@caspeco/casper-ui-library 10.5.0 → 10.6.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/components/combobox/combobox-button.d.ts +1 -1
- package/dist/components/combobox/combobox-button.d.ts.map +1 -1
- package/dist/components/combobox/combobox-button.js +117 -83
- package/dist/components/combobox/combobox-recipe.d.ts.map +1 -1
- package/dist/components/combobox/combobox-recipe.js +16 -0
- package/dist/components/combobox/combobox.composition.d.ts.map +1 -1
- package/dist/components/combobox/translations.d.ts.map +1 -1
- package/dist/components/combobox/translations.js +6 -0
- package/dist/components/combobox/types.d.ts +1 -0
- package/dist/components/combobox/types.d.ts.map +1 -1
- package/dist/components/phone-input/country-data.d.ts +1 -1
- package/dist/components/phone-input/country-data.d.ts.map +1 -1
- package/dist/components/phone-input/country-data.js +2 -2
- package/dist/components/phone-input/country-list.d.ts +1 -1
- package/dist/components/phone-input/country-list.d.ts.map +1 -1
- package/dist/components/phone-input/country-list.js +1 -0
- package/dist/components/phone-input/country-selector.d.ts +1 -1
- package/dist/components/phone-input/country-selector.d.ts.map +1 -1
- package/dist/components/phone-input/phone-input-helpers.d.ts +1 -1
- package/dist/components/phone-input/phone-input-helpers.d.ts.map +1 -1
- package/dist/components/phone-input/phone-input-helpers.js +5 -5
- package/dist/components/phone-input/types.d.ts +1 -1
- package/dist/components/phone-input/types.d.ts.map +1 -1
- package/dist/components/phone-input/use-phone-input.d.ts +1 -1
- package/dist/components/phone-input/use-phone-input.d.ts.map +1 -1
- package/dist/components/phone-input/use-phone-input.js +1 -1
- package/dist/node_modules/libphonenumber-js/es6-modern/ParseError.js +8 -0
- package/dist/node_modules/libphonenumber-js/es6-modern/PhoneNumber.js +73 -0
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/constants.js +1 -1
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/format.js +22 -22
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/getCountries.js +1 -1
- package/dist/node_modules/libphonenumber-js/es6-modern/helpers/RFC3966.js +8 -0
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/helpers/applyInternationalSeparatorStyle.js +1 -1
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/helpers/checkNumberLength.js +6 -6
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/helpers/extension/createExtensionPattern.js +2 -4
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/helpers/extension/extractExtension.js +4 -3
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/helpers/extractCountryCallingCode.js +15 -14
- package/dist/node_modules/libphonenumber-js/es6-modern/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +21 -0
- package/dist/node_modules/libphonenumber-js/es6-modern/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +21 -0
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/helpers/extractNationalNumber.js +7 -7
- package/dist/node_modules/libphonenumber-js/es6-modern/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +27 -0
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/helpers/extractPhoneContext.js +4 -3
- package/dist/node_modules/libphonenumber-js/es6-modern/helpers/formatNationalNumberUsingFormat.js +9 -0
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/helpers/getCountryAndCallingCodeFromOneOfThem.js +2 -1
- package/dist/node_modules/libphonenumber-js/es6-modern/helpers/getCountryByCallingCode.js +8 -0
- package/dist/node_modules/libphonenumber-js/es6-modern/helpers/getCountryByNationalNumber.js +14 -0
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/helpers/getIddPrefix.js +2 -2
- package/dist/node_modules/libphonenumber-js/es6-modern/helpers/getNumberType.js +30 -0
- package/dist/node_modules/libphonenumber-js/es6-modern/helpers/getPossibleCountriesForNumber.js +12 -0
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/helpers/isCallingCode.js +1 -1
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/helpers/isCountryCode.js +1 -1
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/helpers/isObject.js +1 -1
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/helpers/isViablePhoneNumber.js +1 -1
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/helpers/matchesEntirely.js +1 -1
- package/dist/node_modules/libphonenumber-js/es6-modern/helpers/mergeArrays.js +8 -0
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/helpers/parseDigits.js +1 -1
- package/dist/node_modules/libphonenumber-js/es6-modern/helpers/stripIddPrefix.js +16 -0
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/isPossible.js +2 -2
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/isValid.js +3 -3
- package/dist/node_modules/libphonenumber-js/es6-modern/isValidPhoneNumber.js +20 -0
- package/dist/node_modules/libphonenumber-js/es6-modern/metadata.js +254 -0
- package/dist/node_modules/libphonenumber-js/es6-modern/normalizeArguments.js +26 -0
- package/dist/node_modules/libphonenumber-js/es6-modern/parse.js +100 -0
- package/dist/node_modules/libphonenumber-js/es6-modern/parseIncompletePhoneNumber.js +19 -0
- package/dist/node_modules/libphonenumber-js/es6-modern/parsePhoneNumber.js +9 -0
- package/dist/node_modules/libphonenumber-js/es6-modern/parsePhoneNumberWithError_.js +16 -0
- package/dist/node_modules/libphonenumber-js/es6-modern/parsePhoneNumber_.js +24 -0
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/tools/semver-compare.js +1 -1
- package/dist/node_modules/libphonenumber-js/max/es6/exports/PhoneNumber.js +10 -0
- package/dist/node_modules/libphonenumber-js/max/es6/exports/getCountries.js +8 -0
- package/dist/node_modules/libphonenumber-js/max/es6/exports/getCountryCallingCode.js +8 -0
- package/dist/node_modules/libphonenumber-js/max/es6/exports/isSupportedCountry.js +8 -0
- package/dist/node_modules/libphonenumber-js/max/es6/exports/isValidPhoneNumber.js +8 -0
- package/dist/node_modules/libphonenumber-js/max/es6/exports/parsePhoneNumber.js +9 -0
- package/dist/node_modules/libphonenumber-js/max/es6/exports/withMetadataArgument.js +10 -0
- package/dist/node_modules/libphonenumber-js/{metadata.min.json.js → metadata.max.json.js} +3313 -254
- package/package.json +1 -1
- package/dist/node_modules/libphonenumber-js/es6/ParseError.js +0 -116
- package/dist/node_modules/libphonenumber-js/es6/PhoneNumber.js +0 -164
- package/dist/node_modules/libphonenumber-js/es6/helpers/RFC3966.js +0 -9
- package/dist/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +0 -21
- package/dist/node_modules/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +0 -18
- package/dist/node_modules/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +0 -27
- package/dist/node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js +0 -11
- package/dist/node_modules/libphonenumber-js/es6/helpers/getCountryByCallingCode.js +0 -7
- package/dist/node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js +0 -43
- package/dist/node_modules/libphonenumber-js/es6/helpers/getNumberType.js +0 -61
- package/dist/node_modules/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.js +0 -14
- package/dist/node_modules/libphonenumber-js/es6/helpers/mergeArrays.js +0 -39
- package/dist/node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.js +0 -18
- package/dist/node_modules/libphonenumber-js/es6/isValidPhoneNumber.js +0 -62
- package/dist/node_modules/libphonenumber-js/es6/metadata.js +0 -474
- package/dist/node_modules/libphonenumber-js/es6/normalizeArguments.js +0 -110
- package/dist/node_modules/libphonenumber-js/es6/parse.js +0 -103
- package/dist/node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.js +0 -48
- package/dist/node_modules/libphonenumber-js/es6/parsePhoneNumber.js +0 -9
- package/dist/node_modules/libphonenumber-js/es6/parsePhoneNumberWithError_.js +0 -58
- package/dist/node_modules/libphonenumber-js/es6/parsePhoneNumber_.js +0 -66
- package/dist/node_modules/libphonenumber-js/min/exports/getCountries.js +0 -8
- package/dist/node_modules/libphonenumber-js/min/exports/getCountryCallingCode.js +0 -8
- package/dist/node_modules/libphonenumber-js/min/exports/isSupportedCountry.js +0 -8
- package/dist/node_modules/libphonenumber-js/min/exports/isValidPhoneNumber.js +0 -8
- package/dist/node_modules/libphonenumber-js/min/exports/parsePhoneNumber.js +0 -8
- package/dist/node_modules/libphonenumber-js/min/exports/withMetadataArgument.js +0 -8
|
@@ -1,474 +0,0 @@
|
|
|
1
|
-
import e from "./tools/semver-compare.js";
|
|
2
|
-
import t from "./helpers/isObject.js";
|
|
3
|
-
import n from "./helpers/isCallingCode.js";
|
|
4
|
-
//#region ../../node_modules/libphonenumber-js/es6/metadata.js
|
|
5
|
-
function r(e) {
|
|
6
|
-
"@babel/helpers - typeof";
|
|
7
|
-
return r = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
8
|
-
return typeof e;
|
|
9
|
-
} : function(e) {
|
|
10
|
-
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
11
|
-
}, r(e);
|
|
12
|
-
}
|
|
13
|
-
function i(e, t) {
|
|
14
|
-
if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
|
|
15
|
-
}
|
|
16
|
-
function a(e, t) {
|
|
17
|
-
for (var n = 0; n < t.length; n++) {
|
|
18
|
-
var r = t[n];
|
|
19
|
-
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, s(r.key), r);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
function o(e, t, n) {
|
|
23
|
-
return t && a(e.prototype, t), n && a(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e;
|
|
24
|
-
}
|
|
25
|
-
function s(e) {
|
|
26
|
-
var t = c(e, "string");
|
|
27
|
-
return r(t) == "symbol" ? t : t + "";
|
|
28
|
-
}
|
|
29
|
-
function c(e, t) {
|
|
30
|
-
if (r(e) != "object" || !e) return e;
|
|
31
|
-
var n = e[Symbol.toPrimitive];
|
|
32
|
-
if (n !== void 0) {
|
|
33
|
-
var i = n.call(e, t || "default");
|
|
34
|
-
if (r(i) != "object") return i;
|
|
35
|
-
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
36
|
-
}
|
|
37
|
-
return (t === "string" ? String : Number)(e);
|
|
38
|
-
}
|
|
39
|
-
var l = "1.2.0", u = "1.7.35", d = " ext. ", f = /*#__PURE__*/ function() {
|
|
40
|
-
function e(t) {
|
|
41
|
-
i(this, e), v(t), this.metadata = t, S.call(this, t);
|
|
42
|
-
}
|
|
43
|
-
return o(e, [
|
|
44
|
-
{
|
|
45
|
-
key: "getCountries",
|
|
46
|
-
value: function() {
|
|
47
|
-
return Object.keys(this.metadata.countries).filter(function(e) {
|
|
48
|
-
return e !== "001";
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
key: "getCountryMetadata",
|
|
54
|
-
value: function(e) {
|
|
55
|
-
return this.metadata.countries[e];
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
key: "nonGeographic",
|
|
60
|
-
value: function() {
|
|
61
|
-
if (!(this.v1 || this.v2 || this.v3)) return this.metadata.nonGeographic || this.metadata.nonGeographical;
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
key: "hasCountry",
|
|
66
|
-
value: function(e) {
|
|
67
|
-
return this.getCountryMetadata(e) !== void 0;
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
key: "hasCallingCode",
|
|
72
|
-
value: function(e) {
|
|
73
|
-
if (this.getCountryCodesForCallingCode(e)) return !0;
|
|
74
|
-
if (this.nonGeographic()) {
|
|
75
|
-
if (this.nonGeographic()[e]) return !0;
|
|
76
|
-
} else {
|
|
77
|
-
var t = this.countryCallingCodes()[e];
|
|
78
|
-
if (t && t.length === 1 && t[0] === "001") return !0;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
key: "isNonGeographicCallingCode",
|
|
84
|
-
value: function(e) {
|
|
85
|
-
return this.nonGeographic() ? !!this.nonGeographic()[e] : !this.getCountryCodesForCallingCode(e);
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
key: "country",
|
|
90
|
-
value: function(e) {
|
|
91
|
-
return this.selectNumberingPlan(e);
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
key: "selectNumberingPlan",
|
|
96
|
-
value: function(e, t) {
|
|
97
|
-
var r, i;
|
|
98
|
-
if (e && (n(e) ? i = e : r = e), t && (i = t), r && r !== "001") {
|
|
99
|
-
var a = this.getCountryMetadata(r);
|
|
100
|
-
if (!a) throw Error(`Unknown country: ${r}`);
|
|
101
|
-
this.numberingPlan = new p(a, this);
|
|
102
|
-
} else if (i) {
|
|
103
|
-
if (!this.hasCallingCode(i)) throw Error(`Unknown calling code: ${i}`);
|
|
104
|
-
this.numberingPlan = new p(this.getNumberingPlanMetadata(i), this);
|
|
105
|
-
} else this.numberingPlan = void 0;
|
|
106
|
-
return this;
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
key: "getCountryCodesForCallingCode",
|
|
111
|
-
value: function(e) {
|
|
112
|
-
var t = this.countryCallingCodes()[e];
|
|
113
|
-
if (t) return t.length === 1 && t[0].length === 3 ? void 0 : t;
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
key: "getCountryCodeForCallingCode",
|
|
118
|
-
value: function(e) {
|
|
119
|
-
var t = this.getCountryCodesForCallingCode(e);
|
|
120
|
-
if (t) return t[0];
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
key: "getNumberingPlanMetadata",
|
|
125
|
-
value: function(e) {
|
|
126
|
-
var t = this.getCountryCodeForCallingCode(e);
|
|
127
|
-
if (t) return this.getCountryMetadata(t);
|
|
128
|
-
if (this.nonGeographic()) {
|
|
129
|
-
var n = this.nonGeographic()[e];
|
|
130
|
-
if (n) return n;
|
|
131
|
-
} else {
|
|
132
|
-
var r = this.countryCallingCodes()[e];
|
|
133
|
-
if (r && r.length === 1 && r[0] === "001") return this.metadata.countries["001"];
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
key: "countryCallingCode",
|
|
139
|
-
value: function() {
|
|
140
|
-
return this.numberingPlan.callingCode();
|
|
141
|
-
}
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
key: "IDDPrefix",
|
|
145
|
-
value: function() {
|
|
146
|
-
return this.numberingPlan.IDDPrefix();
|
|
147
|
-
}
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
key: "defaultIDDPrefix",
|
|
151
|
-
value: function() {
|
|
152
|
-
return this.numberingPlan.defaultIDDPrefix();
|
|
153
|
-
}
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
key: "nationalNumberPattern",
|
|
157
|
-
value: function() {
|
|
158
|
-
return this.numberingPlan.nationalNumberPattern();
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
key: "possibleLengths",
|
|
163
|
-
value: function() {
|
|
164
|
-
return this.numberingPlan.possibleLengths();
|
|
165
|
-
}
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
key: "formats",
|
|
169
|
-
value: function() {
|
|
170
|
-
return this.numberingPlan.formats();
|
|
171
|
-
}
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
key: "nationalPrefixForParsing",
|
|
175
|
-
value: function() {
|
|
176
|
-
return this.numberingPlan.nationalPrefixForParsing();
|
|
177
|
-
}
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
key: "nationalPrefixTransformRule",
|
|
181
|
-
value: function() {
|
|
182
|
-
return this.numberingPlan.nationalPrefixTransformRule();
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
key: "leadingDigits",
|
|
187
|
-
value: function() {
|
|
188
|
-
return this.numberingPlan.leadingDigits();
|
|
189
|
-
}
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
key: "hasTypes",
|
|
193
|
-
value: function() {
|
|
194
|
-
return this.numberingPlan.hasTypes();
|
|
195
|
-
}
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
key: "type",
|
|
199
|
-
value: function(e) {
|
|
200
|
-
return this.numberingPlan.type(e);
|
|
201
|
-
}
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
key: "ext",
|
|
205
|
-
value: function() {
|
|
206
|
-
return this.numberingPlan.ext();
|
|
207
|
-
}
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
key: "countryCallingCodes",
|
|
211
|
-
value: function() {
|
|
212
|
-
return this.v1 ? this.metadata.country_phone_code_to_countries : this.metadata.country_calling_codes;
|
|
213
|
-
}
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
key: "chooseCountryByCountryCallingCode",
|
|
217
|
-
value: function(e) {
|
|
218
|
-
return this.selectNumberingPlan(e);
|
|
219
|
-
}
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
key: "hasSelectedNumberingPlan",
|
|
223
|
-
value: function() {
|
|
224
|
-
return this.numberingPlan !== void 0;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
]);
|
|
228
|
-
}(), p = /*#__PURE__*/ function() {
|
|
229
|
-
function e(t, n) {
|
|
230
|
-
i(this, e), this.globalMetadataObject = n, this.metadata = t, S.call(this, n.metadata);
|
|
231
|
-
}
|
|
232
|
-
return o(e, [
|
|
233
|
-
{
|
|
234
|
-
key: "callingCode",
|
|
235
|
-
value: function() {
|
|
236
|
-
return this.metadata[0];
|
|
237
|
-
}
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
key: "_getDefaultCountryMetadataForThisCallingCode",
|
|
241
|
-
value: function() {
|
|
242
|
-
return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode());
|
|
243
|
-
}
|
|
244
|
-
},
|
|
245
|
-
{
|
|
246
|
-
key: "getDefaultCountryMetadataForRegion",
|
|
247
|
-
value: function() {
|
|
248
|
-
return this._getDefaultCountryMetadataForThisCallingCode();
|
|
249
|
-
}
|
|
250
|
-
},
|
|
251
|
-
{
|
|
252
|
-
key: "IDDPrefix",
|
|
253
|
-
value: function() {
|
|
254
|
-
if (!(this.v1 || this.v2)) return this.metadata[1];
|
|
255
|
-
}
|
|
256
|
-
},
|
|
257
|
-
{
|
|
258
|
-
key: "defaultIDDPrefix",
|
|
259
|
-
value: function() {
|
|
260
|
-
if (!(this.v1 || this.v2)) return this.metadata[12];
|
|
261
|
-
}
|
|
262
|
-
},
|
|
263
|
-
{
|
|
264
|
-
key: "nationalNumberPattern",
|
|
265
|
-
value: function() {
|
|
266
|
-
return this.v1 || this.v2 ? this.metadata[1] : this.metadata[2];
|
|
267
|
-
}
|
|
268
|
-
},
|
|
269
|
-
{
|
|
270
|
-
key: "possibleLengths",
|
|
271
|
-
value: function() {
|
|
272
|
-
if (!this.v1) return this.metadata[this.v2 ? 2 : 3];
|
|
273
|
-
}
|
|
274
|
-
},
|
|
275
|
-
{
|
|
276
|
-
key: "_getFormats",
|
|
277
|
-
value: function(e) {
|
|
278
|
-
return e[this.v1 ? 2 : this.v2 ? 3 : 4];
|
|
279
|
-
}
|
|
280
|
-
},
|
|
281
|
-
{
|
|
282
|
-
key: "formats",
|
|
283
|
-
value: function() {
|
|
284
|
-
var e = this;
|
|
285
|
-
return (this._getFormats(this.metadata) || this._getFormats(this._getDefaultCountryMetadataForThisCallingCode()) || []).map(function(t) {
|
|
286
|
-
return new m(t, e);
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
},
|
|
290
|
-
{
|
|
291
|
-
key: "nationalPrefix",
|
|
292
|
-
value: function() {
|
|
293
|
-
return this.metadata[this.v1 ? 3 : this.v2 ? 4 : 5];
|
|
294
|
-
}
|
|
295
|
-
},
|
|
296
|
-
{
|
|
297
|
-
key: "_getNationalPrefixFormattingRule",
|
|
298
|
-
value: function(e) {
|
|
299
|
-
return e[this.v1 ? 4 : this.v2 ? 5 : 6];
|
|
300
|
-
}
|
|
301
|
-
},
|
|
302
|
-
{
|
|
303
|
-
key: "nationalPrefixFormattingRule",
|
|
304
|
-
value: function() {
|
|
305
|
-
return this._getNationalPrefixFormattingRule(this.metadata) || this._getNationalPrefixFormattingRule(this._getDefaultCountryMetadataForThisCallingCode());
|
|
306
|
-
}
|
|
307
|
-
},
|
|
308
|
-
{
|
|
309
|
-
key: "_nationalPrefixForParsing",
|
|
310
|
-
value: function() {
|
|
311
|
-
return this.metadata[this.v1 ? 5 : this.v2 ? 6 : 7];
|
|
312
|
-
}
|
|
313
|
-
},
|
|
314
|
-
{
|
|
315
|
-
key: "nationalPrefixForParsing",
|
|
316
|
-
value: function() {
|
|
317
|
-
return this._nationalPrefixForParsing() || this.nationalPrefix();
|
|
318
|
-
}
|
|
319
|
-
},
|
|
320
|
-
{
|
|
321
|
-
key: "nationalPrefixTransformRule",
|
|
322
|
-
value: function() {
|
|
323
|
-
return this.metadata[this.v1 ? 6 : this.v2 ? 7 : 8];
|
|
324
|
-
}
|
|
325
|
-
},
|
|
326
|
-
{
|
|
327
|
-
key: "_getNationalPrefixIsOptionalWhenFormatting",
|
|
328
|
-
value: function() {
|
|
329
|
-
return !!this.metadata[this.v1 ? 7 : this.v2 ? 8 : 9];
|
|
330
|
-
}
|
|
331
|
-
},
|
|
332
|
-
{
|
|
333
|
-
key: "nationalPrefixIsOptionalWhenFormattingInNationalFormat",
|
|
334
|
-
value: function() {
|
|
335
|
-
return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata) || this._getNationalPrefixIsOptionalWhenFormatting(this._getDefaultCountryMetadataForThisCallingCode());
|
|
336
|
-
}
|
|
337
|
-
},
|
|
338
|
-
{
|
|
339
|
-
key: "leadingDigits",
|
|
340
|
-
value: function() {
|
|
341
|
-
return this.metadata[this.v1 ? 8 : this.v2 ? 9 : 10];
|
|
342
|
-
}
|
|
343
|
-
},
|
|
344
|
-
{
|
|
345
|
-
key: "types",
|
|
346
|
-
value: function() {
|
|
347
|
-
return this.metadata[this.v1 ? 9 : this.v2 ? 10 : 11];
|
|
348
|
-
}
|
|
349
|
-
},
|
|
350
|
-
{
|
|
351
|
-
key: "hasTypes",
|
|
352
|
-
value: function() {
|
|
353
|
-
return this.types() && this.types().length === 0 ? !1 : !!this.types();
|
|
354
|
-
}
|
|
355
|
-
},
|
|
356
|
-
{
|
|
357
|
-
key: "type",
|
|
358
|
-
value: function(e) {
|
|
359
|
-
if (this.hasTypes() && _(this.types(), e)) return new g(_(this.types(), e), this);
|
|
360
|
-
}
|
|
361
|
-
},
|
|
362
|
-
{
|
|
363
|
-
key: "ext",
|
|
364
|
-
value: function() {
|
|
365
|
-
return this.v1 || this.v2 ? d : this.metadata[13] || d;
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
]);
|
|
369
|
-
}(), m = /*#__PURE__*/ function() {
|
|
370
|
-
function e(t, n) {
|
|
371
|
-
i(this, e), this._format = t, this.metadata = n;
|
|
372
|
-
}
|
|
373
|
-
return o(e, [
|
|
374
|
-
{
|
|
375
|
-
key: "pattern",
|
|
376
|
-
value: function() {
|
|
377
|
-
return this._format[0];
|
|
378
|
-
}
|
|
379
|
-
},
|
|
380
|
-
{
|
|
381
|
-
key: "format",
|
|
382
|
-
value: function() {
|
|
383
|
-
return this._format[1];
|
|
384
|
-
}
|
|
385
|
-
},
|
|
386
|
-
{
|
|
387
|
-
key: "leadingDigitsPatterns",
|
|
388
|
-
value: function() {
|
|
389
|
-
return this._format[2] || [];
|
|
390
|
-
}
|
|
391
|
-
},
|
|
392
|
-
{
|
|
393
|
-
key: "nationalPrefixFormattingRule",
|
|
394
|
-
value: function() {
|
|
395
|
-
return this._format[3] || this.metadata.nationalPrefixFormattingRule();
|
|
396
|
-
}
|
|
397
|
-
},
|
|
398
|
-
{
|
|
399
|
-
key: "nationalPrefixIsOptionalWhenFormattingInNationalFormat",
|
|
400
|
-
value: function() {
|
|
401
|
-
return !!this._format[4] || this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat();
|
|
402
|
-
}
|
|
403
|
-
},
|
|
404
|
-
{
|
|
405
|
-
key: "nationalPrefixIsMandatoryWhenFormattingInNationalFormat",
|
|
406
|
-
value: function() {
|
|
407
|
-
return this.usesNationalPrefix() && !this.nationalPrefixIsOptionalWhenFormattingInNationalFormat();
|
|
408
|
-
}
|
|
409
|
-
},
|
|
410
|
-
{
|
|
411
|
-
key: "usesNationalPrefix",
|
|
412
|
-
value: function() {
|
|
413
|
-
return !!(this.nationalPrefixFormattingRule() && !h.test(this.nationalPrefixFormattingRule()));
|
|
414
|
-
}
|
|
415
|
-
},
|
|
416
|
-
{
|
|
417
|
-
key: "internationalFormat",
|
|
418
|
-
value: function() {
|
|
419
|
-
return this._format[5] || this.format();
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
]);
|
|
423
|
-
}(), h = /^\(?\$1\)?$/, g = /*#__PURE__*/ function() {
|
|
424
|
-
function e(t, n) {
|
|
425
|
-
i(this, e), this.type = t, this.metadata = n;
|
|
426
|
-
}
|
|
427
|
-
return o(e, [{
|
|
428
|
-
key: "pattern",
|
|
429
|
-
value: function() {
|
|
430
|
-
return this.metadata.v1 ? this.type : this.type[0];
|
|
431
|
-
}
|
|
432
|
-
}, {
|
|
433
|
-
key: "possibleLengths",
|
|
434
|
-
value: function() {
|
|
435
|
-
if (!this.metadata.v1) return this.type[1] || this.metadata.possibleLengths();
|
|
436
|
-
}
|
|
437
|
-
}]);
|
|
438
|
-
}();
|
|
439
|
-
function _(e, t) {
|
|
440
|
-
switch (t) {
|
|
441
|
-
case "FIXED_LINE": return e[0];
|
|
442
|
-
case "MOBILE": return e[1];
|
|
443
|
-
case "TOLL_FREE": return e[2];
|
|
444
|
-
case "PREMIUM_RATE": return e[3];
|
|
445
|
-
case "PERSONAL_NUMBER": return e[4];
|
|
446
|
-
case "VOICEMAIL": return e[5];
|
|
447
|
-
case "UAN": return e[6];
|
|
448
|
-
case "PAGER": return e[7];
|
|
449
|
-
case "VOIP": return e[8];
|
|
450
|
-
case "SHARED_COST": return e[9];
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
function v(e) {
|
|
454
|
-
if (!e) throw Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");
|
|
455
|
-
if (!t(e) || !t(e.countries)) throw Error(`[libphonenumber-js] \`metadata\` argument was passed but it's not a valid metadata. Must be an object having \`.countries\` child object property. Got ${t(e) ? "an object of shape: { " + Object.keys(e).join(", ") + " }" : "a " + y(e) + ": " + e}.`);
|
|
456
|
-
}
|
|
457
|
-
/* istanbul ignore next */
|
|
458
|
-
var y = function(e) {
|
|
459
|
-
return r(e);
|
|
460
|
-
};
|
|
461
|
-
function b(e, t) {
|
|
462
|
-
var n = new f(t);
|
|
463
|
-
if (n.hasCountry(e)) return n.selectNumberingPlan(e).countryCallingCode();
|
|
464
|
-
throw Error(`Unknown country: ${e}`);
|
|
465
|
-
}
|
|
466
|
-
function x(e, t) {
|
|
467
|
-
return t.countries.hasOwnProperty(e);
|
|
468
|
-
}
|
|
469
|
-
function S(t) {
|
|
470
|
-
var n = t.version;
|
|
471
|
-
typeof n == "number" ? (this.v1 = n === 1, this.v2 = n === 2, this.v3 = n === 3, this.v4 = n === 4) : n ? e(n, l) === -1 ? this.v2 = !0 : e(n, u) === -1 ? this.v3 = !0 : this.v4 = !0 : this.v1 = !0;
|
|
472
|
-
}
|
|
473
|
-
//#endregion
|
|
474
|
-
export { f as default, b as getCountryCallingCode, x as isSupportedCountry, v as validateMetadata };
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import e from "./helpers/isObject.js";
|
|
2
|
-
//#region ../../node_modules/libphonenumber-js/es6/normalizeArguments.js
|
|
3
|
-
function t(e) {
|
|
4
|
-
"@babel/helpers - typeof";
|
|
5
|
-
return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
6
|
-
return typeof e;
|
|
7
|
-
} : function(e) {
|
|
8
|
-
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
9
|
-
}, t(e);
|
|
10
|
-
}
|
|
11
|
-
function n(e, t) {
|
|
12
|
-
var n = Object.keys(e);
|
|
13
|
-
if (Object.getOwnPropertySymbols) {
|
|
14
|
-
var r = Object.getOwnPropertySymbols(e);
|
|
15
|
-
t && (r = r.filter(function(t) {
|
|
16
|
-
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
17
|
-
})), n.push.apply(n, r);
|
|
18
|
-
}
|
|
19
|
-
return n;
|
|
20
|
-
}
|
|
21
|
-
function r(e) {
|
|
22
|
-
for (var t = 1; t < arguments.length; t++) {
|
|
23
|
-
var r = arguments[t] == null ? {} : arguments[t];
|
|
24
|
-
t % 2 ? n(Object(r), !0).forEach(function(t) {
|
|
25
|
-
i(e, t, r[t]);
|
|
26
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : n(Object(r)).forEach(function(t) {
|
|
27
|
-
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t));
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
return e;
|
|
31
|
-
}
|
|
32
|
-
function i(e, t, n) {
|
|
33
|
-
return (t = a(t)) in e ? Object.defineProperty(e, t, {
|
|
34
|
-
value: n,
|
|
35
|
-
enumerable: !0,
|
|
36
|
-
configurable: !0,
|
|
37
|
-
writable: !0
|
|
38
|
-
}) : e[t] = n, e;
|
|
39
|
-
}
|
|
40
|
-
function a(e) {
|
|
41
|
-
var n = o(e, "string");
|
|
42
|
-
return t(n) == "symbol" ? n : n + "";
|
|
43
|
-
}
|
|
44
|
-
function o(e, n) {
|
|
45
|
-
if (t(e) != "object" || !e) return e;
|
|
46
|
-
var r = e[Symbol.toPrimitive];
|
|
47
|
-
if (r !== void 0) {
|
|
48
|
-
var i = r.call(e, n || "default");
|
|
49
|
-
if (t(i) != "object") return i;
|
|
50
|
-
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
51
|
-
}
|
|
52
|
-
return (n === "string" ? String : Number)(e);
|
|
53
|
-
}
|
|
54
|
-
function s(e, t) {
|
|
55
|
-
return f(e) || d(e, t) || l(e, t) || c();
|
|
56
|
-
}
|
|
57
|
-
function c() {
|
|
58
|
-
throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
59
|
-
}
|
|
60
|
-
function l(e, t) {
|
|
61
|
-
if (e) {
|
|
62
|
-
if (typeof e == "string") return u(e, t);
|
|
63
|
-
var n = {}.toString.call(e).slice(8, -1);
|
|
64
|
-
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? u(e, t) : void 0;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
function u(e, t) {
|
|
68
|
-
(t == null || t > e.length) && (t = e.length);
|
|
69
|
-
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
70
|
-
return r;
|
|
71
|
-
}
|
|
72
|
-
function d(e, t) {
|
|
73
|
-
var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
74
|
-
if (n != null) {
|
|
75
|
-
var r, i, a, o, s = [], c = !0, l = !1;
|
|
76
|
-
try {
|
|
77
|
-
if (a = (n = n.call(e)).next, t === 0) {
|
|
78
|
-
if (Object(n) !== n) return;
|
|
79
|
-
c = !1;
|
|
80
|
-
} else for (; !(c = (r = a.call(n)).done) && (s.push(r.value), s.length !== t); c = !0);
|
|
81
|
-
} catch (e) {
|
|
82
|
-
l = !0, i = e;
|
|
83
|
-
} finally {
|
|
84
|
-
try {
|
|
85
|
-
if (!c && n.return != null && (o = n.return(), Object(o) !== o)) return;
|
|
86
|
-
} finally {
|
|
87
|
-
if (l) throw i;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
return s;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
function f(e) {
|
|
94
|
-
if (Array.isArray(e)) return e;
|
|
95
|
-
}
|
|
96
|
-
function p(t) {
|
|
97
|
-
var n = s(Array.prototype.slice.call(t), 4), i = n[0], a = n[1], o = n[2], c = n[3], l, u, d;
|
|
98
|
-
if (typeof i == "string") l = i;
|
|
99
|
-
else throw TypeError("A text for parsing must be a string.");
|
|
100
|
-
if (!a || typeof a == "string") c ? (u = o, d = c) : (u = void 0, d = o), a && (u = r({ defaultCountry: a }, u));
|
|
101
|
-
else if (e(a)) o ? (u = a, d = o) : d = a;
|
|
102
|
-
else throw Error(`Invalid second argument: ${a}`);
|
|
103
|
-
return {
|
|
104
|
-
text: l,
|
|
105
|
-
options: u,
|
|
106
|
-
metadata: d
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
//#endregion
|
|
110
|
-
export { p as default };
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import e from "./metadata.js";
|
|
2
|
-
import { isPossibleNumber as t } from "./isPossible.js";
|
|
3
|
-
import n from "./helpers/matchesEntirely.js";
|
|
4
|
-
import { PLUS_CHARS as r, VALID_DIGITS as i } from "./constants.js";
|
|
5
|
-
import a from "./helpers/getCountryByCallingCode.js";
|
|
6
|
-
import o from "./helpers/extractNationalNumber.js";
|
|
7
|
-
import s from "./helpers/extractCountryCallingCode.js";
|
|
8
|
-
import c, { isViablePhoneNumberStart as l } from "./helpers/isViablePhoneNumber.js";
|
|
9
|
-
import u from "./PhoneNumber.js";
|
|
10
|
-
import d from "./ParseError.js";
|
|
11
|
-
import f from "./helpers/extension/extractExtension.js";
|
|
12
|
-
import p from "./parseIncompletePhoneNumber.js";
|
|
13
|
-
import m from "./helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js";
|
|
14
|
-
//#region ../../node_modules/libphonenumber-js/es6/parse.js
|
|
15
|
-
var h = 250, g = RegExp("[" + r + i + "]"), _ = RegExp("[^" + i + "#]+$");
|
|
16
|
-
function v(r, i, a) {
|
|
17
|
-
i ||= {};
|
|
18
|
-
var o = new e(a);
|
|
19
|
-
if (i.defaultCountry && !o.hasCountry(i.defaultCountry)) throw i.v2 ? new d("INVALID_COUNTRY") : Error(`Unknown country: ${i.defaultCountry}`);
|
|
20
|
-
var s = b(r, i.v2, i.extract), c = s.number, l = s.ext, f = s.error;
|
|
21
|
-
if (!c) {
|
|
22
|
-
if (i.v2) throw f === "TOO_SHORT" ? new d("TOO_SHORT") : new d("NOT_A_NUMBER");
|
|
23
|
-
return {};
|
|
24
|
-
}
|
|
25
|
-
var p = S(c, i.defaultCountry, i.defaultCallingCode, o), m = p.country, h = p.nationalNumber, g = p.countryCallingCode, _ = p.countryCallingCodeSource, v = p.carrierCode;
|
|
26
|
-
if (!o.hasSelectedNumberingPlan()) {
|
|
27
|
-
if (i.v2) throw new d("INVALID_COUNTRY");
|
|
28
|
-
return {};
|
|
29
|
-
}
|
|
30
|
-
if (!h || h.length < 2) {
|
|
31
|
-
/* istanbul ignore if */
|
|
32
|
-
if (i.v2) throw new d("TOO_SHORT");
|
|
33
|
-
return {};
|
|
34
|
-
}
|
|
35
|
-
if (h.length > 17) {
|
|
36
|
-
if (i.v2) throw new d("TOO_LONG");
|
|
37
|
-
return {};
|
|
38
|
-
}
|
|
39
|
-
if (i.v2) {
|
|
40
|
-
var y = new u(g, h, o.metadata);
|
|
41
|
-
return m && (y.country = m), v && (y.carrierCode = v), l && (y.ext = l), y.__countryCallingCodeSource = _, y;
|
|
42
|
-
}
|
|
43
|
-
var C = (i.extended ? o.hasSelectedNumberingPlan() : m) ? n(h, o.nationalNumberPattern()) : !1;
|
|
44
|
-
return i.extended ? {
|
|
45
|
-
country: m,
|
|
46
|
-
countryCallingCode: g,
|
|
47
|
-
carrierCode: v,
|
|
48
|
-
valid: C,
|
|
49
|
-
possible: C ? !0 : !!(i.extended === !0 && o.possibleLengths() && t(h, o)),
|
|
50
|
-
phone: h,
|
|
51
|
-
ext: l
|
|
52
|
-
} : C ? x(m, h, l) : {};
|
|
53
|
-
}
|
|
54
|
-
function y(e, t, n) {
|
|
55
|
-
if (e) {
|
|
56
|
-
if (e.length > h) {
|
|
57
|
-
if (n) throw new d("TOO_LONG");
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
if (t === !1) return e;
|
|
61
|
-
var r = e.search(g);
|
|
62
|
-
if (!(r < 0)) return e.slice(r).replace(_, "");
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
function b(e, t, n) {
|
|
66
|
-
var r = m(e, { extractFormattedPhoneNumber: function(e) {
|
|
67
|
-
return y(e, n, t);
|
|
68
|
-
} });
|
|
69
|
-
if (!r) return {};
|
|
70
|
-
if (!c(r)) return l(r) ? { error: "TOO_SHORT" } : {};
|
|
71
|
-
var i = f(r);
|
|
72
|
-
return i.ext ? i : { number: r };
|
|
73
|
-
}
|
|
74
|
-
function x(e, t, n) {
|
|
75
|
-
var r = {
|
|
76
|
-
country: e,
|
|
77
|
-
phone: t
|
|
78
|
-
};
|
|
79
|
-
return n && (r.ext = n), r;
|
|
80
|
-
}
|
|
81
|
-
function S(e, t, n, r) {
|
|
82
|
-
var i = s(p(e), void 0, t, n, r.metadata), c = i.countryCallingCodeSource, l = i.countryCallingCode, u = i.number, d;
|
|
83
|
-
if (l) r.selectNumberingPlan(l);
|
|
84
|
-
else if (u && (t || n)) t ? (d = t, r.selectNumberingPlan(t), l = r.numberingPlan.callingCode()) : (r.selectNumberingPlan(n), l = n);
|
|
85
|
-
else return {};
|
|
86
|
-
if (!u) return {
|
|
87
|
-
countryCallingCodeSource: c,
|
|
88
|
-
countryCallingCode: l
|
|
89
|
-
};
|
|
90
|
-
var f = o(p(u), void 0, r), m = f.nationalNumber, h = f.carrierCode, g = a(l, {
|
|
91
|
-
nationalNumber: m,
|
|
92
|
-
metadata: r
|
|
93
|
-
});
|
|
94
|
-
return g && (d = g, g === "001" || r.selectNumberingPlan(d)), {
|
|
95
|
-
country: d,
|
|
96
|
-
countryCallingCode: l,
|
|
97
|
-
countryCallingCodeSource: c,
|
|
98
|
-
nationalNumber: m,
|
|
99
|
-
carrierCode: h
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
//#endregion
|
|
103
|
-
export { v as default };
|