intl-tel-input 25.11.0 → 25.11.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/angular/README.md +1 -1
- package/angular/build/IntlTelInput.js +349 -200
- package/angular/build/IntlTelInputWithUtils.js +349 -200
- package/angular/build/types/intl-tel-input/data.d.ts +3 -3
- package/angular/build/types/intl-tel-input.d.ts +5 -1
- package/angular/build/types/modules/constants.d.ts +84 -0
- package/angular/build/types/modules/core/countrySearch.d.ts +17 -0
- package/angular/build/types/modules/core/icons.d.ts +7 -0
- package/angular/build/types/modules/core/options.d.ts +2 -1
- package/angular/build/types/modules/data/country-data.d.ts +5 -5
- package/angular/build/types/modules/format/caret.d.ts +1 -1
- package/angular/build/types/modules/format/formatting.d.ts +2 -2
- package/angular/build/types/modules/types/events.d.ts +5 -4
- package/build/js/data.js +8 -2
- package/build/js/data.min.js +2 -2
- package/build/js/intlTelInput.d.ts +137 -17
- package/build/js/intlTelInput.js +397 -226
- package/build/js/intlTelInput.min.js +13 -13
- package/build/js/intlTelInputWithUtils.js +397 -226
- package/build/js/intlTelInputWithUtils.min.js +13 -13
- package/package.json +2 -1
- package/react/README.md +1 -1
- package/react/build/IntlTelInput.cjs +396 -225
- package/react/build/IntlTelInput.d.ts +137 -17
- package/react/build/IntlTelInput.js +396 -225
- package/react/build/IntlTelInputWithUtils.cjs +396 -225
- package/react/build/IntlTelInputWithUtils.js +396 -225
- package/vue/README.md +1 -1
- package/vue/build/IntlTelInput.mjs +514 -390
- package/vue/build/IntlTelInputWithUtils.mjs +923 -799
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { mergeModels as
|
|
2
|
-
const
|
|
1
|
+
import { mergeModels as g0, useModel as j0, ref as A1, onMounted as Y0, watch as z0, onUnmounted as Z0, withDirectives as J0, createElementBlock as X0, openBlock as q0, mergeProps as Q0, vModelText as d2 } from "vue";
|
|
2
|
+
const t2 = [
|
|
3
3
|
[
|
|
4
4
|
"af",
|
|
5
5
|
// Afghanistan
|
|
@@ -1676,20 +1676,26 @@ const K0 = [
|
|
|
1676
1676
|
null,
|
|
1677
1677
|
"0"
|
|
1678
1678
|
]
|
|
1679
|
-
],
|
|
1680
|
-
for (const
|
|
1681
|
-
|
|
1679
|
+
], Q = [];
|
|
1680
|
+
for (const h of t2)
|
|
1681
|
+
Q.push({
|
|
1682
1682
|
name: "",
|
|
1683
1683
|
// populated in the plugin
|
|
1684
|
-
iso2:
|
|
1685
|
-
dialCode:
|
|
1686
|
-
priority:
|
|
1687
|
-
areaCodes:
|
|
1684
|
+
iso2: h[0],
|
|
1685
|
+
dialCode: h[1],
|
|
1686
|
+
priority: h[2] || 0,
|
|
1687
|
+
areaCodes: h[3] || null,
|
|
1688
1688
|
nodeById: {},
|
|
1689
1689
|
// populated by the plugin
|
|
1690
|
-
nationalPrefix:
|
|
1690
|
+
nationalPrefix: h[4] || null,
|
|
1691
|
+
normalisedName: "",
|
|
1692
|
+
// populated in the plugin
|
|
1693
|
+
initials: "",
|
|
1694
|
+
// populated in the plugin
|
|
1695
|
+
dialCodePlus: ""
|
|
1696
|
+
// populated in the plugin
|
|
1691
1697
|
});
|
|
1692
|
-
const
|
|
1698
|
+
const e2 = {
|
|
1693
1699
|
ad: "Andorra",
|
|
1694
1700
|
ae: "United Arab Emirates",
|
|
1695
1701
|
af: "Afghanistan",
|
|
@@ -1932,7 +1938,7 @@ const a0 = {
|
|
|
1932
1938
|
za: "South Africa",
|
|
1933
1939
|
zm: "Zambia",
|
|
1934
1940
|
zw: "Zimbabwe"
|
|
1935
|
-
},
|
|
1941
|
+
}, $2 = {
|
|
1936
1942
|
selectedCountryAriaLabel: "Change country, selected ${countryName} (${dialCode})",
|
|
1937
1943
|
noCountrySelected: "Select country",
|
|
1938
1944
|
countryListAriaLabel: "List of countries",
|
|
@@ -1944,19 +1950,95 @@ const a0 = {
|
|
|
1944
1950
|
// additional countries (not supported by country-list library)
|
|
1945
1951
|
ac: "Ascension Island",
|
|
1946
1952
|
xk: "Kosovo"
|
|
1947
|
-
},
|
|
1953
|
+
}, E0 = { ...e2, ...$2 }, g1 = {
|
|
1954
|
+
OPEN_COUNTRY_DROPDOWN: "open:countrydropdown",
|
|
1955
|
+
CLOSE_COUNTRY_DROPDOWN: "close:countrydropdown",
|
|
1956
|
+
COUNTRY_CHANGE: "countrychange",
|
|
1957
|
+
INPUT: "input"
|
|
1958
|
+
// used for synthetic input trigger
|
|
1959
|
+
}, E = {
|
|
1960
|
+
HIDE: "iti__hide",
|
|
1961
|
+
V_HIDE: "iti__v-hide",
|
|
1962
|
+
ARROW_UP: "iti__arrow--up",
|
|
1963
|
+
GLOBE: "iti__globe",
|
|
1964
|
+
FLAG: "iti__flag",
|
|
1965
|
+
COUNTRY_ITEM: "iti__country",
|
|
1966
|
+
HIGHLIGHT: "iti__highlight"
|
|
1967
|
+
}, x = {
|
|
1968
|
+
ARROW_UP: "ArrowUp",
|
|
1969
|
+
ARROW_DOWN: "ArrowDown",
|
|
1970
|
+
SPACE: " ",
|
|
1971
|
+
ENTER: "Enter",
|
|
1972
|
+
ESC: "Escape",
|
|
1973
|
+
TAB: "Tab"
|
|
1974
|
+
}, m0 = {
|
|
1975
|
+
PASTE: "insertFromPaste",
|
|
1976
|
+
DELETE_FWD: "deleteContentForward"
|
|
1977
|
+
}, q = {
|
|
1978
|
+
ALPHA_UNICODE: new RegExp("\\p{L}", "u"),
|
|
1979
|
+
// any kind of letter from any language
|
|
1980
|
+
NON_PLUS_NUMERIC: /[^+0-9]/,
|
|
1981
|
+
// chars that are NOT + or digit
|
|
1982
|
+
NON_PLUS_NUMERIC_GLOBAL: /[^+0-9]/g,
|
|
1983
|
+
// chars that are NOT + or digit (global)
|
|
1984
|
+
HIDDEN_SEARCH_CHAR: /^[a-zA-ZÀ-ÿа-яА-Я ]$/
|
|
1985
|
+
// single acceptable hidden-search char
|
|
1986
|
+
}, n2 = {
|
|
1987
|
+
HIDDEN_SEARCH_RESET_MS: 1e3
|
|
1988
|
+
}, y0 = {
|
|
1989
|
+
UNKNOWN_NUMBER_TYPE: -99,
|
|
1990
|
+
UNKNOWN_VALIDATION_ERROR: -99
|
|
1991
|
+
}, w1 = {
|
|
1992
|
+
SANE_SELECTED_WITH_DIAL_WIDTH: 78,
|
|
1993
|
+
// px width fallback when separateDialCode enabled
|
|
1994
|
+
SANE_SELECTED_NO_DIAL_WIDTH: 42,
|
|
1995
|
+
// px width fallback when no separate dial code
|
|
1996
|
+
INPUT_PADDING_EXTRA_LEFT: 6
|
|
1997
|
+
// px gap between selected country container and input text
|
|
1998
|
+
}, N0 = {
|
|
1999
|
+
NANP: "1"
|
|
2000
|
+
// North American Numbering Plan
|
|
2001
|
+
}, b1 = {
|
|
2002
|
+
DIAL_CODE: "44",
|
|
2003
|
+
// +44 United Kingdom
|
|
2004
|
+
MOBILE_PREFIX: "7",
|
|
2005
|
+
// UK mobile numbers start with 7 after national trunk (0) or core section
|
|
2006
|
+
MOBILE_CORE_LENGTH: 10
|
|
2007
|
+
// core number length (excluding dial code / national prefix) for mobiles
|
|
2008
|
+
}, i2 = {
|
|
2009
|
+
ISO2: "us"
|
|
2010
|
+
}, s2 = {
|
|
2011
|
+
POLITE: "polite"
|
|
2012
|
+
}, T1 = {
|
|
2013
|
+
AUTO: "auto"
|
|
2014
|
+
}, I0 = {
|
|
2015
|
+
COUNTRY_CODE: "countryCode",
|
|
2016
|
+
DIAL_CODE: "dialCode"
|
|
2017
|
+
}, L = {
|
|
2018
|
+
EXPANDED: "aria-expanded",
|
|
2019
|
+
LABEL: "aria-label",
|
|
2020
|
+
SELECTED: "aria-selected",
|
|
2021
|
+
ACTIVE_DESCENDANT: "aria-activedescendant",
|
|
2022
|
+
HASPOPUP: "aria-haspopup",
|
|
2023
|
+
CONTROLS: "aria-controls",
|
|
2024
|
+
HIDDEN: "aria-hidden",
|
|
2025
|
+
AUTOCOMPLETE: "aria-autocomplete",
|
|
2026
|
+
MODAL: "aria-modal"
|
|
2027
|
+
}, D1 = (h) => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(h).matches, r2 = () => {
|
|
1948
2028
|
if (typeof navigator < "u" && typeof window < "u") {
|
|
1949
|
-
const
|
|
1950
|
-
|
|
2029
|
+
const h = /Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
|
|
2030
|
+
navigator.userAgent
|
|
2031
|
+
), e = D1("(max-width: 500px)"), $ = D1("(max-height: 600px)"), i = D1("(pointer: coarse)");
|
|
2032
|
+
return h || e || i && $;
|
|
1951
2033
|
}
|
|
1952
2034
|
return !1;
|
|
1953
|
-
},
|
|
2035
|
+
}, S0 = {
|
|
1954
2036
|
// Allow alphanumeric "phonewords" (e.g. +1 800 FLOWERS) as valid numbers
|
|
1955
2037
|
allowPhonewords: !1,
|
|
1956
2038
|
//* Whether or not to allow the dropdown.
|
|
1957
2039
|
allowDropdown: !0,
|
|
1958
2040
|
//* Add a placeholder in the input with an example number for the selected country.
|
|
1959
|
-
autoPlaceholder:
|
|
2041
|
+
autoPlaceholder: s2.POLITE,
|
|
1960
2042
|
//* Modify the parentClass.
|
|
1961
2043
|
containerClass: "",
|
|
1962
2044
|
//* The order of the countries in the dropdown. Defaults to alphabetical.
|
|
@@ -1998,18 +2080,51 @@ const a0 = {
|
|
|
1998
2080
|
//* Only allow certain chars e.g. a plus followed by numeric digits, and cap at max valid length.
|
|
1999
2081
|
strictMode: !1,
|
|
2000
2082
|
//* Use full screen popup instead of dropdown for country list.
|
|
2001
|
-
useFullscreenPopup:
|
|
2083
|
+
useFullscreenPopup: r2(),
|
|
2002
2084
|
//* The number type to enforce during validation.
|
|
2003
2085
|
validationNumberTypes: ["MOBILE"]
|
|
2086
|
+
}, o2 = (h, e) => {
|
|
2087
|
+
h.useFullscreenPopup && (h.fixDropdownWidth = !1), h.onlyCountries.length === 1 && (h.initialCountry = h.onlyCountries[0]), h.separateDialCode && (h.nationalMode = !1), h.allowDropdown && !h.showFlags && !h.separateDialCode && (h.nationalMode = !1), h.useFullscreenPopup && !h.dropdownContainer && (h.dropdownContainer = document.body), h.i18n = { ...e, ...h.i18n };
|
|
2088
|
+
}, m1 = (h) => h.replace(/\D/g, ""), L0 = (h = "") => h.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase(), u2 = (h, e) => {
|
|
2089
|
+
const $ = L0(e), i = [], s = [], a = [], u = [], f = [], C = [];
|
|
2090
|
+
for (const _ of h)
|
|
2091
|
+
_.iso2 === $ ? i.push(_) : _.normalisedName.startsWith($) ? s.push(_) : _.normalisedName.includes($) ? a.push(_) : $ === _.dialCode || $ === _.dialCodePlus ? u.push(_) : _.dialCodePlus.includes($) ? f.push(_) : _.initials.includes($) && C.push(_);
|
|
2092
|
+
const I = (_, A) => _.priority - A.priority;
|
|
2093
|
+
return [
|
|
2094
|
+
...i.sort(I),
|
|
2095
|
+
...s.sort(I),
|
|
2096
|
+
...a.sort(I),
|
|
2097
|
+
...u.sort(I),
|
|
2098
|
+
...f.sort(I),
|
|
2099
|
+
...C.sort(I)
|
|
2100
|
+
];
|
|
2101
|
+
}, l2 = (h, e) => {
|
|
2102
|
+
const $ = e.toLowerCase();
|
|
2103
|
+
for (const i of h)
|
|
2104
|
+
if (i.name.toLowerCase().startsWith($))
|
|
2105
|
+
return i;
|
|
2106
|
+
return null;
|
|
2107
|
+
}, v1 = (h) => Object.keys(h).filter((e) => !!h[e]).join(" "), w = (h, e, $) => {
|
|
2108
|
+
const i = document.createElement(h);
|
|
2109
|
+
return e && Object.entries(e).forEach(
|
|
2110
|
+
([s, a]) => i.setAttribute(s, a)
|
|
2111
|
+
), $ && $.appendChild(i), i;
|
|
2112
|
+
}, a2 = () => `
|
|
2113
|
+
<svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" ${L.HIDDEN}="true">
|
|
2114
|
+
<circle cx="11" cy="11" r="7" />
|
|
2115
|
+
<line x1="21" y1="21" x2="16.65" y2="16.65" />
|
|
2116
|
+
</svg>`, c2 = (h) => {
|
|
2117
|
+
const e = `iti-${h}-clear-mask`;
|
|
2118
|
+
return `
|
|
2119
|
+
<svg class="iti__search-clear-svg" width="12" height="12" viewBox="0 0 16 16" ${L.HIDDEN}="true" focusable="false">
|
|
2120
|
+
<mask id="${e}" maskUnits="userSpaceOnUse">
|
|
2121
|
+
<rect width="16" height="16" fill="white" />
|
|
2122
|
+
<path d="M5.2 5.2 L10.8 10.8 M10.8 5.2 L5.2 10.8" stroke="black" stroke-linecap="round" class="iti__search-clear-x" />
|
|
2123
|
+
</mask>
|
|
2124
|
+
<circle cx="8" cy="8" r="8" class="iti__search-clear-bg" mask="url(#${e})" />
|
|
2125
|
+
</svg>`;
|
|
2004
2126
|
};
|
|
2005
|
-
|
|
2006
|
-
p.useFullscreenPopup && (p.fixDropdownWidth = !1), p.onlyCountries.length === 1 && (p.initialCountry = p.onlyCountries[0]), p.separateDialCode && (p.nationalMode = !1), p.allowDropdown && !p.showFlags && !p.separateDialCode && (p.nationalMode = !1), p.useFullscreenPopup && !p.dropdownContainer && (p.dropdownContainer = document.body), p.i18n = { ...W0, ...p.i18n };
|
|
2007
|
-
}
|
|
2008
|
-
const c1 = (p) => p.replace(/\D/g, ""), c0 = (p = "") => p.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase(), w1 = (p) => Object.keys(p).filter((e) => !!p[e]).join(" "), v = (p, e, $) => {
|
|
2009
|
-
const i = document.createElement(p);
|
|
2010
|
-
return e && Object.entries(e).forEach(([s, h]) => i.setAttribute(s, h)), $ && $.appendChild(i), i;
|
|
2011
|
-
};
|
|
2012
|
-
class Z0 {
|
|
2127
|
+
class h2 {
|
|
2013
2128
|
constructor(e, $, i) {
|
|
2014
2129
|
this.highlightedItem = null, e.dataset.intlTelInputId = i.toString(), this.telInput = e, this.options = $, this.id = i, this.hadInitialPlaceholder = !!e.getAttribute("placeholder"), this.isRTL = !!this.telInput.closest("[dir=rtl]"), this.options.separateDialCode && (this.originalPaddingLeft = this.telInput.style.paddingLeft);
|
|
2015
2130
|
}
|
|
@@ -2024,58 +2139,53 @@ class Z0 {
|
|
|
2024
2139
|
this.telInput.classList.add("iti__tel-input"), !this.telInput.hasAttribute("autocomplete") && !((e = this.telInput.form) != null && e.hasAttribute("autocomplete")) && this.telInput.setAttribute("autocomplete", "off");
|
|
2025
2140
|
}
|
|
2026
2141
|
_createWrapperAndInsert() {
|
|
2027
|
-
const {
|
|
2028
|
-
allowDropdown: e,
|
|
2029
|
-
showFlags: $,
|
|
2030
|
-
containerClass: i,
|
|
2031
|
-
useFullscreenPopup: s
|
|
2032
|
-
} = this.options, h = w1({
|
|
2142
|
+
const { allowDropdown: e, showFlags: $, containerClass: i, useFullscreenPopup: s } = this.options, a = v1({
|
|
2033
2143
|
iti: !0,
|
|
2034
2144
|
"iti--allow-dropdown": e,
|
|
2035
2145
|
"iti--show-flags": $,
|
|
2036
2146
|
"iti--inline-dropdown": !s,
|
|
2037
2147
|
[i]: !!i
|
|
2038
|
-
}), u =
|
|
2148
|
+
}), u = w("div", { class: a });
|
|
2039
2149
|
return this.isRTL && u.setAttribute("dir", "ltr"), this.telInput.before(u), u;
|
|
2040
2150
|
}
|
|
2041
2151
|
_maybeBuildCountryContainer(e) {
|
|
2042
2152
|
const { allowDropdown: $, separateDialCode: i, showFlags: s } = this.options;
|
|
2043
2153
|
if ($ || s || i) {
|
|
2044
|
-
this.countryContainer =
|
|
2154
|
+
this.countryContainer = w(
|
|
2045
2155
|
"div",
|
|
2046
2156
|
// visibly hidden until we measure it's width to set the input padding correctly
|
|
2047
|
-
{ class:
|
|
2157
|
+
{ class: `iti__country-container ${E.V_HIDE}` },
|
|
2048
2158
|
e
|
|
2049
|
-
), $ ? (this.selectedCountry =
|
|
2159
|
+
), $ ? (this.selectedCountry = w(
|
|
2050
2160
|
"button",
|
|
2051
2161
|
{
|
|
2052
2162
|
type: "button",
|
|
2053
2163
|
class: "iti__selected-country",
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2164
|
+
[L.EXPANDED]: "false",
|
|
2165
|
+
[L.LABEL]: this.options.i18n.noCountrySelected,
|
|
2166
|
+
[L.HASPOPUP]: "dialog",
|
|
2167
|
+
[L.CONTROLS]: `iti-${this.id}__dropdown-content`
|
|
2058
2168
|
},
|
|
2059
2169
|
this.countryContainer
|
|
2060
|
-
), this.telInput.disabled && this.selectedCountry.setAttribute("disabled", "true")) : this.selectedCountry =
|
|
2170
|
+
), this.telInput.disabled && this.selectedCountry.setAttribute("disabled", "true")) : this.selectedCountry = w(
|
|
2061
2171
|
"div",
|
|
2062
2172
|
{ class: "iti__selected-country" },
|
|
2063
2173
|
this.countryContainer
|
|
2064
2174
|
);
|
|
2065
|
-
const
|
|
2175
|
+
const a = w(
|
|
2066
2176
|
"div",
|
|
2067
2177
|
{ class: "iti__selected-country-primary" },
|
|
2068
2178
|
this.selectedCountry
|
|
2069
2179
|
);
|
|
2070
|
-
this.selectedCountryInner =
|
|
2180
|
+
this.selectedCountryInner = w(
|
|
2071
2181
|
"div",
|
|
2072
|
-
{ class:
|
|
2073
|
-
|
|
2074
|
-
), $ && (this.dropdownArrow =
|
|
2182
|
+
{ class: E.FLAG },
|
|
2183
|
+
a
|
|
2184
|
+
), $ && (this.dropdownArrow = w(
|
|
2075
2185
|
"div",
|
|
2076
|
-
{ class: "iti__arrow",
|
|
2077
|
-
|
|
2078
|
-
)), i && (this.selectedDialCode =
|
|
2186
|
+
{ class: "iti__arrow", [L.HIDDEN]: "true" },
|
|
2187
|
+
a
|
|
2188
|
+
)), i && (this.selectedDialCode = w(
|
|
2079
2189
|
"div",
|
|
2080
2190
|
{ class: "iti__selected-dial-code" },
|
|
2081
2191
|
this.selectedCountry
|
|
@@ -2088,53 +2198,49 @@ class Z0 {
|
|
|
2088
2198
|
useFullscreenPopup: $,
|
|
2089
2199
|
countrySearch: i,
|
|
2090
2200
|
i18n: s,
|
|
2091
|
-
dropdownContainer:
|
|
2201
|
+
dropdownContainer: a,
|
|
2092
2202
|
containerClass: u
|
|
2093
2203
|
} = this.options, f = e ? "" : "iti--flexible-dropdown-width";
|
|
2094
|
-
if (this.dropdownContent =
|
|
2204
|
+
if (this.dropdownContent = w("div", {
|
|
2095
2205
|
id: `iti-${this.id}__dropdown-content`,
|
|
2096
|
-
class: `iti__dropdown-content
|
|
2206
|
+
class: `iti__dropdown-content ${E.HIDE} ${f}`,
|
|
2097
2207
|
role: "dialog",
|
|
2098
|
-
|
|
2099
|
-
}), this.isRTL && this.dropdownContent.setAttribute("dir", "rtl"), i && this._buildSearchUI(), this.countryList =
|
|
2208
|
+
[L.MODAL]: "true"
|
|
2209
|
+
}), this.isRTL && this.dropdownContent.setAttribute("dir", "rtl"), i && this._buildSearchUI(), this.countryList = w(
|
|
2100
2210
|
"ul",
|
|
2101
2211
|
{
|
|
2102
2212
|
class: "iti__country-list",
|
|
2103
2213
|
id: `iti-${this.id}__country-listbox`,
|
|
2104
2214
|
role: "listbox",
|
|
2105
|
-
|
|
2215
|
+
[L.LABEL]: s.countryListAriaLabel
|
|
2106
2216
|
},
|
|
2107
2217
|
this.dropdownContent
|
|
2108
|
-
), this._appendListItems(),
|
|
2109
|
-
const
|
|
2218
|
+
), this._appendListItems(), i && this.updateSearchResultsA11yText(), a) {
|
|
2219
|
+
const C = v1({
|
|
2110
2220
|
iti: !0,
|
|
2111
2221
|
"iti--container": !0,
|
|
2112
2222
|
"iti--fullscreen-popup": $,
|
|
2113
2223
|
"iti--inline-dropdown": !$,
|
|
2114
2224
|
[u]: !!u
|
|
2115
2225
|
});
|
|
2116
|
-
this.dropdown =
|
|
2226
|
+
this.dropdown = w("div", { class: C }), this.dropdown.appendChild(this.dropdownContent);
|
|
2117
2227
|
} else
|
|
2118
2228
|
this.countryContainer.appendChild(this.dropdownContent);
|
|
2119
2229
|
}
|
|
2120
2230
|
_buildSearchUI() {
|
|
2121
|
-
const { i18n: e } = this.options, $ =
|
|
2231
|
+
const { i18n: e } = this.options, $ = w(
|
|
2122
2232
|
"div",
|
|
2123
2233
|
{ class: "iti__search-input-wrapper" },
|
|
2124
2234
|
this.dropdownContent
|
|
2125
2235
|
);
|
|
2126
|
-
this.searchIcon =
|
|
2236
|
+
this.searchIcon = w(
|
|
2127
2237
|
"span",
|
|
2128
2238
|
{
|
|
2129
2239
|
class: "iti__search-icon",
|
|
2130
|
-
|
|
2240
|
+
[L.HIDDEN]: "true"
|
|
2131
2241
|
},
|
|
2132
2242
|
$
|
|
2133
|
-
), this.searchIcon.innerHTML =
|
|
2134
|
-
<svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" aria-hidden="true">
|
|
2135
|
-
<circle cx="11" cy="11" r="7" />
|
|
2136
|
-
<line x1="21" y1="21" x2="16.65" y2="16.65" />
|
|
2137
|
-
</svg>`, this.searchInput = v(
|
|
2243
|
+
), this.searchIcon.innerHTML = a2(), this.searchInput = w(
|
|
2138
2244
|
"input",
|
|
2139
2245
|
{
|
|
2140
2246
|
id: `iti-${this.id}__search-input`,
|
|
@@ -2144,58 +2250,49 @@ class Z0 {
|
|
|
2144
2250
|
placeholder: e.searchPlaceholder,
|
|
2145
2251
|
// role=combobox + aria-autocomplete=list + aria-activedescendant allows maintaining focus on the search input while allowing users to navigate search results with up/down keyboard keys
|
|
2146
2252
|
role: "combobox",
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2253
|
+
[L.EXPANDED]: "true",
|
|
2254
|
+
[L.LABEL]: e.searchPlaceholder,
|
|
2255
|
+
[L.CONTROLS]: `iti-${this.id}__country-listbox`,
|
|
2256
|
+
[L.AUTOCOMPLETE]: "list",
|
|
2151
2257
|
autocomplete: "off"
|
|
2152
2258
|
},
|
|
2153
2259
|
$
|
|
2154
|
-
), this.searchClearButton =
|
|
2260
|
+
), this.searchClearButton = w(
|
|
2155
2261
|
"button",
|
|
2156
2262
|
{
|
|
2157
2263
|
type: "button",
|
|
2158
|
-
class:
|
|
2159
|
-
|
|
2264
|
+
class: `iti__search-clear ${E.HIDE}`,
|
|
2265
|
+
[L.LABEL]: e.clearSearchAriaLabel,
|
|
2160
2266
|
tabindex: "-1"
|
|
2161
2267
|
},
|
|
2162
2268
|
$
|
|
2163
|
-
)
|
|
2164
|
-
const i = `iti-${this.id}-clear-mask`;
|
|
2165
|
-
this.searchClearButton.innerHTML = `
|
|
2166
|
-
<svg class="iti__search-clear-svg" width="12" height="12" viewBox="0 0 16 16" aria-hidden="true" focusable="false">
|
|
2167
|
-
<mask id="${i}" maskUnits="userSpaceOnUse">
|
|
2168
|
-
<rect width="16" height="16" fill="white" />
|
|
2169
|
-
<path d="M5.2 5.2 L10.8 10.8 M10.8 5.2 L5.2 10.8" stroke="black" stroke-linecap="round" class="iti__search-clear-x" />
|
|
2170
|
-
</mask>
|
|
2171
|
-
<circle cx="8" cy="8" r="8" class="iti__search-clear-bg" mask="url(#${i})" />
|
|
2172
|
-
</svg>`, this.searchResultsA11yText = v(
|
|
2269
|
+
), this.searchClearButton.innerHTML = c2(this.id), this.searchResultsA11yText = w(
|
|
2173
2270
|
"span",
|
|
2174
2271
|
{ class: "iti__a11y-text" },
|
|
2175
2272
|
this.dropdownContent
|
|
2176
|
-
), this.searchNoResults =
|
|
2273
|
+
), this.searchNoResults = w(
|
|
2177
2274
|
"div",
|
|
2178
2275
|
{
|
|
2179
|
-
class:
|
|
2180
|
-
|
|
2276
|
+
class: `iti__no-results ${E.HIDE}`,
|
|
2277
|
+
[L.HIDDEN]: "true"
|
|
2181
2278
|
// all a11y messaging happens in this.searchResultsA11yText
|
|
2182
2279
|
},
|
|
2183
2280
|
this.dropdownContent
|
|
2184
2281
|
), this.searchNoResults.textContent = e.zeroSearchResults;
|
|
2185
2282
|
}
|
|
2186
2283
|
_maybeUpdateInputPaddingAndReveal() {
|
|
2187
|
-
this.countryContainer && (this.updateInputPadding(), this.countryContainer.classList.remove(
|
|
2284
|
+
this.countryContainer && (this.updateInputPadding(), this.countryContainer.classList.remove(E.V_HIDE));
|
|
2188
2285
|
}
|
|
2189
2286
|
_maybeBuildHiddenInputs(e) {
|
|
2190
2287
|
var i, s;
|
|
2191
2288
|
const { hiddenInput: $ } = this.options;
|
|
2192
2289
|
if ($) {
|
|
2193
|
-
const
|
|
2290
|
+
const a = this.telInput.getAttribute("name") || "", u = $(a);
|
|
2194
2291
|
if (u.phone) {
|
|
2195
2292
|
const f = (i = this.telInput.form) == null ? void 0 : i.querySelector(
|
|
2196
2293
|
`input[name="${u.phone}"]`
|
|
2197
2294
|
);
|
|
2198
|
-
f ? this.hiddenInput = f : (this.hiddenInput =
|
|
2295
|
+
f ? this.hiddenInput = f : (this.hiddenInput = w("input", {
|
|
2199
2296
|
type: "hidden",
|
|
2200
2297
|
name: u.phone
|
|
2201
2298
|
}), e.appendChild(this.hiddenInput));
|
|
@@ -2204,7 +2301,7 @@ class Z0 {
|
|
|
2204
2301
|
const f = (s = this.telInput.form) == null ? void 0 : s.querySelector(
|
|
2205
2302
|
`input[name="${u.country}"]`
|
|
2206
2303
|
);
|
|
2207
|
-
f ? this.hiddenInputCountry = f : (this.hiddenInputCountry =
|
|
2304
|
+
f ? this.hiddenInputCountry = f : (this.hiddenInputCountry = w("input", {
|
|
2208
2305
|
type: "hidden",
|
|
2209
2306
|
name: u.country
|
|
2210
2307
|
}), e.appendChild(this.hiddenInputCountry));
|
|
@@ -2215,28 +2312,28 @@ class Z0 {
|
|
|
2215
2312
|
_appendListItems() {
|
|
2216
2313
|
const e = document.createDocumentFragment();
|
|
2217
2314
|
for (let $ = 0; $ < this.countries.length; $++) {
|
|
2218
|
-
const i = this.countries[$], s =
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
}),
|
|
2315
|
+
const i = this.countries[$], s = v1({
|
|
2316
|
+
[E.COUNTRY_ITEM]: !0,
|
|
2317
|
+
[E.HIGHLIGHT]: $ === 0
|
|
2318
|
+
}), a = w("li", {
|
|
2222
2319
|
id: `iti-${this.id}__item-${i.iso2}`,
|
|
2223
2320
|
class: s,
|
|
2224
2321
|
tabindex: "-1",
|
|
2225
2322
|
role: "option",
|
|
2226
|
-
|
|
2323
|
+
[L.SELECTED]: "false"
|
|
2227
2324
|
});
|
|
2228
|
-
|
|
2229
|
-
const u =
|
|
2325
|
+
a.dataset.dialCode = i.dialCode, a.dataset.countryCode = i.iso2, i.nodeById[this.id] = a, this.options.showFlags && w("div", { class: `${E.FLAG} iti__${i.iso2}` }, a);
|
|
2326
|
+
const u = w("span", { class: "iti__country-name" }, a);
|
|
2230
2327
|
u.textContent = i.name;
|
|
2231
|
-
const f =
|
|
2232
|
-
this.isRTL && f.setAttribute("dir", "ltr"), f.textContent = `+${i.dialCode}`, e.appendChild(
|
|
2328
|
+
const f = w("span", { class: "iti__dial-code" }, a);
|
|
2329
|
+
this.isRTL && f.setAttribute("dir", "ltr"), f.textContent = `+${i.dialCode}`, e.appendChild(a);
|
|
2233
2330
|
}
|
|
2234
2331
|
this.countryList.appendChild(e);
|
|
2235
2332
|
}
|
|
2236
2333
|
//* Update the input padding to make space for the selected country/dial code.
|
|
2237
2334
|
updateInputPadding() {
|
|
2238
2335
|
if (this.selectedCountry) {
|
|
2239
|
-
const e = this.options.separateDialCode ?
|
|
2336
|
+
const e = this.options.separateDialCode ? w1.SANE_SELECTED_WITH_DIAL_WIDTH : w1.SANE_SELECTED_NO_DIAL_WIDTH, i = (this.selectedCountry.offsetWidth || this._getHiddenSelectedCountryWidth() || e) + w1.INPUT_PADDING_EXTRA_LEFT;
|
|
2240
2337
|
this.telInput.style.paddingLeft = `${i}px`;
|
|
2241
2338
|
}
|
|
2242
2339
|
}
|
|
@@ -2262,8 +2359,8 @@ class Z0 {
|
|
|
2262
2359
|
!0
|
|
2263
2360
|
);
|
|
2264
2361
|
i.appendChild(s);
|
|
2265
|
-
const
|
|
2266
|
-
return e.removeChild($),
|
|
2362
|
+
const a = s.offsetWidth;
|
|
2363
|
+
return e.removeChild($), a;
|
|
2267
2364
|
}
|
|
2268
2365
|
return 0;
|
|
2269
2366
|
}
|
|
@@ -2278,23 +2375,20 @@ class Z0 {
|
|
|
2278
2375
|
}
|
|
2279
2376
|
//* Check if an element is visible within it's container, else scroll until it is.
|
|
2280
2377
|
scrollTo(e) {
|
|
2281
|
-
const $ = this.countryList, i = document.documentElement.scrollTop, s = $.offsetHeight,
|
|
2282
|
-
if (
|
|
2283
|
-
$.scrollTop =
|
|
2284
|
-
else if (
|
|
2285
|
-
const
|
|
2286
|
-
$.scrollTop =
|
|
2378
|
+
const $ = this.countryList, i = document.documentElement.scrollTop, s = $.offsetHeight, a = $.getBoundingClientRect().top + i, u = a + s, f = e.offsetHeight, C = e.getBoundingClientRect().top + i, I = C + f, _ = C - a + $.scrollTop;
|
|
2379
|
+
if (C < a)
|
|
2380
|
+
$.scrollTop = _;
|
|
2381
|
+
else if (I > u) {
|
|
2382
|
+
const A = s - f;
|
|
2383
|
+
$.scrollTop = _ - A;
|
|
2287
2384
|
}
|
|
2288
2385
|
}
|
|
2289
2386
|
//* Remove highlighting from other list items and highlight the given item.
|
|
2290
2387
|
highlightListItem(e, $) {
|
|
2291
2388
|
const i = this.highlightedItem;
|
|
2292
|
-
if (i && (i.classList.remove(
|
|
2389
|
+
if (i && (i.classList.remove(E.HIGHLIGHT), i.setAttribute(L.SELECTED, "false")), this.highlightedItem = e, this.highlightedItem && (this.highlightedItem.classList.add(E.HIGHLIGHT), this.highlightedItem.setAttribute(L.SELECTED, "true"), this.options.countrySearch)) {
|
|
2293
2390
|
const s = this.highlightedItem.getAttribute("id") || "";
|
|
2294
|
-
this.searchInput.setAttribute(
|
|
2295
|
-
"aria-activedescendant",
|
|
2296
|
-
s
|
|
2297
|
-
);
|
|
2391
|
+
this.searchInput.setAttribute(L.ACTIVE_DESCENDANT, s);
|
|
2298
2392
|
}
|
|
2299
2393
|
$ && this.highlightedItem.focus();
|
|
2300
2394
|
}
|
|
@@ -2306,7 +2400,7 @@ class Z0 {
|
|
|
2306
2400
|
const s = i.nodeById[this.id];
|
|
2307
2401
|
s && (this.countryList.appendChild(s), $ && (this.highlightListItem(s, !1), $ = !1));
|
|
2308
2402
|
}
|
|
2309
|
-
$ ? (this.highlightListItem(null, !1), this.searchNoResults && this.searchNoResults.classList.remove(
|
|
2403
|
+
$ ? (this.highlightListItem(null, !1), this.searchNoResults && this.searchNoResults.classList.remove(E.HIDE)) : this.searchNoResults && this.searchNoResults.classList.add(E.HIDE), this.countryList.scrollTop = 0, this.updateSearchResultsA11yText();
|
|
2310
2404
|
}
|
|
2311
2405
|
destroy() {
|
|
2312
2406
|
this.telInput.iti = void 0, delete this.telInput.dataset.intlTelInputId, this.options.separateDialCode && (this.telInput.style.paddingLeft = this.originalPaddingLeft);
|
|
@@ -2317,101 +2411,103 @@ class Z0 {
|
|
|
2317
2411
|
this.countries = null;
|
|
2318
2412
|
}
|
|
2319
2413
|
}
|
|
2320
|
-
|
|
2321
|
-
const { onlyCountries: e, excludeCountries: $ } =
|
|
2414
|
+
const f2 = (h) => {
|
|
2415
|
+
const { onlyCountries: e, excludeCountries: $ } = h;
|
|
2322
2416
|
if (e.length) {
|
|
2323
|
-
const i = e.map(
|
|
2324
|
-
|
|
2417
|
+
const i = e.map(
|
|
2418
|
+
(s) => s.toLowerCase()
|
|
2419
|
+
);
|
|
2420
|
+
return Q.filter(
|
|
2421
|
+
(s) => i.includes(s.iso2)
|
|
2422
|
+
);
|
|
2325
2423
|
} else if ($.length) {
|
|
2326
|
-
const i = $.map(
|
|
2327
|
-
|
|
2424
|
+
const i = $.map(
|
|
2425
|
+
(s) => s.toLowerCase()
|
|
2426
|
+
);
|
|
2427
|
+
return Q.filter(
|
|
2428
|
+
(s) => !i.includes(s.iso2)
|
|
2429
|
+
);
|
|
2328
2430
|
}
|
|
2329
|
-
return
|
|
2330
|
-
}
|
|
2331
|
-
|
|
2332
|
-
for (const $ of p) {
|
|
2431
|
+
return Q;
|
|
2432
|
+
}, p2 = (h, e) => {
|
|
2433
|
+
for (const $ of h) {
|
|
2333
2434
|
const i = $.iso2.toLowerCase();
|
|
2334
2435
|
e.i18n[i] && ($.name = e.i18n[i]);
|
|
2335
2436
|
}
|
|
2336
|
-
}
|
|
2337
|
-
function q0(p, e) {
|
|
2437
|
+
}, C2 = (h, e) => {
|
|
2338
2438
|
const $ = /* @__PURE__ */ new Set();
|
|
2339
2439
|
let i = 0;
|
|
2340
|
-
const s = {},
|
|
2440
|
+
const s = {}, a = (u, f, C) => {
|
|
2341
2441
|
if (!u || !f)
|
|
2342
2442
|
return;
|
|
2343
2443
|
f.length > i && (i = f.length), s.hasOwnProperty(f) || (s[f] = []);
|
|
2344
|
-
const
|
|
2345
|
-
if (
|
|
2444
|
+
const I = s[f];
|
|
2445
|
+
if (I.includes(u))
|
|
2346
2446
|
return;
|
|
2347
|
-
const
|
|
2348
|
-
|
|
2447
|
+
const _ = C !== void 0 ? C : I.length;
|
|
2448
|
+
I[_] = u;
|
|
2349
2449
|
};
|
|
2350
|
-
for (const u of
|
|
2450
|
+
for (const u of h) {
|
|
2351
2451
|
$.has(u.dialCode) || $.add(u.dialCode);
|
|
2352
2452
|
for (let f = 1; f < u.dialCode.length; f++) {
|
|
2353
|
-
const
|
|
2354
|
-
|
|
2453
|
+
const C = u.dialCode.substring(0, f);
|
|
2454
|
+
a(u.iso2, C);
|
|
2355
2455
|
}
|
|
2356
|
-
|
|
2456
|
+
a(u.iso2, u.dialCode, u.priority);
|
|
2357
2457
|
}
|
|
2358
2458
|
(e.onlyCountries.length || e.excludeCountries.length) && $.forEach((u) => {
|
|
2359
2459
|
s[u] = s[u].filter(Boolean);
|
|
2360
2460
|
});
|
|
2361
|
-
for (const u of
|
|
2461
|
+
for (const u of h)
|
|
2362
2462
|
if (u.areaCodes) {
|
|
2363
2463
|
const f = s[u.dialCode][0];
|
|
2364
|
-
for (const
|
|
2365
|
-
for (let
|
|
2366
|
-
const
|
|
2367
|
-
|
|
2464
|
+
for (const C of u.areaCodes) {
|
|
2465
|
+
for (let I = 1; I < C.length; I++) {
|
|
2466
|
+
const _ = C.substring(0, I), A = u.dialCode + _;
|
|
2467
|
+
a(f, A), a(u.iso2, A);
|
|
2368
2468
|
}
|
|
2369
|
-
|
|
2469
|
+
a(u.iso2, u.dialCode + C);
|
|
2370
2470
|
}
|
|
2371
2471
|
}
|
|
2372
2472
|
return { dialCodes: $, dialCodeMaxLen: i, dialCodeToIso2Map: s };
|
|
2373
|
-
}
|
|
2374
|
-
|
|
2375
|
-
|
|
2473
|
+
}, g2 = (h, e) => {
|
|
2474
|
+
e.countryOrder && (e.countryOrder = e.countryOrder.map(
|
|
2475
|
+
($) => $.toLowerCase()
|
|
2476
|
+
)), h.sort(($, i) => {
|
|
2376
2477
|
const { countryOrder: s } = e;
|
|
2377
2478
|
if (s) {
|
|
2378
|
-
const
|
|
2379
|
-
if (f ||
|
|
2380
|
-
return f &&
|
|
2479
|
+
const a = s.indexOf($.iso2), u = s.indexOf(i.iso2), f = a > -1, C = u > -1;
|
|
2480
|
+
if (f || C)
|
|
2481
|
+
return f && C ? a - u : f ? -1 : 1;
|
|
2381
2482
|
}
|
|
2382
2483
|
return $.name.localeCompare(i.name);
|
|
2383
2484
|
});
|
|
2384
|
-
}
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
function d2(p, e, $, i) {
|
|
2390
|
-
let s = p;
|
|
2485
|
+
}, m2 = (h) => {
|
|
2486
|
+
for (const e of h)
|
|
2487
|
+
e.normalisedName = L0(e.name), e.initials = e.normalisedName.split(/[^a-z]/).map(($) => $[0]).join(""), e.dialCodePlus = `+${e.dialCode}`;
|
|
2488
|
+
}, y2 = (h, e, $, i) => {
|
|
2489
|
+
let s = h;
|
|
2391
2490
|
if ($ && e) {
|
|
2392
2491
|
e = `+${i.dialCode}`;
|
|
2393
|
-
const
|
|
2394
|
-
s = s.substring(
|
|
2492
|
+
const a = s[e.length] === " " || s[e.length] === "-" ? e.length + 1 : e.length;
|
|
2493
|
+
s = s.substring(a);
|
|
2395
2494
|
}
|
|
2396
2495
|
return s;
|
|
2397
|
-
}
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
}
|
|
2402
|
-
function e2(p, e, $, i) {
|
|
2496
|
+
}, I2 = (h, e, $, i, s) => {
|
|
2497
|
+
const a = $ ? $.formatNumberAsYouType(h, i.iso2) : h, { dialCode: u } = i;
|
|
2498
|
+
return s && e.charAt(0) !== "+" && a.includes(`+${u}`) ? (a.split(`+${u}`)[1] || "").trim() : a;
|
|
2499
|
+
}, _2 = (h, e, $, i) => {
|
|
2403
2500
|
if ($ === 0 && !i)
|
|
2404
2501
|
return 0;
|
|
2405
2502
|
let s = 0;
|
|
2406
|
-
for (let
|
|
2407
|
-
if (/[+0-9]/.test(e[
|
|
2408
|
-
return
|
|
2409
|
-
if (i && s ===
|
|
2410
|
-
return
|
|
2503
|
+
for (let a = 0; a < e.length; a++) {
|
|
2504
|
+
if (/[+0-9]/.test(e[a]) && s++, s === h && !i)
|
|
2505
|
+
return a + 1;
|
|
2506
|
+
if (i && s === h + 1)
|
|
2507
|
+
return a;
|
|
2411
2508
|
}
|
|
2412
2509
|
return e.length;
|
|
2413
|
-
}
|
|
2414
|
-
const $2 = [
|
|
2510
|
+
}, E2 = [
|
|
2415
2511
|
"800",
|
|
2416
2512
|
"822",
|
|
2417
2513
|
"833",
|
|
@@ -2429,26 +2525,26 @@ const $2 = [
|
|
|
2429
2525
|
"887",
|
|
2430
2526
|
"888",
|
|
2431
2527
|
"889"
|
|
2432
|
-
],
|
|
2433
|
-
const e =
|
|
2434
|
-
if (e.
|
|
2528
|
+
], _0 = (h) => {
|
|
2529
|
+
const e = m1(h);
|
|
2530
|
+
if (e.startsWith(N0.NANP) && e.length >= 4) {
|
|
2435
2531
|
const $ = e.substring(1, 4);
|
|
2436
|
-
return
|
|
2532
|
+
return E2.includes($);
|
|
2437
2533
|
}
|
|
2438
2534
|
return !1;
|
|
2439
2535
|
};
|
|
2440
|
-
for (const
|
|
2441
|
-
|
|
2442
|
-
let
|
|
2443
|
-
const
|
|
2444
|
-
class
|
|
2536
|
+
for (const h of Q)
|
|
2537
|
+
h.name = E0[h.iso2];
|
|
2538
|
+
let N2 = 0;
|
|
2539
|
+
const S2 = new Set(Q.map((h) => h.iso2)), P1 = (h) => S2.has(h);
|
|
2540
|
+
class M1 {
|
|
2445
2541
|
constructor(e, $ = {}) {
|
|
2446
|
-
this.id =
|
|
2447
|
-
const { dialCodes: i, dialCodeMaxLen: s, dialCodeToIso2Map:
|
|
2542
|
+
this.id = N2++, this.options = { ...S0, ...$ }, o2(this.options, E0), this.ui = new h2(e, this.options, this.id), this.isAndroid = M1._getIsAndroid(), this.promise = this._createInitPromises(), this.countries = f2(this.options);
|
|
2543
|
+
const { dialCodes: i, dialCodeMaxLen: s, dialCodeToIso2Map: a } = C2(
|
|
2448
2544
|
this.countries,
|
|
2449
2545
|
this.options
|
|
2450
2546
|
);
|
|
2451
|
-
this.dialCodes = i, this.dialCodeMaxLen = s, this.dialCodeToIso2Map =
|
|
2547
|
+
this.dialCodes = i, this.dialCodeMaxLen = s, this.dialCodeToIso2Map = a, this.countryByIso2 = new Map(this.countries.map((u) => [u.iso2, u])), this._init();
|
|
2452
2548
|
}
|
|
2453
2549
|
static _getIsAndroid() {
|
|
2454
2550
|
return typeof navigator < "u" ? /Android/i.test(navigator.userAgent) : !1;
|
|
@@ -2470,20 +2566,20 @@ class v1 {
|
|
|
2470
2566
|
//********************
|
|
2471
2567
|
//* Prepare all of the country data, including onlyCountries, excludeCountries, countryOrder options.
|
|
2472
2568
|
_processCountryData() {
|
|
2473
|
-
|
|
2569
|
+
p2(this.countries, this.options), g2(this.countries, this.options), m2(this.countries);
|
|
2474
2570
|
}
|
|
2475
2571
|
//* Set the initial state of the input value and the selected country by:
|
|
2476
2572
|
//* 1. Extracting a dial code from the given number
|
|
2477
2573
|
//* 2. Using explicit initialCountry
|
|
2478
2574
|
_setInitialState(e = !1) {
|
|
2479
|
-
const $ = this.ui.telInput.getAttribute("value"), i = this.ui.telInput.value,
|
|
2575
|
+
const $ = this.ui.telInput.getAttribute("value"), i = this.ui.telInput.value, a = $ && $.startsWith("+") && (!i || !i.startsWith("+")) ? $ : i, u = this._getDialCode(a), f = _0(a), { initialCountry: C, geoIpLookup: I } = this.options, _ = C === T1.AUTO && I;
|
|
2480
2576
|
if (u && !f)
|
|
2481
|
-
this._updateCountryFromNumber(
|
|
2482
|
-
else if (!
|
|
2483
|
-
const
|
|
2484
|
-
|
|
2577
|
+
this._updateCountryFromNumber(a);
|
|
2578
|
+
else if (!_ || e) {
|
|
2579
|
+
const A = C ? C.toLowerCase() : "";
|
|
2580
|
+
P1(A) ? this._setCountry(A) : u && f ? this._setCountry(i2.ISO2) : this._setCountry("");
|
|
2485
2581
|
}
|
|
2486
|
-
|
|
2582
|
+
a && this._updateValFromNumber(a);
|
|
2487
2583
|
}
|
|
2488
2584
|
//* Initialise the main event listeners: input keyup, and click selected country.
|
|
2489
2585
|
_initListeners() {
|
|
@@ -2502,38 +2598,46 @@ class v1 {
|
|
|
2502
2598
|
//* initialise the dropdown listeners.
|
|
2503
2599
|
_initDropdownListeners() {
|
|
2504
2600
|
const e = this.abortController.signal, $ = (u) => {
|
|
2505
|
-
this.ui.dropdownContent.classList.contains(
|
|
2601
|
+
this.ui.dropdownContent.classList.contains(E.HIDE) ? this.ui.telInput.focus() : u.preventDefault();
|
|
2506
2602
|
}, i = this.ui.telInput.closest("label");
|
|
2507
2603
|
i && i.addEventListener("click", $, { signal: e });
|
|
2508
2604
|
const s = () => {
|
|
2509
|
-
this.ui.dropdownContent.classList.contains(
|
|
2605
|
+
this.ui.dropdownContent.classList.contains(
|
|
2606
|
+
E.HIDE
|
|
2607
|
+
) && !this.ui.telInput.disabled && !this.ui.telInput.readOnly && this._openDropdown();
|
|
2510
2608
|
};
|
|
2511
|
-
this.ui.selectedCountry.addEventListener(
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2609
|
+
this.ui.selectedCountry.addEventListener(
|
|
2610
|
+
"click",
|
|
2611
|
+
s,
|
|
2612
|
+
{
|
|
2613
|
+
signal: e
|
|
2614
|
+
}
|
|
2615
|
+
);
|
|
2616
|
+
const a = (u) => {
|
|
2617
|
+
this.ui.dropdownContent.classList.contains(
|
|
2618
|
+
E.HIDE
|
|
2619
|
+
) && [x.ARROW_UP, x.ARROW_DOWN, x.SPACE, x.ENTER].includes(u.key) && (u.preventDefault(), u.stopPropagation(), this._openDropdown()), u.key === x.TAB && this._closeDropdown();
|
|
2516
2620
|
};
|
|
2517
2621
|
this.ui.countryContainer.addEventListener(
|
|
2518
2622
|
"keydown",
|
|
2519
|
-
|
|
2623
|
+
a,
|
|
2520
2624
|
{ signal: e }
|
|
2521
2625
|
);
|
|
2522
2626
|
}
|
|
2523
2627
|
//* Init many requests: utils script / geo ip lookup.
|
|
2524
2628
|
_initRequests() {
|
|
2525
2629
|
const { loadUtils: e, initialCountry: $, geoIpLookup: i } = this.options;
|
|
2526
|
-
if (e && !
|
|
2527
|
-
const
|
|
2630
|
+
if (e && !m.utils) {
|
|
2631
|
+
const a = () => {
|
|
2528
2632
|
var u;
|
|
2529
|
-
(u =
|
|
2633
|
+
(u = m.attachUtils(e)) == null || u.catch(() => {
|
|
2530
2634
|
});
|
|
2531
2635
|
};
|
|
2532
|
-
if (
|
|
2533
|
-
|
|
2636
|
+
if (m.documentReady())
|
|
2637
|
+
a();
|
|
2534
2638
|
else {
|
|
2535
2639
|
const u = () => {
|
|
2536
|
-
|
|
2640
|
+
a();
|
|
2537
2641
|
};
|
|
2538
2642
|
window.addEventListener("load", u, {
|
|
2539
2643
|
signal: this.abortController.signal
|
|
@@ -2541,17 +2645,17 @@ class v1 {
|
|
|
2541
2645
|
}
|
|
2542
2646
|
} else
|
|
2543
2647
|
this.resolveUtilsScriptPromise();
|
|
2544
|
-
$ ===
|
|
2648
|
+
$ === T1.AUTO && i && !this.selectedCountryData.iso2 ? this._loadAutoCountry() : this.resolveAutoCountryPromise();
|
|
2545
2649
|
}
|
|
2546
2650
|
//* Perform the geo ip lookup.
|
|
2547
2651
|
_loadAutoCountry() {
|
|
2548
|
-
|
|
2652
|
+
m.autoCountry ? this.handleAutoCountry() : m.startedLoadingAutoCountry || (m.startedLoadingAutoCountry = !0, typeof this.options.geoIpLookup == "function" && this.options.geoIpLookup(
|
|
2549
2653
|
(e = "") => {
|
|
2550
2654
|
const $ = e.toLowerCase();
|
|
2551
|
-
|
|
2655
|
+
P1($) ? (m.autoCountry = $, setTimeout(() => r1("handleAutoCountry"))) : (this._setInitialState(!0), r1("rejectAutoCountryPromise"));
|
|
2552
2656
|
},
|
|
2553
2657
|
() => {
|
|
2554
|
-
this._setInitialState(!0),
|
|
2658
|
+
this._setInitialState(!0), r1("rejectAutoCountryPromise");
|
|
2555
2659
|
}
|
|
2556
2660
|
));
|
|
2557
2661
|
}
|
|
@@ -2568,68 +2672,72 @@ class v1 {
|
|
|
2568
2672
|
formatAsYouType: $,
|
|
2569
2673
|
separateDialCode: i,
|
|
2570
2674
|
allowDropdown: s,
|
|
2571
|
-
countrySearch:
|
|
2675
|
+
countrySearch: a
|
|
2572
2676
|
} = this.options;
|
|
2573
2677
|
let u = !1;
|
|
2574
|
-
|
|
2575
|
-
const f = (
|
|
2576
|
-
if (this.isAndroid && (
|
|
2577
|
-
const
|
|
2678
|
+
q.ALPHA_UNICODE.test(this.ui.telInput.value) && (u = !0);
|
|
2679
|
+
const f = (C) => {
|
|
2680
|
+
if (this.isAndroid && (C == null ? void 0 : C.data) === "+" && i && s && a) {
|
|
2681
|
+
const v = this.ui.telInput.selectionStart || 0, N = this.ui.telInput.value.substring(
|
|
2578
2682
|
0,
|
|
2579
|
-
|
|
2580
|
-
),
|
|
2581
|
-
this.ui.telInput.value =
|
|
2683
|
+
v - 1
|
|
2684
|
+
), T = this.ui.telInput.value.substring(v);
|
|
2685
|
+
this.ui.telInput.value = N + T, this._openDropdownWithPlus();
|
|
2582
2686
|
return;
|
|
2583
2687
|
}
|
|
2584
2688
|
this._updateCountryFromNumber(this.ui.telInput.value) && this._triggerCountryChange();
|
|
2585
|
-
const
|
|
2586
|
-
|
|
2587
|
-
const
|
|
2588
|
-
if ($ && !u && !
|
|
2589
|
-
const
|
|
2689
|
+
const I = (C == null ? void 0 : C.data) && q.NON_PLUS_NUMERIC.test(C.data), _ = (C == null ? void 0 : C.inputType) === m0.PASTE && this.ui.telInput.value;
|
|
2690
|
+
I || _ && !e ? u = !0 : q.NON_PLUS_NUMERIC.test(this.ui.telInput.value) || (u = !1);
|
|
2691
|
+
const A = (C == null ? void 0 : C.detail) && C.detail.isSetNumber;
|
|
2692
|
+
if ($ && !u && !A) {
|
|
2693
|
+
const v = this.ui.telInput.selectionStart || 0, T = this.ui.telInput.value.substring(
|
|
2590
2694
|
0,
|
|
2591
|
-
|
|
2695
|
+
v
|
|
2592
2696
|
).replace(
|
|
2593
|
-
|
|
2697
|
+
q.NON_PLUS_NUMERIC_GLOBAL,
|
|
2594
2698
|
""
|
|
2595
|
-
).length,
|
|
2596
|
-
|
|
2699
|
+
).length, k = (C == null ? void 0 : C.inputType) === m0.DELETE_FWD, P = this._getFullNumber(), B = I2(
|
|
2700
|
+
P,
|
|
2597
2701
|
this.ui.telInput.value,
|
|
2598
|
-
|
|
2702
|
+
m.utils,
|
|
2599
2703
|
this.selectedCountryData,
|
|
2600
2704
|
this.options.separateDialCode
|
|
2601
|
-
),
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2705
|
+
), W = _2(
|
|
2706
|
+
T,
|
|
2707
|
+
B,
|
|
2708
|
+
v,
|
|
2709
|
+
k
|
|
2606
2710
|
);
|
|
2607
|
-
this.ui.telInput.value =
|
|
2711
|
+
this.ui.telInput.value = B, this.ui.telInput.setSelectionRange(W, W);
|
|
2608
2712
|
}
|
|
2609
2713
|
};
|
|
2610
|
-
this.ui.telInput.addEventListener(
|
|
2611
|
-
|
|
2612
|
-
|
|
2714
|
+
this.ui.telInput.addEventListener(
|
|
2715
|
+
"input",
|
|
2716
|
+
f,
|
|
2717
|
+
{
|
|
2718
|
+
signal: this.abortController.signal
|
|
2719
|
+
}
|
|
2720
|
+
);
|
|
2613
2721
|
}
|
|
2614
2722
|
_maybeBindKeydownListener() {
|
|
2615
2723
|
const { strictMode: e, separateDialCode: $, allowDropdown: i, countrySearch: s } = this.options;
|
|
2616
2724
|
if (e || $) {
|
|
2617
|
-
const
|
|
2725
|
+
const a = (u) => {
|
|
2618
2726
|
if (u.key && u.key.length === 1 && !u.altKey && !u.ctrlKey && !u.metaKey) {
|
|
2619
2727
|
if ($ && i && s && u.key === "+") {
|
|
2620
2728
|
u.preventDefault(), this._openDropdownWithPlus();
|
|
2621
2729
|
return;
|
|
2622
2730
|
}
|
|
2623
2731
|
if (e) {
|
|
2624
|
-
const f = this.ui.telInput.value,
|
|
2625
|
-
|
|
2732
|
+
const f = this.ui.telInput.value, I = !f.startsWith("+") && this.ui.telInput.selectionStart === 0 && u.key === "+", _ = /^[0-9]$/.test(u.key), A = $ ? _ : I || _, v = f.slice(0, this.ui.telInput.selectionStart) + u.key + f.slice(this.ui.telInput.selectionEnd), N = this._getFullNumber(v), T = m.utils.getCoreNumber(
|
|
2733
|
+
N,
|
|
2626
2734
|
this.selectedCountryData.iso2
|
|
2627
|
-
),
|
|
2628
|
-
(!
|
|
2735
|
+
), k = this.maxCoreNumberLength && T.length > this.maxCoreNumberLength, B = this._getNewCountryFromNumber(N) !== null;
|
|
2736
|
+
(!A || k && !B && !I) && u.preventDefault();
|
|
2629
2737
|
}
|
|
2630
2738
|
}
|
|
2631
2739
|
};
|
|
2632
|
-
this.ui.telInput.addEventListener("keydown",
|
|
2740
|
+
this.ui.telInput.addEventListener("keydown", a, {
|
|
2633
2741
|
signal: this.abortController.signal
|
|
2634
2742
|
});
|
|
2635
2743
|
}
|
|
@@ -2638,21 +2746,21 @@ class v1 {
|
|
|
2638
2746
|
if (this.options.strictMode) {
|
|
2639
2747
|
const e = ($) => {
|
|
2640
2748
|
$.preventDefault();
|
|
2641
|
-
const i = this.ui.telInput, s = i.selectionStart,
|
|
2642
|
-
let
|
|
2643
|
-
for (;
|
|
2644
|
-
|
|
2645
|
-
if (!
|
|
2749
|
+
const i = this.ui.telInput, s = i.selectionStart, a = i.selectionEnd, u = i.value.slice(0, s), f = i.value.slice(a), C = this.selectedCountryData.iso2, I = $.clipboardData.getData("text"), _ = s === 0 && a > 0, A = !i.value.startsWith("+") || _, v = I.replace(q.NON_PLUS_NUMERIC_GLOBAL, ""), N = v.startsWith("+"), T = v.replace(/\+/g, ""), k = N && A ? `+${T}` : T;
|
|
2750
|
+
let P = u + k + f, B = m.utils.getCoreNumber(P, C);
|
|
2751
|
+
for (; B.length === 0 && P.length > 0; )
|
|
2752
|
+
P = P.slice(0, -1), B = m.utils.getCoreNumber(P, C);
|
|
2753
|
+
if (!B)
|
|
2646
2754
|
return;
|
|
2647
|
-
if (this.maxCoreNumberLength &&
|
|
2755
|
+
if (this.maxCoreNumberLength && B.length > this.maxCoreNumberLength)
|
|
2648
2756
|
if (i.selectionEnd === i.value.length) {
|
|
2649
|
-
const
|
|
2650
|
-
|
|
2757
|
+
const y1 = B.length - this.maxCoreNumberLength;
|
|
2758
|
+
P = P.slice(0, P.length - y1);
|
|
2651
2759
|
} else
|
|
2652
2760
|
return;
|
|
2653
|
-
i.value =
|
|
2654
|
-
const
|
|
2655
|
-
i.setSelectionRange(
|
|
2761
|
+
i.value = P;
|
|
2762
|
+
const W = s + k.length;
|
|
2763
|
+
i.setSelectionRange(W, W), i.dispatchEvent(new InputEvent("input", { bubbles: !0 }));
|
|
2656
2764
|
};
|
|
2657
2765
|
this.ui.telInput.addEventListener("paste", e, {
|
|
2658
2766
|
signal: this.abortController.signal
|
|
@@ -2676,11 +2784,11 @@ class v1 {
|
|
|
2676
2784
|
//* Open the dropdown.
|
|
2677
2785
|
_openDropdown() {
|
|
2678
2786
|
const { fixDropdownWidth: e, countrySearch: $ } = this.options;
|
|
2679
|
-
if (this.dropdownAbortController = new AbortController(), e && (this.ui.dropdownContent.style.width = `${this.ui.telInput.offsetWidth}px`), this.ui.dropdownContent.classList.remove(
|
|
2787
|
+
if (this.dropdownAbortController = new AbortController(), e && (this.ui.dropdownContent.style.width = `${this.ui.telInput.offsetWidth}px`), this.ui.dropdownContent.classList.remove(E.HIDE), this.ui.selectedCountry.setAttribute(L.EXPANDED, "true"), this._setDropdownPosition(), $) {
|
|
2680
2788
|
const i = this.ui.countryList.firstElementChild;
|
|
2681
2789
|
i && (this.ui.highlightListItem(i, !1), this.ui.countryList.scrollTop = 0), this.ui.searchInput.focus();
|
|
2682
2790
|
}
|
|
2683
|
-
this._bindDropdownListeners(), this.ui.dropdownArrow.classList.add(
|
|
2791
|
+
this._bindDropdownListeners(), this.ui.dropdownArrow.classList.add(E.ARROW_UP), this._trigger(g1.OPEN_COUNTRY_DROPDOWN);
|
|
2684
2792
|
}
|
|
2685
2793
|
//* Set the dropdown position
|
|
2686
2794
|
_setDropdownPosition() {
|
|
@@ -2697,98 +2805,114 @@ class v1 {
|
|
|
2697
2805
|
}
|
|
2698
2806
|
//* We only bind dropdown listeners when the dropdown is open.
|
|
2699
2807
|
_bindDropdownListeners() {
|
|
2700
|
-
const e = this.dropdownAbortController.signal
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2808
|
+
const e = this.dropdownAbortController.signal;
|
|
2809
|
+
this._bindDropdownMouseoverListener(e), this._bindDropdownCountryClickListener(e), this._bindDropdownClickOffListener(e), this._bindDropdownKeydownListener(e), this.options.countrySearch && this._bindDropdownSearchListeners(e);
|
|
2810
|
+
}
|
|
2811
|
+
//* When mouse over a list item, just highlight that one
|
|
2812
|
+
//* we add the class "highlight", so if they hit "enter" we know which one to select.
|
|
2813
|
+
_bindDropdownMouseoverListener(e) {
|
|
2814
|
+
const $ = (i) => {
|
|
2815
|
+
var a;
|
|
2816
|
+
const s = (a = i.target) == null ? void 0 : a.closest(
|
|
2817
|
+
`.${E.COUNTRY_ITEM}`
|
|
2704
2818
|
);
|
|
2705
|
-
|
|
2819
|
+
s && this.ui.highlightListItem(s, !1);
|
|
2706
2820
|
};
|
|
2707
|
-
this.ui.countryList.addEventListener(
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2821
|
+
this.ui.countryList.addEventListener(
|
|
2822
|
+
"mouseover",
|
|
2823
|
+
$,
|
|
2824
|
+
{
|
|
2825
|
+
signal: e
|
|
2826
|
+
}
|
|
2827
|
+
);
|
|
2828
|
+
}
|
|
2829
|
+
//* Listen for country selection.
|
|
2830
|
+
_bindDropdownCountryClickListener(e) {
|
|
2831
|
+
const $ = (i) => {
|
|
2832
|
+
var a;
|
|
2833
|
+
const s = (a = i.target) == null ? void 0 : a.closest(
|
|
2834
|
+
`.${E.COUNTRY_ITEM}`
|
|
2714
2835
|
);
|
|
2715
|
-
|
|
2836
|
+
s && this._selectListItem(s);
|
|
2716
2837
|
};
|
|
2717
|
-
this.ui.countryList.addEventListener("click",
|
|
2838
|
+
this.ui.countryList.addEventListener("click", $, {
|
|
2718
2839
|
signal: e
|
|
2719
2840
|
});
|
|
2720
|
-
|
|
2721
|
-
|
|
2841
|
+
}
|
|
2842
|
+
//* Click off to close (except when this initial opening click is bubbling up).
|
|
2843
|
+
//* We cannot just stopPropagation as it may be needed to close another instance.
|
|
2844
|
+
_bindDropdownClickOffListener(e) {
|
|
2845
|
+
const $ = (i) => {
|
|
2846
|
+
!!i.target.closest(
|
|
2722
2847
|
`#iti-${this.id}__dropdown-content`
|
|
2723
2848
|
) || this._closeDropdown();
|
|
2724
2849
|
};
|
|
2725
2850
|
setTimeout(() => {
|
|
2726
2851
|
document.documentElement.addEventListener(
|
|
2727
2852
|
"click",
|
|
2728
|
-
|
|
2853
|
+
$,
|
|
2729
2854
|
{ signal: e }
|
|
2730
2855
|
);
|
|
2731
2856
|
}, 0);
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2857
|
+
}
|
|
2858
|
+
//* Listen for up/down scrolling, enter to select, or escape to close.
|
|
2859
|
+
//* Use keydown as keypress doesn't fire for non-char keys and we want to catch if they
|
|
2860
|
+
//* just hit down and hold it to scroll down (no keyup event).
|
|
2861
|
+
//* Listen on the document because that's where key events are triggered if no input has focus.
|
|
2862
|
+
_bindDropdownKeydownListener(e) {
|
|
2863
|
+
let $ = "", i = null;
|
|
2864
|
+
const s = (a) => {
|
|
2865
|
+
[
|
|
2866
|
+
x.ARROW_UP,
|
|
2867
|
+
x.ARROW_DOWN,
|
|
2868
|
+
x.ENTER,
|
|
2869
|
+
x.ESC
|
|
2870
|
+
].includes(a.key) && (a.preventDefault(), a.stopPropagation(), a.key === x.ARROW_UP || a.key === x.ARROW_DOWN ? this._handleUpDownKey(a.key) : a.key === x.ENTER ? this._handleEnterKey() : a.key === x.ESC && this._closeDropdown()), !this.options.countrySearch && q.HIDDEN_SEARCH_CHAR.test(a.key) && (a.stopPropagation(), i && clearTimeout(i), $ += a.key.toLowerCase(), this._searchForCountry($), i = setTimeout(() => {
|
|
2871
|
+
$ = "";
|
|
2872
|
+
}, n2.HIDDEN_SEARCH_RESET_MS));
|
|
2737
2873
|
};
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2874
|
+
document.addEventListener("keydown", s, { signal: e });
|
|
2875
|
+
}
|
|
2876
|
+
//* Search input listeners when countrySearch enabled.
|
|
2877
|
+
_bindDropdownSearchListeners(e) {
|
|
2878
|
+
const $ = () => {
|
|
2879
|
+
const u = this.ui.searchInput.value.trim();
|
|
2880
|
+
this._filterCountriesByQuery(u), this.ui.searchInput.value ? this.ui.searchClearButton.classList.remove(E.HIDE) : this.ui.searchClearButton.classList.add(E.HIDE);
|
|
2881
|
+
};
|
|
2882
|
+
let i = null;
|
|
2883
|
+
const s = () => {
|
|
2884
|
+
i && clearTimeout(i), i = setTimeout(() => {
|
|
2885
|
+
$(), i = null;
|
|
2886
|
+
}, 100);
|
|
2887
|
+
};
|
|
2888
|
+
this.ui.searchInput.addEventListener("input", s, {
|
|
2889
|
+
signal: e
|
|
2890
|
+
});
|
|
2891
|
+
const a = () => {
|
|
2892
|
+
this.ui.searchInput.value = "", this.ui.searchInput.focus(), $();
|
|
2893
|
+
};
|
|
2894
|
+
this.ui.searchClearButton.addEventListener("click", a, {
|
|
2895
|
+
signal: e
|
|
2896
|
+
});
|
|
2759
2897
|
}
|
|
2760
2898
|
//* Hidden search (countrySearch disabled): Find the first list item whose name starts with the query string.
|
|
2761
2899
|
_searchForCountry(e) {
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
}
|
|
2900
|
+
const $ = l2(this.countries, e);
|
|
2901
|
+
if ($) {
|
|
2902
|
+
const i = $.nodeById[this.id];
|
|
2903
|
+
this.ui.highlightListItem(i, !1), this.ui.scrollTo(i);
|
|
2904
|
+
}
|
|
2768
2905
|
}
|
|
2769
2906
|
//* Country search: Filter the countries according to the search query.
|
|
2770
2907
|
_filterCountriesByQuery(e) {
|
|
2771
2908
|
let $;
|
|
2772
|
-
e === "" ? $ = this.countries : $ = this.
|
|
2773
|
-
}
|
|
2774
|
-
_getMatchedCountries(e) {
|
|
2775
|
-
const $ = c0(e), i = [], s = [], h = [], u = [], f = [], c = [];
|
|
2776
|
-
for (const g of this.countries)
|
|
2777
|
-
g.iso2 === $ ? i.push(g) : g.normalisedName.startsWith($) ? s.push(g) : g.normalisedName.includes($) ? h.push(g) : $ === g.dialCode || $ === g.dialCodePlus ? u.push(g) : g.dialCodePlus.includes($) ? f.push(g) : g.initials.includes($) && c.push(g);
|
|
2778
|
-
return [
|
|
2779
|
-
...i.sort((g, I) => g.priority - I.priority),
|
|
2780
|
-
...s.sort((g, I) => g.priority - I.priority),
|
|
2781
|
-
...h.sort((g, I) => g.priority - I.priority),
|
|
2782
|
-
...u.sort((g, I) => g.priority - I.priority),
|
|
2783
|
-
...f.sort((g, I) => g.priority - I.priority),
|
|
2784
|
-
...c.sort((g, I) => g.priority - I.priority)
|
|
2785
|
-
];
|
|
2909
|
+
e === "" ? $ = this.countries : $ = u2(this.countries, e), this.ui.filterCountries($);
|
|
2786
2910
|
}
|
|
2787
2911
|
//* Highlight the next/prev item in the list (and ensure it is visible).
|
|
2788
2912
|
_handleUpDownKey(e) {
|
|
2789
2913
|
var i, s;
|
|
2790
|
-
let $ = e ===
|
|
2791
|
-
!$ && this.ui.countryList.childElementCount > 1 && ($ = e ===
|
|
2914
|
+
let $ = e === x.ARROW_UP ? (i = this.ui.highlightedItem) == null ? void 0 : i.previousElementSibling : (s = this.ui.highlightedItem) == null ? void 0 : s.nextElementSibling;
|
|
2915
|
+
!$ && this.ui.countryList.childElementCount > 1 && ($ = e === x.ARROW_UP ? this.ui.countryList.lastElementChild : this.ui.countryList.firstElementChild), $ && (this.ui.scrollTo($), this.ui.highlightListItem($, !1));
|
|
2792
2916
|
}
|
|
2793
2917
|
//* Select the currently highlighted item.
|
|
2794
2918
|
_handleEnterKey() {
|
|
@@ -2798,9 +2922,9 @@ class v1 {
|
|
|
2798
2922
|
//* NOTE: this is called from _setInitialState, handleUtils and setNumber.
|
|
2799
2923
|
_updateValFromNumber(e) {
|
|
2800
2924
|
let $ = e;
|
|
2801
|
-
if (this.options.formatOnDisplay &&
|
|
2802
|
-
const i = this.options.nationalMode || !$.startsWith("+") && !this.options.separateDialCode, { NATIONAL: s, INTERNATIONAL:
|
|
2803
|
-
$ =
|
|
2925
|
+
if (this.options.formatOnDisplay && m.utils && this.selectedCountryData) {
|
|
2926
|
+
const i = this.options.nationalMode || !$.startsWith("+") && !this.options.separateDialCode, { NATIONAL: s, INTERNATIONAL: a } = m.utils.numberFormat, u = i ? s : a;
|
|
2927
|
+
$ = m.utils.formatNumber(
|
|
2804
2928
|
$,
|
|
2805
2929
|
this.selectedCountryData.iso2,
|
|
2806
2930
|
u
|
|
@@ -2828,29 +2952,29 @@ class v1 {
|
|
|
2828
2952
|
_getNewCountryFromNumber(e) {
|
|
2829
2953
|
const $ = e.indexOf("+");
|
|
2830
2954
|
let i = $ ? e.substring($) : e;
|
|
2831
|
-
const s = this.selectedCountryData.iso2,
|
|
2955
|
+
const s = this.selectedCountryData.iso2, a = this.selectedCountryData.dialCode;
|
|
2832
2956
|
i = this._ensureHasDialCode(i);
|
|
2833
|
-
const u = this._getDialCode(i, !0), f =
|
|
2957
|
+
const u = this._getDialCode(i, !0), f = m1(i);
|
|
2834
2958
|
if (u) {
|
|
2835
|
-
const
|
|
2836
|
-
if (
|
|
2837
|
-
return
|
|
2838
|
-
if (!s && this.defaultCountry &&
|
|
2959
|
+
const C = m1(u), I = this.dialCodeToIso2Map[C];
|
|
2960
|
+
if (I.length === 1)
|
|
2961
|
+
return I[0] === s ? null : I[0];
|
|
2962
|
+
if (!s && this.defaultCountry && I.includes(this.defaultCountry))
|
|
2839
2963
|
return this.defaultCountry;
|
|
2840
|
-
if (
|
|
2964
|
+
if (a === N0.NANP && _0(f))
|
|
2841
2965
|
return null;
|
|
2842
|
-
const { areaCodes:
|
|
2843
|
-
if (
|
|
2844
|
-
const
|
|
2845
|
-
(
|
|
2966
|
+
const { areaCodes: A, priority: v } = this.selectedCountryData;
|
|
2967
|
+
if (A) {
|
|
2968
|
+
const B = A.map(
|
|
2969
|
+
(W) => `${a}${W}`
|
|
2846
2970
|
);
|
|
2847
|
-
for (const
|
|
2848
|
-
if (f.startsWith(
|
|
2971
|
+
for (const W of B)
|
|
2972
|
+
if (f.startsWith(W))
|
|
2849
2973
|
return null;
|
|
2850
2974
|
}
|
|
2851
|
-
const
|
|
2852
|
-
if (!
|
|
2853
|
-
return
|
|
2975
|
+
const T = A && !(v === 0) && f.length > C.length, k = s && I.includes(s) && !T, P = s === I[0];
|
|
2976
|
+
if (!k && !P)
|
|
2977
|
+
return I[0];
|
|
2854
2978
|
} else {
|
|
2855
2979
|
if (i.startsWith("+") && f.length)
|
|
2856
2980
|
return "";
|
|
@@ -2862,43 +2986,43 @@ class v1 {
|
|
|
2862
2986
|
//* Update the selected country, dial code (if separateDialCode), placeholder, title, and active list item.
|
|
2863
2987
|
//* Note: called from _setInitialState, _updateCountryFromNumber, _selectListItem, setCountry.
|
|
2864
2988
|
_setCountry(e) {
|
|
2865
|
-
const { separateDialCode: $, showFlags: i, i18n: s } = this.options,
|
|
2989
|
+
const { separateDialCode: $, showFlags: i, i18n: s } = this.options, a = this.selectedCountryData.iso2 || "";
|
|
2866
2990
|
if (this.selectedCountryData = e ? this.countryByIso2.get(e) : {}, this.selectedCountryData.iso2 && (this.defaultCountry = this.selectedCountryData.iso2), this.ui.selectedCountry) {
|
|
2867
|
-
const u = e && i ?
|
|
2868
|
-
let f,
|
|
2991
|
+
const u = e && i ? `${E.FLAG} iti__${e}` : `${E.FLAG} ${E.GLOBE}`;
|
|
2992
|
+
let f, C;
|
|
2869
2993
|
if (e) {
|
|
2870
|
-
const { name:
|
|
2871
|
-
|
|
2994
|
+
const { name: I, dialCode: _ } = this.selectedCountryData;
|
|
2995
|
+
C = I, f = s.selectedCountryAriaLabel.replace("${countryName}", I).replace("${dialCode}", `+${_}`);
|
|
2872
2996
|
} else
|
|
2873
|
-
|
|
2874
|
-
this.ui.selectedCountryInner.className = u, this.ui.selectedCountry.setAttribute("title",
|
|
2997
|
+
C = s.noCountrySelected, f = s.noCountrySelected;
|
|
2998
|
+
this.ui.selectedCountryInner.className = u, this.ui.selectedCountry.setAttribute("title", C), this.ui.selectedCountry.setAttribute(L.LABEL, f);
|
|
2875
2999
|
}
|
|
2876
3000
|
if ($) {
|
|
2877
3001
|
const u = this.selectedCountryData.dialCode ? `+${this.selectedCountryData.dialCode}` : "";
|
|
2878
3002
|
this.ui.selectedDialCode.textContent = u, this.ui.updateInputPadding();
|
|
2879
3003
|
}
|
|
2880
|
-
return this._updatePlaceholder(), this._updateMaxLength(),
|
|
3004
|
+
return this._updatePlaceholder(), this._updateMaxLength(), a !== e;
|
|
2881
3005
|
}
|
|
2882
3006
|
//* Update the maximum valid number length for the currently selected country.
|
|
2883
3007
|
_updateMaxLength() {
|
|
2884
3008
|
const { strictMode: e, placeholderNumberType: $, validationNumberTypes: i } = this.options, { iso2: s } = this.selectedCountryData;
|
|
2885
|
-
if (e &&
|
|
3009
|
+
if (e && m.utils)
|
|
2886
3010
|
if (s) {
|
|
2887
|
-
const
|
|
2888
|
-
let u =
|
|
3011
|
+
const a = m.utils.numberType[$];
|
|
3012
|
+
let u = m.utils.getExampleNumber(
|
|
2889
3013
|
s,
|
|
2890
3014
|
!1,
|
|
2891
|
-
|
|
3015
|
+
a,
|
|
2892
3016
|
!0
|
|
2893
3017
|
), f = u;
|
|
2894
|
-
for (;
|
|
3018
|
+
for (; m.utils.isPossibleNumber(
|
|
2895
3019
|
u,
|
|
2896
3020
|
s,
|
|
2897
3021
|
i
|
|
2898
3022
|
); )
|
|
2899
3023
|
f = u, u += "0";
|
|
2900
|
-
const
|
|
2901
|
-
this.maxCoreNumberLength =
|
|
3024
|
+
const C = m.utils.getCoreNumber(f, s);
|
|
3025
|
+
this.maxCoreNumberLength = C.length, s === "by" && (this.maxCoreNumberLength = C.length + 1);
|
|
2902
3026
|
} else
|
|
2903
3027
|
this.maxCoreNumberLength = null;
|
|
2904
3028
|
}
|
|
@@ -2909,10 +3033,10 @@ class v1 {
|
|
|
2909
3033
|
placeholderNumberType: $,
|
|
2910
3034
|
nationalMode: i,
|
|
2911
3035
|
customPlaceholder: s
|
|
2912
|
-
} = this.options,
|
|
2913
|
-
if (
|
|
2914
|
-
const u =
|
|
2915
|
-
let f = this.selectedCountryData.iso2 ?
|
|
3036
|
+
} = this.options, a = e === "aggressive" || !this.ui.hadInitialPlaceholder && e === "polite";
|
|
3037
|
+
if (m.utils && a) {
|
|
3038
|
+
const u = m.utils.numberType[$];
|
|
3039
|
+
let f = this.selectedCountryData.iso2 ? m.utils.getExampleNumber(
|
|
2916
3040
|
this.selectedCountryData.iso2,
|
|
2917
3041
|
i,
|
|
2918
3042
|
u
|
|
@@ -2922,14 +3046,14 @@ class v1 {
|
|
|
2922
3046
|
}
|
|
2923
3047
|
//* Called when the user selects a list item from the dropdown.
|
|
2924
3048
|
_selectListItem(e) {
|
|
2925
|
-
const $ = e.dataset.
|
|
3049
|
+
const $ = e.dataset[I0.COUNTRY_CODE], i = this._setCountry($);
|
|
2926
3050
|
this._closeDropdown();
|
|
2927
|
-
const s = e.dataset.
|
|
3051
|
+
const s = e.dataset[I0.DIAL_CODE];
|
|
2928
3052
|
this._updateDialCode(s), this.options.formatOnDisplay && this._updateValFromNumber(this.ui.telInput.value), this.ui.telInput.focus(), i && this._triggerCountryChange();
|
|
2929
3053
|
}
|
|
2930
3054
|
//* Close the dropdown and unbind any listeners.
|
|
2931
3055
|
_closeDropdown() {
|
|
2932
|
-
this.ui.dropdownContent.classList.contains(
|
|
3056
|
+
this.ui.dropdownContent.classList.contains(E.HIDE) || (this.ui.dropdownContent.classList.add(E.HIDE), this.ui.selectedCountry.setAttribute(L.EXPANDED, "false"), this.ui.highlightedItem && this.ui.highlightedItem.setAttribute(L.SELECTED, "false"), this.options.countrySearch && this.ui.searchInput.removeAttribute(L.ACTIVE_DESCENDANT), this.ui.dropdownArrow.classList.remove(E.ARROW_UP), this.dropdownAbortController.abort(), this.dropdownAbortController = null, this.options.dropdownContainer && this.ui.dropdown.remove(), this._trigger(g1.CLOSE_COUNTRY_DROPDOWN));
|
|
2933
3057
|
}
|
|
2934
3058
|
//* Replace any existing dial code with the new one
|
|
2935
3059
|
//* Note: called from _selectListItem and setCountry
|
|
@@ -2937,8 +3061,8 @@ class v1 {
|
|
|
2937
3061
|
const $ = this.ui.telInput.value, i = `+${e}`;
|
|
2938
3062
|
let s;
|
|
2939
3063
|
if ($.startsWith("+")) {
|
|
2940
|
-
const
|
|
2941
|
-
|
|
3064
|
+
const a = this._getDialCode($);
|
|
3065
|
+
a ? s = $.replace(a, i) : s = i, this.ui.telInput.value = s;
|
|
2942
3066
|
}
|
|
2943
3067
|
}
|
|
2944
3068
|
//* Try and extract a valid international dial code from a full telephone number.
|
|
@@ -2947,15 +3071,15 @@ class v1 {
|
|
|
2947
3071
|
let i = "";
|
|
2948
3072
|
if (e.startsWith("+")) {
|
|
2949
3073
|
let s = "";
|
|
2950
|
-
for (let
|
|
2951
|
-
const u = e.charAt(
|
|
3074
|
+
for (let a = 0; a < e.length; a++) {
|
|
3075
|
+
const u = e.charAt(a);
|
|
2952
3076
|
if (/[0-9]/.test(u)) {
|
|
2953
3077
|
if (s += u, !!!this.dialCodeToIso2Map[s])
|
|
2954
3078
|
break;
|
|
2955
3079
|
if ($)
|
|
2956
|
-
i = e.substring(0,
|
|
3080
|
+
i = e.substring(0, a + 1);
|
|
2957
3081
|
else if (this.dialCodes.has(s)) {
|
|
2958
|
-
i = e.substring(0,
|
|
3082
|
+
i = e.substring(0, a + 1);
|
|
2959
3083
|
break;
|
|
2960
3084
|
}
|
|
2961
3085
|
if (s.length === this.dialCodeMaxLen)
|
|
@@ -2969,12 +3093,12 @@ class v1 {
|
|
|
2969
3093
|
_getFullNumber(e) {
|
|
2970
3094
|
const $ = e || this.ui.telInput.value.trim(), { dialCode: i } = this.selectedCountryData;
|
|
2971
3095
|
let s;
|
|
2972
|
-
const
|
|
2973
|
-
return this.options.separateDialCode && !$.startsWith("+") && i &&
|
|
3096
|
+
const a = m1($);
|
|
3097
|
+
return this.options.separateDialCode && !$.startsWith("+") && i && a ? s = `+${i}` : s = "", s + $;
|
|
2974
3098
|
}
|
|
2975
3099
|
//* Remove the dial code if separateDialCode is enabled also cap the length if the input has a maxlength attribute
|
|
2976
3100
|
_beforeSetNumber(e) {
|
|
2977
|
-
const $ = this._getDialCode(e), i =
|
|
3101
|
+
const $ = this._getDialCode(e), i = y2(
|
|
2978
3102
|
e,
|
|
2979
3103
|
$,
|
|
2980
3104
|
this.options.separateDialCode,
|
|
@@ -2984,38 +3108,38 @@ class v1 {
|
|
|
2984
3108
|
}
|
|
2985
3109
|
//* Trigger the 'countrychange' event.
|
|
2986
3110
|
_triggerCountryChange() {
|
|
2987
|
-
this._trigger(
|
|
3111
|
+
this._trigger(g1.COUNTRY_CHANGE);
|
|
2988
3112
|
}
|
|
2989
3113
|
//**************************
|
|
2990
3114
|
//* SECRET PUBLIC METHODS
|
|
2991
3115
|
//**************************
|
|
2992
3116
|
//* This is called when the geoip call returns.
|
|
2993
3117
|
handleAutoCountry() {
|
|
2994
|
-
this.options.initialCountry ===
|
|
3118
|
+
this.options.initialCountry === T1.AUTO && m.autoCountry && (this.defaultCountry = m.autoCountry, this.selectedCountryData.iso2 || this.ui.selectedCountryInner.classList.contains(E.GLOBE) || this.setCountry(this.defaultCountry), this.resolveAutoCountryPromise());
|
|
2995
3119
|
}
|
|
2996
3120
|
//* This is called when the utils request completes.
|
|
2997
3121
|
handleUtils() {
|
|
2998
|
-
|
|
3122
|
+
m.utils && (this.ui.telInput.value && this._updateValFromNumber(this.ui.telInput.value), this.selectedCountryData.iso2 && (this._updatePlaceholder(), this._updateMaxLength())), this.resolveUtilsScriptPromise();
|
|
2999
3123
|
}
|
|
3000
3124
|
//********************
|
|
3001
3125
|
//* PUBLIC METHODS
|
|
3002
3126
|
//********************
|
|
3003
3127
|
//* Remove plugin.
|
|
3004
3128
|
destroy() {
|
|
3005
|
-
this.ui.telInput && (this.options.allowDropdown && this._closeDropdown(), this.abortController.abort(), this.abortController = null, this.ui.destroy(),
|
|
3129
|
+
this.ui.telInput && (this.options.allowDropdown && this._closeDropdown(), this.abortController.abort(), this.abortController = null, this.ui.destroy(), m.instances instanceof Map ? m.instances.delete(this.id) : delete m.instances[this.id]);
|
|
3006
3130
|
}
|
|
3007
3131
|
//* Get the extension from the current number.
|
|
3008
3132
|
getExtension() {
|
|
3009
|
-
return
|
|
3133
|
+
return m.utils ? m.utils.getExtension(
|
|
3010
3134
|
this._getFullNumber(),
|
|
3011
3135
|
this.selectedCountryData.iso2
|
|
3012
3136
|
) : "";
|
|
3013
3137
|
}
|
|
3014
3138
|
//* Format the number to the given format.
|
|
3015
3139
|
getNumber(e) {
|
|
3016
|
-
if (
|
|
3140
|
+
if (m.utils) {
|
|
3017
3141
|
const { iso2: $ } = this.selectedCountryData;
|
|
3018
|
-
return
|
|
3142
|
+
return m.utils.formatNumber(
|
|
3019
3143
|
this._getFullNumber(),
|
|
3020
3144
|
$,
|
|
3021
3145
|
e
|
|
@@ -3025,10 +3149,10 @@ class v1 {
|
|
|
3025
3149
|
}
|
|
3026
3150
|
//* Get the type of the entered number e.g. landline/mobile.
|
|
3027
3151
|
getNumberType() {
|
|
3028
|
-
return
|
|
3152
|
+
return m.utils ? m.utils.getNumberType(
|
|
3029
3153
|
this._getFullNumber(),
|
|
3030
3154
|
this.selectedCountryData.iso2
|
|
3031
|
-
) :
|
|
3155
|
+
) : y0.UNKNOWN_NUMBER_TYPE;
|
|
3032
3156
|
}
|
|
3033
3157
|
//* Get the country data for the currently selected country.
|
|
3034
3158
|
getSelectedCountryData() {
|
|
@@ -3036,18 +3160,18 @@ class v1 {
|
|
|
3036
3160
|
}
|
|
3037
3161
|
//* Get the validation error.
|
|
3038
3162
|
getValidationError() {
|
|
3039
|
-
if (
|
|
3163
|
+
if (m.utils) {
|
|
3040
3164
|
const { iso2: e } = this.selectedCountryData;
|
|
3041
|
-
return
|
|
3165
|
+
return m.utils.getValidationError(this._getFullNumber(), e);
|
|
3042
3166
|
}
|
|
3043
|
-
return
|
|
3167
|
+
return y0.UNKNOWN_VALIDATION_ERROR;
|
|
3044
3168
|
}
|
|
3045
3169
|
//* Validate the input val using number length only
|
|
3046
3170
|
isValidNumber() {
|
|
3047
3171
|
const { dialCode: e, iso2: $ } = this.selectedCountryData;
|
|
3048
|
-
if (e ===
|
|
3049
|
-
const i = this._getFullNumber(), s =
|
|
3050
|
-
if (s[0] ===
|
|
3172
|
+
if (e === b1.DIAL_CODE && m.utils) {
|
|
3173
|
+
const i = this._getFullNumber(), s = m.utils.getCoreNumber(i, $);
|
|
3174
|
+
if (s[0] === b1.MOBILE_PREFIX && s.length !== b1.MOBILE_CORE_LENGTH)
|
|
3051
3175
|
return !1;
|
|
3052
3176
|
}
|
|
3053
3177
|
return this._validateNumber(!1);
|
|
@@ -3057,7 +3181,7 @@ class v1 {
|
|
|
3057
3181
|
return this._validateNumber(!0);
|
|
3058
3182
|
}
|
|
3059
3183
|
_utilsIsPossibleNumber(e) {
|
|
3060
|
-
return
|
|
3184
|
+
return m.utils ? m.utils.isPossibleNumber(
|
|
3061
3185
|
e,
|
|
3062
3186
|
this.selectedCountryData.iso2,
|
|
3063
3187
|
this.options.validationNumberTypes
|
|
@@ -3065,19 +3189,19 @@ class v1 {
|
|
|
3065
3189
|
}
|
|
3066
3190
|
//* Shared internal validation logic to handle alpha character extension rules.
|
|
3067
3191
|
_validateNumber(e) {
|
|
3068
|
-
if (!
|
|
3192
|
+
if (!m.utils)
|
|
3069
3193
|
return null;
|
|
3070
3194
|
if (!this.selectedCountryData.iso2)
|
|
3071
3195
|
return !1;
|
|
3072
|
-
const $ = (u) => e ? this._utilsIsValidNumber(u) : this._utilsIsPossibleNumber(u), i = this._getFullNumber(), s = i.search(
|
|
3196
|
+
const $ = (u) => e ? this._utilsIsValidNumber(u) : this._utilsIsPossibleNumber(u), i = this._getFullNumber(), s = i.search(q.ALPHA_UNICODE);
|
|
3073
3197
|
if (s > -1 && !this.options.allowPhonewords) {
|
|
3074
|
-
const u = i.substring(0, s), f = $(u),
|
|
3075
|
-
return f &&
|
|
3198
|
+
const u = i.substring(0, s), f = $(u), C = $(i);
|
|
3199
|
+
return f && C;
|
|
3076
3200
|
}
|
|
3077
3201
|
return $(i);
|
|
3078
3202
|
}
|
|
3079
3203
|
_utilsIsValidNumber(e) {
|
|
3080
|
-
return
|
|
3204
|
+
return m.utils ? m.utils.isValidNumber(
|
|
3081
3205
|
e,
|
|
3082
3206
|
this.selectedCountryData.iso2,
|
|
3083
3207
|
this.options.validationNumberTypes
|
|
@@ -3086,7 +3210,7 @@ class v1 {
|
|
|
3086
3210
|
//* Update the selected country, and update the input val accordingly.
|
|
3087
3211
|
setCountry(e) {
|
|
3088
3212
|
const $ = e == null ? void 0 : e.toLowerCase();
|
|
3089
|
-
if (!
|
|
3213
|
+
if (!P1($))
|
|
3090
3214
|
throw new Error(`Invalid country code: '${$}'`);
|
|
3091
3215
|
const i = this.selectedCountryData.iso2;
|
|
3092
3216
|
(e && $ !== i || !e && i) && (this._setCountry($), this._updateDialCode(this.selectedCountryData.dialCode), this.options.formatOnDisplay && this._updateValFromNumber(this.ui.telInput.value), this._triggerCountryChange());
|
|
@@ -3094,7 +3218,7 @@ class v1 {
|
|
|
3094
3218
|
//* Set the input value and update the country.
|
|
3095
3219
|
setNumber(e) {
|
|
3096
3220
|
const $ = this._updateCountryFromNumber(e);
|
|
3097
|
-
this._updateValFromNumber(e), $ && this._triggerCountryChange(), this._trigger(
|
|
3221
|
+
this._updateValFromNumber(e), $ && this._triggerCountryChange(), this._trigger(g1.INPUT, { isSetNumber: !0 });
|
|
3098
3222
|
}
|
|
3099
3223
|
//* Set the placeholder number typ
|
|
3100
3224
|
setPlaceholderNumberType(e) {
|
|
@@ -3104,67 +3228,67 @@ class v1 {
|
|
|
3104
3228
|
this.ui.telInput.disabled = e, e ? this.ui.selectedCountry.setAttribute("disabled", "true") : this.ui.selectedCountry.removeAttribute("disabled");
|
|
3105
3229
|
}
|
|
3106
3230
|
}
|
|
3107
|
-
const
|
|
3108
|
-
if (!
|
|
3231
|
+
const L2 = (h) => {
|
|
3232
|
+
if (!m.utils && !m.startedLoadingUtilsScript) {
|
|
3109
3233
|
let e;
|
|
3110
|
-
if (typeof
|
|
3234
|
+
if (typeof h == "function")
|
|
3111
3235
|
try {
|
|
3112
|
-
e = Promise.resolve(
|
|
3236
|
+
e = Promise.resolve(h());
|
|
3113
3237
|
} catch ($) {
|
|
3114
3238
|
return Promise.reject($);
|
|
3115
3239
|
}
|
|
3116
3240
|
else
|
|
3117
3241
|
return Promise.reject(
|
|
3118
3242
|
new TypeError(
|
|
3119
|
-
`The argument passed to attachUtils must be a function that returns a promise for the utilities module, not ${typeof
|
|
3243
|
+
`The argument passed to attachUtils must be a function that returns a promise for the utilities module, not ${typeof h}`
|
|
3120
3244
|
)
|
|
3121
3245
|
);
|
|
3122
|
-
return
|
|
3246
|
+
return m.startedLoadingUtilsScript = !0, e.then(($) => {
|
|
3123
3247
|
const i = $ == null ? void 0 : $.default;
|
|
3124
3248
|
if (!i || typeof i != "object")
|
|
3125
3249
|
throw new TypeError(
|
|
3126
3250
|
"The loader function passed to attachUtils did not resolve to a module object with utils as its default export."
|
|
3127
3251
|
);
|
|
3128
|
-
return
|
|
3252
|
+
return m.utils = i, r1("handleUtils"), !0;
|
|
3129
3253
|
}).catch(($) => {
|
|
3130
|
-
throw
|
|
3254
|
+
throw r1("rejectUtilsScriptPromise", $), $;
|
|
3131
3255
|
});
|
|
3132
3256
|
}
|
|
3133
3257
|
return null;
|
|
3134
|
-
},
|
|
3135
|
-
Object.values(
|
|
3136
|
-
const i = $[
|
|
3258
|
+
}, r1 = (h, ...e) => {
|
|
3259
|
+
Object.values(m.instances).forEach(($) => {
|
|
3260
|
+
const i = $[h];
|
|
3137
3261
|
typeof i == "function" && i.apply($, e);
|
|
3138
3262
|
});
|
|
3139
|
-
},
|
|
3140
|
-
(
|
|
3141
|
-
const $ = new
|
|
3142
|
-
return
|
|
3263
|
+
}, m = Object.assign(
|
|
3264
|
+
(h, e) => {
|
|
3265
|
+
const $ = new M1(h, e);
|
|
3266
|
+
return m.instances[$.id] = $, h.iti = $, $;
|
|
3143
3267
|
},
|
|
3144
3268
|
{
|
|
3145
|
-
defaults:
|
|
3269
|
+
defaults: S0,
|
|
3146
3270
|
//* Using a static var like this allows us to mock it in the tests.
|
|
3147
3271
|
documentReady: () => document.readyState === "complete",
|
|
3148
3272
|
//* Get the country data object.
|
|
3149
|
-
getCountryData: () =>
|
|
3273
|
+
getCountryData: () => Q,
|
|
3150
3274
|
//* A getter for the plugin instance.
|
|
3151
|
-
getInstance: (
|
|
3152
|
-
const e =
|
|
3153
|
-
return e ?
|
|
3275
|
+
getInstance: (h) => {
|
|
3276
|
+
const e = h.dataset.intlTelInputId;
|
|
3277
|
+
return e ? m.instances[e] : null;
|
|
3154
3278
|
},
|
|
3155
3279
|
//* A map from instance ID to instance object.
|
|
3156
3280
|
instances: {},
|
|
3157
|
-
attachUtils:
|
|
3281
|
+
attachUtils: L2,
|
|
3158
3282
|
startedLoadingUtilsScript: !1,
|
|
3159
3283
|
startedLoadingAutoCountry: !1,
|
|
3160
|
-
version: "25.11.
|
|
3284
|
+
version: "25.11.1"
|
|
3161
3285
|
}
|
|
3162
3286
|
);
|
|
3163
3287
|
(function() {
|
|
3164
|
-
var
|
|
3288
|
+
var h = this || self;
|
|
3165
3289
|
function e(d, t) {
|
|
3166
3290
|
d = d.split(".");
|
|
3167
|
-
var n =
|
|
3291
|
+
var n = h;
|
|
3168
3292
|
d[0] in n || typeof n.execScript > "u" || n.execScript("var " + d[0]);
|
|
3169
3293
|
for (var r; d.length && (r = d.shift()); ) d.length || t === void 0 ? n[r] && n[r] !== Object.prototype[r] ? n = n[r] : n = n[r] = {} : n[r] = t;
|
|
3170
3294
|
}
|
|
@@ -3172,8 +3296,8 @@ const r2 = (p) => {
|
|
|
3172
3296
|
function n() {
|
|
3173
3297
|
}
|
|
3174
3298
|
n.prototype = t.prototype, d.ma = t.prototype, d.prototype = new n(), d.prototype.constructor = d, d.sa = function(r, o, l) {
|
|
3175
|
-
for (var
|
|
3176
|
-
return t.prototype[o].apply(r,
|
|
3299
|
+
for (var c = Array(arguments.length - 2), p = 2; p < arguments.length; p++) c[p - 2] = arguments[p];
|
|
3300
|
+
return t.prototype[o].apply(r, c);
|
|
3177
3301
|
};
|
|
3178
3302
|
}
|
|
3179
3303
|
function i(d) {
|
|
@@ -3184,13 +3308,13 @@ const r2 = (p) => {
|
|
|
3184
3308
|
}
|
|
3185
3309
|
var s = class {
|
|
3186
3310
|
constructor(d) {
|
|
3187
|
-
if (
|
|
3311
|
+
if (a !== a) throw Error("SafeUrl is not meant to be built directly");
|
|
3188
3312
|
this.g = d;
|
|
3189
3313
|
}
|
|
3190
3314
|
toString() {
|
|
3191
3315
|
return this.g.toString();
|
|
3192
3316
|
}
|
|
3193
|
-
},
|
|
3317
|
+
}, a = {};
|
|
3194
3318
|
new s("about:invalid#zClosurez"), new s("about:blank");
|
|
3195
3319
|
const u = {};
|
|
3196
3320
|
class f {
|
|
@@ -3202,93 +3326,93 @@ const r2 = (p) => {
|
|
|
3202
3326
|
}
|
|
3203
3327
|
}
|
|
3204
3328
|
new f();
|
|
3205
|
-
const
|
|
3206
|
-
class
|
|
3329
|
+
const C = {};
|
|
3330
|
+
class I {
|
|
3207
3331
|
constructor() {
|
|
3208
|
-
if (
|
|
3332
|
+
if (C !== C) throw Error("SafeStyleSheet is not meant to be built directly");
|
|
3209
3333
|
}
|
|
3210
3334
|
toString() {
|
|
3211
3335
|
return "";
|
|
3212
3336
|
}
|
|
3213
3337
|
}
|
|
3214
|
-
new
|
|
3215
|
-
const
|
|
3216
|
-
class
|
|
3338
|
+
new I();
|
|
3339
|
+
const _ = {};
|
|
3340
|
+
class A {
|
|
3217
3341
|
constructor() {
|
|
3218
|
-
var t =
|
|
3219
|
-
if (
|
|
3342
|
+
var t = h.trustedTypes && h.trustedTypes.emptyHTML || "";
|
|
3343
|
+
if (_ !== _) throw Error("SafeHtml is not meant to be built directly");
|
|
3220
3344
|
this.g = t;
|
|
3221
3345
|
}
|
|
3222
3346
|
toString() {
|
|
3223
3347
|
return this.g.toString();
|
|
3224
3348
|
}
|
|
3225
3349
|
}
|
|
3226
|
-
new
|
|
3227
|
-
function
|
|
3350
|
+
new A();
|
|
3351
|
+
function v(d, t) {
|
|
3228
3352
|
switch (this.g = d, this.l = !!t.aa, this.h = t.i, this.s = t.type, this.o = !1, this.h) {
|
|
3229
|
-
case
|
|
3230
|
-
case E:
|
|
3353
|
+
case k:
|
|
3231
3354
|
case P:
|
|
3232
|
-
case
|
|
3233
|
-
case
|
|
3234
|
-
case
|
|
3235
|
-
case
|
|
3355
|
+
case B:
|
|
3356
|
+
case W:
|
|
3357
|
+
case y1:
|
|
3358
|
+
case T:
|
|
3359
|
+
case N:
|
|
3236
3360
|
this.o = !0;
|
|
3237
3361
|
}
|
|
3238
3362
|
this.j = t.defaultValue;
|
|
3239
3363
|
}
|
|
3240
|
-
var
|
|
3241
|
-
function
|
|
3364
|
+
var N = 1, T = 2, k = 3, P = 4, B = 6, W = 16, y1 = 18;
|
|
3365
|
+
function w0(d, t) {
|
|
3242
3366
|
for (this.h = d, this.g = {}, d = 0; d < t.length; d++) {
|
|
3243
3367
|
var n = t[d];
|
|
3244
3368
|
this.g[n.g] = n;
|
|
3245
3369
|
}
|
|
3246
3370
|
}
|
|
3247
|
-
function
|
|
3371
|
+
function b0(d) {
|
|
3248
3372
|
return d = i(d.g), d.sort(function(t, n) {
|
|
3249
3373
|
return t.g - n.g;
|
|
3250
3374
|
}), d;
|
|
3251
3375
|
}
|
|
3252
|
-
function
|
|
3376
|
+
function U() {
|
|
3253
3377
|
this.h = {}, this.j = this.m().g, this.g = this.l = null;
|
|
3254
3378
|
}
|
|
3255
|
-
|
|
3256
|
-
return
|
|
3257
|
-
},
|
|
3258
|
-
return
|
|
3259
|
-
},
|
|
3379
|
+
U.prototype.has = function(d) {
|
|
3380
|
+
return G(this, d.g);
|
|
3381
|
+
}, U.prototype.get = function(d, t) {
|
|
3382
|
+
return g(this, d.g, t);
|
|
3383
|
+
}, U.prototype.set = function(d, t) {
|
|
3260
3384
|
M(this, d.g, t);
|
|
3261
|
-
},
|
|
3262
|
-
|
|
3385
|
+
}, U.prototype.add = function(d, t) {
|
|
3386
|
+
O1(this, d.g, t);
|
|
3263
3387
|
};
|
|
3264
|
-
function
|
|
3265
|
-
for (var n =
|
|
3388
|
+
function R1(d, t) {
|
|
3389
|
+
for (var n = b0(d.m()), r = 0; r < n.length; r++) {
|
|
3266
3390
|
var o = n[r], l = o.g;
|
|
3267
|
-
if (
|
|
3391
|
+
if (G(t, l)) {
|
|
3268
3392
|
d.g && delete d.g[o.g];
|
|
3269
|
-
var
|
|
3393
|
+
var c = o.h == 11 || o.h == 10;
|
|
3270
3394
|
if (o.l) {
|
|
3271
|
-
o =
|
|
3272
|
-
for (var
|
|
3273
|
-
} else o =
|
|
3395
|
+
o = O(t, l);
|
|
3396
|
+
for (var p = 0; p < o.length; p++) O1(d, l, c ? o[p].clone() : o[p]);
|
|
3397
|
+
} else o = o1(t, l), c ? (c = o1(d, l)) ? R1(c, o) : M(d, l, o.clone()) : M(d, l, o);
|
|
3274
3398
|
}
|
|
3275
3399
|
}
|
|
3276
3400
|
}
|
|
3277
|
-
|
|
3401
|
+
U.prototype.clone = function() {
|
|
3278
3402
|
var d = new this.constructor();
|
|
3279
|
-
return d != this && (d.h = {}, d.g && (d.g = {}),
|
|
3403
|
+
return d != this && (d.h = {}, d.g && (d.g = {}), R1(d, this)), d;
|
|
3280
3404
|
};
|
|
3281
|
-
function
|
|
3405
|
+
function G(d, t) {
|
|
3282
3406
|
return d.h[t] != null;
|
|
3283
3407
|
}
|
|
3284
|
-
function
|
|
3408
|
+
function o1(d, t) {
|
|
3285
3409
|
var n = d.h[t];
|
|
3286
3410
|
if (n == null) return null;
|
|
3287
3411
|
if (d.l) {
|
|
3288
3412
|
if (!(t in d.g)) {
|
|
3289
3413
|
var r = d.l, o = d.j[t];
|
|
3290
3414
|
if (n != null) if (o.l) {
|
|
3291
|
-
for (var l = [],
|
|
3415
|
+
for (var l = [], c = 0; c < n.length; c++) l[c] = r.h(o, n[c]);
|
|
3292
3416
|
n = l;
|
|
3293
3417
|
} else n = r.h(o, n);
|
|
3294
3418
|
return d.g[t] = n;
|
|
@@ -3297,12 +3421,12 @@ const r2 = (p) => {
|
|
|
3297
3421
|
}
|
|
3298
3422
|
return n;
|
|
3299
3423
|
}
|
|
3300
|
-
function
|
|
3301
|
-
var r =
|
|
3424
|
+
function g(d, t, n) {
|
|
3425
|
+
var r = o1(d, t);
|
|
3302
3426
|
return d.j[t].l ? r[n || 0] : r;
|
|
3303
3427
|
}
|
|
3304
|
-
function
|
|
3305
|
-
if (
|
|
3428
|
+
function S(d, t) {
|
|
3429
|
+
if (G(d, t)) d = g(d, t);
|
|
3306
3430
|
else d: {
|
|
3307
3431
|
if (d = d.j[t], d.j === void 0) if (t = d.s, t === Boolean) d.j = !1;
|
|
3308
3432
|
else if (t === Number) d.j = 0;
|
|
@@ -3315,106 +3439,106 @@ const r2 = (p) => {
|
|
|
3315
3439
|
}
|
|
3316
3440
|
return d;
|
|
3317
3441
|
}
|
|
3318
|
-
function
|
|
3319
|
-
return
|
|
3442
|
+
function O(d, t) {
|
|
3443
|
+
return o1(d, t) || [];
|
|
3320
3444
|
}
|
|
3321
|
-
function
|
|
3322
|
-
return d.j[t].l ?
|
|
3445
|
+
function j(d, t) {
|
|
3446
|
+
return d.j[t].l ? G(d, t) ? d.h[t].length : 0 : G(d, t) ? 1 : 0;
|
|
3323
3447
|
}
|
|
3324
3448
|
function M(d, t, n) {
|
|
3325
3449
|
d.h[t] = n, d.g && (d.g[t] = n);
|
|
3326
3450
|
}
|
|
3327
|
-
function
|
|
3451
|
+
function O1(d, t, n) {
|
|
3328
3452
|
d.h[t] || (d.h[t] = []), d.h[t].push(n), d.g && delete d.g[t];
|
|
3329
3453
|
}
|
|
3330
|
-
function
|
|
3454
|
+
function u1(d, t) {
|
|
3331
3455
|
var n = [], r;
|
|
3332
|
-
for (r in t) r != 0 && n.push(new
|
|
3333
|
-
return new
|
|
3456
|
+
for (r in t) r != 0 && n.push(new v(r, t[r]));
|
|
3457
|
+
return new w0(d, n);
|
|
3334
3458
|
}
|
|
3335
|
-
function
|
|
3459
|
+
function l1() {
|
|
3336
3460
|
}
|
|
3337
|
-
|
|
3461
|
+
l1.prototype.g = function(d) {
|
|
3338
3462
|
throw new d.h(), Error("Unimplemented");
|
|
3339
|
-
},
|
|
3340
|
-
if (d.h == 11 || d.h == 10) return t instanceof
|
|
3341
|
-
if (d.h == 14) return typeof t == "string" &&
|
|
3463
|
+
}, l1.prototype.h = function(d, t) {
|
|
3464
|
+
if (d.h == 11 || d.h == 10) return t instanceof U ? t : this.g(d.s.prototype.m(), t);
|
|
3465
|
+
if (d.h == 14) return typeof t == "string" && x1.test(t) && (d = Number(t), 0 < d) ? d : t;
|
|
3342
3466
|
if (!d.o) return t;
|
|
3343
3467
|
if (d = d.s, d === String) {
|
|
3344
3468
|
if (typeof t == "number") return String(t);
|
|
3345
|
-
} else if (d === Number && typeof t == "string" && (t === "Infinity" || t === "-Infinity" || t === "NaN" ||
|
|
3469
|
+
} else if (d === Number && typeof t == "string" && (t === "Infinity" || t === "-Infinity" || t === "NaN" || x1.test(t))) return Number(t);
|
|
3346
3470
|
return t;
|
|
3347
3471
|
};
|
|
3348
|
-
var
|
|
3349
|
-
function
|
|
3472
|
+
var x1 = /^-?[0-9]+$/;
|
|
3473
|
+
function I1() {
|
|
3350
3474
|
}
|
|
3351
|
-
$(
|
|
3475
|
+
$(I1, l1), I1.prototype.g = function(d, t) {
|
|
3352
3476
|
return d = new d.h(), d.l = this, d.h = t, d.g = {}, d;
|
|
3353
3477
|
};
|
|
3354
|
-
function
|
|
3478
|
+
function t1() {
|
|
3355
3479
|
}
|
|
3356
|
-
$(
|
|
3357
|
-
return d.h == 8 ? !!t :
|
|
3358
|
-
},
|
|
3359
|
-
return
|
|
3480
|
+
$(t1, I1), t1.prototype.h = function(d, t) {
|
|
3481
|
+
return d.h == 8 ? !!t : l1.prototype.h.apply(this, arguments);
|
|
3482
|
+
}, t1.prototype.g = function(d, t) {
|
|
3483
|
+
return t1.ma.g.call(this, d, t);
|
|
3360
3484
|
};
|
|
3361
|
-
function
|
|
3485
|
+
function D(d, t) {
|
|
3362
3486
|
d != null && this.g.apply(this, arguments);
|
|
3363
3487
|
}
|
|
3364
|
-
|
|
3488
|
+
D.prototype.h = "", D.prototype.set = function(d) {
|
|
3365
3489
|
this.h = "" + d;
|
|
3366
|
-
},
|
|
3490
|
+
}, D.prototype.g = function(d, t, n) {
|
|
3367
3491
|
if (this.h += String(d), t != null) for (let r = 1; r < arguments.length; r++) this.h += arguments[r];
|
|
3368
3492
|
return this;
|
|
3369
3493
|
};
|
|
3370
|
-
function
|
|
3494
|
+
function H(d) {
|
|
3371
3495
|
d.h = "";
|
|
3372
3496
|
}
|
|
3373
|
-
|
|
3497
|
+
D.prototype.toString = function() {
|
|
3374
3498
|
return this.h;
|
|
3375
3499
|
};
|
|
3376
|
-
function
|
|
3377
|
-
|
|
3378
|
-
}
|
|
3379
|
-
$(
|
|
3380
|
-
var
|
|
3381
|
-
function
|
|
3382
|
-
|
|
3383
|
-
}
|
|
3384
|
-
$(
|
|
3385
|
-
var
|
|
3386
|
-
function
|
|
3387
|
-
|
|
3388
|
-
}
|
|
3389
|
-
$(
|
|
3390
|
-
var
|
|
3391
|
-
|
|
3392
|
-
var d =
|
|
3393
|
-
return d || (
|
|
3394
|
-
},
|
|
3395
|
-
var d =
|
|
3396
|
-
return d || (
|
|
3397
|
-
},
|
|
3398
|
-
var d =
|
|
3399
|
-
return d || (
|
|
3500
|
+
function Z() {
|
|
3501
|
+
U.call(this);
|
|
3502
|
+
}
|
|
3503
|
+
$(Z, U);
|
|
3504
|
+
var B1 = null;
|
|
3505
|
+
function b() {
|
|
3506
|
+
U.call(this);
|
|
3507
|
+
}
|
|
3508
|
+
$(b, U);
|
|
3509
|
+
var U1 = null;
|
|
3510
|
+
function J() {
|
|
3511
|
+
U.call(this);
|
|
3512
|
+
}
|
|
3513
|
+
$(J, U);
|
|
3514
|
+
var G1 = null;
|
|
3515
|
+
Z.prototype.m = function() {
|
|
3516
|
+
var d = B1;
|
|
3517
|
+
return d || (B1 = d = u1(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;
|
|
3518
|
+
}, Z.m = Z.prototype.m, b.prototype.m = function() {
|
|
3519
|
+
var d = U1;
|
|
3520
|
+
return d || (U1 = d = u1(b, { 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;
|
|
3521
|
+
}, b.m = b.prototype.m, J.prototype.m = function() {
|
|
3522
|
+
var d = G1;
|
|
3523
|
+
return d || (G1 = d = u1(J, {
|
|
3400
3524
|
0: { name: "PhoneMetadata", ia: "i18n.phonenumbers.PhoneMetadata" },
|
|
3401
|
-
1: { name: "general_desc", i: 11, type:
|
|
3402
|
-
2: { name: "fixed_line", i: 11, type:
|
|
3403
|
-
3: { name: "mobile", i: 11, type:
|
|
3404
|
-
4: { name: "toll_free", i: 11, type:
|
|
3405
|
-
5: { name: "premium_rate", i: 11, type:
|
|
3406
|
-
6: { name: "shared_cost", i: 11, type:
|
|
3407
|
-
7: { name: "personal_number", i: 11, type:
|
|
3408
|
-
8: { name: "voip", i: 11, type:
|
|
3409
|
-
21: { name: "pager", i: 11, type:
|
|
3410
|
-
25: { name: "uan", i: 11, type:
|
|
3411
|
-
27: { name: "emergency", i: 11, type:
|
|
3412
|
-
28: { name: "voicemail", i: 11, type:
|
|
3413
|
-
29: { name: "short_code", i: 11, type:
|
|
3414
|
-
30: { name: "standard_rate", i: 11, type:
|
|
3415
|
-
31: { name: "carrier_specific", i: 11, type:
|
|
3416
|
-
33: { name: "sms_services", i: 11, type:
|
|
3417
|
-
24: { name: "no_international_dialling", i: 11, type:
|
|
3525
|
+
1: { name: "general_desc", i: 11, type: b },
|
|
3526
|
+
2: { name: "fixed_line", i: 11, type: b },
|
|
3527
|
+
3: { name: "mobile", i: 11, type: b },
|
|
3528
|
+
4: { name: "toll_free", i: 11, type: b },
|
|
3529
|
+
5: { name: "premium_rate", i: 11, type: b },
|
|
3530
|
+
6: { name: "shared_cost", i: 11, type: b },
|
|
3531
|
+
7: { name: "personal_number", i: 11, type: b },
|
|
3532
|
+
8: { name: "voip", i: 11, type: b },
|
|
3533
|
+
21: { name: "pager", i: 11, type: b },
|
|
3534
|
+
25: { name: "uan", i: 11, type: b },
|
|
3535
|
+
27: { name: "emergency", i: 11, type: b },
|
|
3536
|
+
28: { name: "voicemail", i: 11, type: b },
|
|
3537
|
+
29: { name: "short_code", i: 11, type: b },
|
|
3538
|
+
30: { name: "standard_rate", i: 11, type: b },
|
|
3539
|
+
31: { name: "carrier_specific", i: 11, type: b },
|
|
3540
|
+
33: { name: "sms_services", i: 11, type: b },
|
|
3541
|
+
24: { name: "no_international_dialling", i: 11, type: b },
|
|
3418
3542
|
9: { name: "id", required: !0, i: 9, type: String },
|
|
3419
3543
|
10: { name: "country_code", i: 5, type: Number },
|
|
3420
3544
|
11: { name: "international_prefix", i: 9, type: String },
|
|
@@ -3428,26 +3552,26 @@ const r2 = (p) => {
|
|
|
3428
3552
|
},
|
|
3429
3553
|
16: { name: "national_prefix_transform_rule", i: 9, type: String },
|
|
3430
3554
|
18: { name: "same_mobile_and_fixed_line_pattern", i: 8, defaultValue: !1, type: Boolean },
|
|
3431
|
-
19: { name: "number_format", aa: !0, i: 11, type:
|
|
3432
|
-
20: { name: "intl_number_format", aa: !0, i: 11, type:
|
|
3555
|
+
19: { name: "number_format", aa: !0, i: 11, type: Z },
|
|
3556
|
+
20: { name: "intl_number_format", aa: !0, i: 11, type: Z },
|
|
3433
3557
|
22: { name: "main_country_for_code", i: 8, defaultValue: !1, type: Boolean },
|
|
3434
3558
|
23: { name: "leading_digits", i: 9, type: String }
|
|
3435
3559
|
})), d;
|
|
3436
|
-
},
|
|
3437
|
-
function
|
|
3438
|
-
|
|
3439
|
-
}
|
|
3440
|
-
$(
|
|
3441
|
-
var
|
|
3442
|
-
|
|
3443
|
-
var d =
|
|
3444
|
-
return d || (
|
|
3560
|
+
}, J.m = J.prototype.m;
|
|
3561
|
+
function Y() {
|
|
3562
|
+
U.call(this);
|
|
3563
|
+
}
|
|
3564
|
+
$(Y, U);
|
|
3565
|
+
var H1 = null, T0 = { ra: 0, qa: 1, pa: 5, oa: 10, na: 20 };
|
|
3566
|
+
Y.prototype.m = function() {
|
|
3567
|
+
var d = H1;
|
|
3568
|
+
return d || (H1 = d = u1(Y, { 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: T0 }, 7: {
|
|
3445
3569
|
name: "preferred_domestic_carrier_code",
|
|
3446
3570
|
i: 9,
|
|
3447
3571
|
type: String
|
|
3448
3572
|
} })), d;
|
|
3449
|
-
},
|
|
3450
|
-
var
|
|
3573
|
+
}, Y.ctor = Y, Y.ctor.m = Y.prototype.m;
|
|
3574
|
+
var e1 = {
|
|
3451
3575
|
1: "US AG AI AS BB BM BS CA DM DO GD GU JM KN KY LC MP MS PR SX TC TT VC VG VI".split(" "),
|
|
3452
3576
|
7: ["RU", "KZ"],
|
|
3453
3577
|
20: ["EG"],
|
|
@@ -3663,7 +3787,7 @@ const r2 = (p) => {
|
|
|
3663
3787
|
995: ["GE"],
|
|
3664
3788
|
996: ["KG"],
|
|
3665
3789
|
998: ["UZ"]
|
|
3666
|
-
},
|
|
3790
|
+
}, k1 = {
|
|
3667
3791
|
AC: [, [
|
|
3668
3792
|
,
|
|
3669
3793
|
,
|
|
@@ -8797,13 +8921,13 @@ const r2 = (p) => {
|
|
|
8797
8921
|
], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], "001", 888, , , , , , , , 1, [[, "(\\d{3})(\\d{3})(\\d{5})", "$1 $2 $3"]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , "\\d{11}", , , , "12345678901"], , , [, , , , , , , , , [-1]]],
|
|
8798
8922
|
979: [, [, , "[1359]\\d{8}", , , , , , , [9], [8]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , "[1359]\\d{8}", , , , "123456789", , , , [8]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], "001", 979, , , , , , , , 1, [[, "(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["[1359]"]]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]]]
|
|
8799
8923
|
};
|
|
8800
|
-
function
|
|
8924
|
+
function R() {
|
|
8801
8925
|
this.g = {};
|
|
8802
8926
|
}
|
|
8803
|
-
|
|
8804
|
-
return
|
|
8927
|
+
R.h = void 0, R.g = function() {
|
|
8928
|
+
return R.h ? R.h : R.h = new R();
|
|
8805
8929
|
};
|
|
8806
|
-
var
|
|
8930
|
+
var _1 = { 0: "0", 1: "1", 2: "2", 3: "3", 4: "4", 5: "5", 6: "6", 7: "7", 8: "8", 9: "9", "0": "0", "1": "1", "2": "2", "3": "3", "4": "4", "5": "5", "6": "6", "7": "7", "8": "8", "9": "9", "٠": "0", "١": "1", "٢": "2", "٣": "3", "٤": "4", "٥": "5", "٦": "6", "٧": "7", "٨": "8", "٩": "9", "۰": "0", "۱": "1", "۲": "2", "۳": "3", "۴": "4", "۵": "5", "۶": "6", "۷": "7", "۸": "8", "۹": "9" }, D0 = {
|
|
8807
8931
|
0: "0",
|
|
8808
8932
|
1: "1",
|
|
8809
8933
|
2: "2",
|
|
@@ -8817,7 +8941,7 @@ const r2 = (p) => {
|
|
|
8817
8941
|
"+": "+",
|
|
8818
8942
|
"*": "*",
|
|
8819
8943
|
"#": "#"
|
|
8820
|
-
},
|
|
8944
|
+
}, v0 = {
|
|
8821
8945
|
0: "0",
|
|
8822
8946
|
1: "1",
|
|
8823
8947
|
2: "2",
|
|
@@ -8884,74 +9008,74 @@ const r2 = (p) => {
|
|
|
8884
9008
|
X: "9",
|
|
8885
9009
|
Y: "9",
|
|
8886
9010
|
Z: "9"
|
|
8887
|
-
},
|
|
8888
|
-
function
|
|
9011
|
+
}, P0 = RegExp("[++]+"), $1 = RegExp("^[++]+"), F1 = RegExp("([0-90-9٠-٩۰-۹])"), M0 = RegExp("[++0-90-9٠-٩۰-۹]"), R0 = /[\\\/] *x/, O0 = RegExp("[^0-90-9٠-٩۰-۹A-Za-z#]+$"), x0 = /(?:.*?[A-Za-z]){3}.*/, B0 = RegExp("^\\+([0-90-9٠-٩۰-۹]|[\\-\\.\\(\\)]?)*[0-90-9٠-٩۰-۹]([0-90-9٠-٩۰-۹]|[\\-\\.\\(\\)]?)*$"), U0 = RegExp("^([A-Za-z0-90-9٠-٩۰-۹]+((\\-)*[A-Za-z0-90-9٠-٩۰-۹])*\\.)*[A-Za-z]+((\\-)*[A-Za-z0-90-9٠-٩۰-۹])*\\.?$");
|
|
9012
|
+
function d1(d) {
|
|
8889
9013
|
return "([0-90-9٠-٩۰-۹]{1," + d + "})";
|
|
8890
9014
|
}
|
|
8891
|
-
function
|
|
8892
|
-
return ";ext=" +
|
|
9015
|
+
function W1() {
|
|
9016
|
+
return ";ext=" + d1("20") + "|[ \\t,]*(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)[:\\..]?[ \\t,-]*" + (d1("20") + "#?|[ \\t,]*(?:[xx##~~]|int|int)[:\\..]?[ \\t,-]*") + (d1("9") + "#?|[- ]+") + (d1("6") + "#|[ \\t]*(?:,{2}|;)[:\\..]?[ \\t,-]*") + (d1("15") + "#?|[ \\t]*(?:,)+[:\\..]?[ \\t,-]*") + (d1("9") + "#?");
|
|
8893
9017
|
}
|
|
8894
|
-
var
|
|
8895
|
-
function
|
|
8896
|
-
return 2 > d.length ? !1 :
|
|
9018
|
+
var V1 = new RegExp("(?:" + W1() + ")$", "i"), G0 = new RegExp("^[0-90-9٠-٩۰-۹]{2}$|^[++]*(?:[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~*]*[0-90-9٠-٩۰-۹]){3,}[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~*A-Za-z0-90-9٠-٩۰-۹]*(?:" + W1() + ")?$", "i"), H0 = /(\$\d)/, k0 = /^\(?\$1\)?$/;
|
|
9019
|
+
function K1(d) {
|
|
9020
|
+
return 2 > d.length ? !1 : V(G0, d);
|
|
8897
9021
|
}
|
|
8898
|
-
function
|
|
8899
|
-
return
|
|
9022
|
+
function j1(d) {
|
|
9023
|
+
return V(x0, d) ? a1(d, v0) : a1(d, _1);
|
|
8900
9024
|
}
|
|
8901
|
-
function
|
|
8902
|
-
var t =
|
|
8903
|
-
|
|
9025
|
+
function Y1(d) {
|
|
9026
|
+
var t = j1(d.toString());
|
|
9027
|
+
H(d), d.g(t);
|
|
8904
9028
|
}
|
|
8905
|
-
function
|
|
8906
|
-
return d != null && (
|
|
9029
|
+
function z1(d) {
|
|
9030
|
+
return d != null && (j(d, 9) != 1 || O(d, 9)[0] != -1);
|
|
8907
9031
|
}
|
|
8908
|
-
function
|
|
8909
|
-
for (var n = new
|
|
9032
|
+
function a1(d, t) {
|
|
9033
|
+
for (var n = new D(), r, o = d.length, l = 0; l < o; ++l) r = d.charAt(l), r = t[r.toUpperCase()], r != null && n.g(r);
|
|
8910
9034
|
return n.toString();
|
|
8911
9035
|
}
|
|
8912
|
-
function
|
|
8913
|
-
return d.length == 0 ||
|
|
9036
|
+
function Z1(d) {
|
|
9037
|
+
return d.length == 0 || k0.test(d);
|
|
8914
9038
|
}
|
|
8915
|
-
function
|
|
8916
|
-
return d != null && isNaN(d) && d.toUpperCase() in
|
|
9039
|
+
function c1(d) {
|
|
9040
|
+
return d != null && isNaN(d) && d.toUpperCase() in k1;
|
|
8917
9041
|
}
|
|
8918
|
-
|
|
8919
|
-
if (
|
|
8920
|
-
var n =
|
|
9042
|
+
R.prototype.format = function(d, t) {
|
|
9043
|
+
if (g(d, 2) == 0 && G(d, 5)) {
|
|
9044
|
+
var n = S(d, 5);
|
|
8921
9045
|
if (0 < n.length) return n;
|
|
8922
9046
|
}
|
|
8923
|
-
n =
|
|
8924
|
-
var r =
|
|
8925
|
-
if (t == 0) return
|
|
8926
|
-
if (!(n in
|
|
8927
|
-
var o =
|
|
8928
|
-
d =
|
|
9047
|
+
n = S(d, 1);
|
|
9048
|
+
var r = i1(d);
|
|
9049
|
+
if (t == 0) return J1(n, 0, r, "");
|
|
9050
|
+
if (!(n in e1)) return r;
|
|
9051
|
+
var o = n1(this, n, s1(n));
|
|
9052
|
+
d = G(d, 3) && g(d, 3).length != 0 ? t == 3 ? ";ext=" + g(d, 3) : G(o, 13) ? g(o, 13) + S(d, 3) : " ext. " + S(d, 3) : "";
|
|
8929
9053
|
d: {
|
|
8930
|
-
o =
|
|
8931
|
-
for (var l,
|
|
8932
|
-
l = o[
|
|
8933
|
-
var
|
|
8934
|
-
if ((
|
|
9054
|
+
o = O(o, 20).length == 0 || t == 2 ? O(o, 19) : O(o, 20);
|
|
9055
|
+
for (var l, c = o.length, p = 0; p < c; ++p) {
|
|
9056
|
+
l = o[p];
|
|
9057
|
+
var y = j(l, 3);
|
|
9058
|
+
if ((y == 0 || r.search(g(l, 3, y - 1)) == 0) && (y = new RegExp(g(l, 1)), V(y, r))) {
|
|
8935
9059
|
o = l;
|
|
8936
9060
|
break d;
|
|
8937
9061
|
}
|
|
8938
9062
|
}
|
|
8939
9063
|
o = null;
|
|
8940
9064
|
}
|
|
8941
|
-
return o != null && (
|
|
8942
|
-
|
|
9065
|
+
return o != null && (c = o, o = S(c, 2), l = new RegExp(g(c, 1)), S(
|
|
9066
|
+
c,
|
|
8943
9067
|
5
|
|
8944
|
-
),
|
|
9068
|
+
), c = S(c, 4), r = t == 2 && c != null && 0 < c.length ? r.replace(l, o.replace(H0, c)) : r.replace(l, o), t == 3 && (r = r.replace(RegExp("^[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]+"), ""), r = r.replace(RegExp("[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]+", "g"), "-"))), J1(n, t, r, d);
|
|
8945
9069
|
};
|
|
8946
|
-
function
|
|
8947
|
-
return n == "001" ?
|
|
9070
|
+
function n1(d, t, n) {
|
|
9071
|
+
return n == "001" ? z(d, "" + t) : z(d, n);
|
|
8948
9072
|
}
|
|
8949
|
-
function
|
|
8950
|
-
if (!
|
|
8951
|
-
var t = "" +
|
|
8952
|
-
return
|
|
9073
|
+
function i1(d) {
|
|
9074
|
+
if (!G(d, 2)) return "";
|
|
9075
|
+
var t = "" + g(d, 2);
|
|
9076
|
+
return G(d, 4) && g(d, 4) && 0 < S(d, 8) ? Array(S(d, 8) + 1).join("0") + t : t;
|
|
8953
9077
|
}
|
|
8954
|
-
function
|
|
9078
|
+
function J1(d, t, n, r) {
|
|
8955
9079
|
switch (t) {
|
|
8956
9080
|
case 0:
|
|
8957
9081
|
return "+" + d + n + r;
|
|
@@ -8963,74 +9087,74 @@ const r2 = (p) => {
|
|
|
8963
9087
|
return n + r;
|
|
8964
9088
|
}
|
|
8965
9089
|
}
|
|
8966
|
-
function
|
|
9090
|
+
function h1(d, t) {
|
|
8967
9091
|
switch (t) {
|
|
8968
9092
|
case 4:
|
|
8969
|
-
return
|
|
9093
|
+
return g(d, 5);
|
|
8970
9094
|
case 3:
|
|
8971
|
-
return
|
|
9095
|
+
return g(d, 4);
|
|
8972
9096
|
case 1:
|
|
8973
|
-
return
|
|
9097
|
+
return g(d, 3);
|
|
8974
9098
|
case 0:
|
|
8975
9099
|
case 2:
|
|
8976
|
-
return
|
|
9100
|
+
return g(d, 2);
|
|
8977
9101
|
case 5:
|
|
8978
|
-
return
|
|
9102
|
+
return g(d, 6);
|
|
8979
9103
|
case 6:
|
|
8980
|
-
return
|
|
9104
|
+
return g(d, 8);
|
|
8981
9105
|
case 7:
|
|
8982
|
-
return
|
|
9106
|
+
return g(d, 7);
|
|
8983
9107
|
case 8:
|
|
8984
|
-
return
|
|
9108
|
+
return g(d, 21);
|
|
8985
9109
|
case 9:
|
|
8986
|
-
return
|
|
9110
|
+
return g(d, 25);
|
|
8987
9111
|
case 10:
|
|
8988
|
-
return
|
|
9112
|
+
return g(d, 28);
|
|
8989
9113
|
default:
|
|
8990
|
-
return
|
|
9114
|
+
return g(d, 1);
|
|
8991
9115
|
}
|
|
8992
9116
|
}
|
|
8993
|
-
function
|
|
8994
|
-
var n =
|
|
8995
|
-
return d =
|
|
9117
|
+
function X1(d, t) {
|
|
9118
|
+
var n = q1(d, t);
|
|
9119
|
+
return d = n1(d, S(t, 1), n), d == null ? -1 : (t = i1(t), E1(t, d));
|
|
8996
9120
|
}
|
|
8997
|
-
function
|
|
8998
|
-
return
|
|
9121
|
+
function E1(d, t) {
|
|
9122
|
+
return F(d, g(t, 1)) ? F(d, g(t, 5)) ? 4 : F(d, g(t, 4)) ? 3 : F(d, g(t, 6)) ? 5 : F(d, g(t, 8)) ? 6 : F(d, g(t, 7)) ? 7 : F(d, g(t, 21)) ? 8 : F(d, g(t, 25)) ? 9 : F(d, g(t, 28)) ? 10 : F(d, g(t, 2)) ? g(t, 18) || F(d, g(t, 3)) ? 2 : 0 : !g(t, 18) && F(d, g(t, 3)) ? 1 : -1 : -1;
|
|
8999
9123
|
}
|
|
9000
|
-
function
|
|
9124
|
+
function z(d, t) {
|
|
9001
9125
|
if (t == null) return null;
|
|
9002
9126
|
t = t.toUpperCase();
|
|
9003
9127
|
var n = d.g[t];
|
|
9004
9128
|
if (n == null) {
|
|
9005
|
-
if (n =
|
|
9006
|
-
n = new
|
|
9129
|
+
if (n = k1[t], n == null) return null;
|
|
9130
|
+
n = new t1().g(J.m(), n), d.g[t] = n;
|
|
9007
9131
|
}
|
|
9008
9132
|
return n;
|
|
9009
9133
|
}
|
|
9010
|
-
function
|
|
9134
|
+
function F(d, t) {
|
|
9011
9135
|
var n = d.length;
|
|
9012
|
-
return 0 <
|
|
9136
|
+
return 0 < j(t, 9) && O(t, 9).indexOf(n) == -1 ? !1 : V(S(t, 2), d);
|
|
9013
9137
|
}
|
|
9014
|
-
function
|
|
9015
|
-
var n =
|
|
9016
|
-
return o == null || n != "001" && r !=
|
|
9138
|
+
function F0(d, t) {
|
|
9139
|
+
var n = q1(d, t), r = S(t, 1), o = n1(d, r, n);
|
|
9140
|
+
return o == null || n != "001" && r != Q1(d, n) ? o = !1 : (d = i1(t), o = E1(d, o) != -1), o;
|
|
9017
9141
|
}
|
|
9018
|
-
function
|
|
9142
|
+
function q1(d, t) {
|
|
9019
9143
|
if (t == null) return null;
|
|
9020
|
-
var n =
|
|
9021
|
-
if (n =
|
|
9144
|
+
var n = S(t, 1);
|
|
9145
|
+
if (n = e1[n], n == null) d = null;
|
|
9022
9146
|
else if (n.length == 1) d = n[0];
|
|
9023
9147
|
else d: {
|
|
9024
|
-
t =
|
|
9148
|
+
t = i1(t);
|
|
9025
9149
|
for (var r, o = n.length, l = 0; l < o; l++) {
|
|
9026
9150
|
r = n[l];
|
|
9027
|
-
var
|
|
9028
|
-
if (
|
|
9029
|
-
if (t.search(
|
|
9151
|
+
var c = z(d, r);
|
|
9152
|
+
if (G(c, 23)) {
|
|
9153
|
+
if (t.search(g(c, 23)) == 0) {
|
|
9030
9154
|
d = r;
|
|
9031
9155
|
break d;
|
|
9032
9156
|
}
|
|
9033
|
-
} else if (
|
|
9157
|
+
} else if (E1(t, c) != -1) {
|
|
9034
9158
|
d = r;
|
|
9035
9159
|
break d;
|
|
9036
9160
|
}
|
|
@@ -9039,103 +9163,103 @@ const r2 = (p) => {
|
|
|
9039
9163
|
}
|
|
9040
9164
|
return d;
|
|
9041
9165
|
}
|
|
9042
|
-
function
|
|
9043
|
-
return d =
|
|
9166
|
+
function s1(d) {
|
|
9167
|
+
return d = e1[d], d == null ? "ZZ" : d[0];
|
|
9044
9168
|
}
|
|
9045
|
-
function
|
|
9046
|
-
if (d =
|
|
9047
|
-
return
|
|
9169
|
+
function Q1(d, t) {
|
|
9170
|
+
if (d = z(d, t), d == null) throw Error("Invalid region code: " + t);
|
|
9171
|
+
return S(d, 10);
|
|
9048
9172
|
}
|
|
9049
|
-
function
|
|
9050
|
-
var o =
|
|
9051
|
-
if (o =
|
|
9052
|
-
else return
|
|
9173
|
+
function f1(d, t, n, r) {
|
|
9174
|
+
var o = h1(n, r), l = j(o, 9) == 0 ? O(g(n, 1), 9) : O(o, 9);
|
|
9175
|
+
if (o = O(o, 10), r == 2) if (z1(h1(n, 0))) d = h1(n, 1), z1(d) && (l = l.concat(j(d, 9) == 0 ? O(g(n, 1), 9) : O(d, 9)), l.sort(), o.length == 0 ? o = O(d, 10) : (o = o.concat(O(d, 10)), o.sort()));
|
|
9176
|
+
else return f1(d, t, n, 1);
|
|
9053
9177
|
return l[0] == -1 ? 5 : (t = t.length, -1 < o.indexOf(t) ? 4 : (n = l[0], n == t ? 0 : n > t ? 2 : l[l.length - 1] < t ? 3 : -1 < l.indexOf(t, 1) ? 0 : 5));
|
|
9054
9178
|
}
|
|
9055
|
-
function
|
|
9056
|
-
var r =
|
|
9057
|
-
return t =
|
|
9179
|
+
function p1(d, t, n) {
|
|
9180
|
+
var r = i1(t);
|
|
9181
|
+
return t = S(t, 1), t in e1 ? (t = n1(d, t, s1(t)), f1(d, r, t, n)) : 1;
|
|
9058
9182
|
}
|
|
9059
|
-
function
|
|
9183
|
+
function d0(d, t) {
|
|
9060
9184
|
if (d = d.toString(), d.length == 0 || d.charAt(0) == "0") return 0;
|
|
9061
|
-
for (var n, r = d.length, o = 1; 3 >= o && o <= r; ++o) if (n = parseInt(d.substring(0, o), 10), n in
|
|
9185
|
+
for (var n, r = d.length, o = 1; 3 >= o && o <= r; ++o) if (n = parseInt(d.substring(0, o), 10), n in e1) return t.g(d.substring(o)), n;
|
|
9062
9186
|
return 0;
|
|
9063
9187
|
}
|
|
9064
|
-
function
|
|
9188
|
+
function t0(d, t, n, r, o, l) {
|
|
9065
9189
|
if (t.length == 0) return 0;
|
|
9066
|
-
t = new
|
|
9067
|
-
var
|
|
9068
|
-
n != null && (
|
|
9069
|
-
var
|
|
9070
|
-
if (
|
|
9071
|
-
else if (
|
|
9190
|
+
t = new D(t);
|
|
9191
|
+
var c;
|
|
9192
|
+
n != null && (c = g(n, 11)), c == null && (c = "NonMatch");
|
|
9193
|
+
var p = t.toString();
|
|
9194
|
+
if (p.length == 0) c = 20;
|
|
9195
|
+
else if ($1.test(p)) p = p.replace($1, ""), H(t), t.g(j1(p)), c = 1;
|
|
9072
9196
|
else {
|
|
9073
|
-
if (
|
|
9074
|
-
|
|
9075
|
-
var
|
|
9076
|
-
|
|
9077
|
-
} else
|
|
9078
|
-
|
|
9197
|
+
if (p = new RegExp(c), Y1(t), c = t.toString(), c.search(p) == 0) {
|
|
9198
|
+
p = c.match(p)[0].length;
|
|
9199
|
+
var y = c.substring(p).match(F1);
|
|
9200
|
+
y && y[1] != null && 0 < y[1].length && a1(y[1], _1) == "0" ? c = !1 : (H(t), t.g(c.substring(p)), c = !0);
|
|
9201
|
+
} else c = !1;
|
|
9202
|
+
c = c ? 5 : 20;
|
|
9079
9203
|
}
|
|
9080
|
-
if (o && M(l, 6,
|
|
9204
|
+
if (o && M(l, 6, c), c != 20) {
|
|
9081
9205
|
if (2 >= t.h.length) throw Error("Phone number too short after IDD");
|
|
9082
|
-
if (d =
|
|
9206
|
+
if (d = d0(t, r), d != 0) return M(l, 1, d), d;
|
|
9083
9207
|
throw Error("Invalid country calling code");
|
|
9084
9208
|
}
|
|
9085
|
-
return n != null && (
|
|
9209
|
+
return n != null && (c = S(n, 10), p = "" + c, y = t.toString(), y.lastIndexOf(p, 0) == 0 && (p = new D(y.substring(p.length)), y = g(n, 1), y = new RegExp(S(y, 2)), e0(p, n, null), p = p.toString(), !V(y, t.toString()) && V(y, p) || f1(d, t.toString(), n, -1) == 3)) ? (r.g(p), o && M(l, 6, 10), M(l, 1, c), c) : (M(l, 1, 0), 0);
|
|
9086
9210
|
}
|
|
9087
|
-
function
|
|
9088
|
-
var r = d.toString(), o = r.length, l =
|
|
9211
|
+
function e0(d, t, n) {
|
|
9212
|
+
var r = d.toString(), o = r.length, l = g(t, 15);
|
|
9089
9213
|
if (o != 0 && l != null && l.length != 0) {
|
|
9090
|
-
var
|
|
9091
|
-
if (o =
|
|
9092
|
-
l = new RegExp(
|
|
9093
|
-
var
|
|
9094
|
-
t =
|
|
9214
|
+
var c = new RegExp("^(?:" + l + ")");
|
|
9215
|
+
if (o = c.exec(r)) {
|
|
9216
|
+
l = new RegExp(S(g(t, 1), 2));
|
|
9217
|
+
var p = V(l, r), y = o.length - 1;
|
|
9218
|
+
t = g(t, 16), t == null || t.length == 0 || o[y] == null || o[y].length == 0 ? (!p || V(l, r.substring(o[0].length))) && (n != null && 0 < y && o[y] != null && n.g(o[1]), d.set(r.substring(o[0].length))) : (r = r.replace(c, t), (!p || V(l, r)) && (n != null && 0 < y && n.g(o[1]), d.set(r)));
|
|
9095
9219
|
}
|
|
9096
9220
|
}
|
|
9097
9221
|
}
|
|
9098
|
-
function
|
|
9099
|
-
if (!
|
|
9100
|
-
return
|
|
9222
|
+
function X(d, t, n) {
|
|
9223
|
+
if (!c1(n) && 0 < t.length && t.charAt(0) != "+") throw Error("Invalid country calling code");
|
|
9224
|
+
return $0(d, t, n, !0);
|
|
9101
9225
|
}
|
|
9102
|
-
function
|
|
9226
|
+
function $0(d, t, n, r) {
|
|
9103
9227
|
if (t == null) throw Error("The string supplied did not seem to be a phone number");
|
|
9104
9228
|
if (250 < t.length) throw Error("The string supplied is too long to be a phone number");
|
|
9105
|
-
var o = new
|
|
9229
|
+
var o = new D(), l = t.indexOf(";phone-context=");
|
|
9106
9230
|
if (l === -1) l = null;
|
|
9107
9231
|
else if (l += 15, l >= t.length) l = "";
|
|
9108
9232
|
else {
|
|
9109
|
-
var
|
|
9110
|
-
l =
|
|
9233
|
+
var c = t.indexOf(";", l);
|
|
9234
|
+
l = c !== -1 ? t.substring(l, c) : t.substring(l);
|
|
9111
9235
|
}
|
|
9112
|
-
var
|
|
9113
|
-
if (
|
|
9114
|
-
if (l = o.toString(), !(
|
|
9115
|
-
l = new
|
|
9236
|
+
var p = l;
|
|
9237
|
+
if (p == null ? c = !0 : p.length === 0 ? c = !1 : (c = B0.exec(p), p = U0.exec(p), c = c !== null || p !== null), !c || (l != null ? (l.charAt(0) === "+" && o.g(l), l = t.indexOf("tel:"), o.g(t.substring(0 <= l ? l + 4 : 0, t.indexOf(";phone-context=")))) : (l = o.g, c = t ?? "", p = c.search(M0), 0 <= p ? (c = c.substring(p), c = c.replace(O0, ""), p = c.search(R0), 0 <= p && (c = c.substring(0, p))) : c = "", l.call(o, c)), l = o.toString(), c = l.indexOf(";isub="), 0 < c && (H(o), o.g(l.substring(0, c))), !K1(o.toString()))) throw Error("The string supplied did not seem to be a phone number");
|
|
9238
|
+
if (l = o.toString(), !(c1(n) || l != null && 0 < l.length && $1.test(l))) throw Error("Invalid country calling code");
|
|
9239
|
+
l = new Y(), r && M(l, 5, t);
|
|
9116
9240
|
d: {
|
|
9117
|
-
if (t = o.toString(),
|
|
9118
|
-
|
|
9119
|
-
for (var
|
|
9120
|
-
|
|
9241
|
+
if (t = o.toString(), c = t.search(V1), 0 <= c && K1(t.substring(0, c))) {
|
|
9242
|
+
p = t.match(V1);
|
|
9243
|
+
for (var y = p.length, K = 1; K < y; ++K) if (p[K] != null && 0 < p[K].length) {
|
|
9244
|
+
H(o), o.g(t.substring(0, c)), t = p[K];
|
|
9121
9245
|
break d;
|
|
9122
9246
|
}
|
|
9123
9247
|
}
|
|
9124
9248
|
t = "";
|
|
9125
9249
|
}
|
|
9126
|
-
0 < t.length && M(l, 3, t),
|
|
9250
|
+
0 < t.length && M(l, 3, t), c = z(d, n), t = new D(), p = 0, y = o.toString();
|
|
9127
9251
|
try {
|
|
9128
|
-
|
|
9129
|
-
} catch (
|
|
9130
|
-
if (
|
|
9131
|
-
if (
|
|
9132
|
-
} else throw
|
|
9252
|
+
p = t0(d, y, c, t, r, l);
|
|
9253
|
+
} catch (L1) {
|
|
9254
|
+
if (L1.message == "Invalid country calling code" && $1.test(y)) {
|
|
9255
|
+
if (y = y.replace($1, ""), p = t0(d, y, c, t, r, l), p == 0) throw L1;
|
|
9256
|
+
} else throw L1;
|
|
9133
9257
|
}
|
|
9134
|
-
if (
|
|
9258
|
+
if (p != 0 ? (o = s1(p), o != n && (c = n1(d, p, o))) : (Y1(o), t.g(o.toString()), n != null ? (p = S(c, 10), M(
|
|
9135
9259
|
l,
|
|
9136
9260
|
1,
|
|
9137
|
-
|
|
9138
|
-
)) : r && (delete l.h[6], l.g && delete l.g[6])), 2 > t.h.length || (
|
|
9261
|
+
p
|
|
9262
|
+
)) : r && (delete l.h[6], l.g && delete l.g[6])), 2 > t.h.length || (c != null && (n = new D(), o = new D(t.toString()), e0(o, c, n), d = f1(d, o.toString(), c, -1), d != 2 && d != 4 && d != 5 && (t = o, r && 0 < n.toString().length && M(l, 7, n.toString()))), r = t.toString(), d = r.length, 2 > d)) throw Error("The string supplied is too short to be a phone number");
|
|
9139
9263
|
if (17 < d) throw Error("The string supplied is too long to be a phone number");
|
|
9140
9264
|
if (1 < r.length && r.charAt(0) == "0") {
|
|
9141
9265
|
for (M(l, 4, !0), d = 1; d < r.length - 1 && r.charAt(d) == "0"; ) d++;
|
|
@@ -9143,47 +9267,47 @@ const r2 = (p) => {
|
|
|
9143
9267
|
}
|
|
9144
9268
|
return M(l, 2, parseInt(r, 10)), l;
|
|
9145
9269
|
}
|
|
9146
|
-
function
|
|
9270
|
+
function V(d, t) {
|
|
9147
9271
|
return !!((d = t.match(new RegExp("^(?:" + (typeof d == "string" ? d : d.source) + ")$", "i"))) && d[0].length == t.length);
|
|
9148
9272
|
}
|
|
9149
|
-
function
|
|
9150
|
-
this.fa = RegExp(" "), this.ja = "", this.v = new
|
|
9273
|
+
function W0(d) {
|
|
9274
|
+
this.fa = RegExp(" "), this.ja = "", this.v = new D(), this.da = "", this.s = new D(), this.ba = new D(), this.u = !0, this.ea = this.ca = this.la = !1, this.ga = R.g(), this.$ = 0, this.h = new D(), this.ha = !1, this.o = "", this.g = new D(), this.j = [], this.ka = d, this.l = s0(this, this.ka);
|
|
9151
9275
|
}
|
|
9152
|
-
var
|
|
9153
|
-
M(
|
|
9154
|
-
var
|
|
9155
|
-
function
|
|
9276
|
+
var n0 = new J();
|
|
9277
|
+
M(n0, 11, "NA");
|
|
9278
|
+
var V0 = RegExp("^[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*\\$1[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*(\\$\\d[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*)*$"), i0 = /[- ]/;
|
|
9279
|
+
function s0(d, t) {
|
|
9156
9280
|
var n = d.ga;
|
|
9157
|
-
return t =
|
|
9281
|
+
return t = c1(t) ? Q1(n, t) : 0, d = z(d.ga, s1(t)), d ?? n0;
|
|
9158
9282
|
}
|
|
9159
|
-
function
|
|
9283
|
+
function r0(d) {
|
|
9160
9284
|
for (var t = d.j.length, n = 0; n < t; ++n) {
|
|
9161
|
-
var r = d.j[n], o =
|
|
9285
|
+
var r = d.j[n], o = S(r, 1);
|
|
9162
9286
|
if (d.da == o) return !1;
|
|
9163
|
-
var l = d,
|
|
9164
|
-
|
|
9165
|
-
var
|
|
9166
|
-
|
|
9167
|
-
var
|
|
9168
|
-
if (
|
|
9287
|
+
var l = d, c = r, p = S(c, 1);
|
|
9288
|
+
H(l.v);
|
|
9289
|
+
var y = l;
|
|
9290
|
+
c = S(c, 2);
|
|
9291
|
+
var K = "999999999999999".match(p)[0];
|
|
9292
|
+
if (K.length < y.g.h.length ? y = "" : (y = K.replace(new RegExp(p, "g"), c), y = y.replace(RegExp("9", "g"), " ")), 0 < y.length ? (l.v.g(y), l = !0) : l = !1, l) return d.da = o, d.ha = i0.test(g(r, 4)), d.$ = 0, !0;
|
|
9169
9293
|
}
|
|
9170
9294
|
return d.u = !1;
|
|
9171
9295
|
}
|
|
9172
|
-
function
|
|
9296
|
+
function o0(d, t) {
|
|
9173
9297
|
for (var n = [], r = t.length - 3, o = d.j.length, l = 0; l < o; ++l) {
|
|
9174
|
-
var
|
|
9175
|
-
|
|
9298
|
+
var c = d.j[l];
|
|
9299
|
+
j(c, 3) == 0 ? n.push(d.j[l]) : (c = g(c, 3, Math.min(r, j(c, 3) - 1)), t.search(c) == 0 && n.push(d.j[l]));
|
|
9176
9300
|
}
|
|
9177
9301
|
d.j = n;
|
|
9178
9302
|
}
|
|
9179
|
-
function
|
|
9303
|
+
function K0(d, t) {
|
|
9180
9304
|
d.s.g(t);
|
|
9181
9305
|
var n = t;
|
|
9182
|
-
if (
|
|
9306
|
+
if (F1.test(n) || d.s.h.length == 1 && P0.test(n) ? (t == "+" ? (n = t, d.ba.g(t)) : (n = _1[t], d.ba.g(n), d.g.g(n)), t = n) : (d.u = !1, d.la = !0), !d.u) {
|
|
9183
9307
|
if (!d.la) {
|
|
9184
|
-
if (
|
|
9185
|
-
if (
|
|
9186
|
-
} else if (0 < d.o.length && (t = d.g.toString(),
|
|
9308
|
+
if (h0(d)) {
|
|
9309
|
+
if (f0(d)) return u0(d);
|
|
9310
|
+
} else if (0 < d.o.length && (t = d.g.toString(), H(d.g), d.g.g(d.o), d.g.g(t), t = d.h.toString(), n = t.lastIndexOf(d.o), H(d.h), d.h.g(t.substring(0, n))), d.o != c0(d)) return d.h.g(" "), u0(d);
|
|
9187
9311
|
}
|
|
9188
9312
|
return d.s.toString();
|
|
9189
9313
|
}
|
|
@@ -9193,137 +9317,137 @@ const r2 = (p) => {
|
|
|
9193
9317
|
case 2:
|
|
9194
9318
|
return d.s.toString();
|
|
9195
9319
|
case 3:
|
|
9196
|
-
if (
|
|
9197
|
-
else return d.o =
|
|
9320
|
+
if (h0(d)) d.ea = !0;
|
|
9321
|
+
else return d.o = c0(d), N1(d);
|
|
9198
9322
|
default:
|
|
9199
|
-
return d.ea ? (
|
|
9323
|
+
return d.ea ? (f0(d) && (d.ea = !1), d.h.toString() + d.g.toString()) : 0 < d.j.length ? (t = p0(d, t), n = l0(d), 0 < n.length ? n : (o0(d, d.g.toString()), r0(d) ? a0(d) : d.u ? C1(d, t) : d.s.toString())) : N1(d);
|
|
9200
9324
|
}
|
|
9201
9325
|
}
|
|
9202
|
-
function
|
|
9203
|
-
return d.u = !0, d.ea = !1, d.j = [], d.$ = 0,
|
|
9326
|
+
function u0(d) {
|
|
9327
|
+
return d.u = !0, d.ea = !1, d.j = [], d.$ = 0, H(d.v), d.da = "", N1(d);
|
|
9204
9328
|
}
|
|
9205
|
-
function
|
|
9329
|
+
function l0(d) {
|
|
9206
9330
|
for (var t = d.g.toString(), n = d.j.length, r = 0; r < n; ++r) {
|
|
9207
|
-
var o = d.j[r], l =
|
|
9208
|
-
if (new RegExp("^(?:" + l + ")$").test(t) && (d.ha =
|
|
9331
|
+
var o = d.j[r], l = S(o, 1);
|
|
9332
|
+
if (new RegExp("^(?:" + l + ")$").test(t) && (d.ha = i0.test(g(o, 4)), o = t.replace(new RegExp(l, "g"), g(o, 2)), o = C1(d, o), a1(o, D0) == d.ba)) return o;
|
|
9209
9333
|
}
|
|
9210
9334
|
return "";
|
|
9211
9335
|
}
|
|
9212
|
-
function
|
|
9336
|
+
function C1(d, t) {
|
|
9213
9337
|
var n = d.h.h.length;
|
|
9214
9338
|
return d.ha && 0 < n && d.h.toString().charAt(n - 1) != " " ? d.h + " " + t : d.h + t;
|
|
9215
9339
|
}
|
|
9216
|
-
function
|
|
9340
|
+
function N1(d) {
|
|
9217
9341
|
var t = d.g.toString();
|
|
9218
9342
|
if (3 <= t.length) {
|
|
9219
|
-
for (var n = d.ca && d.o.length == 0 && 0 <
|
|
9343
|
+
for (var n = d.ca && d.o.length == 0 && 0 < j(d.l, 20) ? O(d.l, 20) : O(d.l, 19), r = n.length, o = 0; o < r; ++o) {
|
|
9220
9344
|
var l = n[o];
|
|
9221
|
-
0 < d.o.length &&
|
|
9345
|
+
0 < d.o.length && Z1(S(l, 4)) && !g(l, 6) && !G(l, 5) || (d.o.length != 0 || d.ca || Z1(S(l, 4)) || g(l, 6)) && V0.test(S(l, 2)) && d.j.push(l);
|
|
9222
9346
|
}
|
|
9223
|
-
return
|
|
9347
|
+
return o0(d, t), t = l0(d), 0 < t.length ? t : r0(d) ? a0(d) : d.s.toString();
|
|
9224
9348
|
}
|
|
9225
|
-
return
|
|
9349
|
+
return C1(d, t);
|
|
9226
9350
|
}
|
|
9227
|
-
function
|
|
9351
|
+
function a0(d) {
|
|
9228
9352
|
var t = d.g.toString(), n = t.length;
|
|
9229
9353
|
if (0 < n) {
|
|
9230
|
-
for (var r = "", o = 0; o < n; o++) r =
|
|
9231
|
-
return d.u ?
|
|
9354
|
+
for (var r = "", o = 0; o < n; o++) r = p0(d, t.charAt(o));
|
|
9355
|
+
return d.u ? C1(d, r) : d.s.toString();
|
|
9232
9356
|
}
|
|
9233
9357
|
return d.h.toString();
|
|
9234
9358
|
}
|
|
9235
|
-
function
|
|
9359
|
+
function c0(d) {
|
|
9236
9360
|
var t = d.g.toString(), n = 0;
|
|
9237
|
-
if (
|
|
9361
|
+
if (g(d.l, 10) != 1) var r = !1;
|
|
9238
9362
|
else r = d.g.toString(), r = r.charAt(0) == "1" && r.charAt(1) != "0" && r.charAt(1) != "1";
|
|
9239
|
-
return r ? (n = 1, d.h.g("1").g(" "), d.ca = !0) :
|
|
9363
|
+
return r ? (n = 1, d.h.g("1").g(" "), d.ca = !0) : G(d.l, 15) && (r = new RegExp("^(?:" + g(d.l, 15) + ")"), r = t.match(r), r != null && r[0] != null && 0 < r[0].length && (d.ca = !0, n = r[0].length, d.h.g(t.substring(0, n)))), H(d.g), d.g.g(t.substring(n)), t.substring(0, n);
|
|
9240
9364
|
}
|
|
9241
|
-
function
|
|
9242
|
-
var t = d.ba.toString(), n = new RegExp("^(?:\\+|" +
|
|
9243
|
-
return n = t.match(n), n != null && n[0] != null && 0 < n[0].length ? (d.ca = !0, n = n[0].length,
|
|
9365
|
+
function h0(d) {
|
|
9366
|
+
var t = d.ba.toString(), n = new RegExp("^(?:\\+|" + g(d.l, 11) + ")");
|
|
9367
|
+
return n = t.match(n), n != null && n[0] != null && 0 < n[0].length ? (d.ca = !0, n = n[0].length, H(d.g), d.g.g(t.substring(n)), H(d.h), d.h.g(t.substring(0, n)), t.charAt(0) != "+" && d.h.g(" "), !0) : !1;
|
|
9244
9368
|
}
|
|
9245
|
-
function
|
|
9369
|
+
function f0(d) {
|
|
9246
9370
|
if (d.g.h.length == 0) return !1;
|
|
9247
|
-
var t = new
|
|
9248
|
-
return n == 0 ? !1 : (
|
|
9371
|
+
var t = new D(), n = d0(d.g, t);
|
|
9372
|
+
return n == 0 ? !1 : (H(d.g), d.g.g(t.toString()), t = s1(n), t == "001" ? d.l = z(d.ga, "" + n) : t != d.ka && (d.l = s0(d, t)), d.h.g("" + n).g(" "), d.o = "", !0);
|
|
9249
9373
|
}
|
|
9250
|
-
function
|
|
9374
|
+
function p0(d, t) {
|
|
9251
9375
|
var n = d.v.toString();
|
|
9252
9376
|
if (0 <= n.substring(d.$).search(d.fa)) {
|
|
9253
9377
|
var r = n.search(d.fa);
|
|
9254
|
-
return t = n.replace(d.fa, t),
|
|
9378
|
+
return t = n.replace(d.fa, t), H(d.v), d.v.g(t), d.$ = r, t.substring(0, d.$ + 1);
|
|
9255
9379
|
}
|
|
9256
9380
|
return d.j.length == 1 && (d.u = !1), d.da = "", d.s.toString();
|
|
9257
9381
|
}
|
|
9258
|
-
const
|
|
9382
|
+
const C0 = (d) => {
|
|
9259
9383
|
const t = [];
|
|
9260
9384
|
return d.includes("FIXED_LINE_OR_MOBILE") ? (d.includes("MOBILE") || t.push("MOBILE"), d.includes("FIXED_LINE") || t.push("FIXED_LINE")) : (d.includes("MOBILE") || d.includes("FIXED_LINE")) && t.push("FIXED_LINE_OR_MOBILE"), d.concat(t);
|
|
9261
|
-
},
|
|
9385
|
+
}, S1 = { 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 };
|
|
9262
9386
|
e("intlTelInputUtilsTemp", {}), e("intlTelInputUtilsTemp.formatNumberAsYouType", (d, t) => {
|
|
9263
9387
|
try {
|
|
9264
|
-
const n = d.replace(/[^+0-9]/g, ""), r = new
|
|
9388
|
+
const n = d.replace(/[^+0-9]/g, ""), r = new W0(t);
|
|
9265
9389
|
t = "";
|
|
9266
|
-
for (let o = 0; o < n.length; o++) r.ja =
|
|
9390
|
+
for (let o = 0; o < n.length; o++) r.ja = K0(r, n.charAt(o)), t = r.ja;
|
|
9267
9391
|
return t;
|
|
9268
9392
|
} catch {
|
|
9269
9393
|
return d;
|
|
9270
9394
|
}
|
|
9271
9395
|
}), e("intlTelInputUtilsTemp.formatNumber", (d, t, n) => {
|
|
9272
9396
|
try {
|
|
9273
|
-
const o =
|
|
9274
|
-
var r =
|
|
9397
|
+
const o = R.g(), l = X(o, d, t);
|
|
9398
|
+
var r = p1(o, l, -1);
|
|
9275
9399
|
return r == 0 || r == 4 ? o.format(l, typeof n > "u" ? 0 : n) : d;
|
|
9276
9400
|
} catch {
|
|
9277
9401
|
return d;
|
|
9278
9402
|
}
|
|
9279
9403
|
}), e("intlTelInputUtilsTemp.getExampleNumber", (d, t, n, r) => {
|
|
9280
9404
|
try {
|
|
9281
|
-
const
|
|
9405
|
+
const y = R.g();
|
|
9282
9406
|
d: {
|
|
9283
|
-
var o =
|
|
9284
|
-
if (
|
|
9285
|
-
var l =
|
|
9407
|
+
var o = y;
|
|
9408
|
+
if (c1(d)) {
|
|
9409
|
+
var l = h1(z(o, d), n);
|
|
9286
9410
|
try {
|
|
9287
|
-
if (
|
|
9288
|
-
var
|
|
9411
|
+
if (G(l, 6)) {
|
|
9412
|
+
var c = g(l, 6), p = $0(o, c, d, !1);
|
|
9289
9413
|
break d;
|
|
9290
9414
|
}
|
|
9291
9415
|
} catch {
|
|
9292
9416
|
}
|
|
9293
9417
|
}
|
|
9294
|
-
|
|
9418
|
+
p = null;
|
|
9295
9419
|
}
|
|
9296
|
-
return
|
|
9420
|
+
return y.format(p, r ? 0 : t ? 2 : 1);
|
|
9297
9421
|
} catch {
|
|
9298
9422
|
return "";
|
|
9299
9423
|
}
|
|
9300
9424
|
}), e("intlTelInputUtilsTemp.getExtension", (d, t) => {
|
|
9301
9425
|
try {
|
|
9302
|
-
return
|
|
9426
|
+
return g(X(R.g(), d, t), 3);
|
|
9303
9427
|
} catch {
|
|
9304
9428
|
return "";
|
|
9305
9429
|
}
|
|
9306
9430
|
}), e("intlTelInputUtilsTemp.getNumberType", (d, t) => {
|
|
9307
9431
|
try {
|
|
9308
|
-
const n =
|
|
9309
|
-
return
|
|
9432
|
+
const n = R.g(), r = X(n, d, t);
|
|
9433
|
+
return X1(n, r);
|
|
9310
9434
|
} catch {
|
|
9311
9435
|
return -99;
|
|
9312
9436
|
}
|
|
9313
9437
|
}), e("intlTelInputUtilsTemp.getValidationError", (d, t) => {
|
|
9314
9438
|
if (!t) return 1;
|
|
9315
9439
|
try {
|
|
9316
|
-
const n =
|
|
9317
|
-
return
|
|
9440
|
+
const n = R.g(), r = X(n, d, t);
|
|
9441
|
+
return p1(n, r, -1);
|
|
9318
9442
|
} catch (n) {
|
|
9319
9443
|
return n.message === "Invalid country calling code" ? 1 : 3 >= d.length || n.message === "Phone number too short after IDD" || n.message === "The string supplied is too short to be a phone number" ? 2 : n.message === "The string supplied is too long to be a phone number" ? 3 : -99;
|
|
9320
9444
|
}
|
|
9321
9445
|
}), e("intlTelInputUtilsTemp.isValidNumber", (d, t, n) => {
|
|
9322
9446
|
try {
|
|
9323
|
-
const r =
|
|
9447
|
+
const r = R.g(), o = X(r, d, t), l = F0(r, o);
|
|
9324
9448
|
if (n) {
|
|
9325
|
-
const
|
|
9326
|
-
return l &&
|
|
9449
|
+
const c = C0(n).map((p) => S1[p]);
|
|
9450
|
+
return l && c.includes(X1(r, o));
|
|
9327
9451
|
}
|
|
9328
9452
|
return l;
|
|
9329
9453
|
} catch {
|
|
@@ -9331,30 +9455,30 @@ const r2 = (p) => {
|
|
|
9331
9455
|
}
|
|
9332
9456
|
}), e("intlTelInputUtilsTemp.isPossibleNumber", (d, t, n) => {
|
|
9333
9457
|
try {
|
|
9334
|
-
const r =
|
|
9458
|
+
const r = R.g(), o = X(r, d, t);
|
|
9335
9459
|
if (n) {
|
|
9336
|
-
const l =
|
|
9337
|
-
for (let
|
|
9460
|
+
const l = C0(n);
|
|
9461
|
+
for (let c of l) if (p1(r, o, S1[c]) === 0) return !0;
|
|
9338
9462
|
return !1;
|
|
9339
9463
|
}
|
|
9340
|
-
return
|
|
9464
|
+
return p1(r, o, -1) === 0;
|
|
9341
9465
|
} catch {
|
|
9342
9466
|
return !1;
|
|
9343
9467
|
}
|
|
9344
9468
|
}), e("intlTelInputUtilsTemp.getCoreNumber", (d, t) => {
|
|
9345
9469
|
try {
|
|
9346
|
-
return
|
|
9470
|
+
return g(X(R.g(), d, t), 2).toString();
|
|
9347
9471
|
} catch {
|
|
9348
9472
|
return "";
|
|
9349
9473
|
}
|
|
9350
|
-
}), e("intlTelInputUtilsTemp.numberFormat", { E164: 0, INTERNATIONAL: 1, NATIONAL: 2, RFC3966: 3 }), e("intlTelInputUtilsTemp.numberType",
|
|
9474
|
+
}), e("intlTelInputUtilsTemp.numberFormat", { E164: 0, INTERNATIONAL: 1, NATIONAL: 2, RFC3966: 3 }), e("intlTelInputUtilsTemp.numberType", S1), e("intlTelInputUtilsTemp.validationError", { IS_POSSIBLE: 0, INVALID_COUNTRY_CODE: 1, TOO_SHORT: 2, TOO_LONG: 3, IS_POSSIBLE_LOCAL_ONLY: 4, INVALID_LENGTH: 5 });
|
|
9351
9475
|
})();
|
|
9352
|
-
const
|
|
9353
|
-
delete
|
|
9354
|
-
|
|
9355
|
-
const
|
|
9476
|
+
const A0 = typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : void 0, A2 = A0.intlTelInputUtilsTemp;
|
|
9477
|
+
delete A0.intlTelInputUtilsTemp;
|
|
9478
|
+
m.utils = A2;
|
|
9479
|
+
const b2 = {
|
|
9356
9480
|
__name: "IntlTelInputWithUtils",
|
|
9357
|
-
props: /* @__PURE__ */
|
|
9481
|
+
props: /* @__PURE__ */ g0({
|
|
9358
9482
|
disabled: {
|
|
9359
9483
|
type: Boolean,
|
|
9360
9484
|
default: !1
|
|
@@ -9378,47 +9502,47 @@ const u2 = {
|
|
|
9378
9502
|
},
|
|
9379
9503
|
modelModifiers: {}
|
|
9380
9504
|
}),
|
|
9381
|
-
emits: /* @__PURE__ */
|
|
9505
|
+
emits: /* @__PURE__ */ g0([
|
|
9382
9506
|
"changeNumber",
|
|
9383
9507
|
"changeCountry",
|
|
9384
9508
|
"changeValidity",
|
|
9385
9509
|
"changeErrorCode"
|
|
9386
9510
|
], ["update:modelValue"]),
|
|
9387
|
-
setup(
|
|
9388
|
-
const i =
|
|
9389
|
-
let
|
|
9390
|
-
|
|
9511
|
+
setup(h, { expose: e, emit: $ }) {
|
|
9512
|
+
const i = j0(h, "modelValue"), s = h, a = $, u = A1(), f = A1(), C = A1(!1), I = () => f.value ? s.options.strictMode ? f.value.isValidNumberPrecise() : f.value.isValidNumber() : null, _ = () => {
|
|
9513
|
+
let N = I();
|
|
9514
|
+
C.value !== N && (C.value = N, a("changeValidity", !!N), a(
|
|
9391
9515
|
"changeErrorCode",
|
|
9392
|
-
|
|
9516
|
+
N ? null : f.value.getValidationError()
|
|
9393
9517
|
));
|
|
9394
|
-
},
|
|
9395
|
-
var
|
|
9396
|
-
|
|
9397
|
-
},
|
|
9398
|
-
var
|
|
9399
|
-
|
|
9518
|
+
}, A = () => {
|
|
9519
|
+
var N;
|
|
9520
|
+
a("changeNumber", ((N = f.value) == null ? void 0 : N.getNumber()) ?? ""), _();
|
|
9521
|
+
}, v = () => {
|
|
9522
|
+
var N;
|
|
9523
|
+
a("changeCountry", ((N = f.value) == null ? void 0 : N.getSelectedCountryData().iso2) ?? ""), A(), _();
|
|
9400
9524
|
};
|
|
9401
|
-
return
|
|
9402
|
-
u.value && (f.value =
|
|
9403
|
-
}),
|
|
9525
|
+
return Y0(() => {
|
|
9526
|
+
u.value && (f.value = m(u.value, s.options), s.value && f.value.setNumber(s.value), s.disabled && f.value.setDisabled(s.disabled), C.value = I());
|
|
9527
|
+
}), z0(
|
|
9404
9528
|
() => s.disabled,
|
|
9405
|
-
(
|
|
9406
|
-
var
|
|
9407
|
-
return (
|
|
9529
|
+
(N) => {
|
|
9530
|
+
var T;
|
|
9531
|
+
return (T = f.value) == null ? void 0 : T.setDisabled(N);
|
|
9408
9532
|
}
|
|
9409
|
-
),
|
|
9410
|
-
var
|
|
9411
|
-
return (
|
|
9412
|
-
}), e({ instance: f, input: u }), (
|
|
9533
|
+
), Z0(() => {
|
|
9534
|
+
var N;
|
|
9535
|
+
return (N = f.value) == null ? void 0 : N.destroy();
|
|
9536
|
+
}), e({ instance: f, input: u }), (N, T) => J0((q0(), X0("input", Q0({
|
|
9413
9537
|
ref_key: "input",
|
|
9414
9538
|
ref: u,
|
|
9415
|
-
"onUpdate:modelValue":
|
|
9539
|
+
"onUpdate:modelValue": T[0] || (T[0] = (k) => i.value = k),
|
|
9416
9540
|
type: "tel",
|
|
9417
|
-
onCountrychange:
|
|
9418
|
-
onInput:
|
|
9419
|
-
},
|
|
9541
|
+
onCountrychange: v,
|
|
9542
|
+
onInput: A
|
|
9543
|
+
}, h.inputProps), null, 16)), [
|
|
9420
9544
|
[
|
|
9421
|
-
|
|
9545
|
+
d2,
|
|
9422
9546
|
i.value,
|
|
9423
9547
|
void 0,
|
|
9424
9548
|
{ lazy: !0 }
|
|
@@ -9427,5 +9551,5 @@ const u2 = {
|
|
|
9427
9551
|
}
|
|
9428
9552
|
};
|
|
9429
9553
|
export {
|
|
9430
|
-
|
|
9554
|
+
b2 as default
|
|
9431
9555
|
};
|