radar-sdk-js 3.4.0-beta → 3.5.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +948 -1609
- package/dist/radar.js +948 -1609
- package/dist/radar.min.js +1 -1
- package/package.json +1 -1
- package/src/api/context.js +1 -1
- package/src/api/geocoding.js +3 -3
- package/src/api/routing.js +2 -2
- package/src/api/search.js +3 -3
- package/src/api/track.js +1 -4
- package/src/api/trips.js +2 -4
- package/src/api_host.js +2 -1
- package/src/http.js +3 -2
- package/src/index.js +2 -1
- package/src/storage.js +3 -0
- package/src/version.js +1 -1
package/dist/radar.js
CHANGED
|
@@ -13,14 +13,13 @@ var Radar = (function () {
|
|
|
13
13
|
|
|
14
14
|
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
15
15
|
var global_1 =
|
|
16
|
-
// eslint-disable-next-line
|
|
16
|
+
// eslint-disable-next-line no-undef
|
|
17
17
|
check(typeof globalThis == 'object' && globalThis) ||
|
|
18
18
|
check(typeof window == 'object' && window) ||
|
|
19
|
-
// eslint-disable-next-line no-restricted-globals -- safe
|
|
20
19
|
check(typeof self == 'object' && self) ||
|
|
21
20
|
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
|
22
|
-
// eslint-disable-next-line no-new-func
|
|
23
|
-
|
|
21
|
+
// eslint-disable-next-line no-new-func
|
|
22
|
+
Function('return this')();
|
|
24
23
|
|
|
25
24
|
var fails = function (exec) {
|
|
26
25
|
try {
|
|
@@ -30,38 +29,23 @@ var Radar = (function () {
|
|
|
30
29
|
}
|
|
31
30
|
};
|
|
32
31
|
|
|
33
|
-
//
|
|
32
|
+
// Thank's IE8 for his funny defineProperty
|
|
34
33
|
var descriptors = !fails(function () {
|
|
35
|
-
// eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
|
|
36
34
|
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
|
37
35
|
});
|
|
38
36
|
|
|
39
|
-
var
|
|
40
|
-
// eslint-disable-next-line es-x/no-function-prototype-bind -- safe
|
|
41
|
-
var test = (function () { /* empty */ }).bind();
|
|
42
|
-
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
43
|
-
return typeof test != 'function' || test.hasOwnProperty('prototype');
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
var call = Function.prototype.call;
|
|
47
|
-
|
|
48
|
-
var functionCall = functionBindNative ? call.bind(call) : function () {
|
|
49
|
-
return call.apply(call, arguments);
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
|
53
|
-
// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
|
|
37
|
+
var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
|
|
54
38
|
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
55
39
|
|
|
56
40
|
// Nashorn ~ JDK8 bug
|
|
57
|
-
var NASHORN_BUG = getOwnPropertyDescriptor &&
|
|
41
|
+
var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
|
|
58
42
|
|
|
59
43
|
// `Object.prototype.propertyIsEnumerable` method implementation
|
|
60
|
-
// https://tc39.
|
|
44
|
+
// https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable
|
|
61
45
|
var f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
|
62
46
|
var descriptor = getOwnPropertyDescriptor(this, V);
|
|
63
47
|
return !!descriptor && descriptor.enumerable;
|
|
64
|
-
} :
|
|
48
|
+
} : nativePropertyIsEnumerable;
|
|
65
49
|
|
|
66
50
|
var objectPropertyIsEnumerable = {
|
|
67
51
|
f: f
|
|
@@ -76,44 +60,27 @@ var Radar = (function () {
|
|
|
76
60
|
};
|
|
77
61
|
};
|
|
78
62
|
|
|
79
|
-
var
|
|
80
|
-
var bind = FunctionPrototype.bind;
|
|
81
|
-
var call$1 = FunctionPrototype.call;
|
|
82
|
-
var uncurryThis = functionBindNative && bind.bind(call$1, call$1);
|
|
83
|
-
|
|
84
|
-
var functionUncurryThis = functionBindNative ? function (fn) {
|
|
85
|
-
return fn && uncurryThis(fn);
|
|
86
|
-
} : function (fn) {
|
|
87
|
-
return fn && function () {
|
|
88
|
-
return call$1.apply(fn, arguments);
|
|
89
|
-
};
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
var toString = functionUncurryThis({}.toString);
|
|
93
|
-
var stringSlice = functionUncurryThis(''.slice);
|
|
63
|
+
var toString = {}.toString;
|
|
94
64
|
|
|
95
65
|
var classofRaw = function (it) {
|
|
96
|
-
return
|
|
66
|
+
return toString.call(it).slice(8, -1);
|
|
97
67
|
};
|
|
98
68
|
|
|
99
|
-
var
|
|
100
|
-
var split = functionUncurryThis(''.split);
|
|
69
|
+
var split = ''.split;
|
|
101
70
|
|
|
102
71
|
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
103
72
|
var indexedObject = fails(function () {
|
|
104
73
|
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
|
|
105
|
-
// eslint-disable-next-line no-prototype-builtins
|
|
106
|
-
return
|
|
74
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
75
|
+
return !Object('z').propertyIsEnumerable(0);
|
|
107
76
|
}) ? function (it) {
|
|
108
|
-
return classofRaw(it) == 'String' ? split(it, '') :
|
|
109
|
-
} :
|
|
110
|
-
|
|
111
|
-
var $TypeError = TypeError;
|
|
77
|
+
return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
|
|
78
|
+
} : Object;
|
|
112
79
|
|
|
113
80
|
// `RequireObjectCoercible` abstract operation
|
|
114
|
-
// https://tc39.
|
|
81
|
+
// https://tc39.github.io/ecma262/#sec-requireobjectcoercible
|
|
115
82
|
var requireObjectCoercible = function (it) {
|
|
116
|
-
if (it == undefined) throw
|
|
83
|
+
if (it == undefined) throw TypeError("Can't call method on " + it);
|
|
117
84
|
return it;
|
|
118
85
|
};
|
|
119
86
|
|
|
@@ -125,215 +92,27 @@ var Radar = (function () {
|
|
|
125
92
|
return indexedObject(requireObjectCoercible(it));
|
|
126
93
|
};
|
|
127
94
|
|
|
128
|
-
// `IsCallable` abstract operation
|
|
129
|
-
// https://tc39.es/ecma262/#sec-iscallable
|
|
130
|
-
var isCallable = function (argument) {
|
|
131
|
-
return typeof argument == 'function';
|
|
132
|
-
};
|
|
133
|
-
|
|
134
95
|
var isObject = function (it) {
|
|
135
|
-
return typeof it
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
var aFunction = function (argument) {
|
|
139
|
-
return isCallable(argument) ? argument : undefined;
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
var getBuiltIn = function (namespace, method) {
|
|
143
|
-
return arguments.length < 2 ? aFunction(global_1[namespace]) : global_1[namespace] && global_1[namespace][method];
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
|
|
147
|
-
|
|
148
|
-
var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
|
|
149
|
-
|
|
150
|
-
var process = global_1.process;
|
|
151
|
-
var Deno$1 = global_1.Deno;
|
|
152
|
-
var versions = process && process.versions || Deno$1 && Deno$1.version;
|
|
153
|
-
var v8 = versions && versions.v8;
|
|
154
|
-
var match, version;
|
|
155
|
-
|
|
156
|
-
if (v8) {
|
|
157
|
-
match = v8.split('.');
|
|
158
|
-
// in old Chrome, versions of V8 isn't V8 = Chrome / 10
|
|
159
|
-
// but their correct versions are not interesting for us
|
|
160
|
-
version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
|
|
164
|
-
// so check `userAgent` even if `.v8` exists, but 0
|
|
165
|
-
if (!version && engineUserAgent) {
|
|
166
|
-
match = engineUserAgent.match(/Edge\/(\d+)/);
|
|
167
|
-
if (!match || match[1] >= 74) {
|
|
168
|
-
match = engineUserAgent.match(/Chrome\/(\d+)/);
|
|
169
|
-
if (match) version = +match[1];
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
var engineV8Version = version;
|
|
174
|
-
|
|
175
|
-
/* eslint-disable es-x/no-symbol -- required for testing */
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
// eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing
|
|
180
|
-
var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
|
|
181
|
-
var symbol = Symbol();
|
|
182
|
-
// Chrome 38 Symbol has incorrect toString conversion
|
|
183
|
-
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
184
|
-
return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
|
|
185
|
-
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
|
186
|
-
!Symbol.sham && engineV8Version && engineV8Version < 41;
|
|
187
|
-
});
|
|
188
|
-
|
|
189
|
-
/* eslint-disable es-x/no-symbol -- required for testing */
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
var useSymbolAsUid = nativeSymbol
|
|
193
|
-
&& !Symbol.sham
|
|
194
|
-
&& typeof Symbol.iterator == 'symbol';
|
|
195
|
-
|
|
196
|
-
var $Object$1 = Object;
|
|
197
|
-
|
|
198
|
-
var isSymbol = useSymbolAsUid ? function (it) {
|
|
199
|
-
return typeof it == 'symbol';
|
|
200
|
-
} : function (it) {
|
|
201
|
-
var $Symbol = getBuiltIn('Symbol');
|
|
202
|
-
return isCallable($Symbol) && objectIsPrototypeOf($Symbol.prototype, $Object$1(it));
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
var $String = String;
|
|
206
|
-
|
|
207
|
-
var tryToString = function (argument) {
|
|
208
|
-
try {
|
|
209
|
-
return $String(argument);
|
|
210
|
-
} catch (error) {
|
|
211
|
-
return 'Object';
|
|
212
|
-
}
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
var $TypeError$1 = TypeError;
|
|
216
|
-
|
|
217
|
-
// `Assert: IsCallable(argument) is true`
|
|
218
|
-
var aCallable = function (argument) {
|
|
219
|
-
if (isCallable(argument)) return argument;
|
|
220
|
-
throw $TypeError$1(tryToString(argument) + ' is not a function');
|
|
96
|
+
return typeof it === 'object' ? it !== null : typeof it === 'function';
|
|
221
97
|
};
|
|
222
98
|
|
|
223
|
-
// `
|
|
224
|
-
// https://tc39.
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
var $TypeError$2 = TypeError;
|
|
231
|
-
|
|
232
|
-
// `OrdinaryToPrimitive` abstract operation
|
|
233
|
-
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
|
|
234
|
-
var ordinaryToPrimitive = function (input, pref) {
|
|
99
|
+
// `ToPrimitive` abstract operation
|
|
100
|
+
// https://tc39.github.io/ecma262/#sec-toprimitive
|
|
101
|
+
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
|
|
102
|
+
// and the second argument - flag - preferred type is a string
|
|
103
|
+
var toPrimitive = function (input, PREFERRED_STRING) {
|
|
104
|
+
if (!isObject(input)) return input;
|
|
235
105
|
var fn, val;
|
|
236
|
-
if (
|
|
237
|
-
if (
|
|
238
|
-
if (
|
|
239
|
-
throw
|
|
106
|
+
if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
|
|
107
|
+
if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
|
|
108
|
+
if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
|
|
109
|
+
throw TypeError("Can't convert object to primitive value");
|
|
240
110
|
};
|
|
241
111
|
|
|
242
|
-
|
|
243
|
-
var defineProperty = Object.defineProperty;
|
|
112
|
+
var hasOwnProperty = {}.hasOwnProperty;
|
|
244
113
|
|
|
245
|
-
var
|
|
246
|
-
|
|
247
|
-
defineProperty(global_1, key, { value: value, configurable: true, writable: true });
|
|
248
|
-
} catch (error) {
|
|
249
|
-
global_1[key] = value;
|
|
250
|
-
} return value;
|
|
251
|
-
};
|
|
252
|
-
|
|
253
|
-
var SHARED = '__core-js_shared__';
|
|
254
|
-
var store = global_1[SHARED] || defineGlobalProperty(SHARED, {});
|
|
255
|
-
|
|
256
|
-
var sharedStore = store;
|
|
257
|
-
|
|
258
|
-
var shared = createCommonjsModule(function (module) {
|
|
259
|
-
(module.exports = function (key, value) {
|
|
260
|
-
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
|
261
|
-
})('versions', []).push({
|
|
262
|
-
version: '3.23.3',
|
|
263
|
-
mode: 'global',
|
|
264
|
-
copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
|
|
265
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.23.3/LICENSE',
|
|
266
|
-
source: 'https://github.com/zloirock/core-js'
|
|
267
|
-
});
|
|
268
|
-
});
|
|
269
|
-
|
|
270
|
-
var $Object$2 = Object;
|
|
271
|
-
|
|
272
|
-
// `ToObject` abstract operation
|
|
273
|
-
// https://tc39.es/ecma262/#sec-toobject
|
|
274
|
-
var toObject = function (argument) {
|
|
275
|
-
return $Object$2(requireObjectCoercible(argument));
|
|
276
|
-
};
|
|
277
|
-
|
|
278
|
-
var hasOwnProperty = functionUncurryThis({}.hasOwnProperty);
|
|
279
|
-
|
|
280
|
-
// `HasOwnProperty` abstract operation
|
|
281
|
-
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
282
|
-
// eslint-disable-next-line es-x/no-object-hasown -- safe
|
|
283
|
-
var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
284
|
-
return hasOwnProperty(toObject(it), key);
|
|
285
|
-
};
|
|
286
|
-
|
|
287
|
-
var id = 0;
|
|
288
|
-
var postfix = Math.random();
|
|
289
|
-
var toString$1 = functionUncurryThis(1.0.toString);
|
|
290
|
-
|
|
291
|
-
var uid = function (key) {
|
|
292
|
-
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$1(++id + postfix, 36);
|
|
293
|
-
};
|
|
294
|
-
|
|
295
|
-
var WellKnownSymbolsStore = shared('wks');
|
|
296
|
-
var Symbol$1 = global_1.Symbol;
|
|
297
|
-
var symbolFor = Symbol$1 && Symbol$1['for'];
|
|
298
|
-
var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
|
|
299
|
-
|
|
300
|
-
var wellKnownSymbol = function (name) {
|
|
301
|
-
if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
|
|
302
|
-
var description = 'Symbol.' + name;
|
|
303
|
-
if (nativeSymbol && hasOwnProperty_1(Symbol$1, name)) {
|
|
304
|
-
WellKnownSymbolsStore[name] = Symbol$1[name];
|
|
305
|
-
} else if (useSymbolAsUid && symbolFor) {
|
|
306
|
-
WellKnownSymbolsStore[name] = symbolFor(description);
|
|
307
|
-
} else {
|
|
308
|
-
WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
|
|
309
|
-
}
|
|
310
|
-
} return WellKnownSymbolsStore[name];
|
|
311
|
-
};
|
|
312
|
-
|
|
313
|
-
var $TypeError$3 = TypeError;
|
|
314
|
-
var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
|
|
315
|
-
|
|
316
|
-
// `ToPrimitive` abstract operation
|
|
317
|
-
// https://tc39.es/ecma262/#sec-toprimitive
|
|
318
|
-
var toPrimitive = function (input, pref) {
|
|
319
|
-
if (!isObject(input) || isSymbol(input)) return input;
|
|
320
|
-
var exoticToPrim = getMethod(input, TO_PRIMITIVE);
|
|
321
|
-
var result;
|
|
322
|
-
if (exoticToPrim) {
|
|
323
|
-
if (pref === undefined) pref = 'default';
|
|
324
|
-
result = functionCall(exoticToPrim, input, pref);
|
|
325
|
-
if (!isObject(result) || isSymbol(result)) return result;
|
|
326
|
-
throw $TypeError$3("Can't convert object to primitive value");
|
|
327
|
-
}
|
|
328
|
-
if (pref === undefined) pref = 'number';
|
|
329
|
-
return ordinaryToPrimitive(input, pref);
|
|
330
|
-
};
|
|
331
|
-
|
|
332
|
-
// `ToPropertyKey` abstract operation
|
|
333
|
-
// https://tc39.es/ecma262/#sec-topropertykey
|
|
334
|
-
var toPropertyKey = function (argument) {
|
|
335
|
-
var key = toPrimitive(argument, 'string');
|
|
336
|
-
return isSymbol(key) ? key : key + '';
|
|
114
|
+
var has = function (it, key) {
|
|
115
|
+
return hasOwnProperty.call(it, key);
|
|
337
116
|
};
|
|
338
117
|
|
|
339
118
|
var document$1 = global_1.document;
|
|
@@ -344,85 +123,48 @@ var Radar = (function () {
|
|
|
344
123
|
return EXISTS ? document$1.createElement(it) : {};
|
|
345
124
|
};
|
|
346
125
|
|
|
347
|
-
//
|
|
126
|
+
// Thank's IE8 for his funny defineProperty
|
|
348
127
|
var ie8DomDefine = !descriptors && !fails(function () {
|
|
349
|
-
// eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
|
|
350
128
|
return Object.defineProperty(documentCreateElement('div'), 'a', {
|
|
351
129
|
get: function () { return 7; }
|
|
352
130
|
}).a != 7;
|
|
353
131
|
});
|
|
354
132
|
|
|
355
|
-
|
|
356
|
-
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
133
|
+
var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
357
134
|
|
|
358
135
|
// `Object.getOwnPropertyDescriptor` method
|
|
359
|
-
// https://tc39.
|
|
360
|
-
var f$1 = descriptors ?
|
|
136
|
+
// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor
|
|
137
|
+
var f$1 = descriptors ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
|
|
361
138
|
O = toIndexedObject(O);
|
|
362
|
-
P =
|
|
139
|
+
P = toPrimitive(P, true);
|
|
363
140
|
if (ie8DomDefine) try {
|
|
364
|
-
return
|
|
141
|
+
return nativeGetOwnPropertyDescriptor(O, P);
|
|
365
142
|
} catch (error) { /* empty */ }
|
|
366
|
-
if (
|
|
143
|
+
if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
|
|
367
144
|
};
|
|
368
145
|
|
|
369
146
|
var objectGetOwnPropertyDescriptor = {
|
|
370
147
|
f: f$1
|
|
371
148
|
};
|
|
372
149
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
|
|
378
|
-
value: 42,
|
|
379
|
-
writable: false
|
|
380
|
-
}).prototype != 42;
|
|
381
|
-
});
|
|
382
|
-
|
|
383
|
-
var $String$1 = String;
|
|
384
|
-
var $TypeError$4 = TypeError;
|
|
385
|
-
|
|
386
|
-
// `Assert: Type(argument) is Object`
|
|
387
|
-
var anObject = function (argument) {
|
|
388
|
-
if (isObject(argument)) return argument;
|
|
389
|
-
throw $TypeError$4($String$1(argument) + ' is not an object');
|
|
150
|
+
var anObject = function (it) {
|
|
151
|
+
if (!isObject(it)) {
|
|
152
|
+
throw TypeError(String(it) + ' is not an object');
|
|
153
|
+
} return it;
|
|
390
154
|
};
|
|
391
155
|
|
|
392
|
-
var
|
|
393
|
-
// eslint-disable-next-line es-x/no-object-defineproperty -- safe
|
|
394
|
-
var $defineProperty = Object.defineProperty;
|
|
395
|
-
// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
|
|
396
|
-
var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
397
|
-
var ENUMERABLE = 'enumerable';
|
|
398
|
-
var CONFIGURABLE = 'configurable';
|
|
399
|
-
var WRITABLE = 'writable';
|
|
156
|
+
var nativeDefineProperty = Object.defineProperty;
|
|
400
157
|
|
|
401
158
|
// `Object.defineProperty` method
|
|
402
|
-
// https://tc39.
|
|
403
|
-
var f$2 = descriptors ?
|
|
404
|
-
anObject(O);
|
|
405
|
-
P = toPropertyKey(P);
|
|
406
|
-
anObject(Attributes);
|
|
407
|
-
if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
|
|
408
|
-
var current = $getOwnPropertyDescriptor$1(O, P);
|
|
409
|
-
if (current && current[WRITABLE]) {
|
|
410
|
-
O[P] = Attributes.value;
|
|
411
|
-
Attributes = {
|
|
412
|
-
configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
|
|
413
|
-
enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
|
|
414
|
-
writable: false
|
|
415
|
-
};
|
|
416
|
-
}
|
|
417
|
-
} return $defineProperty(O, P, Attributes);
|
|
418
|
-
} : $defineProperty : function defineProperty(O, P, Attributes) {
|
|
159
|
+
// https://tc39.github.io/ecma262/#sec-object.defineproperty
|
|
160
|
+
var f$2 = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
|
|
419
161
|
anObject(O);
|
|
420
|
-
P =
|
|
162
|
+
P = toPrimitive(P, true);
|
|
421
163
|
anObject(Attributes);
|
|
422
164
|
if (ie8DomDefine) try {
|
|
423
|
-
return
|
|
165
|
+
return nativeDefineProperty(O, P, Attributes);
|
|
424
166
|
} catch (error) { /* empty */ }
|
|
425
|
-
if ('get' in Attributes || 'set' in Attributes) throw
|
|
167
|
+
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
|
|
426
168
|
if ('value' in Attributes) O[P] = Attributes.value;
|
|
427
169
|
return O;
|
|
428
170
|
};
|
|
@@ -438,27 +180,25 @@ var Radar = (function () {
|
|
|
438
180
|
return object;
|
|
439
181
|
};
|
|
440
182
|
|
|
441
|
-
var
|
|
442
|
-
|
|
443
|
-
|
|
183
|
+
var setGlobal = function (key, value) {
|
|
184
|
+
try {
|
|
185
|
+
createNonEnumerableProperty(global_1, key, value);
|
|
186
|
+
} catch (error) {
|
|
187
|
+
global_1[key] = value;
|
|
188
|
+
} return value;
|
|
189
|
+
};
|
|
444
190
|
|
|
445
|
-
var
|
|
446
|
-
|
|
447
|
-
var PROPER = EXISTS$1 && (function something() { /* empty */ }).name === 'something';
|
|
448
|
-
var CONFIGURABLE$1 = EXISTS$1 && (!descriptors || (descriptors && getDescriptor(FunctionPrototype$1, 'name').configurable));
|
|
191
|
+
var SHARED = '__core-js_shared__';
|
|
192
|
+
var store = global_1[SHARED] || setGlobal(SHARED, {});
|
|
449
193
|
|
|
450
|
-
var
|
|
451
|
-
EXISTS: EXISTS$1,
|
|
452
|
-
PROPER: PROPER,
|
|
453
|
-
CONFIGURABLE: CONFIGURABLE$1
|
|
454
|
-
};
|
|
194
|
+
var sharedStore = store;
|
|
455
195
|
|
|
456
|
-
var functionToString =
|
|
196
|
+
var functionToString = Function.toString;
|
|
457
197
|
|
|
458
|
-
// this helper broken in `
|
|
459
|
-
if (
|
|
198
|
+
// this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
|
|
199
|
+
if (typeof sharedStore.inspectSource != 'function') {
|
|
460
200
|
sharedStore.inspectSource = function (it) {
|
|
461
|
-
return functionToString(it);
|
|
201
|
+
return functionToString.call(it);
|
|
462
202
|
};
|
|
463
203
|
}
|
|
464
204
|
|
|
@@ -466,7 +206,24 @@ var Radar = (function () {
|
|
|
466
206
|
|
|
467
207
|
var WeakMap = global_1.WeakMap;
|
|
468
208
|
|
|
469
|
-
var nativeWeakMap =
|
|
209
|
+
var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
|
|
210
|
+
|
|
211
|
+
var shared = createCommonjsModule(function (module) {
|
|
212
|
+
(module.exports = function (key, value) {
|
|
213
|
+
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
|
214
|
+
})('versions', []).push({
|
|
215
|
+
version: '3.6.4',
|
|
216
|
+
mode: 'global',
|
|
217
|
+
copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
|
|
218
|
+
});
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
var id = 0;
|
|
222
|
+
var postfix = Math.random();
|
|
223
|
+
|
|
224
|
+
var uid = function (key) {
|
|
225
|
+
return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
|
|
226
|
+
};
|
|
470
227
|
|
|
471
228
|
var keys = shared('keys');
|
|
472
229
|
|
|
@@ -476,193 +233,141 @@ var Radar = (function () {
|
|
|
476
233
|
|
|
477
234
|
var hiddenKeys = {};
|
|
478
235
|
|
|
479
|
-
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
|
480
|
-
var TypeError$1 = global_1.TypeError;
|
|
481
236
|
var WeakMap$1 = global_1.WeakMap;
|
|
482
|
-
var set, get, has;
|
|
237
|
+
var set, get, has$1;
|
|
483
238
|
|
|
484
239
|
var enforce = function (it) {
|
|
485
|
-
return has(it) ? get(it) : set(it, {});
|
|
240
|
+
return has$1(it) ? get(it) : set(it, {});
|
|
486
241
|
};
|
|
487
242
|
|
|
488
243
|
var getterFor = function (TYPE) {
|
|
489
244
|
return function (it) {
|
|
490
245
|
var state;
|
|
491
246
|
if (!isObject(it) || (state = get(it)).type !== TYPE) {
|
|
492
|
-
throw TypeError
|
|
247
|
+
throw TypeError('Incompatible receiver, ' + TYPE + ' required');
|
|
493
248
|
} return state;
|
|
494
249
|
};
|
|
495
250
|
};
|
|
496
251
|
|
|
497
|
-
if (nativeWeakMap
|
|
498
|
-
var store$1 =
|
|
499
|
-
var wmget =
|
|
500
|
-
var wmhas =
|
|
501
|
-
var wmset =
|
|
252
|
+
if (nativeWeakMap) {
|
|
253
|
+
var store$1 = new WeakMap$1();
|
|
254
|
+
var wmget = store$1.get;
|
|
255
|
+
var wmhas = store$1.has;
|
|
256
|
+
var wmset = store$1.set;
|
|
502
257
|
set = function (it, metadata) {
|
|
503
|
-
|
|
504
|
-
metadata.facade = it;
|
|
505
|
-
wmset(store$1, it, metadata);
|
|
258
|
+
wmset.call(store$1, it, metadata);
|
|
506
259
|
return metadata;
|
|
507
260
|
};
|
|
508
261
|
get = function (it) {
|
|
509
|
-
return wmget(store$1, it) || {};
|
|
262
|
+
return wmget.call(store$1, it) || {};
|
|
510
263
|
};
|
|
511
|
-
has = function (it) {
|
|
512
|
-
return wmhas(store$1, it);
|
|
264
|
+
has$1 = function (it) {
|
|
265
|
+
return wmhas.call(store$1, it);
|
|
513
266
|
};
|
|
514
267
|
} else {
|
|
515
268
|
var STATE = sharedKey('state');
|
|
516
269
|
hiddenKeys[STATE] = true;
|
|
517
270
|
set = function (it, metadata) {
|
|
518
|
-
if (hasOwnProperty_1(it, STATE)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
|
519
|
-
metadata.facade = it;
|
|
520
271
|
createNonEnumerableProperty(it, STATE, metadata);
|
|
521
272
|
return metadata;
|
|
522
273
|
};
|
|
523
274
|
get = function (it) {
|
|
524
|
-
return
|
|
275
|
+
return has(it, STATE) ? it[STATE] : {};
|
|
525
276
|
};
|
|
526
|
-
has = function (it) {
|
|
527
|
-
return
|
|
277
|
+
has$1 = function (it) {
|
|
278
|
+
return has(it, STATE);
|
|
528
279
|
};
|
|
529
280
|
}
|
|
530
281
|
|
|
531
282
|
var internalState = {
|
|
532
283
|
set: set,
|
|
533
284
|
get: get,
|
|
534
|
-
has: has,
|
|
285
|
+
has: has$1,
|
|
535
286
|
enforce: enforce,
|
|
536
287
|
getterFor: getterFor
|
|
537
288
|
};
|
|
538
289
|
|
|
539
|
-
var
|
|
540
|
-
var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
var enforceInternalState = internalState.enforce;
|
|
290
|
+
var redefine = createCommonjsModule(function (module) {
|
|
545
291
|
var getInternalState = internalState.get;
|
|
546
|
-
|
|
547
|
-
var defineProperty = Object.defineProperty;
|
|
548
|
-
|
|
549
|
-
var CONFIGURABLE_LENGTH = descriptors && !fails(function () {
|
|
550
|
-
return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
|
|
551
|
-
});
|
|
552
|
-
|
|
292
|
+
var enforceInternalState = internalState.enforce;
|
|
553
293
|
var TEMPLATE = String(String).split('String');
|
|
554
294
|
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
if (
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
if (descriptors) defineProperty(value, 'name', { value: name, configurable: true });
|
|
563
|
-
else value.name = name;
|
|
295
|
+
(module.exports = function (O, key, value, options) {
|
|
296
|
+
var unsafe = options ? !!options.unsafe : false;
|
|
297
|
+
var simple = options ? !!options.enumerable : false;
|
|
298
|
+
var noTargetGet = options ? !!options.noTargetGet : false;
|
|
299
|
+
if (typeof value == 'function') {
|
|
300
|
+
if (typeof key == 'string' && !has(value, 'name')) createNonEnumerableProperty(value, 'name', key);
|
|
301
|
+
enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');
|
|
564
302
|
}
|
|
565
|
-
if (
|
|
566
|
-
|
|
303
|
+
if (O === global_1) {
|
|
304
|
+
if (simple) O[key] = value;
|
|
305
|
+
else setGlobal(key, value);
|
|
306
|
+
return;
|
|
307
|
+
} else if (!unsafe) {
|
|
308
|
+
delete O[key];
|
|
309
|
+
} else if (!noTargetGet && O[key]) {
|
|
310
|
+
simple = true;
|
|
567
311
|
}
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
if (descriptors) defineProperty(value, 'prototype', { writable: false });
|
|
571
|
-
// in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
|
|
572
|
-
} else if (value.prototype) value.prototype = undefined;
|
|
573
|
-
} catch (error) { /* empty */ }
|
|
574
|
-
var state = enforceInternalState(value);
|
|
575
|
-
if (!hasOwnProperty_1(state, 'source')) {
|
|
576
|
-
state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
|
|
577
|
-
} return value;
|
|
578
|
-
};
|
|
579
|
-
|
|
312
|
+
if (simple) O[key] = value;
|
|
313
|
+
else createNonEnumerableProperty(O, key, value);
|
|
580
314
|
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
}, 'toString');
|
|
315
|
+
})(Function.prototype, 'toString', function toString() {
|
|
316
|
+
return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
|
|
317
|
+
});
|
|
585
318
|
});
|
|
586
319
|
|
|
587
|
-
var
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
try {
|
|
597
|
-
if (!options.unsafe) delete O[key];
|
|
598
|
-
else if (O[key]) simple = true;
|
|
599
|
-
} catch (error) { /* empty */ }
|
|
600
|
-
if (simple) O[key] = value;
|
|
601
|
-
else objectDefineProperty.f(O, key, {
|
|
602
|
-
value: value,
|
|
603
|
-
enumerable: false,
|
|
604
|
-
configurable: !options.nonConfigurable,
|
|
605
|
-
writable: !options.nonWritable
|
|
606
|
-
});
|
|
607
|
-
} return O;
|
|
320
|
+
var path = global_1;
|
|
321
|
+
|
|
322
|
+
var aFunction = function (variable) {
|
|
323
|
+
return typeof variable == 'function' ? variable : undefined;
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
var getBuiltIn = function (namespace, method) {
|
|
327
|
+
return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global_1[namespace])
|
|
328
|
+
: path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
|
|
608
329
|
};
|
|
609
330
|
|
|
610
331
|
var ceil = Math.ceil;
|
|
611
332
|
var floor = Math.floor;
|
|
612
333
|
|
|
613
|
-
// `
|
|
614
|
-
// https://tc39.
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
var n = +x;
|
|
618
|
-
return (n > 0 ? floor : ceil)(n);
|
|
334
|
+
// `ToInteger` abstract operation
|
|
335
|
+
// https://tc39.github.io/ecma262/#sec-tointeger
|
|
336
|
+
var toInteger = function (argument) {
|
|
337
|
+
return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
|
|
619
338
|
};
|
|
620
339
|
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
return
|
|
340
|
+
var min = Math.min;
|
|
341
|
+
|
|
342
|
+
// `ToLength` abstract operation
|
|
343
|
+
// https://tc39.github.io/ecma262/#sec-tolength
|
|
344
|
+
var toLength = function (argument) {
|
|
345
|
+
return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
627
346
|
};
|
|
628
347
|
|
|
629
348
|
var max = Math.max;
|
|
630
|
-
var min = Math.min;
|
|
349
|
+
var min$1 = Math.min;
|
|
631
350
|
|
|
632
351
|
// Helper for a popular repeating case of the spec:
|
|
633
352
|
// Let integer be ? ToInteger(index).
|
|
634
353
|
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
|
|
635
354
|
var toAbsoluteIndex = function (index, length) {
|
|
636
|
-
var integer =
|
|
637
|
-
return integer < 0 ? max(integer + length, 0) : min(integer, length);
|
|
638
|
-
};
|
|
639
|
-
|
|
640
|
-
var min$1 = Math.min;
|
|
641
|
-
|
|
642
|
-
// `ToLength` abstract operation
|
|
643
|
-
// https://tc39.es/ecma262/#sec-tolength
|
|
644
|
-
var toLength = function (argument) {
|
|
645
|
-
return argument > 0 ? min$1(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
646
|
-
};
|
|
647
|
-
|
|
648
|
-
// `LengthOfArrayLike` abstract operation
|
|
649
|
-
// https://tc39.es/ecma262/#sec-lengthofarraylike
|
|
650
|
-
var lengthOfArrayLike = function (obj) {
|
|
651
|
-
return toLength(obj.length);
|
|
355
|
+
var integer = toInteger(index);
|
|
356
|
+
return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
|
|
652
357
|
};
|
|
653
358
|
|
|
654
359
|
// `Array.prototype.{ indexOf, includes }` methods implementation
|
|
655
360
|
var createMethod = function (IS_INCLUDES) {
|
|
656
361
|
return function ($this, el, fromIndex) {
|
|
657
362
|
var O = toIndexedObject($this);
|
|
658
|
-
var length =
|
|
363
|
+
var length = toLength(O.length);
|
|
659
364
|
var index = toAbsoluteIndex(fromIndex, length);
|
|
660
365
|
var value;
|
|
661
366
|
// Array#includes uses SameValueZero equality algorithm
|
|
662
|
-
// eslint-disable-next-line no-self-compare
|
|
367
|
+
// eslint-disable-next-line no-self-compare
|
|
663
368
|
if (IS_INCLUDES && el != el) while (length > index) {
|
|
664
369
|
value = O[index++];
|
|
665
|
-
// eslint-disable-next-line no-self-compare
|
|
370
|
+
// eslint-disable-next-line no-self-compare
|
|
666
371
|
if (value != value) return true;
|
|
667
372
|
// Array#indexOf ignores holes, Array#includes - not
|
|
668
373
|
} else for (;length > index; index++) {
|
|
@@ -673,27 +378,25 @@ var Radar = (function () {
|
|
|
673
378
|
|
|
674
379
|
var arrayIncludes = {
|
|
675
380
|
// `Array.prototype.includes` method
|
|
676
|
-
// https://tc39.
|
|
381
|
+
// https://tc39.github.io/ecma262/#sec-array.prototype.includes
|
|
677
382
|
includes: createMethod(true),
|
|
678
383
|
// `Array.prototype.indexOf` method
|
|
679
|
-
// https://tc39.
|
|
384
|
+
// https://tc39.github.io/ecma262/#sec-array.prototype.indexof
|
|
680
385
|
indexOf: createMethod(false)
|
|
681
386
|
};
|
|
682
387
|
|
|
683
388
|
var indexOf = arrayIncludes.indexOf;
|
|
684
389
|
|
|
685
390
|
|
|
686
|
-
var push = functionUncurryThis([].push);
|
|
687
|
-
|
|
688
391
|
var objectKeysInternal = function (object, names) {
|
|
689
392
|
var O = toIndexedObject(object);
|
|
690
393
|
var i = 0;
|
|
691
394
|
var result = [];
|
|
692
395
|
var key;
|
|
693
|
-
for (key in O) !
|
|
396
|
+
for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
|
|
694
397
|
// Don't enum bug & hidden keys
|
|
695
|
-
while (names.length > i) if (
|
|
696
|
-
~indexOf(result, key) || push(
|
|
398
|
+
while (names.length > i) if (has(O, key = names[i++])) {
|
|
399
|
+
~indexOf(result, key) || result.push(key);
|
|
697
400
|
}
|
|
698
401
|
return result;
|
|
699
402
|
};
|
|
@@ -712,8 +415,7 @@ var Radar = (function () {
|
|
|
712
415
|
var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
|
|
713
416
|
|
|
714
417
|
// `Object.getOwnPropertyNames` method
|
|
715
|
-
// https://tc39.
|
|
716
|
-
// eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
|
|
418
|
+
// https://tc39.github.io/ecma262/#sec-object.getownpropertynames
|
|
717
419
|
var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
|
718
420
|
return objectKeysInternal(O, hiddenKeys$1);
|
|
719
421
|
};
|
|
@@ -722,31 +424,26 @@ var Radar = (function () {
|
|
|
722
424
|
f: f$3
|
|
723
425
|
};
|
|
724
426
|
|
|
725
|
-
// eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
|
|
726
427
|
var f$4 = Object.getOwnPropertySymbols;
|
|
727
428
|
|
|
728
429
|
var objectGetOwnPropertySymbols = {
|
|
729
430
|
f: f$4
|
|
730
431
|
};
|
|
731
432
|
|
|
732
|
-
var concat = functionUncurryThis([].concat);
|
|
733
|
-
|
|
734
433
|
// all object keys, includes non-enumerable and symbols
|
|
735
434
|
var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
736
435
|
var keys = objectGetOwnPropertyNames.f(anObject(it));
|
|
737
436
|
var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
|
|
738
|
-
return getOwnPropertySymbols ? concat(
|
|
437
|
+
return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
|
|
739
438
|
};
|
|
740
439
|
|
|
741
|
-
var copyConstructorProperties = function (target, source
|
|
440
|
+
var copyConstructorProperties = function (target, source) {
|
|
742
441
|
var keys = ownKeys(source);
|
|
743
442
|
var defineProperty = objectDefineProperty.f;
|
|
744
443
|
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
|
745
444
|
for (var i = 0; i < keys.length; i++) {
|
|
746
445
|
var key = keys[i];
|
|
747
|
-
if (!
|
|
748
|
-
defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
|
749
|
-
}
|
|
446
|
+
if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
|
750
447
|
}
|
|
751
448
|
};
|
|
752
449
|
|
|
@@ -756,7 +453,7 @@ var Radar = (function () {
|
|
|
756
453
|
var value = data[normalize(feature)];
|
|
757
454
|
return value == POLYFILL ? true
|
|
758
455
|
: value == NATIVE ? false
|
|
759
|
-
:
|
|
456
|
+
: typeof detection == 'function' ? fails(detection)
|
|
760
457
|
: !!detection;
|
|
761
458
|
};
|
|
762
459
|
|
|
@@ -778,19 +475,18 @@ var Radar = (function () {
|
|
|
778
475
|
|
|
779
476
|
|
|
780
477
|
/*
|
|
781
|
-
options.target
|
|
782
|
-
options.global
|
|
783
|
-
options.stat
|
|
784
|
-
options.proto
|
|
785
|
-
options.real
|
|
786
|
-
options.forced
|
|
787
|
-
options.bind
|
|
788
|
-
options.wrap
|
|
789
|
-
options.unsafe
|
|
790
|
-
options.sham
|
|
791
|
-
options.enumerable
|
|
792
|
-
options.
|
|
793
|
-
options.name - the .name of the function if it does not match the key
|
|
478
|
+
options.target - name of the target object
|
|
479
|
+
options.global - target is the global object
|
|
480
|
+
options.stat - export as static methods of target
|
|
481
|
+
options.proto - export as prototype methods of target
|
|
482
|
+
options.real - real prototype method for the `pure` version
|
|
483
|
+
options.forced - export even if the native feature is available
|
|
484
|
+
options.bind - bind methods to the target, required for the `pure` version
|
|
485
|
+
options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
|
|
486
|
+
options.unsafe - use the simple assignment of property instead of delete + defineProperty
|
|
487
|
+
options.sham - add a flag to not completely full polyfills
|
|
488
|
+
options.enumerable - export as enumerable property
|
|
489
|
+
options.noTargetGet - prevent calling a getter on target
|
|
794
490
|
*/
|
|
795
491
|
var _export = function (options, source) {
|
|
796
492
|
var TARGET = options.target;
|
|
@@ -800,33 +496,39 @@ var Radar = (function () {
|
|
|
800
496
|
if (GLOBAL) {
|
|
801
497
|
target = global_1;
|
|
802
498
|
} else if (STATIC) {
|
|
803
|
-
target = global_1[TARGET] ||
|
|
499
|
+
target = global_1[TARGET] || setGlobal(TARGET, {});
|
|
804
500
|
} else {
|
|
805
501
|
target = (global_1[TARGET] || {}).prototype;
|
|
806
502
|
}
|
|
807
503
|
if (target) for (key in source) {
|
|
808
504
|
sourceProperty = source[key];
|
|
809
|
-
if (options.
|
|
505
|
+
if (options.noTargetGet) {
|
|
810
506
|
descriptor = getOwnPropertyDescriptor$1(target, key);
|
|
811
507
|
targetProperty = descriptor && descriptor.value;
|
|
812
508
|
} else targetProperty = target[key];
|
|
813
509
|
FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
|
814
510
|
// contained in target
|
|
815
511
|
if (!FORCED && targetProperty !== undefined) {
|
|
816
|
-
if (typeof sourceProperty
|
|
512
|
+
if (typeof sourceProperty === typeof targetProperty) continue;
|
|
817
513
|
copyConstructorProperties(sourceProperty, targetProperty);
|
|
818
514
|
}
|
|
819
515
|
// add a flag to not completely full polyfills
|
|
820
516
|
if (options.sham || (targetProperty && targetProperty.sham)) {
|
|
821
517
|
createNonEnumerableProperty(sourceProperty, 'sham', true);
|
|
822
518
|
}
|
|
823
|
-
|
|
519
|
+
// extend global
|
|
520
|
+
redefine(target, key, sourceProperty, options);
|
|
824
521
|
}
|
|
825
522
|
};
|
|
826
523
|
|
|
524
|
+
// `ToObject` abstract operation
|
|
525
|
+
// https://tc39.github.io/ecma262/#sec-toobject
|
|
526
|
+
var toObject = function (argument) {
|
|
527
|
+
return Object(requireObjectCoercible(argument));
|
|
528
|
+
};
|
|
529
|
+
|
|
827
530
|
// `Object.keys` method
|
|
828
|
-
// https://tc39.
|
|
829
|
-
// eslint-disable-next-line es-x/no-object-keys -- safe
|
|
531
|
+
// https://tc39.github.io/ecma262/#sec-object.keys
|
|
830
532
|
var objectKeys = Object.keys || function keys(O) {
|
|
831
533
|
return objectKeysInternal(O, enumBugKeys);
|
|
832
534
|
};
|
|
@@ -834,57 +536,17 @@ var Radar = (function () {
|
|
|
834
536
|
var FAILS_ON_PRIMITIVES = fails(function () { objectKeys(1); });
|
|
835
537
|
|
|
836
538
|
// `Object.keys` method
|
|
837
|
-
// https://tc39.
|
|
539
|
+
// https://tc39.github.io/ecma262/#sec-object.keys
|
|
838
540
|
_export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
|
|
839
541
|
keys: function keys(it) {
|
|
840
542
|
return objectKeys(toObject(it));
|
|
841
543
|
}
|
|
842
544
|
});
|
|
843
545
|
|
|
844
|
-
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
|
845
|
-
var test = {};
|
|
846
|
-
|
|
847
|
-
test[TO_STRING_TAG] = 'z';
|
|
848
|
-
|
|
849
|
-
var toStringTagSupport = String(test) === '[object z]';
|
|
850
|
-
|
|
851
|
-
var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
|
|
852
|
-
var $Object$3 = Object;
|
|
853
|
-
|
|
854
|
-
// ES3 wrong here
|
|
855
|
-
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
|
|
856
|
-
|
|
857
|
-
// fallback for IE11 Script Access Denied error
|
|
858
|
-
var tryGet = function (it, key) {
|
|
859
|
-
try {
|
|
860
|
-
return it[key];
|
|
861
|
-
} catch (error) { /* empty */ }
|
|
862
|
-
};
|
|
863
|
-
|
|
864
|
-
// getting tag from ES6+ `Object.prototype.toString`
|
|
865
|
-
var classof = toStringTagSupport ? classofRaw : function (it) {
|
|
866
|
-
var O, tag, result;
|
|
867
|
-
return it === undefined ? 'Undefined' : it === null ? 'Null'
|
|
868
|
-
// @@toStringTag case
|
|
869
|
-
: typeof (tag = tryGet(O = $Object$3(it), TO_STRING_TAG$1)) == 'string' ? tag
|
|
870
|
-
// builtinTag case
|
|
871
|
-
: CORRECT_ARGUMENTS ? classofRaw(O)
|
|
872
|
-
// ES3 arguments fallback
|
|
873
|
-
: (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
|
|
874
|
-
};
|
|
875
|
-
|
|
876
|
-
var $String$2 = String;
|
|
877
|
-
|
|
878
|
-
var toString_1 = function (argument) {
|
|
879
|
-
if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
|
|
880
|
-
return $String$2(argument);
|
|
881
|
-
};
|
|
882
|
-
|
|
883
546
|
// a string of all valid unicode whitespaces
|
|
884
|
-
|
|
885
|
-
|
|
547
|
+
// eslint-disable-next-line max-len
|
|
548
|
+
var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
|
|
886
549
|
|
|
887
|
-
var replace = functionUncurryThis(''.replace);
|
|
888
550
|
var whitespace = '[' + whitespaces + ']';
|
|
889
551
|
var ltrim = RegExp('^' + whitespace + whitespace + '*');
|
|
890
552
|
var rtrim = RegExp(whitespace + whitespace + '*$');
|
|
@@ -892,38 +554,32 @@ var Radar = (function () {
|
|
|
892
554
|
// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
|
|
893
555
|
var createMethod$1 = function (TYPE) {
|
|
894
556
|
return function ($this) {
|
|
895
|
-
var string =
|
|
896
|
-
if (TYPE & 1) string = replace(
|
|
897
|
-
if (TYPE & 2) string = replace(
|
|
557
|
+
var string = String(requireObjectCoercible($this));
|
|
558
|
+
if (TYPE & 1) string = string.replace(ltrim, '');
|
|
559
|
+
if (TYPE & 2) string = string.replace(rtrim, '');
|
|
898
560
|
return string;
|
|
899
561
|
};
|
|
900
562
|
};
|
|
901
563
|
|
|
902
564
|
var stringTrim = {
|
|
903
565
|
// `String.prototype.{ trimLeft, trimStart }` methods
|
|
904
|
-
// https://tc39.
|
|
566
|
+
// https://tc39.github.io/ecma262/#sec-string.prototype.trimstart
|
|
905
567
|
start: createMethod$1(1),
|
|
906
568
|
// `String.prototype.{ trimRight, trimEnd }` methods
|
|
907
|
-
// https://tc39.
|
|
569
|
+
// https://tc39.github.io/ecma262/#sec-string.prototype.trimend
|
|
908
570
|
end: createMethod$1(2),
|
|
909
571
|
// `String.prototype.trim` method
|
|
910
|
-
// https://tc39.
|
|
572
|
+
// https://tc39.github.io/ecma262/#sec-string.prototype.trim
|
|
911
573
|
trim: createMethod$1(3)
|
|
912
574
|
};
|
|
913
575
|
|
|
914
|
-
var PROPER_FUNCTION_NAME = functionName.PROPER;
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
576
|
var non = '\u200B\u0085\u180E';
|
|
919
577
|
|
|
920
578
|
// check that a method works with the correct list
|
|
921
579
|
// of whitespaces and has a correct name
|
|
922
580
|
var stringTrimForced = function (METHOD_NAME) {
|
|
923
581
|
return fails(function () {
|
|
924
|
-
return !!whitespaces[METHOD_NAME]()
|
|
925
|
-
|| non[METHOD_NAME]() !== non
|
|
926
|
-
|| (PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME);
|
|
582
|
+
return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME;
|
|
927
583
|
});
|
|
928
584
|
};
|
|
929
585
|
|
|
@@ -931,7 +587,7 @@ var Radar = (function () {
|
|
|
931
587
|
|
|
932
588
|
|
|
933
589
|
// `String.prototype.trim` method
|
|
934
|
-
// https://tc39.
|
|
590
|
+
// https://tc39.github.io/ecma262/#sec-string.prototype.trim
|
|
935
591
|
_export({ target: 'String', proto: true, forced: stringTrimForced('trim') }, {
|
|
936
592
|
trim: function trim() {
|
|
937
593
|
return $trim(this);
|
|
@@ -1061,66 +717,87 @@ var Radar = (function () {
|
|
|
1061
717
|
return target;
|
|
1062
718
|
}
|
|
1063
719
|
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
return
|
|
1068
|
-
};
|
|
1069
|
-
|
|
1070
|
-
// `Object.prototype.toString` method
|
|
1071
|
-
// https://tc39.es/ecma262/#sec-object.prototype.tostring
|
|
1072
|
-
if (!toStringTagSupport) {
|
|
1073
|
-
defineBuiltIn(Object.prototype, 'toString', objectToString, { unsafe: true });
|
|
1074
|
-
}
|
|
720
|
+
var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
|
|
721
|
+
// Chrome 38 Symbol has incorrect toString conversion
|
|
722
|
+
// eslint-disable-next-line no-undef
|
|
723
|
+
return !String(Symbol());
|
|
724
|
+
});
|
|
1075
725
|
|
|
1076
|
-
var
|
|
726
|
+
var useSymbolAsUid = nativeSymbol
|
|
727
|
+
// eslint-disable-next-line no-undef
|
|
728
|
+
&& !Symbol.sham
|
|
729
|
+
// eslint-disable-next-line no-undef
|
|
730
|
+
&& typeof Symbol.iterator == 'symbol';
|
|
1077
731
|
|
|
1078
|
-
var
|
|
1079
|
-
var $
|
|
732
|
+
var WellKnownSymbolsStore = shared('wks');
|
|
733
|
+
var Symbol$1 = global_1.Symbol;
|
|
734
|
+
var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
|
|
1080
735
|
|
|
1081
|
-
var
|
|
1082
|
-
if (
|
|
1083
|
-
|
|
736
|
+
var wellKnownSymbol = function (name) {
|
|
737
|
+
if (!has(WellKnownSymbolsStore, name)) {
|
|
738
|
+
if (nativeSymbol && has(Symbol$1, name)) WellKnownSymbolsStore[name] = Symbol$1[name];
|
|
739
|
+
else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
|
|
740
|
+
} return WellKnownSymbolsStore[name];
|
|
1084
741
|
};
|
|
1085
742
|
|
|
1086
|
-
|
|
743
|
+
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
|
744
|
+
var test = {};
|
|
1087
745
|
|
|
746
|
+
test[TO_STRING_TAG] = 'z';
|
|
1088
747
|
|
|
748
|
+
var toStringTagSupport = String(test) === '[object z]';
|
|
1089
749
|
|
|
750
|
+
var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
|
|
751
|
+
// ES3 wrong here
|
|
752
|
+
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
|
|
1090
753
|
|
|
1091
|
-
//
|
|
1092
|
-
|
|
1093
|
-
// Works with __proto__ only. Old v8 can't work with null proto objects.
|
|
1094
|
-
// eslint-disable-next-line es-x/no-object-setprototypeof -- safe
|
|
1095
|
-
var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
|
1096
|
-
var CORRECT_SETTER = false;
|
|
1097
|
-
var test = {};
|
|
1098
|
-
var setter;
|
|
754
|
+
// fallback for IE11 Script Access Denied error
|
|
755
|
+
var tryGet = function (it, key) {
|
|
1099
756
|
try {
|
|
1100
|
-
|
|
1101
|
-
setter = functionUncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
|
|
1102
|
-
setter(test, []);
|
|
1103
|
-
CORRECT_SETTER = test instanceof Array;
|
|
757
|
+
return it[key];
|
|
1104
758
|
} catch (error) { /* empty */ }
|
|
1105
|
-
|
|
1106
|
-
anObject(O);
|
|
1107
|
-
aPossiblePrototype(proto);
|
|
1108
|
-
if (CORRECT_SETTER) setter(O, proto);
|
|
1109
|
-
else O.__proto__ = proto;
|
|
1110
|
-
return O;
|
|
1111
|
-
};
|
|
1112
|
-
}() : undefined);
|
|
759
|
+
};
|
|
1113
760
|
|
|
1114
|
-
|
|
761
|
+
// getting tag from ES6+ `Object.prototype.toString`
|
|
762
|
+
var classof = toStringTagSupport ? classofRaw : function (it) {
|
|
763
|
+
var O, tag, result;
|
|
764
|
+
return it === undefined ? 'Undefined' : it === null ? 'Null'
|
|
765
|
+
// @@toStringTag case
|
|
766
|
+
: typeof (tag = tryGet(O = Object(it), TO_STRING_TAG$1)) == 'string' ? tag
|
|
767
|
+
// builtinTag case
|
|
768
|
+
: CORRECT_ARGUMENTS ? classofRaw(O)
|
|
769
|
+
// ES3 arguments fallback
|
|
770
|
+
: (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
|
|
771
|
+
};
|
|
772
|
+
|
|
773
|
+
// `Object.prototype.toString` method implementation
|
|
774
|
+
// https://tc39.github.io/ecma262/#sec-object.prototype.tostring
|
|
775
|
+
var objectToString = toStringTagSupport ? {}.toString : function toString() {
|
|
776
|
+
return '[object ' + classof(this) + ']';
|
|
777
|
+
};
|
|
778
|
+
|
|
779
|
+
// `Object.prototype.toString` method
|
|
780
|
+
// https://tc39.github.io/ecma262/#sec-object.prototype.tostring
|
|
781
|
+
if (!toStringTagSupport) {
|
|
782
|
+
redefine(Object.prototype, 'toString', objectToString, { unsafe: true });
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
var nativePromiseConstructor = global_1.Promise;
|
|
786
|
+
|
|
787
|
+
var redefineAll = function (target, src, options) {
|
|
788
|
+
for (var key in src) redefine(target, key, src[key], options);
|
|
789
|
+
return target;
|
|
790
|
+
};
|
|
791
|
+
|
|
792
|
+
var defineProperty = objectDefineProperty.f;
|
|
1115
793
|
|
|
1116
794
|
|
|
1117
795
|
|
|
1118
796
|
var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
|
|
1119
797
|
|
|
1120
|
-
var setToStringTag = function (
|
|
1121
|
-
if (
|
|
1122
|
-
|
|
1123
|
-
defineProperty$1(target, TO_STRING_TAG$2, { configurable: true, value: TAG });
|
|
798
|
+
var setToStringTag = function (it, TAG, STATIC) {
|
|
799
|
+
if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG$2)) {
|
|
800
|
+
defineProperty(it, TO_STRING_TAG$2, { configurable: true, value: TAG });
|
|
1124
801
|
}
|
|
1125
802
|
};
|
|
1126
803
|
|
|
@@ -1138,128 +815,177 @@ var Radar = (function () {
|
|
|
1138
815
|
}
|
|
1139
816
|
};
|
|
1140
817
|
|
|
1141
|
-
var $
|
|
818
|
+
var aFunction$1 = function (it) {
|
|
819
|
+
if (typeof it != 'function') {
|
|
820
|
+
throw TypeError(String(it) + ' is not a function');
|
|
821
|
+
} return it;
|
|
822
|
+
};
|
|
1142
823
|
|
|
1143
|
-
var anInstance = function (it,
|
|
1144
|
-
if (
|
|
1145
|
-
|
|
824
|
+
var anInstance = function (it, Constructor, name) {
|
|
825
|
+
if (!(it instanceof Constructor)) {
|
|
826
|
+
throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation');
|
|
827
|
+
} return it;
|
|
1146
828
|
};
|
|
1147
829
|
|
|
1148
|
-
var
|
|
1149
|
-
var empty = [];
|
|
1150
|
-
var construct = getBuiltIn('Reflect', 'construct');
|
|
1151
|
-
var constructorRegExp = /^\s*(?:class|function)\b/;
|
|
1152
|
-
var exec = functionUncurryThis(constructorRegExp.exec);
|
|
1153
|
-
var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
|
|
830
|
+
var iterators = {};
|
|
1154
831
|
|
|
1155
|
-
var
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
return false;
|
|
1162
|
-
}
|
|
832
|
+
var ITERATOR = wellKnownSymbol('iterator');
|
|
833
|
+
var ArrayPrototype = Array.prototype;
|
|
834
|
+
|
|
835
|
+
// check on default Array iterator
|
|
836
|
+
var isArrayIteratorMethod = function (it) {
|
|
837
|
+
return it !== undefined && (iterators.Array === it || ArrayPrototype[ITERATOR] === it);
|
|
1163
838
|
};
|
|
1164
839
|
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
case
|
|
840
|
+
// optional / simple context binding
|
|
841
|
+
var functionBindContext = function (fn, that, length) {
|
|
842
|
+
aFunction$1(fn);
|
|
843
|
+
if (that === undefined) return fn;
|
|
844
|
+
switch (length) {
|
|
845
|
+
case 0: return function () {
|
|
846
|
+
return fn.call(that);
|
|
847
|
+
};
|
|
848
|
+
case 1: return function (a) {
|
|
849
|
+
return fn.call(that, a);
|
|
850
|
+
};
|
|
851
|
+
case 2: return function (a, b) {
|
|
852
|
+
return fn.call(that, a, b);
|
|
853
|
+
};
|
|
854
|
+
case 3: return function (a, b, c) {
|
|
855
|
+
return fn.call(that, a, b, c);
|
|
856
|
+
};
|
|
1171
857
|
}
|
|
858
|
+
return function (/* ...args */) {
|
|
859
|
+
return fn.apply(that, arguments);
|
|
860
|
+
};
|
|
861
|
+
};
|
|
862
|
+
|
|
863
|
+
var ITERATOR$1 = wellKnownSymbol('iterator');
|
|
864
|
+
|
|
865
|
+
var getIteratorMethod = function (it) {
|
|
866
|
+
if (it != undefined) return it[ITERATOR$1]
|
|
867
|
+
|| it['@@iterator']
|
|
868
|
+
|| iterators[classof(it)];
|
|
869
|
+
};
|
|
870
|
+
|
|
871
|
+
// call something on iterator step with safe closing on error
|
|
872
|
+
var callWithSafeIterationClosing = function (iterator, fn, value, ENTRIES) {
|
|
1172
873
|
try {
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
// (for example, `DOMQuad` and similar in FF41-)
|
|
1176
|
-
return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
|
|
874
|
+
return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
|
|
875
|
+
// 7.4.6 IteratorClose(iterator, completion)
|
|
1177
876
|
} catch (error) {
|
|
1178
|
-
return
|
|
877
|
+
var returnMethod = iterator['return'];
|
|
878
|
+
if (returnMethod !== undefined) anObject(returnMethod.call(iterator));
|
|
879
|
+
throw error;
|
|
1179
880
|
}
|
|
1180
881
|
};
|
|
1181
882
|
|
|
1182
|
-
|
|
883
|
+
var iterate_1 = createCommonjsModule(function (module) {
|
|
884
|
+
var Result = function (stopped, result) {
|
|
885
|
+
this.stopped = stopped;
|
|
886
|
+
this.result = result;
|
|
887
|
+
};
|
|
1183
888
|
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
var called;
|
|
1188
|
-
return isConstructorModern(isConstructorModern.call)
|
|
1189
|
-
|| !isConstructorModern(Object)
|
|
1190
|
-
|| !isConstructorModern(function () { called = true; })
|
|
1191
|
-
|| called;
|
|
1192
|
-
}) ? isConstructorLegacy : isConstructorModern;
|
|
889
|
+
var iterate = module.exports = function (iterable, fn, that, AS_ENTRIES, IS_ITERATOR) {
|
|
890
|
+
var boundFunction = functionBindContext(fn, that, AS_ENTRIES ? 2 : 1);
|
|
891
|
+
var iterator, iterFn, index, length, result, next, step;
|
|
1193
892
|
|
|
1194
|
-
|
|
893
|
+
if (IS_ITERATOR) {
|
|
894
|
+
iterator = iterable;
|
|
895
|
+
} else {
|
|
896
|
+
iterFn = getIteratorMethod(iterable);
|
|
897
|
+
if (typeof iterFn != 'function') throw TypeError('Target is not iterable');
|
|
898
|
+
// optimisation for array iterators
|
|
899
|
+
if (isArrayIteratorMethod(iterFn)) {
|
|
900
|
+
for (index = 0, length = toLength(iterable.length); length > index; index++) {
|
|
901
|
+
result = AS_ENTRIES
|
|
902
|
+
? boundFunction(anObject(step = iterable[index])[0], step[1])
|
|
903
|
+
: boundFunction(iterable[index]);
|
|
904
|
+
if (result && result instanceof Result) return result;
|
|
905
|
+
} return new Result(false);
|
|
906
|
+
}
|
|
907
|
+
iterator = iterFn.call(iterable);
|
|
908
|
+
}
|
|
1195
909
|
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
910
|
+
next = iterator.next;
|
|
911
|
+
while (!(step = next.call(iterator)).done) {
|
|
912
|
+
result = callWithSafeIterationClosing(iterator, boundFunction, step.value, AS_ENTRIES);
|
|
913
|
+
if (typeof result == 'object' && result && result instanceof Result) return result;
|
|
914
|
+
} return new Result(false);
|
|
1200
915
|
};
|
|
1201
916
|
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
// `SpeciesConstructor` abstract operation
|
|
1205
|
-
// https://tc39.es/ecma262/#sec-speciesconstructor
|
|
1206
|
-
var speciesConstructor = function (O, defaultConstructor) {
|
|
1207
|
-
var C = anObject(O).constructor;
|
|
1208
|
-
var S;
|
|
1209
|
-
return C === undefined || (S = anObject(C)[SPECIES$1]) == undefined ? defaultConstructor : aConstructor(S);
|
|
917
|
+
iterate.stop = function (result) {
|
|
918
|
+
return new Result(true, result);
|
|
1210
919
|
};
|
|
1211
|
-
|
|
1212
|
-
var FunctionPrototype$2 = Function.prototype;
|
|
1213
|
-
var apply = FunctionPrototype$2.apply;
|
|
1214
|
-
var call$2 = FunctionPrototype$2.call;
|
|
1215
|
-
|
|
1216
|
-
// eslint-disable-next-line es-x/no-reflect -- safe
|
|
1217
|
-
var functionApply = typeof Reflect == 'object' && Reflect.apply || (functionBindNative ? call$2.bind(apply) : function () {
|
|
1218
|
-
return call$2.apply(apply, arguments);
|
|
1219
920
|
});
|
|
1220
921
|
|
|
1221
|
-
var
|
|
922
|
+
var ITERATOR$2 = wellKnownSymbol('iterator');
|
|
923
|
+
var SAFE_CLOSING = false;
|
|
1222
924
|
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
925
|
+
try {
|
|
926
|
+
var called = 0;
|
|
927
|
+
var iteratorWithReturn = {
|
|
928
|
+
next: function () {
|
|
929
|
+
return { done: !!called++ };
|
|
930
|
+
},
|
|
931
|
+
'return': function () {
|
|
932
|
+
SAFE_CLOSING = true;
|
|
933
|
+
}
|
|
934
|
+
};
|
|
935
|
+
iteratorWithReturn[ITERATOR$2] = function () {
|
|
936
|
+
return this;
|
|
1228
937
|
};
|
|
938
|
+
// eslint-disable-next-line no-throw-literal
|
|
939
|
+
Array.from(iteratorWithReturn, function () { throw 2; });
|
|
940
|
+
} catch (error) { /* empty */ }
|
|
941
|
+
|
|
942
|
+
var checkCorrectnessOfIteration = function (exec, SKIP_CLOSING) {
|
|
943
|
+
if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
|
|
944
|
+
var ITERATION_SUPPORT = false;
|
|
945
|
+
try {
|
|
946
|
+
var object = {};
|
|
947
|
+
object[ITERATOR$2] = function () {
|
|
948
|
+
return {
|
|
949
|
+
next: function () {
|
|
950
|
+
return { done: ITERATION_SUPPORT = true };
|
|
951
|
+
}
|
|
952
|
+
};
|
|
953
|
+
};
|
|
954
|
+
exec(object);
|
|
955
|
+
} catch (error) { /* empty */ }
|
|
956
|
+
return ITERATION_SUPPORT;
|
|
1229
957
|
};
|
|
1230
958
|
|
|
1231
|
-
var
|
|
959
|
+
var SPECIES$1 = wellKnownSymbol('species');
|
|
1232
960
|
|
|
1233
|
-
|
|
961
|
+
// `SpeciesConstructor` abstract operation
|
|
962
|
+
// https://tc39.github.io/ecma262/#sec-speciesconstructor
|
|
963
|
+
var speciesConstructor = function (O, defaultConstructor) {
|
|
964
|
+
var C = anObject(O).constructor;
|
|
965
|
+
var S;
|
|
966
|
+
return C === undefined || (S = anObject(C)[SPECIES$1]) == undefined ? defaultConstructor : aFunction$1(S);
|
|
967
|
+
};
|
|
1234
968
|
|
|
1235
|
-
var
|
|
969
|
+
var html = getBuiltIn('document', 'documentElement');
|
|
1236
970
|
|
|
1237
|
-
var
|
|
1238
|
-
if (passed < required) throw $TypeError$9('Not enough arguments');
|
|
1239
|
-
return passed;
|
|
1240
|
-
};
|
|
971
|
+
var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
|
|
1241
972
|
|
|
1242
|
-
var engineIsIos = /(
|
|
973
|
+
var engineIsIos = /(iphone|ipod|ipad).*applewebkit/i.test(engineUserAgent);
|
|
1243
974
|
|
|
975
|
+
var location = global_1.location;
|
|
1244
976
|
var set$1 = global_1.setImmediate;
|
|
1245
977
|
var clear = global_1.clearImmediate;
|
|
1246
|
-
var process
|
|
1247
|
-
var Dispatch = global_1.Dispatch;
|
|
1248
|
-
var Function$1 = global_1.Function;
|
|
978
|
+
var process = global_1.process;
|
|
1249
979
|
var MessageChannel = global_1.MessageChannel;
|
|
1250
|
-
var
|
|
980
|
+
var Dispatch = global_1.Dispatch;
|
|
1251
981
|
var counter = 0;
|
|
1252
982
|
var queue = {};
|
|
1253
983
|
var ONREADYSTATECHANGE = 'onreadystatechange';
|
|
1254
|
-
var
|
|
1255
|
-
|
|
1256
|
-
try {
|
|
1257
|
-
// Deno throws a ReferenceError on `location` access without `--location` flag
|
|
1258
|
-
location = global_1.location;
|
|
1259
|
-
} catch (error) { /* empty */ }
|
|
984
|
+
var defer, channel, port;
|
|
1260
985
|
|
|
1261
986
|
var run = function (id) {
|
|
1262
|
-
|
|
987
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
988
|
+
if (queue.hasOwnProperty(id)) {
|
|
1263
989
|
var fn = queue[id];
|
|
1264
990
|
delete queue[id];
|
|
1265
991
|
fn();
|
|
@@ -1278,17 +1004,18 @@ var Radar = (function () {
|
|
|
1278
1004
|
|
|
1279
1005
|
var post = function (id) {
|
|
1280
1006
|
// old engines have not location.origin
|
|
1281
|
-
global_1.postMessage(
|
|
1007
|
+
global_1.postMessage(id + '', location.protocol + '//' + location.host);
|
|
1282
1008
|
};
|
|
1283
1009
|
|
|
1284
1010
|
// Node.js 0.9+ & IE10+ has setImmediate, otherwise:
|
|
1285
1011
|
if (!set$1 || !clear) {
|
|
1286
|
-
set$1 = function setImmediate(
|
|
1287
|
-
|
|
1288
|
-
var
|
|
1289
|
-
|
|
1012
|
+
set$1 = function setImmediate(fn) {
|
|
1013
|
+
var args = [];
|
|
1014
|
+
var i = 1;
|
|
1015
|
+
while (arguments.length > i) args.push(arguments[i++]);
|
|
1290
1016
|
queue[++counter] = function () {
|
|
1291
|
-
|
|
1017
|
+
// eslint-disable-next-line no-new-func
|
|
1018
|
+
(typeof fn == 'function' ? fn : Function(fn)).apply(undefined, args);
|
|
1292
1019
|
};
|
|
1293
1020
|
defer(counter);
|
|
1294
1021
|
return counter;
|
|
@@ -1297,9 +1024,9 @@ var Radar = (function () {
|
|
|
1297
1024
|
delete queue[id];
|
|
1298
1025
|
};
|
|
1299
1026
|
// Node.js 0.8-
|
|
1300
|
-
if (
|
|
1027
|
+
if (classofRaw(process) == 'process') {
|
|
1301
1028
|
defer = function (id) {
|
|
1302
|
-
process
|
|
1029
|
+
process.nextTick(runner(id));
|
|
1303
1030
|
};
|
|
1304
1031
|
// Sphere (JS game engine) Dispatch API
|
|
1305
1032
|
} else if (Dispatch && Dispatch.now) {
|
|
@@ -1312,16 +1039,10 @@ var Radar = (function () {
|
|
|
1312
1039
|
channel = new MessageChannel();
|
|
1313
1040
|
port = channel.port2;
|
|
1314
1041
|
channel.port1.onmessage = listener;
|
|
1315
|
-
defer = functionBindContext(port.postMessage, port);
|
|
1042
|
+
defer = functionBindContext(port.postMessage, port, 1);
|
|
1316
1043
|
// Browsers with postMessage, skip WebWorkers
|
|
1317
1044
|
// IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
|
|
1318
|
-
} else if (
|
|
1319
|
-
global_1.addEventListener &&
|
|
1320
|
-
isCallable(global_1.postMessage) &&
|
|
1321
|
-
!global_1.importScripts &&
|
|
1322
|
-
location && location.protocol !== 'file:' &&
|
|
1323
|
-
!fails(post)
|
|
1324
|
-
) {
|
|
1045
|
+
} else if (global_1.addEventListener && typeof postMessage == 'function' && !global_1.importScripts && !fails(post)) {
|
|
1325
1046
|
defer = post;
|
|
1326
1047
|
global_1.addEventListener('message', listener, false);
|
|
1327
1048
|
// IE8-
|
|
@@ -1345,21 +1066,15 @@ var Radar = (function () {
|
|
|
1345
1066
|
clear: clear
|
|
1346
1067
|
};
|
|
1347
1068
|
|
|
1348
|
-
var engineIsIosPebble = /ipad|iphone|ipod/i.test(engineUserAgent) && global_1.Pebble !== undefined;
|
|
1349
|
-
|
|
1350
|
-
var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(engineUserAgent);
|
|
1351
|
-
|
|
1352
1069
|
var getOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f;
|
|
1353
|
-
var macrotask = task.set;
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
1070
|
|
|
1071
|
+
var macrotask = task.set;
|
|
1357
1072
|
|
|
1358
1073
|
|
|
1359
1074
|
var MutationObserver = global_1.MutationObserver || global_1.WebKitMutationObserver;
|
|
1360
|
-
var
|
|
1361
|
-
var process$2 = global_1.process;
|
|
1075
|
+
var process$1 = global_1.process;
|
|
1362
1076
|
var Promise$1 = global_1.Promise;
|
|
1077
|
+
var IS_NODE = classofRaw(process$1) == 'process';
|
|
1363
1078
|
// Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
|
|
1364
1079
|
var queueMicrotaskDescriptor = getOwnPropertyDescriptor$2(global_1, 'queueMicrotask');
|
|
1365
1080
|
var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
|
|
@@ -1370,7 +1085,7 @@ var Radar = (function () {
|
|
|
1370
1085
|
if (!queueMicrotask) {
|
|
1371
1086
|
flush = function () {
|
|
1372
1087
|
var parent, fn;
|
|
1373
|
-
if (
|
|
1088
|
+
if (IS_NODE && (parent = process$1.domain)) parent.exit();
|
|
1374
1089
|
while (head) {
|
|
1375
1090
|
fn = head.fn;
|
|
1376
1091
|
head = head.next;
|
|
@@ -1385,41 +1100,37 @@ var Radar = (function () {
|
|
|
1385
1100
|
if (parent) parent.enter();
|
|
1386
1101
|
};
|
|
1387
1102
|
|
|
1103
|
+
// Node.js
|
|
1104
|
+
if (IS_NODE) {
|
|
1105
|
+
notify = function () {
|
|
1106
|
+
process$1.nextTick(flush);
|
|
1107
|
+
};
|
|
1388
1108
|
// browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
|
|
1389
|
-
|
|
1390
|
-
if (!engineIsIos && !engineIsNode && !engineIsWebosWebkit && MutationObserver && document$2) {
|
|
1109
|
+
} else if (MutationObserver && !engineIsIos) {
|
|
1391
1110
|
toggle = true;
|
|
1392
|
-
node = document
|
|
1111
|
+
node = document.createTextNode('');
|
|
1393
1112
|
new MutationObserver(flush).observe(node, { characterData: true });
|
|
1394
1113
|
notify = function () {
|
|
1395
1114
|
node.data = toggle = !toggle;
|
|
1396
1115
|
};
|
|
1397
1116
|
// environments with maybe non-completely correct, but existent Promise
|
|
1398
|
-
} else if (
|
|
1117
|
+
} else if (Promise$1 && Promise$1.resolve) {
|
|
1399
1118
|
// Promise.resolve without an argument throws an error in LG WebOS 2
|
|
1400
1119
|
promise = Promise$1.resolve(undefined);
|
|
1401
|
-
|
|
1402
|
-
promise.constructor = Promise$1;
|
|
1403
|
-
then = functionBindContext(promise.then, promise);
|
|
1404
|
-
notify = function () {
|
|
1405
|
-
then(flush);
|
|
1406
|
-
};
|
|
1407
|
-
// Node.js without promises
|
|
1408
|
-
} else if (engineIsNode) {
|
|
1120
|
+
then = promise.then;
|
|
1409
1121
|
notify = function () {
|
|
1410
|
-
|
|
1122
|
+
then.call(promise, flush);
|
|
1411
1123
|
};
|
|
1412
1124
|
// for other environments - macrotask based on:
|
|
1413
1125
|
// - setImmediate
|
|
1414
1126
|
// - MessageChannel
|
|
1415
|
-
// - window.
|
|
1127
|
+
// - window.postMessag
|
|
1416
1128
|
// - onreadystatechange
|
|
1417
1129
|
// - setTimeout
|
|
1418
1130
|
} else {
|
|
1419
|
-
// strange IE + webpack dev server bug - use .bind(global)
|
|
1420
|
-
macrotask = functionBindContext(macrotask, global_1);
|
|
1421
1131
|
notify = function () {
|
|
1422
|
-
|
|
1132
|
+
// strange IE + webpack dev server bug - use .call(global)
|
|
1133
|
+
macrotask.call(global_1, flush);
|
|
1423
1134
|
};
|
|
1424
1135
|
}
|
|
1425
1136
|
}
|
|
@@ -1433,10 +1144,39 @@ var Radar = (function () {
|
|
|
1433
1144
|
} last = task;
|
|
1434
1145
|
};
|
|
1435
1146
|
|
|
1147
|
+
var PromiseCapability = function (C) {
|
|
1148
|
+
var resolve, reject;
|
|
1149
|
+
this.promise = new C(function ($$resolve, $$reject) {
|
|
1150
|
+
if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
|
|
1151
|
+
resolve = $$resolve;
|
|
1152
|
+
reject = $$reject;
|
|
1153
|
+
});
|
|
1154
|
+
this.resolve = aFunction$1(resolve);
|
|
1155
|
+
this.reject = aFunction$1(reject);
|
|
1156
|
+
};
|
|
1157
|
+
|
|
1158
|
+
// 25.4.1.5 NewPromiseCapability(C)
|
|
1159
|
+
var f$5 = function (C) {
|
|
1160
|
+
return new PromiseCapability(C);
|
|
1161
|
+
};
|
|
1162
|
+
|
|
1163
|
+
var newPromiseCapability = {
|
|
1164
|
+
f: f$5
|
|
1165
|
+
};
|
|
1166
|
+
|
|
1167
|
+
var promiseResolve = function (C, x) {
|
|
1168
|
+
anObject(C);
|
|
1169
|
+
if (isObject(x) && x.constructor === C) return x;
|
|
1170
|
+
var promiseCapability = newPromiseCapability.f(C);
|
|
1171
|
+
var resolve = promiseCapability.resolve;
|
|
1172
|
+
resolve(x);
|
|
1173
|
+
return promiseCapability.promise;
|
|
1174
|
+
};
|
|
1175
|
+
|
|
1436
1176
|
var hostReportErrors = function (a, b) {
|
|
1437
1177
|
var console = global_1.console;
|
|
1438
1178
|
if (console && console.error) {
|
|
1439
|
-
arguments.length
|
|
1179
|
+
arguments.length === 1 ? console.error(a) : console.error(a, b);
|
|
1440
1180
|
}
|
|
1441
1181
|
};
|
|
1442
1182
|
|
|
@@ -1448,89 +1188,23 @@ var Radar = (function () {
|
|
|
1448
1188
|
}
|
|
1449
1189
|
};
|
|
1450
1190
|
|
|
1451
|
-
var
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1191
|
+
var process$2 = global_1.process;
|
|
1192
|
+
var versions = process$2 && process$2.versions;
|
|
1193
|
+
var v8 = versions && versions.v8;
|
|
1194
|
+
var match, version;
|
|
1455
1195
|
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
var entry = this.head;
|
|
1465
|
-
if (entry) {
|
|
1466
|
-
this.head = entry.next;
|
|
1467
|
-
if (this.tail === entry) this.tail = null;
|
|
1468
|
-
return entry.item;
|
|
1469
|
-
}
|
|
1196
|
+
if (v8) {
|
|
1197
|
+
match = v8.split('.');
|
|
1198
|
+
version = match[0] + match[1];
|
|
1199
|
+
} else if (engineUserAgent) {
|
|
1200
|
+
match = engineUserAgent.match(/Edge\/(\d+)/);
|
|
1201
|
+
if (!match || match[1] >= 74) {
|
|
1202
|
+
match = engineUserAgent.match(/Chrome\/(\d+)/);
|
|
1203
|
+
if (match) version = match[1];
|
|
1470
1204
|
}
|
|
1471
|
-
}
|
|
1472
|
-
|
|
1473
|
-
var queue$1 = Queue;
|
|
1474
|
-
|
|
1475
|
-
var promiseNativeConstructor = global_1.Promise;
|
|
1476
|
-
|
|
1477
|
-
var engineIsBrowser = typeof window == 'object' && typeof Deno != 'object';
|
|
1478
|
-
|
|
1479
|
-
var NativePromisePrototype = promiseNativeConstructor && promiseNativeConstructor.prototype;
|
|
1480
|
-
var SPECIES$2 = wellKnownSymbol('species');
|
|
1481
|
-
var SUBCLASSING = false;
|
|
1482
|
-
var NATIVE_PROMISE_REJECTION_EVENT = isCallable(global_1.PromiseRejectionEvent);
|
|
1483
|
-
|
|
1484
|
-
var FORCED_PROMISE_CONSTRUCTOR = isForced_1('Promise', function () {
|
|
1485
|
-
var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(promiseNativeConstructor);
|
|
1486
|
-
var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(promiseNativeConstructor);
|
|
1487
|
-
// V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
|
|
1488
|
-
// https://bugs.chromium.org/p/chromium/issues/detail?id=830565
|
|
1489
|
-
// We can't detect it synchronously, so just check versions
|
|
1490
|
-
if (!GLOBAL_CORE_JS_PROMISE && engineV8Version === 66) return true;
|
|
1491
|
-
// We can't use @@species feature detection in V8 since it causes
|
|
1492
|
-
// deoptimization and performance degradation
|
|
1493
|
-
// https://github.com/zloirock/core-js/issues/679
|
|
1494
|
-
if (engineV8Version >= 51 && /native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) return false;
|
|
1495
|
-
// Detect correctness of subclassing with @@species support
|
|
1496
|
-
var promise = new promiseNativeConstructor(function (resolve) { resolve(1); });
|
|
1497
|
-
var FakePromise = function (exec) {
|
|
1498
|
-
exec(function () { /* empty */ }, function () { /* empty */ });
|
|
1499
|
-
};
|
|
1500
|
-
var constructor = promise.constructor = {};
|
|
1501
|
-
constructor[SPECIES$2] = FakePromise;
|
|
1502
|
-
SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
|
|
1503
|
-
if (!SUBCLASSING) return true;
|
|
1504
|
-
// Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
|
|
1505
|
-
return !GLOBAL_CORE_JS_PROMISE && engineIsBrowser && !NATIVE_PROMISE_REJECTION_EVENT;
|
|
1506
|
-
});
|
|
1507
|
-
|
|
1508
|
-
var promiseConstructorDetection = {
|
|
1509
|
-
CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR,
|
|
1510
|
-
REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT,
|
|
1511
|
-
SUBCLASSING: SUBCLASSING
|
|
1512
|
-
};
|
|
1513
|
-
|
|
1514
|
-
var PromiseCapability = function (C) {
|
|
1515
|
-
var resolve, reject;
|
|
1516
|
-
this.promise = new C(function ($$resolve, $$reject) {
|
|
1517
|
-
if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
|
|
1518
|
-
resolve = $$resolve;
|
|
1519
|
-
reject = $$reject;
|
|
1520
|
-
});
|
|
1521
|
-
this.resolve = aCallable(resolve);
|
|
1522
|
-
this.reject = aCallable(reject);
|
|
1523
|
-
};
|
|
1524
|
-
|
|
1525
|
-
// `NewPromiseCapability` abstract operation
|
|
1526
|
-
// https://tc39.es/ecma262/#sec-newpromisecapability
|
|
1527
|
-
var f$5 = function (C) {
|
|
1528
|
-
return new PromiseCapability(C);
|
|
1529
|
-
};
|
|
1205
|
+
}
|
|
1530
1206
|
|
|
1531
|
-
var
|
|
1532
|
-
f: f$5
|
|
1533
|
-
};
|
|
1207
|
+
var engineV8Version = version && +version;
|
|
1534
1208
|
|
|
1535
1209
|
var task$1 = task.set;
|
|
1536
1210
|
|
|
@@ -1542,22 +1216,21 @@ var Radar = (function () {
|
|
|
1542
1216
|
|
|
1543
1217
|
|
|
1544
1218
|
|
|
1219
|
+
|
|
1220
|
+
var SPECIES$2 = wellKnownSymbol('species');
|
|
1545
1221
|
var PROMISE = 'Promise';
|
|
1546
|
-
var
|
|
1547
|
-
var NATIVE_PROMISE_REJECTION_EVENT$1 = promiseConstructorDetection.REJECTION_EVENT;
|
|
1548
|
-
var NATIVE_PROMISE_SUBCLASSING = promiseConstructorDetection.SUBCLASSING;
|
|
1549
|
-
var getInternalPromiseState = internalState.getterFor(PROMISE);
|
|
1222
|
+
var getInternalState = internalState.get;
|
|
1550
1223
|
var setInternalState = internalState.set;
|
|
1551
|
-
var
|
|
1552
|
-
var PromiseConstructor =
|
|
1553
|
-
var
|
|
1554
|
-
var
|
|
1555
|
-
var document$3 = global_1.document;
|
|
1224
|
+
var getInternalPromiseState = internalState.getterFor(PROMISE);
|
|
1225
|
+
var PromiseConstructor = nativePromiseConstructor;
|
|
1226
|
+
var TypeError$1 = global_1.TypeError;
|
|
1227
|
+
var document$2 = global_1.document;
|
|
1556
1228
|
var process$3 = global_1.process;
|
|
1229
|
+
var $fetch = getBuiltIn('fetch');
|
|
1557
1230
|
var newPromiseCapability$1 = newPromiseCapability.f;
|
|
1558
1231
|
var newGenericPromiseCapability = newPromiseCapability$1;
|
|
1559
|
-
|
|
1560
|
-
var DISPATCH_EVENT = !!(document$
|
|
1232
|
+
var IS_NODE$1 = classofRaw(process$3) == 'process';
|
|
1233
|
+
var DISPATCH_EVENT = !!(document$2 && document$2.createEvent && global_1.dispatchEvent);
|
|
1561
1234
|
var UNHANDLED_REJECTION = 'unhandledrejection';
|
|
1562
1235
|
var REJECTION_HANDLED = 'rejectionhandled';
|
|
1563
1236
|
var PENDING = 0;
|
|
@@ -1565,91 +1238,116 @@ var Radar = (function () {
|
|
|
1565
1238
|
var REJECTED = 2;
|
|
1566
1239
|
var HANDLED = 1;
|
|
1567
1240
|
var UNHANDLED = 2;
|
|
1568
|
-
|
|
1569
1241
|
var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
|
|
1570
1242
|
|
|
1243
|
+
var FORCED = isForced_1(PROMISE, function () {
|
|
1244
|
+
var GLOBAL_CORE_JS_PROMISE = inspectSource(PromiseConstructor) !== String(PromiseConstructor);
|
|
1245
|
+
if (!GLOBAL_CORE_JS_PROMISE) {
|
|
1246
|
+
// V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
|
|
1247
|
+
// https://bugs.chromium.org/p/chromium/issues/detail?id=830565
|
|
1248
|
+
// We can't detect it synchronously, so just check versions
|
|
1249
|
+
if (engineV8Version === 66) return true;
|
|
1250
|
+
// Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
|
|
1251
|
+
if (!IS_NODE$1 && typeof PromiseRejectionEvent != 'function') return true;
|
|
1252
|
+
}
|
|
1253
|
+
// We can't use @@species feature detection in V8 since it causes
|
|
1254
|
+
// deoptimization and performance degradation
|
|
1255
|
+
// https://github.com/zloirock/core-js/issues/679
|
|
1256
|
+
if (engineV8Version >= 51 && /native code/.test(PromiseConstructor)) return false;
|
|
1257
|
+
// Detect correctness of subclassing with @@species support
|
|
1258
|
+
var promise = PromiseConstructor.resolve(1);
|
|
1259
|
+
var FakePromise = function (exec) {
|
|
1260
|
+
exec(function () { /* empty */ }, function () { /* empty */ });
|
|
1261
|
+
};
|
|
1262
|
+
var constructor = promise.constructor = {};
|
|
1263
|
+
constructor[SPECIES$2] = FakePromise;
|
|
1264
|
+
return !(promise.then(function () { /* empty */ }) instanceof FakePromise);
|
|
1265
|
+
});
|
|
1266
|
+
|
|
1267
|
+
var INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) {
|
|
1268
|
+
PromiseConstructor.all(iterable)['catch'](function () { /* empty */ });
|
|
1269
|
+
});
|
|
1270
|
+
|
|
1571
1271
|
// helpers
|
|
1572
1272
|
var isThenable = function (it) {
|
|
1573
1273
|
var then;
|
|
1574
|
-
return isObject(it) &&
|
|
1274
|
+
return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
|
|
1575
1275
|
};
|
|
1576
1276
|
|
|
1577
|
-
var
|
|
1578
|
-
var value = state.value;
|
|
1579
|
-
var ok = state.state == FULFILLED;
|
|
1580
|
-
var handler = ok ? reaction.ok : reaction.fail;
|
|
1581
|
-
var resolve = reaction.resolve;
|
|
1582
|
-
var reject = reaction.reject;
|
|
1583
|
-
var domain = reaction.domain;
|
|
1584
|
-
var result, then, exited;
|
|
1585
|
-
try {
|
|
1586
|
-
if (handler) {
|
|
1587
|
-
if (!ok) {
|
|
1588
|
-
if (state.rejection === UNHANDLED) onHandleUnhandled(state);
|
|
1589
|
-
state.rejection = HANDLED;
|
|
1590
|
-
}
|
|
1591
|
-
if (handler === true) result = value;
|
|
1592
|
-
else {
|
|
1593
|
-
if (domain) domain.enter();
|
|
1594
|
-
result = handler(value); // can throw
|
|
1595
|
-
if (domain) {
|
|
1596
|
-
domain.exit();
|
|
1597
|
-
exited = true;
|
|
1598
|
-
}
|
|
1599
|
-
}
|
|
1600
|
-
if (result === reaction.promise) {
|
|
1601
|
-
reject(TypeError$2('Promise-chain cycle'));
|
|
1602
|
-
} else if (then = isThenable(result)) {
|
|
1603
|
-
functionCall(then, result, resolve, reject);
|
|
1604
|
-
} else resolve(result);
|
|
1605
|
-
} else reject(value);
|
|
1606
|
-
} catch (error) {
|
|
1607
|
-
if (domain && !exited) domain.exit();
|
|
1608
|
-
reject(error);
|
|
1609
|
-
}
|
|
1610
|
-
};
|
|
1611
|
-
|
|
1612
|
-
var notify$1 = function (state, isReject) {
|
|
1277
|
+
var notify$1 = function (promise, state, isReject) {
|
|
1613
1278
|
if (state.notified) return;
|
|
1614
1279
|
state.notified = true;
|
|
1280
|
+
var chain = state.reactions;
|
|
1615
1281
|
microtask(function () {
|
|
1616
|
-
var
|
|
1617
|
-
var
|
|
1618
|
-
|
|
1619
|
-
|
|
1282
|
+
var value = state.value;
|
|
1283
|
+
var ok = state.state == FULFILLED;
|
|
1284
|
+
var index = 0;
|
|
1285
|
+
// variable length - can't use forEach
|
|
1286
|
+
while (chain.length > index) {
|
|
1287
|
+
var reaction = chain[index++];
|
|
1288
|
+
var handler = ok ? reaction.ok : reaction.fail;
|
|
1289
|
+
var resolve = reaction.resolve;
|
|
1290
|
+
var reject = reaction.reject;
|
|
1291
|
+
var domain = reaction.domain;
|
|
1292
|
+
var result, then, exited;
|
|
1293
|
+
try {
|
|
1294
|
+
if (handler) {
|
|
1295
|
+
if (!ok) {
|
|
1296
|
+
if (state.rejection === UNHANDLED) onHandleUnhandled(promise, state);
|
|
1297
|
+
state.rejection = HANDLED;
|
|
1298
|
+
}
|
|
1299
|
+
if (handler === true) result = value;
|
|
1300
|
+
else {
|
|
1301
|
+
if (domain) domain.enter();
|
|
1302
|
+
result = handler(value); // can throw
|
|
1303
|
+
if (domain) {
|
|
1304
|
+
domain.exit();
|
|
1305
|
+
exited = true;
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
if (result === reaction.promise) {
|
|
1309
|
+
reject(TypeError$1('Promise-chain cycle'));
|
|
1310
|
+
} else if (then = isThenable(result)) {
|
|
1311
|
+
then.call(result, resolve, reject);
|
|
1312
|
+
} else resolve(result);
|
|
1313
|
+
} else reject(value);
|
|
1314
|
+
} catch (error) {
|
|
1315
|
+
if (domain && !exited) domain.exit();
|
|
1316
|
+
reject(error);
|
|
1317
|
+
}
|
|
1620
1318
|
}
|
|
1319
|
+
state.reactions = [];
|
|
1621
1320
|
state.notified = false;
|
|
1622
|
-
if (isReject && !state.rejection) onUnhandled(state);
|
|
1321
|
+
if (isReject && !state.rejection) onUnhandled(promise, state);
|
|
1623
1322
|
});
|
|
1624
1323
|
};
|
|
1625
1324
|
|
|
1626
1325
|
var dispatchEvent = function (name, promise, reason) {
|
|
1627
1326
|
var event, handler;
|
|
1628
1327
|
if (DISPATCH_EVENT) {
|
|
1629
|
-
event = document$
|
|
1328
|
+
event = document$2.createEvent('Event');
|
|
1630
1329
|
event.promise = promise;
|
|
1631
1330
|
event.reason = reason;
|
|
1632
1331
|
event.initEvent(name, false, true);
|
|
1633
1332
|
global_1.dispatchEvent(event);
|
|
1634
1333
|
} else event = { promise: promise, reason: reason };
|
|
1635
|
-
if (
|
|
1334
|
+
if (handler = global_1['on' + name]) handler(event);
|
|
1636
1335
|
else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
|
|
1637
1336
|
};
|
|
1638
1337
|
|
|
1639
|
-
var onUnhandled = function (state) {
|
|
1640
|
-
|
|
1641
|
-
var promise = state.facade;
|
|
1338
|
+
var onUnhandled = function (promise, state) {
|
|
1339
|
+
task$1.call(global_1, function () {
|
|
1642
1340
|
var value = state.value;
|
|
1643
1341
|
var IS_UNHANDLED = isUnhandled(state);
|
|
1644
1342
|
var result;
|
|
1645
1343
|
if (IS_UNHANDLED) {
|
|
1646
1344
|
result = perform(function () {
|
|
1647
|
-
if (
|
|
1345
|
+
if (IS_NODE$1) {
|
|
1648
1346
|
process$3.emit('unhandledRejection', value, promise);
|
|
1649
1347
|
} else dispatchEvent(UNHANDLED_REJECTION, promise, value);
|
|
1650
1348
|
});
|
|
1651
1349
|
// Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
|
|
1652
|
-
state.rejection =
|
|
1350
|
+
state.rejection = IS_NODE$1 || isUnhandled(state) ? UNHANDLED : HANDLED;
|
|
1653
1351
|
if (result.error) throw result.value;
|
|
1654
1352
|
}
|
|
1655
1353
|
});
|
|
@@ -1659,315 +1357,187 @@ var Radar = (function () {
|
|
|
1659
1357
|
return state.rejection !== HANDLED && !state.parent;
|
|
1660
1358
|
};
|
|
1661
1359
|
|
|
1662
|
-
var onHandleUnhandled = function (state) {
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
if (engineIsNode) {
|
|
1360
|
+
var onHandleUnhandled = function (promise, state) {
|
|
1361
|
+
task$1.call(global_1, function () {
|
|
1362
|
+
if (IS_NODE$1) {
|
|
1666
1363
|
process$3.emit('rejectionHandled', promise);
|
|
1667
1364
|
} else dispatchEvent(REJECTION_HANDLED, promise, state.value);
|
|
1668
1365
|
});
|
|
1669
1366
|
};
|
|
1670
1367
|
|
|
1671
|
-
var bind
|
|
1368
|
+
var bind = function (fn, promise, state, unwrap) {
|
|
1672
1369
|
return function (value) {
|
|
1673
|
-
fn(state, value, unwrap);
|
|
1370
|
+
fn(promise, state, value, unwrap);
|
|
1674
1371
|
};
|
|
1675
1372
|
};
|
|
1676
1373
|
|
|
1677
|
-
var internalReject = function (state, value, unwrap) {
|
|
1374
|
+
var internalReject = function (promise, state, value, unwrap) {
|
|
1678
1375
|
if (state.done) return;
|
|
1679
1376
|
state.done = true;
|
|
1680
1377
|
if (unwrap) state = unwrap;
|
|
1681
1378
|
state.value = value;
|
|
1682
1379
|
state.state = REJECTED;
|
|
1683
|
-
notify$1(state, true);
|
|
1380
|
+
notify$1(promise, state, true);
|
|
1684
1381
|
};
|
|
1685
1382
|
|
|
1686
|
-
var internalResolve = function (state, value, unwrap) {
|
|
1383
|
+
var internalResolve = function (promise, state, value, unwrap) {
|
|
1687
1384
|
if (state.done) return;
|
|
1688
1385
|
state.done = true;
|
|
1689
1386
|
if (unwrap) state = unwrap;
|
|
1690
1387
|
try {
|
|
1691
|
-
if (
|
|
1388
|
+
if (promise === value) throw TypeError$1("Promise can't be resolved itself");
|
|
1692
1389
|
var then = isThenable(value);
|
|
1693
1390
|
if (then) {
|
|
1694
1391
|
microtask(function () {
|
|
1695
1392
|
var wrapper = { done: false };
|
|
1696
1393
|
try {
|
|
1697
|
-
|
|
1698
|
-
bind
|
|
1699
|
-
bind
|
|
1394
|
+
then.call(value,
|
|
1395
|
+
bind(internalResolve, promise, wrapper, state),
|
|
1396
|
+
bind(internalReject, promise, wrapper, state)
|
|
1700
1397
|
);
|
|
1701
1398
|
} catch (error) {
|
|
1702
|
-
internalReject(wrapper, error, state);
|
|
1399
|
+
internalReject(promise, wrapper, error, state);
|
|
1703
1400
|
}
|
|
1704
1401
|
});
|
|
1705
1402
|
} else {
|
|
1706
1403
|
state.value = value;
|
|
1707
1404
|
state.state = FULFILLED;
|
|
1708
|
-
notify$1(state, false);
|
|
1405
|
+
notify$1(promise, state, false);
|
|
1709
1406
|
}
|
|
1710
1407
|
} catch (error) {
|
|
1711
|
-
internalReject({ done: false }, error, state);
|
|
1408
|
+
internalReject(promise, { done: false }, error, state);
|
|
1712
1409
|
}
|
|
1713
1410
|
};
|
|
1714
1411
|
|
|
1715
1412
|
// constructor polyfill
|
|
1716
|
-
if (
|
|
1413
|
+
if (FORCED) {
|
|
1717
1414
|
// 25.4.3.1 Promise(executor)
|
|
1718
1415
|
PromiseConstructor = function Promise(executor) {
|
|
1719
|
-
anInstance(this,
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
var state =
|
|
1416
|
+
anInstance(this, PromiseConstructor, PROMISE);
|
|
1417
|
+
aFunction$1(executor);
|
|
1418
|
+
Internal.call(this);
|
|
1419
|
+
var state = getInternalState(this);
|
|
1723
1420
|
try {
|
|
1724
|
-
executor(bind
|
|
1421
|
+
executor(bind(internalResolve, this, state), bind(internalReject, this, state));
|
|
1725
1422
|
} catch (error) {
|
|
1726
|
-
internalReject(state, error);
|
|
1423
|
+
internalReject(this, state, error);
|
|
1727
1424
|
}
|
|
1728
1425
|
};
|
|
1729
|
-
|
|
1730
|
-
PromisePrototype = PromiseConstructor.prototype;
|
|
1731
|
-
|
|
1732
|
-
// eslint-disable-next-line no-unused-vars -- required for `.length`
|
|
1426
|
+
// eslint-disable-next-line no-unused-vars
|
|
1733
1427
|
Internal = function Promise(executor) {
|
|
1734
1428
|
setInternalState(this, {
|
|
1735
1429
|
type: PROMISE,
|
|
1736
1430
|
done: false,
|
|
1737
1431
|
notified: false,
|
|
1738
1432
|
parent: false,
|
|
1739
|
-
reactions:
|
|
1433
|
+
reactions: [],
|
|
1740
1434
|
rejection: false,
|
|
1741
1435
|
state: PENDING,
|
|
1742
1436
|
value: undefined
|
|
1743
1437
|
});
|
|
1744
1438
|
};
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
}
|
|
1759
|
-
|
|
1439
|
+
Internal.prototype = redefineAll(PromiseConstructor.prototype, {
|
|
1440
|
+
// `Promise.prototype.then` method
|
|
1441
|
+
// https://tc39.github.io/ecma262/#sec-promise.prototype.then
|
|
1442
|
+
then: function then(onFulfilled, onRejected) {
|
|
1443
|
+
var state = getInternalPromiseState(this);
|
|
1444
|
+
var reaction = newPromiseCapability$1(speciesConstructor(this, PromiseConstructor));
|
|
1445
|
+
reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
|
|
1446
|
+
reaction.fail = typeof onRejected == 'function' && onRejected;
|
|
1447
|
+
reaction.domain = IS_NODE$1 ? process$3.domain : undefined;
|
|
1448
|
+
state.parent = true;
|
|
1449
|
+
state.reactions.push(reaction);
|
|
1450
|
+
if (state.state != PENDING) notify$1(this, state, false);
|
|
1451
|
+
return reaction.promise;
|
|
1452
|
+
},
|
|
1453
|
+
// `Promise.prototype.catch` method
|
|
1454
|
+
// https://tc39.github.io/ecma262/#sec-promise.prototype.catch
|
|
1455
|
+
'catch': function (onRejected) {
|
|
1456
|
+
return this.then(undefined, onRejected);
|
|
1457
|
+
}
|
|
1760
1458
|
});
|
|
1761
|
-
|
|
1762
1459
|
OwnPromiseCapability = function () {
|
|
1763
1460
|
var promise = new Internal();
|
|
1764
|
-
var state =
|
|
1461
|
+
var state = getInternalState(promise);
|
|
1765
1462
|
this.promise = promise;
|
|
1766
|
-
this.resolve = bind
|
|
1767
|
-
this.reject = bind
|
|
1463
|
+
this.resolve = bind(internalResolve, promise, state);
|
|
1464
|
+
this.reject = bind(internalReject, promise, state);
|
|
1768
1465
|
};
|
|
1769
|
-
|
|
1770
1466
|
newPromiseCapability.f = newPromiseCapability$1 = function (C) {
|
|
1771
1467
|
return C === PromiseConstructor || C === PromiseWrapper
|
|
1772
1468
|
? new OwnPromiseCapability(C)
|
|
1773
1469
|
: newGenericPromiseCapability(C);
|
|
1774
1470
|
};
|
|
1775
1471
|
|
|
1776
|
-
if (
|
|
1777
|
-
nativeThen =
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
}
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
});
|
|
1805
|
-
|
|
1806
|
-
setToStringTag(PromiseConstructor, PROMISE, false);
|
|
1807
|
-
setSpecies(PROMISE);
|
|
1808
|
-
|
|
1809
|
-
var iterators = {};
|
|
1810
|
-
|
|
1811
|
-
var ITERATOR = wellKnownSymbol('iterator');
|
|
1812
|
-
var ArrayPrototype = Array.prototype;
|
|
1813
|
-
|
|
1814
|
-
// check on default Array iterator
|
|
1815
|
-
var isArrayIteratorMethod = function (it) {
|
|
1816
|
-
return it !== undefined && (iterators.Array === it || ArrayPrototype[ITERATOR] === it);
|
|
1817
|
-
};
|
|
1818
|
-
|
|
1819
|
-
var ITERATOR$1 = wellKnownSymbol('iterator');
|
|
1820
|
-
|
|
1821
|
-
var getIteratorMethod = function (it) {
|
|
1822
|
-
if (it != undefined) return getMethod(it, ITERATOR$1)
|
|
1823
|
-
|| getMethod(it, '@@iterator')
|
|
1824
|
-
|| iterators[classof(it)];
|
|
1825
|
-
};
|
|
1826
|
-
|
|
1827
|
-
var $TypeError$a = TypeError;
|
|
1828
|
-
|
|
1829
|
-
var getIterator = function (argument, usingIterator) {
|
|
1830
|
-
var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
|
|
1831
|
-
if (aCallable(iteratorMethod)) return anObject(functionCall(iteratorMethod, argument));
|
|
1832
|
-
throw $TypeError$a(tryToString(argument) + ' is not iterable');
|
|
1833
|
-
};
|
|
1834
|
-
|
|
1835
|
-
var iteratorClose = function (iterator, kind, value) {
|
|
1836
|
-
var innerResult, innerError;
|
|
1837
|
-
anObject(iterator);
|
|
1838
|
-
try {
|
|
1839
|
-
innerResult = getMethod(iterator, 'return');
|
|
1840
|
-
if (!innerResult) {
|
|
1841
|
-
if (kind === 'throw') throw value;
|
|
1842
|
-
return value;
|
|
1843
|
-
}
|
|
1844
|
-
innerResult = functionCall(innerResult, iterator);
|
|
1845
|
-
} catch (error) {
|
|
1846
|
-
innerError = true;
|
|
1847
|
-
innerResult = error;
|
|
1848
|
-
}
|
|
1849
|
-
if (kind === 'throw') throw value;
|
|
1850
|
-
if (innerError) throw innerResult;
|
|
1851
|
-
anObject(innerResult);
|
|
1852
|
-
return value;
|
|
1853
|
-
};
|
|
1854
|
-
|
|
1855
|
-
var $TypeError$b = TypeError;
|
|
1856
|
-
|
|
1857
|
-
var Result = function (stopped, result) {
|
|
1858
|
-
this.stopped = stopped;
|
|
1859
|
-
this.result = result;
|
|
1860
|
-
};
|
|
1861
|
-
|
|
1862
|
-
var ResultPrototype = Result.prototype;
|
|
1863
|
-
|
|
1864
|
-
var iterate = function (iterable, unboundFunction, options) {
|
|
1865
|
-
var that = options && options.that;
|
|
1866
|
-
var AS_ENTRIES = !!(options && options.AS_ENTRIES);
|
|
1867
|
-
var IS_ITERATOR = !!(options && options.IS_ITERATOR);
|
|
1868
|
-
var INTERRUPTED = !!(options && options.INTERRUPTED);
|
|
1869
|
-
var fn = functionBindContext(unboundFunction, that);
|
|
1870
|
-
var iterator, iterFn, index, length, result, next, step;
|
|
1871
|
-
|
|
1872
|
-
var stop = function (condition) {
|
|
1873
|
-
if (iterator) iteratorClose(iterator, 'normal', condition);
|
|
1874
|
-
return new Result(true, condition);
|
|
1875
|
-
};
|
|
1876
|
-
|
|
1877
|
-
var callFn = function (value) {
|
|
1878
|
-
if (AS_ENTRIES) {
|
|
1879
|
-
anObject(value);
|
|
1880
|
-
return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
|
|
1881
|
-
} return INTERRUPTED ? fn(value, stop) : fn(value);
|
|
1882
|
-
};
|
|
1883
|
-
|
|
1884
|
-
if (IS_ITERATOR) {
|
|
1885
|
-
iterator = iterable;
|
|
1886
|
-
} else {
|
|
1887
|
-
iterFn = getIteratorMethod(iterable);
|
|
1888
|
-
if (!iterFn) throw $TypeError$b(tryToString(iterable) + ' is not iterable');
|
|
1889
|
-
// optimisation for array iterators
|
|
1890
|
-
if (isArrayIteratorMethod(iterFn)) {
|
|
1891
|
-
for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
|
|
1892
|
-
result = callFn(iterable[index]);
|
|
1893
|
-
if (result && objectIsPrototypeOf(ResultPrototype, result)) return result;
|
|
1894
|
-
} return new Result(false);
|
|
1895
|
-
}
|
|
1896
|
-
iterator = getIterator(iterable, iterFn);
|
|
1897
|
-
}
|
|
1898
|
-
|
|
1899
|
-
next = iterator.next;
|
|
1900
|
-
while (!(step = functionCall(next, iterator)).done) {
|
|
1901
|
-
try {
|
|
1902
|
-
result = callFn(step.value);
|
|
1903
|
-
} catch (error) {
|
|
1904
|
-
iteratorClose(iterator, 'throw', error);
|
|
1905
|
-
}
|
|
1906
|
-
if (typeof result == 'object' && result && objectIsPrototypeOf(ResultPrototype, result)) return result;
|
|
1907
|
-
} return new Result(false);
|
|
1908
|
-
};
|
|
1909
|
-
|
|
1910
|
-
var ITERATOR$2 = wellKnownSymbol('iterator');
|
|
1911
|
-
var SAFE_CLOSING = false;
|
|
1912
|
-
|
|
1913
|
-
try {
|
|
1914
|
-
var called = 0;
|
|
1915
|
-
var iteratorWithReturn = {
|
|
1916
|
-
next: function () {
|
|
1917
|
-
return { done: !!called++ };
|
|
1918
|
-
},
|
|
1919
|
-
'return': function () {
|
|
1920
|
-
SAFE_CLOSING = true;
|
|
1921
|
-
}
|
|
1922
|
-
};
|
|
1923
|
-
iteratorWithReturn[ITERATOR$2] = function () {
|
|
1924
|
-
return this;
|
|
1925
|
-
};
|
|
1926
|
-
// eslint-disable-next-line es-x/no-array-from, no-throw-literal -- required for testing
|
|
1927
|
-
Array.from(iteratorWithReturn, function () { throw 2; });
|
|
1928
|
-
} catch (error) { /* empty */ }
|
|
1929
|
-
|
|
1930
|
-
var checkCorrectnessOfIteration = function (exec, SKIP_CLOSING) {
|
|
1931
|
-
if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
|
|
1932
|
-
var ITERATION_SUPPORT = false;
|
|
1933
|
-
try {
|
|
1934
|
-
var object = {};
|
|
1935
|
-
object[ITERATOR$2] = function () {
|
|
1936
|
-
return {
|
|
1937
|
-
next: function () {
|
|
1938
|
-
return { done: ITERATION_SUPPORT = true };
|
|
1939
|
-
}
|
|
1940
|
-
};
|
|
1941
|
-
};
|
|
1942
|
-
exec(object);
|
|
1943
|
-
} catch (error) { /* empty */ }
|
|
1944
|
-
return ITERATION_SUPPORT;
|
|
1945
|
-
};
|
|
1472
|
+
if ( typeof nativePromiseConstructor == 'function') {
|
|
1473
|
+
nativeThen = nativePromiseConstructor.prototype.then;
|
|
1474
|
+
|
|
1475
|
+
// wrap native Promise#then for native async functions
|
|
1476
|
+
redefine(nativePromiseConstructor.prototype, 'then', function then(onFulfilled, onRejected) {
|
|
1477
|
+
var that = this;
|
|
1478
|
+
return new PromiseConstructor(function (resolve, reject) {
|
|
1479
|
+
nativeThen.call(that, resolve, reject);
|
|
1480
|
+
}).then(onFulfilled, onRejected);
|
|
1481
|
+
// https://github.com/zloirock/core-js/issues/640
|
|
1482
|
+
}, { unsafe: true });
|
|
1483
|
+
|
|
1484
|
+
// wrap fetch result
|
|
1485
|
+
if (typeof $fetch == 'function') _export({ global: true, enumerable: true, forced: true }, {
|
|
1486
|
+
// eslint-disable-next-line no-unused-vars
|
|
1487
|
+
fetch: function fetch(input /* , init */) {
|
|
1488
|
+
return promiseResolve(PromiseConstructor, $fetch.apply(global_1, arguments));
|
|
1489
|
+
}
|
|
1490
|
+
});
|
|
1491
|
+
}
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
_export({ global: true, wrap: true, forced: FORCED }, {
|
|
1495
|
+
Promise: PromiseConstructor
|
|
1496
|
+
});
|
|
1497
|
+
|
|
1498
|
+
setToStringTag(PromiseConstructor, PROMISE, false);
|
|
1499
|
+
setSpecies(PROMISE);
|
|
1946
1500
|
|
|
1947
|
-
|
|
1501
|
+
PromiseWrapper = getBuiltIn(PROMISE);
|
|
1502
|
+
|
|
1503
|
+
// statics
|
|
1504
|
+
_export({ target: PROMISE, stat: true, forced: FORCED }, {
|
|
1505
|
+
// `Promise.reject` method
|
|
1506
|
+
// https://tc39.github.io/ecma262/#sec-promise.reject
|
|
1507
|
+
reject: function reject(r) {
|
|
1508
|
+
var capability = newPromiseCapability$1(this);
|
|
1509
|
+
capability.reject.call(undefined, r);
|
|
1510
|
+
return capability.promise;
|
|
1511
|
+
}
|
|
1512
|
+
});
|
|
1948
1513
|
|
|
1949
|
-
|
|
1950
|
-
|
|
1514
|
+
_export({ target: PROMISE, stat: true, forced: FORCED }, {
|
|
1515
|
+
// `Promise.resolve` method
|
|
1516
|
+
// https://tc39.github.io/ecma262/#sec-promise.resolve
|
|
1517
|
+
resolve: function resolve(x) {
|
|
1518
|
+
return promiseResolve( this, x);
|
|
1519
|
+
}
|
|
1951
1520
|
});
|
|
1952
1521
|
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1522
|
+
_export({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, {
|
|
1523
|
+
// `Promise.all` method
|
|
1524
|
+
// https://tc39.github.io/ecma262/#sec-promise.all
|
|
1956
1525
|
all: function all(iterable) {
|
|
1957
1526
|
var C = this;
|
|
1958
|
-
var capability = newPromiseCapability
|
|
1527
|
+
var capability = newPromiseCapability$1(C);
|
|
1959
1528
|
var resolve = capability.resolve;
|
|
1960
1529
|
var reject = capability.reject;
|
|
1961
1530
|
var result = perform(function () {
|
|
1962
|
-
var $promiseResolve =
|
|
1531
|
+
var $promiseResolve = aFunction$1(C.resolve);
|
|
1963
1532
|
var values = [];
|
|
1964
1533
|
var counter = 0;
|
|
1965
1534
|
var remaining = 1;
|
|
1966
|
-
|
|
1535
|
+
iterate_1(iterable, function (promise) {
|
|
1967
1536
|
var index = counter++;
|
|
1968
1537
|
var alreadyCalled = false;
|
|
1538
|
+
values.push(undefined);
|
|
1969
1539
|
remaining++;
|
|
1970
|
-
|
|
1540
|
+
$promiseResolve.call(C, promise).then(function (value) {
|
|
1971
1541
|
if (alreadyCalled) return;
|
|
1972
1542
|
alreadyCalled = true;
|
|
1973
1543
|
values[index] = value;
|
|
@@ -1978,44 +1548,17 @@ var Radar = (function () {
|
|
|
1978
1548
|
});
|
|
1979
1549
|
if (result.error) reject(result.value);
|
|
1980
1550
|
return capability.promise;
|
|
1981
|
-
}
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
var FORCED_PROMISE_CONSTRUCTOR$3 = promiseConstructorDetection.CONSTRUCTOR;
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
var NativePromisePrototype$2 = promiseNativeConstructor && promiseNativeConstructor.prototype;
|
|
1991
|
-
|
|
1992
|
-
// `Promise.prototype.catch` method
|
|
1993
|
-
// https://tc39.es/ecma262/#sec-promise.prototype.catch
|
|
1994
|
-
_export({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR$3, real: true }, {
|
|
1995
|
-
'catch': function (onRejected) {
|
|
1996
|
-
return this.then(undefined, onRejected);
|
|
1997
|
-
}
|
|
1998
|
-
});
|
|
1999
|
-
|
|
2000
|
-
// makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
|
|
2001
|
-
if ( isCallable(promiseNativeConstructor)) {
|
|
2002
|
-
var method = getBuiltIn('Promise').prototype['catch'];
|
|
2003
|
-
if (NativePromisePrototype$2['catch'] !== method) {
|
|
2004
|
-
defineBuiltIn(NativePromisePrototype$2, 'catch', method, { unsafe: true });
|
|
2005
|
-
}
|
|
2006
|
-
}
|
|
2007
|
-
|
|
2008
|
-
// `Promise.race` method
|
|
2009
|
-
// https://tc39.es/ecma262/#sec-promise.race
|
|
2010
|
-
_export({ target: 'Promise', stat: true, forced: promiseStaticsIncorrectIteration }, {
|
|
1551
|
+
},
|
|
1552
|
+
// `Promise.race` method
|
|
1553
|
+
// https://tc39.github.io/ecma262/#sec-promise.race
|
|
2011
1554
|
race: function race(iterable) {
|
|
2012
1555
|
var C = this;
|
|
2013
|
-
var capability = newPromiseCapability
|
|
1556
|
+
var capability = newPromiseCapability$1(C);
|
|
2014
1557
|
var reject = capability.reject;
|
|
2015
1558
|
var result = perform(function () {
|
|
2016
|
-
var $promiseResolve =
|
|
2017
|
-
|
|
2018
|
-
|
|
1559
|
+
var $promiseResolve = aFunction$1(C.resolve);
|
|
1560
|
+
iterate_1(iterable, function (promise) {
|
|
1561
|
+
$promiseResolve.call(C, promise).then(capability.resolve, reject);
|
|
2019
1562
|
});
|
|
2020
1563
|
});
|
|
2021
1564
|
if (result.error) reject(result.value);
|
|
@@ -2023,40 +1566,6 @@ var Radar = (function () {
|
|
|
2023
1566
|
}
|
|
2024
1567
|
});
|
|
2025
1568
|
|
|
2026
|
-
var FORCED_PROMISE_CONSTRUCTOR$4 = promiseConstructorDetection.CONSTRUCTOR;
|
|
2027
|
-
|
|
2028
|
-
// `Promise.reject` method
|
|
2029
|
-
// https://tc39.es/ecma262/#sec-promise.reject
|
|
2030
|
-
_export({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$4 }, {
|
|
2031
|
-
reject: function reject(r) {
|
|
2032
|
-
var capability = newPromiseCapability.f(this);
|
|
2033
|
-
functionCall(capability.reject, undefined, r);
|
|
2034
|
-
return capability.promise;
|
|
2035
|
-
}
|
|
2036
|
-
});
|
|
2037
|
-
|
|
2038
|
-
var promiseResolve = function (C, x) {
|
|
2039
|
-
anObject(C);
|
|
2040
|
-
if (isObject(x) && x.constructor === C) return x;
|
|
2041
|
-
var promiseCapability = newPromiseCapability.f(C);
|
|
2042
|
-
var resolve = promiseCapability.resolve;
|
|
2043
|
-
resolve(x);
|
|
2044
|
-
return promiseCapability.promise;
|
|
2045
|
-
};
|
|
2046
|
-
|
|
2047
|
-
var FORCED_PROMISE_CONSTRUCTOR$5 = promiseConstructorDetection.CONSTRUCTOR;
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
var PromiseConstructorWrapper = getBuiltIn('Promise');
|
|
2051
|
-
|
|
2052
|
-
// `Promise.resolve` method
|
|
2053
|
-
// https://tc39.es/ecma262/#sec-promise.resolve
|
|
2054
|
-
_export({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$5 }, {
|
|
2055
|
-
resolve: function resolve(x) {
|
|
2056
|
-
return promiseResolve( this, x);
|
|
2057
|
-
}
|
|
2058
|
-
});
|
|
2059
|
-
|
|
2060
1569
|
var STATUS = {
|
|
2061
1570
|
SUCCESS: 'SUCCESS',
|
|
2062
1571
|
ERROR_PUBLISHABLE_KEY: 'ERROR_PUBLISHABLE_KEY',
|
|
@@ -2117,48 +1626,32 @@ var Radar = (function () {
|
|
|
2117
1626
|
}();
|
|
2118
1627
|
|
|
2119
1628
|
// `IsArray` abstract operation
|
|
2120
|
-
// https://tc39.
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
return classofRaw(argument) == 'Array';
|
|
2124
|
-
};
|
|
2125
|
-
|
|
2126
|
-
var $TypeError$c = TypeError;
|
|
2127
|
-
var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
|
|
2128
|
-
|
|
2129
|
-
var doesNotExceedSafeInteger = function (it) {
|
|
2130
|
-
if (it > MAX_SAFE_INTEGER) throw $TypeError$c('Maximum allowed index exceeded');
|
|
2131
|
-
return it;
|
|
1629
|
+
// https://tc39.github.io/ecma262/#sec-isarray
|
|
1630
|
+
var isArray = Array.isArray || function isArray(arg) {
|
|
1631
|
+
return classofRaw(arg) == 'Array';
|
|
2132
1632
|
};
|
|
2133
1633
|
|
|
2134
1634
|
var createProperty = function (object, key, value) {
|
|
2135
|
-
var propertyKey =
|
|
1635
|
+
var propertyKey = toPrimitive(key);
|
|
2136
1636
|
if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
|
|
2137
1637
|
else object[propertyKey] = value;
|
|
2138
1638
|
};
|
|
2139
1639
|
|
|
2140
1640
|
var SPECIES$3 = wellKnownSymbol('species');
|
|
2141
|
-
var $Array = Array;
|
|
2142
1641
|
|
|
2143
|
-
//
|
|
2144
|
-
// https://tc39.
|
|
2145
|
-
var
|
|
1642
|
+
// `ArraySpeciesCreate` abstract operation
|
|
1643
|
+
// https://tc39.github.io/ecma262/#sec-arrayspeciescreate
|
|
1644
|
+
var arraySpeciesCreate = function (originalArray, length) {
|
|
2146
1645
|
var C;
|
|
2147
1646
|
if (isArray(originalArray)) {
|
|
2148
1647
|
C = originalArray.constructor;
|
|
2149
1648
|
// cross-realm fallback
|
|
2150
|
-
if (
|
|
1649
|
+
if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
|
|
2151
1650
|
else if (isObject(C)) {
|
|
2152
1651
|
C = C[SPECIES$3];
|
|
2153
1652
|
if (C === null) C = undefined;
|
|
2154
1653
|
}
|
|
2155
|
-
} return C === undefined ?
|
|
2156
|
-
};
|
|
2157
|
-
|
|
2158
|
-
// `ArraySpeciesCreate` abstract operation
|
|
2159
|
-
// https://tc39.es/ecma262/#sec-arrayspeciescreate
|
|
2160
|
-
var arraySpeciesCreate = function (originalArray, length) {
|
|
2161
|
-
return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
|
|
1654
|
+
} return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
|
|
2162
1655
|
};
|
|
2163
1656
|
|
|
2164
1657
|
var SPECIES$4 = wellKnownSymbol('species');
|
|
@@ -2178,6 +1671,8 @@ var Radar = (function () {
|
|
|
2178
1671
|
};
|
|
2179
1672
|
|
|
2180
1673
|
var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
|
|
1674
|
+
var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
|
|
1675
|
+
var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
|
|
2181
1676
|
|
|
2182
1677
|
// We can't use this feature detection in V8 since it causes
|
|
2183
1678
|
// deoptimization and serious performance degradation
|
|
@@ -2196,14 +1691,13 @@ var Radar = (function () {
|
|
|
2196
1691
|
return spreadable !== undefined ? !!spreadable : isArray(O);
|
|
2197
1692
|
};
|
|
2198
1693
|
|
|
2199
|
-
var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
|
|
1694
|
+
var FORCED$1 = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
|
|
2200
1695
|
|
|
2201
1696
|
// `Array.prototype.concat` method
|
|
2202
|
-
// https://tc39.
|
|
1697
|
+
// https://tc39.github.io/ecma262/#sec-array.prototype.concat
|
|
2203
1698
|
// with adding support of @@isConcatSpreadable and @@species
|
|
2204
|
-
_export({ target: 'Array', proto: true,
|
|
2205
|
-
// eslint-disable-
|
|
2206
|
-
concat: function concat(arg) {
|
|
1699
|
+
_export({ target: 'Array', proto: true, forced: FORCED$1 }, {
|
|
1700
|
+
concat: function concat(arg) { // eslint-disable-line no-unused-vars
|
|
2207
1701
|
var O = toObject(this);
|
|
2208
1702
|
var A = arraySpeciesCreate(O, 0);
|
|
2209
1703
|
var n = 0;
|
|
@@ -2211,11 +1705,11 @@ var Radar = (function () {
|
|
|
2211
1705
|
for (i = -1, length = arguments.length; i < length; i++) {
|
|
2212
1706
|
E = i === -1 ? O : arguments[i];
|
|
2213
1707
|
if (isConcatSpreadable(E)) {
|
|
2214
|
-
len =
|
|
2215
|
-
|
|
1708
|
+
len = toLength(E.length);
|
|
1709
|
+
if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
|
|
2216
1710
|
for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
|
|
2217
1711
|
} else {
|
|
2218
|
-
|
|
1712
|
+
if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
|
|
2219
1713
|
createProperty(A, n++, E);
|
|
2220
1714
|
}
|
|
2221
1715
|
}
|
|
@@ -2955,25 +2449,24 @@ var Radar = (function () {
|
|
|
2955
2449
|
}
|
|
2956
2450
|
});
|
|
2957
2451
|
|
|
2958
|
-
var push
|
|
2452
|
+
var push = [].push;
|
|
2959
2453
|
|
|
2960
|
-
// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex
|
|
2454
|
+
// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation
|
|
2961
2455
|
var createMethod$2 = function (TYPE) {
|
|
2962
2456
|
var IS_MAP = TYPE == 1;
|
|
2963
2457
|
var IS_FILTER = TYPE == 2;
|
|
2964
2458
|
var IS_SOME = TYPE == 3;
|
|
2965
2459
|
var IS_EVERY = TYPE == 4;
|
|
2966
2460
|
var IS_FIND_INDEX = TYPE == 6;
|
|
2967
|
-
var IS_FILTER_REJECT = TYPE == 7;
|
|
2968
2461
|
var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
|
|
2969
2462
|
return function ($this, callbackfn, that, specificCreate) {
|
|
2970
2463
|
var O = toObject($this);
|
|
2971
2464
|
var self = indexedObject(O);
|
|
2972
|
-
var boundFunction = functionBindContext(callbackfn, that);
|
|
2973
|
-
var length =
|
|
2465
|
+
var boundFunction = functionBindContext(callbackfn, that, 3);
|
|
2466
|
+
var length = toLength(self.length);
|
|
2974
2467
|
var index = 0;
|
|
2975
2468
|
var create = specificCreate || arraySpeciesCreate;
|
|
2976
|
-
var target = IS_MAP ? create($this, length) : IS_FILTER
|
|
2469
|
+
var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
|
|
2977
2470
|
var value, result;
|
|
2978
2471
|
for (;length > index; index++) if (NO_HOLES || index in self) {
|
|
2979
2472
|
value = self[index];
|
|
@@ -2984,11 +2477,8 @@ var Radar = (function () {
|
|
|
2984
2477
|
case 3: return true; // some
|
|
2985
2478
|
case 5: return value; // find
|
|
2986
2479
|
case 6: return index; // findIndex
|
|
2987
|
-
case 2: push
|
|
2988
|
-
} else
|
|
2989
|
-
case 4: return false; // every
|
|
2990
|
-
case 7: push$1(target, value); // filterReject
|
|
2991
|
-
}
|
|
2480
|
+
case 2: push.call(target, value); // filter
|
|
2481
|
+
} else if (IS_EVERY) return false; // every
|
|
2992
2482
|
}
|
|
2993
2483
|
}
|
|
2994
2484
|
return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
|
|
@@ -2997,80 +2487,104 @@ var Radar = (function () {
|
|
|
2997
2487
|
|
|
2998
2488
|
var arrayIteration = {
|
|
2999
2489
|
// `Array.prototype.forEach` method
|
|
3000
|
-
// https://tc39.
|
|
2490
|
+
// https://tc39.github.io/ecma262/#sec-array.prototype.foreach
|
|
3001
2491
|
forEach: createMethod$2(0),
|
|
3002
2492
|
// `Array.prototype.map` method
|
|
3003
|
-
// https://tc39.
|
|
2493
|
+
// https://tc39.github.io/ecma262/#sec-array.prototype.map
|
|
3004
2494
|
map: createMethod$2(1),
|
|
3005
2495
|
// `Array.prototype.filter` method
|
|
3006
|
-
// https://tc39.
|
|
2496
|
+
// https://tc39.github.io/ecma262/#sec-array.prototype.filter
|
|
3007
2497
|
filter: createMethod$2(2),
|
|
3008
2498
|
// `Array.prototype.some` method
|
|
3009
|
-
// https://tc39.
|
|
2499
|
+
// https://tc39.github.io/ecma262/#sec-array.prototype.some
|
|
3010
2500
|
some: createMethod$2(3),
|
|
3011
2501
|
// `Array.prototype.every` method
|
|
3012
|
-
// https://tc39.
|
|
2502
|
+
// https://tc39.github.io/ecma262/#sec-array.prototype.every
|
|
3013
2503
|
every: createMethod$2(4),
|
|
3014
2504
|
// `Array.prototype.find` method
|
|
3015
|
-
// https://tc39.
|
|
2505
|
+
// https://tc39.github.io/ecma262/#sec-array.prototype.find
|
|
3016
2506
|
find: createMethod$2(5),
|
|
3017
2507
|
// `Array.prototype.findIndex` method
|
|
3018
|
-
// https://tc39.
|
|
3019
|
-
findIndex: createMethod$2(6)
|
|
3020
|
-
// `Array.prototype.filterReject` method
|
|
3021
|
-
// https://github.com/tc39/proposal-array-filtering
|
|
3022
|
-
filterReject: createMethod$2(7)
|
|
2508
|
+
// https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
|
|
2509
|
+
findIndex: createMethod$2(6)
|
|
3023
2510
|
};
|
|
3024
2511
|
|
|
3025
2512
|
var arrayMethodIsStrict = function (METHOD_NAME, argument) {
|
|
3026
2513
|
var method = [][METHOD_NAME];
|
|
3027
2514
|
return !!method && fails(function () {
|
|
3028
|
-
// eslint-disable-next-line no-useless-call
|
|
3029
|
-
method.call(null, argument || function () {
|
|
2515
|
+
// eslint-disable-next-line no-useless-call,no-throw-literal
|
|
2516
|
+
method.call(null, argument || function () { throw 1; }, 1);
|
|
2517
|
+
});
|
|
2518
|
+
};
|
|
2519
|
+
|
|
2520
|
+
var defineProperty$1 = Object.defineProperty;
|
|
2521
|
+
var cache = {};
|
|
2522
|
+
|
|
2523
|
+
var thrower = function (it) { throw it; };
|
|
2524
|
+
|
|
2525
|
+
var arrayMethodUsesToLength = function (METHOD_NAME, options) {
|
|
2526
|
+
if (has(cache, METHOD_NAME)) return cache[METHOD_NAME];
|
|
2527
|
+
if (!options) options = {};
|
|
2528
|
+
var method = [][METHOD_NAME];
|
|
2529
|
+
var ACCESSORS = has(options, 'ACCESSORS') ? options.ACCESSORS : false;
|
|
2530
|
+
var argument0 = has(options, 0) ? options[0] : thrower;
|
|
2531
|
+
var argument1 = has(options, 1) ? options[1] : undefined;
|
|
2532
|
+
|
|
2533
|
+
return cache[METHOD_NAME] = !!method && !fails(function () {
|
|
2534
|
+
if (ACCESSORS && !descriptors) return true;
|
|
2535
|
+
var O = { length: -1 };
|
|
2536
|
+
|
|
2537
|
+
if (ACCESSORS) defineProperty$1(O, 1, { enumerable: true, get: thrower });
|
|
2538
|
+
else O[1] = 1;
|
|
2539
|
+
|
|
2540
|
+
method.call(O, argument0, argument1);
|
|
3030
2541
|
});
|
|
3031
2542
|
};
|
|
3032
2543
|
|
|
3033
2544
|
var $forEach = arrayIteration.forEach;
|
|
3034
2545
|
|
|
3035
2546
|
|
|
2547
|
+
|
|
3036
2548
|
var STRICT_METHOD = arrayMethodIsStrict('forEach');
|
|
2549
|
+
var USES_TO_LENGTH = arrayMethodUsesToLength('forEach');
|
|
3037
2550
|
|
|
3038
2551
|
// `Array.prototype.forEach` method implementation
|
|
3039
|
-
// https://tc39.
|
|
3040
|
-
var arrayForEach = !STRICT_METHOD ? function forEach(callbackfn /* , thisArg */) {
|
|
2552
|
+
// https://tc39.github.io/ecma262/#sec-array.prototype.foreach
|
|
2553
|
+
var arrayForEach = (!STRICT_METHOD || !USES_TO_LENGTH) ? function forEach(callbackfn /* , thisArg */) {
|
|
3041
2554
|
return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
|
3042
|
-
// eslint-disable-next-line es-x/no-array-prototype-foreach -- safe
|
|
3043
2555
|
} : [].forEach;
|
|
3044
2556
|
|
|
3045
2557
|
// `Array.prototype.forEach` method
|
|
3046
|
-
// https://tc39.
|
|
3047
|
-
// eslint-disable-next-line es-x/no-array-prototype-foreach -- safe
|
|
2558
|
+
// https://tc39.github.io/ecma262/#sec-array.prototype.foreach
|
|
3048
2559
|
_export({ target: 'Array', proto: true, forced: [].forEach != arrayForEach }, {
|
|
3049
2560
|
forEach: arrayForEach
|
|
3050
2561
|
});
|
|
3051
2562
|
|
|
3052
|
-
var
|
|
2563
|
+
var nativeJoin = [].join;
|
|
3053
2564
|
|
|
3054
2565
|
var ES3_STRINGS = indexedObject != Object;
|
|
3055
2566
|
var STRICT_METHOD$1 = arrayMethodIsStrict('join', ',');
|
|
3056
2567
|
|
|
3057
2568
|
// `Array.prototype.join` method
|
|
3058
|
-
// https://tc39.
|
|
2569
|
+
// https://tc39.github.io/ecma262/#sec-array.prototype.join
|
|
3059
2570
|
_export({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD$1 }, {
|
|
3060
2571
|
join: function join(separator) {
|
|
3061
|
-
return
|
|
2572
|
+
return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
|
|
3062
2573
|
}
|
|
3063
2574
|
});
|
|
3064
2575
|
|
|
3065
2576
|
var $map = arrayIteration.map;
|
|
3066
2577
|
|
|
3067
2578
|
|
|
2579
|
+
|
|
3068
2580
|
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
|
|
2581
|
+
// FF49- issue
|
|
2582
|
+
var USES_TO_LENGTH$1 = arrayMethodUsesToLength('map');
|
|
3069
2583
|
|
|
3070
2584
|
// `Array.prototype.map` method
|
|
3071
|
-
// https://tc39.
|
|
2585
|
+
// https://tc39.github.io/ecma262/#sec-array.prototype.map
|
|
3072
2586
|
// with adding support of @@species
|
|
3073
|
-
_export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
|
|
2587
|
+
_export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH$1 }, {
|
|
3074
2588
|
map: function map(callbackfn /* , thisArg */) {
|
|
3075
2589
|
return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
|
3076
2590
|
}
|
|
@@ -3112,31 +2626,17 @@ var Radar = (function () {
|
|
|
3112
2626
|
TouchList: 0
|
|
3113
2627
|
};
|
|
3114
2628
|
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
var classList = documentCreateElement('span').classList;
|
|
3119
|
-
var DOMTokenListPrototype = classList && classList.constructor && classList.constructor.prototype;
|
|
3120
|
-
|
|
3121
|
-
var domTokenListPrototype = DOMTokenListPrototype === Object.prototype ? undefined : DOMTokenListPrototype;
|
|
3122
|
-
|
|
3123
|
-
var handlePrototype = function (CollectionPrototype) {
|
|
2629
|
+
for (var COLLECTION_NAME in domIterables) {
|
|
2630
|
+
var Collection = global_1[COLLECTION_NAME];
|
|
2631
|
+
var CollectionPrototype = Collection && Collection.prototype;
|
|
3124
2632
|
// some Chrome versions have non-configurable methods on DOMTokenList
|
|
3125
2633
|
if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
|
|
3126
2634
|
createNonEnumerableProperty(CollectionPrototype, 'forEach', arrayForEach);
|
|
3127
2635
|
} catch (error) {
|
|
3128
2636
|
CollectionPrototype.forEach = arrayForEach;
|
|
3129
2637
|
}
|
|
3130
|
-
};
|
|
3131
|
-
|
|
3132
|
-
for (var COLLECTION_NAME in domIterables) {
|
|
3133
|
-
if (domIterables[COLLECTION_NAME]) {
|
|
3134
|
-
handlePrototype(global_1[COLLECTION_NAME] && global_1[COLLECTION_NAME].prototype);
|
|
3135
|
-
}
|
|
3136
2638
|
}
|
|
3137
2639
|
|
|
3138
|
-
handlePrototype(domTokenListPrototype);
|
|
3139
|
-
|
|
3140
2640
|
var Storage = /*#__PURE__*/function () {
|
|
3141
2641
|
function Storage() {
|
|
3142
2642
|
_classCallCheck(this, Storage);
|
|
@@ -3156,6 +2656,10 @@ var Radar = (function () {
|
|
|
3156
2656
|
return;
|
|
3157
2657
|
}
|
|
3158
2658
|
|
|
2659
|
+
if (value === undefined || value === null) {
|
|
2660
|
+
return;
|
|
2661
|
+
}
|
|
2662
|
+
|
|
3159
2663
|
sessionStorage.setItem(key, value);
|
|
3160
2664
|
}
|
|
3161
2665
|
}, {
|
|
@@ -3259,6 +2763,7 @@ var Radar = (function () {
|
|
|
3259
2763
|
}();
|
|
3260
2764
|
|
|
3261
2765
|
var DEFAULT_HOST = 'https://api.radar.io';
|
|
2766
|
+
var API_VERSION = 'v1';
|
|
3262
2767
|
|
|
3263
2768
|
var API_HOST = /*#__PURE__*/function () {
|
|
3264
2769
|
function API_HOST() {
|
|
@@ -3275,7 +2780,7 @@ var Radar = (function () {
|
|
|
3275
2780
|
return API_HOST;
|
|
3276
2781
|
}();
|
|
3277
2782
|
|
|
3278
|
-
var SDK_VERSION = '3.
|
|
2783
|
+
var SDK_VERSION = '3.5.0-beta.1';
|
|
3279
2784
|
|
|
3280
2785
|
var Http = /*#__PURE__*/function () {
|
|
3281
2786
|
function Http() {
|
|
@@ -3287,7 +2792,8 @@ var Radar = (function () {
|
|
|
3287
2792
|
value: function request(method, path, data) {
|
|
3288
2793
|
return new Promise(function (resolve, reject) {
|
|
3289
2794
|
var xhr = new XMLHttpRequest();
|
|
3290
|
-
var
|
|
2795
|
+
var basePath = Storage.getItem(Storage.BASE_API_PATH) || API_VERSION;
|
|
2796
|
+
var url = "".concat(API_HOST.getHost(), "/").concat(basePath, "/").concat(path); // remove undefined values
|
|
3291
2797
|
|
|
3292
2798
|
var body = {};
|
|
3293
2799
|
Object.keys(data).forEach(function (key) {
|
|
@@ -3442,7 +2948,7 @@ var Radar = (function () {
|
|
|
3442
2948
|
params = {
|
|
3443
2949
|
coordinates: "".concat(latitude, ",").concat(longitude)
|
|
3444
2950
|
};
|
|
3445
|
-
return _context.abrupt("return", Http.request('GET', "
|
|
2951
|
+
return _context.abrupt("return", Http.request('GET', "context", params));
|
|
3446
2952
|
|
|
3447
2953
|
case 8:
|
|
3448
2954
|
case "end":
|
|
@@ -3483,7 +2989,7 @@ var Radar = (function () {
|
|
|
3483
2989
|
case 0:
|
|
3484
2990
|
geocodeOptions = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
|
3485
2991
|
query = geocodeOptions.query, layers = geocodeOptions.layers, country = geocodeOptions.country;
|
|
3486
|
-
return _context.abrupt("return", Http.request('GET', '
|
|
2992
|
+
return _context.abrupt("return", Http.request('GET', 'geocode/forward', {
|
|
3487
2993
|
query: query,
|
|
3488
2994
|
layers: layers,
|
|
3489
2995
|
country: country
|
|
@@ -3544,7 +3050,7 @@ var Radar = (function () {
|
|
|
3544
3050
|
coordinates: "".concat(latitude, ",").concat(longitude),
|
|
3545
3051
|
layers: layers
|
|
3546
3052
|
};
|
|
3547
|
-
return _context2.abrupt("return", Http.request('GET', '
|
|
3053
|
+
return _context2.abrupt("return", Http.request('GET', 'geocode/reverse', params));
|
|
3548
3054
|
|
|
3549
3055
|
case 12:
|
|
3550
3056
|
case "end":
|
|
@@ -3573,7 +3079,7 @@ var Radar = (function () {
|
|
|
3573
3079
|
case 0:
|
|
3574
3080
|
geocodeOptions = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
|
|
3575
3081
|
ip = geocodeOptions.ip;
|
|
3576
|
-
return _context3.abrupt("return", Http.request('GET', '
|
|
3082
|
+
return _context3.abrupt("return", Http.request('GET', 'geocode/ip', {
|
|
3577
3083
|
ip: ip
|
|
3578
3084
|
}));
|
|
3579
3085
|
|
|
@@ -3659,7 +3165,7 @@ var Radar = (function () {
|
|
|
3659
3165
|
units: units,
|
|
3660
3166
|
geometry: geometry
|
|
3661
3167
|
};
|
|
3662
|
-
return _context.abrupt("return", Http.request('GET', '
|
|
3168
|
+
return _context.abrupt("return", Http.request('GET', 'route/distance', params));
|
|
3663
3169
|
|
|
3664
3170
|
case 14:
|
|
3665
3171
|
case "end":
|
|
@@ -3729,7 +3235,7 @@ var Radar = (function () {
|
|
|
3729
3235
|
units: units,
|
|
3730
3236
|
geometry: geometry
|
|
3731
3237
|
};
|
|
3732
|
-
return _context2.abrupt("return", Http.request('GET', '
|
|
3238
|
+
return _context2.abrupt("return", Http.request('GET', 'route/matrix', params));
|
|
3733
3239
|
|
|
3734
3240
|
case 13:
|
|
3735
3241
|
case "end":
|
|
@@ -3819,7 +3325,7 @@ var Radar = (function () {
|
|
|
3819
3325
|
groups: groups,
|
|
3820
3326
|
limit: limit
|
|
3821
3327
|
};
|
|
3822
|
-
return _context.abrupt("return", Http.request('GET', '
|
|
3328
|
+
return _context.abrupt("return", Http.request('GET', 'search/places', params));
|
|
3823
3329
|
|
|
3824
3330
|
case 15:
|
|
3825
3331
|
case "end":
|
|
@@ -3897,7 +3403,7 @@ var Radar = (function () {
|
|
|
3897
3403
|
});
|
|
3898
3404
|
}
|
|
3899
3405
|
|
|
3900
|
-
return _context2.abrupt("return", Http.request('GET', '
|
|
3406
|
+
return _context2.abrupt("return", Http.request('GET', 'search/geofences', params));
|
|
3901
3407
|
|
|
3902
3408
|
case 14:
|
|
3903
3409
|
case "end":
|
|
@@ -3946,7 +3452,7 @@ var Radar = (function () {
|
|
|
3946
3452
|
layers: layers,
|
|
3947
3453
|
country: country
|
|
3948
3454
|
};
|
|
3949
|
-
return _context3.abrupt("return", Http.request('GET', '
|
|
3455
|
+
return _context3.abrupt("return", Http.request('GET', 'search/autocomplete', params));
|
|
3950
3456
|
|
|
3951
3457
|
case 5:
|
|
3952
3458
|
case "end":
|
|
@@ -3968,235 +3474,86 @@ var Radar = (function () {
|
|
|
3968
3474
|
}();
|
|
3969
3475
|
|
|
3970
3476
|
// `RegExp.prototype.flags` getter implementation
|
|
3971
|
-
// https://tc39.
|
|
3477
|
+
// https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
|
|
3972
3478
|
var regexpFlags = function () {
|
|
3973
3479
|
var that = anObject(this);
|
|
3974
3480
|
var result = '';
|
|
3975
|
-
if (that.hasIndices) result += 'd';
|
|
3976
3481
|
if (that.global) result += 'g';
|
|
3977
3482
|
if (that.ignoreCase) result += 'i';
|
|
3978
3483
|
if (that.multiline) result += 'm';
|
|
3979
3484
|
if (that.dotAll) result += 's';
|
|
3980
3485
|
if (that.unicode) result += 'u';
|
|
3981
|
-
if (that.unicodeSets) result += 'v';
|
|
3982
3486
|
if (that.sticky) result += 'y';
|
|
3983
3487
|
return result;
|
|
3984
3488
|
};
|
|
3985
3489
|
|
|
3986
|
-
// babel-minify
|
|
3987
|
-
|
|
3490
|
+
// babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,
|
|
3491
|
+
// so we use an intermediate function.
|
|
3492
|
+
function RE(s, f) {
|
|
3493
|
+
return RegExp(s, f);
|
|
3494
|
+
}
|
|
3988
3495
|
|
|
3989
3496
|
var UNSUPPORTED_Y = fails(function () {
|
|
3990
|
-
|
|
3497
|
+
// babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
|
|
3498
|
+
var re = RE('a', 'y');
|
|
3991
3499
|
re.lastIndex = 2;
|
|
3992
3500
|
return re.exec('abcd') != null;
|
|
3993
3501
|
});
|
|
3994
3502
|
|
|
3995
|
-
|
|
3996
|
-
// https://github.com/zloirock/core-js/issues/1008
|
|
3997
|
-
var MISSED_STICKY = UNSUPPORTED_Y || fails(function () {
|
|
3998
|
-
return !$RegExp('a', 'y').sticky;
|
|
3999
|
-
});
|
|
4000
|
-
|
|
4001
|
-
var BROKEN_CARET = UNSUPPORTED_Y || fails(function () {
|
|
3503
|
+
var BROKEN_CARET = fails(function () {
|
|
4002
3504
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=773687
|
|
4003
|
-
var re =
|
|
3505
|
+
var re = RE('^r', 'gy');
|
|
4004
3506
|
re.lastIndex = 2;
|
|
4005
3507
|
return re.exec('str') != null;
|
|
4006
3508
|
});
|
|
4007
3509
|
|
|
4008
3510
|
var regexpStickyHelpers = {
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
UNSUPPORTED_Y: UNSUPPORTED_Y
|
|
4012
|
-
};
|
|
4013
|
-
|
|
4014
|
-
// `Object.defineProperties` method
|
|
4015
|
-
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
4016
|
-
// eslint-disable-next-line es-x/no-object-defineproperties -- safe
|
|
4017
|
-
var f$6 = descriptors && !v8PrototypeDefineBug ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
4018
|
-
anObject(O);
|
|
4019
|
-
var props = toIndexedObject(Properties);
|
|
4020
|
-
var keys = objectKeys(Properties);
|
|
4021
|
-
var length = keys.length;
|
|
4022
|
-
var index = 0;
|
|
4023
|
-
var key;
|
|
4024
|
-
while (length > index) objectDefineProperty.f(O, key = keys[index++], props[key]);
|
|
4025
|
-
return O;
|
|
4026
|
-
};
|
|
4027
|
-
|
|
4028
|
-
var objectDefineProperties = {
|
|
4029
|
-
f: f$6
|
|
4030
|
-
};
|
|
4031
|
-
|
|
4032
|
-
/* global ActiveXObject -- old IE, WSH */
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
var GT = '>';
|
|
4042
|
-
var LT = '<';
|
|
4043
|
-
var PROTOTYPE = 'prototype';
|
|
4044
|
-
var SCRIPT = 'script';
|
|
4045
|
-
var IE_PROTO = sharedKey('IE_PROTO');
|
|
4046
|
-
|
|
4047
|
-
var EmptyConstructor = function () { /* empty */ };
|
|
4048
|
-
|
|
4049
|
-
var scriptTag = function (content) {
|
|
4050
|
-
return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
|
|
4051
|
-
};
|
|
4052
|
-
|
|
4053
|
-
// Create object with fake `null` prototype: use ActiveX Object with cleared prototype
|
|
4054
|
-
var NullProtoObjectViaActiveX = function (activeXDocument) {
|
|
4055
|
-
activeXDocument.write(scriptTag(''));
|
|
4056
|
-
activeXDocument.close();
|
|
4057
|
-
var temp = activeXDocument.parentWindow.Object;
|
|
4058
|
-
activeXDocument = null; // avoid memory leak
|
|
4059
|
-
return temp;
|
|
4060
|
-
};
|
|
4061
|
-
|
|
4062
|
-
// Create object with fake `null` prototype: use iframe Object with cleared prototype
|
|
4063
|
-
var NullProtoObjectViaIFrame = function () {
|
|
4064
|
-
// Thrash, waste and sodomy: IE GC bug
|
|
4065
|
-
var iframe = documentCreateElement('iframe');
|
|
4066
|
-
var JS = 'java' + SCRIPT + ':';
|
|
4067
|
-
var iframeDocument;
|
|
4068
|
-
iframe.style.display = 'none';
|
|
4069
|
-
html.appendChild(iframe);
|
|
4070
|
-
// https://github.com/zloirock/core-js/issues/475
|
|
4071
|
-
iframe.src = String(JS);
|
|
4072
|
-
iframeDocument = iframe.contentWindow.document;
|
|
4073
|
-
iframeDocument.open();
|
|
4074
|
-
iframeDocument.write(scriptTag('document.F=Object'));
|
|
4075
|
-
iframeDocument.close();
|
|
4076
|
-
return iframeDocument.F;
|
|
4077
|
-
};
|
|
4078
|
-
|
|
4079
|
-
// Check for document.domain and active x support
|
|
4080
|
-
// No need to use active x approach when document.domain is not set
|
|
4081
|
-
// see https://github.com/es-shims/es5-shim/issues/150
|
|
4082
|
-
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
|
|
4083
|
-
// avoid IE GC bug
|
|
4084
|
-
var activeXDocument;
|
|
4085
|
-
var NullProtoObject = function () {
|
|
4086
|
-
try {
|
|
4087
|
-
activeXDocument = new ActiveXObject('htmlfile');
|
|
4088
|
-
} catch (error) { /* ignore */ }
|
|
4089
|
-
NullProtoObject = typeof document != 'undefined'
|
|
4090
|
-
? document.domain && activeXDocument
|
|
4091
|
-
? NullProtoObjectViaActiveX(activeXDocument) // old IE
|
|
4092
|
-
: NullProtoObjectViaIFrame()
|
|
4093
|
-
: NullProtoObjectViaActiveX(activeXDocument); // WSH
|
|
4094
|
-
var length = enumBugKeys.length;
|
|
4095
|
-
while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
|
|
4096
|
-
return NullProtoObject();
|
|
4097
|
-
};
|
|
4098
|
-
|
|
4099
|
-
hiddenKeys[IE_PROTO] = true;
|
|
4100
|
-
|
|
4101
|
-
// `Object.create` method
|
|
4102
|
-
// https://tc39.es/ecma262/#sec-object.create
|
|
4103
|
-
// eslint-disable-next-line es-x/no-object-create -- safe
|
|
4104
|
-
var objectCreate = Object.create || function create(O, Properties) {
|
|
4105
|
-
var result;
|
|
4106
|
-
if (O !== null) {
|
|
4107
|
-
EmptyConstructor[PROTOTYPE] = anObject(O);
|
|
4108
|
-
result = new EmptyConstructor();
|
|
4109
|
-
EmptyConstructor[PROTOTYPE] = null;
|
|
4110
|
-
// add "__proto__" for Object.getPrototypeOf polyfill
|
|
4111
|
-
result[IE_PROTO] = O;
|
|
4112
|
-
} else result = NullProtoObject();
|
|
4113
|
-
return Properties === undefined ? result : objectDefineProperties.f(result, Properties);
|
|
3511
|
+
UNSUPPORTED_Y: UNSUPPORTED_Y,
|
|
3512
|
+
BROKEN_CARET: BROKEN_CARET
|
|
4114
3513
|
};
|
|
4115
3514
|
|
|
4116
|
-
// babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
|
|
4117
|
-
var $RegExp$1 = global_1.RegExp;
|
|
4118
|
-
|
|
4119
|
-
var regexpUnsupportedDotAll = fails(function () {
|
|
4120
|
-
var re = $RegExp$1('.', 's');
|
|
4121
|
-
return !(re.dotAll && re.exec('\n') && re.flags === 's');
|
|
4122
|
-
});
|
|
4123
|
-
|
|
4124
|
-
// babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
|
|
4125
|
-
var $RegExp$2 = global_1.RegExp;
|
|
4126
|
-
|
|
4127
|
-
var regexpUnsupportedNcg = fails(function () {
|
|
4128
|
-
var re = $RegExp$2('(?<a>b)', 'g');
|
|
4129
|
-
return re.exec('b').groups.a !== 'b' ||
|
|
4130
|
-
'b'.replace(re, '$<a>c') !== 'bc';
|
|
4131
|
-
});
|
|
4132
|
-
|
|
4133
|
-
/* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
|
|
4134
|
-
/* eslint-disable regexp/no-useless-quantifier -- testing */
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
var getInternalState = internalState.get;
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
var nativeReplace = shared('native-string-replace', String.prototype.replace);
|
|
4147
3515
|
var nativeExec = RegExp.prototype.exec;
|
|
3516
|
+
// This always refers to the native implementation, because the
|
|
3517
|
+
// String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
|
|
3518
|
+
// which loads this file before patching the method.
|
|
3519
|
+
var nativeReplace = String.prototype.replace;
|
|
3520
|
+
|
|
4148
3521
|
var patchedExec = nativeExec;
|
|
4149
|
-
var charAt = functionUncurryThis(''.charAt);
|
|
4150
|
-
var indexOf$1 = functionUncurryThis(''.indexOf);
|
|
4151
|
-
var replace$1 = functionUncurryThis(''.replace);
|
|
4152
|
-
var stringSlice$1 = functionUncurryThis(''.slice);
|
|
4153
3522
|
|
|
4154
3523
|
var UPDATES_LAST_INDEX_WRONG = (function () {
|
|
4155
3524
|
var re1 = /a/;
|
|
4156
3525
|
var re2 = /b*/g;
|
|
4157
|
-
|
|
4158
|
-
|
|
3526
|
+
nativeExec.call(re1, 'a');
|
|
3527
|
+
nativeExec.call(re2, 'a');
|
|
4159
3528
|
return re1.lastIndex !== 0 || re2.lastIndex !== 0;
|
|
4160
3529
|
})();
|
|
4161
3530
|
|
|
4162
|
-
var UNSUPPORTED_Y$1 = regexpStickyHelpers.BROKEN_CARET;
|
|
3531
|
+
var UNSUPPORTED_Y$1 = regexpStickyHelpers.UNSUPPORTED_Y || regexpStickyHelpers.BROKEN_CARET;
|
|
4163
3532
|
|
|
4164
3533
|
// nonparticipating capturing group, copied from es5-shim's String#split patch.
|
|
4165
3534
|
var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
|
|
4166
3535
|
|
|
4167
|
-
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1
|
|
3536
|
+
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1;
|
|
4168
3537
|
|
|
4169
3538
|
if (PATCH) {
|
|
4170
|
-
patchedExec = function exec(
|
|
3539
|
+
patchedExec = function exec(str) {
|
|
4171
3540
|
var re = this;
|
|
4172
|
-
var
|
|
4173
|
-
var str = toString_1(string);
|
|
4174
|
-
var raw = state.raw;
|
|
4175
|
-
var result, reCopy, lastIndex, match, i, object, group;
|
|
4176
|
-
|
|
4177
|
-
if (raw) {
|
|
4178
|
-
raw.lastIndex = re.lastIndex;
|
|
4179
|
-
result = functionCall(patchedExec, raw, str);
|
|
4180
|
-
re.lastIndex = raw.lastIndex;
|
|
4181
|
-
return result;
|
|
4182
|
-
}
|
|
4183
|
-
|
|
4184
|
-
var groups = state.groups;
|
|
3541
|
+
var lastIndex, reCopy, match, i;
|
|
4185
3542
|
var sticky = UNSUPPORTED_Y$1 && re.sticky;
|
|
4186
|
-
var flags =
|
|
3543
|
+
var flags = regexpFlags.call(re);
|
|
4187
3544
|
var source = re.source;
|
|
4188
3545
|
var charsAdded = 0;
|
|
4189
3546
|
var strCopy = str;
|
|
4190
3547
|
|
|
4191
3548
|
if (sticky) {
|
|
4192
|
-
flags = replace
|
|
4193
|
-
if (indexOf
|
|
3549
|
+
flags = flags.replace('y', '');
|
|
3550
|
+
if (flags.indexOf('g') === -1) {
|
|
4194
3551
|
flags += 'g';
|
|
4195
3552
|
}
|
|
4196
3553
|
|
|
4197
|
-
strCopy =
|
|
3554
|
+
strCopy = String(str).slice(re.lastIndex);
|
|
4198
3555
|
// Support anchored sticky behavior.
|
|
4199
|
-
if (re.lastIndex > 0 && (!re.multiline || re.multiline &&
|
|
3556
|
+
if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) {
|
|
4200
3557
|
source = '(?: ' + source + ')';
|
|
4201
3558
|
strCopy = ' ' + strCopy;
|
|
4202
3559
|
charsAdded++;
|
|
@@ -4211,12 +3568,12 @@ var Radar = (function () {
|
|
|
4211
3568
|
}
|
|
4212
3569
|
if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
|
|
4213
3570
|
|
|
4214
|
-
match =
|
|
3571
|
+
match = nativeExec.call(sticky ? reCopy : re, strCopy);
|
|
4215
3572
|
|
|
4216
3573
|
if (sticky) {
|
|
4217
3574
|
if (match) {
|
|
4218
|
-
match.input =
|
|
4219
|
-
match[0] =
|
|
3575
|
+
match.input = match.input.slice(charsAdded);
|
|
3576
|
+
match[0] = match[0].slice(charsAdded);
|
|
4220
3577
|
match.index = re.lastIndex;
|
|
4221
3578
|
re.lastIndex += match[0].length;
|
|
4222
3579
|
} else re.lastIndex = 0;
|
|
@@ -4226,64 +3583,40 @@ var Radar = (function () {
|
|
|
4226
3583
|
if (NPCG_INCLUDED && match && match.length > 1) {
|
|
4227
3584
|
// Fix browsers whose `exec` methods don't consistently return `undefined`
|
|
4228
3585
|
// for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
|
|
4229
|
-
|
|
3586
|
+
nativeReplace.call(match[0], reCopy, function () {
|
|
4230
3587
|
for (i = 1; i < arguments.length - 2; i++) {
|
|
4231
3588
|
if (arguments[i] === undefined) match[i] = undefined;
|
|
4232
3589
|
}
|
|
4233
3590
|
});
|
|
4234
3591
|
}
|
|
4235
3592
|
|
|
4236
|
-
if (match && groups) {
|
|
4237
|
-
match.groups = object = objectCreate(null);
|
|
4238
|
-
for (i = 0; i < groups.length; i++) {
|
|
4239
|
-
group = groups[i];
|
|
4240
|
-
object[group[0]] = match[group[1]];
|
|
4241
|
-
}
|
|
4242
|
-
}
|
|
4243
|
-
|
|
4244
3593
|
return match;
|
|
4245
3594
|
};
|
|
4246
3595
|
}
|
|
4247
3596
|
|
|
4248
3597
|
var regexpExec = patchedExec;
|
|
4249
3598
|
|
|
4250
|
-
// `RegExp.prototype.exec` method
|
|
4251
|
-
// https://tc39.es/ecma262/#sec-regexp.prototype.exec
|
|
4252
3599
|
_export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
|
|
4253
3600
|
exec: regexpExec
|
|
4254
3601
|
});
|
|
4255
3602
|
|
|
4256
|
-
var RegExpPrototype = RegExp.prototype;
|
|
4257
|
-
|
|
4258
|
-
var regexpGetFlags = function (R) {
|
|
4259
|
-
var flags = R.flags;
|
|
4260
|
-
return flags === undefined && !('flags' in RegExpPrototype) && !hasOwnProperty_1(R, 'flags') && objectIsPrototypeOf(RegExpPrototype, R)
|
|
4261
|
-
? functionCall(regexpFlags, R) : flags;
|
|
4262
|
-
};
|
|
4263
|
-
|
|
4264
|
-
var PROPER_FUNCTION_NAME$1 = functionName.PROPER;
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
3603
|
var TO_STRING = 'toString';
|
|
4272
|
-
var RegExpPrototype
|
|
4273
|
-
var
|
|
3604
|
+
var RegExpPrototype = RegExp.prototype;
|
|
3605
|
+
var nativeToString = RegExpPrototype[TO_STRING];
|
|
4274
3606
|
|
|
4275
|
-
var NOT_GENERIC = fails(function () { return
|
|
3607
|
+
var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
|
|
4276
3608
|
// FF44- RegExp#toString has a wrong name
|
|
4277
|
-
var INCORRECT_NAME =
|
|
3609
|
+
var INCORRECT_NAME = nativeToString.name != TO_STRING;
|
|
4278
3610
|
|
|
4279
3611
|
// `RegExp.prototype.toString` method
|
|
4280
|
-
// https://tc39.
|
|
3612
|
+
// https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring
|
|
4281
3613
|
if (NOT_GENERIC || INCORRECT_NAME) {
|
|
4282
|
-
|
|
3614
|
+
redefine(RegExp.prototype, TO_STRING, function toString() {
|
|
4283
3615
|
var R = anObject(this);
|
|
4284
|
-
var
|
|
4285
|
-
var
|
|
4286
|
-
|
|
3616
|
+
var p = String(R.source);
|
|
3617
|
+
var rf = R.flags;
|
|
3618
|
+
var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? regexpFlags.call(R) : rf);
|
|
3619
|
+
return '/' + p + '/' + f;
|
|
4287
3620
|
}, { unsafe: true });
|
|
4288
3621
|
}
|
|
4289
3622
|
|
|
@@ -4295,11 +3628,47 @@ var Radar = (function () {
|
|
|
4295
3628
|
|
|
4296
3629
|
|
|
4297
3630
|
|
|
4298
|
-
|
|
4299
3631
|
var SPECIES$5 = wellKnownSymbol('species');
|
|
4300
|
-
var RegExpPrototype$2 = RegExp.prototype;
|
|
4301
3632
|
|
|
4302
|
-
var
|
|
3633
|
+
var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
|
|
3634
|
+
// #replace needs built-in support for named groups.
|
|
3635
|
+
// #match works fine because it just return the exec results, even if it has
|
|
3636
|
+
// a "grops" property.
|
|
3637
|
+
var re = /./;
|
|
3638
|
+
re.exec = function () {
|
|
3639
|
+
var result = [];
|
|
3640
|
+
result.groups = { a: '7' };
|
|
3641
|
+
return result;
|
|
3642
|
+
};
|
|
3643
|
+
return ''.replace(re, '$<a>') !== '7';
|
|
3644
|
+
});
|
|
3645
|
+
|
|
3646
|
+
// IE <= 11 replaces $0 with the whole match, as if it was $&
|
|
3647
|
+
// https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
|
|
3648
|
+
var REPLACE_KEEPS_$0 = (function () {
|
|
3649
|
+
return 'a'.replace(/./, '$0') === '$0';
|
|
3650
|
+
})();
|
|
3651
|
+
|
|
3652
|
+
var REPLACE = wellKnownSymbol('replace');
|
|
3653
|
+
// Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
|
|
3654
|
+
var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
|
|
3655
|
+
if (/./[REPLACE]) {
|
|
3656
|
+
return /./[REPLACE]('a', '$0') === '';
|
|
3657
|
+
}
|
|
3658
|
+
return false;
|
|
3659
|
+
})();
|
|
3660
|
+
|
|
3661
|
+
// Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
|
|
3662
|
+
// Weex JS has frozen built-in prototypes, so use try / catch wrapper
|
|
3663
|
+
var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
|
|
3664
|
+
var re = /(?:)/;
|
|
3665
|
+
var originalExec = re.exec;
|
|
3666
|
+
re.exec = function () { return originalExec.apply(this, arguments); };
|
|
3667
|
+
var result = 'ab'.split(re);
|
|
3668
|
+
return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
|
|
3669
|
+
});
|
|
3670
|
+
|
|
3671
|
+
var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
|
|
4303
3672
|
var SYMBOL = wellKnownSymbol(KEY);
|
|
4304
3673
|
|
|
4305
3674
|
var DELEGATES_TO_SYMBOL = !fails(function () {
|
|
@@ -4336,197 +3705,140 @@ var Radar = (function () {
|
|
|
4336
3705
|
if (
|
|
4337
3706
|
!DELEGATES_TO_SYMBOL ||
|
|
4338
3707
|
!DELEGATES_TO_EXEC ||
|
|
4339
|
-
|
|
3708
|
+
(KEY === 'replace' && !(
|
|
3709
|
+
REPLACE_SUPPORTS_NAMED_GROUPS &&
|
|
3710
|
+
REPLACE_KEEPS_$0 &&
|
|
3711
|
+
!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
|
|
3712
|
+
)) ||
|
|
3713
|
+
(KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
|
|
4340
3714
|
) {
|
|
4341
|
-
var
|
|
3715
|
+
var nativeRegExpMethod = /./[SYMBOL];
|
|
4342
3716
|
var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
|
|
4343
|
-
|
|
4344
|
-
var $exec = regexp.exec;
|
|
4345
|
-
if ($exec === regexpExec || $exec === RegExpPrototype$2.exec) {
|
|
3717
|
+
if (regexp.exec === regexpExec) {
|
|
4346
3718
|
if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
|
|
4347
3719
|
// The native String method already delegates to @@method (this
|
|
4348
3720
|
// polyfilled function), leasing to infinite recursion.
|
|
4349
3721
|
// We avoid it by directly calling the native @@method method.
|
|
4350
|
-
return { done: true, value:
|
|
3722
|
+
return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
|
|
4351
3723
|
}
|
|
4352
|
-
return { done: true, value:
|
|
3724
|
+
return { done: true, value: nativeMethod.call(str, regexp, arg2) };
|
|
4353
3725
|
}
|
|
4354
3726
|
return { done: false };
|
|
3727
|
+
}, {
|
|
3728
|
+
REPLACE_KEEPS_$0: REPLACE_KEEPS_$0,
|
|
3729
|
+
REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
|
|
4355
3730
|
});
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
3731
|
+
var stringMethod = methods[0];
|
|
3732
|
+
var regexMethod = methods[1];
|
|
3733
|
+
|
|
3734
|
+
redefine(String.prototype, KEY, stringMethod);
|
|
3735
|
+
redefine(RegExp.prototype, SYMBOL, length == 2
|
|
3736
|
+
// 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
|
|
3737
|
+
// 21.2.5.11 RegExp.prototype[@@split](string, limit)
|
|
3738
|
+
? function (string, arg) { return regexMethod.call(string, this, arg); }
|
|
3739
|
+
// 21.2.5.6 RegExp.prototype[@@match](string)
|
|
3740
|
+
// 21.2.5.9 RegExp.prototype[@@search](string)
|
|
3741
|
+
: function (string) { return regexMethod.call(string, this); }
|
|
3742
|
+
);
|
|
4359
3743
|
}
|
|
4360
3744
|
|
|
4361
|
-
if (
|
|
3745
|
+
if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
|
|
4362
3746
|
};
|
|
4363
3747
|
|
|
4364
|
-
|
|
4365
|
-
var charCodeAt = functionUncurryThis(''.charCodeAt);
|
|
4366
|
-
var stringSlice$2 = functionUncurryThis(''.slice);
|
|
4367
|
-
|
|
3748
|
+
// `String.prototype.{ codePointAt, at }` methods implementation
|
|
4368
3749
|
var createMethod$3 = function (CONVERT_TO_STRING) {
|
|
4369
3750
|
return function ($this, pos) {
|
|
4370
|
-
var S =
|
|
4371
|
-
var position =
|
|
3751
|
+
var S = String(requireObjectCoercible($this));
|
|
3752
|
+
var position = toInteger(pos);
|
|
4372
3753
|
var size = S.length;
|
|
4373
3754
|
var first, second;
|
|
4374
3755
|
if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
|
|
4375
|
-
first = charCodeAt(
|
|
3756
|
+
first = S.charCodeAt(position);
|
|
4376
3757
|
return first < 0xD800 || first > 0xDBFF || position + 1 === size
|
|
4377
|
-
|| (second = charCodeAt(
|
|
4378
|
-
? CONVERT_TO_STRING
|
|
4379
|
-
|
|
4380
|
-
: first
|
|
4381
|
-
: CONVERT_TO_STRING
|
|
4382
|
-
? stringSlice$2(S, position, position + 2)
|
|
4383
|
-
: (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
|
|
3758
|
+
|| (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
|
|
3759
|
+
? CONVERT_TO_STRING ? S.charAt(position) : first
|
|
3760
|
+
: CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
|
|
4384
3761
|
};
|
|
4385
3762
|
};
|
|
4386
3763
|
|
|
4387
3764
|
var stringMultibyte = {
|
|
4388
3765
|
// `String.prototype.codePointAt` method
|
|
4389
|
-
// https://tc39.
|
|
3766
|
+
// https://tc39.github.io/ecma262/#sec-string.prototype.codepointat
|
|
4390
3767
|
codeAt: createMethod$3(false),
|
|
4391
3768
|
// `String.prototype.at` method
|
|
4392
3769
|
// https://github.com/mathiasbynens/String.prototype.at
|
|
4393
3770
|
charAt: createMethod$3(true)
|
|
4394
3771
|
};
|
|
4395
3772
|
|
|
4396
|
-
var charAt
|
|
3773
|
+
var charAt = stringMultibyte.charAt;
|
|
4397
3774
|
|
|
4398
3775
|
// `AdvanceStringIndex` abstract operation
|
|
4399
|
-
// https://tc39.
|
|
3776
|
+
// https://tc39.github.io/ecma262/#sec-advancestringindex
|
|
4400
3777
|
var advanceStringIndex = function (S, index, unicode) {
|
|
4401
|
-
return index + (unicode ? charAt
|
|
4402
|
-
};
|
|
4403
|
-
|
|
4404
|
-
var floor$1 = Math.floor;
|
|
4405
|
-
var charAt$3 = functionUncurryThis(''.charAt);
|
|
4406
|
-
var replace$2 = functionUncurryThis(''.replace);
|
|
4407
|
-
var stringSlice$3 = functionUncurryThis(''.slice);
|
|
4408
|
-
var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
|
|
4409
|
-
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
|
|
4410
|
-
|
|
4411
|
-
// `GetSubstitution` abstract operation
|
|
4412
|
-
// https://tc39.es/ecma262/#sec-getsubstitution
|
|
4413
|
-
var getSubstitution = function (matched, str, position, captures, namedCaptures, replacement) {
|
|
4414
|
-
var tailPos = position + matched.length;
|
|
4415
|
-
var m = captures.length;
|
|
4416
|
-
var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
|
|
4417
|
-
if (namedCaptures !== undefined) {
|
|
4418
|
-
namedCaptures = toObject(namedCaptures);
|
|
4419
|
-
symbols = SUBSTITUTION_SYMBOLS;
|
|
4420
|
-
}
|
|
4421
|
-
return replace$2(replacement, symbols, function (match, ch) {
|
|
4422
|
-
var capture;
|
|
4423
|
-
switch (charAt$3(ch, 0)) {
|
|
4424
|
-
case '$': return '$';
|
|
4425
|
-
case '&': return matched;
|
|
4426
|
-
case '`': return stringSlice$3(str, 0, position);
|
|
4427
|
-
case "'": return stringSlice$3(str, tailPos);
|
|
4428
|
-
case '<':
|
|
4429
|
-
capture = namedCaptures[stringSlice$3(ch, 1, -1)];
|
|
4430
|
-
break;
|
|
4431
|
-
default: // \d\d?
|
|
4432
|
-
var n = +ch;
|
|
4433
|
-
if (n === 0) return match;
|
|
4434
|
-
if (n > m) {
|
|
4435
|
-
var f = floor$1(n / 10);
|
|
4436
|
-
if (f === 0) return match;
|
|
4437
|
-
if (f <= m) return captures[f - 1] === undefined ? charAt$3(ch, 1) : captures[f - 1] + charAt$3(ch, 1);
|
|
4438
|
-
return match;
|
|
4439
|
-
}
|
|
4440
|
-
capture = captures[n - 1];
|
|
4441
|
-
}
|
|
4442
|
-
return capture === undefined ? '' : capture;
|
|
4443
|
-
});
|
|
3778
|
+
return index + (unicode ? charAt(S, index).length : 1);
|
|
4444
3779
|
};
|
|
4445
3780
|
|
|
4446
|
-
var $TypeError$d = TypeError;
|
|
4447
|
-
|
|
4448
3781
|
// `RegExpExec` abstract operation
|
|
4449
|
-
// https://tc39.
|
|
3782
|
+
// https://tc39.github.io/ecma262/#sec-regexpexec
|
|
4450
3783
|
var regexpExecAbstract = function (R, S) {
|
|
4451
3784
|
var exec = R.exec;
|
|
4452
|
-
if (
|
|
4453
|
-
var result =
|
|
4454
|
-
if (result !==
|
|
3785
|
+
if (typeof exec === 'function') {
|
|
3786
|
+
var result = exec.call(R, S);
|
|
3787
|
+
if (typeof result !== 'object') {
|
|
3788
|
+
throw TypeError('RegExp exec method returned something other than an Object or null');
|
|
3789
|
+
}
|
|
4455
3790
|
return result;
|
|
4456
3791
|
}
|
|
4457
|
-
|
|
4458
|
-
|
|
3792
|
+
|
|
3793
|
+
if (classofRaw(R) !== 'RegExp') {
|
|
3794
|
+
throw TypeError('RegExp#exec called on incompatible receiver');
|
|
3795
|
+
}
|
|
3796
|
+
|
|
3797
|
+
return regexpExec.call(R, S);
|
|
4459
3798
|
};
|
|
4460
3799
|
|
|
4461
|
-
var REPLACE = wellKnownSymbol('replace');
|
|
4462
3800
|
var max$1 = Math.max;
|
|
4463
3801
|
var min$2 = Math.min;
|
|
4464
|
-
var
|
|
4465
|
-
var
|
|
4466
|
-
var
|
|
4467
|
-
var stringSlice$4 = functionUncurryThis(''.slice);
|
|
3802
|
+
var floor$1 = Math.floor;
|
|
3803
|
+
var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g;
|
|
3804
|
+
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g;
|
|
4468
3805
|
|
|
4469
3806
|
var maybeToString = function (it) {
|
|
4470
3807
|
return it === undefined ? it : String(it);
|
|
4471
3808
|
};
|
|
4472
3809
|
|
|
4473
|
-
// IE <= 11 replaces $0 with the whole match, as if it was $&
|
|
4474
|
-
// https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
|
|
4475
|
-
var REPLACE_KEEPS_$0 = (function () {
|
|
4476
|
-
// eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
|
|
4477
|
-
return 'a'.replace(/./, '$0') === '$0';
|
|
4478
|
-
})();
|
|
4479
|
-
|
|
4480
|
-
// Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
|
|
4481
|
-
var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
|
|
4482
|
-
if (/./[REPLACE]) {
|
|
4483
|
-
return /./[REPLACE]('a', '$0') === '';
|
|
4484
|
-
}
|
|
4485
|
-
return false;
|
|
4486
|
-
})();
|
|
4487
|
-
|
|
4488
|
-
var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
|
|
4489
|
-
var re = /./;
|
|
4490
|
-
re.exec = function () {
|
|
4491
|
-
var result = [];
|
|
4492
|
-
result.groups = { a: '7' };
|
|
4493
|
-
return result;
|
|
4494
|
-
};
|
|
4495
|
-
// eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive
|
|
4496
|
-
return ''.replace(re, '$<a>') !== '7';
|
|
4497
|
-
});
|
|
4498
|
-
|
|
4499
3810
|
// @@replace logic
|
|
4500
|
-
fixRegexpWellKnownSymbolLogic('replace', function (
|
|
3811
|
+
fixRegexpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative, reason) {
|
|
3812
|
+
var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = reason.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE;
|
|
3813
|
+
var REPLACE_KEEPS_$0 = reason.REPLACE_KEEPS_$0;
|
|
4501
3814
|
var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
|
|
4502
3815
|
|
|
4503
3816
|
return [
|
|
4504
3817
|
// `String.prototype.replace` method
|
|
4505
|
-
// https://tc39.
|
|
3818
|
+
// https://tc39.github.io/ecma262/#sec-string.prototype.replace
|
|
4506
3819
|
function replace(searchValue, replaceValue) {
|
|
4507
3820
|
var O = requireObjectCoercible(this);
|
|
4508
|
-
var replacer = searchValue == undefined ? undefined :
|
|
4509
|
-
return replacer
|
|
4510
|
-
?
|
|
4511
|
-
:
|
|
3821
|
+
var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
|
|
3822
|
+
return replacer !== undefined
|
|
3823
|
+
? replacer.call(searchValue, O, replaceValue)
|
|
3824
|
+
: nativeReplace.call(String(O), searchValue, replaceValue);
|
|
4512
3825
|
},
|
|
4513
3826
|
// `RegExp.prototype[@@replace]` method
|
|
4514
|
-
// https://tc39.
|
|
4515
|
-
function (
|
|
4516
|
-
var rx = anObject(this);
|
|
4517
|
-
var S = toString_1(string);
|
|
4518
|
-
|
|
3827
|
+
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
|
|
3828
|
+
function (regexp, replaceValue) {
|
|
4519
3829
|
if (
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
stringIndexOf(replaceValue, '$<') === -1
|
|
3830
|
+
(!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE && REPLACE_KEEPS_$0) ||
|
|
3831
|
+
(typeof replaceValue === 'string' && replaceValue.indexOf(UNSAFE_SUBSTITUTE) === -1)
|
|
4523
3832
|
) {
|
|
4524
|
-
var res = maybeCallNative(nativeReplace,
|
|
3833
|
+
var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
|
|
4525
3834
|
if (res.done) return res.value;
|
|
4526
3835
|
}
|
|
4527
3836
|
|
|
4528
|
-
var
|
|
4529
|
-
|
|
3837
|
+
var rx = anObject(regexp);
|
|
3838
|
+
var S = String(this);
|
|
3839
|
+
|
|
3840
|
+
var functionalReplace = typeof replaceValue === 'function';
|
|
3841
|
+
if (!functionalReplace) replaceValue = String(replaceValue);
|
|
4530
3842
|
|
|
4531
3843
|
var global = rx.global;
|
|
4532
3844
|
if (global) {
|
|
@@ -4538,10 +3850,10 @@ var Radar = (function () {
|
|
|
4538
3850
|
var result = regexpExecAbstract(rx, S);
|
|
4539
3851
|
if (result === null) break;
|
|
4540
3852
|
|
|
4541
|
-
push
|
|
3853
|
+
results.push(result);
|
|
4542
3854
|
if (!global) break;
|
|
4543
3855
|
|
|
4544
|
-
var matchStr =
|
|
3856
|
+
var matchStr = String(result[0]);
|
|
4545
3857
|
if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
|
|
4546
3858
|
}
|
|
4547
3859
|
|
|
@@ -4550,32 +3862,66 @@ var Radar = (function () {
|
|
|
4550
3862
|
for (var i = 0; i < results.length; i++) {
|
|
4551
3863
|
result = results[i];
|
|
4552
3864
|
|
|
4553
|
-
var matched =
|
|
4554
|
-
var position = max$1(min$2(
|
|
3865
|
+
var matched = String(result[0]);
|
|
3866
|
+
var position = max$1(min$2(toInteger(result.index), S.length), 0);
|
|
4555
3867
|
var captures = [];
|
|
4556
3868
|
// NOTE: This is equivalent to
|
|
4557
3869
|
// captures = result.slice(1).map(maybeToString)
|
|
4558
3870
|
// but for some reason `nativeSlice.call(result, 1, result.length)` (called in
|
|
4559
3871
|
// the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
|
|
4560
3872
|
// causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
|
|
4561
|
-
for (var j = 1; j < result.length; j++) push
|
|
3873
|
+
for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
|
|
4562
3874
|
var namedCaptures = result.groups;
|
|
4563
3875
|
if (functionalReplace) {
|
|
4564
|
-
var replacerArgs =
|
|
4565
|
-
if (namedCaptures !== undefined) push
|
|
4566
|
-
var replacement =
|
|
3876
|
+
var replacerArgs = [matched].concat(captures, position, S);
|
|
3877
|
+
if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
|
|
3878
|
+
var replacement = String(replaceValue.apply(undefined, replacerArgs));
|
|
4567
3879
|
} else {
|
|
4568
3880
|
replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
|
|
4569
3881
|
}
|
|
4570
3882
|
if (position >= nextSourcePosition) {
|
|
4571
|
-
accumulatedResult +=
|
|
3883
|
+
accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
|
|
4572
3884
|
nextSourcePosition = position + matched.length;
|
|
4573
3885
|
}
|
|
4574
3886
|
}
|
|
4575
|
-
return accumulatedResult +
|
|
3887
|
+
return accumulatedResult + S.slice(nextSourcePosition);
|
|
4576
3888
|
}
|
|
4577
3889
|
];
|
|
4578
|
-
|
|
3890
|
+
|
|
3891
|
+
// https://tc39.github.io/ecma262/#sec-getsubstitution
|
|
3892
|
+
function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
|
|
3893
|
+
var tailPos = position + matched.length;
|
|
3894
|
+
var m = captures.length;
|
|
3895
|
+
var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
|
|
3896
|
+
if (namedCaptures !== undefined) {
|
|
3897
|
+
namedCaptures = toObject(namedCaptures);
|
|
3898
|
+
symbols = SUBSTITUTION_SYMBOLS;
|
|
3899
|
+
}
|
|
3900
|
+
return nativeReplace.call(replacement, symbols, function (match, ch) {
|
|
3901
|
+
var capture;
|
|
3902
|
+
switch (ch.charAt(0)) {
|
|
3903
|
+
case '$': return '$';
|
|
3904
|
+
case '&': return matched;
|
|
3905
|
+
case '`': return str.slice(0, position);
|
|
3906
|
+
case "'": return str.slice(tailPos);
|
|
3907
|
+
case '<':
|
|
3908
|
+
capture = namedCaptures[ch.slice(1, -1)];
|
|
3909
|
+
break;
|
|
3910
|
+
default: // \d\d?
|
|
3911
|
+
var n = +ch;
|
|
3912
|
+
if (n === 0) return match;
|
|
3913
|
+
if (n > m) {
|
|
3914
|
+
var f = floor$1(n / 10);
|
|
3915
|
+
if (f === 0) return match;
|
|
3916
|
+
if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
|
|
3917
|
+
return match;
|
|
3918
|
+
}
|
|
3919
|
+
capture = captures[n - 1];
|
|
3920
|
+
}
|
|
3921
|
+
return capture === undefined ? '' : capture;
|
|
3922
|
+
});
|
|
3923
|
+
}
|
|
3924
|
+
});
|
|
4579
3925
|
|
|
4580
3926
|
var generateUUID = function generateUUID() {
|
|
4581
3927
|
var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (char) {
|
|
@@ -4632,8 +3978,6 @@ var Radar = (function () {
|
|
|
4632
3978
|
description,
|
|
4633
3979
|
metadata,
|
|
4634
3980
|
body,
|
|
4635
|
-
basePath,
|
|
4636
|
-
trackEndpoint,
|
|
4637
3981
|
response,
|
|
4638
3982
|
_args = arguments;
|
|
4639
3983
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
@@ -4683,12 +4027,10 @@ var Radar = (function () {
|
|
|
4683
4027
|
stopped: true,
|
|
4684
4028
|
userId: userId
|
|
4685
4029
|
});
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
_context.next = 21;
|
|
4689
|
-
return Http.request('POST', trackEndpoint, body);
|
|
4030
|
+
_context.next = 19;
|
|
4031
|
+
return Http.request('POST', 'track', body);
|
|
4690
4032
|
|
|
4691
|
-
case
|
|
4033
|
+
case 19:
|
|
4692
4034
|
response = _context.sent;
|
|
4693
4035
|
response.location = {
|
|
4694
4036
|
latitude: latitude,
|
|
@@ -4697,7 +4039,7 @@ var Radar = (function () {
|
|
|
4697
4039
|
};
|
|
4698
4040
|
return _context.abrupt("return", response);
|
|
4699
4041
|
|
|
4700
|
-
case
|
|
4042
|
+
case 22:
|
|
4701
4043
|
case "end":
|
|
4702
4044
|
return _context.stop();
|
|
4703
4045
|
}
|
|
@@ -4734,7 +4076,6 @@ var Radar = (function () {
|
|
|
4734
4076
|
metadata,
|
|
4735
4077
|
approachingThreshold,
|
|
4736
4078
|
params,
|
|
4737
|
-
basePath,
|
|
4738
4079
|
_args = arguments;
|
|
4739
4080
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
4740
4081
|
while (1) {
|
|
@@ -4752,10 +4093,9 @@ var Radar = (function () {
|
|
|
4752
4093
|
metadata: metadata,
|
|
4753
4094
|
approachingThreshold: approachingThreshold
|
|
4754
4095
|
};
|
|
4755
|
-
|
|
4756
|
-
return _context.abrupt("return", Http.request('POST', "".concat(basePath, "/trips"), params));
|
|
4096
|
+
return _context.abrupt("return", Http.request('POST', "trips", params));
|
|
4757
4097
|
|
|
4758
|
-
case
|
|
4098
|
+
case 5:
|
|
4759
4099
|
case "end":
|
|
4760
4100
|
return _context.stop();
|
|
4761
4101
|
}
|
|
@@ -4783,7 +4123,6 @@ var Radar = (function () {
|
|
|
4783
4123
|
metadata,
|
|
4784
4124
|
approachingThreshold,
|
|
4785
4125
|
params,
|
|
4786
|
-
basePath,
|
|
4787
4126
|
_args2 = arguments;
|
|
4788
4127
|
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
4789
4128
|
while (1) {
|
|
@@ -4803,10 +4142,9 @@ var Radar = (function () {
|
|
|
4803
4142
|
metadata: metadata,
|
|
4804
4143
|
approachingThreshold: approachingThreshold
|
|
4805
4144
|
};
|
|
4806
|
-
|
|
4807
|
-
return _context2.abrupt("return", Http.request('PATCH', "".concat(basePath, "/trips/").concat(externalId, "/update"), params));
|
|
4145
|
+
return _context2.abrupt("return", Http.request('PATCH', "trips/".concat(externalId, "/update"), params));
|
|
4808
4146
|
|
|
4809
|
-
case
|
|
4147
|
+
case 6:
|
|
4810
4148
|
case "end":
|
|
4811
4149
|
return _context2.stop();
|
|
4812
4150
|
}
|
|
@@ -4873,7 +4211,8 @@ var Radar = (function () {
|
|
|
4873
4211
|
}
|
|
4874
4212
|
}, {
|
|
4875
4213
|
key: "setHost",
|
|
4876
|
-
value: function setHost(host
|
|
4214
|
+
value: function setHost(host) {
|
|
4215
|
+
var baseApiPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : API_VERSION;
|
|
4877
4216
|
Storage.setItem(Storage.HOST, host);
|
|
4878
4217
|
Storage.setItem(Storage.BASE_API_PATH, baseApiPath);
|
|
4879
4218
|
}
|