@alma/widgets 2.3.3 → 2.5.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/raw/widgets.js +878 -467
- package/dist/raw/widgets.js.map +1 -1
- package/dist/raw/widgets.m.js +878 -467
- package/dist/raw/widgets.m.js.map +1 -1
- package/dist/raw/widgets.modern.js +876 -464
- package/dist/raw/widgets.modern.js.map +1 -1
- package/dist/raw/widgets.umd.js +1308 -845
- package/dist/raw/widgets.umd.js.map +1 -1
- package/dist/types/Widgets/EligibilityModal/DesktopModal/index.d.ts +3 -1
- package/dist/types/Widgets/EligibilityModal/MobileModal/index.d.ts +3 -1
- package/dist/types/Widgets/EligibilityModal/classNames.const.d.ts +18 -0
- package/dist/types/Widgets/EligibilityModal/components/Title/index.d.ts +3 -1
- package/dist/types/Widgets/PaymentPlans/classNames.const.d.ts +13 -0
- package/dist/types/test/fixtures.d.ts +41 -0
- package/dist/types/types.d.ts +7 -1
- package/dist/widgets.js +1 -1
- package/dist/widgets.js.map +1 -1
- package/dist/widgets.m.js +1 -1
- package/dist/widgets.m.js.map +1 -1
- package/dist/widgets.modern.js +1 -1
- package/dist/widgets.modern.js.map +1 -1
- package/dist/widgets.umd.js +1 -1
- package/dist/widgets.umd.js.map +1 -1
- package/package.json +7 -13
- package/CHANGELOG.md +0 -256
- package/dist/types/Widgets/EligibilityModal/ModalContainer.test.d.ts +0 -1
- package/dist/types/Widgets/EligibilityModal/modal.test.d.ts +0 -1
- package/dist/types/Widgets/PaymentPlans/__tests__/Basics.test.d.ts +0 -1
- package/dist/types/Widgets/PaymentPlans/__tests__/Credit.test.d.ts +0 -1
- package/dist/types/Widgets/PaymentPlans/__tests__/CustomTransitionDelay.test.d.ts +0 -1
- package/dist/types/Widgets/PaymentPlans/__tests__/HideWidget.test.d.ts +0 -1
- package/dist/types/Widgets/PaymentPlans/__tests__/IneligibleOptions.test.d.ts +0 -1
- package/dist/types/Widgets/PaymentPlans/__tests__/LanguageCheck.test.d.ts +0 -1
- package/dist/types/Widgets/PaymentPlans/__tests__/LaunchModal.test.d.ts +0 -1
- package/dist/types/Widgets/PaymentPlans/__tests__/SuggestedPaymentPlan.test.d.ts +0 -1
- package/dist/types/Widgets/PaymentPlans/__tests__/WithoutPlans.test.d.ts +0 -1
|
@@ -7,40 +7,44 @@ import noScroll from 'no-scroll';
|
|
|
7
7
|
import { useMediaQuery } from 'react-responsive';
|
|
8
8
|
import { secondsToMilliseconds, isToday } from 'date-fns';
|
|
9
9
|
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
var fails = function (exec) {
|
|
11
|
+
try {
|
|
12
|
+
return !!exec();
|
|
13
|
+
} catch (error) {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
//
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
};
|
|
18
|
+
var functionBindNative = !fails(function () {
|
|
19
|
+
// eslint-disable-next-line es-x/no-function-prototype-bind -- safe
|
|
20
|
+
var test = function () {
|
|
21
|
+
/* empty */
|
|
22
|
+
}.bind(); // eslint-disable-next-line no-prototype-builtins -- safe
|
|
24
23
|
|
|
25
|
-
|
|
26
|
-
return function (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
|
|
25
|
+
return typeof test != 'function' || test.hasOwnProperty('prototype');
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
var FunctionPrototype = Function.prototype;
|
|
29
|
+
var bind = FunctionPrototype.bind;
|
|
30
|
+
var call = FunctionPrototype.call;
|
|
31
|
+
var uncurryThis = functionBindNative && bind.bind(call, call);
|
|
32
|
+
var functionUncurryThis = functionBindNative ? function (fn) {
|
|
33
|
+
return fn && uncurryThis(fn);
|
|
34
|
+
} : function (fn) {
|
|
35
|
+
return fn && function () {
|
|
36
|
+
return call.apply(fn, arguments);
|
|
34
37
|
};
|
|
35
38
|
};
|
|
36
39
|
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
//
|
|
43
|
-
|
|
40
|
+
var ceil = Math.ceil;
|
|
41
|
+
var floor = Math.floor; // `ToIntegerOrInfinity` abstract operation
|
|
42
|
+
// https://tc39.es/ecma262/#sec-tointegerorinfinity
|
|
43
|
+
|
|
44
|
+
var toIntegerOrInfinity = function (argument) {
|
|
45
|
+
var number = +argument; // eslint-disable-next-line no-self-compare -- safe
|
|
46
|
+
|
|
47
|
+
return number !== number || number === 0 ? 0 : (number > 0 ? floor : ceil)(number);
|
|
44
48
|
};
|
|
45
49
|
|
|
46
50
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -64,21 +68,241 @@ var check = function (it) {
|
|
|
64
68
|
}; // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
65
69
|
|
|
66
70
|
|
|
67
|
-
var global_1 = // eslint-disable-next-line no-
|
|
68
|
-
check(typeof globalThis == 'object' && globalThis) || check(typeof window == 'object' && window) ||
|
|
71
|
+
var global_1 = // eslint-disable-next-line es-x/no-global-this -- safe
|
|
72
|
+
check(typeof globalThis == 'object' && globalThis) || check(typeof window == 'object' && window) || // eslint-disable-next-line no-restricted-globals -- safe
|
|
73
|
+
check(typeof self == 'object' && self) || check(typeof commonjsGlobal == 'object' && commonjsGlobal) || // eslint-disable-next-line no-new-func -- fallback
|
|
69
74
|
function () {
|
|
70
75
|
return this;
|
|
71
76
|
}() || Function('return this')();
|
|
72
77
|
|
|
73
|
-
var
|
|
78
|
+
var defineProperty = Object.defineProperty;
|
|
79
|
+
|
|
80
|
+
var setGlobal = function (key, value) {
|
|
74
81
|
try {
|
|
75
|
-
|
|
82
|
+
defineProperty(global_1, key, {
|
|
83
|
+
value: value,
|
|
84
|
+
configurable: true,
|
|
85
|
+
writable: true
|
|
86
|
+
});
|
|
76
87
|
} catch (error) {
|
|
77
|
-
|
|
88
|
+
global_1[key] = value;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return value;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
var SHARED = '__core-js_shared__';
|
|
95
|
+
var store = global_1[SHARED] || setGlobal(SHARED, {});
|
|
96
|
+
var sharedStore = store;
|
|
97
|
+
|
|
98
|
+
var shared = createCommonjsModule(function (module) {
|
|
99
|
+
(module.exports = function (key, value) {
|
|
100
|
+
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
|
101
|
+
})('versions', []).push({
|
|
102
|
+
version: '3.22.1',
|
|
103
|
+
mode: 'global',
|
|
104
|
+
copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
|
|
105
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.22.1/LICENSE',
|
|
106
|
+
source: 'https://github.com/zloirock/core-js'
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
var TypeError$1 = global_1.TypeError; // `RequireObjectCoercible` abstract operation
|
|
111
|
+
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
112
|
+
|
|
113
|
+
var requireObjectCoercible = function (it) {
|
|
114
|
+
if (it == undefined) throw TypeError$1("Can't call method on " + it);
|
|
115
|
+
return it;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
var Object$1 = global_1.Object; // `ToObject` abstract operation
|
|
119
|
+
// https://tc39.es/ecma262/#sec-toobject
|
|
120
|
+
|
|
121
|
+
var toObject = function (argument) {
|
|
122
|
+
return Object$1(requireObjectCoercible(argument));
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
var hasOwnProperty = functionUncurryThis({}.hasOwnProperty); // `HasOwnProperty` abstract operation
|
|
126
|
+
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
127
|
+
// eslint-disable-next-line es-x/no-object-hasown -- safe
|
|
128
|
+
|
|
129
|
+
var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
130
|
+
return hasOwnProperty(toObject(it), key);
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
var id = 0;
|
|
134
|
+
var postfix = Math.random();
|
|
135
|
+
var toString = functionUncurryThis(1.0.toString);
|
|
136
|
+
|
|
137
|
+
var uid = function (key) {
|
|
138
|
+
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
// `IsCallable` abstract operation
|
|
142
|
+
// https://tc39.es/ecma262/#sec-iscallable
|
|
143
|
+
var isCallable = function (argument) {
|
|
144
|
+
return typeof argument == 'function';
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
var aFunction = function (argument) {
|
|
148
|
+
return isCallable(argument) ? argument : undefined;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
var getBuiltIn = function (namespace, method) {
|
|
152
|
+
return arguments.length < 2 ? aFunction(global_1[namespace]) : global_1[namespace] && global_1[namespace][method];
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
|
|
156
|
+
|
|
157
|
+
var process = global_1.process;
|
|
158
|
+
var Deno = global_1.Deno;
|
|
159
|
+
var versions = process && process.versions || Deno && Deno.version;
|
|
160
|
+
var v8 = versions && versions.v8;
|
|
161
|
+
var match, version;
|
|
162
|
+
|
|
163
|
+
if (v8) {
|
|
164
|
+
match = v8.split('.'); // in old Chrome, versions of V8 isn't V8 = Chrome / 10
|
|
165
|
+
// but their correct versions are not interesting for us
|
|
166
|
+
|
|
167
|
+
version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
|
|
168
|
+
} // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
|
|
169
|
+
// so check `userAgent` even if `.v8` exists, but 0
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
if (!version && engineUserAgent) {
|
|
173
|
+
match = engineUserAgent.match(/Edge\/(\d+)/);
|
|
174
|
+
|
|
175
|
+
if (!match || match[1] >= 74) {
|
|
176
|
+
match = engineUserAgent.match(/Chrome\/(\d+)/);
|
|
177
|
+
if (match) version = +match[1];
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
var engineV8Version = version;
|
|
182
|
+
|
|
183
|
+
/* eslint-disable es-x/no-symbol -- required for testing */
|
|
184
|
+
// eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing
|
|
185
|
+
|
|
186
|
+
var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
|
|
187
|
+
var symbol = Symbol(); // Chrome 38 Symbol has incorrect toString conversion
|
|
188
|
+
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
189
|
+
|
|
190
|
+
return !String(symbol) || !(Object(symbol) instanceof Symbol) || // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
|
191
|
+
!Symbol.sham && engineV8Version && engineV8Version < 41;
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
/* eslint-disable es-x/no-symbol -- required for testing */
|
|
195
|
+
|
|
196
|
+
var useSymbolAsUid = nativeSymbol && !Symbol.sham && typeof Symbol.iterator == 'symbol';
|
|
197
|
+
|
|
198
|
+
var WellKnownSymbolsStore = shared('wks');
|
|
199
|
+
var Symbol$1 = global_1.Symbol;
|
|
200
|
+
var symbolFor = Symbol$1 && Symbol$1['for'];
|
|
201
|
+
var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
|
|
202
|
+
|
|
203
|
+
var wellKnownSymbol = function (name) {
|
|
204
|
+
if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
|
|
205
|
+
var description = 'Symbol.' + name;
|
|
206
|
+
|
|
207
|
+
if (nativeSymbol && hasOwnProperty_1(Symbol$1, name)) {
|
|
208
|
+
WellKnownSymbolsStore[name] = Symbol$1[name];
|
|
209
|
+
} else if (useSymbolAsUid && symbolFor) {
|
|
210
|
+
WellKnownSymbolsStore[name] = symbolFor(description);
|
|
211
|
+
} else {
|
|
212
|
+
WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
return WellKnownSymbolsStore[name];
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
|
220
|
+
var test = {};
|
|
221
|
+
test[TO_STRING_TAG] = 'z';
|
|
222
|
+
var toStringTagSupport = String(test) === '[object z]';
|
|
223
|
+
|
|
224
|
+
var toString$1 = functionUncurryThis({}.toString);
|
|
225
|
+
var stringSlice = functionUncurryThis(''.slice);
|
|
226
|
+
|
|
227
|
+
var classofRaw = function (it) {
|
|
228
|
+
return stringSlice(toString$1(it), 8, -1);
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
|
|
232
|
+
var Object$2 = global_1.Object; // ES3 wrong here
|
|
233
|
+
|
|
234
|
+
var CORRECT_ARGUMENTS = classofRaw(function () {
|
|
235
|
+
return arguments;
|
|
236
|
+
}()) == 'Arguments'; // fallback for IE11 Script Access Denied error
|
|
237
|
+
|
|
238
|
+
var tryGet = function (it, key) {
|
|
239
|
+
try {
|
|
240
|
+
return it[key];
|
|
241
|
+
} catch (error) {
|
|
242
|
+
/* empty */
|
|
78
243
|
}
|
|
244
|
+
}; // getting tag from ES6+ `Object.prototype.toString`
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
var classof = toStringTagSupport ? classofRaw : function (it) {
|
|
248
|
+
var O, tag, result;
|
|
249
|
+
return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case
|
|
250
|
+
: typeof (tag = tryGet(O = Object$2(it), TO_STRING_TAG$1)) == 'string' ? tag // builtinTag case
|
|
251
|
+
: CORRECT_ARGUMENTS ? classofRaw(O) // ES3 arguments fallback
|
|
252
|
+
: (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
var String$1 = global_1.String;
|
|
256
|
+
|
|
257
|
+
var toString_1 = function (argument) {
|
|
258
|
+
if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
|
|
259
|
+
return String$1(argument);
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
var charAt = functionUncurryThis(''.charAt);
|
|
263
|
+
var charCodeAt = functionUncurryThis(''.charCodeAt);
|
|
264
|
+
var stringSlice$1 = functionUncurryThis(''.slice);
|
|
265
|
+
|
|
266
|
+
var createMethod = function (CONVERT_TO_STRING) {
|
|
267
|
+
return function ($this, pos) {
|
|
268
|
+
var S = toString_1(requireObjectCoercible($this));
|
|
269
|
+
var position = toIntegerOrInfinity(pos);
|
|
270
|
+
var size = S.length;
|
|
271
|
+
var first, second;
|
|
272
|
+
if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
|
|
273
|
+
first = charCodeAt(S, position);
|
|
274
|
+
return first < 0xD800 || first > 0xDBFF || position + 1 === size || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF ? CONVERT_TO_STRING ? charAt(S, position) : first : CONVERT_TO_STRING ? stringSlice$1(S, position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
|
|
275
|
+
};
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
var stringMultibyte = {
|
|
279
|
+
// `String.prototype.codePointAt` method
|
|
280
|
+
// https://tc39.es/ecma262/#sec-string.prototype.codepointat
|
|
281
|
+
codeAt: createMethod(false),
|
|
282
|
+
// `String.prototype.at` method
|
|
283
|
+
// https://github.com/mathiasbynens/String.prototype.at
|
|
284
|
+
charAt: createMethod(true)
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
var functionToString = functionUncurryThis(Function.toString); // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
|
288
|
+
|
|
289
|
+
if (!isCallable(sharedStore.inspectSource)) {
|
|
290
|
+
sharedStore.inspectSource = function (it) {
|
|
291
|
+
return functionToString(it);
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
var inspectSource = sharedStore.inspectSource;
|
|
296
|
+
|
|
297
|
+
var WeakMap = global_1.WeakMap;
|
|
298
|
+
var nativeWeakMap = isCallable(WeakMap) && /native code/.test(inspectSource(WeakMap));
|
|
299
|
+
|
|
300
|
+
var isObject = function (it) {
|
|
301
|
+
return typeof it == 'object' ? it !== null : isCallable(it);
|
|
79
302
|
};
|
|
80
303
|
|
|
81
304
|
var descriptors = !fails(function () {
|
|
305
|
+
// eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
|
|
82
306
|
return Object.defineProperty({}, 1, {
|
|
83
307
|
get: function () {
|
|
84
308
|
return 7;
|
|
@@ -86,10 +310,6 @@ var descriptors = !fails(function () {
|
|
|
86
310
|
})[1] != 7;
|
|
87
311
|
});
|
|
88
312
|
|
|
89
|
-
var isObject = function (it) {
|
|
90
|
-
return typeof it === 'object' ? it !== null : typeof it === 'function';
|
|
91
|
-
};
|
|
92
|
-
|
|
93
313
|
var document$1 = global_1.document; // typeof document.createElement is 'object' in old IE
|
|
94
314
|
|
|
95
315
|
var EXISTS = isObject(document$1) && isObject(document$1.createElement);
|
|
@@ -99,6 +319,7 @@ var documentCreateElement = function (it) {
|
|
|
99
319
|
};
|
|
100
320
|
|
|
101
321
|
var ie8DomDefine = !descriptors && !fails(function () {
|
|
322
|
+
// eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
|
|
102
323
|
return Object.defineProperty(documentCreateElement('div'), 'a', {
|
|
103
324
|
get: function () {
|
|
104
325
|
return 7;
|
|
@@ -106,40 +327,142 @@ var ie8DomDefine = !descriptors && !fails(function () {
|
|
|
106
327
|
}).a != 7;
|
|
107
328
|
});
|
|
108
329
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
330
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
|
|
331
|
+
|
|
332
|
+
var v8PrototypeDefineBug = descriptors && fails(function () {
|
|
333
|
+
// eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
|
|
334
|
+
return Object.defineProperty(function () {
|
|
335
|
+
/* empty */
|
|
336
|
+
}, 'prototype', {
|
|
337
|
+
value: 42,
|
|
338
|
+
writable: false
|
|
339
|
+
}).prototype != 42;
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
var String$2 = global_1.String;
|
|
343
|
+
var TypeError$2 = global_1.TypeError; // `Assert: Type(argument) is Object`
|
|
344
|
+
|
|
345
|
+
var anObject = function (argument) {
|
|
346
|
+
if (isObject(argument)) return argument;
|
|
347
|
+
throw TypeError$2(String$2(argument) + ' is not an object');
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
var call$1 = Function.prototype.call;
|
|
351
|
+
var functionCall = functionBindNative ? call$1.bind(call$1) : function () {
|
|
352
|
+
return call$1.apply(call$1, arguments);
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
|
|
356
|
+
|
|
357
|
+
var Object$3 = global_1.Object;
|
|
358
|
+
var isSymbol = useSymbolAsUid ? function (it) {
|
|
359
|
+
return typeof it == 'symbol';
|
|
360
|
+
} : function (it) {
|
|
361
|
+
var $Symbol = getBuiltIn('Symbol');
|
|
362
|
+
return isCallable($Symbol) && objectIsPrototypeOf($Symbol.prototype, Object$3(it));
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
var String$3 = global_1.String;
|
|
366
|
+
|
|
367
|
+
var tryToString = function (argument) {
|
|
368
|
+
try {
|
|
369
|
+
return String$3(argument);
|
|
370
|
+
} catch (error) {
|
|
371
|
+
return 'Object';
|
|
112
372
|
}
|
|
373
|
+
};
|
|
113
374
|
|
|
114
|
-
|
|
375
|
+
var TypeError$3 = global_1.TypeError; // `Assert: IsCallable(argument) is true`
|
|
376
|
+
|
|
377
|
+
var aCallable = function (argument) {
|
|
378
|
+
if (isCallable(argument)) return argument;
|
|
379
|
+
throw TypeError$3(tryToString(argument) + ' is not a function');
|
|
115
380
|
};
|
|
116
381
|
|
|
117
|
-
// https://tc39.
|
|
118
|
-
|
|
119
|
-
|
|
382
|
+
// https://tc39.es/ecma262/#sec-getmethod
|
|
383
|
+
|
|
384
|
+
var getMethod = function (V, P) {
|
|
385
|
+
var func = V[P];
|
|
386
|
+
return func == null ? undefined : aCallable(func);
|
|
387
|
+
};
|
|
120
388
|
|
|
121
|
-
var
|
|
122
|
-
|
|
389
|
+
var TypeError$4 = global_1.TypeError; // `OrdinaryToPrimitive` abstract operation
|
|
390
|
+
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
|
|
391
|
+
|
|
392
|
+
var ordinaryToPrimitive = function (input, pref) {
|
|
123
393
|
var fn, val;
|
|
124
|
-
if (
|
|
125
|
-
if (
|
|
126
|
-
if (
|
|
127
|
-
throw TypeError("Can't convert object to primitive value");
|
|
394
|
+
if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
|
|
395
|
+
if (isCallable(fn = input.valueOf) && !isObject(val = functionCall(fn, input))) return val;
|
|
396
|
+
if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
|
|
397
|
+
throw TypeError$4("Can't convert object to primitive value");
|
|
398
|
+
};
|
|
399
|
+
|
|
400
|
+
var TypeError$5 = global_1.TypeError;
|
|
401
|
+
var TO_PRIMITIVE = wellKnownSymbol('toPrimitive'); // `ToPrimitive` abstract operation
|
|
402
|
+
// https://tc39.es/ecma262/#sec-toprimitive
|
|
403
|
+
|
|
404
|
+
var toPrimitive = function (input, pref) {
|
|
405
|
+
if (!isObject(input) || isSymbol(input)) return input;
|
|
406
|
+
var exoticToPrim = getMethod(input, TO_PRIMITIVE);
|
|
407
|
+
var result;
|
|
408
|
+
|
|
409
|
+
if (exoticToPrim) {
|
|
410
|
+
if (pref === undefined) pref = 'default';
|
|
411
|
+
result = functionCall(exoticToPrim, input, pref);
|
|
412
|
+
if (!isObject(result) || isSymbol(result)) return result;
|
|
413
|
+
throw TypeError$5("Can't convert object to primitive value");
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
if (pref === undefined) pref = 'number';
|
|
417
|
+
return ordinaryToPrimitive(input, pref);
|
|
128
418
|
};
|
|
129
419
|
|
|
130
|
-
|
|
131
|
-
// https://tc39.github.io/ecma262/#sec-object.defineproperty
|
|
420
|
+
// https://tc39.es/ecma262/#sec-topropertykey
|
|
132
421
|
|
|
133
|
-
var
|
|
422
|
+
var toPropertyKey = function (argument) {
|
|
423
|
+
var key = toPrimitive(argument, 'string');
|
|
424
|
+
return isSymbol(key) ? key : key + '';
|
|
425
|
+
};
|
|
426
|
+
|
|
427
|
+
var TypeError$6 = global_1.TypeError; // eslint-disable-next-line es-x/no-object-defineproperty -- safe
|
|
428
|
+
|
|
429
|
+
var $defineProperty = Object.defineProperty; // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
|
|
430
|
+
|
|
431
|
+
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
432
|
+
var ENUMERABLE = 'enumerable';
|
|
433
|
+
var CONFIGURABLE = 'configurable';
|
|
434
|
+
var WRITABLE = 'writable'; // `Object.defineProperty` method
|
|
435
|
+
// https://tc39.es/ecma262/#sec-object.defineproperty
|
|
436
|
+
|
|
437
|
+
var f = descriptors ? v8PrototypeDefineBug ? function defineProperty(O, P, Attributes) {
|
|
134
438
|
anObject(O);
|
|
135
|
-
P =
|
|
439
|
+
P = toPropertyKey(P);
|
|
440
|
+
anObject(Attributes);
|
|
441
|
+
|
|
442
|
+
if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
|
|
443
|
+
var current = $getOwnPropertyDescriptor(O, P);
|
|
444
|
+
|
|
445
|
+
if (current && current[WRITABLE]) {
|
|
446
|
+
O[P] = Attributes.value;
|
|
447
|
+
Attributes = {
|
|
448
|
+
configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
|
|
449
|
+
enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
|
|
450
|
+
writable: false
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
return $defineProperty(O, P, Attributes);
|
|
456
|
+
} : $defineProperty : function defineProperty(O, P, Attributes) {
|
|
457
|
+
anObject(O);
|
|
458
|
+
P = toPropertyKey(P);
|
|
136
459
|
anObject(Attributes);
|
|
137
460
|
if (ie8DomDefine) try {
|
|
138
|
-
return
|
|
461
|
+
return $defineProperty(O, P, Attributes);
|
|
139
462
|
} catch (error) {
|
|
140
463
|
/* empty */
|
|
141
464
|
}
|
|
142
|
-
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
|
|
465
|
+
if ('get' in Attributes || 'set' in Attributes) throw TypeError$6('Accessors not supported');
|
|
143
466
|
if ('value' in Attributes) O[P] = Attributes.value;
|
|
144
467
|
return O;
|
|
145
468
|
};
|
|
@@ -163,56 +486,6 @@ var createNonEnumerableProperty = descriptors ? function (object, key, value) {
|
|
|
163
486
|
return object;
|
|
164
487
|
};
|
|
165
488
|
|
|
166
|
-
var setGlobal = function (key, value) {
|
|
167
|
-
try {
|
|
168
|
-
createNonEnumerableProperty(global_1, key, value);
|
|
169
|
-
} catch (error) {
|
|
170
|
-
global_1[key] = value;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
return value;
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
var SHARED = '__core-js_shared__';
|
|
177
|
-
var store = global_1[SHARED] || setGlobal(SHARED, {});
|
|
178
|
-
var sharedStore = store;
|
|
179
|
-
|
|
180
|
-
var functionToString = Function.toString; // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
|
|
181
|
-
|
|
182
|
-
if (typeof sharedStore.inspectSource != 'function') {
|
|
183
|
-
sharedStore.inspectSource = function (it) {
|
|
184
|
-
return functionToString.call(it);
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
var inspectSource = sharedStore.inspectSource;
|
|
189
|
-
|
|
190
|
-
var WeakMap = global_1.WeakMap;
|
|
191
|
-
var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
|
|
192
|
-
|
|
193
|
-
var hasOwnProperty = {}.hasOwnProperty;
|
|
194
|
-
|
|
195
|
-
var has = function (it, key) {
|
|
196
|
-
return hasOwnProperty.call(it, key);
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
var shared = createCommonjsModule(function (module) {
|
|
200
|
-
(module.exports = function (key, value) {
|
|
201
|
-
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
|
202
|
-
})('versions', []).push({
|
|
203
|
-
version: '3.8.1',
|
|
204
|
-
mode: 'global',
|
|
205
|
-
copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
|
|
206
|
-
});
|
|
207
|
-
});
|
|
208
|
-
|
|
209
|
-
var id = 0;
|
|
210
|
-
var postfix = Math.random();
|
|
211
|
-
|
|
212
|
-
var uid = function (key) {
|
|
213
|
-
return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
|
|
214
|
-
};
|
|
215
|
-
|
|
216
489
|
var keys = shared('keys');
|
|
217
490
|
|
|
218
491
|
var sharedKey = function (key) {
|
|
@@ -221,11 +494,13 @@ var sharedKey = function (key) {
|
|
|
221
494
|
|
|
222
495
|
var hiddenKeys = {};
|
|
223
496
|
|
|
497
|
+
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
|
498
|
+
var TypeError$7 = global_1.TypeError;
|
|
224
499
|
var WeakMap$1 = global_1.WeakMap;
|
|
225
|
-
var set, get, has
|
|
500
|
+
var set, get, has;
|
|
226
501
|
|
|
227
502
|
var enforce = function (it) {
|
|
228
|
-
return has
|
|
503
|
+
return has(it) ? get(it) : set(it, {});
|
|
229
504
|
};
|
|
230
505
|
|
|
231
506
|
var getterFor = function (TYPE) {
|
|
@@ -233,113 +508,128 @@ var getterFor = function (TYPE) {
|
|
|
233
508
|
var state;
|
|
234
509
|
|
|
235
510
|
if (!isObject(it) || (state = get(it)).type !== TYPE) {
|
|
236
|
-
throw TypeError('Incompatible receiver, ' + TYPE + ' required');
|
|
511
|
+
throw TypeError$7('Incompatible receiver, ' + TYPE + ' required');
|
|
237
512
|
}
|
|
238
513
|
|
|
239
514
|
return state;
|
|
240
515
|
};
|
|
241
516
|
};
|
|
242
517
|
|
|
243
|
-
if (nativeWeakMap) {
|
|
518
|
+
if (nativeWeakMap || sharedStore.state) {
|
|
244
519
|
var store$1 = sharedStore.state || (sharedStore.state = new WeakMap$1());
|
|
245
|
-
var wmget = store$1.get;
|
|
246
|
-
var wmhas = store$1.has;
|
|
247
|
-
var wmset = store$1.set;
|
|
520
|
+
var wmget = functionUncurryThis(store$1.get);
|
|
521
|
+
var wmhas = functionUncurryThis(store$1.has);
|
|
522
|
+
var wmset = functionUncurryThis(store$1.set);
|
|
248
523
|
|
|
249
524
|
set = function (it, metadata) {
|
|
525
|
+
if (wmhas(store$1, it)) throw new TypeError$7(OBJECT_ALREADY_INITIALIZED);
|
|
250
526
|
metadata.facade = it;
|
|
251
|
-
wmset
|
|
527
|
+
wmset(store$1, it, metadata);
|
|
252
528
|
return metadata;
|
|
253
529
|
};
|
|
254
530
|
|
|
255
531
|
get = function (it) {
|
|
256
|
-
return wmget
|
|
532
|
+
return wmget(store$1, it) || {};
|
|
257
533
|
};
|
|
258
534
|
|
|
259
|
-
has
|
|
260
|
-
return wmhas
|
|
535
|
+
has = function (it) {
|
|
536
|
+
return wmhas(store$1, it);
|
|
261
537
|
};
|
|
262
538
|
} else {
|
|
263
539
|
var STATE = sharedKey('state');
|
|
264
540
|
hiddenKeys[STATE] = true;
|
|
265
541
|
|
|
266
542
|
set = function (it, metadata) {
|
|
543
|
+
if (hasOwnProperty_1(it, STATE)) throw new TypeError$7(OBJECT_ALREADY_INITIALIZED);
|
|
267
544
|
metadata.facade = it;
|
|
268
545
|
createNonEnumerableProperty(it, STATE, metadata);
|
|
269
546
|
return metadata;
|
|
270
547
|
};
|
|
271
548
|
|
|
272
549
|
get = function (it) {
|
|
273
|
-
return
|
|
550
|
+
return hasOwnProperty_1(it, STATE) ? it[STATE] : {};
|
|
274
551
|
};
|
|
275
552
|
|
|
276
|
-
has
|
|
277
|
-
return
|
|
553
|
+
has = function (it) {
|
|
554
|
+
return hasOwnProperty_1(it, STATE);
|
|
278
555
|
};
|
|
279
556
|
}
|
|
280
557
|
|
|
281
558
|
var internalState = {
|
|
282
559
|
set: set,
|
|
283
560
|
get: get,
|
|
284
|
-
has: has
|
|
561
|
+
has: has,
|
|
285
562
|
enforce: enforce,
|
|
286
563
|
getterFor: getterFor
|
|
287
564
|
};
|
|
288
565
|
|
|
289
|
-
var
|
|
566
|
+
var $propertyIsEnumerable = {}.propertyIsEnumerable; // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
|
|
567
|
+
|
|
290
568
|
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // Nashorn ~ JDK8 bug
|
|
291
569
|
|
|
292
|
-
var NASHORN_BUG = getOwnPropertyDescriptor &&
|
|
570
|
+
var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({
|
|
293
571
|
1: 2
|
|
294
572
|
}, 1); // `Object.prototype.propertyIsEnumerable` method implementation
|
|
295
|
-
// https://tc39.
|
|
573
|
+
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
|
|
296
574
|
|
|
297
575
|
var f$1 = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
|
298
576
|
var descriptor = getOwnPropertyDescriptor(this, V);
|
|
299
577
|
return !!descriptor && descriptor.enumerable;
|
|
300
|
-
} :
|
|
578
|
+
} : $propertyIsEnumerable;
|
|
301
579
|
var objectPropertyIsEnumerable = {
|
|
302
580
|
f: f$1
|
|
303
581
|
};
|
|
304
582
|
|
|
305
|
-
var
|
|
306
|
-
|
|
307
|
-
var classofRaw = function (it) {
|
|
308
|
-
return toString.call(it).slice(8, -1);
|
|
309
|
-
};
|
|
310
|
-
|
|
311
|
-
var split = ''.split; // fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
583
|
+
var Object$4 = global_1.Object;
|
|
584
|
+
var split = functionUncurryThis(''.split); // fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
312
585
|
|
|
313
586
|
var indexedObject = fails(function () {
|
|
314
587
|
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
|
|
315
|
-
// eslint-disable-next-line no-prototype-builtins
|
|
316
|
-
return !Object('z').propertyIsEnumerable(0);
|
|
588
|
+
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
589
|
+
return !Object$4('z').propertyIsEnumerable(0);
|
|
317
590
|
}) ? function (it) {
|
|
318
|
-
return classofRaw(it) == 'String' ? split
|
|
319
|
-
} : Object;
|
|
591
|
+
return classofRaw(it) == 'String' ? split(it, '') : Object$4(it);
|
|
592
|
+
} : Object$4;
|
|
320
593
|
|
|
321
594
|
var toIndexedObject = function (it) {
|
|
322
595
|
return indexedObject(requireObjectCoercible(it));
|
|
323
596
|
};
|
|
324
597
|
|
|
325
|
-
var
|
|
326
|
-
// https://tc39.
|
|
598
|
+
var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor; // `Object.getOwnPropertyDescriptor` method
|
|
599
|
+
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
|
|
327
600
|
|
|
328
|
-
var f$2 = descriptors ?
|
|
601
|
+
var f$2 = descriptors ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
|
|
329
602
|
O = toIndexedObject(O);
|
|
330
|
-
P =
|
|
603
|
+
P = toPropertyKey(P);
|
|
331
604
|
if (ie8DomDefine) try {
|
|
332
|
-
return
|
|
605
|
+
return $getOwnPropertyDescriptor$1(O, P);
|
|
333
606
|
} catch (error) {
|
|
334
607
|
/* empty */
|
|
335
608
|
}
|
|
336
|
-
if (
|
|
609
|
+
if (hasOwnProperty_1(O, P)) return createPropertyDescriptor(!functionCall(objectPropertyIsEnumerable.f, O, P), O[P]);
|
|
337
610
|
};
|
|
338
611
|
var objectGetOwnPropertyDescriptor = {
|
|
339
612
|
f: f$2
|
|
340
613
|
};
|
|
341
614
|
|
|
615
|
+
var FunctionPrototype$1 = Function.prototype; // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
|
|
616
|
+
|
|
617
|
+
var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
|
|
618
|
+
var EXISTS$1 = hasOwnProperty_1(FunctionPrototype$1, 'name'); // additional protection from minified / mangled / dropped function names
|
|
619
|
+
|
|
620
|
+
var PROPER = EXISTS$1 && function something() {
|
|
621
|
+
/* empty */
|
|
622
|
+
}.name === 'something';
|
|
623
|
+
|
|
624
|
+
var CONFIGURABLE$1 = EXISTS$1 && (!descriptors || descriptors && getDescriptor(FunctionPrototype$1, 'name').configurable);
|
|
625
|
+
var functionName = {
|
|
626
|
+
EXISTS: EXISTS$1,
|
|
627
|
+
PROPER: PROPER,
|
|
628
|
+
CONFIGURABLE: CONFIGURABLE$1
|
|
629
|
+
};
|
|
630
|
+
|
|
342
631
|
var redefine = createCommonjsModule(function (module) {
|
|
632
|
+
var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
|
|
343
633
|
var getInternalState = internalState.get;
|
|
344
634
|
var enforceInternalState = internalState.enforce;
|
|
345
635
|
var TEMPLATE = String(String).split('String');
|
|
@@ -347,17 +637,22 @@ var redefine = createCommonjsModule(function (module) {
|
|
|
347
637
|
var unsafe = options ? !!options.unsafe : false;
|
|
348
638
|
var simple = options ? !!options.enumerable : false;
|
|
349
639
|
var noTargetGet = options ? !!options.noTargetGet : false;
|
|
640
|
+
var name = options && options.name !== undefined ? options.name : key;
|
|
350
641
|
var state;
|
|
351
642
|
|
|
352
|
-
if (
|
|
353
|
-
if (
|
|
354
|
-
|
|
643
|
+
if (isCallable(value)) {
|
|
644
|
+
if (String(name).slice(0, 7) === 'Symbol(') {
|
|
645
|
+
name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
if (!hasOwnProperty_1(value, 'name') || CONFIGURABLE_FUNCTION_NAME && value.name !== name) {
|
|
649
|
+
createNonEnumerableProperty(value, 'name', name);
|
|
355
650
|
}
|
|
356
651
|
|
|
357
652
|
state = enforceInternalState(value);
|
|
358
653
|
|
|
359
654
|
if (!state.source) {
|
|
360
|
-
state.source = TEMPLATE.join(typeof
|
|
655
|
+
state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
|
|
361
656
|
}
|
|
362
657
|
}
|
|
363
658
|
|
|
@@ -372,47 +667,43 @@ var redefine = createCommonjsModule(function (module) {
|
|
|
372
667
|
|
|
373
668
|
if (simple) O[key] = value;else createNonEnumerableProperty(O, key, value); // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
|
374
669
|
})(Function.prototype, 'toString', function toString() {
|
|
375
|
-
return
|
|
670
|
+
return isCallable(this) && getInternalState(this).source || inspectSource(this);
|
|
376
671
|
});
|
|
377
672
|
});
|
|
378
673
|
|
|
379
|
-
var
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
};
|
|
674
|
+
var max = Math.max;
|
|
675
|
+
var min = Math.min; // Helper for a popular repeating case of the spec:
|
|
676
|
+
// Let integer be ? ToInteger(index).
|
|
677
|
+
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
|
|
384
678
|
|
|
385
|
-
var
|
|
386
|
-
|
|
679
|
+
var toAbsoluteIndex = function (index, length) {
|
|
680
|
+
var integer = toIntegerOrInfinity(index);
|
|
681
|
+
return integer < 0 ? max(integer + length, 0) : min(integer, length);
|
|
387
682
|
};
|
|
388
683
|
|
|
389
|
-
var min = Math.min; // `ToLength` abstract operation
|
|
390
|
-
// https://tc39.
|
|
684
|
+
var min$1 = Math.min; // `ToLength` abstract operation
|
|
685
|
+
// https://tc39.es/ecma262/#sec-tolength
|
|
391
686
|
|
|
392
687
|
var toLength = function (argument) {
|
|
393
|
-
return argument > 0 ? min(
|
|
688
|
+
return argument > 0 ? min$1(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
394
689
|
};
|
|
395
690
|
|
|
396
|
-
|
|
397
|
-
var min$1 = Math.min; // Helper for a popular repeating case of the spec:
|
|
398
|
-
// Let integer be ? ToInteger(index).
|
|
399
|
-
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
|
|
691
|
+
// https://tc39.es/ecma262/#sec-lengthofarraylike
|
|
400
692
|
|
|
401
|
-
var
|
|
402
|
-
|
|
403
|
-
return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
|
|
693
|
+
var lengthOfArrayLike = function (obj) {
|
|
694
|
+
return toLength(obj.length);
|
|
404
695
|
};
|
|
405
696
|
|
|
406
697
|
var createMethod$1 = function (IS_INCLUDES) {
|
|
407
698
|
return function ($this, el, fromIndex) {
|
|
408
699
|
var O = toIndexedObject($this);
|
|
409
|
-
var length =
|
|
700
|
+
var length = lengthOfArrayLike(O);
|
|
410
701
|
var index = toAbsoluteIndex(fromIndex, length);
|
|
411
702
|
var value; // Array#includes uses SameValueZero equality algorithm
|
|
412
|
-
// eslint-disable-next-line no-self-compare
|
|
703
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
413
704
|
|
|
414
705
|
if (IS_INCLUDES && el != el) while (length > index) {
|
|
415
|
-
value = O[index++]; // eslint-disable-next-line no-self-compare
|
|
706
|
+
value = O[index++]; // eslint-disable-next-line no-self-compare -- NaN check
|
|
416
707
|
|
|
417
708
|
if (value != value) return true; // Array#indexOf ignores holes, Array#includes - not
|
|
418
709
|
} else for (; length > index; index++) {
|
|
@@ -424,14 +715,15 @@ var createMethod$1 = function (IS_INCLUDES) {
|
|
|
424
715
|
|
|
425
716
|
var arrayIncludes = {
|
|
426
717
|
// `Array.prototype.includes` method
|
|
427
|
-
// https://tc39.
|
|
718
|
+
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
428
719
|
includes: createMethod$1(true),
|
|
429
720
|
// `Array.prototype.indexOf` method
|
|
430
|
-
// https://tc39.
|
|
721
|
+
// https://tc39.es/ecma262/#sec-array.prototype.indexof
|
|
431
722
|
indexOf: createMethod$1(false)
|
|
432
723
|
};
|
|
433
724
|
|
|
434
725
|
var indexOf = arrayIncludes.indexOf;
|
|
726
|
+
var push = functionUncurryThis([].push);
|
|
435
727
|
|
|
436
728
|
var objectKeysInternal = function (object, names) {
|
|
437
729
|
var O = toIndexedObject(object);
|
|
@@ -439,11 +731,11 @@ var objectKeysInternal = function (object, names) {
|
|
|
439
731
|
var result = [];
|
|
440
732
|
var key;
|
|
441
733
|
|
|
442
|
-
for (key in O) !
|
|
734
|
+
for (key in O) !hasOwnProperty_1(hiddenKeys, key) && hasOwnProperty_1(O, key) && push(result, key); // Don't enum bug & hidden keys
|
|
443
735
|
|
|
444
736
|
|
|
445
|
-
while (names.length > i) if (
|
|
446
|
-
~indexOf(result, key) ||
|
|
737
|
+
while (names.length > i) if (hasOwnProperty_1(O, key = names[i++])) {
|
|
738
|
+
~indexOf(result, key) || push(result, key);
|
|
447
739
|
}
|
|
448
740
|
|
|
449
741
|
return result;
|
|
@@ -453,7 +745,8 @@ var objectKeysInternal = function (object, names) {
|
|
|
453
745
|
var enumBugKeys = ['constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf'];
|
|
454
746
|
|
|
455
747
|
var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype'); // `Object.getOwnPropertyNames` method
|
|
456
|
-
// https://tc39.
|
|
748
|
+
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
|
749
|
+
// eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
|
|
457
750
|
|
|
458
751
|
var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
|
459
752
|
return objectKeysInternal(O, hiddenKeys$1);
|
|
@@ -463,25 +756,31 @@ var objectGetOwnPropertyNames = {
|
|
|
463
756
|
f: f$3
|
|
464
757
|
};
|
|
465
758
|
|
|
759
|
+
// eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
|
|
466
760
|
var f$4 = Object.getOwnPropertySymbols;
|
|
467
761
|
var objectGetOwnPropertySymbols = {
|
|
468
762
|
f: f$4
|
|
469
763
|
};
|
|
470
764
|
|
|
765
|
+
var concat = functionUncurryThis([].concat); // all object keys, includes non-enumerable and symbols
|
|
766
|
+
|
|
471
767
|
var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
472
768
|
var keys = objectGetOwnPropertyNames.f(anObject(it));
|
|
473
769
|
var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
|
|
474
|
-
return getOwnPropertySymbols ?
|
|
770
|
+
return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
|
|
475
771
|
};
|
|
476
772
|
|
|
477
|
-
var copyConstructorProperties = function (target, source) {
|
|
773
|
+
var copyConstructorProperties = function (target, source, exceptions) {
|
|
478
774
|
var keys = ownKeys(source);
|
|
479
775
|
var defineProperty = objectDefineProperty.f;
|
|
480
776
|
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
|
481
777
|
|
|
482
778
|
for (var i = 0; i < keys.length; i++) {
|
|
483
779
|
var key = keys[i];
|
|
484
|
-
|
|
780
|
+
|
|
781
|
+
if (!hasOwnProperty_1(target, key) && !(exceptions && hasOwnProperty_1(exceptions, key))) {
|
|
782
|
+
defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
|
783
|
+
}
|
|
485
784
|
}
|
|
486
785
|
};
|
|
487
786
|
|
|
@@ -489,7 +788,7 @@ var replacement = /#|\.prototype\./;
|
|
|
489
788
|
|
|
490
789
|
var isForced = function (feature, detection) {
|
|
491
790
|
var value = data[normalize(feature)];
|
|
492
|
-
return value == POLYFILL ? true : value == NATIVE ? false :
|
|
791
|
+
return value == POLYFILL ? true : value == NATIVE ? false : isCallable(detection) ? fails(detection) : !!detection;
|
|
493
792
|
};
|
|
494
793
|
|
|
495
794
|
var normalize = isForced.normalize = function (string) {
|
|
@@ -515,6 +814,7 @@ var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
|
|
|
515
814
|
options.sham - add a flag to not completely full polyfills
|
|
516
815
|
options.enumerable - export as enumerable property
|
|
517
816
|
options.noTargetGet - prevent calling a getter on target
|
|
817
|
+
options.name - the .name of the function if it does not match the key
|
|
518
818
|
*/
|
|
519
819
|
|
|
520
820
|
var _export = function (options, source) {
|
|
@@ -542,7 +842,7 @@ var _export = function (options, source) {
|
|
|
542
842
|
FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); // contained in target
|
|
543
843
|
|
|
544
844
|
if (!FORCED && targetProperty !== undefined) {
|
|
545
|
-
if (typeof sourceProperty
|
|
845
|
+
if (typeof sourceProperty == typeof targetProperty) continue;
|
|
546
846
|
copyConstructorProperties(sourceProperty, targetProperty);
|
|
547
847
|
} // add a flag to not completely full polyfills
|
|
548
848
|
|
|
@@ -556,116 +856,41 @@ var _export = function (options, source) {
|
|
|
556
856
|
}
|
|
557
857
|
};
|
|
558
858
|
|
|
559
|
-
// https://tc39.
|
|
560
|
-
|
|
561
|
-
var toObject = function (argument) {
|
|
562
|
-
return Object(requireObjectCoercible(argument));
|
|
563
|
-
};
|
|
564
|
-
|
|
565
|
-
var correctPrototypeGetter = !fails(function () {
|
|
566
|
-
function F() {
|
|
567
|
-
/* empty */
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
F.prototype.constructor = null;
|
|
571
|
-
return Object.getPrototypeOf(new F()) !== F.prototype;
|
|
572
|
-
});
|
|
573
|
-
|
|
574
|
-
var IE_PROTO = sharedKey('IE_PROTO');
|
|
575
|
-
var ObjectPrototype = Object.prototype; // `Object.getPrototypeOf` method
|
|
576
|
-
// https://tc39.github.io/ecma262/#sec-object.getprototypeof
|
|
577
|
-
|
|
578
|
-
var objectGetPrototypeOf = correctPrototypeGetter ? Object.getPrototypeOf : function (O) {
|
|
579
|
-
O = toObject(O);
|
|
580
|
-
if (has(O, IE_PROTO)) return O[IE_PROTO];
|
|
581
|
-
|
|
582
|
-
if (typeof O.constructor == 'function' && O instanceof O.constructor) {
|
|
583
|
-
return O.constructor.prototype;
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
return O instanceof Object ? ObjectPrototype : null;
|
|
587
|
-
};
|
|
588
|
-
|
|
589
|
-
var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
|
|
590
|
-
// Chrome 38 Symbol has incorrect toString conversion
|
|
591
|
-
// eslint-disable-next-line no-undef
|
|
592
|
-
return !String(Symbol());
|
|
593
|
-
});
|
|
594
|
-
|
|
595
|
-
var useSymbolAsUid = nativeSymbol // eslint-disable-next-line no-undef
|
|
596
|
-
&& !Symbol.sham // eslint-disable-next-line no-undef
|
|
597
|
-
&& typeof Symbol.iterator == 'symbol';
|
|
598
|
-
|
|
599
|
-
var WellKnownSymbolsStore = shared('wks');
|
|
600
|
-
var Symbol$1 = global_1.Symbol;
|
|
601
|
-
var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
|
|
602
|
-
|
|
603
|
-
var wellKnownSymbol = function (name) {
|
|
604
|
-
if (!has(WellKnownSymbolsStore, name)) {
|
|
605
|
-
if (nativeSymbol && has(Symbol$1, name)) WellKnownSymbolsStore[name] = Symbol$1[name];else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
return WellKnownSymbolsStore[name];
|
|
609
|
-
};
|
|
610
|
-
|
|
611
|
-
var ITERATOR = wellKnownSymbol('iterator');
|
|
612
|
-
var BUGGY_SAFARI_ITERATORS = false;
|
|
613
|
-
|
|
614
|
-
var returnThis = function () {
|
|
615
|
-
return this;
|
|
616
|
-
}; // `%IteratorPrototype%` object
|
|
617
|
-
// https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
|
|
621
|
-
|
|
622
|
-
if ([].keys) {
|
|
623
|
-
arrayIterator = [].keys(); // Safari 8 has buggy iterators w/o `next`
|
|
624
|
-
|
|
625
|
-
if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;else {
|
|
626
|
-
PrototypeOfArrayIteratorPrototype = objectGetPrototypeOf(objectGetPrototypeOf(arrayIterator));
|
|
627
|
-
if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
if (IteratorPrototype == undefined) IteratorPrototype = {}; // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
|
|
632
|
-
|
|
633
|
-
if ( !has(IteratorPrototype, ITERATOR)) {
|
|
634
|
-
createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
var iteratorsCore = {
|
|
638
|
-
IteratorPrototype: IteratorPrototype,
|
|
639
|
-
BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
|
|
640
|
-
};
|
|
641
|
-
|
|
642
|
-
// https://tc39.github.io/ecma262/#sec-object.keys
|
|
859
|
+
// https://tc39.es/ecma262/#sec-object.keys
|
|
860
|
+
// eslint-disable-next-line es-x/no-object-keys -- safe
|
|
643
861
|
|
|
644
862
|
var objectKeys = Object.keys || function keys(O) {
|
|
645
863
|
return objectKeysInternal(O, enumBugKeys);
|
|
646
864
|
};
|
|
647
865
|
|
|
648
|
-
// https://tc39.
|
|
866
|
+
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
867
|
+
// eslint-disable-next-line es-x/no-object-defineproperties -- safe
|
|
649
868
|
|
|
650
|
-
var
|
|
869
|
+
var f$5 = descriptors && !v8PrototypeDefineBug ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
651
870
|
anObject(O);
|
|
871
|
+
var props = toIndexedObject(Properties);
|
|
652
872
|
var keys = objectKeys(Properties);
|
|
653
873
|
var length = keys.length;
|
|
654
874
|
var index = 0;
|
|
655
875
|
var key;
|
|
656
876
|
|
|
657
|
-
while (length > index) objectDefineProperty.f(O, key = keys[index++],
|
|
877
|
+
while (length > index) objectDefineProperty.f(O, key = keys[index++], props[key]);
|
|
658
878
|
|
|
659
879
|
return O;
|
|
660
880
|
};
|
|
881
|
+
var objectDefineProperties = {
|
|
882
|
+
f: f$5
|
|
883
|
+
};
|
|
661
884
|
|
|
662
885
|
var html = getBuiltIn('document', 'documentElement');
|
|
663
886
|
|
|
887
|
+
/* global ActiveXObject -- old IE, WSH */
|
|
888
|
+
|
|
664
889
|
var GT = '>';
|
|
665
890
|
var LT = '<';
|
|
666
891
|
var PROTOTYPE = 'prototype';
|
|
667
892
|
var SCRIPT = 'script';
|
|
668
|
-
var IE_PROTO
|
|
893
|
+
var IE_PROTO = sharedKey('IE_PROTO');
|
|
669
894
|
|
|
670
895
|
var EmptyConstructor = function () {
|
|
671
896
|
/* empty */
|
|
@@ -711,13 +936,14 @@ var activeXDocument;
|
|
|
711
936
|
|
|
712
937
|
var NullProtoObject = function () {
|
|
713
938
|
try {
|
|
714
|
-
|
|
715
|
-
activeXDocument = document.domain && new ActiveXObject('htmlfile');
|
|
939
|
+
activeXDocument = new ActiveXObject('htmlfile');
|
|
716
940
|
} catch (error) {
|
|
717
941
|
/* ignore */
|
|
718
942
|
}
|
|
719
943
|
|
|
720
|
-
NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument)
|
|
944
|
+
NullProtoObject = typeof document != 'undefined' ? document.domain && activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) // old IE
|
|
945
|
+
: NullProtoObjectViaIFrame() : NullProtoObjectViaActiveX(activeXDocument); // WSH
|
|
946
|
+
|
|
721
947
|
var length = enumBugKeys.length;
|
|
722
948
|
|
|
723
949
|
while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
|
|
@@ -725,8 +951,9 @@ var NullProtoObject = function () {
|
|
|
725
951
|
return NullProtoObject();
|
|
726
952
|
};
|
|
727
953
|
|
|
728
|
-
hiddenKeys[IE_PROTO
|
|
729
|
-
// https://tc39.
|
|
954
|
+
hiddenKeys[IE_PROTO] = true; // `Object.create` method
|
|
955
|
+
// https://tc39.es/ecma262/#sec-object.create
|
|
956
|
+
// eslint-disable-next-line es-x/no-object-create -- safe
|
|
730
957
|
|
|
731
958
|
var objectCreate = Object.create || function create(O, Properties) {
|
|
732
959
|
var result;
|
|
@@ -736,18 +963,82 @@ var objectCreate = Object.create || function create(O, Properties) {
|
|
|
736
963
|
result = new EmptyConstructor();
|
|
737
964
|
EmptyConstructor[PROTOTYPE] = null; // add "__proto__" for Object.getPrototypeOf polyfill
|
|
738
965
|
|
|
739
|
-
result[IE_PROTO
|
|
966
|
+
result[IE_PROTO] = O;
|
|
740
967
|
} else result = NullProtoObject();
|
|
741
968
|
|
|
742
|
-
return Properties === undefined ? result : objectDefineProperties(result, Properties);
|
|
969
|
+
return Properties === undefined ? result : objectDefineProperties.f(result, Properties);
|
|
743
970
|
};
|
|
744
971
|
|
|
745
|
-
var
|
|
746
|
-
|
|
972
|
+
var correctPrototypeGetter = !fails(function () {
|
|
973
|
+
function F() {
|
|
974
|
+
/* empty */
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
F.prototype.constructor = null; // eslint-disable-next-line es-x/no-object-getprototypeof -- required for testing
|
|
978
|
+
|
|
979
|
+
return Object.getPrototypeOf(new F()) !== F.prototype;
|
|
980
|
+
});
|
|
981
|
+
|
|
982
|
+
var IE_PROTO$1 = sharedKey('IE_PROTO');
|
|
983
|
+
var Object$5 = global_1.Object;
|
|
984
|
+
var ObjectPrototype = Object$5.prototype; // `Object.getPrototypeOf` method
|
|
985
|
+
// https://tc39.es/ecma262/#sec-object.getprototypeof
|
|
986
|
+
|
|
987
|
+
var objectGetPrototypeOf = correctPrototypeGetter ? Object$5.getPrototypeOf : function (O) {
|
|
988
|
+
var object = toObject(O);
|
|
989
|
+
if (hasOwnProperty_1(object, IE_PROTO$1)) return object[IE_PROTO$1];
|
|
990
|
+
var constructor = object.constructor;
|
|
991
|
+
|
|
992
|
+
if (isCallable(constructor) && object instanceof constructor) {
|
|
993
|
+
return constructor.prototype;
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
return object instanceof Object$5 ? ObjectPrototype : null;
|
|
997
|
+
};
|
|
998
|
+
|
|
999
|
+
var ITERATOR = wellKnownSymbol('iterator');
|
|
1000
|
+
var BUGGY_SAFARI_ITERATORS = false; // `%IteratorPrototype%` object
|
|
1001
|
+
// https://tc39.es/ecma262/#sec-%iteratorprototype%-object
|
|
1002
|
+
|
|
1003
|
+
var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
|
|
1004
|
+
/* eslint-disable es-x/no-array-prototype-keys -- safe */
|
|
1005
|
+
|
|
1006
|
+
if ([].keys) {
|
|
1007
|
+
arrayIterator = [].keys(); // Safari 8 has buggy iterators w/o `next`
|
|
1008
|
+
|
|
1009
|
+
if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;else {
|
|
1010
|
+
PrototypeOfArrayIteratorPrototype = objectGetPrototypeOf(objectGetPrototypeOf(arrayIterator));
|
|
1011
|
+
if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
var NEW_ITERATOR_PROTOTYPE = IteratorPrototype == undefined || fails(function () {
|
|
1016
|
+
var test = {}; // FF44- legacy iterators case
|
|
1017
|
+
|
|
1018
|
+
return IteratorPrototype[ITERATOR].call(test) !== test;
|
|
1019
|
+
});
|
|
1020
|
+
if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {}; // `%IteratorPrototype%[@@iterator]()` method
|
|
1021
|
+
// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
|
|
1022
|
+
|
|
1023
|
+
if (!isCallable(IteratorPrototype[ITERATOR])) {
|
|
1024
|
+
redefine(IteratorPrototype, ITERATOR, function () {
|
|
1025
|
+
return this;
|
|
1026
|
+
});
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
var iteratorsCore = {
|
|
1030
|
+
IteratorPrototype: IteratorPrototype,
|
|
1031
|
+
BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
|
|
1032
|
+
};
|
|
747
1033
|
|
|
748
|
-
var
|
|
749
|
-
|
|
750
|
-
|
|
1034
|
+
var defineProperty$1 = objectDefineProperty.f;
|
|
1035
|
+
var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
|
|
1036
|
+
|
|
1037
|
+
var setToStringTag = function (target, TAG, STATIC) {
|
|
1038
|
+
if (target && !STATIC) target = target.prototype;
|
|
1039
|
+
|
|
1040
|
+
if (target && !hasOwnProperty_1(target, TO_STRING_TAG$2)) {
|
|
1041
|
+
defineProperty$1(target, TO_STRING_TAG$2, {
|
|
751
1042
|
configurable: true,
|
|
752
1043
|
value: TAG
|
|
753
1044
|
});
|
|
@@ -758,32 +1049,33 @@ var iterators = {};
|
|
|
758
1049
|
|
|
759
1050
|
var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
|
|
760
1051
|
|
|
761
|
-
var returnThis
|
|
1052
|
+
var returnThis = function () {
|
|
762
1053
|
return this;
|
|
763
1054
|
};
|
|
764
1055
|
|
|
765
|
-
var createIteratorConstructor = function (IteratorConstructor, NAME, next) {
|
|
1056
|
+
var createIteratorConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
|
|
766
1057
|
var TO_STRING_TAG = NAME + ' Iterator';
|
|
767
1058
|
IteratorConstructor.prototype = objectCreate(IteratorPrototype$1, {
|
|
768
|
-
next: createPropertyDescriptor(
|
|
1059
|
+
next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next)
|
|
769
1060
|
});
|
|
770
1061
|
setToStringTag(IteratorConstructor, TO_STRING_TAG, false);
|
|
771
|
-
iterators[TO_STRING_TAG] = returnThis
|
|
1062
|
+
iterators[TO_STRING_TAG] = returnThis;
|
|
772
1063
|
return IteratorConstructor;
|
|
773
1064
|
};
|
|
774
1065
|
|
|
775
|
-
var
|
|
776
|
-
|
|
777
|
-
throw TypeError("Can't set " + String(it) + ' as a prototype');
|
|
778
|
-
}
|
|
1066
|
+
var String$4 = global_1.String;
|
|
1067
|
+
var TypeError$8 = global_1.TypeError;
|
|
779
1068
|
|
|
780
|
-
|
|
1069
|
+
var aPossiblePrototype = function (argument) {
|
|
1070
|
+
if (typeof argument == 'object' || isCallable(argument)) return argument;
|
|
1071
|
+
throw TypeError$8("Can't set " + String$4(argument) + ' as a prototype');
|
|
781
1072
|
};
|
|
782
1073
|
|
|
783
|
-
|
|
1074
|
+
/* eslint-disable no-proto -- safe */
|
|
1075
|
+
// `Object.setPrototypeOf` method
|
|
1076
|
+
// https://tc39.es/ecma262/#sec-object.setprototypeof
|
|
784
1077
|
// Works with __proto__ only. Old v8 can't work with null proto objects.
|
|
785
|
-
|
|
786
|
-
/* eslint-disable no-proto */
|
|
1078
|
+
// eslint-disable-next-line es-x/no-object-setprototypeof -- safe
|
|
787
1079
|
|
|
788
1080
|
var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
|
789
1081
|
var CORRECT_SETTER = false;
|
|
@@ -791,8 +1083,9 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
|
|
|
791
1083
|
var setter;
|
|
792
1084
|
|
|
793
1085
|
try {
|
|
794
|
-
|
|
795
|
-
setter.
|
|
1086
|
+
// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
|
|
1087
|
+
setter = functionUncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
|
|
1088
|
+
setter(test, []);
|
|
796
1089
|
CORRECT_SETTER = test instanceof Array;
|
|
797
1090
|
} catch (error) {
|
|
798
1091
|
/* empty */
|
|
@@ -801,11 +1094,13 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
|
|
|
801
1094
|
return function setPrototypeOf(O, proto) {
|
|
802
1095
|
anObject(O);
|
|
803
1096
|
aPossiblePrototype(proto);
|
|
804
|
-
if (CORRECT_SETTER) setter
|
|
1097
|
+
if (CORRECT_SETTER) setter(O, proto);else O.__proto__ = proto;
|
|
805
1098
|
return O;
|
|
806
1099
|
};
|
|
807
1100
|
}() : undefined);
|
|
808
1101
|
|
|
1102
|
+
var PROPER_FUNCTION_NAME = functionName.PROPER;
|
|
1103
|
+
var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
|
|
809
1104
|
var IteratorPrototype$2 = iteratorsCore.IteratorPrototype;
|
|
810
1105
|
var BUGGY_SAFARI_ITERATORS$1 = iteratorsCore.BUGGY_SAFARI_ITERATORS;
|
|
811
1106
|
var ITERATOR$1 = wellKnownSymbol('iterator');
|
|
@@ -813,7 +1108,7 @@ var KEYS = 'keys';
|
|
|
813
1108
|
var VALUES = 'values';
|
|
814
1109
|
var ENTRIES = 'entries';
|
|
815
1110
|
|
|
816
|
-
var returnThis$
|
|
1111
|
+
var returnThis$1 = function () {
|
|
817
1112
|
return this;
|
|
818
1113
|
};
|
|
819
1114
|
|
|
@@ -857,35 +1152,33 @@ var defineIterator = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
|
|
|
857
1152
|
if (anyNativeIterator) {
|
|
858
1153
|
CurrentIteratorPrototype = objectGetPrototypeOf(anyNativeIterator.call(new Iterable()));
|
|
859
1154
|
|
|
860
|
-
if (
|
|
1155
|
+
if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
|
|
861
1156
|
if ( objectGetPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype$2) {
|
|
862
1157
|
if (objectSetPrototypeOf) {
|
|
863
1158
|
objectSetPrototypeOf(CurrentIteratorPrototype, IteratorPrototype$2);
|
|
864
|
-
} else if (
|
|
865
|
-
|
|
1159
|
+
} else if (!isCallable(CurrentIteratorPrototype[ITERATOR$1])) {
|
|
1160
|
+
redefine(CurrentIteratorPrototype, ITERATOR$1, returnThis$1);
|
|
866
1161
|
}
|
|
867
1162
|
} // Set @@toStringTag to native iterators
|
|
868
1163
|
|
|
869
1164
|
|
|
870
1165
|
setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true);
|
|
871
1166
|
}
|
|
872
|
-
} // fix Array
|
|
1167
|
+
} // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
|
|
873
1168
|
|
|
874
1169
|
|
|
875
|
-
if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
};
|
|
881
|
-
} // define iterator
|
|
882
|
-
|
|
1170
|
+
if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
|
|
1171
|
+
if ( CONFIGURABLE_FUNCTION_NAME) {
|
|
1172
|
+
createNonEnumerableProperty(IterablePrototype, 'name', VALUES);
|
|
1173
|
+
} else {
|
|
1174
|
+
INCORRECT_VALUES_NAME = true;
|
|
883
1175
|
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
1176
|
+
defaultIterator = function values() {
|
|
1177
|
+
return functionCall(nativeIterator, this);
|
|
1178
|
+
};
|
|
1179
|
+
}
|
|
1180
|
+
} // export additional methods
|
|
887
1181
|
|
|
888
|
-
iterators[NAME] = defaultIterator; // export additional methods
|
|
889
1182
|
|
|
890
1183
|
if (DEFAULT) {
|
|
891
1184
|
methods = {
|
|
@@ -902,24 +1195,32 @@ var defineIterator = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
|
|
|
902
1195
|
proto: true,
|
|
903
1196
|
forced: BUGGY_SAFARI_ITERATORS$1 || INCORRECT_VALUES_NAME
|
|
904
1197
|
}, methods);
|
|
1198
|
+
} // define iterator
|
|
1199
|
+
|
|
1200
|
+
|
|
1201
|
+
if ( IterablePrototype[ITERATOR$1] !== defaultIterator) {
|
|
1202
|
+
redefine(IterablePrototype, ITERATOR$1, defaultIterator, {
|
|
1203
|
+
name: DEFAULT
|
|
1204
|
+
});
|
|
905
1205
|
}
|
|
906
1206
|
|
|
1207
|
+
iterators[NAME] = defaultIterator;
|
|
907
1208
|
return methods;
|
|
908
1209
|
};
|
|
909
1210
|
|
|
910
|
-
var charAt = stringMultibyte.charAt;
|
|
1211
|
+
var charAt$1 = stringMultibyte.charAt;
|
|
911
1212
|
var STRING_ITERATOR = 'String Iterator';
|
|
912
1213
|
var setInternalState = internalState.set;
|
|
913
1214
|
var getInternalState = internalState.getterFor(STRING_ITERATOR); // `String.prototype[@@iterator]` method
|
|
914
|
-
// https://tc39.
|
|
1215
|
+
// https://tc39.es/ecma262/#sec-string.prototype-@@iterator
|
|
915
1216
|
|
|
916
1217
|
defineIterator(String, 'String', function (iterated) {
|
|
917
1218
|
setInternalState(this, {
|
|
918
1219
|
type: STRING_ITERATOR,
|
|
919
|
-
string:
|
|
1220
|
+
string: toString_1(iterated),
|
|
920
1221
|
index: 0
|
|
921
1222
|
}); // `%StringIteratorPrototype%.next` method
|
|
922
|
-
// https://tc39.
|
|
1223
|
+
// https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next
|
|
923
1224
|
}, function next() {
|
|
924
1225
|
var state = getInternalState(this);
|
|
925
1226
|
var string = state.string;
|
|
@@ -929,7 +1230,7 @@ defineIterator(String, 'String', function (iterated) {
|
|
|
929
1230
|
value: undefined,
|
|
930
1231
|
done: true
|
|
931
1232
|
};
|
|
932
|
-
point = charAt(string, index);
|
|
1233
|
+
point = charAt$1(string, index);
|
|
933
1234
|
state.index += point.length;
|
|
934
1235
|
return {
|
|
935
1236
|
value: point,
|
|
@@ -937,61 +1238,46 @@ defineIterator(String, 'String', function (iterated) {
|
|
|
937
1238
|
};
|
|
938
1239
|
});
|
|
939
1240
|
|
|
940
|
-
var
|
|
941
|
-
if (typeof it != 'function') {
|
|
942
|
-
throw TypeError(String(it) + ' is not a function');
|
|
943
|
-
}
|
|
1241
|
+
var bind$1 = functionUncurryThis(functionUncurryThis.bind); // optional / simple context binding
|
|
944
1242
|
|
|
945
|
-
|
|
1243
|
+
var functionBindContext = function (fn, that) {
|
|
1244
|
+
aCallable(fn);
|
|
1245
|
+
return that === undefined ? fn : functionBindNative ? bind$1(fn, that) : function
|
|
1246
|
+
/* ...args */
|
|
1247
|
+
() {
|
|
1248
|
+
return fn.apply(that, arguments);
|
|
1249
|
+
};
|
|
946
1250
|
};
|
|
947
1251
|
|
|
948
|
-
var
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
switch (length) {
|
|
953
|
-
case 0:
|
|
954
|
-
return function () {
|
|
955
|
-
return fn.call(that);
|
|
956
|
-
};
|
|
1252
|
+
var iteratorClose = function (iterator, kind, value) {
|
|
1253
|
+
var innerResult, innerError;
|
|
1254
|
+
anObject(iterator);
|
|
957
1255
|
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
return fn.call(that, a);
|
|
961
|
-
};
|
|
1256
|
+
try {
|
|
1257
|
+
innerResult = getMethod(iterator, 'return');
|
|
962
1258
|
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
1259
|
+
if (!innerResult) {
|
|
1260
|
+
if (kind === 'throw') throw value;
|
|
1261
|
+
return value;
|
|
1262
|
+
}
|
|
967
1263
|
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
1264
|
+
innerResult = functionCall(innerResult, iterator);
|
|
1265
|
+
} catch (error) {
|
|
1266
|
+
innerError = true;
|
|
1267
|
+
innerResult = error;
|
|
972
1268
|
}
|
|
973
1269
|
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
};
|
|
979
|
-
};
|
|
980
|
-
|
|
981
|
-
var iteratorClose = function (iterator) {
|
|
982
|
-
var returnMethod = iterator['return'];
|
|
983
|
-
|
|
984
|
-
if (returnMethod !== undefined) {
|
|
985
|
-
return anObject(returnMethod.call(iterator)).value;
|
|
986
|
-
}
|
|
1270
|
+
if (kind === 'throw') throw value;
|
|
1271
|
+
if (innerError) throw innerResult;
|
|
1272
|
+
anObject(innerResult);
|
|
1273
|
+
return value;
|
|
987
1274
|
};
|
|
988
1275
|
|
|
989
1276
|
var callWithSafeIterationClosing = function (iterator, fn, value, ENTRIES) {
|
|
990
1277
|
try {
|
|
991
|
-
return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
|
|
1278
|
+
return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
|
|
992
1279
|
} catch (error) {
|
|
993
|
-
iteratorClose(iterator);
|
|
994
|
-
throw error;
|
|
1280
|
+
iteratorClose(iterator, 'throw', error);
|
|
995
1281
|
}
|
|
996
1282
|
};
|
|
997
1283
|
|
|
@@ -1002,73 +1288,104 @@ var isArrayIteratorMethod = function (it) {
|
|
|
1002
1288
|
return it !== undefined && (iterators.Array === it || ArrayPrototype[ITERATOR$2] === it);
|
|
1003
1289
|
};
|
|
1004
1290
|
|
|
1005
|
-
var
|
|
1006
|
-
|
|
1007
|
-
if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));else object[propertyKey] = value;
|
|
1291
|
+
var noop = function () {
|
|
1292
|
+
/* empty */
|
|
1008
1293
|
};
|
|
1009
1294
|
|
|
1010
|
-
var
|
|
1011
|
-
var
|
|
1012
|
-
|
|
1013
|
-
var
|
|
1295
|
+
var empty = [];
|
|
1296
|
+
var construct = getBuiltIn('Reflect', 'construct');
|
|
1297
|
+
var constructorRegExp = /^\s*(?:class|function)\b/;
|
|
1298
|
+
var exec = functionUncurryThis(constructorRegExp.exec);
|
|
1299
|
+
var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
|
|
1014
1300
|
|
|
1015
|
-
var
|
|
1301
|
+
var isConstructorModern = function isConstructor(argument) {
|
|
1302
|
+
if (!isCallable(argument)) return false;
|
|
1016
1303
|
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1304
|
+
try {
|
|
1305
|
+
construct(noop, empty, argument);
|
|
1306
|
+
return true;
|
|
1307
|
+
} catch (error) {
|
|
1308
|
+
return false;
|
|
1309
|
+
}
|
|
1310
|
+
};
|
|
1311
|
+
|
|
1312
|
+
var isConstructorLegacy = function isConstructor(argument) {
|
|
1313
|
+
if (!isCallable(argument)) return false;
|
|
1314
|
+
|
|
1315
|
+
switch (classof(argument)) {
|
|
1316
|
+
case 'AsyncFunction':
|
|
1317
|
+
case 'GeneratorFunction':
|
|
1318
|
+
case 'AsyncGeneratorFunction':
|
|
1319
|
+
return false;
|
|
1320
|
+
}
|
|
1020
1321
|
|
|
1021
|
-
var tryGet = function (it, key) {
|
|
1022
1322
|
try {
|
|
1023
|
-
|
|
1323
|
+
// we can't check .prototype since constructors produced by .bind haven't it
|
|
1324
|
+
// `Function#toString` throws on some built-it function in some legacy engines
|
|
1325
|
+
// (for example, `DOMQuad` and similar in FF41-)
|
|
1326
|
+
return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
|
|
1024
1327
|
} catch (error) {
|
|
1025
|
-
|
|
1328
|
+
return true;
|
|
1026
1329
|
}
|
|
1027
|
-
};
|
|
1330
|
+
};
|
|
1028
1331
|
|
|
1332
|
+
isConstructorLegacy.sham = true; // `IsConstructor` abstract operation
|
|
1333
|
+
// https://tc39.es/ecma262/#sec-isconstructor
|
|
1029
1334
|
|
|
1030
|
-
var
|
|
1031
|
-
var
|
|
1032
|
-
return
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1335
|
+
var isConstructor = !construct || fails(function () {
|
|
1336
|
+
var called;
|
|
1337
|
+
return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) || !isConstructorModern(function () {
|
|
1338
|
+
called = true;
|
|
1339
|
+
}) || called;
|
|
1340
|
+
}) ? isConstructorLegacy : isConstructorModern;
|
|
1341
|
+
|
|
1342
|
+
var createProperty = function (object, key, value) {
|
|
1343
|
+
var propertyKey = toPropertyKey(key);
|
|
1344
|
+
if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));else object[propertyKey] = value;
|
|
1036
1345
|
};
|
|
1037
1346
|
|
|
1038
1347
|
var ITERATOR$3 = wellKnownSymbol('iterator');
|
|
1039
1348
|
|
|
1040
1349
|
var getIteratorMethod = function (it) {
|
|
1041
|
-
if (it != undefined) return it
|
|
1350
|
+
if (it != undefined) return getMethod(it, ITERATOR$3) || getMethod(it, '@@iterator') || iterators[classof(it)];
|
|
1042
1351
|
};
|
|
1043
1352
|
|
|
1044
|
-
|
|
1353
|
+
var TypeError$9 = global_1.TypeError;
|
|
1045
1354
|
|
|
1355
|
+
var getIterator = function (argument, usingIterator) {
|
|
1356
|
+
var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
|
|
1357
|
+
if (aCallable(iteratorMethod)) return anObject(functionCall(iteratorMethod, argument));
|
|
1358
|
+
throw TypeError$9(tryToString(argument) + ' is not iterable');
|
|
1359
|
+
};
|
|
1360
|
+
|
|
1361
|
+
var Array$1 = global_1.Array; // `Array.from` method implementation
|
|
1362
|
+
// https://tc39.es/ecma262/#sec-array.from
|
|
1046
1363
|
|
|
1047
1364
|
var arrayFrom = function from(arrayLike
|
|
1048
1365
|
/* , mapfn = undefined, thisArg = undefined */
|
|
1049
1366
|
) {
|
|
1050
1367
|
var O = toObject(arrayLike);
|
|
1051
|
-
var
|
|
1368
|
+
var IS_CONSTRUCTOR = isConstructor(this);
|
|
1052
1369
|
var argumentsLength = arguments.length;
|
|
1053
1370
|
var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
|
|
1054
1371
|
var mapping = mapfn !== undefined;
|
|
1372
|
+
if (mapping) mapfn = functionBindContext(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
|
|
1055
1373
|
var iteratorMethod = getIteratorMethod(O);
|
|
1056
1374
|
var index = 0;
|
|
1057
|
-
var length, result, step, iterator, next, value;
|
|
1058
|
-
if (mapping) mapfn = functionBindContext(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2); // if the target is not iterable or it's an array with the default iterator - use a simple case
|
|
1375
|
+
var length, result, step, iterator, next, value; // if the target is not iterable or it's an array with the default iterator - use a simple case
|
|
1059
1376
|
|
|
1060
|
-
if (iteratorMethod
|
|
1061
|
-
iterator =
|
|
1377
|
+
if (iteratorMethod && !(this == Array$1 && isArrayIteratorMethod(iteratorMethod))) {
|
|
1378
|
+
iterator = getIterator(O, iteratorMethod);
|
|
1062
1379
|
next = iterator.next;
|
|
1063
|
-
result = new
|
|
1380
|
+
result = IS_CONSTRUCTOR ? new this() : [];
|
|
1064
1381
|
|
|
1065
|
-
for (; !(step = next
|
|
1382
|
+
for (; !(step = functionCall(next, iterator)).done; index++) {
|
|
1066
1383
|
value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
|
|
1067
1384
|
createProperty(result, index, value);
|
|
1068
1385
|
}
|
|
1069
1386
|
} else {
|
|
1070
|
-
length =
|
|
1071
|
-
result = new
|
|
1387
|
+
length = lengthOfArrayLike(O);
|
|
1388
|
+
result = IS_CONSTRUCTOR ? new this(length) : Array$1(length);
|
|
1072
1389
|
|
|
1073
1390
|
for (; length > index; index++) {
|
|
1074
1391
|
value = mapping ? mapfn(O[index], index) : O[index];
|
|
@@ -1098,7 +1415,7 @@ try {
|
|
|
1098
1415
|
|
|
1099
1416
|
iteratorWithReturn[ITERATOR$4] = function () {
|
|
1100
1417
|
return this;
|
|
1101
|
-
}; // eslint-disable-next-line no-throw-literal
|
|
1418
|
+
}; // eslint-disable-next-line es-x/no-array-from, no-throw-literal -- required for testing
|
|
1102
1419
|
|
|
1103
1420
|
|
|
1104
1421
|
Array.from(iteratorWithReturn, function () {
|
|
@@ -1134,9 +1451,10 @@ var checkCorrectnessOfIteration = function (exec, SKIP_CLOSING) {
|
|
|
1134
1451
|
};
|
|
1135
1452
|
|
|
1136
1453
|
var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {
|
|
1454
|
+
// eslint-disable-next-line es-x/no-array-from -- required for testing
|
|
1137
1455
|
Array.from(iterable);
|
|
1138
1456
|
}); // `Array.from` method
|
|
1139
|
-
// https://tc39.
|
|
1457
|
+
// https://tc39.es/ecma262/#sec-array.from
|
|
1140
1458
|
|
|
1141
1459
|
_export({
|
|
1142
1460
|
target: 'Array',
|
|
@@ -1497,8 +1815,9 @@ var messagesDE = {
|
|
|
1497
1815
|
"eligibility-modal.credit-commitment": "Ein Kredit verpflichtet Sie und muss zurückgezahlt werden. Prüfen Sie Ihre Rückzahlungsfähigkeit, bevor Sie sich verpflichten.",
|
|
1498
1816
|
"eligibility-modal.credit-cost": "Davon Kreditkosten",
|
|
1499
1817
|
"eligibility-modal.credit-cost-amount": "{creditCost} (APR {TAEG})",
|
|
1500
|
-
"eligibility-modal.no-eligibility": "Ups, die Simulation
|
|
1501
|
-
"eligibility-modal.title": "<highlighted>Bezahlen Sie in Raten</highlighted>
|
|
1818
|
+
"eligibility-modal.no-eligibility": "Ups, die Simulation hat anscheinend nicht funktioniert.",
|
|
1819
|
+
"eligibility-modal.title": "<highlighted>Bezahlen Sie in Raten</highlighted> per Kreditkarte mit Alma.",
|
|
1820
|
+
"eligibility-modal.title-deferred": "<highlighted>Bezahlen Sie in Raten</highlighted> oder später per Kreditkarte mit Alma.",
|
|
1502
1821
|
"eligibility-modal.total": "Insgesamt",
|
|
1503
1822
|
"installments.today": "Heutzutage",
|
|
1504
1823
|
"payment-plan-strings.day-abbreviation": "J{numberOfDeferredDays}",
|
|
@@ -1520,7 +1839,8 @@ var messagesEN = {
|
|
|
1520
1839
|
"eligibility-modal.credit-cost": "Of which cost of credit",
|
|
1521
1840
|
"eligibility-modal.credit-cost-amount": "{creditCost} (APR {TAEG})",
|
|
1522
1841
|
"eligibility-modal.no-eligibility": "Oops, looks like the simulation didn't work.",
|
|
1523
|
-
"eligibility-modal.title": "<highlighted>Pay in installments</highlighted>
|
|
1842
|
+
"eligibility-modal.title": "<highlighted>Pay in installments</highlighted> by credit card with Alma.",
|
|
1843
|
+
"eligibility-modal.title-deferred": "<highlighted>Pay in installments</highlighted> or later by credit card with Alma.",
|
|
1524
1844
|
"eligibility-modal.total": "Total",
|
|
1525
1845
|
"installments.today": "Today",
|
|
1526
1846
|
"payment-plan-strings.day-abbreviation": "T{numberOfDeferredDays}",
|
|
@@ -1542,7 +1862,8 @@ var messagesES = {
|
|
|
1542
1862
|
"eligibility-modal.credit-cost": "Coste de crédito (incl. en el total)",
|
|
1543
1863
|
"eligibility-modal.credit-cost-amount": "{creditCost} (TAE {TAEG})",
|
|
1544
1864
|
"eligibility-modal.no-eligibility": "Uy, parece que la simulación no ha funcionado.",
|
|
1545
|
-
"eligibility-modal.title": "<highlighted>Paga a plazos</highlighted>
|
|
1865
|
+
"eligibility-modal.title": "<highlighted>Paga a plazos</highlighted> con tarjeta de crédito con Alma.",
|
|
1866
|
+
"eligibility-modal.title-deferred": "<highlighted>Paga a plazos</highlighted> o más adelante con tu tarjeta, a través de Alma.",
|
|
1546
1867
|
"eligibility-modal.total": "Total",
|
|
1547
1868
|
"installments.today": "Hoy",
|
|
1548
1869
|
"payment-plan-strings.day-abbreviation": "D{numberOfDeferredDays}",
|
|
@@ -1563,8 +1884,9 @@ var messagesFR = {
|
|
|
1563
1884
|
"eligibility-modal.credit-commitment": "Un crédit vous engage et doit être remboursé. Vérifiez vos capacités de remboursement avant de vous engager.",
|
|
1564
1885
|
"eligibility-modal.credit-cost": "Dont coût du crédit",
|
|
1565
1886
|
"eligibility-modal.credit-cost-amount": "{creditCost} (TAEG {TAEG})",
|
|
1566
|
-
"eligibility-modal.no-eligibility": "Oups, il semblerait que la simulation n'
|
|
1567
|
-
"eligibility-modal.title": "<highlighted>Payez en plusieurs fois</highlighted>
|
|
1887
|
+
"eligibility-modal.no-eligibility": "Oups, il semblerait que la simulation n'ait pas fonctionné.",
|
|
1888
|
+
"eligibility-modal.title": "<highlighted>Payez en plusieurs fois</highlighted> par carte bancaire avec Alma.",
|
|
1889
|
+
"eligibility-modal.title-deferred": "<highlighted>Payez en plusieurs fois</highlighted> ou plus tard par carte bancaire avec Alma.",
|
|
1568
1890
|
"eligibility-modal.total": "Total",
|
|
1569
1891
|
"installments.today": "Aujourd'hui",
|
|
1570
1892
|
"payment-plan-strings.day-abbreviation": "J{numberOfDeferredDays}",
|
|
@@ -1586,7 +1908,8 @@ var messagesIT = {
|
|
|
1586
1908
|
"eligibility-modal.credit-cost": "Di cui commissioni",
|
|
1587
1909
|
"eligibility-modal.credit-cost-amount": "{creditCost} (TAEG {TAEG})",
|
|
1588
1910
|
"eligibility-modal.no-eligibility": "Ops, sembra che la simulazione non abbia funzionato.",
|
|
1589
|
-
"eligibility-modal.title": "<highlighted>Paga a rate</highlighted>
|
|
1911
|
+
"eligibility-modal.title": "<highlighted>Paga a rate</highlighted> con carta di credito con Alma.",
|
|
1912
|
+
"eligibility-modal.title-deferred": "<highlighted>Paga a rate</highlighted> e posticipa il pagamento con Alma, senza interessi.",
|
|
1590
1913
|
"eligibility-modal.total": "Totale",
|
|
1591
1914
|
"installments.today": "Oggi",
|
|
1592
1915
|
"payment-plan-strings.day-abbreviation": "G{numberOfDeferredDays}",
|
|
@@ -1608,7 +1931,8 @@ var messagesNL = {
|
|
|
1608
1931
|
"eligibility-modal.credit-cost": "Waarvan kosten van krediet",
|
|
1609
1932
|
"eligibility-modal.credit-cost-amount": "{creditCost} (APR {TAEG})",
|
|
1610
1933
|
"eligibility-modal.no-eligibility": "Oeps, het lijkt erop dat de simulatie niet werkte.",
|
|
1611
|
-
"eligibility-modal.title": "<highlighted>Betaal in termijnen</highlighted>
|
|
1934
|
+
"eligibility-modal.title": "<highlighted>Betaal in termijnen</highlighted> met kredietkaart bij Alma.",
|
|
1935
|
+
"eligibility-modal.title-deferred": "<highlighted>Betaal in termijnen</highlighted> of later per credit card met Alma.",
|
|
1612
1936
|
"eligibility-modal.total": "Totaal",
|
|
1613
1937
|
"installments.today": "Tegenwoordig",
|
|
1614
1938
|
"payment-plan-strings.day-abbreviation": "J{numberOfDeferredDays}",
|
|
@@ -1701,11 +2025,33 @@ async function fetchFromApi(url = '', data, headers) {
|
|
|
1701
2025
|
return response.json();
|
|
1702
2026
|
}
|
|
1703
2027
|
|
|
2028
|
+
const isPlanEligible = (plan, configPlan) => {
|
|
2029
|
+
if (!plan.eligible) {
|
|
2030
|
+
return false;
|
|
2031
|
+
}
|
|
2032
|
+
|
|
2033
|
+
return configPlan ? plan.purchase_amount >= (configPlan == null ? void 0 : configPlan.minAmount) && plan.purchase_amount <= (configPlan == null ? void 0 : configPlan.maxAmount) : false;
|
|
2034
|
+
};
|
|
2035
|
+
|
|
2036
|
+
const getPaymentPlanBoundaries = (plan, configPlan) => {
|
|
2037
|
+
var _plan$constraints;
|
|
2038
|
+
|
|
2039
|
+
// When the plan is not eligible, the purchase amount constraints is given from the merchant config
|
|
2040
|
+
const purchaseAmountConstraints = (_plan$constraints = plan.constraints) == null ? void 0 : _plan$constraints.purchase_amount;
|
|
2041
|
+
|
|
2042
|
+
if (purchaseAmountConstraints && configPlan) {
|
|
2043
|
+
return {
|
|
2044
|
+
minAmount: Math.max(configPlan.minAmount, purchaseAmountConstraints == null ? void 0 : purchaseAmountConstraints.minimum),
|
|
2045
|
+
maxAmount: Math.min(configPlan.maxAmount, purchaseAmountConstraints == null ? void 0 : purchaseAmountConstraints.maximum)
|
|
2046
|
+
};
|
|
2047
|
+
}
|
|
2048
|
+
|
|
2049
|
+
return configPlan != null ? configPlan : {};
|
|
2050
|
+
};
|
|
2051
|
+
|
|
1704
2052
|
const filterELigibility = (eligibilities, configPlans) => {
|
|
1705
2053
|
// Remove p1x
|
|
1706
|
-
const filteredEligibilityPlans = eligibilities.filter(plan => !(plan.installments_count === 1 && plan.deferred_days === 0 && plan.deferred_months === 0)) //
|
|
1707
|
-
.filter(plan => plan.payment_plan) // Remove plans that have a reasons property
|
|
1708
|
-
.filter(plan => !plan.reasons); // If no configPlans was provided, return eligibility response
|
|
2054
|
+
const filteredEligibilityPlans = eligibilities.filter(plan => !(plan.installments_count === 1 && plan.deferred_days === 0 && plan.deferred_months === 0)); // If no configPlans was provided, return eligibility response
|
|
1709
2055
|
|
|
1710
2056
|
if (!configPlans) {
|
|
1711
2057
|
return filteredEligibilityPlans;
|
|
@@ -1720,10 +2066,8 @@ const filterELigibility = (eligibilities, configPlans) => {
|
|
|
1720
2066
|
return plan.installments_count === configPlan.installmentsCount && eligibilityDeferredDays === configPlanDeferredDays;
|
|
1721
2067
|
});
|
|
1722
2068
|
return _extends({}, plan, {
|
|
1723
|
-
eligible:
|
|
1724
|
-
|
|
1725
|
-
maxAmount: relatedConfigPlan == null ? void 0 : relatedConfigPlan.maxAmount
|
|
1726
|
-
});
|
|
2069
|
+
eligible: isPlanEligible(plan, relatedConfigPlan)
|
|
2070
|
+
}, getPaymentPlanBoundaries(plan, relatedConfigPlan));
|
|
1727
2071
|
});
|
|
1728
2072
|
};
|
|
1729
2073
|
|
|
@@ -1790,7 +2134,32 @@ function CrossIcon({
|
|
|
1790
2134
|
}));
|
|
1791
2135
|
}
|
|
1792
2136
|
|
|
1793
|
-
|
|
2137
|
+
/**
|
|
2138
|
+
* Prefix classes to avoid name collisions.
|
|
2139
|
+
*/
|
|
2140
|
+
const prefix = 'alma-eligibility-modal';
|
|
2141
|
+
/**
|
|
2142
|
+
* Class names for the **eligibility modale** widget.
|
|
2143
|
+
* Those classes are intended to be used by the **merchant developer**.
|
|
2144
|
+
*/
|
|
2145
|
+
|
|
2146
|
+
const STATIC_CUSTOMISATION_CLASSES = {
|
|
2147
|
+
leftSide: prefix + '-left-side',
|
|
2148
|
+
rightSide: prefix + '-right-side',
|
|
2149
|
+
title: prefix + '-title',
|
|
2150
|
+
info: prefix + '-info',
|
|
2151
|
+
infoMessage: prefix + '-info-message',
|
|
2152
|
+
eligibilityOptions: prefix + '-eligibility-options',
|
|
2153
|
+
activeOption: prefix + '-active-option',
|
|
2154
|
+
closeButton: prefix + '-close-button',
|
|
2155
|
+
scheduleDetails: prefix + '-schedule-details',
|
|
2156
|
+
scheduleTotal: prefix + '-schedule-total',
|
|
2157
|
+
scheduleCredit: prefix + '-schedule-credit'
|
|
2158
|
+
};
|
|
2159
|
+
|
|
2160
|
+
const _excluded = ["children", "isOpen", "onClose", "className", "contentClassName", "scrollable"];
|
|
2161
|
+
|
|
2162
|
+
const ControlledModal = _ref => {
|
|
1794
2163
|
let {
|
|
1795
2164
|
children,
|
|
1796
2165
|
isOpen,
|
|
@@ -1799,7 +2168,7 @@ const ControlledModal = (_ref) => {
|
|
|
1799
2168
|
contentClassName,
|
|
1800
2169
|
scrollable = false
|
|
1801
2170
|
} = _ref,
|
|
1802
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
2171
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
1803
2172
|
|
|
1804
2173
|
Modal.setAppElement('body');
|
|
1805
2174
|
return /*#__PURE__*/React.createElement(Modal, Object.assign({
|
|
@@ -1819,7 +2188,7 @@ const ControlledModal = (_ref) => {
|
|
|
1819
2188
|
className: s$1.header
|
|
1820
2189
|
}, /*#__PURE__*/React.createElement("button", {
|
|
1821
2190
|
onClick: onClose,
|
|
1822
|
-
className: s$1.closeButton,
|
|
2191
|
+
className: cx(s$1.closeButton, STATIC_CUSTOMISATION_CLASSES.closeButton),
|
|
1823
2192
|
"data-testid": "modal-close-button"
|
|
1824
2193
|
}, /*#__PURE__*/React.createElement(CrossIcon, null))), /*#__PURE__*/React.createElement("div", {
|
|
1825
2194
|
className: cx(s$1.content, contentClassName, {
|
|
@@ -1848,6 +2217,18 @@ const paymentPlanShorthandName = payment => {
|
|
|
1848
2217
|
return `${installmentsCount}x`;
|
|
1849
2218
|
}
|
|
1850
2219
|
};
|
|
2220
|
+
|
|
2221
|
+
const withNoFee = payment => {
|
|
2222
|
+
var _payment$payment_plan;
|
|
2223
|
+
|
|
2224
|
+
if ((_payment$payment_plan = payment.payment_plan) != null && _payment$payment_plan.every(plan => plan.customer_fee === 0 && plan.customer_interest === 0)) {
|
|
2225
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, ' ', /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2226
|
+
id: "payment-plan-strings.no-fee",
|
|
2227
|
+
defaultMessage: '(sans frais)'
|
|
2228
|
+
}));
|
|
2229
|
+
}
|
|
2230
|
+
};
|
|
2231
|
+
|
|
1851
2232
|
const paymentPlanInfoText = payment => {
|
|
1852
2233
|
const {
|
|
1853
2234
|
deferred_days,
|
|
@@ -1856,19 +2237,11 @@ const paymentPlanInfoText = payment => {
|
|
|
1856
2237
|
eligible,
|
|
1857
2238
|
purchase_amount: purchaseAmount,
|
|
1858
2239
|
minAmount = 0,
|
|
1859
|
-
maxAmount = 0
|
|
2240
|
+
maxAmount = 0,
|
|
2241
|
+
payment_plan
|
|
1860
2242
|
} = payment;
|
|
1861
2243
|
const deferredDaysCount = deferred_days + deferred_months * 30;
|
|
1862
2244
|
|
|
1863
|
-
const withNoFee = () => {
|
|
1864
|
-
if (payment.payment_plan.every(plan => plan.customer_fee === 0 && plan.customer_interest === 0)) {
|
|
1865
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, ' ', /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
1866
|
-
id: "payment-plan-strings.no-fee",
|
|
1867
|
-
defaultMessage: '(sans frais)'
|
|
1868
|
-
}));
|
|
1869
|
-
}
|
|
1870
|
-
};
|
|
1871
|
-
|
|
1872
2245
|
if (!eligible) {
|
|
1873
2246
|
return purchaseAmount > maxAmount ? /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
1874
2247
|
id: "payment-plan-strings.ineligible-greater-than-max",
|
|
@@ -1891,26 +2264,31 @@ const paymentPlanInfoText = payment => {
|
|
|
1891
2264
|
})
|
|
1892
2265
|
}
|
|
1893
2266
|
});
|
|
2267
|
+
} else if (!payment_plan) {
|
|
2268
|
+
/* This error should never happen. We added this condition to avoid a typescript warning on
|
|
2269
|
+
payment_plan possibly undefined. As far as we know, it only happens when the plan is not
|
|
2270
|
+
eligible, which is checked above. */
|
|
2271
|
+
throw Error(`No payment plan provided for payment in ${installmentsCount} installments. Please contact us if you see this error.`);
|
|
1894
2272
|
} else if (deferredDaysCount !== 0 && installmentsCount === 1) {
|
|
1895
2273
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
1896
2274
|
id: "payment-plan-strings.deferred",
|
|
1897
2275
|
defaultMessage: "{totalAmount} \u00E0 payer le {dueDate}",
|
|
1898
2276
|
values: {
|
|
1899
2277
|
totalAmount: /*#__PURE__*/React.createElement(FormattedNumber, {
|
|
1900
|
-
value: priceFromCents(
|
|
2278
|
+
value: priceFromCents(payment_plan[0].total_amount),
|
|
1901
2279
|
style: "currency",
|
|
1902
2280
|
currency: "EUR"
|
|
1903
2281
|
}),
|
|
1904
2282
|
dueDate: /*#__PURE__*/React.createElement(FormattedDate, {
|
|
1905
|
-
value: secondsToMilliseconds(
|
|
2283
|
+
value: secondsToMilliseconds(payment_plan[0].due_date),
|
|
1906
2284
|
day: "numeric",
|
|
1907
2285
|
month: "long",
|
|
1908
2286
|
year: "numeric"
|
|
1909
2287
|
})
|
|
1910
2288
|
}
|
|
1911
|
-
}), withNoFee());
|
|
2289
|
+
}), withNoFee(payment));
|
|
1912
2290
|
} else if (installmentsCount > 0) {
|
|
1913
|
-
const areInstallmentsOfSameAmount =
|
|
2291
|
+
const areInstallmentsOfSameAmount = payment_plan == null ? void 0 : payment_plan.every((installment, index) => index === 0 || installment.total_amount === payment_plan[0].total_amount);
|
|
1914
2292
|
|
|
1915
2293
|
if (areInstallmentsOfSameAmount) {
|
|
1916
2294
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
@@ -1918,13 +2296,13 @@ const paymentPlanInfoText = payment => {
|
|
|
1918
2296
|
defaultMessage: "{installmentsCount} x {totalAmount}",
|
|
1919
2297
|
values: {
|
|
1920
2298
|
totalAmount: /*#__PURE__*/React.createElement(FormattedNumber, {
|
|
1921
|
-
value: priceFromCents(
|
|
2299
|
+
value: priceFromCents(payment_plan[0].total_amount),
|
|
1922
2300
|
style: "currency",
|
|
1923
2301
|
currency: "EUR"
|
|
1924
2302
|
}),
|
|
1925
2303
|
installmentsCount
|
|
1926
2304
|
}
|
|
1927
|
-
}), withNoFee());
|
|
2305
|
+
}), withNoFee(payment));
|
|
1928
2306
|
}
|
|
1929
2307
|
|
|
1930
2308
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
@@ -1932,18 +2310,18 @@ const paymentPlanInfoText = payment => {
|
|
|
1932
2310
|
defaultMessage: "{numberOfRemainingInstallments, plural, one {{firstInstallmentAmount} puis {numberOfRemainingInstallments} x {othersInstallmentAmount}} other {{firstInstallmentAmount} puis {numberOfRemainingInstallments} x {othersInstallmentAmount}}}",
|
|
1933
2311
|
values: {
|
|
1934
2312
|
firstInstallmentAmount: /*#__PURE__*/React.createElement(FormattedNumber, {
|
|
1935
|
-
value: priceFromCents(
|
|
2313
|
+
value: priceFromCents(payment_plan[0].total_amount),
|
|
1936
2314
|
style: "currency",
|
|
1937
2315
|
currency: "EUR"
|
|
1938
2316
|
}),
|
|
1939
2317
|
numberOfRemainingInstallments: installmentsCount - 1,
|
|
1940
2318
|
othersInstallmentAmount: /*#__PURE__*/React.createElement(FormattedNumber, {
|
|
1941
|
-
value: priceFromCents(
|
|
2319
|
+
value: priceFromCents(payment_plan[1].total_amount),
|
|
1942
2320
|
style: "currency",
|
|
1943
2321
|
currency: "EUR"
|
|
1944
2322
|
})
|
|
1945
2323
|
}
|
|
1946
|
-
}), withNoFee());
|
|
2324
|
+
}), withNoFee(payment));
|
|
1947
2325
|
}
|
|
1948
2326
|
|
|
1949
2327
|
return /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
@@ -1959,11 +2337,11 @@ const EligibilityPlansButtons = ({
|
|
|
1959
2337
|
currentPlanIndex,
|
|
1960
2338
|
setCurrentPlanIndex
|
|
1961
2339
|
}) => /*#__PURE__*/React.createElement("div", {
|
|
1962
|
-
className: s$2.buttons
|
|
2340
|
+
className: cx(s$2.buttons, STATIC_CUSTOMISATION_CLASSES.eligibilityOptions)
|
|
1963
2341
|
}, eligibilityPlans.map((eligibilityPlan, index) => /*#__PURE__*/React.createElement("button", {
|
|
1964
2342
|
key: index,
|
|
1965
2343
|
className: cx({
|
|
1966
|
-
[s$2.active]: index === currentPlanIndex
|
|
2344
|
+
[cx(s$2.active, STATIC_CUSTOMISATION_CLASSES.activeOption)]: index === currentPlanIndex
|
|
1967
2345
|
}),
|
|
1968
2346
|
onClick: () => setCurrentPlanIndex(index)
|
|
1969
2347
|
}, paymentPlanShorthandName(eligibilityPlan))));
|
|
@@ -1980,10 +2358,10 @@ const Schedule = ({
|
|
|
1980
2358
|
const isCredit = currentPlan && currentPlan.installments_count > 4;
|
|
1981
2359
|
const intl = useIntl();
|
|
1982
2360
|
return /*#__PURE__*/React.createElement("div", {
|
|
1983
|
-
className: s$3.schedule,
|
|
2361
|
+
className: cx(s$3.schedule, STATIC_CUSTOMISATION_CLASSES.scheduleDetails),
|
|
1984
2362
|
"data-testid": "modal-installments-element"
|
|
1985
2363
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1986
|
-
className: cx(s$3.scheduleLine, s$3.total)
|
|
2364
|
+
className: cx(s$3.scheduleLine, s$3.total, STATIC_CUSTOMISATION_CLASSES.scheduleTotal)
|
|
1987
2365
|
}, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
1988
2366
|
id: "eligibility-modal.total",
|
|
1989
2367
|
defaultMessage: "Total"
|
|
@@ -1992,7 +2370,7 @@ const Schedule = ({
|
|
|
1992
2370
|
style: "currency",
|
|
1993
2371
|
currency: "EUR"
|
|
1994
2372
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
1995
|
-
className: cx(s$3.scheduleLine, s$3.creditCost)
|
|
2373
|
+
className: cx(s$3.scheduleLine, s$3.creditCost, STATIC_CUSTOMISATION_CLASSES.scheduleCredit)
|
|
1996
2374
|
}, isCredit ? /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
1997
2375
|
id: "eligibility-modal.credit-cost",
|
|
1998
2376
|
defaultMessage: "Dont co\u00FBt du cr\u00E9dit"
|
|
@@ -2042,13 +2420,15 @@ const Schedule = ({
|
|
|
2042
2420
|
var s$4 = {"list":"_180ro","listItem":"_1HqCO","bullet":"_3B8wx"};
|
|
2043
2421
|
|
|
2044
2422
|
const Info = () => /*#__PURE__*/React.createElement("div", {
|
|
2045
|
-
className: s$4.list,
|
|
2423
|
+
className: cx(s$4.list, STATIC_CUSTOMISATION_CLASSES.info),
|
|
2046
2424
|
"data-testid": "modal-info-element"
|
|
2047
2425
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2048
2426
|
className: s$4.listItem
|
|
2049
2427
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2050
2428
|
className: s$4.bullet
|
|
2051
|
-
}, "1"), /*#__PURE__*/React.createElement("div",
|
|
2429
|
+
}, "1"), /*#__PURE__*/React.createElement("div", {
|
|
2430
|
+
className: STATIC_CUSTOMISATION_CLASSES.infoMessage
|
|
2431
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2052
2432
|
id: "eligibility-modal.bullet-1",
|
|
2053
2433
|
defaultMessage: "Choisissez <strong>Alma</strong> au moment du paiement.",
|
|
2054
2434
|
values: {
|
|
@@ -2058,7 +2438,9 @@ const Info = () => /*#__PURE__*/React.createElement("div", {
|
|
|
2058
2438
|
className: s$4.listItem
|
|
2059
2439
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2060
2440
|
className: s$4.bullet
|
|
2061
|
-
}, "2"), /*#__PURE__*/React.createElement("div",
|
|
2441
|
+
}, "2"), /*#__PURE__*/React.createElement("div", {
|
|
2442
|
+
className: STATIC_CUSTOMISATION_CLASSES.infoMessage
|
|
2443
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2062
2444
|
id: "eligibility-modal.bullet-2",
|
|
2063
2445
|
defaultMessage: "Renseignez les <strong>informations</strong> demand\u00E9es.",
|
|
2064
2446
|
values: {
|
|
@@ -2068,7 +2450,9 @@ const Info = () => /*#__PURE__*/React.createElement("div", {
|
|
|
2068
2450
|
className: s$4.listItem
|
|
2069
2451
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2070
2452
|
className: s$4.bullet
|
|
2071
|
-
}, "3"), /*#__PURE__*/React.createElement("div",
|
|
2453
|
+
}, "3"), /*#__PURE__*/React.createElement("div", {
|
|
2454
|
+
className: STATIC_CUSTOMISATION_CLASSES.infoMessage
|
|
2455
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2072
2456
|
id: "eligibility-modal.bullet-3",
|
|
2073
2457
|
defaultMessage: "La validation de votre paiement <strong>instantan\u00E9e</strong> !",
|
|
2074
2458
|
values: {
|
|
@@ -2118,28 +2502,39 @@ const Logo = () => /*#__PURE__*/React.createElement("div", {
|
|
|
2118
2502
|
|
|
2119
2503
|
var s$6 = {"title":"_3ERx-"};
|
|
2120
2504
|
|
|
2121
|
-
const Title = (
|
|
2122
|
-
|
|
2505
|
+
const Title = ({
|
|
2506
|
+
isSomePlanDeferred
|
|
2507
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
2508
|
+
className: cx(s$6.title, STATIC_CUSTOMISATION_CLASSES.title),
|
|
2123
2509
|
"data-testid": "modal-title-element"
|
|
2124
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2125
|
-
id:
|
|
2510
|
+
}, isSomePlanDeferred ? /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2511
|
+
id: 'eligibility-modal.title-deferred',
|
|
2126
2512
|
defaultMessage: "<highlighted>Payez en plusieurs fois</highlighted> ou plus tard par carte bancaire avec Alma.",
|
|
2127
2513
|
values: {
|
|
2128
2514
|
highlighted: (...chunks) => /*#__PURE__*/React.createElement("span", null, chunks)
|
|
2129
2515
|
}
|
|
2516
|
+
}) : /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2517
|
+
id: 'eligibility-modal.title',
|
|
2518
|
+
defaultMessage: "<highlighted>Payez en plusieurs fois</highlighted> par carte bancaire avec Alma.",
|
|
2519
|
+
values: {
|
|
2520
|
+
highlighted: (...chunks) => /*#__PURE__*/React.createElement("span", null, chunks)
|
|
2521
|
+
}
|
|
2130
2522
|
}));
|
|
2131
2523
|
|
|
2132
2524
|
var s$7 = {"container":"_21g6u","block":"_3zaP5","left":"_2SBRC"};
|
|
2133
2525
|
|
|
2134
2526
|
const DesktopModal = ({
|
|
2135
|
-
children
|
|
2527
|
+
children,
|
|
2528
|
+
isSomePlanDeferred
|
|
2136
2529
|
}) => /*#__PURE__*/React.createElement("div", {
|
|
2137
2530
|
className: s$7.container,
|
|
2138
2531
|
"data-testid": "modal-container"
|
|
2139
2532
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2140
|
-
className: cx([s$7.block, s$7.left])
|
|
2141
|
-
}, /*#__PURE__*/React.createElement(Title,
|
|
2142
|
-
|
|
2533
|
+
className: cx([s$7.block, s$7.left, STATIC_CUSTOMISATION_CLASSES.leftSide])
|
|
2534
|
+
}, /*#__PURE__*/React.createElement(Title, {
|
|
2535
|
+
isSomePlanDeferred: isSomePlanDeferred
|
|
2536
|
+
}), /*#__PURE__*/React.createElement(Info, null), /*#__PURE__*/React.createElement(Logo, null)), /*#__PURE__*/React.createElement("div", {
|
|
2537
|
+
className: cx(s$7.block, STATIC_CUSTOMISATION_CLASSES.rightSide)
|
|
2143
2538
|
}, children));
|
|
2144
2539
|
|
|
2145
2540
|
var s$8 = {"noEligibility":"_17qNJ","loader":"_2oTJq"};
|
|
@@ -2147,11 +2542,14 @@ var s$8 = {"noEligibility":"_17qNJ","loader":"_2oTJq"};
|
|
|
2147
2542
|
var s$9 = {"container":"_2G7Ch"};
|
|
2148
2543
|
|
|
2149
2544
|
const MobileModal = ({
|
|
2150
|
-
children
|
|
2545
|
+
children,
|
|
2546
|
+
isSomePlanDeferred
|
|
2151
2547
|
}) => /*#__PURE__*/React.createElement("div", {
|
|
2152
2548
|
className: s$9.container,
|
|
2153
2549
|
"data-testid": "modal-container"
|
|
2154
|
-
}, /*#__PURE__*/React.createElement(Title,
|
|
2550
|
+
}, /*#__PURE__*/React.createElement(Title, {
|
|
2551
|
+
isSomePlanDeferred: isSomePlanDeferred
|
|
2552
|
+
}), children, /*#__PURE__*/React.createElement(Info, null), /*#__PURE__*/React.createElement(Logo, null));
|
|
2155
2553
|
|
|
2156
2554
|
const EligibilityModal = ({
|
|
2157
2555
|
initialPlanIndex,
|
|
@@ -2166,25 +2564,21 @@ const EligibilityModal = ({
|
|
|
2166
2564
|
const ModalComponent = isBigScreen ? DesktopModal : MobileModal;
|
|
2167
2565
|
const eligiblePlans = eligibilityPlans.filter(plan => plan.eligible);
|
|
2168
2566
|
const currentPlan = eligiblePlans[currentPlanIndex];
|
|
2169
|
-
const
|
|
2170
|
-
eligibilityPlans: eligiblePlans,
|
|
2171
|
-
currentPlanIndex,
|
|
2172
|
-
setCurrentPlanIndex,
|
|
2173
|
-
currentPlan,
|
|
2174
|
-
status
|
|
2175
|
-
};
|
|
2567
|
+
const isSomePlanDeferred = eligibilityPlans.some(plan => plan.deferred_days > 0 || plan.deferred_months > 0);
|
|
2176
2568
|
return /*#__PURE__*/React.createElement(ControlledModal, {
|
|
2177
2569
|
onClose: onClose,
|
|
2178
2570
|
ariaHideApp: false,
|
|
2179
2571
|
scrollable: true,
|
|
2180
2572
|
isOpen: true
|
|
2181
|
-
}, /*#__PURE__*/React.createElement(ModalComponent,
|
|
2573
|
+
}, /*#__PURE__*/React.createElement(ModalComponent, {
|
|
2574
|
+
isSomePlanDeferred: isSomePlanDeferred
|
|
2575
|
+
}, status === apiStatus.PENDING && /*#__PURE__*/React.createElement("div", {
|
|
2182
2576
|
className: s$8.loader
|
|
2183
2577
|
}, /*#__PURE__*/React.createElement(LoadingIndicator, null)), status === apiStatus.SUCCESS && eligiblePlans.length === 0 && /*#__PURE__*/React.createElement("div", {
|
|
2184
2578
|
className: s$8.noEligibility
|
|
2185
2579
|
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
2186
2580
|
id: "eligibility-modal.no-eligibility",
|
|
2187
|
-
defaultMessage: "Oups, il semblerait que la simulation n'
|
|
2581
|
+
defaultMessage: "Oups, il semblerait que la simulation n'ait pas fonctionn\u00E9."
|
|
2188
2582
|
})), status === apiStatus.SUCCESS && eligiblePlans.length >= 1 && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(EligibilityPlansButtons, {
|
|
2189
2583
|
eligibilityPlans: eligiblePlans,
|
|
2190
2584
|
currentPlanIndex: currentPlanIndex,
|
|
@@ -2286,6 +2680,24 @@ const getIndexOfActivePlan = ({
|
|
|
2286
2680
|
return 0;
|
|
2287
2681
|
};
|
|
2288
2682
|
|
|
2683
|
+
/**
|
|
2684
|
+
* Prefix classes to avoid name collisions.
|
|
2685
|
+
*/
|
|
2686
|
+
const prefix$1 = 'alma-payment-plans';
|
|
2687
|
+
/**
|
|
2688
|
+
* Class names for the **payment plans** widget.
|
|
2689
|
+
* Those classes are intended to be used by the **merchant developer**.
|
|
2690
|
+
*/
|
|
2691
|
+
|
|
2692
|
+
const STATIC_CUSTOMISATION_CLASSES$1 = {
|
|
2693
|
+
container: prefix$1 + '-container',
|
|
2694
|
+
eligibilityLine: prefix$1 + '-eligibility-line',
|
|
2695
|
+
eligibilityOptions: prefix$1 + '-eligibility-options',
|
|
2696
|
+
notEligibleOption: prefix$1 + '-not-eligible-option',
|
|
2697
|
+
paymentInfo: prefix$1 + '-payment-info',
|
|
2698
|
+
activeOption: prefix$1 + '-active-option'
|
|
2699
|
+
};
|
|
2700
|
+
|
|
2289
2701
|
var s$b = {"widgetButton":"_TSkFv","logo":"_LJ4nZ","primaryContainer":"_bMClc","paymentPlans":"_17c_S","plan":"_2Kqjn","active":"_3dG_J","notEligible":"_3O1bg","info":"_25GrF","loader":"_30j1O","error":"_R0YlN","errorText":"_2kGhu","errorButton":"_73d_Y","pending":"_1ZDMS","clickable":"_UksZa","unClickable":"_1lr-q"};
|
|
2290
2702
|
|
|
2291
2703
|
const VERY_LONG_TIME_IN_MS = 1000 * 3600 * 24 * 365;
|
|
@@ -2305,7 +2717,7 @@ const PaymentPlanWidget = ({
|
|
|
2305
2717
|
eligibilityPlans,
|
|
2306
2718
|
suggestedPaymentPlan: suggestedPaymentPlan != null ? suggestedPaymentPlan : 0
|
|
2307
2719
|
});
|
|
2308
|
-
const isSuggestedPaymentPlanSpecified = suggestedPaymentPlan !== undefined; // 👈 The merchant decided to focus a tab
|
|
2720
|
+
const isSuggestedPaymentPlanSpecified = suggestedPaymentPlan !== undefined; // 👈 The merchant decided to focus a tab
|
|
2309
2721
|
|
|
2310
2722
|
const isTransitionSpecified = transitionDelay !== undefined; // 👈 The merchant has specified a transition time
|
|
2311
2723
|
|
|
@@ -2383,28 +2795,28 @@ const PaymentPlanWidget = ({
|
|
|
2383
2795
|
className: cx(s$b.widgetButton, {
|
|
2384
2796
|
[s$b.clickable]: eligiblePlans.length > 0,
|
|
2385
2797
|
[s$b.unClickable]: eligiblePlans.length === 0
|
|
2386
|
-
}),
|
|
2798
|
+
}, STATIC_CUSTOMISATION_CLASSES$1.container),
|
|
2387
2799
|
"data-testid": "widget-button"
|
|
2388
2800
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2389
|
-
className: s$b.primaryContainer
|
|
2801
|
+
className: cx(s$b.primaryContainer, STATIC_CUSTOMISATION_CLASSES$1.eligibilityLine)
|
|
2390
2802
|
}, /*#__PURE__*/React.createElement(LogoIcon, {
|
|
2391
2803
|
className: s$b.logo
|
|
2392
2804
|
}), /*#__PURE__*/React.createElement("div", {
|
|
2393
|
-
className: s$b.paymentPlans
|
|
2805
|
+
className: cx(s$b.paymentPlans, STATIC_CUSTOMISATION_CLASSES$1.eligibilityOptions)
|
|
2394
2806
|
}, eligibilityPlans.map((eligibilityPlan, key) => {
|
|
2395
2807
|
return /*#__PURE__*/React.createElement("div", {
|
|
2396
2808
|
key: key,
|
|
2397
2809
|
onMouseEnter: () => onHover(key),
|
|
2398
2810
|
onMouseOut: onLeave,
|
|
2399
2811
|
className: cx(s$b.plan, {
|
|
2400
|
-
[s$b.active]: current === key,
|
|
2401
|
-
[s$b.notEligible]: !eligibilityPlan.eligible
|
|
2812
|
+
[cx(s$b.active, STATIC_CUSTOMISATION_CLASSES$1.activeOption)]: current === key,
|
|
2813
|
+
[cx(s$b.notEligible, STATIC_CUSTOMISATION_CLASSES$1.notEligibleOption)]: !eligibilityPlan.eligible
|
|
2402
2814
|
})
|
|
2403
2815
|
}, paymentPlanShorthandName(eligibilityPlan));
|
|
2404
2816
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
2405
2817
|
className: cx(s$b.info, {
|
|
2406
|
-
[s$b.notEligible]: eligibilityPlans[current] && !eligibilityPlans[current].eligible
|
|
2407
|
-
})
|
|
2818
|
+
[cx(s$b.notEligible, STATIC_CUSTOMISATION_CLASSES$1.notEligibleOption)]: eligibilityPlans[current] && !eligibilityPlans[current].eligible
|
|
2819
|
+
}, STATIC_CUSTOMISATION_CLASSES$1.paymentInfo)
|
|
2408
2820
|
}, eligibilityPlans.length !== 0 && paymentPlanInfoText(eligibilityPlans[current]))), isOpen && /*#__PURE__*/React.createElement(EligibilityModal, {
|
|
2409
2821
|
initialPlanIndex: getIndexWithinEligiblePlans(current),
|
|
2410
2822
|
onClose: closeModal,
|