vitest 0.0.121 → 0.0.122

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.
@@ -0,0 +1,3445 @@
1
+ import { n as noop, i as isObject } from './index-090545ef.js';
2
+ import { c as commonjsGlobal, g as getDefaultExportFromCjs } from './_commonjsHelpers-c9e3b764.js';
3
+ import { a as spyOn, f as fn, s as spies } from './jest-mock-038a01b3.js';
4
+
5
+ var __defProp = Object.defineProperty;
6
+ var __defProps = Object.defineProperties;
7
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
8
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
+ var __spreadValues = (a, b) => {
13
+ for (var prop in b || (b = {}))
14
+ if (__hasOwnProp.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ if (__getOwnPropSymbols)
17
+ for (var prop of __getOwnPropSymbols(b)) {
18
+ if (__propIsEnum.call(b, prop))
19
+ __defNormalProp(a, prop, b[prop]);
20
+ }
21
+ return a;
22
+ };
23
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
+ function createChainable(keys, fn) {
25
+ function create(obj) {
26
+ const chain2 = function(...args) {
27
+ return fn.apply(obj, args);
28
+ };
29
+ for (const key of keys) {
30
+ Object.defineProperty(chain2, key, {
31
+ get() {
32
+ return create(__spreadProps(__spreadValues({}, obj), { [key]: true }));
33
+ }
34
+ });
35
+ }
36
+ return chain2;
37
+ }
38
+ const chain = create({});
39
+ chain.fn = fn;
40
+ return chain;
41
+ }
42
+
43
+ const context = {
44
+ tasks: [],
45
+ currentSuite: null
46
+ };
47
+ function collectTask(task) {
48
+ var _a;
49
+ (_a = context.currentSuite) == null ? void 0 : _a.tasks.push(task);
50
+ }
51
+ async function runWithSuite(suite, fn) {
52
+ const prev = context.currentSuite;
53
+ context.currentSuite = suite;
54
+ await fn();
55
+ context.currentSuite = prev;
56
+ }
57
+ function getDefaultTestTimeout() {
58
+ return process.__vitest_worker__.config.testTimeout;
59
+ }
60
+ function getDefaultHookTimeout() {
61
+ return process.__vitest_worker__.config.hookTimeout;
62
+ }
63
+ function withTimeout(fn, _timeout) {
64
+ const timeout = _timeout ?? getDefaultTestTimeout();
65
+ if (timeout <= 0 || timeout === Infinity)
66
+ return fn;
67
+ return (...args) => {
68
+ return Promise.race([fn(...args), new Promise((resolve, reject) => {
69
+ const timer = setTimeout(() => {
70
+ clearTimeout(timer);
71
+ reject(new Error(`Test timed out in ${timeout}ms.`));
72
+ }, timeout);
73
+ timer.unref();
74
+ })]);
75
+ };
76
+ }
77
+ function ensureAsyncTest(fn) {
78
+ if (!fn.length)
79
+ return fn;
80
+ return () => new Promise((resolve, reject) => {
81
+ const done = (...args) => args[0] ? reject(args[0]) : resolve();
82
+ fn(done);
83
+ });
84
+ }
85
+ function normalizeTest(fn, timeout) {
86
+ return withTimeout(ensureAsyncTest(fn), timeout);
87
+ }
88
+
89
+ const fnMap = new WeakMap();
90
+ const hooksMap = new WeakMap();
91
+ function setFn(key, fn) {
92
+ fnMap.set(key, fn);
93
+ }
94
+ function getFn(key) {
95
+ return fnMap.get(key);
96
+ }
97
+ function setHooks(key, hooks) {
98
+ hooksMap.set(key, hooks);
99
+ }
100
+ function getHooks(key) {
101
+ return hooksMap.get(key);
102
+ }
103
+
104
+ const suite = createSuite();
105
+ const test$7 = createChainable(["concurrent", "skip", "only", "todo", "fails"], function(name, fn, timeout) {
106
+ getCurrentSuite().test.fn.call(this, name, fn, timeout);
107
+ });
108
+ const describe = suite;
109
+ const it = test$7;
110
+ const defaultSuite = suite("");
111
+ function clearContext() {
112
+ context.tasks.length = 0;
113
+ defaultSuite.clear();
114
+ context.currentSuite = defaultSuite;
115
+ }
116
+ function getCurrentSuite() {
117
+ return context.currentSuite || defaultSuite;
118
+ }
119
+ function createSuiteHooks() {
120
+ return {
121
+ beforeAll: [],
122
+ afterAll: [],
123
+ beforeEach: [],
124
+ afterEach: []
125
+ };
126
+ }
127
+ function createSuiteCollector(name, factory = () => {
128
+ }, mode, suiteComputeMode) {
129
+ const tasks = [];
130
+ const factoryQueue = [];
131
+ let suite2;
132
+ initSuite();
133
+ const test2 = createChainable(["concurrent", "skip", "only", "todo", "fails"], function(name2, fn, timeout) {
134
+ const mode2 = this.only ? "only" : this.skip ? "skip" : this.todo ? "todo" : "run";
135
+ const computeMode = this.concurrent ? "concurrent" : void 0;
136
+ const test3 = {
137
+ id: "",
138
+ type: "test",
139
+ name: name2,
140
+ mode: mode2,
141
+ computeMode: computeMode ?? (suiteComputeMode ?? "serial"),
142
+ suite: void 0,
143
+ fails: this.fails
144
+ };
145
+ setFn(test3, normalizeTest(fn || noop, timeout));
146
+ tasks.push(test3);
147
+ });
148
+ const collector = {
149
+ type: "collector",
150
+ name,
151
+ mode,
152
+ test: test2,
153
+ tasks,
154
+ collect,
155
+ clear,
156
+ on: addHook
157
+ };
158
+ function addHook(name2, ...fn) {
159
+ getHooks(suite2)[name2].push(...fn);
160
+ }
161
+ function initSuite() {
162
+ suite2 = {
163
+ id: "",
164
+ type: "suite",
165
+ computeMode: "serial",
166
+ name,
167
+ mode,
168
+ tasks: []
169
+ };
170
+ setHooks(suite2, createSuiteHooks());
171
+ }
172
+ function clear() {
173
+ tasks.length = 0;
174
+ factoryQueue.length = 0;
175
+ initSuite();
176
+ }
177
+ async function collect(file) {
178
+ factoryQueue.length = 0;
179
+ if (factory)
180
+ await runWithSuite(collector, () => factory(test2));
181
+ const allChildren = await Promise.all([...factoryQueue, ...tasks].map((i) => i.type === "collector" ? i.collect(file) : i));
182
+ suite2.file = file;
183
+ suite2.tasks = allChildren;
184
+ allChildren.forEach((task) => {
185
+ task.suite = suite2;
186
+ if (file)
187
+ task.file = file;
188
+ });
189
+ return suite2;
190
+ }
191
+ collectTask(collector);
192
+ return collector;
193
+ }
194
+ function createSuite() {
195
+ return createChainable(["concurrent", "skip", "only", "todo"], function(name, factory) {
196
+ const mode = this.only ? "only" : this.skip ? "skip" : this.todo ? "todo" : "run";
197
+ const computeMode = this.concurrent ? "concurrent" : void 0;
198
+ return createSuiteCollector(name, factory, mode, computeMode);
199
+ });
200
+ }
201
+
202
+ var build = {};
203
+
204
+ var ansiStyles = {exports: {}};
205
+
206
+ (function (module) {
207
+
208
+ const ANSI_BACKGROUND_OFFSET = 10;
209
+
210
+ const wrapAnsi256 = (offset = 0) => code => `\u001B[${38 + offset};5;${code}m`;
211
+
212
+ const wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`;
213
+
214
+ function assembleStyles() {
215
+ const codes = new Map();
216
+ const styles = {
217
+ modifier: {
218
+ reset: [0, 0],
219
+ // 21 isn't widely supported and 22 does the same thing
220
+ bold: [1, 22],
221
+ dim: [2, 22],
222
+ italic: [3, 23],
223
+ underline: [4, 24],
224
+ overline: [53, 55],
225
+ inverse: [7, 27],
226
+ hidden: [8, 28],
227
+ strikethrough: [9, 29]
228
+ },
229
+ color: {
230
+ black: [30, 39],
231
+ red: [31, 39],
232
+ green: [32, 39],
233
+ yellow: [33, 39],
234
+ blue: [34, 39],
235
+ magenta: [35, 39],
236
+ cyan: [36, 39],
237
+ white: [37, 39],
238
+
239
+ // Bright color
240
+ blackBright: [90, 39],
241
+ redBright: [91, 39],
242
+ greenBright: [92, 39],
243
+ yellowBright: [93, 39],
244
+ blueBright: [94, 39],
245
+ magentaBright: [95, 39],
246
+ cyanBright: [96, 39],
247
+ whiteBright: [97, 39]
248
+ },
249
+ bgColor: {
250
+ bgBlack: [40, 49],
251
+ bgRed: [41, 49],
252
+ bgGreen: [42, 49],
253
+ bgYellow: [43, 49],
254
+ bgBlue: [44, 49],
255
+ bgMagenta: [45, 49],
256
+ bgCyan: [46, 49],
257
+ bgWhite: [47, 49],
258
+
259
+ // Bright color
260
+ bgBlackBright: [100, 49],
261
+ bgRedBright: [101, 49],
262
+ bgGreenBright: [102, 49],
263
+ bgYellowBright: [103, 49],
264
+ bgBlueBright: [104, 49],
265
+ bgMagentaBright: [105, 49],
266
+ bgCyanBright: [106, 49],
267
+ bgWhiteBright: [107, 49]
268
+ }
269
+ };
270
+
271
+ // Alias bright black as gray (and grey)
272
+ styles.color.gray = styles.color.blackBright;
273
+ styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
274
+ styles.color.grey = styles.color.blackBright;
275
+ styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
276
+
277
+ for (const [groupName, group] of Object.entries(styles)) {
278
+ for (const [styleName, style] of Object.entries(group)) {
279
+ styles[styleName] = {
280
+ open: `\u001B[${style[0]}m`,
281
+ close: `\u001B[${style[1]}m`
282
+ };
283
+
284
+ group[styleName] = styles[styleName];
285
+
286
+ codes.set(style[0], style[1]);
287
+ }
288
+
289
+ Object.defineProperty(styles, groupName, {
290
+ value: group,
291
+ enumerable: false
292
+ });
293
+ }
294
+
295
+ Object.defineProperty(styles, 'codes', {
296
+ value: codes,
297
+ enumerable: false
298
+ });
299
+
300
+ styles.color.close = '\u001B[39m';
301
+ styles.bgColor.close = '\u001B[49m';
302
+
303
+ styles.color.ansi256 = wrapAnsi256();
304
+ styles.color.ansi16m = wrapAnsi16m();
305
+ styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
306
+ styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
307
+
308
+ // From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js
309
+ Object.defineProperties(styles, {
310
+ rgbToAnsi256: {
311
+ value: (red, green, blue) => {
312
+ // We use the extended greyscale palette here, with the exception of
313
+ // black and white. normal palette only has 4 greyscale shades.
314
+ if (red === green && green === blue) {
315
+ if (red < 8) {
316
+ return 16;
317
+ }
318
+
319
+ if (red > 248) {
320
+ return 231;
321
+ }
322
+
323
+ return Math.round(((red - 8) / 247) * 24) + 232;
324
+ }
325
+
326
+ return 16 +
327
+ (36 * Math.round(red / 255 * 5)) +
328
+ (6 * Math.round(green / 255 * 5)) +
329
+ Math.round(blue / 255 * 5);
330
+ },
331
+ enumerable: false
332
+ },
333
+ hexToRgb: {
334
+ value: hex => {
335
+ const matches = /(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(hex.toString(16));
336
+ if (!matches) {
337
+ return [0, 0, 0];
338
+ }
339
+
340
+ let {colorString} = matches.groups;
341
+
342
+ if (colorString.length === 3) {
343
+ colorString = colorString.split('').map(character => character + character).join('');
344
+ }
345
+
346
+ const integer = Number.parseInt(colorString, 16);
347
+
348
+ return [
349
+ (integer >> 16) & 0xFF,
350
+ (integer >> 8) & 0xFF,
351
+ integer & 0xFF
352
+ ];
353
+ },
354
+ enumerable: false
355
+ },
356
+ hexToAnsi256: {
357
+ value: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
358
+ enumerable: false
359
+ }
360
+ });
361
+
362
+ return styles;
363
+ }
364
+
365
+ // Make the export immutable
366
+ Object.defineProperty(module, 'exports', {
367
+ enumerable: true,
368
+ get: assembleStyles
369
+ });
370
+ }(ansiStyles));
371
+
372
+ var collections = {};
373
+
374
+ Object.defineProperty(collections, '__esModule', {
375
+ value: true
376
+ });
377
+ collections.printIteratorEntries = printIteratorEntries;
378
+ collections.printIteratorValues = printIteratorValues;
379
+ collections.printListItems = printListItems;
380
+ collections.printObjectProperties = printObjectProperties;
381
+
382
+ /**
383
+ * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
384
+ *
385
+ * This source code is licensed under the MIT license found in the
386
+ * LICENSE file in the root directory of this source tree.
387
+ *
388
+ */
389
+ const getKeysOfEnumerableProperties = (object, compareKeys) => {
390
+ const keys = Object.keys(object).sort(compareKeys);
391
+
392
+ if (Object.getOwnPropertySymbols) {
393
+ Object.getOwnPropertySymbols(object).forEach(symbol => {
394
+ if (Object.getOwnPropertyDescriptor(object, symbol).enumerable) {
395
+ keys.push(symbol);
396
+ }
397
+ });
398
+ }
399
+
400
+ return keys;
401
+ };
402
+ /**
403
+ * Return entries (for example, of a map)
404
+ * with spacing, indentation, and comma
405
+ * without surrounding punctuation (for example, braces)
406
+ */
407
+
408
+ function printIteratorEntries(
409
+ iterator,
410
+ config,
411
+ indentation,
412
+ depth,
413
+ refs,
414
+ printer, // Too bad, so sad that separator for ECMAScript Map has been ' => '
415
+ // What a distracting diff if you change a data structure to/from
416
+ // ECMAScript Object or Immutable.Map/OrderedMap which use the default.
417
+ separator = ': '
418
+ ) {
419
+ let result = '';
420
+ let current = iterator.next();
421
+
422
+ if (!current.done) {
423
+ result += config.spacingOuter;
424
+ const indentationNext = indentation + config.indent;
425
+
426
+ while (!current.done) {
427
+ const name = printer(
428
+ current.value[0],
429
+ config,
430
+ indentationNext,
431
+ depth,
432
+ refs
433
+ );
434
+ const value = printer(
435
+ current.value[1],
436
+ config,
437
+ indentationNext,
438
+ depth,
439
+ refs
440
+ );
441
+ result += indentationNext + name + separator + value;
442
+ current = iterator.next();
443
+
444
+ if (!current.done) {
445
+ result += ',' + config.spacingInner;
446
+ } else if (!config.min) {
447
+ result += ',';
448
+ }
449
+ }
450
+
451
+ result += config.spacingOuter + indentation;
452
+ }
453
+
454
+ return result;
455
+ }
456
+ /**
457
+ * Return values (for example, of a set)
458
+ * with spacing, indentation, and comma
459
+ * without surrounding punctuation (braces or brackets)
460
+ */
461
+
462
+ function printIteratorValues(
463
+ iterator,
464
+ config,
465
+ indentation,
466
+ depth,
467
+ refs,
468
+ printer
469
+ ) {
470
+ let result = '';
471
+ let current = iterator.next();
472
+
473
+ if (!current.done) {
474
+ result += config.spacingOuter;
475
+ const indentationNext = indentation + config.indent;
476
+
477
+ while (!current.done) {
478
+ result +=
479
+ indentationNext +
480
+ printer(current.value, config, indentationNext, depth, refs);
481
+ current = iterator.next();
482
+
483
+ if (!current.done) {
484
+ result += ',' + config.spacingInner;
485
+ } else if (!config.min) {
486
+ result += ',';
487
+ }
488
+ }
489
+
490
+ result += config.spacingOuter + indentation;
491
+ }
492
+
493
+ return result;
494
+ }
495
+ /**
496
+ * Return items (for example, of an array)
497
+ * with spacing, indentation, and comma
498
+ * without surrounding punctuation (for example, brackets)
499
+ **/
500
+
501
+ function printListItems(list, config, indentation, depth, refs, printer) {
502
+ let result = '';
503
+
504
+ if (list.length) {
505
+ result += config.spacingOuter;
506
+ const indentationNext = indentation + config.indent;
507
+
508
+ for (let i = 0; i < list.length; i++) {
509
+ result += indentationNext;
510
+
511
+ if (i in list) {
512
+ result += printer(list[i], config, indentationNext, depth, refs);
513
+ }
514
+
515
+ if (i < list.length - 1) {
516
+ result += ',' + config.spacingInner;
517
+ } else if (!config.min) {
518
+ result += ',';
519
+ }
520
+ }
521
+
522
+ result += config.spacingOuter + indentation;
523
+ }
524
+
525
+ return result;
526
+ }
527
+ /**
528
+ * Return properties of an object
529
+ * with spacing, indentation, and comma
530
+ * without surrounding punctuation (for example, braces)
531
+ */
532
+
533
+ function printObjectProperties(val, config, indentation, depth, refs, printer) {
534
+ let result = '';
535
+ const keys = getKeysOfEnumerableProperties(val, config.compareKeys);
536
+
537
+ if (keys.length) {
538
+ result += config.spacingOuter;
539
+ const indentationNext = indentation + config.indent;
540
+
541
+ for (let i = 0; i < keys.length; i++) {
542
+ const key = keys[i];
543
+ const name = printer(key, config, indentationNext, depth, refs);
544
+ const value = printer(val[key], config, indentationNext, depth, refs);
545
+ result += indentationNext + name + ': ' + value;
546
+
547
+ if (i < keys.length - 1) {
548
+ result += ',' + config.spacingInner;
549
+ } else if (!config.min) {
550
+ result += ',';
551
+ }
552
+ }
553
+
554
+ result += config.spacingOuter + indentation;
555
+ }
556
+
557
+ return result;
558
+ }
559
+
560
+ var AsymmetricMatcher$1 = {};
561
+
562
+ Object.defineProperty(AsymmetricMatcher$1, '__esModule', {
563
+ value: true
564
+ });
565
+ AsymmetricMatcher$1.default = AsymmetricMatcher$1.test = AsymmetricMatcher$1.serialize = void 0;
566
+
567
+ var _collections$3 = collections;
568
+
569
+ var global$2 = (function () {
570
+ if (typeof globalThis !== 'undefined') {
571
+ return globalThis;
572
+ } else if (typeof global$2 !== 'undefined') {
573
+ return global$2;
574
+ } else if (typeof self !== 'undefined') {
575
+ return self;
576
+ } else if (typeof window !== 'undefined') {
577
+ return window;
578
+ } else {
579
+ return Function('return this')();
580
+ }
581
+ })();
582
+
583
+ var Symbol$2 = global$2['jest-symbol-do-not-touch'] || global$2.Symbol;
584
+ const asymmetricMatcher =
585
+ typeof Symbol$2 === 'function' && Symbol$2.for
586
+ ? Symbol$2.for('jest.asymmetricMatcher')
587
+ : 0x1357a5;
588
+ const SPACE$2 = ' ';
589
+
590
+ const serialize$6 = (val, config, indentation, depth, refs, printer) => {
591
+ const stringedValue = val.toString();
592
+
593
+ if (
594
+ stringedValue === 'ArrayContaining' ||
595
+ stringedValue === 'ArrayNotContaining'
596
+ ) {
597
+ if (++depth > config.maxDepth) {
598
+ return '[' + stringedValue + ']';
599
+ }
600
+
601
+ return (
602
+ stringedValue +
603
+ SPACE$2 +
604
+ '[' +
605
+ (0, _collections$3.printListItems)(
606
+ val.sample,
607
+ config,
608
+ indentation,
609
+ depth,
610
+ refs,
611
+ printer
612
+ ) +
613
+ ']'
614
+ );
615
+ }
616
+
617
+ if (
618
+ stringedValue === 'ObjectContaining' ||
619
+ stringedValue === 'ObjectNotContaining'
620
+ ) {
621
+ if (++depth > config.maxDepth) {
622
+ return '[' + stringedValue + ']';
623
+ }
624
+
625
+ return (
626
+ stringedValue +
627
+ SPACE$2 +
628
+ '{' +
629
+ (0, _collections$3.printObjectProperties)(
630
+ val.sample,
631
+ config,
632
+ indentation,
633
+ depth,
634
+ refs,
635
+ printer
636
+ ) +
637
+ '}'
638
+ );
639
+ }
640
+
641
+ if (
642
+ stringedValue === 'StringMatching' ||
643
+ stringedValue === 'StringNotMatching'
644
+ ) {
645
+ return (
646
+ stringedValue +
647
+ SPACE$2 +
648
+ printer(val.sample, config, indentation, depth, refs)
649
+ );
650
+ }
651
+
652
+ if (
653
+ stringedValue === 'StringContaining' ||
654
+ stringedValue === 'StringNotContaining'
655
+ ) {
656
+ return (
657
+ stringedValue +
658
+ SPACE$2 +
659
+ printer(val.sample, config, indentation, depth, refs)
660
+ );
661
+ }
662
+
663
+ return val.toAsymmetricMatcher();
664
+ };
665
+
666
+ AsymmetricMatcher$1.serialize = serialize$6;
667
+
668
+ const test$6 = val => val && val.$$typeof === asymmetricMatcher;
669
+
670
+ AsymmetricMatcher$1.test = test$6;
671
+ const plugin$6 = {
672
+ serialize: serialize$6,
673
+ test: test$6
674
+ };
675
+ var _default$7 = plugin$6;
676
+ AsymmetricMatcher$1.default = _default$7;
677
+
678
+ var ConvertAnsi = {};
679
+
680
+ var ansiRegex = ({onlyFirst = false} = {}) => {
681
+ const pattern = [
682
+ '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
683
+ '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'
684
+ ].join('|');
685
+
686
+ return new RegExp(pattern, onlyFirst ? undefined : 'g');
687
+ };
688
+
689
+ Object.defineProperty(ConvertAnsi, '__esModule', {
690
+ value: true
691
+ });
692
+ ConvertAnsi.default = ConvertAnsi.serialize = ConvertAnsi.test = void 0;
693
+
694
+ var _ansiRegex = _interopRequireDefault$2(ansiRegex);
695
+
696
+ var _ansiStyles$1 = _interopRequireDefault$2(ansiStyles.exports);
697
+
698
+ function _interopRequireDefault$2(obj) {
699
+ return obj && obj.__esModule ? obj : {default: obj};
700
+ }
701
+
702
+ /**
703
+ * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
704
+ *
705
+ * This source code is licensed under the MIT license found in the
706
+ * LICENSE file in the root directory of this source tree.
707
+ */
708
+ const toHumanReadableAnsi = text =>
709
+ text.replace((0, _ansiRegex.default)(), match => {
710
+ switch (match) {
711
+ case _ansiStyles$1.default.red.close:
712
+ case _ansiStyles$1.default.green.close:
713
+ case _ansiStyles$1.default.cyan.close:
714
+ case _ansiStyles$1.default.gray.close:
715
+ case _ansiStyles$1.default.white.close:
716
+ case _ansiStyles$1.default.yellow.close:
717
+ case _ansiStyles$1.default.bgRed.close:
718
+ case _ansiStyles$1.default.bgGreen.close:
719
+ case _ansiStyles$1.default.bgYellow.close:
720
+ case _ansiStyles$1.default.inverse.close:
721
+ case _ansiStyles$1.default.dim.close:
722
+ case _ansiStyles$1.default.bold.close:
723
+ case _ansiStyles$1.default.reset.open:
724
+ case _ansiStyles$1.default.reset.close:
725
+ return '</>';
726
+
727
+ case _ansiStyles$1.default.red.open:
728
+ return '<red>';
729
+
730
+ case _ansiStyles$1.default.green.open:
731
+ return '<green>';
732
+
733
+ case _ansiStyles$1.default.cyan.open:
734
+ return '<cyan>';
735
+
736
+ case _ansiStyles$1.default.gray.open:
737
+ return '<gray>';
738
+
739
+ case _ansiStyles$1.default.white.open:
740
+ return '<white>';
741
+
742
+ case _ansiStyles$1.default.yellow.open:
743
+ return '<yellow>';
744
+
745
+ case _ansiStyles$1.default.bgRed.open:
746
+ return '<bgRed>';
747
+
748
+ case _ansiStyles$1.default.bgGreen.open:
749
+ return '<bgGreen>';
750
+
751
+ case _ansiStyles$1.default.bgYellow.open:
752
+ return '<bgYellow>';
753
+
754
+ case _ansiStyles$1.default.inverse.open:
755
+ return '<inverse>';
756
+
757
+ case _ansiStyles$1.default.dim.open:
758
+ return '<dim>';
759
+
760
+ case _ansiStyles$1.default.bold.open:
761
+ return '<bold>';
762
+
763
+ default:
764
+ return '';
765
+ }
766
+ });
767
+
768
+ const test$5 = val =>
769
+ typeof val === 'string' && !!val.match((0, _ansiRegex.default)());
770
+
771
+ ConvertAnsi.test = test$5;
772
+
773
+ const serialize$5 = (val, config, indentation, depth, refs, printer) =>
774
+ printer(toHumanReadableAnsi(val), config, indentation, depth, refs);
775
+
776
+ ConvertAnsi.serialize = serialize$5;
777
+ const plugin$5 = {
778
+ serialize: serialize$5,
779
+ test: test$5
780
+ };
781
+ var _default$6 = plugin$5;
782
+ ConvertAnsi.default = _default$6;
783
+
784
+ var DOMCollection$1 = {};
785
+
786
+ Object.defineProperty(DOMCollection$1, '__esModule', {
787
+ value: true
788
+ });
789
+ DOMCollection$1.default = DOMCollection$1.serialize = DOMCollection$1.test = void 0;
790
+
791
+ var _collections$2 = collections;
792
+
793
+ /**
794
+ * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
795
+ *
796
+ * This source code is licensed under the MIT license found in the
797
+ * LICENSE file in the root directory of this source tree.
798
+ */
799
+
800
+ /* eslint-disable local/ban-types-eventually */
801
+ const SPACE$1 = ' ';
802
+ const OBJECT_NAMES = ['DOMStringMap', 'NamedNodeMap'];
803
+ const ARRAY_REGEXP = /^(HTML\w*Collection|NodeList)$/;
804
+
805
+ const testName = name =>
806
+ OBJECT_NAMES.indexOf(name) !== -1 || ARRAY_REGEXP.test(name);
807
+
808
+ const test$4 = val =>
809
+ val &&
810
+ val.constructor &&
811
+ !!val.constructor.name &&
812
+ testName(val.constructor.name);
813
+
814
+ DOMCollection$1.test = test$4;
815
+
816
+ const isNamedNodeMap = collection =>
817
+ collection.constructor.name === 'NamedNodeMap';
818
+
819
+ const serialize$4 = (collection, config, indentation, depth, refs, printer) => {
820
+ const name = collection.constructor.name;
821
+
822
+ if (++depth > config.maxDepth) {
823
+ return '[' + name + ']';
824
+ }
825
+
826
+ return (
827
+ (config.min ? '' : name + SPACE$1) +
828
+ (OBJECT_NAMES.indexOf(name) !== -1
829
+ ? '{' +
830
+ (0, _collections$2.printObjectProperties)(
831
+ isNamedNodeMap(collection)
832
+ ? Array.from(collection).reduce((props, attribute) => {
833
+ props[attribute.name] = attribute.value;
834
+ return props;
835
+ }, {})
836
+ : {...collection},
837
+ config,
838
+ indentation,
839
+ depth,
840
+ refs,
841
+ printer
842
+ ) +
843
+ '}'
844
+ : '[' +
845
+ (0, _collections$2.printListItems)(
846
+ Array.from(collection),
847
+ config,
848
+ indentation,
849
+ depth,
850
+ refs,
851
+ printer
852
+ ) +
853
+ ']')
854
+ );
855
+ };
856
+
857
+ DOMCollection$1.serialize = serialize$4;
858
+ const plugin$4 = {
859
+ serialize: serialize$4,
860
+ test: test$4
861
+ };
862
+ var _default$5 = plugin$4;
863
+ DOMCollection$1.default = _default$5;
864
+
865
+ var DOMElement$1 = {};
866
+
867
+ var markup = {};
868
+
869
+ var escapeHTML$1 = {};
870
+
871
+ Object.defineProperty(escapeHTML$1, '__esModule', {
872
+ value: true
873
+ });
874
+ escapeHTML$1.default = escapeHTML;
875
+
876
+ /**
877
+ * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
878
+ *
879
+ * This source code is licensed under the MIT license found in the
880
+ * LICENSE file in the root directory of this source tree.
881
+ */
882
+ function escapeHTML(str) {
883
+ return str.replace(/</g, '&lt;').replace(/>/g, '&gt;');
884
+ }
885
+
886
+ Object.defineProperty(markup, '__esModule', {
887
+ value: true
888
+ });
889
+ markup.printElementAsLeaf =
890
+ markup.printElement =
891
+ markup.printComment =
892
+ markup.printText =
893
+ markup.printChildren =
894
+ markup.printProps =
895
+ void 0;
896
+
897
+ var _escapeHTML = _interopRequireDefault$1(escapeHTML$1);
898
+
899
+ function _interopRequireDefault$1(obj) {
900
+ return obj && obj.__esModule ? obj : {default: obj};
901
+ }
902
+
903
+ /**
904
+ * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
905
+ *
906
+ * This source code is licensed under the MIT license found in the
907
+ * LICENSE file in the root directory of this source tree.
908
+ */
909
+ // Return empty string if keys is empty.
910
+ const printProps = (keys, props, config, indentation, depth, refs, printer) => {
911
+ const indentationNext = indentation + config.indent;
912
+ const colors = config.colors;
913
+ return keys
914
+ .map(key => {
915
+ const value = props[key];
916
+ let printed = printer(value, config, indentationNext, depth, refs);
917
+
918
+ if (typeof value !== 'string') {
919
+ if (printed.indexOf('\n') !== -1) {
920
+ printed =
921
+ config.spacingOuter +
922
+ indentationNext +
923
+ printed +
924
+ config.spacingOuter +
925
+ indentation;
926
+ }
927
+
928
+ printed = '{' + printed + '}';
929
+ }
930
+
931
+ return (
932
+ config.spacingInner +
933
+ indentation +
934
+ colors.prop.open +
935
+ key +
936
+ colors.prop.close +
937
+ '=' +
938
+ colors.value.open +
939
+ printed +
940
+ colors.value.close
941
+ );
942
+ })
943
+ .join('');
944
+ }; // Return empty string if children is empty.
945
+
946
+ markup.printProps = printProps;
947
+
948
+ const printChildren = (children, config, indentation, depth, refs, printer) =>
949
+ children
950
+ .map(
951
+ child =>
952
+ config.spacingOuter +
953
+ indentation +
954
+ (typeof child === 'string'
955
+ ? printText(child, config)
956
+ : printer(child, config, indentation, depth, refs))
957
+ )
958
+ .join('');
959
+
960
+ markup.printChildren = printChildren;
961
+
962
+ const printText = (text, config) => {
963
+ const contentColor = config.colors.content;
964
+ return (
965
+ contentColor.open + (0, _escapeHTML.default)(text) + contentColor.close
966
+ );
967
+ };
968
+
969
+ markup.printText = printText;
970
+
971
+ const printComment = (comment, config) => {
972
+ const commentColor = config.colors.comment;
973
+ return (
974
+ commentColor.open +
975
+ '<!--' +
976
+ (0, _escapeHTML.default)(comment) +
977
+ '-->' +
978
+ commentColor.close
979
+ );
980
+ }; // Separate the functions to format props, children, and element,
981
+ // so a plugin could override a particular function, if needed.
982
+ // Too bad, so sad: the traditional (but unnecessary) space
983
+ // in a self-closing tagColor requires a second test of printedProps.
984
+
985
+ markup.printComment = printComment;
986
+
987
+ const printElement = (
988
+ type,
989
+ printedProps,
990
+ printedChildren,
991
+ config,
992
+ indentation
993
+ ) => {
994
+ const tagColor = config.colors.tag;
995
+ return (
996
+ tagColor.open +
997
+ '<' +
998
+ type +
999
+ (printedProps &&
1000
+ tagColor.close +
1001
+ printedProps +
1002
+ config.spacingOuter +
1003
+ indentation +
1004
+ tagColor.open) +
1005
+ (printedChildren
1006
+ ? '>' +
1007
+ tagColor.close +
1008
+ printedChildren +
1009
+ config.spacingOuter +
1010
+ indentation +
1011
+ tagColor.open +
1012
+ '</' +
1013
+ type
1014
+ : (printedProps && !config.min ? '' : ' ') + '/') +
1015
+ '>' +
1016
+ tagColor.close
1017
+ );
1018
+ };
1019
+
1020
+ markup.printElement = printElement;
1021
+
1022
+ const printElementAsLeaf = (type, config) => {
1023
+ const tagColor = config.colors.tag;
1024
+ return (
1025
+ tagColor.open +
1026
+ '<' +
1027
+ type +
1028
+ tagColor.close +
1029
+ ' …' +
1030
+ tagColor.open +
1031
+ ' />' +
1032
+ tagColor.close
1033
+ );
1034
+ };
1035
+
1036
+ markup.printElementAsLeaf = printElementAsLeaf;
1037
+
1038
+ Object.defineProperty(DOMElement$1, '__esModule', {
1039
+ value: true
1040
+ });
1041
+ DOMElement$1.default = DOMElement$1.serialize = DOMElement$1.test = void 0;
1042
+
1043
+ var _markup$2 = markup;
1044
+
1045
+ /**
1046
+ * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
1047
+ *
1048
+ * This source code is licensed under the MIT license found in the
1049
+ * LICENSE file in the root directory of this source tree.
1050
+ */
1051
+ const ELEMENT_NODE = 1;
1052
+ const TEXT_NODE = 3;
1053
+ const COMMENT_NODE = 8;
1054
+ const FRAGMENT_NODE = 11;
1055
+ const ELEMENT_REGEXP = /^((HTML|SVG)\w*)?Element$/;
1056
+
1057
+ const testHasAttribute = val => {
1058
+ try {
1059
+ return typeof val.hasAttribute === 'function' && val.hasAttribute('is');
1060
+ } catch {
1061
+ return false;
1062
+ }
1063
+ };
1064
+
1065
+ const testNode = val => {
1066
+ const constructorName = val.constructor.name;
1067
+ const {nodeType, tagName} = val;
1068
+ const isCustomElement =
1069
+ (typeof tagName === 'string' && tagName.includes('-')) ||
1070
+ testHasAttribute(val);
1071
+ return (
1072
+ (nodeType === ELEMENT_NODE &&
1073
+ (ELEMENT_REGEXP.test(constructorName) || isCustomElement)) ||
1074
+ (nodeType === TEXT_NODE && constructorName === 'Text') ||
1075
+ (nodeType === COMMENT_NODE && constructorName === 'Comment') ||
1076
+ (nodeType === FRAGMENT_NODE && constructorName === 'DocumentFragment')
1077
+ );
1078
+ };
1079
+
1080
+ const test$3 = val => {
1081
+ var _val$constructor;
1082
+
1083
+ return (
1084
+ (val === null || val === void 0
1085
+ ? void 0
1086
+ : (_val$constructor = val.constructor) === null ||
1087
+ _val$constructor === void 0
1088
+ ? void 0
1089
+ : _val$constructor.name) && testNode(val)
1090
+ );
1091
+ };
1092
+
1093
+ DOMElement$1.test = test$3;
1094
+
1095
+ function nodeIsText(node) {
1096
+ return node.nodeType === TEXT_NODE;
1097
+ }
1098
+
1099
+ function nodeIsComment(node) {
1100
+ return node.nodeType === COMMENT_NODE;
1101
+ }
1102
+
1103
+ function nodeIsFragment(node) {
1104
+ return node.nodeType === FRAGMENT_NODE;
1105
+ }
1106
+
1107
+ const serialize$3 = (node, config, indentation, depth, refs, printer) => {
1108
+ if (nodeIsText(node)) {
1109
+ return (0, _markup$2.printText)(node.data, config);
1110
+ }
1111
+
1112
+ if (nodeIsComment(node)) {
1113
+ return (0, _markup$2.printComment)(node.data, config);
1114
+ }
1115
+
1116
+ const type = nodeIsFragment(node)
1117
+ ? `DocumentFragment`
1118
+ : node.tagName.toLowerCase();
1119
+
1120
+ if (++depth > config.maxDepth) {
1121
+ return (0, _markup$2.printElementAsLeaf)(type, config);
1122
+ }
1123
+
1124
+ return (0, _markup$2.printElement)(
1125
+ type,
1126
+ (0, _markup$2.printProps)(
1127
+ nodeIsFragment(node)
1128
+ ? []
1129
+ : Array.from(node.attributes)
1130
+ .map(attr => attr.name)
1131
+ .sort(),
1132
+ nodeIsFragment(node)
1133
+ ? {}
1134
+ : Array.from(node.attributes).reduce((props, attribute) => {
1135
+ props[attribute.name] = attribute.value;
1136
+ return props;
1137
+ }, {}),
1138
+ config,
1139
+ indentation + config.indent,
1140
+ depth,
1141
+ refs,
1142
+ printer
1143
+ ),
1144
+ (0, _markup$2.printChildren)(
1145
+ Array.prototype.slice.call(node.childNodes || node.children),
1146
+ config,
1147
+ indentation + config.indent,
1148
+ depth,
1149
+ refs,
1150
+ printer
1151
+ ),
1152
+ config,
1153
+ indentation
1154
+ );
1155
+ };
1156
+
1157
+ DOMElement$1.serialize = serialize$3;
1158
+ const plugin$3 = {
1159
+ serialize: serialize$3,
1160
+ test: test$3
1161
+ };
1162
+ var _default$4 = plugin$3;
1163
+ DOMElement$1.default = _default$4;
1164
+
1165
+ var Immutable$1 = {};
1166
+
1167
+ Object.defineProperty(Immutable$1, '__esModule', {
1168
+ value: true
1169
+ });
1170
+ Immutable$1.default = Immutable$1.test = Immutable$1.serialize = void 0;
1171
+
1172
+ var _collections$1 = collections;
1173
+
1174
+ /**
1175
+ * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
1176
+ *
1177
+ * This source code is licensed under the MIT license found in the
1178
+ * LICENSE file in the root directory of this source tree.
1179
+ */
1180
+ // SENTINEL constants are from https://github.com/facebook/immutable-js
1181
+ const IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@';
1182
+ const IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@';
1183
+ const IS_KEYED_SENTINEL$1 = '@@__IMMUTABLE_KEYED__@@';
1184
+ const IS_MAP_SENTINEL = '@@__IMMUTABLE_MAP__@@';
1185
+ const IS_ORDERED_SENTINEL$1 = '@@__IMMUTABLE_ORDERED__@@';
1186
+ const IS_RECORD_SENTINEL = '@@__IMMUTABLE_RECORD__@@'; // immutable v4
1187
+
1188
+ const IS_SEQ_SENTINEL = '@@__IMMUTABLE_SEQ__@@';
1189
+ const IS_SET_SENTINEL$1 = '@@__IMMUTABLE_SET__@@';
1190
+ const IS_STACK_SENTINEL = '@@__IMMUTABLE_STACK__@@';
1191
+
1192
+ const getImmutableName = name => 'Immutable.' + name;
1193
+
1194
+ const printAsLeaf = name => '[' + name + ']';
1195
+
1196
+ const SPACE = ' ';
1197
+ const LAZY = '…'; // Seq is lazy if it calls a method like filter
1198
+
1199
+ const printImmutableEntries = (
1200
+ val,
1201
+ config,
1202
+ indentation,
1203
+ depth,
1204
+ refs,
1205
+ printer,
1206
+ type
1207
+ ) =>
1208
+ ++depth > config.maxDepth
1209
+ ? printAsLeaf(getImmutableName(type))
1210
+ : getImmutableName(type) +
1211
+ SPACE +
1212
+ '{' +
1213
+ (0, _collections$1.printIteratorEntries)(
1214
+ val.entries(),
1215
+ config,
1216
+ indentation,
1217
+ depth,
1218
+ refs,
1219
+ printer
1220
+ ) +
1221
+ '}'; // Record has an entries method because it is a collection in immutable v3.
1222
+ // Return an iterator for Immutable Record from version v3 or v4.
1223
+
1224
+ function getRecordEntries(val) {
1225
+ let i = 0;
1226
+ return {
1227
+ next() {
1228
+ if (i < val._keys.length) {
1229
+ const key = val._keys[i++];
1230
+ return {
1231
+ done: false,
1232
+ value: [key, val.get(key)]
1233
+ };
1234
+ }
1235
+
1236
+ return {
1237
+ done: true,
1238
+ value: undefined
1239
+ };
1240
+ }
1241
+ };
1242
+ }
1243
+
1244
+ const printImmutableRecord = (
1245
+ val,
1246
+ config,
1247
+ indentation,
1248
+ depth,
1249
+ refs,
1250
+ printer
1251
+ ) => {
1252
+ // _name property is defined only for an Immutable Record instance
1253
+ // which was constructed with a second optional descriptive name arg
1254
+ const name = getImmutableName(val._name || 'Record');
1255
+ return ++depth > config.maxDepth
1256
+ ? printAsLeaf(name)
1257
+ : name +
1258
+ SPACE +
1259
+ '{' +
1260
+ (0, _collections$1.printIteratorEntries)(
1261
+ getRecordEntries(val),
1262
+ config,
1263
+ indentation,
1264
+ depth,
1265
+ refs,
1266
+ printer
1267
+ ) +
1268
+ '}';
1269
+ };
1270
+
1271
+ const printImmutableSeq = (val, config, indentation, depth, refs, printer) => {
1272
+ const name = getImmutableName('Seq');
1273
+
1274
+ if (++depth > config.maxDepth) {
1275
+ return printAsLeaf(name);
1276
+ }
1277
+
1278
+ if (val[IS_KEYED_SENTINEL$1]) {
1279
+ return (
1280
+ name +
1281
+ SPACE +
1282
+ '{' +
1283
+ (val._iter || val._object
1284
+ ? (0, _collections$1.printIteratorEntries)(
1285
+ val.entries(),
1286
+ config,
1287
+ indentation,
1288
+ depth,
1289
+ refs,
1290
+ printer
1291
+ )
1292
+ : LAZY) +
1293
+ '}'
1294
+ );
1295
+ }
1296
+
1297
+ return (
1298
+ name +
1299
+ SPACE +
1300
+ '[' +
1301
+ (val._iter || // from Immutable collection of values
1302
+ val._array || // from ECMAScript array
1303
+ val._collection || // from ECMAScript collection in immutable v4
1304
+ val._iterable // from ECMAScript collection in immutable v3
1305
+ ? (0, _collections$1.printIteratorValues)(
1306
+ val.values(),
1307
+ config,
1308
+ indentation,
1309
+ depth,
1310
+ refs,
1311
+ printer
1312
+ )
1313
+ : LAZY) +
1314
+ ']'
1315
+ );
1316
+ };
1317
+
1318
+ const printImmutableValues = (
1319
+ val,
1320
+ config,
1321
+ indentation,
1322
+ depth,
1323
+ refs,
1324
+ printer,
1325
+ type
1326
+ ) =>
1327
+ ++depth > config.maxDepth
1328
+ ? printAsLeaf(getImmutableName(type))
1329
+ : getImmutableName(type) +
1330
+ SPACE +
1331
+ '[' +
1332
+ (0, _collections$1.printIteratorValues)(
1333
+ val.values(),
1334
+ config,
1335
+ indentation,
1336
+ depth,
1337
+ refs,
1338
+ printer
1339
+ ) +
1340
+ ']';
1341
+
1342
+ const serialize$2 = (val, config, indentation, depth, refs, printer) => {
1343
+ if (val[IS_MAP_SENTINEL]) {
1344
+ return printImmutableEntries(
1345
+ val,
1346
+ config,
1347
+ indentation,
1348
+ depth,
1349
+ refs,
1350
+ printer,
1351
+ val[IS_ORDERED_SENTINEL$1] ? 'OrderedMap' : 'Map'
1352
+ );
1353
+ }
1354
+
1355
+ if (val[IS_LIST_SENTINEL]) {
1356
+ return printImmutableValues(
1357
+ val,
1358
+ config,
1359
+ indentation,
1360
+ depth,
1361
+ refs,
1362
+ printer,
1363
+ 'List'
1364
+ );
1365
+ }
1366
+
1367
+ if (val[IS_SET_SENTINEL$1]) {
1368
+ return printImmutableValues(
1369
+ val,
1370
+ config,
1371
+ indentation,
1372
+ depth,
1373
+ refs,
1374
+ printer,
1375
+ val[IS_ORDERED_SENTINEL$1] ? 'OrderedSet' : 'Set'
1376
+ );
1377
+ }
1378
+
1379
+ if (val[IS_STACK_SENTINEL]) {
1380
+ return printImmutableValues(
1381
+ val,
1382
+ config,
1383
+ indentation,
1384
+ depth,
1385
+ refs,
1386
+ printer,
1387
+ 'Stack'
1388
+ );
1389
+ }
1390
+
1391
+ if (val[IS_SEQ_SENTINEL]) {
1392
+ return printImmutableSeq(val, config, indentation, depth, refs, printer);
1393
+ } // For compatibility with immutable v3 and v4, let record be the default.
1394
+
1395
+ return printImmutableRecord(val, config, indentation, depth, refs, printer);
1396
+ }; // Explicitly comparing sentinel properties to true avoids false positive
1397
+ // when mock identity-obj-proxy returns the key as the value for any key.
1398
+
1399
+ Immutable$1.serialize = serialize$2;
1400
+
1401
+ const test$2 = val =>
1402
+ val &&
1403
+ (val[IS_ITERABLE_SENTINEL] === true || val[IS_RECORD_SENTINEL] === true);
1404
+
1405
+ Immutable$1.test = test$2;
1406
+ const plugin$2 = {
1407
+ serialize: serialize$2,
1408
+ test: test$2
1409
+ };
1410
+ var _default$3 = plugin$2;
1411
+ Immutable$1.default = _default$3;
1412
+
1413
+ var ReactElement$1 = {};
1414
+
1415
+ var reactIs = {exports: {}};
1416
+
1417
+ var reactIs_production_min = {};
1418
+
1419
+ /** @license React v17.0.2
1420
+ * react-is.production.min.js
1421
+ *
1422
+ * Copyright (c) Facebook, Inc. and its affiliates.
1423
+ *
1424
+ * This source code is licensed under the MIT license found in the
1425
+ * LICENSE file in the root directory of this source tree.
1426
+ */
1427
+ var b=60103,c=60106,d=60107,e=60108,f=60114,g=60109,h=60110,k=60112,l=60113,m=60120,n=60115,p=60116,q=60121,r=60122,u=60117,v=60129,w=60131;
1428
+ if("function"===typeof Symbol&&Symbol.for){var x=Symbol.for;b=x("react.element");c=x("react.portal");d=x("react.fragment");e=x("react.strict_mode");f=x("react.profiler");g=x("react.provider");h=x("react.context");k=x("react.forward_ref");l=x("react.suspense");m=x("react.suspense_list");n=x("react.memo");p=x("react.lazy");q=x("react.block");r=x("react.server.block");u=x("react.fundamental");v=x("react.debug_trace_mode");w=x("react.legacy_hidden");}
1429
+ function y(a){if("object"===typeof a&&null!==a){var t=a.$$typeof;switch(t){case b:switch(a=a.type,a){case d:case f:case e:case l:case m:return a;default:switch(a=a&&a.$$typeof,a){case h:case k:case p:case n:case g:return a;default:return t}}case c:return t}}}var z=g,A=b,B=k,C=d,D=p,E=n,F=c,G=f,H=e,I=l;reactIs_production_min.ContextConsumer=h;reactIs_production_min.ContextProvider=z;reactIs_production_min.Element=A;reactIs_production_min.ForwardRef=B;reactIs_production_min.Fragment=C;reactIs_production_min.Lazy=D;reactIs_production_min.Memo=E;reactIs_production_min.Portal=F;reactIs_production_min.Profiler=G;reactIs_production_min.StrictMode=H;
1430
+ reactIs_production_min.Suspense=I;reactIs_production_min.isAsyncMode=function(){return !1};reactIs_production_min.isConcurrentMode=function(){return !1};reactIs_production_min.isContextConsumer=function(a){return y(a)===h};reactIs_production_min.isContextProvider=function(a){return y(a)===g};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===b};reactIs_production_min.isForwardRef=function(a){return y(a)===k};reactIs_production_min.isFragment=function(a){return y(a)===d};reactIs_production_min.isLazy=function(a){return y(a)===p};reactIs_production_min.isMemo=function(a){return y(a)===n};
1431
+ reactIs_production_min.isPortal=function(a){return y(a)===c};reactIs_production_min.isProfiler=function(a){return y(a)===f};reactIs_production_min.isStrictMode=function(a){return y(a)===e};reactIs_production_min.isSuspense=function(a){return y(a)===l};reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===d||a===f||a===v||a===e||a===l||a===m||a===w||"object"===typeof a&&null!==a&&(a.$$typeof===p||a.$$typeof===n||a.$$typeof===g||a.$$typeof===h||a.$$typeof===k||a.$$typeof===u||a.$$typeof===q||a[0]===r)?!0:!1};
1432
+ reactIs_production_min.typeOf=y;
1433
+
1434
+ var reactIs_development = {};
1435
+
1436
+ /** @license React v17.0.2
1437
+ * react-is.development.js
1438
+ *
1439
+ * Copyright (c) Facebook, Inc. and its affiliates.
1440
+ *
1441
+ * This source code is licensed under the MIT license found in the
1442
+ * LICENSE file in the root directory of this source tree.
1443
+ */
1444
+
1445
+ if (process.env.NODE_ENV !== "production") {
1446
+ (function() {
1447
+
1448
+ // ATTENTION
1449
+ // When adding new symbols to this file,
1450
+ // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
1451
+ // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
1452
+ // nor polyfill, then a plain number is used for performance.
1453
+ var REACT_ELEMENT_TYPE = 0xeac7;
1454
+ var REACT_PORTAL_TYPE = 0xeaca;
1455
+ var REACT_FRAGMENT_TYPE = 0xeacb;
1456
+ var REACT_STRICT_MODE_TYPE = 0xeacc;
1457
+ var REACT_PROFILER_TYPE = 0xead2;
1458
+ var REACT_PROVIDER_TYPE = 0xeacd;
1459
+ var REACT_CONTEXT_TYPE = 0xeace;
1460
+ var REACT_FORWARD_REF_TYPE = 0xead0;
1461
+ var REACT_SUSPENSE_TYPE = 0xead1;
1462
+ var REACT_SUSPENSE_LIST_TYPE = 0xead8;
1463
+ var REACT_MEMO_TYPE = 0xead3;
1464
+ var REACT_LAZY_TYPE = 0xead4;
1465
+ var REACT_BLOCK_TYPE = 0xead9;
1466
+ var REACT_SERVER_BLOCK_TYPE = 0xeada;
1467
+ var REACT_FUNDAMENTAL_TYPE = 0xead5;
1468
+ var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
1469
+ var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;
1470
+
1471
+ if (typeof Symbol === 'function' && Symbol.for) {
1472
+ var symbolFor = Symbol.for;
1473
+ REACT_ELEMENT_TYPE = symbolFor('react.element');
1474
+ REACT_PORTAL_TYPE = symbolFor('react.portal');
1475
+ REACT_FRAGMENT_TYPE = symbolFor('react.fragment');
1476
+ REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode');
1477
+ REACT_PROFILER_TYPE = symbolFor('react.profiler');
1478
+ REACT_PROVIDER_TYPE = symbolFor('react.provider');
1479
+ REACT_CONTEXT_TYPE = symbolFor('react.context');
1480
+ REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
1481
+ REACT_SUSPENSE_TYPE = symbolFor('react.suspense');
1482
+ REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
1483
+ REACT_MEMO_TYPE = symbolFor('react.memo');
1484
+ REACT_LAZY_TYPE = symbolFor('react.lazy');
1485
+ REACT_BLOCK_TYPE = symbolFor('react.block');
1486
+ REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');
1487
+ REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
1488
+ symbolFor('react.scope');
1489
+ symbolFor('react.opaque.id');
1490
+ REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
1491
+ symbolFor('react.offscreen');
1492
+ REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
1493
+ }
1494
+
1495
+ // Filter certain DOM attributes (e.g. src, href) if their values are empty strings.
1496
+
1497
+ var enableScopeAPI = false; // Experimental Create Event Handle API.
1498
+
1499
+ function isValidElementType(type) {
1500
+ if (typeof type === 'string' || typeof type === 'function') {
1501
+ return true;
1502
+ } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
1503
+
1504
+
1505
+ if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) {
1506
+ return true;
1507
+ }
1508
+
1509
+ if (typeof type === 'object' && type !== null) {
1510
+ if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {
1511
+ return true;
1512
+ }
1513
+ }
1514
+
1515
+ return false;
1516
+ }
1517
+
1518
+ function typeOf(object) {
1519
+ if (typeof object === 'object' && object !== null) {
1520
+ var $$typeof = object.$$typeof;
1521
+
1522
+ switch ($$typeof) {
1523
+ case REACT_ELEMENT_TYPE:
1524
+ var type = object.type;
1525
+
1526
+ switch (type) {
1527
+ case REACT_FRAGMENT_TYPE:
1528
+ case REACT_PROFILER_TYPE:
1529
+ case REACT_STRICT_MODE_TYPE:
1530
+ case REACT_SUSPENSE_TYPE:
1531
+ case REACT_SUSPENSE_LIST_TYPE:
1532
+ return type;
1533
+
1534
+ default:
1535
+ var $$typeofType = type && type.$$typeof;
1536
+
1537
+ switch ($$typeofType) {
1538
+ case REACT_CONTEXT_TYPE:
1539
+ case REACT_FORWARD_REF_TYPE:
1540
+ case REACT_LAZY_TYPE:
1541
+ case REACT_MEMO_TYPE:
1542
+ case REACT_PROVIDER_TYPE:
1543
+ return $$typeofType;
1544
+
1545
+ default:
1546
+ return $$typeof;
1547
+ }
1548
+
1549
+ }
1550
+
1551
+ case REACT_PORTAL_TYPE:
1552
+ return $$typeof;
1553
+ }
1554
+ }
1555
+
1556
+ return undefined;
1557
+ }
1558
+ var ContextConsumer = REACT_CONTEXT_TYPE;
1559
+ var ContextProvider = REACT_PROVIDER_TYPE;
1560
+ var Element = REACT_ELEMENT_TYPE;
1561
+ var ForwardRef = REACT_FORWARD_REF_TYPE;
1562
+ var Fragment = REACT_FRAGMENT_TYPE;
1563
+ var Lazy = REACT_LAZY_TYPE;
1564
+ var Memo = REACT_MEMO_TYPE;
1565
+ var Portal = REACT_PORTAL_TYPE;
1566
+ var Profiler = REACT_PROFILER_TYPE;
1567
+ var StrictMode = REACT_STRICT_MODE_TYPE;
1568
+ var Suspense = REACT_SUSPENSE_TYPE;
1569
+ var hasWarnedAboutDeprecatedIsAsyncMode = false;
1570
+ var hasWarnedAboutDeprecatedIsConcurrentMode = false; // AsyncMode should be deprecated
1571
+
1572
+ function isAsyncMode(object) {
1573
+ {
1574
+ if (!hasWarnedAboutDeprecatedIsAsyncMode) {
1575
+ hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
1576
+
1577
+ console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 18+.');
1578
+ }
1579
+ }
1580
+
1581
+ return false;
1582
+ }
1583
+ function isConcurrentMode(object) {
1584
+ {
1585
+ if (!hasWarnedAboutDeprecatedIsConcurrentMode) {
1586
+ hasWarnedAboutDeprecatedIsConcurrentMode = true; // Using console['warn'] to evade Babel and ESLint
1587
+
1588
+ console['warn']('The ReactIs.isConcurrentMode() alias has been deprecated, ' + 'and will be removed in React 18+.');
1589
+ }
1590
+ }
1591
+
1592
+ return false;
1593
+ }
1594
+ function isContextConsumer(object) {
1595
+ return typeOf(object) === REACT_CONTEXT_TYPE;
1596
+ }
1597
+ function isContextProvider(object) {
1598
+ return typeOf(object) === REACT_PROVIDER_TYPE;
1599
+ }
1600
+ function isElement(object) {
1601
+ return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
1602
+ }
1603
+ function isForwardRef(object) {
1604
+ return typeOf(object) === REACT_FORWARD_REF_TYPE;
1605
+ }
1606
+ function isFragment(object) {
1607
+ return typeOf(object) === REACT_FRAGMENT_TYPE;
1608
+ }
1609
+ function isLazy(object) {
1610
+ return typeOf(object) === REACT_LAZY_TYPE;
1611
+ }
1612
+ function isMemo(object) {
1613
+ return typeOf(object) === REACT_MEMO_TYPE;
1614
+ }
1615
+ function isPortal(object) {
1616
+ return typeOf(object) === REACT_PORTAL_TYPE;
1617
+ }
1618
+ function isProfiler(object) {
1619
+ return typeOf(object) === REACT_PROFILER_TYPE;
1620
+ }
1621
+ function isStrictMode(object) {
1622
+ return typeOf(object) === REACT_STRICT_MODE_TYPE;
1623
+ }
1624
+ function isSuspense(object) {
1625
+ return typeOf(object) === REACT_SUSPENSE_TYPE;
1626
+ }
1627
+
1628
+ reactIs_development.ContextConsumer = ContextConsumer;
1629
+ reactIs_development.ContextProvider = ContextProvider;
1630
+ reactIs_development.Element = Element;
1631
+ reactIs_development.ForwardRef = ForwardRef;
1632
+ reactIs_development.Fragment = Fragment;
1633
+ reactIs_development.Lazy = Lazy;
1634
+ reactIs_development.Memo = Memo;
1635
+ reactIs_development.Portal = Portal;
1636
+ reactIs_development.Profiler = Profiler;
1637
+ reactIs_development.StrictMode = StrictMode;
1638
+ reactIs_development.Suspense = Suspense;
1639
+ reactIs_development.isAsyncMode = isAsyncMode;
1640
+ reactIs_development.isConcurrentMode = isConcurrentMode;
1641
+ reactIs_development.isContextConsumer = isContextConsumer;
1642
+ reactIs_development.isContextProvider = isContextProvider;
1643
+ reactIs_development.isElement = isElement;
1644
+ reactIs_development.isForwardRef = isForwardRef;
1645
+ reactIs_development.isFragment = isFragment;
1646
+ reactIs_development.isLazy = isLazy;
1647
+ reactIs_development.isMemo = isMemo;
1648
+ reactIs_development.isPortal = isPortal;
1649
+ reactIs_development.isProfiler = isProfiler;
1650
+ reactIs_development.isStrictMode = isStrictMode;
1651
+ reactIs_development.isSuspense = isSuspense;
1652
+ reactIs_development.isValidElementType = isValidElementType;
1653
+ reactIs_development.typeOf = typeOf;
1654
+ })();
1655
+ }
1656
+
1657
+ if (process.env.NODE_ENV === 'production') {
1658
+ reactIs.exports = reactIs_production_min;
1659
+ } else {
1660
+ reactIs.exports = reactIs_development;
1661
+ }
1662
+
1663
+ Object.defineProperty(ReactElement$1, '__esModule', {
1664
+ value: true
1665
+ });
1666
+ ReactElement$1.default = ReactElement$1.test = ReactElement$1.serialize = void 0;
1667
+
1668
+ var ReactIs = _interopRequireWildcard(reactIs.exports);
1669
+
1670
+ var _markup$1 = markup;
1671
+
1672
+ function _getRequireWildcardCache(nodeInterop) {
1673
+ if (typeof WeakMap !== 'function') return null;
1674
+ var cacheBabelInterop = new WeakMap();
1675
+ var cacheNodeInterop = new WeakMap();
1676
+ return (_getRequireWildcardCache = function (nodeInterop) {
1677
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
1678
+ })(nodeInterop);
1679
+ }
1680
+
1681
+ function _interopRequireWildcard(obj, nodeInterop) {
1682
+ if (!nodeInterop && obj && obj.__esModule) {
1683
+ return obj;
1684
+ }
1685
+ if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) {
1686
+ return {default: obj};
1687
+ }
1688
+ var cache = _getRequireWildcardCache(nodeInterop);
1689
+ if (cache && cache.has(obj)) {
1690
+ return cache.get(obj);
1691
+ }
1692
+ var newObj = {};
1693
+ var hasPropertyDescriptor =
1694
+ Object.defineProperty && Object.getOwnPropertyDescriptor;
1695
+ for (var key in obj) {
1696
+ if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) {
1697
+ var desc = hasPropertyDescriptor
1698
+ ? Object.getOwnPropertyDescriptor(obj, key)
1699
+ : null;
1700
+ if (desc && (desc.get || desc.set)) {
1701
+ Object.defineProperty(newObj, key, desc);
1702
+ } else {
1703
+ newObj[key] = obj[key];
1704
+ }
1705
+ }
1706
+ }
1707
+ newObj.default = obj;
1708
+ if (cache) {
1709
+ cache.set(obj, newObj);
1710
+ }
1711
+ return newObj;
1712
+ }
1713
+
1714
+ /**
1715
+ * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
1716
+ *
1717
+ * This source code is licensed under the MIT license found in the
1718
+ * LICENSE file in the root directory of this source tree.
1719
+ */
1720
+ // Given element.props.children, or subtree during recursive traversal,
1721
+ // return flattened array of children.
1722
+ const getChildren = (arg, children = []) => {
1723
+ if (Array.isArray(arg)) {
1724
+ arg.forEach(item => {
1725
+ getChildren(item, children);
1726
+ });
1727
+ } else if (arg != null && arg !== false) {
1728
+ children.push(arg);
1729
+ }
1730
+
1731
+ return children;
1732
+ };
1733
+
1734
+ const getType = element => {
1735
+ const type = element.type;
1736
+
1737
+ if (typeof type === 'string') {
1738
+ return type;
1739
+ }
1740
+
1741
+ if (typeof type === 'function') {
1742
+ return type.displayName || type.name || 'Unknown';
1743
+ }
1744
+
1745
+ if (ReactIs.isFragment(element)) {
1746
+ return 'React.Fragment';
1747
+ }
1748
+
1749
+ if (ReactIs.isSuspense(element)) {
1750
+ return 'React.Suspense';
1751
+ }
1752
+
1753
+ if (typeof type === 'object' && type !== null) {
1754
+ if (ReactIs.isContextProvider(element)) {
1755
+ return 'Context.Provider';
1756
+ }
1757
+
1758
+ if (ReactIs.isContextConsumer(element)) {
1759
+ return 'Context.Consumer';
1760
+ }
1761
+
1762
+ if (ReactIs.isForwardRef(element)) {
1763
+ if (type.displayName) {
1764
+ return type.displayName;
1765
+ }
1766
+
1767
+ const functionName = type.render.displayName || type.render.name || '';
1768
+ return functionName !== ''
1769
+ ? 'ForwardRef(' + functionName + ')'
1770
+ : 'ForwardRef';
1771
+ }
1772
+
1773
+ if (ReactIs.isMemo(element)) {
1774
+ const functionName =
1775
+ type.displayName || type.type.displayName || type.type.name || '';
1776
+ return functionName !== '' ? 'Memo(' + functionName + ')' : 'Memo';
1777
+ }
1778
+ }
1779
+
1780
+ return 'UNDEFINED';
1781
+ };
1782
+
1783
+ const getPropKeys$1 = element => {
1784
+ const {props} = element;
1785
+ return Object.keys(props)
1786
+ .filter(key => key !== 'children' && props[key] !== undefined)
1787
+ .sort();
1788
+ };
1789
+
1790
+ const serialize$1 = (element, config, indentation, depth, refs, printer) =>
1791
+ ++depth > config.maxDepth
1792
+ ? (0, _markup$1.printElementAsLeaf)(getType(element), config)
1793
+ : (0, _markup$1.printElement)(
1794
+ getType(element),
1795
+ (0, _markup$1.printProps)(
1796
+ getPropKeys$1(element),
1797
+ element.props,
1798
+ config,
1799
+ indentation + config.indent,
1800
+ depth,
1801
+ refs,
1802
+ printer
1803
+ ),
1804
+ (0, _markup$1.printChildren)(
1805
+ getChildren(element.props.children),
1806
+ config,
1807
+ indentation + config.indent,
1808
+ depth,
1809
+ refs,
1810
+ printer
1811
+ ),
1812
+ config,
1813
+ indentation
1814
+ );
1815
+
1816
+ ReactElement$1.serialize = serialize$1;
1817
+
1818
+ const test$1 = val => val != null && ReactIs.isElement(val);
1819
+
1820
+ ReactElement$1.test = test$1;
1821
+ const plugin$1 = {
1822
+ serialize: serialize$1,
1823
+ test: test$1
1824
+ };
1825
+ var _default$2 = plugin$1;
1826
+ ReactElement$1.default = _default$2;
1827
+
1828
+ var ReactTestComponent$1 = {};
1829
+
1830
+ Object.defineProperty(ReactTestComponent$1, '__esModule', {
1831
+ value: true
1832
+ });
1833
+ ReactTestComponent$1.default = ReactTestComponent$1.test = ReactTestComponent$1.serialize = void 0;
1834
+
1835
+ var _markup = markup;
1836
+
1837
+ var global$1 = (function () {
1838
+ if (typeof globalThis !== 'undefined') {
1839
+ return globalThis;
1840
+ } else if (typeof global$1 !== 'undefined') {
1841
+ return global$1;
1842
+ } else if (typeof self !== 'undefined') {
1843
+ return self;
1844
+ } else if (typeof window !== 'undefined') {
1845
+ return window;
1846
+ } else {
1847
+ return Function('return this')();
1848
+ }
1849
+ })();
1850
+
1851
+ var Symbol$1 = global$1['jest-symbol-do-not-touch'] || global$1.Symbol;
1852
+ const testSymbol =
1853
+ typeof Symbol$1 === 'function' && Symbol$1.for
1854
+ ? Symbol$1.for('react.test.json')
1855
+ : 0xea71357;
1856
+
1857
+ const getPropKeys = object => {
1858
+ const {props} = object;
1859
+ return props
1860
+ ? Object.keys(props)
1861
+ .filter(key => props[key] !== undefined)
1862
+ .sort()
1863
+ : [];
1864
+ };
1865
+
1866
+ const serialize = (object, config, indentation, depth, refs, printer) =>
1867
+ ++depth > config.maxDepth
1868
+ ? (0, _markup.printElementAsLeaf)(object.type, config)
1869
+ : (0, _markup.printElement)(
1870
+ object.type,
1871
+ object.props
1872
+ ? (0, _markup.printProps)(
1873
+ getPropKeys(object),
1874
+ object.props,
1875
+ config,
1876
+ indentation + config.indent,
1877
+ depth,
1878
+ refs,
1879
+ printer
1880
+ )
1881
+ : '',
1882
+ object.children
1883
+ ? (0, _markup.printChildren)(
1884
+ object.children,
1885
+ config,
1886
+ indentation + config.indent,
1887
+ depth,
1888
+ refs,
1889
+ printer
1890
+ )
1891
+ : '',
1892
+ config,
1893
+ indentation
1894
+ );
1895
+
1896
+ ReactTestComponent$1.serialize = serialize;
1897
+
1898
+ const test = val => val && val.$$typeof === testSymbol;
1899
+
1900
+ ReactTestComponent$1.test = test;
1901
+ const plugin = {
1902
+ serialize,
1903
+ test
1904
+ };
1905
+ var _default$1 = plugin;
1906
+ ReactTestComponent$1.default = _default$1;
1907
+
1908
+ Object.defineProperty(build, '__esModule', {
1909
+ value: true
1910
+ });
1911
+ var format_1 = build.format = format;
1912
+ build.default = plugins_1 = build.plugins = build.DEFAULT_OPTIONS = void 0;
1913
+
1914
+ var _ansiStyles = _interopRequireDefault(ansiStyles.exports);
1915
+
1916
+ var _collections = collections;
1917
+
1918
+ var _AsymmetricMatcher = _interopRequireDefault(
1919
+ AsymmetricMatcher$1
1920
+ );
1921
+
1922
+ var _ConvertAnsi = _interopRequireDefault(ConvertAnsi);
1923
+
1924
+ var _DOMCollection = _interopRequireDefault(DOMCollection$1);
1925
+
1926
+ var _DOMElement = _interopRequireDefault(DOMElement$1);
1927
+
1928
+ var _Immutable = _interopRequireDefault(Immutable$1);
1929
+
1930
+ var _ReactElement = _interopRequireDefault(ReactElement$1);
1931
+
1932
+ var _ReactTestComponent = _interopRequireDefault(
1933
+ ReactTestComponent$1
1934
+ );
1935
+
1936
+ function _interopRequireDefault(obj) {
1937
+ return obj && obj.__esModule ? obj : {default: obj};
1938
+ }
1939
+
1940
+ /**
1941
+ * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
1942
+ *
1943
+ * This source code is licensed under the MIT license found in the
1944
+ * LICENSE file in the root directory of this source tree.
1945
+ */
1946
+
1947
+ /* eslint-disable local/ban-types-eventually */
1948
+ const toString = Object.prototype.toString;
1949
+ const toISOString = Date.prototype.toISOString;
1950
+ const errorToString = Error.prototype.toString;
1951
+ const regExpToString = RegExp.prototype.toString;
1952
+ /**
1953
+ * Explicitly comparing typeof constructor to function avoids undefined as name
1954
+ * when mock identity-obj-proxy returns the key as the value for any key.
1955
+ */
1956
+
1957
+ const getConstructorName = val =>
1958
+ (typeof val.constructor === 'function' && val.constructor.name) || 'Object';
1959
+ /* global window */
1960
+
1961
+ /** Is val is equal to global window object? Works even if it does not exist :) */
1962
+
1963
+ const isWindow = val => typeof window !== 'undefined' && val === window;
1964
+
1965
+ const SYMBOL_REGEXP = /^Symbol\((.*)\)(.*)$/;
1966
+ const NEWLINE_REGEXP = /\n/gi;
1967
+
1968
+ class PrettyFormatPluginError extends Error {
1969
+ constructor(message, stack) {
1970
+ super(message);
1971
+ this.stack = stack;
1972
+ this.name = this.constructor.name;
1973
+ }
1974
+ }
1975
+
1976
+ function isToStringedArrayType(toStringed) {
1977
+ return (
1978
+ toStringed === '[object Array]' ||
1979
+ toStringed === '[object ArrayBuffer]' ||
1980
+ toStringed === '[object DataView]' ||
1981
+ toStringed === '[object Float32Array]' ||
1982
+ toStringed === '[object Float64Array]' ||
1983
+ toStringed === '[object Int8Array]' ||
1984
+ toStringed === '[object Int16Array]' ||
1985
+ toStringed === '[object Int32Array]' ||
1986
+ toStringed === '[object Uint8Array]' ||
1987
+ toStringed === '[object Uint8ClampedArray]' ||
1988
+ toStringed === '[object Uint16Array]' ||
1989
+ toStringed === '[object Uint32Array]'
1990
+ );
1991
+ }
1992
+
1993
+ function printNumber(val) {
1994
+ return Object.is(val, -0) ? '-0' : String(val);
1995
+ }
1996
+
1997
+ function printBigInt(val) {
1998
+ return String(`${val}n`);
1999
+ }
2000
+
2001
+ function printFunction(val, printFunctionName) {
2002
+ if (!printFunctionName) {
2003
+ return '[Function]';
2004
+ }
2005
+
2006
+ return '[Function ' + (val.name || 'anonymous') + ']';
2007
+ }
2008
+
2009
+ function printSymbol(val) {
2010
+ return String(val).replace(SYMBOL_REGEXP, 'Symbol($1)');
2011
+ }
2012
+
2013
+ function printError(val) {
2014
+ return '[' + errorToString.call(val) + ']';
2015
+ }
2016
+ /**
2017
+ * The first port of call for printing an object, handles most of the
2018
+ * data-types in JS.
2019
+ */
2020
+
2021
+ function printBasicValue(val, printFunctionName, escapeRegex, escapeString) {
2022
+ if (val === true || val === false) {
2023
+ return '' + val;
2024
+ }
2025
+
2026
+ if (val === undefined) {
2027
+ return 'undefined';
2028
+ }
2029
+
2030
+ if (val === null) {
2031
+ return 'null';
2032
+ }
2033
+
2034
+ const typeOf = typeof val;
2035
+
2036
+ if (typeOf === 'number') {
2037
+ return printNumber(val);
2038
+ }
2039
+
2040
+ if (typeOf === 'bigint') {
2041
+ return printBigInt(val);
2042
+ }
2043
+
2044
+ if (typeOf === 'string') {
2045
+ if (escapeString) {
2046
+ return '"' + val.replace(/"|\\/g, '\\$&') + '"';
2047
+ }
2048
+
2049
+ return '"' + val + '"';
2050
+ }
2051
+
2052
+ if (typeOf === 'function') {
2053
+ return printFunction(val, printFunctionName);
2054
+ }
2055
+
2056
+ if (typeOf === 'symbol') {
2057
+ return printSymbol(val);
2058
+ }
2059
+
2060
+ const toStringed = toString.call(val);
2061
+
2062
+ if (toStringed === '[object WeakMap]') {
2063
+ return 'WeakMap {}';
2064
+ }
2065
+
2066
+ if (toStringed === '[object WeakSet]') {
2067
+ return 'WeakSet {}';
2068
+ }
2069
+
2070
+ if (
2071
+ toStringed === '[object Function]' ||
2072
+ toStringed === '[object GeneratorFunction]'
2073
+ ) {
2074
+ return printFunction(val, printFunctionName);
2075
+ }
2076
+
2077
+ if (toStringed === '[object Symbol]') {
2078
+ return printSymbol(val);
2079
+ }
2080
+
2081
+ if (toStringed === '[object Date]') {
2082
+ return isNaN(+val) ? 'Date { NaN }' : toISOString.call(val);
2083
+ }
2084
+
2085
+ if (toStringed === '[object Error]') {
2086
+ return printError(val);
2087
+ }
2088
+
2089
+ if (toStringed === '[object RegExp]') {
2090
+ if (escapeRegex) {
2091
+ // https://github.com/benjamingr/RegExp.escape/blob/main/polyfill.js
2092
+ return regExpToString.call(val).replace(/[\\^$*+?.()|[\]{}]/g, '\\$&');
2093
+ }
2094
+
2095
+ return regExpToString.call(val);
2096
+ }
2097
+
2098
+ if (val instanceof Error) {
2099
+ return printError(val);
2100
+ }
2101
+
2102
+ return null;
2103
+ }
2104
+ /**
2105
+ * Handles more complex objects ( such as objects with circular references.
2106
+ * maps and sets etc )
2107
+ */
2108
+
2109
+ function printComplexValue(
2110
+ val,
2111
+ config,
2112
+ indentation,
2113
+ depth,
2114
+ refs,
2115
+ hasCalledToJSON
2116
+ ) {
2117
+ if (refs.indexOf(val) !== -1) {
2118
+ return '[Circular]';
2119
+ }
2120
+
2121
+ refs = refs.slice();
2122
+ refs.push(val);
2123
+ const hitMaxDepth = ++depth > config.maxDepth;
2124
+ const min = config.min;
2125
+
2126
+ if (
2127
+ config.callToJSON &&
2128
+ !hitMaxDepth &&
2129
+ val.toJSON &&
2130
+ typeof val.toJSON === 'function' &&
2131
+ !hasCalledToJSON
2132
+ ) {
2133
+ return printer(val.toJSON(), config, indentation, depth, refs, true);
2134
+ }
2135
+
2136
+ const toStringed = toString.call(val);
2137
+
2138
+ if (toStringed === '[object Arguments]') {
2139
+ return hitMaxDepth
2140
+ ? '[Arguments]'
2141
+ : (min ? '' : 'Arguments ') +
2142
+ '[' +
2143
+ (0, _collections.printListItems)(
2144
+ val,
2145
+ config,
2146
+ indentation,
2147
+ depth,
2148
+ refs,
2149
+ printer
2150
+ ) +
2151
+ ']';
2152
+ }
2153
+
2154
+ if (isToStringedArrayType(toStringed)) {
2155
+ return hitMaxDepth
2156
+ ? '[' + val.constructor.name + ']'
2157
+ : (min
2158
+ ? ''
2159
+ : !config.printBasicPrototype && val.constructor.name === 'Array'
2160
+ ? ''
2161
+ : val.constructor.name + ' ') +
2162
+ '[' +
2163
+ (0, _collections.printListItems)(
2164
+ val,
2165
+ config,
2166
+ indentation,
2167
+ depth,
2168
+ refs,
2169
+ printer
2170
+ ) +
2171
+ ']';
2172
+ }
2173
+
2174
+ if (toStringed === '[object Map]') {
2175
+ return hitMaxDepth
2176
+ ? '[Map]'
2177
+ : 'Map {' +
2178
+ (0, _collections.printIteratorEntries)(
2179
+ val.entries(),
2180
+ config,
2181
+ indentation,
2182
+ depth,
2183
+ refs,
2184
+ printer,
2185
+ ' => '
2186
+ ) +
2187
+ '}';
2188
+ }
2189
+
2190
+ if (toStringed === '[object Set]') {
2191
+ return hitMaxDepth
2192
+ ? '[Set]'
2193
+ : 'Set {' +
2194
+ (0, _collections.printIteratorValues)(
2195
+ val.values(),
2196
+ config,
2197
+ indentation,
2198
+ depth,
2199
+ refs,
2200
+ printer
2201
+ ) +
2202
+ '}';
2203
+ } // Avoid failure to serialize global window object in jsdom test environment.
2204
+ // For example, not even relevant if window is prop of React element.
2205
+
2206
+ return hitMaxDepth || isWindow(val)
2207
+ ? '[' + getConstructorName(val) + ']'
2208
+ : (min
2209
+ ? ''
2210
+ : !config.printBasicPrototype && getConstructorName(val) === 'Object'
2211
+ ? ''
2212
+ : getConstructorName(val) + ' ') +
2213
+ '{' +
2214
+ (0, _collections.printObjectProperties)(
2215
+ val,
2216
+ config,
2217
+ indentation,
2218
+ depth,
2219
+ refs,
2220
+ printer
2221
+ ) +
2222
+ '}';
2223
+ }
2224
+
2225
+ function isNewPlugin(plugin) {
2226
+ return plugin.serialize != null;
2227
+ }
2228
+
2229
+ function printPlugin(plugin, val, config, indentation, depth, refs) {
2230
+ let printed;
2231
+
2232
+ try {
2233
+ printed = isNewPlugin(plugin)
2234
+ ? plugin.serialize(val, config, indentation, depth, refs, printer)
2235
+ : plugin.print(
2236
+ val,
2237
+ valChild => printer(valChild, config, indentation, depth, refs),
2238
+ str => {
2239
+ const indentationNext = indentation + config.indent;
2240
+ return (
2241
+ indentationNext +
2242
+ str.replace(NEWLINE_REGEXP, '\n' + indentationNext)
2243
+ );
2244
+ },
2245
+ {
2246
+ edgeSpacing: config.spacingOuter,
2247
+ min: config.min,
2248
+ spacing: config.spacingInner
2249
+ },
2250
+ config.colors
2251
+ );
2252
+ } catch (error) {
2253
+ throw new PrettyFormatPluginError(error.message, error.stack);
2254
+ }
2255
+
2256
+ if (typeof printed !== 'string') {
2257
+ throw new Error(
2258
+ `pretty-format: Plugin must return type "string" but instead returned "${typeof printed}".`
2259
+ );
2260
+ }
2261
+
2262
+ return printed;
2263
+ }
2264
+
2265
+ function findPlugin(plugins, val) {
2266
+ for (let p = 0; p < plugins.length; p++) {
2267
+ try {
2268
+ if (plugins[p].test(val)) {
2269
+ return plugins[p];
2270
+ }
2271
+ } catch (error) {
2272
+ throw new PrettyFormatPluginError(error.message, error.stack);
2273
+ }
2274
+ }
2275
+
2276
+ return null;
2277
+ }
2278
+
2279
+ function printer(val, config, indentation, depth, refs, hasCalledToJSON) {
2280
+ const plugin = findPlugin(config.plugins, val);
2281
+
2282
+ if (plugin !== null) {
2283
+ return printPlugin(plugin, val, config, indentation, depth, refs);
2284
+ }
2285
+
2286
+ const basicResult = printBasicValue(
2287
+ val,
2288
+ config.printFunctionName,
2289
+ config.escapeRegex,
2290
+ config.escapeString
2291
+ );
2292
+
2293
+ if (basicResult !== null) {
2294
+ return basicResult;
2295
+ }
2296
+
2297
+ return printComplexValue(
2298
+ val,
2299
+ config,
2300
+ indentation,
2301
+ depth,
2302
+ refs,
2303
+ hasCalledToJSON
2304
+ );
2305
+ }
2306
+
2307
+ const DEFAULT_THEME = {
2308
+ comment: 'gray',
2309
+ content: 'reset',
2310
+ prop: 'yellow',
2311
+ tag: 'cyan',
2312
+ value: 'green'
2313
+ };
2314
+ const DEFAULT_THEME_KEYS = Object.keys(DEFAULT_THEME);
2315
+ const DEFAULT_OPTIONS = {
2316
+ callToJSON: true,
2317
+ compareKeys: undefined,
2318
+ escapeRegex: false,
2319
+ escapeString: true,
2320
+ highlight: false,
2321
+ indent: 2,
2322
+ maxDepth: Infinity,
2323
+ min: false,
2324
+ plugins: [],
2325
+ printBasicPrototype: true,
2326
+ printFunctionName: true,
2327
+ theme: DEFAULT_THEME
2328
+ };
2329
+ build.DEFAULT_OPTIONS = DEFAULT_OPTIONS;
2330
+
2331
+ function validateOptions(options) {
2332
+ Object.keys(options).forEach(key => {
2333
+ if (!DEFAULT_OPTIONS.hasOwnProperty(key)) {
2334
+ throw new Error(`pretty-format: Unknown option "${key}".`);
2335
+ }
2336
+ });
2337
+
2338
+ if (options.min && options.indent !== undefined && options.indent !== 0) {
2339
+ throw new Error(
2340
+ 'pretty-format: Options "min" and "indent" cannot be used together.'
2341
+ );
2342
+ }
2343
+
2344
+ if (options.theme !== undefined) {
2345
+ if (options.theme === null) {
2346
+ throw new Error(`pretty-format: Option "theme" must not be null.`);
2347
+ }
2348
+
2349
+ if (typeof options.theme !== 'object') {
2350
+ throw new Error(
2351
+ `pretty-format: Option "theme" must be of type "object" but instead received "${typeof options.theme}".`
2352
+ );
2353
+ }
2354
+ }
2355
+ }
2356
+
2357
+ const getColorsHighlight = options =>
2358
+ DEFAULT_THEME_KEYS.reduce((colors, key) => {
2359
+ const value =
2360
+ options.theme && options.theme[key] !== undefined
2361
+ ? options.theme[key]
2362
+ : DEFAULT_THEME[key];
2363
+ const color = value && _ansiStyles.default[value];
2364
+
2365
+ if (
2366
+ color &&
2367
+ typeof color.close === 'string' &&
2368
+ typeof color.open === 'string'
2369
+ ) {
2370
+ colors[key] = color;
2371
+ } else {
2372
+ throw new Error(
2373
+ `pretty-format: Option "theme" has a key "${key}" whose value "${value}" is undefined in ansi-styles.`
2374
+ );
2375
+ }
2376
+
2377
+ return colors;
2378
+ }, Object.create(null));
2379
+
2380
+ const getColorsEmpty = () =>
2381
+ DEFAULT_THEME_KEYS.reduce((colors, key) => {
2382
+ colors[key] = {
2383
+ close: '',
2384
+ open: ''
2385
+ };
2386
+ return colors;
2387
+ }, Object.create(null));
2388
+
2389
+ const getPrintFunctionName = options =>
2390
+ options && options.printFunctionName !== undefined
2391
+ ? options.printFunctionName
2392
+ : DEFAULT_OPTIONS.printFunctionName;
2393
+
2394
+ const getEscapeRegex = options =>
2395
+ options && options.escapeRegex !== undefined
2396
+ ? options.escapeRegex
2397
+ : DEFAULT_OPTIONS.escapeRegex;
2398
+
2399
+ const getEscapeString = options =>
2400
+ options && options.escapeString !== undefined
2401
+ ? options.escapeString
2402
+ : DEFAULT_OPTIONS.escapeString;
2403
+
2404
+ const getConfig = options => {
2405
+ var _options$printBasicPr;
2406
+
2407
+ return {
2408
+ callToJSON:
2409
+ options && options.callToJSON !== undefined
2410
+ ? options.callToJSON
2411
+ : DEFAULT_OPTIONS.callToJSON,
2412
+ colors:
2413
+ options && options.highlight
2414
+ ? getColorsHighlight(options)
2415
+ : getColorsEmpty(),
2416
+ compareKeys:
2417
+ options && typeof options.compareKeys === 'function'
2418
+ ? options.compareKeys
2419
+ : DEFAULT_OPTIONS.compareKeys,
2420
+ escapeRegex: getEscapeRegex(options),
2421
+ escapeString: getEscapeString(options),
2422
+ indent:
2423
+ options && options.min
2424
+ ? ''
2425
+ : createIndent(
2426
+ options && options.indent !== undefined
2427
+ ? options.indent
2428
+ : DEFAULT_OPTIONS.indent
2429
+ ),
2430
+ maxDepth:
2431
+ options && options.maxDepth !== undefined
2432
+ ? options.maxDepth
2433
+ : DEFAULT_OPTIONS.maxDepth,
2434
+ min:
2435
+ options && options.min !== undefined ? options.min : DEFAULT_OPTIONS.min,
2436
+ plugins:
2437
+ options && options.plugins !== undefined
2438
+ ? options.plugins
2439
+ : DEFAULT_OPTIONS.plugins,
2440
+ printBasicPrototype:
2441
+ (_options$printBasicPr =
2442
+ options === null || options === void 0
2443
+ ? void 0
2444
+ : options.printBasicPrototype) !== null &&
2445
+ _options$printBasicPr !== void 0
2446
+ ? _options$printBasicPr
2447
+ : true,
2448
+ printFunctionName: getPrintFunctionName(options),
2449
+ spacingInner: options && options.min ? ' ' : '\n',
2450
+ spacingOuter: options && options.min ? '' : '\n'
2451
+ };
2452
+ };
2453
+
2454
+ function createIndent(indent) {
2455
+ return new Array(indent + 1).join(' ');
2456
+ }
2457
+ /**
2458
+ * Returns a presentation string of your `val` object
2459
+ * @param val any potential JavaScript object
2460
+ * @param options Custom settings
2461
+ */
2462
+
2463
+ function format(val, options) {
2464
+ if (options) {
2465
+ validateOptions(options);
2466
+
2467
+ if (options.plugins) {
2468
+ const plugin = findPlugin(options.plugins, val);
2469
+
2470
+ if (plugin !== null) {
2471
+ return printPlugin(plugin, val, getConfig(options), '', 0, []);
2472
+ }
2473
+ }
2474
+ }
2475
+
2476
+ const basicResult = printBasicValue(
2477
+ val,
2478
+ getPrintFunctionName(options),
2479
+ getEscapeRegex(options),
2480
+ getEscapeString(options)
2481
+ );
2482
+
2483
+ if (basicResult !== null) {
2484
+ return basicResult;
2485
+ }
2486
+
2487
+ return printComplexValue(val, getConfig(options), '', 0, []);
2488
+ }
2489
+
2490
+ const plugins = {
2491
+ AsymmetricMatcher: _AsymmetricMatcher.default,
2492
+ ConvertAnsi: _ConvertAnsi.default,
2493
+ DOMCollection: _DOMCollection.default,
2494
+ DOMElement: _DOMElement.default,
2495
+ Immutable: _Immutable.default,
2496
+ ReactElement: _ReactElement.default,
2497
+ ReactTestComponent: _ReactTestComponent.default
2498
+ };
2499
+ var plugins_1 = build.plugins = plugins;
2500
+ var _default = format;
2501
+ build.default = _default;
2502
+
2503
+ const {
2504
+ DOMCollection,
2505
+ DOMElement,
2506
+ Immutable,
2507
+ ReactElement,
2508
+ ReactTestComponent,
2509
+ AsymmetricMatcher
2510
+ } = plugins_1;
2511
+ let PLUGINS = [
2512
+ ReactTestComponent,
2513
+ ReactElement,
2514
+ DOMElement,
2515
+ DOMCollection,
2516
+ Immutable,
2517
+ AsymmetricMatcher
2518
+ ];
2519
+ const addSerializer = (plugin) => {
2520
+ PLUGINS = [plugin].concat(PLUGINS);
2521
+ };
2522
+ const getSerializers = () => PLUGINS;
2523
+
2524
+ function equals(a, b, customTesters, strictCheck) {
2525
+ customTesters = customTesters || [];
2526
+ return eq(a, b, [], [], customTesters, strictCheck ? hasKey : hasDefinedKey);
2527
+ }
2528
+ function isAsymmetric(obj) {
2529
+ return !!obj && isA("Function", obj.asymmetricMatch);
2530
+ }
2531
+ function hasAsymmetric(obj, seen = new Set()) {
2532
+ if (seen.has(obj))
2533
+ return false;
2534
+ seen.add(obj);
2535
+ if (isAsymmetric(obj))
2536
+ return true;
2537
+ if (Array.isArray(obj))
2538
+ return obj.some((i) => hasAsymmetric(i, seen));
2539
+ if (obj instanceof Set)
2540
+ return Array.from(obj).some((i) => hasAsymmetric(i, seen));
2541
+ if (isObject(obj))
2542
+ return Object.values(obj).some((v) => hasAsymmetric(v, seen));
2543
+ return false;
2544
+ }
2545
+ function asymmetricMatch(a, b) {
2546
+ const asymmetricA = isAsymmetric(a);
2547
+ const asymmetricB = isAsymmetric(b);
2548
+ if (asymmetricA && asymmetricB)
2549
+ return void 0;
2550
+ if (asymmetricA)
2551
+ return a.asymmetricMatch(b);
2552
+ if (asymmetricB)
2553
+ return b.asymmetricMatch(a);
2554
+ }
2555
+ function eq(a, b, aStack, bStack, customTesters, hasKey2) {
2556
+ let result = true;
2557
+ const asymmetricResult = asymmetricMatch(a, b);
2558
+ if (asymmetricResult !== void 0)
2559
+ return asymmetricResult;
2560
+ for (let i = 0; i < customTesters.length; i++) {
2561
+ const customTesterResult = customTesters[i](a, b);
2562
+ if (customTesterResult !== void 0)
2563
+ return customTesterResult;
2564
+ }
2565
+ if (a instanceof Error && b instanceof Error)
2566
+ return a.message === b.message;
2567
+ if (Object.is(a, b))
2568
+ return true;
2569
+ if (a === null || b === null)
2570
+ return a === b;
2571
+ const className = Object.prototype.toString.call(a);
2572
+ if (className !== Object.prototype.toString.call(b))
2573
+ return false;
2574
+ switch (className) {
2575
+ case "[object Boolean]":
2576
+ case "[object String]":
2577
+ case "[object Number]":
2578
+ if (typeof a !== typeof b) {
2579
+ return false;
2580
+ } else if (typeof a !== "object" && typeof b !== "object") {
2581
+ return Object.is(a, b);
2582
+ } else {
2583
+ return Object.is(a.valueOf(), b.valueOf());
2584
+ }
2585
+ case "[object Date]":
2586
+ return +a === +b;
2587
+ case "[object RegExp]":
2588
+ return a.source === b.source && a.flags === b.flags;
2589
+ }
2590
+ if (typeof a !== "object" || typeof b !== "object")
2591
+ return false;
2592
+ if (isDomNode(a) && isDomNode(b))
2593
+ return a.isEqualNode(b);
2594
+ let length = aStack.length;
2595
+ while (length--) {
2596
+ if (aStack[length] === a)
2597
+ return bStack[length] === b;
2598
+ else if (bStack[length] === b)
2599
+ return false;
2600
+ }
2601
+ aStack.push(a);
2602
+ bStack.push(b);
2603
+ if (className === "[object Array]" && a.length !== b.length)
2604
+ return false;
2605
+ const aKeys = keys(a, hasKey2);
2606
+ let key;
2607
+ let size = aKeys.length;
2608
+ if (keys(b, hasKey2).length !== size)
2609
+ return false;
2610
+ while (size--) {
2611
+ key = aKeys[size];
2612
+ result = hasKey2(b, key) && eq(a[key], b[key], aStack, bStack, customTesters, hasKey2);
2613
+ if (!result)
2614
+ return false;
2615
+ }
2616
+ aStack.pop();
2617
+ bStack.pop();
2618
+ return result;
2619
+ }
2620
+ function keys(obj, hasKey2) {
2621
+ const keys2 = [];
2622
+ for (const key in obj) {
2623
+ if (hasKey2(obj, key))
2624
+ keys2.push(key);
2625
+ }
2626
+ return keys2.concat(Object.getOwnPropertySymbols(obj).filter((symbol) => Object.getOwnPropertyDescriptor(obj, symbol).enumerable));
2627
+ }
2628
+ function hasDefinedKey(obj, key) {
2629
+ return hasKey(obj, key) && obj[key] !== void 0;
2630
+ }
2631
+ function hasKey(obj, key) {
2632
+ return Object.prototype.hasOwnProperty.call(obj, key);
2633
+ }
2634
+ function isA(typeName, value) {
2635
+ return Object.prototype.toString.apply(value) === `[object ${typeName}]`;
2636
+ }
2637
+ function isDomNode(obj) {
2638
+ return obj !== null && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string" && typeof obj.isEqualNode === "function";
2639
+ }
2640
+ const IS_KEYED_SENTINEL = "@@__IMMUTABLE_KEYED__@@";
2641
+ const IS_SET_SENTINEL = "@@__IMMUTABLE_SET__@@";
2642
+ const IS_ORDERED_SENTINEL = "@@__IMMUTABLE_ORDERED__@@";
2643
+ function isImmutableUnorderedKeyed(maybeKeyed) {
2644
+ return !!(maybeKeyed && maybeKeyed[IS_KEYED_SENTINEL] && !maybeKeyed[IS_ORDERED_SENTINEL]);
2645
+ }
2646
+ function isImmutableUnorderedSet(maybeSet) {
2647
+ return !!(maybeSet && maybeSet[IS_SET_SENTINEL] && !maybeSet[IS_ORDERED_SENTINEL]);
2648
+ }
2649
+ const IteratorSymbol = Symbol.iterator;
2650
+ const hasIterator = (object) => !!(object != null && object[IteratorSymbol]);
2651
+ const iterableEquality = (a, b, aStack = [], bStack = []) => {
2652
+ if (typeof a !== "object" || typeof b !== "object" || Array.isArray(a) || Array.isArray(b) || !hasIterator(a) || !hasIterator(b))
2653
+ return void 0;
2654
+ if (a.constructor !== b.constructor)
2655
+ return false;
2656
+ let length = aStack.length;
2657
+ while (length--) {
2658
+ if (aStack[length] === a)
2659
+ return bStack[length] === b;
2660
+ }
2661
+ aStack.push(a);
2662
+ bStack.push(b);
2663
+ const iterableEqualityWithStack = (a2, b2) => iterableEquality(a2, b2, [...aStack], [...bStack]);
2664
+ if (a.size !== void 0) {
2665
+ if (a.size !== b.size) {
2666
+ return false;
2667
+ } else if (isA("Set", a) || isImmutableUnorderedSet(a)) {
2668
+ let allFound = true;
2669
+ for (const aValue of a) {
2670
+ if (!b.has(aValue)) {
2671
+ let has = false;
2672
+ for (const bValue of b) {
2673
+ const isEqual = equals(aValue, bValue, [iterableEqualityWithStack]);
2674
+ if (isEqual === true)
2675
+ has = true;
2676
+ }
2677
+ if (has === false) {
2678
+ allFound = false;
2679
+ break;
2680
+ }
2681
+ }
2682
+ }
2683
+ aStack.pop();
2684
+ bStack.pop();
2685
+ return allFound;
2686
+ } else if (isA("Map", a) || isImmutableUnorderedKeyed(a)) {
2687
+ let allFound = true;
2688
+ for (const aEntry of a) {
2689
+ if (!b.has(aEntry[0]) || !equals(aEntry[1], b.get(aEntry[0]), [iterableEqualityWithStack])) {
2690
+ let has = false;
2691
+ for (const bEntry of b) {
2692
+ const matchedKey = equals(aEntry[0], bEntry[0], [
2693
+ iterableEqualityWithStack
2694
+ ]);
2695
+ let matchedValue = false;
2696
+ if (matchedKey === true) {
2697
+ matchedValue = equals(aEntry[1], bEntry[1], [
2698
+ iterableEqualityWithStack
2699
+ ]);
2700
+ }
2701
+ if (matchedValue === true)
2702
+ has = true;
2703
+ }
2704
+ if (has === false) {
2705
+ allFound = false;
2706
+ break;
2707
+ }
2708
+ }
2709
+ }
2710
+ aStack.pop();
2711
+ bStack.pop();
2712
+ return allFound;
2713
+ }
2714
+ }
2715
+ const bIterator = b[IteratorSymbol]();
2716
+ for (const aValue of a) {
2717
+ const nextB = bIterator.next();
2718
+ if (nextB.done || !equals(aValue, nextB.value, [iterableEqualityWithStack]))
2719
+ return false;
2720
+ }
2721
+ if (!bIterator.next().done)
2722
+ return false;
2723
+ aStack.pop();
2724
+ bStack.pop();
2725
+ return true;
2726
+ };
2727
+ const hasPropertyInObject = (object, key) => {
2728
+ const shouldTerminate = !object || typeof object !== "object" || object === Object.prototype;
2729
+ if (shouldTerminate)
2730
+ return false;
2731
+ return Object.prototype.hasOwnProperty.call(object, key) || hasPropertyInObject(Object.getPrototypeOf(object), key);
2732
+ };
2733
+ const isObjectWithKeys = (a) => isObject(a) && !(a instanceof Error) && !(a instanceof Array) && !(a instanceof Date);
2734
+ const subsetEquality = (object, subset) => {
2735
+ const subsetEqualityWithContext = (seenReferences = new WeakMap()) => (object2, subset2) => {
2736
+ if (!isObjectWithKeys(subset2))
2737
+ return void 0;
2738
+ return Object.keys(subset2).every((key) => {
2739
+ if (isObjectWithKeys(subset2[key])) {
2740
+ if (seenReferences.has(subset2[key]))
2741
+ return equals(object2[key], subset2[key], [iterableEquality]);
2742
+ seenReferences.set(subset2[key], true);
2743
+ }
2744
+ const result = object2 != null && hasPropertyInObject(object2, key) && equals(object2[key], subset2[key], [
2745
+ iterableEquality,
2746
+ subsetEqualityWithContext(seenReferences)
2747
+ ]);
2748
+ seenReferences.delete(subset2[key]);
2749
+ return result;
2750
+ });
2751
+ };
2752
+ return subsetEqualityWithContext()(object, subset);
2753
+ };
2754
+ const typeEquality = (a, b) => {
2755
+ if (a == null || b == null || a.constructor === b.constructor)
2756
+ return void 0;
2757
+ return false;
2758
+ };
2759
+ const arrayBufferEquality = (a, b) => {
2760
+ if (!(a instanceof ArrayBuffer) || !(b instanceof ArrayBuffer))
2761
+ return void 0;
2762
+ const dataViewA = new DataView(a);
2763
+ const dataViewB = new DataView(b);
2764
+ if (dataViewA.byteLength !== dataViewB.byteLength)
2765
+ return false;
2766
+ for (let i = 0; i < dataViewA.byteLength; i++) {
2767
+ if (dataViewA.getUint8(i) !== dataViewB.getUint8(i))
2768
+ return false;
2769
+ }
2770
+ return true;
2771
+ };
2772
+ const sparseArrayEquality = (a, b) => {
2773
+ if (!Array.isArray(a) || !Array.isArray(b))
2774
+ return void 0;
2775
+ const aKeys = Object.keys(a);
2776
+ const bKeys = Object.keys(b);
2777
+ return equals(a, b, [iterableEquality, typeEquality], true) && equals(aKeys, bKeys);
2778
+ };
2779
+
2780
+ const MATCHERS_OBJECT = Symbol.for("matchers-object");
2781
+ if (!Object.prototype.hasOwnProperty.call(global, MATCHERS_OBJECT)) {
2782
+ const defaultState = {
2783
+ assertionCalls: 0,
2784
+ isExpectingAssertions: false,
2785
+ isExpectingAssertionsError: null,
2786
+ expectedAssertionsNumber: null,
2787
+ expectedAssertionsNumberError: null
2788
+ };
2789
+ Object.defineProperty(global, MATCHERS_OBJECT, {
2790
+ value: {
2791
+ state: defaultState
2792
+ }
2793
+ });
2794
+ }
2795
+ const getState = () => global[MATCHERS_OBJECT].state;
2796
+ const setState = (state) => {
2797
+ Object.assign(global[MATCHERS_OBJECT].state, state);
2798
+ };
2799
+ const JestChaiExpect = (chai, utils) => {
2800
+ function def(name, fn) {
2801
+ const addMethod = (n) => {
2802
+ utils.addMethod(chai.Assertion.prototype, n, fn);
2803
+ };
2804
+ if (Array.isArray(name))
2805
+ name.forEach((n) => addMethod(n));
2806
+ else
2807
+ addMethod(name);
2808
+ }
2809
+ const chaiEqual = chai.Assertion.prototype.equal;
2810
+ def("chaiEqual", function(...args) {
2811
+ return chaiEqual.apply(this, args);
2812
+ });
2813
+ utils.overwriteMethod(chai.Assertion.prototype, "equal", (_super) => {
2814
+ return function(...args) {
2815
+ const expected = args[0];
2816
+ const actual = utils.flag(this, "object");
2817
+ if (hasAsymmetric(expected)) {
2818
+ this.assert(equals(actual, expected, void 0, true), "not match with #{act}", "should not match with #{act}", actual, expected);
2819
+ } else {
2820
+ _super.apply(this, args);
2821
+ }
2822
+ };
2823
+ });
2824
+ utils.overwriteMethod(chai.Assertion.prototype, "eql", (_super) => {
2825
+ return function(...args) {
2826
+ const expected = args[0];
2827
+ const actual = utils.flag(this, "object");
2828
+ if (hasAsymmetric(expected)) {
2829
+ this.assert(equals(actual, expected), "not match with #{exp}", "should not match with #{exp}", expected, actual);
2830
+ } else {
2831
+ _super.apply(this, args);
2832
+ }
2833
+ };
2834
+ });
2835
+ def("toEqual", function(expected) {
2836
+ return this.eql(expected);
2837
+ });
2838
+ def("toStrictEqual", function(expected) {
2839
+ const obj = utils.flag(this, "object");
2840
+ const equal = equals(obj, expected, [
2841
+ iterableEquality,
2842
+ typeEquality,
2843
+ sparseArrayEquality,
2844
+ arrayBufferEquality
2845
+ ], true);
2846
+ return this.assert(equal, "expected #{this} to strictly equal #{exp}", "expected #{this} to not strictly equal #{exp}", expected, obj);
2847
+ });
2848
+ def("toBe", function(expected) {
2849
+ return this.equal(expected);
2850
+ });
2851
+ def("toMatchObject", function(expected) {
2852
+ return this.containSubset(expected);
2853
+ });
2854
+ def("toMatch", function(expected) {
2855
+ if (typeof expected === "string")
2856
+ return this.include(expected);
2857
+ else
2858
+ return this.match(expected);
2859
+ });
2860
+ def("toContain", function(item) {
2861
+ return this.contain(item);
2862
+ });
2863
+ def("toContainEqual", function(expected) {
2864
+ const obj = utils.flag(this, "object");
2865
+ const index = Array.from(obj).findIndex((item) => {
2866
+ try {
2867
+ chai.assert.deepEqual(item, expected);
2868
+ } catch {
2869
+ return false;
2870
+ }
2871
+ return true;
2872
+ });
2873
+ this.assert(index !== -1, "expected #{this} to deep equally contain #{exp}", "expected #{this} to not deep equally contain #{exp}", expected);
2874
+ });
2875
+ def("toBeTruthy", function() {
2876
+ const obj = utils.flag(this, "object");
2877
+ this.assert(Boolean(obj), "expected #{this} to be truthy", "expected #{this} to not be truthy", obj);
2878
+ });
2879
+ def("toBeFalsy", function() {
2880
+ const obj = utils.flag(this, "object");
2881
+ this.assert(!obj, "expected #{this} to be falsy", "expected #{this} to not be falsy", obj);
2882
+ });
2883
+ def("toBeGreaterThan", function(expected) {
2884
+ return this.to.greaterThan(expected);
2885
+ });
2886
+ def("toBeGreaterThanOrEqual", function(expected) {
2887
+ return this.to.greaterThanOrEqual(expected);
2888
+ });
2889
+ def("toBeLessThan", function(expected) {
2890
+ return this.to.lessThan(expected);
2891
+ });
2892
+ def("toBeLessThanOrEqual", function(expected) {
2893
+ return this.to.lessThanOrEqual(expected);
2894
+ });
2895
+ def("toBeNaN", function() {
2896
+ return this.be.NaN;
2897
+ });
2898
+ def("toBeUndefined", function() {
2899
+ return this.be.undefined;
2900
+ });
2901
+ def("toBeNull", function() {
2902
+ return this.be.null;
2903
+ });
2904
+ def("toBeDefined", function() {
2905
+ const negate = utils.flag(this, "negate");
2906
+ utils.flag(this, "negate", false);
2907
+ if (negate)
2908
+ return this.be.undefined;
2909
+ return this.not.be.undefined;
2910
+ });
2911
+ def("toBeInstanceOf", function(obj) {
2912
+ return this.instanceOf(obj);
2913
+ });
2914
+ def("toHaveLength", function(length) {
2915
+ return this.have.length(length);
2916
+ });
2917
+ def("toHaveProperty", function(...args) {
2918
+ return this.have.deep.nested.property(...args);
2919
+ });
2920
+ def("toBeCloseTo", function(number, numDigits = 2) {
2921
+ utils.expectTypes(this, ["number"]);
2922
+ return this.closeTo(number, numDigits);
2923
+ });
2924
+ function isSpy(putativeSpy) {
2925
+ return typeof putativeSpy === "function" && "__isSpy" in putativeSpy && putativeSpy.__isSpy;
2926
+ }
2927
+ const assertIsMock = (assertion) => {
2928
+ if (!isSpy(assertion._obj))
2929
+ throw new TypeError(`${utils.inspect(assertion._obj)} is not a spy or a call to a spy!`);
2930
+ };
2931
+ const getSpy = (assertion) => {
2932
+ assertIsMock(assertion);
2933
+ return assertion._obj;
2934
+ };
2935
+ def(["toHaveBeenCalledTimes", "toBeCalledTimes"], function(number) {
2936
+ const spy = getSpy(this);
2937
+ const spyName = spy.getMockName();
2938
+ return this.assert(spy.callCount === number, `expected "${spyName}" to be called #{exp} times`, `expected "${spyName}" to not be called #{exp} times`, number, spy.callCount);
2939
+ });
2940
+ def("toHaveBeenCalledOnce", function() {
2941
+ const spy = getSpy(this);
2942
+ const spyName = spy.getMockName();
2943
+ return this.assert(spy.callCount === 1, `expected "${spyName}" to be called once`, `expected "${spyName}" to not be called once`, 1, spy.callCount);
2944
+ });
2945
+ def(["toHaveBeenCalled", "toBeCalled"], function() {
2946
+ const spy = getSpy(this);
2947
+ const spyName = spy.getMockName();
2948
+ return this.assert(spy.called, `expected "${spyName}" to be called at least once`, `expected "${spyName}" to not be called at all`, true, spy.called);
2949
+ });
2950
+ def(["toHaveBeenCalledWith", "toBeCalledWith"], function(...args) {
2951
+ const spy = getSpy(this);
2952
+ const spyName = spy.getMockName();
2953
+ const pass = spy.calls.some((callArg) => equals(callArg, args, [iterableEquality]));
2954
+ return this.assert(pass, `expected "${spyName}" to be called with arguments: #{exp}`, `expected "${spyName}" to not be called with arguments: #{exp}`, args, spy.calls);
2955
+ });
2956
+ const ordinalOf = (i) => {
2957
+ const j = i % 10;
2958
+ const k = i % 100;
2959
+ if (j === 1 && k !== 11)
2960
+ return `${i}st`;
2961
+ if (j === 2 && k !== 12)
2962
+ return `${i}nd`;
2963
+ if (j === 3 && k !== 13)
2964
+ return `${i}rd`;
2965
+ return `${i}th`;
2966
+ };
2967
+ def(["toHaveBeenNthCalledWith", "nthCalledWith"], function(times, ...args) {
2968
+ const spy = getSpy(this);
2969
+ const spyName = spy.getMockName();
2970
+ const nthCall = spy.calls[times - 1];
2971
+ this.assert(equals(nthCall, args, [iterableEquality]), `expected ${ordinalOf(times)} "${spyName}" call to have been called with #{exp}`, `expected ${ordinalOf(times)} "${spyName}" call to not have been called with #{exp}`, args, nthCall);
2972
+ });
2973
+ def(["toHaveBeenLastCalledWith", "lastCalledWith"], function(...args) {
2974
+ const spy = getSpy(this);
2975
+ const spyName = spy.getMockName();
2976
+ const lastCall = spy.calls[spy.calls.length - 1];
2977
+ this.assert(equals(lastCall, args, [iterableEquality]), `expected last "${spyName}" call to have been called with #{exp}`, `expected last "${spyName}" call to not have been called with #{exp}`, args, lastCall);
2978
+ });
2979
+ def(["toThrow", "toThrowError"], function(expected) {
2980
+ const negate = utils.flag(this, "negate");
2981
+ if (negate)
2982
+ this.not.to.throw(expected);
2983
+ else
2984
+ this.to.throw(expected);
2985
+ });
2986
+ def(["toHaveReturned", "toReturn"], function() {
2987
+ const spy = getSpy(this);
2988
+ const spyName = spy.getMockName();
2989
+ const calledAndNotThrew = spy.called && !spy.results.some(([type]) => type === "error");
2990
+ this.assert(calledAndNotThrew, `expected "${spyName}" to be successfully called at least once`, `expected "${spyName}" to not be successfully called`, calledAndNotThrew, !calledAndNotThrew);
2991
+ });
2992
+ def(["toHaveReturnedTimes", "toReturnTimes"], function(times) {
2993
+ const spy = getSpy(this);
2994
+ const spyName = spy.getMockName();
2995
+ const successfullReturns = spy.results.reduce((success, [type]) => type === "error" ? success : ++success, 0);
2996
+ this.assert(successfullReturns === times, `expected "${spyName}" to be successfully called ${times} times`, `expected "${spyName}" to not be successfully called ${times} times`, `expected number of returns: ${times}`, `received number of returns: ${successfullReturns}`);
2997
+ });
2998
+ def(["toHaveReturnedWith", "toReturnWith"], function(value) {
2999
+ const spy = getSpy(this);
3000
+ const spyName = spy.getMockName();
3001
+ const pass = spy.results.some(([type, result]) => type === "ok" && equals(value, result));
3002
+ this.assert(pass, `expected "${spyName}" to be successfully called with #{exp}`, `expected "${spyName}" to not be successfully called with #{exp}`, value);
3003
+ });
3004
+ def(["toHaveLastReturnedWith", "lastReturnedWith"], function(value) {
3005
+ const spy = getSpy(this);
3006
+ const spyName = spy.getMockName();
3007
+ const lastResult = spy.returns[spy.returns.length - 1];
3008
+ const pass = equals(lastResult, value);
3009
+ this.assert(pass, `expected last "${spyName}" call to return #{exp}`, `expected last "${spyName}" call to not return #{exp}`, value, lastResult);
3010
+ });
3011
+ def(["toHaveNthReturnedWith", "nthReturnedWith"], function(nthCall, value) {
3012
+ const spy = getSpy(this);
3013
+ const spyName = spy.getMockName();
3014
+ const isNot = utils.flag(this, "negate");
3015
+ const [callType, callResult] = spy.results[nthCall - 1];
3016
+ const ordinalCall = `${ordinalOf(nthCall)} call`;
3017
+ if (!isNot && callType === "error")
3018
+ chai.assert.fail(`expected ${ordinalCall} to return #{exp}, but instead it threw an error`);
3019
+ const nthCallReturn = equals(callResult, value);
3020
+ this.assert(nthCallReturn, `expected ${ordinalCall} "${spyName}" call to return #{exp}`, `expected ${ordinalCall} "${spyName}" call to not return #{exp}`, value, callResult);
3021
+ });
3022
+ utils.addProperty(chai.Assertion.prototype, "resolves", function() {
3023
+ utils.flag(this, "promise", "resolves");
3024
+ const obj = utils.flag(this, "object");
3025
+ const proxy = new Proxy(this, {
3026
+ get: (target, key, reciever) => {
3027
+ const result = Reflect.get(target, key, reciever);
3028
+ if (typeof result !== "function")
3029
+ return result instanceof chai.Assertion ? proxy : result;
3030
+ return async (...args) => {
3031
+ return obj.then((value) => {
3032
+ utils.flag(this, "object", value);
3033
+ return result.call(this, ...args);
3034
+ }, (err) => {
3035
+ throw new Error(`promise rejected ${err} instead of resolving`);
3036
+ });
3037
+ };
3038
+ }
3039
+ });
3040
+ return proxy;
3041
+ });
3042
+ utils.addProperty(chai.Assertion.prototype, "rejects", function() {
3043
+ utils.flag(this, "promise", "rejects");
3044
+ const obj = utils.flag(this, "object");
3045
+ const wrapper = typeof obj === "function" ? obj() : obj;
3046
+ const proxy = new Proxy(this, {
3047
+ get: (target, key, reciever) => {
3048
+ const result = Reflect.get(target, key, reciever);
3049
+ if (typeof result !== "function")
3050
+ return result instanceof chai.Assertion ? proxy : result;
3051
+ return async (...args) => {
3052
+ return wrapper.then((value) => {
3053
+ throw new Error(`promise resolved ${value} instead of rejecting`);
3054
+ }, (err) => {
3055
+ utils.flag(this, "object", err);
3056
+ return result.call(this, ...args);
3057
+ });
3058
+ };
3059
+ }
3060
+ });
3061
+ return proxy;
3062
+ });
3063
+ utils.addMethod(chai.expect, "assertions", function assertions(expected) {
3064
+ const error = new Error(`expected number of assertions to be ${expected}, but got ${getState().assertionCalls}`);
3065
+ if (Error.captureStackTrace)
3066
+ Error.captureStackTrace(error, assertions);
3067
+ setState({
3068
+ expectedAssertionsNumber: expected,
3069
+ expectedAssertionsNumberError: error
3070
+ });
3071
+ });
3072
+ utils.addMethod(chai.expect, "hasAssertions", function hasAssertions() {
3073
+ const error = new Error("expected any number of assertion, but got none");
3074
+ if (Error.captureStackTrace)
3075
+ Error.captureStackTrace(error, hasAssertions);
3076
+ setState({
3077
+ isExpectingAssertions: true,
3078
+ isExpectingAssertionsError: error
3079
+ });
3080
+ });
3081
+ utils.addMethod(chai.expect, "addSnapshotSerializer", addSerializer);
3082
+ };
3083
+
3084
+ var mockdate$1 = {exports: {}};
3085
+
3086
+ (function (module, exports) {
3087
+ (function (global, factory) {
3088
+ factory(exports) ;
3089
+ }(commonjsGlobal, (function (exports) {
3090
+ /*! *****************************************************************************
3091
+ Copyright (c) Microsoft Corporation.
3092
+
3093
+ Permission to use, copy, modify, and/or distribute this software for any
3094
+ purpose with or without fee is hereby granted.
3095
+
3096
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
3097
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
3098
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
3099
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
3100
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
3101
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
3102
+ PERFORMANCE OF THIS SOFTWARE.
3103
+ ***************************************************************************** */
3104
+ /* global Reflect, Promise */
3105
+
3106
+ var extendStatics = function(d, b) {
3107
+ extendStatics = Object.setPrototypeOf ||
3108
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
3109
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
3110
+ return extendStatics(d, b);
3111
+ };
3112
+
3113
+ function __extends(d, b) {
3114
+ if (typeof b !== "function" && b !== null)
3115
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
3116
+ extendStatics(d, b);
3117
+ function __() { this.constructor = d; }
3118
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
3119
+ }
3120
+
3121
+ var RealDate = Date;
3122
+ var now = null;
3123
+ var MockDate = /** @class */ (function (_super) {
3124
+ __extends(Date, _super);
3125
+ function Date(y, m, d, h, M, s, ms) {
3126
+ _super.call(this) || this;
3127
+ var date;
3128
+ switch (arguments.length) {
3129
+ case 0:
3130
+ if (now !== null) {
3131
+ date = new RealDate(now.valueOf());
3132
+ }
3133
+ else {
3134
+ date = new RealDate();
3135
+ }
3136
+ break;
3137
+ case 1:
3138
+ date = new RealDate(y);
3139
+ break;
3140
+ default:
3141
+ d = typeof d === 'undefined' ? 1 : d;
3142
+ h = h || 0;
3143
+ M = M || 0;
3144
+ s = s || 0;
3145
+ ms = ms || 0;
3146
+ date = new RealDate(y, m, d, h, M, s, ms);
3147
+ break;
3148
+ }
3149
+ return date;
3150
+ }
3151
+ return Date;
3152
+ }(RealDate));
3153
+ MockDate.prototype = RealDate.prototype;
3154
+ MockDate.UTC = RealDate.UTC;
3155
+ MockDate.now = function () {
3156
+ return new MockDate().valueOf();
3157
+ };
3158
+ MockDate.parse = function (dateString) {
3159
+ return RealDate.parse(dateString);
3160
+ };
3161
+ MockDate.toString = function () {
3162
+ return RealDate.toString();
3163
+ };
3164
+ function set(date) {
3165
+ var dateObj = new Date(date.valueOf());
3166
+ if (isNaN(dateObj.getTime())) {
3167
+ throw new TypeError('mockdate: The time set is an invalid date: ' + date);
3168
+ }
3169
+ // @ts-ignore
3170
+ Date = MockDate;
3171
+ now = dateObj.valueOf();
3172
+ }
3173
+ function reset() {
3174
+ Date = RealDate;
3175
+ }
3176
+ var mockdate = {
3177
+ set: set,
3178
+ reset: reset,
3179
+ };
3180
+
3181
+ exports.default = mockdate;
3182
+ exports.reset = reset;
3183
+ exports.set = set;
3184
+
3185
+ Object.defineProperty(exports, '__esModule', { value: true });
3186
+
3187
+ })));
3188
+ }(mockdate$1, mockdate$1.exports));
3189
+
3190
+ var mockdate = /*@__PURE__*/getDefaultExportFromCjs(mockdate$1.exports);
3191
+
3192
+ const originalSetTimeout = global.setTimeout;
3193
+ const originalSetInterval = global.setInterval;
3194
+ const originalClearTimeout = global.clearTimeout;
3195
+ const originalClearInterval = global.clearInterval;
3196
+ const MAX_LOOPS = 1e4;
3197
+ var QueueTaskType;
3198
+ (function(QueueTaskType2) {
3199
+ QueueTaskType2["Interval"] = "interval";
3200
+ QueueTaskType2["Timeout"] = "timeout";
3201
+ QueueTaskType2["Immediate"] = "immediate";
3202
+ })(QueueTaskType || (QueueTaskType = {}));
3203
+ const assertEvery = (assertions, message) => {
3204
+ if (assertions.some((a) => !a))
3205
+ throw new Error(message);
3206
+ };
3207
+ const assertMaxLoop = (times) => {
3208
+ if (times >= MAX_LOOPS)
3209
+ throw new Error("setTimeout/setInterval called 10 000 times. It's possible it stuck in an infinite loop.");
3210
+ };
3211
+ const getNodeTimeout = (id) => {
3212
+ const timer = {
3213
+ ref: () => timer,
3214
+ unref: () => timer,
3215
+ hasRef: () => true,
3216
+ refresh: () => timer,
3217
+ [Symbol.toPrimitive]: () => id
3218
+ };
3219
+ return timer;
3220
+ };
3221
+ class FakeTimers {
3222
+ constructor() {
3223
+ this._advancedTime = 0;
3224
+ this._nestedTime = {};
3225
+ this._scopeId = 0;
3226
+ this._isNested = false;
3227
+ this._isOnlyPending = false;
3228
+ this._spyid = 0;
3229
+ this._isMocked = false;
3230
+ this._tasksQueue = [];
3231
+ this._queueCount = 0;
3232
+ }
3233
+ useFakeTimers() {
3234
+ this._isMocked = true;
3235
+ this.reset();
3236
+ const spyFactory = (spyType, resultBuilder) => {
3237
+ return (cb, ms = 0) => {
3238
+ const id = ++this._spyid;
3239
+ const nestedTo = Object.entries(this._nestedTime).filter(([key]) => Number(key) <= this._scopeId);
3240
+ const nestedMs = nestedTo.reduce((total, [, ms2]) => total + ms2, ms);
3241
+ const call = { id, cb, ms, nestedMs, scopeId: this._scopeId };
3242
+ const task = { type: spyType, call, nested: this._isNested };
3243
+ this.pushTask(task);
3244
+ return resultBuilder(id, cb);
3245
+ };
3246
+ };
3247
+ this._setTimeout = spyOn(global, "setTimeout").mockImplementation(spyFactory(QueueTaskType.Timeout, getNodeTimeout));
3248
+ this._setInterval = spyOn(global, "setInterval").mockImplementation(spyFactory(QueueTaskType.Interval, getNodeTimeout));
3249
+ const clearTimerFactory = (spyType) => (id) => {
3250
+ if (id === void 0)
3251
+ return;
3252
+ const index = this._tasksQueue.findIndex(({ call, type }) => type === spyType && call.id === Number(id));
3253
+ if (index !== -1)
3254
+ this._tasksQueue.splice(index, 1);
3255
+ };
3256
+ this._clearTimeout = spyOn(global, "clearTimeout").mockImplementation(clearTimerFactory(QueueTaskType.Timeout));
3257
+ this._clearInterval = spyOn(global, "clearInterval").mockImplementation(clearTimerFactory(QueueTaskType.Interval));
3258
+ }
3259
+ useRealTimers() {
3260
+ this._isMocked = false;
3261
+ this.reset();
3262
+ global.setTimeout = originalSetTimeout;
3263
+ global.setInterval = originalSetInterval;
3264
+ global.clearTimeout = originalClearTimeout;
3265
+ global.clearInterval = originalClearInterval;
3266
+ }
3267
+ runOnlyPendingTimers() {
3268
+ this.assertMocked();
3269
+ this._isOnlyPending = true;
3270
+ this.runQueue();
3271
+ }
3272
+ runAllTimers() {
3273
+ this.assertMocked();
3274
+ this.runQueue();
3275
+ }
3276
+ advanceTimersByTime(ms) {
3277
+ this.assertMocked();
3278
+ this._advancedTime += ms;
3279
+ this.runQueue();
3280
+ }
3281
+ advanceTimersToNextTimer() {
3282
+ this.assertMocked();
3283
+ this.callQueueItem(0);
3284
+ }
3285
+ getTimerCount() {
3286
+ this.assertMocked();
3287
+ return this._tasksQueue.length;
3288
+ }
3289
+ reset() {
3290
+ var _a, _b, _c, _d;
3291
+ this._advancedTime = 0;
3292
+ this._nestedTime = {};
3293
+ this._isNested = false;
3294
+ this._isOnlyPending = false;
3295
+ this._spyid = 0;
3296
+ this._queueCount = 0;
3297
+ this._tasksQueue = [];
3298
+ (_a = this._clearInterval) == null ? void 0 : _a.mockRestore();
3299
+ (_b = this._clearTimeout) == null ? void 0 : _b.mockRestore();
3300
+ (_c = this._setInterval) == null ? void 0 : _c.mockRestore();
3301
+ (_d = this._setTimeout) == null ? void 0 : _d.mockRestore();
3302
+ }
3303
+ callQueueItem(index) {
3304
+ var _a, _b;
3305
+ const task = this._tasksQueue[index];
3306
+ if (!task)
3307
+ return;
3308
+ const { call, type } = task;
3309
+ this._scopeId = call.id;
3310
+ this._isNested = true;
3311
+ (_a = this._nestedTime)[_b = call.id] ?? (_a[_b] = 0);
3312
+ this._nestedTime[call.id] += call.ms;
3313
+ if (type === "timeout") {
3314
+ this.removeTask(index);
3315
+ } else if (type === "interval") {
3316
+ call.nestedMs += call.ms;
3317
+ const nestedMs = call.nestedMs;
3318
+ const closestTask = this._tasksQueue.findIndex(({ type: type2, call: call2 }) => type2 === "interval" && call2.nestedMs < nestedMs);
3319
+ if (closestTask !== -1 && closestTask !== index)
3320
+ this.ensureQueueOrder();
3321
+ }
3322
+ call.cb();
3323
+ this._queueCount++;
3324
+ }
3325
+ runQueue() {
3326
+ let index = 0;
3327
+ while (this._tasksQueue[index]) {
3328
+ assertMaxLoop(this._queueCount);
3329
+ const { call, nested } = this._tasksQueue[index];
3330
+ if (this._advancedTime && call.nestedMs > this._advancedTime)
3331
+ break;
3332
+ if (this._isOnlyPending && nested) {
3333
+ index++;
3334
+ continue;
3335
+ }
3336
+ this.callQueueItem(index);
3337
+ }
3338
+ }
3339
+ removeTask(index) {
3340
+ if (index === 0)
3341
+ this._tasksQueue.shift();
3342
+ else
3343
+ this._tasksQueue.splice(index, 1);
3344
+ }
3345
+ pushTask(task) {
3346
+ this._tasksQueue.push(task);
3347
+ this.ensureQueueOrder();
3348
+ }
3349
+ ensureQueueOrder() {
3350
+ this._tasksQueue.sort((t1, t2) => {
3351
+ const diff = t1.call.nestedMs - t2.call.nestedMs;
3352
+ if (diff === 0) {
3353
+ if (t1.type === QueueTaskType.Immediate && t2.type !== QueueTaskType.Immediate)
3354
+ return 1;
3355
+ return 0;
3356
+ }
3357
+ return diff;
3358
+ });
3359
+ }
3360
+ assertMocked() {
3361
+ assertEvery([
3362
+ this._isMocked,
3363
+ this._setTimeout,
3364
+ this._setInterval,
3365
+ this._clearTimeout,
3366
+ this._clearInterval
3367
+ ], 'timers are not mocked. try calling "vitest.useFakeTimers()" first');
3368
+ }
3369
+ }
3370
+
3371
+ class VitestUtils {
3372
+ constructor() {
3373
+ this.spyOn = spyOn;
3374
+ this.fn = fn;
3375
+ this._timers = new FakeTimers();
3376
+ this._mockedDate = null;
3377
+ }
3378
+ useFakeTimers() {
3379
+ return this._timers.useFakeTimers();
3380
+ }
3381
+ useRealTimers() {
3382
+ return this._timers.useRealTimers();
3383
+ }
3384
+ runOnlyPendingTimers() {
3385
+ return this._timers.runOnlyPendingTimers();
3386
+ }
3387
+ runAllTimers() {
3388
+ return this._timers.runAllTimers();
3389
+ }
3390
+ advanceTimersByTime(ms) {
3391
+ return this._timers.advanceTimersByTime(ms);
3392
+ }
3393
+ advanceTimersToNextTimer() {
3394
+ return this._timers.advanceTimersToNextTimer();
3395
+ }
3396
+ getTimerCount() {
3397
+ return this._timers.getTimerCount();
3398
+ }
3399
+ mockCurrentDate(date) {
3400
+ this._mockedDate = date;
3401
+ mockdate.set(date);
3402
+ }
3403
+ restoreCurrentDate() {
3404
+ this._mockedDate = null;
3405
+ mockdate.reset();
3406
+ }
3407
+ getMockedDate() {
3408
+ return this._mockedDate;
3409
+ }
3410
+ mock(path, factory) {
3411
+ }
3412
+ unmock(path) {
3413
+ }
3414
+ async importActual(path) {
3415
+ return {};
3416
+ }
3417
+ async importMock(path) {
3418
+ return {};
3419
+ }
3420
+ mocked(item, _deep = false) {
3421
+ return item;
3422
+ }
3423
+ isMockFunction(fn2) {
3424
+ return typeof fn2 === "function" && "__isSpy" in fn2 && fn2.__isSpy;
3425
+ }
3426
+ clearAllMocks() {
3427
+ __vitest__clearMocks__({ clearMocks: true });
3428
+ spies.forEach((spy) => spy.mockClear());
3429
+ return this;
3430
+ }
3431
+ resetAllMocks() {
3432
+ __vitest__clearMocks__({ mockReset: true });
3433
+ spies.forEach((spy) => spy.mockReset());
3434
+ return this;
3435
+ }
3436
+ restoreAllMocks() {
3437
+ __vitest__clearMocks__({ restoreMocks: true });
3438
+ spies.forEach((spy) => spy.mockRestore());
3439
+ return this;
3440
+ }
3441
+ }
3442
+ const vitest = new VitestUtils();
3443
+ const vi = vitest;
3444
+
3445
+ export { JestChaiExpect as J, getDefaultHookTimeout as a, getState as b, suite as c, describe as d, vi as e, format_1 as f, getCurrentSuite as g, getSerializers as h, it as i, equals as j, iterableEquality as k, subsetEquality as l, isA as m, clearContext as n, defaultSuite as o, plugins_1 as p, setHooks as q, getHooks as r, setState as s, test$7 as t, context as u, vitest as v, withTimeout as w, getFn as x };