@dereekb/rxjs 12.6.21 → 13.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/index.cjs.js +93 -1907
- package/index.esm.js +174 -1974
- package/package.json +5 -5
- package/src/lib/filter/filter.source.d.ts +0 -4
- package/src/lib/iterator/iteration.mapped.page.d.ts +0 -4
- package/src/lib/loading/loading.context.state.d.ts +0 -6
- package/src/lib/loading/loading.state.d.ts +0 -64
- package/src/lib/loading/loading.state.list.d.ts +0 -8
- package/src/lib/lock.d.ts +13 -10
- package/src/lib/rxjs/expires.d.ts +29 -0
- package/src/lib/rxjs/index.d.ts +1 -0
- package/src/lib/rxjs/value.d.ts +0 -10
- package/index.esm.d.ts +0 -1
- /package/{index.cjs.d.ts → index.d.ts} +0 -0
package/index.esm.js
CHANGED
|
@@ -1,1710 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
11
|
-
var global$b =
|
|
12
|
-
// eslint-disable-next-line es/no-global-this -- safe
|
|
13
|
-
check(typeof globalThis == 'object' && globalThis) ||
|
|
14
|
-
check(typeof window == 'object' && window) ||
|
|
15
|
-
// eslint-disable-next-line no-restricted-globals -- safe
|
|
16
|
-
check(typeof self == 'object' && self) ||
|
|
17
|
-
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
|
18
|
-
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
|
19
|
-
// eslint-disable-next-line no-new-func -- fallback
|
|
20
|
-
(function () { return this; })() || Function('return this')();
|
|
21
|
-
|
|
22
|
-
var objectGetOwnPropertyDescriptor = {};
|
|
23
|
-
|
|
24
|
-
var fails$c = function (exec) {
|
|
25
|
-
try {
|
|
26
|
-
return !!exec();
|
|
27
|
-
} catch (error) {
|
|
28
|
-
return true;
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
var fails$b = fails$c;
|
|
33
|
-
|
|
34
|
-
// Detect IE8's incomplete defineProperty implementation
|
|
35
|
-
var descriptors = !fails$b(function () {
|
|
36
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
37
|
-
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
var fails$a = fails$c;
|
|
41
|
-
|
|
42
|
-
var functionBindNative = !fails$a(function () {
|
|
43
|
-
// eslint-disable-next-line es/no-function-prototype-bind -- safe
|
|
44
|
-
var test = (function () { /* empty */ }).bind();
|
|
45
|
-
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
46
|
-
return typeof test != 'function' || test.hasOwnProperty('prototype');
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
var NATIVE_BIND$2 = functionBindNative;
|
|
50
|
-
|
|
51
|
-
var call$a = Function.prototype.call;
|
|
52
|
-
|
|
53
|
-
var functionCall = NATIVE_BIND$2 ? call$a.bind(call$a) : function () {
|
|
54
|
-
return call$a.apply(call$a, arguments);
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
var objectPropertyIsEnumerable = {};
|
|
58
|
-
|
|
59
|
-
var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
|
60
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
61
|
-
var getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor;
|
|
62
|
-
|
|
63
|
-
// Nashorn ~ JDK8 bug
|
|
64
|
-
var NASHORN_BUG = getOwnPropertyDescriptor$2 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
|
|
65
|
-
|
|
66
|
-
// `Object.prototype.propertyIsEnumerable` method implementation
|
|
67
|
-
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
|
|
68
|
-
objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
|
69
|
-
var descriptor = getOwnPropertyDescriptor$2(this, V);
|
|
70
|
-
return !!descriptor && descriptor.enumerable;
|
|
71
|
-
} : $propertyIsEnumerable;
|
|
72
|
-
|
|
73
|
-
var createPropertyDescriptor$3 = function (bitmap, value) {
|
|
74
|
-
return {
|
|
75
|
-
enumerable: !(bitmap & 1),
|
|
76
|
-
configurable: !(bitmap & 2),
|
|
77
|
-
writable: !(bitmap & 4),
|
|
78
|
-
value: value
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
var NATIVE_BIND$1 = functionBindNative;
|
|
83
|
-
|
|
84
|
-
var FunctionPrototype$1 = Function.prototype;
|
|
85
|
-
var call$9 = FunctionPrototype$1.call;
|
|
86
|
-
var uncurryThisWithBind = NATIVE_BIND$1 && FunctionPrototype$1.bind.bind(call$9, call$9);
|
|
87
|
-
|
|
88
|
-
var functionUncurryThis = NATIVE_BIND$1 ? uncurryThisWithBind : function (fn) {
|
|
89
|
-
return function () {
|
|
90
|
-
return call$9.apply(fn, arguments);
|
|
91
|
-
};
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
var uncurryThis$a = functionUncurryThis;
|
|
95
|
-
|
|
96
|
-
var toString$1 = uncurryThis$a({}.toString);
|
|
97
|
-
var stringSlice$1 = uncurryThis$a(''.slice);
|
|
98
|
-
|
|
99
|
-
var classofRaw$2 = function (it) {
|
|
100
|
-
return stringSlice$1(toString$1(it), 8, -1);
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
var uncurryThis$9 = functionUncurryThis;
|
|
104
|
-
var fails$9 = fails$c;
|
|
105
|
-
var classof$3 = classofRaw$2;
|
|
106
|
-
|
|
107
|
-
var $Object$4 = Object;
|
|
108
|
-
var split = uncurryThis$9(''.split);
|
|
109
|
-
|
|
110
|
-
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
111
|
-
var indexedObject = fails$9(function () {
|
|
112
|
-
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
|
|
113
|
-
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
114
|
-
return !$Object$4('z').propertyIsEnumerable(0);
|
|
115
|
-
}) ? function (it) {
|
|
116
|
-
return classof$3(it) === 'String' ? split(it, '') : $Object$4(it);
|
|
117
|
-
} : $Object$4;
|
|
118
|
-
|
|
119
|
-
// we can't use just `it == null` since of `document.all` special case
|
|
120
|
-
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
|
|
121
|
-
var isNullOrUndefined$3 = function (it) {
|
|
122
|
-
return it === null || it === undefined;
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
var isNullOrUndefined$2 = isNullOrUndefined$3;
|
|
126
|
-
|
|
127
|
-
var $TypeError$b = TypeError;
|
|
128
|
-
|
|
129
|
-
// `RequireObjectCoercible` abstract operation
|
|
130
|
-
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
131
|
-
var requireObjectCoercible$2 = function (it) {
|
|
132
|
-
if (isNullOrUndefined$2(it)) throw new $TypeError$b("Can't call method on " + it);
|
|
133
|
-
return it;
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
// toObject with fallback for non-array-like ES3 strings
|
|
137
|
-
var IndexedObject = indexedObject;
|
|
138
|
-
var requireObjectCoercible$1 = requireObjectCoercible$2;
|
|
139
|
-
|
|
140
|
-
var toIndexedObject$4 = function (it) {
|
|
141
|
-
return IndexedObject(requireObjectCoercible$1(it));
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
|
|
145
|
-
var documentAll = typeof document == 'object' && document.all;
|
|
146
|
-
|
|
147
|
-
// `IsCallable` abstract operation
|
|
148
|
-
// https://tc39.es/ecma262/#sec-iscallable
|
|
149
|
-
// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
|
|
150
|
-
var isCallable$e = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {
|
|
151
|
-
return typeof argument == 'function' || argument === documentAll;
|
|
152
|
-
} : function (argument) {
|
|
153
|
-
return typeof argument == 'function';
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
var isCallable$d = isCallable$e;
|
|
157
|
-
|
|
158
|
-
var isObject$6 = function (it) {
|
|
159
|
-
return typeof it == 'object' ? it !== null : isCallable$d(it);
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
var global$a = global$b;
|
|
163
|
-
var isCallable$c = isCallable$e;
|
|
164
|
-
|
|
165
|
-
var aFunction = function (argument) {
|
|
166
|
-
return isCallable$c(argument) ? argument : undefined;
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
var getBuiltIn$3 = function (namespace, method) {
|
|
170
|
-
return arguments.length < 2 ? aFunction(global$a[namespace]) : global$a[namespace] && global$a[namespace][method];
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
var uncurryThis$8 = functionUncurryThis;
|
|
174
|
-
|
|
175
|
-
var objectIsPrototypeOf = uncurryThis$8({}.isPrototypeOf);
|
|
176
|
-
|
|
177
|
-
var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
|
|
178
|
-
|
|
179
|
-
var global$9 = global$b;
|
|
180
|
-
var userAgent = engineUserAgent;
|
|
181
|
-
|
|
182
|
-
var process = global$9.process;
|
|
183
|
-
var Deno = global$9.Deno;
|
|
184
|
-
var versions = process && process.versions || Deno && Deno.version;
|
|
185
|
-
var v8 = versions && versions.v8;
|
|
186
|
-
var match, version;
|
|
187
|
-
|
|
188
|
-
if (v8) {
|
|
189
|
-
match = v8.split('.');
|
|
190
|
-
// in old Chrome, versions of V8 isn't V8 = Chrome / 10
|
|
191
|
-
// but their correct versions are not interesting for us
|
|
192
|
-
version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
|
|
196
|
-
// so check `userAgent` even if `.v8` exists, but 0
|
|
197
|
-
if (!version && userAgent) {
|
|
198
|
-
match = userAgent.match(/Edge\/(\d+)/);
|
|
199
|
-
if (!match || match[1] >= 74) {
|
|
200
|
-
match = userAgent.match(/Chrome\/(\d+)/);
|
|
201
|
-
if (match) version = +match[1];
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
var engineV8Version = version;
|
|
206
|
-
|
|
207
|
-
/* eslint-disable es/no-symbol -- required for testing */
|
|
208
|
-
var V8_VERSION = engineV8Version;
|
|
209
|
-
var fails$8 = fails$c;
|
|
210
|
-
var global$8 = global$b;
|
|
211
|
-
|
|
212
|
-
var $String$3 = global$8.String;
|
|
213
|
-
|
|
214
|
-
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
|
215
|
-
var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$8(function () {
|
|
216
|
-
var symbol = Symbol('symbol detection');
|
|
217
|
-
// Chrome 38 Symbol has incorrect toString conversion
|
|
218
|
-
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
219
|
-
// nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
|
|
220
|
-
// of course, fail.
|
|
221
|
-
return !$String$3(symbol) || !(Object(symbol) instanceof Symbol) ||
|
|
222
|
-
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
|
223
|
-
!Symbol.sham && V8_VERSION && V8_VERSION < 41;
|
|
224
|
-
});
|
|
225
|
-
|
|
226
|
-
/* eslint-disable es/no-symbol -- required for testing */
|
|
227
|
-
var NATIVE_SYMBOL$1 = symbolConstructorDetection;
|
|
228
|
-
|
|
229
|
-
var useSymbolAsUid = NATIVE_SYMBOL$1
|
|
230
|
-
&& !Symbol.sham
|
|
231
|
-
&& typeof Symbol.iterator == 'symbol';
|
|
232
|
-
|
|
233
|
-
var getBuiltIn$2 = getBuiltIn$3;
|
|
234
|
-
var isCallable$b = isCallable$e;
|
|
235
|
-
var isPrototypeOf$2 = objectIsPrototypeOf;
|
|
236
|
-
var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
|
|
237
|
-
|
|
238
|
-
var $Object$3 = Object;
|
|
239
|
-
|
|
240
|
-
var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
|
|
241
|
-
return typeof it == 'symbol';
|
|
242
|
-
} : function (it) {
|
|
243
|
-
var $Symbol = getBuiltIn$2('Symbol');
|
|
244
|
-
return isCallable$b($Symbol) && isPrototypeOf$2($Symbol.prototype, $Object$3(it));
|
|
245
|
-
};
|
|
246
|
-
|
|
247
|
-
var $String$2 = String;
|
|
248
|
-
|
|
249
|
-
var tryToString$3 = function (argument) {
|
|
250
|
-
try {
|
|
251
|
-
return $String$2(argument);
|
|
252
|
-
} catch (error) {
|
|
253
|
-
return 'Object';
|
|
254
|
-
}
|
|
255
|
-
};
|
|
256
|
-
|
|
257
|
-
var isCallable$a = isCallable$e;
|
|
258
|
-
var tryToString$2 = tryToString$3;
|
|
259
|
-
|
|
260
|
-
var $TypeError$a = TypeError;
|
|
261
|
-
|
|
262
|
-
// `Assert: IsCallable(argument) is true`
|
|
263
|
-
var aCallable$7 = function (argument) {
|
|
264
|
-
if (isCallable$a(argument)) return argument;
|
|
265
|
-
throw new $TypeError$a(tryToString$2(argument) + ' is not a function');
|
|
266
|
-
};
|
|
267
|
-
|
|
268
|
-
var aCallable$6 = aCallable$7;
|
|
269
|
-
var isNullOrUndefined$1 = isNullOrUndefined$3;
|
|
270
|
-
|
|
271
|
-
// `GetMethod` abstract operation
|
|
272
|
-
// https://tc39.es/ecma262/#sec-getmethod
|
|
273
|
-
var getMethod$4 = function (V, P) {
|
|
274
|
-
var func = V[P];
|
|
275
|
-
return isNullOrUndefined$1(func) ? undefined : aCallable$6(func);
|
|
276
|
-
};
|
|
277
|
-
|
|
278
|
-
var call$8 = functionCall;
|
|
279
|
-
var isCallable$9 = isCallable$e;
|
|
280
|
-
var isObject$5 = isObject$6;
|
|
281
|
-
|
|
282
|
-
var $TypeError$9 = TypeError;
|
|
283
|
-
|
|
284
|
-
// `OrdinaryToPrimitive` abstract operation
|
|
285
|
-
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
|
|
286
|
-
var ordinaryToPrimitive$1 = function (input, pref) {
|
|
287
|
-
var fn, val;
|
|
288
|
-
if (pref === 'string' && isCallable$9(fn = input.toString) && !isObject$5(val = call$8(fn, input))) return val;
|
|
289
|
-
if (isCallable$9(fn = input.valueOf) && !isObject$5(val = call$8(fn, input))) return val;
|
|
290
|
-
if (pref !== 'string' && isCallable$9(fn = input.toString) && !isObject$5(val = call$8(fn, input))) return val;
|
|
291
|
-
throw new $TypeError$9("Can't convert object to primitive value");
|
|
292
|
-
};
|
|
293
|
-
|
|
294
|
-
var sharedStore = {exports: {}};
|
|
295
|
-
|
|
296
|
-
var isPure = false;
|
|
297
|
-
|
|
298
|
-
var global$7 = global$b;
|
|
299
|
-
|
|
300
|
-
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
301
|
-
var defineProperty$2 = Object.defineProperty;
|
|
302
|
-
|
|
303
|
-
var defineGlobalProperty$3 = function (key, value) {
|
|
304
|
-
try {
|
|
305
|
-
defineProperty$2(global$7, key, { value: value, configurable: true, writable: true });
|
|
306
|
-
} catch (error) {
|
|
307
|
-
global$7[key] = value;
|
|
308
|
-
} return value;
|
|
309
|
-
};
|
|
310
|
-
|
|
311
|
-
var globalThis$1 = global$b;
|
|
312
|
-
var defineGlobalProperty$2 = defineGlobalProperty$3;
|
|
313
|
-
|
|
314
|
-
var SHARED = '__core-js_shared__';
|
|
315
|
-
var store$3 = sharedStore.exports = globalThis$1[SHARED] || defineGlobalProperty$2(SHARED, {});
|
|
316
|
-
|
|
317
|
-
(store$3.versions || (store$3.versions = [])).push({
|
|
318
|
-
version: '3.36.1',
|
|
319
|
-
mode: 'global',
|
|
320
|
-
copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
|
|
321
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.36.1/LICENSE',
|
|
322
|
-
source: 'https://github.com/zloirock/core-js'
|
|
323
|
-
});
|
|
324
|
-
|
|
325
|
-
var sharedStoreExports = sharedStore.exports;
|
|
326
|
-
|
|
327
|
-
var store$2 = sharedStoreExports;
|
|
328
|
-
|
|
329
|
-
var shared$3 = function (key, value) {
|
|
330
|
-
return store$2[key] || (store$2[key] = value || {});
|
|
331
|
-
};
|
|
332
|
-
|
|
333
|
-
var requireObjectCoercible = requireObjectCoercible$2;
|
|
334
|
-
|
|
335
|
-
var $Object$2 = Object;
|
|
336
|
-
|
|
337
|
-
// `ToObject` abstract operation
|
|
338
|
-
// https://tc39.es/ecma262/#sec-toobject
|
|
339
|
-
var toObject$3 = function (argument) {
|
|
340
|
-
return $Object$2(requireObjectCoercible(argument));
|
|
341
|
-
};
|
|
342
|
-
|
|
343
|
-
var uncurryThis$7 = functionUncurryThis;
|
|
344
|
-
var toObject$2 = toObject$3;
|
|
345
|
-
|
|
346
|
-
var hasOwnProperty = uncurryThis$7({}.hasOwnProperty);
|
|
347
|
-
|
|
348
|
-
// `HasOwnProperty` abstract operation
|
|
349
|
-
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
350
|
-
// eslint-disable-next-line es/no-object-hasown -- safe
|
|
351
|
-
var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
352
|
-
return hasOwnProperty(toObject$2(it), key);
|
|
353
|
-
};
|
|
354
|
-
|
|
355
|
-
var uncurryThis$6 = functionUncurryThis;
|
|
356
|
-
|
|
357
|
-
var id = 0;
|
|
358
|
-
var postfix = Math.random();
|
|
359
|
-
var toString = uncurryThis$6(1.0.toString);
|
|
360
|
-
|
|
361
|
-
var uid$2 = function (key) {
|
|
362
|
-
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
|
|
363
|
-
};
|
|
364
|
-
|
|
365
|
-
var global$6 = global$b;
|
|
366
|
-
var shared$2 = shared$3;
|
|
367
|
-
var hasOwn$8 = hasOwnProperty_1;
|
|
368
|
-
var uid$1 = uid$2;
|
|
369
|
-
var NATIVE_SYMBOL = symbolConstructorDetection;
|
|
370
|
-
var USE_SYMBOL_AS_UID = useSymbolAsUid;
|
|
371
|
-
|
|
372
|
-
var Symbol$1 = global$6.Symbol;
|
|
373
|
-
var WellKnownSymbolsStore = shared$2('wks');
|
|
374
|
-
var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1['for'] || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
|
|
375
|
-
|
|
376
|
-
var wellKnownSymbol$8 = function (name) {
|
|
377
|
-
if (!hasOwn$8(WellKnownSymbolsStore, name)) {
|
|
378
|
-
WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn$8(Symbol$1, name)
|
|
379
|
-
? Symbol$1[name]
|
|
380
|
-
: createWellKnownSymbol('Symbol.' + name);
|
|
381
|
-
} return WellKnownSymbolsStore[name];
|
|
382
|
-
};
|
|
383
|
-
|
|
384
|
-
var call$7 = functionCall;
|
|
385
|
-
var isObject$4 = isObject$6;
|
|
386
|
-
var isSymbol$1 = isSymbol$2;
|
|
387
|
-
var getMethod$3 = getMethod$4;
|
|
388
|
-
var ordinaryToPrimitive = ordinaryToPrimitive$1;
|
|
389
|
-
var wellKnownSymbol$7 = wellKnownSymbol$8;
|
|
390
|
-
|
|
391
|
-
var $TypeError$8 = TypeError;
|
|
392
|
-
var TO_PRIMITIVE = wellKnownSymbol$7('toPrimitive');
|
|
393
|
-
|
|
394
|
-
// `ToPrimitive` abstract operation
|
|
395
|
-
// https://tc39.es/ecma262/#sec-toprimitive
|
|
396
|
-
var toPrimitive$1 = function (input, pref) {
|
|
397
|
-
if (!isObject$4(input) || isSymbol$1(input)) return input;
|
|
398
|
-
var exoticToPrim = getMethod$3(input, TO_PRIMITIVE);
|
|
399
|
-
var result;
|
|
400
|
-
if (exoticToPrim) {
|
|
401
|
-
if (pref === undefined) pref = 'default';
|
|
402
|
-
result = call$7(exoticToPrim, input, pref);
|
|
403
|
-
if (!isObject$4(result) || isSymbol$1(result)) return result;
|
|
404
|
-
throw new $TypeError$8("Can't convert object to primitive value");
|
|
405
|
-
}
|
|
406
|
-
if (pref === undefined) pref = 'number';
|
|
407
|
-
return ordinaryToPrimitive(input, pref);
|
|
408
|
-
};
|
|
409
|
-
|
|
410
|
-
var toPrimitive = toPrimitive$1;
|
|
411
|
-
var isSymbol = isSymbol$2;
|
|
412
|
-
|
|
413
|
-
// `ToPropertyKey` abstract operation
|
|
414
|
-
// https://tc39.es/ecma262/#sec-topropertykey
|
|
415
|
-
var toPropertyKey$2 = function (argument) {
|
|
416
|
-
var key = toPrimitive(argument, 'string');
|
|
417
|
-
return isSymbol(key) ? key : key + '';
|
|
418
|
-
};
|
|
419
|
-
|
|
420
|
-
var global$5 = global$b;
|
|
421
|
-
var isObject$3 = isObject$6;
|
|
422
|
-
|
|
423
|
-
var document$1 = global$5.document;
|
|
424
|
-
// typeof document.createElement is 'object' in old IE
|
|
425
|
-
var EXISTS$1 = isObject$3(document$1) && isObject$3(document$1.createElement);
|
|
426
|
-
|
|
427
|
-
var documentCreateElement$1 = function (it) {
|
|
428
|
-
return EXISTS$1 ? document$1.createElement(it) : {};
|
|
429
|
-
};
|
|
430
|
-
|
|
431
|
-
var DESCRIPTORS$a = descriptors;
|
|
432
|
-
var fails$7 = fails$c;
|
|
433
|
-
var createElement = documentCreateElement$1;
|
|
434
|
-
|
|
435
|
-
// Thanks to IE8 for its funny defineProperty
|
|
436
|
-
var ie8DomDefine = !DESCRIPTORS$a && !fails$7(function () {
|
|
437
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
438
|
-
return Object.defineProperty(createElement('div'), 'a', {
|
|
439
|
-
get: function () { return 7; }
|
|
440
|
-
}).a !== 7;
|
|
441
|
-
});
|
|
442
|
-
|
|
443
|
-
var DESCRIPTORS$9 = descriptors;
|
|
444
|
-
var call$6 = functionCall;
|
|
445
|
-
var propertyIsEnumerableModule = objectPropertyIsEnumerable;
|
|
446
|
-
var createPropertyDescriptor$2 = createPropertyDescriptor$3;
|
|
447
|
-
var toIndexedObject$3 = toIndexedObject$4;
|
|
448
|
-
var toPropertyKey$1 = toPropertyKey$2;
|
|
449
|
-
var hasOwn$7 = hasOwnProperty_1;
|
|
450
|
-
var IE8_DOM_DEFINE$1 = ie8DomDefine;
|
|
451
|
-
|
|
452
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
453
|
-
var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
454
|
-
|
|
455
|
-
// `Object.getOwnPropertyDescriptor` method
|
|
456
|
-
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
|
|
457
|
-
objectGetOwnPropertyDescriptor.f = DESCRIPTORS$9 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
|
|
458
|
-
O = toIndexedObject$3(O);
|
|
459
|
-
P = toPropertyKey$1(P);
|
|
460
|
-
if (IE8_DOM_DEFINE$1) try {
|
|
461
|
-
return $getOwnPropertyDescriptor$1(O, P);
|
|
462
|
-
} catch (error) { /* empty */ }
|
|
463
|
-
if (hasOwn$7(O, P)) return createPropertyDescriptor$2(!call$6(propertyIsEnumerableModule.f, O, P), O[P]);
|
|
464
|
-
};
|
|
465
|
-
|
|
466
|
-
var objectDefineProperty = {};
|
|
467
|
-
|
|
468
|
-
var DESCRIPTORS$8 = descriptors;
|
|
469
|
-
var fails$6 = fails$c;
|
|
470
|
-
|
|
471
|
-
// V8 ~ Chrome 36-
|
|
472
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
|
|
473
|
-
var v8PrototypeDefineBug = DESCRIPTORS$8 && fails$6(function () {
|
|
474
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
475
|
-
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
|
|
476
|
-
value: 42,
|
|
477
|
-
writable: false
|
|
478
|
-
}).prototype !== 42;
|
|
479
|
-
});
|
|
480
|
-
|
|
481
|
-
var isObject$2 = isObject$6;
|
|
482
|
-
|
|
483
|
-
var $String$1 = String;
|
|
484
|
-
var $TypeError$7 = TypeError;
|
|
485
|
-
|
|
486
|
-
// `Assert: Type(argument) is Object`
|
|
487
|
-
var anObject$d = function (argument) {
|
|
488
|
-
if (isObject$2(argument)) return argument;
|
|
489
|
-
throw new $TypeError$7($String$1(argument) + ' is not an object');
|
|
490
|
-
};
|
|
491
|
-
|
|
492
|
-
var DESCRIPTORS$7 = descriptors;
|
|
493
|
-
var IE8_DOM_DEFINE = ie8DomDefine;
|
|
494
|
-
var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
|
|
495
|
-
var anObject$c = anObject$d;
|
|
496
|
-
var toPropertyKey = toPropertyKey$2;
|
|
497
|
-
|
|
498
|
-
var $TypeError$6 = TypeError;
|
|
499
|
-
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
500
|
-
var $defineProperty = Object.defineProperty;
|
|
501
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
502
|
-
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
503
|
-
var ENUMERABLE = 'enumerable';
|
|
504
|
-
var CONFIGURABLE$1 = 'configurable';
|
|
505
|
-
var WRITABLE = 'writable';
|
|
506
|
-
|
|
507
|
-
// `Object.defineProperty` method
|
|
508
|
-
// https://tc39.es/ecma262/#sec-object.defineproperty
|
|
509
|
-
objectDefineProperty.f = DESCRIPTORS$7 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
|
|
510
|
-
anObject$c(O);
|
|
511
|
-
P = toPropertyKey(P);
|
|
512
|
-
anObject$c(Attributes);
|
|
513
|
-
if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
|
|
514
|
-
var current = $getOwnPropertyDescriptor(O, P);
|
|
515
|
-
if (current && current[WRITABLE]) {
|
|
516
|
-
O[P] = Attributes.value;
|
|
517
|
-
Attributes = {
|
|
518
|
-
configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
|
|
519
|
-
enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
|
|
520
|
-
writable: false
|
|
521
|
-
};
|
|
522
|
-
}
|
|
523
|
-
} return $defineProperty(O, P, Attributes);
|
|
524
|
-
} : $defineProperty : function defineProperty(O, P, Attributes) {
|
|
525
|
-
anObject$c(O);
|
|
526
|
-
P = toPropertyKey(P);
|
|
527
|
-
anObject$c(Attributes);
|
|
528
|
-
if (IE8_DOM_DEFINE) try {
|
|
529
|
-
return $defineProperty(O, P, Attributes);
|
|
530
|
-
} catch (error) { /* empty */ }
|
|
531
|
-
if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$6('Accessors not supported');
|
|
532
|
-
if ('value' in Attributes) O[P] = Attributes.value;
|
|
533
|
-
return O;
|
|
534
|
-
};
|
|
535
|
-
|
|
536
|
-
var DESCRIPTORS$6 = descriptors;
|
|
537
|
-
var definePropertyModule$4 = objectDefineProperty;
|
|
538
|
-
var createPropertyDescriptor$1 = createPropertyDescriptor$3;
|
|
539
|
-
|
|
540
|
-
var createNonEnumerableProperty$3 = DESCRIPTORS$6 ? function (object, key, value) {
|
|
541
|
-
return definePropertyModule$4.f(object, key, createPropertyDescriptor$1(1, value));
|
|
542
|
-
} : function (object, key, value) {
|
|
543
|
-
object[key] = value;
|
|
544
|
-
return object;
|
|
545
|
-
};
|
|
546
|
-
|
|
547
|
-
var makeBuiltIn$3 = {exports: {}};
|
|
548
|
-
|
|
549
|
-
var DESCRIPTORS$5 = descriptors;
|
|
550
|
-
var hasOwn$6 = hasOwnProperty_1;
|
|
551
|
-
|
|
552
|
-
var FunctionPrototype = Function.prototype;
|
|
553
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
554
|
-
var getDescriptor = DESCRIPTORS$5 && Object.getOwnPropertyDescriptor;
|
|
555
|
-
|
|
556
|
-
var EXISTS = hasOwn$6(FunctionPrototype, 'name');
|
|
557
|
-
// additional protection from minified / mangled / dropped function names
|
|
558
|
-
var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
|
|
559
|
-
var CONFIGURABLE = EXISTS && (!DESCRIPTORS$5 || (DESCRIPTORS$5 && getDescriptor(FunctionPrototype, 'name').configurable));
|
|
560
|
-
|
|
561
|
-
var functionName = {
|
|
562
|
-
EXISTS: EXISTS,
|
|
563
|
-
PROPER: PROPER,
|
|
564
|
-
CONFIGURABLE: CONFIGURABLE
|
|
565
|
-
};
|
|
566
|
-
|
|
567
|
-
var uncurryThis$5 = functionUncurryThis;
|
|
568
|
-
var isCallable$8 = isCallable$e;
|
|
569
|
-
var store$1 = sharedStoreExports;
|
|
570
|
-
|
|
571
|
-
var functionToString = uncurryThis$5(Function.toString);
|
|
572
|
-
|
|
573
|
-
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
|
574
|
-
if (!isCallable$8(store$1.inspectSource)) {
|
|
575
|
-
store$1.inspectSource = function (it) {
|
|
576
|
-
return functionToString(it);
|
|
577
|
-
};
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
var inspectSource$1 = store$1.inspectSource;
|
|
581
|
-
|
|
582
|
-
var global$4 = global$b;
|
|
583
|
-
var isCallable$7 = isCallable$e;
|
|
584
|
-
|
|
585
|
-
var WeakMap$1 = global$4.WeakMap;
|
|
586
|
-
|
|
587
|
-
var weakMapBasicDetection = isCallable$7(WeakMap$1) && /native code/.test(String(WeakMap$1));
|
|
588
|
-
|
|
589
|
-
var shared$1 = shared$3;
|
|
590
|
-
var uid = uid$2;
|
|
591
|
-
|
|
592
|
-
var keys = shared$1('keys');
|
|
593
|
-
|
|
594
|
-
var sharedKey$3 = function (key) {
|
|
595
|
-
return keys[key] || (keys[key] = uid(key));
|
|
596
|
-
};
|
|
597
|
-
|
|
598
|
-
var hiddenKeys$4 = {};
|
|
599
|
-
|
|
600
|
-
var NATIVE_WEAK_MAP = weakMapBasicDetection;
|
|
601
|
-
var global$3 = global$b;
|
|
602
|
-
var isObject$1 = isObject$6;
|
|
603
|
-
var createNonEnumerableProperty$2 = createNonEnumerableProperty$3;
|
|
604
|
-
var hasOwn$5 = hasOwnProperty_1;
|
|
605
|
-
var shared = sharedStoreExports;
|
|
606
|
-
var sharedKey$2 = sharedKey$3;
|
|
607
|
-
var hiddenKeys$3 = hiddenKeys$4;
|
|
608
|
-
|
|
609
|
-
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
|
610
|
-
var TypeError$1 = global$3.TypeError;
|
|
611
|
-
var WeakMap = global$3.WeakMap;
|
|
612
|
-
var set, get, has;
|
|
613
|
-
|
|
614
|
-
var enforce = function (it) {
|
|
615
|
-
return has(it) ? get(it) : set(it, {});
|
|
616
|
-
};
|
|
617
|
-
|
|
618
|
-
var getterFor = function (TYPE) {
|
|
619
|
-
return function (it) {
|
|
620
|
-
var state;
|
|
621
|
-
if (!isObject$1(it) || (state = get(it)).type !== TYPE) {
|
|
622
|
-
throw new TypeError$1('Incompatible receiver, ' + TYPE + ' required');
|
|
623
|
-
} return state;
|
|
624
|
-
};
|
|
625
|
-
};
|
|
626
|
-
|
|
627
|
-
if (NATIVE_WEAK_MAP || shared.state) {
|
|
628
|
-
var store = shared.state || (shared.state = new WeakMap());
|
|
629
|
-
/* eslint-disable no-self-assign -- prototype methods protection */
|
|
630
|
-
store.get = store.get;
|
|
631
|
-
store.has = store.has;
|
|
632
|
-
store.set = store.set;
|
|
633
|
-
/* eslint-enable no-self-assign -- prototype methods protection */
|
|
634
|
-
set = function (it, metadata) {
|
|
635
|
-
if (store.has(it)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
|
636
|
-
metadata.facade = it;
|
|
637
|
-
store.set(it, metadata);
|
|
638
|
-
return metadata;
|
|
639
|
-
};
|
|
640
|
-
get = function (it) {
|
|
641
|
-
return store.get(it) || {};
|
|
642
|
-
};
|
|
643
|
-
has = function (it) {
|
|
644
|
-
return store.has(it);
|
|
645
|
-
};
|
|
646
|
-
} else {
|
|
647
|
-
var STATE = sharedKey$2('state');
|
|
648
|
-
hiddenKeys$3[STATE] = true;
|
|
649
|
-
set = function (it, metadata) {
|
|
650
|
-
if (hasOwn$5(it, STATE)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
|
651
|
-
metadata.facade = it;
|
|
652
|
-
createNonEnumerableProperty$2(it, STATE, metadata);
|
|
653
|
-
return metadata;
|
|
654
|
-
};
|
|
655
|
-
get = function (it) {
|
|
656
|
-
return hasOwn$5(it, STATE) ? it[STATE] : {};
|
|
657
|
-
};
|
|
658
|
-
has = function (it) {
|
|
659
|
-
return hasOwn$5(it, STATE);
|
|
660
|
-
};
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
var internalState = {
|
|
664
|
-
set: set,
|
|
665
|
-
get: get,
|
|
666
|
-
has: has,
|
|
667
|
-
enforce: enforce,
|
|
668
|
-
getterFor: getterFor
|
|
669
|
-
};
|
|
670
|
-
|
|
671
|
-
var uncurryThis$4 = functionUncurryThis;
|
|
672
|
-
var fails$5 = fails$c;
|
|
673
|
-
var isCallable$6 = isCallable$e;
|
|
674
|
-
var hasOwn$4 = hasOwnProperty_1;
|
|
675
|
-
var DESCRIPTORS$4 = descriptors;
|
|
676
|
-
var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
|
|
677
|
-
var inspectSource = inspectSource$1;
|
|
678
|
-
var InternalStateModule$1 = internalState;
|
|
679
|
-
|
|
680
|
-
var enforceInternalState = InternalStateModule$1.enforce;
|
|
681
|
-
var getInternalState = InternalStateModule$1.get;
|
|
682
|
-
var $String = String;
|
|
683
|
-
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
684
|
-
var defineProperty$1 = Object.defineProperty;
|
|
685
|
-
var stringSlice = uncurryThis$4(''.slice);
|
|
686
|
-
var replace = uncurryThis$4(''.replace);
|
|
687
|
-
var join = uncurryThis$4([].join);
|
|
688
|
-
|
|
689
|
-
var CONFIGURABLE_LENGTH = DESCRIPTORS$4 && !fails$5(function () {
|
|
690
|
-
return defineProperty$1(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
|
|
691
|
-
});
|
|
692
|
-
|
|
693
|
-
var TEMPLATE = String(String).split('String');
|
|
694
|
-
|
|
695
|
-
var makeBuiltIn$2 = makeBuiltIn$3.exports = function (value, name, options) {
|
|
696
|
-
if (stringSlice($String(name), 0, 7) === 'Symbol(') {
|
|
697
|
-
name = '[' + replace($String(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
|
|
698
|
-
}
|
|
699
|
-
if (options && options.getter) name = 'get ' + name;
|
|
700
|
-
if (options && options.setter) name = 'set ' + name;
|
|
701
|
-
if (!hasOwn$4(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
|
|
702
|
-
if (DESCRIPTORS$4) defineProperty$1(value, 'name', { value: name, configurable: true });
|
|
703
|
-
else value.name = name;
|
|
704
|
-
}
|
|
705
|
-
if (CONFIGURABLE_LENGTH && options && hasOwn$4(options, 'arity') && value.length !== options.arity) {
|
|
706
|
-
defineProperty$1(value, 'length', { value: options.arity });
|
|
707
|
-
}
|
|
708
|
-
try {
|
|
709
|
-
if (options && hasOwn$4(options, 'constructor') && options.constructor) {
|
|
710
|
-
if (DESCRIPTORS$4) defineProperty$1(value, 'prototype', { writable: false });
|
|
711
|
-
// in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
|
|
712
|
-
} else if (value.prototype) value.prototype = undefined;
|
|
713
|
-
} catch (error) { /* empty */ }
|
|
714
|
-
var state = enforceInternalState(value);
|
|
715
|
-
if (!hasOwn$4(state, 'source')) {
|
|
716
|
-
state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
|
|
717
|
-
} return value;
|
|
718
|
-
};
|
|
719
|
-
|
|
720
|
-
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
|
721
|
-
// eslint-disable-next-line no-extend-native -- required
|
|
722
|
-
Function.prototype.toString = makeBuiltIn$2(function toString() {
|
|
723
|
-
return isCallable$6(this) && getInternalState(this).source || inspectSource(this);
|
|
724
|
-
}, 'toString');
|
|
725
|
-
|
|
726
|
-
var makeBuiltInExports = makeBuiltIn$3.exports;
|
|
727
|
-
|
|
728
|
-
var isCallable$5 = isCallable$e;
|
|
729
|
-
var definePropertyModule$3 = objectDefineProperty;
|
|
730
|
-
var makeBuiltIn$1 = makeBuiltInExports;
|
|
731
|
-
var defineGlobalProperty$1 = defineGlobalProperty$3;
|
|
732
|
-
|
|
733
|
-
var defineBuiltIn$3 = function (O, key, value, options) {
|
|
734
|
-
if (!options) options = {};
|
|
735
|
-
var simple = options.enumerable;
|
|
736
|
-
var name = options.name !== undefined ? options.name : key;
|
|
737
|
-
if (isCallable$5(value)) makeBuiltIn$1(value, name, options);
|
|
738
|
-
if (options.global) {
|
|
739
|
-
if (simple) O[key] = value;
|
|
740
|
-
else defineGlobalProperty$1(key, value);
|
|
741
|
-
} else {
|
|
742
|
-
try {
|
|
743
|
-
if (!options.unsafe) delete O[key];
|
|
744
|
-
else if (O[key]) simple = true;
|
|
745
|
-
} catch (error) { /* empty */ }
|
|
746
|
-
if (simple) O[key] = value;
|
|
747
|
-
else definePropertyModule$3.f(O, key, {
|
|
748
|
-
value: value,
|
|
749
|
-
enumerable: false,
|
|
750
|
-
configurable: !options.nonConfigurable,
|
|
751
|
-
writable: !options.nonWritable
|
|
752
|
-
});
|
|
753
|
-
} return O;
|
|
754
|
-
};
|
|
755
|
-
|
|
756
|
-
var objectGetOwnPropertyNames = {};
|
|
757
|
-
|
|
758
|
-
var ceil = Math.ceil;
|
|
759
|
-
var floor = Math.floor;
|
|
760
|
-
|
|
761
|
-
// `Math.trunc` method
|
|
762
|
-
// https://tc39.es/ecma262/#sec-math.trunc
|
|
763
|
-
// eslint-disable-next-line es/no-math-trunc -- safe
|
|
764
|
-
var mathTrunc = Math.trunc || function trunc(x) {
|
|
765
|
-
var n = +x;
|
|
766
|
-
return (n > 0 ? floor : ceil)(n);
|
|
767
|
-
};
|
|
768
|
-
|
|
769
|
-
var trunc = mathTrunc;
|
|
770
|
-
|
|
771
|
-
// `ToIntegerOrInfinity` abstract operation
|
|
772
|
-
// https://tc39.es/ecma262/#sec-tointegerorinfinity
|
|
773
|
-
var toIntegerOrInfinity$2 = function (argument) {
|
|
774
|
-
var number = +argument;
|
|
775
|
-
// eslint-disable-next-line no-self-compare -- NaN check
|
|
776
|
-
return number !== number || number === 0 ? 0 : trunc(number);
|
|
777
|
-
};
|
|
778
|
-
|
|
779
|
-
var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
|
|
780
|
-
|
|
781
|
-
var max = Math.max;
|
|
782
|
-
var min$1 = Math.min;
|
|
783
|
-
|
|
784
|
-
// Helper for a popular repeating case of the spec:
|
|
785
|
-
// Let integer be ? ToInteger(index).
|
|
786
|
-
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
|
|
787
|
-
var toAbsoluteIndex$1 = function (index, length) {
|
|
788
|
-
var integer = toIntegerOrInfinity$1(index);
|
|
789
|
-
return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
|
|
790
|
-
};
|
|
791
|
-
|
|
792
|
-
var toIntegerOrInfinity = toIntegerOrInfinity$2;
|
|
793
|
-
|
|
794
|
-
var min = Math.min;
|
|
795
|
-
|
|
796
|
-
// `ToLength` abstract operation
|
|
797
|
-
// https://tc39.es/ecma262/#sec-tolength
|
|
798
|
-
var toLength$1 = function (argument) {
|
|
799
|
-
var len = toIntegerOrInfinity(argument);
|
|
800
|
-
return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
801
|
-
};
|
|
802
|
-
|
|
803
|
-
var toLength = toLength$1;
|
|
804
|
-
|
|
805
|
-
// `LengthOfArrayLike` abstract operation
|
|
806
|
-
// https://tc39.es/ecma262/#sec-lengthofarraylike
|
|
807
|
-
var lengthOfArrayLike$3 = function (obj) {
|
|
808
|
-
return toLength(obj.length);
|
|
809
|
-
};
|
|
810
|
-
|
|
811
|
-
var toIndexedObject$2 = toIndexedObject$4;
|
|
812
|
-
var toAbsoluteIndex = toAbsoluteIndex$1;
|
|
813
|
-
var lengthOfArrayLike$2 = lengthOfArrayLike$3;
|
|
814
|
-
|
|
815
|
-
// `Array.prototype.{ indexOf, includes }` methods implementation
|
|
816
|
-
var createMethod = function (IS_INCLUDES) {
|
|
817
|
-
return function ($this, el, fromIndex) {
|
|
818
|
-
var O = toIndexedObject$2($this);
|
|
819
|
-
var length = lengthOfArrayLike$2(O);
|
|
820
|
-
if (length === 0) return !IS_INCLUDES && -1;
|
|
821
|
-
var index = toAbsoluteIndex(fromIndex, length);
|
|
822
|
-
var value;
|
|
823
|
-
// Array#includes uses SameValueZero equality algorithm
|
|
824
|
-
// eslint-disable-next-line no-self-compare -- NaN check
|
|
825
|
-
if (IS_INCLUDES && el !== el) while (length > index) {
|
|
826
|
-
value = O[index++];
|
|
827
|
-
// eslint-disable-next-line no-self-compare -- NaN check
|
|
828
|
-
if (value !== value) return true;
|
|
829
|
-
// Array#indexOf ignores holes, Array#includes - not
|
|
830
|
-
} else for (;length > index; index++) {
|
|
831
|
-
if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
|
832
|
-
} return !IS_INCLUDES && -1;
|
|
833
|
-
};
|
|
834
|
-
};
|
|
835
|
-
|
|
836
|
-
var arrayIncludes = {
|
|
837
|
-
// `Array.prototype.includes` method
|
|
838
|
-
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
839
|
-
includes: createMethod(true),
|
|
840
|
-
// `Array.prototype.indexOf` method
|
|
841
|
-
// https://tc39.es/ecma262/#sec-array.prototype.indexof
|
|
842
|
-
indexOf: createMethod(false)
|
|
843
|
-
};
|
|
844
|
-
|
|
845
|
-
var uncurryThis$3 = functionUncurryThis;
|
|
846
|
-
var hasOwn$3 = hasOwnProperty_1;
|
|
847
|
-
var toIndexedObject$1 = toIndexedObject$4;
|
|
848
|
-
var indexOf = arrayIncludes.indexOf;
|
|
849
|
-
var hiddenKeys$2 = hiddenKeys$4;
|
|
850
|
-
|
|
851
|
-
var push = uncurryThis$3([].push);
|
|
852
|
-
|
|
853
|
-
var objectKeysInternal = function (object, names) {
|
|
854
|
-
var O = toIndexedObject$1(object);
|
|
855
|
-
var i = 0;
|
|
856
|
-
var result = [];
|
|
857
|
-
var key;
|
|
858
|
-
for (key in O) !hasOwn$3(hiddenKeys$2, key) && hasOwn$3(O, key) && push(result, key);
|
|
859
|
-
// Don't enum bug & hidden keys
|
|
860
|
-
while (names.length > i) if (hasOwn$3(O, key = names[i++])) {
|
|
861
|
-
~indexOf(result, key) || push(result, key);
|
|
862
|
-
}
|
|
863
|
-
return result;
|
|
864
|
-
};
|
|
865
|
-
|
|
866
|
-
// IE8- don't enum bug keys
|
|
867
|
-
var enumBugKeys$3 = [
|
|
868
|
-
'constructor',
|
|
869
|
-
'hasOwnProperty',
|
|
870
|
-
'isPrototypeOf',
|
|
871
|
-
'propertyIsEnumerable',
|
|
872
|
-
'toLocaleString',
|
|
873
|
-
'toString',
|
|
874
|
-
'valueOf'
|
|
875
|
-
];
|
|
876
|
-
|
|
877
|
-
var internalObjectKeys$1 = objectKeysInternal;
|
|
878
|
-
var enumBugKeys$2 = enumBugKeys$3;
|
|
879
|
-
|
|
880
|
-
var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
|
|
881
|
-
|
|
882
|
-
// `Object.getOwnPropertyNames` method
|
|
883
|
-
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
|
884
|
-
// eslint-disable-next-line es/no-object-getownpropertynames -- safe
|
|
885
|
-
objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
|
886
|
-
return internalObjectKeys$1(O, hiddenKeys$1);
|
|
887
|
-
};
|
|
888
|
-
|
|
889
|
-
var objectGetOwnPropertySymbols = {};
|
|
890
|
-
|
|
891
|
-
// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
|
|
892
|
-
objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
|
|
893
|
-
|
|
894
|
-
var getBuiltIn$1 = getBuiltIn$3;
|
|
895
|
-
var uncurryThis$2 = functionUncurryThis;
|
|
896
|
-
var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
|
|
897
|
-
var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
|
|
898
|
-
var anObject$b = anObject$d;
|
|
899
|
-
|
|
900
|
-
var concat = uncurryThis$2([].concat);
|
|
901
|
-
|
|
902
|
-
// all object keys, includes non-enumerable and symbols
|
|
903
|
-
var ownKeys$1 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
904
|
-
var keys = getOwnPropertyNamesModule.f(anObject$b(it));
|
|
905
|
-
var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
|
|
906
|
-
return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
|
|
907
|
-
};
|
|
908
|
-
|
|
909
|
-
var hasOwn$2 = hasOwnProperty_1;
|
|
910
|
-
var ownKeys = ownKeys$1;
|
|
911
|
-
var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
|
|
912
|
-
var definePropertyModule$2 = objectDefineProperty;
|
|
913
|
-
|
|
914
|
-
var copyConstructorProperties$1 = function (target, source, exceptions) {
|
|
915
|
-
var keys = ownKeys(source);
|
|
916
|
-
var defineProperty = definePropertyModule$2.f;
|
|
917
|
-
var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
|
918
|
-
for (var i = 0; i < keys.length; i++) {
|
|
919
|
-
var key = keys[i];
|
|
920
|
-
if (!hasOwn$2(target, key) && !(exceptions && hasOwn$2(exceptions, key))) {
|
|
921
|
-
defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
|
922
|
-
}
|
|
923
|
-
}
|
|
924
|
-
};
|
|
925
|
-
|
|
926
|
-
var fails$4 = fails$c;
|
|
927
|
-
var isCallable$4 = isCallable$e;
|
|
928
|
-
|
|
929
|
-
var replacement = /#|\.prototype\./;
|
|
930
|
-
|
|
931
|
-
var isForced$1 = function (feature, detection) {
|
|
932
|
-
var value = data[normalize(feature)];
|
|
933
|
-
return value === POLYFILL ? true
|
|
934
|
-
: value === NATIVE ? false
|
|
935
|
-
: isCallable$4(detection) ? fails$4(detection)
|
|
936
|
-
: !!detection;
|
|
937
|
-
};
|
|
938
|
-
|
|
939
|
-
var normalize = isForced$1.normalize = function (string) {
|
|
940
|
-
return String(string).replace(replacement, '.').toLowerCase();
|
|
941
|
-
};
|
|
942
|
-
|
|
943
|
-
var data = isForced$1.data = {};
|
|
944
|
-
var NATIVE = isForced$1.NATIVE = 'N';
|
|
945
|
-
var POLYFILL = isForced$1.POLYFILL = 'P';
|
|
946
|
-
|
|
947
|
-
var isForced_1 = isForced$1;
|
|
948
|
-
|
|
949
|
-
var global$2 = global$b;
|
|
950
|
-
var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
|
|
951
|
-
var createNonEnumerableProperty$1 = createNonEnumerableProperty$3;
|
|
952
|
-
var defineBuiltIn$2 = defineBuiltIn$3;
|
|
953
|
-
var defineGlobalProperty = defineGlobalProperty$3;
|
|
954
|
-
var copyConstructorProperties = copyConstructorProperties$1;
|
|
955
|
-
var isForced = isForced_1;
|
|
956
|
-
|
|
957
|
-
/*
|
|
958
|
-
options.target - name of the target object
|
|
959
|
-
options.global - target is the global object
|
|
960
|
-
options.stat - export as static methods of target
|
|
961
|
-
options.proto - export as prototype methods of target
|
|
962
|
-
options.real - real prototype method for the `pure` version
|
|
963
|
-
options.forced - export even if the native feature is available
|
|
964
|
-
options.bind - bind methods to the target, required for the `pure` version
|
|
965
|
-
options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
|
|
966
|
-
options.unsafe - use the simple assignment of property instead of delete + defineProperty
|
|
967
|
-
options.sham - add a flag to not completely full polyfills
|
|
968
|
-
options.enumerable - export as enumerable property
|
|
969
|
-
options.dontCallGetSet - prevent calling a getter on target
|
|
970
|
-
options.name - the .name of the function if it does not match the key
|
|
971
|
-
*/
|
|
972
|
-
var _export = function (options, source) {
|
|
973
|
-
var TARGET = options.target;
|
|
974
|
-
var GLOBAL = options.global;
|
|
975
|
-
var STATIC = options.stat;
|
|
976
|
-
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
|
977
|
-
if (GLOBAL) {
|
|
978
|
-
target = global$2;
|
|
979
|
-
} else if (STATIC) {
|
|
980
|
-
target = global$2[TARGET] || defineGlobalProperty(TARGET, {});
|
|
981
|
-
} else {
|
|
982
|
-
target = global$2[TARGET] && global$2[TARGET].prototype;
|
|
983
|
-
}
|
|
984
|
-
if (target) for (key in source) {
|
|
985
|
-
sourceProperty = source[key];
|
|
986
|
-
if (options.dontCallGetSet) {
|
|
987
|
-
descriptor = getOwnPropertyDescriptor$1(target, key);
|
|
988
|
-
targetProperty = descriptor && descriptor.value;
|
|
989
|
-
} else targetProperty = target[key];
|
|
990
|
-
FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
|
991
|
-
// contained in target
|
|
992
|
-
if (!FORCED && targetProperty !== undefined) {
|
|
993
|
-
if (typeof sourceProperty == typeof targetProperty) continue;
|
|
994
|
-
copyConstructorProperties(sourceProperty, targetProperty);
|
|
995
|
-
}
|
|
996
|
-
// add a flag to not completely full polyfills
|
|
997
|
-
if (options.sham || (targetProperty && targetProperty.sham)) {
|
|
998
|
-
createNonEnumerableProperty$1(sourceProperty, 'sham', true);
|
|
999
|
-
}
|
|
1000
|
-
defineBuiltIn$2(target, key, sourceProperty, options);
|
|
1001
|
-
}
|
|
1002
|
-
};
|
|
1003
|
-
|
|
1004
|
-
var isPrototypeOf$1 = objectIsPrototypeOf;
|
|
1005
|
-
|
|
1006
|
-
var $TypeError$5 = TypeError;
|
|
1007
|
-
|
|
1008
|
-
var anInstance$1 = function (it, Prototype) {
|
|
1009
|
-
if (isPrototypeOf$1(Prototype, it)) return it;
|
|
1010
|
-
throw new $TypeError$5('Incorrect invocation');
|
|
1011
|
-
};
|
|
1012
|
-
|
|
1013
|
-
var fails$3 = fails$c;
|
|
1014
|
-
|
|
1015
|
-
var correctPrototypeGetter = !fails$3(function () {
|
|
1016
|
-
function F() { /* empty */ }
|
|
1017
|
-
F.prototype.constructor = null;
|
|
1018
|
-
// eslint-disable-next-line es/no-object-getprototypeof -- required for testing
|
|
1019
|
-
return Object.getPrototypeOf(new F()) !== F.prototype;
|
|
1020
|
-
});
|
|
1021
|
-
|
|
1022
|
-
var hasOwn$1 = hasOwnProperty_1;
|
|
1023
|
-
var isCallable$3 = isCallable$e;
|
|
1024
|
-
var toObject$1 = toObject$3;
|
|
1025
|
-
var sharedKey$1 = sharedKey$3;
|
|
1026
|
-
var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
|
|
1027
|
-
|
|
1028
|
-
var IE_PROTO$1 = sharedKey$1('IE_PROTO');
|
|
1029
|
-
var $Object$1 = Object;
|
|
1030
|
-
var ObjectPrototype = $Object$1.prototype;
|
|
1031
|
-
|
|
1032
|
-
// `Object.getPrototypeOf` method
|
|
1033
|
-
// https://tc39.es/ecma262/#sec-object.getprototypeof
|
|
1034
|
-
// eslint-disable-next-line es/no-object-getprototypeof -- safe
|
|
1035
|
-
var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object$1.getPrototypeOf : function (O) {
|
|
1036
|
-
var object = toObject$1(O);
|
|
1037
|
-
if (hasOwn$1(object, IE_PROTO$1)) return object[IE_PROTO$1];
|
|
1038
|
-
var constructor = object.constructor;
|
|
1039
|
-
if (isCallable$3(constructor) && object instanceof constructor) {
|
|
1040
|
-
return constructor.prototype;
|
|
1041
|
-
} return object instanceof $Object$1 ? ObjectPrototype : null;
|
|
1042
|
-
};
|
|
1043
|
-
|
|
1044
|
-
var makeBuiltIn = makeBuiltInExports;
|
|
1045
|
-
var defineProperty = objectDefineProperty;
|
|
1046
|
-
|
|
1047
|
-
var defineBuiltInAccessor$1 = function (target, name, descriptor) {
|
|
1048
|
-
if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true });
|
|
1049
|
-
if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true });
|
|
1050
|
-
return defineProperty.f(target, name, descriptor);
|
|
1051
|
-
};
|
|
1052
|
-
|
|
1053
|
-
var DESCRIPTORS$3 = descriptors;
|
|
1054
|
-
var definePropertyModule$1 = objectDefineProperty;
|
|
1055
|
-
var createPropertyDescriptor = createPropertyDescriptor$3;
|
|
1056
|
-
|
|
1057
|
-
var createProperty$1 = function (object, key, value) {
|
|
1058
|
-
if (DESCRIPTORS$3) definePropertyModule$1.f(object, key, createPropertyDescriptor(0, value));
|
|
1059
|
-
else object[key] = value;
|
|
1060
|
-
};
|
|
1061
|
-
|
|
1062
|
-
var objectDefineProperties = {};
|
|
1063
|
-
|
|
1064
|
-
var internalObjectKeys = objectKeysInternal;
|
|
1065
|
-
var enumBugKeys$1 = enumBugKeys$3;
|
|
1066
|
-
|
|
1067
|
-
// `Object.keys` method
|
|
1068
|
-
// https://tc39.es/ecma262/#sec-object.keys
|
|
1069
|
-
// eslint-disable-next-line es/no-object-keys -- safe
|
|
1070
|
-
var objectKeys$1 = Object.keys || function keys(O) {
|
|
1071
|
-
return internalObjectKeys(O, enumBugKeys$1);
|
|
1072
|
-
};
|
|
1073
|
-
|
|
1074
|
-
var DESCRIPTORS$2 = descriptors;
|
|
1075
|
-
var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
|
|
1076
|
-
var definePropertyModule = objectDefineProperty;
|
|
1077
|
-
var anObject$a = anObject$d;
|
|
1078
|
-
var toIndexedObject = toIndexedObject$4;
|
|
1079
|
-
var objectKeys = objectKeys$1;
|
|
1080
|
-
|
|
1081
|
-
// `Object.defineProperties` method
|
|
1082
|
-
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
1083
|
-
// eslint-disable-next-line es/no-object-defineproperties -- safe
|
|
1084
|
-
objectDefineProperties.f = DESCRIPTORS$2 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
1085
|
-
anObject$a(O);
|
|
1086
|
-
var props = toIndexedObject(Properties);
|
|
1087
|
-
var keys = objectKeys(Properties);
|
|
1088
|
-
var length = keys.length;
|
|
1089
|
-
var index = 0;
|
|
1090
|
-
var key;
|
|
1091
|
-
while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
|
|
1092
|
-
return O;
|
|
1093
|
-
};
|
|
1094
|
-
|
|
1095
|
-
var getBuiltIn = getBuiltIn$3;
|
|
1096
|
-
|
|
1097
|
-
var html$1 = getBuiltIn('document', 'documentElement');
|
|
1098
|
-
|
|
1099
|
-
/* global ActiveXObject -- old IE, WSH */
|
|
1100
|
-
var anObject$9 = anObject$d;
|
|
1101
|
-
var definePropertiesModule = objectDefineProperties;
|
|
1102
|
-
var enumBugKeys = enumBugKeys$3;
|
|
1103
|
-
var hiddenKeys = hiddenKeys$4;
|
|
1104
|
-
var html = html$1;
|
|
1105
|
-
var documentCreateElement = documentCreateElement$1;
|
|
1106
|
-
var sharedKey = sharedKey$3;
|
|
1107
|
-
|
|
1108
|
-
var GT = '>';
|
|
1109
|
-
var LT = '<';
|
|
1110
|
-
var PROTOTYPE = 'prototype';
|
|
1111
|
-
var SCRIPT = 'script';
|
|
1112
|
-
var IE_PROTO = sharedKey('IE_PROTO');
|
|
1113
|
-
|
|
1114
|
-
var EmptyConstructor = function () { /* empty */ };
|
|
1115
|
-
|
|
1116
|
-
var scriptTag = function (content) {
|
|
1117
|
-
return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
|
|
1118
|
-
};
|
|
1119
|
-
|
|
1120
|
-
// Create object with fake `null` prototype: use ActiveX Object with cleared prototype
|
|
1121
|
-
var NullProtoObjectViaActiveX = function (activeXDocument) {
|
|
1122
|
-
activeXDocument.write(scriptTag(''));
|
|
1123
|
-
activeXDocument.close();
|
|
1124
|
-
var temp = activeXDocument.parentWindow.Object;
|
|
1125
|
-
activeXDocument = null; // avoid memory leak
|
|
1126
|
-
return temp;
|
|
1127
|
-
};
|
|
1128
|
-
|
|
1129
|
-
// Create object with fake `null` prototype: use iframe Object with cleared prototype
|
|
1130
|
-
var NullProtoObjectViaIFrame = function () {
|
|
1131
|
-
// Thrash, waste and sodomy: IE GC bug
|
|
1132
|
-
var iframe = documentCreateElement('iframe');
|
|
1133
|
-
var JS = 'java' + SCRIPT + ':';
|
|
1134
|
-
var iframeDocument;
|
|
1135
|
-
iframe.style.display = 'none';
|
|
1136
|
-
html.appendChild(iframe);
|
|
1137
|
-
// https://github.com/zloirock/core-js/issues/475
|
|
1138
|
-
iframe.src = String(JS);
|
|
1139
|
-
iframeDocument = iframe.contentWindow.document;
|
|
1140
|
-
iframeDocument.open();
|
|
1141
|
-
iframeDocument.write(scriptTag('document.F=Object'));
|
|
1142
|
-
iframeDocument.close();
|
|
1143
|
-
return iframeDocument.F;
|
|
1144
|
-
};
|
|
1145
|
-
|
|
1146
|
-
// Check for document.domain and active x support
|
|
1147
|
-
// No need to use active x approach when document.domain is not set
|
|
1148
|
-
// see https://github.com/es-shims/es5-shim/issues/150
|
|
1149
|
-
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
|
|
1150
|
-
// avoid IE GC bug
|
|
1151
|
-
var activeXDocument;
|
|
1152
|
-
var NullProtoObject = function () {
|
|
1153
|
-
try {
|
|
1154
|
-
activeXDocument = new ActiveXObject('htmlfile');
|
|
1155
|
-
} catch (error) { /* ignore */ }
|
|
1156
|
-
NullProtoObject = typeof document != 'undefined'
|
|
1157
|
-
? document.domain && activeXDocument
|
|
1158
|
-
? NullProtoObjectViaActiveX(activeXDocument) // old IE
|
|
1159
|
-
: NullProtoObjectViaIFrame()
|
|
1160
|
-
: NullProtoObjectViaActiveX(activeXDocument); // WSH
|
|
1161
|
-
var length = enumBugKeys.length;
|
|
1162
|
-
while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
|
|
1163
|
-
return NullProtoObject();
|
|
1164
|
-
};
|
|
1165
|
-
|
|
1166
|
-
hiddenKeys[IE_PROTO] = true;
|
|
1167
|
-
|
|
1168
|
-
// `Object.create` method
|
|
1169
|
-
// https://tc39.es/ecma262/#sec-object.create
|
|
1170
|
-
// eslint-disable-next-line es/no-object-create -- safe
|
|
1171
|
-
var objectCreate = Object.create || function create(O, Properties) {
|
|
1172
|
-
var result;
|
|
1173
|
-
if (O !== null) {
|
|
1174
|
-
EmptyConstructor[PROTOTYPE] = anObject$9(O);
|
|
1175
|
-
result = new EmptyConstructor();
|
|
1176
|
-
EmptyConstructor[PROTOTYPE] = null;
|
|
1177
|
-
// add "__proto__" for Object.getPrototypeOf polyfill
|
|
1178
|
-
result[IE_PROTO] = O;
|
|
1179
|
-
} else result = NullProtoObject();
|
|
1180
|
-
return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
|
|
1181
|
-
};
|
|
1182
|
-
|
|
1183
|
-
var fails$2 = fails$c;
|
|
1184
|
-
var isCallable$2 = isCallable$e;
|
|
1185
|
-
var isObject = isObject$6;
|
|
1186
|
-
var getPrototypeOf$1 = objectGetPrototypeOf;
|
|
1187
|
-
var defineBuiltIn$1 = defineBuiltIn$3;
|
|
1188
|
-
var wellKnownSymbol$6 = wellKnownSymbol$8;
|
|
1189
|
-
|
|
1190
|
-
var ITERATOR$3 = wellKnownSymbol$6('iterator');
|
|
1191
|
-
var BUGGY_SAFARI_ITERATORS = false;
|
|
1192
|
-
|
|
1193
|
-
// `%IteratorPrototype%` object
|
|
1194
|
-
// https://tc39.es/ecma262/#sec-%iteratorprototype%-object
|
|
1195
|
-
var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
|
|
1196
|
-
|
|
1197
|
-
/* eslint-disable es/no-array-prototype-keys -- safe */
|
|
1198
|
-
if ([].keys) {
|
|
1199
|
-
arrayIterator = [].keys();
|
|
1200
|
-
// Safari 8 has buggy iterators w/o `next`
|
|
1201
|
-
if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
|
|
1202
|
-
else {
|
|
1203
|
-
PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
|
|
1204
|
-
if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
|
|
1205
|
-
}
|
|
1206
|
-
}
|
|
1207
|
-
|
|
1208
|
-
var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype$2) || fails$2(function () {
|
|
1209
|
-
var test = {};
|
|
1210
|
-
// FF44- legacy iterators case
|
|
1211
|
-
return IteratorPrototype$2[ITERATOR$3].call(test) !== test;
|
|
1212
|
-
});
|
|
1213
|
-
|
|
1214
|
-
if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
|
|
1215
|
-
|
|
1216
|
-
// `%IteratorPrototype%[@@iterator]()` method
|
|
1217
|
-
// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
|
|
1218
|
-
if (!isCallable$2(IteratorPrototype$2[ITERATOR$3])) {
|
|
1219
|
-
defineBuiltIn$1(IteratorPrototype$2, ITERATOR$3, function () {
|
|
1220
|
-
return this;
|
|
1221
|
-
});
|
|
1222
|
-
}
|
|
1223
|
-
|
|
1224
|
-
var iteratorsCore = {
|
|
1225
|
-
IteratorPrototype: IteratorPrototype$2,
|
|
1226
|
-
BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
|
|
1227
|
-
};
|
|
1228
|
-
|
|
1229
|
-
var $$5 = _export;
|
|
1230
|
-
var global$1 = global$b;
|
|
1231
|
-
var anInstance = anInstance$1;
|
|
1232
|
-
var anObject$8 = anObject$d;
|
|
1233
|
-
var isCallable$1 = isCallable$e;
|
|
1234
|
-
var getPrototypeOf = objectGetPrototypeOf;
|
|
1235
|
-
var defineBuiltInAccessor = defineBuiltInAccessor$1;
|
|
1236
|
-
var createProperty = createProperty$1;
|
|
1237
|
-
var fails$1 = fails$c;
|
|
1238
|
-
var hasOwn = hasOwnProperty_1;
|
|
1239
|
-
var wellKnownSymbol$5 = wellKnownSymbol$8;
|
|
1240
|
-
var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
|
|
1241
|
-
var DESCRIPTORS$1 = descriptors;
|
|
1242
|
-
|
|
1243
|
-
var CONSTRUCTOR = 'constructor';
|
|
1244
|
-
var ITERATOR$2 = 'Iterator';
|
|
1245
|
-
var TO_STRING_TAG$3 = wellKnownSymbol$5('toStringTag');
|
|
1246
|
-
|
|
1247
|
-
var $TypeError$4 = TypeError;
|
|
1248
|
-
var NativeIterator = global$1[ITERATOR$2];
|
|
1249
|
-
|
|
1250
|
-
// FF56- have non-standard global helper `Iterator`
|
|
1251
|
-
var FORCED$1 = !isCallable$1(NativeIterator)
|
|
1252
|
-
|| NativeIterator.prototype !== IteratorPrototype$1
|
|
1253
|
-
// FF44- non-standard `Iterator` passes previous tests
|
|
1254
|
-
|| !fails$1(function () { NativeIterator({}); });
|
|
1255
|
-
|
|
1256
|
-
var IteratorConstructor = function Iterator() {
|
|
1257
|
-
anInstance(this, IteratorPrototype$1);
|
|
1258
|
-
if (getPrototypeOf(this) === IteratorPrototype$1) throw new $TypeError$4('Abstract class Iterator not directly constructable');
|
|
1259
|
-
};
|
|
1260
|
-
|
|
1261
|
-
var defineIteratorPrototypeAccessor = function (key, value) {
|
|
1262
|
-
if (DESCRIPTORS$1) {
|
|
1263
|
-
defineBuiltInAccessor(IteratorPrototype$1, key, {
|
|
1264
|
-
configurable: true,
|
|
1265
|
-
get: function () {
|
|
1266
|
-
return value;
|
|
1267
|
-
},
|
|
1268
|
-
set: function (replacement) {
|
|
1269
|
-
anObject$8(this);
|
|
1270
|
-
if (this === IteratorPrototype$1) throw new $TypeError$4("You can't redefine this property");
|
|
1271
|
-
if (hasOwn(this, key)) this[key] = replacement;
|
|
1272
|
-
else createProperty(this, key, replacement);
|
|
1273
|
-
}
|
|
1274
|
-
});
|
|
1275
|
-
} else IteratorPrototype$1[key] = value;
|
|
1276
|
-
};
|
|
1277
|
-
|
|
1278
|
-
if (!hasOwn(IteratorPrototype$1, TO_STRING_TAG$3)) defineIteratorPrototypeAccessor(TO_STRING_TAG$3, ITERATOR$2);
|
|
1279
|
-
|
|
1280
|
-
if (FORCED$1 || !hasOwn(IteratorPrototype$1, CONSTRUCTOR) || IteratorPrototype$1[CONSTRUCTOR] === Object) {
|
|
1281
|
-
defineIteratorPrototypeAccessor(CONSTRUCTOR, IteratorConstructor);
|
|
1282
|
-
}
|
|
1283
|
-
|
|
1284
|
-
IteratorConstructor.prototype = IteratorPrototype$1;
|
|
1285
|
-
|
|
1286
|
-
// `Iterator` constructor
|
|
1287
|
-
// https://github.com/tc39/proposal-iterator-helpers
|
|
1288
|
-
$$5({ global: true, constructor: true, forced: FORCED$1 }, {
|
|
1289
|
-
Iterator: IteratorConstructor
|
|
1290
|
-
});
|
|
1291
|
-
|
|
1292
|
-
// `GetIteratorDirect(obj)` abstract operation
|
|
1293
|
-
// https://tc39.es/proposal-iterator-helpers/#sec-getiteratordirect
|
|
1294
|
-
var getIteratorDirect$4 = function (obj) {
|
|
1295
|
-
return {
|
|
1296
|
-
iterator: obj,
|
|
1297
|
-
next: obj.next,
|
|
1298
|
-
done: false
|
|
1299
|
-
};
|
|
1300
|
-
};
|
|
1301
|
-
|
|
1302
|
-
var defineBuiltIn = defineBuiltIn$3;
|
|
1303
|
-
|
|
1304
|
-
var defineBuiltIns$1 = function (target, src, options) {
|
|
1305
|
-
for (var key in src) defineBuiltIn(target, key, src[key], options);
|
|
1306
|
-
return target;
|
|
1307
|
-
};
|
|
1308
|
-
|
|
1309
|
-
// `CreateIterResultObject` abstract operation
|
|
1310
|
-
// https://tc39.es/ecma262/#sec-createiterresultobject
|
|
1311
|
-
var createIterResultObject$1 = function (value, done) {
|
|
1312
|
-
return { value: value, done: done };
|
|
1313
|
-
};
|
|
1314
|
-
|
|
1315
|
-
var call$5 = functionCall;
|
|
1316
|
-
var anObject$7 = anObject$d;
|
|
1317
|
-
var getMethod$2 = getMethod$4;
|
|
1318
|
-
|
|
1319
|
-
var iteratorClose$3 = function (iterator, kind, value) {
|
|
1320
|
-
var innerResult, innerError;
|
|
1321
|
-
anObject$7(iterator);
|
|
1322
|
-
try {
|
|
1323
|
-
innerResult = getMethod$2(iterator, 'return');
|
|
1324
|
-
if (!innerResult) {
|
|
1325
|
-
if (kind === 'throw') throw value;
|
|
1326
|
-
return value;
|
|
1327
|
-
}
|
|
1328
|
-
innerResult = call$5(innerResult, iterator);
|
|
1329
|
-
} catch (error) {
|
|
1330
|
-
innerError = true;
|
|
1331
|
-
innerResult = error;
|
|
1332
|
-
}
|
|
1333
|
-
if (kind === 'throw') throw value;
|
|
1334
|
-
if (innerError) throw innerResult;
|
|
1335
|
-
anObject$7(innerResult);
|
|
1336
|
-
return value;
|
|
1337
|
-
};
|
|
1338
|
-
|
|
1339
|
-
var call$4 = functionCall;
|
|
1340
|
-
var create = objectCreate;
|
|
1341
|
-
var createNonEnumerableProperty = createNonEnumerableProperty$3;
|
|
1342
|
-
var defineBuiltIns = defineBuiltIns$1;
|
|
1343
|
-
var wellKnownSymbol$4 = wellKnownSymbol$8;
|
|
1344
|
-
var InternalStateModule = internalState;
|
|
1345
|
-
var getMethod$1 = getMethod$4;
|
|
1346
|
-
var IteratorPrototype = iteratorsCore.IteratorPrototype;
|
|
1347
|
-
var createIterResultObject = createIterResultObject$1;
|
|
1348
|
-
var iteratorClose$2 = iteratorClose$3;
|
|
1349
|
-
|
|
1350
|
-
var TO_STRING_TAG$2 = wellKnownSymbol$4('toStringTag');
|
|
1351
|
-
var ITERATOR_HELPER = 'IteratorHelper';
|
|
1352
|
-
var WRAP_FOR_VALID_ITERATOR = 'WrapForValidIterator';
|
|
1353
|
-
var setInternalState = InternalStateModule.set;
|
|
1354
|
-
|
|
1355
|
-
var createIteratorProxyPrototype = function (IS_ITERATOR) {
|
|
1356
|
-
var getInternalState = InternalStateModule.getterFor(IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER);
|
|
1357
|
-
|
|
1358
|
-
return defineBuiltIns(create(IteratorPrototype), {
|
|
1359
|
-
next: function next() {
|
|
1360
|
-
var state = getInternalState(this);
|
|
1361
|
-
// for simplification:
|
|
1362
|
-
// for `%WrapForValidIteratorPrototype%.next` our `nextHandler` returns `IterResultObject`
|
|
1363
|
-
// for `%IteratorHelperPrototype%.next` - just a value
|
|
1364
|
-
if (IS_ITERATOR) return state.nextHandler();
|
|
1365
|
-
try {
|
|
1366
|
-
var result = state.done ? undefined : state.nextHandler();
|
|
1367
|
-
return createIterResultObject(result, state.done);
|
|
1368
|
-
} catch (error) {
|
|
1369
|
-
state.done = true;
|
|
1370
|
-
throw error;
|
|
1371
|
-
}
|
|
1372
|
-
},
|
|
1373
|
-
'return': function () {
|
|
1374
|
-
var state = getInternalState(this);
|
|
1375
|
-
var iterator = state.iterator;
|
|
1376
|
-
state.done = true;
|
|
1377
|
-
if (IS_ITERATOR) {
|
|
1378
|
-
var returnMethod = getMethod$1(iterator, 'return');
|
|
1379
|
-
return returnMethod ? call$4(returnMethod, iterator) : createIterResultObject(undefined, true);
|
|
1380
|
-
}
|
|
1381
|
-
if (state.inner) try {
|
|
1382
|
-
iteratorClose$2(state.inner.iterator, 'normal');
|
|
1383
|
-
} catch (error) {
|
|
1384
|
-
return iteratorClose$2(iterator, 'throw', error);
|
|
1385
|
-
}
|
|
1386
|
-
iteratorClose$2(iterator, 'normal');
|
|
1387
|
-
return createIterResultObject(undefined, true);
|
|
1388
|
-
}
|
|
1389
|
-
});
|
|
1390
|
-
};
|
|
1391
|
-
|
|
1392
|
-
var WrapForValidIteratorPrototype = createIteratorProxyPrototype(true);
|
|
1393
|
-
var IteratorHelperPrototype = createIteratorProxyPrototype(false);
|
|
1394
|
-
|
|
1395
|
-
createNonEnumerableProperty(IteratorHelperPrototype, TO_STRING_TAG$2, 'Iterator Helper');
|
|
1396
|
-
|
|
1397
|
-
var iteratorCreateProxy = function (nextHandler, IS_ITERATOR) {
|
|
1398
|
-
var IteratorProxy = function Iterator(record, state) {
|
|
1399
|
-
if (state) {
|
|
1400
|
-
state.iterator = record.iterator;
|
|
1401
|
-
state.next = record.next;
|
|
1402
|
-
} else state = record;
|
|
1403
|
-
state.type = IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER;
|
|
1404
|
-
state.nextHandler = nextHandler;
|
|
1405
|
-
state.counter = 0;
|
|
1406
|
-
state.done = false;
|
|
1407
|
-
setInternalState(this, state);
|
|
1408
|
-
};
|
|
1409
|
-
|
|
1410
|
-
IteratorProxy.prototype = IS_ITERATOR ? WrapForValidIteratorPrototype : IteratorHelperPrototype;
|
|
1411
|
-
|
|
1412
|
-
return IteratorProxy;
|
|
1413
|
-
};
|
|
1414
|
-
|
|
1415
|
-
var anObject$6 = anObject$d;
|
|
1416
|
-
var iteratorClose$1 = iteratorClose$3;
|
|
1417
|
-
|
|
1418
|
-
// call something on iterator step with safe closing on error
|
|
1419
|
-
var callWithSafeIterationClosing$2 = function (iterator, fn, value, ENTRIES) {
|
|
1420
|
-
try {
|
|
1421
|
-
return ENTRIES ? fn(anObject$6(value)[0], value[1]) : fn(value);
|
|
1422
|
-
} catch (error) {
|
|
1423
|
-
iteratorClose$1(iterator, 'throw', error);
|
|
1424
|
-
}
|
|
1425
|
-
};
|
|
1426
|
-
|
|
1427
|
-
var $$4 = _export;
|
|
1428
|
-
var call$3 = functionCall;
|
|
1429
|
-
var aCallable$5 = aCallable$7;
|
|
1430
|
-
var anObject$5 = anObject$d;
|
|
1431
|
-
var getIteratorDirect$3 = getIteratorDirect$4;
|
|
1432
|
-
var createIteratorProxy$1 = iteratorCreateProxy;
|
|
1433
|
-
var callWithSafeIterationClosing$1 = callWithSafeIterationClosing$2;
|
|
1434
|
-
var IS_PURE$1 = isPure;
|
|
1435
|
-
|
|
1436
|
-
var IteratorProxy$1 = createIteratorProxy$1(function () {
|
|
1437
|
-
var iterator = this.iterator;
|
|
1438
|
-
var predicate = this.predicate;
|
|
1439
|
-
var next = this.next;
|
|
1440
|
-
var result, done, value;
|
|
1441
|
-
while (true) {
|
|
1442
|
-
result = anObject$5(call$3(next, iterator));
|
|
1443
|
-
done = this.done = !!result.done;
|
|
1444
|
-
if (done) return;
|
|
1445
|
-
value = result.value;
|
|
1446
|
-
if (callWithSafeIterationClosing$1(iterator, predicate, [value, this.counter++], true)) return value;
|
|
1447
|
-
}
|
|
1448
|
-
});
|
|
1449
|
-
|
|
1450
|
-
// `Iterator.prototype.filter` method
|
|
1451
|
-
// https://github.com/tc39/proposal-iterator-helpers
|
|
1452
|
-
$$4({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$1 }, {
|
|
1453
|
-
filter: function filter(predicate) {
|
|
1454
|
-
anObject$5(this);
|
|
1455
|
-
aCallable$5(predicate);
|
|
1456
|
-
return new IteratorProxy$1(getIteratorDirect$3(this), {
|
|
1457
|
-
predicate: predicate
|
|
1458
|
-
});
|
|
1459
|
-
}
|
|
1460
|
-
});
|
|
1461
|
-
|
|
1462
|
-
var classofRaw$1 = classofRaw$2;
|
|
1463
|
-
var uncurryThis$1 = functionUncurryThis;
|
|
1464
|
-
|
|
1465
|
-
var functionUncurryThisClause = function (fn) {
|
|
1466
|
-
// Nashorn bug:
|
|
1467
|
-
// https://github.com/zloirock/core-js/issues/1128
|
|
1468
|
-
// https://github.com/zloirock/core-js/issues/1130
|
|
1469
|
-
if (classofRaw$1(fn) === 'Function') return uncurryThis$1(fn);
|
|
1470
|
-
};
|
|
1471
|
-
|
|
1472
|
-
var uncurryThis = functionUncurryThisClause;
|
|
1473
|
-
var aCallable$4 = aCallable$7;
|
|
1474
|
-
var NATIVE_BIND = functionBindNative;
|
|
1475
|
-
|
|
1476
|
-
var bind$1 = uncurryThis(uncurryThis.bind);
|
|
1477
|
-
|
|
1478
|
-
// optional / simple context binding
|
|
1479
|
-
var functionBindContext = function (fn, that) {
|
|
1480
|
-
aCallable$4(fn);
|
|
1481
|
-
return that === undefined ? fn : NATIVE_BIND ? bind$1(fn, that) : function (/* ...args */) {
|
|
1482
|
-
return fn.apply(that, arguments);
|
|
1483
|
-
};
|
|
1484
|
-
};
|
|
1485
|
-
|
|
1486
|
-
var iterators = {};
|
|
1487
|
-
|
|
1488
|
-
var wellKnownSymbol$3 = wellKnownSymbol$8;
|
|
1489
|
-
var Iterators$1 = iterators;
|
|
1490
|
-
|
|
1491
|
-
var ITERATOR$1 = wellKnownSymbol$3('iterator');
|
|
1492
|
-
var ArrayPrototype = Array.prototype;
|
|
1493
|
-
|
|
1494
|
-
// check on default Array iterator
|
|
1495
|
-
var isArrayIteratorMethod$1 = function (it) {
|
|
1496
|
-
return it !== undefined && (Iterators$1.Array === it || ArrayPrototype[ITERATOR$1] === it);
|
|
1497
|
-
};
|
|
1498
|
-
|
|
1499
|
-
var wellKnownSymbol$2 = wellKnownSymbol$8;
|
|
1500
|
-
|
|
1501
|
-
var TO_STRING_TAG$1 = wellKnownSymbol$2('toStringTag');
|
|
1502
|
-
var test = {};
|
|
1503
|
-
|
|
1504
|
-
test[TO_STRING_TAG$1] = 'z';
|
|
1505
|
-
|
|
1506
|
-
var toStringTagSupport = String(test) === '[object z]';
|
|
1507
|
-
|
|
1508
|
-
var TO_STRING_TAG_SUPPORT = toStringTagSupport;
|
|
1509
|
-
var isCallable = isCallable$e;
|
|
1510
|
-
var classofRaw = classofRaw$2;
|
|
1511
|
-
var wellKnownSymbol$1 = wellKnownSymbol$8;
|
|
1512
|
-
|
|
1513
|
-
var TO_STRING_TAG = wellKnownSymbol$1('toStringTag');
|
|
1514
|
-
var $Object = Object;
|
|
1515
|
-
|
|
1516
|
-
// ES3 wrong here
|
|
1517
|
-
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';
|
|
1518
|
-
|
|
1519
|
-
// fallback for IE11 Script Access Denied error
|
|
1520
|
-
var tryGet = function (it, key) {
|
|
1521
|
-
try {
|
|
1522
|
-
return it[key];
|
|
1523
|
-
} catch (error) { /* empty */ }
|
|
1524
|
-
};
|
|
1525
|
-
|
|
1526
|
-
// getting tag from ES6+ `Object.prototype.toString`
|
|
1527
|
-
var classof$2 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
|
|
1528
|
-
var O, tag, result;
|
|
1529
|
-
return it === undefined ? 'Undefined' : it === null ? 'Null'
|
|
1530
|
-
// @@toStringTag case
|
|
1531
|
-
: typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
|
|
1532
|
-
// builtinTag case
|
|
1533
|
-
: CORRECT_ARGUMENTS ? classofRaw(O)
|
|
1534
|
-
// ES3 arguments fallback
|
|
1535
|
-
: (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result;
|
|
1536
|
-
};
|
|
1537
|
-
|
|
1538
|
-
var classof$1 = classof$2;
|
|
1539
|
-
var getMethod = getMethod$4;
|
|
1540
|
-
var isNullOrUndefined = isNullOrUndefined$3;
|
|
1541
|
-
var Iterators = iterators;
|
|
1542
|
-
var wellKnownSymbol = wellKnownSymbol$8;
|
|
1543
|
-
|
|
1544
|
-
var ITERATOR = wellKnownSymbol('iterator');
|
|
1545
|
-
|
|
1546
|
-
var getIteratorMethod$2 = function (it) {
|
|
1547
|
-
if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR)
|
|
1548
|
-
|| getMethod(it, '@@iterator')
|
|
1549
|
-
|| Iterators[classof$1(it)];
|
|
1550
|
-
};
|
|
1551
|
-
|
|
1552
|
-
var call$2 = functionCall;
|
|
1553
|
-
var aCallable$3 = aCallable$7;
|
|
1554
|
-
var anObject$4 = anObject$d;
|
|
1555
|
-
var tryToString$1 = tryToString$3;
|
|
1556
|
-
var getIteratorMethod$1 = getIteratorMethod$2;
|
|
1557
|
-
|
|
1558
|
-
var $TypeError$3 = TypeError;
|
|
1559
|
-
|
|
1560
|
-
var getIterator$1 = function (argument, usingIterator) {
|
|
1561
|
-
var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
|
|
1562
|
-
if (aCallable$3(iteratorMethod)) return anObject$4(call$2(iteratorMethod, argument));
|
|
1563
|
-
throw new $TypeError$3(tryToString$1(argument) + ' is not iterable');
|
|
1564
|
-
};
|
|
1565
|
-
|
|
1566
|
-
var bind = functionBindContext;
|
|
1567
|
-
var call$1 = functionCall;
|
|
1568
|
-
var anObject$3 = anObject$d;
|
|
1569
|
-
var tryToString = tryToString$3;
|
|
1570
|
-
var isArrayIteratorMethod = isArrayIteratorMethod$1;
|
|
1571
|
-
var lengthOfArrayLike$1 = lengthOfArrayLike$3;
|
|
1572
|
-
var isPrototypeOf = objectIsPrototypeOf;
|
|
1573
|
-
var getIterator = getIterator$1;
|
|
1574
|
-
var getIteratorMethod = getIteratorMethod$2;
|
|
1575
|
-
var iteratorClose = iteratorClose$3;
|
|
1576
|
-
|
|
1577
|
-
var $TypeError$2 = TypeError;
|
|
1578
|
-
|
|
1579
|
-
var Result = function (stopped, result) {
|
|
1580
|
-
this.stopped = stopped;
|
|
1581
|
-
this.result = result;
|
|
1582
|
-
};
|
|
1583
|
-
|
|
1584
|
-
var ResultPrototype = Result.prototype;
|
|
1585
|
-
|
|
1586
|
-
var iterate$2 = function (iterable, unboundFunction, options) {
|
|
1587
|
-
var that = options && options.that;
|
|
1588
|
-
var AS_ENTRIES = !!(options && options.AS_ENTRIES);
|
|
1589
|
-
var IS_RECORD = !!(options && options.IS_RECORD);
|
|
1590
|
-
var IS_ITERATOR = !!(options && options.IS_ITERATOR);
|
|
1591
|
-
var INTERRUPTED = !!(options && options.INTERRUPTED);
|
|
1592
|
-
var fn = bind(unboundFunction, that);
|
|
1593
|
-
var iterator, iterFn, index, length, result, next, step;
|
|
1594
|
-
|
|
1595
|
-
var stop = function (condition) {
|
|
1596
|
-
if (iterator) iteratorClose(iterator, 'normal', condition);
|
|
1597
|
-
return new Result(true, condition);
|
|
1598
|
-
};
|
|
1599
|
-
|
|
1600
|
-
var callFn = function (value) {
|
|
1601
|
-
if (AS_ENTRIES) {
|
|
1602
|
-
anObject$3(value);
|
|
1603
|
-
return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
|
|
1604
|
-
} return INTERRUPTED ? fn(value, stop) : fn(value);
|
|
1605
|
-
};
|
|
1606
|
-
|
|
1607
|
-
if (IS_RECORD) {
|
|
1608
|
-
iterator = iterable.iterator;
|
|
1609
|
-
} else if (IS_ITERATOR) {
|
|
1610
|
-
iterator = iterable;
|
|
1611
|
-
} else {
|
|
1612
|
-
iterFn = getIteratorMethod(iterable);
|
|
1613
|
-
if (!iterFn) throw new $TypeError$2(tryToString(iterable) + ' is not iterable');
|
|
1614
|
-
// optimisation for array iterators
|
|
1615
|
-
if (isArrayIteratorMethod(iterFn)) {
|
|
1616
|
-
for (index = 0, length = lengthOfArrayLike$1(iterable); length > index; index++) {
|
|
1617
|
-
result = callFn(iterable[index]);
|
|
1618
|
-
if (result && isPrototypeOf(ResultPrototype, result)) return result;
|
|
1619
|
-
} return new Result(false);
|
|
1620
|
-
}
|
|
1621
|
-
iterator = getIterator(iterable, iterFn);
|
|
1622
|
-
}
|
|
1623
|
-
|
|
1624
|
-
next = IS_RECORD ? iterable.next : iterator.next;
|
|
1625
|
-
while (!(step = call$1(next, iterator)).done) {
|
|
1626
|
-
try {
|
|
1627
|
-
result = callFn(step.value);
|
|
1628
|
-
} catch (error) {
|
|
1629
|
-
iteratorClose(iterator, 'throw', error);
|
|
1630
|
-
}
|
|
1631
|
-
if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
|
|
1632
|
-
} return new Result(false);
|
|
1633
|
-
};
|
|
1634
|
-
|
|
1635
|
-
var $$3 = _export;
|
|
1636
|
-
var iterate$1 = iterate$2;
|
|
1637
|
-
var aCallable$2 = aCallable$7;
|
|
1638
|
-
var anObject$2 = anObject$d;
|
|
1639
|
-
var getIteratorDirect$2 = getIteratorDirect$4;
|
|
1640
|
-
|
|
1641
|
-
// `Iterator.prototype.find` method
|
|
1642
|
-
// https://github.com/tc39/proposal-iterator-helpers
|
|
1643
|
-
$$3({ target: 'Iterator', proto: true, real: true }, {
|
|
1644
|
-
find: function find(predicate) {
|
|
1645
|
-
anObject$2(this);
|
|
1646
|
-
aCallable$2(predicate);
|
|
1647
|
-
var record = getIteratorDirect$2(this);
|
|
1648
|
-
var counter = 0;
|
|
1649
|
-
return iterate$1(record, function (value, stop) {
|
|
1650
|
-
if (predicate(value, counter++)) return stop(value);
|
|
1651
|
-
}, { IS_RECORD: true, INTERRUPTED: true }).result;
|
|
1652
|
-
}
|
|
1653
|
-
});
|
|
1654
|
-
|
|
1655
|
-
var $$2 = _export;
|
|
1656
|
-
var iterate = iterate$2;
|
|
1657
|
-
var aCallable$1 = aCallable$7;
|
|
1658
|
-
var anObject$1 = anObject$d;
|
|
1659
|
-
var getIteratorDirect$1 = getIteratorDirect$4;
|
|
1660
|
-
|
|
1661
|
-
// `Iterator.prototype.forEach` method
|
|
1662
|
-
// https://github.com/tc39/proposal-iterator-helpers
|
|
1663
|
-
$$2({ target: 'Iterator', proto: true, real: true }, {
|
|
1664
|
-
forEach: function forEach(fn) {
|
|
1665
|
-
anObject$1(this);
|
|
1666
|
-
aCallable$1(fn);
|
|
1667
|
-
var record = getIteratorDirect$1(this);
|
|
1668
|
-
var counter = 0;
|
|
1669
|
-
iterate(record, function (value) {
|
|
1670
|
-
fn(value, counter++);
|
|
1671
|
-
}, { IS_RECORD: true });
|
|
1672
|
-
}
|
|
1673
|
-
});
|
|
1674
|
-
|
|
1675
|
-
var call = functionCall;
|
|
1676
|
-
var aCallable = aCallable$7;
|
|
1677
|
-
var anObject = anObject$d;
|
|
1678
|
-
var getIteratorDirect = getIteratorDirect$4;
|
|
1679
|
-
var createIteratorProxy = iteratorCreateProxy;
|
|
1680
|
-
var callWithSafeIterationClosing = callWithSafeIterationClosing$2;
|
|
1681
|
-
|
|
1682
|
-
var IteratorProxy = createIteratorProxy(function () {
|
|
1683
|
-
var iterator = this.iterator;
|
|
1684
|
-
var result = anObject(call(this.next, iterator));
|
|
1685
|
-
var done = this.done = !!result.done;
|
|
1686
|
-
if (!done) return callWithSafeIterationClosing(iterator, this.mapper, [result.value, this.counter++], true);
|
|
1687
|
-
});
|
|
1688
|
-
|
|
1689
|
-
// `Iterator.prototype.map` method
|
|
1690
|
-
// https://github.com/tc39/proposal-iterator-helpers
|
|
1691
|
-
var iteratorMap = function map(mapper) {
|
|
1692
|
-
anObject(this);
|
|
1693
|
-
aCallable(mapper);
|
|
1694
|
-
return new IteratorProxy(getIteratorDirect(this), {
|
|
1695
|
-
mapper: mapper
|
|
1696
|
-
});
|
|
1697
|
-
};
|
|
1698
|
-
|
|
1699
|
-
var $$1 = _export;
|
|
1700
|
-
var map = iteratorMap;
|
|
1701
|
-
var IS_PURE = isPure;
|
|
1702
|
-
|
|
1703
|
-
// `Iterator.prototype.map` method
|
|
1704
|
-
// https://github.com/tc39/proposal-iterator-helpers
|
|
1705
|
-
$$1({ target: 'Iterator', proto: true, real: true, forced: IS_PURE }, {
|
|
1706
|
-
map: map
|
|
1707
|
-
});
|
|
1
|
+
import 'core-js/modules/es.iterator.constructor.js';
|
|
2
|
+
import 'core-js/modules/es.iterator.filter.js';
|
|
3
|
+
import 'core-js/modules/es.iterator.find.js';
|
|
4
|
+
import 'core-js/modules/es.iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/es.iterator.map.js';
|
|
6
|
+
import 'core-js/modules/es.map.get-or-insert.js';
|
|
7
|
+
import 'core-js/modules/es.map.get-or-insert-computed.js';
|
|
8
|
+
import { isObservable, of, switchMap, combineLatest, map, delay, startWith, filter, skipWhile, EMPTY, distinctUntilChanged, mergeMap, BehaviorSubject, shareReplay, skip, defaultIfEmpty, first, merge, finalize, firstValueFrom, exhaustMap, scan, identity, throttleTime, takeWhile, timeout, tap, throwError, timer, asyncScheduler, delayWhen, from, catchError, Subject } from 'rxjs';
|
|
9
|
+
import { getValueFromGetter, isMaybeSo, filterMaybeArrayValues, areEqualPOJOValues, convertToArray, asGetter, performTaskLoop, isMaybeNot, forEachWithArray, pushArrayItemsIntoArray, pushItemOrArrayItemsIntoArray, asArray, filterAndMapFunction, expirationDetails, objectKeysEqualityComparatorFunction, objectKeyEqualityComparatorFunction, asPromise, randomNumberFactory, mapsHaveSameKeys, mapKeysIntersectionObjectToArray, incrementingNumberFactory, filterUniqueFunction, build, cachedGetter, allKeyValueTuples, keyValueMapFactory, multiKeyValueMapFactory, timePeriodCounter, hasSameValues, compareEqualityWithValueFromItemsFunction, setContainsAllValues, setContainsAnyValue, setContainsNoneOfValue, searchStringFilterFunction, objectHasKey, reduceBooleansWithAnd, toReadableError, reduceBooleansWithOr, valuesAreBothNullishOrEquivalent, mergeObjects, safeCompareEquality, hasNonNullValue, limitArray, mapFunctionOutputPair, lastValue, flattenArray, filteredPage, invertMaybeBoolean, FIRST_PAGE, hasValueOrNotEmpty, getNextPageNumber, reduceBooleansWithOrFn, MS_IN_SECOND } from '@dereekb/util';
|
|
1708
10
|
|
|
1709
11
|
function asObservable(valueOrObs) {
|
|
1710
12
|
if (isObservable(valueOrObs)) {
|
|
@@ -1754,7 +56,7 @@ function useAsObservable(input, observer) {
|
|
|
1754
56
|
* @param isEqualFunction
|
|
1755
57
|
*/
|
|
1756
58
|
function makeIsModifiedFunction(isEqualFunction) {
|
|
1757
|
-
return value => isEqualFunction(value).pipe(map
|
|
59
|
+
return value => isEqualFunction(value).pipe(map(x => !x));
|
|
1758
60
|
}
|
|
1759
61
|
/**
|
|
1760
62
|
* Creates an Observable<IsModifiedFunction> from the input config.
|
|
@@ -1768,14 +70,14 @@ function makeIsModifiedFunctionObservable(config) {
|
|
|
1768
70
|
isEqual,
|
|
1769
71
|
defaultFunction
|
|
1770
72
|
} = config;
|
|
1771
|
-
return combineLatest([asObservable(isModified), asObservable(isEqual)]).pipe(map
|
|
73
|
+
return combineLatest([asObservable(isModified), asObservable(isEqual)]).pipe(map(([isModified, isEqual]) => isModified ?? (isEqual ? makeIsModifiedFunction(isEqual) : undefined) ?? defaultFunction ?? (() => of(true))));
|
|
1772
74
|
}
|
|
1773
75
|
// MARK: IsCheck
|
|
1774
76
|
function makeReturnIfIsFunction(isCheckFunction, defaultValueOnMaybe) {
|
|
1775
77
|
return value => returnIfIs(isCheckFunction, value, defaultValueOnMaybe);
|
|
1776
78
|
}
|
|
1777
79
|
function returnIfIs(isCheckFunction, value, defaultValueOnMaybe) {
|
|
1778
|
-
return checkIs(isCheckFunction, value, defaultValueOnMaybe).pipe(map
|
|
80
|
+
return checkIs(isCheckFunction, value, defaultValueOnMaybe).pipe(map(x => x ? value : undefined));
|
|
1779
81
|
}
|
|
1780
82
|
function makeCheckIsFunction(isCheckFunction, defaultValueOnMaybe) {
|
|
1781
83
|
return value => checkIs(isCheckFunction, value, defaultValueOnMaybe);
|
|
@@ -1799,7 +101,7 @@ const filterMaybeStrict = filterMaybe;
|
|
|
1799
101
|
* Observable filter that filters out MaybeNot values from the input array of maybe values
|
|
1800
102
|
*/
|
|
1801
103
|
function filterMaybeArray() {
|
|
1802
|
-
return map
|
|
104
|
+
return map(filterMaybeArrayValues);
|
|
1803
105
|
}
|
|
1804
106
|
/**
|
|
1805
107
|
* Skips all initial maybe values, and then returns all values after the first non-null/undefined value is returned.
|
|
@@ -1852,7 +154,7 @@ function switchMapObject(config) {
|
|
|
1852
154
|
defaultGetter
|
|
1853
155
|
} = config;
|
|
1854
156
|
return switchMap(inputConfig => {
|
|
1855
|
-
const obs = asObservableFromGetter(inputConfig).pipe(map
|
|
157
|
+
const obs = asObservableFromGetter(inputConfig).pipe(map(input => {
|
|
1856
158
|
let config;
|
|
1857
159
|
if (input == null || input === true) {
|
|
1858
160
|
config = defaultGetter ? getValueFromGetter(defaultGetter) : null;
|
|
@@ -1917,7 +219,7 @@ function mapMaybe(mapFn) {
|
|
|
1917
219
|
* @returns
|
|
1918
220
|
*/
|
|
1919
221
|
function mapIf(mapFn, decision) {
|
|
1920
|
-
return map
|
|
222
|
+
return map(x => decision(x) ? mapFn(x) : undefined);
|
|
1921
223
|
}
|
|
1922
224
|
/**
|
|
1923
225
|
* Combines both combineLatest with map values to an other value.
|
|
@@ -1927,7 +229,7 @@ function mapIf(mapFn, decision) {
|
|
|
1927
229
|
* @returns
|
|
1928
230
|
*/
|
|
1929
231
|
function combineLatestMapFrom(combineObs, mapFn) {
|
|
1930
|
-
return obs => combineLatest([obs, combineObs]).pipe(map
|
|
232
|
+
return obs => combineLatest([obs, combineObs]).pipe(map(([a, b]) => mapFn(a, b)));
|
|
1931
233
|
}
|
|
1932
234
|
/**
|
|
1933
235
|
* Creates an observable that emits a starting value, then a second value after a delay.
|
|
@@ -1947,17 +249,6 @@ function emitDelayObs(startWith, endWith, delayTime) {
|
|
|
1947
249
|
function emitAfterDelay(value, delayTime) {
|
|
1948
250
|
return obs => obs.pipe(switchMap(x => of(value).pipe(delay(delayTime), startWith(x))));
|
|
1949
251
|
}
|
|
1950
|
-
// MARK: Compat
|
|
1951
|
-
/**
|
|
1952
|
-
* @deprecated use switchMapFilterMaybe instead.
|
|
1953
|
-
*/
|
|
1954
|
-
const switchMapMaybeObs = switchMapFilterMaybe;
|
|
1955
|
-
/**
|
|
1956
|
-
* Skips all initial maybe values, and then returns all values after the first non-null/undefined value is returned.
|
|
1957
|
-
*
|
|
1958
|
-
* @deprecated use skipAllInitialMaybe instead.
|
|
1959
|
-
*/
|
|
1960
|
-
const skipFirstMaybe = skipAllInitialMaybe;
|
|
1961
252
|
|
|
1962
253
|
/**
|
|
1963
254
|
* Equivalent to distinctUntilChanged() using areEqualPOJOValues().
|
|
@@ -1977,92 +268,6 @@ function filterIfObjectValuesUnchanged(input) {
|
|
|
1977
268
|
}
|
|
1978
269
|
}
|
|
1979
270
|
|
|
1980
|
-
var classof = classofRaw$2;
|
|
1981
|
-
|
|
1982
|
-
// `IsArray` abstract operation
|
|
1983
|
-
// https://tc39.es/ecma262/#sec-isarray
|
|
1984
|
-
// eslint-disable-next-line es/no-array-isarray -- safe
|
|
1985
|
-
var isArray$1 = Array.isArray || function isArray(argument) {
|
|
1986
|
-
return classof(argument) === 'Array';
|
|
1987
|
-
};
|
|
1988
|
-
|
|
1989
|
-
var DESCRIPTORS = descriptors;
|
|
1990
|
-
var isArray = isArray$1;
|
|
1991
|
-
|
|
1992
|
-
var $TypeError$1 = TypeError;
|
|
1993
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
1994
|
-
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
1995
|
-
|
|
1996
|
-
// Safari < 13 does not throw an error in this case
|
|
1997
|
-
var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS && !function () {
|
|
1998
|
-
// makes no sense without proper strict mode support
|
|
1999
|
-
if (this !== undefined) return true;
|
|
2000
|
-
try {
|
|
2001
|
-
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
2002
|
-
Object.defineProperty([], 'length', { writable: false }).length = 1;
|
|
2003
|
-
} catch (error) {
|
|
2004
|
-
return error instanceof TypeError;
|
|
2005
|
-
}
|
|
2006
|
-
}();
|
|
2007
|
-
|
|
2008
|
-
var arraySetLength = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
|
|
2009
|
-
if (isArray(O) && !getOwnPropertyDescriptor(O, 'length').writable) {
|
|
2010
|
-
throw new $TypeError$1('Cannot set read only .length');
|
|
2011
|
-
} return O.length = length;
|
|
2012
|
-
} : function (O, length) {
|
|
2013
|
-
return O.length = length;
|
|
2014
|
-
};
|
|
2015
|
-
|
|
2016
|
-
var $TypeError = TypeError;
|
|
2017
|
-
var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
|
|
2018
|
-
|
|
2019
|
-
var doesNotExceedSafeInteger$1 = function (it) {
|
|
2020
|
-
if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded');
|
|
2021
|
-
return it;
|
|
2022
|
-
};
|
|
2023
|
-
|
|
2024
|
-
var $ = _export;
|
|
2025
|
-
var toObject = toObject$3;
|
|
2026
|
-
var lengthOfArrayLike = lengthOfArrayLike$3;
|
|
2027
|
-
var setArrayLength = arraySetLength;
|
|
2028
|
-
var doesNotExceedSafeInteger = doesNotExceedSafeInteger$1;
|
|
2029
|
-
var fails = fails$c;
|
|
2030
|
-
|
|
2031
|
-
var INCORRECT_TO_LENGTH = fails(function () {
|
|
2032
|
-
return [].push.call({ length: 0x100000000 }, 1) !== 4294967297;
|
|
2033
|
-
});
|
|
2034
|
-
|
|
2035
|
-
// V8 <= 121 and Safari <= 15.4; FF < 23 throws InternalError
|
|
2036
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=12681
|
|
2037
|
-
var properErrorOnNonWritableLength = function () {
|
|
2038
|
-
try {
|
|
2039
|
-
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
2040
|
-
Object.defineProperty([], 'length', { writable: false }).push();
|
|
2041
|
-
} catch (error) {
|
|
2042
|
-
return error instanceof TypeError;
|
|
2043
|
-
}
|
|
2044
|
-
};
|
|
2045
|
-
|
|
2046
|
-
var FORCED = INCORRECT_TO_LENGTH || !properErrorOnNonWritableLength();
|
|
2047
|
-
|
|
2048
|
-
// `Array.prototype.push` method
|
|
2049
|
-
// https://tc39.es/ecma262/#sec-array.prototype.push
|
|
2050
|
-
$({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
|
|
2051
|
-
// eslint-disable-next-line no-unused-vars -- required for `.length`
|
|
2052
|
-
push: function push(item) {
|
|
2053
|
-
var O = toObject(this);
|
|
2054
|
-
var len = lengthOfArrayLike(O);
|
|
2055
|
-
var argCount = arguments.length;
|
|
2056
|
-
doesNotExceedSafeInteger(len + argCount);
|
|
2057
|
-
for (var i = 0; i < argCount; i++) {
|
|
2058
|
-
O[len] = arguments[i];
|
|
2059
|
-
len++;
|
|
2060
|
-
}
|
|
2061
|
-
setArrayLength(O, len);
|
|
2062
|
-
return len;
|
|
2063
|
-
}
|
|
2064
|
-
});
|
|
2065
|
-
|
|
2066
271
|
/**
|
|
2067
272
|
* Destroyable object that wraps an Unsubscribable.
|
|
2068
273
|
*/
|
|
@@ -2149,7 +354,7 @@ class FilterSourceInstance {
|
|
|
2149
354
|
this._initialFilter = new BehaviorSubject(undefined);
|
|
2150
355
|
this._defaultFilter = new BehaviorSubject(undefined);
|
|
2151
356
|
this.defaultFilter$ = this._defaultFilter.pipe(switchMapFilterMaybe());
|
|
2152
|
-
this.initialFilter$ = combineLatest([this._initialFilter, this._defaultFilter]).pipe(map
|
|
357
|
+
this.initialFilter$ = combineLatest([this._initialFilter, this._defaultFilter]).pipe(map(([a, b]) => a ?? b), switchMapFilterMaybe(), distinctUntilChanged(), shareReplay(1));
|
|
2153
358
|
/**
|
|
2154
359
|
* filter$ uses the latest value from any filter.
|
|
2155
360
|
*/
|
|
@@ -2197,7 +402,7 @@ class FilterSourceInstance {
|
|
|
2197
402
|
if (!this._initialFilterSub.subscription) {
|
|
2198
403
|
this._initialFilterSub.subscription = this._initialFilterTakesPriority.pipe(switchMap(clearFilterOnInitialFilterPush => {
|
|
2199
404
|
if (clearFilterOnInitialFilterPush) {
|
|
2200
|
-
return this._initialFilter.pipe(switchMap(x => x ? x : EMPTY), filterMaybe(), map
|
|
405
|
+
return this._initialFilter.pipe(switchMap(x => x ? x : EMPTY), filterMaybe(), map(() => true), skip(1) // skip the first emission
|
|
2201
406
|
);
|
|
2202
407
|
} else {
|
|
2203
408
|
return EMPTY;
|
|
@@ -2217,13 +422,6 @@ class FilterSourceInstance {
|
|
|
2217
422
|
this._initialFilter.complete();
|
|
2218
423
|
this._defaultFilter.complete();
|
|
2219
424
|
}
|
|
2220
|
-
// MARK: Compat
|
|
2221
|
-
/**
|
|
2222
|
-
* @deprecated use setInitialFilterTakesPriority instead.
|
|
2223
|
-
*/
|
|
2224
|
-
set initialFilterTakesPriority(initialFilterTakesPriority) {
|
|
2225
|
-
this.setInitialFilterTakesPriority(initialFilterTakesPriority);
|
|
2226
|
-
}
|
|
2227
425
|
}
|
|
2228
426
|
|
|
2229
427
|
/**
|
|
@@ -2234,7 +432,7 @@ class FilterMap {
|
|
|
2234
432
|
this._map = new BehaviorSubject(new Map());
|
|
2235
433
|
}
|
|
2236
434
|
filterForKey(key) {
|
|
2237
|
-
return this._map.pipe(map
|
|
435
|
+
return this._map.pipe(map(x => x.get(key)), filterMaybe(), first(),
|
|
2238
436
|
// take first since the item never changes.
|
|
2239
437
|
switchMap(x => x.filter$), filterMaybe());
|
|
2240
438
|
}
|
|
@@ -2248,7 +446,7 @@ class FilterMap {
|
|
|
2248
446
|
return new FilterMapKeyInstance(this, key);
|
|
2249
447
|
}
|
|
2250
448
|
instanceObsForKeyObs(keyObs) {
|
|
2251
|
-
return keyObs.pipe(distinctUntilChanged(), map
|
|
449
|
+
return keyObs.pipe(distinctUntilChanged(), map(x => this.makeInstance(x)), shareReplay(1));
|
|
2252
450
|
}
|
|
2253
451
|
// MARK: Internal
|
|
2254
452
|
_itemForKey(key) {
|
|
@@ -2358,7 +556,7 @@ function makeMapFilterWithPresetFn(fn) {
|
|
|
2358
556
|
};
|
|
2359
557
|
}
|
|
2360
558
|
function mapFilterWithPreset(fn) {
|
|
2361
|
-
return map
|
|
559
|
+
return map(makeMapFilterWithPresetFn(fn));
|
|
2362
560
|
}
|
|
2363
561
|
|
|
2364
562
|
/**
|
|
@@ -2490,7 +688,7 @@ function scanBuildArray(init) {
|
|
|
2490
688
|
}
|
|
2491
689
|
}
|
|
2492
690
|
return acc;
|
|
2493
|
-
}, seed ?? []), distinctUntilArrayLengthChanges(), map
|
|
691
|
+
}, seed ?? []), distinctUntilArrayLengthChanges(), map(x => [...x]),
|
|
2494
692
|
// always create a copy of the accumulated array when emitting
|
|
2495
693
|
shareReplay(1));
|
|
2496
694
|
});
|
|
@@ -2503,7 +701,7 @@ function scanBuildArray(init) {
|
|
|
2503
701
|
* @returns
|
|
2504
702
|
*/
|
|
2505
703
|
function mapForEach(forEach) {
|
|
2506
|
-
return forEach ? map
|
|
704
|
+
return forEach ? map(x => forEachWithArray(x, forEach)) : map(x => x);
|
|
2507
705
|
}
|
|
2508
706
|
/**
|
|
2509
707
|
* Operator function that maps each value in the array independently using Observables, then combines the all results.
|
|
@@ -2581,7 +779,7 @@ function onMatchDelta(config) {
|
|
|
2581
779
|
value: 0
|
|
2582
780
|
}), filter(({
|
|
2583
781
|
emit
|
|
2584
|
-
}) => Boolean(emit)), map
|
|
782
|
+
}) => Boolean(emit)), map(({
|
|
2585
783
|
value
|
|
2586
784
|
}) => value));
|
|
2587
785
|
};
|
|
@@ -2597,7 +795,7 @@ function pipeIf(usePipe, pipe) {
|
|
|
2597
795
|
* Maps the opposite value of the input boolean.
|
|
2598
796
|
*/
|
|
2599
797
|
function isNot() {
|
|
2600
|
-
return map
|
|
798
|
+
return map(x => !x);
|
|
2601
799
|
}
|
|
2602
800
|
/**
|
|
2603
801
|
* Emits a value when moving from a true value to a false value.
|
|
@@ -2631,7 +829,7 @@ function invertObservableDecision(decisionFn, invert = true) {
|
|
|
2631
829
|
if (invert) {
|
|
2632
830
|
return value => {
|
|
2633
831
|
const obs = decisionFn(value);
|
|
2634
|
-
return obs.pipe(map
|
|
832
|
+
return obs.pipe(map(x => !x));
|
|
2635
833
|
};
|
|
2636
834
|
} else {
|
|
2637
835
|
return decisionFn;
|
|
@@ -2648,11 +846,11 @@ function filterItemsWithObservableDecision(observableDecisionFunction, throttle
|
|
|
2648
846
|
return switchMap(values => {
|
|
2649
847
|
let obs;
|
|
2650
848
|
if (values.length) {
|
|
2651
|
-
const valueObs = values.map(x => observableDecisionFunction(x).pipe(map
|
|
849
|
+
const valueObs = values.map(x => observableDecisionFunction(x).pipe(map(y => [x, y])));
|
|
2652
850
|
obs = combineLatest(valueObs).pipe(throttleTime(throttle, undefined, {
|
|
2653
851
|
leading: true,
|
|
2654
852
|
trailing: true
|
|
2655
|
-
}), map
|
|
853
|
+
}), map(filterAndMap));
|
|
2656
854
|
} else {
|
|
2657
855
|
obs = of([]);
|
|
2658
856
|
}
|
|
@@ -2660,6 +858,79 @@ function filterItemsWithObservableDecision(observableDecisionFunction, throttle
|
|
|
2660
858
|
});
|
|
2661
859
|
}
|
|
2662
860
|
|
|
861
|
+
/**
|
|
862
|
+
* Creates a new Expires object at the current time on emission that will expire in the set amount of time.
|
|
863
|
+
*
|
|
864
|
+
* @param expiresIn
|
|
865
|
+
* @returns
|
|
866
|
+
*/
|
|
867
|
+
function toExpiration(expiresIn) {
|
|
868
|
+
return map(() => {
|
|
869
|
+
const now = new Date();
|
|
870
|
+
const expirationDate = expirationDetails({
|
|
871
|
+
expiresFromDate: now,
|
|
872
|
+
expiresIn
|
|
873
|
+
}).getExpirationDate();
|
|
874
|
+
return {
|
|
875
|
+
expiresAt: expirationDate
|
|
876
|
+
};
|
|
877
|
+
});
|
|
878
|
+
}
|
|
879
|
+
/**
|
|
880
|
+
* Filters further emissions once the input is expired.
|
|
881
|
+
*/
|
|
882
|
+
function skipExpired() {
|
|
883
|
+
return filter(expires => !expirationDetails({
|
|
884
|
+
expires
|
|
885
|
+
}).hasExpired());
|
|
886
|
+
}
|
|
887
|
+
/**
|
|
888
|
+
* Skips the input date or timenumber until expiration occurs.
|
|
889
|
+
*/
|
|
890
|
+
function skipUntilExpiration(expiresIn) {
|
|
891
|
+
return filter(x => expirationDetails({
|
|
892
|
+
expiresFromDate: x,
|
|
893
|
+
expiresIn
|
|
894
|
+
}).hasExpired());
|
|
895
|
+
}
|
|
896
|
+
/**
|
|
897
|
+
* Skips the input date or timenumber after expiration occurs.
|
|
898
|
+
*/
|
|
899
|
+
function skipAfterExpiration(expiresIn) {
|
|
900
|
+
return filter(x => !expirationDetails({
|
|
901
|
+
expiresFromDate: x,
|
|
902
|
+
expiresIn
|
|
903
|
+
}).hasExpired());
|
|
904
|
+
}
|
|
905
|
+
/**
|
|
906
|
+
* Skips emissions until time since the last emission from the watch observable has elapsed.
|
|
907
|
+
*/
|
|
908
|
+
function skipUntilTimeElapsedAfterLastEmission(watch, takeFor) {
|
|
909
|
+
return observable => {
|
|
910
|
+
return watch.pipe(switchMap(() => {
|
|
911
|
+
const details = expirationDetails({
|
|
912
|
+
expiresFromDate: new Date(),
|
|
913
|
+
expiresIn: takeFor
|
|
914
|
+
});
|
|
915
|
+
return observable.pipe(takeWhile(() => !details.hasExpired()));
|
|
916
|
+
}));
|
|
917
|
+
};
|
|
918
|
+
}
|
|
919
|
+
/**
|
|
920
|
+
* Takes emissions until time since the last emission from the watch observable has elapsed.
|
|
921
|
+
*/
|
|
922
|
+
function takeAfterTimeElapsedSinceLastEmission(watch, skipFor) {
|
|
923
|
+
return observable => {
|
|
924
|
+
return watch.pipe(switchMap(() => {
|
|
925
|
+
const details = expirationDetails({
|
|
926
|
+
expiresFromDate: new Date(),
|
|
927
|
+
expiresIn: skipFor
|
|
928
|
+
});
|
|
929
|
+
return observable.pipe(skipWhile(() => !details.hasExpired()));
|
|
930
|
+
}));
|
|
931
|
+
};
|
|
932
|
+
}
|
|
933
|
+
|
|
2663
934
|
/**
|
|
2664
935
|
* Used to pass a default value incase an observable has not yet started emititng values.
|
|
2665
936
|
*/
|
|
@@ -2680,7 +951,7 @@ function tapAfterTimeout(timeoutDelay, useFn) {
|
|
|
2680
951
|
function throwErrorAfterTimeout(timeoutDelay, error) {
|
|
2681
952
|
return timeout({
|
|
2682
953
|
first: timeoutDelay,
|
|
2683
|
-
with: () => of(null).pipe(map
|
|
954
|
+
with: () => of(null).pipe(map(() => throwError(error)), filterMaybe())
|
|
2684
955
|
});
|
|
2685
956
|
}
|
|
2686
957
|
|
|
@@ -2702,7 +973,7 @@ function factoryTimer(config) {
|
|
|
2702
973
|
if (limit) {
|
|
2703
974
|
obs = obs.pipe(takeWhile(x => x < limit));
|
|
2704
975
|
}
|
|
2705
|
-
return obs.pipe(map
|
|
976
|
+
return obs.pipe(map(i => factory(i)));
|
|
2706
977
|
}
|
|
2707
978
|
|
|
2708
979
|
/**
|
|
@@ -2777,7 +1048,7 @@ function cleanupDestroyable(wait) {
|
|
|
2777
1048
|
*/
|
|
2778
1049
|
function isLoading() {
|
|
2779
1050
|
return source => {
|
|
2780
|
-
return source.pipe(first(), map
|
|
1051
|
+
return source.pipe(first(), map(() => false), startWith(true), distinctUntilChanged(), shareReplay(1));
|
|
2781
1052
|
};
|
|
2782
1053
|
}
|
|
2783
1054
|
|
|
@@ -2824,7 +1095,7 @@ function distinctUntilModelKeyChange() {
|
|
|
2824
1095
|
* @returns
|
|
2825
1096
|
*/
|
|
2826
1097
|
function mapKeysIntersectionToArray(keysObs) {
|
|
2827
|
-
return switchMap(object => asObservable(keysObs).pipe(map
|
|
1098
|
+
return switchMap(object => asObservable(keysObs).pipe(map(keys => mapKeysIntersectionObjectToArray(object, keys)), shareReplay(1)));
|
|
2828
1099
|
}
|
|
2829
1100
|
/**
|
|
2830
1101
|
* Operatorfunction using distinctUntilChanged to check that two maps have the same keys.
|
|
@@ -2892,7 +1163,7 @@ function tapFirst(tap, skipFirst = false) {
|
|
|
2892
1163
|
*/
|
|
2893
1164
|
function preventComplete(obs) {
|
|
2894
1165
|
const complete = new BehaviorSubject(0);
|
|
2895
|
-
return combineLatest([obs, complete]).pipe(map
|
|
1166
|
+
return combineLatest([obs, complete]).pipe(map(([x]) => x), shareReplay(1), finalize(() => {
|
|
2896
1167
|
complete.complete();
|
|
2897
1168
|
}));
|
|
2898
1169
|
}
|
|
@@ -2916,7 +1187,7 @@ function lazyFrom(getter) {
|
|
|
2916
1187
|
*/
|
|
2917
1188
|
function filterUnique(readKey, additionalKeysInput) {
|
|
2918
1189
|
const filterFn = filterUniqueFunction(readKey, additionalKeysInput);
|
|
2919
|
-
return map
|
|
1190
|
+
return map(x => filterFn(x));
|
|
2920
1191
|
}
|
|
2921
1192
|
|
|
2922
1193
|
/**
|
|
@@ -2938,7 +1209,7 @@ function asyncPusher(config = {}) {
|
|
|
2938
1209
|
} = config;
|
|
2939
1210
|
const _subject = new BehaviorSubject(undefined);
|
|
2940
1211
|
const _sub = new SubscriptionObject();
|
|
2941
|
-
let obs = _subject.pipe(
|
|
1212
|
+
let obs = _subject.pipe(skipAllInitialMaybe(), throttleTime(throttle, undefined, {
|
|
2942
1213
|
leading: false,
|
|
2943
1214
|
trailing: true
|
|
2944
1215
|
}));
|
|
@@ -3012,8 +1283,8 @@ function combineLatestFromArrayObsFn(mapToObs) {
|
|
|
3012
1283
|
}
|
|
3013
1284
|
function combineLatestFromObject(objectMap) {
|
|
3014
1285
|
const pairs = allKeyValueTuples(objectMap);
|
|
3015
|
-
const observables = pairs.map(x => asObservable(x[1]).pipe(map
|
|
3016
|
-
return combineLatest(observables).pipe(map
|
|
1286
|
+
const observables = pairs.map(x => asObservable(x[1]).pipe(map(value => [x[0], value])));
|
|
1287
|
+
return combineLatest(observables).pipe(map(latestValues => {
|
|
3017
1288
|
const result = {};
|
|
3018
1289
|
latestValues.forEach(([key, value]) => {
|
|
3019
1290
|
result[key] = value;
|
|
@@ -3029,7 +1300,7 @@ function combineLatestFromObject(objectMap) {
|
|
|
3029
1300
|
* @returns
|
|
3030
1301
|
*/
|
|
3031
1302
|
function keyValueMap(read) {
|
|
3032
|
-
return map
|
|
1303
|
+
return map(keyValueMapFactory(read));
|
|
3033
1304
|
}
|
|
3034
1305
|
/**
|
|
3035
1306
|
* Convenience function for creating a map() operator function using multiKeyValueMapFactory().
|
|
@@ -3038,7 +1309,7 @@ function keyValueMap(read) {
|
|
|
3038
1309
|
* @returns
|
|
3039
1310
|
*/
|
|
3040
1311
|
function multiKeyValueMap(read) {
|
|
3041
|
-
return map
|
|
1312
|
+
return map(multiKeyValueMapFactory(read));
|
|
3042
1313
|
}
|
|
3043
1314
|
|
|
3044
1315
|
function errorOnEmissionsInPeriod(config) {
|
|
@@ -3055,7 +1326,7 @@ function errorOnEmissionsInPeriod(config) {
|
|
|
3055
1326
|
return source => {
|
|
3056
1327
|
const counter = timePeriodCounter(period);
|
|
3057
1328
|
if (errorFactory) {
|
|
3058
|
-
return source.pipe(map
|
|
1329
|
+
return source.pipe(map(x => {
|
|
3059
1330
|
if (counter() > maxEmissionsPerPeriod) {
|
|
3060
1331
|
const error = errorFactory();
|
|
3061
1332
|
onError?.(error);
|
|
@@ -3106,7 +1377,7 @@ function filterWithSearchString(config) {
|
|
|
3106
1377
|
} = config;
|
|
3107
1378
|
const filterFactory = searchStringFilterFunction(filter);
|
|
3108
1379
|
return switchMap(values => {
|
|
3109
|
-
return search$.pipe(map
|
|
1380
|
+
return search$.pipe(map(search => {
|
|
3110
1381
|
if (search != null) {
|
|
3111
1382
|
return filterFactory(search, values);
|
|
3112
1383
|
} else {
|
|
@@ -3506,67 +1777,6 @@ function mapLoadingStateValueFunction(mapFn) {
|
|
|
3506
1777
|
return result;
|
|
3507
1778
|
};
|
|
3508
1779
|
}
|
|
3509
|
-
// MARK: Compat
|
|
3510
|
-
/**
|
|
3511
|
-
* @deprecated use unknownLoadingStatesIsLoading instead.
|
|
3512
|
-
*/
|
|
3513
|
-
const unknownLoadingStatesIsLoading = isAnyLoadingStateInLoadingState;
|
|
3514
|
-
/**
|
|
3515
|
-
* @deprecated use areAllLoadingStatesFinishedLoading instead.
|
|
3516
|
-
*/
|
|
3517
|
-
const allLoadingStatesHaveFinishedLoading = areAllLoadingStatesFinishedLoading;
|
|
3518
|
-
/**
|
|
3519
|
-
* @deprecated use isLoadingStateInIdleState instead.
|
|
3520
|
-
*/
|
|
3521
|
-
const loadingStateIsIdle = isLoadingStateInIdleState;
|
|
3522
|
-
/**
|
|
3523
|
-
* @deprecated use isLoadingStateInSuccessState instead.
|
|
3524
|
-
*/
|
|
3525
|
-
const isSuccessLoadingState = isLoadingStateInSuccessState;
|
|
3526
|
-
/**
|
|
3527
|
-
* @deprecated use isLoadingStateInErrorState instead.
|
|
3528
|
-
*/
|
|
3529
|
-
const isErrorLoadingState = isLoadingStateInErrorState;
|
|
3530
|
-
/**
|
|
3531
|
-
* @deprecated Use isLoadingStateLoading instead.
|
|
3532
|
-
*/
|
|
3533
|
-
const loadingStateIsLoading = isLoadingStateLoading;
|
|
3534
|
-
/**
|
|
3535
|
-
* @deprecated use isLoadingStateFinishedLoading instead.
|
|
3536
|
-
*/
|
|
3537
|
-
const loadingStateHasFinishedLoading = isLoadingStateFinishedLoading;
|
|
3538
|
-
/**
|
|
3539
|
-
* @deprecated use isLoadingStateWithError instead.
|
|
3540
|
-
*/
|
|
3541
|
-
const loadingStateHasError = isLoadingStateWithError;
|
|
3542
|
-
/**
|
|
3543
|
-
* @deprecated use isLoadingStateWithDefinedValue instead.
|
|
3544
|
-
*/
|
|
3545
|
-
const loadingStateHasValue = isLoadingStateWithDefinedValue;
|
|
3546
|
-
/**
|
|
3547
|
-
* @deprecated use isLoadingStateFinishedLoadingWithDefinedValue instead.
|
|
3548
|
-
*/
|
|
3549
|
-
const loadingStateHasFinishedLoadingWithValue = isLoadingStateFinishedLoadingWithDefinedValue;
|
|
3550
|
-
/**
|
|
3551
|
-
* @deprecated use isLoadingStateFinishedLoadingWithError instead.
|
|
3552
|
-
*/
|
|
3553
|
-
const loadingStateHasFinishedLoadingWithError = isLoadingStateFinishedLoadingWithError;
|
|
3554
|
-
/**
|
|
3555
|
-
* @deprecated use isPageLoadingStateMetadataEqual instead.
|
|
3556
|
-
*/
|
|
3557
|
-
const loadingStatesHaveEquivalentMetadata = isPageLoadingStateMetadataEqual;
|
|
3558
|
-
/**
|
|
3559
|
-
* @deprecated use mergeLoadingStateWithLoading instead.
|
|
3560
|
-
*/
|
|
3561
|
-
const updatedStateForSetLoading = mergeLoadingStateWithLoading;
|
|
3562
|
-
/**
|
|
3563
|
-
* @deprecated use updatedStateForSetValue instead.
|
|
3564
|
-
*/
|
|
3565
|
-
const updatedStateForSetValue = mergeLoadingStateWithValue;
|
|
3566
|
-
/**
|
|
3567
|
-
* @deprecated use mergeLoadingStateWithError instead.
|
|
3568
|
-
*/
|
|
3569
|
-
const updatedStateForSetError = mergeLoadingStateWithError;
|
|
3570
1780
|
|
|
3571
1781
|
// TODO(BREAKING_CHANGE): Fix all LoadingState types to use the LoadingStateValue inference typings
|
|
3572
1782
|
/**
|
|
@@ -3578,7 +1788,7 @@ function loadingStateFromObs(obs, firstOnly) {
|
|
|
3578
1788
|
if (firstOnly) {
|
|
3579
1789
|
obs = obs.pipe(first());
|
|
3580
1790
|
}
|
|
3581
|
-
return obs.pipe(map
|
|
1791
|
+
return obs.pipe(map(value => successResult(value)), catchError(error => of(errorResult(error))), timeoutStartWith(beginLoading(), 50), shareReplay(1));
|
|
3582
1792
|
}
|
|
3583
1793
|
function combineLoadingStates(...args) {
|
|
3584
1794
|
const validArgs = filterMaybeArrayValues(args); // filter out any undefined values
|
|
@@ -3594,7 +1804,7 @@ function combineLoadingStates(...args) {
|
|
|
3594
1804
|
}
|
|
3595
1805
|
}),
|
|
3596
1806
|
// Prevent remerging the same values!
|
|
3597
|
-
map
|
|
1807
|
+
map(states => {
|
|
3598
1808
|
const result = mergeLoadingStates(...states, mergeFn);
|
|
3599
1809
|
return result;
|
|
3600
1810
|
}), shareReplay(1) // Share the result.
|
|
@@ -3607,7 +1817,7 @@ function combineLoadingStates(...args) {
|
|
|
3607
1817
|
* @returns
|
|
3608
1818
|
*/
|
|
3609
1819
|
function combineLoadingStatesStatus(sources) {
|
|
3610
|
-
return combineLatest(sources).pipe(map
|
|
1820
|
+
return combineLatest(sources).pipe(map(allLoadingStates => {
|
|
3611
1821
|
const firstErrorState = allLoadingStates.find(x => x.error);
|
|
3612
1822
|
let result;
|
|
3613
1823
|
if (firstErrorState) {
|
|
@@ -3631,7 +1841,7 @@ function startWithBeginLoading(state) {
|
|
|
3631
1841
|
*/
|
|
3632
1842
|
function currentValueFromLoadingState() {
|
|
3633
1843
|
return obs => {
|
|
3634
|
-
return obs.pipe(map
|
|
1844
|
+
return obs.pipe(map(x => x.value));
|
|
3635
1845
|
};
|
|
3636
1846
|
}
|
|
3637
1847
|
/**
|
|
@@ -3641,7 +1851,7 @@ function currentValueFromLoadingState() {
|
|
|
3641
1851
|
*/
|
|
3642
1852
|
function valueFromLoadingState() {
|
|
3643
1853
|
return obs => {
|
|
3644
|
-
return obs.pipe(map
|
|
1854
|
+
return obs.pipe(map(x => x.value), filterMaybeStrict());
|
|
3645
1855
|
};
|
|
3646
1856
|
}
|
|
3647
1857
|
/**
|
|
@@ -3649,7 +1859,7 @@ function valueFromLoadingState() {
|
|
|
3649
1859
|
*/
|
|
3650
1860
|
function errorFromLoadingState() {
|
|
3651
1861
|
return obs => {
|
|
3652
|
-
return obs.pipe(filter(isLoadingStateWithError), map
|
|
1862
|
+
return obs.pipe(filter(isLoadingStateWithError), map(x => x.error));
|
|
3653
1863
|
};
|
|
3654
1864
|
}
|
|
3655
1865
|
/**
|
|
@@ -3657,7 +1867,7 @@ function errorFromLoadingState() {
|
|
|
3657
1867
|
*/
|
|
3658
1868
|
function throwErrorFromLoadingStateError() {
|
|
3659
1869
|
return obs => {
|
|
3660
|
-
return obs.pipe(map
|
|
1870
|
+
return obs.pipe(map(x => {
|
|
3661
1871
|
if (isLoadingStateWithError(x)) {
|
|
3662
1872
|
throw x.error;
|
|
3663
1873
|
}
|
|
@@ -3667,7 +1877,7 @@ function throwErrorFromLoadingStateError() {
|
|
|
3667
1877
|
}
|
|
3668
1878
|
function valueFromFinishedLoadingState(defaultValue) {
|
|
3669
1879
|
return obs => {
|
|
3670
|
-
return obs.pipe(filter(isLoadingStateFinishedLoading), map
|
|
1880
|
+
return obs.pipe(filter(isLoadingStateFinishedLoading), map(x => x.value ?? getValueFromGetter(defaultValue)));
|
|
3671
1881
|
};
|
|
3672
1882
|
}
|
|
3673
1883
|
function tapOnLoadingStateType(fn, type) {
|
|
@@ -3687,7 +1897,7 @@ function tapOnLoadingStateSuccess(fn) {
|
|
|
3687
1897
|
return tapOnLoadingStateType(fn, LoadingStateType.SUCCESS);
|
|
3688
1898
|
}
|
|
3689
1899
|
function mapLoadingState(config) {
|
|
3690
|
-
return map
|
|
1900
|
+
return map(state => mapLoadingStateResults(state, config));
|
|
3691
1901
|
}
|
|
3692
1902
|
function mapLoadingStateValueWithOperator(operator, mapOnUndefined = false) {
|
|
3693
1903
|
return obs => {
|
|
@@ -3695,7 +1905,7 @@ function mapLoadingStateValueWithOperator(operator, mapOnUndefined = false) {
|
|
|
3695
1905
|
let mappedObs;
|
|
3696
1906
|
if (isLoadingStateWithDefinedValue(state) || mapOnUndefined && isLoadingStateFinishedLoading(state) && !isLoadingStateWithError(state)) {
|
|
3697
1907
|
// map the value
|
|
3698
|
-
mappedObs = of(state.value).pipe(operator, map
|
|
1908
|
+
mappedObs = of(state.value).pipe(operator, map(value => ({
|
|
3699
1909
|
...state,
|
|
3700
1910
|
value
|
|
3701
1911
|
})),
|
|
@@ -3791,7 +2001,7 @@ function distinctLoadingState(inputConfig) {
|
|
|
3791
2001
|
// only pipe through when the value is different or the loading state metadata is different
|
|
3792
2002
|
filter(x => !(x.isSameValue && x.isSameLoadingStateMetadata)),
|
|
3793
2003
|
// pass the current state
|
|
3794
|
-
map
|
|
2004
|
+
map(x => x.current));
|
|
3795
2005
|
};
|
|
3796
2006
|
}
|
|
3797
2007
|
/**
|
|
@@ -3849,7 +2059,7 @@ function loadingStateContext(input) {
|
|
|
3849
2059
|
obs: input
|
|
3850
2060
|
} : input;
|
|
3851
2061
|
const loadingEventForLoadingPair = _config?.loadingEventForLoadingPair ?? DEFAULT_LOADING_EVENT_FOR_LOADING_PAIR_FUNCTION;
|
|
3852
|
-
const showLoadingOnUndefinedValue = _config?.showLoadingOnUndefinedValue ??
|
|
2062
|
+
const showLoadingOnUndefinedValue = _config?.showLoadingOnUndefinedValue ?? false;
|
|
3853
2063
|
const _stateStream = new BehaviorSubject(_config?.obs);
|
|
3854
2064
|
const currentStateStream$ = _stateStream.asObservable();
|
|
3855
2065
|
const stateStream$ = currentStateStream$.pipe(filterMaybe());
|
|
@@ -3858,7 +2068,7 @@ function loadingStateContext(input) {
|
|
|
3858
2068
|
if (obs) {
|
|
3859
2069
|
result = obs.pipe(filterMaybe(),
|
|
3860
2070
|
// If the observable did not pass a value immediately, we start with the start value.
|
|
3861
|
-
timeoutStartWith(beginLoading()), map
|
|
2071
|
+
timeoutStartWith(beginLoading()), map(x => loadingEventForLoadingPair(x, {
|
|
3862
2072
|
showLoadingOnUndefinedValue
|
|
3863
2073
|
})));
|
|
3864
2074
|
} else {
|
|
@@ -3868,7 +2078,7 @@ function loadingStateContext(input) {
|
|
|
3868
2078
|
}), distinctUntilChanged(isLoadingStateEqual), shareReplay(1));
|
|
3869
2079
|
const currentState$ = currentStateStream$.pipe(switchMap(x => x ? x : of(undefined)));
|
|
3870
2080
|
const state$ = currentState$.pipe(filterMaybe(), shareReplay(1));
|
|
3871
|
-
const loading$ = eventStream$.pipe(map
|
|
2081
|
+
const loading$ = eventStream$.pipe(map(isLoadingStateLoading));
|
|
3872
2082
|
const currentValue$ = state$.pipe(currentValueFromLoadingState(), shareReplay(1));
|
|
3873
2083
|
const valueAfterLoaded$ = state$.pipe(valueFromFinishedLoadingState(), shareReplay(1));
|
|
3874
2084
|
const value$ = valueAfterLoaded$.pipe(filterMaybe(), shareReplay(1));
|
|
@@ -3909,13 +2119,13 @@ function isListLoadingStateWithEmptyValue(listLoadingState) {
|
|
|
3909
2119
|
* @returns
|
|
3910
2120
|
*/
|
|
3911
2121
|
function mapIsListLoadingStateWithEmptyValue() {
|
|
3912
|
-
return map
|
|
2122
|
+
return map(isListLoadingStateWithEmptyValue);
|
|
3913
2123
|
}
|
|
3914
2124
|
/**
|
|
3915
2125
|
* Wraps an observable output and maps the value to a PageLoadingState.
|
|
3916
2126
|
*/
|
|
3917
2127
|
function pageLoadingStateFromObs(obs, firstOnly, page = 0) {
|
|
3918
|
-
return loadingStateFromObs(obs, firstOnly).pipe(map
|
|
2128
|
+
return loadingStateFromObs(obs, firstOnly).pipe(map(x => {
|
|
3919
2129
|
x.page = page;
|
|
3920
2130
|
return x;
|
|
3921
2131
|
}));
|
|
@@ -3932,15 +2142,6 @@ function arrayValueFromFinishedLoadingState() {
|
|
|
3932
2142
|
return obs.pipe(valueFromFinishedLoadingState(() => []));
|
|
3933
2143
|
};
|
|
3934
2144
|
}
|
|
3935
|
-
// MARK: Compat
|
|
3936
|
-
/**
|
|
3937
|
-
* @deprecated use isListLoadingStateWithEmptyValue instead.
|
|
3938
|
-
*/
|
|
3939
|
-
const listLoadingStateIsEmpty = isListLoadingStateWithEmptyValue;
|
|
3940
|
-
/**
|
|
3941
|
-
* @deprecated use mapIsListLoadingStateWithEmptyValue instead.
|
|
3942
|
-
*/
|
|
3943
|
-
const isListLoadingStateEmpty = mapIsListLoadingStateWithEmptyValue;
|
|
3944
2145
|
|
|
3945
2146
|
/**
|
|
3946
2147
|
* Creates a ListLoadingStateContext.
|
|
@@ -3963,12 +2164,12 @@ function listLoadingStateContext(input) {
|
|
|
3963
2164
|
});
|
|
3964
2165
|
const currentList$ = loadingState.value$;
|
|
3965
2166
|
const listAfterLoaded$ = loadingState.valueAfterLoaded$;
|
|
3966
|
-
const list$ = loadingState.valueAfterLoaded$.pipe(map
|
|
2167
|
+
const list$ = loadingState.valueAfterLoaded$.pipe(map(x => x ?? []));
|
|
3967
2168
|
const isEmpty$ = loadingState.stream$.pipe(skipWhile(x => isLoadingStateLoading(x)),
|
|
3968
2169
|
// skip until the first non-loading event has occured
|
|
3969
2170
|
mapIsListLoadingStateWithEmptyValue(), distinctUntilChanged());
|
|
3970
|
-
const isEmptyLoading$ = loadingState.stream$.pipe(map
|
|
3971
|
-
const isEmptyAndNotLoading$ = loadingState.stream$.pipe(map
|
|
2171
|
+
const isEmptyLoading$ = loadingState.stream$.pipe(map(x => isLoadingStateLoading(x) && isListLoadingStateWithEmptyValue(x)), distinctUntilChanged(), shareReplay(1));
|
|
2172
|
+
const isEmptyAndNotLoading$ = loadingState.stream$.pipe(map(x => !isLoadingStateLoading(x) && isListLoadingStateWithEmptyValue(x)), distinctUntilChanged());
|
|
3972
2173
|
const result = {
|
|
3973
2174
|
...loadingState,
|
|
3974
2175
|
currentList$,
|
|
@@ -4057,7 +2258,7 @@ class ValuesLoadingContext extends SimpleLoadingContext {
|
|
|
4057
2258
|
|
|
4058
2259
|
function itemAccumulator(itemIteration, inputMapItem) {
|
|
4059
2260
|
const mapItemFunction = inputMapItem ?? (a => a);
|
|
4060
|
-
const hasCompletedInitialLoad$ = itemIteration.firstState$.pipe(map
|
|
2261
|
+
const hasCompletedInitialLoad$ = itemIteration.firstState$.pipe(map(() => true), startWith(false), distinctUntilChanged(), shareReplay(1));
|
|
4061
2262
|
const latestSuccessfulState$ = itemIteration.latestState$.pipe(filter(x => !isLoadingStateWithError(x)), distinctUntilChanged(), shareReplay(1));
|
|
4062
2263
|
const _allSuccessfulStates$ = latestSuccessfulState$.pipe(scanIntoArray({
|
|
4063
2264
|
immutable: false
|
|
@@ -4066,10 +2267,10 @@ function itemAccumulator(itemIteration, inputMapItem) {
|
|
|
4066
2267
|
* Don't wait for the first successful state in order to avoid never returning a value on immediate failures.
|
|
4067
2268
|
*/
|
|
4068
2269
|
startWith([]), distinctUntilArrayLengthChanges(), shareReplay(1));
|
|
4069
|
-
const allSuccessfulStates$ = _allSuccessfulStates$.pipe(map
|
|
2270
|
+
const allSuccessfulStates$ = _allSuccessfulStates$.pipe(map(x => [...x]),
|
|
4070
2271
|
// return a copy of the array, and not the scanIntoArray() result that is mutable
|
|
4071
2272
|
shareReplay(1));
|
|
4072
|
-
const successfulLoadCount$ = _allSuccessfulStates$.pipe(map
|
|
2273
|
+
const successfulLoadCount$ = _allSuccessfulStates$.pipe(map(x => x.length), shareReplay(1));
|
|
4073
2274
|
// MARK: ItemAccumulator
|
|
4074
2275
|
const currentAllItemPairs$ = _allSuccessfulStates$.pipe(scanBuildArray(allSuccessfulStates => {
|
|
4075
2276
|
const mapStateToItem = mapFunctionOutputPair(mapLoadingStateValueFunction(mapItemFunction));
|
|
@@ -4083,13 +2284,13 @@ function itemAccumulator(itemIteration, inputMapItem) {
|
|
|
4083
2284
|
const allPageResultsUpToFirstSubscription = allSuccessfulStates;
|
|
4084
2285
|
const firstLatestState = lastValue(allPageResultsUpToFirstSubscription);
|
|
4085
2286
|
const seed = allPageResultsUpToFirstSubscription.map(mapStateToItem).filter(x => isMaybeSo(x.output));
|
|
4086
|
-
const accumulatorObs = latestSuccessfulState$.pipe(skipWhile(x => x === firstLatestState), map
|
|
2287
|
+
const accumulatorObs = latestSuccessfulState$.pipe(skipWhile(x => x === firstLatestState), map(mapStateToItem), filter(x => isMaybeSo(x.output)));
|
|
4087
2288
|
return {
|
|
4088
2289
|
seed,
|
|
4089
2290
|
accumulatorObs
|
|
4090
2291
|
};
|
|
4091
2292
|
}), shareReplay(1));
|
|
4092
|
-
const currentAllItems$ = currentAllItemPairs$.pipe(map
|
|
2293
|
+
const currentAllItems$ = currentAllItemPairs$.pipe(map(x => x.map(y => y.output)), shareReplay(1));
|
|
4093
2294
|
const allItemPairs$ = hasCompletedInitialLoad$.pipe(switchMapWhileTrue(currentAllItemPairs$), shareReplay(1));
|
|
4094
2295
|
const allItems$ = hasCompletedInitialLoad$.pipe(switchMapWhileTrue(currentAllItems$), shareReplay(1));
|
|
4095
2296
|
const sub = new SubscriptionObject(_allSuccessfulStates$.subscribe());
|
|
@@ -4180,7 +2381,7 @@ function flattenAccumulatorResultItemArray(accumulator) {
|
|
|
4180
2381
|
const skipValue = firstLatestItemPair?.input;
|
|
4181
2382
|
const seed = flattenArray(pairs.map(x => x.output));
|
|
4182
2383
|
const mapStateToItem = mapLoadingStateValueFunction(accumulator.mapItemFunction);
|
|
4183
|
-
const accumulatorObs = accumulator.itemIteration.latestState$.pipe(skipWhile(x => x.value === skipValue), map
|
|
2384
|
+
const accumulatorObs = accumulator.itemIteration.latestState$.pipe(skipWhile(x => x.value === skipValue), map(mapStateToItem), filterMaybe());
|
|
4184
2385
|
return {
|
|
4185
2386
|
seed,
|
|
4186
2387
|
accumulatorObs,
|
|
@@ -4192,7 +2393,7 @@ function flattenAccumulatorResultItemArray(accumulator) {
|
|
|
4192
2393
|
* A PageListLoadingState that captures all the values that have been loaded so far, flattens them as an array, and the current loading state of currentPageResult$.
|
|
4193
2394
|
*/
|
|
4194
2395
|
function accumulatorFlattenPageListLoadingState(accumulator) {
|
|
4195
|
-
return combineLatest([accumulator.itemIteration.currentState$, flattenAccumulatorResultItemArray(accumulator)]).pipe(map
|
|
2396
|
+
return combineLatest([accumulator.itemIteration.currentState$, flattenAccumulatorResultItemArray(accumulator)]).pipe(map(([state, values]) => mapLoadingStateResults(state, {
|
|
4196
2397
|
alwaysMapValue: true,
|
|
4197
2398
|
mapValue: () => values
|
|
4198
2399
|
})), shareReplay(1));
|
|
@@ -4201,7 +2402,7 @@ function accumulatorFlattenPageListLoadingState(accumulator) {
|
|
|
4201
2402
|
* A PageListLoadingState that captures all the values that have been loaded so far, and the current loading state of currentPageResult$.
|
|
4202
2403
|
*/
|
|
4203
2404
|
function accumulatorCurrentPageListLoadingState(accumulator) {
|
|
4204
|
-
return combineLatest([accumulator.itemIteration.currentState$, accumulator.currentAllItems$]).pipe(map
|
|
2405
|
+
return combineLatest([accumulator.itemIteration.currentState$, accumulator.currentAllItems$]).pipe(map(([state, values]) => mapLoadingStateResults(state, {
|
|
4205
2406
|
alwaysMapValue: true,
|
|
4206
2407
|
mapValue: () => values
|
|
4207
2408
|
})), shareReplay(1));
|
|
@@ -4226,9 +2427,9 @@ function pageItemAccumulatorCurrentPage(pageItemAccumulator) {
|
|
|
4226
2427
|
function mapItemIteration(itemIterator, config) {
|
|
4227
2428
|
const hasNext$ = itemIterator.hasNext$;
|
|
4228
2429
|
const canLoadMore$ = itemIterator.canLoadMore$;
|
|
4229
|
-
const firstState$ = itemIterator.firstState$.pipe(map
|
|
4230
|
-
const latestState$ = itemIterator.latestState$.pipe(map
|
|
4231
|
-
const currentState$ = itemIterator.currentState$.pipe(map
|
|
2430
|
+
const firstState$ = itemIterator.firstState$.pipe(map(state => mapLoadingStateResults(state, config)), shareReplay(1));
|
|
2431
|
+
const latestState$ = itemIterator.latestState$.pipe(map(state => mapLoadingStateResults(state, config)), shareReplay(1));
|
|
2432
|
+
const currentState$ = itemIterator.currentState$.pipe(map(state => mapLoadingStateResults(state, config)), shareReplay(1));
|
|
4232
2433
|
function next(request) {
|
|
4233
2434
|
return itemIterator.next(request);
|
|
4234
2435
|
}
|
|
@@ -4274,11 +2475,6 @@ function mappedPageItemIteration(itemIteration, config) {
|
|
|
4274
2475
|
nextPage
|
|
4275
2476
|
};
|
|
4276
2477
|
}
|
|
4277
|
-
// MARK: Compat
|
|
4278
|
-
/**
|
|
4279
|
-
* @deprecated use mappedPageItemIteration instead.
|
|
4280
|
-
*/
|
|
4281
|
-
const mapPageItemIteration = mappedPageItemIteration;
|
|
4282
2478
|
|
|
4283
2479
|
// MARK: Iterator
|
|
4284
2480
|
/**
|
|
@@ -4334,7 +2530,7 @@ class ItemPageIterationInstance {
|
|
|
4334
2530
|
});
|
|
4335
2531
|
this._maxPageLoadLimit = new BehaviorSubject(undefined);
|
|
4336
2532
|
// MARK: State
|
|
4337
|
-
this.state$ = this._next.pipe(delay(0), exhaustMap(request => combineLatest([this.hasNextAndCanLoadMore$, this._lastFinishedPageResultState$]).pipe(first(), map
|
|
2533
|
+
this.state$ = this._next.pipe(delay(0), exhaustMap(request => combineLatest([this.hasNextAndCanLoadMore$, this._lastFinishedPageResultState$]).pipe(first(), map(([hasNextAndCanLoadMore, prevResult]) => [itemPageIteratorShouldLoadNextPage(request, hasNextAndCanLoadMore, prevResult), prevResult]), mergeMap(([shouldLoadNextPage, prevResult]) => {
|
|
4338
2534
|
if (shouldLoadNextPage) {
|
|
4339
2535
|
const nextPageNumber = nextIteratorPageNumber(prevResult); // retry number if error occured
|
|
4340
2536
|
const page = filteredPage(nextPageNumber, this._config);
|
|
@@ -4347,7 +2543,7 @@ class ItemPageIterationInstance {
|
|
|
4347
2543
|
}).pipe(catchError(error => of({
|
|
4348
2544
|
error
|
|
4349
2545
|
}).pipe(first())));
|
|
4350
|
-
const stateObs = iteratorResultObs.pipe(first(), map
|
|
2546
|
+
const stateObs = iteratorResultObs.pipe(first(), map(result => {
|
|
4351
2547
|
if (result.error != null) {
|
|
4352
2548
|
return {
|
|
4353
2549
|
loading: false,
|
|
@@ -4363,7 +2559,7 @@ class ItemPageIterationInstance {
|
|
|
4363
2559
|
} else {
|
|
4364
2560
|
return of(prevResult).pipe();
|
|
4365
2561
|
}
|
|
4366
|
-
}), map
|
|
2562
|
+
}), map(inputState => {
|
|
4367
2563
|
let state;
|
|
4368
2564
|
if (inputState != null) {
|
|
4369
2565
|
const end = inputState.value != null ? isItemPageIteratorResultEndResult(inputState.value) : undefined;
|
|
@@ -4432,15 +2628,15 @@ class ItemPageIterationInstance {
|
|
|
4432
2628
|
/**
|
|
4433
2629
|
* The first page results that finished loading.
|
|
4434
2630
|
*/
|
|
4435
|
-
this.firstPageResultState$ = this.state$.pipe(map
|
|
2631
|
+
this.firstPageResultState$ = this.state$.pipe(map(x => x.firstFinished), filterMaybe(), shareReplay(1));
|
|
4436
2632
|
/**
|
|
4437
2633
|
* The current page being loaded or the latest page finished loading.
|
|
4438
2634
|
*/
|
|
4439
|
-
this.currentPageResultState$ = this.state$.pipe(map
|
|
2635
|
+
this.currentPageResultState$ = this.state$.pipe(map(x => x.current), filterMaybe(), shareReplay(1));
|
|
4440
2636
|
/**
|
|
4441
2637
|
* The latest page results that has finished loading.
|
|
4442
2638
|
*/
|
|
4443
|
-
this.latestPageResultState$ = this.state$.pipe(map
|
|
2639
|
+
this.latestPageResultState$ = this.state$.pipe(map(x => x.latestFinished), filterMaybe(), distinctUntilChanged(), shareReplay(1));
|
|
4444
2640
|
/**
|
|
4445
2641
|
* Whether or not the final item has been loaded.
|
|
4446
2642
|
*
|
|
@@ -4448,44 +2644,44 @@ class ItemPageIterationInstance {
|
|
|
4448
2644
|
*
|
|
4449
2645
|
* Will emit every time the latest page has finished loading.
|
|
4450
2646
|
*/
|
|
4451
|
-
this.hasReachedEndResult$ = this.latestPageResultState$.pipe(map
|
|
2647
|
+
this.hasReachedEndResult$ = this.latestPageResultState$.pipe(map(x => !x.hasNextPage), startWith(false),
|
|
4452
2648
|
// Has not reached the end
|
|
4453
2649
|
shareReplay(1));
|
|
4454
2650
|
this._currentPageResultState$ = this.currentPageResultState$.pipe(startWith(undefined), shareReplay(1));
|
|
4455
2651
|
/**
|
|
4456
2652
|
* Whether or not items are currently being loaded.
|
|
4457
2653
|
*/
|
|
4458
|
-
this.isLoading$ = this._currentPageResultState$.pipe(map
|
|
2654
|
+
this.isLoading$ = this._currentPageResultState$.pipe(map(x => isLoadingStateLoading(x)), distinctUntilChanged(), shareReplay(1));
|
|
4459
2655
|
this._lastFinishedPageResultState$ = this.latestPageResultState$.pipe(startWith(undefined), shareReplay(1));
|
|
4460
|
-
this._lastFinishedPageResult$ = this._lastFinishedPageResultState$.pipe(map
|
|
4461
|
-
this._lastFinishedPageResultItem$ = this._lastFinishedPageResult$.pipe(map
|
|
2656
|
+
this._lastFinishedPageResult$ = this._lastFinishedPageResultState$.pipe(map(x => x?.value));
|
|
2657
|
+
this._lastFinishedPageResultItem$ = this._lastFinishedPageResult$.pipe(map(x => x?.value));
|
|
4462
2658
|
/**
|
|
4463
2659
|
* The first page results that has finished loading without an error.
|
|
4464
2660
|
*/
|
|
4465
|
-
this.firstSuccessfulPageResults$ = this.state$.pipe(map
|
|
2661
|
+
this.firstSuccessfulPageResults$ = this.state$.pipe(map(x => x.firstSuccessful), filterMaybe(), shareReplay(1));
|
|
4466
2662
|
/**
|
|
4467
2663
|
* The latest page results that has finished loading without an error.
|
|
4468
2664
|
*/
|
|
4469
|
-
this.latestSuccessfulPageResults$ = this.state$.pipe(map
|
|
2665
|
+
this.latestSuccessfulPageResults$ = this.state$.pipe(map(x => x.lastSuccessful), filterMaybe(), shareReplay(1));
|
|
4470
2666
|
this.currentState$ = this.currentPageResultState$.pipe(mapItemPageLoadingStateFromResultPageLoadingState(), shareReplay(1));
|
|
4471
|
-
this.latestLoadedPage$ = this.latestPageResultState$.pipe(map
|
|
4472
|
-
this.numberOfPagesLoaded$ = this.latestLoadedPage$.pipe(map
|
|
2667
|
+
this.latestLoadedPage$ = this.latestPageResultState$.pipe(map(x => x.page), distinctUntilChanged(), shareReplay(1));
|
|
2668
|
+
this.numberOfPagesLoaded$ = this.latestLoadedPage$.pipe(map(x => x + 1), defaultIfEmpty(0), shareReplay(1));
|
|
4473
2669
|
// MARK: ItemIteration
|
|
4474
2670
|
/**
|
|
4475
2671
|
* Whether or not there are more results to load.
|
|
4476
2672
|
*/
|
|
4477
|
-
this.hasNext$ = this.hasReachedEndResult$.pipe(map
|
|
2673
|
+
this.hasNext$ = this.hasReachedEndResult$.pipe(map(x => !x), defaultIfEmpty(false), shareReplay(1));
|
|
4478
2674
|
/**
|
|
4479
2675
|
* Whether or not the successfulPageResultsCount has passed the maxPageLoadLimit
|
|
4480
2676
|
*/
|
|
4481
|
-
this.canLoadMore$ = combineLatest([this._maxPageLoadLimit, this.numberOfPagesLoaded$.pipe(startWith(0))]).pipe(map
|
|
2677
|
+
this.canLoadMore$ = combineLatest([this._maxPageLoadLimit, this.numberOfPagesLoaded$.pipe(startWith(0))]).pipe(map(([maxPageLoadLimit, numberOfPagesLoaded]) => isMaybeNot(maxPageLoadLimit) ? true : numberOfPagesLoaded < maxPageLoadLimit), distinctUntilChanged(), shareReplay(1));
|
|
4482
2678
|
/**
|
|
4483
2679
|
* Observable of whether or not there are items that have finished loading, and if this iterator can load more.
|
|
4484
2680
|
*/
|
|
4485
2681
|
this.hasNextAndCanLoadMore$ = iterationHasNextAndCanLoadMore(this);
|
|
4486
2682
|
this.firstState$ = this.firstPageResultState$.pipe(mapItemPageLoadingStateFromResultPageLoadingState(), shareReplay(1));
|
|
4487
2683
|
this.latestState$ = this.latestPageResultState$.pipe(mapItemPageLoadingStateFromResultPageLoadingState(), shareReplay(1));
|
|
4488
|
-
this.latestItems$ = this.latestState$.pipe(distinctUntilChanged(), map
|
|
2684
|
+
this.latestItems$ = this.latestState$.pipe(distinctUntilChanged(), map(x => x.value), shareReplay(1));
|
|
4489
2685
|
this._iterator = iterator;
|
|
4490
2686
|
this._config = config;
|
|
4491
2687
|
this._maxPageLoadLimit.next(config.maxPageLoadLimit ?? iterator.getMaxPageLoadLimit());
|
|
@@ -4570,7 +2766,7 @@ function nextIteratorPageNumber(prevResult) {
|
|
|
4570
2766
|
return isLoadingStateWithError(prevResult) ? prevResult.page : getNextPageNumber(prevResult);
|
|
4571
2767
|
}
|
|
4572
2768
|
function mapItemPageLoadingStateFromResultPageLoadingState() {
|
|
4573
|
-
return map
|
|
2769
|
+
return map(itemPageLoadingStateFromResultPageLoadingState);
|
|
4574
2770
|
}
|
|
4575
2771
|
function itemPageLoadingStateFromResultPageLoadingState(input) {
|
|
4576
2772
|
const result = mapLoadingStateResults(input, {
|
|
@@ -4603,16 +2799,18 @@ function onLockSetNextUnlock({
|
|
|
4603
2799
|
*/
|
|
4604
2800
|
class LockSet {
|
|
4605
2801
|
constructor() {
|
|
2802
|
+
this._onDestroy = new Subject();
|
|
4606
2803
|
this._locks = new BehaviorSubject(new Map());
|
|
4607
2804
|
this._parentSub = new SubscriptionObject();
|
|
4608
2805
|
this.locks$ = this._locks.asObservable();
|
|
4609
2806
|
/**
|
|
4610
2807
|
* isLocked$ is true if any observable is emitting true.
|
|
4611
2808
|
*/
|
|
4612
|
-
this.isLocked$ = this.locks$.pipe(switchMap(combineLatestFromMapValuesObsFn(x => x)), map
|
|
2809
|
+
this.isLocked$ = this.locks$.pipe(switchMap(combineLatestFromMapValuesObsFn(x => x)), map(reduceBooleansWithOrFn(false)),
|
|
4613
2810
|
// Empty map is unlocked.
|
|
4614
2811
|
shareReplay(1));
|
|
4615
|
-
this.isUnlocked$ = this.isLocked$.pipe(map
|
|
2812
|
+
this.isUnlocked$ = this.isLocked$.pipe(map(x => !x));
|
|
2813
|
+
this.onDestroy$ = this._onDestroy.pipe(shareReplay(1));
|
|
4616
2814
|
}
|
|
4617
2815
|
get locks() {
|
|
4618
2816
|
return this._locks.value;
|
|
@@ -4675,7 +2873,7 @@ class LockSet {
|
|
|
4675
2873
|
});
|
|
4676
2874
|
}
|
|
4677
2875
|
setParentLockSet(parent) {
|
|
4678
|
-
this._parentSub.subscription = preventComplete(asObservable(parent)).pipe(map
|
|
2876
|
+
this._parentSub.subscription = preventComplete(asObservable(parent)).pipe(map(parentLockSet => {
|
|
4679
2877
|
let removeFn;
|
|
4680
2878
|
if (parentLockSet) {
|
|
4681
2879
|
removeFn = parentLockSet.addChildLockSet(this);
|
|
@@ -4709,12 +2907,14 @@ class LockSet {
|
|
|
4709
2907
|
fn?.(unlocked);
|
|
4710
2908
|
setTimeout(() => this.destroy(), 100);
|
|
4711
2909
|
},
|
|
4712
|
-
delayTime
|
|
2910
|
+
delayTime: delayTime ?? mergeConfig?.delayTime
|
|
4713
2911
|
});
|
|
4714
2912
|
}
|
|
4715
2913
|
destroy() {
|
|
4716
2914
|
this._locks.complete();
|
|
4717
2915
|
this._parentSub.destroy();
|
|
2916
|
+
this._onDestroy.next();
|
|
2917
|
+
this._onDestroy.complete();
|
|
4718
2918
|
}
|
|
4719
2919
|
}
|
|
4720
2920
|
LockSet.LOCK_SET_CHILD_INDEX_STEPPER = 0;
|
|
@@ -4732,8 +2932,8 @@ class WorkInstance {
|
|
|
4732
2932
|
this._loadingState = new BehaviorSubject(undefined);
|
|
4733
2933
|
this._sub = new SubscriptionObject();
|
|
4734
2934
|
this.loadingState$ = this._loadingState.pipe(filterMaybe());
|
|
4735
|
-
this._hasStarted$ = this._loadingState.pipe(map
|
|
4736
|
-
this._isComplete$ = this.loadingState$.pipe(map
|
|
2935
|
+
this._hasStarted$ = this._loadingState.pipe(map(x => Boolean(x)), shareReplay(1));
|
|
2936
|
+
this._isComplete$ = this.loadingState$.pipe(map(x => isLoadingStateFinishedLoading(x)), shareReplay(1));
|
|
4737
2937
|
this._value = value;
|
|
4738
2938
|
this._delegate = delegate;
|
|
4739
2939
|
// Schedule to cleanup self once isComplete is true.
|
|
@@ -4780,7 +2980,7 @@ class WorkInstance {
|
|
|
4780
2980
|
first()).subscribe(() => {
|
|
4781
2981
|
this.startWorkingWithObservable(obs.pipe(filter(x => x && !isLoadingStateLoading(x)),
|
|
4782
2982
|
// don't return until it has finished loading.
|
|
4783
|
-
map
|
|
2983
|
+
map(x => {
|
|
4784
2984
|
if (x.error) {
|
|
4785
2985
|
throw x.error;
|
|
4786
2986
|
} else {
|
|
@@ -4926,4 +3126,4 @@ function workFactoryForConfigFactory(configFactory) {
|
|
|
4926
3126
|
};
|
|
4927
3127
|
}
|
|
4928
3128
|
|
|
4929
|
-
export { DEFAULT_ASYNC_PUSHER_THROTTLE, DEFAULT_FACTORY_TIMER_INTERVAL, DEFAULT_ITEM_PAGE_ITERATOR_MAX, DEFAULT_LOADING_EVENT_FOR_LOADING_PAIR_FUNCTION, DEFAULT_LOCK_SET_TIME_LOCK_KEY, FilterMap, FilterMapKeyInstance, FilterSource, FilterSourceConnector, FilterSourceInstance, ItemPageIterationInstance, ItemPageIterator, LoadingStateType, LockSet, MultiSubscriptionObject, PresetFilterSource, SimpleLoadingContext, SubscriptionObject, ValuesLoadingContext, WorkInstance, accumulatorCurrentPageListLoadingState, accumulatorFlattenPageListLoadingState,
|
|
3129
|
+
export { DEFAULT_ASYNC_PUSHER_THROTTLE, DEFAULT_FACTORY_TIMER_INTERVAL, DEFAULT_ITEM_PAGE_ITERATOR_MAX, DEFAULT_LOADING_EVENT_FOR_LOADING_PAIR_FUNCTION, DEFAULT_LOCK_SET_TIME_LOCK_KEY, FilterMap, FilterMapKeyInstance, FilterSource, FilterSourceConnector, FilterSourceInstance, ItemPageIterationInstance, ItemPageIterator, LoadingStateType, LockSet, MultiSubscriptionObject, PresetFilterSource, SimpleLoadingContext, SubscriptionObject, ValuesLoadingContext, WorkInstance, accumulatorCurrentPageListLoadingState, accumulatorFlattenPageListLoadingState, areAllLoadingStatesFinishedLoading, arrayValueFromFinishedLoadingState, asObservable, asObservableFromGetter, asyncPusher, asyncPusherCache, beginLoading, beginLoadingPage, catchLoadingStateErrorWithOperator, checkIs, cleanup, cleanupDestroyable, combineLatestFromArrayObsFn, combineLatestFromMapValuesObsFn, combineLatestFromObject, combineLatestMapFrom, combineLoadingStates, combineLoadingStatesStatus, currentValueFromLoadingState, distinctLoadingState, distinctUntilArrayLengthChanges, distinctUntilHasDifferentValues, distinctUntilItemsHaveDifferentValues, distinctUntilItemsValueChanges, distinctUntilKeysChange, distinctUntilMapHasDifferentKeys, distinctUntilModelIdChange, distinctUntilModelKeyChange, distinctUntilObjectKeyChange, distinctUntilObjectValuesChanged, emitAfterDelay, emitDelayObs, errorFromLoadingState, errorOnEmissionsInPeriod, errorPageResult, errorResult, factoryTimer, filterIfObjectValuesUnchanged, filterItemsWithObservableDecision, filterMaybe, filterMaybeArray, filterMaybeStrict, filterUnique, filterWithSearchString, flattenAccumulatorResultItemArray, idleLoadingState, incrementingNumberTimer, initialize, invertObservableDecision, isAnyLoadingStateInLoadingState, isItemPageIteratorResultEndResult, isListLoadingStateWithEmptyValue, isLoading, isLoadingStateEqual, isLoadingStateFinishedLoading, isLoadingStateFinishedLoadingWithDefinedValue, isLoadingStateFinishedLoadingWithError, isLoadingStateInErrorState, isLoadingStateInIdleState, isLoadingStateInLoadingState, isLoadingStateInSuccessState, isLoadingStateLoading, isLoadingStateMetadataEqual, isLoadingStateWithDefinedValue, isLoadingStateWithError, isLoadingStateWithStateType, isNot, isPageLoadingStateMetadataEqual, itemAccumulator, itemAccumulatorNextPageUntilResultsCount, iterationHasNextAndCanLoadMore, iteratorNextPageUntilMaxPageLoadLimit, iteratorNextPageUntilPage, keyValueMap, lazyFrom, listLoadingStateContext, loadingStateContext, loadingStateFromObs, loadingStateType, makeCheckIsFunction, makeIsModifiedFunction, makeIsModifiedFunctionObservable, makeMapFilterWithPresetFn, makeReturnIfIsFunction, mapEachAsync, mapFilterWithPreset, mapForEach, mapIf, mapIsListLoadingStateWithEmptyValue, mapItemIteration, mapKeysIntersectionToArray, mapLoadingState, mapLoadingStateResults, mapLoadingStateValueFunction, mapLoadingStateValueWithOperator, mapMaybe, mapMultipleLoadingStateResults, mappedPageItemIteration, maybeValueFromObservableOrValue, maybeValueFromObservableOrValueGetter, mergeLoadingStateWithError, mergeLoadingStateWithLoading, mergeLoadingStateWithValue, mergeLoadingStates, multiKeyValueMap, onFalseToTrue, onLockSetNextUnlock, onMatchDelta, onTrueToFalse, pageItemAccumulatorCurrentPage, pageLoadingStateFromObs, pipeIf, preventComplete, promiseFromLoadingState, randomDelay, randomDelayWithRandomFunction, returnIfIs, scanBuildArray, scanCount, scanIntoArray, setContainsAllValuesFrom, setContainsAnyValueFrom, setContainsNoValueFrom, skipAfterExpiration, skipAllInitialMaybe, skipExpired, skipInitialMaybe, skipMaybes, skipUntilExpiration, skipUntilTimeElapsedAfterLastEmission, startWithBeginLoading, successPageResult, successResult, switchMapFilterMaybe, switchMapMaybe, switchMapMaybeDefault, switchMapMaybeLoadingContextStream, switchMapObject, switchMapOnBoolean, switchMapToDefault, switchMapWhileFalse, switchMapWhileTrue, takeAfterTimeElapsedSinceLastEmission, tapAfterTimeout, tapFirst, tapLog, tapOnLoadingStateSuccess, tapOnLoadingStateType, throwErrorAfterTimeout, throwErrorFromLoadingStateError, timeoutStartWith, toExpiration, useAsObservable, useFirst, valueFromFinishedLoadingState, valueFromLoadingState, valueFromObservableOrValue, valueFromObservableOrValueGetter, workFactory, workFactoryForConfigFactory };
|