@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
package/dist/index.js
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import { array as
|
|
1
|
+
import { array as $r } from "./array.js";
|
|
2
2
|
import { J as ge } from "./index-B5l_quQn.js";
|
|
3
|
-
import { c as
|
|
3
|
+
import { c as Er } from "./index-B5l_quQn.js";
|
|
4
4
|
import h, { z as i } from "zod";
|
|
5
|
-
import { a as _, T as U, h as be } from "./series-
|
|
6
|
-
import { c as
|
|
7
|
-
import { a as
|
|
8
|
-
import { c as
|
|
9
|
-
import { c as
|
|
10
|
-
import { i as _e, a as ye, b as we, L as Z, G as
|
|
11
|
-
import { c as
|
|
12
|
-
import { debounce as
|
|
13
|
-
import { deep as
|
|
14
|
-
import { isObject as
|
|
15
|
-
import { e as
|
|
16
|
-
import { link as
|
|
17
|
-
import {
|
|
18
|
-
import { b as
|
|
19
|
-
import { observe as
|
|
20
|
-
import { r as
|
|
21
|
-
import { e as
|
|
22
|
-
import { b as
|
|
23
|
-
import { d as
|
|
24
|
-
import { d as
|
|
25
|
-
import { l as
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import { u as Nn } from "./index-D4NCYiQB.js";
|
|
5
|
+
import { a as _, T as U, h as be } from "./series-kgnLXSDr.js";
|
|
6
|
+
import { c as kr, D as Ar, M as Pr, R as Zr, S as Ir, d as Nr, b as Rr, g as Cr, f as Lr, j as qr, m as Wr, i as zr, e as Dr, t as Ur, u as Br } from "./series-kgnLXSDr.js";
|
|
7
|
+
import { a as Fr } from "./index-D2xcvEO5.js";
|
|
8
|
+
import { c as Jr } from "./change-DLl6DccR.js";
|
|
9
|
+
import { c as Qr, s as Yr } from "./scale-BhIvACdB.js";
|
|
10
|
+
import { i as _e, a as ye, b as we, L as Z, G as I, E as ve } from "./index-CBMHFqs4.js";
|
|
11
|
+
import { c as Xr, p as en } from "./index-CBMHFqs4.js";
|
|
12
|
+
import { debounce as rn, throttle as nn } from "./debounce.js";
|
|
13
|
+
import { deep as on } from "./deep.js";
|
|
14
|
+
import { isObject as cn } from "./identity.js";
|
|
15
|
+
import { e as un } from "./external-BYuXBYJh.js";
|
|
16
|
+
import { link as dn } from "./link.js";
|
|
17
|
+
import { i as Se, j as xe, a as je, k as Me, d as $e, l as Te, n as Ee, o as Oe, p as ke, m as Ae, r as Pe, s as Ze } from "./bounds-BQqppNFf.js";
|
|
18
|
+
import { b as mn } from "./bounds-BQqppNFf.js";
|
|
19
|
+
import { observe as gn } from "./observe.js";
|
|
20
|
+
import { r as _n } from "./record-tSFQKmdG.js";
|
|
21
|
+
import { e as wn } from "./external-BPgtxa8d.js";
|
|
22
|
+
import { b as Sn } from "./box-DRH5SOaY.js";
|
|
23
|
+
import { d as jn } from "./dimensions-RaRkesPq.js";
|
|
24
|
+
import { d as $n } from "./direction-DKdfJwj7.js";
|
|
25
|
+
import { l as En } from "./location-CGLioInQ.js";
|
|
26
|
+
import { s as kn } from "./spatial-QY891r0E.js";
|
|
27
|
+
import { x as Pn } from "./xy-CBuhMaIo.js";
|
|
28
|
+
import { u as In } from "./index-D4NCYiQB.js";
|
|
30
29
|
import { URL as Rn, buildQueryString as Cn } from "./url.js";
|
|
31
30
|
import { RoutedWorker as qn, TypedWorker as Wn, createMockWorkers as zn } from "./worker.js";
|
|
32
|
-
import { e as Un } from "./external-
|
|
33
|
-
const
|
|
31
|
+
import { e as Un } from "./external-BM_NS5yM.js";
|
|
32
|
+
const Ie = 2, Ne = 3, Re = 2, Ce = (e, t) => {
|
|
34
33
|
if (Number.isNaN(e) || !Number.isFinite(e)) return e;
|
|
35
34
|
const r = Se(t);
|
|
36
35
|
if (r == 0) return e;
|
|
37
36
|
let n;
|
|
38
|
-
r >= 1e3 ? n =
|
|
37
|
+
r >= 1e3 ? n = Ie : r >= 1 ? n = Ne : n = Math.ceil(-Math.log10(r)) + Re;
|
|
39
38
|
const s = 10 ** n;
|
|
40
39
|
return Math.round(e * s) / s;
|
|
41
|
-
},
|
|
40
|
+
}, or = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
42
41
|
__proto__: null,
|
|
43
42
|
abs: xe,
|
|
44
43
|
add: je,
|
|
45
44
|
closeTo: Me,
|
|
46
|
-
div:
|
|
47
|
-
equal:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
45
|
+
div: $e,
|
|
46
|
+
equal: Te,
|
|
47
|
+
isInteger: Ee,
|
|
48
|
+
max: Oe,
|
|
49
|
+
min: ke,
|
|
50
|
+
mult: Ae,
|
|
51
|
+
roundBySpan: Ce,
|
|
52
|
+
roundToNearestMagnitude: Pe,
|
|
53
|
+
sub: Ze
|
|
54
54
|
}, Symbol.toStringTag, { value: "Module" })), B = async (e) => await new Promise(
|
|
55
55
|
(t) => setTimeout(t, _.fromMilliseconds(e).milliseconds)
|
|
56
|
-
),
|
|
56
|
+
), ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
57
57
|
__proto__: null,
|
|
58
58
|
sleep: B
|
|
59
59
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
60
|
-
class
|
|
60
|
+
class Le {
|
|
61
61
|
config;
|
|
62
62
|
retries;
|
|
63
63
|
interval;
|
|
@@ -73,26 +73,29 @@ class Ce {
|
|
|
73
73
|
const { maxRetries: t, scale: r, sleepFn: n } = this.config;
|
|
74
74
|
return this.retries >= t ? !1 : (await n(this.interval), this.interval = this.interval.mult(r), this.retries++, !0);
|
|
75
75
|
}
|
|
76
|
+
get retryMessage() {
|
|
77
|
+
return `breaker triggered ${this.retries + 1}/${this.config.maxRetries} times, retrying in ${this.interval.toString()}`;
|
|
78
|
+
}
|
|
76
79
|
reset() {
|
|
77
80
|
this.retries = 0, this.interval = this.config.baseInterval;
|
|
78
81
|
}
|
|
79
82
|
}
|
|
80
|
-
const
|
|
83
|
+
const qe = i.object({
|
|
81
84
|
baseInterval: _.z.optional(),
|
|
82
85
|
maxRetries: i.number().optional(),
|
|
83
86
|
scale: i.number().optional()
|
|
84
|
-
}),
|
|
87
|
+
}), ar = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
85
88
|
__proto__: null,
|
|
86
|
-
Breaker:
|
|
87
|
-
breakerConfigZ:
|
|
88
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
89
|
+
Breaker: Le,
|
|
90
|
+
breakerConfigZ: qe
|
|
91
|
+
}, Symbol.toStringTag, { value: "Module" })), We = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, V = i.string().regex(We), g = i.number().min(0).max(255), F = i.number().min(0).max(1), O = i.tuple([g, g, g, F]), ze = i.tuple([g, g, g]), De = i.object({ rgba255: O }), Ue = i.number().min(0).max(360), Be = i.number().min(0).max(100), Ve = i.number().min(0).max(100), H = i.tuple([Ue, Be, Ve, F]), k = i.union([V, ze, O, H, De]), A = k.transform((e) => d(e)), Fe = (e) => A.safeParse(e).success, He = (e) => O.safeParse(e).success, Je = (e) => {
|
|
89
92
|
if (e == null) return;
|
|
90
93
|
const t = A.safeParse(e);
|
|
91
94
|
if (t.success) return G(t.data);
|
|
92
95
|
if (typeof e == "string") return e;
|
|
93
96
|
throw t.error;
|
|
94
97
|
}, d = (e, t = 1) => {
|
|
95
|
-
if (e = k.parse(e), typeof e == "string") return
|
|
98
|
+
if (e = k.parse(e), typeof e == "string") return ot(e, t);
|
|
96
99
|
if (Array.isArray(e)) {
|
|
97
100
|
if (e.length < 3 || e.length > 4)
|
|
98
101
|
throw new Error(`Invalid color: [${e.join(", ")}]`);
|
|
@@ -103,21 +106,21 @@ const Le = i.object({
|
|
|
103
106
|
if (e == null || t == null) return e == t;
|
|
104
107
|
const r = d(e), n = d(t);
|
|
105
108
|
return r.every((s, o) => s === n[o]);
|
|
106
|
-
},
|
|
109
|
+
}, Ge = (e) => {
|
|
107
110
|
if (e == null) return;
|
|
108
111
|
const [t, r, n, s] = d(e);
|
|
109
|
-
return `#${
|
|
112
|
+
return `#${T(t)}${T(r)}${T(n)}${s === 1 ? "" : T(s * 255)}`;
|
|
110
113
|
}, G = (e) => {
|
|
111
114
|
const [t, r, n, s] = d(e);
|
|
112
115
|
return `rgba(${t}, ${r}, ${n}, ${s})`;
|
|
113
|
-
},
|
|
116
|
+
}, Qe = (e) => `rgb(${Q(e)})`, Q = (e) => {
|
|
114
117
|
const [t, r, n] = d(e);
|
|
115
118
|
return `${t}, ${r}, ${n}`;
|
|
116
|
-
},
|
|
119
|
+
}, Ye = (e) => [...W(e), S(e)], W = (e) => [
|
|
117
120
|
y(e) / 255,
|
|
118
121
|
w(e) / 255,
|
|
119
122
|
v(e) / 255
|
|
120
|
-
], y = (e) => d(e)[0], w = (e) => d(e)[1], v = (e) => d(e)[2], S = (e) => d(e)[3],
|
|
123
|
+
], y = (e) => d(e)[0], w = (e) => d(e)[1], v = (e) => d(e)[2], S = (e) => d(e)[3], Ke = (e) => J(z, e), Xe = (e) => ct(d(e)), et = (e, t) => {
|
|
121
124
|
const [r, n, s] = d(e);
|
|
122
125
|
if (t > 100)
|
|
123
126
|
throw new Error(`Color opacity must be between 0 and 100, got ${t}`);
|
|
@@ -127,24 +130,24 @@ const Le = i.object({
|
|
|
127
130
|
(s) => s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4
|
|
128
131
|
);
|
|
129
132
|
return Number((0.2126 * t + 0.7152 * r + 0.0722 * n).toFixed(3));
|
|
130
|
-
},
|
|
133
|
+
}, tt = (e) => {
|
|
131
134
|
const [t, r, n] = W(e);
|
|
132
135
|
return 1 - (Math.max(t, r, n) - Math.min(t, r, n));
|
|
133
136
|
}, R = (e, t) => {
|
|
134
137
|
const r = d(e), n = d(t), s = x(r), o = x(n);
|
|
135
138
|
return (Math.max(s, o) + 0.5) / (Math.min(s, o) + 0.5);
|
|
136
|
-
},
|
|
139
|
+
}, rt = (e, ...t) => {
|
|
137
140
|
if (t.length === 0)
|
|
138
141
|
throw new Error("[Color.pickByContrast] - must provide at least one color");
|
|
139
142
|
const r = d(e), [n] = t.sort((s, o) => R(r, o) - R(r, s));
|
|
140
143
|
return d(n);
|
|
141
|
-
},
|
|
144
|
+
}, nt = (e) => x(e) < 0.5, st = (e) => x(e) > 0.5, ot = (e, t = 1) => (e = V.parse(e), e = it(e), [
|
|
142
145
|
E(e, 0),
|
|
143
146
|
E(e, 2),
|
|
144
147
|
E(e, 4),
|
|
145
148
|
e.length === 8 ? E(e, 6) / 255 : t
|
|
146
|
-
]), z = [0, 0, 0, 0],
|
|
147
|
-
e =
|
|
149
|
+
]), z = [0, 0, 0, 0], T = (e) => Math.floor(e).toString(16).padStart(2, "0"), E = (e, t) => parseInt(e.slice(t, t + 2), 16), it = (e) => e.startsWith("#") ? e.slice(1) : e, at = (e) => {
|
|
150
|
+
e = H.parse(e);
|
|
148
151
|
let [t, r, n] = e;
|
|
149
152
|
const s = e[3];
|
|
150
153
|
t /= 360, r /= 100, n /= 100;
|
|
@@ -153,10 +156,10 @@ const Le = i.object({
|
|
|
153
156
|
o = a = f = n;
|
|
154
157
|
else {
|
|
155
158
|
const l = n < 0.5 ? n * (1 + r) : n + r - n * r, c = 2 * n - l;
|
|
156
|
-
o =
|
|
159
|
+
o = N(c, l, t + 1 / 3), a = N(c, l, t), f = N(c, l, t - 1 / 3);
|
|
157
160
|
}
|
|
158
161
|
return [Math.round(o * 255), Math.round(a * 255), Math.round(f * 255), s];
|
|
159
|
-
},
|
|
162
|
+
}, N = (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), ct = (e) => {
|
|
160
163
|
e = O.parse(e);
|
|
161
164
|
let [t, r, n] = e;
|
|
162
165
|
const s = e[3];
|
|
@@ -170,12 +173,12 @@ const Le = i.object({
|
|
|
170
173
|
l = c > 0.5 ? u / (2 - o - a) : u / (o + a), o === t ? f = (r - n) / u + (r < n ? 6 : 0) : o === r ? f = (n - t) / u + 2 : f = (t - r) / u + 4, f /= 6;
|
|
171
174
|
}
|
|
172
175
|
return f *= 360, l *= 100, c *= 100, [Math.round(f), Math.round(l), Math.round(c), s];
|
|
173
|
-
},
|
|
176
|
+
}, lt = d("#000000"), ut = d("#ffffff"), Y = i.object({
|
|
174
177
|
key: i.string(),
|
|
175
178
|
color: k,
|
|
176
179
|
position: i.number(),
|
|
177
180
|
switched: i.boolean().optional()
|
|
178
|
-
}),
|
|
181
|
+
}), ft = i.array(Y), dt = (e, t) => {
|
|
179
182
|
if (e.length === 0) return z;
|
|
180
183
|
if (e = e.slice().sort((r, n) => r.position - n.position), t <= e[0].position) return d(e[0].color);
|
|
181
184
|
if (t >= e[e.length - 1].position)
|
|
@@ -191,22 +194,22 @@ const Le = i.object({
|
|
|
191
194
|
w(a) + o * (w(f) - w(a))
|
|
192
195
|
), u = Math.round(
|
|
193
196
|
v(a) + o * (v(f) - v(a))
|
|
194
|
-
),
|
|
195
|
-
return d([l, c, u,
|
|
197
|
+
), m = S(a) + o * (S(f) - S(a));
|
|
198
|
+
return d([l, c, u, m]);
|
|
196
199
|
}
|
|
197
200
|
return d(e[e.length - 1].color);
|
|
198
|
-
},
|
|
201
|
+
}, ht = i.object({
|
|
199
202
|
key: i.string(),
|
|
200
203
|
name: i.string(),
|
|
201
204
|
color: A
|
|
202
|
-
}),
|
|
205
|
+
}), mt = i.object({
|
|
203
206
|
key: i.string(),
|
|
204
207
|
name: i.string(),
|
|
205
|
-
swatches: i.array(
|
|
206
|
-
}),
|
|
208
|
+
swatches: i.array(ht)
|
|
209
|
+
}), cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
207
210
|
__proto__: null,
|
|
208
|
-
BLACK:
|
|
209
|
-
WHITE:
|
|
211
|
+
BLACK: lt,
|
|
212
|
+
WHITE: ut,
|
|
210
213
|
ZERO: z,
|
|
211
214
|
aValue: S,
|
|
212
215
|
bValue: v,
|
|
@@ -214,29 +217,29 @@ const Le = i.object({
|
|
|
214
217
|
construct: d,
|
|
215
218
|
contrast: R,
|
|
216
219
|
crudeZ: k,
|
|
217
|
-
cssString:
|
|
220
|
+
cssString: Je,
|
|
218
221
|
equals: J,
|
|
219
|
-
fromGradient:
|
|
220
|
-
fromHSLA:
|
|
222
|
+
fromGradient: dt,
|
|
223
|
+
fromHSLA: at,
|
|
221
224
|
gValue: w,
|
|
222
|
-
gradientZ:
|
|
223
|
-
grayness:
|
|
224
|
-
hex:
|
|
225
|
-
hsla:
|
|
225
|
+
gradientZ: ft,
|
|
226
|
+
grayness: tt,
|
|
227
|
+
hex: Ge,
|
|
228
|
+
hsla: Xe,
|
|
226
229
|
isColor: He,
|
|
227
230
|
isCrude: Fe,
|
|
228
|
-
isDark:
|
|
229
|
-
isLight:
|
|
230
|
-
isZero:
|
|
231
|
+
isDark: nt,
|
|
232
|
+
isLight: st,
|
|
233
|
+
isZero: Ke,
|
|
231
234
|
luminance: x,
|
|
232
|
-
paletteZ:
|
|
233
|
-
pickByContrast:
|
|
235
|
+
paletteZ: mt,
|
|
236
|
+
pickByContrast: rt,
|
|
234
237
|
rValue: y,
|
|
235
|
-
rgbCSS:
|
|
238
|
+
rgbCSS: Qe,
|
|
236
239
|
rgbString: Q,
|
|
237
|
-
rgba1:
|
|
240
|
+
rgba1: Ye,
|
|
238
241
|
rgbaCSS: G,
|
|
239
|
-
setAlpha:
|
|
242
|
+
setAlpha: et,
|
|
240
243
|
stopZ: Y
|
|
241
244
|
}, Symbol.toStringTag, { value: "Module" })), K = i.int().min(0).max(255), X = 255, ee = 0, pt = {
|
|
242
245
|
lower: ee,
|
|
@@ -248,7 +251,7 @@ const Le = i.object({
|
|
|
248
251
|
subject: te,
|
|
249
252
|
resource: e,
|
|
250
253
|
authority: K
|
|
251
|
-
}),
|
|
254
|
+
}), gt = (...e) => (t) => t.filter((r) => {
|
|
252
255
|
let n = !1;
|
|
253
256
|
return r.to != null && (n = e.includes(r.to.resource)), r.from != null && !n && (n = e.includes(r.from.resource)), n;
|
|
254
257
|
}), re = (e) => i.object({
|
|
@@ -257,38 +260,38 @@ const Le = i.object({
|
|
|
257
260
|
}), ne = (e) => i.object({
|
|
258
261
|
from: i.null(),
|
|
259
262
|
to: j(e)
|
|
260
|
-
}),
|
|
263
|
+
}), bt = (e) => i.union([
|
|
261
264
|
re(e),
|
|
262
265
|
ne(e),
|
|
263
266
|
i.object({
|
|
264
267
|
from: j(e),
|
|
265
268
|
to: j(e)
|
|
266
269
|
})
|
|
267
|
-
]),
|
|
270
|
+
]), lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
268
271
|
__proto__: null,
|
|
269
272
|
ABSOLUTE_AUTHORITY: X,
|
|
270
273
|
AUTHORITY_BOUNDS: pt,
|
|
271
274
|
ZERO_AUTHORITY: ee,
|
|
272
275
|
acquireZ: ne,
|
|
273
276
|
authorityZ: K,
|
|
274
|
-
filterTransfersByChannelKey:
|
|
277
|
+
filterTransfersByChannelKey: gt,
|
|
275
278
|
releaseZ: re,
|
|
276
279
|
stateZ: j,
|
|
277
280
|
subjectZ: te,
|
|
278
|
-
transferZ:
|
|
279
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
281
|
+
transferZ: bt
|
|
282
|
+
}, Symbol.toStringTag, { value: "Module" })), _t = (e) => Object.getOwnPropertySymbols(globalThis).includes(e), yt = (e, t) => {
|
|
280
283
|
const r = Symbol.for(e);
|
|
281
|
-
if (!
|
|
284
|
+
if (!_t(r)) {
|
|
282
285
|
const n = t();
|
|
283
286
|
Object.defineProperty(globalThis, r, { value: n });
|
|
284
287
|
}
|
|
285
288
|
return () => globalThis[r];
|
|
286
|
-
}, se = "sy_x_error",
|
|
289
|
+
}, se = "sy_x_error", wt = (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), M = (e) => class b extends Error {
|
|
287
290
|
static discriminator = se;
|
|
288
291
|
discriminator = b.discriminator;
|
|
289
292
|
static TYPE = e;
|
|
290
293
|
type = b.TYPE;
|
|
291
|
-
static matches =
|
|
294
|
+
static matches = wt(e);
|
|
292
295
|
matches = b.matches;
|
|
293
296
|
constructor(r, n) {
|
|
294
297
|
super(r, n), this.name = b.TYPE;
|
|
@@ -305,8 +308,8 @@ const Le = i.object({
|
|
|
305
308
|
`X Error is missing its type property: ${JSON.stringify(t)}`
|
|
306
309
|
);
|
|
307
310
|
return !0;
|
|
308
|
-
},
|
|
309
|
-
class
|
|
311
|
+
}, p = "unknown", C = "nil";
|
|
312
|
+
class vt {
|
|
310
313
|
providers = [];
|
|
311
314
|
register(t) {
|
|
312
315
|
this.providers.push(t);
|
|
@@ -318,17 +321,17 @@ class wt {
|
|
|
318
321
|
const n = r.encode(t);
|
|
319
322
|
if (n != null) return n;
|
|
320
323
|
}
|
|
321
|
-
if (t instanceof Error) return { type:
|
|
322
|
-
if (typeof t == "string") return { type:
|
|
324
|
+
if (t instanceof Error) return { type: p, data: t.message };
|
|
325
|
+
if (typeof t == "string") return { type: p, data: t };
|
|
323
326
|
try {
|
|
324
|
-
return { type:
|
|
327
|
+
return { type: p, data: JSON.stringify(t) };
|
|
325
328
|
} catch {
|
|
326
|
-
return { type:
|
|
329
|
+
return { type: p, data: "unable to encode error information" };
|
|
327
330
|
}
|
|
328
331
|
}
|
|
329
332
|
decode(t) {
|
|
330
333
|
if (t == null || t.type === C) return null;
|
|
331
|
-
if (t.type ===
|
|
334
|
+
if (t.type === p) return new L(t.data);
|
|
332
335
|
for (const r of this.providers) {
|
|
333
336
|
const n = r.decode(t);
|
|
334
337
|
if (n != null) return n;
|
|
@@ -336,28 +339,28 @@ class wt {
|
|
|
336
339
|
return new L(t.data);
|
|
337
340
|
}
|
|
338
341
|
}
|
|
339
|
-
const D =
|
|
342
|
+
const D = yt("synnax-error-registry", () => new vt()), St = ({ encode: e, decode: t }) => D().register({ encode: e, decode: t }), xt = (e) => D().encode(e), jt = (e) => e == null ? null : D().decode(e);
|
|
340
343
|
class L extends M("unknown") {
|
|
341
344
|
}
|
|
342
|
-
const
|
|
343
|
-
class
|
|
345
|
+
const Mt = i.object({ type: i.string(), data: i.string() });
|
|
346
|
+
class $t extends M("canceled") {
|
|
344
347
|
}
|
|
345
348
|
class Tt extends M("not_implemented") {
|
|
346
349
|
}
|
|
347
|
-
const
|
|
350
|
+
const ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
348
351
|
__proto__: null,
|
|
349
|
-
Canceled:
|
|
352
|
+
Canceled: $t,
|
|
350
353
|
NONE: C,
|
|
351
354
|
NotImplemented: Tt,
|
|
352
|
-
UNKNOWN:
|
|
355
|
+
UNKNOWN: p,
|
|
353
356
|
Unknown: L,
|
|
354
357
|
createTyped: M,
|
|
355
|
-
decode:
|
|
356
|
-
encode:
|
|
358
|
+
decode: jt,
|
|
359
|
+
encode: xt,
|
|
357
360
|
isTyped: oe,
|
|
358
|
-
payloadZ:
|
|
359
|
-
register:
|
|
360
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
361
|
+
payloadZ: Mt,
|
|
362
|
+
register: St
|
|
363
|
+
}, Symbol.toStringTag, { value: "Module" })), fr = () => Promise.resolve(), dr = () => new Promise((e) => setTimeout(e, 0)), hr = (e) => e ? -1 : 1, ie = h.object({
|
|
361
364
|
jsonrpc: h.literal("2.0"),
|
|
362
365
|
method: h.string(),
|
|
363
366
|
// params should be z.union([z.record(z.string(), z.json()),
|
|
@@ -368,9 +371,9 @@ const cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
368
371
|
}), ae = h.object({
|
|
369
372
|
jsonrpc: h.literal("2.0"),
|
|
370
373
|
id: h.union([h.string(), h.number(), h.null()])
|
|
371
|
-
}), $t = ae.extend({
|
|
372
|
-
result: h.json()
|
|
373
374
|
}), Et = ae.extend({
|
|
375
|
+
result: h.json()
|
|
376
|
+
}), Ot = ae.extend({
|
|
374
377
|
error: h.object({
|
|
375
378
|
code: h.number().int(),
|
|
376
379
|
// This should be z.string(), but the VSCode JSON RPC implementation uses a looser
|
|
@@ -378,7 +381,7 @@ const cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
378
381
|
message: h.string().optional(),
|
|
379
382
|
data: h.json().optional()
|
|
380
383
|
})
|
|
381
|
-
}), ce = h.union([
|
|
384
|
+
}), ce = h.union([Et, Ot]), le = h.union([ie, ce]), kt = (e) => {
|
|
382
385
|
const t = new TextDecoder();
|
|
383
386
|
let r = new Uint8Array(0), n = null;
|
|
384
387
|
return (s) => {
|
|
@@ -401,41 +404,41 @@ const cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
401
404
|
} else break;
|
|
402
405
|
}
|
|
403
406
|
};
|
|
404
|
-
},
|
|
407
|
+
}, At = (e) => {
|
|
405
408
|
const t = JSON.stringify(e);
|
|
406
409
|
return `Content-Length: ${new TextEncoder().encode(t).length}\r
|
|
407
410
|
\r
|
|
408
411
|
` + t;
|
|
409
|
-
},
|
|
412
|
+
}, mr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
410
413
|
__proto__: null,
|
|
411
|
-
encodeMessage:
|
|
414
|
+
encodeMessage: At,
|
|
412
415
|
messageZ: le,
|
|
413
416
|
requestZ: ie,
|
|
414
417
|
responseZ: ce,
|
|
415
|
-
streamDecodeChunks:
|
|
416
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
418
|
+
streamDecodeChunks: kt
|
|
419
|
+
}, Symbol.toStringTag, { value: "Module" })), Pt = (e, t, r) => {
|
|
417
420
|
const n = e.get(t);
|
|
418
421
|
return n === void 0 ? (e.set(t, r), r) : n;
|
|
419
|
-
},
|
|
422
|
+
}, pr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
420
423
|
__proto__: null,
|
|
421
|
-
getOrSetDefault:
|
|
422
|
-
}, Symbol.toStringTag, { value: "Module" })), q = i.string().regex(/^\d+\.\d+\.\d+$/),
|
|
424
|
+
getOrSetDefault: Pt
|
|
425
|
+
}, Symbol.toStringTag, { value: "Module" })), q = i.string().regex(/^\d+\.\d+\.\d+$/), $ = (e, t, r = {}) => {
|
|
423
426
|
r.checkMajor ??= !0, r.checkMinor ??= !0, r.checkPatch ??= !0;
|
|
424
427
|
const n = q.parse(e), s = q.parse(t), [o, a, f] = n.split(".").map(Number), [l, c, u] = s.split(".").map(Number);
|
|
425
428
|
if (r.checkMajor) {
|
|
426
429
|
if (o < l) return Z;
|
|
427
|
-
if (o > l) return
|
|
430
|
+
if (o > l) return I;
|
|
428
431
|
}
|
|
429
432
|
if (r.checkMinor) {
|
|
430
433
|
if (a < c) return Z;
|
|
431
|
-
if (a > c) return
|
|
434
|
+
if (a > c) return I;
|
|
432
435
|
}
|
|
433
436
|
if (r.checkPatch) {
|
|
434
437
|
if (f < u) return Z;
|
|
435
|
-
if (f > u) return
|
|
438
|
+
if (f > u) return I;
|
|
436
439
|
}
|
|
437
440
|
return ve;
|
|
438
|
-
},
|
|
441
|
+
}, Zt = (e, t, r = {}) => _e($(e, t, r)), ue = (e, t, r = {}) => ye($(e, t, r)), It = (e, t, r = {}) => we($(e, t, r)), Nt = ({
|
|
439
442
|
name: e,
|
|
440
443
|
migrate: t
|
|
441
444
|
}) => (r) => {
|
|
@@ -445,14 +448,14 @@ const cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
445
448
|
} catch (n) {
|
|
446
449
|
throw console.log(`${e} failed to migrate from ${r.version}`), console.error(n), n;
|
|
447
450
|
}
|
|
448
|
-
},
|
|
451
|
+
}, Rt = ({
|
|
449
452
|
name: e,
|
|
450
453
|
migrations: t,
|
|
451
454
|
targetSchema: r,
|
|
452
455
|
defaultVersion: n,
|
|
453
456
|
def: s
|
|
454
457
|
}) => {
|
|
455
|
-
const o = Object.keys(t).sort(
|
|
458
|
+
const o = Object.keys(t).sort($).pop();
|
|
456
459
|
if (o == null)
|
|
457
460
|
return (c) => {
|
|
458
461
|
if (c.version ??= n, c.version !== s.version)
|
|
@@ -473,7 +476,7 @@ const cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
473
476
|
try {
|
|
474
477
|
if (a === 0 || ue(c.version, o))
|
|
475
478
|
return console.log(f ? `${e} ${c.version} now up to date` : `${e} version ${c.version} is up to date with target version ${s.version}`), c;
|
|
476
|
-
const u = c.version,
|
|
479
|
+
const u = c.version, m = t[u], P = m(c);
|
|
477
480
|
return f = !0, l(P);
|
|
478
481
|
} catch (u) {
|
|
479
482
|
return console.log(
|
|
@@ -497,16 +500,16 @@ const cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
497
500
|
return console.log(`${e} failed to parse final result. Exiting with default`), console.error(u), s;
|
|
498
501
|
}
|
|
499
502
|
};
|
|
500
|
-
},
|
|
503
|
+
}, gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
501
504
|
__proto__: null,
|
|
502
|
-
compareSemVer:
|
|
505
|
+
compareSemVer: $,
|
|
503
506
|
createMigration: Nt,
|
|
504
|
-
migrator:
|
|
507
|
+
migrator: Rt,
|
|
505
508
|
semVerNewer: ue,
|
|
506
|
-
semVerOlder:
|
|
509
|
+
semVerOlder: It,
|
|
507
510
|
semVerZ: q,
|
|
508
|
-
versionsEqual:
|
|
509
|
-
}, Symbol.toStringTag, { value: "Module" })), fe = ["standard", "scientific", "engineering"],
|
|
511
|
+
versionsEqual: Zt
|
|
512
|
+
}, Symbol.toStringTag, { value: "Module" })), fe = ["standard", "scientific", "engineering"], Ct = i.enum(fe), Lt = (e, t, r) => {
|
|
510
513
|
if (Number.isNaN(e)) return "NaN";
|
|
511
514
|
if (e === 1 / 0) return "∞";
|
|
512
515
|
if (e === -1 / 0) return "-∞";
|
|
@@ -515,31 +518,31 @@ const cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
515
518
|
return t === 0 ? "0ᴇ0" : `0.${"0".repeat(t)}ᴇ0`;
|
|
516
519
|
let n;
|
|
517
520
|
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}`;
|
|
518
|
-
},
|
|
521
|
+
}, br = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
519
522
|
__proto__: null,
|
|
520
523
|
NOTATIONS: fe,
|
|
521
|
-
notationZ:
|
|
522
|
-
stringifyNumber:
|
|
523
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
524
|
+
notationZ: Ct,
|
|
525
|
+
stringifyNumber: Lt
|
|
526
|
+
}, Symbol.toStringTag, { value: "Module" })), _r = (e) => {
|
|
524
527
|
if (e === void 0 || typeof e == "string" || typeof e == "number")
|
|
525
528
|
return e;
|
|
526
529
|
if (e.toString === void 0) throw new Error("invalid renderer");
|
|
527
530
|
return e.toString();
|
|
528
|
-
},
|
|
531
|
+
}, yr = (e) => Array.isArray(e) ? [...e] : typeof e == "object" && e !== null ? { ...e } : e, de = i.enum([
|
|
529
532
|
"success",
|
|
530
533
|
"info",
|
|
531
534
|
"warning",
|
|
532
535
|
"error",
|
|
533
536
|
"loading",
|
|
534
537
|
"disabled"
|
|
535
|
-
]),
|
|
538
|
+
]), qt = (e) => i.object({
|
|
536
539
|
key: i.string(),
|
|
537
540
|
variant: de,
|
|
538
541
|
message: i.string(),
|
|
539
542
|
description: i.string().optional(),
|
|
540
543
|
time: U.z,
|
|
541
544
|
details: e ?? i.unknown().optional()
|
|
542
|
-
}),
|
|
545
|
+
}), Wt = (e, t) => {
|
|
543
546
|
if (!(e instanceof Error)) throw e;
|
|
544
547
|
return he({
|
|
545
548
|
variant: "error",
|
|
@@ -553,22 +556,24 @@ const cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
553
556
|
key: be(),
|
|
554
557
|
time: U.now(),
|
|
555
558
|
...e
|
|
556
|
-
}),
|
|
559
|
+
}), zt = (e, t = []) => Array.isArray(t) ? t.includes(e) ? e : void 0 : t === e ? e : void 0, wr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
557
560
|
__proto__: null,
|
|
558
561
|
create: he,
|
|
559
|
-
|
|
560
|
-
|
|
562
|
+
filterVariant: zt,
|
|
563
|
+
fromException: Wt,
|
|
564
|
+
statusZ: qt,
|
|
561
565
|
variantZ: de
|
|
562
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
566
|
+
}, Symbol.toStringTag, { value: "Module" })), Dt = (e, t = "") => {
|
|
567
|
+
if (typeof e == "string") return e;
|
|
563
568
|
const r = e.length;
|
|
564
569
|
return r === 0 ? t : r === 1 ? e[0] : r === 2 ? `${e[0]} and ${e[1]}` : `${e.slice(0, -1).join(", ")}, and ${e[r - 1]}`;
|
|
565
|
-
},
|
|
570
|
+
}, Ut = (e) => {
|
|
566
571
|
const t = e.split(" "), r = /* @__PURE__ */ new Set(), n = t.map((l) => l.charAt(0).toLowerCase()).join("");
|
|
567
572
|
r.add(n.replace(/-/g, "_")), r.add(n.replace(/(.)(.)/g, "$1_$2").replace(/-/g, "_"));
|
|
568
573
|
const s = /\d+/g;
|
|
569
574
|
e.match(s) && t.forEach((l, c) => {
|
|
570
575
|
if (s.test(l)) {
|
|
571
|
-
const u = t.map((
|
|
576
|
+
const u = t.map((m, P) => P !== c ? m.charAt(0).toLowerCase() : m).join("");
|
|
572
577
|
r.add(u.replace(/-/g, "_")), r.add(
|
|
573
578
|
u.replace(/(.)(.)/g, "$1_$2").replace(/-/g, "_")
|
|
574
579
|
);
|
|
@@ -580,13 +585,13 @@ const cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
580
585
|
return r.add(a.join("").replace(/-/g, "_")), r.add(a.join("_").replace(/-/g, "_")), Array.from(r).filter(
|
|
581
586
|
(l) => l.length >= 2 && l.length <= 12 && !/^\d/.test(l)
|
|
582
587
|
);
|
|
583
|
-
},
|
|
588
|
+
}, Bt = (e, t) => e.startsWith(t) ? e.slice(t.length) : e, vr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
584
589
|
__proto__: null,
|
|
585
|
-
createShortIdentifiers:
|
|
586
|
-
naturalLanguageJoin:
|
|
587
|
-
trimPrefix:
|
|
588
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
589
|
-
var
|
|
590
|
+
createShortIdentifiers: Ut,
|
|
591
|
+
naturalLanguageJoin: Dt,
|
|
592
|
+
trimPrefix: Bt
|
|
593
|
+
}, Symbol.toStringTag, { value: "Module" })), Vt = new Error("request for lock canceled");
|
|
594
|
+
var Ft = function(e, t, r, n) {
|
|
590
595
|
function s(o) {
|
|
591
596
|
return o instanceof r ? o : new r(function(a) {
|
|
592
597
|
a(o);
|
|
@@ -596,15 +601,15 @@ var Bt = function(e, t, r, n) {
|
|
|
596
601
|
function f(u) {
|
|
597
602
|
try {
|
|
598
603
|
c(n.next(u));
|
|
599
|
-
} catch (
|
|
600
|
-
a(
|
|
604
|
+
} catch (m) {
|
|
605
|
+
a(m);
|
|
601
606
|
}
|
|
602
607
|
}
|
|
603
608
|
function l(u) {
|
|
604
609
|
try {
|
|
605
610
|
c(n.throw(u));
|
|
606
|
-
} catch (
|
|
607
|
-
a(
|
|
611
|
+
} catch (m) {
|
|
612
|
+
a(m);
|
|
608
613
|
}
|
|
609
614
|
}
|
|
610
615
|
function c(u) {
|
|
@@ -613,20 +618,20 @@ var Bt = function(e, t, r, n) {
|
|
|
613
618
|
c((n = n.apply(e, t || [])).next());
|
|
614
619
|
});
|
|
615
620
|
};
|
|
616
|
-
class
|
|
617
|
-
constructor(t, r =
|
|
621
|
+
class Ht {
|
|
622
|
+
constructor(t, r = Vt) {
|
|
618
623
|
this._value = t, this._cancelError = r, this._queue = [], this._weightedWaiters = [];
|
|
619
624
|
}
|
|
620
625
|
acquire(t = 1, r = 0) {
|
|
621
626
|
if (t <= 0)
|
|
622
627
|
throw new Error(`invalid weight ${t}: must be positive`);
|
|
623
628
|
return new Promise((n, s) => {
|
|
624
|
-
const o = { resolve: n, reject: s, weight: t, priority: r }, a =
|
|
629
|
+
const o = { resolve: n, reject: s, weight: t, priority: r }, a = me(this._queue, (f) => r <= f.priority);
|
|
625
630
|
a === -1 && t <= this._value ? this._dispatchItem(o) : this._queue.splice(a + 1, 0, o);
|
|
626
631
|
});
|
|
627
632
|
}
|
|
628
633
|
runExclusive(t) {
|
|
629
|
-
return
|
|
634
|
+
return Ft(this, arguments, void 0, function* (r, n = 1, s = 0) {
|
|
630
635
|
const [o, a] = yield this.acquire(n, s);
|
|
631
636
|
try {
|
|
632
637
|
return yield r(o);
|
|
@@ -639,7 +644,7 @@ class Ft {
|
|
|
639
644
|
if (t <= 0)
|
|
640
645
|
throw new Error(`invalid weight ${t}: must be positive`);
|
|
641
646
|
return this._couldLockImmediately(t, r) ? Promise.resolve() : new Promise((n) => {
|
|
642
|
-
this._weightedWaiters[t - 1] || (this._weightedWaiters[t - 1] = []),
|
|
647
|
+
this._weightedWaiters[t - 1] || (this._weightedWaiters[t - 1] = []), Jt(this._weightedWaiters[t - 1], { resolve: n, priority: r });
|
|
643
648
|
});
|
|
644
649
|
}
|
|
645
650
|
isLocked() {
|
|
@@ -694,17 +699,17 @@ class Ft {
|
|
|
694
699
|
return (this._queue.length === 0 || this._queue[0].priority < r) && t <= this._value;
|
|
695
700
|
}
|
|
696
701
|
}
|
|
697
|
-
function
|
|
698
|
-
const r =
|
|
702
|
+
function Jt(e, t) {
|
|
703
|
+
const r = me(e, (n) => t.priority <= n.priority);
|
|
699
704
|
e.splice(r + 1, 0, t);
|
|
700
705
|
}
|
|
701
|
-
function
|
|
706
|
+
function me(e, t) {
|
|
702
707
|
for (let r = e.length - 1; r >= 0; r--)
|
|
703
708
|
if (t(e[r]))
|
|
704
709
|
return r;
|
|
705
710
|
return -1;
|
|
706
711
|
}
|
|
707
|
-
var
|
|
712
|
+
var Gt = function(e, t, r, n) {
|
|
708
713
|
function s(o) {
|
|
709
714
|
return o instanceof r ? o : new r(function(a) {
|
|
710
715
|
a(o);
|
|
@@ -714,15 +719,15 @@ var Vt = function(e, t, r, n) {
|
|
|
714
719
|
function f(u) {
|
|
715
720
|
try {
|
|
716
721
|
c(n.next(u));
|
|
717
|
-
} catch (
|
|
718
|
-
a(
|
|
722
|
+
} catch (m) {
|
|
723
|
+
a(m);
|
|
719
724
|
}
|
|
720
725
|
}
|
|
721
726
|
function l(u) {
|
|
722
727
|
try {
|
|
723
728
|
c(n.throw(u));
|
|
724
|
-
} catch (
|
|
725
|
-
a(
|
|
729
|
+
} catch (m) {
|
|
730
|
+
a(m);
|
|
726
731
|
}
|
|
727
732
|
}
|
|
728
733
|
function c(u) {
|
|
@@ -731,12 +736,12 @@ var Vt = function(e, t, r, n) {
|
|
|
731
736
|
c((n = n.apply(e, t || [])).next());
|
|
732
737
|
});
|
|
733
738
|
};
|
|
734
|
-
class
|
|
739
|
+
class Qt {
|
|
735
740
|
constructor(t) {
|
|
736
|
-
this._semaphore = new
|
|
741
|
+
this._semaphore = new Ht(1, t);
|
|
737
742
|
}
|
|
738
743
|
acquire() {
|
|
739
|
-
return
|
|
744
|
+
return Gt(this, arguments, void 0, function* (t = 0) {
|
|
740
745
|
const [, r] = yield this._semaphore.acquire(1, t);
|
|
741
746
|
return r;
|
|
742
747
|
});
|
|
@@ -757,91 +762,90 @@ class Jt {
|
|
|
757
762
|
return this._semaphore.cancel();
|
|
758
763
|
}
|
|
759
764
|
}
|
|
760
|
-
class
|
|
765
|
+
class pe extends Qt {
|
|
761
766
|
constructor(t) {
|
|
762
767
|
super(), Object.assign(this, t);
|
|
763
768
|
}
|
|
764
769
|
}
|
|
765
|
-
const
|
|
770
|
+
const Yt = (e) => new pe(e), Sr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
766
771
|
__proto__: null,
|
|
767
|
-
mutex:
|
|
768
|
-
newMutex:
|
|
769
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
772
|
+
mutex: pe,
|
|
773
|
+
newMutex: Yt
|
|
774
|
+
}, Symbol.toStringTag, { value: "Module" })), Kt = (e) => JSON.stringify(e, (t, r) => typeof r == "bigint" ? r.toString() : r), Xt = async (e, t = 200, r = 20) => {
|
|
770
775
|
const n = Date.now();
|
|
771
776
|
for (; Date.now() - n < t; )
|
|
772
777
|
await e(), await new Promise((s) => setTimeout(s, r));
|
|
773
|
-
},
|
|
778
|
+
}, xr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
774
779
|
__proto__: null,
|
|
775
|
-
expectAlways:
|
|
776
|
-
toString:
|
|
780
|
+
expectAlways: Xt,
|
|
781
|
+
toString: Kt
|
|
777
782
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
778
783
|
export {
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
784
|
+
kr as DataType,
|
|
785
|
+
Ar as Density,
|
|
786
|
+
Pr as MultiSeries,
|
|
787
|
+
Zr as Rate,
|
|
783
788
|
qn as RoutedWorker,
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
789
|
+
Ir as Series,
|
|
790
|
+
Nr as Size,
|
|
791
|
+
Rr as TimeRange,
|
|
787
792
|
_ as TimeSpan,
|
|
788
793
|
U as TimeStamp,
|
|
789
794
|
Wn as TypedWorker,
|
|
790
795
|
Rn as URL,
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
796
|
+
Cr as addSamples,
|
|
797
|
+
$r as array,
|
|
798
|
+
Er as binary,
|
|
799
|
+
mn as bounds,
|
|
800
|
+
Sn as box,
|
|
801
|
+
ar as breaker,
|
|
797
802
|
Cn as buildQueryString,
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
803
|
+
Fr as caseconv,
|
|
804
|
+
Jr as change,
|
|
805
|
+
Qr as clamp,
|
|
806
|
+
cr as color,
|
|
807
|
+
Xr as compare,
|
|
808
|
+
lr as control,
|
|
809
|
+
Lr as convertDataType,
|
|
810
|
+
_r as convertRenderV,
|
|
806
811
|
zn as createMockWorkers,
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
sr as sleep,
|
|
812
|
+
rn as debounce,
|
|
813
|
+
on as deep,
|
|
814
|
+
jn as dimensions,
|
|
815
|
+
$n as direction,
|
|
816
|
+
ur as errors,
|
|
817
|
+
fr as flushMicrotasks,
|
|
818
|
+
dr as flushTaskQueue,
|
|
819
|
+
qr as id,
|
|
820
|
+
Wr as instance,
|
|
821
|
+
hr as invert,
|
|
822
|
+
zr as isCrudeSeries,
|
|
823
|
+
cn as isObject,
|
|
824
|
+
Dr as isTelemValue,
|
|
825
|
+
mr as jsonRPC,
|
|
826
|
+
un as kv,
|
|
827
|
+
dn as link,
|
|
828
|
+
En as location,
|
|
829
|
+
pr as map,
|
|
830
|
+
or as math,
|
|
831
|
+
gr as migrate,
|
|
832
|
+
br as notation,
|
|
833
|
+
gn as observe,
|
|
834
|
+
en as primitive,
|
|
835
|
+
_n as record,
|
|
836
|
+
wn as runtime,
|
|
837
|
+
Yr as scale,
|
|
838
|
+
yr as shallowCopy,
|
|
839
|
+
ir as sleep,
|
|
836
840
|
kn as spatial,
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
841
|
+
wr as status,
|
|
842
|
+
vr as strings,
|
|
843
|
+
Sr as sync,
|
|
844
|
+
xr as testutil,
|
|
845
|
+
nn as throttle,
|
|
846
|
+
Ur as typedArrayZ,
|
|
847
|
+
In as unique,
|
|
848
|
+
Br as uuid,
|
|
845
849
|
Pn as xy,
|
|
846
850
|
Un as zod
|
|
847
851
|
};
|