@synnaxlabs/x 0.44.2 → 0.44.4
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 +35 -39
- package/dist/base-BLNViP3D.cjs +1 -0
- package/dist/{base-DFq0vvGn.js → base-BORMP3mH.js} +14 -11
- package/dist/bounds-BQqppNFf.js +186 -0
- package/dist/bounds-BXbqBINt.cjs +1 -0
- package/dist/bounds.cjs +1 -1
- package/dist/bounds.js +1 -1
- package/dist/{box-CO_2_DGG.js → box-DRH5SOaY.js} +67 -73
- package/dist/box-qgxWXNhm.cjs +1 -0
- package/dist/box.cjs +1 -1
- package/dist/box.js +1 -1
- package/dist/deep.cjs +1 -1
- package/dist/deep.js +1 -1
- package/dist/{dimensions-CRgergMS.js → dimensions-RaRkesPq.js} +1 -1
- package/dist/{dimensions-D2QGoNXO.cjs → dimensions-qY12pyfC.cjs} +1 -1
- package/dist/dimensions.cjs +1 -1
- package/dist/dimensions.js +1 -1
- package/dist/direction-DKdfJwj7.js +19 -0
- package/dist/direction-XCdrc4is.cjs +1 -0
- package/dist/direction.cjs +1 -1
- package/dist/direction.js +1 -1
- package/dist/{external-Birv9jaY.js → external-BM_NS5yM.js} +6 -6
- package/dist/external-E3ErJeeM.cjs +1 -0
- package/dist/index.cjs +3 -3
- package/dist/index.js +244 -240
- package/dist/{location-Ar5y2DX2.js → location-CGLioInQ.js} +16 -21
- package/dist/location-DJ_K4SlP.cjs +1 -0
- package/dist/location.cjs +1 -1
- package/dist/location.js +1 -1
- package/dist/{path-DVFrKaNI.js → path-Blh4wJuA.js} +24 -21
- package/dist/path-CPSfCjde.cjs +1 -0
- package/dist/record-BwjIgrpU.cjs +1 -0
- package/dist/record-tSFQKmdG.js +19 -0
- package/dist/record.cjs +1 -1
- package/dist/record.js +1 -1
- package/dist/{scale-C6qKDbRb.cjs → scale-76Azh2EE.cjs} +1 -1
- package/dist/{scale-EWNUk-bn.js → scale-BhIvACdB.js} +4 -4
- package/dist/scale.cjs +1 -1
- package/dist/scale.js +1 -1
- package/dist/{series-EA1uaEDj.js → series-kgnLXSDr.js} +622 -489
- package/dist/series-tAhThbnz.cjs +6 -0
- package/dist/{spatial-DGpZ2sO3.cjs → spatial-BsGadoUr.cjs} +1 -1
- package/dist/{spatial-BSWPzMkK.js → spatial-QY891r0E.js} +1 -1
- package/dist/spatial.cjs +1 -1
- package/dist/spatial.js +14 -16
- package/dist/src/breaker/breaker.d.ts +2 -1
- package/dist/src/breaker/breaker.d.ts.map +1 -1
- package/dist/src/deep/path.d.ts.map +1 -1
- package/dist/src/id/id.d.ts +3 -1
- package/dist/src/id/id.d.ts.map +1 -1
- package/dist/src/math/math.d.ts +2 -1
- package/dist/src/math/math.d.ts.map +1 -1
- package/dist/src/record/record.d.ts +18 -0
- package/dist/src/record/record.d.ts.map +1 -1
- package/dist/src/spatial/base.d.ts +12 -0
- package/dist/src/spatial/base.d.ts.map +1 -1
- package/dist/src/spatial/direction/direction.d.ts +5 -1
- package/dist/src/spatial/direction/direction.d.ts.map +1 -1
- package/dist/src/spatial/external.d.ts +0 -1
- package/dist/src/spatial/external.d.ts.map +1 -1
- package/dist/src/spatial/xy/xy.d.ts +3 -0
- package/dist/src/spatial/xy/xy.d.ts.map +1 -1
- package/dist/src/status/status.d.ts +1 -0
- package/dist/src/status/status.d.ts.map +1 -1
- package/dist/src/strings/strings.d.ts +1 -1
- package/dist/src/strings/strings.d.ts.map +1 -1
- package/dist/src/telem/series.d.ts +7 -0
- package/dist/src/telem/series.d.ts.map +1 -1
- package/dist/src/telem/telem.d.ts +86 -1
- package/dist/src/telem/telem.d.ts.map +1 -1
- package/dist/src/zod/util.d.ts.map +1 -1
- package/dist/telem.cjs +1 -1
- package/dist/telem.js +1 -1
- package/dist/xy-BKIJiLu_.cjs +1 -0
- package/dist/{xy-C_-hb3Q2.js → xy-CBuhMaIo.js} +41 -31
- package/dist/xy.cjs +1 -1
- package/dist/xy.js +1 -1
- package/dist/zod.cjs +1 -1
- package/dist/zod.js +1 -1
- package/package.json +3 -8
- package/src/breaker/breaker.ts +4 -0
- package/src/deep/path.spec.ts +14 -0
- package/src/deep/path.ts +9 -2
- package/src/id/id.ts +8 -4
- package/src/math/math.spec.ts +20 -0
- package/src/math/math.ts +32 -29
- package/src/record/record.spec.ts +31 -0
- package/src/record/record.ts +23 -0
- package/src/spatial/base.ts +4 -0
- package/src/spatial/bounds/bounds.ts +1 -1
- package/src/spatial/direction/direction.spec.ts +35 -1
- package/src/spatial/direction/direction.ts +12 -0
- package/src/spatial/external.ts +0 -1
- package/src/spatial/xy/xy.spec.ts +124 -7
- package/src/spatial/xy/xy.ts +15 -2
- package/src/status/status.ts +11 -0
- package/src/strings/strings.spec.ts +3 -0
- package/src/strings/strings.ts +2 -1
- package/src/telem/series.spec.ts +543 -2
- package/src/telem/series.ts +28 -9
- package/src/telem/telem.spec.ts +606 -0
- package/src/telem/telem.ts +143 -5
- package/src/zod/util.ts +5 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/vite.config.ts +0 -1
- package/dist/base-BAM2mqCy.cjs +0 -1
- package/dist/bounds-D6e9xoHt.cjs +0 -1
- package/dist/bounds-Dj9nG39I.js +0 -174
- package/dist/box-Cxki783Y.cjs +0 -1
- package/dist/direction-386XDm2w.cjs +0 -1
- package/dist/direction-8etxfKaR.js +0 -17
- package/dist/external-DsmsSN1Y.cjs +0 -1
- package/dist/location-DZi8ftXp.cjs +0 -1
- package/dist/path-BeMr8xWN.cjs +0 -1
- package/dist/position-DSy2hONH.cjs +0 -1
- package/dist/position-PQ6op54I.js +0 -85
- package/dist/position.cjs +0 -1
- package/dist/position.js +0 -4
- package/dist/record-CAcQ5PNX.js +0 -14
- package/dist/record-YvCh7bzB.cjs +0 -1
- package/dist/series-CcA_WjbJ.cjs +0 -6
- package/dist/src/spatial/position/index.d.ts +0 -2
- package/dist/src/spatial/position/index.d.ts.map +0 -1
- package/dist/src/spatial/position/position.d.ts +0 -20
- package/dist/src/spatial/position/position.d.ts.map +0 -1
- package/dist/src/spatial/position/position.spec.d.ts +0 -2
- package/dist/src/spatial/position/position.spec.d.ts.map +0 -1
- package/dist/xy-CUE3QDNn.cjs +0 -1
- package/src/spatial/position/index.ts +0 -10
- package/src/spatial/position/position.spec.ts +0 -211
- package/src/spatial/position/position.ts +0 -157
|
@@ -1,75 +1,75 @@
|
|
|
1
1
|
import { z as x } from "zod";
|
|
2
|
-
import { c as O } from "./direction-
|
|
3
|
-
import { c as A, T as
|
|
4
|
-
import { Z as g, O as U, e as I, t as T, c as k, a as L, r as $ } from "./xy-
|
|
5
|
-
import { x as
|
|
6
|
-
const
|
|
7
|
-
top:
|
|
8
|
-
left:
|
|
9
|
-
width:
|
|
10
|
-
height:
|
|
2
|
+
import { c as O } from "./direction-DKdfJwj7.js";
|
|
3
|
+
import { c as A, T as C, B as j, x as S, a as Z, b as q, d as F, e as G, f as D, C as X, g as Y } from "./location-CGLioInQ.js";
|
|
4
|
+
import { Z as g, O as U, e as I, t as T, c as k, a as L, r as $ } from "./xy-CBuhMaIo.js";
|
|
5
|
+
import { x as N, X as H, Y as J } from "./base-BORMP3mH.js";
|
|
6
|
+
const _ = x.union([x.number(), x.string()]), K = x.object({
|
|
7
|
+
top: _,
|
|
8
|
+
left: _,
|
|
9
|
+
width: _,
|
|
10
|
+
height: _
|
|
11
11
|
}), Q = x.object({
|
|
12
12
|
left: x.number(),
|
|
13
13
|
top: x.number(),
|
|
14
14
|
right: x.number(),
|
|
15
15
|
bottom: x.number()
|
|
16
16
|
}), V = x.object({
|
|
17
|
-
one:
|
|
18
|
-
two:
|
|
17
|
+
one: N,
|
|
18
|
+
two: N,
|
|
19
19
|
root: A
|
|
20
|
-
}), P = { one: g, two: g, root:
|
|
20
|
+
}), P = { one: g, two: g, root: C }, oo = { one: g, two: U, root: j }, v = (o, t) => ({
|
|
21
21
|
one: o.one,
|
|
22
22
|
two: o.two,
|
|
23
23
|
root: t ?? o.root
|
|
24
|
-
}), c = (o, t, e = 0, n = 0,
|
|
25
|
-
const
|
|
24
|
+
}), c = (o, t, e = 0, n = 0, s) => {
|
|
25
|
+
const r = {
|
|
26
26
|
one: { ...g },
|
|
27
27
|
two: { ...g },
|
|
28
|
-
root:
|
|
28
|
+
root: s ?? C
|
|
29
29
|
};
|
|
30
30
|
if (typeof o == "number") {
|
|
31
31
|
if (typeof t != "number")
|
|
32
32
|
throw new Error("Box constructor called with invalid arguments");
|
|
33
|
-
return
|
|
33
|
+
return r.one = { x: o, y: t }, r.two = { x: r.one.x + e, y: r.one.y + n }, r;
|
|
34
34
|
}
|
|
35
|
-
return "one" in o && "two" in o && "root" in o ? { ...o, root:
|
|
36
|
-
x:
|
|
37
|
-
y:
|
|
38
|
-
} : "signedWidth" in t ?
|
|
39
|
-
x:
|
|
40
|
-
y:
|
|
41
|
-
} :
|
|
35
|
+
return "one" in o && "two" in o && "root" in o ? { ...o, root: s ?? o.root } : ("getBoundingClientRect" in o && (o = o.getBoundingClientRect()), "left" in o ? (r.one = { x: o.left, y: o.top }, r.two = { x: o.right, y: o.bottom }, r) : (r.one = o, t == null ? r.two = { x: r.one.x + e, y: r.one.y + n } : typeof t == "number" ? r.two = { x: r.one.x + t, y: r.one.y + e } : "width" in t ? r.two = {
|
|
36
|
+
x: r.one.x + t.width,
|
|
37
|
+
y: r.one.y + t.height
|
|
38
|
+
} : "signedWidth" in t ? r.two = {
|
|
39
|
+
x: r.one.x + t.signedWidth,
|
|
40
|
+
y: r.one.y + t.signedHeight
|
|
41
|
+
} : r.two = t, r));
|
|
42
42
|
}, to = (o, t, e) => {
|
|
43
43
|
const n = c(o);
|
|
44
44
|
if (typeof t == "string") {
|
|
45
45
|
if (e == null) throw new Error("Invalid arguments for resize");
|
|
46
|
-
const
|
|
46
|
+
const s = O(t);
|
|
47
47
|
return c(
|
|
48
48
|
n.one,
|
|
49
49
|
void 0,
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
s === "x" ? e : w(n),
|
|
51
|
+
s === "y" ? e : d(n),
|
|
52
52
|
n.root
|
|
53
53
|
);
|
|
54
54
|
}
|
|
55
55
|
return c(n.one, t, void 0, void 0, n.root);
|
|
56
56
|
}, no = (o, t, e = !0) => {
|
|
57
57
|
const n = c(o);
|
|
58
|
-
let
|
|
59
|
-
return e && (
|
|
58
|
+
let s = (r, i) => r < i;
|
|
59
|
+
return e && (s = (r, i) => r <= i), "one" in t ? s(u(n), u(t)) && s(f(t), f(n)) && s(a(n), a(t)) && s(l(t), l(n)) : s(u(n), t.x) && s(t.x, f(n)) && s(a(n), t.y) && s(t.y, l(n));
|
|
60
60
|
}, eo = (o, t) => I(o.one, t.one) && I(o.two, t.two) && S(o.root, t.root), W = (o) => ({
|
|
61
61
|
width: w(o),
|
|
62
62
|
height: d(o)
|
|
63
|
-
}), so = (o) => ({
|
|
64
|
-
signedWidth: _(o),
|
|
65
|
-
signedHeight: b(o)
|
|
66
63
|
}), ro = (o) => ({
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
signedWidth: h(o),
|
|
65
|
+
signedHeight: b(o)
|
|
66
|
+
}), so = (o) => ({
|
|
67
|
+
top: a(o),
|
|
68
|
+
left: u(o),
|
|
69
69
|
width: w(o),
|
|
70
70
|
height: d(o)
|
|
71
|
-
}),
|
|
72
|
-
const n = O(t) === "y" ? b(o) :
|
|
71
|
+
}), M = (o, t, e = !1) => {
|
|
72
|
+
const n = O(t) === "y" ? b(o) : h(o);
|
|
73
73
|
return e ? n : Math.abs(n);
|
|
74
74
|
}, y = (o, t) => {
|
|
75
75
|
const e = c(o);
|
|
@@ -80,40 +80,40 @@ const h = x.union([x.number(), x.string()]), K = x.object({
|
|
|
80
80
|
}, m = (o, t) => {
|
|
81
81
|
const e = c(o), n = Z(e.root).includes(t) ? Math.min : Math.max;
|
|
82
82
|
return H.includes(t) ? n(e.one.x, e.two.x) : n(e.one.y, e.two.y);
|
|
83
|
-
}, co = (o) => o.one.x === o.two.x && o.one.y === o.two.y, w = (o) =>
|
|
83
|
+
}, co = (o) => o.one.x === o.two.x && o.one.y === o.two.y, w = (o) => M(o, "x"), d = (o) => M(o, "y"), h = (o) => {
|
|
84
84
|
const t = c(o);
|
|
85
85
|
return t.two.x - t.one.x;
|
|
86
86
|
}, b = (o) => {
|
|
87
87
|
const t = c(o);
|
|
88
88
|
return t.two.y - t.one.y;
|
|
89
|
-
}, z = (o) => y(o,
|
|
90
|
-
x:
|
|
89
|
+
}, z = (o) => y(o, C), io = (o) => y(o, q), xo = (o) => y(o, F), yo = (o) => y(o, j), uo = (o) => y(o, G), ao = (o) => y(o, D), wo = (o) => y(o, X), fo = (o) => y(o, Y), f = (o) => m(o, "right"), l = (o) => m(o, "bottom"), u = (o) => m(o, "left"), a = (o) => m(o, "top"), E = (o) => T(z(o), {
|
|
90
|
+
x: h(o) / 2,
|
|
91
91
|
y: b(o) / 2
|
|
92
92
|
}), B = (o) => {
|
|
93
93
|
const t = c(o);
|
|
94
|
-
return t.root.x === "left" ?
|
|
94
|
+
return t.root.x === "left" ? u(t) : f(t);
|
|
95
95
|
}, R = (o) => {
|
|
96
96
|
const t = c(o);
|
|
97
|
-
return t.root.y === "top" ?
|
|
97
|
+
return t.root.y === "top" ? a(t) : l(t);
|
|
98
98
|
}, lo = (o) => ({ x: B(o), y: R(o) }), mo = (o) => {
|
|
99
99
|
const t = c(o);
|
|
100
100
|
return { lower: t.one.x, upper: t.two.x };
|
|
101
101
|
}, po = (o) => {
|
|
102
102
|
const t = c(o);
|
|
103
103
|
return { lower: t.one.y, upper: t.two.y };
|
|
104
|
-
}, go = (o, t) => v(o, t),
|
|
104
|
+
}, go = (o, t) => v(o, t), _o = (o, t) => {
|
|
105
105
|
const e = c(o), n = H.includes(t) ? "x" : J.includes(t) ? "y" : null;
|
|
106
106
|
if (n === null) throw new Error(`Invalid location: ${t}`);
|
|
107
|
-
const
|
|
108
|
-
return
|
|
109
|
-
},
|
|
110
|
-
const e = c(o), n = c(t),
|
|
111
|
-
return c({ x:
|
|
107
|
+
const s = t === "top" || t === "left" ? Math.min : Math.max, r = { ...e.one }, i = { ...e.two };
|
|
108
|
+
return r[n] = s(e.one[n], e.two[n]), i[n] = s(e.one[n], e.two[n]), [r, i];
|
|
109
|
+
}, ho = (o, t) => {
|
|
110
|
+
const e = c(o), n = c(t), s = B(n) + (w(n) - w(e)) / 2, r = R(n) + (d(n) - d(e)) / 2;
|
|
111
|
+
return c({ x: s, y: r }, W(e));
|
|
112
112
|
}, bo = (o) => typeof o != "object" || o == null ? !1 : "one" in o && "two" in o && "root" in o, To = (o) => w(o) / d(o), Eo = (o, t, e) => {
|
|
113
113
|
if (typeof t == "string") {
|
|
114
114
|
if (e == null) throw new Error("Undefined amount passed into box.translate");
|
|
115
|
-
const
|
|
116
|
-
t = k(
|
|
115
|
+
const s = O(t);
|
|
116
|
+
t = k(s, e);
|
|
117
117
|
}
|
|
118
118
|
const n = c(o);
|
|
119
119
|
return c(
|
|
@@ -124,9 +124,9 @@ const h = x.union([x.number(), x.string()]), K = x.object({
|
|
|
124
124
|
n.root
|
|
125
125
|
);
|
|
126
126
|
}, Oo = (o, t) => {
|
|
127
|
-
const e = Math.max(
|
|
128
|
-
return e >
|
|
129
|
-
},
|
|
127
|
+
const e = Math.max(u(o), u(t)), n = Math.max(a(o), a(t)), s = Math.min(f(o), f(t)), r = Math.min(l(o), l(t));
|
|
128
|
+
return e > s || n > r ? P : c({ x: e, y: n }, { x: s, y: r }, void 0, void 0, o.root);
|
|
129
|
+
}, Co = (o) => w(o) * d(o), Mo = (o, t) => {
|
|
130
130
|
const e = c(o);
|
|
131
131
|
return c(
|
|
132
132
|
L(e.one, t),
|
|
@@ -135,9 +135,9 @@ const h = x.union([x.number(), x.string()]), K = x.object({
|
|
|
135
135
|
void 0,
|
|
136
136
|
e.root
|
|
137
137
|
);
|
|
138
|
-
}, Bo = (o, t, e, n,
|
|
138
|
+
}, Bo = (o, t, e, n, s, r) => {
|
|
139
139
|
const i = { x: o, y: t }, p = { x: o + e, y: t + n };
|
|
140
|
-
return
|
|
140
|
+
return s.x !== r.x && (s.x === "center" ? (i.x -= e / 2, p.x -= e / 2) : (i.x -= e, p.x -= e)), s.y !== r.y && (s.y === "center" ? (i.y -= n / 2, p.y -= n / 2) : (i.y -= n, p.y -= n)), c(i, p, void 0, void 0, r);
|
|
141
141
|
}, Ro = (o) => {
|
|
142
142
|
const t = c(o);
|
|
143
143
|
return c($(t.one), $(t.two), void 0, void 0, t.root);
|
|
@@ -145,13 +145,13 @@ const h = x.union([x.number(), x.string()]), K = x.object({
|
|
|
145
145
|
__proto__: null,
|
|
146
146
|
DECIMAL: oo,
|
|
147
147
|
ZERO: P,
|
|
148
|
-
area:
|
|
148
|
+
area: Co,
|
|
149
149
|
areaIsZero: co,
|
|
150
150
|
aspect: To,
|
|
151
151
|
bottom: l,
|
|
152
|
-
bottomCenter:
|
|
152
|
+
bottomCenter: uo,
|
|
153
153
|
bottomLeft: yo,
|
|
154
|
-
bottomRight:
|
|
154
|
+
bottomRight: ao,
|
|
155
155
|
box: V,
|
|
156
156
|
center: E,
|
|
157
157
|
centerLeft: wo,
|
|
@@ -160,33 +160,33 @@ const h = x.union([x.number(), x.string()]), K = x.object({
|
|
|
160
160
|
constructWithAlternateRoot: Bo,
|
|
161
161
|
contains: no,
|
|
162
162
|
copy: v,
|
|
163
|
-
css:
|
|
163
|
+
css: so,
|
|
164
164
|
cssBox: K,
|
|
165
|
-
dim:
|
|
165
|
+
dim: M,
|
|
166
166
|
dims: W,
|
|
167
167
|
domRect: Q,
|
|
168
|
-
edgePoints:
|
|
168
|
+
edgePoints: _o,
|
|
169
169
|
equals: eo,
|
|
170
170
|
height: d,
|
|
171
171
|
intersection: Oo,
|
|
172
172
|
isBox: bo,
|
|
173
|
-
left:
|
|
173
|
+
left: u,
|
|
174
174
|
loc: m,
|
|
175
|
-
positionInCenter:
|
|
175
|
+
positionInCenter: ho,
|
|
176
176
|
reRoot: go,
|
|
177
177
|
resize: to,
|
|
178
178
|
right: f,
|
|
179
179
|
root: lo,
|
|
180
180
|
round: Ro,
|
|
181
|
-
signedDims:
|
|
181
|
+
signedDims: ro,
|
|
182
182
|
signedHeight: b,
|
|
183
|
-
signedWidth:
|
|
184
|
-
top:
|
|
183
|
+
signedWidth: h,
|
|
184
|
+
top: a,
|
|
185
185
|
topCenter: io,
|
|
186
186
|
topLeft: z,
|
|
187
187
|
topRight: xo,
|
|
188
188
|
translate: Eo,
|
|
189
|
-
truncate:
|
|
189
|
+
truncate: Mo,
|
|
190
190
|
width: w,
|
|
191
191
|
x: B,
|
|
192
192
|
xBounds: mo,
|
|
@@ -195,15 +195,9 @@ const h = x.union([x.number(), x.string()]), K = x.object({
|
|
|
195
195
|
yBounds: po
|
|
196
196
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
197
197
|
export {
|
|
198
|
-
Bo as a,
|
|
199
198
|
Ho as b,
|
|
200
199
|
c,
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
mo as f,
|
|
204
|
-
d as h,
|
|
205
|
-
Oo as i,
|
|
206
|
-
w,
|
|
207
|
-
y as x,
|
|
200
|
+
bo as i,
|
|
201
|
+
mo as x,
|
|
208
202
|
po as y
|
|
209
203
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const y=require("zod"),M=require("./direction-XCdrc4is.cjs"),u=require("./location-DJ_K4SlP.cjs"),i=require("./xy-BKIJiLu_.cjs"),m=require("./base-BLNViP3D.cjs"),p=y.z.union([y.z.number(),y.z.string()]),j=y.z.object({top:p,left:p,width:p,height:p}),F=y.z.object({left:y.z.number(),top:y.z.number(),right:y.z.number(),bottom:y.z.number()}),H=y.z.object({one:m.xy,two:m.xy,root:u.corner}),C={one:i.ZERO,two:i.ZERO,root:u.TOP_LEFT},v={one:i.ZERO,two:i.ONE,root:u.BOTTOM_LEFT},L=(t,o)=>({one:t.one,two:t.two,root:o??t.root}),c=(t,o,e=0,n=0,s)=>{const r={one:{...i.ZERO},two:{...i.ZERO},root:s??u.TOP_LEFT};if(typeof t=="number"){if(typeof o!="number")throw new Error("Box constructor called with invalid arguments");return r.one={x:t,y:o},r.two={x:r.one.x+e,y:r.one.y+n},r}return"one"in t&&"two"in t&&"root"in t?{...t,root:s??t.root}:("getBoundingClientRect"in t&&(t=t.getBoundingClientRect()),"left"in t?(r.one={x:t.left,y:t.top},r.two={x:t.right,y:t.bottom},r):(r.one=t,o==null?r.two={x:r.one.x+e,y:r.one.y+n}:typeof o=="number"?r.two={x:r.one.x+o,y:r.one.y+e}:"width"in o?r.two={x:r.one.x+o.width,y:r.one.y+o.height}:"signedWidth"in o?r.two={x:r.one.x+o.signedWidth,y:r.one.y+o.signedHeight}:r.two=o,r))},A=(t,o,e)=>{const n=c(t);if(typeof o=="string"){if(e==null)throw new Error("Invalid arguments for resize");const s=M.construct(o);return c(n.one,void 0,s==="x"?e:f(n),s==="y"?e:_(n),n.root)}return c(n.one,o,void 0,void 0,n.root)},S=(t,o,e=!0)=>{const n=c(t);let s=(r,x)=>r<x;return e&&(s=(r,x)=>r<=x),"one"in o?s(l(n),l(o))&&s(a(o),a(n))&&s(w(n),w(o))&&s(g(o),g(n)):s(l(n),o.x)&&s(o.x,a(n))&&s(w(n),o.y)&&s(o.y,g(n))},W=(t,o)=>i.equals(t.one,o.one)&&i.equals(t.two,o.two)&&u.xyEquals(t.root,o.root),I=t=>({width:f(t),height:_(t)}),G=t=>({signedWidth:O(t),signedHeight:E(t)}),D=t=>({top:w(t),left:l(t),width:f(t),height:_(t)}),R=(t,o,e=!1)=>{const n=M.construct(o)==="y"?E(t):O(t);return e?n:Math.abs(n)},d=(t,o)=>{const e=c(t);return{x:o.x==="center"?b(e).x:T(e,o.x),y:o.y==="center"?b(e).y:T(e,o.y)}},T=(t,o)=>{const e=c(t),n=u.xyCouple(e.root).includes(o)?Math.min:Math.max;return m.X_LOCATIONS.includes(o)?n(e.one.x,e.two.x):n(e.one.y,e.two.y)},X=t=>t.one.x===t.two.x&&t.one.y===t.two.y,f=t=>R(t,"x"),_=t=>R(t,"y"),O=t=>{const o=c(t);return o.two.x-o.one.x},E=t=>{const o=c(t);return o.two.y-o.one.y},q=t=>d(t,u.TOP_LEFT),$=t=>d(t,u.TOP_CENTER),U=t=>d(t,u.TOP_RIGHT),Y=t=>d(t,u.BOTTOM_LEFT),k=t=>d(t,u.BOTTOM_CENTER),J=t=>d(t,u.BOTTOM_RIGHT),K=t=>d(t,u.CENTER_LEFT),Q=t=>d(t,u.CENTER_RIGHT),a=t=>T(t,"right"),g=t=>T(t,"bottom"),l=t=>T(t,"left"),w=t=>T(t,"top"),b=t=>i.translate(q(t),{x:O(t)/2,y:E(t)/2}),z=t=>{const o=c(t);return o.root.x==="left"?l(o):a(o)},B=t=>{const o=c(t);return o.root.y==="top"?w(o):g(o)},V=t=>({x:z(t),y:B(t)}),N=t=>{const o=c(t);return{lower:o.one.x,upper:o.two.x}},P=t=>{const o=c(t);return{lower:o.one.y,upper:o.two.y}},tt=(t,o)=>L(t,o),ot=(t,o)=>{const e=c(t),n=m.X_LOCATIONS.includes(o)?"x":m.Y_LOCATIONS.includes(o)?"y":null;if(n===null)throw new Error(`Invalid location: ${o}`);const s=o==="top"||o==="left"?Math.min:Math.max,r={...e.one},x={...e.two};return r[n]=s(e.one[n],e.two[n]),x[n]=s(e.one[n],e.two[n]),[r,x]},nt=(t,o)=>{const e=c(t),n=c(o),s=z(n)+(f(n)-f(e))/2,r=B(n)+(_(n)-_(e))/2;return c({x:s,y:r},I(e))},Z=t=>typeof t!="object"||t==null?!1:"one"in t&&"two"in t&&"root"in t,et=t=>f(t)/_(t),rt=(t,o,e)=>{if(typeof o=="string"){if(e==null)throw new Error("Undefined amount passed into box.translate");const s=M.construct(o);o=i.construct(s,e)}const n=c(t);return c(i.translate(n.one,o),i.translate(n.two,o),void 0,void 0,n.root)},st=(t,o)=>{const e=Math.max(l(t),l(o)),n=Math.max(w(t),w(o)),s=Math.min(a(t),a(o)),r=Math.min(g(t),g(o));return e>s||n>r?C:c({x:e,y:n},{x:s,y:r},void 0,void 0,t.root)},ct=t=>f(t)*_(t),it=(t,o)=>{const e=c(t);return c(i.truncate(e.one,o),i.truncate(e.two,o),void 0,void 0,e.root)},ut=(t,o,e,n,s,r)=>{const x={x:t,y:o},h={x:t+e,y:o+n};return s.x!==r.x&&(s.x==="center"?(x.x-=e/2,h.x-=e/2):(x.x-=e,h.x-=e)),s.y!==r.y&&(s.y==="center"?(x.y-=n/2,h.y-=n/2):(x.y-=n,h.y-=n)),c(x,h,void 0,void 0,r)},xt=t=>{const o=c(t);return c(i.round(o.one),i.round(o.two),void 0,void 0,o.root)},yt=Object.freeze(Object.defineProperty({__proto__:null,DECIMAL:v,ZERO:C,area:ct,areaIsZero:X,aspect:et,bottom:g,bottomCenter:k,bottomLeft:Y,bottomRight:J,box:H,center:b,centerLeft:K,centerRight:Q,construct:c,constructWithAlternateRoot:ut,contains:S,copy:L,css:D,cssBox:j,dim:R,dims:I,domRect:F,edgePoints:ot,equals:W,height:_,intersection:st,isBox:Z,left:l,loc:T,positionInCenter:nt,reRoot:tt,resize:A,right:a,root:V,round:xt,signedDims:G,signedHeight:E,signedWidth:O,top:w,topCenter:$,topLeft:q,topRight:U,translate:rt,truncate:it,width:f,x:z,xBounds:N,xyLoc:d,y:B,yBounds:P},Symbol.toStringTag,{value:"Module"}));exports.box=yt;exports.construct=c;exports.isBox=Z;exports.xBounds=N;exports.yBounds=P;
|
package/dist/box.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./box-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./box-qgxWXNhm.cjs");exports.box=e.box;
|
package/dist/box.js
CHANGED
package/dist/deep.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./identity.cjs"),y=require("./path-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./identity.cjs"),y=require("./path-CPSfCjde.cjs"),d=t=>{try{return structuredClone(t)}catch{return console.warn("Failed to deep copy object, falling back to JSON.parse(JSON.stringify)",t),console.trace(),JSON.parse(JSON.stringify(t))}},j=(t,...f)=>(f.forEach(i=>{let r=t;const l=i.split(".");l.forEach((n,e)=>{typeof r!="object"||r===null||(e===l.length-1?delete r[n]:n in r&&(r=r[n]))})}),t),A=(t,f,i="")=>{const r={},l=(n,e,s)=>{if(typeof n!=typeof e||n===null||e===null){r[s]=[n,e];return}if(typeof n=="object"&&typeof e=="object")if(Array.isArray(n)&&Array.isArray(e)){if(n.length!==e.length){r[s]=[n,e];return}for(let o=0;o<n.length;o++)l(n[o],e[o],`${s}[${o}]`)}else new Set([...Object.keys(n),...Object.keys(e)]).forEach(c=>{l(n[c],e[c],s!==""?`${s}.${c}`:c)});else n!==e&&(r[s]=[n,e])};return l(t,f,i),r},p=(t,f)=>{const i=Array.isArray(t),r=Array.isArray(f);if(i!==r)return!1;if(i&&r){const e=t,s=f;if(e.length!==s.length)return!1;for(let o=0;o<e.length;o++)if(!p(e[o],s[o]))return!1;return!0}if(t==null||f==null||typeof t!="object"||typeof f!="object")return t===f;if("equals"in t)return t.equals(f);const l=Object.keys(t),n=Object.keys(f);if(l.length!==n.length)return!1;for(const e of l){const s=t[e],o=f[e];if(typeof s=="object"&&typeof o=="object"){if(!p(s,o))return!1}else if(s!==o)return!1}return!0},h=(t,f)=>{if(typeof t!="object"||t==null)return t===f;const i=Object.keys(t),r=Object.keys(f);if(r.length>i.length)return!1;for(const l of r){const n=t[l],e=f[l];if(typeof n=="object"&&typeof e=="object"){if(!h(n,e))return!1}else if(n!==e)return!1}return!0},a=(t,...f)=>{if(f.length===0)return t;const i=f.shift();if(u.isObject(t)&&u.isObject(i))for(const r in i)try{u.isObject(i[r])?(r in t||Object.assign(t,{[r]:{}}),a(t[r],i[r])):Object.assign(t,{[r]:i[r]})}catch(l){throw l instanceof TypeError?new TypeError(`.${r}: ${l.message}`):l}return a(t,...f)},k=(t,f,i)=>{const r=(l,n,e)=>{if(e.def?.type==="union")return e.def.options.reduce((s,o)=>r(s,n,o),l);if(e.def?.type==="intersection"){const s=r(l,n,e.def.left);return r(s,n,e.def.right)}for(const s in n){const o=n[s];let c=e?.shape;if(c!=null)for(;c!=null;){if(c[s]!=null){const g=c[s].safeParse(o);if(g.success){l[s]=g.data;break}}c=c.def?.shape}typeof o=="object"&&!Array.isArray(o)&&o!==null&&e&&e.shape&&e.shape[s]&&(l[s]||={},r(l[s],o,e.shape[s]))}return l};return r({...t},f,i)},O=Object.freeze(Object.defineProperty({__proto__:null,copy:d,deleteD:j,difference:A,element:y.element,equal:p,get:y.get,has:y.has,override:a,overrideValidItems:k,partialEqual:h,pathsMatch:y.pathsMatch,remove:y.remove,resolvePath:y.resolvePath,set:y.set,transformPath:y.transformPath},Symbol.toStringTag,{value:"Module"}));exports.deep=O;
|
package/dist/deep.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isObject as y } from "./identity.js";
|
|
2
|
-
import { e as h, g as d, h as A, p as j, r as k, a as V, s as w, t as E } from "./path-
|
|
2
|
+
import { e as h, g as d, h as A, p as j, r as k, a as V, s as w, t as E } from "./path-Blh4wJuA.js";
|
|
3
3
|
const O = (t) => {
|
|
4
4
|
try {
|
|
5
5
|
return structuredClone(t);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z as h } from "zod";
|
|
2
|
-
import { d as o, x as g, n as a } from "./base-
|
|
2
|
+
import { d as o, x as g, n as a } from "./base-BORMP3mH.js";
|
|
3
3
|
const r = h.object({ signedWidth: h.number(), signedHeight: h.number() }), c = h.union([o, r, g, a]), u = { width: 0, height: 0 }, m = { width: 1, height: 1 }, n = (t, e) => typeof t == "number" ? { width: t, height: e ?? t } : Array.isArray(t) ? { width: t[0], height: t[1] } : "x" in t ? { width: t.x, height: t.y } : "signedWidth" in t ? { width: t.signedWidth, height: t.signedHeight } : { ...t }, d = (t, e) => {
|
|
4
4
|
if (e == null) return !1;
|
|
5
5
|
const i = n(t), s = n(e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const h=require("zod"),s=require("./base-
|
|
1
|
+
"use strict";const h=require("zod"),s=require("./base-BLNViP3D.cjs"),o=h.z.object({signedWidth:h.z.number(),signedHeight:h.z.number()}),g=h.z.union([s.dimensions,o,s.xy,s.numberCouple]),c={width:0,height:0},u={width:1,height:1},n=(t,e)=>typeof t=="number"?{width:t,height:e??t}:Array.isArray(t)?{width:t[0],height:t[1]}:"x"in t?{width:t.x,height:t.y}:"signedWidth"in t?{width:t.signedWidth,height:t.signedHeight}:{...t},a=(t,e)=>{if(e==null)return!1;const i=n(t),r=n(e);return i.width===r.width&&i.height===r.height},d=t=>{const e=n(t);return{width:e.height,height:e.width}},m=t=>{const e=n(t);return`0 0 ${e.width} ${e.height}`},l=t=>{const e=n(t);return[e.width,e.height]},p=t=>({width:Math.max(...t.map(e=>n(e).width)),height:Math.max(...t.map(e=>n(e).height))}),b=t=>({width:Math.min(...t.map(e=>n(e).width)),height:Math.min(...t.map(e=>n(e).height))}),f=(t,e)=>{const i=n(t);return{width:i.width*e,height:i.height*e}},w=Object.freeze(Object.defineProperty({__proto__:null,DECIMAL:u,ZERO:c,construct:n,couple:l,crude:g,dimensions:s.dimensions,equals:a,max:p,min:b,scale:f,signed:o,svgViewBox:m,swap:d},Symbol.toStringTag,{value:"Module"}));exports.dimensions=w;
|
package/dist/dimensions.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./dimensions-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./dimensions-qY12pyfC.cjs");exports.dimensions=e.dimensions;
|
package/dist/dimensions.js
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { c as i, D as n, Y as o, b as r } from "./base-BORMP3mH.js";
|
|
2
|
+
const s = i, t = (e) => n.includes(e) ? e : o.includes(e) ? "y" : "x", c = (e) => t(e) === "x" ? "y" : "x", d = (e) => t(e) === "x" ? "width" : "height", u = (e) => t(e) === "x" ? "left" : "top", a = (e) => s.safeParse(e).success, l = (e) => t(e) === "x" ? "signedWidth" : "signedHeight", f = (e) => e === "center" ? !1 : t(e) === "x", x = (e) => t(e) === "y", p = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3
|
+
__proto__: null,
|
|
4
|
+
DIRECTIONS: n,
|
|
5
|
+
construct: t,
|
|
6
|
+
crude: s,
|
|
7
|
+
dimension: d,
|
|
8
|
+
direction: r,
|
|
9
|
+
isDirection: a,
|
|
10
|
+
isX: f,
|
|
11
|
+
isY: x,
|
|
12
|
+
location: u,
|
|
13
|
+
signedDimension: l,
|
|
14
|
+
swap: c
|
|
15
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
16
|
+
export {
|
|
17
|
+
t as c,
|
|
18
|
+
p as d
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("./base-BLNViP3D.cjs"),i=n.crudeDirection,t=e=>n.DIRECTIONS.includes(e)?e:n.Y_LOCATIONS.includes(e)?"y":"x",s=e=>t(e)==="x"?"y":"x",c=e=>t(e)==="x"?"width":"height",o=e=>t(e)==="x"?"left":"top",r=e=>i.safeParse(e).success,u=e=>t(e)==="x"?"signedWidth":"signedHeight",d=e=>e==="center"?!1:t(e)==="x",l=e=>t(e)==="y",a=Object.freeze(Object.defineProperty({__proto__:null,DIRECTIONS:n.DIRECTIONS,construct:t,crude:i,dimension:c,direction:n.direction,isDirection:r,isX:d,isY:l,location:o,signedDimension:u,swap:s},Symbol.toStringTag,{value:"Module"}));exports.construct=t;exports.direction=a;
|
package/dist/direction.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./direction-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./direction-XCdrc4is.cjs");exports.direction=e.direction;
|
package/dist/direction.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { t as i, g as f } from "./path-
|
|
3
|
-
const m = (e) => e.nullable().transform((t) => t === null ? void 0 : t).optional(), p = (e) =>
|
|
4
|
-
const l = r === n.length - 1,
|
|
5
|
-
return
|
|
1
|
+
import a from "zod";
|
|
2
|
+
import { t as i, g as f } from "./path-Blh4wJuA.js";
|
|
3
|
+
const m = (e) => e.nullable().transform((t) => t === null ? void 0 : t).optional(), p = (e) => a.array(e).or(e.transform((t) => [t])), s = (e) => i(e, (t, r, n) => {
|
|
4
|
+
const l = r === n.length - 1, u = !isNaN(parseInt(t)), c = !isNaN(parseInt(n[r + 1]));
|
|
5
|
+
return u && (t = "element"), l || c ? t : [t, "shape"];
|
|
6
6
|
}), o = (e, t) => {
|
|
7
7
|
if (e == null) return null;
|
|
8
8
|
const r = e[t];
|
|
9
9
|
return r == null && typeof e == "object" && "sourceType" in e ? e.sourceType()[t] : r;
|
|
10
|
-
}, y = (e, t, r) => f(
|
|
10
|
+
}, y = (e, t, r) => t === "" ? e : f(
|
|
11
11
|
o(e, "shape"),
|
|
12
12
|
s(t),
|
|
13
13
|
{ ...r, getter: o }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=require("zod"),s=require("./path-CPSfCjde.cjs"),f=e=>e.nullable().transform(t=>t===null?void 0:t).optional(),p=e=>a.array(e).or(e.transform(t=>[t])),u=e=>s.transformPath(e,(t,r,n)=>{const l=r===n.length-1,c=!isNaN(parseInt(t)),i=!isNaN(parseInt(n[r+1]));return c&&(t="element"),l||i?t:[t,"shape"]}),o=(e,t)=>{if(e==null)return null;const r=e[t];return r==null&&typeof e=="object"&&"sourceType"in e?e.sourceType()[t]:r},y=(e,t,r)=>t===""?e:s.get(o(e,"shape"),u(t),{...r,getter:o}),g=Object.freeze(Object.defineProperty({__proto__:null,getFieldSchema:y,getFieldSchemaPath:u,nullToUndefined:f,toArray:p},Symbol.toStringTag,{value:"Module"}));exports.external=g;
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _e=require("./array.cjs"),U=require("./index-BQe8OIgm.cjs"),o=require("zod"),h=require("./series-CcA_WjbJ.cjs"),Se=require("./index-DdhM_E4k.cjs"),ve=require("./change-C-YELKx6.cjs"),H=require("./scale-C6qKDbRb.cjs"),g=require("./index-DOJlZHqJ.cjs"),B=require("./debounce.cjs"),we=require("./deep.cjs"),Te=require("./identity.cjs"),Me=require("./external-B9AAGv50.cjs"),je=require("./link.cjs"),m=require("./bounds-D6e9xoHt.cjs"),ze=require("./observe.cjs"),Ee=require("./record-YvCh7bzB.cjs"),$e=require("./external-uXk0Avrg.cjs"),xe=require("./box-Cxki783Y.cjs"),ke=require("./dimensions-D2QGoNXO.cjs"),Oe=require("./direction-386XDm2w.cjs"),qe=require("./location-DZi8ftXp.cjs"),Ae=require("./position-DSy2hONH.cjs"),Re=require("./spatial-DGpZ2sO3.cjs"),Ne=require("./xy-CUE3QDNn.cjs"),Pe=require("./index-udOjA9d-.cjs"),V=require("./url.cjs"),L=require("./worker.cjs"),Ze=require("./external-DsmsSN1Y.cjs"),Ce=2,Le=3,Ie=2,We=(e,t)=>{if(Number.isNaN(e)||!Number.isFinite(e))return e;const r=m.span(t);if(r==0)return e;let n;r>=1e3?n=Ce:r>=1?n=Le:n=Math.ceil(-Math.log10(r))+Ie;const s=10**n;return Math.round(e*s)/s},De=Object.freeze(Object.defineProperty({__proto__:null,abs:m.abs,add:m.add,closeTo:m.closeTo,div:m.div,equal:m.equal,max:m.max$1,min:m.min,mult:m.mult,roundBySpan:We,roundToNearestMagnitude:m.roundToNearestMagnitude,sub:m.sub},Symbol.toStringTag,{value:"Module"})),F=async e=>await new Promise(t=>setTimeout(t,h.TimeSpan.fromMilliseconds(e).milliseconds)),Ue=Object.freeze(Object.defineProperty({__proto__:null,sleep:F},Symbol.toStringTag,{value:"Module"}));class He{config;retries;interval;constructor(t){this.config={baseInterval:new h.TimeSpan(t?.baseInterval??h.TimeSpan.seconds(1)),maxRetries:t?.maxRetries??5,scale:t?.scale??1,sleepFn:t?.sleepFn??F},this.retries=0,this.interval=new h.TimeSpan(this.config.baseInterval)}async wait(){const{maxRetries:t,scale:r,sleepFn:n}=this.config;return this.retries>=t?!1:(await n(this.interval),this.interval=this.interval.mult(r),this.retries++,!0)}reset(){this.retries=0,this.interval=this.config.baseInterval}}const Be=o.z.object({baseInterval:h.TimeSpan.z.optional(),maxRetries:o.z.number().optional(),scale:o.z.number().optional()}),Ve=Object.freeze(Object.defineProperty({__proto__:null,Breaker:He,breakerConfigZ:Be},Symbol.toStringTag,{value:"Module"})),Fe=/^#?([0-9a-f]{6}|[0-9a-f]{8})$/i,Q=o.z.string().regex(Fe),y=o.z.number().min(0).max(255),G=o.z.number().min(0).max(1),k=o.z.tuple([y,y,y,G]),Qe=o.z.tuple([y,y,y]),Ge=o.z.object({rgba255:k}),Je=o.z.number().min(0).max(360),Ye=o.z.number().min(0).max(100),Ke=o.z.number().min(0).max(100),J=o.z.tuple([Je,Ye,Ke,G]),O=o.z.union([Q,Qe,k,J,Ge]),q=O.transform(e=>f(e)),Xe=e=>q.safeParse(e).success,et=e=>k.safeParse(e).success,tt=e=>{if(e==null)return;const t=q.safeParse(e);if(t.success)return K(t.data);if(typeof e=="string")return e;throw t.error},f=(e,t=1)=>{if(e=O.parse(e),typeof e=="string")return ft(e,t);if(Array.isArray(e)){if(e.length<3||e.length>4)throw new Error(`Invalid color: [${e.join(", ")}]`);return e.length===3?[...e,t]:e}return e.rgba255},Y=(e,t)=>{if(e==null||t==null)return e==t;const r=f(e),n=f(t);return r.every((s,i)=>s===n[i])},rt=e=>{if(e==null)return;const[t,r,n,s]=f(e);return`#${$(t)}${$(r)}${$(n)}${s===1?"":$(s*255)}`},K=e=>{const[t,r,n,s]=f(e);return`rgba(${t}, ${r}, ${n}, ${s})`},nt=e=>`rgb(${X(e)})`,X=e=>{const[t,r,n]=f(e);return`${t}, ${r}, ${n}`},ot=e=>[...I(e),T(e)],I=e=>[S(e)/255,v(e)/255,w(e)/255],S=e=>f(e)[0],v=e=>f(e)[1],w=e=>f(e)[2],T=e=>f(e)[3],st=e=>Y(W,e),it=e=>mt(f(e)),ct=(e,t)=>{const[r,n,s]=f(e);if(t>100)throw new Error(`Color opacity must be between 0 and 100, got ${t}`);return t>1&&(t/=100),[r,n,s,t]},M=e=>{const[t,r,n]=I(e).map(s=>s<=.03928?s/12.92:((s+.055)/1.055)**2.4);return Number((.2126*t+.7152*r+.0722*n).toFixed(3))},at=e=>{const[t,r,n]=I(e);return 1-(Math.max(t,r,n)-Math.min(t,r,n))},N=(e,t)=>{const r=f(e),n=f(t),s=M(r),i=M(n);return(Math.max(s,i)+.5)/(Math.min(s,i)+.5)},lt=(e,...t)=>{if(t.length===0)throw new Error("[Color.pickByContrast] - must provide at least one color");const r=f(e),[n]=t.sort((s,i)=>N(r,i)-N(r,s));return f(n)},ut=e=>M(e)<.5,dt=e=>M(e)>.5,ft=(e,t=1)=>(e=Q.parse(e),e=ht(e),[x(e,0),x(e,2),x(e,4),e.length===8?x(e,6)/255:t]),W=[0,0,0,0],$=e=>Math.floor(e).toString(16).padStart(2,"0"),x=(e,t)=>parseInt(e.slice(t,t+2),16),ht=e=>e.startsWith("#")?e.slice(1):e,pt=e=>{e=J.parse(e);let[t,r,n]=e;const s=e[3];t/=360,r/=100,n/=100;let i,c,d;if(r===0)i=c=d=n;else{const l=n<.5?n*(1+r):n+r-n*r,a=2*n-l;i=R(a,l,t+1/3),c=R(a,l,t),d=R(a,l,t-1/3)}return[Math.round(i*255),Math.round(c*255),Math.round(d*255),s]},R=(e,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e),mt=e=>{e=k.parse(e);let[t,r,n]=e;const s=e[3];t/=255,r/=255,n/=255;const i=Math.max(t,r,n),c=Math.min(t,r,n);let d,l,a=(i+c)/2;if(i===c)d=l=0;else{const u=i-c;l=a>.5?u/(2-i-c):u/(i+c),i===t?d=(r-n)/u+(r<n?6:0):i===r?d=(n-t)/u+2:d=(t-r)/u+4,d/=6}return d*=360,l*=100,a*=100,[Math.round(d),Math.round(l),Math.round(a),s]},gt=f("#000000"),bt=f("#ffffff"),ee=o.z.object({key:o.z.string(),color:O,position:o.z.number(),switched:o.z.boolean().optional()}),yt=o.z.array(ee),_t=(e,t)=>{if(e.length===0)return W;if(e=e.slice().sort((r,n)=>r.position-n.position),t<=e[0].position)return f(e[0].color);if(t>=e[e.length-1].position)return f(e[e.length-1].color);for(let r=0;r<e.length-1;r++){const n=e[r],s=e[r+1];if(t<n.position||t>s.position)continue;if(t===n.position)return f(n.color);if(t===s.position)return f(s.color);const i=(t-n.position)/(s.position-n.position),c=f(n.color),d=f(s.color),l=Math.round(S(c)+i*(S(d)-S(c))),a=Math.round(v(c)+i*(v(d)-v(c))),u=Math.round(w(c)+i*(w(d)-w(c))),p=T(c)+i*(T(d)-T(c));return f([l,a,u,p])}return f(e[e.length-1].color)},St=o.z.object({key:o.z.string(),name:o.z.string(),color:q}),vt=o.z.object({key:o.z.string(),name:o.z.string(),swatches:o.z.array(St)}),wt=Object.freeze(Object.defineProperty({__proto__:null,BLACK:gt,WHITE:bt,ZERO:W,aValue:T,bValue:w,colorZ:q,construct:f,contrast:N,crudeZ:O,cssString:tt,equals:Y,fromGradient:_t,fromHSLA:pt,gValue:v,gradientZ:yt,grayness:at,hex:rt,hsla:it,isColor:et,isCrude:Xe,isDark:ut,isLight:dt,isZero:st,luminance:M,paletteZ:vt,pickByContrast:lt,rValue:S,rgbCSS:nt,rgbString:X,rgba1:ot,rgbaCSS:K,setAlpha:ct,stopZ:ee},Symbol.toStringTag,{value:"Module"})),te=o.z.int().min(0).max(255),re=255,ne=0,Tt={lower:ne,upper:re+1},oe=o.z.object({name:o.z.string(),key:o.z.string()}),j=e=>o.z.object({subject:oe,resource:e,authority:te}),Mt=(...e)=>t=>t.filter(r=>{let n=!1;return r.to!=null&&(n=e.includes(r.to.resource)),r.from!=null&&!n&&(n=e.includes(r.from.resource)),n}),se=e=>o.z.object({from:j(e),to:o.z.null()}),ie=e=>o.z.object({from:o.z.null(),to:j(e)}),jt=e=>o.z.union([se(e),ie(e),o.z.object({from:j(e),to:j(e)})]),zt=Object.freeze(Object.defineProperty({__proto__:null,ABSOLUTE_AUTHORITY:re,AUTHORITY_BOUNDS:Tt,ZERO_AUTHORITY:ne,acquireZ:ie,authorityZ:te,filterTransfersByChannelKey:Mt,releaseZ:se,stateZ:j,subjectZ:oe,transferZ:jt},Symbol.toStringTag,{value:"Module"})),Et=e=>Object.getOwnPropertySymbols(globalThis).includes(e),$t=(e,t)=>{const r=Symbol.for(e);if(!Et(r)){const n=t();Object.defineProperty(globalThis,r,{value:n})}return()=>globalThis[r]},ce="sy_x_error",xt=e=>t=>t!=null&&typeof t=="object"&&"type"in t&&typeof t.type=="string"?t.type.startsWith(e):t instanceof Error?t.message.startsWith(e):typeof t!="string"?!1:t.startsWith(e),z=e=>class _ extends Error{static discriminator=ce;discriminator=_.discriminator;static TYPE=e;type=_.TYPE;static matches=xt(e);matches=_.matches;constructor(r,n){super(r,n),this.name=_.TYPE}static sub(r){return z(`${e}.${r}`)}},ae=e=>{if(e==null||typeof e!="object")return!1;const t=e;if(t.discriminator!==ce)return!1;if(!("type"in t))throw new Error(`X Error is missing its type property: ${JSON.stringify(t)}`);return!0},b="unknown",P="nil";class kt{providers=[];register(t){this.providers.push(t)}encode(t){if(t==null)return{type:P,data:""};if(ae(t))for(const r of this.providers){const n=r.encode(t);if(n!=null)return n}if(t instanceof Error)return{type:b,data:t.message};if(typeof t=="string")return{type:b,data:t};try{return{type:b,data:JSON.stringify(t)}}catch{return{type:b,data:"unable to encode error information"}}}decode(t){if(t==null||t.type===P)return null;if(t.type===b)return new Z(t.data);for(const r of this.providers){const n=r.decode(t);if(n!=null)return n}return new Z(t.data)}}const D=$t("synnax-error-registry",()=>new kt),Ot=({encode:e,decode:t})=>D().register({encode:e,decode:t}),qt=e=>D().encode(e),At=e=>e==null?null:D().decode(e);class Z extends z("unknown"){}const Rt=o.z.object({type:o.z.string(),data:o.z.string()});class Nt extends z("canceled"){}class Pt extends z("not_implemented"){}const Zt=Object.freeze(Object.defineProperty({__proto__:null,Canceled:Nt,NONE:P,NotImplemented:Pt,UNKNOWN:b,Unknown:Z,createTyped:z,decode:At,encode:qt,isTyped:ae,payloadZ:Rt,register:Ot},Symbol.toStringTag,{value:"Module"})),Ct=()=>Promise.resolve(),Lt=()=>new Promise(e=>setTimeout(e,0)),It=e=>e?-1:1,le=o.object({jsonrpc:o.literal("2.0"),method:o.string(),params:o.any().optional(),id:o.union([o.string(),o.number(),o.null()]).optional()}),ue=o.object({jsonrpc:o.literal("2.0"),id:o.union([o.string(),o.number(),o.null()])}),Wt=ue.extend({result:o.json()}),Dt=ue.extend({error:o.object({code:o.number().int(),message:o.string().optional(),data:o.json().optional()})}),de=o.union([Wt,Dt]),fe=o.union([le,de]),Ut=e=>{const t=new TextDecoder;let r=new Uint8Array(0),n=null;return s=>{let i;typeof s=="string"?i=new TextEncoder().encode(s):s instanceof ArrayBuffer?i=new Uint8Array(s):i=s;const c=new Uint8Array(r.length+i.length);for(c.set(r),c.set(i,r.length),r=c;r.length>0;){if(n===null){const l=t.decode(r).match(/^Content-Length: (\d+)\r?\n\r?\n/);if(!l)break;n=parseInt(l[1]);const a=new TextEncoder().encode(l[0]).length;r=r.slice(a)}if(n!==null&&r.length>=n){const d=r.slice(0,n);r=r.slice(n),n=null;const l=t.decode(d),a=U.JSON_CODEC.decodeString(l,fe);e(a)}else break}}},Ht=e=>{const t=JSON.stringify(e);return`Content-Length: ${new TextEncoder().encode(t).length}\r
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _e=require("./array.cjs"),U=require("./index-BQe8OIgm.cjs"),s=require("zod"),h=require("./series-tAhThbnz.cjs"),Se=require("./index-DdhM_E4k.cjs"),ve=require("./change-C-YELKx6.cjs"),H=require("./scale-76Azh2EE.cjs"),m=require("./index-DOJlZHqJ.cjs"),B=require("./debounce.cjs"),we=require("./deep.cjs"),Te=require("./identity.cjs"),Me=require("./external-B9AAGv50.cjs"),je=require("./link.cjs"),g=require("./bounds-BXbqBINt.cjs"),ze=require("./observe.cjs"),$e=require("./record-BwjIgrpU.cjs"),Ee=require("./external-uXk0Avrg.cjs"),xe=require("./box-qgxWXNhm.cjs"),ke=require("./dimensions-qY12pyfC.cjs"),Oe=require("./direction-XCdrc4is.cjs"),qe=require("./location-DJ_K4SlP.cjs"),Ae=require("./spatial-BsGadoUr.cjs"),Re=require("./xy-BKIJiLu_.cjs"),Ne=require("./index-udOjA9d-.cjs"),V=require("./url.cjs"),C=require("./worker.cjs"),Pe=require("./external-E3ErJeeM.cjs"),Ze=2,Ie=3,Ce=2,Le=(e,t)=>{if(Number.isNaN(e)||!Number.isFinite(e))return e;const r=g.span(t);if(r==0)return e;let n;r>=1e3?n=Ze:r>=1?n=Ie:n=Math.ceil(-Math.log10(r))+Ce;const o=10**n;return Math.round(e*o)/o},We=Object.freeze(Object.defineProperty({__proto__:null,abs:g.abs,add:g.add,closeTo:g.closeTo,div:g.div,equal:g.equal,isInteger:g.isInteger,max:g.max$1,min:g.min,mult:g.mult,roundBySpan:Le,roundToNearestMagnitude:g.roundToNearestMagnitude,sub:g.sub},Symbol.toStringTag,{value:"Module"})),F=async e=>await new Promise(t=>setTimeout(t,h.TimeSpan.fromMilliseconds(e).milliseconds)),De=Object.freeze(Object.defineProperty({__proto__:null,sleep:F},Symbol.toStringTag,{value:"Module"}));class Ue{config;retries;interval;constructor(t){this.config={baseInterval:new h.TimeSpan(t?.baseInterval??h.TimeSpan.seconds(1)),maxRetries:t?.maxRetries??5,scale:t?.scale??1,sleepFn:t?.sleepFn??F},this.retries=0,this.interval=new h.TimeSpan(this.config.baseInterval)}async wait(){const{maxRetries:t,scale:r,sleepFn:n}=this.config;return this.retries>=t?!1:(await n(this.interval),this.interval=this.interval.mult(r),this.retries++,!0)}get retryMessage(){return`breaker triggered ${this.retries+1}/${this.config.maxRetries} times, retrying in ${this.interval.toString()}`}reset(){this.retries=0,this.interval=this.config.baseInterval}}const He=s.z.object({baseInterval:h.TimeSpan.z.optional(),maxRetries:s.z.number().optional(),scale:s.z.number().optional()}),Be=Object.freeze(Object.defineProperty({__proto__:null,Breaker:Ue,breakerConfigZ:He},Symbol.toStringTag,{value:"Module"})),Ve=/^#?([0-9a-f]{6}|[0-9a-f]{8})$/i,Q=s.z.string().regex(Ve),y=s.z.number().min(0).max(255),G=s.z.number().min(0).max(1),k=s.z.tuple([y,y,y,G]),Fe=s.z.tuple([y,y,y]),Qe=s.z.object({rgba255:k}),Ge=s.z.number().min(0).max(360),Je=s.z.number().min(0).max(100),Ye=s.z.number().min(0).max(100),J=s.z.tuple([Ge,Je,Ye,G]),O=s.z.union([Q,Fe,k,J,Qe]),q=O.transform(e=>f(e)),Ke=e=>q.safeParse(e).success,Xe=e=>k.safeParse(e).success,et=e=>{if(e==null)return;const t=q.safeParse(e);if(t.success)return K(t.data);if(typeof e=="string")return e;throw t.error},f=(e,t=1)=>{if(e=O.parse(e),typeof e=="string")return dt(e,t);if(Array.isArray(e)){if(e.length<3||e.length>4)throw new Error(`Invalid color: [${e.join(", ")}]`);return e.length===3?[...e,t]:e}return e.rgba255},Y=(e,t)=>{if(e==null||t==null)return e==t;const r=f(e),n=f(t);return r.every((o,i)=>o===n[i])},tt=e=>{if(e==null)return;const[t,r,n,o]=f(e);return`#${E(t)}${E(r)}${E(n)}${o===1?"":E(o*255)}`},K=e=>{const[t,r,n,o]=f(e);return`rgba(${t}, ${r}, ${n}, ${o})`},rt=e=>`rgb(${X(e)})`,X=e=>{const[t,r,n]=f(e);return`${t}, ${r}, ${n}`},nt=e=>[...L(e),T(e)],L=e=>[S(e)/255,v(e)/255,w(e)/255],S=e=>f(e)[0],v=e=>f(e)[1],w=e=>f(e)[2],T=e=>f(e)[3],st=e=>Y(W,e),ot=e=>pt(f(e)),it=(e,t)=>{const[r,n,o]=f(e);if(t>100)throw new Error(`Color opacity must be between 0 and 100, got ${t}`);return t>1&&(t/=100),[r,n,o,t]},M=e=>{const[t,r,n]=L(e).map(o=>o<=.03928?o/12.92:((o+.055)/1.055)**2.4);return Number((.2126*t+.7152*r+.0722*n).toFixed(3))},ct=e=>{const[t,r,n]=L(e);return 1-(Math.max(t,r,n)-Math.min(t,r,n))},N=(e,t)=>{const r=f(e),n=f(t),o=M(r),i=M(n);return(Math.max(o,i)+.5)/(Math.min(o,i)+.5)},at=(e,...t)=>{if(t.length===0)throw new Error("[Color.pickByContrast] - must provide at least one color");const r=f(e),[n]=t.sort((o,i)=>N(r,i)-N(r,o));return f(n)},lt=e=>M(e)<.5,ut=e=>M(e)>.5,dt=(e,t=1)=>(e=Q.parse(e),e=ft(e),[x(e,0),x(e,2),x(e,4),e.length===8?x(e,6)/255:t]),W=[0,0,0,0],E=e=>Math.floor(e).toString(16).padStart(2,"0"),x=(e,t)=>parseInt(e.slice(t,t+2),16),ft=e=>e.startsWith("#")?e.slice(1):e,ht=e=>{e=J.parse(e);let[t,r,n]=e;const o=e[3];t/=360,r/=100,n/=100;let i,c,d;if(r===0)i=c=d=n;else{const l=n<.5?n*(1+r):n+r-n*r,a=2*n-l;i=R(a,l,t+1/3),c=R(a,l,t),d=R(a,l,t-1/3)}return[Math.round(i*255),Math.round(c*255),Math.round(d*255),o]},R=(e,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e),pt=e=>{e=k.parse(e);let[t,r,n]=e;const o=e[3];t/=255,r/=255,n/=255;const i=Math.max(t,r,n),c=Math.min(t,r,n);let d,l,a=(i+c)/2;if(i===c)d=l=0;else{const u=i-c;l=a>.5?u/(2-i-c):u/(i+c),i===t?d=(r-n)/u+(r<n?6:0):i===r?d=(n-t)/u+2:d=(t-r)/u+4,d/=6}return d*=360,l*=100,a*=100,[Math.round(d),Math.round(l),Math.round(a),o]},gt=f("#000000"),mt=f("#ffffff"),ee=s.z.object({key:s.z.string(),color:O,position:s.z.number(),switched:s.z.boolean().optional()}),bt=s.z.array(ee),yt=(e,t)=>{if(e.length===0)return W;if(e=e.slice().sort((r,n)=>r.position-n.position),t<=e[0].position)return f(e[0].color);if(t>=e[e.length-1].position)return f(e[e.length-1].color);for(let r=0;r<e.length-1;r++){const n=e[r],o=e[r+1];if(t<n.position||t>o.position)continue;if(t===n.position)return f(n.color);if(t===o.position)return f(o.color);const i=(t-n.position)/(o.position-n.position),c=f(n.color),d=f(o.color),l=Math.round(S(c)+i*(S(d)-S(c))),a=Math.round(v(c)+i*(v(d)-v(c))),u=Math.round(w(c)+i*(w(d)-w(c))),p=T(c)+i*(T(d)-T(c));return f([l,a,u,p])}return f(e[e.length-1].color)},_t=s.z.object({key:s.z.string(),name:s.z.string(),color:q}),St=s.z.object({key:s.z.string(),name:s.z.string(),swatches:s.z.array(_t)}),vt=Object.freeze(Object.defineProperty({__proto__:null,BLACK:gt,WHITE:mt,ZERO:W,aValue:T,bValue:w,colorZ:q,construct:f,contrast:N,crudeZ:O,cssString:et,equals:Y,fromGradient:yt,fromHSLA:ht,gValue:v,gradientZ:bt,grayness:ct,hex:tt,hsla:ot,isColor:Xe,isCrude:Ke,isDark:lt,isLight:ut,isZero:st,luminance:M,paletteZ:St,pickByContrast:at,rValue:S,rgbCSS:rt,rgbString:X,rgba1:nt,rgbaCSS:K,setAlpha:it,stopZ:ee},Symbol.toStringTag,{value:"Module"})),te=s.z.int().min(0).max(255),re=255,ne=0,wt={lower:ne,upper:re+1},se=s.z.object({name:s.z.string(),key:s.z.string()}),j=e=>s.z.object({subject:se,resource:e,authority:te}),Tt=(...e)=>t=>t.filter(r=>{let n=!1;return r.to!=null&&(n=e.includes(r.to.resource)),r.from!=null&&!n&&(n=e.includes(r.from.resource)),n}),oe=e=>s.z.object({from:j(e),to:s.z.null()}),ie=e=>s.z.object({from:s.z.null(),to:j(e)}),Mt=e=>s.z.union([oe(e),ie(e),s.z.object({from:j(e),to:j(e)})]),jt=Object.freeze(Object.defineProperty({__proto__:null,ABSOLUTE_AUTHORITY:re,AUTHORITY_BOUNDS:wt,ZERO_AUTHORITY:ne,acquireZ:ie,authorityZ:te,filterTransfersByChannelKey:Tt,releaseZ:oe,stateZ:j,subjectZ:se,transferZ:Mt},Symbol.toStringTag,{value:"Module"})),zt=e=>Object.getOwnPropertySymbols(globalThis).includes(e),$t=(e,t)=>{const r=Symbol.for(e);if(!zt(r)){const n=t();Object.defineProperty(globalThis,r,{value:n})}return()=>globalThis[r]},ce="sy_x_error",Et=e=>t=>t!=null&&typeof t=="object"&&"type"in t&&typeof t.type=="string"?t.type.startsWith(e):t instanceof Error?t.message.startsWith(e):typeof t!="string"?!1:t.startsWith(e),z=e=>class _ extends Error{static discriminator=ce;discriminator=_.discriminator;static TYPE=e;type=_.TYPE;static matches=Et(e);matches=_.matches;constructor(r,n){super(r,n),this.name=_.TYPE}static sub(r){return z(`${e}.${r}`)}},ae=e=>{if(e==null||typeof e!="object")return!1;const t=e;if(t.discriminator!==ce)return!1;if(!("type"in t))throw new Error(`X Error is missing its type property: ${JSON.stringify(t)}`);return!0},b="unknown",P="nil";class xt{providers=[];register(t){this.providers.push(t)}encode(t){if(t==null)return{type:P,data:""};if(ae(t))for(const r of this.providers){const n=r.encode(t);if(n!=null)return n}if(t instanceof Error)return{type:b,data:t.message};if(typeof t=="string")return{type:b,data:t};try{return{type:b,data:JSON.stringify(t)}}catch{return{type:b,data:"unable to encode error information"}}}decode(t){if(t==null||t.type===P)return null;if(t.type===b)return new Z(t.data);for(const r of this.providers){const n=r.decode(t);if(n!=null)return n}return new Z(t.data)}}const D=$t("synnax-error-registry",()=>new xt),kt=({encode:e,decode:t})=>D().register({encode:e,decode:t}),Ot=e=>D().encode(e),qt=e=>e==null?null:D().decode(e);class Z extends z("unknown"){}const At=s.z.object({type:s.z.string(),data:s.z.string()});class Rt extends z("canceled"){}class Nt extends z("not_implemented"){}const Pt=Object.freeze(Object.defineProperty({__proto__:null,Canceled:Rt,NONE:P,NotImplemented:Nt,UNKNOWN:b,Unknown:Z,createTyped:z,decode:qt,encode:Ot,isTyped:ae,payloadZ:At,register:kt},Symbol.toStringTag,{value:"Module"})),Zt=()=>Promise.resolve(),It=()=>new Promise(e=>setTimeout(e,0)),Ct=e=>e?-1:1,le=s.object({jsonrpc:s.literal("2.0"),method:s.string(),params:s.any().optional(),id:s.union([s.string(),s.number(),s.null()]).optional()}),ue=s.object({jsonrpc:s.literal("2.0"),id:s.union([s.string(),s.number(),s.null()])}),Lt=ue.extend({result:s.json()}),Wt=ue.extend({error:s.object({code:s.number().int(),message:s.string().optional(),data:s.json().optional()})}),de=s.union([Lt,Wt]),fe=s.union([le,de]),Dt=e=>{const t=new TextDecoder;let r=new Uint8Array(0),n=null;return o=>{let i;typeof o=="string"?i=new TextEncoder().encode(o):o instanceof ArrayBuffer?i=new Uint8Array(o):i=o;const c=new Uint8Array(r.length+i.length);for(c.set(r),c.set(i,r.length),r=c;r.length>0;){if(n===null){const l=t.decode(r).match(/^Content-Length: (\d+)\r?\n\r?\n/);if(!l)break;n=parseInt(l[1]);const a=new TextEncoder().encode(l[0]).length;r=r.slice(a)}if(n!==null&&r.length>=n){const d=r.slice(0,n);r=r.slice(n),n=null;const l=t.decode(d),a=U.JSON_CODEC.decodeString(l,fe);e(a)}else break}}},Ut=e=>{const t=JSON.stringify(e);return`Content-Length: ${new TextEncoder().encode(t).length}\r
|
|
2
2
|
\r
|
|
3
|
-
`+t},
|
|
3
|
+
`+t},Ht=Object.freeze(Object.defineProperty({__proto__:null,encodeMessage:Ut,messageZ:fe,requestZ:le,responseZ:de,streamDecodeChunks:Dt},Symbol.toStringTag,{value:"Module"})),Bt=(e,t,r)=>{const n=e.get(t);return n===void 0?(e.set(t,r),r):n},Vt=Object.freeze(Object.defineProperty({__proto__:null,getOrSetDefault:Bt},Symbol.toStringTag,{value:"Module"})),I=s.z.string().regex(/^\d+\.\d+\.\d+$/),$=(e,t,r={})=>{r.checkMajor??=!0,r.checkMinor??=!0,r.checkPatch??=!0;const n=I.parse(e),o=I.parse(t),[i,c,d]=n.split(".").map(Number),[l,a,u]=o.split(".").map(Number);if(r.checkMajor){if(i<l)return m.LESS_THAN;if(i>l)return m.GREATER_THAN}if(r.checkMinor){if(c<a)return m.LESS_THAN;if(c>a)return m.GREATER_THAN}if(r.checkPatch){if(d<u)return m.LESS_THAN;if(d>u)return m.GREATER_THAN}return m.EQUAL},Ft=(e,t,r={})=>m.isEqualTo($(e,t,r)),he=(e,t,r={})=>m.isGreaterThan($(e,t,r)),Qt=(e,t,r={})=>m.isLessThan($(e,t,r)),Gt=({name:e,migrate:t})=>r=>{try{const n=t(r);return console.log(`${e} migrated: ${r.version} -> ${n.version}`),n}catch(n){throw console.log(`${e} failed to migrate from ${r.version}`),console.error(n),n}},Jt=({name:e,migrations:t,targetSchema:r,defaultVersion:n,def:o})=>{const i=Object.keys(t).sort($).pop();if(i==null)return a=>{if(a.version??=n,a.version!==o.version)return console.log(`${e} version ${a.version} is newer than latest version of ${o.version}.
|
|
4
4
|
Returning default instead.
|
|
5
|
-
`),
|
|
5
|
+
`),o;try{return r!=null?r.parse(a):a}catch(u){return console.log(`${e} failed to parse default. Exiting with default`),console.error(u),o}};const c=Object.keys(t).length;let d=!1;const l=a=>{try{if(c===0||he(a.version,i))return console.log(d?`${e} ${a.version} now up to date`:`${e} version ${a.version} is up to date with target version ${o.version}`),a;const u=a.version,p=t[u],A=p(a);return d=!0,l(A)}catch(u){return console.log(`${e} failed to migrate from ${a.version} to ${i}`),console.error(u),o}};return a=>{try{if(a.version==null)if(n!=null)console.log(`${e} version is null. Setting version to default of ${n}`),a.version=n;else return console.log(`${e} version is null and no default version set. Exiting with default`),o;return l(a)}catch(u){return console.log(`${e} failed to parse final result. Exiting with default`),console.error(u),o}}},Yt=Object.freeze(Object.defineProperty({__proto__:null,compareSemVer:$,createMigration:Gt,migrator:Jt,semVerNewer:he,semVerOlder:Qt,semVerZ:I,versionsEqual:Ft},Symbol.toStringTag,{value:"Module"})),pe=["standard","scientific","engineering"],Kt=s.z.enum(pe),Xt=(e,t,r)=>{if(Number.isNaN(e))return"NaN";if(e===1/0)return"∞";if(e===-1/0)return"-∞";if(r==="standard")return e.toFixed(t);if(e===0)return t===0?"0ᴇ0":`0.${"0".repeat(t)}ᴇ0`;let n;return r==="scientific"?n=Math.floor(Math.log10(Math.abs(e))):n=Math.floor(Math.log10(Math.abs(e))/3)*3,`${(e/10**n).toFixed(t)}ᴇ${n}`},er=Object.freeze(Object.defineProperty({__proto__:null,NOTATIONS:pe,notationZ:Kt,stringifyNumber:Xt},Symbol.toStringTag,{value:"Module"})),tr=e=>{if(e===void 0||typeof e=="string"||typeof e=="number")return e;if(e.toString===void 0)throw new Error("invalid renderer");return e.toString()},rr=e=>Array.isArray(e)?[...e]:typeof e=="object"&&e!==null?{...e}:e,ge=s.z.enum(["success","info","warning","error","loading","disabled"]),nr=e=>s.z.object({key:s.z.string(),variant:ge,message:s.z.string(),description:s.z.string().optional(),time:h.TimeStamp.z,details:e??s.z.unknown().optional()}),sr=(e,t)=>{if(!(e instanceof Error))throw e;return me({variant:"error",message:t??e.message,description:t!=null?e.message:void 0,details:{stack:e.stack??""}})},me=e=>({key:h.create(),time:h.TimeStamp.now(),...e}),or=(e,t=[])=>Array.isArray(t)?t.includes(e)?e:void 0:t===e?e:void 0,ir=Object.freeze(Object.defineProperty({__proto__:null,create:me,filterVariant:or,fromException:sr,statusZ:nr,variantZ:ge},Symbol.toStringTag,{value:"Module"})),cr=(e,t="")=>{if(typeof e=="string")return e;const r=e.length;return r===0?t:r===1?e[0]:r===2?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e[r-1]}`},ar=e=>{const t=e.split(" "),r=new Set,n=t.map(l=>l.charAt(0).toLowerCase()).join("");r.add(n.replace(/-/g,"_")),r.add(n.replace(/(.)(.)/g,"$1_$2").replace(/-/g,"_"));const o=/\d+/g;e.match(o)&&t.forEach((l,a)=>{if(o.test(l)){const u=t.map((p,A)=>A!==a?p.charAt(0).toLowerCase():p).join("");r.add(u.replace(/-/g,"_")),r.add(u.replace(/(.)(.)/g,"$1_$2").replace(/-/g,"_"))}});const c=t.map(l=>(l.length>3?l.substring(0,3):l).toLowerCase());return r.add(c.join("").replace(/-/g,"_")),r.add(c.join("_").replace(/-/g,"_")),Array.from(r).filter(l=>l.length>=2&&l.length<=12&&!/^\d/.test(l))},lr=(e,t)=>e.startsWith(t)?e.slice(t.length):e,ur=Object.freeze(Object.defineProperty({__proto__:null,createShortIdentifiers:ar,naturalLanguageJoin:cr,trimPrefix:lr},Symbol.toStringTag,{value:"Module"})),dr=new Error("request for lock canceled");var fr=function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(c){c(i)})}return new(r||(r=Promise))(function(i,c){function d(u){try{a(n.next(u))}catch(p){c(p)}}function l(u){try{a(n.throw(u))}catch(p){c(p)}}function a(u){u.done?i(u.value):o(u.value).then(d,l)}a((n=n.apply(e,t||[])).next())})};class hr{constructor(t,r=dr){this._value=t,this._cancelError=r,this._queue=[],this._weightedWaiters=[]}acquire(t=1,r=0){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);return new Promise((n,o)=>{const i={resolve:n,reject:o,weight:t,priority:r},c=be(this._queue,d=>r<=d.priority);c===-1&&t<=this._value?this._dispatchItem(i):this._queue.splice(c+1,0,i)})}runExclusive(t){return fr(this,arguments,void 0,function*(r,n=1,o=0){const[i,c]=yield this.acquire(n,o);try{return yield r(i)}finally{c()}})}waitForUnlock(t=1,r=0){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);return this._couldLockImmediately(t,r)?Promise.resolve():new Promise(n=>{this._weightedWaiters[t-1]||(this._weightedWaiters[t-1]=[]),pr(this._weightedWaiters[t-1],{resolve:n,priority:r})})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(t){this._value=t,this._dispatchQueue()}release(t=1){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);this._value+=t,this._dispatchQueue()}cancel(){this._queue.forEach(t=>t.reject(this._cancelError)),this._queue=[]}_dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}_dispatchItem(t){const r=this._value;this._value-=t.weight,t.resolve([r,this._newReleaser(t.weight)])}_newReleaser(t){let r=!1;return()=>{r||(r=!0,this.release(t))}}_drainUnlockWaiters(){if(this._queue.length===0)for(let t=this._value;t>0;t--){const r=this._weightedWaiters[t-1];r&&(r.forEach(n=>n.resolve()),this._weightedWaiters[t-1]=[])}else{const t=this._queue[0].priority;for(let r=this._value;r>0;r--){const n=this._weightedWaiters[r-1];if(!n)continue;const o=n.findIndex(i=>i.priority<=t);(o===-1?n:n.splice(0,o)).forEach(i=>i.resolve())}}}_couldLockImmediately(t,r){return(this._queue.length===0||this._queue[0].priority<r)&&t<=this._value}}function pr(e,t){const r=be(e,n=>t.priority<=n.priority);e.splice(r+1,0,t)}function be(e,t){for(let r=e.length-1;r>=0;r--)if(t(e[r]))return r;return-1}var gr=function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(c){c(i)})}return new(r||(r=Promise))(function(i,c){function d(u){try{a(n.next(u))}catch(p){c(p)}}function l(u){try{a(n.throw(u))}catch(p){c(p)}}function a(u){u.done?i(u.value):o(u.value).then(d,l)}a((n=n.apply(e,t||[])).next())})};class mr{constructor(t){this._semaphore=new hr(1,t)}acquire(){return gr(this,arguments,void 0,function*(t=0){const[,r]=yield this._semaphore.acquire(1,t);return r})}runExclusive(t,r=0){return this._semaphore.runExclusive(()=>t(),1,r)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(t=0){return this._semaphore.waitForUnlock(1,t)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}}class ye extends mr{constructor(t){super(),Object.assign(this,t)}}const br=e=>new ye(e),yr=Object.freeze(Object.defineProperty({__proto__:null,mutex:ye,newMutex:br},Symbol.toStringTag,{value:"Module"})),_r=e=>JSON.stringify(e,(t,r)=>typeof r=="bigint"?r.toString():r),Sr=async(e,t=200,r=20)=>{const n=Date.now();for(;Date.now()-n<t;)await e(),await new Promise(o=>setTimeout(o,r))},vr=Object.freeze(Object.defineProperty({__proto__:null,expectAlways:Sr,toString:_r},Symbol.toStringTag,{value:"Module"}));exports.array=_e.array;exports.binary=U.codec;exports.DataType=h.DataType;exports.Density=h.Density;exports.MultiSeries=h.MultiSeries;exports.Rate=h.Rate;exports.Series=h.Series;exports.Size=h.Size;exports.TimeRange=h.TimeRange;exports.TimeSpan=h.TimeSpan;exports.TimeStamp=h.TimeStamp;exports.addSamples=h.addSamples;exports.convertDataType=h.convertDataType;exports.id=h.id;exports.instance=h.matcher;exports.isCrudeSeries=h.isCrudeSeries;exports.isTelemValue=h.isTelemValue;exports.typedArrayZ=h.typedArrayZ;exports.uuid=h.uuid;exports.caseconv=Se.caseconv;exports.change=ve.change;exports.clamp=H.clamp;exports.scale=H.scale;exports.compare=m.compare;exports.primitive=m.primitive;exports.debounce=B.debounce;exports.throttle=B.throttle;exports.deep=we.deep;exports.isObject=Te.isObject;exports.kv=Me.external;exports.link=je.link;exports.bounds=g.bounds;exports.observe=ze.observe;exports.record=$e.record;exports.runtime=Ee.external;exports.box=xe.box;exports.dimensions=ke.dimensions;exports.direction=Oe.direction;exports.location=qe.location;exports.spatial=Ae.spatial;exports.xy=Re.xy;exports.unique=Ne.unique;exports.URL=V.URL;exports.buildQueryString=V.buildQueryString;exports.RoutedWorker=C.RoutedWorker;exports.TypedWorker=C.TypedWorker;exports.createMockWorkers=C.createMockWorkers;exports.zod=Pe.external;exports.breaker=Be;exports.color=vt;exports.control=jt;exports.convertRenderV=tr;exports.errors=Pt;exports.flushMicrotasks=Zt;exports.flushTaskQueue=It;exports.invert=Ct;exports.jsonRPC=Ht;exports.map=Vt;exports.math=We;exports.migrate=Yt;exports.notation=er;exports.shallowCopy=rr;exports.sleep=De;exports.status=ir;exports.strings=ur;exports.sync=yr;exports.testutil=vr;
|