@spscommerce/utils 7.4.1 → 7.4.2
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.js +116 -117
- package/lib/index.umd.cjs +1 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
function M(e) {
|
|
2
|
-
return Array.isArray(e) ? e.reduce((n,
|
|
2
|
+
return Array.isArray(e) ? e.reduce((n, a) => n.concat(M(a)), []) : e;
|
|
3
3
|
}
|
|
4
4
|
function U(e, n) {
|
|
5
|
-
const
|
|
6
|
-
for (const
|
|
7
|
-
if (!
|
|
5
|
+
const a = new Set(n);
|
|
6
|
+
for (const t of e)
|
|
7
|
+
if (!a.has(t))
|
|
8
8
|
return !1;
|
|
9
9
|
return !0;
|
|
10
10
|
}
|
|
11
11
|
function w() {
|
|
12
12
|
return this.pending = !1, typeof this.id < "u" ? (clearTimeout(this.id), delete this.id, !0) : !1;
|
|
13
13
|
}
|
|
14
|
-
function D(e, n,
|
|
15
|
-
const
|
|
14
|
+
function D(e, n, a) {
|
|
15
|
+
const t = function(...i) {
|
|
16
16
|
return new Promise((o, s) => {
|
|
17
|
-
|
|
17
|
+
t.reset && t.reset(), t.pending = !0;
|
|
18
18
|
const f = () => {
|
|
19
19
|
(async () => {
|
|
20
20
|
try {
|
|
21
|
-
let c = e.apply(
|
|
21
|
+
let c = e.apply(a || this, i);
|
|
22
22
|
c instanceof Promise && (c = await c), o(c);
|
|
23
23
|
} catch (c) {
|
|
24
24
|
s(c);
|
|
25
25
|
} finally {
|
|
26
|
-
|
|
26
|
+
t.reset && t.reset();
|
|
27
27
|
}
|
|
28
28
|
})();
|
|
29
29
|
};
|
|
30
|
-
|
|
30
|
+
t.id = window.setTimeout(f, n);
|
|
31
31
|
});
|
|
32
32
|
};
|
|
33
|
-
return
|
|
33
|
+
return t.reset = w.bind(t), t;
|
|
34
34
|
}
|
|
35
35
|
function F() {
|
|
36
36
|
return this.pending = !1, typeof this.id == "number" ? (window.cancelAnimationFrame(this.id), delete this.id, !0) : !1;
|
|
37
37
|
}
|
|
38
38
|
function j(e, n) {
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
e.apply(!!n || this, r),
|
|
42
|
-
}),
|
|
39
|
+
const a = function(...r) {
|
|
40
|
+
a.pending === !0 && a.reset && a.reset(), a.id = window.requestAnimationFrame(() => {
|
|
41
|
+
e.apply(!!n || this, r), a.reset && a.reset();
|
|
42
|
+
}), a.pending = !0;
|
|
43
43
|
};
|
|
44
|
-
return
|
|
44
|
+
return a.pending = !1, a.reset = F.bind(a), a;
|
|
45
45
|
}
|
|
46
46
|
function G(e, n) {
|
|
47
|
-
const
|
|
48
|
-
setTimeout(
|
|
47
|
+
const a = n ? e.bind(n) : e;
|
|
48
|
+
setTimeout(a, 0);
|
|
49
49
|
}
|
|
50
50
|
const S = {
|
|
51
51
|
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
|
|
@@ -91,21 +91,21 @@ function W(e, n) {
|
|
|
91
91
|
return new Array(Math.abs(n - e) + 1).fill(e).map(e > n ? S.sub : S.add);
|
|
92
92
|
}
|
|
93
93
|
class z {
|
|
94
|
-
constructor(n,
|
|
95
|
-
let
|
|
94
|
+
constructor(n, a = {}) {
|
|
95
|
+
let t;
|
|
96
96
|
if (typeof Event == "function")
|
|
97
|
-
|
|
97
|
+
t = new Event(n, a);
|
|
98
98
|
else {
|
|
99
|
-
|
|
100
|
-
for (const i of Object.keys(
|
|
101
|
-
i !== "bubbles" && i !== "cancelable" && (
|
|
99
|
+
t = document.createEvent("Event"), t.initEvent(n, a.bubbles, a.cancelable);
|
|
100
|
+
for (const i of Object.keys(a))
|
|
101
|
+
i !== "bubbles" && i !== "cancelable" && (t[i] = a[i]);
|
|
102
102
|
}
|
|
103
|
-
Object.setPrototypeOf(this,
|
|
103
|
+
Object.setPrototypeOf(this, t);
|
|
104
104
|
const r = Object.getOwnPropertyDescriptors(Event.prototype);
|
|
105
105
|
for (const i of Object.keys(r)) {
|
|
106
106
|
const o = r[i];
|
|
107
107
|
for (const s of Object.keys(o))
|
|
108
|
-
typeof o[s] == "function" && (o[s] = o[s].bind(
|
|
108
|
+
typeof o[s] == "function" && (o[s] = o[s].bind(t));
|
|
109
109
|
}
|
|
110
110
|
Object.defineProperties(this, r);
|
|
111
111
|
}
|
|
@@ -413,9 +413,9 @@ const H = Object.freeze({
|
|
|
413
413
|
});
|
|
414
414
|
function $() {
|
|
415
415
|
return (e, n) => {
|
|
416
|
-
const
|
|
416
|
+
const a = `_${String(n)}`;
|
|
417
417
|
Object.defineProperties(e, {
|
|
418
|
-
[
|
|
418
|
+
[a]: {
|
|
419
419
|
enumerable: !1,
|
|
420
420
|
configurable: !0,
|
|
421
421
|
writable: !0,
|
|
@@ -425,39 +425,39 @@ function $() {
|
|
|
425
425
|
enumerable: !0,
|
|
426
426
|
configurable: !0,
|
|
427
427
|
get() {
|
|
428
|
-
return Number(this[
|
|
428
|
+
return Number(this[a]);
|
|
429
429
|
},
|
|
430
|
-
set(
|
|
431
|
-
this[
|
|
430
|
+
set(t) {
|
|
431
|
+
this[a] = Number(t);
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
434
|
});
|
|
435
435
|
};
|
|
436
436
|
}
|
|
437
437
|
function K(e) {
|
|
438
|
-
return (n,
|
|
439
|
-
const r = { ...
|
|
438
|
+
return (n, a, t) => {
|
|
439
|
+
const r = { ...t };
|
|
440
440
|
return r.get = function() {
|
|
441
441
|
const o = { ...r };
|
|
442
442
|
return o.value = D(
|
|
443
443
|
r.value,
|
|
444
444
|
e,
|
|
445
445
|
this
|
|
446
|
-
), Object.defineProperty(this,
|
|
446
|
+
), Object.defineProperty(this, a, o), o.value;
|
|
447
447
|
}, r.configurable = !0, delete r.writable, delete r.value, r;
|
|
448
448
|
};
|
|
449
449
|
}
|
|
450
|
-
function Q(e, n,
|
|
451
|
-
const
|
|
452
|
-
return
|
|
453
|
-
const i = { ...
|
|
450
|
+
function Q(e, n, a) {
|
|
451
|
+
const t = { ...a };
|
|
452
|
+
return a.get = function() {
|
|
453
|
+
const i = { ...t };
|
|
454
454
|
return i.value = j(
|
|
455
|
-
|
|
455
|
+
t.value,
|
|
456
456
|
this
|
|
457
457
|
), Object.defineProperty(this, n, i), i.value;
|
|
458
|
-
},
|
|
458
|
+
}, a.configurable = !0, delete a.writable, delete a.value, a;
|
|
459
459
|
}
|
|
460
|
-
function X(e, n,
|
|
460
|
+
function X(e, n, a, t, r) {
|
|
461
461
|
const i = r, o = i.get, { value: s } = i;
|
|
462
462
|
return i.get = function() {
|
|
463
463
|
const c = this, R = s ?? (typeof o < "u" && o.call(this));
|
|
@@ -476,7 +476,7 @@ function X(e, n, t, a, r) {
|
|
|
476
476
|
throw new Error(`Property ${l} is not a function`);
|
|
477
477
|
}
|
|
478
478
|
}) : d[l] = y[l];
|
|
479
|
-
return Object.defineProperty(this,
|
|
479
|
+
return Object.defineProperty(this, t, {
|
|
480
480
|
writable: !0,
|
|
481
481
|
configurable: !0,
|
|
482
482
|
enumerable: i.enumerable,
|
|
@@ -484,23 +484,23 @@ function X(e, n, t, a, r) {
|
|
|
484
484
|
}), d;
|
|
485
485
|
}, delete i.value, delete i.writable, i;
|
|
486
486
|
}
|
|
487
|
-
function Y(e, n,
|
|
488
|
-
const
|
|
489
|
-
return
|
|
490
|
-
const i = { ...
|
|
491
|
-
if (!
|
|
492
|
-
return
|
|
493
|
-
const o =
|
|
487
|
+
function Y(e, n, a) {
|
|
488
|
+
const t = { ...a };
|
|
489
|
+
return t.get = function() {
|
|
490
|
+
const i = { ...t };
|
|
491
|
+
if (!t.value)
|
|
492
|
+
return t.value;
|
|
493
|
+
const o = t.value.bind(this);
|
|
494
494
|
return i.value = () => setTimeout(o, 0), Object.defineProperty(this, n, i), i.value;
|
|
495
|
-
},
|
|
495
|
+
}, t.configurable = !0, delete t.writable, delete t.value, t;
|
|
496
496
|
}
|
|
497
497
|
function J(e, n) {
|
|
498
498
|
return !e || e < n[0] ? n[0] : e > n[1] ? n[1] : e;
|
|
499
499
|
}
|
|
500
500
|
function N(e, n = 0) {
|
|
501
|
-
const
|
|
501
|
+
const a = String(e).split("."), t = a.length > 1 ? a[1].length : 0;
|
|
502
502
|
let r = e;
|
|
503
|
-
for (let i =
|
|
503
|
+
for (let i = t - 1; i >= n; i -= 1)
|
|
504
504
|
r = +`${Math.round(+`${r}e${i}`)}e-${i}`;
|
|
505
505
|
return r;
|
|
506
506
|
}
|
|
@@ -510,27 +510,27 @@ function Z(e, n = 2) {
|
|
|
510
510
|
throw new Error(
|
|
511
511
|
"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."
|
|
512
512
|
);
|
|
513
|
-
const
|
|
513
|
+
const a = Math.min(
|
|
514
514
|
Math.floor(Math.log(e) / Math.log(C)),
|
|
515
515
|
L
|
|
516
|
-
),
|
|
516
|
+
), t = [
|
|
517
517
|
"B",
|
|
518
518
|
"KB",
|
|
519
519
|
"MB",
|
|
520
520
|
"GB",
|
|
521
521
|
"TB",
|
|
522
522
|
"PB"
|
|
523
|
-
][
|
|
524
|
-
return N(e / C **
|
|
523
|
+
][a], r = a ? n : 0;
|
|
524
|
+
return N(e / C ** a, r).toFixed(
|
|
525
525
|
r
|
|
526
|
-
) +
|
|
526
|
+
) + t;
|
|
527
527
|
}
|
|
528
528
|
function g(e) {
|
|
529
529
|
return typeof e == "string" ? e.match(/[^.[\]]+/g) ?? [] : Array.isArray(e) ? Array.from(e) : [e];
|
|
530
530
|
}
|
|
531
|
-
function ee(e, n,
|
|
532
|
-
const
|
|
533
|
-
|
|
531
|
+
function ee(e, n, a) {
|
|
532
|
+
const t = Object.getOwnPropertyDescriptor(n, e);
|
|
533
|
+
t && Object.defineProperty(a, e, t);
|
|
534
534
|
}
|
|
535
535
|
function u(e) {
|
|
536
536
|
if (typeof e != "object" || e === null)
|
|
@@ -541,52 +541,52 @@ function u(e) {
|
|
|
541
541
|
function k(e) {
|
|
542
542
|
Object.freeze(e);
|
|
543
543
|
for (const n of Object.keys(e)) {
|
|
544
|
-
const
|
|
545
|
-
(u(
|
|
544
|
+
const a = e[n];
|
|
545
|
+
(u(a) || Array.isArray(a)) && k(a);
|
|
546
546
|
}
|
|
547
547
|
}
|
|
548
548
|
var B = /* @__PURE__ */ ((e) => (e[e.ADDITION = 0] = "ADDITION", e[e.DELETION = 1] = "DELETION", e[e.ALTERATION = 2] = "ALTERATION", e))(B || {});
|
|
549
|
-
function q(e, n,
|
|
550
|
-
let
|
|
549
|
+
function q(e, n, a = []) {
|
|
550
|
+
let t = [];
|
|
551
551
|
for (const r of /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(n)])) {
|
|
552
552
|
const i = Object.hasOwn(e, r), o = Object.hasOwn(n, r);
|
|
553
|
-
i && !o ?
|
|
553
|
+
i && !o ? t.push({
|
|
554
554
|
type: 1,
|
|
555
555
|
key: r,
|
|
556
|
-
parentPath:
|
|
556
|
+
parentPath: a,
|
|
557
557
|
objects: [e, n]
|
|
558
|
-
}) : !i && o ?
|
|
558
|
+
}) : !i && o ? t.push({
|
|
559
559
|
type: 0,
|
|
560
560
|
key: r,
|
|
561
|
-
parentPath:
|
|
561
|
+
parentPath: a,
|
|
562
562
|
objects: [e, n]
|
|
563
|
-
}) : u(e[r]) && u(n[r]) || Array.isArray(e[r]) && Array.isArray(n[r]) ?
|
|
563
|
+
}) : u(e[r]) && u(n[r]) || Array.isArray(e[r]) && Array.isArray(n[r]) ? t = t.concat(
|
|
564
564
|
q(
|
|
565
565
|
e[r],
|
|
566
566
|
n[r],
|
|
567
|
-
[...
|
|
567
|
+
[...a, r]
|
|
568
568
|
)
|
|
569
|
-
) : e[r] !== n[r] &&
|
|
569
|
+
) : e[r] !== n[r] && t.push({
|
|
570
570
|
type: 2,
|
|
571
571
|
key: r,
|
|
572
|
-
parentPath:
|
|
572
|
+
parentPath: a,
|
|
573
573
|
objects: [e, n]
|
|
574
574
|
});
|
|
575
575
|
}
|
|
576
|
-
return
|
|
576
|
+
return t;
|
|
577
577
|
}
|
|
578
578
|
function V(e, n) {
|
|
579
|
-
for (const
|
|
580
|
-
const
|
|
581
|
-
u(
|
|
579
|
+
for (const a of Object.keys(e)) {
|
|
580
|
+
const t = e[a];
|
|
581
|
+
u(t) || Array.isArray(t) ? V(t, n) : n(a, t, e);
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
|
-
function _(e, n,
|
|
585
|
-
n(
|
|
586
|
-
for (const
|
|
587
|
-
const r = e[
|
|
584
|
+
function _(e, n, a = []) {
|
|
585
|
+
n(a, e);
|
|
586
|
+
for (const t of Object.keys(e)) {
|
|
587
|
+
const r = e[t];
|
|
588
588
|
if (u(r) || Array.isArray(r)) {
|
|
589
|
-
const i =
|
|
589
|
+
const i = a.concat(t);
|
|
590
590
|
_(r, n, i);
|
|
591
591
|
}
|
|
592
592
|
}
|
|
@@ -597,7 +597,7 @@ function v(e) {
|
|
|
597
597
|
function A(e) {
|
|
598
598
|
return e == null;
|
|
599
599
|
}
|
|
600
|
-
function I(e, n,
|
|
600
|
+
function I(e, n, a, t = !1) {
|
|
601
601
|
if (v(n))
|
|
602
602
|
return e;
|
|
603
603
|
let r = e;
|
|
@@ -611,44 +611,43 @@ function I(e, n, t, a = !1) {
|
|
|
611
611
|
s
|
|
612
612
|
] = c);
|
|
613
613
|
}
|
|
614
|
-
if (r = r[o], A(r) && (s ||
|
|
615
|
-
return
|
|
614
|
+
if (r = r[o], A(r) && (s || t))
|
|
615
|
+
return a;
|
|
616
616
|
}
|
|
617
|
-
return A(r) ?
|
|
617
|
+
return A(r) ? a : r;
|
|
618
618
|
}
|
|
619
619
|
function ne(e, ...n) {
|
|
620
|
-
const
|
|
620
|
+
const a = new Set(n), t = {};
|
|
621
621
|
for (const r of Object.keys(e))
|
|
622
|
-
|
|
623
|
-
return
|
|
622
|
+
a.has(r) || (t[r] = e[r]);
|
|
623
|
+
return t;
|
|
624
624
|
}
|
|
625
|
-
function te(e, n,
|
|
625
|
+
function te(e, n, a) {
|
|
626
626
|
if (typeof e != "object")
|
|
627
627
|
throw new Error("object is required");
|
|
628
628
|
if (v(n))
|
|
629
629
|
throw new Error("path is required");
|
|
630
|
-
const
|
|
630
|
+
const t = g(n), r = t.splice(t.length - 1, 1)[0];
|
|
631
631
|
let i = e;
|
|
632
|
-
for (const o of
|
|
632
|
+
for (const o of t)
|
|
633
633
|
if (i = i[o], typeof i != "object")
|
|
634
634
|
throw new Error(`Cannot set value at given path: Path deadends at ${String(o)}`);
|
|
635
|
-
i[r] =
|
|
635
|
+
i[r] = a;
|
|
636
636
|
}
|
|
637
637
|
function* ae(e, n) {
|
|
638
638
|
yield e;
|
|
639
|
-
let
|
|
640
|
-
for (const
|
|
641
|
-
|
|
639
|
+
let a = e;
|
|
640
|
+
for (const t of g(n))
|
|
641
|
+
a = a[t], yield a;
|
|
642
642
|
}
|
|
643
643
|
function b(...e) {
|
|
644
|
-
var t;
|
|
645
644
|
const n = {};
|
|
646
645
|
for (const a of e)
|
|
647
|
-
for (const
|
|
648
|
-
Object.hasOwn(n,
|
|
649
|
-
n[
|
|
650
|
-
a[
|
|
651
|
-
) : u(a[
|
|
646
|
+
for (const t of Object.keys(a))
|
|
647
|
+
Object.hasOwn(n, t) && Object.getOwnPropertyDescriptor(n, t)?.writable !== void 0 && u(n[t]) ? n[t] = b(
|
|
648
|
+
n[t],
|
|
649
|
+
a[t]
|
|
650
|
+
) : u(a[t]) ? n[t] = b({}, a[t]) : n[t] = a[t];
|
|
652
651
|
return n;
|
|
653
652
|
}
|
|
654
653
|
const O = (e) => {
|
|
@@ -660,11 +659,11 @@ const O = (e) => {
|
|
|
660
659
|
return Object.prototype.toString.call(e) === "[object Object]";
|
|
661
660
|
}
|
|
662
661
|
return !1;
|
|
663
|
-
}, m = (...e) => e.reduce((n,
|
|
664
|
-
if (Array.isArray(
|
|
662
|
+
}, m = (...e) => e.reduce((n, a) => {
|
|
663
|
+
if (Array.isArray(a))
|
|
665
664
|
throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");
|
|
666
|
-
return Object.keys(
|
|
667
|
-
["__proto__", "constructor", "prototype"].includes(
|
|
665
|
+
return Object.keys(a).forEach((t) => {
|
|
666
|
+
["__proto__", "constructor", "prototype"].includes(t) || (Array.isArray(n[t]) && Array.isArray(a[t]) ? n[t] = m.options.mergeArrays ? m.options.uniqueArrayItems ? Array.from(new Set(n[t].concat(a[t]))) : [...n[t], ...a[t]] : a[t] : O(n[t]) && O(a[t]) ? n[t] = m(n[t], a[t]) : n[t] = a[t] === void 0 ? m.options.allowUndefinedOverrides ? a[t] : n[t] : a[t]);
|
|
668
667
|
}), n;
|
|
669
668
|
}, {}), p = {
|
|
670
669
|
allowUndefinedOverrides: !0,
|
|
@@ -674,23 +673,23 @@ const O = (e) => {
|
|
|
674
673
|
m.options = p;
|
|
675
674
|
m.withOptions = (e, ...n) => {
|
|
676
675
|
m.options = Object.assign(Object.assign({}, p), e);
|
|
677
|
-
const
|
|
678
|
-
return m.options = p,
|
|
676
|
+
const a = m(...n);
|
|
677
|
+
return m.options = p, a;
|
|
679
678
|
};
|
|
680
679
|
function re(e) {
|
|
681
680
|
const n = [];
|
|
682
|
-
for (const
|
|
683
|
-
n.push(e[
|
|
681
|
+
for (const a of Object.keys(e))
|
|
682
|
+
n.push(e[a]);
|
|
684
683
|
return n;
|
|
685
684
|
}
|
|
686
685
|
function ie(e, ...n) {
|
|
687
|
-
const
|
|
688
|
-
...
|
|
686
|
+
const a = e.reduce((r, i, o) => `${r}${o <= n.length ? String(n[o - 1]) : ""}${i}`), t = Math.min(
|
|
687
|
+
...a.split(/[\r\n]/).filter((r) => !!r.trim()).map((r) => {
|
|
689
688
|
const i = /^ */.exec(r);
|
|
690
689
|
return i ? i[0].length : 0;
|
|
691
690
|
})
|
|
692
691
|
);
|
|
693
|
-
return
|
|
692
|
+
return a.replace(new RegExp(`^ {${t}}`, "gm"), "").trim();
|
|
694
693
|
}
|
|
695
694
|
const x = 1024;
|
|
696
695
|
function oe(e) {
|
|
@@ -699,8 +698,8 @@ function oe(e) {
|
|
|
699
698
|
throw new Error(
|
|
700
699
|
`Input to parseFileSize ("${e}") doesn't seem like a file size; cannot identify a unit (e.g. KB, GB)`
|
|
701
700
|
);
|
|
702
|
-
const [
|
|
703
|
-
if (Number.isNaN(
|
|
701
|
+
const [a] = n, t = Number(e.replace(a, ""));
|
|
702
|
+
if (Number.isNaN(t))
|
|
704
703
|
throw new Error(`Could not parse a number out of input to parseFileSize ("${e}")`);
|
|
705
704
|
const r = [
|
|
706
705
|
"B",
|
|
@@ -709,14 +708,14 @@ function oe(e) {
|
|
|
709
708
|
"GB",
|
|
710
709
|
"TB",
|
|
711
710
|
"PB"
|
|
712
|
-
].indexOf(
|
|
711
|
+
].indexOf(a);
|
|
713
712
|
if (r === -1)
|
|
714
713
|
throw new Error("parseFileSize does not support units above PB");
|
|
715
|
-
return Math.ceil(
|
|
714
|
+
return Math.ceil(t * x ** r);
|
|
716
715
|
}
|
|
717
716
|
const P = /(<%=|{{)(.+?)(%>|}})/g, E = /<%\?(.+?)%>(.+?)<\/%>/g, T = Symbol("sps.utils.templateSrc");
|
|
718
717
|
function se(e) {
|
|
719
|
-
const n = (
|
|
718
|
+
const n = (a) => e.replace(E, (t, r, i) => I(a, r.trim()) ? i : "").replace(P, (t, r, i) => I(a, i.trim(), ""));
|
|
720
719
|
return n[T] = e, n;
|
|
721
720
|
}
|
|
722
721
|
function ce(e) {
|
package/lib/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(o,d){typeof exports=="object"&&typeof module<"u"?d(exports):typeof define=="function"&&define.amd?define(["exports"],d):(o=typeof globalThis<"u"?globalThis:o||self,d(o.Utils={}))})(this,function(o){"use strict";function d(e){return Array.isArray(e)?e.reduce((n,t)=>n.concat(d(t)),[]):e}function _(e,n){const t=new Set(n);for(const a of e)if(!t.has(a))return!1;return!0}function U(){return this.pending=!1,typeof this.id<"u"?(clearTimeout(this.id),delete this.id,!0):!1}function A(e,n,t){const a=function(...i){return new Promise((c,s)=>{a.reset&&a.reset(),a.pending=!0;const C=()=>{(async()=>{try{let m=e.apply(t||this,i);m instanceof Promise&&(m=await m),c(m)}catch(m){s(m)}finally{a.reset&&a.reset()}})()};a.id=window.setTimeout(C,n)})};return a.reset=U.bind(a),a}function V(){return this.pending=!1,typeof this.id=="number"?(window.cancelAnimationFrame(this.id),delete this.id,!0):!1}function I(e,n){const t=function(...r){t.pending===!0&&t.reset&&t.reset(),t.id=window.requestAnimationFrame(()=>{e.apply(!!n||this,r),t.reset&&t.reset()}),t.pending=!0};return t.pending=!1,t.reset=V.bind(t),t}function G(e,n){const t=n?e.bind(n):e;setTimeout(t,0)}const R={add:(e,n)=>e+n,and:(e,n)=>e&&n,band:(e,n)=>e&n,bor:(e,n)=>e|n,bxor:(e,n)=>e^n,bnot:e=>~e,decr:e=>e-1,div:(e,n)=>e/n,eq:(e,n)=>e===n,exp:(e,n)=>e**n,gt:(e,n)=>e>n,gte:(e,n)=>e>=n,incr:e=>e+1,lshift:(e,n)=>e<<n,lt:(e,n)=>e<n,lte:(e,n)=>e<=n,mul:(e,n)=>e*n,neg:e=>-e,neq:(e,n)=>e!==n,not:e=>!e,or:(e,n)=>e||n,rem:(e,n)=>e%n,rshift:(e,n)=>e>>n,rshift_zf:(e,n)=>e>>>n,sub:(e,n)=>e-n,xor:(e,n)=>!!((e||n)&&!(e&&n))};function z(e,n){if(!Number.isInteger(e))throw new Error("start must be an integer");if(!Number.isInteger(n))throw new Error("end must be an integer");return new Array(Math.abs(n-e)+1).fill(e).map(e>n?R.sub:R.add)}class W{constructor(n,t={}){let a;if(typeof Event=="function")a=new Event(n,t);else{a=document.createEvent("Event"),a.initEvent(n,t.bubbles,t.cancelable);for(const i of Object.keys(t))i!=="bubbles"&&i!=="cancelable"&&(a[i]=t[i])}Object.setPrototypeOf(this,a);const r=Object.getOwnPropertyDescriptors(Event.prototype);for(const i of Object.keys(r)){const c=r[i];for(const s of Object.keys(c))typeof c[s]=="function"&&(c[s]=c[s].bind(a))}Object.defineProperties(this,r)}}const H=Object.freeze({100:{name:"Insurance Plan Description"},101:{name:"Name and Address Lists"},104:{name:"Air Shipment Information"},106:{name:"Motor Carrier Rate Proposal"},107:{name:"Request for Motor Carrier Rate Proposal"},108:{name:"Response to a Motor Carrier Rate Proposal"},109:{name:"Vessel Content Details"},110:{name:"Air Freight Details and Invoice"},112:{name:"Property Damage Report"},120:{name:"Vehicle Shipping Order"},121:{name:"Vehicle Service"},124:{name:"Vehicle Damage"},125:{name:"Multilevel Railcar Load Details"},126:{name:"Vehicle Application Advice"},127:{name:"Vehicle Baying Order"},128:{name:"Dealer Information"},129:{name:"Vehicle Carrier Rate Update"},130:{name:"Student Educational Record (Transcript)"},131:{name:"Student Educational Record (Transcript) Acknowledgment"},135:{name:"Student Loan Application"},138:{name:"Testing Results Request and Report"},139:{name:"Student Loan Guarantee Result"},140:{name:"Product Registration"},141:{name:"Product Service Claim Response"},142:{name:"Product Service Claim"},143:{name:"Product Service Notification"},144:{name:"Student Loan Transfer and Status Verification"},146:{name:"Request for Student Educational Record (Transcript)"},147:{name:"Response to Request for Student Educational Record (Transcript)"},148:{name:"Report of Injury, Illness or Incident"},149:{name:"Notice of Tax Adjustment or Assessment"},150:{name:"Tax Rate Notification"},151:{name:"Electronic Filing of Tax Return Data Acknowledgment"},152:{name:"Statistical Government Information"},153:{name:"Unemployment Insurance Tax Claim or Charge Information"},154:{name:"Uniform Commercial Code Filing"},155:{name:"Business Credit Report"},157:{name:"Notice of Power of Attorney"},159:{name:"Motion Picture Booking Confirmation"},160:{name:"Transportation Automatic Equipment Identification"},161:{name:"Train Sheet"},169:{name:"Transportation Appointment Schedule Information"},170:{name:"Revenue Receipts Statement"},175:{name:"Court and Law Enforcement Notice"},176:{name:"Court Submission TYPE"},180:{name:"Return Merchandise Authorization and Notification"},185:{name:"Royalty Regulatory Report"},186:{name:"Insurance Underwriting Requirements Reporting"},188:{name:"Educational Course Inventory"},189:{name:"Application for Admission to Educational Institutions"},190:{name:"Student Enrollment Verification"},191:{name:"Student Loan Pre-Claims and Claims"},194:{name:"Grant or Assistance Application"},195:{name:"Federal Communications Commission (FCC) License Application"},196:{name:"Contractor Cost Data Reporting"},197:{name:"Real Estate Title Evidence"},198:{name:"Loan Verification Information"},199:{name:"Real Estate Settlement Information"},200:{name:"Mortgage Credit Report"},201:{name:"Residential Loan Application"},202:{name:"Secondary Mortgage Market Loan Delivery"},203:{name:"Secondary Mortgage Market Investor Report"},204:{name:"Motor Carrier Load Tender"},205:{name:"Mortgage Note"},206:{name:"Real Estate Inspection"},210:{name:"Motor Carrier Freight Details and Invoice"},211:{name:"Motor Carrier Bill of Lading",edifactId:"IFTMCE"},212:{name:"Motor Carrier Delivery Trailer Manifest"},213:{name:"Motor Carrier Shipment Status Inquiry"},214:{name:"Transportation Carrier Shipment Status Message"},215:{name:"Motor Carrier Pick-up Manifest"},216:{name:"Motor Carrier Shipment Pick-up Notification"},217:{name:"Motor Carrier Loading and Route Guide"},218:{name:"Motor Carrier Tariff Information"},219:{name:"Logistics Service Request"},220:{name:"Logistics Service Response"},222:{name:"Cartage Work Assignment"},223:{name:"Consolidators Freight Bill and Invoice"},224:{name:"Motor Carrier Summary Freight Bill Manifest"},225:{name:"Response to a Cartage Work Assignment"},240:{name:"Motor Carrier Package Status"},242:{name:"Data Status Tracking"},244:{name:"Product Source Information"},248:{name:"Account Assignment/Inquiry and Service/Status"},249:{name:"Animal Toxicological Data"},250:{name:"Purchase Order Shipment Management Document"},251:{name:"Pricing Support"},252:{name:"Insurance Producer Administration"},255:{name:"Underwriting Information Services"},256:{name:"Periodic Compensation"},260:{name:"Application for Mortgage Insurance Benefits"},261:{name:"Real Estate Information Request"},262:{name:"Real Estate Information Report"},263:{name:"Residential Mortgage Insurance Application Response"},264:{name:"Mortgage Loan Default Status"},265:{name:"Real Estate Title Insurance Services Order"},266:{name:"Mortgage or Property Record Change Notification"},267:{name:"Individual Life, Annuity and Disability Application"},268:{name:"Annuity Activity"},270:{name:"Eligibility, Coverage or Benefit Inquiry"},271:{name:"Eligibility, Coverage or Benefit Information"},272:{name:"Property and Casualty Loss Notification"},273:{name:"Insurance/Annuity Application Status"},274:{name:"Health Care Provider Information"},275:{name:"Patient Information"},276:{name:"Health Care Claim Status Request"},277:{name:"Health Care Claim Status Notification"},278:{name:"Health Care Services Insurance/Benefit Review Information"},280:{name:"Voter Registration Information"},285:{name:"Commercial Vehicle Safety and Credentials Information Exchange"},286:{name:"Commercial Vehicle Credentials"},288:{name:"Wage Determination"},290:{name:"Cooperative Advertising Agreements"},300:{name:"Reservation (Booking Request) (Ocean)"},301:{name:"Confirmation (Ocean)",edifactId:"IFTMBC"},303:{name:"Booking Cancellation (Ocean)"},304:{name:"Shipping Instructions"},309:{name:"U.S. Customs Manifest"},310:{name:"Freight Receipt and Invoice (Ocean)"},311:{name:"Canadian Customs Information"},312:{name:"Arrival Notice (Ocean)"},313:{name:"Shipment Status Inquiry (Ocean)"},315:{name:"Status Details (Ocean)"},317:{name:"Delivery/Pickup Order"},319:{name:"Terminal Information"},322:{name:"Terminal Operations and Intermodal Ramp Activity"},323:{name:"Vessel Schedule and Itinerary (Ocean)"},324:{name:"Vessel Stow Plan (Ocean)"},325:{name:"Consolidation of Goods In Container"},326:{name:"Consignment Summary List"},350:{name:"U.S. Customs Status Information"},352:{name:"U.S. Customs Carrier General Order Status"},353:{name:"U.S. Customs Events Advisory Details"},354:{name:"U.S. Customs Automated Manifest Archive Status"},355:{name:"U.S. Customs Acceptance/Rejection"},356:{name:"U.S. Customs Permit to Transfer Request"},357:{name:"U.S. Customs In-Bond Information"},358:{name:"U.S. Customs Consist Information"},361:{name:"Carrier Interchange Agreement (Ocean)"},362:{name:"Cargo Insurance Advice of Shipment"},404:{name:"Rail Carrier Shipment Information"},410:{name:"Rail Carrier Freight Details and Invoice"},411:{name:"Rail Carrier Freight Details and Invoice Summary"},412:{name:"Trailer or Container Repair Billing"},414:{name:"Rail Carhire Settlements"},417:{name:"Rail Carrier Waybill Interchange"},418:{name:"Rail Advance Interchange Consist"},419:{name:"Advance Car Disposition"},420:{name:"Car Handling Information"},421:{name:"Estimated Time of Arrival and Car Scheduling"},422:{name:"Shipper's Car Order"},423:{name:"Rail Industrial Switch List"},424:{name:"Rail Carrier Services Settlement"},425:{name:"Rail Waybill Request"},426:{name:"Rail Revenue Waybill"},427:{name:"Rail Waybill Response"},429:{name:"Railroad Retirement Activity"},431:{name:"Railroad Station Master File"},432:{name:"Rail Deprescription"},433:{name:"Railroad Reciprocal Switch File"},434:{name:"Railroad Mark Register Update Activity"},435:{name:"Standard Transportation Commodity Code (STCC) Master"},436:{name:"Locomotive Information"},437:{name:"Railroad Junctions and Interchanges Activity"},440:{name:"Shipment Weights"},451:{name:"Railroad Event Report"},452:{name:"Railroad Problem Log Inquiry or Advice"},453:{name:"Railroad Service Commitment Advice"},455:{name:"Railroad Parameter Trace Registration"},456:{name:"Railroad Equipment Inquiry or Advice"},460:{name:"Railroad Price Distribution Request or Response"},463:{name:"Rail Rate Reply"},466:{name:"Rate Request"},468:{name:"Rate Docket Journal Log"},470:{name:"Railroad Clearance"},475:{name:"Rail Route File Maintenance"},485:{name:"Ratemaking Action"},486:{name:"Rate Docket Expiration"},490:{name:"Rate Group Definition"},492:{name:"Miscellaneous Rates"},494:{name:"Rail Scale Rates"},500:{name:"Medical Event Reporting"},501:{name:"Vendor Performance Review"},503:{name:"Pricing History"},504:{name:"Clauses and Provisions"},511:{name:"Requisition"},517:{name:"Material Obligation Validation"},521:{name:"Income or Asset Offset"},527:{name:"Material Due-In and Receipt"},536:{name:"Logistics Reassignment"},540:{name:"Notice of Employment Status"},561:{name:"Contract Abstract"},567:{name:"Contract Completion Status"},568:{name:"Contract Payment Management Report"},601:{name:"U.S. Customs Export Shipment Information"},602:{name:"Transportation Services Tender"},620:{name:"Excavation Communication"},625:{name:"Well Information"},650:{name:"Maintenance Service Order"},715:{name:"Intermodal Group Loading Plan"},805:{name:"Contract Pricing Proposal"},806:{name:"Project Schedule Reporting"},810:{name:"Invoice",edifactId:"INVOIC"},811:{name:"Consolidated Service Invoice/Statement"},812:{name:"Credit/Debit Adjustment"},813:{name:"Electronic Filing of Tax Return Data"},814:{name:"General Request, Response or Confirmation"},815:{name:"Cryptographic Service Message"},816:{name:"Organizational Relationships"},818:{name:"Commission Sales Report"},819:{name:"Operating Expense Statement"},820:{name:"Payment Order/Remittance Advice",edifactId:"REMADV"},821:{name:"Financial Information Reporting"},822:{name:"Account Analysis"},823:{name:"Lockbox"},824:{name:"Application Advice",edifactId:"APERAK"},826:{name:"Tax Information Exchange"},827:{name:"Financial Return Notice"},828:{name:"Debit Authorization"},829:{name:"Payment Cancellation Request"},830:{name:"Planning Schedule with Release Capability",edifactId:"DELFOR"},831:{name:"Application Control Totals"},832:{name:"Price/Sales Catalog",edifactId:"PRICAT"},833:{name:"Mortgage Credit Report Order"},834:{name:"Benefit Enrollment and Maintenance"},835:{name:"Health Care Claim Payment/Advice"},836:{name:"Procurement Notices"},837:{name:"Health Care Claim"},838:{name:"Trading Partner Profile"},839:{name:"Project Cost Reporting"},840:{name:"Request for Quotation",edifactId:"REQUOTE"},841:{name:"Specifications/Technical Information"},842:{name:"Nonconformance Report"},843:{name:"Response to Request for Quotation",edifactId:"QUOTES"},844:{name:"Product Transfer Account Adjustment",edifactId:"SSDCLM"},845:{name:"Price Authorization Acknowledgment/Status",edifactId:"ATHSTS"},846:{name:"Inventory Inquiry/Advice",edifactId:"INVRPT"},847:{name:"Material Claim"},848:{name:"Material Safety Data Sheet"},849:{name:"Response to Product Transfer Account Adjustment"},850:{name:"Purchase Order",edifactId:"ORDERS"},851:{name:"Asset Schedule"},852:{name:"Product Activity Data",edifactId:"SLSRPT"},853:{name:"Routing and Carrier Instruction"},854:{name:"Shipment Delivery Discrepancy Information"},855:{name:"Purchase Order Acknowledgment",edifactId:"ORDRSP"},856:{name:"Advance Ship Notice/Manifest",edifactId:"DESADV"},857:{name:"Shipment and Billing Notice"},858:{name:"Shipment Information"},859:{name:"Freight Invoice"},860:{name:"Purchase Order Change",edifactId:"ORDCHG"},861:{name:"Receiving Advice/Acceptance Certificate",edifactId:"RECADV"},862:{name:"Shipping Schedule",edifactId:"DELJIT"},863:{name:"Report of Test Results"},864:{name:"Text Message"},865:{name:"Purchase Order Change",edifactId:"ORDRSP"},866:{name:"Production Sequence"},867:{name:"Product Transfer and Resale Report",edifactId:"SLSRPT"},868:{name:"Electronic Form Structure"},869:{name:"Order Status Inquiry",edifactId:"ORSSTA"},870:{name:"Order Status Report",edifactId:"ORDREP"},871:{name:"Component Parts Content"},872:{name:"Residential Mortgage Insurance Application"},875:{name:"Grocery Products Purchase Order"},876:{name:"Grocery Products Purchase Order Change"},877:{name:"Manufacturer Coupon Family Code Structure"},878:{name:"Product Authorization/De-authorization"},879:{name:"Price Information"},880:{name:"Grocery Products Invoice"},881:{name:"Manufacturer Coupon Redemption Detail"},882:{name:"Direct Store Delivery Summary Information"},883:{name:"Market Development Fund Allocation"},884:{name:"Market Development Fund Settlement"},885:{name:"Retail Account Characteristics"},886:{name:"Customer Call Reporting"},887:{name:"Coupon Notification"},888:{name:"Item Maintenance"},889:{name:"Promotion Announcement"},891:{name:"Deduction Research Report"},893:{name:"Item Information Request"},894:{name:"Delivery/Return Base Record"},895:{name:"Delivery/Return Acknowledgment or Adjustment"},896:{name:"Product Dimension Maintenance"},920:{name:"Loss or Damage Claim - General Commodities"},924:{name:"Loss or Damage Claim - Motor Vehicle"},925:{name:"Claim Tracer"},926:{name:"Claim Status Report and Tracer Reply"},928:{name:"Automotive Inspection Detail"},940:{name:"Warehouse Shipping Order"},943:{name:"Warehouse Stock Transfer Shipment Advice"},944:{name:"Warehouse Stock Transfer Receipt Advice"},945:{name:"Warehouse Shipping Advice"},947:{name:"Warehouse Inventory Adjustment Advice"},980:{name:"Functional Group Totals"},990:{name:"Response to a Load Tender"},996:{name:"File Transfer"},997:{name:"Functional Acknowledgment",edifactId:"CONTROL"},998:{name:"Set Cancellation"},999:{name:"Implementation Acknowledgment"}});function $(){return(e,n)=>{const t=`_${String(n)}`;Object.defineProperties(e,{[t]:{enumerable:!1,configurable:!0,writable:!0,value:void 0},[n]:{enumerable:!0,configurable:!0,get(){return Number(this[t])},set(a){this[t]=Number(a)}}})}}function K(e){return(n,t,a)=>{const r={...a};return r.get=function(){const c={...r};return c.value=A(r.value,e,this),Object.defineProperty(this,t,c),c.value},r.configurable=!0,delete r.writable,delete r.value,r}}function Y(e,n,t){const a={...t};return t.get=function(){const i={...a};return i.value=I(a.value,this),Object.defineProperty(this,n,i),i.value},t.configurable=!0,delete t.writable,delete t.value,t}function Q(e,n,t,a,r){const i=r,c=i.get,{value:s}=i;return i.get=function(){const m=this,L=s??(typeof c<"u"&&c.call(this));let p;if(typeof L=="function")p=L.bind(this);else throw new Error("The value is not a function");const B={...n,...e};for(const f of Object.keys(n))typeof e[f]=="function"?Object.defineProperty(p,f,{get(){const q=B[f];if(typeof q=="function")return q(m);throw new Error(`Property ${f} is not a function`)}}):p[f]=B[f];return Object.defineProperty(this,a,{writable:!0,configurable:!0,enumerable:i.enumerable,value:p}),p},delete i.value,delete i.writable,i}function X(e,n,t){const a={...t};return a.get=function(){const i={...a};if(!a.value)return a.value;const c=a.value.bind(this);return i.value=()=>setTimeout(c,0),Object.defineProperty(this,n,i),i.value},a.configurable=!0,delete a.writable,delete a.value,a}function J(e,n){return!e||e<n[0]?n[0]:e>n[1]?n[1]:e}function b(e,n=0){const t=String(e).split("."),a=t.length>1?t[1].length:0;let r=e;for(let i=a-1;i>=n;i-=1)r=+`${Math.round(+`${r}e${i}`)}e-${i}`;return r}const Z=5,O=1024;function x(e,n=2){if(e>Number.MAX_SAFE_INTEGER)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.");const t=Math.min(Math.floor(Math.log(e)/Math.log(O)),Z),a=["B","KB","MB","GB","TB","PB"][t],r=t?n:0;return b(e/O**t,r).toFixed(r)+a}function g(e){return typeof e=="string"?e.match(/[^.[\]]+/g)??[]:Array.isArray(e)?Array.from(e):[e]}function ee(e,n,t){const a=Object.getOwnPropertyDescriptor(n,e);a&&Object.defineProperty(t,e,a)}function l(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function v(e){Object.freeze(e);for(const n of Object.keys(e)){const t=e[n];(l(t)||Array.isArray(t))&&v(t)}}var P=(e=>(e[e.ADDITION=0]="ADDITION",e[e.DELETION=1]="DELETION",e[e.ALTERATION=2]="ALTERATION",e))(P||{});function E(e,n,t=[]){let a=[];for(const r of new Set([...Object.keys(e),...Object.keys(n)])){const i=Object.hasOwn(e,r),c=Object.hasOwn(n,r);i&&!c?a.push({type:1,key:r,parentPath:t,objects:[e,n]}):!i&&c?a.push({type:0,key:r,parentPath:t,objects:[e,n]}):l(e[r])&&l(n[r])||Array.isArray(e[r])&&Array.isArray(n[r])?a=a.concat(E(e[r],n[r],[...t,r])):e[r]!==n[r]&&a.push({type:2,key:r,parentPath:t,objects:[e,n]})}return a}function T(e,n){for(const t of Object.keys(e)){const a=e[t];l(a)||Array.isArray(a)?T(a,n):n(t,a,e)}}function D(e,n,t=[]){n(t,e);for(const a of Object.keys(e)){const r=e[a];if(l(r)||Array.isArray(r)){const i=t.concat(a);D(r,n,i)}}}function M(e){return e==null?!0:typeof e=="object"?Array.isArray(e)?e.length===0:e instanceof Map||e instanceof Set?e.size===0:Object.keys(e).length===0:!1}function w(e){return e==null}function y(e,n,t,a=!1){if(M(n))return e;let r=e;for(const i of g(n)){let c=i,s;if(typeof i=="string"){const m=/^([^?]+)(\?)?$/.exec(i);m&&([,c,s]=m)}if(r=r[c],w(r)&&(s||a))return t}return w(r)?t:r}function ne(e,...n){const t=new Set(n),a={};for(const r of Object.keys(e))t.has(r)||(a[r]=e[r]);return a}function te(e,n,t){if(typeof e!="object")throw new Error("object is required");if(M(n))throw new Error("path is required");const a=g(n),r=a.splice(a.length-1,1)[0];let i=e;for(const c of a)if(i=i[c],typeof i!="object")throw new Error(`Cannot set value at given path: Path deadends at ${String(c)}`);i[r]=t}function*ae(e,n){yield e;let t=e;for(const a of g(n))t=t[a],yield t}function h(...e){var t;const n={};for(const a of e)for(const r of Object.keys(a))Object.hasOwn(n,r)&&((t=Object.getOwnPropertyDescriptor(n,r))==null?void 0:t.writable)!==void 0&&l(n[r])?n[r]=h(n[r],a[r]):l(a[r])?n[r]=h({},a[r]):n[r]=a[r];return n}const F=e=>{if(typeof e=="object"&&e!==null){if(typeof Object.getPrototypeOf=="function"){const n=Object.getPrototypeOf(e);return n===Object.prototype||n===null}return Object.prototype.toString.call(e)==="[object Object]"}return!1},u=(...e)=>e.reduce((n,t)=>{if(Array.isArray(t))throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");return Object.keys(t).forEach(a=>{["__proto__","constructor","prototype"].includes(a)||(Array.isArray(n[a])&&Array.isArray(t[a])?n[a]=u.options.mergeArrays?u.options.uniqueArrayItems?Array.from(new Set(n[a].concat(t[a]))):[...n[a],...t[a]]:t[a]:F(n[a])&&F(t[a])?n[a]=u(n[a],t[a]):n[a]=t[a]===void 0?u.options.allowUndefinedOverrides?t[a]:n[a]:t[a])}),n},{}),S={allowUndefinedOverrides:!0,mergeArrays:!0,uniqueArrayItems:!0};u.options=S,u.withOptions=(e,...n)=>{u.options=Object.assign(Object.assign({},S),e);const t=u(...n);return u.options=S,t};function re(e){const n=[];for(const t of Object.keys(e))n.push(e[t]);return n}function ie(e,...n){const t=e.reduce((r,i,c)=>`${r}${c<=n.length?String(n[c-1]):""}${i}`),a=Math.min(...t.split(/[\r\n]/).filter(r=>!!r.trim()).map(r=>{const i=/^ */.exec(r);return i?i[0].length:0}));return t.replace(new RegExp(`^ {${a}}`,"gm"),"").trim()}const oe=1024;function ce(e){const n=/[A-Z]?B$/.exec(e);if(!n)throw new Error(`Input to parseFileSize ("${e}") doesn't seem like a file size; cannot identify a unit (e.g. KB, GB)`);const[t]=n,a=Number(e.replace(t,""));if(Number.isNaN(a))throw new Error(`Could not parse a number out of input to parseFileSize ("${e}")`);const r=["B","KB","MB","GB","TB","PB"].indexOf(t);if(r===-1)throw new Error("parseFileSize does not support units above PB");return Math.ceil(a*oe**r)}const j=/(<%=|{{)(.+?)(%>|}})/g,N=/<%\?(.+?)%>(.+?)<\/%>/g,k=Symbol("sps.utils.templateSrc");function se(e){const n=t=>e.replace(N,(a,r,i)=>y(t,r.trim())?i:"").replace(j,(a,r,i)=>y(t,i.trim(),""));return n[k]=e,n}function me(e){return typeof e=="string"&&(j.test(e)||N.test(e))}function ue(e){return typeof e=="function"&&Object.hasOwn(e,k)}o.CustomEvent=W,o.DiffChange=P,o.EDI_DOCUMENT_TYPE=H,o.Op=R,o.castToNumber=$,o.code=ie,o.constrain=J,o.copyProperty=ee,o.crumblePath=g,o.debounce=A,o.debounced=K,o.decimalRound=b,o.deepFreeze=v,o.diff=E,o.flatten=d,o.forEachEntryDeep=T,o.forEachNestedObject=D,o.getPath=y,o.isSubset=_,o.isTemplate=me,o.isTemplateFn=ue,o.lockToAnimationFrames=I,o.lockedToAnimationFrames=Y,o.mergeDeep=h,o.mergePropertiesDeep=u,o.omit=ne,o.onNextTick=G,o.parseFileSize=ce,o.range=z,o.setPath=te,o.simpleMetadataDecoratorApplicator=Q,o.template=se,o.tickDelay=X,o.toFileSizeString=x,o.traversePath=ae,o.values=re,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(o,d){typeof exports=="object"&&typeof module<"u"?d(exports):typeof define=="function"&&define.amd?define(["exports"],d):(o=typeof globalThis<"u"?globalThis:o||self,d(o.Utils={}))})(this,(function(o){"use strict";function d(e){return Array.isArray(e)?e.reduce((n,a)=>n.concat(d(a)),[]):e}function _(e,n){const a=new Set(n);for(const t of e)if(!a.has(t))return!1;return!0}function U(){return this.pending=!1,typeof this.id<"u"?(clearTimeout(this.id),delete this.id,!0):!1}function A(e,n,a){const t=function(...i){return new Promise((c,s)=>{t.reset&&t.reset(),t.pending=!0;const C=()=>{(async()=>{try{let m=e.apply(a||this,i);m instanceof Promise&&(m=await m),c(m)}catch(m){s(m)}finally{t.reset&&t.reset()}})()};t.id=window.setTimeout(C,n)})};return t.reset=U.bind(t),t}function V(){return this.pending=!1,typeof this.id=="number"?(window.cancelAnimationFrame(this.id),delete this.id,!0):!1}function I(e,n){const a=function(...r){a.pending===!0&&a.reset&&a.reset(),a.id=window.requestAnimationFrame(()=>{e.apply(!!n||this,r),a.reset&&a.reset()}),a.pending=!0};return a.pending=!1,a.reset=V.bind(a),a}function G(e,n){const a=n?e.bind(n):e;setTimeout(a,0)}const R={add:(e,n)=>e+n,and:(e,n)=>e&&n,band:(e,n)=>e&n,bor:(e,n)=>e|n,bxor:(e,n)=>e^n,bnot:e=>~e,decr:e=>e-1,div:(e,n)=>e/n,eq:(e,n)=>e===n,exp:(e,n)=>e**n,gt:(e,n)=>e>n,gte:(e,n)=>e>=n,incr:e=>e+1,lshift:(e,n)=>e<<n,lt:(e,n)=>e<n,lte:(e,n)=>e<=n,mul:(e,n)=>e*n,neg:e=>-e,neq:(e,n)=>e!==n,not:e=>!e,or:(e,n)=>e||n,rem:(e,n)=>e%n,rshift:(e,n)=>e>>n,rshift_zf:(e,n)=>e>>>n,sub:(e,n)=>e-n,xor:(e,n)=>!!((e||n)&&!(e&&n))};function z(e,n){if(!Number.isInteger(e))throw new Error("start must be an integer");if(!Number.isInteger(n))throw new Error("end must be an integer");return new Array(Math.abs(n-e)+1).fill(e).map(e>n?R.sub:R.add)}class W{constructor(n,a={}){let t;if(typeof Event=="function")t=new Event(n,a);else{t=document.createEvent("Event"),t.initEvent(n,a.bubbles,a.cancelable);for(const i of Object.keys(a))i!=="bubbles"&&i!=="cancelable"&&(t[i]=a[i])}Object.setPrototypeOf(this,t);const r=Object.getOwnPropertyDescriptors(Event.prototype);for(const i of Object.keys(r)){const c=r[i];for(const s of Object.keys(c))typeof c[s]=="function"&&(c[s]=c[s].bind(t))}Object.defineProperties(this,r)}}const H=Object.freeze({100:{name:"Insurance Plan Description"},101:{name:"Name and Address Lists"},104:{name:"Air Shipment Information"},106:{name:"Motor Carrier Rate Proposal"},107:{name:"Request for Motor Carrier Rate Proposal"},108:{name:"Response to a Motor Carrier Rate Proposal"},109:{name:"Vessel Content Details"},110:{name:"Air Freight Details and Invoice"},112:{name:"Property Damage Report"},120:{name:"Vehicle Shipping Order"},121:{name:"Vehicle Service"},124:{name:"Vehicle Damage"},125:{name:"Multilevel Railcar Load Details"},126:{name:"Vehicle Application Advice"},127:{name:"Vehicle Baying Order"},128:{name:"Dealer Information"},129:{name:"Vehicle Carrier Rate Update"},130:{name:"Student Educational Record (Transcript)"},131:{name:"Student Educational Record (Transcript) Acknowledgment"},135:{name:"Student Loan Application"},138:{name:"Testing Results Request and Report"},139:{name:"Student Loan Guarantee Result"},140:{name:"Product Registration"},141:{name:"Product Service Claim Response"},142:{name:"Product Service Claim"},143:{name:"Product Service Notification"},144:{name:"Student Loan Transfer and Status Verification"},146:{name:"Request for Student Educational Record (Transcript)"},147:{name:"Response to Request for Student Educational Record (Transcript)"},148:{name:"Report of Injury, Illness or Incident"},149:{name:"Notice of Tax Adjustment or Assessment"},150:{name:"Tax Rate Notification"},151:{name:"Electronic Filing of Tax Return Data Acknowledgment"},152:{name:"Statistical Government Information"},153:{name:"Unemployment Insurance Tax Claim or Charge Information"},154:{name:"Uniform Commercial Code Filing"},155:{name:"Business Credit Report"},157:{name:"Notice of Power of Attorney"},159:{name:"Motion Picture Booking Confirmation"},160:{name:"Transportation Automatic Equipment Identification"},161:{name:"Train Sheet"},169:{name:"Transportation Appointment Schedule Information"},170:{name:"Revenue Receipts Statement"},175:{name:"Court and Law Enforcement Notice"},176:{name:"Court Submission TYPE"},180:{name:"Return Merchandise Authorization and Notification"},185:{name:"Royalty Regulatory Report"},186:{name:"Insurance Underwriting Requirements Reporting"},188:{name:"Educational Course Inventory"},189:{name:"Application for Admission to Educational Institutions"},190:{name:"Student Enrollment Verification"},191:{name:"Student Loan Pre-Claims and Claims"},194:{name:"Grant or Assistance Application"},195:{name:"Federal Communications Commission (FCC) License Application"},196:{name:"Contractor Cost Data Reporting"},197:{name:"Real Estate Title Evidence"},198:{name:"Loan Verification Information"},199:{name:"Real Estate Settlement Information"},200:{name:"Mortgage Credit Report"},201:{name:"Residential Loan Application"},202:{name:"Secondary Mortgage Market Loan Delivery"},203:{name:"Secondary Mortgage Market Investor Report"},204:{name:"Motor Carrier Load Tender"},205:{name:"Mortgage Note"},206:{name:"Real Estate Inspection"},210:{name:"Motor Carrier Freight Details and Invoice"},211:{name:"Motor Carrier Bill of Lading",edifactId:"IFTMCE"},212:{name:"Motor Carrier Delivery Trailer Manifest"},213:{name:"Motor Carrier Shipment Status Inquiry"},214:{name:"Transportation Carrier Shipment Status Message"},215:{name:"Motor Carrier Pick-up Manifest"},216:{name:"Motor Carrier Shipment Pick-up Notification"},217:{name:"Motor Carrier Loading and Route Guide"},218:{name:"Motor Carrier Tariff Information"},219:{name:"Logistics Service Request"},220:{name:"Logistics Service Response"},222:{name:"Cartage Work Assignment"},223:{name:"Consolidators Freight Bill and Invoice"},224:{name:"Motor Carrier Summary Freight Bill Manifest"},225:{name:"Response to a Cartage Work Assignment"},240:{name:"Motor Carrier Package Status"},242:{name:"Data Status Tracking"},244:{name:"Product Source Information"},248:{name:"Account Assignment/Inquiry and Service/Status"},249:{name:"Animal Toxicological Data"},250:{name:"Purchase Order Shipment Management Document"},251:{name:"Pricing Support"},252:{name:"Insurance Producer Administration"},255:{name:"Underwriting Information Services"},256:{name:"Periodic Compensation"},260:{name:"Application for Mortgage Insurance Benefits"},261:{name:"Real Estate Information Request"},262:{name:"Real Estate Information Report"},263:{name:"Residential Mortgage Insurance Application Response"},264:{name:"Mortgage Loan Default Status"},265:{name:"Real Estate Title Insurance Services Order"},266:{name:"Mortgage or Property Record Change Notification"},267:{name:"Individual Life, Annuity and Disability Application"},268:{name:"Annuity Activity"},270:{name:"Eligibility, Coverage or Benefit Inquiry"},271:{name:"Eligibility, Coverage or Benefit Information"},272:{name:"Property and Casualty Loss Notification"},273:{name:"Insurance/Annuity Application Status"},274:{name:"Health Care Provider Information"},275:{name:"Patient Information"},276:{name:"Health Care Claim Status Request"},277:{name:"Health Care Claim Status Notification"},278:{name:"Health Care Services Insurance/Benefit Review Information"},280:{name:"Voter Registration Information"},285:{name:"Commercial Vehicle Safety and Credentials Information Exchange"},286:{name:"Commercial Vehicle Credentials"},288:{name:"Wage Determination"},290:{name:"Cooperative Advertising Agreements"},300:{name:"Reservation (Booking Request) (Ocean)"},301:{name:"Confirmation (Ocean)",edifactId:"IFTMBC"},303:{name:"Booking Cancellation (Ocean)"},304:{name:"Shipping Instructions"},309:{name:"U.S. Customs Manifest"},310:{name:"Freight Receipt and Invoice (Ocean)"},311:{name:"Canadian Customs Information"},312:{name:"Arrival Notice (Ocean)"},313:{name:"Shipment Status Inquiry (Ocean)"},315:{name:"Status Details (Ocean)"},317:{name:"Delivery/Pickup Order"},319:{name:"Terminal Information"},322:{name:"Terminal Operations and Intermodal Ramp Activity"},323:{name:"Vessel Schedule and Itinerary (Ocean)"},324:{name:"Vessel Stow Plan (Ocean)"},325:{name:"Consolidation of Goods In Container"},326:{name:"Consignment Summary List"},350:{name:"U.S. Customs Status Information"},352:{name:"U.S. Customs Carrier General Order Status"},353:{name:"U.S. Customs Events Advisory Details"},354:{name:"U.S. Customs Automated Manifest Archive Status"},355:{name:"U.S. Customs Acceptance/Rejection"},356:{name:"U.S. Customs Permit to Transfer Request"},357:{name:"U.S. Customs In-Bond Information"},358:{name:"U.S. Customs Consist Information"},361:{name:"Carrier Interchange Agreement (Ocean)"},362:{name:"Cargo Insurance Advice of Shipment"},404:{name:"Rail Carrier Shipment Information"},410:{name:"Rail Carrier Freight Details and Invoice"},411:{name:"Rail Carrier Freight Details and Invoice Summary"},412:{name:"Trailer or Container Repair Billing"},414:{name:"Rail Carhire Settlements"},417:{name:"Rail Carrier Waybill Interchange"},418:{name:"Rail Advance Interchange Consist"},419:{name:"Advance Car Disposition"},420:{name:"Car Handling Information"},421:{name:"Estimated Time of Arrival and Car Scheduling"},422:{name:"Shipper's Car Order"},423:{name:"Rail Industrial Switch List"},424:{name:"Rail Carrier Services Settlement"},425:{name:"Rail Waybill Request"},426:{name:"Rail Revenue Waybill"},427:{name:"Rail Waybill Response"},429:{name:"Railroad Retirement Activity"},431:{name:"Railroad Station Master File"},432:{name:"Rail Deprescription"},433:{name:"Railroad Reciprocal Switch File"},434:{name:"Railroad Mark Register Update Activity"},435:{name:"Standard Transportation Commodity Code (STCC) Master"},436:{name:"Locomotive Information"},437:{name:"Railroad Junctions and Interchanges Activity"},440:{name:"Shipment Weights"},451:{name:"Railroad Event Report"},452:{name:"Railroad Problem Log Inquiry or Advice"},453:{name:"Railroad Service Commitment Advice"},455:{name:"Railroad Parameter Trace Registration"},456:{name:"Railroad Equipment Inquiry or Advice"},460:{name:"Railroad Price Distribution Request or Response"},463:{name:"Rail Rate Reply"},466:{name:"Rate Request"},468:{name:"Rate Docket Journal Log"},470:{name:"Railroad Clearance"},475:{name:"Rail Route File Maintenance"},485:{name:"Ratemaking Action"},486:{name:"Rate Docket Expiration"},490:{name:"Rate Group Definition"},492:{name:"Miscellaneous Rates"},494:{name:"Rail Scale Rates"},500:{name:"Medical Event Reporting"},501:{name:"Vendor Performance Review"},503:{name:"Pricing History"},504:{name:"Clauses and Provisions"},511:{name:"Requisition"},517:{name:"Material Obligation Validation"},521:{name:"Income or Asset Offset"},527:{name:"Material Due-In and Receipt"},536:{name:"Logistics Reassignment"},540:{name:"Notice of Employment Status"},561:{name:"Contract Abstract"},567:{name:"Contract Completion Status"},568:{name:"Contract Payment Management Report"},601:{name:"U.S. Customs Export Shipment Information"},602:{name:"Transportation Services Tender"},620:{name:"Excavation Communication"},625:{name:"Well Information"},650:{name:"Maintenance Service Order"},715:{name:"Intermodal Group Loading Plan"},805:{name:"Contract Pricing Proposal"},806:{name:"Project Schedule Reporting"},810:{name:"Invoice",edifactId:"INVOIC"},811:{name:"Consolidated Service Invoice/Statement"},812:{name:"Credit/Debit Adjustment"},813:{name:"Electronic Filing of Tax Return Data"},814:{name:"General Request, Response or Confirmation"},815:{name:"Cryptographic Service Message"},816:{name:"Organizational Relationships"},818:{name:"Commission Sales Report"},819:{name:"Operating Expense Statement"},820:{name:"Payment Order/Remittance Advice",edifactId:"REMADV"},821:{name:"Financial Information Reporting"},822:{name:"Account Analysis"},823:{name:"Lockbox"},824:{name:"Application Advice",edifactId:"APERAK"},826:{name:"Tax Information Exchange"},827:{name:"Financial Return Notice"},828:{name:"Debit Authorization"},829:{name:"Payment Cancellation Request"},830:{name:"Planning Schedule with Release Capability",edifactId:"DELFOR"},831:{name:"Application Control Totals"},832:{name:"Price/Sales Catalog",edifactId:"PRICAT"},833:{name:"Mortgage Credit Report Order"},834:{name:"Benefit Enrollment and Maintenance"},835:{name:"Health Care Claim Payment/Advice"},836:{name:"Procurement Notices"},837:{name:"Health Care Claim"},838:{name:"Trading Partner Profile"},839:{name:"Project Cost Reporting"},840:{name:"Request for Quotation",edifactId:"REQUOTE"},841:{name:"Specifications/Technical Information"},842:{name:"Nonconformance Report"},843:{name:"Response to Request for Quotation",edifactId:"QUOTES"},844:{name:"Product Transfer Account Adjustment",edifactId:"SSDCLM"},845:{name:"Price Authorization Acknowledgment/Status",edifactId:"ATHSTS"},846:{name:"Inventory Inquiry/Advice",edifactId:"INVRPT"},847:{name:"Material Claim"},848:{name:"Material Safety Data Sheet"},849:{name:"Response to Product Transfer Account Adjustment"},850:{name:"Purchase Order",edifactId:"ORDERS"},851:{name:"Asset Schedule"},852:{name:"Product Activity Data",edifactId:"SLSRPT"},853:{name:"Routing and Carrier Instruction"},854:{name:"Shipment Delivery Discrepancy Information"},855:{name:"Purchase Order Acknowledgment",edifactId:"ORDRSP"},856:{name:"Advance Ship Notice/Manifest",edifactId:"DESADV"},857:{name:"Shipment and Billing Notice"},858:{name:"Shipment Information"},859:{name:"Freight Invoice"},860:{name:"Purchase Order Change",edifactId:"ORDCHG"},861:{name:"Receiving Advice/Acceptance Certificate",edifactId:"RECADV"},862:{name:"Shipping Schedule",edifactId:"DELJIT"},863:{name:"Report of Test Results"},864:{name:"Text Message"},865:{name:"Purchase Order Change",edifactId:"ORDRSP"},866:{name:"Production Sequence"},867:{name:"Product Transfer and Resale Report",edifactId:"SLSRPT"},868:{name:"Electronic Form Structure"},869:{name:"Order Status Inquiry",edifactId:"ORSSTA"},870:{name:"Order Status Report",edifactId:"ORDREP"},871:{name:"Component Parts Content"},872:{name:"Residential Mortgage Insurance Application"},875:{name:"Grocery Products Purchase Order"},876:{name:"Grocery Products Purchase Order Change"},877:{name:"Manufacturer Coupon Family Code Structure"},878:{name:"Product Authorization/De-authorization"},879:{name:"Price Information"},880:{name:"Grocery Products Invoice"},881:{name:"Manufacturer Coupon Redemption Detail"},882:{name:"Direct Store Delivery Summary Information"},883:{name:"Market Development Fund Allocation"},884:{name:"Market Development Fund Settlement"},885:{name:"Retail Account Characteristics"},886:{name:"Customer Call Reporting"},887:{name:"Coupon Notification"},888:{name:"Item Maintenance"},889:{name:"Promotion Announcement"},891:{name:"Deduction Research Report"},893:{name:"Item Information Request"},894:{name:"Delivery/Return Base Record"},895:{name:"Delivery/Return Acknowledgment or Adjustment"},896:{name:"Product Dimension Maintenance"},920:{name:"Loss or Damage Claim - General Commodities"},924:{name:"Loss or Damage Claim - Motor Vehicle"},925:{name:"Claim Tracer"},926:{name:"Claim Status Report and Tracer Reply"},928:{name:"Automotive Inspection Detail"},940:{name:"Warehouse Shipping Order"},943:{name:"Warehouse Stock Transfer Shipment Advice"},944:{name:"Warehouse Stock Transfer Receipt Advice"},945:{name:"Warehouse Shipping Advice"},947:{name:"Warehouse Inventory Adjustment Advice"},980:{name:"Functional Group Totals"},990:{name:"Response to a Load Tender"},996:{name:"File Transfer"},997:{name:"Functional Acknowledgment",edifactId:"CONTROL"},998:{name:"Set Cancellation"},999:{name:"Implementation Acknowledgment"}});function $(){return(e,n)=>{const a=`_${String(n)}`;Object.defineProperties(e,{[a]:{enumerable:!1,configurable:!0,writable:!0,value:void 0},[n]:{enumerable:!0,configurable:!0,get(){return Number(this[a])},set(t){this[a]=Number(t)}}})}}function K(e){return(n,a,t)=>{const r={...t};return r.get=function(){const c={...r};return c.value=A(r.value,e,this),Object.defineProperty(this,a,c),c.value},r.configurable=!0,delete r.writable,delete r.value,r}}function Y(e,n,a){const t={...a};return a.get=function(){const i={...t};return i.value=I(t.value,this),Object.defineProperty(this,n,i),i.value},a.configurable=!0,delete a.writable,delete a.value,a}function Q(e,n,a,t,r){const i=r,c=i.get,{value:s}=i;return i.get=function(){const m=this,L=s??(typeof c<"u"&&c.call(this));let p;if(typeof L=="function")p=L.bind(this);else throw new Error("The value is not a function");const B={...n,...e};for(const f of Object.keys(n))typeof e[f]=="function"?Object.defineProperty(p,f,{get(){const q=B[f];if(typeof q=="function")return q(m);throw new Error(`Property ${f} is not a function`)}}):p[f]=B[f];return Object.defineProperty(this,t,{writable:!0,configurable:!0,enumerable:i.enumerable,value:p}),p},delete i.value,delete i.writable,i}function X(e,n,a){const t={...a};return t.get=function(){const i={...t};if(!t.value)return t.value;const c=t.value.bind(this);return i.value=()=>setTimeout(c,0),Object.defineProperty(this,n,i),i.value},t.configurable=!0,delete t.writable,delete t.value,t}function J(e,n){return!e||e<n[0]?n[0]:e>n[1]?n[1]:e}function b(e,n=0){const a=String(e).split("."),t=a.length>1?a[1].length:0;let r=e;for(let i=t-1;i>=n;i-=1)r=+`${Math.round(+`${r}e${i}`)}e-${i}`;return r}const Z=5,O=1024;function x(e,n=2){if(e>Number.MAX_SAFE_INTEGER)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.");const a=Math.min(Math.floor(Math.log(e)/Math.log(O)),Z),t=["B","KB","MB","GB","TB","PB"][a],r=a?n:0;return b(e/O**a,r).toFixed(r)+t}function g(e){return typeof e=="string"?e.match(/[^.[\]]+/g)??[]:Array.isArray(e)?Array.from(e):[e]}function ee(e,n,a){const t=Object.getOwnPropertyDescriptor(n,e);t&&Object.defineProperty(a,e,t)}function l(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function v(e){Object.freeze(e);for(const n of Object.keys(e)){const a=e[n];(l(a)||Array.isArray(a))&&v(a)}}var P=(e=>(e[e.ADDITION=0]="ADDITION",e[e.DELETION=1]="DELETION",e[e.ALTERATION=2]="ALTERATION",e))(P||{});function E(e,n,a=[]){let t=[];for(const r of new Set([...Object.keys(e),...Object.keys(n)])){const i=Object.hasOwn(e,r),c=Object.hasOwn(n,r);i&&!c?t.push({type:1,key:r,parentPath:a,objects:[e,n]}):!i&&c?t.push({type:0,key:r,parentPath:a,objects:[e,n]}):l(e[r])&&l(n[r])||Array.isArray(e[r])&&Array.isArray(n[r])?t=t.concat(E(e[r],n[r],[...a,r])):e[r]!==n[r]&&t.push({type:2,key:r,parentPath:a,objects:[e,n]})}return t}function T(e,n){for(const a of Object.keys(e)){const t=e[a];l(t)||Array.isArray(t)?T(t,n):n(a,t,e)}}function D(e,n,a=[]){n(a,e);for(const t of Object.keys(e)){const r=e[t];if(l(r)||Array.isArray(r)){const i=a.concat(t);D(r,n,i)}}}function M(e){return e==null?!0:typeof e=="object"?Array.isArray(e)?e.length===0:e instanceof Map||e instanceof Set?e.size===0:Object.keys(e).length===0:!1}function w(e){return e==null}function y(e,n,a,t=!1){if(M(n))return e;let r=e;for(const i of g(n)){let c=i,s;if(typeof i=="string"){const m=/^([^?]+)(\?)?$/.exec(i);m&&([,c,s]=m)}if(r=r[c],w(r)&&(s||t))return a}return w(r)?a:r}function ne(e,...n){const a=new Set(n),t={};for(const r of Object.keys(e))a.has(r)||(t[r]=e[r]);return t}function te(e,n,a){if(typeof e!="object")throw new Error("object is required");if(M(n))throw new Error("path is required");const t=g(n),r=t.splice(t.length-1,1)[0];let i=e;for(const c of t)if(i=i[c],typeof i!="object")throw new Error(`Cannot set value at given path: Path deadends at ${String(c)}`);i[r]=a}function*ae(e,n){yield e;let a=e;for(const t of g(n))a=a[t],yield a}function h(...e){const n={};for(const a of e)for(const t of Object.keys(a))Object.hasOwn(n,t)&&Object.getOwnPropertyDescriptor(n,t)?.writable!==void 0&&l(n[t])?n[t]=h(n[t],a[t]):l(a[t])?n[t]=h({},a[t]):n[t]=a[t];return n}const F=e=>{if(typeof e=="object"&&e!==null){if(typeof Object.getPrototypeOf=="function"){const n=Object.getPrototypeOf(e);return n===Object.prototype||n===null}return Object.prototype.toString.call(e)==="[object Object]"}return!1},u=(...e)=>e.reduce((n,a)=>{if(Array.isArray(a))throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");return Object.keys(a).forEach(t=>{["__proto__","constructor","prototype"].includes(t)||(Array.isArray(n[t])&&Array.isArray(a[t])?n[t]=u.options.mergeArrays?u.options.uniqueArrayItems?Array.from(new Set(n[t].concat(a[t]))):[...n[t],...a[t]]:a[t]:F(n[t])&&F(a[t])?n[t]=u(n[t],a[t]):n[t]=a[t]===void 0?u.options.allowUndefinedOverrides?a[t]:n[t]:a[t])}),n},{}),S={allowUndefinedOverrides:!0,mergeArrays:!0,uniqueArrayItems:!0};u.options=S,u.withOptions=(e,...n)=>{u.options=Object.assign(Object.assign({},S),e);const a=u(...n);return u.options=S,a};function re(e){const n=[];for(const a of Object.keys(e))n.push(e[a]);return n}function ie(e,...n){const a=e.reduce((r,i,c)=>`${r}${c<=n.length?String(n[c-1]):""}${i}`),t=Math.min(...a.split(/[\r\n]/).filter(r=>!!r.trim()).map(r=>{const i=/^ */.exec(r);return i?i[0].length:0}));return a.replace(new RegExp(`^ {${t}}`,"gm"),"").trim()}const oe=1024;function ce(e){const n=/[A-Z]?B$/.exec(e);if(!n)throw new Error(`Input to parseFileSize ("${e}") doesn't seem like a file size; cannot identify a unit (e.g. KB, GB)`);const[a]=n,t=Number(e.replace(a,""));if(Number.isNaN(t))throw new Error(`Could not parse a number out of input to parseFileSize ("${e}")`);const r=["B","KB","MB","GB","TB","PB"].indexOf(a);if(r===-1)throw new Error("parseFileSize does not support units above PB");return Math.ceil(t*oe**r)}const j=/(<%=|{{)(.+?)(%>|}})/g,N=/<%\?(.+?)%>(.+?)<\/%>/g,k=Symbol("sps.utils.templateSrc");function se(e){const n=a=>e.replace(N,(t,r,i)=>y(a,r.trim())?i:"").replace(j,(t,r,i)=>y(a,i.trim(),""));return n[k]=e,n}function me(e){return typeof e=="string"&&(j.test(e)||N.test(e))}function ue(e){return typeof e=="function"&&Object.hasOwn(e,k)}o.CustomEvent=W,o.DiffChange=P,o.EDI_DOCUMENT_TYPE=H,o.Op=R,o.castToNumber=$,o.code=ie,o.constrain=J,o.copyProperty=ee,o.crumblePath=g,o.debounce=A,o.debounced=K,o.decimalRound=b,o.deepFreeze=v,o.diff=E,o.flatten=d,o.forEachEntryDeep=T,o.forEachNestedObject=D,o.getPath=y,o.isSubset=_,o.isTemplate=me,o.isTemplateFn=ue,o.lockToAnimationFrames=I,o.lockedToAnimationFrames=Y,o.mergeDeep=h,o.mergePropertiesDeep=u,o.omit=ne,o.onNextTick=G,o.parseFileSize=ce,o.range=z,o.setPath=te,o.simpleMetadataDecoratorApplicator=Q,o.template=se,o.tickDelay=X,o.toFileSizeString=x,o.traversePath=ae,o.values=re,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spscommerce/utils",
|
|
3
3
|
"description": "Utility items for frontend projects.",
|
|
4
|
-
"version": "7.4.
|
|
4
|
+
"version": "7.4.2",
|
|
5
5
|
"author": "SPS Commerce",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"repository": "https://github.com/spscommerce/design-system/tree/main/packages/@spscommerce/utils",
|