intl-tel-input 27.3.0 → 28.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/intlTelInput-no-assets.css +2 -2
- package/dist/css/intlTelInput.css +3 -3
- package/dist/js/data.d.ts +1 -4
- package/dist/js/data.js +3 -9
- package/dist/js/data.min.js +2 -2
- package/dist/js/data.mjs +2 -8
- package/dist/js/i18n.d.ts +1 -1592
- package/dist/js/intlTelInput.d.ts +62 -49
- package/dist/js/intlTelInput.js +221 -182
- package/dist/js/intlTelInput.min.js +6 -6
- package/dist/js/intlTelInput.mjs +219 -180
- package/dist/js/intlTelInputWithUtils.js +622 -568
- package/dist/js/intlTelInputWithUtils.min.js +6 -6
- package/dist/js/intlTelInputWithUtils.mjs +620 -566
- package/dist/js/utils.js +56 -55
- package/package.json +14 -181
- package/CHANGELOG.md +0 -33
- package/angular/README.md +0 -13
- package/angular/dist/IntlTelInput.d.ts +0 -110
- package/angular/dist/IntlTelInput.js +0 -5096
- package/angular/dist/IntlTelInputWithUtils.d.ts +0 -3
- package/angular/dist/IntlTelInputWithUtils.js +0 -11435
- package/react/README.md +0 -13
- package/react/dist/IntlTelInput.d.ts +0 -25
- package/react/dist/IntlTelInput.js +0 -4788
- package/react/dist/IntlTelInputWithUtils.d.ts +0 -4
- package/react/dist/IntlTelInputWithUtils.js +0 -11127
- package/svelte/README.md +0 -14
- package/svelte/src/IntlTelInput.svelte +0 -233
- package/svelte/src/IntlTelInput.svelte.d.ts +0 -36
- package/svelte/src/IntlTelInputWithUtils.svelte +0 -24
- package/vue/README.md +0 -14
- package/vue/dist/IntlTelInput-jw1tkqdD.js +0 -2657
- package/vue/dist/IntlTelInput.js +0 -5
- package/vue/dist/IntlTelInput.vue.d.ts +0 -43
- package/vue/dist/IntlTelInputWithUtils.js +0 -49403
- package/vue/dist/index.d.ts +0 -4
- package/vue/dist/indexWithUtils.d.ts +0 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// src/js/data.ts
|
|
1
|
+
// packages/core/src/js/data.ts
|
|
2
2
|
var rawCountryData = [
|
|
3
3
|
[
|
|
4
4
|
"af",
|
|
@@ -1743,20 +1743,14 @@ for (const c of rawCountryData) {
|
|
|
1743
1743
|
dialCode: c[1],
|
|
1744
1744
|
priority: c[2] || 0,
|
|
1745
1745
|
areaCodes: c[3] || null,
|
|
1746
|
-
nationalPrefix: c[4] || null
|
|
1747
|
-
normalisedName: "",
|
|
1748
|
-
// populated in the plugin
|
|
1749
|
-
initials: "",
|
|
1750
|
-
// populated in the plugin
|
|
1751
|
-
dialCodePlus: ""
|
|
1752
|
-
// populated in the plugin
|
|
1746
|
+
nationalPrefix: c[4] || null
|
|
1753
1747
|
});
|
|
1754
1748
|
}
|
|
1755
1749
|
var iso2Set = new Set(allCountries.map((c) => c.iso2));
|
|
1756
1750
|
var isIso2 = (val) => iso2Set.has(val);
|
|
1757
1751
|
var data_default = allCountries;
|
|
1758
1752
|
|
|
1759
|
-
// src/js/constants.ts
|
|
1753
|
+
// packages/core/src/js/constants.ts
|
|
1760
1754
|
var EVENTS = {
|
|
1761
1755
|
OPEN_COUNTRY_DROPDOWN: "open:countrydropdown",
|
|
1762
1756
|
CLOSE_COUNTRY_DROPDOWN: "close:countrydropdown",
|
|
@@ -1802,10 +1796,6 @@ var TIMINGS = {
|
|
|
1802
1796
|
HIDDEN_SEARCH_RESET_MS: 1e3,
|
|
1803
1797
|
NEXT_TICK: 0
|
|
1804
1798
|
};
|
|
1805
|
-
var SENTINELS = {
|
|
1806
|
-
UNKNOWN_NUMBER_TYPE: -99,
|
|
1807
|
-
UNKNOWN_VALIDATION_ERROR: -99
|
|
1808
|
-
};
|
|
1809
1799
|
var LAYOUT = {
|
|
1810
1800
|
NARROW_VIEWPORT_WIDTH: 500,
|
|
1811
1801
|
// keep in sync with .iti__country-list CSS media query
|
|
@@ -1847,6 +1837,12 @@ var PLACEHOLDER_MODES = {
|
|
|
1847
1837
|
var INITIAL_COUNTRY = {
|
|
1848
1838
|
AUTO: "auto"
|
|
1849
1839
|
};
|
|
1840
|
+
var NUMBER_FORMATS = [
|
|
1841
|
+
"E164",
|
|
1842
|
+
"INTERNATIONAL",
|
|
1843
|
+
"NATIONAL",
|
|
1844
|
+
"RFC3966"
|
|
1845
|
+
];
|
|
1850
1846
|
var NUMBER_TYPES = [
|
|
1851
1847
|
"FIXED_LINE",
|
|
1852
1848
|
"MOBILE",
|
|
@@ -1861,11 +1857,21 @@ var NUMBER_TYPES = [
|
|
|
1861
1857
|
"VOICEMAIL",
|
|
1862
1858
|
"UNKNOWN"
|
|
1863
1859
|
];
|
|
1864
|
-
var
|
|
1860
|
+
var VALIDATION_ERRORS = [
|
|
1861
|
+
"IS_POSSIBLE",
|
|
1862
|
+
"INVALID_COUNTRY_CODE",
|
|
1863
|
+
"TOO_SHORT",
|
|
1864
|
+
"TOO_LONG",
|
|
1865
|
+
"IS_POSSIBLE_LOCAL_ONLY",
|
|
1866
|
+
"INVALID_LENGTH"
|
|
1867
|
+
];
|
|
1868
|
+
var toEnumObject = (arr) => Object.fromEntries(arr.map((v) => [v, v]));
|
|
1869
|
+
var NUMBER_FORMAT = toEnumObject(NUMBER_FORMATS);
|
|
1870
|
+
var NUMBER_TYPE = toEnumObject(NUMBER_TYPES);
|
|
1871
|
+
var VALIDATION_ERROR = toEnumObject(VALIDATION_ERRORS);
|
|
1865
1872
|
var DATA_KEYS = {
|
|
1866
|
-
// e.g. <li data-
|
|
1867
|
-
|
|
1868
|
-
ISO2: "countryCode",
|
|
1873
|
+
// e.g. <li data-iso2="us"> for country items in dropdown
|
|
1874
|
+
ISO2: "iso2",
|
|
1869
1875
|
DIAL_CODE: "dialCode",
|
|
1870
1876
|
// e.g. <input data-intl-tel-input-id="0"> on the input element
|
|
1871
1877
|
INSTANCE_ID: "intlTelInputId"
|
|
@@ -1882,7 +1888,7 @@ var ARIA = {
|
|
|
1882
1888
|
MODAL: "aria-modal"
|
|
1883
1889
|
};
|
|
1884
1890
|
|
|
1885
|
-
// src/js/i18n/en.ts
|
|
1891
|
+
// packages/core/src/js/i18n/en.ts
|
|
1886
1892
|
var interfaceTranslations = {
|
|
1887
1893
|
selectedCountryAriaLabel: "Change country for phone number, currently selected ${countryName} (${dialCode})",
|
|
1888
1894
|
noCountrySelected: "Select country for phone number",
|
|
@@ -1902,7 +1908,7 @@ var interfaceTranslations = {
|
|
|
1902
1908
|
};
|
|
1903
1909
|
var en_default = interfaceTranslations;
|
|
1904
1910
|
|
|
1905
|
-
// src/js/core/options.ts
|
|
1911
|
+
// packages/core/src/js/core/options.ts
|
|
1906
1912
|
var mediaQuery = (q) => typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia(q).matches;
|
|
1907
1913
|
var isNarrowViewport = () => mediaQuery(`(max-width: ${LAYOUT.NARROW_VIEWPORT_WIDTH}px)`);
|
|
1908
1914
|
var computeDefaultUseFullscreenPopup = () => {
|
|
@@ -1917,7 +1923,7 @@ var defaults = {
|
|
|
1917
1923
|
//* Whether or not to allow the dropdown.
|
|
1918
1924
|
allowDropdown: true,
|
|
1919
1925
|
//* The number type to enforce during validation.
|
|
1920
|
-
allowedNumberTypes: [
|
|
1926
|
+
allowedNumberTypes: [NUMBER_TYPE.MOBILE, NUMBER_TYPE.FIXED_LINE],
|
|
1921
1927
|
//* Whether or not to allow extensions after the main number.
|
|
1922
1928
|
allowNumberExtensions: false,
|
|
1923
1929
|
// Allow alphanumeric "phonewords" (e.g. +1 800 FLOWERS) as valid numbers
|
|
@@ -1928,6 +1934,8 @@ var defaults = {
|
|
|
1928
1934
|
containerClass: "",
|
|
1929
1935
|
//* Locale for localising country names via Intl.DisplayNames.
|
|
1930
1936
|
countryNameLocale: "en",
|
|
1937
|
+
//* Override individual country names by iso2 code.
|
|
1938
|
+
countryNameOverrides: {},
|
|
1931
1939
|
//* The order of the countries in the dropdown. Defaults to alphabetical.
|
|
1932
1940
|
countryOrder: null,
|
|
1933
1941
|
//* Add a country search input at the top of the dropdown.
|
|
@@ -1961,17 +1969,17 @@ var defaults = {
|
|
|
1961
1969
|
//* Display only these countries.
|
|
1962
1970
|
onlyCountries: null,
|
|
1963
1971
|
//* Number type to use for placeholders.
|
|
1964
|
-
placeholderNumberType:
|
|
1972
|
+
placeholderNumberType: NUMBER_TYPE.MOBILE,
|
|
1965
1973
|
//* Add custom classes to the search input element.
|
|
1966
1974
|
searchInputClass: "",
|
|
1967
1975
|
//* Display the international dial code next to the selected flag.
|
|
1968
|
-
separateDialCode:
|
|
1976
|
+
separateDialCode: true,
|
|
1969
1977
|
//* When strictMode rejects a key (etc), play a short feedback animation
|
|
1970
|
-
strictRejectAnimation:
|
|
1978
|
+
strictRejectAnimation: true,
|
|
1971
1979
|
//* Show flags - for both the selected country, and in the country dropdown
|
|
1972
1980
|
showFlags: true,
|
|
1973
1981
|
//* Only allow certain chars e.g. a plus followed by numeric digits, and cap at max valid length.
|
|
1974
|
-
strictMode:
|
|
1982
|
+
strictMode: true,
|
|
1975
1983
|
//* Use full screen popup instead of dropdown for country list.
|
|
1976
1984
|
useFullscreenPopup: computeDefaultUseFullscreenPopup()
|
|
1977
1985
|
};
|
|
@@ -2115,6 +2123,13 @@ var validateOptions = (customOptions) => {
|
|
|
2115
2123
|
}
|
|
2116
2124
|
validatedOptions[key] = value;
|
|
2117
2125
|
break;
|
|
2126
|
+
case "countryNameOverrides":
|
|
2127
|
+
if (value && !isPlainObject(value)) {
|
|
2128
|
+
warnOption("countryNameOverrides", "an object", value);
|
|
2129
|
+
break;
|
|
2130
|
+
}
|
|
2131
|
+
validatedOptions[key] = value;
|
|
2132
|
+
break;
|
|
2118
2133
|
case "initialCountry": {
|
|
2119
2134
|
if (typeof value !== "string") {
|
|
2120
2135
|
warnOption("initialCountry", "a string", value);
|
|
@@ -2133,8 +2148,8 @@ var validateOptions = (customOptions) => {
|
|
|
2133
2148
|
break;
|
|
2134
2149
|
}
|
|
2135
2150
|
case "placeholderNumberType":
|
|
2136
|
-
if (typeof value !== "string" || !
|
|
2137
|
-
const validTypes =
|
|
2151
|
+
if (typeof value !== "string" || !NUMBER_TYPES.includes(value)) {
|
|
2152
|
+
const validTypes = NUMBER_TYPES.join(", ");
|
|
2138
2153
|
warnOption("placeholderNumberType", `one of ${validTypes}`, value);
|
|
2139
2154
|
break;
|
|
2140
2155
|
}
|
|
@@ -2152,8 +2167,8 @@ var validateOptions = (customOptions) => {
|
|
|
2152
2167
|
}
|
|
2153
2168
|
let allValid = true;
|
|
2154
2169
|
for (const v of value) {
|
|
2155
|
-
if (typeof v !== "string" || !
|
|
2156
|
-
const validTypes =
|
|
2170
|
+
if (typeof v !== "string" || !NUMBER_TYPES.includes(v)) {
|
|
2171
|
+
const validTypes = NUMBER_TYPES.join(", ");
|
|
2157
2172
|
warnOption(
|
|
2158
2173
|
"allowedNumberTypes",
|
|
2159
2174
|
`an array of valid number types (${validTypes})`,
|
|
@@ -2215,11 +2230,11 @@ var applyOptionSideEffects = (o) => {
|
|
|
2215
2230
|
o.i18n = { ...en_default, ...o.i18n };
|
|
2216
2231
|
};
|
|
2217
2232
|
|
|
2218
|
-
// src/js/helpers/string.ts
|
|
2233
|
+
// packages/core/src/js/helpers/string.ts
|
|
2219
2234
|
var getNumeric = (s) => s.replace(/\D/g, "");
|
|
2220
2235
|
var normaliseString = (s = "") => s.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase();
|
|
2221
2236
|
|
|
2222
|
-
// src/js/helpers/dom.ts
|
|
2237
|
+
// packages/core/src/js/helpers/dom.ts
|
|
2223
2238
|
var buildClassNames = (flags) => Object.keys(flags).filter((k) => Boolean(flags[k])).join(" ");
|
|
2224
2239
|
var createEl = (tagName, attrs, container) => {
|
|
2225
2240
|
const el = document.createElement(tagName);
|
|
@@ -2234,7 +2249,7 @@ var createEl = (tagName, attrs, container) => {
|
|
|
2234
2249
|
return el;
|
|
2235
2250
|
};
|
|
2236
2251
|
|
|
2237
|
-
// src/js/core/icons.ts
|
|
2252
|
+
// packages/core/src/js/core/icons.ts
|
|
2238
2253
|
var buildSearchIcon = () => `
|
|
2239
2254
|
<svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" ${ARIA.HIDDEN}="true">
|
|
2240
2255
|
<circle cx="11" cy="11" r="7" />
|
|
@@ -2261,8 +2276,21 @@ var buildGlobeIcon = () => `
|
|
|
2261
2276
|
<path d="m261 428-2-2-22-21a40 40 0 0 0-32-11h-1a37 37 0 0 0-18 8l-1 1-4 2-2 2-5 4c-9-3-36-31-47-44s-32-45-34-55l3-2a151 151 0 0 0 11-9v-1a39 39 0 0 0 5-48l-3-3-11-19-3-4-5-7h-1l-3-3-4-3-5-2a35 35 0 0 0-16-3h-5c-4 1-14 5-24 11l-4 2-4 3-4 2c-9 8-17 17-18 27a380 380 0 0 0 212 259h3c12 0 25-10 36-21l10-12 6-11a39 39 0 0 0-8-40"/>
|
|
2262
2277
|
</svg>`;
|
|
2263
2278
|
|
|
2264
|
-
// src/js/core/countrySearch.ts
|
|
2265
|
-
var
|
|
2279
|
+
// packages/core/src/js/core/countrySearch.ts
|
|
2280
|
+
var buildSearchTokens = (countries) => {
|
|
2281
|
+
const tokens = /* @__PURE__ */ new Map();
|
|
2282
|
+
for (const c of countries) {
|
|
2283
|
+
const normalisedName = normaliseString(c.name);
|
|
2284
|
+
const initials = normalisedName.split(/[^a-z]/).map((word) => word[0]).join("");
|
|
2285
|
+
tokens.set(c.iso2, {
|
|
2286
|
+
normalisedName,
|
|
2287
|
+
initials,
|
|
2288
|
+
dialCodePlus: `+${c.dialCode}`
|
|
2289
|
+
});
|
|
2290
|
+
}
|
|
2291
|
+
return tokens;
|
|
2292
|
+
};
|
|
2293
|
+
var getMatchedCountries = (countries, searchTokens, query) => {
|
|
2266
2294
|
const normalisedQuery = normaliseString(query);
|
|
2267
2295
|
const iso2Matches = [];
|
|
2268
2296
|
const nameStartsWith = [];
|
|
@@ -2271,17 +2299,18 @@ var getMatchedCountries = (countries, query) => {
|
|
|
2271
2299
|
const dialCodeContains = [];
|
|
2272
2300
|
const initialsMatches = [];
|
|
2273
2301
|
for (const c of countries) {
|
|
2302
|
+
const t = searchTokens.get(c.iso2);
|
|
2274
2303
|
if (c.iso2 === normalisedQuery) {
|
|
2275
2304
|
iso2Matches.push(c);
|
|
2276
|
-
} else if (
|
|
2305
|
+
} else if (t.normalisedName.startsWith(normalisedQuery)) {
|
|
2277
2306
|
nameStartsWith.push(c);
|
|
2278
|
-
} else if (
|
|
2307
|
+
} else if (t.normalisedName.includes(normalisedQuery)) {
|
|
2279
2308
|
nameContains.push(c);
|
|
2280
|
-
} else if (normalisedQuery === c.dialCode || normalisedQuery ===
|
|
2309
|
+
} else if (normalisedQuery === c.dialCode || normalisedQuery === t.dialCodePlus) {
|
|
2281
2310
|
dialCodeMatches.push(c);
|
|
2282
|
-
} else if (
|
|
2311
|
+
} else if (t.dialCodePlus.includes(normalisedQuery)) {
|
|
2283
2312
|
dialCodeContains.push(c);
|
|
2284
|
-
} else if (
|
|
2313
|
+
} else if (t.initials.includes(normalisedQuery)) {
|
|
2285
2314
|
initialsMatches.push(c);
|
|
2286
2315
|
}
|
|
2287
2316
|
}
|
|
@@ -2296,17 +2325,76 @@ var getMatchedCountries = (countries, query) => {
|
|
|
2296
2325
|
...initialsMatches
|
|
2297
2326
|
];
|
|
2298
2327
|
};
|
|
2299
|
-
var findFirstCountryStartingWith = (countries, query) => {
|
|
2328
|
+
var findFirstCountryStartingWith = (countries, searchTokens, query) => {
|
|
2300
2329
|
const normalisedQuery = normaliseString(query);
|
|
2301
2330
|
for (const c of countries) {
|
|
2302
|
-
|
|
2331
|
+
const { normalisedName } = searchTokens.get(c.iso2);
|
|
2332
|
+
if (normalisedName.startsWith(normalisedQuery)) {
|
|
2303
2333
|
return c;
|
|
2304
2334
|
}
|
|
2305
2335
|
}
|
|
2306
2336
|
return null;
|
|
2307
2337
|
};
|
|
2308
2338
|
|
|
2309
|
-
// src/js/core/
|
|
2339
|
+
// packages/core/src/js/core/numerals.ts
|
|
2340
|
+
var Numerals = class _Numerals {
|
|
2341
|
+
#userNumeralSet;
|
|
2342
|
+
//* Stateless conversion of any Arabic-Indic / Persian digits to ASCII 0-9.
|
|
2343
|
+
//* Use this when you need to normalise digits without affecting any instance's tracked numeral set (e.g. for the country-search query).
|
|
2344
|
+
static toAscii(str) {
|
|
2345
|
+
if (!str) {
|
|
2346
|
+
return "";
|
|
2347
|
+
}
|
|
2348
|
+
return str.replace(
|
|
2349
|
+
/[٠-٩]/g,
|
|
2350
|
+
(ch) => String.fromCharCode(48 + (ch.charCodeAt(0) - 1632))
|
|
2351
|
+
).replace(
|
|
2352
|
+
/[۰-۹]/g,
|
|
2353
|
+
(ch) => String.fromCharCode(48 + (ch.charCodeAt(0) - 1776))
|
|
2354
|
+
);
|
|
2355
|
+
}
|
|
2356
|
+
constructor(initialValue) {
|
|
2357
|
+
if (initialValue) {
|
|
2358
|
+
this.#updateNumeralSet(initialValue);
|
|
2359
|
+
}
|
|
2360
|
+
}
|
|
2361
|
+
// If any Arabic-Indic digits, then label it as that set. Same for Persian. Otherwise assume ASCII.
|
|
2362
|
+
#updateNumeralSet(str) {
|
|
2363
|
+
if (/[٠-٩]/.test(str)) {
|
|
2364
|
+
this.#userNumeralSet = "arabic-indic";
|
|
2365
|
+
} else if (/[۰-۹]/.test(str)) {
|
|
2366
|
+
this.#userNumeralSet = "persian";
|
|
2367
|
+
} else {
|
|
2368
|
+
this.#userNumeralSet = "ascii";
|
|
2369
|
+
}
|
|
2370
|
+
}
|
|
2371
|
+
// Denormalise ASCII 0-9 to the user's numeral set. If not yet known, return as-is.
|
|
2372
|
+
// NOTE: normalise is always called before this, so it should be impossible for the numeral set to be unknown at this point.
|
|
2373
|
+
denormalise(str) {
|
|
2374
|
+
if (!this.#userNumeralSet || this.#userNumeralSet === "ascii") {
|
|
2375
|
+
return str;
|
|
2376
|
+
}
|
|
2377
|
+
const base = this.#userNumeralSet === "arabic-indic" ? 1632 : 1776;
|
|
2378
|
+
return str.replace(/[0-9]/g, (d) => String.fromCharCode(base + Number(d)));
|
|
2379
|
+
}
|
|
2380
|
+
// Normalize Eastern Arabic (U+0660-0669) and Persian/Extended Arabic-Indic (U+06F0-06F9) numerals to ASCII 0-9.
|
|
2381
|
+
// Tracks the user's numeral set as a side effect so denormalise can mirror it back.
|
|
2382
|
+
normalise(str) {
|
|
2383
|
+
if (!str) {
|
|
2384
|
+
return "";
|
|
2385
|
+
}
|
|
2386
|
+
this.#updateNumeralSet(str);
|
|
2387
|
+
if (this.#userNumeralSet === "ascii") {
|
|
2388
|
+
return str;
|
|
2389
|
+
}
|
|
2390
|
+
return _Numerals.toAscii(str);
|
|
2391
|
+
}
|
|
2392
|
+
isAscii() {
|
|
2393
|
+
return !this.#userNumeralSet || this.#userNumeralSet === "ascii";
|
|
2394
|
+
}
|
|
2395
|
+
};
|
|
2396
|
+
|
|
2397
|
+
// packages/core/src/js/core/ui.ts
|
|
2310
2398
|
var UI = class _UI {
|
|
2311
2399
|
// private
|
|
2312
2400
|
#options;
|
|
@@ -2314,6 +2402,7 @@ var UI = class _UI {
|
|
|
2314
2402
|
#isRTL;
|
|
2315
2403
|
#originalPaddingLeft = "";
|
|
2316
2404
|
#countries;
|
|
2405
|
+
#searchTokens;
|
|
2317
2406
|
#searchDebounceTimer = null;
|
|
2318
2407
|
#inlineDropdownHeight;
|
|
2319
2408
|
#countryContainerEl;
|
|
@@ -2359,8 +2448,9 @@ var UI = class _UI {
|
|
|
2359
2448
|
}
|
|
2360
2449
|
}
|
|
2361
2450
|
//* Generate all of the markup for the plugin: the selected country overlay, and the dropdown.
|
|
2362
|
-
buildMarkup(countries) {
|
|
2451
|
+
buildMarkup(countries, searchTokens) {
|
|
2363
2452
|
this.#countries = countries;
|
|
2453
|
+
this.#searchTokens = searchTokens;
|
|
2364
2454
|
this.telInputEl.classList.add("iti__tel-input");
|
|
2365
2455
|
if (!this.telInputEl.hasAttribute("type")) {
|
|
2366
2456
|
this.telInputEl.setAttribute("type", "tel");
|
|
@@ -2728,7 +2818,12 @@ var UI = class _UI {
|
|
|
2728
2818
|
if (query === "") {
|
|
2729
2819
|
matchedCountries = this.#countries;
|
|
2730
2820
|
} else {
|
|
2731
|
-
|
|
2821
|
+
const normalisedQuery = Numerals.toAscii(query);
|
|
2822
|
+
matchedCountries = getMatchedCountries(
|
|
2823
|
+
this.#countries,
|
|
2824
|
+
this.#searchTokens,
|
|
2825
|
+
normalisedQuery
|
|
2826
|
+
);
|
|
2732
2827
|
}
|
|
2733
2828
|
this.#showFilteredCountries(matchedCountries);
|
|
2734
2829
|
}
|
|
@@ -3023,7 +3118,11 @@ var UI = class _UI {
|
|
|
3023
3118
|
}
|
|
3024
3119
|
//* Hidden search (countrySearch disabled): jump to the first list item whose name starts with the query.
|
|
3025
3120
|
#searchForCountry(query) {
|
|
3026
|
-
const match = findFirstCountryStartingWith(
|
|
3121
|
+
const match = findFirstCountryStartingWith(
|
|
3122
|
+
this.#countries,
|
|
3123
|
+
this.#searchTokens,
|
|
3124
|
+
query
|
|
3125
|
+
);
|
|
3027
3126
|
if (match) {
|
|
3028
3127
|
const listItem = this.#listItemByIso2.get(match.iso2);
|
|
3029
3128
|
this.#highlightListItem(listItem);
|
|
@@ -3048,7 +3147,7 @@ var UI = class _UI {
|
|
|
3048
3147
|
}
|
|
3049
3148
|
if (iso2 && !this.#selectedListItemEl) {
|
|
3050
3149
|
const newListItem = this.#countryListEl.querySelector(
|
|
3051
|
-
`[data-
|
|
3150
|
+
`[data-iso2="${iso2}"]`
|
|
3052
3151
|
);
|
|
3053
3152
|
if (newListItem) {
|
|
3054
3153
|
newListItem.setAttribute(ARIA.SELECTED, "true");
|
|
@@ -3236,7 +3335,7 @@ var UI = class _UI {
|
|
|
3236
3335
|
}
|
|
3237
3336
|
};
|
|
3238
3337
|
|
|
3239
|
-
// src/js/data/country-data.ts
|
|
3338
|
+
// packages/core/src/js/data/country-data.ts
|
|
3240
3339
|
var processAllCountries = (options) => {
|
|
3241
3340
|
const { onlyCountries, excludeCountries } = options;
|
|
3242
3341
|
if (onlyCountries?.length) {
|
|
@@ -3251,7 +3350,7 @@ var processAllCountries = (options) => {
|
|
|
3251
3350
|
return [...data_default];
|
|
3252
3351
|
};
|
|
3253
3352
|
var generateCountryNames = (countries, options) => {
|
|
3254
|
-
const { countryNameLocale,
|
|
3353
|
+
const { countryNameLocale, countryNameOverrides } = options;
|
|
3255
3354
|
let displayNames;
|
|
3256
3355
|
try {
|
|
3257
3356
|
const hasDisplayNames = typeof Intl !== "undefined" && typeof Intl.DisplayNames === "function";
|
|
@@ -3267,7 +3366,7 @@ var generateCountryNames = (countries, options) => {
|
|
|
3267
3366
|
displayNames = null;
|
|
3268
3367
|
}
|
|
3269
3368
|
for (const c of countries) {
|
|
3270
|
-
c.name =
|
|
3369
|
+
c.name = countryNameOverrides[c.iso2] || displayNames?.of(c.iso2.toUpperCase()) || "";
|
|
3271
3370
|
}
|
|
3272
3371
|
};
|
|
3273
3372
|
var processDialCodes = (countries) => {
|
|
@@ -3335,15 +3434,8 @@ var sortCountries = (countries, options) => {
|
|
|
3335
3434
|
return a.name.localeCompare(b.name);
|
|
3336
3435
|
});
|
|
3337
3436
|
};
|
|
3338
|
-
var cacheSearchTokens = (countries) => {
|
|
3339
|
-
for (const c of countries) {
|
|
3340
|
-
c.normalisedName = normaliseString(c.name);
|
|
3341
|
-
c.initials = c.normalisedName.split(/[^a-z]/).map((word) => word[0]).join("");
|
|
3342
|
-
c.dialCodePlus = `+${c.dialCode}`;
|
|
3343
|
-
}
|
|
3344
|
-
};
|
|
3345
3437
|
|
|
3346
|
-
// src/js/data/intl-regionless.ts
|
|
3438
|
+
// packages/core/src/js/data/intl-regionless.ts
|
|
3347
3439
|
var regionlessDialCodes = /* @__PURE__ */ new Set([
|
|
3348
3440
|
"800",
|
|
3349
3441
|
"808",
|
|
@@ -3359,7 +3451,7 @@ var hasRegionlessDialCode = (number) => {
|
|
|
3359
3451
|
return number.startsWith("+") && regionlessDialCodes.has(dialCode);
|
|
3360
3452
|
};
|
|
3361
3453
|
|
|
3362
|
-
// src/js/format/formatting.ts
|
|
3454
|
+
// packages/core/src/js/format/formatting.ts
|
|
3363
3455
|
var stripSeparateDialCode = (fullNumber, hasValidDialCode, separateDialCode, selectedCountryData) => {
|
|
3364
3456
|
if (!separateDialCode || !hasValidDialCode) {
|
|
3365
3457
|
return fullNumber;
|
|
@@ -3378,7 +3470,7 @@ var formatNumberAsYouType = (fullNumber, telInputValue, utils, selectedCountryDa
|
|
|
3378
3470
|
return result;
|
|
3379
3471
|
};
|
|
3380
3472
|
|
|
3381
|
-
// src/js/format/caret.ts
|
|
3473
|
+
// packages/core/src/js/format/caret.ts
|
|
3382
3474
|
var computeNewCaretPosition = (relevantChars, formattedValue, prevCaretPos, isDeleteForwards) => {
|
|
3383
3475
|
if (prevCaretPos === 0 && !isDeleteForwards) {
|
|
3384
3476
|
return 0;
|
|
@@ -3398,7 +3490,7 @@ var computeNewCaretPosition = (relevantChars, formattedValue, prevCaretPos, isDe
|
|
|
3398
3490
|
return formattedValue.length;
|
|
3399
3491
|
};
|
|
3400
3492
|
|
|
3401
|
-
// src/js/data/nanp-regionless.ts
|
|
3493
|
+
// packages/core/src/js/data/nanp-regionless.ts
|
|
3402
3494
|
var regionlessNanpAreaCodes = /* @__PURE__ */ new Set([
|
|
3403
3495
|
"800",
|
|
3404
3496
|
"822",
|
|
@@ -3427,55 +3519,7 @@ var isRegionlessNanp = (number) => {
|
|
|
3427
3519
|
return false;
|
|
3428
3520
|
};
|
|
3429
3521
|
|
|
3430
|
-
// src/js/
|
|
3431
|
-
var Numerals = class {
|
|
3432
|
-
#userNumeralSet;
|
|
3433
|
-
constructor(initialValue) {
|
|
3434
|
-
if (initialValue) {
|
|
3435
|
-
this.#updateNumeralSet(initialValue);
|
|
3436
|
-
}
|
|
3437
|
-
}
|
|
3438
|
-
// If any Arabic-Indic digits, then label it as that set. Same for Persian. Otherwise assume ASCII.
|
|
3439
|
-
#updateNumeralSet(str) {
|
|
3440
|
-
if (/[\u0660-\u0669]/.test(str)) {
|
|
3441
|
-
this.#userNumeralSet = "arabic-indic";
|
|
3442
|
-
} else if (/[\u06F0-\u06F9]/.test(str)) {
|
|
3443
|
-
this.#userNumeralSet = "persian";
|
|
3444
|
-
} else {
|
|
3445
|
-
this.#userNumeralSet = "ascii";
|
|
3446
|
-
}
|
|
3447
|
-
}
|
|
3448
|
-
// Denormalise ASCII 0-9 to the user's numeral set. If not yet known, return as-is.
|
|
3449
|
-
// NOTE: normalise is always called before this, so it should be impossible for the numeral set to be unknown at this point.
|
|
3450
|
-
denormalise(str) {
|
|
3451
|
-
if (!this.#userNumeralSet || this.#userNumeralSet === "ascii") {
|
|
3452
|
-
return str;
|
|
3453
|
-
}
|
|
3454
|
-
const base = this.#userNumeralSet === "arabic-indic" ? 1632 : 1776;
|
|
3455
|
-
return str.replace(/[0-9]/g, (d) => String.fromCharCode(base + Number(d)));
|
|
3456
|
-
}
|
|
3457
|
-
// Normalize Eastern Arabic (U+0660-0669) and Persian/Extended Arabic-Indic (U+06F0-06F9) numerals to ASCII 0-9
|
|
3458
|
-
normalise(str) {
|
|
3459
|
-
if (!str) {
|
|
3460
|
-
return "";
|
|
3461
|
-
}
|
|
3462
|
-
this.#updateNumeralSet(str);
|
|
3463
|
-
if (this.#userNumeralSet === "ascii") {
|
|
3464
|
-
return str;
|
|
3465
|
-
}
|
|
3466
|
-
const base = this.#userNumeralSet === "arabic-indic" ? 1632 : 1776;
|
|
3467
|
-
const regex = this.#userNumeralSet === "arabic-indic" ? /[\u0660-\u0669]/g : /[\u06F0-\u06F9]/g;
|
|
3468
|
-
return str.replace(
|
|
3469
|
-
regex,
|
|
3470
|
-
(ch) => String.fromCharCode(48 + (ch.charCodeAt(0) - base))
|
|
3471
|
-
);
|
|
3472
|
-
}
|
|
3473
|
-
isAscii() {
|
|
3474
|
-
return !this.#userNumeralSet || this.#userNumeralSet === "ascii";
|
|
3475
|
-
}
|
|
3476
|
-
};
|
|
3477
|
-
|
|
3478
|
-
// src/js/intlTelInput.ts
|
|
3522
|
+
// packages/core/src/js/intlTelInput.ts
|
|
3479
3523
|
var nextId = 0;
|
|
3480
3524
|
var ensureUtils = (methodName) => {
|
|
3481
3525
|
if (!intlTelInput.utils) {
|
|
@@ -3509,6 +3553,7 @@ var Iti = class _Iti {
|
|
|
3509
3553
|
#dialCodeToIso2Map;
|
|
3510
3554
|
#dialCodes;
|
|
3511
3555
|
#countryByIso2;
|
|
3556
|
+
#searchTokens;
|
|
3512
3557
|
#selectedCountry = null;
|
|
3513
3558
|
#maxCoreNumberLength = null;
|
|
3514
3559
|
#fallbackCountryIso2;
|
|
@@ -3565,7 +3610,7 @@ var Iti = class _Iti {
|
|
|
3565
3610
|
#init() {
|
|
3566
3611
|
this.#abortController = new AbortController();
|
|
3567
3612
|
this.#processCountryData();
|
|
3568
|
-
this.#ui.buildMarkup(this.#countries);
|
|
3613
|
+
this.#ui.buildMarkup(this.#countries, this.#searchTokens);
|
|
3569
3614
|
this.#setInitialState();
|
|
3570
3615
|
this.#initListeners();
|
|
3571
3616
|
this.#startAsyncLoads();
|
|
@@ -3580,7 +3625,7 @@ var Iti = class _Iti {
|
|
|
3580
3625
|
#processCountryData() {
|
|
3581
3626
|
generateCountryNames(this.#countries, this.#options);
|
|
3582
3627
|
sortCountries(this.#countries, this.#options);
|
|
3583
|
-
|
|
3628
|
+
this.#searchTokens = buildSearchTokens(this.#countries);
|
|
3584
3629
|
}
|
|
3585
3630
|
//* Set the initial state of the input value and the selected country by:
|
|
3586
3631
|
//* 1. Extracting a dial code from the given number
|
|
@@ -3641,7 +3686,7 @@ var Iti = class _Iti {
|
|
|
3641
3686
|
if (this.#utilsDeferred) {
|
|
3642
3687
|
const { loadUtils } = this.#options;
|
|
3643
3688
|
const doAttachUtils = () => {
|
|
3644
|
-
intlTelInput.attachUtils(loadUtils)
|
|
3689
|
+
intlTelInput.attachUtils(loadUtils).catch(() => {
|
|
3645
3690
|
});
|
|
3646
3691
|
};
|
|
3647
3692
|
if (intlTelInput.documentReady()) {
|
|
@@ -3661,7 +3706,7 @@ var Iti = class _Iti {
|
|
|
3661
3706
|
}
|
|
3662
3707
|
}
|
|
3663
3708
|
//* Perform the geo ip lookup.
|
|
3664
|
-
#loadAutoCountry() {
|
|
3709
|
+
async #loadAutoCountry() {
|
|
3665
3710
|
if (intlTelInput.autoCountry) {
|
|
3666
3711
|
this.#handleAutoCountryLoaded();
|
|
3667
3712
|
return;
|
|
@@ -3672,19 +3717,18 @@ var Iti = class _Iti {
|
|
|
3672
3717
|
}
|
|
3673
3718
|
intlTelInput.startedLoadingAutoCountry = true;
|
|
3674
3719
|
if (typeof this.#options.geoIpLookup === "function") {
|
|
3675
|
-
|
|
3676
|
-
const
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
setTimeout(() => _Iti.forEachInstance("handleAutoCountryLoaded"));
|
|
3680
|
-
} else {
|
|
3720
|
+
try {
|
|
3721
|
+
const iso2 = await this.#options.geoIpLookup();
|
|
3722
|
+
const iso2Lower = typeof iso2 === "string" ? iso2.toLowerCase() : "";
|
|
3723
|
+
if (!isIso2(iso2Lower)) {
|
|
3681
3724
|
_Iti.forEachInstance("handleAutoCountryFailure");
|
|
3725
|
+
return;
|
|
3682
3726
|
}
|
|
3683
|
-
|
|
3684
|
-
|
|
3727
|
+
intlTelInput.autoCountry = iso2Lower;
|
|
3728
|
+
setTimeout(() => _Iti.forEachInstance("handleAutoCountryLoaded"));
|
|
3729
|
+
} catch {
|
|
3685
3730
|
_Iti.forEachInstance("handleAutoCountryFailure");
|
|
3686
|
-
}
|
|
3687
|
-
this.#options.geoIpLookup(successCallback, failureCallback);
|
|
3731
|
+
}
|
|
3688
3732
|
}
|
|
3689
3733
|
}
|
|
3690
3734
|
#openDropdownWithPlus() {
|
|
@@ -3703,7 +3747,7 @@ var Iti = class _Iti {
|
|
|
3703
3747
|
#bindAllTelInputListeners() {
|
|
3704
3748
|
this.#bindInputListener();
|
|
3705
3749
|
this.#bindKeydownListener();
|
|
3706
|
-
this.#
|
|
3750
|
+
this.#bindStrictPasteListener();
|
|
3707
3751
|
}
|
|
3708
3752
|
//* Android workaround for handling plus when separateDialCode enabled (as impossible to handle with keydown/keyup, for which e.key always returns "Unidentified", see https://stackoverflow.com/q/59584061/217866)
|
|
3709
3753
|
#handleAndroidPlusKey(inputValue) {
|
|
@@ -3871,15 +3915,16 @@ var Iti = class _Iti {
|
|
|
3871
3915
|
e.preventDefault();
|
|
3872
3916
|
}
|
|
3873
3917
|
};
|
|
3874
|
-
#
|
|
3918
|
+
#bindStrictPasteListener() {
|
|
3875
3919
|
if (!this.#options.strictMode) {
|
|
3876
3920
|
return;
|
|
3877
3921
|
}
|
|
3878
|
-
this.#ui.telInputEl.addEventListener("paste", this.#
|
|
3922
|
+
this.#ui.telInputEl.addEventListener("paste", this.#handleStrictPasteEvent, {
|
|
3879
3923
|
signal: this.#abortController.signal
|
|
3880
3924
|
});
|
|
3881
3925
|
}
|
|
3882
|
-
|
|
3926
|
+
// Handle paste events when strictMode is enabled by sanitising the pasted content before it's inserted into the input, and rejecting it entirely if it would result in an invalid number
|
|
3927
|
+
#handleStrictPasteEvent = (e) => {
|
|
3883
3928
|
e.preventDefault();
|
|
3884
3929
|
const input = this.#ui.telInputEl;
|
|
3885
3930
|
const selStart = input.selectionStart;
|
|
@@ -3898,6 +3943,15 @@ var Iti = class _Iti {
|
|
|
3898
3943
|
const sanitised = hasLeadingPlus && allowLeadingPlus ? `+${numerics}` : numerics;
|
|
3899
3944
|
let newValue = before + sanitised + after;
|
|
3900
3945
|
let rejectReason = sanitised !== pasted ? "invalid" : null;
|
|
3946
|
+
if (newValue.length > 30) {
|
|
3947
|
+
this.#playStrictRejectAnimation();
|
|
3948
|
+
this.#dispatchEvent(EVENTS.STRICT_REJECT, {
|
|
3949
|
+
source: "paste",
|
|
3950
|
+
rejectedInput: pastedRaw,
|
|
3951
|
+
reason: "max-length"
|
|
3952
|
+
});
|
|
3953
|
+
return;
|
|
3954
|
+
}
|
|
3901
3955
|
if (newValue.length > 5 && intlTelInput.utils) {
|
|
3902
3956
|
let coreNumber = intlTelInput.utils.getCoreNumber(newValue, iso2);
|
|
3903
3957
|
while (coreNumber.length === 0 && newValue.length > 0) {
|
|
@@ -3989,8 +4043,7 @@ var Iti = class _Iti {
|
|
|
3989
4043
|
if (formatOnDisplay && intlTelInput.utils && this.#selectedCountry) {
|
|
3990
4044
|
const isRegionless = hasRegionlessDialCode(fullNumber);
|
|
3991
4045
|
const useNational = nationalMode && !isRegionless || !number.startsWith("+") && !separateDialCode;
|
|
3992
|
-
const
|
|
3993
|
-
const format = useNational ? NATIONAL : INTERNATIONAL;
|
|
4046
|
+
const format = useNational ? NUMBER_FORMAT.NATIONAL : NUMBER_FORMAT.INTERNATIONAL;
|
|
3994
4047
|
number = intlTelInput.utils.formatNumber(
|
|
3995
4048
|
number,
|
|
3996
4049
|
this.#selectedCountry?.iso2,
|
|
@@ -4110,11 +4163,10 @@ var Iti = class _Iti {
|
|
|
4110
4163
|
this.#maxCoreNumberLength = null;
|
|
4111
4164
|
return;
|
|
4112
4165
|
}
|
|
4113
|
-
const numberType = intlTelInput.utils.numberType[placeholderNumberType];
|
|
4114
4166
|
let exampleNumber = intlTelInput.utils.getExampleNumber(
|
|
4115
4167
|
iso2,
|
|
4116
4168
|
false,
|
|
4117
|
-
|
|
4169
|
+
placeholderNumberType,
|
|
4118
4170
|
true
|
|
4119
4171
|
);
|
|
4120
4172
|
let validNumber = exampleNumber;
|
|
@@ -4144,11 +4196,10 @@ var Iti = class _Iti {
|
|
|
4144
4196
|
if (!intlTelInput.utils || !shouldSetPlaceholder) {
|
|
4145
4197
|
return;
|
|
4146
4198
|
}
|
|
4147
|
-
const numberType = intlTelInput.utils.numberType[placeholderNumberType];
|
|
4148
4199
|
let placeholder = this.#selectedCountry ? intlTelInput.utils.getExampleNumber(
|
|
4149
4200
|
this.#selectedCountry.iso2,
|
|
4150
4201
|
nationalMode,
|
|
4151
|
-
|
|
4202
|
+
placeholderNumberType
|
|
4152
4203
|
) : "";
|
|
4153
4204
|
placeholder = this.#prepareNumberForInput(placeholder);
|
|
4154
4205
|
if (typeof customPlaceholder === "function") {
|
|
@@ -4258,19 +4309,9 @@ var Iti = class _Iti {
|
|
|
4258
4309
|
);
|
|
4259
4310
|
return this.#truncateToMaxLength(number);
|
|
4260
4311
|
}
|
|
4261
|
-
//* Return only the public-facing subset of the selected country data.
|
|
4262
|
-
#getPublicCountryData() {
|
|
4263
|
-
const d = this.#selectedCountry;
|
|
4264
|
-
if (!d) {
|
|
4265
|
-
return null;
|
|
4266
|
-
}
|
|
4267
|
-
const { iso2, dialCode, name } = d;
|
|
4268
|
-
return { iso2, dialCode, name };
|
|
4269
|
-
}
|
|
4270
4312
|
//* Dispatch the 'countrychange' event.
|
|
4271
4313
|
#dispatchCountryChangeEvent() {
|
|
4272
|
-
|
|
4273
|
-
this.#dispatchEvent(EVENTS.COUNTRY_CHANGE, countryData);
|
|
4314
|
+
this.#dispatchEvent(EVENTS.COUNTRY_CHANGE, this.#selectedCountry ?? null);
|
|
4274
4315
|
}
|
|
4275
4316
|
//**************************
|
|
4276
4317
|
//* INTERNAL METHODS
|
|
@@ -4361,7 +4402,7 @@ var Iti = class _Iti {
|
|
|
4361
4402
|
this.#selectedCountry?.iso2
|
|
4362
4403
|
);
|
|
4363
4404
|
}
|
|
4364
|
-
//* Format the number to the given format.
|
|
4405
|
+
//* Format the number to the given format (defaults to "E164").
|
|
4365
4406
|
getNumber(format) {
|
|
4366
4407
|
if (!this.#isActive) {
|
|
4367
4408
|
return "";
|
|
@@ -4376,10 +4417,10 @@ var Iti = class _Iti {
|
|
|
4376
4417
|
);
|
|
4377
4418
|
return this.#numerals.denormalise(formattedNumber);
|
|
4378
4419
|
}
|
|
4379
|
-
//* Get the type of the entered number e.g.
|
|
4420
|
+
//* Get the type of the entered number e.g. "FIXED_LINE" / "MOBILE", or null if it can't be determined / instance is destroyed.
|
|
4380
4421
|
getNumberType() {
|
|
4381
4422
|
if (!this.#isActive) {
|
|
4382
|
-
return
|
|
4423
|
+
return null;
|
|
4383
4424
|
}
|
|
4384
4425
|
ensureUtils("getNumberType");
|
|
4385
4426
|
return intlTelInput.utils.getNumberType(
|
|
@@ -4389,12 +4430,12 @@ var Iti = class _Iti {
|
|
|
4389
4430
|
}
|
|
4390
4431
|
//* Get the country data for the currently selected country.
|
|
4391
4432
|
getSelectedCountryData() {
|
|
4392
|
-
return this.#
|
|
4433
|
+
return this.#selectedCountry ?? null;
|
|
4393
4434
|
}
|
|
4394
|
-
//* Get the validation error.
|
|
4435
|
+
//* Get the validation error e.g. "TOO_SHORT" / "TOO_LONG", or null if it can't be determined / instance is destroyed.
|
|
4395
4436
|
getValidationError() {
|
|
4396
4437
|
if (!this.#isActive) {
|
|
4397
|
-
return
|
|
4438
|
+
return null;
|
|
4398
4439
|
}
|
|
4399
4440
|
ensureUtils("getValidationError");
|
|
4400
4441
|
const iso2 = this.#selectedCountry?.iso2;
|
|
@@ -4543,39 +4584,31 @@ var Iti = class _Iti {
|
|
|
4543
4584
|
});
|
|
4544
4585
|
}
|
|
4545
4586
|
};
|
|
4546
|
-
var attachUtils = (source) => {
|
|
4547
|
-
if (
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4587
|
+
var attachUtils = async (source) => {
|
|
4588
|
+
if (intlTelInput.utils || intlTelInput.startedLoadingUtils) {
|
|
4589
|
+
return null;
|
|
4590
|
+
}
|
|
4591
|
+
if (typeof source !== "function") {
|
|
4592
|
+
throw new TypeError(
|
|
4593
|
+
`The argument passed to attachUtils must be a function that returns a promise for the utils module, not ${typeof source}`
|
|
4594
|
+
);
|
|
4595
|
+
}
|
|
4596
|
+
intlTelInput.startedLoadingUtils = true;
|
|
4597
|
+
try {
|
|
4598
|
+
const module = await source();
|
|
4599
|
+
const utils = module?.default;
|
|
4600
|
+
if (!utils || typeof utils !== "object") {
|
|
4601
|
+
throw new TypeError(
|
|
4602
|
+
"The loader function passed to attachUtils did not resolve to a module object with utils as its default export."
|
|
4560
4603
|
);
|
|
4561
4604
|
}
|
|
4562
|
-
intlTelInput.
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
);
|
|
4569
|
-
}
|
|
4570
|
-
intlTelInput.utils = utils;
|
|
4571
|
-
Iti.forEachInstance("handleUtilsLoaded");
|
|
4572
|
-
return true;
|
|
4573
|
-
}).catch((error) => {
|
|
4574
|
-
Iti.forEachInstance("handleUtilsFailure", error);
|
|
4575
|
-
throw error;
|
|
4576
|
-
});
|
|
4605
|
+
intlTelInput.utils = utils;
|
|
4606
|
+
Iti.forEachInstance("handleUtilsLoaded");
|
|
4607
|
+
return true;
|
|
4608
|
+
} catch (error) {
|
|
4609
|
+
Iti.forEachInstance("handleUtilsFailure", error);
|
|
4610
|
+
throw error;
|
|
4577
4611
|
}
|
|
4578
|
-
return null;
|
|
4579
4612
|
};
|
|
4580
4613
|
var intlTelInput = Object.assign(
|
|
4581
4614
|
(input, options) => {
|
|
@@ -4600,22 +4633,25 @@ var intlTelInput = Object.assign(
|
|
|
4600
4633
|
attachUtils,
|
|
4601
4634
|
startedLoadingUtils: false,
|
|
4602
4635
|
startedLoadingAutoCountry: false,
|
|
4603
|
-
version: "
|
|
4636
|
+
version: "28.0.0",
|
|
4637
|
+
NUMBER_FORMAT,
|
|
4638
|
+
NUMBER_TYPE,
|
|
4639
|
+
VALIDATION_ERROR
|
|
4604
4640
|
}
|
|
4605
4641
|
);
|
|
4606
4642
|
var intlTelInput_default = intlTelInput;
|
|
4607
4643
|
|
|
4608
|
-
// dist/js/utils.js
|
|
4644
|
+
// packages/core/dist/js/utils.js
|
|
4609
4645
|
var _scope = {};
|
|
4610
4646
|
(function() {
|
|
4611
|
-
var
|
|
4612
|
-
function
|
|
4647
|
+
var aa = this || self;
|
|
4648
|
+
function k(a, b) {
|
|
4613
4649
|
a = a.split(".");
|
|
4614
|
-
var c =
|
|
4650
|
+
var c = aa;
|
|
4615
4651
|
a[0] in c || typeof c.execScript == "undefined" || c.execScript("var " + a[0]);
|
|
4616
4652
|
for (var d; a.length && (d = a.shift()); ) a.length || b === void 0 ? c[d] && c[d] !== Object.prototype[d] ? c = c[d] : c = c[d] = {} : c[d] = b;
|
|
4617
4653
|
}
|
|
4618
|
-
function
|
|
4654
|
+
function m(a, b) {
|
|
4619
4655
|
function c() {
|
|
4620
4656
|
}
|
|
4621
4657
|
c.prototype = b.prototype;
|
|
@@ -4628,7 +4664,7 @@ var _scope = {};
|
|
|
4628
4664
|
};
|
|
4629
4665
|
}
|
|
4630
4666
|
;
|
|
4631
|
-
function
|
|
4667
|
+
function ba(a) {
|
|
4632
4668
|
const b = [];
|
|
4633
4669
|
let c = 0;
|
|
4634
4670
|
for (const d in a) b[c++] = a[d];
|
|
@@ -4637,13 +4673,13 @@ var _scope = {};
|
|
|
4637
4673
|
;
|
|
4638
4674
|
var da = class {
|
|
4639
4675
|
constructor(a) {
|
|
4640
|
-
if (
|
|
4676
|
+
if (ca !== ca) throw Error("SafeUrl is not meant to be built directly");
|
|
4641
4677
|
this.g = a;
|
|
4642
4678
|
}
|
|
4643
4679
|
toString() {
|
|
4644
4680
|
return this.g.toString();
|
|
4645
4681
|
}
|
|
4646
|
-
},
|
|
4682
|
+
}, ca = {};
|
|
4647
4683
|
new da("about:invalid#zClosurez");
|
|
4648
4684
|
new da("about:blank");
|
|
4649
4685
|
const ea = {};
|
|
@@ -4669,7 +4705,7 @@ var _scope = {};
|
|
|
4669
4705
|
const ja = {};
|
|
4670
4706
|
class ka {
|
|
4671
4707
|
constructor() {
|
|
4672
|
-
var a =
|
|
4708
|
+
var a = aa.trustedTypes && aa.trustedTypes.emptyHTML || "";
|
|
4673
4709
|
if (ja !== ja) throw Error("SafeHtml is not meant to be built directly");
|
|
4674
4710
|
this.g = a;
|
|
4675
4711
|
}
|
|
@@ -4706,38 +4742,38 @@ var _scope = {};
|
|
|
4706
4742
|
}
|
|
4707
4743
|
}
|
|
4708
4744
|
function ua(a) {
|
|
4709
|
-
a =
|
|
4745
|
+
a = ba(a.g);
|
|
4710
4746
|
a.sort(function(b, c) {
|
|
4711
4747
|
return b.g - c.g;
|
|
4712
4748
|
});
|
|
4713
4749
|
return a;
|
|
4714
4750
|
}
|
|
4715
4751
|
;
|
|
4716
|
-
function
|
|
4752
|
+
function n() {
|
|
4717
4753
|
this.h = {};
|
|
4718
4754
|
this.j = this.m().g;
|
|
4719
4755
|
this.g = this.l = null;
|
|
4720
4756
|
}
|
|
4721
|
-
|
|
4722
|
-
return
|
|
4757
|
+
n.prototype.has = function(a) {
|
|
4758
|
+
return p(this, a.g);
|
|
4723
4759
|
};
|
|
4724
|
-
|
|
4725
|
-
return
|
|
4760
|
+
n.prototype.get = function(a, b) {
|
|
4761
|
+
return q(this, a.g, b);
|
|
4726
4762
|
};
|
|
4727
|
-
|
|
4728
|
-
|
|
4763
|
+
n.prototype.set = function(a, b) {
|
|
4764
|
+
r(this, a.g, b);
|
|
4729
4765
|
};
|
|
4730
|
-
|
|
4766
|
+
n.prototype.add = function(a, b) {
|
|
4731
4767
|
va(this, a.g, b);
|
|
4732
4768
|
};
|
|
4733
|
-
|
|
4769
|
+
n.prototype.equals = function(a) {
|
|
4734
4770
|
if (!a || this.constructor != a.constructor) return false;
|
|
4735
4771
|
for (var b = ua(this.m()), c = 0; c < b.length; c++) {
|
|
4736
4772
|
var d = b[c], e = d.g;
|
|
4737
|
-
if (
|
|
4738
|
-
if (
|
|
4739
|
-
var f = d.h == 11 || d.h == 10, g =
|
|
4740
|
-
e =
|
|
4773
|
+
if (p(this, e) != p(a, e)) return false;
|
|
4774
|
+
if (p(this, e)) {
|
|
4775
|
+
var f = d.h == 11 || d.h == 10, g = t(this, e);
|
|
4776
|
+
e = t(a, e);
|
|
4741
4777
|
if (d.l) {
|
|
4742
4778
|
if (g.length != e.length) return false;
|
|
4743
4779
|
for (d = 0; d < g.length; d++) {
|
|
@@ -4752,25 +4788,25 @@ var _scope = {};
|
|
|
4752
4788
|
function wa(a, b) {
|
|
4753
4789
|
for (var c = ua(a.m()), d = 0; d < c.length; d++) {
|
|
4754
4790
|
var e = c[d], f = e.g;
|
|
4755
|
-
if (
|
|
4791
|
+
if (p(b, f)) {
|
|
4756
4792
|
a.g && delete a.g[e.g];
|
|
4757
4793
|
var g = e.h == 11 || e.h == 10;
|
|
4758
4794
|
if (e.l) {
|
|
4759
|
-
e =
|
|
4795
|
+
e = t(b, f) || [];
|
|
4760
4796
|
for (var h = 0; h < e.length; h++) va(a, f, g ? e[h].clone() : e[h]);
|
|
4761
|
-
} else e =
|
|
4797
|
+
} else e = t(b, f), g ? (g = t(a, f)) ? wa(g, e) : r(a, f, e.clone()) : r(a, f, e);
|
|
4762
4798
|
}
|
|
4763
4799
|
}
|
|
4764
4800
|
}
|
|
4765
|
-
|
|
4801
|
+
n.prototype.clone = function() {
|
|
4766
4802
|
var a = new this.constructor();
|
|
4767
4803
|
a != this && (a.h = {}, a.g && (a.g = {}), wa(a, this));
|
|
4768
4804
|
return a;
|
|
4769
4805
|
};
|
|
4770
|
-
function
|
|
4806
|
+
function p(a, b) {
|
|
4771
4807
|
return a.h[b] != null;
|
|
4772
4808
|
}
|
|
4773
|
-
function
|
|
4809
|
+
function t(a, b) {
|
|
4774
4810
|
var c = a.h[b];
|
|
4775
4811
|
if (c == null) return null;
|
|
4776
4812
|
if (a.l) {
|
|
@@ -4786,12 +4822,12 @@ var _scope = {};
|
|
|
4786
4822
|
}
|
|
4787
4823
|
return c;
|
|
4788
4824
|
}
|
|
4789
|
-
function
|
|
4790
|
-
var d =
|
|
4825
|
+
function q(a, b, c) {
|
|
4826
|
+
var d = t(a, b);
|
|
4791
4827
|
return a.j[b].l ? d[c || 0] : d;
|
|
4792
4828
|
}
|
|
4793
|
-
function
|
|
4794
|
-
if (
|
|
4829
|
+
function u(a, b) {
|
|
4830
|
+
if (p(a, b)) a = q(a, b);
|
|
4795
4831
|
else a: {
|
|
4796
4832
|
a = a.j[b];
|
|
4797
4833
|
if (a.j === void 0) if (b = a.u, b === Boolean) a.j = false;
|
|
@@ -4805,10 +4841,10 @@ var _scope = {};
|
|
|
4805
4841
|
}
|
|
4806
4842
|
return a;
|
|
4807
4843
|
}
|
|
4808
|
-
function
|
|
4809
|
-
return a.j[b].l ?
|
|
4844
|
+
function v(a, b) {
|
|
4845
|
+
return a.j[b].l ? p(a, b) ? a.h[b].length : 0 : p(a, b) ? 1 : 0;
|
|
4810
4846
|
}
|
|
4811
|
-
function
|
|
4847
|
+
function r(a, b, c) {
|
|
4812
4848
|
a.h[b] = c;
|
|
4813
4849
|
a.g && (a.g[b] = c);
|
|
4814
4850
|
}
|
|
@@ -4817,20 +4853,20 @@ var _scope = {};
|
|
|
4817
4853
|
a.h[b].push(c);
|
|
4818
4854
|
a.g && delete a.g[b];
|
|
4819
4855
|
}
|
|
4820
|
-
function
|
|
4856
|
+
function w(a, b) {
|
|
4821
4857
|
var c = [], d;
|
|
4822
4858
|
for (d in b) d != 0 && c.push(new la(d, b[d]));
|
|
4823
4859
|
return new ta(a, c);
|
|
4824
4860
|
}
|
|
4825
4861
|
;
|
|
4826
|
-
function
|
|
4862
|
+
function x() {
|
|
4827
4863
|
}
|
|
4828
|
-
|
|
4864
|
+
x.prototype.g = function(a) {
|
|
4829
4865
|
new a.h();
|
|
4830
4866
|
throw Error("Unimplemented");
|
|
4831
4867
|
};
|
|
4832
|
-
|
|
4833
|
-
if (a.h == 11 || a.h == 10) return b instanceof
|
|
4868
|
+
x.prototype.h = function(a, b) {
|
|
4869
|
+
if (a.h == 11 || a.h == 10) return b instanceof n ? b : this.g(a.u.prototype.m(), b);
|
|
4834
4870
|
if (a.h == 14) return typeof b === "string" && xa.test(b) && (a = Number(b), a > 0) ? a : b;
|
|
4835
4871
|
if (!a.o) return b;
|
|
4836
4872
|
a = a.u;
|
|
@@ -4840,94 +4876,94 @@ var _scope = {};
|
|
|
4840
4876
|
return b;
|
|
4841
4877
|
};
|
|
4842
4878
|
var xa = /^-?[0-9]+$/;
|
|
4843
|
-
function
|
|
4879
|
+
function ya() {
|
|
4844
4880
|
}
|
|
4845
|
-
|
|
4846
|
-
|
|
4881
|
+
m(ya, x);
|
|
4882
|
+
ya.prototype.g = function(a, b) {
|
|
4847
4883
|
a = new a.h();
|
|
4848
4884
|
a.l = this;
|
|
4849
4885
|
a.h = b;
|
|
4850
4886
|
a.g = {};
|
|
4851
4887
|
return a;
|
|
4852
4888
|
};
|
|
4853
|
-
function
|
|
4889
|
+
function z() {
|
|
4854
4890
|
}
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
return a.h == 8 ? !!b :
|
|
4891
|
+
m(z, ya);
|
|
4892
|
+
z.prototype.h = function(a, b) {
|
|
4893
|
+
return a.h == 8 ? !!b : x.prototype.h.apply(this, arguments);
|
|
4858
4894
|
};
|
|
4859
|
-
|
|
4860
|
-
return
|
|
4895
|
+
z.prototype.g = function(a, b) {
|
|
4896
|
+
return z.na.g.call(this, a, b);
|
|
4861
4897
|
};
|
|
4862
|
-
function
|
|
4898
|
+
function A(a, b) {
|
|
4863
4899
|
a != null && this.g.apply(this, arguments);
|
|
4864
4900
|
}
|
|
4865
|
-
|
|
4866
|
-
|
|
4901
|
+
A.prototype.h = "";
|
|
4902
|
+
A.prototype.set = function(a) {
|
|
4867
4903
|
this.h = "" + a;
|
|
4868
4904
|
};
|
|
4869
|
-
|
|
4905
|
+
A.prototype.g = function(a, b, c) {
|
|
4870
4906
|
this.h += String(a);
|
|
4871
4907
|
if (b != null) for (let d = 1; d < arguments.length; d++) this.h += arguments[d];
|
|
4872
4908
|
return this;
|
|
4873
4909
|
};
|
|
4874
|
-
function
|
|
4910
|
+
function B(a) {
|
|
4875
4911
|
a.h = "";
|
|
4876
4912
|
}
|
|
4877
|
-
|
|
4913
|
+
A.prototype.toString = function() {
|
|
4878
4914
|
return this.h;
|
|
4879
4915
|
};
|
|
4880
|
-
function
|
|
4881
|
-
|
|
4916
|
+
function C() {
|
|
4917
|
+
n.call(this);
|
|
4882
4918
|
}
|
|
4883
|
-
|
|
4884
|
-
var ya = null;
|
|
4885
|
-
function F() {
|
|
4886
|
-
p.call(this);
|
|
4887
|
-
}
|
|
4888
|
-
n(F, p);
|
|
4919
|
+
m(C, n);
|
|
4889
4920
|
var za = null;
|
|
4890
|
-
function
|
|
4891
|
-
|
|
4892
|
-
}
|
|
4893
|
-
function H() {
|
|
4894
|
-
p.call(this);
|
|
4921
|
+
function D() {
|
|
4922
|
+
n.call(this);
|
|
4895
4923
|
}
|
|
4896
|
-
|
|
4924
|
+
m(D, n);
|
|
4897
4925
|
var Aa = null;
|
|
4898
|
-
E
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
F
|
|
4926
|
+
function E(a) {
|
|
4927
|
+
return t(a, 9) || [];
|
|
4928
|
+
}
|
|
4929
|
+
function F() {
|
|
4930
|
+
n.call(this);
|
|
4931
|
+
}
|
|
4932
|
+
m(F, n);
|
|
4933
|
+
var Ba = null;
|
|
4934
|
+
C.prototype.m = function() {
|
|
4905
4935
|
var a = za;
|
|
4906
|
-
a || (za = a =
|
|
4936
|
+
a || (za = a = w(C, { 0: { name: "NumberFormat", ja: "i18n.phonenumbers.NumberFormat" }, 1: { name: "pattern", required: true, i: 9, type: String }, 2: { name: "format", required: true, i: 9, type: String }, 3: { name: "leading_digits_pattern", ca: true, i: 9, type: String }, 4: { name: "national_prefix_formatting_rule", i: 9, type: String }, 6: { name: "national_prefix_optional_when_formatting", i: 8, defaultValue: false, type: Boolean }, 5: { name: "domestic_carrier_code_formatting_rule", i: 9, type: String } }));
|
|
4907
4937
|
return a;
|
|
4908
4938
|
};
|
|
4909
|
-
|
|
4910
|
-
|
|
4939
|
+
C.m = C.prototype.m;
|
|
4940
|
+
D.prototype.m = function() {
|
|
4911
4941
|
var a = Aa;
|
|
4912
|
-
a || (Aa = a =
|
|
4942
|
+
a || (Aa = a = w(D, { 0: { name: "PhoneNumberDesc", ja: "i18n.phonenumbers.PhoneNumberDesc" }, 2: { name: "national_number_pattern", i: 9, type: String }, 9: { name: "possible_length", ca: true, i: 5, type: Number }, 10: { name: "possible_length_local_only", ca: true, i: 5, type: Number }, 6: { name: "example_number", i: 9, type: String } }));
|
|
4943
|
+
return a;
|
|
4944
|
+
};
|
|
4945
|
+
D.m = D.prototype.m;
|
|
4946
|
+
F.prototype.m = function() {
|
|
4947
|
+
var a = Ba;
|
|
4948
|
+
a || (Ba = a = w(F, {
|
|
4913
4949
|
0: { name: "PhoneMetadata", ja: "i18n.phonenumbers.PhoneMetadata" },
|
|
4914
|
-
1: { name: "general_desc", i: 11, type:
|
|
4915
|
-
2: { name: "fixed_line", i: 11, type:
|
|
4916
|
-
3: { name: "mobile", i: 11, type:
|
|
4917
|
-
4: { name: "toll_free", i: 11, type:
|
|
4918
|
-
5: { name: "premium_rate", i: 11, type:
|
|
4919
|
-
6: { name: "shared_cost", i: 11, type:
|
|
4920
|
-
7: { name: "personal_number", i: 11, type:
|
|
4921
|
-
8: { name: "voip", i: 11, type:
|
|
4922
|
-
21: { name: "pager", i: 11, type:
|
|
4923
|
-
25: { name: "uan", i: 11, type:
|
|
4924
|
-
27: { name: "emergency", i: 11, type:
|
|
4925
|
-
28: { name: "voicemail", i: 11, type:
|
|
4926
|
-
29: { name: "short_code", i: 11, type:
|
|
4927
|
-
30: { name: "standard_rate", i: 11, type:
|
|
4928
|
-
31: { name: "carrier_specific", i: 11, type:
|
|
4929
|
-
33: { name: "sms_services", i: 11, type:
|
|
4930
|
-
24: { name: "no_international_dialling", i: 11, type:
|
|
4950
|
+
1: { name: "general_desc", i: 11, type: D },
|
|
4951
|
+
2: { name: "fixed_line", i: 11, type: D },
|
|
4952
|
+
3: { name: "mobile", i: 11, type: D },
|
|
4953
|
+
4: { name: "toll_free", i: 11, type: D },
|
|
4954
|
+
5: { name: "premium_rate", i: 11, type: D },
|
|
4955
|
+
6: { name: "shared_cost", i: 11, type: D },
|
|
4956
|
+
7: { name: "personal_number", i: 11, type: D },
|
|
4957
|
+
8: { name: "voip", i: 11, type: D },
|
|
4958
|
+
21: { name: "pager", i: 11, type: D },
|
|
4959
|
+
25: { name: "uan", i: 11, type: D },
|
|
4960
|
+
27: { name: "emergency", i: 11, type: D },
|
|
4961
|
+
28: { name: "voicemail", i: 11, type: D },
|
|
4962
|
+
29: { name: "short_code", i: 11, type: D },
|
|
4963
|
+
30: { name: "standard_rate", i: 11, type: D },
|
|
4964
|
+
31: { name: "carrier_specific", i: 11, type: D },
|
|
4965
|
+
33: { name: "sms_services", i: 11, type: D },
|
|
4966
|
+
24: { name: "no_international_dialling", i: 11, type: D },
|
|
4931
4967
|
9: { name: "id", required: true, i: 9, type: String },
|
|
4932
4968
|
10: { name: "country_code", i: 5, type: Number },
|
|
4933
4969
|
11: { name: "international_prefix", i: 9, type: String },
|
|
@@ -4941,31 +4977,31 @@ var _scope = {};
|
|
|
4941
4977
|
},
|
|
4942
4978
|
16: { name: "national_prefix_transform_rule", i: 9, type: String },
|
|
4943
4979
|
18: { name: "same_mobile_and_fixed_line_pattern", i: 8, defaultValue: false, type: Boolean },
|
|
4944
|
-
19: { name: "number_format", ca: true, i: 11, type:
|
|
4945
|
-
20: { name: "intl_number_format", ca: true, i: 11, type:
|
|
4980
|
+
19: { name: "number_format", ca: true, i: 11, type: C },
|
|
4981
|
+
20: { name: "intl_number_format", ca: true, i: 11, type: C },
|
|
4946
4982
|
22: { name: "main_country_for_code", i: 8, defaultValue: false, type: Boolean },
|
|
4947
4983
|
23: { name: "leading_digits", i: 9, type: String }
|
|
4948
4984
|
}));
|
|
4949
4985
|
return a;
|
|
4950
4986
|
};
|
|
4951
|
-
|
|
4952
|
-
function
|
|
4953
|
-
|
|
4954
|
-
}
|
|
4955
|
-
|
|
4956
|
-
var
|
|
4957
|
-
|
|
4958
|
-
var a =
|
|
4959
|
-
a || (
|
|
4987
|
+
F.m = F.prototype.m;
|
|
4988
|
+
function G() {
|
|
4989
|
+
n.call(this);
|
|
4990
|
+
}
|
|
4991
|
+
m(G, n);
|
|
4992
|
+
var Ca = null, Da = { sa: 0, ra: 1, qa: 5, pa: 10, oa: 20 };
|
|
4993
|
+
G.prototype.m = function() {
|
|
4994
|
+
var a = Ca;
|
|
4995
|
+
a || (Ca = a = w(G, { 0: { name: "PhoneNumber", ja: "i18n.phonenumbers.PhoneNumber" }, 1: { name: "country_code", required: true, i: 5, type: Number }, 2: { name: "national_number", required: true, 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: Da }, 7: {
|
|
4960
4996
|
name: "preferred_domestic_carrier_code",
|
|
4961
4997
|
i: 9,
|
|
4962
4998
|
type: String
|
|
4963
4999
|
} }));
|
|
4964
5000
|
return a;
|
|
4965
5001
|
};
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
var
|
|
5002
|
+
G.ctor = G;
|
|
5003
|
+
G.ctor.m = G.prototype.m;
|
|
5004
|
+
var H = {
|
|
4969
5005
|
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(" "),
|
|
4970
5006
|
7: ["RU", "KZ"],
|
|
4971
5007
|
20: ["EG"],
|
|
@@ -5181,7 +5217,7 @@ var _scope = {};
|
|
|
5181
5217
|
995: ["GE"],
|
|
5182
5218
|
996: ["KG"],
|
|
5183
5219
|
998: ["UZ"]
|
|
5184
|
-
},
|
|
5220
|
+
}, Ea = {
|
|
5185
5221
|
AC: [, [
|
|
5186
5222
|
,
|
|
5187
5223
|
,
|
|
@@ -10253,14 +10289,14 @@ var _scope = {};
|
|
|
10253
10289
|
], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], "001", 888, , , , , , , , 1, [[, "(\\d{3})(\\d{3})(\\d{5})", "$1 $2 $3"]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , "\\d{11}", , , , "12345678901"], , , [, , , , , , , , , [-1]]],
|
|
10254
10290
|
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]]]
|
|
10255
10291
|
};
|
|
10256
|
-
function
|
|
10292
|
+
function I() {
|
|
10257
10293
|
this.g = {};
|
|
10258
10294
|
}
|
|
10259
|
-
|
|
10260
|
-
|
|
10261
|
-
return
|
|
10295
|
+
I.h = void 0;
|
|
10296
|
+
I.g = function() {
|
|
10297
|
+
return I.h ? I.h : I.h = new I();
|
|
10262
10298
|
};
|
|
10263
|
-
var
|
|
10299
|
+
var Fa = { 0: "0", 1: "1", 2: "2", 3: "3", 4: "4", 5: "5", 6: "6", 7: "7", 8: "8", 9: "9", "\uFF10": "0", "\uFF11": "1", "\uFF12": "2", "\uFF13": "3", "\uFF14": "4", "\uFF15": "5", "\uFF16": "6", "\uFF17": "7", "\uFF18": "8", "\uFF19": "9", "\u0660": "0", "\u0661": "1", "\u0662": "2", "\u0663": "3", "\u0664": "4", "\u0665": "5", "\u0666": "6", "\u0667": "7", "\u0668": "8", "\u0669": "9", "\u06F0": "0", "\u06F1": "1", "\u06F2": "2", "\u06F3": "3", "\u06F4": "4", "\u06F5": "5", "\u06F6": "6", "\u06F7": "7", "\u06F8": "8", "\u06F9": "9" }, Ga = {
|
|
10264
10300
|
0: "0",
|
|
10265
10301
|
1: "1",
|
|
10266
10302
|
2: "2",
|
|
@@ -10274,7 +10310,7 @@ var _scope = {};
|
|
|
10274
10310
|
"+": "+",
|
|
10275
10311
|
"*": "*",
|
|
10276
10312
|
"#": "#"
|
|
10277
|
-
},
|
|
10313
|
+
}, Ha = {
|
|
10278
10314
|
0: "0",
|
|
10279
10315
|
1: "1",
|
|
10280
10316
|
2: "2",
|
|
@@ -10341,56 +10377,56 @@ var _scope = {};
|
|
|
10341
10377
|
X: "9",
|
|
10342
10378
|
Y: "9",
|
|
10343
10379
|
Z: "9"
|
|
10344
|
-
},
|
|
10345
|
-
function
|
|
10380
|
+
}, Ia = RegExp("[+\uFF0B]+"), J = RegExp("^[+\uFF0B]+"), Ja = RegExp("([0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9])"), Ka = RegExp("[+\uFF0B0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]"), La = /[\\\/] *x/, Ma = RegExp("[^0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9A-Za-z#]+$"), Na = /(?:.*?[A-Za-z]){3}.*/, Oa = RegExp("^\\+([0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]|[\\-\\.\\(\\)]?)*[0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]([0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]|[\\-\\.\\(\\)]?)*$"), Pa = RegExp("^([A-Za-z0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]+((\\-)*[A-Za-z0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9])*\\.)*[A-Za-z]+((\\-)*[A-Za-z0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9])*\\.?$");
|
|
10381
|
+
function K(a) {
|
|
10346
10382
|
return "([0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]{1," + a + "})";
|
|
10347
10383
|
}
|
|
10348
|
-
function
|
|
10349
|
-
return ";ext=" +
|
|
10350
|
-
}
|
|
10351
|
-
var Qa = new RegExp("(?:" + Pa() + ")$", "i"), Ra = new RegExp("^[0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]{2}$|^[+\uFF0B]*(?:[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E*]*[0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]){3,}[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E*A-Za-z0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]*(?:" + Pa() + ")?$", "i"), Sa = /(\$\d)/, Ta = /^\(?\$1\)?$/;
|
|
10352
|
-
function Ua(a) {
|
|
10353
|
-
return a.length < 2 ? false : N(Ra, a);
|
|
10384
|
+
function Qa() {
|
|
10385
|
+
return ";ext=" + K("20") + "|[ \xA0\\t,]*(?:e?xt(?:ensi(?:o\u0301?|\xF3))?n?|\uFF45?\uFF58\uFF54\uFF4E?|\u0434\u043E\u0431|anexo)[:\\.\uFF0E]?[ \xA0\\t,-]*" + (K("20") + "#?|[ \xA0\\t,]*(?:[x\uFF58#\uFF03~\uFF5E]|int|\uFF49\uFF4E\uFF54)[:\\.\uFF0E]?[ \xA0\\t,-]*") + (K("9") + "#?|[- ]+") + (K("6") + "#|[ \xA0\\t]*(?:,{2}|;)[:\\.\uFF0E]?[ \xA0\\t,-]*") + (K("15") + "#?|[ \xA0\\t]*(?:,)+[:\\.\uFF0E]?[ \xA0\\t,-]*") + (K("9") + "#?");
|
|
10354
10386
|
}
|
|
10387
|
+
var Ra = new RegExp("(?:" + Qa() + ")$", "i"), Sa = new RegExp("^[0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]{2}$|^[+\uFF0B]*(?:[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E*]*[0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]){3,}[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E*A-Za-z0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]*(?:" + Qa() + ")?$", "i"), Ta = /(\$\d)/, Ua = /^\(?\$1\)?$/;
|
|
10355
10388
|
function Va(a) {
|
|
10356
|
-
return
|
|
10389
|
+
return a.length < 2 ? false : L(Sa, a);
|
|
10357
10390
|
}
|
|
10358
10391
|
function Wa(a) {
|
|
10359
|
-
|
|
10360
|
-
D(a);
|
|
10361
|
-
a.g(b);
|
|
10392
|
+
return L(Na, a) ? M(a, Ha) : M(a, Fa);
|
|
10362
10393
|
}
|
|
10363
10394
|
function Xa(a) {
|
|
10364
|
-
|
|
10395
|
+
var b = Wa(a.toString());
|
|
10396
|
+
B(a);
|
|
10397
|
+
a.g(b);
|
|
10365
10398
|
}
|
|
10366
|
-
function
|
|
10367
|
-
|
|
10399
|
+
function Ya(a) {
|
|
10400
|
+
return a != null && (v(a, 9) != 1 || E(a)[0] != -1);
|
|
10401
|
+
}
|
|
10402
|
+
function M(a, b) {
|
|
10403
|
+
for (var c = new A(), d, e = a.length, f = 0; f < e; ++f) d = a.charAt(f), d = b[d.toUpperCase()], d != null && c.g(d);
|
|
10368
10404
|
return c.toString();
|
|
10369
10405
|
}
|
|
10370
|
-
function
|
|
10371
|
-
return a.length == 0 ||
|
|
10406
|
+
function Za(a) {
|
|
10407
|
+
return a.length == 0 || Ua.test(a);
|
|
10372
10408
|
}
|
|
10373
|
-
function
|
|
10374
|
-
return a != null && isNaN(a) && a.toUpperCase() in
|
|
10409
|
+
function N(a) {
|
|
10410
|
+
return a != null && isNaN(a) && a.toUpperCase() in Ea;
|
|
10375
10411
|
}
|
|
10376
|
-
|
|
10377
|
-
if (
|
|
10378
|
-
var c =
|
|
10412
|
+
I.prototype.format = function(a, b) {
|
|
10413
|
+
if (q(a, 2) == 0 && p(a, 5)) {
|
|
10414
|
+
var c = u(a, 5);
|
|
10379
10415
|
if (c.length > 0) return c;
|
|
10380
10416
|
}
|
|
10381
|
-
c =
|
|
10382
|
-
var d =
|
|
10383
|
-
if (b == 0) return
|
|
10384
|
-
if (!(c in
|
|
10385
|
-
var e =
|
|
10386
|
-
a =
|
|
10417
|
+
c = u(a, 1);
|
|
10418
|
+
var d = O(a);
|
|
10419
|
+
if (b == 0) return $a(c, 0, d, "");
|
|
10420
|
+
if (!(c in H)) return d;
|
|
10421
|
+
var e = P(this, c, Q(c));
|
|
10422
|
+
a = p(a, 3) && q(a, 3).length != 0 ? b == 3 ? ";ext=" + q(a, 3) : p(e, 13) ? q(e, 13) + u(a, 3) : " ext. " + u(a, 3) : "";
|
|
10387
10423
|
a: {
|
|
10388
|
-
e = (
|
|
10424
|
+
e = (t(e, 20) || []).length == 0 || b == 2 ? t(e, 19) || [] : t(e, 20) || [];
|
|
10389
10425
|
for (var f, g = e.length, h = 0; h < g; ++h) {
|
|
10390
10426
|
f = e[h];
|
|
10391
|
-
var l =
|
|
10392
|
-
if (l == 0 || d.search(
|
|
10393
|
-
if (l = new RegExp(
|
|
10427
|
+
var l = v(f, 3);
|
|
10428
|
+
if (l == 0 || d.search(q(f, 3, l - 1)) == 0) {
|
|
10429
|
+
if (l = new RegExp(q(f, 1)), L(l, d)) {
|
|
10394
10430
|
e = f;
|
|
10395
10431
|
break a;
|
|
10396
10432
|
}
|
|
@@ -10398,21 +10434,21 @@ var _scope = {};
|
|
|
10398
10434
|
}
|
|
10399
10435
|
e = null;
|
|
10400
10436
|
}
|
|
10401
|
-
e != null && (g = e, e =
|
|
10437
|
+
e != null && (g = e, e = u(g, 2), f = new RegExp(q(
|
|
10402
10438
|
g,
|
|
10403
10439
|
1
|
|
10404
|
-
)),
|
|
10405
|
-
return
|
|
10440
|
+
)), u(g, 5), g = u(g, 4), d = b == 2 && g != null && g.length > 0 ? d.replace(f, e.replace(Ta, g)) : d.replace(f, e), b == 3 && (d = d.replace(RegExp("^[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E]+"), ""), d = d.replace(RegExp("[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E]+", "g"), "-")));
|
|
10441
|
+
return $a(c, b, d, a);
|
|
10406
10442
|
};
|
|
10407
|
-
function
|
|
10408
|
-
return "001" == c ?
|
|
10443
|
+
function P(a, b, c) {
|
|
10444
|
+
return "001" == c ? R(a, "" + b) : R(a, c);
|
|
10409
10445
|
}
|
|
10410
|
-
function
|
|
10411
|
-
if (!
|
|
10412
|
-
var b = "" +
|
|
10413
|
-
return
|
|
10446
|
+
function O(a) {
|
|
10447
|
+
if (!p(a, 2)) return "";
|
|
10448
|
+
var b = "" + q(a, 2);
|
|
10449
|
+
return p(a, 4) && q(a, 4) && u(a, 8) > 0 ? Array(u(a, 8) + 1).join("0") + b : b;
|
|
10414
10450
|
}
|
|
10415
|
-
function
|
|
10451
|
+
function $a(a, b, c, d) {
|
|
10416
10452
|
switch (b) {
|
|
10417
10453
|
case 0:
|
|
10418
10454
|
return "+" + a + c + d;
|
|
@@ -10424,83 +10460,83 @@ var _scope = {};
|
|
|
10424
10460
|
return c + d;
|
|
10425
10461
|
}
|
|
10426
10462
|
}
|
|
10427
|
-
function
|
|
10463
|
+
function S(a, b) {
|
|
10428
10464
|
switch (b) {
|
|
10429
10465
|
case 4:
|
|
10430
|
-
return
|
|
10466
|
+
return q(a, 5);
|
|
10431
10467
|
case 3:
|
|
10432
|
-
return
|
|
10468
|
+
return q(a, 4);
|
|
10433
10469
|
case 1:
|
|
10434
|
-
return
|
|
10470
|
+
return q(a, 3);
|
|
10435
10471
|
case 0:
|
|
10436
10472
|
case 2:
|
|
10437
|
-
return
|
|
10473
|
+
return q(a, 2);
|
|
10438
10474
|
case 5:
|
|
10439
|
-
return
|
|
10475
|
+
return q(a, 6);
|
|
10440
10476
|
case 6:
|
|
10441
|
-
return
|
|
10477
|
+
return q(a, 8);
|
|
10442
10478
|
case 7:
|
|
10443
|
-
return
|
|
10479
|
+
return q(a, 7);
|
|
10444
10480
|
case 8:
|
|
10445
|
-
return
|
|
10481
|
+
return q(a, 21);
|
|
10446
10482
|
case 9:
|
|
10447
|
-
return
|
|
10483
|
+
return q(a, 25);
|
|
10448
10484
|
case 10:
|
|
10449
|
-
return
|
|
10485
|
+
return q(a, 28);
|
|
10450
10486
|
default:
|
|
10451
|
-
return
|
|
10487
|
+
return q(a, 1);
|
|
10452
10488
|
}
|
|
10453
10489
|
}
|
|
10454
|
-
function
|
|
10455
|
-
var c =
|
|
10456
|
-
a =
|
|
10490
|
+
function ab(a, b) {
|
|
10491
|
+
var c = bb(a, b);
|
|
10492
|
+
a = P(a, u(b, 1), c);
|
|
10457
10493
|
if (a == null) return -1;
|
|
10458
|
-
b =
|
|
10459
|
-
return
|
|
10494
|
+
b = O(b);
|
|
10495
|
+
return cb(b, a);
|
|
10460
10496
|
}
|
|
10461
|
-
function
|
|
10462
|
-
return
|
|
10497
|
+
function cb(a, b) {
|
|
10498
|
+
return T(a, q(b, 1)) ? T(a, q(b, 5)) ? 4 : T(a, q(b, 4)) ? 3 : T(a, q(b, 6)) ? 5 : T(a, q(b, 8)) ? 6 : T(a, q(b, 7)) ? 7 : T(a, q(b, 21)) ? 8 : T(a, q(b, 25)) ? 9 : T(a, q(b, 28)) ? 10 : T(a, q(b, 2)) ? q(b, 18) || T(a, q(b, 3)) ? 2 : 0 : !q(b, 18) && T(a, q(b, 3)) ? 1 : -1 : -1;
|
|
10463
10499
|
}
|
|
10464
|
-
function
|
|
10500
|
+
function R(a, b) {
|
|
10465
10501
|
if (b == null) return null;
|
|
10466
10502
|
b = b.toUpperCase();
|
|
10467
10503
|
var c = a.g[b];
|
|
10468
10504
|
if (c == null) {
|
|
10469
|
-
c =
|
|
10505
|
+
c = Ea[b];
|
|
10470
10506
|
if (c == null) return null;
|
|
10471
|
-
c = new
|
|
10507
|
+
c = new z().g(F.m(), c);
|
|
10472
10508
|
a.g[b] = c;
|
|
10473
10509
|
}
|
|
10474
10510
|
return c;
|
|
10475
10511
|
}
|
|
10476
|
-
function
|
|
10512
|
+
function T(a, b) {
|
|
10477
10513
|
var c = a.length;
|
|
10478
|
-
return
|
|
10514
|
+
return v(b, 9) > 0 && E(b).indexOf(c) == -1 ? false : L(u(b, 2), a);
|
|
10479
10515
|
}
|
|
10480
|
-
function
|
|
10481
|
-
var c =
|
|
10482
|
-
var d =
|
|
10483
|
-
var e =
|
|
10484
|
-
e == null || "001" != c && d !=
|
|
10516
|
+
function db(a, b) {
|
|
10517
|
+
var c = bb(a, b);
|
|
10518
|
+
var d = u(b, 1);
|
|
10519
|
+
var e = P(a, d, c);
|
|
10520
|
+
e == null || "001" != c && d != eb(a, c) ? e = false : (a = O(b), e = cb(a, e) != -1);
|
|
10485
10521
|
return e;
|
|
10486
10522
|
}
|
|
10487
|
-
function
|
|
10523
|
+
function bb(a, b) {
|
|
10488
10524
|
if (b == null) return null;
|
|
10489
|
-
var c =
|
|
10490
|
-
c =
|
|
10525
|
+
var c = u(b, 1);
|
|
10526
|
+
c = H[c];
|
|
10491
10527
|
if (c == null) a = null;
|
|
10492
10528
|
else if (c.length == 1) a = c[0];
|
|
10493
10529
|
else a: {
|
|
10494
|
-
b =
|
|
10530
|
+
b = O(b);
|
|
10495
10531
|
for (var d, e = c.length, f = 0; f < e; f++) {
|
|
10496
10532
|
d = c[f];
|
|
10497
|
-
var g =
|
|
10498
|
-
if (
|
|
10499
|
-
if (b.search(
|
|
10533
|
+
var g = R(a, d);
|
|
10534
|
+
if (p(g, 23)) {
|
|
10535
|
+
if (b.search(q(g, 23)) == 0) {
|
|
10500
10536
|
a = d;
|
|
10501
10537
|
break a;
|
|
10502
10538
|
}
|
|
10503
|
-
} else if (
|
|
10539
|
+
} else if (cb(b, g) != -1) {
|
|
10504
10540
|
a = d;
|
|
10505
10541
|
break a;
|
|
10506
10542
|
}
|
|
@@ -10509,93 +10545,93 @@ var _scope = {};
|
|
|
10509
10545
|
}
|
|
10510
10546
|
return a;
|
|
10511
10547
|
}
|
|
10512
|
-
function
|
|
10513
|
-
a =
|
|
10548
|
+
function Q(a) {
|
|
10549
|
+
a = H[a];
|
|
10514
10550
|
return a == null ? "ZZ" : a[0];
|
|
10515
10551
|
}
|
|
10516
|
-
function
|
|
10517
|
-
a =
|
|
10552
|
+
function eb(a, b) {
|
|
10553
|
+
a = R(a, b);
|
|
10518
10554
|
if (a == null) throw Error("Invalid region code: " + b);
|
|
10519
|
-
return
|
|
10555
|
+
return u(a, 10);
|
|
10520
10556
|
}
|
|
10521
|
-
function
|
|
10522
|
-
var e =
|
|
10523
|
-
e =
|
|
10524
|
-
if (d == 2) if (
|
|
10525
|
-
else return
|
|
10557
|
+
function U(a, b, c, d) {
|
|
10558
|
+
var e = S(c, d), f = v(e, 9) == 0 ? E(q(c, 1)) : E(e);
|
|
10559
|
+
e = t(e, 10) || [];
|
|
10560
|
+
if (d == 2) if (Ya(S(c, 0))) a = S(c, 1), Ya(a) && (f = f.concat(v(a, 9) == 0 ? E(q(c, 1)) : E(a)), f.sort(), e.length == 0 ? e = t(a, 10) || [] : (e = e.concat(t(a, 10) || []), e.sort()));
|
|
10561
|
+
else return U(a, b, c, 1);
|
|
10526
10562
|
if (f[0] == -1) return 5;
|
|
10527
10563
|
b = b.length;
|
|
10528
10564
|
if (e.indexOf(b) > -1) return 4;
|
|
10529
10565
|
c = f[0];
|
|
10530
10566
|
return c == b ? 0 : c > b ? 2 : f[f.length - 1] < b ? 3 : f.indexOf(b, 1) > -1 ? 0 : 5;
|
|
10531
10567
|
}
|
|
10532
|
-
function
|
|
10533
|
-
var d =
|
|
10534
|
-
b =
|
|
10535
|
-
if (!(b in
|
|
10536
|
-
b =
|
|
10537
|
-
return
|
|
10568
|
+
function V(a, b, c) {
|
|
10569
|
+
var d = O(b);
|
|
10570
|
+
b = u(b, 1);
|
|
10571
|
+
if (!(b in H)) return 1;
|
|
10572
|
+
b = P(a, b, Q(b));
|
|
10573
|
+
return U(a, d, b, c);
|
|
10538
10574
|
}
|
|
10539
|
-
function
|
|
10575
|
+
function fb(a, b) {
|
|
10540
10576
|
a = a.toString();
|
|
10541
10577
|
if (a.length == 0 || a.charAt(0) == "0") return 0;
|
|
10542
|
-
for (var c, d = a.length, e = 1; e <= 3 && e <= d; ++e) if (c = parseInt(a.substring(0, e), 10), c in
|
|
10578
|
+
for (var c, d = a.length, e = 1; e <= 3 && e <= d; ++e) if (c = parseInt(a.substring(0, e), 10), c in H) return b.g(a.substring(e)), c;
|
|
10543
10579
|
return 0;
|
|
10544
10580
|
}
|
|
10545
|
-
function
|
|
10581
|
+
function gb(a, b, c, d, e, f) {
|
|
10546
10582
|
if (b.length == 0) return 0;
|
|
10547
|
-
b = new
|
|
10583
|
+
b = new A(b);
|
|
10548
10584
|
var g;
|
|
10549
|
-
c != null && (g =
|
|
10585
|
+
c != null && (g = q(c, 11));
|
|
10550
10586
|
g == null && (g = "NonMatch");
|
|
10551
10587
|
var h = b.toString();
|
|
10552
10588
|
if (h.length == 0) g = 20;
|
|
10553
|
-
else if (
|
|
10589
|
+
else if (J.test(h)) h = h.replace(J, ""), B(b), b.g(Wa(h)), g = 1;
|
|
10554
10590
|
else {
|
|
10555
10591
|
h = new RegExp(g);
|
|
10556
|
-
|
|
10592
|
+
Xa(b);
|
|
10557
10593
|
g = b.toString();
|
|
10558
10594
|
if (g.search(h) == 0) {
|
|
10559
10595
|
h = g.match(h)[0].length;
|
|
10560
|
-
var l = g.substring(h).match(
|
|
10561
|
-
l && l[1] != null && l[1].length > 0 &&
|
|
10596
|
+
var l = g.substring(h).match(Ja);
|
|
10597
|
+
l && l[1] != null && l[1].length > 0 && M(l[1], Fa) == "0" ? g = false : (B(b), b.g(g.substring(h)), g = true);
|
|
10562
10598
|
} else g = false;
|
|
10563
10599
|
g = g ? 5 : 20;
|
|
10564
10600
|
}
|
|
10565
|
-
e &&
|
|
10601
|
+
e && r(f, 6, g);
|
|
10566
10602
|
if (g != 20) {
|
|
10567
10603
|
if (b.h.length <= 2) throw Error("Phone number too short after IDD");
|
|
10568
|
-
a =
|
|
10569
|
-
if (a != 0) return
|
|
10604
|
+
a = fb(b, d);
|
|
10605
|
+
if (a != 0) return r(f, 1, a), a;
|
|
10570
10606
|
throw Error("Invalid country calling code");
|
|
10571
10607
|
}
|
|
10572
|
-
if (c != null && (g =
|
|
10573
|
-
|
|
10608
|
+
if (c != null && (g = u(c, 10), h = "" + g, l = b.toString(), l.lastIndexOf(h, 0) == 0 && (h = new A(l.substring(h.length)), l = q(c, 1), l = new RegExp(u(l, 2)), hb(h, c, null), h = h.toString(), !L(l, b.toString()) && L(l, h) || U(a, b.toString(), c, -1) == 3))) return d.g(h), e && r(f, 6, 10), r(f, 1, g), g;
|
|
10609
|
+
r(f, 1, 0);
|
|
10574
10610
|
return 0;
|
|
10575
10611
|
}
|
|
10576
|
-
function
|
|
10577
|
-
var d = a.toString(), e = d.length, f =
|
|
10612
|
+
function hb(a, b, c) {
|
|
10613
|
+
var d = a.toString(), e = d.length, f = q(b, 15);
|
|
10578
10614
|
if (e != 0 && f != null && f.length != 0 && (f = new RegExp("^(?:" + f + ")"), e = f.exec(d))) {
|
|
10579
10615
|
var g = RegExp;
|
|
10580
|
-
var h =
|
|
10581
|
-
h =
|
|
10616
|
+
var h = q(b, 1);
|
|
10617
|
+
h = u(h, 2);
|
|
10582
10618
|
g = new g(h);
|
|
10583
|
-
h =
|
|
10619
|
+
h = L(g, d);
|
|
10584
10620
|
var l = e.length - 1;
|
|
10585
|
-
b =
|
|
10621
|
+
b = q(b, 16);
|
|
10586
10622
|
if (b == null || b.length == 0 || e[l] == null || e[l].length == 0) {
|
|
10587
|
-
if (!h ||
|
|
10588
|
-
} else if (d = d.replace(f, b), !h ||
|
|
10623
|
+
if (!h || L(g, d.substring(e[0].length))) c != null && l > 0 && e[l] != null && c.g(e[1]), a.set(d.substring(e[0].length));
|
|
10624
|
+
} else if (d = d.replace(f, b), !h || L(g, d)) c != null && l > 0 && c.g(e[1]), a.set(d);
|
|
10589
10625
|
}
|
|
10590
10626
|
}
|
|
10591
|
-
function
|
|
10592
|
-
if (!
|
|
10593
|
-
return
|
|
10627
|
+
function W(a, b, c) {
|
|
10628
|
+
if (!N(c) && b.length > 0 && b.charAt(0) != "+") throw Error("Invalid country calling code");
|
|
10629
|
+
return ib(a, b, c, true);
|
|
10594
10630
|
}
|
|
10595
|
-
function
|
|
10631
|
+
function ib(a, b, c, d) {
|
|
10596
10632
|
if (b == null) throw Error("The string supplied did not seem to be a phone number");
|
|
10597
10633
|
if (b.length > 250) throw Error("The string supplied is too long to be a phone number");
|
|
10598
|
-
var e = new
|
|
10634
|
+
var e = new A();
|
|
10599
10635
|
var f = b.indexOf(";phone-context=");
|
|
10600
10636
|
if (f === -1) f = null;
|
|
10601
10637
|
else if (f += 15, f >= b.length) f = "";
|
|
@@ -10604,126 +10640,126 @@ var _scope = {};
|
|
|
10604
10640
|
f = g !== -1 ? b.substring(f, g) : b.substring(f);
|
|
10605
10641
|
}
|
|
10606
10642
|
var h = f;
|
|
10607
|
-
h == null ? g = true : h.length === 0 ? g = false : (g =
|
|
10643
|
+
h == null ? g = true : h.length === 0 ? g = false : (g = Oa.exec(h), h = Pa.exec(h), g = g !== null || h !== null);
|
|
10608
10644
|
if (!g) throw Error("The string supplied did not seem to be a phone number");
|
|
10609
|
-
f != null ? (f.charAt(0) === "+" && e.g(f), f = b.indexOf("tel:"), e.g(b.substring(f >= 0 ? f + 4 : 0, b.indexOf(";phone-context=")))) : (f = e.g, g = b ?? "", h = g.search(
|
|
10645
|
+
f != null ? (f.charAt(0) === "+" && e.g(f), f = b.indexOf("tel:"), e.g(b.substring(f >= 0 ? f + 4 : 0, b.indexOf(";phone-context=")))) : (f = e.g, g = b ?? "", h = g.search(Ka), h >= 0 ? (g = g.substring(h), g = g.replace(Ma, ""), h = g.search(La), h >= 0 && (g = g.substring(0, h))) : g = "", f.call(e, g));
|
|
10610
10646
|
f = e.toString();
|
|
10611
10647
|
g = f.indexOf(";isub=");
|
|
10612
|
-
g > 0 && (
|
|
10613
|
-
if (!
|
|
10648
|
+
g > 0 && (B(e), e.g(f.substring(0, g)));
|
|
10649
|
+
if (!Va(e.toString())) throw Error("The string supplied did not seem to be a phone number");
|
|
10614
10650
|
f = e.toString();
|
|
10615
|
-
if (!(
|
|
10616
|
-
f = new
|
|
10617
|
-
d &&
|
|
10651
|
+
if (!(N(c) || f != null && f.length > 0 && J.test(f))) throw Error("Invalid country calling code");
|
|
10652
|
+
f = new G();
|
|
10653
|
+
d && r(f, 5, b);
|
|
10618
10654
|
a: {
|
|
10619
10655
|
b = e.toString();
|
|
10620
|
-
g = b.search(
|
|
10621
|
-
if (g >= 0 &&
|
|
10622
|
-
h = b.match(
|
|
10623
|
-
for (var l = h.length,
|
|
10624
|
-
|
|
10656
|
+
g = b.search(Ra);
|
|
10657
|
+
if (g >= 0 && Va(b.substring(0, g))) {
|
|
10658
|
+
h = b.match(Ra);
|
|
10659
|
+
for (var l = h.length, y = 1; y < l; ++y) if (h[y] != null && h[y].length > 0) {
|
|
10660
|
+
B(e);
|
|
10625
10661
|
e.g(b.substring(0, g));
|
|
10626
|
-
b = h[
|
|
10662
|
+
b = h[y];
|
|
10627
10663
|
break a;
|
|
10628
10664
|
}
|
|
10629
10665
|
}
|
|
10630
10666
|
b = "";
|
|
10631
10667
|
}
|
|
10632
|
-
b.length > 0 &&
|
|
10633
|
-
g =
|
|
10634
|
-
b = new
|
|
10668
|
+
b.length > 0 && r(f, 3, b);
|
|
10669
|
+
g = R(a, c);
|
|
10670
|
+
b = new A();
|
|
10635
10671
|
h = 0;
|
|
10636
10672
|
l = e.toString();
|
|
10637
10673
|
try {
|
|
10638
|
-
h =
|
|
10639
|
-
} catch (
|
|
10640
|
-
if (
|
|
10641
|
-
if (l = l.replace(
|
|
10642
|
-
} else throw
|
|
10674
|
+
h = gb(a, l, g, b, d, f);
|
|
10675
|
+
} catch (Y) {
|
|
10676
|
+
if (Y.message == "Invalid country calling code" && J.test(l)) {
|
|
10677
|
+
if (l = l.replace(J, ""), h = gb(a, l, g, b, d, f), h == 0) throw Y;
|
|
10678
|
+
} else throw Y;
|
|
10643
10679
|
}
|
|
10644
|
-
h != 0 ? (e =
|
|
10680
|
+
h != 0 ? (e = Q(h), e != c && (g = P(a, h, e))) : (Xa(e), b.g(e.toString()), c != null ? (h = u(g, 10), r(
|
|
10645
10681
|
f,
|
|
10646
10682
|
1,
|
|
10647
10683
|
h
|
|
10648
10684
|
)) : d && (delete f.h[6], f.g && delete f.g[6]));
|
|
10649
10685
|
if (b.h.length < 2) throw Error("The string supplied is too short to be a phone number");
|
|
10650
|
-
g != null && (c = new
|
|
10686
|
+
g != null && (c = new A(), e = new A(b.toString()), hb(e, g, c), a = U(a, e.toString(), g, -1), a != 2 && a != 4 && a != 5 && (b = e, d && c.toString().length > 0 && r(f, 7, c.toString())));
|
|
10651
10687
|
d = b.toString();
|
|
10652
10688
|
a = d.length;
|
|
10653
10689
|
if (a < 2) throw Error("The string supplied is too short to be a phone number");
|
|
10654
10690
|
if (a > 17) throw Error("The string supplied is too long to be a phone number");
|
|
10655
10691
|
if (d.length > 1 && d.charAt(0) == "0") {
|
|
10656
|
-
|
|
10692
|
+
r(f, 4, true);
|
|
10657
10693
|
for (a = 1; a < d.length - 1 && d.charAt(a) == "0"; ) a++;
|
|
10658
|
-
a != 1 &&
|
|
10694
|
+
a != 1 && r(f, 8, a);
|
|
10659
10695
|
}
|
|
10660
|
-
|
|
10696
|
+
r(f, 2, parseInt(d, 10));
|
|
10661
10697
|
return f;
|
|
10662
10698
|
}
|
|
10663
|
-
function
|
|
10699
|
+
function L(a, b) {
|
|
10664
10700
|
return (a = b.match(new RegExp("^(?:" + (typeof a == "string" ? a : a.source) + ")$", "i"))) && a[0].length == b.length ? true : false;
|
|
10665
10701
|
}
|
|
10666
10702
|
;
|
|
10667
|
-
function
|
|
10703
|
+
function jb(a) {
|
|
10668
10704
|
this.ga = RegExp("\u2008");
|
|
10669
10705
|
this.ka = "";
|
|
10670
|
-
this.$ = new
|
|
10706
|
+
this.$ = new A();
|
|
10671
10707
|
this.ea = "";
|
|
10672
|
-
this.u = new
|
|
10673
|
-
this.da = new
|
|
10708
|
+
this.u = new A();
|
|
10709
|
+
this.da = new A();
|
|
10674
10710
|
this.v = true;
|
|
10675
10711
|
this.fa = this.aa = this.ma = false;
|
|
10676
|
-
this.ha =
|
|
10712
|
+
this.ha = I.g();
|
|
10677
10713
|
this.ba = 0;
|
|
10678
|
-
this.h = new
|
|
10714
|
+
this.h = new A();
|
|
10679
10715
|
this.ia = false;
|
|
10680
10716
|
this.o = "";
|
|
10681
|
-
this.g = new
|
|
10717
|
+
this.g = new A();
|
|
10682
10718
|
this.j = [];
|
|
10683
10719
|
this.la = a;
|
|
10684
|
-
this.l =
|
|
10720
|
+
this.l = kb(this, this.la);
|
|
10685
10721
|
}
|
|
10686
|
-
var
|
|
10687
|
-
|
|
10688
|
-
var
|
|
10689
|
-
function
|
|
10722
|
+
var lb = new F();
|
|
10723
|
+
r(lb, 11, "NA");
|
|
10724
|
+
var mb = RegExp("^[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E]*\\$1[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E]*(\\$\\d[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E]*)*$"), nb = /[- ]/;
|
|
10725
|
+
function kb(a, b) {
|
|
10690
10726
|
var c = a.ha;
|
|
10691
|
-
b =
|
|
10692
|
-
a =
|
|
10693
|
-
return a != null ? a :
|
|
10727
|
+
b = N(b) ? eb(c, b) : 0;
|
|
10728
|
+
a = R(a.ha, Q(b));
|
|
10729
|
+
return a != null ? a : lb;
|
|
10694
10730
|
}
|
|
10695
|
-
function
|
|
10731
|
+
function ob(a) {
|
|
10696
10732
|
for (var b = a.j.length, c = 0; c < b; ++c) {
|
|
10697
|
-
var d = a.j[c], e =
|
|
10733
|
+
var d = a.j[c], e = u(d, 1);
|
|
10698
10734
|
if (a.ea == e) return false;
|
|
10699
10735
|
var f = a;
|
|
10700
|
-
var g = d, h =
|
|
10701
|
-
|
|
10736
|
+
var g = d, h = u(g, 1);
|
|
10737
|
+
B(f.$);
|
|
10702
10738
|
var l = f;
|
|
10703
|
-
g =
|
|
10704
|
-
var
|
|
10705
|
-
|
|
10739
|
+
g = u(g, 2);
|
|
10740
|
+
var y = "999999999999999".match(h)[0];
|
|
10741
|
+
y.length < l.g.h.length ? l = "" : (l = y.replace(new RegExp(h, "g"), g), l = l.replace(RegExp("9", "g"), "\u2008"));
|
|
10706
10742
|
l.length > 0 ? (f.$.g(l), f = true) : f = false;
|
|
10707
|
-
if (f) return a.ea = e, a.ia =
|
|
10743
|
+
if (f) return a.ea = e, a.ia = nb.test(q(d, 4)), a.ba = 0, true;
|
|
10708
10744
|
}
|
|
10709
10745
|
return a.v = false;
|
|
10710
10746
|
}
|
|
10711
|
-
function
|
|
10747
|
+
function pb(a, b) {
|
|
10712
10748
|
for (var c = [], d = b.length - 3, e = a.j.length, f = 0; f < e; ++f) {
|
|
10713
10749
|
var g = a.j[f];
|
|
10714
|
-
|
|
10750
|
+
v(g, 3) == 0 ? c.push(a.j[f]) : (g = q(g, 3, Math.min(d, v(g, 3) - 1)), b.search(g) == 0 && c.push(a.j[f]));
|
|
10715
10751
|
}
|
|
10716
10752
|
a.j = c;
|
|
10717
10753
|
}
|
|
10718
|
-
function
|
|
10754
|
+
function qb(a, b) {
|
|
10719
10755
|
a.u.g(b);
|
|
10720
10756
|
var c = b;
|
|
10721
|
-
|
|
10757
|
+
Ja.test(c) || a.u.h.length == 1 && Ia.test(c) ? (b == "+" ? (c = b, a.da.g(b)) : (c = Fa[b], a.da.g(c), a.g.g(c)), b = c) : (a.v = false, a.ma = true);
|
|
10722
10758
|
if (!a.v) {
|
|
10723
10759
|
if (!a.ma) {
|
|
10724
|
-
if (
|
|
10725
|
-
if (
|
|
10726
|
-
} else if (a.o.length > 0 && (b = a.g.toString(),
|
|
10760
|
+
if (rb(a)) {
|
|
10761
|
+
if (sb(a)) return tb(a);
|
|
10762
|
+
} else if (a.o.length > 0 && (b = a.g.toString(), B(a.g), a.g.g(a.o), a.g.g(b), b = a.h.toString(), c = b.lastIndexOf(a.o), B(a.h), a.h.g(b.substring(0, c))), a.o != ub(a)) return a.h.g(" "), tb(a);
|
|
10727
10763
|
}
|
|
10728
10764
|
return a.u.toString();
|
|
10729
10765
|
}
|
|
@@ -10733,93 +10769,93 @@ var _scope = {};
|
|
|
10733
10769
|
case 2:
|
|
10734
10770
|
return a.u.toString();
|
|
10735
10771
|
case 3:
|
|
10736
|
-
if (
|
|
10737
|
-
else return a.o =
|
|
10772
|
+
if (rb(a)) a.fa = true;
|
|
10773
|
+
else return a.o = ub(a), vb(a);
|
|
10738
10774
|
default:
|
|
10739
|
-
if (a.fa) return
|
|
10775
|
+
if (a.fa) return sb(a) && (a.fa = false), a.h.toString() + a.g.toString();
|
|
10740
10776
|
if (a.j.length > 0) {
|
|
10741
|
-
b =
|
|
10742
|
-
c =
|
|
10777
|
+
b = wb(a, b);
|
|
10778
|
+
c = xb(a);
|
|
10743
10779
|
if (c.length > 0) return c;
|
|
10744
|
-
|
|
10745
|
-
return
|
|
10780
|
+
pb(a, a.g.toString());
|
|
10781
|
+
return ob(a) ? yb(a) : a.v ? X(a, b) : a.u.toString();
|
|
10746
10782
|
}
|
|
10747
|
-
return
|
|
10783
|
+
return vb(a);
|
|
10748
10784
|
}
|
|
10749
10785
|
}
|
|
10750
|
-
function
|
|
10786
|
+
function tb(a) {
|
|
10751
10787
|
a.v = true;
|
|
10752
10788
|
a.fa = false;
|
|
10753
10789
|
a.j = [];
|
|
10754
10790
|
a.ba = 0;
|
|
10755
|
-
|
|
10791
|
+
B(a.$);
|
|
10756
10792
|
a.ea = "";
|
|
10757
|
-
return
|
|
10793
|
+
return vb(a);
|
|
10758
10794
|
}
|
|
10759
|
-
function
|
|
10795
|
+
function xb(a) {
|
|
10760
10796
|
for (var b = a.g.toString(), c = a.j.length, d = 0; d < c; ++d) {
|
|
10761
|
-
var e = a.j[d], f =
|
|
10762
|
-
if (new RegExp("^(?:" + f + ")$").test(b) && (a.ia =
|
|
10797
|
+
var e = a.j[d], f = u(e, 1);
|
|
10798
|
+
if (new RegExp("^(?:" + f + ")$").test(b) && (a.ia = nb.test(q(e, 4)), e = b.replace(new RegExp(f, "g"), q(e, 2)), e = X(a, e), M(e, Ga) == a.da)) return e;
|
|
10763
10799
|
}
|
|
10764
10800
|
return "";
|
|
10765
10801
|
}
|
|
10766
|
-
function
|
|
10802
|
+
function X(a, b) {
|
|
10767
10803
|
var c = a.h.h.length;
|
|
10768
10804
|
return a.ia && c > 0 && a.h.toString().charAt(c - 1) != " " ? a.h + " " + b : a.h + b;
|
|
10769
10805
|
}
|
|
10770
|
-
function
|
|
10806
|
+
function vb(a) {
|
|
10771
10807
|
var b = a.g.toString();
|
|
10772
10808
|
if (b.length >= 3) {
|
|
10773
|
-
for (var c = a.aa && a.o.length == 0 &&
|
|
10809
|
+
for (var c = a.aa && a.o.length == 0 && v(a.l, 20) > 0 ? t(a.l, 20) || [] : t(a.l, 19) || [], d = c.length, e = 0; e < d; ++e) {
|
|
10774
10810
|
var f = c[e];
|
|
10775
|
-
a.o.length > 0 &&
|
|
10811
|
+
a.o.length > 0 && Za(u(f, 4)) && !q(f, 6) && !p(f, 5) || (a.o.length != 0 || a.aa || Za(u(f, 4)) || q(f, 6)) && mb.test(u(f, 2)) && a.j.push(f);
|
|
10776
10812
|
}
|
|
10777
|
-
|
|
10778
|
-
b =
|
|
10779
|
-
return b.length > 0 ? b :
|
|
10813
|
+
pb(a, b);
|
|
10814
|
+
b = xb(a);
|
|
10815
|
+
return b.length > 0 ? b : ob(a) ? yb(a) : a.u.toString();
|
|
10780
10816
|
}
|
|
10781
|
-
return
|
|
10817
|
+
return X(a, b);
|
|
10782
10818
|
}
|
|
10783
|
-
function
|
|
10819
|
+
function yb(a) {
|
|
10784
10820
|
var b = a.g.toString(), c = b.length;
|
|
10785
10821
|
if (c > 0) {
|
|
10786
|
-
for (var d = "", e = 0; e < c; e++) d =
|
|
10787
|
-
return a.v ?
|
|
10822
|
+
for (var d = "", e = 0; e < c; e++) d = wb(a, b.charAt(e));
|
|
10823
|
+
return a.v ? X(a, d) : a.u.toString();
|
|
10788
10824
|
}
|
|
10789
10825
|
return a.h.toString();
|
|
10790
10826
|
}
|
|
10791
|
-
function
|
|
10827
|
+
function ub(a) {
|
|
10792
10828
|
var b = a.g.toString(), c = 0;
|
|
10793
|
-
if (
|
|
10829
|
+
if (q(a.l, 10) != 1) var d = false;
|
|
10794
10830
|
else d = a.g.toString(), d = d.charAt(0) == "1" && d.charAt(1) != "0" && d.charAt(1) != "1";
|
|
10795
|
-
d ? (c = 1, a.h.g("1").g(" "), a.aa = true) :
|
|
10796
|
-
|
|
10831
|
+
d ? (c = 1, a.h.g("1").g(" "), a.aa = true) : p(a.l, 15) && (d = new RegExp("^(?:" + q(a.l, 15) + ")"), d = b.match(d), d != null && d[0] != null && d[0].length > 0 && (a.aa = true, c = d[0].length, a.h.g(b.substring(0, c))));
|
|
10832
|
+
B(a.g);
|
|
10797
10833
|
a.g.g(b.substring(c));
|
|
10798
10834
|
return b.substring(0, c);
|
|
10799
10835
|
}
|
|
10800
|
-
function
|
|
10801
|
-
var b = a.da.toString(), c = new RegExp("^(?:\\+|" +
|
|
10836
|
+
function rb(a) {
|
|
10837
|
+
var b = a.da.toString(), c = new RegExp("^(?:\\+|" + q(a.l, 11) + ")");
|
|
10802
10838
|
c = b.match(c);
|
|
10803
|
-
return c != null && c[0] != null && c[0].length > 0 ? (a.aa = true, c = c[0].length,
|
|
10839
|
+
return c != null && c[0] != null && c[0].length > 0 ? (a.aa = true, c = c[0].length, B(a.g), a.g.g(b.substring(c)), B(a.h), a.h.g(b.substring(0, c)), b.charAt(0) != "+" && a.h.g(" "), true) : false;
|
|
10804
10840
|
}
|
|
10805
|
-
function
|
|
10841
|
+
function sb(a) {
|
|
10806
10842
|
if (a.g.h.length == 0) return false;
|
|
10807
|
-
var b = new
|
|
10843
|
+
var b = new A(), c = fb(a.g, b);
|
|
10808
10844
|
if (c == 0) return false;
|
|
10809
|
-
|
|
10845
|
+
B(a.g);
|
|
10810
10846
|
a.g.g(b.toString());
|
|
10811
|
-
b =
|
|
10812
|
-
"001" == b ? a.l =
|
|
10847
|
+
b = Q(c);
|
|
10848
|
+
"001" == b ? a.l = R(a.ha, "" + c) : b != a.la && (a.l = kb(a, b));
|
|
10813
10849
|
a.h.g("" + c).g(" ");
|
|
10814
10850
|
a.o = "";
|
|
10815
10851
|
return true;
|
|
10816
10852
|
}
|
|
10817
|
-
function
|
|
10853
|
+
function wb(a, b) {
|
|
10818
10854
|
var c = a.$.toString();
|
|
10819
10855
|
if (c.substring(a.ba).search(a.ga) >= 0) {
|
|
10820
10856
|
var d = c.search(a.ga);
|
|
10821
10857
|
b = c.replace(a.ga, b);
|
|
10822
|
-
|
|
10858
|
+
B(a.$);
|
|
10823
10859
|
a.$.g(b);
|
|
10824
10860
|
a.ba = d;
|
|
10825
10861
|
return b.substring(0, a.ba + 1);
|
|
@@ -10829,119 +10865,137 @@ var _scope = {};
|
|
|
10829
10865
|
return a.u.toString();
|
|
10830
10866
|
}
|
|
10831
10867
|
;
|
|
10832
|
-
const
|
|
10868
|
+
const zb = {};
|
|
10869
|
+
["E164", "INTERNATIONAL", "NATIONAL", "RFC3966"].forEach((a, b) => {
|
|
10870
|
+
zb[a] = b;
|
|
10871
|
+
});
|
|
10872
|
+
const Z = {};
|
|
10873
|
+
"FIXED_LINE MOBILE FIXED_LINE_OR_MOBILE TOLL_FREE PREMIUM_RATE SHARED_COST VOIP PERSONAL_NUMBER PAGER UAN VOICEMAIL UNKNOWN".split(" ").forEach((a, b) => {
|
|
10874
|
+
Z[a] = b;
|
|
10875
|
+
});
|
|
10876
|
+
Z.UNKNOWN = -1;
|
|
10877
|
+
const Ab = {};
|
|
10878
|
+
"IS_POSSIBLE INVALID_COUNTRY_CODE TOO_SHORT TOO_LONG IS_POSSIBLE_LOCAL_ONLY INVALID_LENGTH".split(" ").forEach((a, b) => {
|
|
10879
|
+
Ab[a] = b;
|
|
10880
|
+
});
|
|
10881
|
+
const Bb = {};
|
|
10882
|
+
Object.keys(Z).forEach((a) => {
|
|
10883
|
+
Bb[Z[a]] = a;
|
|
10884
|
+
});
|
|
10885
|
+
const Cb = {};
|
|
10886
|
+
Object.keys(Ab).forEach((a) => {
|
|
10887
|
+
Cb[Ab[a]] = a;
|
|
10888
|
+
});
|
|
10889
|
+
const Db = (a) => {
|
|
10833
10890
|
const b = [];
|
|
10834
10891
|
a.includes("FIXED_LINE_OR_MOBILE") ? (a.includes("MOBILE") || b.push("MOBILE"), a.includes("FIXED_LINE") || b.push("FIXED_LINE")) : (a.includes("MOBILE") || a.includes("FIXED_LINE")) && b.push("FIXED_LINE_OR_MOBILE");
|
|
10835
10892
|
return a.concat(b);
|
|
10836
|
-
}
|
|
10837
|
-
|
|
10838
|
-
|
|
10893
|
+
};
|
|
10894
|
+
k("utils", {});
|
|
10895
|
+
k("utils.formatNumberAsYouType", (a, b) => {
|
|
10839
10896
|
try {
|
|
10840
|
-
const c = a.replace(/[^+0-9]/g, ""), d = new
|
|
10897
|
+
const c = a.replace(/[^+0-9]/g, ""), d = new jb(b);
|
|
10841
10898
|
b = "";
|
|
10842
|
-
for (let e = 0; e < c.length; e++) d.ka =
|
|
10899
|
+
for (let e = 0; e < c.length; e++) d.ka = qb(d, c.charAt(e)), b = d.ka;
|
|
10843
10900
|
return b;
|
|
10844
10901
|
} catch {
|
|
10845
10902
|
return a;
|
|
10846
10903
|
}
|
|
10847
10904
|
});
|
|
10848
|
-
|
|
10905
|
+
k("utils.formatNumber", (a, b, c) => {
|
|
10849
10906
|
try {
|
|
10850
|
-
const e =
|
|
10851
|
-
var d =
|
|
10852
|
-
return d == 0 || d == 4 ? e.format(f, typeof c === "undefined" ? 0 : c) : a;
|
|
10907
|
+
const e = I.g(), f = W(e, a, b);
|
|
10908
|
+
var d = V(e, f, -1);
|
|
10909
|
+
return d == 0 || d == 4 ? e.format(f, typeof c === "undefined" ? 0 : zb[c]) : a;
|
|
10853
10910
|
} catch {
|
|
10854
10911
|
return a;
|
|
10855
10912
|
}
|
|
10856
10913
|
});
|
|
10857
|
-
|
|
10914
|
+
k("utils.getExampleNumber", (a, b, c, d) => {
|
|
10858
10915
|
try {
|
|
10859
|
-
const
|
|
10916
|
+
const y = I.g();
|
|
10860
10917
|
a: {
|
|
10861
|
-
var e =
|
|
10862
|
-
if (
|
|
10863
|
-
var
|
|
10918
|
+
var e = y, f = Z[c];
|
|
10919
|
+
if (N(a)) {
|
|
10920
|
+
var g = S(R(e, a), f);
|
|
10864
10921
|
try {
|
|
10865
|
-
if (
|
|
10866
|
-
var
|
|
10867
|
-
var
|
|
10922
|
+
if (p(g, 6)) {
|
|
10923
|
+
var h = q(g, 6);
|
|
10924
|
+
var l = ib(e, h, a, false);
|
|
10868
10925
|
break a;
|
|
10869
10926
|
}
|
|
10870
|
-
} catch (
|
|
10927
|
+
} catch (Y) {
|
|
10871
10928
|
}
|
|
10872
10929
|
}
|
|
10873
|
-
|
|
10930
|
+
l = null;
|
|
10874
10931
|
}
|
|
10875
|
-
return
|
|
10932
|
+
return y.format(l, d ? 0 : b ? 2 : 1);
|
|
10876
10933
|
} catch {
|
|
10877
10934
|
return "";
|
|
10878
10935
|
}
|
|
10879
10936
|
});
|
|
10880
|
-
|
|
10937
|
+
k("utils.getExtension", (a, b) => {
|
|
10881
10938
|
try {
|
|
10882
|
-
var c =
|
|
10883
|
-
return
|
|
10939
|
+
var c = W(I.g(), a, b);
|
|
10940
|
+
return q(c, 3);
|
|
10884
10941
|
} catch {
|
|
10885
10942
|
return "";
|
|
10886
10943
|
}
|
|
10887
10944
|
});
|
|
10888
|
-
|
|
10945
|
+
k("utils.getNumberType", (a, b) => {
|
|
10889
10946
|
try {
|
|
10890
|
-
const c =
|
|
10891
|
-
return
|
|
10947
|
+
const c = I.g(), d = W(c, a, b), e = ab(c, d);
|
|
10948
|
+
return Bb[e] || null;
|
|
10892
10949
|
} catch {
|
|
10893
|
-
return
|
|
10950
|
+
return null;
|
|
10894
10951
|
}
|
|
10895
10952
|
});
|
|
10896
|
-
|
|
10897
|
-
if (!b) return
|
|
10953
|
+
k("utils.getValidationError", (a, b) => {
|
|
10954
|
+
if (!b) return "INVALID_COUNTRY_CODE";
|
|
10898
10955
|
try {
|
|
10899
|
-
const c =
|
|
10900
|
-
return
|
|
10956
|
+
const c = I.g(), d = W(c, a, b), e = V(c, d, -1);
|
|
10957
|
+
return Cb[e] || null;
|
|
10901
10958
|
} catch (c) {
|
|
10902
|
-
return c.message === "Invalid country calling code" ?
|
|
10959
|
+
return c.message === "Invalid country calling code" ? "INVALID_COUNTRY_CODE" : a.length <= 3 || c.message === "Phone number too short after IDD" || c.message === "The string supplied is too short to be a phone number" ? "TOO_SHORT" : c.message === "The string supplied is too long to be a phone number" ? "TOO_LONG" : null;
|
|
10903
10960
|
}
|
|
10904
10961
|
});
|
|
10905
|
-
|
|
10962
|
+
k("utils.isValidNumber", (a, b, c) => {
|
|
10906
10963
|
try {
|
|
10907
|
-
const d =
|
|
10964
|
+
const d = I.g(), e = W(d, a, b), f = db(d, e);
|
|
10908
10965
|
if (c) {
|
|
10909
|
-
const g =
|
|
10910
|
-
return f && g.includes(
|
|
10966
|
+
const g = Db(c).map((h) => Z[h]);
|
|
10967
|
+
return f && g.includes(ab(d, e));
|
|
10911
10968
|
}
|
|
10912
10969
|
return f;
|
|
10913
10970
|
} catch {
|
|
10914
10971
|
return false;
|
|
10915
10972
|
}
|
|
10916
10973
|
});
|
|
10917
|
-
|
|
10974
|
+
k("utils.isPossibleNumber", (a, b, c) => {
|
|
10918
10975
|
try {
|
|
10919
|
-
const d =
|
|
10976
|
+
const d = I.g(), e = W(d, a, b);
|
|
10920
10977
|
if (c) {
|
|
10921
|
-
const f =
|
|
10922
|
-
for (let g of f) if (
|
|
10978
|
+
const f = Db(c);
|
|
10979
|
+
for (let g of f) if (V(d, e, Z[g]) === 0) return true;
|
|
10923
10980
|
return false;
|
|
10924
10981
|
}
|
|
10925
|
-
return
|
|
10982
|
+
return V(d, e, -1) === 0;
|
|
10926
10983
|
} catch {
|
|
10927
10984
|
return false;
|
|
10928
10985
|
}
|
|
10929
10986
|
});
|
|
10930
|
-
|
|
10987
|
+
k("utils.getCoreNumber", (a, b) => {
|
|
10931
10988
|
try {
|
|
10932
|
-
var c =
|
|
10933
|
-
return
|
|
10989
|
+
var c = W(I.g(), a, b);
|
|
10990
|
+
return q(c, 2).toString();
|
|
10934
10991
|
} catch {
|
|
10935
10992
|
return "";
|
|
10936
10993
|
}
|
|
10937
10994
|
});
|
|
10938
|
-
m("utils.numberFormat", { E164: 0, INTERNATIONAL: 1, NATIONAL: 2, RFC3966: 3 });
|
|
10939
|
-
m("utils.numberType", zb);
|
|
10940
|
-
m("utils.validationError", { IS_POSSIBLE: 0, INVALID_COUNTRY_CODE: 1, TOO_SHORT: 2, TOO_LONG: 3, IS_POSSIBLE_LOCAL_ONLY: 4, INVALID_LENGTH: 5 });
|
|
10941
10995
|
}).call(_scope);
|
|
10942
10996
|
var utils_default = _scope.utils;
|
|
10943
10997
|
|
|
10944
|
-
// src/js/intlTelInputWithUtils.ts
|
|
10998
|
+
// packages/core/src/js/intlTelInputWithUtils.ts
|
|
10945
10999
|
intlTelInput_default.utils = utils_default;
|
|
10946
11000
|
var intlTelInputWithUtils_default = intlTelInput_default;
|
|
10947
11001
|
export {
|