@spscommerce/utils 6.13.1 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.es.js CHANGED
@@ -1,180 +1,125 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
- var __hasOwnProp = Object.prototype.hasOwnProperty;
4
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
- var __spreadValues = (a, b) => {
7
- for (var prop in b || (b = {}))
8
- if (__hasOwnProp.call(b, prop))
9
- __defNormalProp(a, prop, b[prop]);
10
- if (__getOwnPropSymbols)
11
- for (var prop of __getOwnPropSymbols(b)) {
12
- if (__propIsEnum.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
1
+ function Q(e, t) {
2
+ for (var n = 0; n < t.length; n++) {
3
+ const r = t[n];
4
+ if (typeof r != "string" && !Array.isArray(r)) {
5
+ for (const a in r)
6
+ if (a !== "default" && !(a in e)) {
7
+ const i = Object.getOwnPropertyDescriptor(r, a);
8
+ i && Object.defineProperty(e, a, i.get ? i : {
9
+ enumerable: !0,
10
+ get: () => r[a]
11
+ });
12
+ }
14
13
  }
15
- return a;
16
- };
17
- function _mergeNamespaces(n, m) {
18
- m.forEach(function(e) {
19
- Object.keys(e).forEach(function(k) {
20
- if (k !== "default" && !(k in n)) {
21
- var d = Object.getOwnPropertyDescriptor(e, k);
22
- Object.defineProperty(n, k, d.get ? d : {
23
- enumerable: true,
24
- get: function() {
25
- return e[k];
26
- }
27
- });
28
- }
29
- });
30
- });
31
- return Object.freeze(n);
32
- }
33
- function flatten(arg) {
34
- if (!Array.isArray(arg)) {
35
- return arg;
36
14
  }
37
- return arg.reduce((acc, x) => acc.concat(flatten(x)), []);
15
+ return Object.freeze(Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }));
38
16
  }
39
- function isSubset(candidate, array) {
40
- const set = new Set(array);
41
- for (const member of candidate) {
42
- if (!set.has(member)) {
43
- return false;
44
- }
45
- }
46
- return true;
17
+ function Ne(e) {
18
+ return Array.isArray(e) ? e.reduce((t, n) => t.concat(Ne(n)), []) : e;
47
19
  }
48
- function resetDebouncedFn() {
49
- this.pending = false;
50
- if (typeof this.id === "number") {
51
- clearTimeout(this.id);
52
- delete this.id;
53
- return true;
54
- }
55
- return false;
20
+ function st(e, t) {
21
+ const n = new Set(t);
22
+ for (const r of e)
23
+ if (!n.has(r))
24
+ return !1;
25
+ return !0;
26
+ }
27
+ function Le() {
28
+ return this.pending = !1, typeof this.id < "u" ? (clearTimeout(this.id), delete this.id, !0) : !1;
56
29
  }
57
- function debounce(functionToDebounce, milliseconds, thisArg) {
58
- const debFn = function debouncedFn(...args) {
59
- return new Promise((resolve, reject) => {
60
- debFn.reset();
61
- debFn.pending = true;
62
- function executor() {
63
- void (async () => {
30
+ function Be(e, t, n) {
31
+ const r = function(...i) {
32
+ return new Promise((c, m) => {
33
+ r.reset(), r.pending = !0;
34
+ function h() {
35
+ (async () => {
64
36
  try {
65
- let output = functionToDebounce.apply(thisArg || this, args);
66
- if (output instanceof Promise) {
67
- output = await output;
68
- }
69
- resolve(output);
70
- } catch (err) {
71
- reject(err);
37
+ let u = e.apply(n || this, i);
38
+ u instanceof Promise && (u = await u), c(u);
39
+ } catch (u) {
40
+ m(u);
72
41
  } finally {
73
- debFn.reset();
42
+ r.reset();
74
43
  }
75
44
  })();
76
45
  }
77
- debFn.id = window.setTimeout(executor, milliseconds);
46
+ r.id = window.setTimeout(h, t);
78
47
  });
79
48
  };
80
- debFn.reset = resetDebouncedFn.bind(debFn);
81
- return debFn;
49
+ return r.reset = Le.bind(r), r;
82
50
  }
83
- function resetLockedFn() {
84
- this.pending = false;
85
- if (typeof this.id === "number") {
86
- window.cancelAnimationFrame(this.id);
87
- delete this.id;
88
- return true;
89
- }
90
- return false;
51
+ function _e() {
52
+ return this.pending = !1, typeof this.id == "number" ? (window.cancelAnimationFrame(this.id), delete this.id, !0) : !1;
91
53
  }
92
- function lockToAnimationFrames(functionToLock, thisArg) {
93
- const lockFn = function lockedFn(...args) {
94
- if (lockFn.pending) {
95
- lockFn.reset();
96
- }
97
- lockFn.id = window.requestAnimationFrame(() => {
98
- if (functionToLock) {
99
- functionToLock.apply(thisArg || this, args);
100
- }
101
- lockFn.reset();
102
- });
103
- lockFn.pending = true;
54
+ function qe(e, t) {
55
+ const n = function(...a) {
56
+ n.pending && n.reset(), n.id = window.requestAnimationFrame(() => {
57
+ e && e.apply(t || this, a), n.reset();
58
+ }), n.pending = !0;
104
59
  };
105
- lockFn.pending = false;
106
- lockFn.reset = resetLockedFn.bind(lockFn);
107
- return lockFn;
108
- }
109
- function onNextTick(fn, thisArg) {
110
- const boundFn = thisArg ? fn.bind(thisArg) : fn;
111
- setTimeout(boundFn, 0);
112
- }
113
- const Op = {
114
- add: (a, b) => a + b,
115
- and: (a, b) => a && b,
116
- band: (a, b) => a & b,
117
- bor: (a, b) => a | b,
118
- bxor: (a, b) => a ^ b,
119
- bnot: (a) => ~a,
120
- decr: (a) => a - 1,
121
- div: (a, b) => a / b,
122
- eq: (a, b) => a === b,
123
- exp: (a, b) => a ** b,
124
- gt: (a, b) => a > b,
125
- gte: (a, b) => a >= b,
126
- incr: (a) => a + 1,
127
- lshift: (a, b) => a << b,
128
- lt: (a, b) => a < b,
129
- lte: (a, b) => a <= b,
130
- mul: (a, b) => a * b,
131
- neg: (a) => -a,
132
- neq: (a, b) => a !== b,
133
- not: (a) => !a,
134
- or: (a, b) => a || b,
135
- rem: (a, b) => a % b,
136
- rshift: (a, b) => a >> b,
137
- rshift_zf: (a, b) => a >>> b,
138
- sub: (a, b) => a - b,
139
- xor: (a, b) => (a || b) && !(a && b)
60
+ return n.pending = !1, n.reset = _e.bind(n), n;
61
+ }
62
+ function mt(e, t) {
63
+ const n = t ? e.bind(t) : e;
64
+ setTimeout(n, 0);
65
+ }
66
+ const z = {
67
+ // eslint-disable-next-line @typescript-eslint/restrict-plus-operands
68
+ add: (e, t) => e + t,
69
+ and: (e, t) => e && t,
70
+ band: (e, t) => e & t,
71
+ bor: (e, t) => e | t,
72
+ bxor: (e, t) => e ^ t,
73
+ bnot: (e) => ~e,
74
+ decr: (e) => e - 1,
75
+ div: (e, t) => e / t,
76
+ eq: (e, t) => e === t,
77
+ exp: (e, t) => e ** t,
78
+ gt: (e, t) => e > t,
79
+ gte: (e, t) => e >= t,
80
+ incr: (e) => e + 1,
81
+ lshift: (e, t) => e << t,
82
+ lt: (e, t) => e < t,
83
+ lte: (e, t) => e <= t,
84
+ mul: (e, t) => e * t,
85
+ neg: (e) => -e,
86
+ neq: (e, t) => e !== t,
87
+ not: (e) => !e,
88
+ or: (e, t) => e || t,
89
+ rem: (e, t) => e % t,
90
+ rshift: (e, t) => e >> t,
91
+ rshift_zf: (e, t) => e >>> t,
92
+ sub: (e, t) => e - t,
93
+ xor: (e, t) => (e || t) && !(e && t)
140
94
  };
141
- function range(start, end) {
142
- if (!Number.isInteger(start)) {
95
+ function ut(e, t) {
96
+ if (!Number.isInteger(e))
143
97
  throw new Error("start must be an integer");
144
- }
145
- if (!Number.isInteger(end)) {
98
+ if (!Number.isInteger(t))
146
99
  throw new Error("end must be an integer");
147
- }
148
- return new Array(Math.abs(end - start) + 1).fill(start).map(start > end ? Op.sub : Op.add);
149
- }
150
- class CustomEvent {
151
- constructor(eventName, initDict = {}) {
152
- let event;
153
- if (typeof Event === "function") {
154
- event = new Event(eventName, initDict);
155
- } else {
156
- event = document.createEvent("Event");
157
- event.initEvent(eventName, initDict.bubbles, initDict.cancelable);
158
- for (const key of Object.keys(initDict)) {
159
- if (key !== "bubbles" && key !== "cancelable") {
160
- event[key] = initDict[key];
161
- }
162
- }
100
+ return new Array(Math.abs(t - e) + 1).fill(e).map(e > t ? z.sub : z.add);
101
+ }
102
+ class lt {
103
+ constructor(t, n = {}) {
104
+ let r;
105
+ if (typeof Event == "function")
106
+ r = new Event(t, n);
107
+ else {
108
+ r = document.createEvent("Event"), r.initEvent(t, n.bubbles, n.cancelable);
109
+ for (const i of Object.keys(n))
110
+ i !== "bubbles" && i !== "cancelable" && (r[i] = n[i]);
163
111
  }
164
- Object.setPrototypeOf(this, event);
165
- const descriptors = Object.getOwnPropertyDescriptors(Event.prototype);
166
- for (const propKey of Object.keys(descriptors)) {
167
- const descriptor = descriptors[propKey];
168
- for (const key of Object.keys(descriptor)) {
169
- if (typeof descriptor[key] === "function") {
170
- descriptor[key] = descriptor[key].bind(event);
171
- }
172
- }
112
+ Object.setPrototypeOf(this, r);
113
+ const a = Object.getOwnPropertyDescriptors(Event.prototype);
114
+ for (const i of Object.keys(a)) {
115
+ const c = a[i];
116
+ for (const m of Object.keys(c))
117
+ typeof c[m] == "function" && (c[m] = c[m].bind(r));
173
118
  }
174
- Object.defineProperties(this, descriptors);
119
+ Object.defineProperties(this, a);
175
120
  }
176
121
  }
177
- const EDI_DOCUMENT_TYPE = Object.freeze({
122
+ const ft = Object.freeze({
178
123
  100: { name: "Insurance Plan Description" },
179
124
  101: { name: "Name and Address Lists" },
180
125
  104: { name: "Air Shipment Information" },
@@ -475,550 +420,459 @@ const EDI_DOCUMENT_TYPE = Object.freeze({
475
420
  998: { name: "Set Cancellation" },
476
421
  999: { name: "Implementation Acknowledgment" }
477
422
  });
478
- function castToNumber() {
479
- return (target, key) => {
480
- const internalKey = `_${String(key)}`;
481
- Object.defineProperties(target, {
482
- [internalKey]: {
483
- enumerable: false,
484
- configurable: true,
485
- writable: true,
423
+ function dt() {
424
+ return (e, t) => {
425
+ const n = `_${String(t)}`;
426
+ Object.defineProperties(e, {
427
+ [n]: {
428
+ enumerable: !1,
429
+ configurable: !0,
430
+ writable: !0,
486
431
  value: void 0
487
432
  },
488
- [key]: {
489
- enumerable: true,
490
- configurable: true,
433
+ [t]: {
434
+ enumerable: !0,
435
+ configurable: !0,
491
436
  get() {
492
- return this[internalKey];
437
+ return this[n];
493
438
  },
494
- set(newValue) {
495
- this[internalKey] = Number(newValue);
439
+ set(r) {
440
+ this[n] = Number(r);
496
441
  }
497
442
  }
498
443
  });
499
444
  };
500
445
  }
501
- function debounced(ms) {
502
- return (target, propertyKey, descriptor) => {
503
- const originalDescriptorCopy = __spreadValues({}, descriptor);
504
- originalDescriptorCopy.get = function get() {
505
- const newDescriptorWithDebounced = __spreadValues({}, originalDescriptorCopy);
506
- newDescriptorWithDebounced.value = debounce(originalDescriptorCopy.value, ms, this);
507
- Object.defineProperty(this, propertyKey, newDescriptorWithDebounced);
508
- return newDescriptorWithDebounced.value;
509
- };
510
- originalDescriptorCopy.configurable = true;
511
- delete originalDescriptorCopy.writable;
512
- delete originalDescriptorCopy.value;
513
- return originalDescriptorCopy;
514
- };
515
- }
516
- function lockedToAnimationFrames(target, propertyKey, descriptor) {
517
- const originalDescriptorCopy = __spreadValues({}, descriptor);
518
- descriptor.get = function get() {
519
- const newDescriptor = __spreadValues({}, originalDescriptorCopy);
520
- newDescriptor.value = lockToAnimationFrames(originalDescriptorCopy.value, this);
521
- Object.defineProperty(this, propertyKey, newDescriptor);
522
- return newDescriptor.value;
523
- };
524
- descriptor.configurable = true;
525
- delete descriptor.writable;
526
- delete descriptor.value;
527
- return descriptor;
528
- }
529
- function simpleMetadataDecoratorApplicator(metadata, defaults, target, key, descriptor) {
530
- const updatedDescriptor = descriptor || Object.getOwnPropertyDescriptor(target, key);
531
- const getter = updatedDescriptor.get;
532
- const { value } = updatedDescriptor;
533
- updatedDescriptor.get = function get() {
534
- const self2 = this;
535
- const fn = value || getter.call(this);
536
- const boundFn = fn.bind(this);
537
- const updatedMetadata = __spreadValues(__spreadValues({}, defaults), metadata);
538
- for (const prop of Object.keys(defaults)) {
539
- if (typeof metadata[prop] === "function") {
540
- Object.defineProperty(boundFn, prop, {
541
- get() {
542
- return updatedMetadata[prop](self2);
543
- }
544
- });
545
- } else {
546
- boundFn[prop] = updatedMetadata[prop];
547
- }
548
- }
549
- Object.defineProperty(this, key, {
550
- writable: true,
551
- configurable: true,
552
- enumerable: updatedDescriptor.enumerable,
553
- value: boundFn
554
- });
555
- return boundFn;
556
- };
557
- delete updatedDescriptor.value;
558
- delete updatedDescriptor.writable;
559
- return updatedDescriptor;
560
- }
561
- function tickDelay(target, propertyKey, descriptor) {
562
- const originalDescriptorCopy = __spreadValues({}, descriptor);
563
- originalDescriptorCopy.get = function get() {
564
- const newDescriptor = __spreadValues({}, originalDescriptorCopy);
565
- const boundFn = originalDescriptorCopy.value.bind(this);
566
- newDescriptor.value = () => setTimeout(boundFn, 0);
567
- Object.defineProperty(this, propertyKey, newDescriptor);
568
- return newDescriptor.value;
446
+ function pt(e) {
447
+ return (t, n, r) => {
448
+ const a = { ...r };
449
+ return a.get = function() {
450
+ const c = { ...a };
451
+ return c.value = Be(a.value, e, this), Object.defineProperty(this, n, c), c.value;
452
+ }, a.configurable = !0, delete a.writable, delete a.value, a;
569
453
  };
570
- originalDescriptorCopy.configurable = true;
571
- delete originalDescriptorCopy.writable;
572
- delete originalDescriptorCopy.value;
573
- return originalDescriptorCopy;
574
454
  }
575
- function constrain(n, range2) {
576
- if (!n || n < range2[0]) {
577
- return range2[0];
578
- }
579
- if (n > range2[1]) {
580
- return range2[1];
581
- }
582
- return n;
583
- }
584
- function decimalRound(num, decimalPlaces = 0) {
585
- const integralAndFractionalSplit = String(num).split(".");
586
- const allDecimalPlaces = integralAndFractionalSplit.length > 1 ? integralAndFractionalSplit[1].length : 0;
587
- let roundedNum = num;
588
- for (let i = allDecimalPlaces - 1; i >= decimalPlaces; i -= 1) {
589
- roundedNum = Number(`${Math.round(Number(`${roundedNum}e${i}`))}e-${i}`);
590
- }
591
- return roundedNum;
455
+ function gt(e, t, n) {
456
+ const r = { ...n };
457
+ return n.get = function() {
458
+ const i = { ...r };
459
+ return i.value = qe(r.value, this), Object.defineProperty(this, t, i), i.value;
460
+ }, n.configurable = !0, delete n.writable, delete n.value, n;
461
+ }
462
+ function yt(e, t, n, r, a) {
463
+ const i = a || Object.getOwnPropertyDescriptor(n, r), c = i.get, { value: m } = i;
464
+ return i.get = function() {
465
+ const u = this, d = (m || c.call(this)).bind(this), S = { ...t, ...e };
466
+ for (const p of Object.keys(t))
467
+ typeof e[p] == "function" ? Object.defineProperty(d, p, {
468
+ get() {
469
+ return S[p](u);
470
+ }
471
+ }) : d[p] = S[p];
472
+ return Object.defineProperty(this, r, {
473
+ writable: !0,
474
+ configurable: !0,
475
+ enumerable: i.enumerable,
476
+ value: d
477
+ }), d;
478
+ }, delete i.value, delete i.writable, i;
479
+ }
480
+ function Rt(e, t, n) {
481
+ const r = { ...n };
482
+ return r.get = function() {
483
+ const i = { ...r }, c = r.value.bind(this);
484
+ return i.value = () => setTimeout(c, 0), Object.defineProperty(this, t, i), i.value;
485
+ }, r.configurable = !0, delete r.writable, delete r.value, r;
486
+ }
487
+ function ht(e, t) {
488
+ return !e || e < t[0] ? t[0] : e > t[1] ? t[1] : e;
489
+ }
490
+ function xe(e, t = 0) {
491
+ const n = String(e).split("."), r = n.length > 1 ? n[1].length : 0;
492
+ let a = e;
493
+ for (let i = r - 1; i >= t; i -= 1)
494
+ a = +`${Math.round(+`${a}e${i}`)}e-${i}`;
495
+ return a;
592
496
  }
593
- function toFileSizeString(n, precision = 2) {
594
- if (n > Number.MAX_SAFE_INTEGER) {
595
- throw new Error("Number is greater than MAX_SAFE_INTEGER; toFileSizeString does not support orders of magnitude higher than petabytes for this reason until BigInt achieves broad browser support.");
596
- }
597
- const magnitude = Math.min(Math.floor(Math.log(n) / Math.log(1024)), 5);
598
- const unit = [
497
+ function bt(e, t = 2) {
498
+ if (e > Number.MAX_SAFE_INTEGER)
499
+ throw new Error(
500
+ "Number is greater than MAX_SAFE_INTEGER; toFileSizeString does not support orders of magnitude higher than petabytes for this reason until BigInt achieves broad browser support."
501
+ );
502
+ const n = Math.min(Math.floor(Math.log(e) / Math.log(1024)), 5), r = [
599
503
  "B",
600
504
  "KB",
601
505
  "MB",
602
506
  "GB",
603
507
  "TB",
604
508
  "PB"
605
- ][magnitude];
606
- const decimalPlaces = magnitude ? precision : 0;
607
- return decimalRound(n / 1024 ** magnitude, decimalPlaces).toFixed(decimalPlaces) + unit;
608
- }
609
- function crumblePath(path) {
610
- return typeof path === "string" ? path.match(/[^.[\]]+/g) || [] : [].concat(path);
611
- }
612
- function copyProperty(propName, sourceObject, destObject) {
613
- Object.defineProperty(destObject, propName, Object.getOwnPropertyDescriptor(sourceObject, propName));
614
- }
615
- var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
616
- var objectTag = "[object Object]";
617
- function isHostObject(value) {
618
- var result = false;
619
- if (value != null && typeof value.toString != "function") {
509
+ ][n], a = n ? t : 0;
510
+ return xe(e / 1024 ** n, a).toFixed(a) + r;
511
+ }
512
+ function k(e) {
513
+ return typeof e == "string" ? e.match(/[^.[\]]+/g) || [] : [].concat(e);
514
+ }
515
+ function Ve(e, t, n) {
516
+ Object.defineProperty(
517
+ n,
518
+ e,
519
+ Object.getOwnPropertyDescriptor(t, e)
520
+ );
521
+ }
522
+ var I = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
523
+ function F(e) {
524
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
525
+ }
526
+ var Ge = "[object Object]";
527
+ function $e(e) {
528
+ var t = !1;
529
+ if (e != null && typeof e.toString != "function")
620
530
  try {
621
- result = !!(value + "");
622
- } catch (e) {
531
+ t = !!(e + "");
532
+ } catch {
623
533
  }
624
- }
625
- return result;
534
+ return t;
626
535
  }
627
- function overArg(func, transform) {
628
- return function(arg) {
629
- return func(transform(arg));
536
+ function Ue(e, t) {
537
+ return function(n) {
538
+ return e(t(n));
630
539
  };
631
540
  }
632
- var funcProto = Function.prototype, objectProto = Object.prototype;
633
- var funcToString = funcProto.toString;
634
- var hasOwnProperty = objectProto.hasOwnProperty;
635
- var objectCtorString = funcToString.call(Object);
636
- var objectToString = objectProto.toString;
637
- var getPrototype = overArg(Object.getPrototypeOf, Object);
638
- function isObjectLike(value) {
639
- return !!value && typeof value == "object";
640
- }
641
- function isPlainObject(value) {
642
- if (!isObjectLike(value) || objectToString.call(value) != objectTag || isHostObject(value)) {
643
- return false;
644
- }
645
- var proto = getPrototype(value);
646
- if (proto === null) {
647
- return true;
648
- }
649
- var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor;
650
- return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
651
- }
652
- var lodash_isplainobject = isPlainObject;
653
- function deepFreeze(obj) {
654
- Object.freeze(obj);
655
- for (const key of Object.keys(obj)) {
656
- const val = obj[key];
657
- if (lodash_isplainobject(val) || Array.isArray(val)) {
658
- deepFreeze(val);
659
- }
660
- }
661
- }
662
- var DiffChange;
663
- (function(DiffChange2) {
664
- DiffChange2[DiffChange2["ADDITION"] = 0] = "ADDITION";
665
- DiffChange2[DiffChange2["DELETION"] = 1] = "DELETION";
666
- DiffChange2[DiffChange2["ALTERATION"] = 2] = "ALTERATION";
667
- })(DiffChange || (DiffChange = {}));
668
- function diff(o1, o2, parentPath = []) {
669
- let d = [];
670
- for (const key of new Set([...Object.keys(o1), ...Object.keys(o2)])) {
671
- const o1HasKey = Object.prototype.hasOwnProperty.call(o1, key);
672
- const o2HasKey = Object.prototype.hasOwnProperty.call(o2, key);
673
- if (o1HasKey && !o2HasKey) {
674
- d.push({
675
- type: 1,
676
- key,
677
- parentPath,
678
- objects: [o1, o2]
679
- });
680
- } else if (!o1HasKey && o2HasKey) {
681
- d.push({
682
- type: 0,
683
- key,
684
- parentPath,
685
- objects: [o1, o2]
686
- });
687
- } else if (lodash_isplainobject(o1[key]) && lodash_isplainobject(o2[key]) || Array.isArray(o1[key]) && Array.isArray(o2[key])) {
688
- d = d.concat(diff(o1[key], o2[key], [...parentPath, key]));
689
- } else if (o1[key] !== o2[key]) {
690
- d.push({
691
- type: 2,
692
- key,
693
- parentPath,
694
- objects: [o1, o2]
695
- });
696
- }
541
+ var We = Function.prototype, Y = Object.prototype, Z = We.toString, ze = Y.hasOwnProperty, He = Z.call(Object), Ke = Y.toString, Xe = Ue(Object.getPrototypeOf, Object);
542
+ function Je(e) {
543
+ return !!e && typeof e == "object";
544
+ }
545
+ function Qe(e) {
546
+ if (!Je(e) || Ke.call(e) != Ge || $e(e))
547
+ return !1;
548
+ var t = Xe(e);
549
+ if (t === null)
550
+ return !0;
551
+ var n = ze.call(t, "constructor") && t.constructor;
552
+ return typeof n == "function" && n instanceof n && Z.call(n) == He;
553
+ }
554
+ var Ye = Qe;
555
+ const f = /* @__PURE__ */ F(Ye);
556
+ function Ze(e) {
557
+ Object.freeze(e);
558
+ for (const t of Object.keys(e)) {
559
+ const n = e[t];
560
+ (f(n) || Array.isArray(n)) && Ze(n);
561
+ }
562
+ }
563
+ var et = /* @__PURE__ */ ((e) => (e[e.ADDITION = 0] = "ADDITION", e[e.DELETION = 1] = "DELETION", e[e.ALTERATION = 2] = "ALTERATION", e))(et || {});
564
+ function tt(e, t, n = []) {
565
+ let r = [];
566
+ for (const a of /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])) {
567
+ const i = Object.prototype.hasOwnProperty.call(e, a), c = Object.prototype.hasOwnProperty.call(t, a);
568
+ i && !c ? r.push({
569
+ type: 1,
570
+ key: a,
571
+ parentPath: n,
572
+ objects: [e, t]
573
+ }) : !i && c ? r.push({
574
+ type: 0,
575
+ key: a,
576
+ parentPath: n,
577
+ objects: [e, t]
578
+ }) : f(e[a]) && f(t[a]) || Array.isArray(e[a]) && Array.isArray(t[a]) ? r = r.concat(
579
+ tt(
580
+ e[a],
581
+ t[a],
582
+ [...n, a]
583
+ )
584
+ ) : e[a] !== t[a] && r.push({
585
+ type: 2,
586
+ key: a,
587
+ parentPath: n,
588
+ objects: [e, t]
589
+ });
697
590
  }
698
- return d;
591
+ return r;
699
592
  }
700
- function forEachEntryDeep(object, fn) {
701
- for (const key of Object.keys(object)) {
702
- const value = object[key];
703
- if (lodash_isplainobject(value) || Array.isArray(value)) {
704
- forEachEntryDeep(value, fn);
705
- } else {
706
- fn(key, value, object);
707
- }
593
+ function nt(e, t) {
594
+ for (const n of Object.keys(e)) {
595
+ const r = e[n];
596
+ f(r) || Array.isArray(r) ? nt(r, t) : t(n, r, e);
708
597
  }
709
598
  }
710
- function forEachNestedObject(object, fn, path = []) {
711
- fn(path, object);
712
- for (const key of Object.keys(object)) {
713
- const value = object[key];
714
- if (lodash_isplainobject(value) || Array.isArray(value)) {
715
- const newPath = path.concat(key);
716
- forEachNestedObject(value, fn, newPath);
599
+ function rt(e, t, n = []) {
600
+ t(n, e);
601
+ for (const r of Object.keys(e)) {
602
+ const a = e[r];
603
+ if (f(a) || Array.isArray(a)) {
604
+ const i = n.concat(r);
605
+ rt(a, t, i);
717
606
  }
718
607
  }
719
608
  }
720
- function isNil$1(value) {
721
- return value == null;
609
+ function at(e) {
610
+ return e == null;
722
611
  }
723
- var lodash_isnil = isNil$1;
724
- var isNilImport = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ _mergeNamespaces({
612
+ var ee = at;
613
+ const te = /* @__PURE__ */ F(ee), ot = /* @__PURE__ */ Q({
725
614
  __proto__: null,
726
- [Symbol.toStringTag]: "Module",
727
- "default": lodash_isnil
728
- }, [lodash_isnil]));
729
- var lodash_isempty$1 = { exports: {} };
730
- (function(module, exports) {
731
- var MAX_SAFE_INTEGER = 9007199254740991;
732
- var argsTag = "[object Arguments]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", objectTag2 = "[object Object]", promiseTag = "[object Promise]", setTag = "[object Set]", weakMapTag = "[object WeakMap]";
733
- var dataViewTag = "[object DataView]";
734
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
735
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
736
- var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
737
- var freeSelf = typeof self == "object" && self && self.Object === Object && self;
738
- var root = freeGlobal || freeSelf || Function("return this")();
739
- var freeExports = exports && !exports.nodeType && exports;
740
- var freeModule = freeExports && true && module && !module.nodeType && module;
741
- var moduleExports = freeModule && freeModule.exports === freeExports;
742
- function getValue(object, key) {
743
- return object == null ? void 0 : object[key];
744
- }
745
- function isHostObject2(value) {
746
- var result = false;
747
- if (value != null && typeof value.toString != "function") {
615
+ default: te
616
+ }, [ee]);
617
+ var A = { exports: {} };
618
+ A.exports;
619
+ (function(e, t) {
620
+ var n = 9007199254740991, r = "[object Arguments]", a = "[object Function]", i = "[object GeneratorFunction]", c = "[object Map]", m = "[object Object]", h = "[object Promise]", u = "[object Set]", O = "[object WeakMap]", d = "[object DataView]", S = /[\\^$.*+?()[\]{}|]/g, p = /^\[object .+?Constructor\]$/, ce = typeof I == "object" && I && I.Object === Object && I, se = typeof self == "object" && self && self.Object === Object && self, g = ce || se || Function("return this")(), L = t && !t.nodeType && t, B = L && !0 && e && !e.nodeType && e, me = B && B.exports === L;
621
+ function ue(o, s) {
622
+ return o == null ? void 0 : o[s];
623
+ }
624
+ function le(o) {
625
+ var s = !1;
626
+ if (o != null && typeof o.toString != "function")
748
627
  try {
749
- result = !!(value + "");
750
- } catch (e) {
628
+ s = !!(o + "");
629
+ } catch {
751
630
  }
752
- }
753
- return result;
631
+ return s;
754
632
  }
755
- function overArg2(func, transform) {
756
- return function(arg) {
757
- return func(transform(arg));
633
+ function fe(o, s) {
634
+ return function(l) {
635
+ return o(s(l));
758
636
  };
759
637
  }
760
- var funcProto2 = Function.prototype, objectProto2 = Object.prototype;
761
- var coreJsData = root["__core-js_shared__"];
762
- var maskSrcKey = function() {
763
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
764
- return uid ? "Symbol(src)_1." + uid : "";
765
- }();
766
- var funcToString2 = funcProto2.toString;
767
- var hasOwnProperty2 = objectProto2.hasOwnProperty;
768
- var objectToString2 = objectProto2.toString;
769
- var reIsNative = RegExp("^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
770
- var Buffer2 = moduleExports ? root.Buffer : void 0, propertyIsEnumerable = objectProto2.propertyIsEnumerable;
771
- var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0, nativeKeys = overArg2(Object.keys, Object);
772
- var DataView = getNative(root, "DataView"), Map = getNative(root, "Map"), Promise2 = getNative(root, "Promise"), Set2 = getNative(root, "Set"), WeakMap = getNative(root, "WeakMap");
773
- var nonEnumShadows = !propertyIsEnumerable.call({ "valueOf": 1 }, "valueOf");
774
- var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap);
775
- function baseGetTag(value) {
776
- return objectToString2.call(value);
777
- }
778
- function baseIsNative(value) {
779
- if (!isObject(value) || isMasked(value)) {
780
- return false;
781
- }
782
- var pattern = isFunction(value) || isHostObject2(value) ? reIsNative : reIsHostCtor;
783
- return pattern.test(toSource(value));
784
- }
785
- function getNative(object, key) {
786
- var value = getValue(object, key);
787
- return baseIsNative(value) ? value : void 0;
788
- }
789
- var getTag = baseGetTag;
790
- if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
791
- getTag = function(value) {
792
- var result = objectToString2.call(value), Ctor = result == objectTag2 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : void 0;
793
- if (ctorString) {
794
- switch (ctorString) {
795
- case dataViewCtorString:
796
- return dataViewTag;
797
- case mapCtorString:
798
- return mapTag;
799
- case promiseCtorString:
800
- return promiseTag;
801
- case setCtorString:
802
- return setTag;
803
- case weakMapCtorString:
804
- return weakMapTag;
805
- }
638
+ var de = Function.prototype, C = Object.prototype, P = g["__core-js_shared__"], _ = function() {
639
+ var o = /[^.]+$/.exec(P && P.keys && P.keys.IE_PROTO || "");
640
+ return o ? "Symbol(src)_1." + o : "";
641
+ }(), q = de.toString, T = C.hasOwnProperty, v = C.toString, pe = RegExp(
642
+ "^" + q.call(T).replace(S, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
643
+ ), x = me ? g.Buffer : void 0, V = C.propertyIsEnumerable, ge = x ? x.isBuffer : void 0, ye = fe(Object.keys, Object), E = b(g, "DataView"), w = b(g, "Map"), j = b(g, "Promise"), M = b(g, "Set"), D = b(g, "WeakMap"), Re = !V.call({ valueOf: 1 }, "valueOf"), he = R(E), be = R(w), Se = R(j), Ce = R(M), ve = R(D);
644
+ function Ie(o) {
645
+ return v.call(o);
646
+ }
647
+ function Ae(o) {
648
+ if (!U(o) || Oe(o))
649
+ return !1;
650
+ var s = $(o) || le(o) ? pe : p;
651
+ return s.test(R(o));
652
+ }
653
+ function b(o, s) {
654
+ var l = ue(o, s);
655
+ return Ae(l) ? l : void 0;
656
+ }
657
+ var y = Ie;
658
+ (E && y(new E(new ArrayBuffer(1))) != d || w && y(new w()) != c || j && y(j.resolve()) != h || M && y(new M()) != u || D && y(new D()) != O) && (y = function(o) {
659
+ var s = v.call(o), l = s == m ? o.constructor : void 0, W = l ? R(l) : void 0;
660
+ if (W)
661
+ switch (W) {
662
+ case he:
663
+ return d;
664
+ case be:
665
+ return c;
666
+ case Se:
667
+ return h;
668
+ case Ce:
669
+ return u;
670
+ case ve:
671
+ return O;
806
672
  }
807
- return result;
808
- };
809
- }
810
- function isMasked(func) {
811
- return !!maskSrcKey && maskSrcKey in func;
673
+ return s;
674
+ });
675
+ function Oe(o) {
676
+ return !!_ && _ in o;
812
677
  }
813
- function isPrototype(value) {
814
- var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto2;
815
- return value === proto;
678
+ function Pe(o) {
679
+ var s = o && o.constructor, l = typeof s == "function" && s.prototype || C;
680
+ return o === l;
816
681
  }
817
- function toSource(func) {
818
- if (func != null) {
682
+ function R(o) {
683
+ if (o != null) {
819
684
  try {
820
- return funcToString2.call(func);
821
- } catch (e) {
685
+ return q.call(o);
686
+ } catch {
822
687
  }
823
688
  try {
824
- return func + "";
825
- } catch (e) {
689
+ return o + "";
690
+ } catch {
826
691
  }
827
692
  }
828
693
  return "";
829
694
  }
830
- function isArguments(value) {
831
- return isArrayLikeObject(value) && hasOwnProperty2.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString2.call(value) == argsTag);
832
- }
833
- var isArray = Array.isArray;
834
- function isArrayLike(value) {
835
- return value != null && isLength(value.length) && !isFunction(value);
836
- }
837
- function isArrayLikeObject(value) {
838
- return isObjectLike2(value) && isArrayLike(value);
839
- }
840
- var isBuffer = nativeIsBuffer || stubFalse;
841
- function isEmpty2(value) {
842
- if (isArrayLike(value) && (isArray(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer(value) || isArguments(value))) {
843
- return !value.length;
844
- }
845
- var tag = getTag(value);
846
- if (tag == mapTag || tag == setTag) {
847
- return !value.size;
848
- }
849
- if (nonEnumShadows || isPrototype(value)) {
850
- return !nativeKeys(value).length;
851
- }
852
- for (var key in value) {
853
- if (hasOwnProperty2.call(value, key)) {
854
- return false;
855
- }
856
- }
857
- return true;
858
- }
859
- function isFunction(value) {
860
- var tag = isObject(value) ? objectToString2.call(value) : "";
861
- return tag == funcTag || tag == genTag;
862
- }
863
- function isLength(value) {
864
- return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
865
- }
866
- function isObject(value) {
867
- var type = typeof value;
868
- return !!value && (type == "object" || type == "function");
869
- }
870
- function isObjectLike2(value) {
871
- return !!value && typeof value == "object";
872
- }
873
- function stubFalse() {
874
- return false;
875
- }
876
- module.exports = isEmpty2;
877
- })(lodash_isempty$1, lodash_isempty$1.exports);
878
- var lodash_isempty = lodash_isempty$1.exports;
879
- var isEmptyImport = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ _mergeNamespaces({
695
+ function Te(o) {
696
+ return we(o) && T.call(o, "callee") && (!V.call(o, "callee") || v.call(o) == r);
697
+ }
698
+ var Ee = Array.isArray;
699
+ function G(o) {
700
+ return o != null && De(o.length) && !$(o);
701
+ }
702
+ function we(o) {
703
+ return ke(o) && G(o);
704
+ }
705
+ var je = ge || Fe;
706
+ function Me(o) {
707
+ if (G(o) && (Ee(o) || typeof o == "string" || typeof o.splice == "function" || je(o) || Te(o)))
708
+ return !o.length;
709
+ var s = y(o);
710
+ if (s == c || s == u)
711
+ return !o.size;
712
+ if (Re || Pe(o))
713
+ return !ye(o).length;
714
+ for (var l in o)
715
+ if (T.call(o, l))
716
+ return !1;
717
+ return !0;
718
+ }
719
+ function $(o) {
720
+ var s = U(o) ? v.call(o) : "";
721
+ return s == a || s == i;
722
+ }
723
+ function De(o) {
724
+ return typeof o == "number" && o > -1 && o % 1 == 0 && o <= n;
725
+ }
726
+ function U(o) {
727
+ var s = typeof o;
728
+ return !!o && (s == "object" || s == "function");
729
+ }
730
+ function ke(o) {
731
+ return !!o && typeof o == "object";
732
+ }
733
+ function Fe() {
734
+ return !1;
735
+ }
736
+ e.exports = Me;
737
+ })(A, A.exports);
738
+ var ne = A.exports;
739
+ const N = /* @__PURE__ */ F(ne), re = /* @__PURE__ */ Q({
880
740
  __proto__: null,
881
- [Symbol.toStringTag]: "Module",
882
- "default": lodash_isempty
883
- }, [lodash_isempty$1.exports]));
884
- const isNil = lodash_isnil || isNilImport;
885
- const isEmpty$1 = lodash_isempty || isEmptyImport;
886
- function getPath(object, path, defaultValue, allOptional = false) {
887
- if (isEmpty$1(path)) {
888
- return object;
889
- }
890
- let value = object;
891
- for (const crumb of crumblePath(path)) {
892
- let key = crumb;
893
- let optional;
894
- if (typeof crumb === "string") {
895
- [
896
- ,
897
- key,
898
- optional
899
- ] = /^([^?]+)(\?)?$/.exec(crumb);
900
- }
901
- value = value[key];
902
- if (isNil(value) && (optional || allOptional)) {
903
- return defaultValue;
904
- }
905
- }
906
- return isNil(value) ? defaultValue : value;
907
- }
908
- function omit(obj, ...keys) {
909
- const keySet = new Set(keys);
910
- const result = {};
911
- for (const k of Object.keys(obj)) {
912
- if (!keySet.has(k)) {
913
- result[k] = obj[k];
914
- }
915
- }
916
- return result;
917
- }
918
- const isEmpty = lodash_isempty || isEmptyImport;
919
- function setPath(object, path, newValue) {
920
- if (typeof object !== "object") {
741
+ default: N
742
+ }, [ne]), H = te || ot, it = N || re;
743
+ function K(e, t, n, r = !1) {
744
+ if (it(t))
745
+ return e;
746
+ let a = e;
747
+ for (const i of k(t)) {
748
+ let c = i, m;
749
+ if (typeof i == "string" && ([
750
+ ,
751
+ c,
752
+ m
753
+ ] = /^([^?]+)(\?)?$/.exec(i)), a = a[c], H(a) && (m || r))
754
+ return n;
755
+ }
756
+ return H(a) ? n : a;
757
+ }
758
+ function St(e, ...t) {
759
+ const n = new Set(t), r = {};
760
+ for (const a of Object.keys(e))
761
+ n.has(a) || (r[a] = e[a]);
762
+ return r;
763
+ }
764
+ const ct = N || re;
765
+ function Ct(e, t, n) {
766
+ if (typeof e != "object")
921
767
  throw new Error("object is required");
922
- }
923
- if (isEmpty(path)) {
768
+ if (ct(t))
924
769
  throw new Error("path is required");
925
- }
926
- const crumbs = crumblePath(path);
927
- const finalCrumb = crumbs.splice(crumbs.length - 1, 1)[0];
928
- let current = object;
929
- for (const crumb of crumbs) {
930
- current = current[crumb];
931
- if (typeof current !== "object") {
932
- throw new Error(`Cannot set value at given path: Path deadends at ${String(crumb)}`);
933
- }
934
- }
935
- current[finalCrumb] = newValue;
936
- }
937
- function* traversePath(object, path) {
938
- yield object;
939
- let obj = object;
940
- for (const crumb of crumblePath(path)) {
941
- obj = obj[crumb];
942
- yield obj;
943
- }
944
- }
945
- function mergeDeep(...objectsToMerge) {
946
- const result = {};
947
- for (const mergee of objectsToMerge) {
948
- for (const key of Object.keys(mergee)) {
949
- if (Object.prototype.hasOwnProperty.call(result, key) && Object.getOwnPropertyDescriptor(result, key).writable && lodash_isplainobject(result[key])) {
950
- result[key] = mergeDeep(result[key], mergee[key]);
951
- } else if (lodash_isplainobject(mergee[key])) {
952
- result[key] = mergeDeep({}, mergee[key]);
953
- } else {
954
- result[key] = mergee[key];
955
- }
956
- }
957
- }
958
- return result;
959
- }
960
- function mergePropertiesDeep(...objectsToMerge) {
961
- const result = {};
962
- for (const mergee of objectsToMerge) {
963
- for (const key of Object.keys(mergee)) {
964
- if (Object.prototype.hasOwnProperty.call(result, key) && Object.getOwnPropertyDescriptor(result, key).writable && lodash_isplainobject(result[key])) {
965
- result[key] = mergePropertiesDeep(result[key], mergee[key]);
966
- } else if (lodash_isplainobject(mergee[key])) {
967
- result[key] = mergePropertiesDeep({}, mergee[key]);
968
- } else {
969
- copyProperty(key, mergee, result);
970
- }
971
- }
972
- }
973
- return result;
974
- }
975
- function values(object) {
976
- const vals = [];
977
- for (const key of Object.keys(object)) {
978
- vals.push(object[key]);
979
- }
980
- return vals;
981
- }
982
- function code(strings, ...interpolations) {
983
- const s = strings.reduce((a, b, i) => `${a}${i <= interpolations.length ? String(interpolations[i - 1]) : ""}${b}`);
984
- const leadingWhitespace = Math.min(...s.split(/[\r\n]/).filter((l) => l.trim()).map((l) => /^ */.exec(l)[0].length));
985
- return s.replace(new RegExp(`^ {${leadingWhitespace}}`, "gm"), "").trim();
986
- }
987
- function parseFileSize(fileSize) {
988
- const unitMatch = /[A-Z]?B$/.exec(fileSize);
989
- if (!unitMatch) {
990
- throw new Error(`Input to parseFileSize ("${fileSize}") doesn't seem like a file size; cannot identify a unit (e.g. KB, GB)`);
991
- }
992
- const [unit] = unitMatch;
993
- const num = Number(fileSize.replace(unit, ""));
994
- if (Number.isNaN(num)) {
995
- throw new Error(`Could not parse a number out of input to parseFileSize ("${fileSize}")`);
996
- }
997
- const magnitude = [
770
+ const r = k(t), a = r.splice(r.length - 1, 1)[0];
771
+ let i = e;
772
+ for (const c of r)
773
+ if (i = i[c], typeof i != "object")
774
+ throw new Error(`Cannot set value at given path: Path deadends at ${String(c)}`);
775
+ i[a] = n;
776
+ }
777
+ function* vt(e, t) {
778
+ yield e;
779
+ let n = e;
780
+ for (const r of k(t))
781
+ n = n[r], yield n;
782
+ }
783
+ function X(...e) {
784
+ const t = {};
785
+ for (const n of e)
786
+ for (const r of Object.keys(n))
787
+ Object.prototype.hasOwnProperty.call(t, r) && Object.getOwnPropertyDescriptor(t, r).writable && f(t[r]) ? t[r] = X(t[r], n[r]) : f(n[r]) ? t[r] = X({}, n[r]) : t[r] = n[r];
788
+ return t;
789
+ }
790
+ function J(...e) {
791
+ const t = {};
792
+ for (const n of e)
793
+ for (const r of Object.keys(n))
794
+ Object.prototype.hasOwnProperty.call(t, r) && Object.getOwnPropertyDescriptor(t, r).writable && f(t[r]) ? t[r] = J(t[r], n[r]) : f(n[r]) ? t[r] = J({}, n[r]) : Ve(r, n, t);
795
+ return t;
796
+ }
797
+ function It(e) {
798
+ const t = [];
799
+ for (const n of Object.keys(e))
800
+ t.push(e[n]);
801
+ return t;
802
+ }
803
+ function At(e, ...t) {
804
+ const n = e.reduce((a, i, c) => `${a}${c <= t.length ? String(t[c - 1]) : ""}${i}`), r = Math.min(
805
+ ...n.split(/[\r\n]/).filter((a) => a.trim()).map((a) => /^ */.exec(a)[0].length)
806
+ );
807
+ return n.replace(new RegExp(`^ {${r}}`, "gm"), "").trim();
808
+ }
809
+ function Ot(e) {
810
+ const t = /[A-Z]?B$/.exec(e);
811
+ if (!t)
812
+ throw new Error(
813
+ `Input to parseFileSize ("${e}") doesn't seem like a file size; cannot identify a unit (e.g. KB, GB)`
814
+ );
815
+ const [n] = t, r = Number(e.replace(n, ""));
816
+ if (Number.isNaN(r))
817
+ throw new Error(`Could not parse a number out of input to parseFileSize ("${e}")`);
818
+ const a = [
998
819
  "B",
999
820
  "KB",
1000
821
  "MB",
1001
822
  "GB",
1002
823
  "TB",
1003
824
  "PB"
1004
- ].indexOf(unit);
1005
- if (magnitude === -1) {
825
+ ].indexOf(n);
826
+ if (a === -1)
1006
827
  throw new Error("parseFileSize does not support units above PB");
1007
- }
1008
- return Math.ceil(num * 1024 ** magnitude);
1009
- }
1010
- const REGEX_REPLACEMENT = /(<%=|{{)(.+?)(%>|}})/g;
1011
- const REGEX_IF = /<%\?(.+?)%>(.+?)<\/%>/g;
1012
- const SYMBOL_TEMPLATE_SOURCE = Symbol("sps.utils.templateSrc");
1013
- function template(string) {
1014
- const fn = (data) => string.replace(REGEX_IF, (match, pathToCheck, content) => getPath(data, pathToCheck.trim()) ? content : "").replace(REGEX_REPLACEMENT, (match, _, pathToInterpolate) => getPath(data, pathToInterpolate.trim(), ""));
1015
- fn[SYMBOL_TEMPLATE_SOURCE] = string;
1016
- return fn;
1017
- }
1018
- function isTemplate(x) {
1019
- return typeof x === "string" && (REGEX_REPLACEMENT.test(x) || REGEX_IF.test(x));
1020
- }
1021
- function isTemplateFn(x) {
1022
- return typeof x === "function" && Object.prototype.hasOwnProperty.call(x, SYMBOL_TEMPLATE_SOURCE);
1023
- }
1024
- export { CustomEvent, DiffChange, EDI_DOCUMENT_TYPE, Op, castToNumber, code, constrain, copyProperty, crumblePath, debounce, debounced, decimalRound, deepFreeze, diff, flatten, forEachEntryDeep, forEachNestedObject, getPath, isSubset, isTemplate, isTemplateFn, lockToAnimationFrames, lockedToAnimationFrames, mergeDeep, mergePropertiesDeep, omit, onNextTick, parseFileSize, range, setPath, simpleMetadataDecoratorApplicator, template, tickDelay, toFileSizeString, traversePath, values };
828
+ return Math.ceil(r * 1024 ** a);
829
+ }
830
+ const ae = /(<%=|{{)(.+?)(%>|}})/g, oe = /<%\?(.+?)%>(.+?)<\/%>/g, ie = Symbol("sps.utils.templateSrc");
831
+ function Pt(e) {
832
+ const t = (n) => e.replace(oe, (r, a, i) => K(n, a.trim()) ? i : "").replace(ae, (r, a, i) => K(n, i.trim(), ""));
833
+ return t[ie] = e, t;
834
+ }
835
+ function Tt(e) {
836
+ return typeof e == "string" && (ae.test(e) || oe.test(e));
837
+ }
838
+ function Et(e) {
839
+ return typeof e == "function" && Object.prototype.hasOwnProperty.call(e, ie);
840
+ }
841
+ export {
842
+ lt as CustomEvent,
843
+ et as DiffChange,
844
+ ft as EDI_DOCUMENT_TYPE,
845
+ z as Op,
846
+ dt as castToNumber,
847
+ At as code,
848
+ ht as constrain,
849
+ Ve as copyProperty,
850
+ k as crumblePath,
851
+ Be as debounce,
852
+ pt as debounced,
853
+ xe as decimalRound,
854
+ Ze as deepFreeze,
855
+ tt as diff,
856
+ Ne as flatten,
857
+ nt as forEachEntryDeep,
858
+ rt as forEachNestedObject,
859
+ K as getPath,
860
+ st as isSubset,
861
+ Tt as isTemplate,
862
+ Et as isTemplateFn,
863
+ qe as lockToAnimationFrames,
864
+ gt as lockedToAnimationFrames,
865
+ X as mergeDeep,
866
+ J as mergePropertiesDeep,
867
+ St as omit,
868
+ mt as onNextTick,
869
+ Ot as parseFileSize,
870
+ ut as range,
871
+ Ct as setPath,
872
+ yt as simpleMetadataDecoratorApplicator,
873
+ Pt as template,
874
+ Rt as tickDelay,
875
+ bt as toFileSizeString,
876
+ vt as traversePath,
877
+ It as values
878
+ };