@interopio/fdc3 2.4.2 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.md +7 -0
- package/dist/fdc3.electron.es.js +3835 -146
- package/dist/fdc3.electron.umd.js +8382 -4693
- package/dist/fdc3.es.js +3835 -146
- package/dist/fdc3.umd.js +8370 -4681
- package/package.json +3 -3
package/dist/fdc3.electron.es.js
CHANGED
|
@@ -1,3 +1,3610 @@
|
|
|
1
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
2
|
+
|
|
3
|
+
function getDefaultExportFromCjs (x) {
|
|
4
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
function getAugmentedNamespace(n) {
|
|
8
|
+
if (n.__esModule) return n;
|
|
9
|
+
var f = n.default;
|
|
10
|
+
if (typeof f == "function") {
|
|
11
|
+
var a = function a () {
|
|
12
|
+
if (this instanceof a) {
|
|
13
|
+
return Reflect.construct(f, arguments, this.constructor);
|
|
14
|
+
}
|
|
15
|
+
return f.apply(this, arguments);
|
|
16
|
+
};
|
|
17
|
+
a.prototype = f.prototype;
|
|
18
|
+
} else a = {};
|
|
19
|
+
Object.defineProperty(a, '__esModule', {value: true});
|
|
20
|
+
Object.keys(n).forEach(function (k) {
|
|
21
|
+
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
22
|
+
Object.defineProperty(a, k, d.get ? d : {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function () {
|
|
25
|
+
return n[k];
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
return a;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
var toStr$9 = Object.prototype.toString;
|
|
33
|
+
|
|
34
|
+
var isArguments$3 = function isArguments(value) {
|
|
35
|
+
var str = toStr$9.call(value);
|
|
36
|
+
var isArgs = str === '[object Arguments]';
|
|
37
|
+
if (!isArgs) {
|
|
38
|
+
isArgs = str !== '[object Array]' &&
|
|
39
|
+
value !== null &&
|
|
40
|
+
typeof value === 'object' &&
|
|
41
|
+
typeof value.length === 'number' &&
|
|
42
|
+
value.length >= 0 &&
|
|
43
|
+
toStr$9.call(value.callee) === '[object Function]';
|
|
44
|
+
}
|
|
45
|
+
return isArgs;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
var implementation$b;
|
|
49
|
+
var hasRequiredImplementation;
|
|
50
|
+
|
|
51
|
+
function requireImplementation () {
|
|
52
|
+
if (hasRequiredImplementation) return implementation$b;
|
|
53
|
+
hasRequiredImplementation = 1;
|
|
54
|
+
|
|
55
|
+
var keysShim;
|
|
56
|
+
if (!Object.keys) {
|
|
57
|
+
// modified from https://github.com/es-shims/es5-shim
|
|
58
|
+
var has = Object.prototype.hasOwnProperty;
|
|
59
|
+
var toStr = Object.prototype.toString;
|
|
60
|
+
var isArgs = isArguments$3; // eslint-disable-line global-require
|
|
61
|
+
var isEnumerable = Object.prototype.propertyIsEnumerable;
|
|
62
|
+
var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');
|
|
63
|
+
var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');
|
|
64
|
+
var dontEnums = [
|
|
65
|
+
'toString',
|
|
66
|
+
'toLocaleString',
|
|
67
|
+
'valueOf',
|
|
68
|
+
'hasOwnProperty',
|
|
69
|
+
'isPrototypeOf',
|
|
70
|
+
'propertyIsEnumerable',
|
|
71
|
+
'constructor'
|
|
72
|
+
];
|
|
73
|
+
var equalsConstructorPrototype = function (o) {
|
|
74
|
+
var ctor = o.constructor;
|
|
75
|
+
return ctor && ctor.prototype === o;
|
|
76
|
+
};
|
|
77
|
+
var excludedKeys = {
|
|
78
|
+
$applicationCache: true,
|
|
79
|
+
$console: true,
|
|
80
|
+
$external: true,
|
|
81
|
+
$frame: true,
|
|
82
|
+
$frameElement: true,
|
|
83
|
+
$frames: true,
|
|
84
|
+
$innerHeight: true,
|
|
85
|
+
$innerWidth: true,
|
|
86
|
+
$onmozfullscreenchange: true,
|
|
87
|
+
$onmozfullscreenerror: true,
|
|
88
|
+
$outerHeight: true,
|
|
89
|
+
$outerWidth: true,
|
|
90
|
+
$pageXOffset: true,
|
|
91
|
+
$pageYOffset: true,
|
|
92
|
+
$parent: true,
|
|
93
|
+
$scrollLeft: true,
|
|
94
|
+
$scrollTop: true,
|
|
95
|
+
$scrollX: true,
|
|
96
|
+
$scrollY: true,
|
|
97
|
+
$self: true,
|
|
98
|
+
$webkitIndexedDB: true,
|
|
99
|
+
$webkitStorageInfo: true,
|
|
100
|
+
$window: true
|
|
101
|
+
};
|
|
102
|
+
var hasAutomationEqualityBug = (function () {
|
|
103
|
+
/* global window */
|
|
104
|
+
if (typeof window === 'undefined') { return false; }
|
|
105
|
+
for (var k in window) {
|
|
106
|
+
try {
|
|
107
|
+
if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
|
|
108
|
+
try {
|
|
109
|
+
equalsConstructorPrototype(window[k]);
|
|
110
|
+
} catch (e) {
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
} catch (e) {
|
|
115
|
+
return true;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return false;
|
|
119
|
+
}());
|
|
120
|
+
var equalsConstructorPrototypeIfNotBuggy = function (o) {
|
|
121
|
+
/* global window */
|
|
122
|
+
if (typeof window === 'undefined' || !hasAutomationEqualityBug) {
|
|
123
|
+
return equalsConstructorPrototype(o);
|
|
124
|
+
}
|
|
125
|
+
try {
|
|
126
|
+
return equalsConstructorPrototype(o);
|
|
127
|
+
} catch (e) {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
keysShim = function keys(object) {
|
|
133
|
+
var isObject = object !== null && typeof object === 'object';
|
|
134
|
+
var isFunction = toStr.call(object) === '[object Function]';
|
|
135
|
+
var isArguments = isArgs(object);
|
|
136
|
+
var isString = isObject && toStr.call(object) === '[object String]';
|
|
137
|
+
var theKeys = [];
|
|
138
|
+
|
|
139
|
+
if (!isObject && !isFunction && !isArguments) {
|
|
140
|
+
throw new TypeError('Object.keys called on a non-object');
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
var skipProto = hasProtoEnumBug && isFunction;
|
|
144
|
+
if (isString && object.length > 0 && !has.call(object, 0)) {
|
|
145
|
+
for (var i = 0; i < object.length; ++i) {
|
|
146
|
+
theKeys.push(String(i));
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (isArguments && object.length > 0) {
|
|
151
|
+
for (var j = 0; j < object.length; ++j) {
|
|
152
|
+
theKeys.push(String(j));
|
|
153
|
+
}
|
|
154
|
+
} else {
|
|
155
|
+
for (var name in object) {
|
|
156
|
+
if (!(skipProto && name === 'prototype') && has.call(object, name)) {
|
|
157
|
+
theKeys.push(String(name));
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
if (hasDontEnumBug) {
|
|
163
|
+
var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
|
|
164
|
+
|
|
165
|
+
for (var k = 0; k < dontEnums.length; ++k) {
|
|
166
|
+
if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {
|
|
167
|
+
theKeys.push(dontEnums[k]);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return theKeys;
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
implementation$b = keysShim;
|
|
175
|
+
return implementation$b;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
var slice = Array.prototype.slice;
|
|
179
|
+
var isArgs = isArguments$3;
|
|
180
|
+
|
|
181
|
+
var origKeys = Object.keys;
|
|
182
|
+
var keysShim = origKeys ? function keys(o) { return origKeys(o); } : requireImplementation();
|
|
183
|
+
|
|
184
|
+
var originalKeys = Object.keys;
|
|
185
|
+
|
|
186
|
+
keysShim.shim = function shimObjectKeys() {
|
|
187
|
+
if (Object.keys) {
|
|
188
|
+
var keysWorksWithArguments = (function () {
|
|
189
|
+
// Safari 5.0 bug
|
|
190
|
+
var args = Object.keys(arguments);
|
|
191
|
+
return args && args.length === arguments.length;
|
|
192
|
+
}(1, 2));
|
|
193
|
+
if (!keysWorksWithArguments) {
|
|
194
|
+
Object.keys = function keys(object) { // eslint-disable-line func-name-matching
|
|
195
|
+
if (isArgs(object)) {
|
|
196
|
+
return originalKeys(slice.call(object));
|
|
197
|
+
}
|
|
198
|
+
return originalKeys(object);
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
} else {
|
|
202
|
+
Object.keys = keysShim;
|
|
203
|
+
}
|
|
204
|
+
return Object.keys || keysShim;
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
var objectKeys$2 = keysShim;
|
|
208
|
+
|
|
209
|
+
/** @type {import('.')} */
|
|
210
|
+
var esErrors = Error;
|
|
211
|
+
|
|
212
|
+
/** @type {import('./eval')} */
|
|
213
|
+
var _eval = EvalError;
|
|
214
|
+
|
|
215
|
+
/** @type {import('./range')} */
|
|
216
|
+
var range = RangeError;
|
|
217
|
+
|
|
218
|
+
/** @type {import('./ref')} */
|
|
219
|
+
var ref = ReferenceError;
|
|
220
|
+
|
|
221
|
+
/** @type {import('./syntax')} */
|
|
222
|
+
var syntax = SyntaxError;
|
|
223
|
+
|
|
224
|
+
/** @type {import('./type')} */
|
|
225
|
+
var type = TypeError;
|
|
226
|
+
|
|
227
|
+
/** @type {import('./uri')} */
|
|
228
|
+
var uri = URIError;
|
|
229
|
+
|
|
230
|
+
var shams$1;
|
|
231
|
+
var hasRequiredShams;
|
|
232
|
+
|
|
233
|
+
function requireShams () {
|
|
234
|
+
if (hasRequiredShams) return shams$1;
|
|
235
|
+
hasRequiredShams = 1;
|
|
236
|
+
|
|
237
|
+
/* eslint complexity: [2, 18], max-statements: [2, 33] */
|
|
238
|
+
shams$1 = function hasSymbols() {
|
|
239
|
+
if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
|
|
240
|
+
if (typeof Symbol.iterator === 'symbol') { return true; }
|
|
241
|
+
|
|
242
|
+
var obj = {};
|
|
243
|
+
var sym = Symbol('test');
|
|
244
|
+
var symObj = Object(sym);
|
|
245
|
+
if (typeof sym === 'string') { return false; }
|
|
246
|
+
|
|
247
|
+
if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
|
|
248
|
+
if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
|
|
249
|
+
|
|
250
|
+
// temp disabled per https://github.com/ljharb/object.assign/issues/17
|
|
251
|
+
// if (sym instanceof Symbol) { return false; }
|
|
252
|
+
// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
|
|
253
|
+
// if (!(symObj instanceof Symbol)) { return false; }
|
|
254
|
+
|
|
255
|
+
// if (typeof Symbol.prototype.toString !== 'function') { return false; }
|
|
256
|
+
// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
|
|
257
|
+
|
|
258
|
+
var symVal = 42;
|
|
259
|
+
obj[sym] = symVal;
|
|
260
|
+
for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
|
|
261
|
+
if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
|
|
262
|
+
|
|
263
|
+
if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
|
|
264
|
+
|
|
265
|
+
var syms = Object.getOwnPropertySymbols(obj);
|
|
266
|
+
if (syms.length !== 1 || syms[0] !== sym) { return false; }
|
|
267
|
+
|
|
268
|
+
if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
|
|
269
|
+
|
|
270
|
+
if (typeof Object.getOwnPropertyDescriptor === 'function') {
|
|
271
|
+
var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
|
|
272
|
+
if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
return true;
|
|
276
|
+
};
|
|
277
|
+
return shams$1;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
var origSymbol = typeof Symbol !== 'undefined' && Symbol;
|
|
281
|
+
var hasSymbolSham = requireShams();
|
|
282
|
+
|
|
283
|
+
var hasSymbols$5 = function hasNativeSymbols() {
|
|
284
|
+
if (typeof origSymbol !== 'function') { return false; }
|
|
285
|
+
if (typeof Symbol !== 'function') { return false; }
|
|
286
|
+
if (typeof origSymbol('foo') !== 'symbol') { return false; }
|
|
287
|
+
if (typeof Symbol('bar') !== 'symbol') { return false; }
|
|
288
|
+
|
|
289
|
+
return hasSymbolSham();
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
var test = {
|
|
293
|
+
__proto__: null,
|
|
294
|
+
foo: {}
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
var $Object$1 = Object;
|
|
298
|
+
|
|
299
|
+
/** @type {import('.')} */
|
|
300
|
+
var hasProto$1 = function hasProto() {
|
|
301
|
+
// @ts-expect-error: TS errors on an inherited property for some reason
|
|
302
|
+
return { __proto__: test }.foo === test.foo
|
|
303
|
+
&& !(test instanceof $Object$1);
|
|
304
|
+
};
|
|
305
|
+
|
|
306
|
+
/* eslint no-invalid-this: 1 */
|
|
307
|
+
|
|
308
|
+
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
|
|
309
|
+
var toStr$8 = Object.prototype.toString;
|
|
310
|
+
var max = Math.max;
|
|
311
|
+
var funcType = '[object Function]';
|
|
312
|
+
|
|
313
|
+
var concatty = function concatty(a, b) {
|
|
314
|
+
var arr = [];
|
|
315
|
+
|
|
316
|
+
for (var i = 0; i < a.length; i += 1) {
|
|
317
|
+
arr[i] = a[i];
|
|
318
|
+
}
|
|
319
|
+
for (var j = 0; j < b.length; j += 1) {
|
|
320
|
+
arr[j + a.length] = b[j];
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
return arr;
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
var slicy = function slicy(arrLike, offset) {
|
|
327
|
+
var arr = [];
|
|
328
|
+
for (var i = offset, j = 0; i < arrLike.length; i += 1, j += 1) {
|
|
329
|
+
arr[j] = arrLike[i];
|
|
330
|
+
}
|
|
331
|
+
return arr;
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
var joiny = function (arr, joiner) {
|
|
335
|
+
var str = '';
|
|
336
|
+
for (var i = 0; i < arr.length; i += 1) {
|
|
337
|
+
str += arr[i];
|
|
338
|
+
if (i + 1 < arr.length) {
|
|
339
|
+
str += joiner;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
return str;
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
var implementation$a = function bind(that) {
|
|
346
|
+
var target = this;
|
|
347
|
+
if (typeof target !== 'function' || toStr$8.apply(target) !== funcType) {
|
|
348
|
+
throw new TypeError(ERROR_MESSAGE + target);
|
|
349
|
+
}
|
|
350
|
+
var args = slicy(arguments, 1);
|
|
351
|
+
|
|
352
|
+
var bound;
|
|
353
|
+
var binder = function () {
|
|
354
|
+
if (this instanceof bound) {
|
|
355
|
+
var result = target.apply(
|
|
356
|
+
this,
|
|
357
|
+
concatty(args, arguments)
|
|
358
|
+
);
|
|
359
|
+
if (Object(result) === result) {
|
|
360
|
+
return result;
|
|
361
|
+
}
|
|
362
|
+
return this;
|
|
363
|
+
}
|
|
364
|
+
return target.apply(
|
|
365
|
+
that,
|
|
366
|
+
concatty(args, arguments)
|
|
367
|
+
);
|
|
368
|
+
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
var boundLength = max(0, target.length - args.length);
|
|
372
|
+
var boundArgs = [];
|
|
373
|
+
for (var i = 0; i < boundLength; i++) {
|
|
374
|
+
boundArgs[i] = '$' + i;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
|
|
378
|
+
|
|
379
|
+
if (target.prototype) {
|
|
380
|
+
var Empty = function Empty() {};
|
|
381
|
+
Empty.prototype = target.prototype;
|
|
382
|
+
bound.prototype = new Empty();
|
|
383
|
+
Empty.prototype = null;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
return bound;
|
|
387
|
+
};
|
|
388
|
+
|
|
389
|
+
var implementation$9 = implementation$a;
|
|
390
|
+
|
|
391
|
+
var functionBind = Function.prototype.bind || implementation$9;
|
|
392
|
+
|
|
393
|
+
var call = Function.prototype.call;
|
|
394
|
+
var $hasOwn = Object.prototype.hasOwnProperty;
|
|
395
|
+
var bind$1 = functionBind;
|
|
396
|
+
|
|
397
|
+
/** @type {import('.')} */
|
|
398
|
+
var hasown = bind$1.call(call, $hasOwn);
|
|
399
|
+
|
|
400
|
+
var undefined$1;
|
|
401
|
+
|
|
402
|
+
var $Error = esErrors;
|
|
403
|
+
var $EvalError = _eval;
|
|
404
|
+
var $RangeError = range;
|
|
405
|
+
var $ReferenceError = ref;
|
|
406
|
+
var $SyntaxError$2 = syntax;
|
|
407
|
+
var $TypeError$6 = type;
|
|
408
|
+
var $URIError = uri;
|
|
409
|
+
|
|
410
|
+
var $Function = Function;
|
|
411
|
+
|
|
412
|
+
// eslint-disable-next-line consistent-return
|
|
413
|
+
var getEvalledConstructor = function (expressionSyntax) {
|
|
414
|
+
try {
|
|
415
|
+
return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
|
|
416
|
+
} catch (e) {}
|
|
417
|
+
};
|
|
418
|
+
|
|
419
|
+
var $gOPD$2 = Object.getOwnPropertyDescriptor;
|
|
420
|
+
if ($gOPD$2) {
|
|
421
|
+
try {
|
|
422
|
+
$gOPD$2({}, '');
|
|
423
|
+
} catch (e) {
|
|
424
|
+
$gOPD$2 = null; // this is IE 8, which has a broken gOPD
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
var throwTypeError = function () {
|
|
429
|
+
throw new $TypeError$6();
|
|
430
|
+
};
|
|
431
|
+
var ThrowTypeError = $gOPD$2
|
|
432
|
+
? (function () {
|
|
433
|
+
try {
|
|
434
|
+
// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
|
|
435
|
+
arguments.callee; // IE 8 does not throw here
|
|
436
|
+
return throwTypeError;
|
|
437
|
+
} catch (calleeThrows) {
|
|
438
|
+
try {
|
|
439
|
+
// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
|
|
440
|
+
return $gOPD$2(arguments, 'callee').get;
|
|
441
|
+
} catch (gOPDthrows) {
|
|
442
|
+
return throwTypeError;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
}())
|
|
446
|
+
: throwTypeError;
|
|
447
|
+
|
|
448
|
+
var hasSymbols$4 = hasSymbols$5();
|
|
449
|
+
var hasProto = hasProto$1();
|
|
450
|
+
|
|
451
|
+
var getProto$1 = Object.getPrototypeOf || (
|
|
452
|
+
hasProto
|
|
453
|
+
? function (x) { return x.__proto__; } // eslint-disable-line no-proto
|
|
454
|
+
: null
|
|
455
|
+
);
|
|
456
|
+
|
|
457
|
+
var needsEval = {};
|
|
458
|
+
|
|
459
|
+
var TypedArray = typeof Uint8Array === 'undefined' || !getProto$1 ? undefined$1 : getProto$1(Uint8Array);
|
|
460
|
+
|
|
461
|
+
var INTRINSICS = {
|
|
462
|
+
__proto__: null,
|
|
463
|
+
'%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
|
|
464
|
+
'%Array%': Array,
|
|
465
|
+
'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
|
|
466
|
+
'%ArrayIteratorPrototype%': hasSymbols$4 && getProto$1 ? getProto$1([][Symbol.iterator]()) : undefined$1,
|
|
467
|
+
'%AsyncFromSyncIteratorPrototype%': undefined$1,
|
|
468
|
+
'%AsyncFunction%': needsEval,
|
|
469
|
+
'%AsyncGenerator%': needsEval,
|
|
470
|
+
'%AsyncGeneratorFunction%': needsEval,
|
|
471
|
+
'%AsyncIteratorPrototype%': needsEval,
|
|
472
|
+
'%Atomics%': typeof Atomics === 'undefined' ? undefined$1 : Atomics,
|
|
473
|
+
'%BigInt%': typeof BigInt === 'undefined' ? undefined$1 : BigInt,
|
|
474
|
+
'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined$1 : BigInt64Array,
|
|
475
|
+
'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined$1 : BigUint64Array,
|
|
476
|
+
'%Boolean%': Boolean,
|
|
477
|
+
'%DataView%': typeof DataView === 'undefined' ? undefined$1 : DataView,
|
|
478
|
+
'%Date%': Date,
|
|
479
|
+
'%decodeURI%': decodeURI,
|
|
480
|
+
'%decodeURIComponent%': decodeURIComponent,
|
|
481
|
+
'%encodeURI%': encodeURI,
|
|
482
|
+
'%encodeURIComponent%': encodeURIComponent,
|
|
483
|
+
'%Error%': $Error,
|
|
484
|
+
'%eval%': eval, // eslint-disable-line no-eval
|
|
485
|
+
'%EvalError%': $EvalError,
|
|
486
|
+
'%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
|
|
487
|
+
'%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
|
|
488
|
+
'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
|
|
489
|
+
'%Function%': $Function,
|
|
490
|
+
'%GeneratorFunction%': needsEval,
|
|
491
|
+
'%Int8Array%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array,
|
|
492
|
+
'%Int16Array%': typeof Int16Array === 'undefined' ? undefined$1 : Int16Array,
|
|
493
|
+
'%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
|
|
494
|
+
'%isFinite%': isFinite,
|
|
495
|
+
'%isNaN%': isNaN,
|
|
496
|
+
'%IteratorPrototype%': hasSymbols$4 && getProto$1 ? getProto$1(getProto$1([][Symbol.iterator]())) : undefined$1,
|
|
497
|
+
'%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
|
|
498
|
+
'%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
|
|
499
|
+
'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols$4 || !getProto$1 ? undefined$1 : getProto$1(new Map()[Symbol.iterator]()),
|
|
500
|
+
'%Math%': Math,
|
|
501
|
+
'%Number%': Number,
|
|
502
|
+
'%Object%': Object,
|
|
503
|
+
'%parseFloat%': parseFloat,
|
|
504
|
+
'%parseInt%': parseInt,
|
|
505
|
+
'%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
|
|
506
|
+
'%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
|
|
507
|
+
'%RangeError%': $RangeError,
|
|
508
|
+
'%ReferenceError%': $ReferenceError,
|
|
509
|
+
'%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
|
|
510
|
+
'%RegExp%': RegExp,
|
|
511
|
+
'%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
|
|
512
|
+
'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols$4 || !getProto$1 ? undefined$1 : getProto$1(new Set()[Symbol.iterator]()),
|
|
513
|
+
'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
|
|
514
|
+
'%String%': String,
|
|
515
|
+
'%StringIteratorPrototype%': hasSymbols$4 && getProto$1 ? getProto$1(''[Symbol.iterator]()) : undefined$1,
|
|
516
|
+
'%Symbol%': hasSymbols$4 ? Symbol : undefined$1,
|
|
517
|
+
'%SyntaxError%': $SyntaxError$2,
|
|
518
|
+
'%ThrowTypeError%': ThrowTypeError,
|
|
519
|
+
'%TypedArray%': TypedArray,
|
|
520
|
+
'%TypeError%': $TypeError$6,
|
|
521
|
+
'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
|
|
522
|
+
'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
|
|
523
|
+
'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
|
|
524
|
+
'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
|
|
525
|
+
'%URIError%': $URIError,
|
|
526
|
+
'%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
|
|
527
|
+
'%WeakRef%': typeof WeakRef === 'undefined' ? undefined$1 : WeakRef,
|
|
528
|
+
'%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet
|
|
529
|
+
};
|
|
530
|
+
|
|
531
|
+
if (getProto$1) {
|
|
532
|
+
try {
|
|
533
|
+
null.error; // eslint-disable-line no-unused-expressions
|
|
534
|
+
} catch (e) {
|
|
535
|
+
// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
|
|
536
|
+
var errorProto = getProto$1(getProto$1(e));
|
|
537
|
+
INTRINSICS['%Error.prototype%'] = errorProto;
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
var doEval = function doEval(name) {
|
|
542
|
+
var value;
|
|
543
|
+
if (name === '%AsyncFunction%') {
|
|
544
|
+
value = getEvalledConstructor('async function () {}');
|
|
545
|
+
} else if (name === '%GeneratorFunction%') {
|
|
546
|
+
value = getEvalledConstructor('function* () {}');
|
|
547
|
+
} else if (name === '%AsyncGeneratorFunction%') {
|
|
548
|
+
value = getEvalledConstructor('async function* () {}');
|
|
549
|
+
} else if (name === '%AsyncGenerator%') {
|
|
550
|
+
var fn = doEval('%AsyncGeneratorFunction%');
|
|
551
|
+
if (fn) {
|
|
552
|
+
value = fn.prototype;
|
|
553
|
+
}
|
|
554
|
+
} else if (name === '%AsyncIteratorPrototype%') {
|
|
555
|
+
var gen = doEval('%AsyncGenerator%');
|
|
556
|
+
if (gen && getProto$1) {
|
|
557
|
+
value = getProto$1(gen.prototype);
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
INTRINSICS[name] = value;
|
|
562
|
+
|
|
563
|
+
return value;
|
|
564
|
+
};
|
|
565
|
+
|
|
566
|
+
var LEGACY_ALIASES = {
|
|
567
|
+
__proto__: null,
|
|
568
|
+
'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
|
|
569
|
+
'%ArrayPrototype%': ['Array', 'prototype'],
|
|
570
|
+
'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
|
|
571
|
+
'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
|
|
572
|
+
'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
|
|
573
|
+
'%ArrayProto_values%': ['Array', 'prototype', 'values'],
|
|
574
|
+
'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
|
|
575
|
+
'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
|
|
576
|
+
'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
|
|
577
|
+
'%BooleanPrototype%': ['Boolean', 'prototype'],
|
|
578
|
+
'%DataViewPrototype%': ['DataView', 'prototype'],
|
|
579
|
+
'%DatePrototype%': ['Date', 'prototype'],
|
|
580
|
+
'%ErrorPrototype%': ['Error', 'prototype'],
|
|
581
|
+
'%EvalErrorPrototype%': ['EvalError', 'prototype'],
|
|
582
|
+
'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
|
|
583
|
+
'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
|
|
584
|
+
'%FunctionPrototype%': ['Function', 'prototype'],
|
|
585
|
+
'%Generator%': ['GeneratorFunction', 'prototype'],
|
|
586
|
+
'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
|
|
587
|
+
'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
|
|
588
|
+
'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
|
|
589
|
+
'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
|
|
590
|
+
'%JSONParse%': ['JSON', 'parse'],
|
|
591
|
+
'%JSONStringify%': ['JSON', 'stringify'],
|
|
592
|
+
'%MapPrototype%': ['Map', 'prototype'],
|
|
593
|
+
'%NumberPrototype%': ['Number', 'prototype'],
|
|
594
|
+
'%ObjectPrototype%': ['Object', 'prototype'],
|
|
595
|
+
'%ObjProto_toString%': ['Object', 'prototype', 'toString'],
|
|
596
|
+
'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
|
|
597
|
+
'%PromisePrototype%': ['Promise', 'prototype'],
|
|
598
|
+
'%PromiseProto_then%': ['Promise', 'prototype', 'then'],
|
|
599
|
+
'%Promise_all%': ['Promise', 'all'],
|
|
600
|
+
'%Promise_reject%': ['Promise', 'reject'],
|
|
601
|
+
'%Promise_resolve%': ['Promise', 'resolve'],
|
|
602
|
+
'%RangeErrorPrototype%': ['RangeError', 'prototype'],
|
|
603
|
+
'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
|
|
604
|
+
'%RegExpPrototype%': ['RegExp', 'prototype'],
|
|
605
|
+
'%SetPrototype%': ['Set', 'prototype'],
|
|
606
|
+
'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
|
|
607
|
+
'%StringPrototype%': ['String', 'prototype'],
|
|
608
|
+
'%SymbolPrototype%': ['Symbol', 'prototype'],
|
|
609
|
+
'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
|
|
610
|
+
'%TypedArrayPrototype%': ['TypedArray', 'prototype'],
|
|
611
|
+
'%TypeErrorPrototype%': ['TypeError', 'prototype'],
|
|
612
|
+
'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
|
|
613
|
+
'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
|
|
614
|
+
'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
|
|
615
|
+
'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
|
|
616
|
+
'%URIErrorPrototype%': ['URIError', 'prototype'],
|
|
617
|
+
'%WeakMapPrototype%': ['WeakMap', 'prototype'],
|
|
618
|
+
'%WeakSetPrototype%': ['WeakSet', 'prototype']
|
|
619
|
+
};
|
|
620
|
+
|
|
621
|
+
var bind = functionBind;
|
|
622
|
+
var hasOwn$2 = hasown;
|
|
623
|
+
var $concat$1 = bind.call(Function.call, Array.prototype.concat);
|
|
624
|
+
var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
|
|
625
|
+
var $replace$1 = bind.call(Function.call, String.prototype.replace);
|
|
626
|
+
var $strSlice = bind.call(Function.call, String.prototype.slice);
|
|
627
|
+
var $exec$1 = bind.call(Function.call, RegExp.prototype.exec);
|
|
628
|
+
|
|
629
|
+
/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
|
|
630
|
+
var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
|
|
631
|
+
var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
|
|
632
|
+
var stringToPath = function stringToPath(string) {
|
|
633
|
+
var first = $strSlice(string, 0, 1);
|
|
634
|
+
var last = $strSlice(string, -1);
|
|
635
|
+
if (first === '%' && last !== '%') {
|
|
636
|
+
throw new $SyntaxError$2('invalid intrinsic syntax, expected closing `%`');
|
|
637
|
+
} else if (last === '%' && first !== '%') {
|
|
638
|
+
throw new $SyntaxError$2('invalid intrinsic syntax, expected opening `%`');
|
|
639
|
+
}
|
|
640
|
+
var result = [];
|
|
641
|
+
$replace$1(string, rePropName, function (match, number, quote, subString) {
|
|
642
|
+
result[result.length] = quote ? $replace$1(subString, reEscapeChar, '$1') : number || match;
|
|
643
|
+
});
|
|
644
|
+
return result;
|
|
645
|
+
};
|
|
646
|
+
/* end adaptation */
|
|
647
|
+
|
|
648
|
+
var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
|
|
649
|
+
var intrinsicName = name;
|
|
650
|
+
var alias;
|
|
651
|
+
if (hasOwn$2(LEGACY_ALIASES, intrinsicName)) {
|
|
652
|
+
alias = LEGACY_ALIASES[intrinsicName];
|
|
653
|
+
intrinsicName = '%' + alias[0] + '%';
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
if (hasOwn$2(INTRINSICS, intrinsicName)) {
|
|
657
|
+
var value = INTRINSICS[intrinsicName];
|
|
658
|
+
if (value === needsEval) {
|
|
659
|
+
value = doEval(intrinsicName);
|
|
660
|
+
}
|
|
661
|
+
if (typeof value === 'undefined' && !allowMissing) {
|
|
662
|
+
throw new $TypeError$6('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
return {
|
|
666
|
+
alias: alias,
|
|
667
|
+
name: intrinsicName,
|
|
668
|
+
value: value
|
|
669
|
+
};
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
throw new $SyntaxError$2('intrinsic ' + name + ' does not exist!');
|
|
673
|
+
};
|
|
674
|
+
|
|
675
|
+
var getIntrinsic = function GetIntrinsic(name, allowMissing) {
|
|
676
|
+
if (typeof name !== 'string' || name.length === 0) {
|
|
677
|
+
throw new $TypeError$6('intrinsic name must be a non-empty string');
|
|
678
|
+
}
|
|
679
|
+
if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
|
|
680
|
+
throw new $TypeError$6('"allowMissing" argument must be a boolean');
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
if ($exec$1(/^%?[^%]*%?$/, name) === null) {
|
|
684
|
+
throw new $SyntaxError$2('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
|
|
685
|
+
}
|
|
686
|
+
var parts = stringToPath(name);
|
|
687
|
+
var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
|
|
688
|
+
|
|
689
|
+
var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
|
|
690
|
+
var intrinsicRealName = intrinsic.name;
|
|
691
|
+
var value = intrinsic.value;
|
|
692
|
+
var skipFurtherCaching = false;
|
|
693
|
+
|
|
694
|
+
var alias = intrinsic.alias;
|
|
695
|
+
if (alias) {
|
|
696
|
+
intrinsicBaseName = alias[0];
|
|
697
|
+
$spliceApply(parts, $concat$1([0, 1], alias));
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
for (var i = 1, isOwn = true; i < parts.length; i += 1) {
|
|
701
|
+
var part = parts[i];
|
|
702
|
+
var first = $strSlice(part, 0, 1);
|
|
703
|
+
var last = $strSlice(part, -1);
|
|
704
|
+
if (
|
|
705
|
+
(
|
|
706
|
+
(first === '"' || first === "'" || first === '`')
|
|
707
|
+
|| (last === '"' || last === "'" || last === '`')
|
|
708
|
+
)
|
|
709
|
+
&& first !== last
|
|
710
|
+
) {
|
|
711
|
+
throw new $SyntaxError$2('property names with quotes must have matching quotes');
|
|
712
|
+
}
|
|
713
|
+
if (part === 'constructor' || !isOwn) {
|
|
714
|
+
skipFurtherCaching = true;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
intrinsicBaseName += '.' + part;
|
|
718
|
+
intrinsicRealName = '%' + intrinsicBaseName + '%';
|
|
719
|
+
|
|
720
|
+
if (hasOwn$2(INTRINSICS, intrinsicRealName)) {
|
|
721
|
+
value = INTRINSICS[intrinsicRealName];
|
|
722
|
+
} else if (value != null) {
|
|
723
|
+
if (!(part in value)) {
|
|
724
|
+
if (!allowMissing) {
|
|
725
|
+
throw new $TypeError$6('base intrinsic for ' + name + ' exists, but the property is not available.');
|
|
726
|
+
}
|
|
727
|
+
return void undefined$1;
|
|
728
|
+
}
|
|
729
|
+
if ($gOPD$2 && (i + 1) >= parts.length) {
|
|
730
|
+
var desc = $gOPD$2(value, part);
|
|
731
|
+
isOwn = !!desc;
|
|
732
|
+
|
|
733
|
+
// By convention, when a data property is converted to an accessor
|
|
734
|
+
// property to emulate a data property that does not suffer from
|
|
735
|
+
// the override mistake, that accessor's getter is marked with
|
|
736
|
+
// an `originalValue` property. Here, when we detect this, we
|
|
737
|
+
// uphold the illusion by pretending to see that original data
|
|
738
|
+
// property, i.e., returning the value rather than the getter
|
|
739
|
+
// itself.
|
|
740
|
+
if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
|
|
741
|
+
value = desc.get;
|
|
742
|
+
} else {
|
|
743
|
+
value = value[part];
|
|
744
|
+
}
|
|
745
|
+
} else {
|
|
746
|
+
isOwn = hasOwn$2(value, part);
|
|
747
|
+
value = value[part];
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
if (isOwn && !skipFurtherCaching) {
|
|
751
|
+
INTRINSICS[intrinsicRealName] = value;
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
return value;
|
|
756
|
+
};
|
|
757
|
+
|
|
758
|
+
var esDefineProperty;
|
|
759
|
+
var hasRequiredEsDefineProperty;
|
|
760
|
+
|
|
761
|
+
function requireEsDefineProperty () {
|
|
762
|
+
if (hasRequiredEsDefineProperty) return esDefineProperty;
|
|
763
|
+
hasRequiredEsDefineProperty = 1;
|
|
764
|
+
|
|
765
|
+
var GetIntrinsic = getIntrinsic;
|
|
766
|
+
|
|
767
|
+
/** @type {import('.')} */
|
|
768
|
+
var $defineProperty = GetIntrinsic('%Object.defineProperty%', true) || false;
|
|
769
|
+
if ($defineProperty) {
|
|
770
|
+
try {
|
|
771
|
+
$defineProperty({}, 'a', { value: 1 });
|
|
772
|
+
} catch (e) {
|
|
773
|
+
// IE 8 has a broken defineProperty
|
|
774
|
+
$defineProperty = false;
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
esDefineProperty = $defineProperty;
|
|
779
|
+
return esDefineProperty;
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
var GetIntrinsic$7 = getIntrinsic;
|
|
783
|
+
|
|
784
|
+
var $gOPD$1 = GetIntrinsic$7('%Object.getOwnPropertyDescriptor%', true);
|
|
785
|
+
|
|
786
|
+
if ($gOPD$1) {
|
|
787
|
+
try {
|
|
788
|
+
$gOPD$1([], 'length');
|
|
789
|
+
} catch (e) {
|
|
790
|
+
// IE 8 has a broken gOPD
|
|
791
|
+
$gOPD$1 = null;
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
var gopd$1 = $gOPD$1;
|
|
796
|
+
|
|
797
|
+
var $defineProperty$1 = requireEsDefineProperty();
|
|
798
|
+
|
|
799
|
+
var $SyntaxError$1 = syntax;
|
|
800
|
+
var $TypeError$5 = type;
|
|
801
|
+
|
|
802
|
+
var gopd = gopd$1;
|
|
803
|
+
|
|
804
|
+
/** @type {import('.')} */
|
|
805
|
+
var defineDataProperty$1 = function defineDataProperty(
|
|
806
|
+
obj,
|
|
807
|
+
property,
|
|
808
|
+
value
|
|
809
|
+
) {
|
|
810
|
+
if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
|
811
|
+
throw new $TypeError$5('`obj` must be an object or a function`');
|
|
812
|
+
}
|
|
813
|
+
if (typeof property !== 'string' && typeof property !== 'symbol') {
|
|
814
|
+
throw new $TypeError$5('`property` must be a string or a symbol`');
|
|
815
|
+
}
|
|
816
|
+
if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {
|
|
817
|
+
throw new $TypeError$5('`nonEnumerable`, if provided, must be a boolean or null');
|
|
818
|
+
}
|
|
819
|
+
if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {
|
|
820
|
+
throw new $TypeError$5('`nonWritable`, if provided, must be a boolean or null');
|
|
821
|
+
}
|
|
822
|
+
if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {
|
|
823
|
+
throw new $TypeError$5('`nonConfigurable`, if provided, must be a boolean or null');
|
|
824
|
+
}
|
|
825
|
+
if (arguments.length > 6 && typeof arguments[6] !== 'boolean') {
|
|
826
|
+
throw new $TypeError$5('`loose`, if provided, must be a boolean');
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
var nonEnumerable = arguments.length > 3 ? arguments[3] : null;
|
|
830
|
+
var nonWritable = arguments.length > 4 ? arguments[4] : null;
|
|
831
|
+
var nonConfigurable = arguments.length > 5 ? arguments[5] : null;
|
|
832
|
+
var loose = arguments.length > 6 ? arguments[6] : false;
|
|
833
|
+
|
|
834
|
+
/* @type {false | TypedPropertyDescriptor<unknown>} */
|
|
835
|
+
var desc = !!gopd && gopd(obj, property);
|
|
836
|
+
|
|
837
|
+
if ($defineProperty$1) {
|
|
838
|
+
$defineProperty$1(obj, property, {
|
|
839
|
+
configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,
|
|
840
|
+
enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,
|
|
841
|
+
value: value,
|
|
842
|
+
writable: nonWritable === null && desc ? desc.writable : !nonWritable
|
|
843
|
+
});
|
|
844
|
+
} else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {
|
|
845
|
+
// must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable
|
|
846
|
+
obj[property] = value; // eslint-disable-line no-param-reassign
|
|
847
|
+
} else {
|
|
848
|
+
throw new $SyntaxError$1('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');
|
|
849
|
+
}
|
|
850
|
+
};
|
|
851
|
+
|
|
852
|
+
var $defineProperty = requireEsDefineProperty();
|
|
853
|
+
|
|
854
|
+
var hasPropertyDescriptors = function hasPropertyDescriptors() {
|
|
855
|
+
return !!$defineProperty;
|
|
856
|
+
};
|
|
857
|
+
|
|
858
|
+
hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {
|
|
859
|
+
// node v0.6 has a bug where array lengths can be Set but not Defined
|
|
860
|
+
if (!$defineProperty) {
|
|
861
|
+
return null;
|
|
862
|
+
}
|
|
863
|
+
try {
|
|
864
|
+
return $defineProperty([], 'length', { value: 1 }).length !== 1;
|
|
865
|
+
} catch (e) {
|
|
866
|
+
// In Firefox 4-22, defining length on an array throws an exception.
|
|
867
|
+
return true;
|
|
868
|
+
}
|
|
869
|
+
};
|
|
870
|
+
|
|
871
|
+
var hasPropertyDescriptors_1 = hasPropertyDescriptors;
|
|
872
|
+
|
|
873
|
+
var keys = objectKeys$2;
|
|
874
|
+
var hasSymbols$3 = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
|
|
875
|
+
|
|
876
|
+
var toStr$7 = Object.prototype.toString;
|
|
877
|
+
var concat = Array.prototype.concat;
|
|
878
|
+
var defineDataProperty = defineDataProperty$1;
|
|
879
|
+
|
|
880
|
+
var isFunction = function (fn) {
|
|
881
|
+
return typeof fn === 'function' && toStr$7.call(fn) === '[object Function]';
|
|
882
|
+
};
|
|
883
|
+
|
|
884
|
+
var supportsDescriptors$2 = hasPropertyDescriptors_1();
|
|
885
|
+
|
|
886
|
+
var defineProperty$1 = function (object, name, value, predicate) {
|
|
887
|
+
if (name in object) {
|
|
888
|
+
if (predicate === true) {
|
|
889
|
+
if (object[name] === value) {
|
|
890
|
+
return;
|
|
891
|
+
}
|
|
892
|
+
} else if (!isFunction(predicate) || !predicate()) {
|
|
893
|
+
return;
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
if (supportsDescriptors$2) {
|
|
898
|
+
defineDataProperty(object, name, value, true);
|
|
899
|
+
} else {
|
|
900
|
+
defineDataProperty(object, name, value);
|
|
901
|
+
}
|
|
902
|
+
};
|
|
903
|
+
|
|
904
|
+
var defineProperties$1 = function (object, map) {
|
|
905
|
+
var predicates = arguments.length > 2 ? arguments[2] : {};
|
|
906
|
+
var props = keys(map);
|
|
907
|
+
if (hasSymbols$3) {
|
|
908
|
+
props = concat.call(props, Object.getOwnPropertySymbols(map));
|
|
909
|
+
}
|
|
910
|
+
for (var i = 0; i < props.length; i += 1) {
|
|
911
|
+
defineProperty$1(object, props[i], map[props[i]], predicates[props[i]]);
|
|
912
|
+
}
|
|
913
|
+
};
|
|
914
|
+
|
|
915
|
+
defineProperties$1.supportsDescriptors = !!supportsDescriptors$2;
|
|
916
|
+
|
|
917
|
+
var defineProperties_1 = defineProperties$1;
|
|
918
|
+
|
|
919
|
+
var callBind$6 = {exports: {}};
|
|
920
|
+
|
|
921
|
+
var GetIntrinsic$6 = getIntrinsic;
|
|
922
|
+
var define$5 = defineDataProperty$1;
|
|
923
|
+
var hasDescriptors$1 = hasPropertyDescriptors_1();
|
|
924
|
+
var gOPD$4 = gopd$1;
|
|
925
|
+
|
|
926
|
+
var $TypeError$4 = type;
|
|
927
|
+
var $floor$1 = GetIntrinsic$6('%Math.floor%');
|
|
928
|
+
|
|
929
|
+
/** @type {import('.')} */
|
|
930
|
+
var setFunctionLength = function setFunctionLength(fn, length) {
|
|
931
|
+
if (typeof fn !== 'function') {
|
|
932
|
+
throw new $TypeError$4('`fn` is not a function');
|
|
933
|
+
}
|
|
934
|
+
if (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor$1(length) !== length) {
|
|
935
|
+
throw new $TypeError$4('`length` must be a positive 32-bit integer');
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
var loose = arguments.length > 2 && !!arguments[2];
|
|
939
|
+
|
|
940
|
+
var functionLengthIsConfigurable = true;
|
|
941
|
+
var functionLengthIsWritable = true;
|
|
942
|
+
if ('length' in fn && gOPD$4) {
|
|
943
|
+
var desc = gOPD$4(fn, 'length');
|
|
944
|
+
if (desc && !desc.configurable) {
|
|
945
|
+
functionLengthIsConfigurable = false;
|
|
946
|
+
}
|
|
947
|
+
if (desc && !desc.writable) {
|
|
948
|
+
functionLengthIsWritable = false;
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {
|
|
953
|
+
if (hasDescriptors$1) {
|
|
954
|
+
define$5(/** @type {Parameters<define>[0]} */ (fn), 'length', length, true, true);
|
|
955
|
+
} else {
|
|
956
|
+
define$5(/** @type {Parameters<define>[0]} */ (fn), 'length', length);
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
return fn;
|
|
960
|
+
};
|
|
961
|
+
|
|
962
|
+
(function (module) {
|
|
963
|
+
|
|
964
|
+
var bind = functionBind;
|
|
965
|
+
var GetIntrinsic = getIntrinsic;
|
|
966
|
+
var setFunctionLength$1 = setFunctionLength;
|
|
967
|
+
|
|
968
|
+
var $TypeError = type;
|
|
969
|
+
var $apply = GetIntrinsic('%Function.prototype.apply%');
|
|
970
|
+
var $call = GetIntrinsic('%Function.prototype.call%');
|
|
971
|
+
var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
|
|
972
|
+
|
|
973
|
+
var $defineProperty = requireEsDefineProperty();
|
|
974
|
+
var $max = GetIntrinsic('%Math.max%');
|
|
975
|
+
|
|
976
|
+
module.exports = function callBind(originalFunction) {
|
|
977
|
+
if (typeof originalFunction !== 'function') {
|
|
978
|
+
throw new $TypeError('a function is required');
|
|
979
|
+
}
|
|
980
|
+
var func = $reflectApply(bind, $call, arguments);
|
|
981
|
+
return setFunctionLength$1(
|
|
982
|
+
func,
|
|
983
|
+
1 + $max(0, originalFunction.length - (arguments.length - 1)),
|
|
984
|
+
true
|
|
985
|
+
);
|
|
986
|
+
};
|
|
987
|
+
|
|
988
|
+
var applyBind = function applyBind() {
|
|
989
|
+
return $reflectApply(bind, $apply, arguments);
|
|
990
|
+
};
|
|
991
|
+
|
|
992
|
+
if ($defineProperty) {
|
|
993
|
+
$defineProperty(module.exports, 'apply', { value: applyBind });
|
|
994
|
+
} else {
|
|
995
|
+
module.exports.apply = applyBind;
|
|
996
|
+
}
|
|
997
|
+
} (callBind$6));
|
|
998
|
+
|
|
999
|
+
var callBindExports = callBind$6.exports;
|
|
1000
|
+
|
|
1001
|
+
var GetIntrinsic$5 = getIntrinsic;
|
|
1002
|
+
|
|
1003
|
+
var callBind$5 = callBindExports;
|
|
1004
|
+
|
|
1005
|
+
var $indexOf$1 = callBind$5(GetIntrinsic$5('String.prototype.indexOf'));
|
|
1006
|
+
|
|
1007
|
+
var callBound$c = function callBoundIntrinsic(name, allowMissing) {
|
|
1008
|
+
var intrinsic = GetIntrinsic$5(name, !!allowMissing);
|
|
1009
|
+
if (typeof intrinsic === 'function' && $indexOf$1(name, '.prototype.') > -1) {
|
|
1010
|
+
return callBind$5(intrinsic);
|
|
1011
|
+
}
|
|
1012
|
+
return intrinsic;
|
|
1013
|
+
};
|
|
1014
|
+
|
|
1015
|
+
// modified from https://github.com/es-shims/es6-shim
|
|
1016
|
+
var objectKeys$1 = objectKeys$2;
|
|
1017
|
+
var hasSymbols$2 = requireShams()();
|
|
1018
|
+
var callBound$b = callBound$c;
|
|
1019
|
+
var toObject = Object;
|
|
1020
|
+
var $push = callBound$b('Array.prototype.push');
|
|
1021
|
+
var $propIsEnumerable = callBound$b('Object.prototype.propertyIsEnumerable');
|
|
1022
|
+
var originalGetSymbols = hasSymbols$2 ? Object.getOwnPropertySymbols : null;
|
|
1023
|
+
|
|
1024
|
+
// eslint-disable-next-line no-unused-vars
|
|
1025
|
+
var implementation$8 = function assign(target, source1) {
|
|
1026
|
+
if (target == null) { throw new TypeError('target must be an object'); }
|
|
1027
|
+
var to = toObject(target); // step 1
|
|
1028
|
+
if (arguments.length === 1) {
|
|
1029
|
+
return to; // step 2
|
|
1030
|
+
}
|
|
1031
|
+
for (var s = 1; s < arguments.length; ++s) {
|
|
1032
|
+
var from = toObject(arguments[s]); // step 3.a.i
|
|
1033
|
+
|
|
1034
|
+
// step 3.a.ii:
|
|
1035
|
+
var keys = objectKeys$1(from);
|
|
1036
|
+
var getSymbols = hasSymbols$2 && (Object.getOwnPropertySymbols || originalGetSymbols);
|
|
1037
|
+
if (getSymbols) {
|
|
1038
|
+
var syms = getSymbols(from);
|
|
1039
|
+
for (var j = 0; j < syms.length; ++j) {
|
|
1040
|
+
var key = syms[j];
|
|
1041
|
+
if ($propIsEnumerable(from, key)) {
|
|
1042
|
+
$push(keys, key);
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
// step 3.a.iii:
|
|
1048
|
+
for (var i = 0; i < keys.length; ++i) {
|
|
1049
|
+
var nextKey = keys[i];
|
|
1050
|
+
if ($propIsEnumerable(from, nextKey)) { // step 3.a.iii.2
|
|
1051
|
+
var propValue = from[nextKey]; // step 3.a.iii.2.a
|
|
1052
|
+
to[nextKey] = propValue; // step 3.a.iii.2.b
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
return to; // step 4
|
|
1058
|
+
};
|
|
1059
|
+
|
|
1060
|
+
var implementation$7 = implementation$8;
|
|
1061
|
+
|
|
1062
|
+
var lacksProperEnumerationOrder = function () {
|
|
1063
|
+
if (!Object.assign) {
|
|
1064
|
+
return false;
|
|
1065
|
+
}
|
|
1066
|
+
/*
|
|
1067
|
+
* v8, specifically in node 4.x, has a bug with incorrect property enumeration order
|
|
1068
|
+
* note: this does not detect the bug unless there's 20 characters
|
|
1069
|
+
*/
|
|
1070
|
+
var str = 'abcdefghijklmnopqrst';
|
|
1071
|
+
var letters = str.split('');
|
|
1072
|
+
var map = {};
|
|
1073
|
+
for (var i = 0; i < letters.length; ++i) {
|
|
1074
|
+
map[letters[i]] = letters[i];
|
|
1075
|
+
}
|
|
1076
|
+
var obj = Object.assign({}, map);
|
|
1077
|
+
var actual = '';
|
|
1078
|
+
for (var k in obj) {
|
|
1079
|
+
actual += k;
|
|
1080
|
+
}
|
|
1081
|
+
return str !== actual;
|
|
1082
|
+
};
|
|
1083
|
+
|
|
1084
|
+
var assignHasPendingExceptions = function () {
|
|
1085
|
+
if (!Object.assign || !Object.preventExtensions) {
|
|
1086
|
+
return false;
|
|
1087
|
+
}
|
|
1088
|
+
/*
|
|
1089
|
+
* Firefox 37 still has "pending exception" logic in its Object.assign implementation,
|
|
1090
|
+
* which is 72% slower than our shim, and Firefox 40's native implementation.
|
|
1091
|
+
*/
|
|
1092
|
+
var thrower = Object.preventExtensions({ 1: 2 });
|
|
1093
|
+
try {
|
|
1094
|
+
Object.assign(thrower, 'xy');
|
|
1095
|
+
} catch (e) {
|
|
1096
|
+
return thrower[1] === 'y';
|
|
1097
|
+
}
|
|
1098
|
+
return false;
|
|
1099
|
+
};
|
|
1100
|
+
|
|
1101
|
+
var polyfill$4 = function getPolyfill() {
|
|
1102
|
+
if (!Object.assign) {
|
|
1103
|
+
return implementation$7;
|
|
1104
|
+
}
|
|
1105
|
+
if (lacksProperEnumerationOrder()) {
|
|
1106
|
+
return implementation$7;
|
|
1107
|
+
}
|
|
1108
|
+
if (assignHasPendingExceptions()) {
|
|
1109
|
+
return implementation$7;
|
|
1110
|
+
}
|
|
1111
|
+
return Object.assign;
|
|
1112
|
+
};
|
|
1113
|
+
|
|
1114
|
+
var define$4 = defineProperties_1;
|
|
1115
|
+
var getPolyfill$5 = polyfill$4;
|
|
1116
|
+
|
|
1117
|
+
var shim$5 = function shimAssign() {
|
|
1118
|
+
var polyfill = getPolyfill$5();
|
|
1119
|
+
define$4(
|
|
1120
|
+
Object,
|
|
1121
|
+
{ assign: polyfill },
|
|
1122
|
+
{ assign: function () { return Object.assign !== polyfill; } }
|
|
1123
|
+
);
|
|
1124
|
+
return polyfill;
|
|
1125
|
+
};
|
|
1126
|
+
|
|
1127
|
+
var defineProperties = defineProperties_1;
|
|
1128
|
+
var callBind$4 = callBindExports;
|
|
1129
|
+
|
|
1130
|
+
var implementation$6 = implementation$8;
|
|
1131
|
+
var getPolyfill$4 = polyfill$4;
|
|
1132
|
+
var shim$4 = shim$5;
|
|
1133
|
+
|
|
1134
|
+
var polyfill$3 = callBind$4.apply(getPolyfill$4());
|
|
1135
|
+
// eslint-disable-next-line no-unused-vars
|
|
1136
|
+
var bound = function assign(target, source1) {
|
|
1137
|
+
return polyfill$3(Object, arguments);
|
|
1138
|
+
};
|
|
1139
|
+
|
|
1140
|
+
defineProperties(bound, {
|
|
1141
|
+
getPolyfill: getPolyfill$4,
|
|
1142
|
+
implementation: implementation$6,
|
|
1143
|
+
shim: shim$4
|
|
1144
|
+
});
|
|
1145
|
+
|
|
1146
|
+
var object_assign = bound;
|
|
1147
|
+
|
|
1148
|
+
var functionsHaveNames = function functionsHaveNames() {
|
|
1149
|
+
return typeof function f() {}.name === 'string';
|
|
1150
|
+
};
|
|
1151
|
+
|
|
1152
|
+
var gOPD$3 = Object.getOwnPropertyDescriptor;
|
|
1153
|
+
if (gOPD$3) {
|
|
1154
|
+
try {
|
|
1155
|
+
gOPD$3([], 'length');
|
|
1156
|
+
} catch (e) {
|
|
1157
|
+
// IE 8 has a broken gOPD
|
|
1158
|
+
gOPD$3 = null;
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
functionsHaveNames.functionsHaveConfigurableNames = function functionsHaveConfigurableNames() {
|
|
1163
|
+
if (!functionsHaveNames() || !gOPD$3) {
|
|
1164
|
+
return false;
|
|
1165
|
+
}
|
|
1166
|
+
var desc = gOPD$3(function () {}, 'name');
|
|
1167
|
+
return !!desc && !!desc.configurable;
|
|
1168
|
+
};
|
|
1169
|
+
|
|
1170
|
+
var $bind = Function.prototype.bind;
|
|
1171
|
+
|
|
1172
|
+
functionsHaveNames.boundFunctionsHaveNames = function boundFunctionsHaveNames() {
|
|
1173
|
+
return functionsHaveNames() && typeof $bind === 'function' && function f() {}.bind().name !== '';
|
|
1174
|
+
};
|
|
1175
|
+
|
|
1176
|
+
var functionsHaveNames_1 = functionsHaveNames;
|
|
1177
|
+
|
|
1178
|
+
var define$3 = defineDataProperty$1;
|
|
1179
|
+
var hasDescriptors = hasPropertyDescriptors_1();
|
|
1180
|
+
var functionsHaveConfigurableNames = functionsHaveNames_1.functionsHaveConfigurableNames();
|
|
1181
|
+
|
|
1182
|
+
var $TypeError$3 = type;
|
|
1183
|
+
|
|
1184
|
+
/** @type {import('.')} */
|
|
1185
|
+
var setFunctionName$1 = function setFunctionName(fn, name) {
|
|
1186
|
+
if (typeof fn !== 'function') {
|
|
1187
|
+
throw new $TypeError$3('`fn` is not a function');
|
|
1188
|
+
}
|
|
1189
|
+
var loose = arguments.length > 2 && !!arguments[2];
|
|
1190
|
+
if (!loose || functionsHaveConfigurableNames) {
|
|
1191
|
+
if (hasDescriptors) {
|
|
1192
|
+
define$3(/** @type {Parameters<define>[0]} */ (fn), 'name', name, true, true);
|
|
1193
|
+
} else {
|
|
1194
|
+
define$3(/** @type {Parameters<define>[0]} */ (fn), 'name', name);
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
return fn;
|
|
1198
|
+
};
|
|
1199
|
+
|
|
1200
|
+
var setFunctionName = setFunctionName$1;
|
|
1201
|
+
var $TypeError$2 = type;
|
|
1202
|
+
|
|
1203
|
+
var $Object = Object;
|
|
1204
|
+
|
|
1205
|
+
var implementation$5 = setFunctionName(function flags() {
|
|
1206
|
+
if (this == null || this !== $Object(this)) {
|
|
1207
|
+
throw new $TypeError$2('RegExp.prototype.flags getter called on non-object');
|
|
1208
|
+
}
|
|
1209
|
+
var result = '';
|
|
1210
|
+
if (this.hasIndices) {
|
|
1211
|
+
result += 'd';
|
|
1212
|
+
}
|
|
1213
|
+
if (this.global) {
|
|
1214
|
+
result += 'g';
|
|
1215
|
+
}
|
|
1216
|
+
if (this.ignoreCase) {
|
|
1217
|
+
result += 'i';
|
|
1218
|
+
}
|
|
1219
|
+
if (this.multiline) {
|
|
1220
|
+
result += 'm';
|
|
1221
|
+
}
|
|
1222
|
+
if (this.dotAll) {
|
|
1223
|
+
result += 's';
|
|
1224
|
+
}
|
|
1225
|
+
if (this.unicode) {
|
|
1226
|
+
result += 'u';
|
|
1227
|
+
}
|
|
1228
|
+
if (this.unicodeSets) {
|
|
1229
|
+
result += 'v';
|
|
1230
|
+
}
|
|
1231
|
+
if (this.sticky) {
|
|
1232
|
+
result += 'y';
|
|
1233
|
+
}
|
|
1234
|
+
return result;
|
|
1235
|
+
}, 'get flags', true);
|
|
1236
|
+
|
|
1237
|
+
var implementation$4 = implementation$5;
|
|
1238
|
+
|
|
1239
|
+
var supportsDescriptors$1 = defineProperties_1.supportsDescriptors;
|
|
1240
|
+
var $gOPD = Object.getOwnPropertyDescriptor;
|
|
1241
|
+
|
|
1242
|
+
var polyfill$2 = function getPolyfill() {
|
|
1243
|
+
if (supportsDescriptors$1 && (/a/mig).flags === 'gim') {
|
|
1244
|
+
var descriptor = $gOPD(RegExp.prototype, 'flags');
|
|
1245
|
+
if (
|
|
1246
|
+
descriptor
|
|
1247
|
+
&& typeof descriptor.get === 'function'
|
|
1248
|
+
&& typeof RegExp.prototype.dotAll === 'boolean'
|
|
1249
|
+
&& typeof RegExp.prototype.hasIndices === 'boolean'
|
|
1250
|
+
) {
|
|
1251
|
+
/* eslint getter-return: 0 */
|
|
1252
|
+
var calls = '';
|
|
1253
|
+
var o = {};
|
|
1254
|
+
Object.defineProperty(o, 'hasIndices', {
|
|
1255
|
+
get: function () {
|
|
1256
|
+
calls += 'd';
|
|
1257
|
+
}
|
|
1258
|
+
});
|
|
1259
|
+
Object.defineProperty(o, 'sticky', {
|
|
1260
|
+
get: function () {
|
|
1261
|
+
calls += 'y';
|
|
1262
|
+
}
|
|
1263
|
+
});
|
|
1264
|
+
if (calls === 'dy') {
|
|
1265
|
+
return descriptor.get;
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
return implementation$4;
|
|
1270
|
+
};
|
|
1271
|
+
|
|
1272
|
+
var supportsDescriptors = defineProperties_1.supportsDescriptors;
|
|
1273
|
+
var getPolyfill$3 = polyfill$2;
|
|
1274
|
+
var gOPD$2 = Object.getOwnPropertyDescriptor;
|
|
1275
|
+
var defineProperty = Object.defineProperty;
|
|
1276
|
+
var TypeErr = TypeError;
|
|
1277
|
+
var getProto = Object.getPrototypeOf;
|
|
1278
|
+
var regex = /a/;
|
|
1279
|
+
|
|
1280
|
+
var shim$3 = function shimFlags() {
|
|
1281
|
+
if (!supportsDescriptors || !getProto) {
|
|
1282
|
+
throw new TypeErr('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors');
|
|
1283
|
+
}
|
|
1284
|
+
var polyfill = getPolyfill$3();
|
|
1285
|
+
var proto = getProto(regex);
|
|
1286
|
+
var descriptor = gOPD$2(proto, 'flags');
|
|
1287
|
+
if (!descriptor || descriptor.get !== polyfill) {
|
|
1288
|
+
defineProperty(proto, 'flags', {
|
|
1289
|
+
configurable: true,
|
|
1290
|
+
enumerable: false,
|
|
1291
|
+
get: polyfill
|
|
1292
|
+
});
|
|
1293
|
+
}
|
|
1294
|
+
return polyfill;
|
|
1295
|
+
};
|
|
1296
|
+
|
|
1297
|
+
var define$2 = defineProperties_1;
|
|
1298
|
+
var callBind$3 = callBindExports;
|
|
1299
|
+
|
|
1300
|
+
var implementation$3 = implementation$5;
|
|
1301
|
+
var getPolyfill$2 = polyfill$2;
|
|
1302
|
+
var shim$2 = shim$3;
|
|
1303
|
+
|
|
1304
|
+
var flagsBound = callBind$3(getPolyfill$2());
|
|
1305
|
+
|
|
1306
|
+
define$2(flagsBound, {
|
|
1307
|
+
getPolyfill: getPolyfill$2,
|
|
1308
|
+
implementation: implementation$3,
|
|
1309
|
+
shim: shim$2
|
|
1310
|
+
});
|
|
1311
|
+
|
|
1312
|
+
var regexp_prototype_flags = flagsBound;
|
|
1313
|
+
|
|
1314
|
+
var esGetIterator = {exports: {}};
|
|
1315
|
+
|
|
1316
|
+
var hasSymbols$1 = requireShams();
|
|
1317
|
+
|
|
1318
|
+
/** @type {import('.')} */
|
|
1319
|
+
var shams = function hasToStringTagShams() {
|
|
1320
|
+
return hasSymbols$1() && !!Symbol.toStringTag;
|
|
1321
|
+
};
|
|
1322
|
+
|
|
1323
|
+
var hasToStringTag$7 = shams();
|
|
1324
|
+
var callBound$a = callBound$c;
|
|
1325
|
+
|
|
1326
|
+
var $toString$4 = callBound$a('Object.prototype.toString');
|
|
1327
|
+
|
|
1328
|
+
var isStandardArguments = function isArguments(value) {
|
|
1329
|
+
if (hasToStringTag$7 && value && typeof value === 'object' && Symbol.toStringTag in value) {
|
|
1330
|
+
return false;
|
|
1331
|
+
}
|
|
1332
|
+
return $toString$4(value) === '[object Arguments]';
|
|
1333
|
+
};
|
|
1334
|
+
|
|
1335
|
+
var isLegacyArguments = function isArguments(value) {
|
|
1336
|
+
if (isStandardArguments(value)) {
|
|
1337
|
+
return true;
|
|
1338
|
+
}
|
|
1339
|
+
return value !== null &&
|
|
1340
|
+
typeof value === 'object' &&
|
|
1341
|
+
typeof value.length === 'number' &&
|
|
1342
|
+
value.length >= 0 &&
|
|
1343
|
+
$toString$4(value) !== '[object Array]' &&
|
|
1344
|
+
$toString$4(value.callee) === '[object Function]';
|
|
1345
|
+
};
|
|
1346
|
+
|
|
1347
|
+
var supportsStandardArguments = (function () {
|
|
1348
|
+
return isStandardArguments(arguments);
|
|
1349
|
+
}());
|
|
1350
|
+
|
|
1351
|
+
isStandardArguments.isLegacyArguments = isLegacyArguments; // for tests
|
|
1352
|
+
|
|
1353
|
+
var isArguments$2 = supportsStandardArguments ? isStandardArguments : isLegacyArguments;
|
|
1354
|
+
|
|
1355
|
+
var _nodeResolve_empty = {};
|
|
1356
|
+
|
|
1357
|
+
var _nodeResolve_empty$1 = /*#__PURE__*/Object.freeze({
|
|
1358
|
+
__proto__: null,
|
|
1359
|
+
default: _nodeResolve_empty
|
|
1360
|
+
});
|
|
1361
|
+
|
|
1362
|
+
var require$$0 = /*@__PURE__*/getAugmentedNamespace(_nodeResolve_empty$1);
|
|
1363
|
+
|
|
1364
|
+
var hasMap = typeof Map === 'function' && Map.prototype;
|
|
1365
|
+
var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
|
|
1366
|
+
var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
|
|
1367
|
+
var mapForEach = hasMap && Map.prototype.forEach;
|
|
1368
|
+
var hasSet = typeof Set === 'function' && Set.prototype;
|
|
1369
|
+
var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;
|
|
1370
|
+
var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;
|
|
1371
|
+
var setForEach = hasSet && Set.prototype.forEach;
|
|
1372
|
+
var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;
|
|
1373
|
+
var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
|
|
1374
|
+
var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;
|
|
1375
|
+
var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
|
|
1376
|
+
var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
|
|
1377
|
+
var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
|
|
1378
|
+
var booleanValueOf = Boolean.prototype.valueOf;
|
|
1379
|
+
var objectToString = Object.prototype.toString;
|
|
1380
|
+
var functionToString = Function.prototype.toString;
|
|
1381
|
+
var $match = String.prototype.match;
|
|
1382
|
+
var $slice$1 = String.prototype.slice;
|
|
1383
|
+
var $replace = String.prototype.replace;
|
|
1384
|
+
var $toUpperCase = String.prototype.toUpperCase;
|
|
1385
|
+
var $toLowerCase = String.prototype.toLowerCase;
|
|
1386
|
+
var $test = RegExp.prototype.test;
|
|
1387
|
+
var $concat = Array.prototype.concat;
|
|
1388
|
+
var $join = Array.prototype.join;
|
|
1389
|
+
var $arrSlice = Array.prototype.slice;
|
|
1390
|
+
var $floor = Math.floor;
|
|
1391
|
+
var bigIntValueOf$1 = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
|
|
1392
|
+
var gOPS = Object.getOwnPropertySymbols;
|
|
1393
|
+
var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
|
|
1394
|
+
var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
|
|
1395
|
+
// ie, `has-tostringtag/shams
|
|
1396
|
+
var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')
|
|
1397
|
+
? Symbol.toStringTag
|
|
1398
|
+
: null;
|
|
1399
|
+
var isEnumerable = Object.prototype.propertyIsEnumerable;
|
|
1400
|
+
|
|
1401
|
+
var gPO$1 = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
|
|
1402
|
+
[].__proto__ === Array.prototype // eslint-disable-line no-proto
|
|
1403
|
+
? function (O) {
|
|
1404
|
+
return O.__proto__; // eslint-disable-line no-proto
|
|
1405
|
+
}
|
|
1406
|
+
: null
|
|
1407
|
+
);
|
|
1408
|
+
|
|
1409
|
+
function addNumericSeparator(num, str) {
|
|
1410
|
+
if (
|
|
1411
|
+
num === Infinity
|
|
1412
|
+
|| num === -Infinity
|
|
1413
|
+
|| num !== num
|
|
1414
|
+
|| (num && num > -1000 && num < 1000)
|
|
1415
|
+
|| $test.call(/e/, str)
|
|
1416
|
+
) {
|
|
1417
|
+
return str;
|
|
1418
|
+
}
|
|
1419
|
+
var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
|
|
1420
|
+
if (typeof num === 'number') {
|
|
1421
|
+
var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)
|
|
1422
|
+
if (int !== num) {
|
|
1423
|
+
var intStr = String(int);
|
|
1424
|
+
var dec = $slice$1.call(str, intStr.length + 1);
|
|
1425
|
+
return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
return $replace.call(str, sepRegex, '$&_');
|
|
1429
|
+
}
|
|
1430
|
+
|
|
1431
|
+
var utilInspect = require$$0;
|
|
1432
|
+
var inspectCustom = utilInspect.custom;
|
|
1433
|
+
var inspectSymbol = isSymbol$2(inspectCustom) ? inspectCustom : null;
|
|
1434
|
+
|
|
1435
|
+
var objectInspect = function inspect_(obj, options, depth, seen) {
|
|
1436
|
+
var opts = options || {};
|
|
1437
|
+
|
|
1438
|
+
if (has$1(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {
|
|
1439
|
+
throw new TypeError('option "quoteStyle" must be "single" or "double"');
|
|
1440
|
+
}
|
|
1441
|
+
if (
|
|
1442
|
+
has$1(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'
|
|
1443
|
+
? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity
|
|
1444
|
+
: opts.maxStringLength !== null
|
|
1445
|
+
)
|
|
1446
|
+
) {
|
|
1447
|
+
throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
|
|
1448
|
+
}
|
|
1449
|
+
var customInspect = has$1(opts, 'customInspect') ? opts.customInspect : true;
|
|
1450
|
+
if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
|
|
1451
|
+
throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
if (
|
|
1455
|
+
has$1(opts, 'indent')
|
|
1456
|
+
&& opts.indent !== null
|
|
1457
|
+
&& opts.indent !== '\t'
|
|
1458
|
+
&& !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
|
|
1459
|
+
) {
|
|
1460
|
+
throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
|
|
1461
|
+
}
|
|
1462
|
+
if (has$1(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {
|
|
1463
|
+
throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
|
|
1464
|
+
}
|
|
1465
|
+
var numericSeparator = opts.numericSeparator;
|
|
1466
|
+
|
|
1467
|
+
if (typeof obj === 'undefined') {
|
|
1468
|
+
return 'undefined';
|
|
1469
|
+
}
|
|
1470
|
+
if (obj === null) {
|
|
1471
|
+
return 'null';
|
|
1472
|
+
}
|
|
1473
|
+
if (typeof obj === 'boolean') {
|
|
1474
|
+
return obj ? 'true' : 'false';
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
if (typeof obj === 'string') {
|
|
1478
|
+
return inspectString(obj, opts);
|
|
1479
|
+
}
|
|
1480
|
+
if (typeof obj === 'number') {
|
|
1481
|
+
if (obj === 0) {
|
|
1482
|
+
return Infinity / obj > 0 ? '0' : '-0';
|
|
1483
|
+
}
|
|
1484
|
+
var str = String(obj);
|
|
1485
|
+
return numericSeparator ? addNumericSeparator(obj, str) : str;
|
|
1486
|
+
}
|
|
1487
|
+
if (typeof obj === 'bigint') {
|
|
1488
|
+
var bigIntStr = String(obj) + 'n';
|
|
1489
|
+
return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
|
|
1493
|
+
if (typeof depth === 'undefined') { depth = 0; }
|
|
1494
|
+
if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {
|
|
1495
|
+
return isArray$2(obj) ? '[Array]' : '[Object]';
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
var indent = getIndent(opts, depth);
|
|
1499
|
+
|
|
1500
|
+
if (typeof seen === 'undefined') {
|
|
1501
|
+
seen = [];
|
|
1502
|
+
} else if (indexOf(seen, obj) >= 0) {
|
|
1503
|
+
return '[Circular]';
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
function inspect(value, from, noIndent) {
|
|
1507
|
+
if (from) {
|
|
1508
|
+
seen = $arrSlice.call(seen);
|
|
1509
|
+
seen.push(from);
|
|
1510
|
+
}
|
|
1511
|
+
if (noIndent) {
|
|
1512
|
+
var newOpts = {
|
|
1513
|
+
depth: opts.depth
|
|
1514
|
+
};
|
|
1515
|
+
if (has$1(opts, 'quoteStyle')) {
|
|
1516
|
+
newOpts.quoteStyle = opts.quoteStyle;
|
|
1517
|
+
}
|
|
1518
|
+
return inspect_(value, newOpts, depth + 1, seen);
|
|
1519
|
+
}
|
|
1520
|
+
return inspect_(value, opts, depth + 1, seen);
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable
|
|
1524
|
+
var name = nameOf(obj);
|
|
1525
|
+
var keys = arrObjKeys(obj, inspect);
|
|
1526
|
+
return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
|
|
1527
|
+
}
|
|
1528
|
+
if (isSymbol$2(obj)) {
|
|
1529
|
+
var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
|
|
1530
|
+
return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
|
|
1531
|
+
}
|
|
1532
|
+
if (isElement(obj)) {
|
|
1533
|
+
var s = '<' + $toLowerCase.call(String(obj.nodeName));
|
|
1534
|
+
var attrs = obj.attributes || [];
|
|
1535
|
+
for (var i = 0; i < attrs.length; i++) {
|
|
1536
|
+
s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
|
|
1537
|
+
}
|
|
1538
|
+
s += '>';
|
|
1539
|
+
if (obj.childNodes && obj.childNodes.length) { s += '...'; }
|
|
1540
|
+
s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';
|
|
1541
|
+
return s;
|
|
1542
|
+
}
|
|
1543
|
+
if (isArray$2(obj)) {
|
|
1544
|
+
if (obj.length === 0) { return '[]'; }
|
|
1545
|
+
var xs = arrObjKeys(obj, inspect);
|
|
1546
|
+
if (indent && !singleLineValues(xs)) {
|
|
1547
|
+
return '[' + indentedJoin(xs, indent) + ']';
|
|
1548
|
+
}
|
|
1549
|
+
return '[ ' + $join.call(xs, ', ') + ' ]';
|
|
1550
|
+
}
|
|
1551
|
+
if (isError(obj)) {
|
|
1552
|
+
var parts = arrObjKeys(obj, inspect);
|
|
1553
|
+
if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
|
|
1554
|
+
return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
|
|
1555
|
+
}
|
|
1556
|
+
if (parts.length === 0) { return '[' + String(obj) + ']'; }
|
|
1557
|
+
return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
|
|
1558
|
+
}
|
|
1559
|
+
if (typeof obj === 'object' && customInspect) {
|
|
1560
|
+
if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
|
|
1561
|
+
return utilInspect(obj, { depth: maxDepth - depth });
|
|
1562
|
+
} else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
|
|
1563
|
+
return obj.inspect();
|
|
1564
|
+
}
|
|
1565
|
+
}
|
|
1566
|
+
if (isMap$3(obj)) {
|
|
1567
|
+
var mapParts = [];
|
|
1568
|
+
if (mapForEach) {
|
|
1569
|
+
mapForEach.call(obj, function (value, key) {
|
|
1570
|
+
mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
|
|
1571
|
+
});
|
|
1572
|
+
}
|
|
1573
|
+
return collectionOf('Map', mapSize.call(obj), mapParts, indent);
|
|
1574
|
+
}
|
|
1575
|
+
if (isSet$3(obj)) {
|
|
1576
|
+
var setParts = [];
|
|
1577
|
+
if (setForEach) {
|
|
1578
|
+
setForEach.call(obj, function (value) {
|
|
1579
|
+
setParts.push(inspect(value, obj));
|
|
1580
|
+
});
|
|
1581
|
+
}
|
|
1582
|
+
return collectionOf('Set', setSize.call(obj), setParts, indent);
|
|
1583
|
+
}
|
|
1584
|
+
if (isWeakMap$1(obj)) {
|
|
1585
|
+
return weakCollectionOf('WeakMap');
|
|
1586
|
+
}
|
|
1587
|
+
if (isWeakSet$1(obj)) {
|
|
1588
|
+
return weakCollectionOf('WeakSet');
|
|
1589
|
+
}
|
|
1590
|
+
if (isWeakRef(obj)) {
|
|
1591
|
+
return weakCollectionOf('WeakRef');
|
|
1592
|
+
}
|
|
1593
|
+
if (isNumber$1(obj)) {
|
|
1594
|
+
return markBoxed(inspect(Number(obj)));
|
|
1595
|
+
}
|
|
1596
|
+
if (isBigInt$1(obj)) {
|
|
1597
|
+
return markBoxed(inspect(bigIntValueOf$1.call(obj)));
|
|
1598
|
+
}
|
|
1599
|
+
if (isBoolean$1(obj)) {
|
|
1600
|
+
return markBoxed(booleanValueOf.call(obj));
|
|
1601
|
+
}
|
|
1602
|
+
if (isString$3(obj)) {
|
|
1603
|
+
return markBoxed(inspect(String(obj)));
|
|
1604
|
+
}
|
|
1605
|
+
// note: in IE 8, sometimes `global !== window` but both are the prototypes of each other
|
|
1606
|
+
/* eslint-env browser */
|
|
1607
|
+
if (typeof window !== 'undefined' && obj === window) {
|
|
1608
|
+
return '{ [object Window] }';
|
|
1609
|
+
}
|
|
1610
|
+
if (obj === commonjsGlobal) {
|
|
1611
|
+
return '{ [object globalThis] }';
|
|
1612
|
+
}
|
|
1613
|
+
if (!isDate$1(obj) && !isRegExp(obj)) {
|
|
1614
|
+
var ys = arrObjKeys(obj, inspect);
|
|
1615
|
+
var isPlainObject = gPO$1 ? gPO$1(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
|
|
1616
|
+
var protoTag = obj instanceof Object ? '' : 'null prototype';
|
|
1617
|
+
var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice$1.call(toStr$6(obj), 8, -1) : protoTag ? 'Object' : '';
|
|
1618
|
+
var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
|
|
1619
|
+
var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');
|
|
1620
|
+
if (ys.length === 0) { return tag + '{}'; }
|
|
1621
|
+
if (indent) {
|
|
1622
|
+
return tag + '{' + indentedJoin(ys, indent) + '}';
|
|
1623
|
+
}
|
|
1624
|
+
return tag + '{ ' + $join.call(ys, ', ') + ' }';
|
|
1625
|
+
}
|
|
1626
|
+
return String(obj);
|
|
1627
|
+
};
|
|
1628
|
+
|
|
1629
|
+
function wrapQuotes(s, defaultStyle, opts) {
|
|
1630
|
+
var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'";
|
|
1631
|
+
return quoteChar + s + quoteChar;
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
function quote(s) {
|
|
1635
|
+
return $replace.call(String(s), /"/g, '"');
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1638
|
+
function isArray$2(obj) { return toStr$6(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
1639
|
+
function isDate$1(obj) { return toStr$6(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
1640
|
+
function isRegExp(obj) { return toStr$6(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
1641
|
+
function isError(obj) { return toStr$6(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
1642
|
+
function isString$3(obj) { return toStr$6(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
1643
|
+
function isNumber$1(obj) { return toStr$6(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
1644
|
+
function isBoolean$1(obj) { return toStr$6(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
1645
|
+
|
|
1646
|
+
// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
|
|
1647
|
+
function isSymbol$2(obj) {
|
|
1648
|
+
if (hasShammedSymbols) {
|
|
1649
|
+
return obj && typeof obj === 'object' && obj instanceof Symbol;
|
|
1650
|
+
}
|
|
1651
|
+
if (typeof obj === 'symbol') {
|
|
1652
|
+
return true;
|
|
1653
|
+
}
|
|
1654
|
+
if (!obj || typeof obj !== 'object' || !symToString) {
|
|
1655
|
+
return false;
|
|
1656
|
+
}
|
|
1657
|
+
try {
|
|
1658
|
+
symToString.call(obj);
|
|
1659
|
+
return true;
|
|
1660
|
+
} catch (e) {}
|
|
1661
|
+
return false;
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1664
|
+
function isBigInt$1(obj) {
|
|
1665
|
+
if (!obj || typeof obj !== 'object' || !bigIntValueOf$1) {
|
|
1666
|
+
return false;
|
|
1667
|
+
}
|
|
1668
|
+
try {
|
|
1669
|
+
bigIntValueOf$1.call(obj);
|
|
1670
|
+
return true;
|
|
1671
|
+
} catch (e) {}
|
|
1672
|
+
return false;
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
var hasOwn$1 = Object.prototype.hasOwnProperty || function (key) { return key in this; };
|
|
1676
|
+
function has$1(obj, key) {
|
|
1677
|
+
return hasOwn$1.call(obj, key);
|
|
1678
|
+
}
|
|
1679
|
+
|
|
1680
|
+
function toStr$6(obj) {
|
|
1681
|
+
return objectToString.call(obj);
|
|
1682
|
+
}
|
|
1683
|
+
|
|
1684
|
+
function nameOf(f) {
|
|
1685
|
+
if (f.name) { return f.name; }
|
|
1686
|
+
var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
|
|
1687
|
+
if (m) { return m[1]; }
|
|
1688
|
+
return null;
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1691
|
+
function indexOf(xs, x) {
|
|
1692
|
+
if (xs.indexOf) { return xs.indexOf(x); }
|
|
1693
|
+
for (var i = 0, l = xs.length; i < l; i++) {
|
|
1694
|
+
if (xs[i] === x) { return i; }
|
|
1695
|
+
}
|
|
1696
|
+
return -1;
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
function isMap$3(x) {
|
|
1700
|
+
if (!mapSize || !x || typeof x !== 'object') {
|
|
1701
|
+
return false;
|
|
1702
|
+
}
|
|
1703
|
+
try {
|
|
1704
|
+
mapSize.call(x);
|
|
1705
|
+
try {
|
|
1706
|
+
setSize.call(x);
|
|
1707
|
+
} catch (s) {
|
|
1708
|
+
return true;
|
|
1709
|
+
}
|
|
1710
|
+
return x instanceof Map; // core-js workaround, pre-v2.5.0
|
|
1711
|
+
} catch (e) {}
|
|
1712
|
+
return false;
|
|
1713
|
+
}
|
|
1714
|
+
|
|
1715
|
+
function isWeakMap$1(x) {
|
|
1716
|
+
if (!weakMapHas || !x || typeof x !== 'object') {
|
|
1717
|
+
return false;
|
|
1718
|
+
}
|
|
1719
|
+
try {
|
|
1720
|
+
weakMapHas.call(x, weakMapHas);
|
|
1721
|
+
try {
|
|
1722
|
+
weakSetHas.call(x, weakSetHas);
|
|
1723
|
+
} catch (s) {
|
|
1724
|
+
return true;
|
|
1725
|
+
}
|
|
1726
|
+
return x instanceof WeakMap; // core-js workaround, pre-v2.5.0
|
|
1727
|
+
} catch (e) {}
|
|
1728
|
+
return false;
|
|
1729
|
+
}
|
|
1730
|
+
|
|
1731
|
+
function isWeakRef(x) {
|
|
1732
|
+
if (!weakRefDeref || !x || typeof x !== 'object') {
|
|
1733
|
+
return false;
|
|
1734
|
+
}
|
|
1735
|
+
try {
|
|
1736
|
+
weakRefDeref.call(x);
|
|
1737
|
+
return true;
|
|
1738
|
+
} catch (e) {}
|
|
1739
|
+
return false;
|
|
1740
|
+
}
|
|
1741
|
+
|
|
1742
|
+
function isSet$3(x) {
|
|
1743
|
+
if (!setSize || !x || typeof x !== 'object') {
|
|
1744
|
+
return false;
|
|
1745
|
+
}
|
|
1746
|
+
try {
|
|
1747
|
+
setSize.call(x);
|
|
1748
|
+
try {
|
|
1749
|
+
mapSize.call(x);
|
|
1750
|
+
} catch (m) {
|
|
1751
|
+
return true;
|
|
1752
|
+
}
|
|
1753
|
+
return x instanceof Set; // core-js workaround, pre-v2.5.0
|
|
1754
|
+
} catch (e) {}
|
|
1755
|
+
return false;
|
|
1756
|
+
}
|
|
1757
|
+
|
|
1758
|
+
function isWeakSet$1(x) {
|
|
1759
|
+
if (!weakSetHas || !x || typeof x !== 'object') {
|
|
1760
|
+
return false;
|
|
1761
|
+
}
|
|
1762
|
+
try {
|
|
1763
|
+
weakSetHas.call(x, weakSetHas);
|
|
1764
|
+
try {
|
|
1765
|
+
weakMapHas.call(x, weakMapHas);
|
|
1766
|
+
} catch (s) {
|
|
1767
|
+
return true;
|
|
1768
|
+
}
|
|
1769
|
+
return x instanceof WeakSet; // core-js workaround, pre-v2.5.0
|
|
1770
|
+
} catch (e) {}
|
|
1771
|
+
return false;
|
|
1772
|
+
}
|
|
1773
|
+
|
|
1774
|
+
function isElement(x) {
|
|
1775
|
+
if (!x || typeof x !== 'object') { return false; }
|
|
1776
|
+
if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
|
|
1777
|
+
return true;
|
|
1778
|
+
}
|
|
1779
|
+
return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';
|
|
1780
|
+
}
|
|
1781
|
+
|
|
1782
|
+
function inspectString(str, opts) {
|
|
1783
|
+
if (str.length > opts.maxStringLength) {
|
|
1784
|
+
var remaining = str.length - opts.maxStringLength;
|
|
1785
|
+
var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
|
|
1786
|
+
return inspectString($slice$1.call(str, 0, opts.maxStringLength), opts) + trailer;
|
|
1787
|
+
}
|
|
1788
|
+
// eslint-disable-next-line no-control-regex
|
|
1789
|
+
var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte);
|
|
1790
|
+
return wrapQuotes(s, 'single', opts);
|
|
1791
|
+
}
|
|
1792
|
+
|
|
1793
|
+
function lowbyte(c) {
|
|
1794
|
+
var n = c.charCodeAt(0);
|
|
1795
|
+
var x = {
|
|
1796
|
+
8: 'b',
|
|
1797
|
+
9: 't',
|
|
1798
|
+
10: 'n',
|
|
1799
|
+
12: 'f',
|
|
1800
|
+
13: 'r'
|
|
1801
|
+
}[n];
|
|
1802
|
+
if (x) { return '\\' + x; }
|
|
1803
|
+
return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1806
|
+
function markBoxed(str) {
|
|
1807
|
+
return 'Object(' + str + ')';
|
|
1808
|
+
}
|
|
1809
|
+
|
|
1810
|
+
function weakCollectionOf(type) {
|
|
1811
|
+
return type + ' { ? }';
|
|
1812
|
+
}
|
|
1813
|
+
|
|
1814
|
+
function collectionOf(type, size, entries, indent) {
|
|
1815
|
+
var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');
|
|
1816
|
+
return type + ' (' + size + ') {' + joinedEntries + '}';
|
|
1817
|
+
}
|
|
1818
|
+
|
|
1819
|
+
function singleLineValues(xs) {
|
|
1820
|
+
for (var i = 0; i < xs.length; i++) {
|
|
1821
|
+
if (indexOf(xs[i], '\n') >= 0) {
|
|
1822
|
+
return false;
|
|
1823
|
+
}
|
|
1824
|
+
}
|
|
1825
|
+
return true;
|
|
1826
|
+
}
|
|
1827
|
+
|
|
1828
|
+
function getIndent(opts, depth) {
|
|
1829
|
+
var baseIndent;
|
|
1830
|
+
if (opts.indent === '\t') {
|
|
1831
|
+
baseIndent = '\t';
|
|
1832
|
+
} else if (typeof opts.indent === 'number' && opts.indent > 0) {
|
|
1833
|
+
baseIndent = $join.call(Array(opts.indent + 1), ' ');
|
|
1834
|
+
} else {
|
|
1835
|
+
return null;
|
|
1836
|
+
}
|
|
1837
|
+
return {
|
|
1838
|
+
base: baseIndent,
|
|
1839
|
+
prev: $join.call(Array(depth + 1), baseIndent)
|
|
1840
|
+
};
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1843
|
+
function indentedJoin(xs, indent) {
|
|
1844
|
+
if (xs.length === 0) { return ''; }
|
|
1845
|
+
var lineJoiner = '\n' + indent.prev + indent.base;
|
|
1846
|
+
return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev;
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
function arrObjKeys(obj, inspect) {
|
|
1850
|
+
var isArr = isArray$2(obj);
|
|
1851
|
+
var xs = [];
|
|
1852
|
+
if (isArr) {
|
|
1853
|
+
xs.length = obj.length;
|
|
1854
|
+
for (var i = 0; i < obj.length; i++) {
|
|
1855
|
+
xs[i] = has$1(obj, i) ? inspect(obj[i], obj) : '';
|
|
1856
|
+
}
|
|
1857
|
+
}
|
|
1858
|
+
var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
|
|
1859
|
+
var symMap;
|
|
1860
|
+
if (hasShammedSymbols) {
|
|
1861
|
+
symMap = {};
|
|
1862
|
+
for (var k = 0; k < syms.length; k++) {
|
|
1863
|
+
symMap['$' + syms[k]] = syms[k];
|
|
1864
|
+
}
|
|
1865
|
+
}
|
|
1866
|
+
|
|
1867
|
+
for (var key in obj) { // eslint-disable-line no-restricted-syntax
|
|
1868
|
+
if (!has$1(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
|
|
1869
|
+
if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
|
|
1870
|
+
if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
|
|
1871
|
+
// this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
|
|
1872
|
+
continue; // eslint-disable-line no-restricted-syntax, no-continue
|
|
1873
|
+
} else if ($test.call(/[^\w$]/, key)) {
|
|
1874
|
+
xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
|
|
1875
|
+
} else {
|
|
1876
|
+
xs.push(key + ': ' + inspect(obj[key], obj));
|
|
1877
|
+
}
|
|
1878
|
+
}
|
|
1879
|
+
if (typeof gOPS === 'function') {
|
|
1880
|
+
for (var j = 0; j < syms.length; j++) {
|
|
1881
|
+
if (isEnumerable.call(obj, syms[j])) {
|
|
1882
|
+
xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
|
|
1883
|
+
}
|
|
1884
|
+
}
|
|
1885
|
+
}
|
|
1886
|
+
return xs;
|
|
1887
|
+
}
|
|
1888
|
+
|
|
1889
|
+
var GetIntrinsic$4 = getIntrinsic;
|
|
1890
|
+
var callBound$9 = callBound$c;
|
|
1891
|
+
var inspect = objectInspect;
|
|
1892
|
+
|
|
1893
|
+
var $TypeError$1 = type;
|
|
1894
|
+
var $WeakMap$1 = GetIntrinsic$4('%WeakMap%', true);
|
|
1895
|
+
var $Map$3 = GetIntrinsic$4('%Map%', true);
|
|
1896
|
+
|
|
1897
|
+
var $weakMapGet = callBound$9('WeakMap.prototype.get', true);
|
|
1898
|
+
var $weakMapSet = callBound$9('WeakMap.prototype.set', true);
|
|
1899
|
+
var $weakMapHas = callBound$9('WeakMap.prototype.has', true);
|
|
1900
|
+
var $mapGet$1 = callBound$9('Map.prototype.get', true);
|
|
1901
|
+
var $mapSet = callBound$9('Map.prototype.set', true);
|
|
1902
|
+
var $mapHas$5 = callBound$9('Map.prototype.has', true);
|
|
1903
|
+
|
|
1904
|
+
/*
|
|
1905
|
+
* This function traverses the list returning the node corresponding to the given key.
|
|
1906
|
+
*
|
|
1907
|
+
* That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list. By doing so, all the recently used nodes can be accessed relatively quickly.
|
|
1908
|
+
*/
|
|
1909
|
+
/** @type {import('.').listGetNode} */
|
|
1910
|
+
var listGetNode = function (list, key) { // eslint-disable-line consistent-return
|
|
1911
|
+
/** @type {typeof list | NonNullable<(typeof list)['next']>} */
|
|
1912
|
+
var prev = list;
|
|
1913
|
+
/** @type {(typeof list)['next']} */
|
|
1914
|
+
var curr;
|
|
1915
|
+
for (; (curr = prev.next) !== null; prev = curr) {
|
|
1916
|
+
if (curr.key === key) {
|
|
1917
|
+
prev.next = curr.next;
|
|
1918
|
+
// eslint-disable-next-line no-extra-parens
|
|
1919
|
+
curr.next = /** @type {NonNullable<typeof list.next>} */ (list.next);
|
|
1920
|
+
list.next = curr; // eslint-disable-line no-param-reassign
|
|
1921
|
+
return curr;
|
|
1922
|
+
}
|
|
1923
|
+
}
|
|
1924
|
+
};
|
|
1925
|
+
|
|
1926
|
+
/** @type {import('.').listGet} */
|
|
1927
|
+
var listGet = function (objects, key) {
|
|
1928
|
+
var node = listGetNode(objects, key);
|
|
1929
|
+
return node && node.value;
|
|
1930
|
+
};
|
|
1931
|
+
/** @type {import('.').listSet} */
|
|
1932
|
+
var listSet = function (objects, key, value) {
|
|
1933
|
+
var node = listGetNode(objects, key);
|
|
1934
|
+
if (node) {
|
|
1935
|
+
node.value = value;
|
|
1936
|
+
} else {
|
|
1937
|
+
// Prepend the new node to the beginning of the list
|
|
1938
|
+
objects.next = /** @type {import('.').ListNode<typeof value>} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens
|
|
1939
|
+
key: key,
|
|
1940
|
+
next: objects.next,
|
|
1941
|
+
value: value
|
|
1942
|
+
});
|
|
1943
|
+
}
|
|
1944
|
+
};
|
|
1945
|
+
/** @type {import('.').listHas} */
|
|
1946
|
+
var listHas = function (objects, key) {
|
|
1947
|
+
return !!listGetNode(objects, key);
|
|
1948
|
+
};
|
|
1949
|
+
|
|
1950
|
+
/** @type {import('.')} */
|
|
1951
|
+
var sideChannel = function getSideChannel() {
|
|
1952
|
+
/** @type {WeakMap<object, unknown>} */ var $wm;
|
|
1953
|
+
/** @type {Map<object, unknown>} */ var $m;
|
|
1954
|
+
/** @type {import('.').RootNode<unknown>} */ var $o;
|
|
1955
|
+
|
|
1956
|
+
/** @type {import('.').Channel} */
|
|
1957
|
+
var channel = {
|
|
1958
|
+
assert: function (key) {
|
|
1959
|
+
if (!channel.has(key)) {
|
|
1960
|
+
throw new $TypeError$1('Side channel does not contain ' + inspect(key));
|
|
1961
|
+
}
|
|
1962
|
+
},
|
|
1963
|
+
get: function (key) { // eslint-disable-line consistent-return
|
|
1964
|
+
if ($WeakMap$1 && key && (typeof key === 'object' || typeof key === 'function')) {
|
|
1965
|
+
if ($wm) {
|
|
1966
|
+
return $weakMapGet($wm, key);
|
|
1967
|
+
}
|
|
1968
|
+
} else if ($Map$3) {
|
|
1969
|
+
if ($m) {
|
|
1970
|
+
return $mapGet$1($m, key);
|
|
1971
|
+
}
|
|
1972
|
+
} else {
|
|
1973
|
+
if ($o) { // eslint-disable-line no-lonely-if
|
|
1974
|
+
return listGet($o, key);
|
|
1975
|
+
}
|
|
1976
|
+
}
|
|
1977
|
+
},
|
|
1978
|
+
has: function (key) {
|
|
1979
|
+
if ($WeakMap$1 && key && (typeof key === 'object' || typeof key === 'function')) {
|
|
1980
|
+
if ($wm) {
|
|
1981
|
+
return $weakMapHas($wm, key);
|
|
1982
|
+
}
|
|
1983
|
+
} else if ($Map$3) {
|
|
1984
|
+
if ($m) {
|
|
1985
|
+
return $mapHas$5($m, key);
|
|
1986
|
+
}
|
|
1987
|
+
} else {
|
|
1988
|
+
if ($o) { // eslint-disable-line no-lonely-if
|
|
1989
|
+
return listHas($o, key);
|
|
1990
|
+
}
|
|
1991
|
+
}
|
|
1992
|
+
return false;
|
|
1993
|
+
},
|
|
1994
|
+
set: function (key, value) {
|
|
1995
|
+
if ($WeakMap$1 && key && (typeof key === 'object' || typeof key === 'function')) {
|
|
1996
|
+
if (!$wm) {
|
|
1997
|
+
$wm = new $WeakMap$1();
|
|
1998
|
+
}
|
|
1999
|
+
$weakMapSet($wm, key, value);
|
|
2000
|
+
} else if ($Map$3) {
|
|
2001
|
+
if (!$m) {
|
|
2002
|
+
$m = new $Map$3();
|
|
2003
|
+
}
|
|
2004
|
+
$mapSet($m, key, value);
|
|
2005
|
+
} else {
|
|
2006
|
+
if (!$o) {
|
|
2007
|
+
// Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head
|
|
2008
|
+
$o = { key: {}, next: null };
|
|
2009
|
+
}
|
|
2010
|
+
listSet($o, key, value);
|
|
2011
|
+
}
|
|
2012
|
+
}
|
|
2013
|
+
};
|
|
2014
|
+
return channel;
|
|
2015
|
+
};
|
|
2016
|
+
|
|
2017
|
+
var hasOwn = hasown;
|
|
2018
|
+
var channel = sideChannel();
|
|
2019
|
+
|
|
2020
|
+
var $TypeError = type;
|
|
2021
|
+
|
|
2022
|
+
var SLOT$1 = {
|
|
2023
|
+
assert: function (O, slot) {
|
|
2024
|
+
if (!O || (typeof O !== 'object' && typeof O !== 'function')) {
|
|
2025
|
+
throw new $TypeError('`O` is not an object');
|
|
2026
|
+
}
|
|
2027
|
+
if (typeof slot !== 'string') {
|
|
2028
|
+
throw new $TypeError('`slot` must be a string');
|
|
2029
|
+
}
|
|
2030
|
+
channel.assert(O);
|
|
2031
|
+
if (!SLOT$1.has(O, slot)) {
|
|
2032
|
+
throw new $TypeError('`' + slot + '` is not present on `O`');
|
|
2033
|
+
}
|
|
2034
|
+
},
|
|
2035
|
+
get: function (O, slot) {
|
|
2036
|
+
if (!O || (typeof O !== 'object' && typeof O !== 'function')) {
|
|
2037
|
+
throw new $TypeError('`O` is not an object');
|
|
2038
|
+
}
|
|
2039
|
+
if (typeof slot !== 'string') {
|
|
2040
|
+
throw new $TypeError('`slot` must be a string');
|
|
2041
|
+
}
|
|
2042
|
+
var slots = channel.get(O);
|
|
2043
|
+
return slots && slots['$' + slot];
|
|
2044
|
+
},
|
|
2045
|
+
has: function (O, slot) {
|
|
2046
|
+
if (!O || (typeof O !== 'object' && typeof O !== 'function')) {
|
|
2047
|
+
throw new $TypeError('`O` is not an object');
|
|
2048
|
+
}
|
|
2049
|
+
if (typeof slot !== 'string') {
|
|
2050
|
+
throw new $TypeError('`slot` must be a string');
|
|
2051
|
+
}
|
|
2052
|
+
var slots = channel.get(O);
|
|
2053
|
+
return !!slots && hasOwn(slots, '$' + slot);
|
|
2054
|
+
},
|
|
2055
|
+
set: function (O, slot, V) {
|
|
2056
|
+
if (!O || (typeof O !== 'object' && typeof O !== 'function')) {
|
|
2057
|
+
throw new $TypeError('`O` is not an object');
|
|
2058
|
+
}
|
|
2059
|
+
if (typeof slot !== 'string') {
|
|
2060
|
+
throw new $TypeError('`slot` must be a string');
|
|
2061
|
+
}
|
|
2062
|
+
var slots = channel.get(O);
|
|
2063
|
+
if (!slots) {
|
|
2064
|
+
slots = {};
|
|
2065
|
+
channel.set(O, slots);
|
|
2066
|
+
}
|
|
2067
|
+
slots['$' + slot] = V;
|
|
2068
|
+
}
|
|
2069
|
+
};
|
|
2070
|
+
|
|
2071
|
+
if (Object.freeze) {
|
|
2072
|
+
Object.freeze(SLOT$1);
|
|
2073
|
+
}
|
|
2074
|
+
|
|
2075
|
+
var internalSlot = SLOT$1;
|
|
2076
|
+
|
|
2077
|
+
var SLOT = internalSlot;
|
|
2078
|
+
|
|
2079
|
+
var $SyntaxError = SyntaxError;
|
|
2080
|
+
var $StopIteration = typeof StopIteration === 'object' ? StopIteration : null;
|
|
2081
|
+
|
|
2082
|
+
var stopIterationIterator = function getStopIterationIterator(origIterator) {
|
|
2083
|
+
if (!$StopIteration) {
|
|
2084
|
+
throw new $SyntaxError('this environment lacks StopIteration');
|
|
2085
|
+
}
|
|
2086
|
+
|
|
2087
|
+
SLOT.set(origIterator, '[[Done]]', false);
|
|
2088
|
+
|
|
2089
|
+
var siIterator = {
|
|
2090
|
+
next: function next() {
|
|
2091
|
+
var iterator = SLOT.get(this, '[[Iterator]]');
|
|
2092
|
+
var done = SLOT.get(iterator, '[[Done]]');
|
|
2093
|
+
try {
|
|
2094
|
+
return {
|
|
2095
|
+
done: done,
|
|
2096
|
+
value: done ? void undefined : iterator.next()
|
|
2097
|
+
};
|
|
2098
|
+
} catch (e) {
|
|
2099
|
+
SLOT.set(iterator, '[[Done]]', true);
|
|
2100
|
+
if (e !== $StopIteration) {
|
|
2101
|
+
throw e;
|
|
2102
|
+
}
|
|
2103
|
+
return {
|
|
2104
|
+
done: true,
|
|
2105
|
+
value: void undefined
|
|
2106
|
+
};
|
|
2107
|
+
}
|
|
2108
|
+
}
|
|
2109
|
+
};
|
|
2110
|
+
|
|
2111
|
+
SLOT.set(siIterator, '[[Iterator]]', origIterator);
|
|
2112
|
+
|
|
2113
|
+
return siIterator;
|
|
2114
|
+
};
|
|
2115
|
+
|
|
2116
|
+
var toString = {}.toString;
|
|
2117
|
+
|
|
2118
|
+
var isarray = Array.isArray || function (arr) {
|
|
2119
|
+
return toString.call(arr) == '[object Array]';
|
|
2120
|
+
};
|
|
2121
|
+
|
|
2122
|
+
var strValue = String.prototype.valueOf;
|
|
2123
|
+
var tryStringObject = function tryStringObject(value) {
|
|
2124
|
+
try {
|
|
2125
|
+
strValue.call(value);
|
|
2126
|
+
return true;
|
|
2127
|
+
} catch (e) {
|
|
2128
|
+
return false;
|
|
2129
|
+
}
|
|
2130
|
+
};
|
|
2131
|
+
var toStr$5 = Object.prototype.toString;
|
|
2132
|
+
var strClass = '[object String]';
|
|
2133
|
+
var hasToStringTag$6 = shams();
|
|
2134
|
+
|
|
2135
|
+
var isString$2 = function isString(value) {
|
|
2136
|
+
if (typeof value === 'string') {
|
|
2137
|
+
return true;
|
|
2138
|
+
}
|
|
2139
|
+
if (typeof value !== 'object') {
|
|
2140
|
+
return false;
|
|
2141
|
+
}
|
|
2142
|
+
return hasToStringTag$6 ? tryStringObject(value) : toStr$5.call(value) === strClass;
|
|
2143
|
+
};
|
|
2144
|
+
|
|
2145
|
+
/** @const */
|
|
2146
|
+
var $Map$2 = typeof Map === 'function' && Map.prototype ? Map : null;
|
|
2147
|
+
var $Set$3 = typeof Set === 'function' && Set.prototype ? Set : null;
|
|
2148
|
+
|
|
2149
|
+
var exported$2;
|
|
2150
|
+
|
|
2151
|
+
if (!$Map$2) {
|
|
2152
|
+
/** @type {import('.')} */
|
|
2153
|
+
// eslint-disable-next-line no-unused-vars
|
|
2154
|
+
exported$2 = function isMap(x) {
|
|
2155
|
+
// `Map` is not present in this environment.
|
|
2156
|
+
return false;
|
|
2157
|
+
};
|
|
2158
|
+
}
|
|
2159
|
+
|
|
2160
|
+
var $mapHas$4 = $Map$2 ? Map.prototype.has : null;
|
|
2161
|
+
var $setHas$4 = $Set$3 ? Set.prototype.has : null;
|
|
2162
|
+
if (!exported$2 && !$mapHas$4) {
|
|
2163
|
+
/** @type {import('.')} */
|
|
2164
|
+
// eslint-disable-next-line no-unused-vars
|
|
2165
|
+
exported$2 = function isMap(x) {
|
|
2166
|
+
// `Map` does not have a `has` method
|
|
2167
|
+
return false;
|
|
2168
|
+
};
|
|
2169
|
+
}
|
|
2170
|
+
|
|
2171
|
+
/** @type {import('.')} */
|
|
2172
|
+
var isMap$2 = exported$2 || function isMap(x) {
|
|
2173
|
+
if (!x || typeof x !== 'object') {
|
|
2174
|
+
return false;
|
|
2175
|
+
}
|
|
2176
|
+
try {
|
|
2177
|
+
$mapHas$4.call(x);
|
|
2178
|
+
if ($setHas$4) {
|
|
2179
|
+
try {
|
|
2180
|
+
$setHas$4.call(x);
|
|
2181
|
+
} catch (e) {
|
|
2182
|
+
return true;
|
|
2183
|
+
}
|
|
2184
|
+
}
|
|
2185
|
+
// @ts-expect-error TS can't figure out that $Map is always truthy here
|
|
2186
|
+
return x instanceof $Map$2; // core-js workaround, pre-v2.5.0
|
|
2187
|
+
} catch (e) {}
|
|
2188
|
+
return false;
|
|
2189
|
+
};
|
|
2190
|
+
|
|
2191
|
+
var $Map$1 = typeof Map === 'function' && Map.prototype ? Map : null;
|
|
2192
|
+
var $Set$2 = typeof Set === 'function' && Set.prototype ? Set : null;
|
|
2193
|
+
|
|
2194
|
+
var exported$1;
|
|
2195
|
+
|
|
2196
|
+
if (!$Set$2) {
|
|
2197
|
+
/** @type {import('.')} */
|
|
2198
|
+
// eslint-disable-next-line no-unused-vars
|
|
2199
|
+
exported$1 = function isSet(x) {
|
|
2200
|
+
// `Set` is not present in this environment.
|
|
2201
|
+
return false;
|
|
2202
|
+
};
|
|
2203
|
+
}
|
|
2204
|
+
|
|
2205
|
+
var $mapHas$3 = $Map$1 ? Map.prototype.has : null;
|
|
2206
|
+
var $setHas$3 = $Set$2 ? Set.prototype.has : null;
|
|
2207
|
+
if (!exported$1 && !$setHas$3) {
|
|
2208
|
+
/** @type {import('.')} */
|
|
2209
|
+
// eslint-disable-next-line no-unused-vars
|
|
2210
|
+
exported$1 = function isSet(x) {
|
|
2211
|
+
// `Set` does not have a `has` method
|
|
2212
|
+
return false;
|
|
2213
|
+
};
|
|
2214
|
+
}
|
|
2215
|
+
|
|
2216
|
+
/** @type {import('.')} */
|
|
2217
|
+
var isSet$2 = exported$1 || function isSet(x) {
|
|
2218
|
+
if (!x || typeof x !== 'object') {
|
|
2219
|
+
return false;
|
|
2220
|
+
}
|
|
2221
|
+
try {
|
|
2222
|
+
$setHas$3.call(x);
|
|
2223
|
+
if ($mapHas$3) {
|
|
2224
|
+
try {
|
|
2225
|
+
$mapHas$3.call(x);
|
|
2226
|
+
} catch (e) {
|
|
2227
|
+
return true;
|
|
2228
|
+
}
|
|
2229
|
+
}
|
|
2230
|
+
// @ts-expect-error TS can't figure out that $Set is always truthy here
|
|
2231
|
+
return x instanceof $Set$2; // core-js workaround, pre-v2.5.0
|
|
2232
|
+
} catch (e) {}
|
|
2233
|
+
return false;
|
|
2234
|
+
};
|
|
2235
|
+
|
|
2236
|
+
/* eslint global-require: 0 */
|
|
2237
|
+
// the code is structured this way so that bundlers can
|
|
2238
|
+
// alias out `has-symbols` to `() => true` or `() => false` if your target
|
|
2239
|
+
// environments' Symbol capabilities are known, and then use
|
|
2240
|
+
// dead code elimination on the rest of this module.
|
|
2241
|
+
//
|
|
2242
|
+
// Similarly, `isarray` can be aliased to `Array.isArray` if
|
|
2243
|
+
// available in all target environments.
|
|
2244
|
+
|
|
2245
|
+
var isArguments$1 = isArguments$2;
|
|
2246
|
+
var getStopIterationIterator = stopIterationIterator;
|
|
2247
|
+
|
|
2248
|
+
if (hasSymbols$5() || requireShams()()) {
|
|
2249
|
+
var $iterator = Symbol.iterator;
|
|
2250
|
+
// Symbol is available natively or shammed
|
|
2251
|
+
// natively:
|
|
2252
|
+
// - Chrome >= 38
|
|
2253
|
+
// - Edge 12-14?, Edge >= 15 for sure
|
|
2254
|
+
// - FF >= 36
|
|
2255
|
+
// - Safari >= 9
|
|
2256
|
+
// - node >= 0.12
|
|
2257
|
+
esGetIterator.exports = function getIterator(iterable) {
|
|
2258
|
+
// alternatively, `iterable[$iterator]?.()`
|
|
2259
|
+
if (iterable != null && typeof iterable[$iterator] !== 'undefined') {
|
|
2260
|
+
return iterable[$iterator]();
|
|
2261
|
+
}
|
|
2262
|
+
if (isArguments$1(iterable)) {
|
|
2263
|
+
// arguments objects lack Symbol.iterator
|
|
2264
|
+
// - node 0.12
|
|
2265
|
+
return Array.prototype[$iterator].call(iterable);
|
|
2266
|
+
}
|
|
2267
|
+
};
|
|
2268
|
+
} else {
|
|
2269
|
+
// Symbol is not available, native or shammed
|
|
2270
|
+
var isArray$1 = isarray;
|
|
2271
|
+
var isString$1 = isString$2;
|
|
2272
|
+
var GetIntrinsic$3 = getIntrinsic;
|
|
2273
|
+
var $Map = GetIntrinsic$3('%Map%', true);
|
|
2274
|
+
var $Set$1 = GetIntrinsic$3('%Set%', true);
|
|
2275
|
+
var callBound$8 = callBound$c;
|
|
2276
|
+
var $arrayPush = callBound$8('Array.prototype.push');
|
|
2277
|
+
var $charCodeAt = callBound$8('String.prototype.charCodeAt');
|
|
2278
|
+
var $stringSlice = callBound$8('String.prototype.slice');
|
|
2279
|
+
|
|
2280
|
+
var advanceStringIndex = function advanceStringIndex(S, index) {
|
|
2281
|
+
var length = S.length;
|
|
2282
|
+
if ((index + 1) >= length) {
|
|
2283
|
+
return index + 1;
|
|
2284
|
+
}
|
|
2285
|
+
|
|
2286
|
+
var first = $charCodeAt(S, index);
|
|
2287
|
+
if (first < 0xD800 || first > 0xDBFF) {
|
|
2288
|
+
return index + 1;
|
|
2289
|
+
}
|
|
2290
|
+
|
|
2291
|
+
var second = $charCodeAt(S, index + 1);
|
|
2292
|
+
if (second < 0xDC00 || second > 0xDFFF) {
|
|
2293
|
+
return index + 1;
|
|
2294
|
+
}
|
|
2295
|
+
|
|
2296
|
+
return index + 2;
|
|
2297
|
+
};
|
|
2298
|
+
|
|
2299
|
+
var getArrayIterator = function getArrayIterator(arraylike) {
|
|
2300
|
+
var i = 0;
|
|
2301
|
+
return {
|
|
2302
|
+
next: function next() {
|
|
2303
|
+
var done = i >= arraylike.length;
|
|
2304
|
+
var value;
|
|
2305
|
+
if (!done) {
|
|
2306
|
+
value = arraylike[i];
|
|
2307
|
+
i += 1;
|
|
2308
|
+
}
|
|
2309
|
+
return {
|
|
2310
|
+
done: done,
|
|
2311
|
+
value: value
|
|
2312
|
+
};
|
|
2313
|
+
}
|
|
2314
|
+
};
|
|
2315
|
+
};
|
|
2316
|
+
|
|
2317
|
+
var getNonCollectionIterator = function getNonCollectionIterator(iterable, noPrimordialCollections) {
|
|
2318
|
+
if (isArray$1(iterable) || isArguments$1(iterable)) {
|
|
2319
|
+
return getArrayIterator(iterable);
|
|
2320
|
+
}
|
|
2321
|
+
if (isString$1(iterable)) {
|
|
2322
|
+
var i = 0;
|
|
2323
|
+
return {
|
|
2324
|
+
next: function next() {
|
|
2325
|
+
var nextIndex = advanceStringIndex(iterable, i);
|
|
2326
|
+
var value = $stringSlice(iterable, i, nextIndex);
|
|
2327
|
+
i = nextIndex;
|
|
2328
|
+
return {
|
|
2329
|
+
done: nextIndex > iterable.length,
|
|
2330
|
+
value: value
|
|
2331
|
+
};
|
|
2332
|
+
}
|
|
2333
|
+
};
|
|
2334
|
+
}
|
|
2335
|
+
|
|
2336
|
+
// es6-shim and es-shims' es-map use a string "_es6-shim iterator_" property on different iterables, such as MapIterator.
|
|
2337
|
+
if (noPrimordialCollections && typeof iterable['_es6-shim iterator_'] !== 'undefined') {
|
|
2338
|
+
return iterable['_es6-shim iterator_']();
|
|
2339
|
+
}
|
|
2340
|
+
};
|
|
2341
|
+
|
|
2342
|
+
if (!$Map && !$Set$1) {
|
|
2343
|
+
// the only language iterables are Array, String, arguments
|
|
2344
|
+
// - Safari <= 6.0
|
|
2345
|
+
// - Chrome < 38
|
|
2346
|
+
// - node < 0.12
|
|
2347
|
+
// - FF < 13
|
|
2348
|
+
// - IE < 11
|
|
2349
|
+
// - Edge < 11
|
|
2350
|
+
|
|
2351
|
+
esGetIterator.exports = function getIterator(iterable) {
|
|
2352
|
+
if (iterable != null) {
|
|
2353
|
+
return getNonCollectionIterator(iterable, true);
|
|
2354
|
+
}
|
|
2355
|
+
};
|
|
2356
|
+
} else {
|
|
2357
|
+
// either Map or Set are available, but Symbol is not
|
|
2358
|
+
// - es6-shim on an ES5 browser
|
|
2359
|
+
// - Safari 6.2 (maybe 6.1?)
|
|
2360
|
+
// - FF v[13, 36)
|
|
2361
|
+
// - IE 11
|
|
2362
|
+
// - Edge 11
|
|
2363
|
+
// - Safari v[6, 9)
|
|
2364
|
+
|
|
2365
|
+
var isMap$1 = isMap$2;
|
|
2366
|
+
var isSet$1 = isSet$2;
|
|
2367
|
+
|
|
2368
|
+
// Firefox >= 27, IE 11, Safari 6.2 - 9, Edge 11, es6-shim in older envs, all have forEach
|
|
2369
|
+
var $mapForEach = callBound$8('Map.prototype.forEach', true);
|
|
2370
|
+
var $setForEach = callBound$8('Set.prototype.forEach', true);
|
|
2371
|
+
if (typeof process === 'undefined' || !process.versions || !process.versions.node) { // "if is not node"
|
|
2372
|
+
|
|
2373
|
+
// Firefox 17 - 26 has `.iterator()`, whose iterator `.next()` either
|
|
2374
|
+
// returns a value, or throws a StopIteration object. These browsers
|
|
2375
|
+
// do not have any other mechanism for iteration.
|
|
2376
|
+
var $mapIterator = callBound$8('Map.prototype.iterator', true);
|
|
2377
|
+
var $setIterator = callBound$8('Set.prototype.iterator', true);
|
|
2378
|
+
}
|
|
2379
|
+
// Firefox 27-35, and some older es6-shim versions, use a string "@@iterator" property
|
|
2380
|
+
// this returns a proper iterator object, so we should use it instead of forEach.
|
|
2381
|
+
// newer es6-shim versions use a string "_es6-shim iterator_" property.
|
|
2382
|
+
var $mapAtAtIterator = callBound$8('Map.prototype.@@iterator', true) || callBound$8('Map.prototype._es6-shim iterator_', true);
|
|
2383
|
+
var $setAtAtIterator = callBound$8('Set.prototype.@@iterator', true) || callBound$8('Set.prototype._es6-shim iterator_', true);
|
|
2384
|
+
|
|
2385
|
+
var getCollectionIterator = function getCollectionIterator(iterable) {
|
|
2386
|
+
if (isMap$1(iterable)) {
|
|
2387
|
+
if ($mapIterator) {
|
|
2388
|
+
return getStopIterationIterator($mapIterator(iterable));
|
|
2389
|
+
}
|
|
2390
|
+
if ($mapAtAtIterator) {
|
|
2391
|
+
return $mapAtAtIterator(iterable);
|
|
2392
|
+
}
|
|
2393
|
+
if ($mapForEach) {
|
|
2394
|
+
var entries = [];
|
|
2395
|
+
$mapForEach(iterable, function (v, k) {
|
|
2396
|
+
$arrayPush(entries, [k, v]);
|
|
2397
|
+
});
|
|
2398
|
+
return getArrayIterator(entries);
|
|
2399
|
+
}
|
|
2400
|
+
}
|
|
2401
|
+
if (isSet$1(iterable)) {
|
|
2402
|
+
if ($setIterator) {
|
|
2403
|
+
return getStopIterationIterator($setIterator(iterable));
|
|
2404
|
+
}
|
|
2405
|
+
if ($setAtAtIterator) {
|
|
2406
|
+
return $setAtAtIterator(iterable);
|
|
2407
|
+
}
|
|
2408
|
+
if ($setForEach) {
|
|
2409
|
+
var values = [];
|
|
2410
|
+
$setForEach(iterable, function (v) {
|
|
2411
|
+
$arrayPush(values, v);
|
|
2412
|
+
});
|
|
2413
|
+
return getArrayIterator(values);
|
|
2414
|
+
}
|
|
2415
|
+
}
|
|
2416
|
+
};
|
|
2417
|
+
|
|
2418
|
+
esGetIterator.exports = function getIterator(iterable) {
|
|
2419
|
+
return getCollectionIterator(iterable) || getNonCollectionIterator(iterable);
|
|
2420
|
+
};
|
|
2421
|
+
}
|
|
2422
|
+
}
|
|
2423
|
+
|
|
2424
|
+
var esGetIteratorExports = esGetIterator.exports;
|
|
2425
|
+
|
|
2426
|
+
var numberIsNaN = function (value) {
|
|
2427
|
+
return value !== value;
|
|
2428
|
+
};
|
|
2429
|
+
|
|
2430
|
+
var implementation$2 = function is(a, b) {
|
|
2431
|
+
if (a === 0 && b === 0) {
|
|
2432
|
+
return 1 / a === 1 / b;
|
|
2433
|
+
}
|
|
2434
|
+
if (a === b) {
|
|
2435
|
+
return true;
|
|
2436
|
+
}
|
|
2437
|
+
if (numberIsNaN(a) && numberIsNaN(b)) {
|
|
2438
|
+
return true;
|
|
2439
|
+
}
|
|
2440
|
+
return false;
|
|
2441
|
+
};
|
|
2442
|
+
|
|
2443
|
+
var implementation$1 = implementation$2;
|
|
2444
|
+
|
|
2445
|
+
var polyfill$1 = function getPolyfill() {
|
|
2446
|
+
return typeof Object.is === 'function' ? Object.is : implementation$1;
|
|
2447
|
+
};
|
|
2448
|
+
|
|
2449
|
+
var getPolyfill$1 = polyfill$1;
|
|
2450
|
+
var define$1 = defineProperties_1;
|
|
2451
|
+
|
|
2452
|
+
var shim$1 = function shimObjectIs() {
|
|
2453
|
+
var polyfill = getPolyfill$1();
|
|
2454
|
+
define$1(Object, { is: polyfill }, {
|
|
2455
|
+
is: function testObjectIs() {
|
|
2456
|
+
return Object.is !== polyfill;
|
|
2457
|
+
}
|
|
2458
|
+
});
|
|
2459
|
+
return polyfill;
|
|
2460
|
+
};
|
|
2461
|
+
|
|
2462
|
+
var define = defineProperties_1;
|
|
2463
|
+
var callBind$2 = callBindExports;
|
|
2464
|
+
|
|
2465
|
+
var implementation = implementation$2;
|
|
2466
|
+
var getPolyfill = polyfill$1;
|
|
2467
|
+
var shim = shim$1;
|
|
2468
|
+
|
|
2469
|
+
var polyfill = callBind$2(getPolyfill(), Object);
|
|
2470
|
+
|
|
2471
|
+
define(polyfill, {
|
|
2472
|
+
getPolyfill: getPolyfill,
|
|
2473
|
+
implementation: implementation,
|
|
2474
|
+
shim: shim
|
|
2475
|
+
});
|
|
2476
|
+
|
|
2477
|
+
var objectIs = polyfill;
|
|
2478
|
+
|
|
2479
|
+
var callBind$1 = callBindExports;
|
|
2480
|
+
var callBound$7 = callBound$c;
|
|
2481
|
+
var GetIntrinsic$2 = getIntrinsic;
|
|
2482
|
+
|
|
2483
|
+
var $ArrayBuffer = GetIntrinsic$2('%ArrayBuffer%', true);
|
|
2484
|
+
/** @type {undefined | ((receiver: ArrayBuffer) => number) | ((receiver: unknown) => never)} */
|
|
2485
|
+
var $byteLength$2 = callBound$7('ArrayBuffer.prototype.byteLength', true);
|
|
2486
|
+
var $toString$3 = callBound$7('Object.prototype.toString');
|
|
2487
|
+
|
|
2488
|
+
// in node 0.10, ArrayBuffers have no prototype methods, but have an own slot-checking `slice` method
|
|
2489
|
+
var abSlice = !!$ArrayBuffer && !$byteLength$2 && new $ArrayBuffer(0).slice;
|
|
2490
|
+
var $abSlice = !!abSlice && callBind$1(abSlice);
|
|
2491
|
+
|
|
2492
|
+
/** @type {import('.')} */
|
|
2493
|
+
var isArrayBuffer$2 = $byteLength$2 || $abSlice
|
|
2494
|
+
? function isArrayBuffer(obj) {
|
|
2495
|
+
if (!obj || typeof obj !== 'object') {
|
|
2496
|
+
return false;
|
|
2497
|
+
}
|
|
2498
|
+
try {
|
|
2499
|
+
if ($byteLength$2) {
|
|
2500
|
+
// @ts-expect-error no idea why TS can't handle the overload
|
|
2501
|
+
$byteLength$2(obj);
|
|
2502
|
+
} else {
|
|
2503
|
+
// @ts-expect-error TS chooses not to type-narrow inside a closure
|
|
2504
|
+
$abSlice(obj, 0);
|
|
2505
|
+
}
|
|
2506
|
+
return true;
|
|
2507
|
+
} catch (e) {
|
|
2508
|
+
return false;
|
|
2509
|
+
}
|
|
2510
|
+
}
|
|
2511
|
+
: $ArrayBuffer
|
|
2512
|
+
// in node 0.8, ArrayBuffers have no prototype or own methods, but also no Symbol.toStringTag
|
|
2513
|
+
? function isArrayBuffer(obj) {
|
|
2514
|
+
return $toString$3(obj) === '[object ArrayBuffer]';
|
|
2515
|
+
}
|
|
2516
|
+
: function isArrayBuffer(obj) { // eslint-disable-line no-unused-vars
|
|
2517
|
+
return false;
|
|
2518
|
+
};
|
|
2519
|
+
|
|
2520
|
+
var getDay = Date.prototype.getDay;
|
|
2521
|
+
var tryDateObject = function tryDateGetDayCall(value) {
|
|
2522
|
+
try {
|
|
2523
|
+
getDay.call(value);
|
|
2524
|
+
return true;
|
|
2525
|
+
} catch (e) {
|
|
2526
|
+
return false;
|
|
2527
|
+
}
|
|
2528
|
+
};
|
|
2529
|
+
|
|
2530
|
+
var toStr$4 = Object.prototype.toString;
|
|
2531
|
+
var dateClass = '[object Date]';
|
|
2532
|
+
var hasToStringTag$5 = shams();
|
|
2533
|
+
|
|
2534
|
+
var isDateObject = function isDateObject(value) {
|
|
2535
|
+
if (typeof value !== 'object' || value === null) {
|
|
2536
|
+
return false;
|
|
2537
|
+
}
|
|
2538
|
+
return hasToStringTag$5 ? tryDateObject(value) : toStr$4.call(value) === dateClass;
|
|
2539
|
+
};
|
|
2540
|
+
|
|
2541
|
+
var callBound$6 = callBound$c;
|
|
2542
|
+
var hasToStringTag$4 = shams();
|
|
2543
|
+
var has;
|
|
2544
|
+
var $exec;
|
|
2545
|
+
var isRegexMarker;
|
|
2546
|
+
var badStringifier;
|
|
2547
|
+
|
|
2548
|
+
if (hasToStringTag$4) {
|
|
2549
|
+
has = callBound$6('Object.prototype.hasOwnProperty');
|
|
2550
|
+
$exec = callBound$6('RegExp.prototype.exec');
|
|
2551
|
+
isRegexMarker = {};
|
|
2552
|
+
|
|
2553
|
+
var throwRegexMarker = function () {
|
|
2554
|
+
throw isRegexMarker;
|
|
2555
|
+
};
|
|
2556
|
+
badStringifier = {
|
|
2557
|
+
toString: throwRegexMarker,
|
|
2558
|
+
valueOf: throwRegexMarker
|
|
2559
|
+
};
|
|
2560
|
+
|
|
2561
|
+
if (typeof Symbol.toPrimitive === 'symbol') {
|
|
2562
|
+
badStringifier[Symbol.toPrimitive] = throwRegexMarker;
|
|
2563
|
+
}
|
|
2564
|
+
}
|
|
2565
|
+
|
|
2566
|
+
var $toString$2 = callBound$6('Object.prototype.toString');
|
|
2567
|
+
var gOPD$1 = Object.getOwnPropertyDescriptor;
|
|
2568
|
+
var regexClass = '[object RegExp]';
|
|
2569
|
+
|
|
2570
|
+
var isRegex$1 = hasToStringTag$4
|
|
2571
|
+
// eslint-disable-next-line consistent-return
|
|
2572
|
+
? function isRegex(value) {
|
|
2573
|
+
if (!value || typeof value !== 'object') {
|
|
2574
|
+
return false;
|
|
2575
|
+
}
|
|
2576
|
+
|
|
2577
|
+
var descriptor = gOPD$1(value, 'lastIndex');
|
|
2578
|
+
var hasLastIndexDataProperty = descriptor && has(descriptor, 'value');
|
|
2579
|
+
if (!hasLastIndexDataProperty) {
|
|
2580
|
+
return false;
|
|
2581
|
+
}
|
|
2582
|
+
|
|
2583
|
+
try {
|
|
2584
|
+
$exec(value, badStringifier);
|
|
2585
|
+
} catch (e) {
|
|
2586
|
+
return e === isRegexMarker;
|
|
2587
|
+
}
|
|
2588
|
+
}
|
|
2589
|
+
: function isRegex(value) {
|
|
2590
|
+
// In older browsers, typeof regex incorrectly returns 'function'
|
|
2591
|
+
if (!value || (typeof value !== 'object' && typeof value !== 'function')) {
|
|
2592
|
+
return false;
|
|
2593
|
+
}
|
|
2594
|
+
|
|
2595
|
+
return $toString$2(value) === regexClass;
|
|
2596
|
+
};
|
|
2597
|
+
|
|
2598
|
+
var callBound$5 = callBound$c;
|
|
2599
|
+
|
|
2600
|
+
var $byteLength$1 = callBound$5('SharedArrayBuffer.prototype.byteLength', true);
|
|
2601
|
+
|
|
2602
|
+
/** @type {import('.')} */
|
|
2603
|
+
var isSharedArrayBuffer$1 = $byteLength$1
|
|
2604
|
+
? function isSharedArrayBuffer(obj) {
|
|
2605
|
+
if (!obj || typeof obj !== 'object') {
|
|
2606
|
+
return false;
|
|
2607
|
+
}
|
|
2608
|
+
try {
|
|
2609
|
+
$byteLength$1(obj);
|
|
2610
|
+
return true;
|
|
2611
|
+
} catch (e) {
|
|
2612
|
+
return false;
|
|
2613
|
+
}
|
|
2614
|
+
}
|
|
2615
|
+
: function isSharedArrayBuffer(obj) { // eslint-disable-line no-unused-vars
|
|
2616
|
+
return false;
|
|
2617
|
+
};
|
|
2618
|
+
|
|
2619
|
+
var numToStr = Number.prototype.toString;
|
|
2620
|
+
var tryNumberObject = function tryNumberObject(value) {
|
|
2621
|
+
try {
|
|
2622
|
+
numToStr.call(value);
|
|
2623
|
+
return true;
|
|
2624
|
+
} catch (e) {
|
|
2625
|
+
return false;
|
|
2626
|
+
}
|
|
2627
|
+
};
|
|
2628
|
+
var toStr$3 = Object.prototype.toString;
|
|
2629
|
+
var numClass = '[object Number]';
|
|
2630
|
+
var hasToStringTag$3 = shams();
|
|
2631
|
+
|
|
2632
|
+
var isNumberObject = function isNumberObject(value) {
|
|
2633
|
+
if (typeof value === 'number') {
|
|
2634
|
+
return true;
|
|
2635
|
+
}
|
|
2636
|
+
if (typeof value !== 'object') {
|
|
2637
|
+
return false;
|
|
2638
|
+
}
|
|
2639
|
+
return hasToStringTag$3 ? tryNumberObject(value) : toStr$3.call(value) === numClass;
|
|
2640
|
+
};
|
|
2641
|
+
|
|
2642
|
+
var callBound$4 = callBound$c;
|
|
2643
|
+
var $boolToStr = callBound$4('Boolean.prototype.toString');
|
|
2644
|
+
var $toString$1 = callBound$4('Object.prototype.toString');
|
|
2645
|
+
|
|
2646
|
+
var tryBooleanObject = function booleanBrandCheck(value) {
|
|
2647
|
+
try {
|
|
2648
|
+
$boolToStr(value);
|
|
2649
|
+
return true;
|
|
2650
|
+
} catch (e) {
|
|
2651
|
+
return false;
|
|
2652
|
+
}
|
|
2653
|
+
};
|
|
2654
|
+
var boolClass = '[object Boolean]';
|
|
2655
|
+
var hasToStringTag$2 = shams();
|
|
2656
|
+
|
|
2657
|
+
var isBooleanObject = function isBoolean(value) {
|
|
2658
|
+
if (typeof value === 'boolean') {
|
|
2659
|
+
return true;
|
|
2660
|
+
}
|
|
2661
|
+
if (value === null || typeof value !== 'object') {
|
|
2662
|
+
return false;
|
|
2663
|
+
}
|
|
2664
|
+
return hasToStringTag$2 && Symbol.toStringTag in value ? tryBooleanObject(value) : $toString$1(value) === boolClass;
|
|
2665
|
+
};
|
|
2666
|
+
|
|
2667
|
+
var isSymbol$1 = {exports: {}};
|
|
2668
|
+
|
|
2669
|
+
var toStr$2 = Object.prototype.toString;
|
|
2670
|
+
var hasSymbols = hasSymbols$5();
|
|
2671
|
+
|
|
2672
|
+
if (hasSymbols) {
|
|
2673
|
+
var symToStr = Symbol.prototype.toString;
|
|
2674
|
+
var symStringRegex = /^Symbol\(.*\)$/;
|
|
2675
|
+
var isSymbolObject = function isRealSymbolObject(value) {
|
|
2676
|
+
if (typeof value.valueOf() !== 'symbol') {
|
|
2677
|
+
return false;
|
|
2678
|
+
}
|
|
2679
|
+
return symStringRegex.test(symToStr.call(value));
|
|
2680
|
+
};
|
|
2681
|
+
|
|
2682
|
+
isSymbol$1.exports = function isSymbol(value) {
|
|
2683
|
+
if (typeof value === 'symbol') {
|
|
2684
|
+
return true;
|
|
2685
|
+
}
|
|
2686
|
+
if (toStr$2.call(value) !== '[object Symbol]') {
|
|
2687
|
+
return false;
|
|
2688
|
+
}
|
|
2689
|
+
try {
|
|
2690
|
+
return isSymbolObject(value);
|
|
2691
|
+
} catch (e) {
|
|
2692
|
+
return false;
|
|
2693
|
+
}
|
|
2694
|
+
};
|
|
2695
|
+
} else {
|
|
2696
|
+
|
|
2697
|
+
isSymbol$1.exports = function isSymbol(value) {
|
|
2698
|
+
// this environment does not support Symbols.
|
|
2699
|
+
return false;
|
|
2700
|
+
};
|
|
2701
|
+
}
|
|
2702
|
+
|
|
2703
|
+
var isSymbolExports = isSymbol$1.exports;
|
|
2704
|
+
|
|
2705
|
+
var isBigint = {exports: {}};
|
|
2706
|
+
|
|
2707
|
+
var $BigInt = typeof BigInt !== 'undefined' && BigInt;
|
|
2708
|
+
|
|
2709
|
+
var hasBigints = function hasNativeBigInts() {
|
|
2710
|
+
return typeof $BigInt === 'function'
|
|
2711
|
+
&& typeof BigInt === 'function'
|
|
2712
|
+
&& typeof $BigInt(42) === 'bigint' // eslint-disable-line no-magic-numbers
|
|
2713
|
+
&& typeof BigInt(42) === 'bigint'; // eslint-disable-line no-magic-numbers
|
|
2714
|
+
};
|
|
2715
|
+
|
|
2716
|
+
var hasBigInts = hasBigints();
|
|
2717
|
+
|
|
2718
|
+
if (hasBigInts) {
|
|
2719
|
+
var bigIntValueOf = BigInt.prototype.valueOf;
|
|
2720
|
+
var tryBigInt = function tryBigIntObject(value) {
|
|
2721
|
+
try {
|
|
2722
|
+
bigIntValueOf.call(value);
|
|
2723
|
+
return true;
|
|
2724
|
+
} catch (e) {
|
|
2725
|
+
}
|
|
2726
|
+
return false;
|
|
2727
|
+
};
|
|
2728
|
+
|
|
2729
|
+
isBigint.exports = function isBigInt(value) {
|
|
2730
|
+
if (
|
|
2731
|
+
value === null
|
|
2732
|
+
|| typeof value === 'undefined'
|
|
2733
|
+
|| typeof value === 'boolean'
|
|
2734
|
+
|| typeof value === 'string'
|
|
2735
|
+
|| typeof value === 'number'
|
|
2736
|
+
|| typeof value === 'symbol'
|
|
2737
|
+
|| typeof value === 'function'
|
|
2738
|
+
) {
|
|
2739
|
+
return false;
|
|
2740
|
+
}
|
|
2741
|
+
if (typeof value === 'bigint') {
|
|
2742
|
+
return true;
|
|
2743
|
+
}
|
|
2744
|
+
|
|
2745
|
+
return tryBigInt(value);
|
|
2746
|
+
};
|
|
2747
|
+
} else {
|
|
2748
|
+
isBigint.exports = function isBigInt(value) {
|
|
2749
|
+
return false;
|
|
2750
|
+
};
|
|
2751
|
+
}
|
|
2752
|
+
|
|
2753
|
+
var isBigintExports = isBigint.exports;
|
|
2754
|
+
|
|
2755
|
+
var isString = isString$2;
|
|
2756
|
+
var isNumber = isNumberObject;
|
|
2757
|
+
var isBoolean = isBooleanObject;
|
|
2758
|
+
var isSymbol = isSymbolExports;
|
|
2759
|
+
var isBigInt = isBigintExports;
|
|
2760
|
+
|
|
2761
|
+
// eslint-disable-next-line consistent-return
|
|
2762
|
+
var whichBoxedPrimitive$1 = function whichBoxedPrimitive(value) {
|
|
2763
|
+
// eslint-disable-next-line eqeqeq
|
|
2764
|
+
if (value == null || (typeof value !== 'object' && typeof value !== 'function')) {
|
|
2765
|
+
return null;
|
|
2766
|
+
}
|
|
2767
|
+
if (isString(value)) {
|
|
2768
|
+
return 'String';
|
|
2769
|
+
}
|
|
2770
|
+
if (isNumber(value)) {
|
|
2771
|
+
return 'Number';
|
|
2772
|
+
}
|
|
2773
|
+
if (isBoolean(value)) {
|
|
2774
|
+
return 'Boolean';
|
|
2775
|
+
}
|
|
2776
|
+
if (isSymbol(value)) {
|
|
2777
|
+
return 'Symbol';
|
|
2778
|
+
}
|
|
2779
|
+
if (isBigInt(value)) {
|
|
2780
|
+
return 'BigInt';
|
|
2781
|
+
}
|
|
2782
|
+
};
|
|
2783
|
+
|
|
2784
|
+
var $WeakMap = typeof WeakMap === 'function' && WeakMap.prototype ? WeakMap : null;
|
|
2785
|
+
var $WeakSet$1 = typeof WeakSet === 'function' && WeakSet.prototype ? WeakSet : null;
|
|
2786
|
+
|
|
2787
|
+
var exported;
|
|
2788
|
+
|
|
2789
|
+
if (!$WeakMap) {
|
|
2790
|
+
/** @type {import('.')} */
|
|
2791
|
+
// eslint-disable-next-line no-unused-vars
|
|
2792
|
+
exported = function isWeakMap(x) {
|
|
2793
|
+
// `WeakMap` is not present in this environment.
|
|
2794
|
+
return false;
|
|
2795
|
+
};
|
|
2796
|
+
}
|
|
2797
|
+
|
|
2798
|
+
var $mapHas$2 = $WeakMap ? $WeakMap.prototype.has : null;
|
|
2799
|
+
var $setHas$2 = $WeakSet$1 ? $WeakSet$1.prototype.has : null;
|
|
2800
|
+
if (!exported && !$mapHas$2) {
|
|
2801
|
+
/** @type {import('.')} */
|
|
2802
|
+
// eslint-disable-next-line no-unused-vars
|
|
2803
|
+
exported = function isWeakMap(x) {
|
|
2804
|
+
// `WeakMap` does not have a `has` method
|
|
2805
|
+
return false;
|
|
2806
|
+
};
|
|
2807
|
+
}
|
|
2808
|
+
|
|
2809
|
+
/** @type {import('.')} */
|
|
2810
|
+
var isWeakmap = exported || function isWeakMap(x) {
|
|
2811
|
+
if (!x || typeof x !== 'object') {
|
|
2812
|
+
return false;
|
|
2813
|
+
}
|
|
2814
|
+
try {
|
|
2815
|
+
$mapHas$2.call(x, $mapHas$2);
|
|
2816
|
+
if ($setHas$2) {
|
|
2817
|
+
try {
|
|
2818
|
+
$setHas$2.call(x, $setHas$2);
|
|
2819
|
+
} catch (e) {
|
|
2820
|
+
return true;
|
|
2821
|
+
}
|
|
2822
|
+
}
|
|
2823
|
+
// @ts-expect-error TS can't figure out that $WeakMap is always truthy here
|
|
2824
|
+
return x instanceof $WeakMap; // core-js workaround, pre-v3
|
|
2825
|
+
} catch (e) {}
|
|
2826
|
+
return false;
|
|
2827
|
+
};
|
|
2828
|
+
|
|
2829
|
+
var isWeakset = {exports: {}};
|
|
2830
|
+
|
|
2831
|
+
var GetIntrinsic$1 = getIntrinsic;
|
|
2832
|
+
var callBound$3 = callBound$c;
|
|
2833
|
+
|
|
2834
|
+
var $WeakSet = GetIntrinsic$1('%WeakSet%', true);
|
|
2835
|
+
|
|
2836
|
+
var $setHas$1 = callBound$3('WeakSet.prototype.has', true);
|
|
2837
|
+
|
|
2838
|
+
if ($setHas$1) {
|
|
2839
|
+
var $mapHas$1 = callBound$3('WeakMap.prototype.has', true);
|
|
2840
|
+
|
|
2841
|
+
/** @type {import('.')} */
|
|
2842
|
+
isWeakset.exports = function isWeakSet(x) {
|
|
2843
|
+
if (!x || typeof x !== 'object') {
|
|
2844
|
+
return false;
|
|
2845
|
+
}
|
|
2846
|
+
try {
|
|
2847
|
+
$setHas$1(x, $setHas$1);
|
|
2848
|
+
if ($mapHas$1) {
|
|
2849
|
+
try {
|
|
2850
|
+
$mapHas$1(x, $mapHas$1);
|
|
2851
|
+
} catch (e) {
|
|
2852
|
+
return true;
|
|
2853
|
+
}
|
|
2854
|
+
}
|
|
2855
|
+
// @ts-expect-error TS can't figure out that $WeakSet is always truthy here
|
|
2856
|
+
return x instanceof $WeakSet; // core-js workaround, pre-v3
|
|
2857
|
+
} catch (e) {}
|
|
2858
|
+
return false;
|
|
2859
|
+
};
|
|
2860
|
+
} else {
|
|
2861
|
+
/** @type {import('.')} */
|
|
2862
|
+
// eslint-disable-next-line no-unused-vars
|
|
2863
|
+
isWeakset.exports = function isWeakSet(x) {
|
|
2864
|
+
// `WeakSet` does not exist, or does not have a `has` method
|
|
2865
|
+
return false;
|
|
2866
|
+
};
|
|
2867
|
+
}
|
|
2868
|
+
|
|
2869
|
+
var isWeaksetExports = isWeakset.exports;
|
|
2870
|
+
|
|
2871
|
+
var isMap = isMap$2;
|
|
2872
|
+
var isSet = isSet$2;
|
|
2873
|
+
var isWeakMap = isWeakmap;
|
|
2874
|
+
var isWeakSet = isWeaksetExports;
|
|
2875
|
+
|
|
2876
|
+
/** @type {import('.')} */
|
|
2877
|
+
var whichCollection$1 = function whichCollection(/** @type {unknown} */ value) {
|
|
2878
|
+
if (value && typeof value === 'object') {
|
|
2879
|
+
if (isMap(value)) {
|
|
2880
|
+
return 'Map';
|
|
2881
|
+
}
|
|
2882
|
+
if (isSet(value)) {
|
|
2883
|
+
return 'Set';
|
|
2884
|
+
}
|
|
2885
|
+
if (isWeakMap(value)) {
|
|
2886
|
+
return 'WeakMap';
|
|
2887
|
+
}
|
|
2888
|
+
if (isWeakSet(value)) {
|
|
2889
|
+
return 'WeakSet';
|
|
2890
|
+
}
|
|
2891
|
+
}
|
|
2892
|
+
return false;
|
|
2893
|
+
};
|
|
2894
|
+
|
|
2895
|
+
var fnToStr = Function.prototype.toString;
|
|
2896
|
+
var reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply;
|
|
2897
|
+
var badArrayLike;
|
|
2898
|
+
var isCallableMarker;
|
|
2899
|
+
if (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') {
|
|
2900
|
+
try {
|
|
2901
|
+
badArrayLike = Object.defineProperty({}, 'length', {
|
|
2902
|
+
get: function () {
|
|
2903
|
+
throw isCallableMarker;
|
|
2904
|
+
}
|
|
2905
|
+
});
|
|
2906
|
+
isCallableMarker = {};
|
|
2907
|
+
// eslint-disable-next-line no-throw-literal
|
|
2908
|
+
reflectApply(function () { throw 42; }, null, badArrayLike);
|
|
2909
|
+
} catch (_) {
|
|
2910
|
+
if (_ !== isCallableMarker) {
|
|
2911
|
+
reflectApply = null;
|
|
2912
|
+
}
|
|
2913
|
+
}
|
|
2914
|
+
} else {
|
|
2915
|
+
reflectApply = null;
|
|
2916
|
+
}
|
|
2917
|
+
|
|
2918
|
+
var constructorRegex = /^\s*class\b/;
|
|
2919
|
+
var isES6ClassFn = function isES6ClassFunction(value) {
|
|
2920
|
+
try {
|
|
2921
|
+
var fnStr = fnToStr.call(value);
|
|
2922
|
+
return constructorRegex.test(fnStr);
|
|
2923
|
+
} catch (e) {
|
|
2924
|
+
return false; // not a function
|
|
2925
|
+
}
|
|
2926
|
+
};
|
|
2927
|
+
|
|
2928
|
+
var tryFunctionObject = function tryFunctionToStr(value) {
|
|
2929
|
+
try {
|
|
2930
|
+
if (isES6ClassFn(value)) { return false; }
|
|
2931
|
+
fnToStr.call(value);
|
|
2932
|
+
return true;
|
|
2933
|
+
} catch (e) {
|
|
2934
|
+
return false;
|
|
2935
|
+
}
|
|
2936
|
+
};
|
|
2937
|
+
var toStr$1 = Object.prototype.toString;
|
|
2938
|
+
var objectClass = '[object Object]';
|
|
2939
|
+
var fnClass = '[object Function]';
|
|
2940
|
+
var genClass = '[object GeneratorFunction]';
|
|
2941
|
+
var ddaClass = '[object HTMLAllCollection]'; // IE 11
|
|
2942
|
+
var ddaClass2 = '[object HTML document.all class]';
|
|
2943
|
+
var ddaClass3 = '[object HTMLCollection]'; // IE 9-10
|
|
2944
|
+
var hasToStringTag$1 = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag`
|
|
2945
|
+
|
|
2946
|
+
var isIE68 = !(0 in [,]); // eslint-disable-line no-sparse-arrays, comma-spacing
|
|
2947
|
+
|
|
2948
|
+
var isDDA = function isDocumentDotAll() { return false; };
|
|
2949
|
+
if (typeof document === 'object') {
|
|
2950
|
+
// Firefox 3 canonicalizes DDA to undefined when it's not accessed directly
|
|
2951
|
+
var all = document.all;
|
|
2952
|
+
if (toStr$1.call(all) === toStr$1.call(document.all)) {
|
|
2953
|
+
isDDA = function isDocumentDotAll(value) {
|
|
2954
|
+
/* globals document: false */
|
|
2955
|
+
// in IE 6-8, typeof document.all is "object" and it's truthy
|
|
2956
|
+
if ((isIE68 || !value) && (typeof value === 'undefined' || typeof value === 'object')) {
|
|
2957
|
+
try {
|
|
2958
|
+
var str = toStr$1.call(value);
|
|
2959
|
+
return (
|
|
2960
|
+
str === ddaClass
|
|
2961
|
+
|| str === ddaClass2
|
|
2962
|
+
|| str === ddaClass3 // opera 12.16
|
|
2963
|
+
|| str === objectClass // IE 6-8
|
|
2964
|
+
) && value('') == null; // eslint-disable-line eqeqeq
|
|
2965
|
+
} catch (e) { /**/ }
|
|
2966
|
+
}
|
|
2967
|
+
return false;
|
|
2968
|
+
};
|
|
2969
|
+
}
|
|
2970
|
+
}
|
|
2971
|
+
|
|
2972
|
+
var isCallable$1 = reflectApply
|
|
2973
|
+
? function isCallable(value) {
|
|
2974
|
+
if (isDDA(value)) { return true; }
|
|
2975
|
+
if (!value) { return false; }
|
|
2976
|
+
if (typeof value !== 'function' && typeof value !== 'object') { return false; }
|
|
2977
|
+
try {
|
|
2978
|
+
reflectApply(value, null, badArrayLike);
|
|
2979
|
+
} catch (e) {
|
|
2980
|
+
if (e !== isCallableMarker) { return false; }
|
|
2981
|
+
}
|
|
2982
|
+
return !isES6ClassFn(value) && tryFunctionObject(value);
|
|
2983
|
+
}
|
|
2984
|
+
: function isCallable(value) {
|
|
2985
|
+
if (isDDA(value)) { return true; }
|
|
2986
|
+
if (!value) { return false; }
|
|
2987
|
+
if (typeof value !== 'function' && typeof value !== 'object') { return false; }
|
|
2988
|
+
if (hasToStringTag$1) { return tryFunctionObject(value); }
|
|
2989
|
+
if (isES6ClassFn(value)) { return false; }
|
|
2990
|
+
var strClass = toStr$1.call(value);
|
|
2991
|
+
if (strClass !== fnClass && strClass !== genClass && !(/^\[object HTML/).test(strClass)) { return false; }
|
|
2992
|
+
return tryFunctionObject(value);
|
|
2993
|
+
};
|
|
2994
|
+
|
|
2995
|
+
var isCallable = isCallable$1;
|
|
2996
|
+
|
|
2997
|
+
var toStr = Object.prototype.toString;
|
|
2998
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
2999
|
+
|
|
3000
|
+
var forEachArray = function forEachArray(array, iterator, receiver) {
|
|
3001
|
+
for (var i = 0, len = array.length; i < len; i++) {
|
|
3002
|
+
if (hasOwnProperty.call(array, i)) {
|
|
3003
|
+
if (receiver == null) {
|
|
3004
|
+
iterator(array[i], i, array);
|
|
3005
|
+
} else {
|
|
3006
|
+
iterator.call(receiver, array[i], i, array);
|
|
3007
|
+
}
|
|
3008
|
+
}
|
|
3009
|
+
}
|
|
3010
|
+
};
|
|
3011
|
+
|
|
3012
|
+
var forEachString = function forEachString(string, iterator, receiver) {
|
|
3013
|
+
for (var i = 0, len = string.length; i < len; i++) {
|
|
3014
|
+
// no such thing as a sparse string.
|
|
3015
|
+
if (receiver == null) {
|
|
3016
|
+
iterator(string.charAt(i), i, string);
|
|
3017
|
+
} else {
|
|
3018
|
+
iterator.call(receiver, string.charAt(i), i, string);
|
|
3019
|
+
}
|
|
3020
|
+
}
|
|
3021
|
+
};
|
|
3022
|
+
|
|
3023
|
+
var forEachObject = function forEachObject(object, iterator, receiver) {
|
|
3024
|
+
for (var k in object) {
|
|
3025
|
+
if (hasOwnProperty.call(object, k)) {
|
|
3026
|
+
if (receiver == null) {
|
|
3027
|
+
iterator(object[k], k, object);
|
|
3028
|
+
} else {
|
|
3029
|
+
iterator.call(receiver, object[k], k, object);
|
|
3030
|
+
}
|
|
3031
|
+
}
|
|
3032
|
+
}
|
|
3033
|
+
};
|
|
3034
|
+
|
|
3035
|
+
var forEach$1 = function forEach(list, iterator, thisArg) {
|
|
3036
|
+
if (!isCallable(iterator)) {
|
|
3037
|
+
throw new TypeError('iterator must be a function');
|
|
3038
|
+
}
|
|
3039
|
+
|
|
3040
|
+
var receiver;
|
|
3041
|
+
if (arguments.length >= 3) {
|
|
3042
|
+
receiver = thisArg;
|
|
3043
|
+
}
|
|
3044
|
+
|
|
3045
|
+
if (toStr.call(list) === '[object Array]') {
|
|
3046
|
+
forEachArray(list, iterator, receiver);
|
|
3047
|
+
} else if (typeof list === 'string') {
|
|
3048
|
+
forEachString(list, iterator, receiver);
|
|
3049
|
+
} else {
|
|
3050
|
+
forEachObject(list, iterator, receiver);
|
|
3051
|
+
}
|
|
3052
|
+
};
|
|
3053
|
+
|
|
3054
|
+
var forEach_1 = forEach$1;
|
|
3055
|
+
|
|
3056
|
+
/** @type {import('.')} */
|
|
3057
|
+
var possibleTypedArrayNames = [
|
|
3058
|
+
'Float32Array',
|
|
3059
|
+
'Float64Array',
|
|
3060
|
+
'Int8Array',
|
|
3061
|
+
'Int16Array',
|
|
3062
|
+
'Int32Array',
|
|
3063
|
+
'Uint8Array',
|
|
3064
|
+
'Uint8ClampedArray',
|
|
3065
|
+
'Uint16Array',
|
|
3066
|
+
'Uint32Array',
|
|
3067
|
+
'BigInt64Array',
|
|
3068
|
+
'BigUint64Array'
|
|
3069
|
+
];
|
|
3070
|
+
|
|
3071
|
+
var possibleNames = possibleTypedArrayNames;
|
|
3072
|
+
|
|
3073
|
+
var g$1 = typeof globalThis === 'undefined' ? commonjsGlobal : globalThis;
|
|
3074
|
+
|
|
3075
|
+
/** @type {import('.')} */
|
|
3076
|
+
var availableTypedArrays$1 = function availableTypedArrays() {
|
|
3077
|
+
var /** @type {ReturnType<typeof availableTypedArrays>} */ out = [];
|
|
3078
|
+
for (var i = 0; i < possibleNames.length; i++) {
|
|
3079
|
+
if (typeof g$1[possibleNames[i]] === 'function') {
|
|
3080
|
+
// @ts-expect-error
|
|
3081
|
+
out[out.length] = possibleNames[i];
|
|
3082
|
+
}
|
|
3083
|
+
}
|
|
3084
|
+
return out;
|
|
3085
|
+
};
|
|
3086
|
+
|
|
3087
|
+
var forEach = forEach_1;
|
|
3088
|
+
var availableTypedArrays = availableTypedArrays$1;
|
|
3089
|
+
var callBind = callBindExports;
|
|
3090
|
+
var callBound$2 = callBound$c;
|
|
3091
|
+
var gOPD = gopd$1;
|
|
3092
|
+
|
|
3093
|
+
/** @type {(O: object) => string} */
|
|
3094
|
+
var $toString = callBound$2('Object.prototype.toString');
|
|
3095
|
+
var hasToStringTag = shams();
|
|
3096
|
+
|
|
3097
|
+
var g = typeof globalThis === 'undefined' ? commonjsGlobal : globalThis;
|
|
3098
|
+
var typedArrays = availableTypedArrays();
|
|
3099
|
+
|
|
3100
|
+
var $slice = callBound$2('String.prototype.slice');
|
|
3101
|
+
var getPrototypeOf = Object.getPrototypeOf; // require('getprototypeof');
|
|
3102
|
+
|
|
3103
|
+
/** @type {<T = unknown>(array: readonly T[], value: unknown) => number} */
|
|
3104
|
+
var $indexOf = callBound$2('Array.prototype.indexOf', true) || function indexOf(array, value) {
|
|
3105
|
+
for (var i = 0; i < array.length; i += 1) {
|
|
3106
|
+
if (array[i] === value) {
|
|
3107
|
+
return i;
|
|
3108
|
+
}
|
|
3109
|
+
}
|
|
3110
|
+
return -1;
|
|
3111
|
+
};
|
|
3112
|
+
|
|
3113
|
+
/** @typedef {(receiver: import('.').TypedArray) => string | typeof Uint8Array.prototype.slice.call | typeof Uint8Array.prototype.set.call} Getter */
|
|
3114
|
+
/** @type {{ [k in `\$${import('.').TypedArrayName}`]?: Getter } & { __proto__: null }} */
|
|
3115
|
+
var cache = { __proto__: null };
|
|
3116
|
+
if (hasToStringTag && gOPD && getPrototypeOf) {
|
|
3117
|
+
forEach(typedArrays, function (typedArray) {
|
|
3118
|
+
var arr = new g[typedArray]();
|
|
3119
|
+
if (Symbol.toStringTag in arr) {
|
|
3120
|
+
var proto = getPrototypeOf(arr);
|
|
3121
|
+
// @ts-expect-error TS won't narrow inside a closure
|
|
3122
|
+
var descriptor = gOPD(proto, Symbol.toStringTag);
|
|
3123
|
+
if (!descriptor) {
|
|
3124
|
+
var superProto = getPrototypeOf(proto);
|
|
3125
|
+
// @ts-expect-error TS won't narrow inside a closure
|
|
3126
|
+
descriptor = gOPD(superProto, Symbol.toStringTag);
|
|
3127
|
+
}
|
|
3128
|
+
// @ts-expect-error TODO: fix
|
|
3129
|
+
cache['$' + typedArray] = callBind(descriptor.get);
|
|
3130
|
+
}
|
|
3131
|
+
});
|
|
3132
|
+
} else {
|
|
3133
|
+
forEach(typedArrays, function (typedArray) {
|
|
3134
|
+
var arr = new g[typedArray]();
|
|
3135
|
+
var fn = arr.slice || arr.set;
|
|
3136
|
+
if (fn) {
|
|
3137
|
+
// @ts-expect-error TODO: fix
|
|
3138
|
+
cache['$' + typedArray] = callBind(fn);
|
|
3139
|
+
}
|
|
3140
|
+
});
|
|
3141
|
+
}
|
|
3142
|
+
|
|
3143
|
+
/** @type {(value: object) => false | import('.').TypedArrayName} */
|
|
3144
|
+
var tryTypedArrays = function tryAllTypedArrays(value) {
|
|
3145
|
+
/** @type {ReturnType<typeof tryAllTypedArrays>} */ var found = false;
|
|
3146
|
+
forEach(
|
|
3147
|
+
// eslint-disable-next-line no-extra-parens
|
|
3148
|
+
/** @type {Record<`\$${TypedArrayName}`, Getter>} */ /** @type {any} */ (cache),
|
|
3149
|
+
/** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */
|
|
3150
|
+
function (getter, typedArray) {
|
|
3151
|
+
if (!found) {
|
|
3152
|
+
try {
|
|
3153
|
+
// @ts-expect-error TODO: fix
|
|
3154
|
+
if ('$' + getter(value) === typedArray) {
|
|
3155
|
+
found = $slice(typedArray, 1);
|
|
3156
|
+
}
|
|
3157
|
+
} catch (e) { /**/ }
|
|
3158
|
+
}
|
|
3159
|
+
}
|
|
3160
|
+
);
|
|
3161
|
+
return found;
|
|
3162
|
+
};
|
|
3163
|
+
|
|
3164
|
+
/** @type {(value: object) => false | import('.').TypedArrayName} */
|
|
3165
|
+
var trySlices = function tryAllSlices(value) {
|
|
3166
|
+
/** @type {ReturnType<typeof tryAllSlices>} */ var found = false;
|
|
3167
|
+
forEach(
|
|
3168
|
+
// eslint-disable-next-line no-extra-parens
|
|
3169
|
+
/** @type {Record<`\$${TypedArrayName}`, Getter>} */ /** @type {any} */ (cache),
|
|
3170
|
+
/** @type {(getter: typeof cache, name: `\$${import('.').TypedArrayName}`) => void} */ function (getter, name) {
|
|
3171
|
+
if (!found) {
|
|
3172
|
+
try {
|
|
3173
|
+
// @ts-expect-error TODO: fix
|
|
3174
|
+
getter(value);
|
|
3175
|
+
found = $slice(name, 1);
|
|
3176
|
+
} catch (e) { /**/ }
|
|
3177
|
+
}
|
|
3178
|
+
}
|
|
3179
|
+
);
|
|
3180
|
+
return found;
|
|
3181
|
+
};
|
|
3182
|
+
|
|
3183
|
+
/** @type {import('.')} */
|
|
3184
|
+
var whichTypedArray$1 = function whichTypedArray(value) {
|
|
3185
|
+
if (!value || typeof value !== 'object') { return false; }
|
|
3186
|
+
if (!hasToStringTag) {
|
|
3187
|
+
/** @type {string} */
|
|
3188
|
+
var tag = $slice($toString(value), 8, -1);
|
|
3189
|
+
if ($indexOf(typedArrays, tag) > -1) {
|
|
3190
|
+
return tag;
|
|
3191
|
+
}
|
|
3192
|
+
if (tag !== 'Object') {
|
|
3193
|
+
return false;
|
|
3194
|
+
}
|
|
3195
|
+
// node < 0.6 hits here on real Typed Arrays
|
|
3196
|
+
return trySlices(value);
|
|
3197
|
+
}
|
|
3198
|
+
if (!gOPD) { return null; } // unknown engine
|
|
3199
|
+
return tryTypedArrays(value);
|
|
3200
|
+
};
|
|
3201
|
+
|
|
3202
|
+
var callBound$1 = callBound$c;
|
|
3203
|
+
var $byteLength = callBound$1('ArrayBuffer.prototype.byteLength', true);
|
|
3204
|
+
|
|
3205
|
+
var isArrayBuffer$1 = isArrayBuffer$2;
|
|
3206
|
+
|
|
3207
|
+
/** @type {import('.')} */
|
|
3208
|
+
var arrayBufferByteLength = function byteLength(ab) {
|
|
3209
|
+
if (!isArrayBuffer$1(ab)) {
|
|
3210
|
+
return NaN;
|
|
3211
|
+
}
|
|
3212
|
+
return $byteLength ? $byteLength(ab) : ab.byteLength;
|
|
3213
|
+
}; // in node < 0.11, byteLength is an own nonconfigurable property
|
|
3214
|
+
|
|
3215
|
+
var assign = object_assign;
|
|
3216
|
+
var callBound = callBound$c;
|
|
3217
|
+
var flags = regexp_prototype_flags;
|
|
3218
|
+
var GetIntrinsic = getIntrinsic;
|
|
3219
|
+
var getIterator = esGetIteratorExports;
|
|
3220
|
+
var getSideChannel = sideChannel;
|
|
3221
|
+
var is = objectIs;
|
|
3222
|
+
var isArguments = isArguments$2;
|
|
3223
|
+
var isArray = isarray;
|
|
3224
|
+
var isArrayBuffer = isArrayBuffer$2;
|
|
3225
|
+
var isDate = isDateObject;
|
|
3226
|
+
var isRegex = isRegex$1;
|
|
3227
|
+
var isSharedArrayBuffer = isSharedArrayBuffer$1;
|
|
3228
|
+
var objectKeys = objectKeys$2;
|
|
3229
|
+
var whichBoxedPrimitive = whichBoxedPrimitive$1;
|
|
3230
|
+
var whichCollection = whichCollection$1;
|
|
3231
|
+
var whichTypedArray = whichTypedArray$1;
|
|
3232
|
+
var byteLength = arrayBufferByteLength;
|
|
3233
|
+
|
|
3234
|
+
var sabByteLength = callBound('SharedArrayBuffer.prototype.byteLength', true);
|
|
3235
|
+
|
|
3236
|
+
var $getTime = callBound('Date.prototype.getTime');
|
|
3237
|
+
var gPO = Object.getPrototypeOf;
|
|
3238
|
+
var $objToString = callBound('Object.prototype.toString');
|
|
3239
|
+
|
|
3240
|
+
var $Set = GetIntrinsic('%Set%', true);
|
|
3241
|
+
var $mapHas = callBound('Map.prototype.has', true);
|
|
3242
|
+
var $mapGet = callBound('Map.prototype.get', true);
|
|
3243
|
+
var $mapSize = callBound('Map.prototype.size', true);
|
|
3244
|
+
var $setAdd = callBound('Set.prototype.add', true);
|
|
3245
|
+
var $setDelete = callBound('Set.prototype.delete', true);
|
|
3246
|
+
var $setHas = callBound('Set.prototype.has', true);
|
|
3247
|
+
var $setSize = callBound('Set.prototype.size', true);
|
|
3248
|
+
|
|
3249
|
+
// taken from https://github.com/browserify/commonjs-assert/blob/bba838e9ba9e28edf3127ce6974624208502f6bc/internal/util/comparisons.js#L401-L414
|
|
3250
|
+
function setHasEqualElement(set, val1, opts, channel) {
|
|
3251
|
+
var i = getIterator(set);
|
|
3252
|
+
var result;
|
|
3253
|
+
while ((result = i.next()) && !result.done) {
|
|
3254
|
+
if (internalDeepEqual(val1, result.value, opts, channel)) { // eslint-disable-line no-use-before-define
|
|
3255
|
+
// Remove the matching element to make sure we do not check that again.
|
|
3256
|
+
$setDelete(set, result.value);
|
|
3257
|
+
return true;
|
|
3258
|
+
}
|
|
3259
|
+
}
|
|
3260
|
+
|
|
3261
|
+
return false;
|
|
3262
|
+
}
|
|
3263
|
+
|
|
3264
|
+
// taken from https://github.com/browserify/commonjs-assert/blob/bba838e9ba9e28edf3127ce6974624208502f6bc/internal/util/comparisons.js#L416-L439
|
|
3265
|
+
function findLooseMatchingPrimitives(prim) {
|
|
3266
|
+
if (typeof prim === 'undefined') {
|
|
3267
|
+
return null;
|
|
3268
|
+
}
|
|
3269
|
+
if (typeof prim === 'object') { // Only pass in null as object!
|
|
3270
|
+
return void 0;
|
|
3271
|
+
}
|
|
3272
|
+
if (typeof prim === 'symbol') {
|
|
3273
|
+
return false;
|
|
3274
|
+
}
|
|
3275
|
+
if (typeof prim === 'string' || typeof prim === 'number') {
|
|
3276
|
+
// Loose equal entries exist only if the string is possible to convert to a regular number and not NaN.
|
|
3277
|
+
return +prim === +prim; // eslint-disable-line no-implicit-coercion
|
|
3278
|
+
}
|
|
3279
|
+
return true;
|
|
3280
|
+
}
|
|
3281
|
+
|
|
3282
|
+
// taken from https://github.com/browserify/commonjs-assert/blob/bba838e9ba9e28edf3127ce6974624208502f6bc/internal/util/comparisons.js#L449-L460
|
|
3283
|
+
function mapMightHaveLoosePrim(a, b, prim, item, opts, channel) {
|
|
3284
|
+
var altValue = findLooseMatchingPrimitives(prim);
|
|
3285
|
+
if (altValue != null) {
|
|
3286
|
+
return altValue;
|
|
3287
|
+
}
|
|
3288
|
+
var curB = $mapGet(b, altValue);
|
|
3289
|
+
var looseOpts = assign({}, opts, { strict: false });
|
|
3290
|
+
if (
|
|
3291
|
+
(typeof curB === 'undefined' && !$mapHas(b, altValue))
|
|
3292
|
+
// eslint-disable-next-line no-use-before-define
|
|
3293
|
+
|| !internalDeepEqual(item, curB, looseOpts, channel)
|
|
3294
|
+
) {
|
|
3295
|
+
return false;
|
|
3296
|
+
}
|
|
3297
|
+
// eslint-disable-next-line no-use-before-define
|
|
3298
|
+
return !$mapHas(a, altValue) && internalDeepEqual(item, curB, looseOpts, channel);
|
|
3299
|
+
}
|
|
3300
|
+
|
|
3301
|
+
// taken from https://github.com/browserify/commonjs-assert/blob/bba838e9ba9e28edf3127ce6974624208502f6bc/internal/util/comparisons.js#L441-L447
|
|
3302
|
+
function setMightHaveLoosePrim(a, b, prim) {
|
|
3303
|
+
var altValue = findLooseMatchingPrimitives(prim);
|
|
3304
|
+
if (altValue != null) {
|
|
3305
|
+
return altValue;
|
|
3306
|
+
}
|
|
3307
|
+
|
|
3308
|
+
return $setHas(b, altValue) && !$setHas(a, altValue);
|
|
3309
|
+
}
|
|
3310
|
+
|
|
3311
|
+
// taken from https://github.com/browserify/commonjs-assert/blob/bba838e9ba9e28edf3127ce6974624208502f6bc/internal/util/comparisons.js#L518-L533
|
|
3312
|
+
function mapHasEqualEntry(set, map, key1, item1, opts, channel) {
|
|
3313
|
+
var i = getIterator(set);
|
|
3314
|
+
var result;
|
|
3315
|
+
var key2;
|
|
3316
|
+
while ((result = i.next()) && !result.done) {
|
|
3317
|
+
key2 = result.value;
|
|
3318
|
+
if (
|
|
3319
|
+
// eslint-disable-next-line no-use-before-define
|
|
3320
|
+
internalDeepEqual(key1, key2, opts, channel)
|
|
3321
|
+
// eslint-disable-next-line no-use-before-define
|
|
3322
|
+
&& internalDeepEqual(item1, $mapGet(map, key2), opts, channel)
|
|
3323
|
+
) {
|
|
3324
|
+
$setDelete(set, key2);
|
|
3325
|
+
return true;
|
|
3326
|
+
}
|
|
3327
|
+
}
|
|
3328
|
+
|
|
3329
|
+
return false;
|
|
3330
|
+
}
|
|
3331
|
+
|
|
3332
|
+
function internalDeepEqual(actual, expected, options, channel) {
|
|
3333
|
+
var opts = options || {};
|
|
3334
|
+
|
|
3335
|
+
// 7.1. All identical values are equivalent, as determined by ===.
|
|
3336
|
+
if (opts.strict ? is(actual, expected) : actual === expected) {
|
|
3337
|
+
return true;
|
|
3338
|
+
}
|
|
3339
|
+
|
|
3340
|
+
var actualBoxed = whichBoxedPrimitive(actual);
|
|
3341
|
+
var expectedBoxed = whichBoxedPrimitive(expected);
|
|
3342
|
+
if (actualBoxed !== expectedBoxed) {
|
|
3343
|
+
return false;
|
|
3344
|
+
}
|
|
3345
|
+
|
|
3346
|
+
// 7.3. Other pairs that do not both pass typeof value == 'object', equivalence is determined by ==.
|
|
3347
|
+
if (!actual || !expected || (typeof actual !== 'object' && typeof expected !== 'object')) {
|
|
3348
|
+
return opts.strict ? is(actual, expected) : actual == expected; // eslint-disable-line eqeqeq
|
|
3349
|
+
}
|
|
3350
|
+
|
|
3351
|
+
/*
|
|
3352
|
+
* 7.4. For all other Object pairs, including Array objects, equivalence is
|
|
3353
|
+
* determined by having the same number of owned properties (as verified
|
|
3354
|
+
* with Object.prototype.hasOwnProperty.call), the same set of keys
|
|
3355
|
+
* (although not necessarily the same order), equivalent values for every
|
|
3356
|
+
* corresponding key, and an identical 'prototype' property. Note: this
|
|
3357
|
+
* accounts for both named and indexed properties on Arrays.
|
|
3358
|
+
*/
|
|
3359
|
+
// see https://github.com/nodejs/node/commit/d3aafd02efd3a403d646a3044adcf14e63a88d32 for memos/channel inspiration
|
|
3360
|
+
|
|
3361
|
+
var hasActual = channel.has(actual);
|
|
3362
|
+
var hasExpected = channel.has(expected);
|
|
3363
|
+
var sentinel;
|
|
3364
|
+
if (hasActual && hasExpected) {
|
|
3365
|
+
if (channel.get(actual) === channel.get(expected)) {
|
|
3366
|
+
return true;
|
|
3367
|
+
}
|
|
3368
|
+
} else {
|
|
3369
|
+
sentinel = {};
|
|
3370
|
+
}
|
|
3371
|
+
if (!hasActual) { channel.set(actual, sentinel); }
|
|
3372
|
+
if (!hasExpected) { channel.set(expected, sentinel); }
|
|
3373
|
+
|
|
3374
|
+
// eslint-disable-next-line no-use-before-define
|
|
3375
|
+
return objEquiv(actual, expected, opts, channel);
|
|
3376
|
+
}
|
|
3377
|
+
|
|
3378
|
+
function isBuffer(x) {
|
|
3379
|
+
if (!x || typeof x !== 'object' || typeof x.length !== 'number') {
|
|
3380
|
+
return false;
|
|
3381
|
+
}
|
|
3382
|
+
if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {
|
|
3383
|
+
return false;
|
|
3384
|
+
}
|
|
3385
|
+
if (x.length > 0 && typeof x[0] !== 'number') {
|
|
3386
|
+
return false;
|
|
3387
|
+
}
|
|
3388
|
+
|
|
3389
|
+
return !!(x.constructor && x.constructor.isBuffer && x.constructor.isBuffer(x));
|
|
3390
|
+
}
|
|
3391
|
+
|
|
3392
|
+
function setEquiv(a, b, opts, channel) {
|
|
3393
|
+
if ($setSize(a) !== $setSize(b)) {
|
|
3394
|
+
return false;
|
|
3395
|
+
}
|
|
3396
|
+
var iA = getIterator(a);
|
|
3397
|
+
var iB = getIterator(b);
|
|
3398
|
+
var resultA;
|
|
3399
|
+
var resultB;
|
|
3400
|
+
var set;
|
|
3401
|
+
while ((resultA = iA.next()) && !resultA.done) {
|
|
3402
|
+
if (resultA.value && typeof resultA.value === 'object') {
|
|
3403
|
+
if (!set) { set = new $Set(); }
|
|
3404
|
+
$setAdd(set, resultA.value);
|
|
3405
|
+
} else if (!$setHas(b, resultA.value)) {
|
|
3406
|
+
if (opts.strict) { return false; }
|
|
3407
|
+
if (!setMightHaveLoosePrim(a, b, resultA.value)) {
|
|
3408
|
+
return false;
|
|
3409
|
+
}
|
|
3410
|
+
if (!set) { set = new $Set(); }
|
|
3411
|
+
$setAdd(set, resultA.value);
|
|
3412
|
+
}
|
|
3413
|
+
}
|
|
3414
|
+
if (set) {
|
|
3415
|
+
while ((resultB = iB.next()) && !resultB.done) {
|
|
3416
|
+
// We have to check if a primitive value is already matching and only if it's not, go hunting for it.
|
|
3417
|
+
if (resultB.value && typeof resultB.value === 'object') {
|
|
3418
|
+
if (!setHasEqualElement(set, resultB.value, opts.strict, channel)) {
|
|
3419
|
+
return false;
|
|
3420
|
+
}
|
|
3421
|
+
} else if (
|
|
3422
|
+
!opts.strict
|
|
3423
|
+
&& !$setHas(a, resultB.value)
|
|
3424
|
+
&& !setHasEqualElement(set, resultB.value, opts.strict, channel)
|
|
3425
|
+
) {
|
|
3426
|
+
return false;
|
|
3427
|
+
}
|
|
3428
|
+
}
|
|
3429
|
+
return $setSize(set) === 0;
|
|
3430
|
+
}
|
|
3431
|
+
return true;
|
|
3432
|
+
}
|
|
3433
|
+
|
|
3434
|
+
function mapEquiv(a, b, opts, channel) {
|
|
3435
|
+
if ($mapSize(a) !== $mapSize(b)) {
|
|
3436
|
+
return false;
|
|
3437
|
+
}
|
|
3438
|
+
var iA = getIterator(a);
|
|
3439
|
+
var iB = getIterator(b);
|
|
3440
|
+
var resultA;
|
|
3441
|
+
var resultB;
|
|
3442
|
+
var set;
|
|
3443
|
+
var key;
|
|
3444
|
+
var item1;
|
|
3445
|
+
var item2;
|
|
3446
|
+
while ((resultA = iA.next()) && !resultA.done) {
|
|
3447
|
+
key = resultA.value[0];
|
|
3448
|
+
item1 = resultA.value[1];
|
|
3449
|
+
if (key && typeof key === 'object') {
|
|
3450
|
+
if (!set) { set = new $Set(); }
|
|
3451
|
+
$setAdd(set, key);
|
|
3452
|
+
} else {
|
|
3453
|
+
item2 = $mapGet(b, key);
|
|
3454
|
+
if ((typeof item2 === 'undefined' && !$mapHas(b, key)) || !internalDeepEqual(item1, item2, opts, channel)) {
|
|
3455
|
+
if (opts.strict) {
|
|
3456
|
+
return false;
|
|
3457
|
+
}
|
|
3458
|
+
if (!mapMightHaveLoosePrim(a, b, key, item1, opts, channel)) {
|
|
3459
|
+
return false;
|
|
3460
|
+
}
|
|
3461
|
+
if (!set) { set = new $Set(); }
|
|
3462
|
+
$setAdd(set, key);
|
|
3463
|
+
}
|
|
3464
|
+
}
|
|
3465
|
+
}
|
|
3466
|
+
|
|
3467
|
+
if (set) {
|
|
3468
|
+
while ((resultB = iB.next()) && !resultB.done) {
|
|
3469
|
+
key = resultB.value[0];
|
|
3470
|
+
item2 = resultB.value[1];
|
|
3471
|
+
if (key && typeof key === 'object') {
|
|
3472
|
+
if (!mapHasEqualEntry(set, a, key, item2, opts, channel)) {
|
|
3473
|
+
return false;
|
|
3474
|
+
}
|
|
3475
|
+
} else if (
|
|
3476
|
+
!opts.strict
|
|
3477
|
+
&& (!a.has(key) || !internalDeepEqual($mapGet(a, key), item2, opts, channel))
|
|
3478
|
+
&& !mapHasEqualEntry(set, a, key, item2, assign({}, opts, { strict: false }), channel)
|
|
3479
|
+
) {
|
|
3480
|
+
return false;
|
|
3481
|
+
}
|
|
3482
|
+
}
|
|
3483
|
+
return $setSize(set) === 0;
|
|
3484
|
+
}
|
|
3485
|
+
return true;
|
|
3486
|
+
}
|
|
3487
|
+
|
|
3488
|
+
function objEquiv(a, b, opts, channel) {
|
|
3489
|
+
/* eslint max-statements: [2, 100], max-lines-per-function: [2, 120], max-depth: [2, 5], max-lines: [2, 400] */
|
|
3490
|
+
var i, key;
|
|
3491
|
+
|
|
3492
|
+
if (typeof a !== typeof b) { return false; }
|
|
3493
|
+
if (a == null || b == null) { return false; }
|
|
3494
|
+
|
|
3495
|
+
if ($objToString(a) !== $objToString(b)) { return false; }
|
|
3496
|
+
|
|
3497
|
+
if (isArguments(a) !== isArguments(b)) { return false; }
|
|
3498
|
+
|
|
3499
|
+
var aIsArray = isArray(a);
|
|
3500
|
+
var bIsArray = isArray(b);
|
|
3501
|
+
if (aIsArray !== bIsArray) { return false; }
|
|
3502
|
+
|
|
3503
|
+
// TODO: replace when a cross-realm brand check is available
|
|
3504
|
+
var aIsError = a instanceof Error;
|
|
3505
|
+
var bIsError = b instanceof Error;
|
|
3506
|
+
if (aIsError !== bIsError) { return false; }
|
|
3507
|
+
if (aIsError || bIsError) {
|
|
3508
|
+
if (a.name !== b.name || a.message !== b.message) { return false; }
|
|
3509
|
+
}
|
|
3510
|
+
|
|
3511
|
+
var aIsRegex = isRegex(a);
|
|
3512
|
+
var bIsRegex = isRegex(b);
|
|
3513
|
+
if (aIsRegex !== bIsRegex) { return false; }
|
|
3514
|
+
if ((aIsRegex || bIsRegex) && (a.source !== b.source || flags(a) !== flags(b))) {
|
|
3515
|
+
return false;
|
|
3516
|
+
}
|
|
3517
|
+
|
|
3518
|
+
var aIsDate = isDate(a);
|
|
3519
|
+
var bIsDate = isDate(b);
|
|
3520
|
+
if (aIsDate !== bIsDate) { return false; }
|
|
3521
|
+
if (aIsDate || bIsDate) { // && would work too, because both are true or both false here
|
|
3522
|
+
if ($getTime(a) !== $getTime(b)) { return false; }
|
|
3523
|
+
}
|
|
3524
|
+
if (opts.strict && gPO && gPO(a) !== gPO(b)) { return false; }
|
|
3525
|
+
|
|
3526
|
+
var aWhich = whichTypedArray(a);
|
|
3527
|
+
var bWhich = whichTypedArray(b);
|
|
3528
|
+
if (aWhich !== bWhich) {
|
|
3529
|
+
return false;
|
|
3530
|
+
}
|
|
3531
|
+
if (aWhich || bWhich) { // && would work too, because both are true or both false here
|
|
3532
|
+
if (a.length !== b.length) { return false; }
|
|
3533
|
+
for (i = 0; i < a.length; i++) {
|
|
3534
|
+
if (a[i] !== b[i]) { return false; }
|
|
3535
|
+
}
|
|
3536
|
+
return true;
|
|
3537
|
+
}
|
|
3538
|
+
|
|
3539
|
+
var aIsBuffer = isBuffer(a);
|
|
3540
|
+
var bIsBuffer = isBuffer(b);
|
|
3541
|
+
if (aIsBuffer !== bIsBuffer) { return false; }
|
|
3542
|
+
if (aIsBuffer || bIsBuffer) { // && would work too, because both are true or both false here
|
|
3543
|
+
if (a.length !== b.length) { return false; }
|
|
3544
|
+
for (i = 0; i < a.length; i++) {
|
|
3545
|
+
if (a[i] !== b[i]) { return false; }
|
|
3546
|
+
}
|
|
3547
|
+
return true;
|
|
3548
|
+
}
|
|
3549
|
+
|
|
3550
|
+
var aIsArrayBuffer = isArrayBuffer(a);
|
|
3551
|
+
var bIsArrayBuffer = isArrayBuffer(b);
|
|
3552
|
+
if (aIsArrayBuffer !== bIsArrayBuffer) { return false; }
|
|
3553
|
+
if (aIsArrayBuffer || bIsArrayBuffer) { // && would work too, because both are true or both false here
|
|
3554
|
+
if (byteLength(a) !== byteLength(b)) { return false; }
|
|
3555
|
+
return typeof Uint8Array === 'function' && internalDeepEqual(new Uint8Array(a), new Uint8Array(b), opts, channel);
|
|
3556
|
+
}
|
|
3557
|
+
|
|
3558
|
+
var aIsSAB = isSharedArrayBuffer(a);
|
|
3559
|
+
var bIsSAB = isSharedArrayBuffer(b);
|
|
3560
|
+
if (aIsSAB !== bIsSAB) { return false; }
|
|
3561
|
+
if (aIsSAB || bIsSAB) { // && would work too, because both are true or both false here
|
|
3562
|
+
if (sabByteLength(a) !== sabByteLength(b)) { return false; }
|
|
3563
|
+
return typeof Uint8Array === 'function' && internalDeepEqual(new Uint8Array(a), new Uint8Array(b), opts, channel);
|
|
3564
|
+
}
|
|
3565
|
+
|
|
3566
|
+
if (typeof a !== typeof b) { return false; }
|
|
3567
|
+
|
|
3568
|
+
var ka = objectKeys(a);
|
|
3569
|
+
var kb = objectKeys(b);
|
|
3570
|
+
// having the same number of owned properties (keys incorporates hasOwnProperty)
|
|
3571
|
+
if (ka.length !== kb.length) { return false; }
|
|
3572
|
+
|
|
3573
|
+
// the same set of keys (although not necessarily the same order),
|
|
3574
|
+
ka.sort();
|
|
3575
|
+
kb.sort();
|
|
3576
|
+
// ~~~cheap key test
|
|
3577
|
+
for (i = ka.length - 1; i >= 0; i--) {
|
|
3578
|
+
if (ka[i] != kb[i]) { return false; } // eslint-disable-line eqeqeq
|
|
3579
|
+
}
|
|
3580
|
+
|
|
3581
|
+
// equivalent values for every corresponding key, and ~~~possibly expensive deep test
|
|
3582
|
+
for (i = ka.length - 1; i >= 0; i--) {
|
|
3583
|
+
key = ka[i];
|
|
3584
|
+
if (!internalDeepEqual(a[key], b[key], opts, channel)) { return false; }
|
|
3585
|
+
}
|
|
3586
|
+
|
|
3587
|
+
var aCollection = whichCollection(a);
|
|
3588
|
+
var bCollection = whichCollection(b);
|
|
3589
|
+
if (aCollection !== bCollection) {
|
|
3590
|
+
return false;
|
|
3591
|
+
}
|
|
3592
|
+
if (aCollection === 'Set' || bCollection === 'Set') { // aCollection === bCollection
|
|
3593
|
+
return setEquiv(a, b, opts, channel);
|
|
3594
|
+
}
|
|
3595
|
+
if (aCollection === 'Map') { // aCollection === bCollection
|
|
3596
|
+
return mapEquiv(a, b, opts, channel);
|
|
3597
|
+
}
|
|
3598
|
+
|
|
3599
|
+
return true;
|
|
3600
|
+
}
|
|
3601
|
+
|
|
3602
|
+
var deepEqual = function deepEqual(a, b, opts) {
|
|
3603
|
+
return internalDeepEqual(a, b, opts, getSideChannel());
|
|
3604
|
+
};
|
|
3605
|
+
|
|
3606
|
+
var deepEqual$1 = /*@__PURE__*/getDefaultExportFromCjs(deepEqual);
|
|
3607
|
+
|
|
1
3608
|
let urlAlphabet =
|
|
2
3609
|
'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
|
|
3
3610
|
let nanoid = (size = 21) => {
|
|
@@ -1229,7 +4836,6 @@ var ChannelTypes;
|
|
|
1229
4836
|
ChannelTypes["App"] = "app";
|
|
1230
4837
|
ChannelTypes["Private"] = "private";
|
|
1231
4838
|
})(ChannelTypes || (ChannelTypes = {}));
|
|
1232
|
-
const fdc3ChannelNames = ["fdc3.channel.1", "fdc3.channel.4", "fdc3.channel.6", "fdc3.channel.3", "fdc3.channel.2", "fdc3.channel.8", "fdc3.channel.7", "fdc3.channel.5"];
|
|
1233
4839
|
const defaultChannelsProps = ["id", "type", "broadcast", "addContextListener", "getCurrentContext"];
|
|
1234
4840
|
const defaultContextProps = ["type"];
|
|
1235
4841
|
const defaultGlue42APIs = ["contexts", "channels", "interop", "intents", "appManager", "windows"];
|
|
@@ -2094,17 +5700,22 @@ const FDC3StartupContextDecoder = object({
|
|
|
2094
5700
|
})
|
|
2095
5701
|
})
|
|
2096
5702
|
});
|
|
5703
|
+
object({
|
|
5704
|
+
channelId: optional(nonEmptyStringDecoder)
|
|
5705
|
+
});
|
|
2097
5706
|
|
|
2098
5707
|
class GlueController {
|
|
2099
5708
|
channelsParser;
|
|
5709
|
+
channelsStateStore;
|
|
2100
5710
|
glue;
|
|
2101
5711
|
_logger;
|
|
2102
5712
|
glueInitPromise;
|
|
2103
5713
|
resolveGluePromise;
|
|
2104
5714
|
rejectGluePromise;
|
|
2105
5715
|
defaultGluePromiseTimeout = 120 * 1000;
|
|
2106
|
-
constructor(channelsParser) {
|
|
5716
|
+
constructor(channelsParser, channelsStateStore) {
|
|
2107
5717
|
this.channelsParser = channelsParser;
|
|
5718
|
+
this.channelsStateStore = channelsStateStore;
|
|
2108
5719
|
}
|
|
2109
5720
|
get gluePromise() {
|
|
2110
5721
|
return this.glueInitPromise.then(this.initializeLogger.bind(this));
|
|
@@ -2204,17 +5815,50 @@ class GlueController {
|
|
|
2204
5815
|
async channelsUpdate(data, options) {
|
|
2205
5816
|
return this.glue.channels.publish(data, options);
|
|
2206
5817
|
}
|
|
5818
|
+
getChannelsMode() {
|
|
5819
|
+
return this.glue.channels.mode;
|
|
5820
|
+
}
|
|
5821
|
+
async getMyChannels() {
|
|
5822
|
+
if (!this.glue.channels.getMyChannels) {
|
|
5823
|
+
const myChannel = await this.glue.channels.getMy();
|
|
5824
|
+
return [myChannel];
|
|
5825
|
+
}
|
|
5826
|
+
return this.glue.channels.getMyChannels();
|
|
5827
|
+
}
|
|
2207
5828
|
async joinChannel(channelId) {
|
|
2208
5829
|
return this.glue.channels.join(channelId);
|
|
2209
5830
|
}
|
|
2210
|
-
async leaveChannel() {
|
|
2211
|
-
return this.glue.channels.leave();
|
|
5831
|
+
async leaveChannel(options) {
|
|
5832
|
+
return this.glue.channels.leave(options);
|
|
2212
5833
|
}
|
|
2213
5834
|
getCurrentChannel() {
|
|
2214
|
-
|
|
5835
|
+
if (!this.glue.channels.myChannels) {
|
|
5836
|
+
return this.glue.channels.my();
|
|
5837
|
+
}
|
|
5838
|
+
const myChannels = this.glue.channels.myChannels();
|
|
5839
|
+
return myChannels[myChannels.length - 1];
|
|
5840
|
+
}
|
|
5841
|
+
async getIoChannelNameByFDC3ChannelId(channelId) {
|
|
5842
|
+
const userChannels = await this.listAllChannels();
|
|
5843
|
+
return userChannels.find((channel) => channel.meta.fdc3?.id === channelId)?.name;
|
|
5844
|
+
}
|
|
5845
|
+
async getFDC3ChannelIdByIoChannelName(channelName) {
|
|
5846
|
+
const fdc3UserChannels = (await this.listAllChannels()).filter((channel) => channel.meta.fdc3);
|
|
5847
|
+
const searchedChannel = fdc3UserChannels.find((channel) => channel.name === channelName);
|
|
5848
|
+
return searchedChannel?.meta.fdc3.id;
|
|
5849
|
+
}
|
|
5850
|
+
getMyChannel() {
|
|
5851
|
+
return this.glue.channels.getMy();
|
|
2215
5852
|
}
|
|
2216
5853
|
setOnChannelChanged(callback) {
|
|
2217
|
-
|
|
5854
|
+
if (!this.glue.channels.onChannelsChanged) {
|
|
5855
|
+
return this.glue.channels.changed(callback);
|
|
5856
|
+
}
|
|
5857
|
+
const wrappedCallback = (channels) => {
|
|
5858
|
+
const channelId = channels[channels.length - 1];
|
|
5859
|
+
callback(channelId);
|
|
5860
|
+
};
|
|
5861
|
+
return this.glue.channels.onChannelsChanged(wrappedCallback);
|
|
2218
5862
|
}
|
|
2219
5863
|
async getAllChannels() {
|
|
2220
5864
|
return this.glue.channels.all();
|
|
@@ -2253,30 +5897,38 @@ class GlueController {
|
|
|
2253
5897
|
}
|
|
2254
5898
|
legacyChannelsSubscribe(callback, contextType) {
|
|
2255
5899
|
const didReplay = { replayed: false };
|
|
2256
|
-
return this.glue.channels.subscribe((data, contextData, updaterId) => {
|
|
5900
|
+
return this.glue.channels.subscribe(async (data, contextData, updaterId) => {
|
|
2257
5901
|
if (this.isUpdateFromMe(updaterId) || !contextData || !contextData.latest_fdc3_type) {
|
|
2258
5902
|
return;
|
|
2259
5903
|
}
|
|
5904
|
+
const channelId = await this.getFDC3ChannelIdByIoChannelName(contextData.name);
|
|
2260
5905
|
if (didReplay.replayed) {
|
|
2261
|
-
return this.parseDataAndInvokeSubscribeCallback({ callback, contextData, metadata: this.getContextMetadata(updaterId), contextType });
|
|
5906
|
+
return this.parseDataAndInvokeSubscribeCallback({ callback, contextData, metadata: this.getContextMetadata(updaterId), contextType, channelId });
|
|
2262
5907
|
}
|
|
2263
|
-
this.invokePreviouslyBroadcastedData({ callback, contextData, metadata: this.getContextMetadata(updaterId), contextType });
|
|
5908
|
+
this.invokePreviouslyBroadcastedData({ callback, contextData, metadata: this.getContextMetadata(updaterId), contextType, channelId });
|
|
2264
5909
|
didReplay.replayed = true;
|
|
2265
5910
|
});
|
|
2266
5911
|
}
|
|
2267
5912
|
channelsSubscribe(callback, contextType) {
|
|
2268
5913
|
const didReplay = { replayed: false };
|
|
2269
|
-
|
|
5914
|
+
let prevContext;
|
|
5915
|
+
return this.glue.channels.subscribe(async (data, contextData, updaterId) => {
|
|
2270
5916
|
if (this.isUpdateFromMe(updaterId) || !contextData || !data.fdc3) {
|
|
2271
5917
|
return;
|
|
2272
5918
|
}
|
|
5919
|
+
const channelId = await this.getFDC3ChannelIdByIoChannelName(contextData.name);
|
|
2273
5920
|
if (contextType && data.fdc3.type !== contextType && !didReplay.replayed) {
|
|
2274
|
-
this.invokePreviouslyBroadcastedData({ callback, contextData, metadata: this.getContextMetadata(updaterId), contextType });
|
|
5921
|
+
this.invokePreviouslyBroadcastedData({ callback, contextData, metadata: this.getContextMetadata(updaterId), contextType, channelId });
|
|
2275
5922
|
didReplay.replayed = true;
|
|
5923
|
+
prevContext = data.fdc3;
|
|
2276
5924
|
return;
|
|
2277
5925
|
}
|
|
2278
|
-
|
|
5926
|
+
if (prevContext && deepEqual$1(prevContext, data.fdc3, { strict: true })) {
|
|
5927
|
+
return;
|
|
5928
|
+
}
|
|
5929
|
+
callback(data.fdc3, this.getContextMetadata(updaterId), channelId);
|
|
2279
5930
|
didReplay.replayed = true;
|
|
5931
|
+
prevContext = data.fdc3;
|
|
2280
5932
|
});
|
|
2281
5933
|
}
|
|
2282
5934
|
contextsSubscribe(contextName, callback) {
|
|
@@ -2320,11 +5972,11 @@ class GlueController {
|
|
|
2320
5972
|
return false;
|
|
2321
5973
|
}
|
|
2322
5974
|
}
|
|
2323
|
-
invokePreviouslyBroadcastedData({ callback, contextData, metadata, contextType }) {
|
|
5975
|
+
invokePreviouslyBroadcastedData({ callback, contextData, metadata, contextType, channelId }) {
|
|
2324
5976
|
const invokeForType = contextType || this.channelsParser.mapChannelsDelimiterToFDC3Type(contextData.latest_fdc3_type);
|
|
2325
5977
|
const dataForContextType = this.getLatestBroadcastedDataByContextType(contextData, invokeForType);
|
|
2326
5978
|
if (dataForContextType) {
|
|
2327
|
-
callback(dataForContextType, metadata);
|
|
5979
|
+
callback(dataForContextType, metadata, channelId);
|
|
2328
5980
|
}
|
|
2329
5981
|
}
|
|
2330
5982
|
isUpdateFromMe(updaterId) {
|
|
@@ -2345,10 +5997,10 @@ class GlueController {
|
|
|
2345
5997
|
initializeLogger() {
|
|
2346
5998
|
this._logger = this.glue.logger;
|
|
2347
5999
|
}
|
|
2348
|
-
parseDataAndInvokeSubscribeCallback({ callback, contextData, metadata, contextType }) {
|
|
6000
|
+
parseDataAndInvokeSubscribeCallback({ callback, contextData, metadata, contextType, channelId }) {
|
|
2349
6001
|
if (!contextType) {
|
|
2350
6002
|
const parsedData = this.channelsParser.parseContextsDataToInitialFDC3Data({ data: contextData.data, latest_fdc3_type: contextData.latest_fdc3_type });
|
|
2351
|
-
callback(parsedData, metadata);
|
|
6003
|
+
callback(parsedData, metadata, channelId);
|
|
2352
6004
|
return;
|
|
2353
6005
|
}
|
|
2354
6006
|
const latestPublishedType = this.channelsParser.mapChannelsDelimiterToFDC3Type(contextData.latest_fdc3_type);
|
|
@@ -2357,7 +6009,7 @@ class GlueController {
|
|
|
2357
6009
|
}
|
|
2358
6010
|
const dataForContextType = this.getLatestBroadcastedDataByContextType(contextData, contextType);
|
|
2359
6011
|
if (dataForContextType) {
|
|
2360
|
-
callback(dataForContextType, metadata);
|
|
6012
|
+
callback(dataForContextType, metadata, channelId);
|
|
2361
6013
|
}
|
|
2362
6014
|
}
|
|
2363
6015
|
getLatestBroadcastedDataByContextType(contextData, contextType) {
|
|
@@ -2678,8 +6330,11 @@ class DesktopAgent {
|
|
|
2678
6330
|
open: this.open.bind(this),
|
|
2679
6331
|
raiseIntent: this.raiseIntent.bind(this),
|
|
2680
6332
|
raiseIntentForContext: this.raiseIntentForContext.bind(this),
|
|
6333
|
+
getCurrentChannels: this.getCurrentChannels.bind(this),
|
|
6334
|
+
leaveChannel: this.leaveChannel.bind(this),
|
|
6335
|
+
leaveCurrentChannels: this.leaveCurrentChannels.bind(this)
|
|
2681
6336
|
};
|
|
2682
|
-
return
|
|
6337
|
+
return api;
|
|
2683
6338
|
}
|
|
2684
6339
|
async open(target, context) {
|
|
2685
6340
|
targetAppDecoder.runWithException(target);
|
|
@@ -2788,6 +6443,16 @@ class DesktopAgent {
|
|
|
2788
6443
|
async createPrivateChannel() {
|
|
2789
6444
|
return this.channelsController.createPrivateChannel(generateCommandId());
|
|
2790
6445
|
}
|
|
6446
|
+
async getCurrentChannels() {
|
|
6447
|
+
return this.channelsController.getCurrentChannels(generateCommandId());
|
|
6448
|
+
}
|
|
6449
|
+
async leaveChannel(channelId) {
|
|
6450
|
+
nonEmptyStringDecoder.runWithException(channelId);
|
|
6451
|
+
return this.channelsController.leave(generateCommandId(), { channelId });
|
|
6452
|
+
}
|
|
6453
|
+
async leaveCurrentChannels() {
|
|
6454
|
+
return this.channelsController.leave(generateCommandId());
|
|
6455
|
+
}
|
|
2791
6456
|
}
|
|
2792
6457
|
|
|
2793
6458
|
class AppChannel {
|
|
@@ -2931,14 +6596,14 @@ const extractChannelMetadata = (channel) => {
|
|
|
2931
6596
|
};
|
|
2932
6597
|
};
|
|
2933
6598
|
const parseContextHandler = (handler, contextType) => {
|
|
2934
|
-
const subHandler = (data, metadata) => {
|
|
6599
|
+
const subHandler = (data, metadata, channelId) => {
|
|
2935
6600
|
if (contextType) {
|
|
2936
6601
|
if (data.type === contextType) {
|
|
2937
|
-
handler(data, metadata);
|
|
6602
|
+
handler(data, metadata, channelId);
|
|
2938
6603
|
}
|
|
2939
6604
|
return;
|
|
2940
6605
|
}
|
|
2941
|
-
handler(data, metadata);
|
|
6606
|
+
handler(data, metadata, channelId);
|
|
2942
6607
|
};
|
|
2943
6608
|
return subHandler;
|
|
2944
6609
|
};
|
|
@@ -3082,7 +6747,14 @@ class IntentsController {
|
|
|
3082
6747
|
return this.glueController.addIntentListener(intent, wrappedHandler);
|
|
3083
6748
|
}
|
|
3084
6749
|
async checkForRememberedIntentHandlerForContext(contextType) {
|
|
3085
|
-
|
|
6750
|
+
let prefs;
|
|
6751
|
+
try {
|
|
6752
|
+
prefs = await this.glueController.getPrefs();
|
|
6753
|
+
}
|
|
6754
|
+
catch (error) {
|
|
6755
|
+
this._logger?.warn(`Cannot get prefs due to the following error: ${error}`);
|
|
6756
|
+
return;
|
|
6757
|
+
}
|
|
3086
6758
|
const intentPrefs = prefs.data?.intents;
|
|
3087
6759
|
if (!intentPrefs) {
|
|
3088
6760
|
return;
|
|
@@ -3171,11 +6843,11 @@ class IntentsController {
|
|
|
3171
6843
|
return result.fdc3intentContext.payload;
|
|
3172
6844
|
}
|
|
3173
6845
|
const { fdc3intentChannel } = result;
|
|
3174
|
-
if (fdc3intentChannel.type ===
|
|
6846
|
+
if (fdc3intentChannel.type === ChannelTypes.User) {
|
|
3175
6847
|
const glueChannel = (await this.glueController.listAllChannels()).find(ch => ch.name === fdc3intentChannel.displayMetadata.name);
|
|
3176
|
-
return this.channelsFactory.buildModel({ ...fdc3intentChannel, displayMetadata: { ...fdc3intentChannel.displayMetadata, glueChannel } });
|
|
6848
|
+
return this.channelsFactory.buildModel({ type: ChannelTypes.User, ...fdc3intentChannel, displayMetadata: { ...fdc3intentChannel.displayMetadata, glueChannel } });
|
|
3177
6849
|
}
|
|
3178
|
-
if (fdc3intentChannel.type
|
|
6850
|
+
if (fdc3intentChannel.type === ChannelTypes.App) {
|
|
3179
6851
|
return this.channelsFactory.buildModel(fdc3intentChannel);
|
|
3180
6852
|
}
|
|
3181
6853
|
await this.glueEventsController.initializeCollaborateMethod();
|
|
@@ -3537,32 +7209,7 @@ class EventReceiver {
|
|
|
3537
7209
|
}
|
|
3538
7210
|
|
|
3539
7211
|
class ChannelsStateStore {
|
|
3540
|
-
_currentChannel = null;
|
|
3541
|
-
_userChannels = {};
|
|
3542
|
-
_fdc3ChannelIdsToGlueChannelNames = {};
|
|
3543
7212
|
_privateChannels = {};
|
|
3544
|
-
get currentChannel() {
|
|
3545
|
-
return this._currentChannel;
|
|
3546
|
-
}
|
|
3547
|
-
set currentChannel(newChannelValue) {
|
|
3548
|
-
this._currentChannel = newChannelValue;
|
|
3549
|
-
}
|
|
3550
|
-
get userChannels() {
|
|
3551
|
-
return this._userChannels;
|
|
3552
|
-
}
|
|
3553
|
-
addUserChannel(channel) {
|
|
3554
|
-
this._userChannels[channel.id] = channel;
|
|
3555
|
-
}
|
|
3556
|
-
addFdc3IdToGlueChannelName(fdc3Id, glueChannelName) {
|
|
3557
|
-
this._fdc3ChannelIdsToGlueChannelNames[fdc3Id] = glueChannelName;
|
|
3558
|
-
}
|
|
3559
|
-
getGlueChannelNameByFdc3ChannelId(fdc3Id) {
|
|
3560
|
-
return this._fdc3ChannelIdsToGlueChannelNames[fdc3Id];
|
|
3561
|
-
}
|
|
3562
|
-
getFdc3ChannelIdByGlueChannelName(glueChannelName) {
|
|
3563
|
-
const [key] = Object.entries(this._fdc3ChannelIdsToGlueChannelNames).find(([_, value]) => value === glueChannelName);
|
|
3564
|
-
return key;
|
|
3565
|
-
}
|
|
3566
7213
|
addPrivateChannel(privateChannel) {
|
|
3567
7214
|
this._privateChannels[privateChannel.id] = privateChannel;
|
|
3568
7215
|
}
|
|
@@ -3574,10 +7221,6 @@ class ChannelsStateStore {
|
|
|
3574
7221
|
}
|
|
3575
7222
|
}
|
|
3576
7223
|
|
|
3577
|
-
function getDefaultExportFromCjs (x) {
|
|
3578
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
3579
|
-
}
|
|
3580
|
-
|
|
3581
7224
|
function createRegistry(options) {
|
|
3582
7225
|
if (options && options.errorHandling
|
|
3583
7226
|
&& typeof options.errorHandling !== "function"
|
|
@@ -3853,22 +7496,22 @@ class PrivateChannel {
|
|
|
3853
7496
|
const lastBroadcastedContextPerType = this.retrieveLatestBroadcastedContextPerType(contextType);
|
|
3854
7497
|
const replayArgs = lastBroadcastedContextPerType ? [[lastBroadcastedContextPerType.context, lastBroadcastedContextPerType.metadata]] : undefined;
|
|
3855
7498
|
const unsub = this.registry.add(PrivateChannelEventMethods.ListenerAdded, subHandler, replayArgs);
|
|
3856
|
-
if (this.collaborator) {
|
|
3857
|
-
const listenerAddedArgs = {
|
|
3858
|
-
action: "addedContextListenerOnPrivateChannel",
|
|
3859
|
-
correlationId: this.id,
|
|
3860
|
-
collaborationObject: {
|
|
3861
|
-
channelId: this.id,
|
|
3862
|
-
contextType: contextType || undefined
|
|
3863
|
-
}
|
|
3864
|
-
};
|
|
3865
|
-
this.logger?.trace(`[${commandId}] - announcing ${"addedContextListenerOnPrivateChannel"} to collaborator ${JSON.stringify(this.collaborator)}`);
|
|
3866
|
-
await this.channelsController.invokeSystemMethod(listenerAddedArgs, this.collaborator?.instanceId);
|
|
3867
|
-
this.logger?.trace(`[${commandId}] - collaborator received action ${"addedContextListenerOnPrivateChannel"}`);
|
|
3868
|
-
}
|
|
3869
|
-
else {
|
|
7499
|
+
if (!this.collaborator) {
|
|
3870
7500
|
this.myListenerTypesBeforeBound.push(contextType);
|
|
7501
|
+
const unsubscribe = this.getAddContextListenerUnsub(unsub, contextType, commandId);
|
|
7502
|
+
return AsyncListener(unsubscribe);
|
|
3871
7503
|
}
|
|
7504
|
+
const listenerAddedArgs = {
|
|
7505
|
+
action: "addedContextListenerOnPrivateChannel",
|
|
7506
|
+
correlationId: this.id,
|
|
7507
|
+
collaborationObject: {
|
|
7508
|
+
channelId: this.id,
|
|
7509
|
+
contextType: contextType || undefined
|
|
7510
|
+
}
|
|
7511
|
+
};
|
|
7512
|
+
this.logger?.trace(`[${commandId}] - announcing ${"addedContextListenerOnPrivateChannel"} to collaborator ${JSON.stringify(this.collaborator)}`);
|
|
7513
|
+
await this.channelsController.invokeSystemMethod(listenerAddedArgs, this.collaborator?.instanceId);
|
|
7514
|
+
this.logger?.trace(`[${commandId}] - collaborator received action ${"addedContextListenerOnPrivateChannel"}`);
|
|
3872
7515
|
const unsubscribe = this.getAddContextListenerUnsub(unsub, contextType, commandId);
|
|
3873
7516
|
return AsyncListener(unsubscribe);
|
|
3874
7517
|
}
|
|
@@ -3993,18 +7636,16 @@ class ChannelsFactory {
|
|
|
3993
7636
|
this.createAppChannel = createAppChannel;
|
|
3994
7637
|
this.createPrivateChannel = createPrivateChannel;
|
|
3995
7638
|
}
|
|
7639
|
+
buildPrivateChannel(data) {
|
|
7640
|
+
return this.createPrivateChannel(data.logger, data.id, data.isCreator);
|
|
7641
|
+
}
|
|
3996
7642
|
buildModel(data) {
|
|
3997
|
-
|
|
3998
|
-
const lowerType = type?.toLowerCase();
|
|
3999
|
-
if (lowerType === ChannelTypes.User) {
|
|
7643
|
+
if (data.type === ChannelTypes.User) {
|
|
4000
7644
|
return this.createUserChannelFn(data.displayMetadata.glueChannel);
|
|
4001
7645
|
}
|
|
4002
|
-
if (
|
|
7646
|
+
if (data.type === ChannelTypes.App) {
|
|
4003
7647
|
return this.createAppChannel(data.id);
|
|
4004
7648
|
}
|
|
4005
|
-
if (lowerType === ChannelTypes.Private) {
|
|
4006
|
-
return this.createPrivateChannel(data.logger, data.id, data.isCreator);
|
|
4007
|
-
}
|
|
4008
7649
|
throw new Error("Pass one of the supported channel types: user, app, private");
|
|
4009
7650
|
}
|
|
4010
7651
|
}
|
|
@@ -4180,26 +7821,37 @@ class ChannelsBaseController {
|
|
|
4180
7821
|
this.logger?.info(`[${commandId}] - trying to invoke context handler with window context`);
|
|
4181
7822
|
this.handleWindowContextOnOpening(commandId, handler, contextType).catch((err) => this.logger?.warn(`[${commandId}] - ${err}`));
|
|
4182
7823
|
}
|
|
4183
|
-
const channelIdToSubscribeTo = channelId || this.
|
|
4184
|
-
|
|
4185
|
-
|
|
7824
|
+
const channelIdToSubscribeTo = channelId || (await this.getCurrentChannel(commandId))?.id;
|
|
7825
|
+
const onMultiChannels = this.glueController.getChannelsMode() === "multi" && (await this.glueController.getMyChannels()).length > 1;
|
|
7826
|
+
const subHandler = parseContextHandler(handler, contextType);
|
|
7827
|
+
if (!channelIdToSubscribeTo || onMultiChannels) {
|
|
7828
|
+
const unsubscribe = this.glueController.channelsSubscribe(subHandler, contextType);
|
|
7829
|
+
return { unsubscribe };
|
|
4186
7830
|
}
|
|
4187
|
-
return this.addContextListenerByChannelId({ commandId, handler, invokedOnChannelModel: !!channelId, channelId: channelIdToSubscribeTo, contextType });
|
|
7831
|
+
return this.addContextListenerByChannelId({ commandId, handler: subHandler, invokedOnChannelModel: !!channelId, channelId: channelIdToSubscribeTo, contextType });
|
|
4188
7832
|
}
|
|
4189
7833
|
async broadcast(commandId, context, channelId) {
|
|
4190
7834
|
await this.initDonePromise;
|
|
4191
7835
|
this.logger?.info(`[${commandId}] - broadcast() invoked with contextType ${context.type} and channelId ${channelId}`);
|
|
4192
|
-
const canBroadcast = this.isBroadcastPermitted(commandId, channelId);
|
|
7836
|
+
const canBroadcast = await this.isBroadcastPermitted(commandId, channelId);
|
|
4193
7837
|
if (!canBroadcast) {
|
|
4194
7838
|
return;
|
|
4195
7839
|
}
|
|
4196
|
-
const channelIdToBroadcastTo = channelId || this.
|
|
7840
|
+
const channelIdToBroadcastTo = channelId || (await this.getCurrentChannel(commandId))?.id;
|
|
7841
|
+
if (!channelIdToBroadcastTo) {
|
|
7842
|
+
return;
|
|
7843
|
+
}
|
|
7844
|
+
const onMultiChannels = this.glueController.getChannelsMode() === "multi" && (await this.glueController.getMyChannels()).length > 1;
|
|
7845
|
+
if (!channelIdToBroadcastTo || onMultiChannels) {
|
|
7846
|
+
return this.glueController.channelsUpdate(context, { fdc3: true });
|
|
7847
|
+
}
|
|
4197
7848
|
return this.broadcastByChannelId(commandId, channelIdToBroadcastTo, context);
|
|
4198
7849
|
}
|
|
4199
7850
|
async getUserChannels(commandId) {
|
|
4200
7851
|
await this.initDonePromise;
|
|
4201
7852
|
this.logger?.info(`[${commandId}] - getUserChannels() invoked`);
|
|
4202
|
-
|
|
7853
|
+
const ioChannels = await this.glueController.listAllChannels();
|
|
7854
|
+
return this.mapIoToFDC3Channels(ioChannels);
|
|
4203
7855
|
}
|
|
4204
7856
|
async getOrCreateChannel({ commandId, channelId }) {
|
|
4205
7857
|
await this.initDonePromise;
|
|
@@ -4223,36 +7875,44 @@ class ChannelsBaseController {
|
|
|
4223
7875
|
this.logger?.error("Cannot join an app channel");
|
|
4224
7876
|
throw new Error(ChannelError.AccessDenied);
|
|
4225
7877
|
}
|
|
4226
|
-
const
|
|
7878
|
+
const channels = await this.getUserChannels(commandId);
|
|
7879
|
+
const channelToJoin = channels.find((ch) => ch.id === channelId);
|
|
4227
7880
|
if (!channelToJoin) {
|
|
4228
7881
|
this.logger?.error(`Cannot find user channel with id ${channelId}`);
|
|
4229
7882
|
throw new Error(ChannelError.NoChannelFound);
|
|
4230
7883
|
}
|
|
4231
|
-
const
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
7884
|
+
const ioChannelName = (await this.getOrCreateChannel({ commandId, channelId }))?.displayMetadata?.name;
|
|
7885
|
+
if (!ioChannelName) {
|
|
7886
|
+
this.logger?.error(`[${commandId}] - Cannot find io channel name for fdc3 channel with id ${channelId}`);
|
|
7887
|
+
throw new Error(ChannelError.NoChannelFound);
|
|
7888
|
+
}
|
|
7889
|
+
this.logger?.info(`[${commandId}] - joining fdc3 user channel with id ${channelId} (underlying io channel: ${ioChannelName})`);
|
|
7890
|
+
await this.glueController.joinChannel(ioChannelName);
|
|
4235
7891
|
}
|
|
4236
7892
|
async getCurrentChannel(commandId) {
|
|
4237
7893
|
await this.initDonePromise;
|
|
4238
7894
|
this.logger?.info(`[${commandId}] - getCurrentChannel() invoked`);
|
|
4239
|
-
|
|
7895
|
+
const currentIoChannel = await this.glueController.getMyChannel();
|
|
7896
|
+
if (!currentIoChannel?.meta.fdc3) {
|
|
7897
|
+
return null;
|
|
7898
|
+
}
|
|
7899
|
+
return this.channelsFactory.buildModel({ type: ChannelTypes.User, displayMetadata: { glueChannel: currentIoChannel } });
|
|
4240
7900
|
}
|
|
4241
7901
|
async leaveCurrentChannel(commandId) {
|
|
4242
7902
|
await this.initDonePromise;
|
|
4243
7903
|
this.logger?.info(`[${commandId}] - leaveCurrentChannel() invoked`);
|
|
4244
|
-
|
|
7904
|
+
const currentChannel = await this.getCurrentChannel(commandId);
|
|
7905
|
+
if (!currentChannel) {
|
|
4245
7906
|
this.logger?.info(`[${commandId}] - no channel to leave`);
|
|
4246
7907
|
return;
|
|
4247
7908
|
}
|
|
4248
7909
|
await this.glueController.leaveChannel();
|
|
4249
|
-
this.stateStore.currentChannel = null;
|
|
4250
7910
|
this.logger?.info(`[${commandId}] - current channel is left. unsubscribing from all listeners`);
|
|
4251
7911
|
}
|
|
4252
7912
|
async getContextForChannel({ commandId, channelId, contextType }) {
|
|
4253
7913
|
await this.initDonePromise;
|
|
4254
7914
|
this.logger?.info(`[${commandId}] - getContextForChannel() invoked for channel with id ${channelId}`);
|
|
4255
|
-
const isUserChannel = this.isUserChannel(channelId);
|
|
7915
|
+
const isUserChannel = await this.isUserChannel(commandId, channelId);
|
|
4256
7916
|
if (isUserChannel) {
|
|
4257
7917
|
return this.userChannelsSupportController.getContext({ commandId, channelId, contextType });
|
|
4258
7918
|
}
|
|
@@ -4301,7 +7961,7 @@ class ChannelsBaseController {
|
|
|
4301
7961
|
}
|
|
4302
7962
|
buildPrivateChannel(channelId, commandId, isCreator) {
|
|
4303
7963
|
const logger = this.glueController.initSubLogger(channelId);
|
|
4304
|
-
const channel = this.
|
|
7964
|
+
const channel = this.channelsFactory.buildPrivateChannel({ id: channelId, logger, isCreator });
|
|
4305
7965
|
this.logger?.info(`[${commandId}] - private channel with id ${channelId} created. Adding it to the store`);
|
|
4306
7966
|
this.stateStore.addPrivateChannel(channel);
|
|
4307
7967
|
return channel;
|
|
@@ -4309,6 +7969,36 @@ class ChannelsBaseController {
|
|
|
4309
7969
|
buildChannel(type, data) {
|
|
4310
7970
|
return this.channelsFactory.buildModel({ type, ...data });
|
|
4311
7971
|
}
|
|
7972
|
+
async publish(commandId, context) {
|
|
7973
|
+
const myGlueChannels = await this.glueController.getMyChannels();
|
|
7974
|
+
if (!myGlueChannels.length) {
|
|
7975
|
+
this.logger?.info(`[${commandId}] - invocation of publish ignored - no channel to publish to`);
|
|
7976
|
+
console.warn("You need to join a user channel to broadcast data");
|
|
7977
|
+
return;
|
|
7978
|
+
}
|
|
7979
|
+
return this.glueController.channelsUpdate(context, { fdc3: true });
|
|
7980
|
+
}
|
|
7981
|
+
async getCurrentChannels(commandId) {
|
|
7982
|
+
await this.initDonePromise;
|
|
7983
|
+
this.logger?.info(`[${commandId}] - getCurrentChannels() invoked`);
|
|
7984
|
+
const ioChannels = await this.glueController.getMyChannels();
|
|
7985
|
+
return this.mapIoToFDC3Channels(ioChannels);
|
|
7986
|
+
}
|
|
7987
|
+
async leave(commandId, options) {
|
|
7988
|
+
await this.initDonePromise;
|
|
7989
|
+
this.logger?.info(`[${commandId}] - leave() invoked with options: ${JSON.stringify(options)}`);
|
|
7990
|
+
if (!options?.channelId) {
|
|
7991
|
+
this.logger?.info(`[${commandId}] - leaving all channels`);
|
|
7992
|
+
return this.glueController.leaveChannel();
|
|
7993
|
+
}
|
|
7994
|
+
const allIoChannels = await this.glueController.listAllChannels();
|
|
7995
|
+
const ioChannelToLeave = allIoChannels.find((ch) => ch.meta.fdc3?.id === options.channelId);
|
|
7996
|
+
if (!ioChannelToLeave) {
|
|
7997
|
+
throw new Error(ChannelError.NoChannelFound);
|
|
7998
|
+
}
|
|
7999
|
+
this.logger?.info(`[${commandId}] - leaving channel '${ioChannelToLeave.name}'`);
|
|
8000
|
+
return this.glueController.leaveChannel({ channel: ioChannelToLeave.name });
|
|
8001
|
+
}
|
|
4312
8002
|
get logger() {
|
|
4313
8003
|
if (!this._logger) {
|
|
4314
8004
|
this._logger = this.glueController.initSubLogger("fdc3.channels.controller");
|
|
@@ -4321,43 +8011,29 @@ class ChannelsBaseController {
|
|
|
4321
8011
|
async initialize() {
|
|
4322
8012
|
await this.glueController.gluePromise;
|
|
4323
8013
|
this.isFdc3DataWrappingSupported = await this.glueController.checkIsFdc3DataWrappingSupported();
|
|
4324
|
-
const current = this.glueController.getCurrentChannel();
|
|
4325
|
-
const glueChannels = await this.glueController.listAllChannels();
|
|
4326
|
-
const glueChannelsWithFdc3Meta = glueChannels.filter((glueChannel) => glueChannel.meta.fdc3);
|
|
4327
|
-
glueChannelsWithFdc3Meta.forEach((glueChannel) => {
|
|
4328
|
-
const userChannel = this.buildChannel(ChannelTypes.User, { displayMetadata: { glueChannel } });
|
|
4329
|
-
this.stateStore.addFdc3IdToGlueChannelName(userChannel.id, glueChannel.name);
|
|
4330
|
-
this.stateStore.addUserChannel(userChannel);
|
|
4331
|
-
if (current && glueChannel.name === current) {
|
|
4332
|
-
this.stateStore.currentChannel = userChannel;
|
|
4333
|
-
}
|
|
4334
|
-
});
|
|
4335
|
-
this.glueController.setOnChannelChanged(this.handleOnChannelChanged.bind(this));
|
|
4336
|
-
}
|
|
4337
|
-
async handleOnChannelChanged(channelId) {
|
|
4338
|
-
if (!channelId) {
|
|
4339
|
-
return;
|
|
4340
|
-
}
|
|
4341
|
-
const isFdc3ChannelName = fdc3ChannelNames.includes(channelId);
|
|
4342
|
-
const userChannelId = isFdc3ChannelName ? channelId : this.stateStore.getFdc3ChannelIdByGlueChannelName(channelId);
|
|
4343
|
-
this.stateStore.currentChannel = this.stateStore.userChannels[userChannelId];
|
|
4344
8014
|
}
|
|
4345
|
-
isBroadcastPermitted(commandId, channelId) {
|
|
8015
|
+
async isBroadcastPermitted(commandId, channelId) {
|
|
4346
8016
|
if (channelId) {
|
|
4347
8017
|
return true;
|
|
4348
8018
|
}
|
|
4349
|
-
|
|
8019
|
+
const currentChannel = await this.getCurrentChannel(commandId);
|
|
8020
|
+
if (!currentChannel) {
|
|
4350
8021
|
this.logger?.info(`[${commandId}] - invocation of broadcast ignored - no channel to broadcast to`);
|
|
4351
8022
|
console.warn("You need to join a user channel in order to broadcast");
|
|
4352
8023
|
return false;
|
|
4353
8024
|
}
|
|
4354
|
-
if (
|
|
8025
|
+
if (currentChannel.type === ChannelTypes.App) {
|
|
4355
8026
|
this.logger?.info(`[${commandId}] - invocation of broadcast ignored - cannot broadcast on app channel directly`);
|
|
4356
8027
|
console.error("You can't broadcast to an app channel directly - use channel's broadcast method instead");
|
|
4357
8028
|
return false;
|
|
4358
8029
|
}
|
|
4359
8030
|
return true;
|
|
4360
8031
|
}
|
|
8032
|
+
mapIoToFDC3Channels(ioChannels) {
|
|
8033
|
+
return ioChannels
|
|
8034
|
+
.filter((ioChannel) => ioChannel.meta.fdc3)
|
|
8035
|
+
.map((ioChannel) => this.channelsFactory.buildModel({ type: ChannelTypes.User, displayMetadata: { glueChannel: ioChannel } }));
|
|
8036
|
+
}
|
|
4361
8037
|
async handleWindowContextOnOpening(commandId, handler, contextType) {
|
|
4362
8038
|
const myWindow = this.glueController.getMyWindow();
|
|
4363
8039
|
if (!myWindow) {
|
|
@@ -4406,36 +8082,35 @@ class ChannelsBaseController {
|
|
|
4406
8082
|
}
|
|
4407
8083
|
this.logger?.info(`[${commandId}] - returning app channel with id ${channelId}`);
|
|
4408
8084
|
const logger = this.glueController.initSubLogger(`app.channel.${channelId}`);
|
|
4409
|
-
return this.
|
|
8085
|
+
return this.channelsFactory.buildModel({ type: ChannelTypes.App, id: channelId, logger });
|
|
4410
8086
|
}
|
|
4411
8087
|
doesAppChannelExist(name) {
|
|
4412
8088
|
return !name.includes(PrivateChannelPrefix) && this.glueController.getAllContexts().some((ctxName) => ctxName === name);
|
|
4413
8089
|
}
|
|
4414
|
-
isUserChannel(channelId) {
|
|
8090
|
+
async isUserChannel(commandId, channelId) {
|
|
4415
8091
|
if (!channelId) {
|
|
4416
8092
|
return false;
|
|
4417
8093
|
}
|
|
4418
|
-
|
|
8094
|
+
const userChannels = await this.getUserChannels(commandId);
|
|
8095
|
+
return userChannels.some((channel) => channel.id === channelId);
|
|
4419
8096
|
}
|
|
4420
8097
|
async broadcastByChannelId(commandId, channelId, context) {
|
|
4421
|
-
const isUserChannel = this.isUserChannel(channelId);
|
|
8098
|
+
const isUserChannel = await this.isUserChannel(commandId, channelId);
|
|
4422
8099
|
if (!isUserChannel) {
|
|
4423
8100
|
this.logger?.info(`[${commandId}] - broadcasting on app channel with id ${channelId}`);
|
|
4424
8101
|
return this.glueController.updateContextWithLatestFdc3Type(channelId, context);
|
|
4425
8102
|
}
|
|
4426
|
-
const ioChannelName = this.
|
|
8103
|
+
const ioChannelName = (await this.getOrCreateChannel({ commandId, channelId }))?.displayMetadata?.name;
|
|
8104
|
+
if (!ioChannelName) {
|
|
8105
|
+
this.logger?.error(`[${commandId}] - Cannot find io channel name for fdc3 channel with id ${channelId}`);
|
|
8106
|
+
throw new Error(ChannelError.NoChannelFound);
|
|
8107
|
+
}
|
|
4427
8108
|
this.logger?.info(`[${commandId}] - broadcasting on fdc3 user channel with id ${channelId} (underlying glue channel: ${ioChannelName})`);
|
|
4428
8109
|
return this.userChannelsSupportController.broadcast({ ioChannelName, context });
|
|
4429
8110
|
}
|
|
4430
|
-
async addContextListenerWithoutChannelId({ commandId, contextType, handler }) {
|
|
4431
|
-
this.logger?.info(`[${commandId}] - Creating a channel subscription using glue.channels.subscribe`);
|
|
4432
|
-
const subHandler = parseContextHandler(handler, contextType);
|
|
4433
|
-
const unsubscribe = this.glueController.legacyChannelsSubscribe(subHandler, contextType);
|
|
4434
|
-
return { unsubscribe };
|
|
4435
|
-
}
|
|
4436
8111
|
async addContextListenerByChannelId({ commandId, channelId, handler, contextType, invokedOnChannelModel }) {
|
|
4437
8112
|
const subHandler = parseContextHandler(handler, contextType);
|
|
4438
|
-
const channelType = this.getChannelTypeById(channelId);
|
|
8113
|
+
const channelType = await this.getChannelTypeById(commandId, channelId);
|
|
4439
8114
|
if (channelType === ChannelTypes.User) {
|
|
4440
8115
|
return this.userChannelsSupportController.addContextListener({ commandId, channelId, handler: subHandler, contextType, invokedOnChannelModel });
|
|
4441
8116
|
}
|
|
@@ -4452,8 +8127,8 @@ class ChannelsBaseController {
|
|
|
4452
8127
|
this.logger?.error("Cannot add a context listener on an invalid channel");
|
|
4453
8128
|
throw new Error(ChannelError.AccessDenied);
|
|
4454
8129
|
}
|
|
4455
|
-
getChannelTypeById(channelId) {
|
|
4456
|
-
const isUser = this.isUserChannel(channelId);
|
|
8130
|
+
async getChannelTypeById(commandId, channelId) {
|
|
8131
|
+
const isUser = await this.isUserChannel(commandId, channelId);
|
|
4457
8132
|
if (isUser) {
|
|
4458
8133
|
return ChannelTypes.User;
|
|
4459
8134
|
}
|
|
@@ -4468,25 +8143,27 @@ class ChannelsBaseController {
|
|
|
4468
8143
|
|
|
4469
8144
|
class LegacyDataWrappingChannelsController {
|
|
4470
8145
|
parser;
|
|
4471
|
-
stateStore;
|
|
4472
8146
|
glueController;
|
|
4473
8147
|
_logger;
|
|
4474
|
-
constructor(parser,
|
|
8148
|
+
constructor(parser, glueController) {
|
|
4475
8149
|
this.parser = parser;
|
|
4476
|
-
this.stateStore = stateStore;
|
|
4477
8150
|
this.glueController = glueController;
|
|
4478
8151
|
}
|
|
4479
8152
|
async getContext({ commandId, channelId, contextType }) {
|
|
4480
8153
|
this.logger?.info(`[${commandId}] - retrieving latest context of type ${contextType} broadcasted on channel with id ${channelId}`);
|
|
8154
|
+
const ioChannelName = await this.glueController.getIoChannelNameByFDC3ChannelId(channelId);
|
|
8155
|
+
if (!ioChannelName) {
|
|
8156
|
+
this.logger?.error(`[${commandId}] - io channel with fdc3 channel id ${channelId} not found`);
|
|
8157
|
+
throw new Error(ChannelError.AccessDenied);
|
|
8158
|
+
}
|
|
4481
8159
|
if (!contextType) {
|
|
4482
|
-
const
|
|
4483
|
-
|
|
4484
|
-
this.logger?.info(`[${commandId}] - getting context for user channel with id ${channelId} (underlying glue channel ${glueChannelName})`);
|
|
8160
|
+
const glueChannelWithPrefix = this.parser.mapChannelNameToContextName(ioChannelName);
|
|
8161
|
+
this.logger?.info(`[${commandId}] - getting context for user channel with id ${channelId} (underlying glue channel ${ioChannelName})`);
|
|
4485
8162
|
const context = await this.glueController.getContext(glueChannelWithPrefix);
|
|
4486
8163
|
return context.latest_fdc3_type ? this.parser.parseContextsDataToInitialFDC3Data(context) : null;
|
|
4487
8164
|
}
|
|
4488
8165
|
const parsedType = this.parser.mapFDC3TypeToChannelsDelimiter(contextType);
|
|
4489
|
-
const { data } = await this.glueController.getChannel(
|
|
8166
|
+
const { data } = await this.glueController.getChannel(ioChannelName);
|
|
4490
8167
|
return data?.[`fdc3_${parsedType}`]
|
|
4491
8168
|
? this.parser.parseContextsDataToInitialFDC3Data({ data, latest_fdc3_type: parsedType })
|
|
4492
8169
|
: null;
|
|
@@ -4501,7 +8178,12 @@ class LegacyDataWrappingChannelsController {
|
|
|
4501
8178
|
const unsubscribe = this.glueController.legacyChannelsSubscribe(handler, contextType);
|
|
4502
8179
|
return { unsubscribe };
|
|
4503
8180
|
}
|
|
4504
|
-
const
|
|
8181
|
+
const ioChannelName = await this.glueController.getIoChannelNameByFDC3ChannelId(channelId);
|
|
8182
|
+
if (!ioChannelName) {
|
|
8183
|
+
this.logger?.error(`[${commandId}] - io channel with fdc3 channel id ${channelId} not found`);
|
|
8184
|
+
throw new Error(ChannelError.AccessDenied);
|
|
8185
|
+
}
|
|
8186
|
+
const contextToSubscribeTo = this.parser.mapChannelNameToContextName(ioChannelName);
|
|
4505
8187
|
this.logger?.info(`[${commandId}] - subscribing for fdc3 user channel with id ${channelId}`);
|
|
4506
8188
|
const unsubscribe = await this.glueController.contextsSubscribe(contextToSubscribeTo, handler);
|
|
4507
8189
|
return { unsubscribe };
|
|
@@ -4516,17 +8198,19 @@ class LegacyDataWrappingChannelsController {
|
|
|
4516
8198
|
|
|
4517
8199
|
class NewDataWrappingChannelsController {
|
|
4518
8200
|
parser;
|
|
4519
|
-
stateStore;
|
|
4520
8201
|
glueController;
|
|
4521
8202
|
_logger;
|
|
4522
|
-
constructor(parser,
|
|
8203
|
+
constructor(parser, glueController) {
|
|
4523
8204
|
this.parser = parser;
|
|
4524
|
-
this.stateStore = stateStore;
|
|
4525
8205
|
this.glueController = glueController;
|
|
4526
8206
|
}
|
|
4527
8207
|
async getContext({ commandId, channelId, contextType }) {
|
|
4528
8208
|
this.logger?.info(`[${commandId}] - retrieving latest context of type ${contextType} broadcasted on channel with id ${channelId}`);
|
|
4529
|
-
const ioChannelName = this.
|
|
8209
|
+
const ioChannelName = await this.glueController.getIoChannelNameByFDC3ChannelId(channelId);
|
|
8210
|
+
if (!ioChannelName) {
|
|
8211
|
+
this.logger?.error(`[${commandId}] - io channel with fdc3 channel id ${channelId} not found`);
|
|
8212
|
+
throw new Error(ChannelError.AccessDenied);
|
|
8213
|
+
}
|
|
4530
8214
|
const ioChannel = await this.glueController.getChannel(ioChannelName);
|
|
4531
8215
|
if (!contextType) {
|
|
4532
8216
|
return ioChannel.data.fdc3 || null;
|
|
@@ -4550,7 +8234,12 @@ class NewDataWrappingChannelsController {
|
|
|
4550
8234
|
const unsubscribe = this.glueController.channelsSubscribe(handler, contextType);
|
|
4551
8235
|
return { unsubscribe };
|
|
4552
8236
|
}
|
|
4553
|
-
const
|
|
8237
|
+
const ioChannelName = await this.glueController.getIoChannelNameByFDC3ChannelId(channelId);
|
|
8238
|
+
if (!ioChannelName) {
|
|
8239
|
+
this.logger?.error(`[${commandId}] - io channel with fdc3 channel id ${channelId} not found`);
|
|
8240
|
+
throw new Error(ChannelError.AccessDenied);
|
|
8241
|
+
}
|
|
8242
|
+
const contextToSubscribeTo = this.parser.mapChannelNameToContextName(ioChannelName);
|
|
4554
8243
|
this.logger?.info(`[${commandId}] - subscribing for fdc3 user channel with id ${channelId}`);
|
|
4555
8244
|
const unsubscribe = await this.glueController.contextsSubscribe(contextToSubscribeTo, handler);
|
|
4556
8245
|
return { unsubscribe };
|
|
@@ -4590,7 +8279,7 @@ class IoC {
|
|
|
4590
8279
|
}
|
|
4591
8280
|
get glueController() {
|
|
4592
8281
|
if (!this._glueController) {
|
|
4593
|
-
this._glueController = new GlueController(this.channelsParser);
|
|
8282
|
+
this._glueController = new GlueController(this.channelsParser, this.channelsStateStore);
|
|
4594
8283
|
}
|
|
4595
8284
|
return this._glueController;
|
|
4596
8285
|
}
|
|
@@ -4653,13 +8342,13 @@ class IoC {
|
|
|
4653
8342
|
}
|
|
4654
8343
|
get legacyDataWrappingChannelsController() {
|
|
4655
8344
|
if (!this._legacyDataWrappingChannelsController) {
|
|
4656
|
-
this._legacyDataWrappingChannelsController = new LegacyDataWrappingChannelsController(this.channelsParser, this.
|
|
8345
|
+
this._legacyDataWrappingChannelsController = new LegacyDataWrappingChannelsController(this.channelsParser, this.glueController);
|
|
4657
8346
|
}
|
|
4658
8347
|
return this._legacyDataWrappingChannelsController;
|
|
4659
8348
|
}
|
|
4660
8349
|
get ioFdc3SupportChannelsController() {
|
|
4661
8350
|
if (!this._newDataWrappingChannelsController) {
|
|
4662
|
-
this._newDataWrappingChannelsController = new NewDataWrappingChannelsController(this.channelsParser, this.
|
|
8351
|
+
this._newDataWrappingChannelsController = new NewDataWrappingChannelsController(this.channelsParser, this.glueController);
|
|
4663
8352
|
}
|
|
4664
8353
|
return this._newDataWrappingChannelsController;
|
|
4665
8354
|
}
|
|
@@ -4690,7 +8379,7 @@ const fdc3Factory = () => {
|
|
|
4690
8379
|
return ioc.fdc3;
|
|
4691
8380
|
};
|
|
4692
8381
|
|
|
4693
|
-
var version = "2.
|
|
8382
|
+
var version = "2.5.0";
|
|
4694
8383
|
|
|
4695
8384
|
let globalFdc3 = window.fdc3;
|
|
4696
8385
|
window.fdc3Info = {
|