@synnaxlabs/x 0.46.2 → 0.48.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/.turbo/turbo-build.log +18 -18
- package/dist/{bounds-DeUXrllt.js → bounds-4BWKPqaP.js} +1 -4
- package/dist/bounds.js +1 -1
- package/dist/{index-C452Pas0.js → compare-Bnx9CdjS.js} +37 -47
- package/dist/compare-GPoFaKRW.cjs +1 -0
- package/dist/compare.cjs +1 -1
- package/dist/compare.js +34 -2
- package/dist/eslint.config.d.ts +3 -0
- package/dist/eslint.config.d.ts.map +1 -0
- package/dist/{index-D4NCYiQB.js → index-Bv029kh3.js} +2 -2
- package/dist/{index-udOjA9d-.cjs → index-CqisIWWC.cjs} +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.js +489 -465
- package/dist/{scale-BBWhTUqJ.js → scale-DJCMZbfU.js} +1 -1
- package/dist/scale.js +1 -1
- package/dist/series-B7l2au4y.cjs +6 -0
- package/dist/{series-Clbw-fZI.js → series-TpAaBlEg.js} +172 -145
- package/dist/spatial.js +2 -2
- package/dist/src/array/nullable.d.ts.map +1 -1
- package/dist/src/compare/binary.d.ts +25 -0
- package/dist/src/compare/binary.d.ts.map +1 -0
- package/dist/src/compare/binary.spec.d.ts +2 -0
- package/dist/src/compare/binary.spec.d.ts.map +1 -0
- package/dist/src/compare/external.d.ts +3 -0
- package/dist/src/compare/external.d.ts.map +1 -0
- package/dist/src/compare/index.d.ts +1 -1
- package/dist/src/compare/index.d.ts.map +1 -1
- package/dist/src/csv/csv.d.ts +11 -0
- package/dist/src/csv/csv.d.ts.map +1 -0
- package/dist/src/csv/csv.spec.d.ts +2 -0
- package/dist/src/csv/csv.spec.d.ts.map +1 -0
- package/dist/src/csv/index.d.ts +2 -0
- package/dist/src/csv/index.d.ts.map +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/migrate/migrate.d.ts +1 -1
- package/dist/src/migrate/migrate.d.ts.map +1 -1
- package/dist/src/spatial/bounds/bounds.d.ts.map +1 -1
- package/dist/src/spatial/box/box.d.ts +5 -5
- package/dist/src/spatial/box/box.d.ts.map +1 -1
- package/dist/src/spatial/scale/scale.d.ts +6 -6
- package/dist/src/spatial/scale/scale.d.ts.map +1 -1
- package/dist/src/telem/telem.d.ts +14 -0
- package/dist/src/telem/telem.d.ts.map +1 -1
- package/dist/telem.cjs +1 -1
- package/dist/telem.js +1 -1
- package/dist/unique.cjs +1 -1
- package/dist/unique.js +1 -1
- package/package.json +9 -9
- package/src/array/nullable.ts +9 -0
- package/src/compare/binary.spec.ts +308 -0
- package/src/compare/binary.ts +50 -0
- package/src/compare/external.ts +11 -0
- package/src/compare/index.ts +1 -1
- package/src/csv/csv.spec.ts +28 -0
- package/src/csv/csv.ts +26 -0
- package/src/csv/index.ts +10 -0
- package/src/index.ts +1 -0
- package/src/jsonrpc/jsonrpc.spec.ts +9 -0
- package/src/math/round.spec.ts +2 -1
- package/src/migrate/migrate.spec.ts +238 -0
- package/src/migrate/migrate.ts +62 -4
- package/src/spatial/bounds/bounds.spec.ts +1 -1
- package/src/spatial/bounds/bounds.ts +9 -12
- package/src/spatial/box/box.spec.ts +3 -3
- package/src/spatial/box/box.ts +5 -5
- package/src/spatial/dimensions/dimensions.spec.ts +1 -1
- package/src/spatial/direction/direction.spec.ts +1 -1
- package/src/spatial/location/location.spec.ts +1 -1
- package/src/spatial/scale/scale.spec.ts +1 -1
- package/src/spatial/scale/scale.ts +7 -7
- package/src/telem/telem.spec.ts +87 -0
- package/src/telem/telem.ts +48 -0
- package/tsconfig.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/index-xaxa1hoa.cjs +0 -1
- package/dist/series-B2zqvP8A.cjs +0 -6
- /package/{eslint.config.js → eslint.config.ts} +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { z as o } from "zod";
|
|
2
2
|
import { J as k } from "./index-yz34Wc2p.js";
|
|
3
3
|
import { s as ft } from "./index-qmkoZBNO.js";
|
|
4
|
-
import { V as R, i as U, n as ct } from "./
|
|
5
|
-
import { a as P, s as F, m as C, d as Y, c as L, e as X, f as $, g as ht, t as dt, h as gt } from "./bounds-
|
|
4
|
+
import { V as R, i as U, n as ct } from "./compare-Bnx9CdjS.js";
|
|
5
|
+
import { a as P, s as F, m as C, d as Y, c as L, e as X, f as $, g as ht, t as dt, h as gt } from "./bounds-4BWKPqaP.js";
|
|
6
6
|
import "./box-BXWXSkKu.js";
|
|
7
7
|
import "./dimensions-DC0uLPwn.js";
|
|
8
8
|
import "./base-DRybODwJ.js";
|
|
9
9
|
import "./location-BIzpxczO.js";
|
|
10
|
-
import "./scale-
|
|
10
|
+
import "./scale-DJCMZbfU.js";
|
|
11
11
|
import "./xy-DnrCAZaw.js";
|
|
12
12
|
let _ = (u, t = 21) => (e = t) => {
|
|
13
13
|
let s = "", i = e | 0;
|
|
@@ -15,14 +15,14 @@ let _ = (u, t = 21) => (e = t) => {
|
|
|
15
15
|
s += u[Math.random() * u.length | 0];
|
|
16
16
|
return s;
|
|
17
17
|
};
|
|
18
|
-
const tt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", Ot = `0123456789${tt}`, et = 11, wt = _(tt, 1), bt = _(Ot, et - 1), st = () => `${wt()}${bt()}`,
|
|
18
|
+
const tt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", Ot = `0123456789${tt}`, et = 11, wt = _(tt, 1), bt = _(Ot, et - 1), st = () => `${wt()}${bt()}`, Qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
19
19
|
__proto__: null,
|
|
20
20
|
LENGTH: et,
|
|
21
21
|
create: st
|
|
22
22
|
}, Symbol.toStringTag, { value: "Module" })), nt = (u, t) => (e) => e instanceof t || typeof e == "object" && e !== null && "discriminator" in e && e.discriminator === u, zt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
23
23
|
__proto__: null,
|
|
24
24
|
createMatcher: nt
|
|
25
|
-
}, Symbol.toStringTag, { value: "Module" })), _t = 2 ** 8 - 1, te = 2 ** 16 - 1, ee = 2 ** 32 - 1, se = 2n ** 64n - 1n, ne = 2 ** 64 - 1, re = -128, ie = 2 ** 7 - 1, ae = -32768, ue = 2 ** 15 - 1, oe = -2147483648, le = 2 ** 31 - 1, fe = -(2n ** 63n), G = 2n ** 63n - 1n, ce = -9223372036854776e3,
|
|
25
|
+
}, Symbol.toStringTag, { value: "Module" })), It = o.enum(["static", "dynamic"]), _t = 2 ** 8 - 1, te = 2 ** 16 - 1, ee = 2 ** 32 - 1, se = 2n ** 64n - 1n, ne = 2 ** 64 - 1, re = -128, ie = 2 ** 7 - 1, ae = -32768, ue = 2 ** 15 - 1, oe = -2147483648, le = 2 ** 31 - 1, fe = -(2n ** 63n), G = 2n ** 63n - 1n, ce = -9223372036854776e3, Nt = 2 ** 63 - 1, K = 365, q = 30, mt = o.union([
|
|
26
26
|
o.tuple([o.int()]),
|
|
27
27
|
o.tuple([o.int(), o.int().min(1).max(12)]),
|
|
28
28
|
o.tuple([o.int(), o.int().min(1).max(12), o.int().min(1).max(31)])
|
|
@@ -53,7 +53,7 @@ class r extends R {
|
|
|
53
53
|
else if (Array.isArray(t)) super(r.parseDate(t));
|
|
54
54
|
else {
|
|
55
55
|
let s = 0n;
|
|
56
|
-
t instanceof Number && (t = t.valueOf()), e === "local" && (s = r.utcOffset.valueOf()), typeof t == "number" && (isFinite(t) ? t ===
|
|
56
|
+
t instanceof Number && (t = t.valueOf()), e === "local" && (s = r.utcOffset.valueOf()), typeof t == "number" && (isFinite(t) ? t === Nt ? t = G : t = Math.trunc(t) : (isNaN(t) && (t = 0), t === 1 / 0 ? t = r.MAX : t = r.MIN)), U(t) && (t = t.value), super(BigInt(t.valueOf()) + s);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
static parseDate([t = 1970, e = 1, s = 1]) {
|
|
@@ -69,17 +69,28 @@ class r extends R {
|
|
|
69
69
|
}
|
|
70
70
|
static parseTimeString(t, e = "UTC") {
|
|
71
71
|
const [s, i, l] = t.split(":");
|
|
72
|
-
let
|
|
73
|
-
l != null && ([
|
|
74
|
-
let
|
|
75
|
-
return e === "local" && (
|
|
72
|
+
let c = "00", y = "00";
|
|
73
|
+
l != null && ([c, y] = l.split("."));
|
|
74
|
+
let v = r.hours(parseInt(s ?? "00")).add(r.minutes(parseInt(i ?? "00"))).add(r.seconds(parseInt(c ?? "00"))).add(r.milliseconds(parseInt(y ?? "00")));
|
|
75
|
+
return e === "local" && (v = v.add(r.utcOffset)), v.valueOf();
|
|
76
76
|
}
|
|
77
77
|
static parseDateTimeString(t, e = "UTC") {
|
|
78
78
|
if (!t.includes("/") && !t.includes("-"))
|
|
79
79
|
return r.parseTimeString(t, e);
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
if (t.match(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,3})?$/) != null) {
|
|
81
|
+
let l = t, c = 0;
|
|
82
|
+
if (t.includes(".")) {
|
|
83
|
+
const w = t.split(".");
|
|
84
|
+
l = w[0];
|
|
85
|
+
const b = w[1] || "0";
|
|
86
|
+
c = parseInt(b.padEnd(3, "0").slice(0, 3));
|
|
87
|
+
}
|
|
88
|
+
const y = e === "local" ? new Date(l.replace("T", " ")) : /* @__PURE__ */ new Date(`${l}Z`), v = BigInt(y.getTime()) * r.MILLISECOND.valueOf(), O = BigInt(c) * r.MILLISECOND.valueOf();
|
|
89
|
+
return v + O;
|
|
90
|
+
}
|
|
91
|
+
const i = new Date(t);
|
|
92
|
+
return t.includes(":") || i.setUTCHours(0, 0, 0, 0), new r(
|
|
93
|
+
BigInt(i.getTime()) * r.MILLISECOND.valueOf(),
|
|
83
94
|
e
|
|
84
95
|
).valueOf();
|
|
85
96
|
}
|
|
@@ -424,6 +435,22 @@ class r extends R {
|
|
|
424
435
|
truncate(t) {
|
|
425
436
|
return this.sub(this.remainder(t));
|
|
426
437
|
}
|
|
438
|
+
/**
|
|
439
|
+
* Determines the appropriate string format based on the span magnitude.
|
|
440
|
+
*
|
|
441
|
+
* @param span - The span that provides context for format selection
|
|
442
|
+
* @returns The appropriate TimeStampStringFormat
|
|
443
|
+
*
|
|
444
|
+
* Rules:
|
|
445
|
+
* - For spans >= 30 days: "shortDate" (e.g., "Nov 5")
|
|
446
|
+
* - For spans >= 1 day: "dateTime" (e.g., "Nov 5 14:23:45")
|
|
447
|
+
* - For spans >= 1 hour: "time" (e.g., "14:23:45")
|
|
448
|
+
* - For spans >= 1 second: "preciseTime" (e.g., "14:23:45.123")
|
|
449
|
+
* - For spans < 1 second: "ISOTime" (full precision time)
|
|
450
|
+
*/
|
|
451
|
+
formatBySpan(t) {
|
|
452
|
+
return t.greaterThanOrEqual(a.days(30)) ? "shortDate" : t.greaterThanOrEqual(a.DAY) ? "dateTime" : t.greaterThanOrEqual(a.HOUR) ? "time" : t.greaterThanOrEqual(a.SECOND) ? "preciseTime" : "ISOTime";
|
|
453
|
+
}
|
|
427
454
|
/**
|
|
428
455
|
* @returns A new TimeStamp representing the current time in UTC. It's important to
|
|
429
456
|
* note that this TimeStamp is only accurate to the millisecond level (that's the best
|
|
@@ -547,7 +574,7 @@ class a extends R {
|
|
|
547
574
|
* @returns A TimeSpan representing the given number of seconds.
|
|
548
575
|
*/
|
|
549
576
|
static fromSeconds(t) {
|
|
550
|
-
return t instanceof a ? t : t instanceof
|
|
577
|
+
return t instanceof a ? t : t instanceof M ? t.period : t instanceof r ? new a(t) : (U(t) && (t = t.value), ["number", "bigint"].includes(typeof t) ? a.seconds(t) : new a(t));
|
|
551
578
|
}
|
|
552
579
|
/**
|
|
553
580
|
* Creates a TimeSpan representing the given number of milliseconds.
|
|
@@ -556,7 +583,7 @@ class a extends R {
|
|
|
556
583
|
* @returns A TimeSpan representing the given number of milliseconds.
|
|
557
584
|
*/
|
|
558
585
|
static fromMilliseconds(t) {
|
|
559
|
-
return t instanceof a ? t : t instanceof
|
|
586
|
+
return t instanceof a ? t : t instanceof M ? t.period : t instanceof r ? new a(t) : (U(t) && (t = t.value), ["number", "bigint"].includes(typeof t) ? a.milliseconds(t) : new a(t));
|
|
560
587
|
}
|
|
561
588
|
/**
|
|
562
589
|
* @returns the primitive value of the TimeSpan. Overrides standard JS valueOf()
|
|
@@ -631,61 +658,61 @@ class a extends R {
|
|
|
631
658
|
*/
|
|
632
659
|
toString(t = "full") {
|
|
633
660
|
if (t === "semantic") return this.toSemanticString();
|
|
634
|
-
const e = this.truncate(a.DAY), s = this.truncate(a.HOUR), i = this.truncate(a.MINUTE), l = this.truncate(a.SECOND),
|
|
661
|
+
const e = this.truncate(a.DAY), s = this.truncate(a.HOUR), i = this.truncate(a.MINUTE), l = this.truncate(a.SECOND), c = this.truncate(a.MILLISECOND), y = this.truncate(a.MICROSECOND), v = this.truncate(a.NANOSECOND), O = e, w = s.sub(e), b = i.sub(s), f = l.sub(i), A = c.sub(l), B = y.sub(c), E = v.sub(y);
|
|
635
662
|
let d = "";
|
|
636
|
-
return O.isZero || (d += `${O.days}d `),
|
|
663
|
+
return O.isZero || (d += `${O.days}d `), w.isZero || (d += `${w.hours}h `), b.isZero || (d += `${b.minutes}m `), f.isZero || (d += `${f.seconds}s `), A.isZero || (d += `${A.milliseconds}ms `), B.isZero || (d += `${B.microseconds}µs `), E.isZero || (d += `${E.nanoseconds}ns`), d.trim();
|
|
637
664
|
}
|
|
638
665
|
toSemanticString() {
|
|
639
666
|
const t = this.valueOf() < 0n ? -this.valueOf() : this.valueOf(), e = new a(t), s = this.valueOf() < 0n;
|
|
640
667
|
if (e.valueOf() === 0n) return "0s";
|
|
641
668
|
if (e.lessThan(a.SECOND)) return "< 1s";
|
|
642
|
-
const i = e.days, l = e.hours,
|
|
643
|
-
if (
|
|
644
|
-
let d = `${
|
|
645
|
-
if (
|
|
646
|
-
const
|
|
647
|
-
i % K /
|
|
669
|
+
const i = e.days, l = e.hours, c = e.minutes, y = e.seconds, v = Math.floor(i / K), O = Math.floor(i / q), w = Math.floor(i / 7), b = Math.floor(i), f = Math.floor(l), A = Math.floor(c), B = Math.floor(y), E = s ? "-" : "";
|
|
670
|
+
if (v >= 1) {
|
|
671
|
+
let d = `${v}y`;
|
|
672
|
+
if (v < 2) {
|
|
673
|
+
const I = Math.floor(
|
|
674
|
+
i % K / q
|
|
648
675
|
);
|
|
649
|
-
|
|
676
|
+
I > 0 && (d += ` ${I}mo`);
|
|
650
677
|
}
|
|
651
678
|
return E + d;
|
|
652
679
|
}
|
|
653
|
-
if (
|
|
654
|
-
let d = `${
|
|
655
|
-
const
|
|
656
|
-
return
|
|
680
|
+
if (w >= 1 && i < q && i % 7 === 0) {
|
|
681
|
+
let d = `${w}w`;
|
|
682
|
+
const I = Math.floor(i % 7), x = Math.floor(l - w * 7 * 24);
|
|
683
|
+
return w < 2 && (I > 0 ? d += ` ${I}d` : x > 0 && x < 24 && (d += ` ${x}h`)), E + d;
|
|
657
684
|
}
|
|
658
685
|
if (O >= 1) {
|
|
659
686
|
let d = `${O}mo`;
|
|
660
687
|
if (O < 3) {
|
|
661
|
-
const
|
|
662
|
-
|
|
688
|
+
const I = Math.floor(i % q);
|
|
689
|
+
I > 0 && (d += ` ${I}d`);
|
|
663
690
|
}
|
|
664
691
|
return E + d;
|
|
665
692
|
}
|
|
666
|
-
if (
|
|
667
|
-
let d = `${
|
|
668
|
-
const
|
|
669
|
-
return
|
|
693
|
+
if (w >= 1) {
|
|
694
|
+
let d = `${w}w`;
|
|
695
|
+
const I = Math.floor(i % 7), x = Math.floor(l - w * 7 * 24);
|
|
696
|
+
return w < 2 && (I > 0 ? d += ` ${I}d` : x > 0 && x < 24 && (d += ` ${x}h`)), E + d;
|
|
670
697
|
}
|
|
671
|
-
if (
|
|
672
|
-
let d = `${
|
|
673
|
-
const
|
|
674
|
-
return
|
|
698
|
+
if (b >= 1) {
|
|
699
|
+
let d = `${b}d`;
|
|
700
|
+
const I = Math.floor(l - b * 24);
|
|
701
|
+
return b < 2 && I > 0 && (d += ` ${I}h`), E + d;
|
|
675
702
|
}
|
|
676
703
|
if (f >= 1) {
|
|
677
704
|
let d = `${f}h`;
|
|
678
705
|
if (f < 3) {
|
|
679
|
-
const
|
|
680
|
-
|
|
706
|
+
const I = Math.floor(c - f * 60);
|
|
707
|
+
I > 0 && (d += ` ${I}m`);
|
|
681
708
|
}
|
|
682
709
|
return E + d;
|
|
683
710
|
}
|
|
684
711
|
if (A >= 1) {
|
|
685
712
|
let d = `${A}m`;
|
|
686
713
|
if (A < 5) {
|
|
687
|
-
const
|
|
688
|
-
|
|
714
|
+
const I = Math.floor(y - A * 60);
|
|
715
|
+
I > 0 && (d += ` ${I}s`);
|
|
689
716
|
}
|
|
690
717
|
return E + d;
|
|
691
718
|
}
|
|
@@ -860,10 +887,10 @@ class a extends R {
|
|
|
860
887
|
o.bigint().transform((t) => new a(t)),
|
|
861
888
|
o.instanceof(a),
|
|
862
889
|
o.instanceof(r).transform((t) => new a(t)),
|
|
863
|
-
o.custom((t) => t instanceof
|
|
890
|
+
o.custom((t) => t instanceof M).transform((t) => new a(t))
|
|
864
891
|
]);
|
|
865
892
|
}
|
|
866
|
-
class
|
|
893
|
+
class M extends R {
|
|
867
894
|
constructor(t) {
|
|
868
895
|
U(t) && (t = t.value), super(t.valueOf());
|
|
869
896
|
}
|
|
@@ -873,7 +900,7 @@ class v extends R {
|
|
|
873
900
|
}
|
|
874
901
|
/** @returns The number of seconds in the Rate. */
|
|
875
902
|
equals(t) {
|
|
876
|
-
return this.valueOf() === new
|
|
903
|
+
return this.valueOf() === new M(t).valueOf();
|
|
877
904
|
}
|
|
878
905
|
/**
|
|
879
906
|
* Calculates the period of the Rate as a TimeSpan.
|
|
@@ -928,7 +955,7 @@ class v extends R {
|
|
|
928
955
|
* @returns A new Rate representing the sum of the two rates.
|
|
929
956
|
*/
|
|
930
957
|
add(t) {
|
|
931
|
-
return new
|
|
958
|
+
return new M(P(this.valueOf(), new M(t).valueOf()));
|
|
932
959
|
}
|
|
933
960
|
/**
|
|
934
961
|
* Subtracts another Rate from this Rate.
|
|
@@ -937,7 +964,7 @@ class v extends R {
|
|
|
937
964
|
* @returns A new Rate representing the difference of the two rates.
|
|
938
965
|
*/
|
|
939
966
|
sub(t) {
|
|
940
|
-
return new
|
|
967
|
+
return new M(F(this.valueOf(), new M(t).valueOf()));
|
|
941
968
|
}
|
|
942
969
|
/**
|
|
943
970
|
* Multiplies this Rate by a scalar value.
|
|
@@ -946,7 +973,7 @@ class v extends R {
|
|
|
946
973
|
* @returns A new Rate representing this Rate multiplied by the value.
|
|
947
974
|
*/
|
|
948
975
|
mult(t) {
|
|
949
|
-
return new
|
|
976
|
+
return new M(C(this.valueOf(), t));
|
|
950
977
|
}
|
|
951
978
|
/**
|
|
952
979
|
* Divides this Rate by a scalar value.
|
|
@@ -955,7 +982,7 @@ class v extends R {
|
|
|
955
982
|
* @returns A new Rate representing this Rate divided by the value.
|
|
956
983
|
*/
|
|
957
984
|
div(t) {
|
|
958
|
-
return new
|
|
985
|
+
return new M(Y(this.valueOf(), t));
|
|
959
986
|
}
|
|
960
987
|
/**
|
|
961
988
|
* Creates a Rate representing the given number of Hz.
|
|
@@ -964,7 +991,7 @@ class v extends R {
|
|
|
964
991
|
* @returns A Rate representing the given number of Hz.
|
|
965
992
|
*/
|
|
966
993
|
static hz(t) {
|
|
967
|
-
return new
|
|
994
|
+
return new M(t);
|
|
968
995
|
}
|
|
969
996
|
/**
|
|
970
997
|
* Creates a Rate representing the given number of kHz.
|
|
@@ -973,12 +1000,12 @@ class v extends R {
|
|
|
973
1000
|
* @returns A Rate representing the given number of kHz.
|
|
974
1001
|
*/
|
|
975
1002
|
static khz(t) {
|
|
976
|
-
return
|
|
1003
|
+
return M.hz(t * 1e3);
|
|
977
1004
|
}
|
|
978
1005
|
/** A zod schema for validating and transforming rates */
|
|
979
1006
|
static z = o.union([
|
|
980
|
-
o.number().transform((t) => new
|
|
981
|
-
o.instanceof(
|
|
1007
|
+
o.number().transform((t) => new M(t)),
|
|
1008
|
+
o.instanceof(M)
|
|
982
1009
|
]);
|
|
983
1010
|
}
|
|
984
1011
|
class g extends R {
|
|
@@ -1008,7 +1035,7 @@ class g extends R {
|
|
|
1008
1035
|
* @returns A Size representing the given number of values.
|
|
1009
1036
|
*/
|
|
1010
1037
|
size(t) {
|
|
1011
|
-
return new
|
|
1038
|
+
return new h(t * this.valueOf());
|
|
1012
1039
|
}
|
|
1013
1040
|
/**
|
|
1014
1041
|
* Adds another Density to this Density.
|
|
@@ -1488,7 +1515,7 @@ class n extends R {
|
|
|
1488
1515
|
o.instanceof(n)
|
|
1489
1516
|
]);
|
|
1490
1517
|
}
|
|
1491
|
-
class
|
|
1518
|
+
class h extends R {
|
|
1492
1519
|
constructor(t) {
|
|
1493
1520
|
U(t) && (t = t.value), super(t.valueOf());
|
|
1494
1521
|
}
|
|
@@ -1502,11 +1529,11 @@ class c extends R {
|
|
|
1502
1529
|
}
|
|
1503
1530
|
/** @returns a new Size representing the sum of the two Sizes. */
|
|
1504
1531
|
add(t) {
|
|
1505
|
-
return U(t) && (t = t.value), new
|
|
1532
|
+
return U(t) && (t = t.value), new h(P(this.valueOf(), t.valueOf()));
|
|
1506
1533
|
}
|
|
1507
1534
|
/** @returns a new Size representing the difference of the two Sizes. */
|
|
1508
1535
|
sub(t) {
|
|
1509
|
-
return U(t) && (t = t.value), new
|
|
1536
|
+
return U(t) && (t = t.value), new h(F(this.valueOf(), t.valueOf()));
|
|
1510
1537
|
}
|
|
1511
1538
|
/**
|
|
1512
1539
|
* Multiplies this Size by a scalar value.
|
|
@@ -1515,7 +1542,7 @@ class c extends R {
|
|
|
1515
1542
|
* @returns A new Size representing this Size multiplied by the value.
|
|
1516
1543
|
*/
|
|
1517
1544
|
mult(t) {
|
|
1518
|
-
return new
|
|
1545
|
+
return new h(C(this.valueOf(), t));
|
|
1519
1546
|
}
|
|
1520
1547
|
/**
|
|
1521
1548
|
* Divides this Size by a scalar value.
|
|
@@ -1524,39 +1551,39 @@ class c extends R {
|
|
|
1524
1551
|
* @returns A new Size representing this Size divided by the value.
|
|
1525
1552
|
*/
|
|
1526
1553
|
div(t) {
|
|
1527
|
-
return new
|
|
1554
|
+
return new h(Y(this.valueOf(), t));
|
|
1528
1555
|
}
|
|
1529
1556
|
/** @returns a new Size representing the truncated value of the Size. */
|
|
1530
1557
|
truncate(t) {
|
|
1531
|
-
return new
|
|
1532
|
-
Math.trunc(this.valueOf() / new
|
|
1558
|
+
return new h(
|
|
1559
|
+
Math.trunc(this.valueOf() / new h(t).valueOf()) * new h(t).valueOf()
|
|
1533
1560
|
);
|
|
1534
1561
|
}
|
|
1535
1562
|
/** @returns a new Size representing the remainder of the Size. */
|
|
1536
1563
|
remainder(t) {
|
|
1537
|
-
return
|
|
1564
|
+
return h.bytes(this.valueOf() % new h(t).valueOf());
|
|
1538
1565
|
}
|
|
1539
1566
|
/** @returns the number of gigabytes in the Size. */
|
|
1540
1567
|
get gigabytes() {
|
|
1541
|
-
return this.valueOf() /
|
|
1568
|
+
return this.valueOf() / h.GIGABYTE.valueOf();
|
|
1542
1569
|
}
|
|
1543
1570
|
/** @returns the number of megabytes in the Size. */
|
|
1544
1571
|
get megabytes() {
|
|
1545
|
-
return this.valueOf() /
|
|
1572
|
+
return this.valueOf() / h.MEGABYTE.valueOf();
|
|
1546
1573
|
}
|
|
1547
1574
|
/** @returns the number of kilobytes in the Size. */
|
|
1548
1575
|
get kilobytes() {
|
|
1549
|
-
return this.valueOf() /
|
|
1576
|
+
return this.valueOf() / h.KILOBYTE.valueOf();
|
|
1550
1577
|
}
|
|
1551
1578
|
/** @returns the number of terabytes in the Size. */
|
|
1552
1579
|
get terabytes() {
|
|
1553
|
-
return this.valueOf() /
|
|
1580
|
+
return this.valueOf() / h.TERABYTE.valueOf();
|
|
1554
1581
|
}
|
|
1555
1582
|
/** @returns a nicely formatted string representation of the Size. */
|
|
1556
1583
|
toString() {
|
|
1557
|
-
const t = this.truncate(
|
|
1558
|
-
let
|
|
1559
|
-
return
|
|
1584
|
+
const t = this.truncate(h.TERABYTE), e = this.truncate(h.GIGABYTE), s = this.truncate(h.MEGABYTE), i = this.truncate(h.KILOBYTE), l = this.truncate(h.BYTE), c = t, y = e.sub(t), v = s.sub(e), O = i.sub(s), w = l.sub(i);
|
|
1585
|
+
let b = "";
|
|
1586
|
+
return c.isZero || (b += `${c.terabytes}TB `), y.isZero || (b += `${y.gigabytes}GB `), v.isZero || (b += `${v.megabytes}MB `), O.isZero || (b += `${O.kilobytes}KB `), (!w.isZero || b === "") && (b += `${w.valueOf()}B`), b.trim();
|
|
1560
1587
|
}
|
|
1561
1588
|
/**
|
|
1562
1589
|
* Creates a Size from the given number of bytes.
|
|
@@ -1565,10 +1592,10 @@ class c extends R {
|
|
|
1565
1592
|
* @returns A Size representing the given number of bytes.
|
|
1566
1593
|
*/
|
|
1567
1594
|
static bytes(t = 1) {
|
|
1568
|
-
return new
|
|
1595
|
+
return new h(t);
|
|
1569
1596
|
}
|
|
1570
1597
|
/** A single byte */
|
|
1571
|
-
static BYTE = new
|
|
1598
|
+
static BYTE = new h(1);
|
|
1572
1599
|
/**
|
|
1573
1600
|
* Creates a Size from the given number if kilobytes.
|
|
1574
1601
|
*
|
|
@@ -1576,10 +1603,10 @@ class c extends R {
|
|
|
1576
1603
|
* @returns A Size representing the given number of kilobytes.
|
|
1577
1604
|
*/
|
|
1578
1605
|
static kilobytes(t = 1) {
|
|
1579
|
-
return
|
|
1606
|
+
return h.bytes(new h(t).valueOf() * 1e3);
|
|
1580
1607
|
}
|
|
1581
1608
|
/** A kilobyte */
|
|
1582
|
-
static KILOBYTE =
|
|
1609
|
+
static KILOBYTE = h.kilobytes(1);
|
|
1583
1610
|
/**
|
|
1584
1611
|
* Creates a Size from the given number of megabytes.
|
|
1585
1612
|
*
|
|
@@ -1587,10 +1614,10 @@ class c extends R {
|
|
|
1587
1614
|
* @returns A Size representing the given number of megabytes.
|
|
1588
1615
|
*/
|
|
1589
1616
|
static megabytes(t = 1) {
|
|
1590
|
-
return
|
|
1617
|
+
return h.kilobytes(new h(t).valueOf() * 1e3);
|
|
1591
1618
|
}
|
|
1592
1619
|
/** A megabyte */
|
|
1593
|
-
static MEGABYTE =
|
|
1620
|
+
static MEGABYTE = h.megabytes(1);
|
|
1594
1621
|
/**
|
|
1595
1622
|
* Creates a Size from the given number of gigabytes.
|
|
1596
1623
|
*
|
|
@@ -1598,10 +1625,10 @@ class c extends R {
|
|
|
1598
1625
|
* @returns A Size representing the given number of gigabytes.
|
|
1599
1626
|
*/
|
|
1600
1627
|
static gigabytes(t = 1) {
|
|
1601
|
-
return
|
|
1628
|
+
return h.megabytes(new h(t).valueOf() * 1e3);
|
|
1602
1629
|
}
|
|
1603
1630
|
/** A gigabyte */
|
|
1604
|
-
static GIGABYTE =
|
|
1631
|
+
static GIGABYTE = h.gigabytes(1);
|
|
1605
1632
|
/**
|
|
1606
1633
|
* Creates a Size from the given number of terabytes.
|
|
1607
1634
|
*
|
|
@@ -1609,16 +1636,16 @@ class c extends R {
|
|
|
1609
1636
|
* @returns A Size representing the given number of terabytes.
|
|
1610
1637
|
*/
|
|
1611
1638
|
static terabytes(t) {
|
|
1612
|
-
return
|
|
1639
|
+
return h.gigabytes(new h(t).valueOf() * 1e3);
|
|
1613
1640
|
}
|
|
1614
1641
|
/** A terabyte. */
|
|
1615
|
-
static TERABYTE =
|
|
1642
|
+
static TERABYTE = h.terabytes(1);
|
|
1616
1643
|
/** The zero value for Size */
|
|
1617
|
-
static ZERO = new
|
|
1644
|
+
static ZERO = new h(0);
|
|
1618
1645
|
/** A zod schema for a Size. */
|
|
1619
1646
|
static z = o.union([
|
|
1620
|
-
o.number().transform((t) => new
|
|
1621
|
-
o.instanceof(
|
|
1647
|
+
o.number().transform((t) => new h(t)),
|
|
1648
|
+
o.instanceof(h)
|
|
1622
1649
|
]);
|
|
1623
1650
|
/** @returns true if the Size is zero. */
|
|
1624
1651
|
get isZero() {
|
|
@@ -1642,7 +1669,7 @@ const he = o.object({
|
|
|
1642
1669
|
]), it = (u) => {
|
|
1643
1670
|
const t = typeof u;
|
|
1644
1671
|
return t === "string" || t === "number" || t === "boolean" || t === "bigint" || u instanceof r || u instanceof a || u instanceof Date;
|
|
1645
|
-
}, vt = (u, t, e, s = 0) => u.usesBigInt && !t.usesBigInt ? Number(e) - Number(s) : !u.usesBigInt && t.usesBigInt ? BigInt(e.valueOf()) - BigInt(s.valueOf()) :
|
|
1672
|
+
}, vt = (u, t, e, s = 0) => u.usesBigInt && !t.usesBigInt ? Number(e) - Number(s) : !u.usesBigInt && t.usesBigInt ? BigInt(e.valueOf()) - BigInt(s.valueOf()) : p(e, -s), p = (u, t) => t == 0 ? u : u == 0 ? t : typeof u == "bigint" && typeof t == "bigint" || typeof u == "number" && typeof t == "number" ? u + t : Number(u) + Number(t), yt = "00000000-0000-0000-0000-000000000000", Mt = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
|
|
1646
1673
|
function At(u) {
|
|
1647
1674
|
return typeof u == "string" && Mt.test(u);
|
|
1648
1675
|
}
|
|
@@ -1668,8 +1695,8 @@ function Bt() {
|
|
|
1668
1695
|
}
|
|
1669
1696
|
return Z(Et);
|
|
1670
1697
|
}
|
|
1671
|
-
const Ct = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto),
|
|
1672
|
-
function
|
|
1698
|
+
const Ct = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), D = { randomUUID: Ct };
|
|
1699
|
+
function Tt(u, t, e) {
|
|
1673
1700
|
u = u || {};
|
|
1674
1701
|
const s = u.random ?? u.rng?.() ?? Bt();
|
|
1675
1702
|
if (s.length < 16)
|
|
@@ -1677,12 +1704,12 @@ function xt(u, t, e) {
|
|
|
1677
1704
|
return s[6] = s[6] & 15 | 64, s[8] = s[8] & 63 | 128, at(s);
|
|
1678
1705
|
}
|
|
1679
1706
|
function St(u, t, e) {
|
|
1680
|
-
return
|
|
1707
|
+
return D.randomUUID && !u ? D.randomUUID() : Tt(u);
|
|
1681
1708
|
}
|
|
1682
|
-
const
|
|
1709
|
+
const xt = () => St(), j = (u, t) => Ut(u, t), Rt = yt, ge = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1683
1710
|
__proto__: null,
|
|
1684
1711
|
ZERO: Rt,
|
|
1685
|
-
create:
|
|
1712
|
+
create: xt,
|
|
1686
1713
|
parse: j
|
|
1687
1714
|
}, Symbol.toStringTag, { value: "Module" })), S = -1, H = {
|
|
1688
1715
|
[Symbol.iterator]: () => H,
|
|
@@ -1697,7 +1724,7 @@ const Tt = () => St(), j = (u, t) => Ut(u, t), Rt = yt, ge = /* @__PURE__ */ Obj
|
|
|
1697
1724
|
if (u === "bigint" && !t.usesBigInt)
|
|
1698
1725
|
throw new Error(`cannot convert series of type ${t.toString()} to bigint`);
|
|
1699
1726
|
}, ot = "sy_x_telem_series";
|
|
1700
|
-
class
|
|
1727
|
+
class T {
|
|
1701
1728
|
/**
|
|
1702
1729
|
* A unique identifier for the series. If specified by the user, it is their
|
|
1703
1730
|
* responsibility to ensure that it is unique. If not specified, a new ID will be
|
|
@@ -1762,13 +1789,13 @@ class x {
|
|
|
1762
1789
|
o.instanceof(ArrayBuffer),
|
|
1763
1790
|
o.instanceof(Uint8Array)
|
|
1764
1791
|
]),
|
|
1765
|
-
glBufferUsage:
|
|
1792
|
+
glBufferUsage: It.optional().default("static").optional()
|
|
1766
1793
|
});
|
|
1767
1794
|
/**
|
|
1768
1795
|
* A zod schema that validates and constructs a series from it's crude
|
|
1769
1796
|
* representation.
|
|
1770
1797
|
*/
|
|
1771
|
-
static z =
|
|
1798
|
+
static z = T.crudeZ.transform((t) => new T(t));
|
|
1772
1799
|
/**
|
|
1773
1800
|
* The Series constructor accepts either a SeriesArgs object or a CrudeSeries value.
|
|
1774
1801
|
*
|
|
@@ -1843,15 +1870,15 @@ class x {
|
|
|
1843
1870
|
* @throws Error if data type cannot be inferred from input
|
|
1844
1871
|
*/
|
|
1845
1872
|
constructor(t) {
|
|
1846
|
-
|
|
1873
|
+
qt(t) && (t = { data: t }), t.data ??= [];
|
|
1847
1874
|
const {
|
|
1848
1875
|
dataType: e,
|
|
1849
1876
|
timeRange: s,
|
|
1850
1877
|
sampleOffset: i = 0,
|
|
1851
1878
|
glBufferUsage: l = "static",
|
|
1852
|
-
alignment:
|
|
1853
|
-
alignmentMultiple:
|
|
1854
|
-
key:
|
|
1879
|
+
alignment: c = 0n,
|
|
1880
|
+
alignmentMultiple: y = 1n,
|
|
1881
|
+
key: v = st(),
|
|
1855
1882
|
data: O
|
|
1856
1883
|
} = t;
|
|
1857
1884
|
if (lt(O)) {
|
|
@@ -1859,16 +1886,16 @@ class x {
|
|
|
1859
1886
|
this.key = f.key, this.dataType = f.dataType, this.sampleOffset = f.sampleOffset, this.gl = f.gl, this._data = f._data, this.timeRange = f.timeRange, this.alignment = f.alignment, this.alignmentMultiple = f.alignmentMultiple, this.cachedMin = f.cachedMin, this.cachedMax = f.cachedMax, this.writePos = f.writePos, this._refCount = f._refCount, this.cachedLength = f.cachedLength;
|
|
1860
1887
|
return;
|
|
1861
1888
|
}
|
|
1862
|
-
const
|
|
1889
|
+
const w = it(O), b = Array.isArray(O);
|
|
1863
1890
|
if (e != null) this.dataType = new n(e);
|
|
1864
1891
|
else {
|
|
1865
1892
|
if (O instanceof ArrayBuffer)
|
|
1866
1893
|
throw new Error(
|
|
1867
1894
|
"cannot infer data type from an ArrayBuffer instance when constructing a Series. Please provide a data type."
|
|
1868
1895
|
);
|
|
1869
|
-
if (
|
|
1896
|
+
if (b || w) {
|
|
1870
1897
|
let f = O;
|
|
1871
|
-
if (!
|
|
1898
|
+
if (!w) {
|
|
1872
1899
|
if (O.length === 0)
|
|
1873
1900
|
throw new Error(
|
|
1874
1901
|
"cannot infer data type from a zero length JS array when constructing a Series. Please provide a data type."
|
|
@@ -1888,11 +1915,11 @@ class x {
|
|
|
1888
1915
|
);
|
|
1889
1916
|
} else this.dataType = new n(O);
|
|
1890
1917
|
}
|
|
1891
|
-
if (!
|
|
1892
|
-
else if (
|
|
1918
|
+
if (!b && !w) this._data = O;
|
|
1919
|
+
else if (b && O.length === 0)
|
|
1893
1920
|
this._data = new this.dataType.Array([]).buffer;
|
|
1894
1921
|
else {
|
|
1895
|
-
let f =
|
|
1922
|
+
let f = w ? [O] : O;
|
|
1896
1923
|
const A = f[0];
|
|
1897
1924
|
(A instanceof r || A instanceof Date || A instanceof a) && (f = f.map((B) => new r(B).valueOf())), this.dataType.equals(n.STRING) ? (this.cachedLength = f.length, this._data = new TextEncoder().encode(`${f.join(`
|
|
1898
1925
|
`)}
|
|
@@ -1906,7 +1933,7 @@ class x {
|
|
|
1906
1933
|
f.map(Number)
|
|
1907
1934
|
).buffer : this._data = new this.dataType.Array(f).buffer;
|
|
1908
1935
|
}
|
|
1909
|
-
this.key =
|
|
1936
|
+
this.key = v, this.alignment = c, this.alignmentMultiple = y, this.sampleOffset = i ?? 0, this.timeRange = s ?? m.ZERO, this.gl = {
|
|
1910
1937
|
control: null,
|
|
1911
1938
|
buffer: null,
|
|
1912
1939
|
prevBuffer: 0,
|
|
@@ -1923,7 +1950,7 @@ class x {
|
|
|
1923
1950
|
static alloc({ capacity: t, dataType: e, ...s }) {
|
|
1924
1951
|
if (t === 0)
|
|
1925
1952
|
throw new Error("[Series] - cannot allocate an array of length 0");
|
|
1926
|
-
const i = new new n(e).Array(t), l = new
|
|
1953
|
+
const i = new new n(e).Array(t), l = new T({ data: i.buffer, dataType: e, ...s });
|
|
1927
1954
|
return l.writePos = 0, l;
|
|
1928
1955
|
}
|
|
1929
1956
|
/**
|
|
@@ -2022,7 +2049,7 @@ class x {
|
|
|
2022
2049
|
* @returns The size of the underlying buffer in bytes.
|
|
2023
2050
|
*/
|
|
2024
2051
|
get byteCapacity() {
|
|
2025
|
-
return new
|
|
2052
|
+
return new h(this.underlyingData.byteLength);
|
|
2026
2053
|
}
|
|
2027
2054
|
/**
|
|
2028
2055
|
* Returns the capacity of the series in samples.
|
|
@@ -2038,7 +2065,7 @@ class x {
|
|
|
2038
2065
|
* @returns The size of the data in bytes.
|
|
2039
2066
|
*/
|
|
2040
2067
|
get byteLength() {
|
|
2041
|
-
return this.writePos === S ? this.byteCapacity : this.dataType.isVariable ? new
|
|
2068
|
+
return this.writePos === S ? this.byteCapacity : this.dataType.isVariable ? new h(this.writePos) : this.dataType.density.size(this.writePos);
|
|
2042
2069
|
}
|
|
2043
2070
|
/**
|
|
2044
2071
|
* Returns the number of samples in this array.
|
|
@@ -2071,7 +2098,7 @@ class x {
|
|
|
2071
2098
|
const s = new t.Array(this.length);
|
|
2072
2099
|
for (let i = 0; i < this.length; i++)
|
|
2073
2100
|
s[i] = vt(this.dataType, t, this.data[i], e);
|
|
2074
|
-
return new
|
|
2101
|
+
return new T({
|
|
2075
2102
|
data: s.buffer,
|
|
2076
2103
|
dataType: t,
|
|
2077
2104
|
timeRange: this.timeRange,
|
|
@@ -2100,7 +2127,7 @@ class x {
|
|
|
2100
2127
|
calcMax() {
|
|
2101
2128
|
if (this.dataType.isVariable)
|
|
2102
2129
|
throw new Error("cannot calculate maximum on a variable length data type");
|
|
2103
|
-
return this.writePos === 0 ? -1 / 0 : (this.cachedMax ??= this.calcRawMax(),
|
|
2130
|
+
return this.writePos === 0 ? -1 / 0 : (this.cachedMax ??= this.calcRawMax(), p(this.cachedMax, this.sampleOffset));
|
|
2104
2131
|
}
|
|
2105
2132
|
calcRawMin() {
|
|
2106
2133
|
if (this.length === 0) return 1 / 0;
|
|
@@ -2121,7 +2148,7 @@ class x {
|
|
|
2121
2148
|
calcMin() {
|
|
2122
2149
|
if (this.dataType.isVariable)
|
|
2123
2150
|
throw new Error("cannot calculate minimum on a variable length data type");
|
|
2124
|
-
return this.writePos === 0 ? 1 / 0 : (this.cachedMin ??= this.calcRawMin(),
|
|
2151
|
+
return this.writePos === 0 ? 1 / 0 : (this.cachedMin ??= this.calcRawMin(), p(this.cachedMin, this.sampleOffset));
|
|
2125
2152
|
}
|
|
2126
2153
|
/** @returns the bounds of the series. */
|
|
2127
2154
|
get bounds() {
|
|
@@ -2154,7 +2181,7 @@ class x {
|
|
|
2154
2181
|
if (e === !0) throw new Error(`[series] - no value at index ${t}`);
|
|
2155
2182
|
return;
|
|
2156
2183
|
}
|
|
2157
|
-
return
|
|
2184
|
+
return p(s, this.sampleOffset);
|
|
2158
2185
|
}
|
|
2159
2186
|
atUUID(t, e) {
|
|
2160
2187
|
t < 0 && (t = this.length + t);
|
|
@@ -2173,13 +2200,13 @@ class x {
|
|
|
2173
2200
|
s = this._cachedIndexes[t], i = this._cachedIndexes[t + 1] - 1;
|
|
2174
2201
|
else {
|
|
2175
2202
|
t < 0 && (t = this.length + t);
|
|
2176
|
-
for (let
|
|
2177
|
-
if (this.data[
|
|
2203
|
+
for (let c = 0; c < this.data.length; c++)
|
|
2204
|
+
if (this.data[c] === J) {
|
|
2178
2205
|
if (t === 0) {
|
|
2179
|
-
i =
|
|
2206
|
+
i = c;
|
|
2180
2207
|
break;
|
|
2181
2208
|
}
|
|
2182
|
-
s =
|
|
2209
|
+
s = c + 1, t--;
|
|
2183
2210
|
}
|
|
2184
2211
|
if (i === 0 && (i = this.data.length), s >= i || t > 0) {
|
|
2185
2212
|
if (e) throw new Error(`[series] - no value at index ${t}`);
|
|
@@ -2198,9 +2225,9 @@ class x {
|
|
|
2198
2225
|
let e = 0, s = this.length - 1;
|
|
2199
2226
|
const i = ct(t);
|
|
2200
2227
|
for (; e <= s; ) {
|
|
2201
|
-
const l = Math.floor((e + s) / 2),
|
|
2202
|
-
if (
|
|
2203
|
-
|
|
2228
|
+
const l = Math.floor((e + s) / 2), c = i(this.at(l, !0), t);
|
|
2229
|
+
if (c === 0) return l;
|
|
2230
|
+
c < 0 ? e = l + 1 : s = l - 1;
|
|
2204
2231
|
}
|
|
2205
2232
|
return e;
|
|
2206
2233
|
}
|
|
@@ -2218,8 +2245,8 @@ class x {
|
|
|
2218
2245
|
if (e == null && (this.gl.buffer = t.createBuffer()), this.writePos !== i)
|
|
2219
2246
|
if (t.bindBuffer(t.ARRAY_BUFFER, this.gl.buffer), this.writePos !== S) {
|
|
2220
2247
|
i === 0 && t.bufferData(t.ARRAY_BUFFER, this.byteCapacity.valueOf(), t.STATIC_DRAW);
|
|
2221
|
-
const l = this.dataType.density.size(i).valueOf(),
|
|
2222
|
-
t.bufferSubData(t.ARRAY_BUFFER, l,
|
|
2248
|
+
const l = this.dataType.density.size(i).valueOf(), c = this.underlyingData.slice(this.gl.prevBuffer, this.writePos);
|
|
2249
|
+
t.bufferSubData(t.ARRAY_BUFFER, l, c.buffer), this.gl.prevBuffer = this.writePos;
|
|
2223
2250
|
} else
|
|
2224
2251
|
t.bufferData(
|
|
2225
2252
|
t.ARRAY_BUFFER,
|
|
@@ -2276,7 +2303,7 @@ class x {
|
|
|
2276
2303
|
}
|
|
2277
2304
|
[Symbol.iterator]() {
|
|
2278
2305
|
if (this.dataType.isVariable) {
|
|
2279
|
-
const t = new
|
|
2306
|
+
const t = new pt(this);
|
|
2280
2307
|
return this.dataType.equals(n.JSON) ? new W(t) : t;
|
|
2281
2308
|
}
|
|
2282
2309
|
return this.dataType.equals(n.UUID) ? new Pt(this) : new Ft(this);
|
|
@@ -2306,7 +2333,7 @@ class x {
|
|
|
2306
2333
|
* @returns An iterator over the specified range.
|
|
2307
2334
|
*/
|
|
2308
2335
|
subIterator(t, e) {
|
|
2309
|
-
return new
|
|
2336
|
+
return new Q(this, t, e ?? this.length);
|
|
2310
2337
|
}
|
|
2311
2338
|
/**
|
|
2312
2339
|
* Returns an iterator over a portion of the series based on alignment.
|
|
@@ -2320,12 +2347,12 @@ class x {
|
|
|
2320
2347
|
), i = Math.ceil(
|
|
2321
2348
|
Number(e - this.alignment) / Number(this.alignmentMultiple)
|
|
2322
2349
|
);
|
|
2323
|
-
return new
|
|
2350
|
+
return new Q(this, s, i);
|
|
2324
2351
|
}
|
|
2325
2352
|
subBytes(t, e) {
|
|
2326
2353
|
if (t >= 0 && (e == null || e >= this.byteLength.valueOf())) return this;
|
|
2327
2354
|
const s = this.data.subarray(t, e);
|
|
2328
|
-
return new
|
|
2355
|
+
return new T({
|
|
2329
2356
|
data: s,
|
|
2330
2357
|
dataType: this.dataType,
|
|
2331
2358
|
timeRange: this.timeRange,
|
|
@@ -2337,7 +2364,7 @@ class x {
|
|
|
2337
2364
|
sliceSub(t, e, s) {
|
|
2338
2365
|
if (e <= 0 && (s == null || s >= this.length)) return this;
|
|
2339
2366
|
let i;
|
|
2340
|
-
return t ? i = this.data.subarray(e, s) : i = this.data.slice(e, s), new
|
|
2367
|
+
return t ? i = this.data.subarray(e, s) : i = this.data.slice(e, s), new T({
|
|
2341
2368
|
data: i,
|
|
2342
2369
|
dataType: this.dataType,
|
|
2343
2370
|
timeRange: this.timeRange,
|
|
@@ -2352,7 +2379,7 @@ class x {
|
|
|
2352
2379
|
* @returns A new series with the specified alignment.
|
|
2353
2380
|
*/
|
|
2354
2381
|
reAlign(t) {
|
|
2355
|
-
return new
|
|
2382
|
+
return new T({
|
|
2356
2383
|
data: this.buffer,
|
|
2357
2384
|
dataType: this.dataType,
|
|
2358
2385
|
timeRange: m.ZERO,
|
|
@@ -2379,8 +2406,8 @@ class x {
|
|
|
2379
2406
|
return t += "])", t;
|
|
2380
2407
|
}
|
|
2381
2408
|
}
|
|
2382
|
-
const
|
|
2383
|
-
class
|
|
2409
|
+
const qt = (u) => u == null ? !1 : Array.isArray(u) || u instanceof ArrayBuffer || ArrayBuffer.isView(u) && !(u instanceof DataView) || u instanceof T ? !0 : it(u), lt = nt(ot, T);
|
|
2410
|
+
class Q {
|
|
2384
2411
|
series;
|
|
2385
2412
|
end;
|
|
2386
2413
|
index;
|
|
@@ -2393,7 +2420,7 @@ class D {
|
|
|
2393
2420
|
return this.index >= this.end ? { done: !0, value: void 0 } : { done: !1, value: this.series.at(this.index++, !0) };
|
|
2394
2421
|
}
|
|
2395
2422
|
}
|
|
2396
|
-
class
|
|
2423
|
+
class pt {
|
|
2397
2424
|
series;
|
|
2398
2425
|
index;
|
|
2399
2426
|
decoder;
|
|
@@ -2599,24 +2626,24 @@ class Oe {
|
|
|
2599
2626
|
return H;
|
|
2600
2627
|
let s = 0;
|
|
2601
2628
|
for (let l = 0; l < this.series.length; l++) {
|
|
2602
|
-
const
|
|
2603
|
-
if (t <
|
|
2604
|
-
if (t >=
|
|
2605
|
-
else if ($(
|
|
2629
|
+
const c = this.series[l];
|
|
2630
|
+
if (t < c.alignment) break;
|
|
2631
|
+
if (t >= c.alignmentBounds.upper) s += c.length;
|
|
2632
|
+
else if ($(c.alignmentBounds, t)) {
|
|
2606
2633
|
s += Math.ceil(
|
|
2607
|
-
Number(t -
|
|
2634
|
+
Number(t - c.alignment) / Number(c.alignmentMultiple)
|
|
2608
2635
|
);
|
|
2609
2636
|
break;
|
|
2610
2637
|
}
|
|
2611
2638
|
}
|
|
2612
2639
|
let i = 0;
|
|
2613
2640
|
for (let l = 0; l < this.series.length; l++) {
|
|
2614
|
-
const
|
|
2615
|
-
if (e <
|
|
2616
|
-
if (e >=
|
|
2617
|
-
else if ($(
|
|
2641
|
+
const c = this.series[l];
|
|
2642
|
+
if (e < c.alignment) break;
|
|
2643
|
+
if (e >= c.alignmentBounds.upper) i += c.length;
|
|
2644
|
+
else if ($(c.alignmentBounds, e)) {
|
|
2618
2645
|
i += Math.ceil(
|
|
2619
|
-
Number(e -
|
|
2646
|
+
Number(e - c.alignment) / Number(c.alignmentMultiple)
|
|
2620
2647
|
);
|
|
2621
2648
|
break;
|
|
2622
2649
|
}
|
|
@@ -2661,7 +2688,7 @@ class Oe {
|
|
|
2661
2688
|
* Returns the sum of the byte lengths of all series.
|
|
2662
2689
|
*/
|
|
2663
2690
|
get byteLength() {
|
|
2664
|
-
return new
|
|
2691
|
+
return new h(this.series.reduce((t, e) => t + e.byteLength.valueOf(), 0));
|
|
2665
2692
|
}
|
|
2666
2693
|
/**
|
|
2667
2694
|
* Returns a combined typed array containing all data from all series.
|
|
@@ -2773,26 +2800,26 @@ const z = (u) => {
|
|
|
2773
2800
|
return { domain: t, sample: e };
|
|
2774
2801
|
};
|
|
2775
2802
|
export {
|
|
2776
|
-
|
|
2803
|
+
Qt as A,
|
|
2777
2804
|
zt as B,
|
|
2778
2805
|
ge as C,
|
|
2779
2806
|
g as D,
|
|
2780
2807
|
Oe as M,
|
|
2781
|
-
|
|
2782
|
-
|
|
2808
|
+
M as R,
|
|
2809
|
+
T as S,
|
|
2783
2810
|
r as T,
|
|
2784
2811
|
a,
|
|
2785
2812
|
m as b,
|
|
2786
2813
|
n as c,
|
|
2787
|
-
|
|
2814
|
+
h as d,
|
|
2788
2815
|
it as e,
|
|
2789
2816
|
vt as f,
|
|
2790
|
-
|
|
2817
|
+
p as g,
|
|
2791
2818
|
ue as h,
|
|
2792
|
-
|
|
2819
|
+
qt as i,
|
|
2793
2820
|
le as j,
|
|
2794
2821
|
G as k,
|
|
2795
|
-
|
|
2822
|
+
Nt as l,
|
|
2796
2823
|
ie as m,
|
|
2797
2824
|
he as n,
|
|
2798
2825
|
te as o,
|