intl-tel-input 25.0.2 → 25.1.1
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 +5 -5
- package/build/js/data.js +34 -16
- package/build/js/data.min.js +2 -2
- package/build/js/intlTelInput.d.ts +3 -3
- package/build/js/intlTelInput.js +54 -58
- package/build/js/intlTelInput.min.js +2 -2
- package/build/js/intlTelInputWithUtils.js +54 -58
- package/build/js/intlTelInputWithUtils.min.js +2 -2
- package/package.json +1 -1
- package/react/README.md +1 -1
- package/react/build/IntlTelInput.cjs +53 -57
- package/react/build/IntlTelInput.d.ts +3 -3
- package/react/build/IntlTelInput.js +53 -57
- package/react/build/IntlTelInputWithUtils.cjs +53 -57
- package/react/build/IntlTelInputWithUtils.js +53 -57
- package/vue/README.md +1 -1
- package/vue/build/IntlTelInput.mjs +366 -344
- package/vue/build/IntlTelInputWithUtils.mjs +674 -652
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { mergeModels as i2, useModel as
|
|
1
|
+
import { mergeModels as i2, useModel as A2, ref as I1, onMounted as E2, watch as D2, onUnmounted as M2, withDirectives as P2, openBlock as x2, createElementBlock as R2, mergeProps as B2, vModelText as k2 } from "vue";
|
|
2
2
|
const r2 = [
|
|
3
3
|
[
|
|
4
4
|
"af",
|
|
@@ -76,7 +76,9 @@ const r2 = [
|
|
|
76
76
|
"au",
|
|
77
77
|
// Australia
|
|
78
78
|
"61",
|
|
79
|
-
0
|
|
79
|
+
0,
|
|
80
|
+
null,
|
|
81
|
+
"0"
|
|
80
82
|
],
|
|
81
83
|
[
|
|
82
84
|
"at",
|
|
@@ -257,14 +259,16 @@ const r2 = [
|
|
|
257
259
|
// Christmas Island
|
|
258
260
|
"61",
|
|
259
261
|
2,
|
|
260
|
-
["89164"]
|
|
262
|
+
["89164"],
|
|
263
|
+
"0"
|
|
261
264
|
],
|
|
262
265
|
[
|
|
263
266
|
"cc",
|
|
264
267
|
// Cocos (Keeling) Islands
|
|
265
268
|
"61",
|
|
266
269
|
1,
|
|
267
|
-
["89162"]
|
|
270
|
+
["89162"],
|
|
271
|
+
"0"
|
|
268
272
|
],
|
|
269
273
|
[
|
|
270
274
|
"co",
|
|
@@ -497,7 +501,8 @@ const r2 = [
|
|
|
497
501
|
// Guernsey
|
|
498
502
|
"44",
|
|
499
503
|
1,
|
|
500
|
-
["1481", "7781", "7839", "7911"]
|
|
504
|
+
["1481", "7781", "7839", "7911"],
|
|
505
|
+
"0"
|
|
501
506
|
],
|
|
502
507
|
[
|
|
503
508
|
"gn",
|
|
@@ -569,7 +574,8 @@ const r2 = [
|
|
|
569
574
|
// Isle of Man
|
|
570
575
|
"44",
|
|
571
576
|
2,
|
|
572
|
-
["1624", "74576", "7524", "7924", "7624"]
|
|
577
|
+
["1624", "74576", "7524", "7924", "7624"],
|
|
578
|
+
"0"
|
|
573
579
|
],
|
|
574
580
|
[
|
|
575
581
|
"il",
|
|
@@ -599,7 +605,8 @@ const r2 = [
|
|
|
599
605
|
// Jersey
|
|
600
606
|
"44",
|
|
601
607
|
3,
|
|
602
|
-
["1534", "7509", "7700", "7797", "7829", "7937"]
|
|
608
|
+
["1534", "7509", "7700", "7797", "7829", "7937"],
|
|
609
|
+
"0"
|
|
603
610
|
],
|
|
604
611
|
[
|
|
605
612
|
"jo",
|
|
@@ -611,7 +618,8 @@ const r2 = [
|
|
|
611
618
|
// Kazakhstan
|
|
612
619
|
"7",
|
|
613
620
|
1,
|
|
614
|
-
["33", "7"]
|
|
621
|
+
["33", "7"],
|
|
622
|
+
"8"
|
|
615
623
|
],
|
|
616
624
|
[
|
|
617
625
|
"ke",
|
|
@@ -743,7 +751,8 @@ const r2 = [
|
|
|
743
751
|
// Mayotte
|
|
744
752
|
"262",
|
|
745
753
|
1,
|
|
746
|
-
["269", "639"]
|
|
754
|
+
["269", "639"],
|
|
755
|
+
"0"
|
|
747
756
|
],
|
|
748
757
|
[
|
|
749
758
|
"mx",
|
|
@@ -786,7 +795,9 @@ const r2 = [
|
|
|
786
795
|
"ma",
|
|
787
796
|
// Morocco
|
|
788
797
|
"212",
|
|
789
|
-
0
|
|
798
|
+
0,
|
|
799
|
+
null,
|
|
800
|
+
"0"
|
|
790
801
|
],
|
|
791
802
|
[
|
|
792
803
|
"mz",
|
|
@@ -947,7 +958,9 @@ const r2 = [
|
|
|
947
958
|
"re",
|
|
948
959
|
// Réunion
|
|
949
960
|
"262",
|
|
950
|
-
0
|
|
961
|
+
0,
|
|
962
|
+
null,
|
|
963
|
+
"0"
|
|
951
964
|
],
|
|
952
965
|
[
|
|
953
966
|
"ro",
|
|
@@ -958,7 +971,9 @@ const r2 = [
|
|
|
958
971
|
"ru",
|
|
959
972
|
// Russia
|
|
960
973
|
"7",
|
|
961
|
-
0
|
|
974
|
+
0,
|
|
975
|
+
null,
|
|
976
|
+
"8"
|
|
962
977
|
],
|
|
963
978
|
[
|
|
964
979
|
"rw",
|
|
@@ -1230,7 +1245,9 @@ const r2 = [
|
|
|
1230
1245
|
"gb",
|
|
1231
1246
|
// United Kingdom
|
|
1232
1247
|
"44",
|
|
1233
|
-
0
|
|
1248
|
+
0,
|
|
1249
|
+
null,
|
|
1250
|
+
"0"
|
|
1234
1251
|
],
|
|
1235
1252
|
[
|
|
1236
1253
|
"us",
|
|
@@ -1287,7 +1304,8 @@ const r2 = [
|
|
|
1287
1304
|
// Western Sahara
|
|
1288
1305
|
"212",
|
|
1289
1306
|
1,
|
|
1290
|
-
["5288", "5289"]
|
|
1307
|
+
["5288", "5289"],
|
|
1308
|
+
"0"
|
|
1291
1309
|
],
|
|
1292
1310
|
[
|
|
1293
1311
|
"ye",
|
|
@@ -1306,16 +1324,16 @@ const r2 = [
|
|
|
1306
1324
|
]
|
|
1307
1325
|
], W = [];
|
|
1308
1326
|
for (let y = 0; y < r2.length; y++) {
|
|
1309
|
-
const
|
|
1327
|
+
const e = r2[y];
|
|
1310
1328
|
W[y] = {
|
|
1311
1329
|
name: "",
|
|
1312
1330
|
// this is now populated in the plugin
|
|
1313
|
-
iso2:
|
|
1314
|
-
dialCode:
|
|
1315
|
-
priority:
|
|
1316
|
-
areaCodes:
|
|
1317
|
-
|
|
1318
|
-
|
|
1331
|
+
iso2: e[0],
|
|
1332
|
+
dialCode: e[1],
|
|
1333
|
+
priority: e[2] || 0,
|
|
1334
|
+
areaCodes: e[3] || null,
|
|
1335
|
+
nodeById: {},
|
|
1336
|
+
nationalPrefix: e[4] || null
|
|
1319
1337
|
};
|
|
1320
1338
|
}
|
|
1321
1339
|
const O2 = {
|
|
@@ -1576,7 +1594,7 @@ const O2 = {
|
|
|
1576
1594
|
for (let y = 0; y < W.length; y++)
|
|
1577
1595
|
W[y].name = u2[W[y].iso2];
|
|
1578
1596
|
let F2 = 0;
|
|
1579
|
-
const
|
|
1597
|
+
const l2 = {
|
|
1580
1598
|
//* Whether or not to allow the dropdown.
|
|
1581
1599
|
allowDropdown: !0,
|
|
1582
1600
|
//* Add a placeholder in the input with an example number for the selected country.
|
|
@@ -1650,45 +1668,45 @@ const a2 = {
|
|
|
1650
1668
|
"888",
|
|
1651
1669
|
"889"
|
|
1652
1670
|
], c1 = (y) => y.replace(/\D/g, ""), s2 = (y = "") => y.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase(), o2 = (y) => {
|
|
1653
|
-
const
|
|
1654
|
-
if (
|
|
1655
|
-
const n =
|
|
1671
|
+
const e = c1(y);
|
|
1672
|
+
if (e.charAt(0) === "1") {
|
|
1673
|
+
const n = e.substr(1, 3);
|
|
1656
1674
|
return U2.indexOf(n) !== -1;
|
|
1657
1675
|
}
|
|
1658
1676
|
return !1;
|
|
1659
|
-
}, V2 = (y,
|
|
1660
|
-
if (n === 0 && !
|
|
1677
|
+
}, V2 = (y, e, n, r) => {
|
|
1678
|
+
if (n === 0 && !r)
|
|
1661
1679
|
return 0;
|
|
1662
1680
|
let o = 0;
|
|
1663
|
-
for (let
|
|
1664
|
-
if (/[+0-9]/.test(
|
|
1665
|
-
return
|
|
1666
|
-
if (
|
|
1667
|
-
return
|
|
1668
|
-
}
|
|
1669
|
-
return
|
|
1670
|
-
},
|
|
1671
|
-
const
|
|
1672
|
-
return
|
|
1673
|
-
}, $1 = (y,
|
|
1681
|
+
for (let a = 0; a < e.length; a++) {
|
|
1682
|
+
if (/[+0-9]/.test(e[a]) && o++, o === y && !r)
|
|
1683
|
+
return a + 1;
|
|
1684
|
+
if (r && o === y + 1)
|
|
1685
|
+
return a;
|
|
1686
|
+
}
|
|
1687
|
+
return e.length;
|
|
1688
|
+
}, T = (y, e, n) => {
|
|
1689
|
+
const r = document.createElement(y);
|
|
1690
|
+
return e && Object.entries(e).forEach(([o, a]) => r.setAttribute(o, a)), n && n.appendChild(r), r;
|
|
1691
|
+
}, $1 = (y, ...e) => {
|
|
1674
1692
|
const { instances: n } = C;
|
|
1675
|
-
Object.values(n).forEach((
|
|
1693
|
+
Object.values(n).forEach((r) => r[y](...e));
|
|
1676
1694
|
};
|
|
1677
1695
|
class K2 {
|
|
1678
|
-
constructor(
|
|
1679
|
-
this.id = F2++, this.telInput =
|
|
1696
|
+
constructor(e, n = {}) {
|
|
1697
|
+
this.id = F2++, this.telInput = e, this.highlightedItem = null, this.options = Object.assign({}, l2, n), this.hadInitialPlaceholder = !!e.getAttribute("placeholder");
|
|
1680
1698
|
}
|
|
1681
1699
|
//* Can't be private as it's called from intlTelInput convenience wrapper.
|
|
1682
1700
|
_init() {
|
|
1683
1701
|
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]");
|
|
1684
|
-
const
|
|
1685
|
-
this.showSelectedCountryOnLeft = this.isRTL ?
|
|
1686
|
-
const n = new Promise((o,
|
|
1687
|
-
this.resolveAutoCountryPromise = o, this.rejectAutoCountryPromise =
|
|
1688
|
-
}),
|
|
1689
|
-
this.resolveUtilsScriptPromise = o, this.rejectUtilsScriptPromise =
|
|
1702
|
+
const e = this.options.allowDropdown || this.options.separateDialCode;
|
|
1703
|
+
this.showSelectedCountryOnLeft = this.isRTL ? !e : e, this.options.separateDialCode && (this.isRTL ? this.originalPaddingRight = this.telInput.style.paddingRight : this.originalPaddingLeft = this.telInput.style.paddingLeft), this.options.i18n = { ...u2, ...this.options.i18n };
|
|
1704
|
+
const n = new Promise((o, a) => {
|
|
1705
|
+
this.resolveAutoCountryPromise = o, this.rejectAutoCountryPromise = a;
|
|
1706
|
+
}), r = new Promise((o, a) => {
|
|
1707
|
+
this.resolveUtilsScriptPromise = o, this.rejectUtilsScriptPromise = a;
|
|
1690
1708
|
});
|
|
1691
|
-
this.promise = Promise.all([n,
|
|
1709
|
+
this.promise = Promise.all([n, r]), this.selectedCountryData = {}, this._processCountryData(), this._generateMarkup(), this._setInitialState(), this._initListeners(), this._initRequests();
|
|
1692
1710
|
}
|
|
1693
1711
|
//********************
|
|
1694
1712
|
//* PRIVATE METHODS
|
|
@@ -1699,99 +1717,99 @@ class K2 {
|
|
|
1699
1717
|
}
|
|
1700
1718
|
//* Sort countries by countryOrder option (if present), then name.
|
|
1701
1719
|
_sortCountries() {
|
|
1702
|
-
this.options.countryOrder && (this.options.countryOrder = this.options.countryOrder.map((
|
|
1703
|
-
const { countryOrder:
|
|
1704
|
-
if (
|
|
1705
|
-
const o =
|
|
1706
|
-
if (c ||
|
|
1707
|
-
return c &&
|
|
1720
|
+
this.options.countryOrder && (this.options.countryOrder = this.options.countryOrder.map((e) => e.toLowerCase())), this.countries.sort((e, n) => {
|
|
1721
|
+
const { countryOrder: r } = this.options;
|
|
1722
|
+
if (r) {
|
|
1723
|
+
const o = r.indexOf(e.iso2), a = r.indexOf(n.iso2), c = o > -1, g = a > -1;
|
|
1724
|
+
if (c || g)
|
|
1725
|
+
return c && g ? o - a : c ? -1 : 1;
|
|
1708
1726
|
}
|
|
1709
|
-
return
|
|
1727
|
+
return e.name.localeCompare(n.name);
|
|
1710
1728
|
});
|
|
1711
1729
|
}
|
|
1712
1730
|
//* Add a dial code to this.dialCodeToIso2Map.
|
|
1713
|
-
_addToDialCodeMap(
|
|
1731
|
+
_addToDialCodeMap(e, n, r) {
|
|
1714
1732
|
n.length > this.dialCodeMaxLen && (this.dialCodeMaxLen = n.length), this.dialCodeToIso2Map.hasOwnProperty(n) || (this.dialCodeToIso2Map[n] = []);
|
|
1715
|
-
for (let
|
|
1716
|
-
if (this.dialCodeToIso2Map[n][
|
|
1733
|
+
for (let a = 0; a < this.dialCodeToIso2Map[n].length; a++)
|
|
1734
|
+
if (this.dialCodeToIso2Map[n][a] === e)
|
|
1717
1735
|
return;
|
|
1718
|
-
const o =
|
|
1719
|
-
this.dialCodeToIso2Map[n][o] =
|
|
1736
|
+
const o = r !== void 0 ? r : this.dialCodeToIso2Map[n].length;
|
|
1737
|
+
this.dialCodeToIso2Map[n][o] = e;
|
|
1720
1738
|
}
|
|
1721
1739
|
//* Process onlyCountries or excludeCountries array if present.
|
|
1722
1740
|
_processAllCountries() {
|
|
1723
|
-
const { onlyCountries:
|
|
1724
|
-
if (
|
|
1725
|
-
const
|
|
1741
|
+
const { onlyCountries: e, excludeCountries: n } = this.options;
|
|
1742
|
+
if (e.length) {
|
|
1743
|
+
const r = e.map(
|
|
1726
1744
|
(o) => o.toLowerCase()
|
|
1727
1745
|
);
|
|
1728
1746
|
this.countries = W.filter(
|
|
1729
|
-
(o) =>
|
|
1747
|
+
(o) => r.indexOf(o.iso2) > -1
|
|
1730
1748
|
);
|
|
1731
1749
|
} else if (n.length) {
|
|
1732
|
-
const
|
|
1750
|
+
const r = n.map(
|
|
1733
1751
|
(o) => o.toLowerCase()
|
|
1734
1752
|
);
|
|
1735
1753
|
this.countries = W.filter(
|
|
1736
|
-
(o) =>
|
|
1754
|
+
(o) => r.indexOf(o.iso2) === -1
|
|
1737
1755
|
);
|
|
1738
1756
|
} else
|
|
1739
1757
|
this.countries = W;
|
|
1740
1758
|
}
|
|
1741
1759
|
//* Translate Countries by object literal provided on config.
|
|
1742
1760
|
_translateCountryNames() {
|
|
1743
|
-
for (let
|
|
1744
|
-
const n = this.countries[
|
|
1745
|
-
this.options.i18n.hasOwnProperty(n) && (this.countries[
|
|
1761
|
+
for (let e = 0; e < this.countries.length; e++) {
|
|
1762
|
+
const n = this.countries[e].iso2.toLowerCase();
|
|
1763
|
+
this.options.i18n.hasOwnProperty(n) && (this.countries[e].name = this.options.i18n[n]);
|
|
1746
1764
|
}
|
|
1747
1765
|
}
|
|
1748
|
-
//* Generate this.dialCodes and this.dialCodeToIso2Map
|
|
1766
|
+
//* Generate this.dialCodes and this.dialCodeToIso2Map.
|
|
1749
1767
|
_processDialCodes() {
|
|
1750
1768
|
this.dialCodes = {}, this.dialCodeMaxLen = 0, this.dialCodeToIso2Map = {};
|
|
1751
|
-
for (let
|
|
1752
|
-
const n = this.countries[
|
|
1769
|
+
for (let e = 0; e < this.countries.length; e++) {
|
|
1770
|
+
const n = this.countries[e];
|
|
1753
1771
|
this.dialCodes[n.dialCode] || (this.dialCodes[n.dialCode] = !0), this._addToDialCodeMap(n.iso2, n.dialCode, n.priority);
|
|
1754
1772
|
}
|
|
1755
|
-
for (let
|
|
1756
|
-
const n = this.countries[
|
|
1773
|
+
for (let e = 0; e < this.countries.length; e++) {
|
|
1774
|
+
const n = this.countries[e];
|
|
1757
1775
|
if (n.areaCodes) {
|
|
1758
|
-
const
|
|
1776
|
+
const r = this.dialCodeToIso2Map[n.dialCode][0];
|
|
1759
1777
|
for (let o = 0; o < n.areaCodes.length; o++) {
|
|
1760
|
-
const
|
|
1761
|
-
for (let c = 1; c <
|
|
1762
|
-
const
|
|
1763
|
-
this._addToDialCodeMap(
|
|
1778
|
+
const a = n.areaCodes[o];
|
|
1779
|
+
for (let c = 1; c < a.length; c++) {
|
|
1780
|
+
const g = a.substr(0, c), f = n.dialCode + g;
|
|
1781
|
+
this._addToDialCodeMap(r, f), this._addToDialCodeMap(n.iso2, f);
|
|
1764
1782
|
}
|
|
1765
|
-
this._addToDialCodeMap(n.iso2, n.dialCode +
|
|
1783
|
+
this._addToDialCodeMap(n.iso2, n.dialCode + a);
|
|
1766
1784
|
}
|
|
1767
1785
|
}
|
|
1768
1786
|
}
|
|
1769
1787
|
}
|
|
1770
1788
|
//* Generate all of the markup for the plugin: the selected country overlay, and the dropdown.
|
|
1771
1789
|
_generateMarkup() {
|
|
1772
|
-
var
|
|
1790
|
+
var I, A, G;
|
|
1773
1791
|
this.telInput.classList.add("iti__tel-input"), !this.telInput.hasAttribute("autocomplete") && !(this.telInput.form && this.telInput.form.hasAttribute("autocomplete")) && this.telInput.setAttribute("autocomplete", "off");
|
|
1774
1792
|
const {
|
|
1775
|
-
allowDropdown:
|
|
1793
|
+
allowDropdown: e,
|
|
1776
1794
|
separateDialCode: n,
|
|
1777
|
-
showFlags:
|
|
1795
|
+
showFlags: r,
|
|
1778
1796
|
containerClass: o,
|
|
1779
|
-
hiddenInput:
|
|
1797
|
+
hiddenInput: a,
|
|
1780
1798
|
dropdownContainer: c,
|
|
1781
|
-
fixDropdownWidth:
|
|
1782
|
-
useFullscreenPopup:
|
|
1783
|
-
countrySearch:
|
|
1784
|
-
i18n:
|
|
1799
|
+
fixDropdownWidth: g,
|
|
1800
|
+
useFullscreenPopup: f,
|
|
1801
|
+
countrySearch: S,
|
|
1802
|
+
i18n: _
|
|
1785
1803
|
} = this.options;
|
|
1786
|
-
let
|
|
1787
|
-
|
|
1788
|
-
const
|
|
1789
|
-
if ((
|
|
1790
|
-
this.countryContainer =
|
|
1804
|
+
let b = "iti";
|
|
1805
|
+
e && (b += " iti--allow-dropdown"), r && (b += " iti--show-flags"), o && (b += ` ${o}`), f || (b += " iti--inline-dropdown");
|
|
1806
|
+
const w = T("div", { class: b });
|
|
1807
|
+
if ((I = this.telInput.parentNode) == null || I.insertBefore(w, this.telInput), e || r || n) {
|
|
1808
|
+
this.countryContainer = T(
|
|
1791
1809
|
"div",
|
|
1792
1810
|
{ class: "iti__country-container" },
|
|
1793
|
-
|
|
1794
|
-
), this.showSelectedCountryOnLeft ? this.countryContainer.style.left = "0px" : this.countryContainer.style.right = "0px",
|
|
1811
|
+
w
|
|
1812
|
+
), this.showSelectedCountryOnLeft ? this.countryContainer.style.left = "0px" : this.countryContainer.style.right = "0px", e ? (this.selectedCountry = T(
|
|
1795
1813
|
"button",
|
|
1796
1814
|
{
|
|
1797
1815
|
type: "button",
|
|
@@ -1803,89 +1821,89 @@ class K2 {
|
|
|
1803
1821
|
role: "combobox"
|
|
1804
1822
|
},
|
|
1805
1823
|
this.countryContainer
|
|
1806
|
-
), this.telInput.disabled && this.selectedCountry.setAttribute("disabled", "true")) : this.selectedCountry =
|
|
1824
|
+
), this.telInput.disabled && this.selectedCountry.setAttribute("disabled", "true")) : this.selectedCountry = T(
|
|
1807
1825
|
"div",
|
|
1808
1826
|
{ class: "iti__selected-country" },
|
|
1809
1827
|
this.countryContainer
|
|
1810
1828
|
);
|
|
1811
|
-
const F =
|
|
1812
|
-
if (this.selectedCountryInner =
|
|
1829
|
+
const F = T("div", { class: "iti__selected-country-primary" }, this.selectedCountry);
|
|
1830
|
+
if (this.selectedCountryInner = T("div", { class: "iti__flag" }, F), this.selectedCountryA11yText = T(
|
|
1813
1831
|
"span",
|
|
1814
1832
|
{ class: "iti__a11y-text" },
|
|
1815
1833
|
this.selectedCountryInner
|
|
1816
|
-
),
|
|
1834
|
+
), e && (this.dropdownArrow = T(
|
|
1817
1835
|
"div",
|
|
1818
1836
|
{ class: "iti__arrow", "aria-hidden": "true" },
|
|
1819
1837
|
F
|
|
1820
|
-
)), n && (this.selectedDialCode =
|
|
1838
|
+
)), n && (this.selectedDialCode = T(
|
|
1821
1839
|
"div",
|
|
1822
1840
|
{ class: "iti__selected-dial-code" },
|
|
1823
1841
|
this.selectedCountry
|
|
1824
|
-
)),
|
|
1825
|
-
const M =
|
|
1826
|
-
if (this.dropdownContent =
|
|
1842
|
+
)), e) {
|
|
1843
|
+
const M = g ? "" : "iti--flexible-dropdown-width";
|
|
1844
|
+
if (this.dropdownContent = T("div", {
|
|
1827
1845
|
id: `iti-${this.id}__dropdown-content`,
|
|
1828
1846
|
class: `iti__dropdown-content iti__hide ${M}`
|
|
1829
|
-
}),
|
|
1847
|
+
}), S && (this.searchInput = T(
|
|
1830
1848
|
"input",
|
|
1831
1849
|
{
|
|
1832
1850
|
type: "text",
|
|
1833
1851
|
class: "iti__search-input",
|
|
1834
|
-
placeholder:
|
|
1852
|
+
placeholder: _.searchPlaceholder,
|
|
1835
1853
|
role: "combobox",
|
|
1836
1854
|
"aria-expanded": "true",
|
|
1837
|
-
"aria-label":
|
|
1855
|
+
"aria-label": _.searchPlaceholder,
|
|
1838
1856
|
"aria-controls": `iti-${this.id}__country-listbox`,
|
|
1839
1857
|
"aria-autocomplete": "list",
|
|
1840
1858
|
autocomplete: "off"
|
|
1841
1859
|
},
|
|
1842
1860
|
this.dropdownContent
|
|
1843
|
-
), this.searchResultsA11yText =
|
|
1861
|
+
), this.searchResultsA11yText = T(
|
|
1844
1862
|
"span",
|
|
1845
1863
|
{ class: "iti__a11y-text" },
|
|
1846
1864
|
this.dropdownContent
|
|
1847
|
-
)), this.countryList =
|
|
1865
|
+
)), this.countryList = T(
|
|
1848
1866
|
"ul",
|
|
1849
1867
|
{
|
|
1850
1868
|
class: "iti__country-list",
|
|
1851
1869
|
id: `iti-${this.id}__country-listbox`,
|
|
1852
1870
|
role: "listbox",
|
|
1853
|
-
"aria-label":
|
|
1871
|
+
"aria-label": _.countryListAriaLabel
|
|
1854
1872
|
},
|
|
1855
1873
|
this.dropdownContent
|
|
1856
|
-
), this._appendListItems(),
|
|
1874
|
+
), this._appendListItems(), S && this._updateSearchResultsText(), c) {
|
|
1857
1875
|
let x = "iti iti--container";
|
|
1858
|
-
|
|
1876
|
+
f ? x += " iti--fullscreen-popup" : x += " iti--inline-dropdown", this.dropdown = T("div", { class: x }), this.dropdown.appendChild(this.dropdownContent);
|
|
1859
1877
|
} else
|
|
1860
1878
|
this.countryContainer.appendChild(this.dropdownContent);
|
|
1861
1879
|
}
|
|
1862
1880
|
}
|
|
1863
|
-
if (
|
|
1864
|
-
const F = this.telInput.getAttribute("name") || "", M =
|
|
1881
|
+
if (w.appendChild(this.telInput), this._updateInputPadding(), a) {
|
|
1882
|
+
const F = this.telInput.getAttribute("name") || "", M = a(F);
|
|
1865
1883
|
if (M.phone) {
|
|
1866
|
-
const x = (
|
|
1867
|
-
x ? this.hiddenInput = x : (this.hiddenInput =
|
|
1884
|
+
const x = (A = this.telInput.form) == null ? void 0 : A.querySelector(`input[name="${M.phone}"]`);
|
|
1885
|
+
x ? this.hiddenInput = x : (this.hiddenInput = T("input", {
|
|
1868
1886
|
type: "hidden",
|
|
1869
1887
|
name: M.phone
|
|
1870
|
-
}),
|
|
1888
|
+
}), w.appendChild(this.hiddenInput));
|
|
1871
1889
|
}
|
|
1872
1890
|
if (M.country) {
|
|
1873
1891
|
const x = (G = this.telInput.form) == null ? void 0 : G.querySelector(`input[name="${M.country}"]`);
|
|
1874
|
-
x ? this.hiddenInputCountry = x : (this.hiddenInputCountry =
|
|
1892
|
+
x ? this.hiddenInputCountry = x : (this.hiddenInputCountry = T("input", {
|
|
1875
1893
|
type: "hidden",
|
|
1876
1894
|
name: M.country
|
|
1877
|
-
}),
|
|
1895
|
+
}), w.appendChild(this.hiddenInputCountry));
|
|
1878
1896
|
}
|
|
1879
1897
|
}
|
|
1880
1898
|
}
|
|
1881
1899
|
//* For each country: add a country list item <li> to the countryList <ul> container.
|
|
1882
1900
|
_appendListItems() {
|
|
1883
|
-
for (let
|
|
1884
|
-
const n = this.countries[
|
|
1901
|
+
for (let e = 0; e < this.countries.length; e++) {
|
|
1902
|
+
const n = this.countries[e], r = e === 0 ? "iti__highlight" : "", o = T(
|
|
1885
1903
|
"li",
|
|
1886
1904
|
{
|
|
1887
1905
|
id: `iti-${this.id}__item-${n.iso2}`,
|
|
1888
|
-
class: `iti__country ${
|
|
1906
|
+
class: `iti__country ${r}`,
|
|
1889
1907
|
tabindex: "-1",
|
|
1890
1908
|
role: "option",
|
|
1891
1909
|
"data-dial-code": n.dialCode,
|
|
@@ -1895,22 +1913,22 @@ class K2 {
|
|
|
1895
1913
|
this.countryList
|
|
1896
1914
|
);
|
|
1897
1915
|
n.nodeById[this.id] = o;
|
|
1898
|
-
let
|
|
1899
|
-
this.options.showFlags && (
|
|
1916
|
+
let a = "";
|
|
1917
|
+
this.options.showFlags && (a += `<div class='iti__flag iti__${n.iso2}'></div>`), a += `<span class='iti__country-name'>${n.name}</span>`, a += `<span class='iti__dial-code'>+${n.dialCode}</span>`, o.insertAdjacentHTML("beforeend", a);
|
|
1900
1918
|
}
|
|
1901
1919
|
}
|
|
1902
1920
|
//* Set the initial state of the input value and the selected country by:
|
|
1903
1921
|
//* 1. Extracting a dial code from the given number
|
|
1904
1922
|
//* 2. Using explicit initialCountry
|
|
1905
|
-
_setInitialState(
|
|
1906
|
-
const n = this.telInput.getAttribute("value"),
|
|
1907
|
-
if (c && !
|
|
1908
|
-
this._updateCountryFromNumber(
|
|
1909
|
-
else if (!
|
|
1910
|
-
const
|
|
1911
|
-
|
|
1923
|
+
_setInitialState(e = !1) {
|
|
1924
|
+
const n = this.telInput.getAttribute("value"), r = this.telInput.value, a = n && n.charAt(0) === "+" && (!r || r.charAt(0) !== "+") ? n : r, c = this._getDialCode(a), g = o2(a), { initialCountry: f, geoIpLookup: S } = this.options, _ = f === "auto" && S;
|
|
1925
|
+
if (c && !g)
|
|
1926
|
+
this._updateCountryFromNumber(a);
|
|
1927
|
+
else if (!_ || e) {
|
|
1928
|
+
const b = f ? f.toLowerCase() : "";
|
|
1929
|
+
b && this._getCountryData(b, !0) ? this._setCountry(b) : c && g ? this._setCountry("us") : this._setCountry();
|
|
1912
1930
|
}
|
|
1913
|
-
|
|
1931
|
+
a && this._updateValFromNumber(a);
|
|
1914
1932
|
}
|
|
1915
1933
|
//* Initialise the main event listeners: input keyup, and click selected country.
|
|
1916
1934
|
_initListeners() {
|
|
@@ -1918,10 +1936,10 @@ class K2 {
|
|
|
1918
1936
|
}
|
|
1919
1937
|
//* Update hidden input on form submit.
|
|
1920
1938
|
_initHiddenInputListener() {
|
|
1921
|
-
var
|
|
1939
|
+
var e;
|
|
1922
1940
|
this._handleHiddenInputSubmit = () => {
|
|
1923
1941
|
this.hiddenInput && (this.hiddenInput.value = this.getNumber()), this.hiddenInputCountry && (this.hiddenInputCountry.value = this.getSelectedCountryData().iso2 || "");
|
|
1924
|
-
}, (
|
|
1942
|
+
}, (e = this.telInput.form) == null || e.addEventListener(
|
|
1925
1943
|
"submit",
|
|
1926
1944
|
this._handleHiddenInputSubmit
|
|
1927
1945
|
);
|
|
@@ -1931,8 +1949,8 @@ class K2 {
|
|
|
1931
1949
|
this._handleLabelClick = (n) => {
|
|
1932
1950
|
this.dropdownContent.classList.contains("iti__hide") ? this.telInput.focus() : n.preventDefault();
|
|
1933
1951
|
};
|
|
1934
|
-
const
|
|
1935
|
-
|
|
1952
|
+
const e = this.telInput.closest("label");
|
|
1953
|
+
e && e.addEventListener("click", this._handleLabelClick), this._handleClickSelectedCountry = () => {
|
|
1936
1954
|
this.dropdownContent.classList.contains("iti__hide") && !this.telInput.disabled && !this.telInput.readOnly && this._openDropdown();
|
|
1937
1955
|
}, this.selectedCountry.addEventListener("click", this._handleClickSelectedCountry), this._handleCountryContainerKeydown = (n) => {
|
|
1938
1956
|
this.dropdownContent.classList.contains("iti__hide") && ["ArrowUp", "ArrowDown", " ", "Enter"].includes(n.key) && (n.preventDefault(), n.stopPropagation(), this._openDropdown()), n.key === "Tab" && this._closeDropdown();
|
|
@@ -1943,18 +1961,18 @@ class K2 {
|
|
|
1943
1961
|
}
|
|
1944
1962
|
//* Init many requests: utils script / geo ip lookup.
|
|
1945
1963
|
_initRequests() {
|
|
1946
|
-
let { loadUtils:
|
|
1947
|
-
|
|
1948
|
-
var
|
|
1949
|
-
window.removeEventListener("load", this._handlePageLoad), (
|
|
1964
|
+
let { loadUtils: e, initialCountry: n, geoIpLookup: r } = this.options;
|
|
1965
|
+
e && !C.utils ? (this._handlePageLoad = () => {
|
|
1966
|
+
var a;
|
|
1967
|
+
window.removeEventListener("load", this._handlePageLoad), (a = C.attachUtils(e)) == null || a.catch(() => {
|
|
1950
1968
|
});
|
|
1951
|
-
}, C.documentReady() ? this._handlePageLoad() : window.addEventListener("load", this._handlePageLoad)) : this.resolveUtilsScriptPromise(), n === "auto" &&
|
|
1969
|
+
}, C.documentReady() ? this._handlePageLoad() : window.addEventListener("load", this._handlePageLoad)) : this.resolveUtilsScriptPromise(), n === "auto" && r && !this.selectedCountryData.iso2 ? this._loadAutoCountry() : this.resolveAutoCountryPromise();
|
|
1952
1970
|
}
|
|
1953
1971
|
//* Perform the geo ip lookup.
|
|
1954
1972
|
_loadAutoCountry() {
|
|
1955
1973
|
C.autoCountry ? this.handleAutoCountry() : C.startedLoadingAutoCountry || (C.startedLoadingAutoCountry = !0, typeof this.options.geoIpLookup == "function" && this.options.geoIpLookup(
|
|
1956
|
-
(
|
|
1957
|
-
const n =
|
|
1974
|
+
(e = "") => {
|
|
1975
|
+
const n = e.toLowerCase();
|
|
1958
1976
|
n && this._getCountryData(n, !0) ? (C.autoCountry = n, setTimeout(() => $1("handleAutoCountry"))) : (this._setInitialState(!0), $1("rejectAutoCountryPromise"));
|
|
1959
1977
|
},
|
|
1960
1978
|
() => {
|
|
@@ -1967,94 +1985,94 @@ class K2 {
|
|
|
1967
1985
|
}
|
|
1968
1986
|
//* Initialize the tel input listeners.
|
|
1969
1987
|
_initTelInputListeners() {
|
|
1970
|
-
const { strictMode:
|
|
1971
|
-
let
|
|
1972
|
-
new RegExp("\\p{L}", "u").test(this.telInput.value) && (
|
|
1973
|
-
if (this.isAndroid && (
|
|
1974
|
-
const
|
|
1975
|
-
this.telInput.value =
|
|
1988
|
+
const { strictMode: e, formatAsYouType: n, separateDialCode: r, formatOnDisplay: o, allowDropdown: a, countrySearch: c } = this.options;
|
|
1989
|
+
let g = !1;
|
|
1990
|
+
new RegExp("\\p{L}", "u").test(this.telInput.value) && (g = !0), this._handleInputEvent = (f) => {
|
|
1991
|
+
if (this.isAndroid && (f == null ? void 0 : f.data) === "+" && r && a && c) {
|
|
1992
|
+
const w = this.telInput.selectionStart || 0, I = this.telInput.value.substring(0, w - 1), A = this.telInput.value.substring(w);
|
|
1993
|
+
this.telInput.value = I + A, this._openDropdownWithPlus();
|
|
1976
1994
|
return;
|
|
1977
1995
|
}
|
|
1978
1996
|
this._updateCountryFromNumber(this.telInput.value) && this._triggerCountryChange();
|
|
1979
|
-
const
|
|
1980
|
-
|
|
1981
|
-
const
|
|
1982
|
-
if (n && !
|
|
1983
|
-
const
|
|
1997
|
+
const S = (f == null ? void 0 : f.data) && /[^+0-9]/.test(f.data), _ = (f == null ? void 0 : f.inputType) === "insertFromPaste" && this.telInput.value;
|
|
1998
|
+
S || _ && !e ? g = !0 : /[^+0-9]/.test(this.telInput.value) || (g = !1);
|
|
1999
|
+
const b = (f == null ? void 0 : f.detail) && f.detail.isSetNumber && !o;
|
|
2000
|
+
if (n && !g && !b) {
|
|
2001
|
+
const w = this.telInput.selectionStart || 0, A = this.telInput.value.substring(0, w).replace(/[^+0-9]/g, "").length, G = (f == null ? void 0 : f.inputType) === "deleteContentForward", F = this._formatNumberAsYouType(), M = V2(A, F, w, G);
|
|
1984
2002
|
this.telInput.value = F, this.telInput.setSelectionRange(M, M);
|
|
1985
2003
|
}
|
|
1986
|
-
}, this.telInput.addEventListener("input", this._handleInputEvent), (
|
|
1987
|
-
if (
|
|
1988
|
-
if (
|
|
1989
|
-
|
|
2004
|
+
}, this.telInput.addEventListener("input", this._handleInputEvent), (e || r) && (this._handleKeydownEvent = (f) => {
|
|
2005
|
+
if (f.key && f.key.length === 1 && !f.altKey && !f.ctrlKey && !f.metaKey) {
|
|
2006
|
+
if (r && a && c && f.key === "+") {
|
|
2007
|
+
f.preventDefault(), this._openDropdownWithPlus();
|
|
1990
2008
|
return;
|
|
1991
2009
|
}
|
|
1992
|
-
if (
|
|
1993
|
-
const
|
|
2010
|
+
if (e) {
|
|
2011
|
+
const S = this.telInput.value, _ = S.charAt(0) === "+", b = !_ && this.telInput.selectionStart === 0 && f.key === "+", w = /^[0-9]$/.test(f.key), I = r ? w : b || w, A = S.slice(0, this.telInput.selectionStart) + f.key + S.slice(this.telInput.selectionEnd), G = this._getFullNumber(A), F = C.utils.getCoreNumber(G, this.selectedCountryData.iso2), M = this.maxCoreNumberLength && F.length > this.maxCoreNumberLength;
|
|
1994
2012
|
let x = !1;
|
|
1995
|
-
if (
|
|
2013
|
+
if (_) {
|
|
1996
2014
|
const f1 = this.selectedCountryData.iso2;
|
|
1997
2015
|
x = this._getCountryFromNumber(G) !== f1;
|
|
1998
2016
|
}
|
|
1999
|
-
(!
|
|
2017
|
+
(!I || M && !x && !b) && f.preventDefault();
|
|
2000
2018
|
}
|
|
2001
2019
|
}
|
|
2002
2020
|
}, this.telInput.addEventListener("keydown", this._handleKeydownEvent));
|
|
2003
2021
|
}
|
|
2004
2022
|
//* Adhere to the input's maxlength attr.
|
|
2005
|
-
_cap(
|
|
2023
|
+
_cap(e) {
|
|
2006
2024
|
const n = parseInt(this.telInput.getAttribute("maxlength") || "", 10);
|
|
2007
|
-
return n &&
|
|
2025
|
+
return n && e.length > n ? e.substr(0, n) : e;
|
|
2008
2026
|
}
|
|
2009
2027
|
//* Trigger a custom event on the input.
|
|
2010
|
-
_trigger(
|
|
2011
|
-
const
|
|
2028
|
+
_trigger(e, n = {}) {
|
|
2029
|
+
const r = new CustomEvent(e, {
|
|
2012
2030
|
bubbles: !0,
|
|
2013
2031
|
cancelable: !0,
|
|
2014
2032
|
detail: n
|
|
2015
2033
|
});
|
|
2016
|
-
this.telInput.dispatchEvent(
|
|
2034
|
+
this.telInput.dispatchEvent(r);
|
|
2017
2035
|
}
|
|
2018
2036
|
//* Open the dropdown.
|
|
2019
2037
|
_openDropdown() {
|
|
2020
|
-
const { fixDropdownWidth:
|
|
2021
|
-
if (
|
|
2022
|
-
const
|
|
2023
|
-
|
|
2038
|
+
const { fixDropdownWidth: e, countrySearch: n } = this.options;
|
|
2039
|
+
if (e && (this.dropdownContent.style.width = `${this.telInput.offsetWidth}px`), this.dropdownContent.classList.remove("iti__hide"), this.selectedCountry.setAttribute("aria-expanded", "true"), this._setDropdownPosition(), n) {
|
|
2040
|
+
const r = this.countryList.firstElementChild;
|
|
2041
|
+
r && (this._highlightListItem(r, !1), this.countryList.scrollTop = 0), this.searchInput.focus();
|
|
2024
2042
|
}
|
|
2025
2043
|
this._bindDropdownListeners(), this.dropdownArrow.classList.add("iti__arrow--up"), this._trigger("open:countrydropdown");
|
|
2026
2044
|
}
|
|
2027
2045
|
//* Set the dropdown position
|
|
2028
2046
|
_setDropdownPosition() {
|
|
2029
2047
|
if (this.options.dropdownContainer && this.options.dropdownContainer.appendChild(this.dropdown), !this.options.useFullscreenPopup) {
|
|
2030
|
-
const
|
|
2031
|
-
this.options.dropdownContainer && (this.dropdown.style.top = `${
|
|
2048
|
+
const e = this.telInput.getBoundingClientRect(), n = this.telInput.offsetHeight;
|
|
2049
|
+
this.options.dropdownContainer && (this.dropdown.style.top = `${e.top + n}px`, this.dropdown.style.left = `${e.left}px`, this._handleWindowScroll = () => this._closeDropdown(), window.addEventListener("scroll", this._handleWindowScroll));
|
|
2032
2050
|
}
|
|
2033
2051
|
}
|
|
2034
2052
|
//* We only bind dropdown listeners when the dropdown is open.
|
|
2035
2053
|
_bindDropdownListeners() {
|
|
2036
2054
|
this._handleMouseoverCountryList = (o) => {
|
|
2037
2055
|
var c;
|
|
2038
|
-
const
|
|
2039
|
-
|
|
2056
|
+
const a = (c = o.target) == null ? void 0 : c.closest(".iti__country");
|
|
2057
|
+
a && this._highlightListItem(a, !1);
|
|
2040
2058
|
}, this.countryList.addEventListener(
|
|
2041
2059
|
"mouseover",
|
|
2042
2060
|
this._handleMouseoverCountryList
|
|
2043
2061
|
), this._handleClickCountryList = (o) => {
|
|
2044
2062
|
var c;
|
|
2045
|
-
const
|
|
2046
|
-
|
|
2063
|
+
const a = (c = o.target) == null ? void 0 : c.closest(".iti__country");
|
|
2064
|
+
a && this._selectListItem(a);
|
|
2047
2065
|
}, this.countryList.addEventListener("click", this._handleClickCountryList);
|
|
2048
|
-
let
|
|
2066
|
+
let e = !0;
|
|
2049
2067
|
this._handleClickOffToClose = () => {
|
|
2050
|
-
|
|
2068
|
+
e || this._closeDropdown(), e = !1;
|
|
2051
2069
|
}, document.documentElement.addEventListener(
|
|
2052
2070
|
"click",
|
|
2053
2071
|
this._handleClickOffToClose
|
|
2054
2072
|
);
|
|
2055
|
-
let n = "",
|
|
2073
|
+
let n = "", r = null;
|
|
2056
2074
|
if (this._handleKeydownOnDropdown = (o) => {
|
|
2057
|
-
["ArrowUp", "ArrowDown", "Enter", "Escape"].includes(o.key) && (o.preventDefault(), o.stopPropagation(), o.key === "ArrowUp" || o.key === "ArrowDown" ? this._handleUpDownKey(o.key) : o.key === "Enter" ? this._handleEnterKey() : o.key === "Escape" && this._closeDropdown()), !this.options.countrySearch && /^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(o.key) && (o.stopPropagation(),
|
|
2075
|
+
["ArrowUp", "ArrowDown", "Enter", "Escape"].includes(o.key) && (o.preventDefault(), o.stopPropagation(), o.key === "ArrowUp" || o.key === "ArrowDown" ? this._handleUpDownKey(o.key) : o.key === "Enter" ? this._handleEnterKey() : o.key === "Escape" && this._closeDropdown()), !this.options.countrySearch && /^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(o.key) && (o.stopPropagation(), r && clearTimeout(r), n += o.key.toLowerCase(), this._searchForCountry(n), r = setTimeout(() => {
|
|
2058
2076
|
n = "";
|
|
2059
2077
|
}, 1e3));
|
|
2060
2078
|
}, document.addEventListener("keydown", this._handleKeydownOnDropdown), this.options.countrySearch) {
|
|
@@ -2062,50 +2080,50 @@ class K2 {
|
|
|
2062
2080
|
const c = this.searchInput.value.trim();
|
|
2063
2081
|
c ? this._filterCountries(c) : this._filterCountries("", !0);
|
|
2064
2082
|
};
|
|
2065
|
-
let
|
|
2083
|
+
let a = null;
|
|
2066
2084
|
this._handleSearchChange = () => {
|
|
2067
|
-
|
|
2068
|
-
o(),
|
|
2085
|
+
a && clearTimeout(a), a = setTimeout(() => {
|
|
2086
|
+
o(), a = null;
|
|
2069
2087
|
}, 100);
|
|
2070
2088
|
}, this.searchInput.addEventListener("input", this._handleSearchChange), this.searchInput.addEventListener("click", (c) => c.stopPropagation());
|
|
2071
2089
|
}
|
|
2072
2090
|
}
|
|
2073
2091
|
//* Hidden search (countrySearch disabled): Find the first list item whose name starts with the query string.
|
|
2074
|
-
_searchForCountry(
|
|
2092
|
+
_searchForCountry(e) {
|
|
2075
2093
|
for (let n = 0; n < this.countries.length; n++) {
|
|
2076
|
-
const
|
|
2077
|
-
if (
|
|
2078
|
-
const
|
|
2079
|
-
this._highlightListItem(
|
|
2094
|
+
const r = this.countries[n];
|
|
2095
|
+
if (r.name.substr(0, e.length).toLowerCase() === e) {
|
|
2096
|
+
const a = r.nodeById[this.id];
|
|
2097
|
+
this._highlightListItem(a, !1), this._scrollTo(a);
|
|
2080
2098
|
break;
|
|
2081
2099
|
}
|
|
2082
2100
|
}
|
|
2083
2101
|
}
|
|
2084
2102
|
//* Country search enabled: Filter the countries according to the search query.
|
|
2085
|
-
_filterCountries(
|
|
2086
|
-
let
|
|
2103
|
+
_filterCountries(e, n = !1) {
|
|
2104
|
+
let r = !0;
|
|
2087
2105
|
this.countryList.innerHTML = "";
|
|
2088
|
-
const o = s2(
|
|
2089
|
-
for (let
|
|
2090
|
-
const c = this.countries[
|
|
2091
|
-
if (n ||
|
|
2092
|
-
const
|
|
2093
|
-
|
|
2106
|
+
const o = s2(e);
|
|
2107
|
+
for (let a = 0; a < this.countries.length; a++) {
|
|
2108
|
+
const c = this.countries[a], g = s2(c.name), f = c.name.split(/[^a-zA-ZÀ-ÿа-яА-Я]/).map((_) => _[0]).join("").toLowerCase(), S = `+${c.dialCode}`;
|
|
2109
|
+
if (n || g.includes(o) || S.includes(o) || c.iso2.includes(o) || f.includes(o)) {
|
|
2110
|
+
const _ = c.nodeById[this.id];
|
|
2111
|
+
_ && this.countryList.appendChild(_), r && (this._highlightListItem(_, !1), r = !1);
|
|
2094
2112
|
}
|
|
2095
2113
|
}
|
|
2096
|
-
|
|
2114
|
+
r && this._highlightListItem(null, !1), this.countryList.scrollTop = 0, this._updateSearchResultsText();
|
|
2097
2115
|
}
|
|
2098
2116
|
//* Update search results text (for a11y).
|
|
2099
2117
|
_updateSearchResultsText() {
|
|
2100
|
-
const { i18n:
|
|
2101
|
-
let
|
|
2102
|
-
n === 0 ?
|
|
2118
|
+
const { i18n: e } = this.options, n = this.countryList.childElementCount;
|
|
2119
|
+
let r;
|
|
2120
|
+
n === 0 ? r = e.zeroSearchResults : n === 1 ? r = e.oneSearchResult : r = e.multipleSearchResults.replace("${count}", n.toString()), this.searchResultsA11yText.textContent = r;
|
|
2103
2121
|
}
|
|
2104
2122
|
//* Highlight the next/prev item in the list (and ensure it is visible).
|
|
2105
|
-
_handleUpDownKey(
|
|
2106
|
-
var
|
|
2107
|
-
let n =
|
|
2108
|
-
!n && this.countryList.childElementCount > 1 && (n =
|
|
2123
|
+
_handleUpDownKey(e) {
|
|
2124
|
+
var r, o;
|
|
2125
|
+
let n = e === "ArrowUp" ? (r = this.highlightedItem) == null ? void 0 : r.previousElementSibling : (o = this.highlightedItem) == null ? void 0 : o.nextElementSibling;
|
|
2126
|
+
!n && this.countryList.childElementCount > 1 && (n = e === "ArrowUp" ? this.countryList.lastElementChild : this.countryList.firstElementChild), n && (this._scrollTo(n), this._highlightListItem(n, !1));
|
|
2109
2127
|
}
|
|
2110
2128
|
//* Select the currently highlighted item.
|
|
2111
2129
|
_handleEnterKey() {
|
|
@@ -2113,10 +2131,10 @@ class K2 {
|
|
|
2113
2131
|
}
|
|
2114
2132
|
//* Update the input's value to the given val (format first if possible)
|
|
2115
2133
|
//* NOTE: this is called from _setInitialState, handleUtils and setNumber.
|
|
2116
|
-
_updateValFromNumber(
|
|
2117
|
-
let n =
|
|
2134
|
+
_updateValFromNumber(e) {
|
|
2135
|
+
let n = e;
|
|
2118
2136
|
if (this.options.formatOnDisplay && C.utils && this.selectedCountryData) {
|
|
2119
|
-
const
|
|
2137
|
+
const r = this.options.nationalMode || n.charAt(0) !== "+" && !this.options.separateDialCode, { NATIONAL: o, INTERNATIONAL: a } = C.utils.numberFormat, c = r ? o : a;
|
|
2120
2138
|
n = C.utils.formatNumber(
|
|
2121
2139
|
n,
|
|
2122
2140
|
this.selectedCountryData.iso2,
|
|
@@ -2127,41 +2145,45 @@ class K2 {
|
|
|
2127
2145
|
}
|
|
2128
2146
|
//* Check if need to select a new country based on the given number
|
|
2129
2147
|
//* Note: called from _setInitialState, keyup handler, setNumber.
|
|
2130
|
-
_updateCountryFromNumber(
|
|
2131
|
-
const n = this._getCountryFromNumber(
|
|
2148
|
+
_updateCountryFromNumber(e) {
|
|
2149
|
+
const n = this._getCountryFromNumber(e);
|
|
2132
2150
|
return n !== null ? this._setCountry(n) : !1;
|
|
2133
2151
|
}
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
const
|
|
2143
|
-
|
|
2144
|
-
const
|
|
2152
|
+
_ensureHasDialCode(e) {
|
|
2153
|
+
const { dialCode: n, nationalPrefix: r } = this.selectedCountryData;
|
|
2154
|
+
if (e.charAt(0) === "+" || !n)
|
|
2155
|
+
return e;
|
|
2156
|
+
const c = r && e.charAt(0) === r && !this.options.separateDialCode ? e.substring(1) : e;
|
|
2157
|
+
return `+${n}${c}`;
|
|
2158
|
+
}
|
|
2159
|
+
_getCountryFromNumber(e) {
|
|
2160
|
+
const n = e.indexOf("+");
|
|
2161
|
+
let r = n ? e.substring(n) : e;
|
|
2162
|
+
const o = this.selectedCountryData.iso2, a = this.selectedCountryData.dialCode;
|
|
2163
|
+
r = this._ensureHasDialCode(r);
|
|
2164
|
+
const c = this._getDialCode(r, !0), g = c1(r);
|
|
2145
2165
|
if (c) {
|
|
2146
|
-
const
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2166
|
+
const f = c1(c), S = this.dialCodeToIso2Map[f];
|
|
2167
|
+
if (!o && this.defaultCountry && S.includes(this.defaultCountry))
|
|
2168
|
+
return this.defaultCountry;
|
|
2169
|
+
const _ = o && S.includes(o) && (g.length === f.length || !this.selectedCountryData.areaCodes);
|
|
2170
|
+
if (!(a === "1" && o2(g)) && !_) {
|
|
2171
|
+
for (let w = 0; w < S.length; w++)
|
|
2172
|
+
if (S[w])
|
|
2173
|
+
return S[w];
|
|
2152
2174
|
}
|
|
2153
2175
|
} else {
|
|
2154
|
-
if (
|
|
2176
|
+
if (r.charAt(0) === "+" && g.length)
|
|
2155
2177
|
return "";
|
|
2156
|
-
if ((!
|
|
2178
|
+
if ((!r || r === "+") && !this.selectedCountryData.iso2)
|
|
2157
2179
|
return this.defaultCountry;
|
|
2158
2180
|
}
|
|
2159
2181
|
return null;
|
|
2160
2182
|
}
|
|
2161
2183
|
//* Remove highlighting from other list items and highlight the given item.
|
|
2162
|
-
_highlightListItem(
|
|
2163
|
-
const
|
|
2164
|
-
if (
|
|
2184
|
+
_highlightListItem(e, n) {
|
|
2185
|
+
const r = this.highlightedItem;
|
|
2186
|
+
if (r && (r.classList.remove("iti__highlight"), r.setAttribute("aria-selected", "false")), this.highlightedItem = e, this.highlightedItem) {
|
|
2165
2187
|
this.highlightedItem.classList.add("iti__highlight"), this.highlightedItem.setAttribute("aria-selected", "true");
|
|
2166
2188
|
const o = this.highlightedItem.getAttribute("id") || "";
|
|
2167
2189
|
this.selectedCountry.setAttribute("aria-activedescendant", o), this.options.countrySearch && this.searchInput.setAttribute("aria-activedescendant", o);
|
|
@@ -2170,27 +2192,27 @@ class K2 {
|
|
|
2170
2192
|
}
|
|
2171
2193
|
//* Find the country data for the given iso2 code
|
|
2172
2194
|
//* the ignoreOnlyCountriesOption is only used during init() while parsing the onlyCountries array
|
|
2173
|
-
_getCountryData(
|
|
2174
|
-
for (let
|
|
2175
|
-
if (this.countries[
|
|
2176
|
-
return this.countries[
|
|
2195
|
+
_getCountryData(e, n) {
|
|
2196
|
+
for (let r = 0; r < this.countries.length; r++)
|
|
2197
|
+
if (this.countries[r].iso2 === e)
|
|
2198
|
+
return this.countries[r];
|
|
2177
2199
|
if (n)
|
|
2178
2200
|
return null;
|
|
2179
|
-
throw new Error(`No country data for '${
|
|
2201
|
+
throw new Error(`No country data for '${e}'`);
|
|
2180
2202
|
}
|
|
2181
2203
|
//* Update the selected country, dial code (if separateDialCode), placeholder, title, and active list item.
|
|
2182
2204
|
//* Note: called from _setInitialState, _updateCountryFromNumber, _selectListItem, setCountry.
|
|
2183
|
-
_setCountry(
|
|
2184
|
-
const { separateDialCode: n, showFlags:
|
|
2185
|
-
if (this.selectedCountryData =
|
|
2186
|
-
let c = "",
|
|
2187
|
-
|
|
2205
|
+
_setCountry(e) {
|
|
2206
|
+
const { separateDialCode: n, showFlags: r, i18n: o } = this.options, a = this.selectedCountryData.iso2 ? this.selectedCountryData : {};
|
|
2207
|
+
if (this.selectedCountryData = e ? this._getCountryData(e, !1) || {} : {}, this.selectedCountryData.iso2 && (this.defaultCountry = this.selectedCountryData.iso2), this.selectedCountryInner) {
|
|
2208
|
+
let c = "", g = "";
|
|
2209
|
+
e && r ? (c = `iti__flag iti__${e}`, g = `${this.selectedCountryData.name} +${this.selectedCountryData.dialCode}`) : (c = "iti__flag iti__globe", g = o.noCountrySelected), this.selectedCountryInner.className = c, this.selectedCountryA11yText.textContent = g;
|
|
2188
2210
|
}
|
|
2189
|
-
if (this._setSelectedCountryTitleAttribute(
|
|
2211
|
+
if (this._setSelectedCountryTitleAttribute(e, n), n) {
|
|
2190
2212
|
const c = this.selectedCountryData.dialCode ? `+${this.selectedCountryData.dialCode}` : "";
|
|
2191
2213
|
this.selectedDialCode.innerHTML = c, this._updateInputPadding();
|
|
2192
2214
|
}
|
|
2193
|
-
return this._updatePlaceholder(), this._updateMaxLength(),
|
|
2215
|
+
return this._updatePlaceholder(), this._updateMaxLength(), a.iso2 !== e;
|
|
2194
2216
|
}
|
|
2195
2217
|
//* Update the input padding to make space for the selected country/dial code.
|
|
2196
2218
|
_updateInputPadding() {
|
|
@@ -2201,28 +2223,28 @@ class K2 {
|
|
|
2201
2223
|
}
|
|
2202
2224
|
//* Update the maximum valid number length for the currently selected country.
|
|
2203
2225
|
_updateMaxLength() {
|
|
2204
|
-
const { strictMode:
|
|
2205
|
-
if (
|
|
2226
|
+
const { strictMode: e, placeholderNumberType: n, validationNumberTypes: r } = this.options, { iso2: o } = this.selectedCountryData;
|
|
2227
|
+
if (e && C.utils)
|
|
2206
2228
|
if (o) {
|
|
2207
|
-
const
|
|
2229
|
+
const a = C.utils.numberType[n];
|
|
2208
2230
|
let c = C.utils.getExampleNumber(
|
|
2209
2231
|
o,
|
|
2210
2232
|
!1,
|
|
2211
|
-
|
|
2233
|
+
a,
|
|
2212
2234
|
!0
|
|
2213
|
-
),
|
|
2214
|
-
for (; C.utils.isPossibleNumber(c, o,
|
|
2215
|
-
|
|
2216
|
-
const
|
|
2217
|
-
this.maxCoreNumberLength =
|
|
2235
|
+
), g = c;
|
|
2236
|
+
for (; C.utils.isPossibleNumber(c, o, r); )
|
|
2237
|
+
g = c, c += "0";
|
|
2238
|
+
const f = C.utils.getCoreNumber(g, o);
|
|
2239
|
+
this.maxCoreNumberLength = f.length, o === "by" && (this.maxCoreNumberLength = f.length + 1);
|
|
2218
2240
|
} else
|
|
2219
2241
|
this.maxCoreNumberLength = null;
|
|
2220
2242
|
}
|
|
2221
|
-
_setSelectedCountryTitleAttribute(
|
|
2243
|
+
_setSelectedCountryTitleAttribute(e = null, n) {
|
|
2222
2244
|
if (!this.selectedCountry)
|
|
2223
2245
|
return;
|
|
2224
|
-
let
|
|
2225
|
-
|
|
2246
|
+
let r;
|
|
2247
|
+
e && !n ? r = `${this.selectedCountryData.name}: +${this.selectedCountryData.dialCode}` : e ? r = this.selectedCountryData.name : r = "Unknown", this.selectedCountry.setAttribute("title", r);
|
|
2226
2248
|
}
|
|
2227
2249
|
//* When the input is in a hidden container during initialisation, we must inject some markup
|
|
2228
2250
|
//* into the end of the DOM to calculate the correct offsetWidth.
|
|
@@ -2230,41 +2252,41 @@ class K2 {
|
|
|
2230
2252
|
//* will definitely exist.
|
|
2231
2253
|
_getHiddenSelectedCountryWidth() {
|
|
2232
2254
|
if (this.telInput.parentNode) {
|
|
2233
|
-
const
|
|
2234
|
-
|
|
2255
|
+
const e = this.telInput.parentNode.cloneNode(!1);
|
|
2256
|
+
e.style.visibility = "hidden", document.body.appendChild(e);
|
|
2235
2257
|
const n = this.countryContainer.cloneNode();
|
|
2236
|
-
|
|
2237
|
-
const
|
|
2238
|
-
n.appendChild(
|
|
2239
|
-
const o =
|
|
2240
|
-
return document.body.removeChild(
|
|
2258
|
+
e.appendChild(n);
|
|
2259
|
+
const r = this.selectedCountry.cloneNode(!0);
|
|
2260
|
+
n.appendChild(r);
|
|
2261
|
+
const o = r.offsetWidth;
|
|
2262
|
+
return document.body.removeChild(e), o;
|
|
2241
2263
|
}
|
|
2242
2264
|
return 0;
|
|
2243
2265
|
}
|
|
2244
2266
|
//* Update the input placeholder to an example number from the currently selected country.
|
|
2245
2267
|
_updatePlaceholder() {
|
|
2246
2268
|
const {
|
|
2247
|
-
autoPlaceholder:
|
|
2269
|
+
autoPlaceholder: e,
|
|
2248
2270
|
placeholderNumberType: n,
|
|
2249
|
-
nationalMode:
|
|
2271
|
+
nationalMode: r,
|
|
2250
2272
|
customPlaceholder: o
|
|
2251
|
-
} = this.options,
|
|
2252
|
-
if (C.utils &&
|
|
2273
|
+
} = this.options, a = e === "aggressive" || !this.hadInitialPlaceholder && e === "polite";
|
|
2274
|
+
if (C.utils && a) {
|
|
2253
2275
|
const c = C.utils.numberType[n];
|
|
2254
|
-
let
|
|
2276
|
+
let g = this.selectedCountryData.iso2 ? C.utils.getExampleNumber(
|
|
2255
2277
|
this.selectedCountryData.iso2,
|
|
2256
|
-
|
|
2278
|
+
r,
|
|
2257
2279
|
c
|
|
2258
2280
|
) : "";
|
|
2259
|
-
|
|
2281
|
+
g = this._beforeSetNumber(g), typeof o == "function" && (g = o(g, this.selectedCountryData)), this.telInput.setAttribute("placeholder", g);
|
|
2260
2282
|
}
|
|
2261
2283
|
}
|
|
2262
2284
|
//* Called when the user selects a list item from the dropdown.
|
|
2263
|
-
_selectListItem(
|
|
2285
|
+
_selectListItem(e) {
|
|
2264
2286
|
const n = this._setCountry(
|
|
2265
|
-
|
|
2287
|
+
e.getAttribute("data-country-code")
|
|
2266
2288
|
);
|
|
2267
|
-
this._closeDropdown(), this._updateDialCode(
|
|
2289
|
+
this._closeDropdown(), this._updateDialCode(e.getAttribute("data-dial-code")), this.telInput.focus(), n && this._triggerCountryChange();
|
|
2268
2290
|
}
|
|
2269
2291
|
//* Close the dropdown and unbind any listeners.
|
|
2270
2292
|
_closeDropdown() {
|
|
@@ -2277,38 +2299,38 @@ class K2 {
|
|
|
2277
2299
|
), this.countryList.removeEventListener("click", this._handleClickCountryList), this.options.dropdownContainer && (this.options.useFullscreenPopup || window.removeEventListener("scroll", this._handleWindowScroll), this.dropdown.parentNode && this.dropdown.parentNode.removeChild(this.dropdown)), this._handlePageLoad && window.removeEventListener("load", this._handlePageLoad), this._trigger("close:countrydropdown");
|
|
2278
2300
|
}
|
|
2279
2301
|
//* Check if an element is visible within it's container, else scroll until it is.
|
|
2280
|
-
_scrollTo(
|
|
2281
|
-
const n = this.countryList,
|
|
2282
|
-
if (
|
|
2283
|
-
n.scrollTop =
|
|
2284
|
-
else if (
|
|
2285
|
-
const
|
|
2286
|
-
n.scrollTop =
|
|
2302
|
+
_scrollTo(e) {
|
|
2303
|
+
const n = this.countryList, r = document.documentElement.scrollTop, o = n.offsetHeight, a = n.getBoundingClientRect().top + r, c = a + o, g = e.offsetHeight, f = e.getBoundingClientRect().top + r, S = f + g, _ = f - a + n.scrollTop;
|
|
2304
|
+
if (f < a)
|
|
2305
|
+
n.scrollTop = _;
|
|
2306
|
+
else if (S > c) {
|
|
2307
|
+
const b = o - g;
|
|
2308
|
+
n.scrollTop = _ - b;
|
|
2287
2309
|
}
|
|
2288
2310
|
}
|
|
2289
2311
|
//* Replace any existing dial code with the new one
|
|
2290
2312
|
//* Note: called from _selectListItem and setCountry
|
|
2291
|
-
_updateDialCode(
|
|
2292
|
-
const n = this.telInput.value,
|
|
2313
|
+
_updateDialCode(e) {
|
|
2314
|
+
const n = this.telInput.value, r = `+${e}`;
|
|
2293
2315
|
let o;
|
|
2294
2316
|
if (n.charAt(0) === "+") {
|
|
2295
|
-
const
|
|
2296
|
-
|
|
2317
|
+
const a = this._getDialCode(n);
|
|
2318
|
+
a ? o = n.replace(a, r) : o = r, this.telInput.value = o;
|
|
2297
2319
|
}
|
|
2298
2320
|
}
|
|
2299
2321
|
//* Try and extract a valid international dial code from a full telephone number.
|
|
2300
2322
|
//* Note: returns the raw string inc plus character and any whitespace/dots etc.
|
|
2301
|
-
_getDialCode(
|
|
2302
|
-
let
|
|
2303
|
-
if (
|
|
2323
|
+
_getDialCode(e, n) {
|
|
2324
|
+
let r = "";
|
|
2325
|
+
if (e.charAt(0) === "+") {
|
|
2304
2326
|
let o = "";
|
|
2305
|
-
for (let
|
|
2306
|
-
const c =
|
|
2327
|
+
for (let a = 0; a < e.length; a++) {
|
|
2328
|
+
const c = e.charAt(a);
|
|
2307
2329
|
if (!isNaN(parseInt(c, 10))) {
|
|
2308
2330
|
if (o += c, n)
|
|
2309
|
-
this.dialCodeToIso2Map[o] && (
|
|
2331
|
+
this.dialCodeToIso2Map[o] && (r = e.substr(0, a + 1));
|
|
2310
2332
|
else if (this.dialCodes[o]) {
|
|
2311
|
-
|
|
2333
|
+
r = e.substr(0, a + 1);
|
|
2312
2334
|
break;
|
|
2313
2335
|
}
|
|
2314
2336
|
if (o.length === this.dialCodeMaxLen)
|
|
@@ -2316,23 +2338,23 @@ class K2 {
|
|
|
2316
2338
|
}
|
|
2317
2339
|
}
|
|
2318
2340
|
}
|
|
2319
|
-
return
|
|
2341
|
+
return r;
|
|
2320
2342
|
}
|
|
2321
2343
|
//* Get the input val, adding the dial code if separateDialCode is enabled.
|
|
2322
|
-
_getFullNumber(
|
|
2323
|
-
const n =
|
|
2344
|
+
_getFullNumber(e) {
|
|
2345
|
+
const n = e || this.telInput.value.trim(), { dialCode: r } = this.selectedCountryData;
|
|
2324
2346
|
let o;
|
|
2325
|
-
const
|
|
2326
|
-
return this.options.separateDialCode && n.charAt(0) !== "+" &&
|
|
2347
|
+
const a = c1(n);
|
|
2348
|
+
return this.options.separateDialCode && n.charAt(0) !== "+" && r && a ? o = `+${r}` : o = "", o + n;
|
|
2327
2349
|
}
|
|
2328
2350
|
//* Remove the dial code if separateDialCode is enabled also cap the length if the input has a maxlength attribute
|
|
2329
|
-
_beforeSetNumber(
|
|
2330
|
-
let n =
|
|
2351
|
+
_beforeSetNumber(e) {
|
|
2352
|
+
let n = e;
|
|
2331
2353
|
if (this.options.separateDialCode) {
|
|
2332
|
-
let
|
|
2333
|
-
if (
|
|
2334
|
-
|
|
2335
|
-
const o = n[
|
|
2354
|
+
let r = this._getDialCode(n);
|
|
2355
|
+
if (r) {
|
|
2356
|
+
r = `+${this.selectedCountryData.dialCode}`;
|
|
2357
|
+
const o = n[r.length] === " " || n[r.length] === "-" ? r.length + 1 : r.length;
|
|
2336
2358
|
n = n.substr(o);
|
|
2337
2359
|
}
|
|
2338
2360
|
}
|
|
@@ -2344,8 +2366,8 @@ class K2 {
|
|
|
2344
2366
|
}
|
|
2345
2367
|
//* Format the number as the user types.
|
|
2346
2368
|
_formatNumberAsYouType() {
|
|
2347
|
-
const
|
|
2348
|
-
return this.options.separateDialCode && this.telInput.value.charAt(0) !== "+" && n.includes(`+${
|
|
2369
|
+
const e = this._getFullNumber(), n = C.utils ? C.utils.formatNumberAsYouType(e, this.selectedCountryData.iso2) : e, { dialCode: r } = this.selectedCountryData;
|
|
2370
|
+
return this.options.separateDialCode && this.telInput.value.charAt(0) !== "+" && n.includes(`+${r}`) ? (n.split(`+${r}`)[1] || "").trim() : n;
|
|
2349
2371
|
}
|
|
2350
2372
|
//**************************
|
|
2351
2373
|
//* SECRET PUBLIC METHODS
|
|
@@ -2363,9 +2385,9 @@ class K2 {
|
|
|
2363
2385
|
//********************
|
|
2364
2386
|
//* Remove plugin.
|
|
2365
2387
|
destroy() {
|
|
2366
|
-
var
|
|
2367
|
-
const { allowDropdown:
|
|
2368
|
-
if (
|
|
2388
|
+
var a, c;
|
|
2389
|
+
const { allowDropdown: e, separateDialCode: n } = this.options;
|
|
2390
|
+
if (e) {
|
|
2369
2391
|
this._closeDropdown(), this.selectedCountry.removeEventListener(
|
|
2370
2392
|
"click",
|
|
2371
2393
|
this._handleClickSelectedCountry
|
|
@@ -2373,13 +2395,13 @@ class K2 {
|
|
|
2373
2395
|
"keydown",
|
|
2374
2396
|
this._handleCountryContainerKeydown
|
|
2375
2397
|
);
|
|
2376
|
-
const
|
|
2377
|
-
|
|
2398
|
+
const g = this.telInput.closest("label");
|
|
2399
|
+
g && g.removeEventListener("click", this._handleLabelClick);
|
|
2378
2400
|
}
|
|
2379
|
-
const { form:
|
|
2380
|
-
this._handleHiddenInputSubmit &&
|
|
2401
|
+
const { form: r } = this.telInput;
|
|
2402
|
+
this._handleHiddenInputSubmit && r && r.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"), n && (this.isRTL ? this.telInput.style.paddingRight = this.originalPaddingRight : this.telInput.style.paddingLeft = this.originalPaddingLeft);
|
|
2381
2403
|
const o = this.telInput.parentNode;
|
|
2382
|
-
(
|
|
2404
|
+
(a = o == null ? void 0 : o.parentNode) == null || a.insertBefore(this.telInput, o), (c = o == null ? void 0 : o.parentNode) == null || c.removeChild(o), delete C.instances[this.id];
|
|
2383
2405
|
}
|
|
2384
2406
|
//* Get the extension from the current number.
|
|
2385
2407
|
getExtension() {
|
|
@@ -2389,13 +2411,13 @@ class K2 {
|
|
|
2389
2411
|
) : "";
|
|
2390
2412
|
}
|
|
2391
2413
|
//* Format the number to the given format.
|
|
2392
|
-
getNumber(
|
|
2414
|
+
getNumber(e) {
|
|
2393
2415
|
if (C.utils) {
|
|
2394
2416
|
const { iso2: n } = this.selectedCountryData;
|
|
2395
2417
|
return C.utils.formatNumber(
|
|
2396
2418
|
this._getFullNumber(),
|
|
2397
2419
|
n,
|
|
2398
|
-
|
|
2420
|
+
e
|
|
2399
2421
|
);
|
|
2400
2422
|
}
|
|
2401
2423
|
return "";
|
|
@@ -2414,8 +2436,8 @@ class K2 {
|
|
|
2414
2436
|
//* Get the validation error.
|
|
2415
2437
|
getValidationError() {
|
|
2416
2438
|
if (C.utils) {
|
|
2417
|
-
const { iso2:
|
|
2418
|
-
return C.utils.getValidationError(this._getFullNumber(),
|
|
2439
|
+
const { iso2: e } = this.selectedCountryData;
|
|
2440
|
+
return C.utils.getValidationError(this._getFullNumber(), e);
|
|
2419
2441
|
}
|
|
2420
2442
|
return -99;
|
|
2421
2443
|
}
|
|
@@ -2423,127 +2445,127 @@ class K2 {
|
|
|
2423
2445
|
isValidNumber() {
|
|
2424
2446
|
if (!this.selectedCountryData.iso2)
|
|
2425
2447
|
return !1;
|
|
2426
|
-
const
|
|
2448
|
+
const e = this._getFullNumber(), n = e.search(new RegExp("\\p{L}", "u"));
|
|
2427
2449
|
if (n > -1) {
|
|
2428
|
-
const
|
|
2429
|
-
return o &&
|
|
2450
|
+
const r = e.substring(0, n), o = this._utilsIsPossibleNumber(r), a = this._utilsIsPossibleNumber(e);
|
|
2451
|
+
return o && a;
|
|
2430
2452
|
}
|
|
2431
|
-
return this._utilsIsPossibleNumber(
|
|
2453
|
+
return this._utilsIsPossibleNumber(e);
|
|
2432
2454
|
}
|
|
2433
|
-
_utilsIsPossibleNumber(
|
|
2434
|
-
return C.utils ? C.utils.isPossibleNumber(
|
|
2455
|
+
_utilsIsPossibleNumber(e) {
|
|
2456
|
+
return C.utils ? C.utils.isPossibleNumber(e, this.selectedCountryData.iso2, this.options.validationNumberTypes) : null;
|
|
2435
2457
|
}
|
|
2436
2458
|
//* Validate the input val (precise)
|
|
2437
2459
|
isValidNumberPrecise() {
|
|
2438
2460
|
if (!this.selectedCountryData.iso2)
|
|
2439
2461
|
return !1;
|
|
2440
|
-
const
|
|
2462
|
+
const e = this._getFullNumber(), n = e.search(new RegExp("\\p{L}", "u"));
|
|
2441
2463
|
if (n > -1) {
|
|
2442
|
-
const
|
|
2443
|
-
return o &&
|
|
2464
|
+
const r = e.substring(0, n), o = this._utilsIsValidNumber(r), a = this._utilsIsValidNumber(e);
|
|
2465
|
+
return o && a;
|
|
2444
2466
|
}
|
|
2445
|
-
return this._utilsIsValidNumber(
|
|
2467
|
+
return this._utilsIsValidNumber(e);
|
|
2446
2468
|
}
|
|
2447
|
-
_utilsIsValidNumber(
|
|
2448
|
-
return C.utils ? C.utils.isValidNumber(
|
|
2469
|
+
_utilsIsValidNumber(e) {
|
|
2470
|
+
return C.utils ? C.utils.isValidNumber(e, this.selectedCountryData.iso2, this.options.validationNumberTypes) : null;
|
|
2449
2471
|
}
|
|
2450
2472
|
//* Update the selected country, and update the input val accordingly.
|
|
2451
|
-
setCountry(
|
|
2452
|
-
const n =
|
|
2453
|
-
(
|
|
2473
|
+
setCountry(e) {
|
|
2474
|
+
const n = e == null ? void 0 : e.toLowerCase(), r = this.selectedCountryData.iso2;
|
|
2475
|
+
(e && n !== r || !e && r) && (this._setCountry(n), this._updateDialCode(this.selectedCountryData.dialCode), this._triggerCountryChange());
|
|
2454
2476
|
}
|
|
2455
2477
|
//* Set the input value and update the country.
|
|
2456
|
-
setNumber(
|
|
2457
|
-
const n = this._updateCountryFromNumber(
|
|
2458
|
-
this._updateValFromNumber(
|
|
2478
|
+
setNumber(e) {
|
|
2479
|
+
const n = this._updateCountryFromNumber(e);
|
|
2480
|
+
this._updateValFromNumber(e), n && this._triggerCountryChange(), this._trigger("input", { isSetNumber: !0 });
|
|
2459
2481
|
}
|
|
2460
2482
|
//* Set the placeholder number typ
|
|
2461
|
-
setPlaceholderNumberType(
|
|
2462
|
-
this.options.placeholderNumberType =
|
|
2483
|
+
setPlaceholderNumberType(e) {
|
|
2484
|
+
this.options.placeholderNumberType = e, this._updatePlaceholder();
|
|
2463
2485
|
}
|
|
2464
|
-
setDisabled(
|
|
2465
|
-
this.telInput.disabled =
|
|
2486
|
+
setDisabled(e) {
|
|
2487
|
+
this.telInput.disabled = e, e ? this.selectedCountry.setAttribute("disabled", "true") : this.selectedCountry.removeAttribute("disabled");
|
|
2466
2488
|
}
|
|
2467
2489
|
}
|
|
2468
2490
|
const H2 = (y) => {
|
|
2469
2491
|
if (!C.utils && !C.startedLoadingUtilsScript) {
|
|
2470
|
-
let
|
|
2492
|
+
let e;
|
|
2471
2493
|
if (typeof y == "function")
|
|
2472
2494
|
try {
|
|
2473
|
-
|
|
2495
|
+
e = Promise.resolve(y());
|
|
2474
2496
|
} catch (n) {
|
|
2475
2497
|
return Promise.reject(n);
|
|
2476
2498
|
}
|
|
2477
2499
|
else
|
|
2478
2500
|
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}`));
|
|
2479
|
-
return C.startedLoadingUtilsScript = !0,
|
|
2480
|
-
const
|
|
2481
|
-
if (!
|
|
2501
|
+
return C.startedLoadingUtilsScript = !0, e.then((n) => {
|
|
2502
|
+
const r = n == null ? void 0 : n.default;
|
|
2503
|
+
if (!r || typeof r != "object")
|
|
2482
2504
|
throw new TypeError("The loader function passed to attachUtils did not resolve to a module object with utils as its default export.");
|
|
2483
|
-
return C.utils =
|
|
2505
|
+
return C.utils = r, $1("handleUtils"), !0;
|
|
2484
2506
|
}).catch((n) => {
|
|
2485
2507
|
throw $1("rejectUtilsScriptPromise", n), n;
|
|
2486
2508
|
});
|
|
2487
2509
|
}
|
|
2488
2510
|
return null;
|
|
2489
2511
|
}, C = Object.assign(
|
|
2490
|
-
(y,
|
|
2491
|
-
const n = new K2(y,
|
|
2512
|
+
(y, e) => {
|
|
2513
|
+
const n = new K2(y, e);
|
|
2492
2514
|
return n._init(), y.setAttribute("data-intl-tel-input-id", n.id.toString()), C.instances[n.id] = n, n;
|
|
2493
2515
|
},
|
|
2494
2516
|
{
|
|
2495
|
-
defaults:
|
|
2517
|
+
defaults: l2,
|
|
2496
2518
|
//* Using a static var like this allows us to mock it in the tests.
|
|
2497
2519
|
documentReady: () => document.readyState === "complete",
|
|
2498
2520
|
//* Get the country data object.
|
|
2499
2521
|
getCountryData: () => W,
|
|
2500
2522
|
//* A getter for the plugin instance.
|
|
2501
2523
|
getInstance: (y) => {
|
|
2502
|
-
const
|
|
2503
|
-
return
|
|
2524
|
+
const e = y.getAttribute("data-intl-tel-input-id");
|
|
2525
|
+
return e ? C.instances[e] : null;
|
|
2504
2526
|
},
|
|
2505
2527
|
//* A map from instance ID to instance object.
|
|
2506
2528
|
instances: {},
|
|
2507
2529
|
attachUtils: H2,
|
|
2508
2530
|
startedLoadingUtilsScript: !1,
|
|
2509
2531
|
startedLoadingAutoCountry: !1,
|
|
2510
|
-
version: "25.
|
|
2532
|
+
version: "25.1.1"
|
|
2511
2533
|
}
|
|
2512
2534
|
);
|
|
2513
2535
|
(function() {
|
|
2514
2536
|
var y = this || self;
|
|
2515
|
-
function
|
|
2537
|
+
function e(d, t) {
|
|
2516
2538
|
d = d.split(".");
|
|
2517
|
-
var
|
|
2518
|
-
d[0] in
|
|
2519
|
-
for (var
|
|
2539
|
+
var $ = y;
|
|
2540
|
+
d[0] in $ || typeof $.execScript > "u" || $.execScript("var " + d[0]);
|
|
2541
|
+
for (var i; d.length && (i = d.shift()); ) d.length || t === void 0 ? $[i] && $[i] !== Object.prototype[i] ? $ = $[i] : $ = $[i] = {} : $[i] = t;
|
|
2520
2542
|
}
|
|
2521
2543
|
function n(d, t) {
|
|
2522
|
-
function
|
|
2544
|
+
function $() {
|
|
2523
2545
|
}
|
|
2524
|
-
|
|
2525
|
-
for (var
|
|
2526
|
-
return t.prototype[s].apply(
|
|
2546
|
+
$.prototype = t.prototype, d.ma = t.prototype, d.prototype = new $(), d.prototype.constructor = d, d.sa = function(i, s, u) {
|
|
2547
|
+
for (var l = Array(arguments.length - 2), h = 2; h < arguments.length; h++) l[h - 2] = arguments[h];
|
|
2548
|
+
return t.prototype[s].apply(i, l);
|
|
2527
2549
|
};
|
|
2528
2550
|
}
|
|
2529
|
-
function
|
|
2551
|
+
function r(d) {
|
|
2530
2552
|
const t = [];
|
|
2531
|
-
let
|
|
2532
|
-
for (const
|
|
2553
|
+
let $ = 0;
|
|
2554
|
+
for (const i in d) t[$++] = d[i];
|
|
2533
2555
|
return t;
|
|
2534
2556
|
}
|
|
2535
2557
|
var o = class {
|
|
2536
2558
|
constructor(d) {
|
|
2537
|
-
if (
|
|
2559
|
+
if (a !== a) throw Error("SafeUrl is not meant to be built directly");
|
|
2538
2560
|
this.g = d;
|
|
2539
2561
|
}
|
|
2540
2562
|
toString() {
|
|
2541
2563
|
return this.g.toString();
|
|
2542
2564
|
}
|
|
2543
|
-
},
|
|
2565
|
+
}, a = {};
|
|
2544
2566
|
new o("about:invalid#zClosurez"), new o("about:blank");
|
|
2545
2567
|
const c = {};
|
|
2546
|
-
class
|
|
2568
|
+
class g {
|
|
2547
2569
|
constructor() {
|
|
2548
2570
|
if (c !== c) throw Error("SafeStyle is not meant to be built directly");
|
|
2549
2571
|
}
|
|
@@ -2551,52 +2573,52 @@ const H2 = (y) => {
|
|
|
2551
2573
|
return "";
|
|
2552
2574
|
}
|
|
2553
2575
|
}
|
|
2554
|
-
new
|
|
2555
|
-
const
|
|
2556
|
-
class
|
|
2576
|
+
new g();
|
|
2577
|
+
const f = {};
|
|
2578
|
+
class S {
|
|
2557
2579
|
constructor() {
|
|
2558
|
-
if (
|
|
2580
|
+
if (f !== f) throw Error("SafeStyleSheet is not meant to be built directly");
|
|
2559
2581
|
}
|
|
2560
2582
|
toString() {
|
|
2561
2583
|
return "";
|
|
2562
2584
|
}
|
|
2563
2585
|
}
|
|
2564
|
-
new
|
|
2565
|
-
const
|
|
2566
|
-
class
|
|
2586
|
+
new S();
|
|
2587
|
+
const _ = {};
|
|
2588
|
+
class b {
|
|
2567
2589
|
constructor() {
|
|
2568
2590
|
var t = y.trustedTypes && y.trustedTypes.emptyHTML || "";
|
|
2569
|
-
if (
|
|
2591
|
+
if (_ !== _) throw Error("SafeHtml is not meant to be built directly");
|
|
2570
2592
|
this.g = t;
|
|
2571
2593
|
}
|
|
2572
2594
|
toString() {
|
|
2573
2595
|
return this.g.toString();
|
|
2574
2596
|
}
|
|
2575
2597
|
}
|
|
2576
|
-
new
|
|
2577
|
-
function
|
|
2598
|
+
new b();
|
|
2599
|
+
function w(d, t) {
|
|
2578
2600
|
switch (this.g = d, this.l = !!t.aa, this.h = t.i, this.s = t.type, this.o = !1, this.h) {
|
|
2579
2601
|
case G:
|
|
2580
2602
|
case F:
|
|
2581
2603
|
case M:
|
|
2582
2604
|
case x:
|
|
2583
2605
|
case f1:
|
|
2584
|
-
case
|
|
2585
|
-
case
|
|
2606
|
+
case A:
|
|
2607
|
+
case I:
|
|
2586
2608
|
this.o = !0;
|
|
2587
2609
|
}
|
|
2588
2610
|
this.j = t.defaultValue;
|
|
2589
2611
|
}
|
|
2590
|
-
var
|
|
2612
|
+
var I = 1, A = 2, G = 3, F = 4, M = 6, x = 16, f1 = 18;
|
|
2591
2613
|
function v1(d, t) {
|
|
2592
2614
|
for (this.h = d, this.g = {}, d = 0; d < t.length; d++) {
|
|
2593
|
-
var
|
|
2594
|
-
this.g[
|
|
2615
|
+
var $ = t[d];
|
|
2616
|
+
this.g[$.g] = $;
|
|
2595
2617
|
}
|
|
2596
2618
|
}
|
|
2597
|
-
function
|
|
2598
|
-
return d =
|
|
2599
|
-
return t.g -
|
|
2619
|
+
function a2(d) {
|
|
2620
|
+
return d = r(d.g), d.sort(function(t, $) {
|
|
2621
|
+
return t.g - $.g;
|
|
2600
2622
|
}), d;
|
|
2601
2623
|
}
|
|
2602
2624
|
function R() {
|
|
@@ -2605,22 +2627,22 @@ const H2 = (y) => {
|
|
|
2605
2627
|
R.prototype.has = function(d) {
|
|
2606
2628
|
return B(this, d.g);
|
|
2607
2629
|
}, R.prototype.get = function(d, t) {
|
|
2608
|
-
return
|
|
2630
|
+
return p(this, d.g, t);
|
|
2609
2631
|
}, R.prototype.set = function(d, t) {
|
|
2610
2632
|
E(this, d.g, t);
|
|
2611
2633
|
}, R.prototype.add = function(d, t) {
|
|
2612
2634
|
w1(this, d.g, t);
|
|
2613
2635
|
};
|
|
2614
2636
|
function S1(d, t) {
|
|
2615
|
-
for (var
|
|
2616
|
-
var s =
|
|
2637
|
+
for (var $ = a2(d.m()), i = 0; i < $.length; i++) {
|
|
2638
|
+
var s = $[i], u = s.g;
|
|
2617
2639
|
if (B(t, u)) {
|
|
2618
2640
|
d.g && delete d.g[s.g];
|
|
2619
|
-
var
|
|
2641
|
+
var l = s.h == 11 || s.h == 10;
|
|
2620
2642
|
if (s.l) {
|
|
2621
2643
|
s = P(t, u);
|
|
2622
|
-
for (var h = 0; h < s.length; h++) w1(d, u,
|
|
2623
|
-
} else s = n1(t, u),
|
|
2644
|
+
for (var h = 0; h < s.length; h++) w1(d, u, l ? s[h].clone() : s[h]);
|
|
2645
|
+
} else s = n1(t, u), l ? (l = n1(d, u)) ? S1(l, s) : E(d, u, s.clone()) : E(d, u, s);
|
|
2624
2646
|
}
|
|
2625
2647
|
}
|
|
2626
2648
|
}
|
|
@@ -2632,27 +2654,27 @@ const H2 = (y) => {
|
|
|
2632
2654
|
return d.h[t] != null;
|
|
2633
2655
|
}
|
|
2634
2656
|
function n1(d, t) {
|
|
2635
|
-
var
|
|
2636
|
-
if (
|
|
2657
|
+
var $ = d.h[t];
|
|
2658
|
+
if ($ == null) return null;
|
|
2637
2659
|
if (d.l) {
|
|
2638
2660
|
if (!(t in d.g)) {
|
|
2639
|
-
var
|
|
2640
|
-
if (
|
|
2641
|
-
for (var u = [],
|
|
2642
|
-
|
|
2643
|
-
} else
|
|
2644
|
-
return d.g[t] =
|
|
2661
|
+
var i = d.l, s = d.j[t];
|
|
2662
|
+
if ($ != null) if (s.l) {
|
|
2663
|
+
for (var u = [], l = 0; l < $.length; l++) u[l] = i.h(s, $[l]);
|
|
2664
|
+
$ = u;
|
|
2665
|
+
} else $ = i.h(s, $);
|
|
2666
|
+
return d.g[t] = $;
|
|
2645
2667
|
}
|
|
2646
2668
|
return d.g[t];
|
|
2647
2669
|
}
|
|
2648
|
-
return
|
|
2670
|
+
return $;
|
|
2649
2671
|
}
|
|
2650
|
-
function
|
|
2651
|
-
var
|
|
2652
|
-
return d.j[t].l ?
|
|
2672
|
+
function p(d, t, $) {
|
|
2673
|
+
var i = n1(d, t);
|
|
2674
|
+
return d.j[t].l ? i[$ || 0] : i;
|
|
2653
2675
|
}
|
|
2654
2676
|
function v(d, t) {
|
|
2655
|
-
if (B(d, t)) d =
|
|
2677
|
+
if (B(d, t)) d = p(d, t);
|
|
2656
2678
|
else d: {
|
|
2657
2679
|
if (d = d.j[t], d.j === void 0) if (t = d.s, t === Boolean) d.j = !1;
|
|
2658
2680
|
else if (t === Number) d.j = 0;
|
|
@@ -2671,16 +2693,16 @@ const H2 = (y) => {
|
|
|
2671
2693
|
function K(d, t) {
|
|
2672
2694
|
return d.j[t].l ? B(d, t) ? d.h[t].length : 0 : B(d, t) ? 1 : 0;
|
|
2673
2695
|
}
|
|
2674
|
-
function E(d, t,
|
|
2675
|
-
d.h[t] =
|
|
2696
|
+
function E(d, t, $) {
|
|
2697
|
+
d.h[t] = $, d.g && (d.g[t] = $);
|
|
2676
2698
|
}
|
|
2677
|
-
function w1(d, t,
|
|
2678
|
-
d.h[t] || (d.h[t] = []), d.h[t].push(
|
|
2699
|
+
function w1(d, t, $) {
|
|
2700
|
+
d.h[t] || (d.h[t] = []), d.h[t].push($), d.g && delete d.g[t];
|
|
2679
2701
|
}
|
|
2680
2702
|
function i1(d, t) {
|
|
2681
|
-
var
|
|
2682
|
-
for (
|
|
2683
|
-
return new v1(d,
|
|
2703
|
+
var $ = [], i;
|
|
2704
|
+
for (i in t) i != 0 && $.push(new w(i, t[i]));
|
|
2705
|
+
return new v1(d, $);
|
|
2684
2706
|
}
|
|
2685
2707
|
function r1() {
|
|
2686
2708
|
}
|
|
@@ -2708,63 +2730,63 @@ const H2 = (y) => {
|
|
|
2708
2730
|
}, q.prototype.g = function(d, t) {
|
|
2709
2731
|
return q.ma.g.call(this, d, t);
|
|
2710
2732
|
};
|
|
2711
|
-
function
|
|
2733
|
+
function N(d, t) {
|
|
2712
2734
|
d != null && this.g.apply(this, arguments);
|
|
2713
2735
|
}
|
|
2714
|
-
|
|
2736
|
+
N.prototype.h = "", N.prototype.set = function(d) {
|
|
2715
2737
|
this.h = "" + d;
|
|
2716
|
-
},
|
|
2717
|
-
if (this.h += String(d), t != null) for (let
|
|
2738
|
+
}, N.prototype.g = function(d, t, $) {
|
|
2739
|
+
if (this.h += String(d), t != null) for (let i = 1; i < arguments.length; i++) this.h += arguments[i];
|
|
2718
2740
|
return this;
|
|
2719
2741
|
};
|
|
2720
2742
|
function k(d) {
|
|
2721
2743
|
d.h = "";
|
|
2722
2744
|
}
|
|
2723
|
-
|
|
2745
|
+
N.prototype.toString = function() {
|
|
2724
2746
|
return this.h;
|
|
2725
2747
|
};
|
|
2726
2748
|
function z() {
|
|
2727
2749
|
R.call(this);
|
|
2728
2750
|
}
|
|
2729
2751
|
n(z, R);
|
|
2730
|
-
var
|
|
2731
|
-
function
|
|
2752
|
+
var L1 = null;
|
|
2753
|
+
function L() {
|
|
2732
2754
|
R.call(this);
|
|
2733
2755
|
}
|
|
2734
|
-
n(
|
|
2735
|
-
var
|
|
2756
|
+
n(L, R);
|
|
2757
|
+
var N1 = null;
|
|
2736
2758
|
function Z() {
|
|
2737
2759
|
R.call(this);
|
|
2738
2760
|
}
|
|
2739
2761
|
n(Z, R);
|
|
2740
|
-
var
|
|
2762
|
+
var T1 = null;
|
|
2741
2763
|
z.prototype.m = function() {
|
|
2742
|
-
var d = A1;
|
|
2743
|
-
return d || (A1 = d = i1(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;
|
|
2744
|
-
}, z.m = z.prototype.m, b.prototype.m = function() {
|
|
2745
2764
|
var d = L1;
|
|
2746
|
-
return d || (L1 = d = i1(
|
|
2747
|
-
},
|
|
2765
|
+
return d || (L1 = d = i1(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;
|
|
2766
|
+
}, z.m = z.prototype.m, L.prototype.m = function() {
|
|
2748
2767
|
var d = N1;
|
|
2749
|
-
return d || (N1 = d = i1(
|
|
2768
|
+
return d || (N1 = d = i1(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;
|
|
2769
|
+
}, L.m = L.prototype.m, Z.prototype.m = function() {
|
|
2770
|
+
var d = T1;
|
|
2771
|
+
return d || (T1 = d = i1(Z, {
|
|
2750
2772
|
0: { name: "PhoneMetadata", ia: "i18n.phonenumbers.PhoneMetadata" },
|
|
2751
|
-
1: { name: "general_desc", i: 11, type:
|
|
2752
|
-
2: { name: "fixed_line", i: 11, type:
|
|
2753
|
-
3: { name: "mobile", i: 11, type:
|
|
2754
|
-
4: { name: "toll_free", i: 11, type:
|
|
2755
|
-
5: { name: "premium_rate", i: 11, type:
|
|
2756
|
-
6: { name: "shared_cost", i: 11, type:
|
|
2757
|
-
7: { name: "personal_number", i: 11, type:
|
|
2758
|
-
8: { name: "voip", i: 11, type:
|
|
2759
|
-
21: { name: "pager", i: 11, type:
|
|
2760
|
-
25: { name: "uan", i: 11, type:
|
|
2761
|
-
27: { name: "emergency", i: 11, type:
|
|
2762
|
-
28: { name: "voicemail", i: 11, type:
|
|
2763
|
-
29: { name: "short_code", i: 11, type:
|
|
2764
|
-
30: { name: "standard_rate", i: 11, type:
|
|
2765
|
-
31: { name: "carrier_specific", i: 11, type:
|
|
2766
|
-
33: { name: "sms_services", i: 11, type:
|
|
2767
|
-
24: { name: "no_international_dialling", i: 11, type:
|
|
2773
|
+
1: { name: "general_desc", i: 11, type: L },
|
|
2774
|
+
2: { name: "fixed_line", i: 11, type: L },
|
|
2775
|
+
3: { name: "mobile", i: 11, type: L },
|
|
2776
|
+
4: { name: "toll_free", i: 11, type: L },
|
|
2777
|
+
5: { name: "premium_rate", i: 11, type: L },
|
|
2778
|
+
6: { name: "shared_cost", i: 11, type: L },
|
|
2779
|
+
7: { name: "personal_number", i: 11, type: L },
|
|
2780
|
+
8: { name: "voip", i: 11, type: L },
|
|
2781
|
+
21: { name: "pager", i: 11, type: L },
|
|
2782
|
+
25: { name: "uan", i: 11, type: L },
|
|
2783
|
+
27: { name: "emergency", i: 11, type: L },
|
|
2784
|
+
28: { name: "voicemail", i: 11, type: L },
|
|
2785
|
+
29: { name: "short_code", i: 11, type: L },
|
|
2786
|
+
30: { name: "standard_rate", i: 11, type: L },
|
|
2787
|
+
31: { name: "carrier_specific", i: 11, type: L },
|
|
2788
|
+
33: { name: "sms_services", i: 11, type: L },
|
|
2789
|
+
24: { name: "no_international_dialling", i: 11, type: L },
|
|
2768
2790
|
9: { name: "id", required: !0, i: 9, type: String },
|
|
2769
2791
|
10: { name: "country_code", i: 5, type: Number },
|
|
2770
2792
|
11: { name: "international_prefix", i: 9, type: String },
|
|
@@ -2788,10 +2810,10 @@ const H2 = (y) => {
|
|
|
2788
2810
|
R.call(this);
|
|
2789
2811
|
}
|
|
2790
2812
|
n(H, R);
|
|
2791
|
-
var
|
|
2813
|
+
var A1 = null, h2 = { ra: 0, qa: 1, pa: 5, oa: 10, na: 20 };
|
|
2792
2814
|
H.prototype.m = function() {
|
|
2793
|
-
var d =
|
|
2794
|
-
return d || (
|
|
2815
|
+
var d = A1;
|
|
2816
|
+
return d || (A1 = d = i1(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: h2 }, 7: {
|
|
2795
2817
|
name: "preferred_domestic_carrier_code",
|
|
2796
2818
|
i: 9,
|
|
2797
2819
|
type: String
|
|
@@ -7987,8 +8009,8 @@ const H2 = (y) => {
|
|
|
7987
8009
|
return d != null && (K(d, 9) != 1 || P(d, 9)[0] != -1);
|
|
7988
8010
|
}
|
|
7989
8011
|
function s1(d, t) {
|
|
7990
|
-
for (var
|
|
7991
|
-
return
|
|
8012
|
+
for (var $ = new N(), i, s = d.length, u = 0; u < s; ++u) i = d.charAt(u), i = t[i.toUpperCase()], i != null && $.g(i);
|
|
8013
|
+
return $.toString();
|
|
7992
8014
|
}
|
|
7993
8015
|
function O1(d) {
|
|
7994
8016
|
return d.length == 0 || w2.test(d);
|
|
@@ -7997,122 +8019,122 @@ const H2 = (y) => {
|
|
|
7997
8019
|
return d != null && isNaN(d) && d.toUpperCase() in E1;
|
|
7998
8020
|
}
|
|
7999
8021
|
D.prototype.format = function(d, t) {
|
|
8000
|
-
if (
|
|
8001
|
-
var
|
|
8002
|
-
if (0 <
|
|
8022
|
+
if (p(d, 2) == 0 && B(d, 5)) {
|
|
8023
|
+
var $ = v(d, 5);
|
|
8024
|
+
if (0 < $.length) return $;
|
|
8003
8025
|
}
|
|
8004
|
-
|
|
8005
|
-
var
|
|
8006
|
-
if (t == 0) return G1(
|
|
8007
|
-
if (!(
|
|
8008
|
-
var s = d1(this,
|
|
8009
|
-
d = B(d, 3) &&
|
|
8026
|
+
$ = v(d, 1);
|
|
8027
|
+
var i = t1(d);
|
|
8028
|
+
if (t == 0) return G1($, 0, i, "");
|
|
8029
|
+
if (!($ in X)) return i;
|
|
8030
|
+
var s = d1(this, $, e1($));
|
|
8031
|
+
d = B(d, 3) && p(d, 3).length != 0 ? t == 3 ? ";ext=" + p(d, 3) : B(s, 13) ? p(s, 13) + v(d, 3) : " ext. " + v(d, 3) : "";
|
|
8010
8032
|
d: {
|
|
8011
8033
|
s = P(s, 20).length == 0 || t == 2 ? P(s, 19) : P(s, 20);
|
|
8012
|
-
for (var u,
|
|
8034
|
+
for (var u, l = s.length, h = 0; h < l; ++h) {
|
|
8013
8035
|
u = s[h];
|
|
8014
8036
|
var m = K(u, 3);
|
|
8015
|
-
if ((m == 0 ||
|
|
8037
|
+
if ((m == 0 || i.search(p(u, 3, m - 1)) == 0) && (m = new RegExp(p(u, 1)), U(m, i))) {
|
|
8016
8038
|
s = u;
|
|
8017
8039
|
break d;
|
|
8018
8040
|
}
|
|
8019
8041
|
}
|
|
8020
8042
|
s = null;
|
|
8021
8043
|
}
|
|
8022
|
-
return s != null && (
|
|
8023
|
-
|
|
8044
|
+
return s != null && (l = s, s = v(l, 2), u = new RegExp(p(l, 1)), v(
|
|
8045
|
+
l,
|
|
8024
8046
|
5
|
|
8025
|
-
),
|
|
8047
|
+
), l = v(l, 4), i = t == 2 && l != null && 0 < l.length ? i.replace(u, s.replace(S2, l)) : i.replace(u, s), t == 3 && (i = i.replace(RegExp("^[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]+"), ""), i = i.replace(RegExp("[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]+", "g"), "-"))), G1($, t, i, d);
|
|
8026
8048
|
};
|
|
8027
|
-
function d1(d, t,
|
|
8028
|
-
return
|
|
8049
|
+
function d1(d, t, $) {
|
|
8050
|
+
return $ == "001" ? j(d, "" + t) : j(d, $);
|
|
8029
8051
|
}
|
|
8030
8052
|
function t1(d) {
|
|
8031
8053
|
if (!B(d, 2)) return "";
|
|
8032
|
-
var t = "" +
|
|
8033
|
-
return B(d, 4) &&
|
|
8054
|
+
var t = "" + p(d, 2);
|
|
8055
|
+
return B(d, 4) && p(d, 4) && 0 < v(d, 8) ? Array(v(d, 8) + 1).join("0") + t : t;
|
|
8034
8056
|
}
|
|
8035
|
-
function G1(d, t,
|
|
8057
|
+
function G1(d, t, $, i) {
|
|
8036
8058
|
switch (t) {
|
|
8037
8059
|
case 0:
|
|
8038
|
-
return "+" + d +
|
|
8060
|
+
return "+" + d + $ + i;
|
|
8039
8061
|
case 1:
|
|
8040
|
-
return "+" + d + " " +
|
|
8062
|
+
return "+" + d + " " + $ + i;
|
|
8041
8063
|
case 3:
|
|
8042
|
-
return "tel:+" + d + "-" +
|
|
8064
|
+
return "tel:+" + d + "-" + $ + i;
|
|
8043
8065
|
default:
|
|
8044
|
-
return
|
|
8066
|
+
return $ + i;
|
|
8045
8067
|
}
|
|
8046
8068
|
}
|
|
8047
8069
|
function u1(d, t) {
|
|
8048
8070
|
switch (t) {
|
|
8049
8071
|
case 4:
|
|
8050
|
-
return
|
|
8072
|
+
return p(d, 5);
|
|
8051
8073
|
case 3:
|
|
8052
|
-
return
|
|
8074
|
+
return p(d, 4);
|
|
8053
8075
|
case 1:
|
|
8054
|
-
return
|
|
8076
|
+
return p(d, 3);
|
|
8055
8077
|
case 0:
|
|
8056
8078
|
case 2:
|
|
8057
|
-
return
|
|
8079
|
+
return p(d, 2);
|
|
8058
8080
|
case 5:
|
|
8059
|
-
return
|
|
8081
|
+
return p(d, 6);
|
|
8060
8082
|
case 6:
|
|
8061
|
-
return
|
|
8083
|
+
return p(d, 8);
|
|
8062
8084
|
case 7:
|
|
8063
|
-
return
|
|
8085
|
+
return p(d, 7);
|
|
8064
8086
|
case 8:
|
|
8065
|
-
return
|
|
8087
|
+
return p(d, 21);
|
|
8066
8088
|
case 9:
|
|
8067
|
-
return
|
|
8089
|
+
return p(d, 25);
|
|
8068
8090
|
case 10:
|
|
8069
|
-
return
|
|
8091
|
+
return p(d, 28);
|
|
8070
8092
|
default:
|
|
8071
|
-
return
|
|
8093
|
+
return p(d, 1);
|
|
8072
8094
|
}
|
|
8073
8095
|
}
|
|
8074
8096
|
function F1(d, t) {
|
|
8075
|
-
var
|
|
8076
|
-
return d = d1(d, v(t, 1),
|
|
8097
|
+
var $ = U1(d, t);
|
|
8098
|
+
return d = d1(d, v(t, 1), $), d == null ? -1 : (t = t1(t), C1(t, d));
|
|
8077
8099
|
}
|
|
8078
8100
|
function C1(d, t) {
|
|
8079
|
-
return O(d,
|
|
8101
|
+
return O(d, p(t, 1)) ? O(d, p(t, 5)) ? 4 : O(d, p(t, 4)) ? 3 : O(d, p(t, 6)) ? 5 : O(d, p(t, 8)) ? 6 : O(d, p(t, 7)) ? 7 : O(d, p(t, 21)) ? 8 : O(d, p(t, 25)) ? 9 : O(d, p(t, 28)) ? 10 : O(d, p(t, 2)) ? p(t, 18) || O(d, p(t, 3)) ? 2 : 0 : !p(t, 18) && O(d, p(t, 3)) ? 1 : -1 : -1;
|
|
8080
8102
|
}
|
|
8081
8103
|
function j(d, t) {
|
|
8082
8104
|
if (t == null) return null;
|
|
8083
8105
|
t = t.toUpperCase();
|
|
8084
|
-
var
|
|
8085
|
-
if (
|
|
8086
|
-
if (
|
|
8087
|
-
|
|
8106
|
+
var $ = d.g[t];
|
|
8107
|
+
if ($ == null) {
|
|
8108
|
+
if ($ = E1[t], $ == null) return null;
|
|
8109
|
+
$ = new q().g(Z.m(), $), d.g[t] = $;
|
|
8088
8110
|
}
|
|
8089
|
-
return
|
|
8111
|
+
return $;
|
|
8090
8112
|
}
|
|
8091
8113
|
function O(d, t) {
|
|
8092
|
-
var
|
|
8093
|
-
return 0 < K(t, 9) && P(t, 9).indexOf(
|
|
8114
|
+
var $ = d.length;
|
|
8115
|
+
return 0 < K(t, 9) && P(t, 9).indexOf($) == -1 ? !1 : U(v(t, 2), d);
|
|
8094
8116
|
}
|
|
8095
8117
|
function b2(d, t) {
|
|
8096
|
-
var
|
|
8097
|
-
return s == null ||
|
|
8118
|
+
var $ = U1(d, t), i = v(t, 1), s = d1(d, i, $);
|
|
8119
|
+
return s == null || $ != "001" && i != V1(d, $) ? s = !1 : (d = t1(t), s = C1(d, s) != -1), s;
|
|
8098
8120
|
}
|
|
8099
8121
|
function U1(d, t) {
|
|
8100
8122
|
if (t == null) return null;
|
|
8101
|
-
var
|
|
8102
|
-
if (
|
|
8103
|
-
else if (
|
|
8123
|
+
var $ = v(t, 1);
|
|
8124
|
+
if ($ = X[$], $ == null) d = null;
|
|
8125
|
+
else if ($.length == 1) d = $[0];
|
|
8104
8126
|
else d: {
|
|
8105
8127
|
t = t1(t);
|
|
8106
|
-
for (var
|
|
8107
|
-
|
|
8108
|
-
var
|
|
8109
|
-
if (B(
|
|
8110
|
-
if (t.search(
|
|
8111
|
-
d =
|
|
8128
|
+
for (var i, s = $.length, u = 0; u < s; u++) {
|
|
8129
|
+
i = $[u];
|
|
8130
|
+
var l = j(d, i);
|
|
8131
|
+
if (B(l, 23)) {
|
|
8132
|
+
if (t.search(p(l, 23)) == 0) {
|
|
8133
|
+
d = i;
|
|
8112
8134
|
break d;
|
|
8113
8135
|
}
|
|
8114
|
-
} else if (C1(t,
|
|
8115
|
-
d =
|
|
8136
|
+
} else if (C1(t, l) != -1) {
|
|
8137
|
+
d = i;
|
|
8116
8138
|
break d;
|
|
8117
8139
|
}
|
|
8118
8140
|
}
|
|
@@ -8127,144 +8149,144 @@ const H2 = (y) => {
|
|
|
8127
8149
|
if (d = j(d, t), d == null) throw Error("Invalid region code: " + t);
|
|
8128
8150
|
return v(d, 10);
|
|
8129
8151
|
}
|
|
8130
|
-
function
|
|
8131
|
-
var s = u1(
|
|
8132
|
-
if (s = P(s, 10),
|
|
8133
|
-
else return
|
|
8134
|
-
return u[0] == -1 ? 5 : (t = t.length, -1 < s.indexOf(t) ? 4 : (
|
|
8152
|
+
function l1(d, t, $, i) {
|
|
8153
|
+
var s = u1($, i), u = K(s, 9) == 0 ? P(p($, 1), 9) : P(s, 9);
|
|
8154
|
+
if (s = P(s, 10), i == 2) if (k1(u1($, 0))) d = u1($, 1), k1(d) && (u = u.concat(K(d, 9) == 0 ? P(p($, 1), 9) : P(d, 9)), u.sort(), s.length == 0 ? s = P(d, 10) : (s = s.concat(P(d, 10)), s.sort()));
|
|
8155
|
+
else return l1(d, t, $, 1);
|
|
8156
|
+
return u[0] == -1 ? 5 : (t = t.length, -1 < s.indexOf(t) ? 4 : ($ = u[0], $ == t ? 0 : $ > t ? 2 : u[u.length - 1] < t ? 3 : -1 < u.indexOf(t, 1) ? 0 : 5));
|
|
8135
8157
|
}
|
|
8136
|
-
function
|
|
8137
|
-
var
|
|
8138
|
-
return t = v(t, 1), t in X ? (t = d1(d, t, e1(t)),
|
|
8158
|
+
function a1(d, t, $) {
|
|
8159
|
+
var i = t1(t);
|
|
8160
|
+
return t = v(t, 1), t in X ? (t = d1(d, t, e1(t)), l1(d, i, t, $)) : 1;
|
|
8139
8161
|
}
|
|
8140
8162
|
function K1(d, t) {
|
|
8141
8163
|
if (d = d.toString(), d.length == 0 || d.charAt(0) == "0") return 0;
|
|
8142
|
-
for (var
|
|
8164
|
+
for (var $, i = d.length, s = 1; 3 >= s && s <= i; ++s) if ($ = parseInt(d.substring(0, s), 10), $ in X) return t.g(d.substring(s)), $;
|
|
8143
8165
|
return 0;
|
|
8144
8166
|
}
|
|
8145
|
-
function H1(d, t,
|
|
8167
|
+
function H1(d, t, $, i, s, u) {
|
|
8146
8168
|
if (t.length == 0) return 0;
|
|
8147
|
-
t = new
|
|
8148
|
-
var
|
|
8149
|
-
|
|
8169
|
+
t = new N(t);
|
|
8170
|
+
var l;
|
|
8171
|
+
$ != null && (l = p($, 11)), l == null && (l = "NonMatch");
|
|
8150
8172
|
var h = t.toString();
|
|
8151
|
-
if (h.length == 0)
|
|
8152
|
-
else if (Q.test(h)) h = h.replace(Q, ""), k(t), t.g(R1(h)),
|
|
8173
|
+
if (h.length == 0) l = 20;
|
|
8174
|
+
else if (Q.test(h)) h = h.replace(Q, ""), k(t), t.g(R1(h)), l = 1;
|
|
8153
8175
|
else {
|
|
8154
|
-
if (h = new RegExp(
|
|
8155
|
-
h =
|
|
8156
|
-
var m =
|
|
8157
|
-
m && m[1] != null && 0 < m[1].length && s1(m[1], g1) == "0" ?
|
|
8158
|
-
} else
|
|
8159
|
-
|
|
8176
|
+
if (h = new RegExp(l), B1(t), l = t.toString(), l.search(h) == 0) {
|
|
8177
|
+
h = l.match(h)[0].length;
|
|
8178
|
+
var m = l.substring(h).match(D1);
|
|
8179
|
+
m && m[1] != null && 0 < m[1].length && s1(m[1], g1) == "0" ? l = !1 : (k(t), t.g(l.substring(h)), l = !0);
|
|
8180
|
+
} else l = !1;
|
|
8181
|
+
l = l ? 5 : 20;
|
|
8160
8182
|
}
|
|
8161
|
-
if (s && E(u, 6,
|
|
8183
|
+
if (s && E(u, 6, l), l != 20) {
|
|
8162
8184
|
if (2 >= t.h.length) throw Error("Phone number too short after IDD");
|
|
8163
|
-
if (d = K1(t,
|
|
8185
|
+
if (d = K1(t, i), d != 0) return E(u, 1, d), d;
|
|
8164
8186
|
throw Error("Invalid country calling code");
|
|
8165
8187
|
}
|
|
8166
|
-
return
|
|
8188
|
+
return $ != null && (l = v($, 10), h = "" + l, m = t.toString(), m.lastIndexOf(h, 0) == 0 && (h = new N(m.substring(h.length)), m = p($, 1), m = new RegExp(v(m, 2)), j1(h, $, null), h = h.toString(), !U(m, t.toString()) && U(m, h) || l1(d, t.toString(), $, -1) == 3)) ? (i.g(h), s && E(u, 6, 10), E(u, 1, l), l) : (E(u, 1, 0), 0);
|
|
8167
8189
|
}
|
|
8168
|
-
function j1(d, t,
|
|
8169
|
-
var
|
|
8190
|
+
function j1(d, t, $) {
|
|
8191
|
+
var i = d.toString(), s = i.length, u = p(t, 15);
|
|
8170
8192
|
if (s != 0 && u != null && u.length != 0) {
|
|
8171
|
-
var
|
|
8172
|
-
if (s =
|
|
8173
|
-
u = new RegExp(v(
|
|
8174
|
-
var h = U(u,
|
|
8175
|
-
t =
|
|
8193
|
+
var l = new RegExp("^(?:" + u + ")");
|
|
8194
|
+
if (s = l.exec(i)) {
|
|
8195
|
+
u = new RegExp(v(p(t, 1), 2));
|
|
8196
|
+
var h = U(u, i), m = s.length - 1;
|
|
8197
|
+
t = p(t, 16), t == null || t.length == 0 || s[m] == null || s[m].length == 0 ? (!h || U(u, i.substring(s[0].length))) && ($ != null && 0 < m && s[m] != null && $.g(s[1]), d.set(i.substring(s[0].length))) : (i = i.replace(l, t), (!h || U(u, i)) && ($ != null && 0 < m && $.g(s[1]), d.set(i)));
|
|
8176
8198
|
}
|
|
8177
8199
|
}
|
|
8178
8200
|
}
|
|
8179
|
-
function Y(d, t,
|
|
8180
|
-
if (!o1(
|
|
8181
|
-
return W1(d, t,
|
|
8201
|
+
function Y(d, t, $) {
|
|
8202
|
+
if (!o1($) && 0 < t.length && t.charAt(0) != "+") throw Error("Invalid country calling code");
|
|
8203
|
+
return W1(d, t, $, !0);
|
|
8182
8204
|
}
|
|
8183
|
-
function W1(d, t,
|
|
8205
|
+
function W1(d, t, $, i) {
|
|
8184
8206
|
if (t == null) throw Error("The string supplied did not seem to be a phone number");
|
|
8185
8207
|
if (250 < t.length) throw Error("The string supplied is too long to be a phone number");
|
|
8186
|
-
var s = new
|
|
8208
|
+
var s = new N(), u = t.indexOf(";phone-context=");
|
|
8187
8209
|
if (u === -1) u = null;
|
|
8188
8210
|
else if (u += 15, u >= t.length) u = "";
|
|
8189
8211
|
else {
|
|
8190
|
-
var
|
|
8191
|
-
u =
|
|
8212
|
+
var l = t.indexOf(";", u);
|
|
8213
|
+
u = l !== -1 ? t.substring(u, l) : t.substring(u);
|
|
8192
8214
|
}
|
|
8193
8215
|
var h = u;
|
|
8194
|
-
if (h == null ?
|
|
8195
|
-
if (u = s.toString(), !(o1(
|
|
8196
|
-
u = new H(),
|
|
8216
|
+
if (h == null ? l = !0 : h.length === 0 ? l = !1 : (l = _2.exec(h), h = I2.exec(h), l = l !== null || h !== null), !l || (u != null ? (u.charAt(0) === "+" && s.g(u), u = t.indexOf("tel:"), s.g(t.substring(0 <= u ? u + 4 : 0, t.indexOf(";phone-context=")))) : (u = s.g, l = t ?? "", h = l.search(g2), 0 <= h ? (l = l.substring(h), l = l.replace(m2, ""), h = l.search(C2), 0 <= h && (l = l.substring(0, h))) : l = "", u.call(s, l)), u = s.toString(), l = u.indexOf(";isub="), 0 < l && (k(s), s.g(u.substring(0, l))), !x1(s.toString()))) throw Error("The string supplied did not seem to be a phone number");
|
|
8217
|
+
if (u = s.toString(), !(o1($) || u != null && 0 < u.length && Q.test(u))) throw Error("Invalid country calling code");
|
|
8218
|
+
u = new H(), i && E(u, 5, t);
|
|
8197
8219
|
d: {
|
|
8198
|
-
if (t = s.toString(),
|
|
8220
|
+
if (t = s.toString(), l = t.search(P1), 0 <= l && x1(t.substring(0, l))) {
|
|
8199
8221
|
h = t.match(P1);
|
|
8200
8222
|
for (var m = h.length, V = 1; V < m; ++V) if (h[V] != null && 0 < h[V].length) {
|
|
8201
|
-
k(s), s.g(t.substring(0,
|
|
8223
|
+
k(s), s.g(t.substring(0, l)), t = h[V];
|
|
8202
8224
|
break d;
|
|
8203
8225
|
}
|
|
8204
8226
|
}
|
|
8205
8227
|
t = "";
|
|
8206
8228
|
}
|
|
8207
|
-
0 < t.length && E(u, 3, t),
|
|
8229
|
+
0 < t.length && E(u, 3, t), l = j(d, $), t = new N(), h = 0, m = s.toString();
|
|
8208
8230
|
try {
|
|
8209
|
-
h = H1(d, m,
|
|
8231
|
+
h = H1(d, m, l, t, i, u);
|
|
8210
8232
|
} catch (_1) {
|
|
8211
8233
|
if (_1.message == "Invalid country calling code" && Q.test(m)) {
|
|
8212
|
-
if (m = m.replace(Q, ""), h = H1(d, m,
|
|
8234
|
+
if (m = m.replace(Q, ""), h = H1(d, m, l, t, i, u), h == 0) throw _1;
|
|
8213
8235
|
} else throw _1;
|
|
8214
8236
|
}
|
|
8215
|
-
if (h != 0 ? (s = e1(h), s !=
|
|
8237
|
+
if (h != 0 ? (s = e1(h), s != $ && (l = d1(d, h, s))) : (B1(s), t.g(s.toString()), $ != null ? (h = v(l, 10), E(
|
|
8216
8238
|
u,
|
|
8217
8239
|
1,
|
|
8218
8240
|
h
|
|
8219
|
-
)) :
|
|
8241
|
+
)) : i && (delete u.h[6], u.g && delete u.g[6])), 2 > t.h.length || (l != null && ($ = new N(), s = new N(t.toString()), j1(s, l, $), d = l1(d, s.toString(), l, -1), d != 2 && d != 4 && d != 5 && (t = s, i && 0 < $.toString().length && E(u, 7, $.toString()))), i = t.toString(), d = i.length, 2 > d)) throw Error("The string supplied is too short to be a phone number");
|
|
8220
8242
|
if (17 < d) throw Error("The string supplied is too long to be a phone number");
|
|
8221
|
-
if (1 <
|
|
8222
|
-
for (E(u, 4, !0), d = 1; d <
|
|
8243
|
+
if (1 < i.length && i.charAt(0) == "0") {
|
|
8244
|
+
for (E(u, 4, !0), d = 1; d < i.length - 1 && i.charAt(d) == "0"; ) d++;
|
|
8223
8245
|
d != 1 && E(u, 8, d);
|
|
8224
8246
|
}
|
|
8225
|
-
return E(u, 2, parseInt(
|
|
8247
|
+
return E(u, 2, parseInt(i, 10)), u;
|
|
8226
8248
|
}
|
|
8227
8249
|
function U(d, t) {
|
|
8228
8250
|
return !!((d = typeof d == "string" ? t.match("^(?:" + d + ")$") : t.match(d)) && d[0].length == t.length);
|
|
8229
8251
|
}
|
|
8230
|
-
function
|
|
8231
|
-
this.fa = RegExp(" "), this.ja = "", this.v = new
|
|
8252
|
+
function L2(d) {
|
|
8253
|
+
this.fa = RegExp(" "), this.ja = "", this.v = new N(), this.da = "", this.s = new N(), this.ba = new N(), this.u = !0, this.ea = this.ca = this.la = !1, this.ga = D.g(), this.$ = 0, this.h = new N(), this.ha = !1, this.o = "", this.g = new N(), this.j = [], this.ka = d, this.l = Y1(this, this.ka);
|
|
8232
8254
|
}
|
|
8233
8255
|
var z1 = new Z();
|
|
8234
8256
|
E(z1, 11, "NA");
|
|
8235
|
-
var
|
|
8257
|
+
var N2 = RegExp("^[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*\\$1[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*(\\$\\d[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*)*$"), Z1 = /[- ]/;
|
|
8236
8258
|
function Y1(d, t) {
|
|
8237
|
-
var
|
|
8238
|
-
return t = o1(t) ? V1(
|
|
8259
|
+
var $ = d.ga;
|
|
8260
|
+
return t = o1(t) ? V1($, t) : 0, d = j(d.ga, e1(t)), d ?? z1;
|
|
8239
8261
|
}
|
|
8240
8262
|
function J1(d) {
|
|
8241
|
-
for (var t = d.j.length,
|
|
8242
|
-
var
|
|
8263
|
+
for (var t = d.j.length, $ = 0; $ < t; ++$) {
|
|
8264
|
+
var i = d.j[$], s = v(i, 1);
|
|
8243
8265
|
if (d.da == s) return !1;
|
|
8244
|
-
var u = d,
|
|
8266
|
+
var u = d, l = i, h = v(l, 1);
|
|
8245
8267
|
k(u.v);
|
|
8246
8268
|
var m = u;
|
|
8247
|
-
|
|
8269
|
+
l = v(l, 2);
|
|
8248
8270
|
var V = "999999999999999".match(h)[0];
|
|
8249
|
-
if (V.length < m.g.h.length ? m = "" : (m = V.replace(new RegExp(h, "g"),
|
|
8271
|
+
if (V.length < m.g.h.length ? m = "" : (m = V.replace(new RegExp(h, "g"), l), m = m.replace(RegExp("9", "g"), " ")), 0 < m.length ? (u.v.g(m), u = !0) : u = !1, u) return d.da = s, d.ha = Z1.test(p(i, 4)), d.$ = 0, !0;
|
|
8250
8272
|
}
|
|
8251
8273
|
return d.u = !1;
|
|
8252
8274
|
}
|
|
8253
8275
|
function q1(d, t) {
|
|
8254
|
-
for (var
|
|
8255
|
-
var
|
|
8256
|
-
K(
|
|
8276
|
+
for (var $ = [], i = t.length - 3, s = d.j.length, u = 0; u < s; ++u) {
|
|
8277
|
+
var l = d.j[u];
|
|
8278
|
+
K(l, 3) == 0 ? $.push(d.j[u]) : (l = p(l, 3, Math.min(i, K(l, 3) - 1)), t.search(l) == 0 && $.push(d.j[u]));
|
|
8257
8279
|
}
|
|
8258
|
-
d.j =
|
|
8280
|
+
d.j = $;
|
|
8259
8281
|
}
|
|
8260
|
-
function
|
|
8282
|
+
function T2(d, t) {
|
|
8261
8283
|
d.s.g(t);
|
|
8262
|
-
var
|
|
8263
|
-
if (D1.test(
|
|
8284
|
+
var $ = t;
|
|
8285
|
+
if (D1.test($) || d.s.h.length == 1 && p2.test($) ? (t == "+" ? ($ = t, d.ba.g(t)) : ($ = g1[t], d.ba.g($), d.g.g($)), t = $) : (d.u = !1, d.la = !0), !d.u) {
|
|
8264
8286
|
if (!d.la) {
|
|
8265
8287
|
if (e2(d)) {
|
|
8266
8288
|
if ($2(d)) return X1(d);
|
|
8267
|
-
} else if (0 < d.o.length && (t = d.g.toString(), k(d.g), d.g.g(d.o), d.g.g(t), t = d.h.toString(),
|
|
8289
|
+
} else if (0 < d.o.length && (t = d.g.toString(), k(d.g), d.g.g(d.o), d.g.g(t), t = d.h.toString(), $ = t.lastIndexOf(d.o), k(d.h), d.h.g(t.substring(0, $))), d.o != t2(d)) return d.h.g(" "), X1(d);
|
|
8268
8290
|
}
|
|
8269
8291
|
return d.s.toString();
|
|
8270
8292
|
}
|
|
@@ -8277,93 +8299,93 @@ const H2 = (y) => {
|
|
|
8277
8299
|
if (e2(d)) d.ea = !0;
|
|
8278
8300
|
else return d.o = t2(d), m1(d);
|
|
8279
8301
|
default:
|
|
8280
|
-
return d.ea ? ($2(d) && (d.ea = !1), d.h.toString() + d.g.toString()) : 0 < d.j.length ? (t = n2(d, t),
|
|
8302
|
+
return d.ea ? ($2(d) && (d.ea = !1), d.h.toString() + d.g.toString()) : 0 < d.j.length ? (t = n2(d, t), $ = Q1(d), 0 < $.length ? $ : (q1(d, d.g.toString()), J1(d) ? d2(d) : d.u ? h1(d, t) : d.s.toString())) : m1(d);
|
|
8281
8303
|
}
|
|
8282
8304
|
}
|
|
8283
8305
|
function X1(d) {
|
|
8284
8306
|
return d.u = !0, d.ea = !1, d.j = [], d.$ = 0, k(d.v), d.da = "", m1(d);
|
|
8285
8307
|
}
|
|
8286
8308
|
function Q1(d) {
|
|
8287
|
-
for (var t = d.g.toString(),
|
|
8288
|
-
var s = d.j[
|
|
8289
|
-
if (new RegExp("^(?:" + u + ")$").test(t) && (d.ha = Z1.test(
|
|
8309
|
+
for (var t = d.g.toString(), $ = d.j.length, i = 0; i < $; ++i) {
|
|
8310
|
+
var s = d.j[i], u = v(s, 1);
|
|
8311
|
+
if (new RegExp("^(?:" + u + ")$").test(t) && (d.ha = Z1.test(p(s, 4)), s = t.replace(new RegExp(u, "g"), p(s, 2)), s = h1(d, s), s1(s, c2) == d.ba)) return s;
|
|
8290
8312
|
}
|
|
8291
8313
|
return "";
|
|
8292
8314
|
}
|
|
8293
8315
|
function h1(d, t) {
|
|
8294
|
-
var
|
|
8295
|
-
return d.ha && 0 <
|
|
8316
|
+
var $ = d.h.h.length;
|
|
8317
|
+
return d.ha && 0 < $ && d.h.toString().charAt($ - 1) != " " ? d.h + " " + t : d.h + t;
|
|
8296
8318
|
}
|
|
8297
8319
|
function m1(d) {
|
|
8298
8320
|
var t = d.g.toString();
|
|
8299
8321
|
if (3 <= t.length) {
|
|
8300
|
-
for (var
|
|
8301
|
-
var u =
|
|
8302
|
-
0 < d.o.length && O1(v(u, 4)) && !
|
|
8322
|
+
for (var $ = d.ca && d.o.length == 0 && 0 < K(d.l, 20) ? P(d.l, 20) : P(d.l, 19), i = $.length, s = 0; s < i; ++s) {
|
|
8323
|
+
var u = $[s];
|
|
8324
|
+
0 < d.o.length && O1(v(u, 4)) && !p(u, 6) && !B(u, 5) || (d.o.length != 0 || d.ca || O1(v(u, 4)) || p(u, 6)) && N2.test(v(u, 2)) && d.j.push(u);
|
|
8303
8325
|
}
|
|
8304
8326
|
return q1(d, t), t = Q1(d), 0 < t.length ? t : J1(d) ? d2(d) : d.s.toString();
|
|
8305
8327
|
}
|
|
8306
8328
|
return h1(d, t);
|
|
8307
8329
|
}
|
|
8308
8330
|
function d2(d) {
|
|
8309
|
-
var t = d.g.toString(),
|
|
8310
|
-
if (0 <
|
|
8311
|
-
for (var
|
|
8312
|
-
return d.u ? h1(d,
|
|
8331
|
+
var t = d.g.toString(), $ = t.length;
|
|
8332
|
+
if (0 < $) {
|
|
8333
|
+
for (var i = "", s = 0; s < $; s++) i = n2(d, t.charAt(s));
|
|
8334
|
+
return d.u ? h1(d, i) : d.s.toString();
|
|
8313
8335
|
}
|
|
8314
8336
|
return d.h.toString();
|
|
8315
8337
|
}
|
|
8316
8338
|
function t2(d) {
|
|
8317
|
-
var t = d.g.toString(),
|
|
8318
|
-
if (
|
|
8319
|
-
else
|
|
8320
|
-
return
|
|
8339
|
+
var t = d.g.toString(), $ = 0;
|
|
8340
|
+
if (p(d.l, 10) != 1) var i = !1;
|
|
8341
|
+
else i = d.g.toString(), i = i.charAt(0) == "1" && i.charAt(1) != "0" && i.charAt(1) != "1";
|
|
8342
|
+
return i ? ($ = 1, d.h.g("1").g(" "), d.ca = !0) : B(d.l, 15) && (i = new RegExp("^(?:" + p(d.l, 15) + ")"), i = t.match(i), i != null && i[0] != null && 0 < i[0].length && (d.ca = !0, $ = i[0].length, d.h.g(t.substring(0, $)))), k(d.g), d.g.g(t.substring($)), t.substring(0, $);
|
|
8321
8343
|
}
|
|
8322
8344
|
function e2(d) {
|
|
8323
|
-
var t = d.ba.toString(),
|
|
8324
|
-
return
|
|
8345
|
+
var t = d.ba.toString(), $ = new RegExp("^(?:\\+|" + p(d.l, 11) + ")");
|
|
8346
|
+
return $ = t.match($), $ != null && $[0] != null && 0 < $[0].length ? (d.ca = !0, $ = $[0].length, k(d.g), d.g.g(t.substring($)), k(d.h), d.h.g(t.substring(0, $)), t.charAt(0) != "+" && d.h.g(" "), !0) : !1;
|
|
8325
8347
|
}
|
|
8326
8348
|
function $2(d) {
|
|
8327
8349
|
if (d.g.h.length == 0) return !1;
|
|
8328
|
-
var t = new
|
|
8329
|
-
return
|
|
8350
|
+
var t = new N(), $ = K1(d.g, t);
|
|
8351
|
+
return $ == 0 ? !1 : (k(d.g), d.g.g(t.toString()), t = e1($), t == "001" ? d.l = j(d.ga, "" + $) : t != d.ka && (d.l = Y1(d, t)), d.h.g("" + $).g(" "), d.o = "", !0);
|
|
8330
8352
|
}
|
|
8331
8353
|
function n2(d, t) {
|
|
8332
|
-
var
|
|
8333
|
-
if (0 <=
|
|
8334
|
-
var
|
|
8335
|
-
return t =
|
|
8354
|
+
var $ = d.v.toString();
|
|
8355
|
+
if (0 <= $.substring(d.$).search(d.fa)) {
|
|
8356
|
+
var i = $.search(d.fa);
|
|
8357
|
+
return t = $.replace(d.fa, t), k(d.v), d.v.g(t), d.$ = i, t.substring(0, d.$ + 1);
|
|
8336
8358
|
}
|
|
8337
8359
|
return d.j.length == 1 && (d.u = !1), d.da = "", d.s.toString();
|
|
8338
8360
|
}
|
|
8339
8361
|
const y1 = { 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 };
|
|
8340
|
-
|
|
8362
|
+
e("intlTelInputUtilsTemp", {}), e("intlTelInputUtilsTemp.formatNumberAsYouType", (d, t) => {
|
|
8341
8363
|
try {
|
|
8342
|
-
const
|
|
8364
|
+
const $ = d.replace(/[^+0-9]/g, ""), i = new L2(t);
|
|
8343
8365
|
t = "";
|
|
8344
|
-
for (let s = 0; s <
|
|
8366
|
+
for (let s = 0; s < $.length; s++) i.ja = T2(i, $.charAt(s)), t = i.ja;
|
|
8345
8367
|
return t;
|
|
8346
8368
|
} catch {
|
|
8347
8369
|
return d;
|
|
8348
8370
|
}
|
|
8349
|
-
}),
|
|
8371
|
+
}), e("intlTelInputUtilsTemp.formatNumber", (d, t, $) => {
|
|
8350
8372
|
try {
|
|
8351
8373
|
const s = D.g(), u = Y(s, d, t);
|
|
8352
|
-
var
|
|
8353
|
-
return
|
|
8374
|
+
var i = a1(s, u, -1);
|
|
8375
|
+
return i == 0 || i == 4 ? s.format(u, typeof $ > "u" ? 0 : $) : d;
|
|
8354
8376
|
} catch {
|
|
8355
8377
|
return d;
|
|
8356
8378
|
}
|
|
8357
|
-
}),
|
|
8379
|
+
}), e("intlTelInputUtilsTemp.getExampleNumber", (d, t, $, i) => {
|
|
8358
8380
|
try {
|
|
8359
8381
|
const m = D.g();
|
|
8360
8382
|
d: {
|
|
8361
8383
|
var s = m;
|
|
8362
8384
|
if (o1(d)) {
|
|
8363
|
-
var u = u1(j(s, d),
|
|
8385
|
+
var u = u1(j(s, d), $);
|
|
8364
8386
|
try {
|
|
8365
8387
|
if (B(u, 6)) {
|
|
8366
|
-
var
|
|
8388
|
+
var l = p(u, 6), h = W1(s, l, d, !1);
|
|
8367
8389
|
break d;
|
|
8368
8390
|
}
|
|
8369
8391
|
} catch {
|
|
@@ -8371,61 +8393,61 @@ const H2 = (y) => {
|
|
|
8371
8393
|
}
|
|
8372
8394
|
h = null;
|
|
8373
8395
|
}
|
|
8374
|
-
return m.format(h,
|
|
8396
|
+
return m.format(h, i ? 0 : t ? 2 : 1);
|
|
8375
8397
|
} catch {
|
|
8376
8398
|
return "";
|
|
8377
8399
|
}
|
|
8378
|
-
}),
|
|
8400
|
+
}), e("intlTelInputUtilsTemp.getExtension", (d, t) => {
|
|
8379
8401
|
try {
|
|
8380
|
-
return
|
|
8402
|
+
return p(Y(D.g(), d, t), 3);
|
|
8381
8403
|
} catch {
|
|
8382
8404
|
return "";
|
|
8383
8405
|
}
|
|
8384
|
-
}),
|
|
8406
|
+
}), e("intlTelInputUtilsTemp.getNumberType", (d, t) => {
|
|
8385
8407
|
try {
|
|
8386
|
-
const
|
|
8387
|
-
return F1(
|
|
8408
|
+
const $ = D.g(), i = Y($, d, t);
|
|
8409
|
+
return F1($, i);
|
|
8388
8410
|
} catch {
|
|
8389
8411
|
return -99;
|
|
8390
8412
|
}
|
|
8391
|
-
}),
|
|
8413
|
+
}), e("intlTelInputUtilsTemp.getValidationError", (d, t) => {
|
|
8392
8414
|
if (!t) return 1;
|
|
8393
8415
|
try {
|
|
8394
|
-
const
|
|
8395
|
-
return
|
|
8396
|
-
} catch (
|
|
8397
|
-
return
|
|
8416
|
+
const $ = D.g(), i = Y($, d, t);
|
|
8417
|
+
return a1($, i, -1);
|
|
8418
|
+
} catch ($) {
|
|
8419
|
+
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;
|
|
8398
8420
|
}
|
|
8399
|
-
}),
|
|
8421
|
+
}), e("intlTelInputUtilsTemp.isValidNumber", (d, t, $) => {
|
|
8400
8422
|
try {
|
|
8401
|
-
const
|
|
8402
|
-
if (
|
|
8403
|
-
const
|
|
8404
|
-
return u &&
|
|
8423
|
+
const i = D.g(), s = Y(i, d, t), u = b2(i, s);
|
|
8424
|
+
if ($) {
|
|
8425
|
+
const l = $.map((h) => y1[h]);
|
|
8426
|
+
return u && l.includes(F1(i, s));
|
|
8405
8427
|
}
|
|
8406
8428
|
return u;
|
|
8407
8429
|
} catch {
|
|
8408
8430
|
return !1;
|
|
8409
8431
|
}
|
|
8410
|
-
}),
|
|
8432
|
+
}), e("intlTelInputUtilsTemp.isPossibleNumber", (d, t, $) => {
|
|
8411
8433
|
try {
|
|
8412
|
-
const
|
|
8413
|
-
if (
|
|
8414
|
-
|
|
8415
|
-
for (let u of
|
|
8434
|
+
const i = D.g(), s = Y(i, d, t);
|
|
8435
|
+
if ($) {
|
|
8436
|
+
$.includes("FIXED_LINE_OR_MOBILE") && ($.includes("MOBILE") || $.push("MOBILE"), $.includes("FIXED_LINE") || $.push("FIXED_LINE"));
|
|
8437
|
+
for (let u of $) if (a1(i, s, y1[u]) === 0) return !0;
|
|
8416
8438
|
return !1;
|
|
8417
8439
|
}
|
|
8418
|
-
return
|
|
8440
|
+
return a1(i, s, -1) === 0;
|
|
8419
8441
|
} catch {
|
|
8420
8442
|
return !1;
|
|
8421
8443
|
}
|
|
8422
|
-
}),
|
|
8444
|
+
}), e("intlTelInputUtilsTemp.getCoreNumber", (d, t) => {
|
|
8423
8445
|
try {
|
|
8424
|
-
return
|
|
8446
|
+
return p(Y(D.g(), d, t), 2).toString();
|
|
8425
8447
|
} catch {
|
|
8426
8448
|
return "";
|
|
8427
8449
|
}
|
|
8428
|
-
}),
|
|
8450
|
+
}), e("intlTelInputUtilsTemp.numberFormat", { E164: 0, INTERNATIONAL: 1, NATIONAL: 2, RFC3966: 3 }), e("intlTelInputUtilsTemp.numberType", y1), e("intlTelInputUtilsTemp.validationError", { IS_POSSIBLE: 0, INVALID_COUNTRY_CODE: 1, TOO_SHORT: 2, TOO_LONG: 3, IS_POSSIBLE_LOCAL_ONLY: 4, INVALID_LENGTH: 5 });
|
|
8429
8451
|
})();
|
|
8430
8452
|
const j2 = window.intlTelInputUtilsTemp;
|
|
8431
8453
|
delete window.intlTelInputUtilsTemp;
|
|
@@ -8462,40 +8484,40 @@ const z2 = {
|
|
|
8462
8484
|
"changeValidity",
|
|
8463
8485
|
"changeErrorCode"
|
|
8464
8486
|
], ["update:modelValue"]),
|
|
8465
|
-
setup(y, { expose:
|
|
8466
|
-
const
|
|
8467
|
-
let
|
|
8468
|
-
|
|
8487
|
+
setup(y, { expose: e, emit: n }) {
|
|
8488
|
+
const r = A2(y, "modelValue"), o = y, a = n, c = I1(), g = I1(), f = I1(!1), S = () => g.value ? o.options.strictMode ? g.value.isValidNumberPrecise() : g.value.isValidNumber() : null, _ = () => {
|
|
8489
|
+
let I = S();
|
|
8490
|
+
f.value !== I && (f.value = I, a("changeValidity", !!I), a(
|
|
8469
8491
|
"changeErrorCode",
|
|
8470
|
-
|
|
8492
|
+
I ? null : g.value.getValidationError()
|
|
8471
8493
|
));
|
|
8472
|
-
},
|
|
8473
|
-
var
|
|
8474
|
-
|
|
8475
|
-
},
|
|
8476
|
-
var
|
|
8477
|
-
|
|
8494
|
+
}, b = () => {
|
|
8495
|
+
var I;
|
|
8496
|
+
a("changeNumber", ((I = g.value) == null ? void 0 : I.getNumber()) ?? ""), _();
|
|
8497
|
+
}, w = () => {
|
|
8498
|
+
var I;
|
|
8499
|
+
a("changeCountry", ((I = g.value) == null ? void 0 : I.getSelectedCountryData().iso2) ?? ""), b(), _();
|
|
8478
8500
|
};
|
|
8479
8501
|
return E2(() => {
|
|
8480
|
-
c.value && (
|
|
8502
|
+
c.value && (g.value = C(c.value, o.options), o.value && g.value.setNumber(o.value), o.disabled && g.value.setDisabled(o.disabled));
|
|
8481
8503
|
}), D2(
|
|
8482
8504
|
() => o.disabled,
|
|
8483
|
-
(
|
|
8484
|
-
var
|
|
8485
|
-
return (
|
|
8505
|
+
(I) => {
|
|
8506
|
+
var A;
|
|
8507
|
+
return (A = g.value) == null ? void 0 : A.setDisabled(I);
|
|
8486
8508
|
}
|
|
8487
8509
|
), M2(() => {
|
|
8488
|
-
var
|
|
8489
|
-
return (
|
|
8490
|
-
}),
|
|
8510
|
+
var I;
|
|
8511
|
+
return (I = g.value) == null ? void 0 : I.destroy();
|
|
8512
|
+
}), e({ instance: g, input: c }), (I, A) => P2((x2(), R2("input", B2({
|
|
8491
8513
|
ref_key: "input",
|
|
8492
8514
|
ref: c,
|
|
8493
|
-
"onUpdate:modelValue":
|
|
8515
|
+
"onUpdate:modelValue": A[0] || (A[0] = (G) => r.value = G),
|
|
8494
8516
|
type: "tel",
|
|
8495
|
-
onCountrychange:
|
|
8496
|
-
onInput:
|
|
8517
|
+
onCountrychange: w,
|
|
8518
|
+
onInput: b
|
|
8497
8519
|
}, y.inputProps), null, 16)), [
|
|
8498
|
-
[k2,
|
|
8520
|
+
[k2, r.value]
|
|
8499
8521
|
]);
|
|
8500
8522
|
}
|
|
8501
8523
|
};
|