@synnaxlabs/pluto 0.44.2 → 0.44.3
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/dist/{Animated-D5cL3URg.js → Animated-BHxq6Pmm.js} +2 -2
- package/dist/{Animated-DnsZ5vvU.cjs → Animated-DEXELMDa.cjs} +1 -1
- package/dist/LinePlot-BJ10hKs7.cjs +53 -0
- package/dist/{provider-Bp-CLkh2.js → LinePlot-VIcFjuPQ.js} +4543 -4448
- package/dist/{Toggle-Dol9oHzM.js → Toggle-C--I90ch.js} +1 -1
- package/dist/{Toggle-Ckdi4fKV.cjs → Toggle-CCsw0kkq.cjs} +1 -1
- package/dist/{Video-BidrtYj_.cjs → Video-BbRLzkdH.cjs} +1 -1
- package/dist/{Video-Cm8ZBqid.js → Video-DdsVXhnt.js} +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/color.cjs +1 -1
- package/dist/color.js +1 -1
- package/dist/{css-Dl9aM7Jz.js → css-BKrX40Df.js} +713 -685
- package/dist/css-TyQvZIXQ.cjs +8 -0
- package/dist/css.cjs +1 -1
- package/dist/css.js +2 -2
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +1 -1
- package/dist/eraser-Bxknv-HS.cjs +63 -0
- package/dist/{eraser-CZknVTjw.js → eraser-DtXU7kOS.js} +4811 -4746
- package/dist/ether.cjs +1 -1
- package/dist/ether.js +66 -63
- package/dist/{external-CU_XHLqP.js → external-BApQK7XP.js} +3 -3
- package/dist/{external-CkvXTCCL.cjs → external-BBXhtVjD.cjs} +1 -1
- package/dist/{external-xfHaehZH.js → external-BOmNpcyI.js} +20 -20
- package/dist/{external-ClD4VLgc.cjs → external-BPF50O_x.cjs} +1 -1
- package/dist/{external-DOd9BcLC.js → external-BT0nByPv.js} +2 -2
- package/dist/{external-BGCkpetp.cjs → external-BUAnicLg.cjs} +1 -1
- package/dist/{external-_eEnQPcq.cjs → external-BaRBYE0N.cjs} +1 -1
- package/dist/{external-B8qSW3N8.js → external-BmfZaFKB.js} +3 -3
- package/dist/external-BsyCwXWB.cjs +1 -0
- package/dist/{external-B5RyMtMy.js → external-Bt-WjDvD.js} +8 -8
- package/dist/{external-B_NFroo8.js → external-CEMgElRx.js} +10 -10
- package/dist/{external-DFsKdN71.cjs → external-COBt6FnN.cjs} +1 -1
- package/dist/{external-DXY1bIut.cjs → external-CZSk2V5E.cjs} +1 -1
- package/dist/{external-CY2bvy20.cjs → external-Cw5iYImi.cjs} +1 -1
- package/dist/{external-Ylv9Wts9.js → external-Dgui980d.js} +74 -75
- package/dist/external-Dwfn2jsF.js +42 -0
- package/dist/external-EMhi5ISu.cjs +1 -0
- package/dist/{external-DPqPAgoV.cjs → external-Jee63xkv.cjs} +1 -1
- package/dist/{external-CJZTgfAH.js → external-NUi5IwGn.js} +20 -20
- package/dist/{external-DnnHYQqD.js → external-ONwuyKzG.js} +27 -27
- package/dist/{external-DZqxSCvz.cjs → external-TAYJZFme.cjs} +1 -1
- package/dist/external-bvOijYCw.cjs +1 -0
- package/dist/{external-pm79tCDD.js → external-dkXc0y5z.js} +20 -20
- package/dist/{external-BYJw6DJV.js → external-n4gJTJfw.js} +23 -23
- package/dist/{external-b2X_jilF.js → external-tHxdTvxn.js} +2 -2
- package/dist/{external-BJ91nMtQ.cjs → external-yddEc8os.cjs} +1 -1
- package/dist/flex.cjs +1 -1
- package/dist/flex.js +1 -1
- package/dist/{fontString-BptzSQcY.cjs → fontString-BWGnZU-8.cjs} +1 -1
- package/dist/{fontString-Bm52S4Lo.js → fontString-D2-HUuI_.js} +2 -2
- package/dist/header.cjs +1 -1
- package/dist/header.js +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.js +10291 -10365
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +1 -1
- package/dist/pluto.css +1 -1
- package/dist/src/channel/AliasInput.d.ts +3 -1
- package/dist/src/channel/AliasInput.d.ts.map +1 -1
- package/dist/src/channel/Select.d.ts.map +1 -1
- package/dist/src/channel/external.d.ts +0 -2
- package/dist/src/channel/external.d.ts.map +1 -1
- package/dist/src/channel/queries.d.ts +84 -6
- package/dist/src/channel/queries.d.ts.map +1 -1
- package/dist/src/dialog/Frame.d.ts.map +1 -1
- package/dist/src/flux/Provider.d.ts +9 -7
- package/dist/src/flux/Provider.d.ts.map +1 -1
- package/dist/src/flux/aether/external.d.ts +4 -3
- package/dist/src/flux/aether/external.d.ts.map +1 -1
- package/dist/src/flux/aether/provider.d.ts +31 -25
- package/dist/src/flux/aether/provider.d.ts.map +1 -1
- package/dist/src/flux/core/client.d.ts +21 -0
- package/dist/src/flux/core/client.d.ts.map +1 -0
- package/dist/src/flux/core/external.d.ts +4 -0
- package/dist/src/flux/core/external.d.ts.map +1 -0
- package/dist/src/flux/core/index.d.ts +2 -0
- package/dist/src/flux/core/index.d.ts.map +1 -0
- package/dist/src/flux/core/params.d.ts.map +1 -0
- package/dist/src/flux/core/store.d.ts +128 -0
- package/dist/src/flux/core/store.d.ts.map +1 -0
- package/dist/src/flux/core/store.spec.d.ts +2 -0
- package/dist/src/flux/core/store.spec.d.ts.map +1 -0
- package/dist/src/flux/core/streamer.d.ts +31 -0
- package/dist/src/flux/core/streamer.d.ts.map +1 -0
- package/dist/src/flux/core/streamer.spec.d.ts.map +1 -0
- package/dist/src/flux/external.d.ts +3 -5
- package/dist/src/flux/external.d.ts.map +1 -1
- package/dist/src/flux/form.d.ts +6 -3
- package/dist/src/flux/form.d.ts.map +1 -1
- package/dist/src/flux/list.d.ts +13 -13
- package/dist/src/flux/list.d.ts.map +1 -1
- package/dist/src/flux/result.d.ts +10 -9
- package/dist/src/flux/result.d.ts.map +1 -1
- package/dist/src/flux/retrieve.d.ts +18 -39
- package/dist/src/flux/retrieve.d.ts.map +1 -1
- package/dist/src/flux/update.d.ts +12 -7
- package/dist/src/flux/update.d.ts.map +1 -1
- package/dist/src/form/state.d.ts +3 -1
- package/dist/src/form/state.d.ts.map +1 -1
- package/dist/src/form/use.d.ts +1 -0
- package/dist/src/form/use.d.ts.map +1 -1
- package/dist/src/hardware/device/queries.d.ts +12 -4
- package/dist/src/hardware/device/queries.d.ts.map +1 -1
- package/dist/src/hardware/rack/external.d.ts +0 -3
- package/dist/src/hardware/rack/external.d.ts.map +1 -1
- package/dist/src/hardware/rack/queries.d.ts +13 -0
- package/dist/src/hardware/rack/queries.d.ts.map +1 -1
- package/dist/src/hardware/task/queries.d.ts +12 -5
- package/dist/src/hardware/task/queries.d.ts.map +1 -1
- package/dist/src/hooks/index.d.ts +1 -0
- package/dist/src/hooks/index.d.ts.map +1 -1
- package/dist/src/hooks/useDestructors.d.ts +7 -0
- package/dist/src/hooks/useDestructors.d.ts.map +1 -0
- package/dist/src/label/queries.d.ts +21 -19
- package/dist/src/label/queries.d.ts.map +1 -1
- package/dist/src/menu/ContextMenu.d.ts +1 -0
- package/dist/src/menu/ContextMenu.d.ts.map +1 -1
- package/dist/src/mosaic/tree.d.ts.map +1 -1
- package/dist/src/ontology/queries.d.ts +19 -4
- package/dist/src/ontology/queries.d.ts.map +1 -1
- package/dist/src/pluto/Pluto.d.ts +23 -2
- package/dist/src/pluto/Pluto.d.ts.map +1 -1
- package/dist/src/pluto/aether/pluto.d.ts.map +1 -1
- package/dist/src/ranger/aether/index.d.ts +2 -0
- package/dist/src/ranger/aether/index.d.ts.map +1 -0
- package/dist/src/ranger/aether/queries.d.ts +11 -0
- package/dist/src/ranger/aether/queries.d.ts.map +1 -0
- package/dist/src/ranger/queries.d.ts +28 -22
- package/dist/src/ranger/queries.d.ts.map +1 -1
- package/dist/src/state/state.d.ts +1 -1
- package/dist/src/state/state.d.ts.map +1 -1
- package/dist/src/status/Aggregator.d.ts +3 -0
- package/dist/src/status/Aggregator.d.ts.map +1 -1
- package/dist/src/status/Summary.d.ts.map +1 -1
- package/dist/src/status/aether/aggregator.d.ts +2 -12
- package/dist/src/status/aether/aggregator.d.ts.map +1 -1
- package/dist/src/status/aether/errorHandler.d.ts +15 -0
- package/dist/src/status/aether/errorHandler.d.ts.map +1 -0
- package/dist/src/status/aether/errorHandler.spec.d.ts +2 -0
- package/dist/src/status/aether/errorHandler.spec.d.ts.map +1 -0
- package/dist/src/status/aether/external.d.ts +3 -0
- package/dist/src/status/aether/external.d.ts.map +1 -0
- package/dist/src/status/aether/index.d.ts +1 -1
- package/dist/src/status/aether/index.d.ts.map +1 -1
- package/dist/src/testutil/Synnax.d.ts +6 -1
- package/dist/src/testutil/Synnax.d.ts.map +1 -1
- package/dist/src/text/Editable.d.ts.map +1 -1
- package/dist/src/vis/lineplot/range/aether/provider.d.ts +6 -18
- package/dist/src/vis/lineplot/range/aether/provider.d.ts.map +1 -1
- package/dist/src/vis/schematic/Forms.d.ts.map +1 -1
- package/dist/src/vis/value/TelemForm.d.ts.map +1 -1
- package/dist/src/workspace/queries.d.ts +8 -0
- package/dist/src/workspace/queries.d.ts.map +1 -1
- package/dist/{symbols-B15FeAg9.cjs → symbols-DWZqHjhU.cjs} +45 -45
- package/dist/{symbols-Lz5vQQDw.js → symbols-aLnytgtc.js} +6093 -6048
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/text.cjs +1 -1
- package/dist/text.js +2 -2
- package/dist/theming.cjs +1 -1
- package/dist/theming.js +2 -2
- package/dist/tree.cjs +1 -1
- package/dist/tree.js +1 -1
- package/dist/triggers.cjs +1 -1
- package/dist/triggers.js +1 -1
- package/dist/{units-BGkvnLO-.cjs → units-XE06scfL.cjs} +1 -1
- package/dist/{units-HcS_zslH.js → units-ny6lkoIv.js} +1 -1
- package/dist/video.cjs +1 -1
- package/dist/video.js +1 -1
- package/package.json +5 -5
- package/dist/Menu-C-MABQ1r.js +0 -61
- package/dist/Menu-vR5-lqo4.cjs +0 -1
- package/dist/css-9yccD6t_.cjs +0 -8
- package/dist/eraser-CLWNvWDn.cjs +0 -63
- package/dist/external-CS6l_QN4.cjs +0 -1
- package/dist/external-CVNscTLA.js +0 -42
- package/dist/external-CtooTI5M.cjs +0 -1
- package/dist/external-DNHOS3w0.cjs +0 -1
- package/dist/provider-DBSsDoFS.cjs +0 -53
- package/dist/src/channel/AliasContext.d.ts +0 -19
- package/dist/src/channel/AliasContext.d.ts.map +0 -1
- package/dist/src/channel/AliasProvider.d.ts +0 -6
- package/dist/src/channel/AliasProvider.d.ts.map +0 -1
- package/dist/src/flux/Context.d.ts +0 -4
- package/dist/src/flux/Context.d.ts.map +0 -1
- package/dist/src/flux/aether/listeners.d.ts +0 -16
- package/dist/src/flux/aether/listeners.d.ts.map +0 -1
- package/dist/src/flux/aether/params.d.ts.map +0 -1
- package/dist/src/flux/aether/streamer.d.ts +0 -22
- package/dist/src/flux/aether/streamer.d.ts.map +0 -1
- package/dist/src/flux/aether/streamer.spec.d.ts.map +0 -1
- package/dist/src/flux/aether/types.d.ts +0 -13
- package/dist/src/flux/aether/types.d.ts.map +0 -1
- package/dist/src/flux/listeners.d.ts +0 -4
- package/dist/src/flux/listeners.d.ts.map +0 -1
- package/dist/src/flux/listeners.spec.d.ts +0 -2
- package/dist/src/flux/listeners.spec.d.ts.map +0 -1
- package/dist/src/flux/useMountListeners.d.ts +0 -7
- package/dist/src/flux/useMountListeners.d.ts.map +0 -1
- package/dist/src/hardware/rack/synchronizers.d.ts +0 -3
- package/dist/src/hardware/rack/synchronizers.d.ts.map +0 -1
- package/dist/src/hardware/rack/use.d.ts +0 -3
- package/dist/src/hardware/rack/use.d.ts.map +0 -1
- package/dist/src/hardware/rack/useStatus.d.ts +0 -3
- package/dist/src/hardware/rack/useStatus.d.ts.map +0 -1
- /package/dist/src/flux/{aether → core}/params.d.ts +0 -0
- /package/dist/src/flux/{aether → core}/streamer.spec.d.ts +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import x, { z as a } from "zod";
|
|
2
|
-
const
|
|
2
|
+
const rn = (t) => {
|
|
3
3
|
const e = t.replace(/_[a-z]/g, (r) => r[1].toUpperCase());
|
|
4
4
|
return e.length > 1 && e[0] === e[0].toUpperCase() && e[1] === e[1].toUpperCase() || e.length === 0 ? e : e[0].toLowerCase() + e.slice(1);
|
|
5
5
|
}, lt = (t) => {
|
|
@@ -7,39 +7,39 @@ const tn = (t) => {
|
|
|
7
7
|
if (typeof r == "string") return t(r);
|
|
8
8
|
if (Array.isArray(r)) return r.map((o) => e(o, n));
|
|
9
9
|
if (!Fe(r)) return r;
|
|
10
|
-
n =
|
|
10
|
+
n = an(n);
|
|
11
11
|
const s = {}, i = r;
|
|
12
12
|
return "toJSON" in i && typeof i.toJSON == "function" ? e(i.toJSON(), n) : (Object.keys(i).forEach((o) => {
|
|
13
13
|
let c = i[o];
|
|
14
14
|
const l = t(o);
|
|
15
|
-
n.recursive && (Fe(c) ? Rt(c) || (c = e(c, n)) : n.recursiveInArray && jt(c) && (c = [...c].map((
|
|
16
|
-
let
|
|
17
|
-
return Fe(
|
|
15
|
+
n.recursive && (Fe(c) ? Rt(c) || (c = e(c, n)) : n.recursiveInArray && jt(c) && (c = [...c].map((h) => {
|
|
16
|
+
let g = h;
|
|
17
|
+
return Fe(h) ? Rt(g) || (g = e(h, n)) : jt(h) && (g = e({ key: h }, n).key), g;
|
|
18
18
|
}))), s[l] = c;
|
|
19
19
|
}), s);
|
|
20
20
|
};
|
|
21
21
|
return e;
|
|
22
|
-
}, ct = lt(
|
|
22
|
+
}, ct = lt(rn), nn = (t) => (
|
|
23
23
|
// Don't convert the first character and don't convert a character that is after a
|
|
24
24
|
// non-alphanumeric character
|
|
25
25
|
t.replace(
|
|
26
26
|
/([a-z0-9])([A-Z])/g,
|
|
27
27
|
(e, r, n) => `${r}_${n.toLowerCase()}`
|
|
28
28
|
)
|
|
29
|
-
), Ft = lt(
|
|
29
|
+
), Ft = lt(nn), Zt = (t) => t.length === 0 ? t : t[0].toUpperCase() + t.slice(1), sn = [Number, String, Uint8Array], Ge = {
|
|
30
30
|
recursive: !0,
|
|
31
31
|
recursiveInArray: !0
|
|
32
|
-
},
|
|
32
|
+
}, an = (t = Ge) => (t.recursive == null ? t = Ge : t.recursiveInArray ??= !1, t), jt = (t) => t != null && Array.isArray(t), Fe = (t) => t != null && typeof t == "object" && !Array.isArray(t), Rt = (t) => sn.some((e) => t instanceof e), on = (t) => t.replace(/\s+/g, "-").replace(
|
|
33
33
|
/([a-z0-9])([A-Z])/g,
|
|
34
34
|
(e, r, n) => `${r}-${n.toLowerCase()}`
|
|
35
|
-
).toLowerCase(),
|
|
35
|
+
).toLowerCase(), un = lt(on), fo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
36
36
|
__proto__: null,
|
|
37
37
|
camelToSnake: Ft,
|
|
38
38
|
capitalize: Zt,
|
|
39
39
|
snakeToCamel: ct,
|
|
40
|
-
toKebab:
|
|
40
|
+
toKebab: un
|
|
41
41
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
42
|
-
let
|
|
42
|
+
let ln = class {
|
|
43
43
|
contentType = "application/json";
|
|
44
44
|
decoder;
|
|
45
45
|
encoder;
|
|
@@ -61,7 +61,7 @@ let un = class {
|
|
|
61
61
|
return JSON.stringify(r, (n, s) => ArrayBuffer.isView(s) ? Array.from(s) : typeof s == "bigint" ? s.toString() : s);
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
|
-
const He = new
|
|
64
|
+
const He = new ln(), Je = (t) => [...new Set(t)], cn = (t, e, r = !0) => {
|
|
65
65
|
const n = /* @__PURE__ */ new Map();
|
|
66
66
|
return t.forEach((s) => {
|
|
67
67
|
const i = e(s);
|
|
@@ -71,9 +71,9 @@ const He = new un(), Je = (t) => [...new Set(t)], ln = (t, e, r = !0) => {
|
|
|
71
71
|
}
|
|
72
72
|
n.set(i, s);
|
|
73
73
|
}), Array.from(n.values());
|
|
74
|
-
},
|
|
74
|
+
}, po = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
75
75
|
__proto__: null,
|
|
76
|
-
by:
|
|
76
|
+
by: cn,
|
|
77
77
|
unique: Je
|
|
78
78
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
79
79
|
let J = class {
|
|
@@ -96,7 +96,7 @@ let J = class {
|
|
|
96
96
|
return this.value.toString();
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
|
-
const ht = (t) => t != null && typeof t == "object" && "toString" in t,
|
|
99
|
+
const ht = (t) => t != null && typeof t == "object" && "toString" in t, Yt = (t) => {
|
|
100
100
|
if (ht(t)) return t?.toString().length === 0;
|
|
101
101
|
switch (typeof t) {
|
|
102
102
|
case "string":
|
|
@@ -114,11 +114,12 @@ const ht = (t) => t != null && typeof t == "object" && "toString" in t, cn = (t)
|
|
|
114
114
|
default:
|
|
115
115
|
return !1;
|
|
116
116
|
}
|
|
117
|
-
},
|
|
117
|
+
}, hn = (t) => !Yt(t), mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
118
118
|
__proto__: null,
|
|
119
119
|
ValueExtension: J,
|
|
120
|
+
isNonZero: hn,
|
|
120
121
|
isStringer: ht,
|
|
121
|
-
isZero:
|
|
122
|
+
isZero: Yt
|
|
122
123
|
}, Symbol.toStringTag, { value: "Module" })), Be = (t, e = !1) => {
|
|
123
124
|
const r = ht(t) ? "stringer" : typeof t;
|
|
124
125
|
let n;
|
|
@@ -144,19 +145,19 @@ const ht = (t) => t != null && typeof t == "object" && "toString" in t, cn = (t)
|
|
|
144
145
|
default:
|
|
145
146
|
return console.warn(`sortFunc: unknown type ${r}`), () => -1;
|
|
146
147
|
}
|
|
147
|
-
return e ?
|
|
148
|
-
},
|
|
148
|
+
return e ? Wt(n) : n;
|
|
149
|
+
}, fn = (t, e, r) => {
|
|
149
150
|
const n = Be(e[t], r);
|
|
150
151
|
return (s, i) => n(s[t], i[t]);
|
|
151
|
-
},
|
|
152
|
+
}, dn = (t, e) => t.length !== e.length ? t.length - e.length : t.every((r, n) => r === e[n]) ? 0 : -1, Vt = (t, e) => {
|
|
152
153
|
if (t.length !== e.length) return t.length - e.length;
|
|
153
154
|
if (t.length === 0) return 0;
|
|
154
155
|
const r = Be(t[0]), n = [...t].sort(r), s = [...e].sort(r);
|
|
155
156
|
return n.every((i, o) => i === s[o]) ? 0 : -1;
|
|
156
|
-
},
|
|
157
|
+
}, gn = (t, e) => {
|
|
157
158
|
const r = Je(t), n = Je(e);
|
|
158
|
-
return
|
|
159
|
-
},
|
|
159
|
+
return Vt(r, n);
|
|
160
|
+
}, pn = (t, e) => t === e ? 0 : t === "first" && e === "last" ? 1 : -1, Wt = (t) => (e, r) => t(r, e), ee = 0, xe = -1, $e = 1, Gt = (t) => t < ee, Ht = (t) => t > ee, yn = (t) => t >= ee, Jt = (t) => t === ee, mn = (t, e) => {
|
|
160
161
|
const r = /([a-zA-Z]+)|(\d+)/g, n = t.replace(/[\s_.-]+/g, "").match(r), s = e.replace(/[\s_.-]+/g, "").match(r);
|
|
161
162
|
if (!n || !s) return 0;
|
|
162
163
|
for (let i = 0; i < Math.min(n.length, s.length); i++) {
|
|
@@ -170,43 +171,43 @@ const ht = (t) => t != null && typeof t == "object" && "toString" in t, cn = (t)
|
|
|
170
171
|
} else return isNaN(Number(o)) ? -1 : 1;
|
|
171
172
|
}
|
|
172
173
|
return n.length - s.length;
|
|
173
|
-
},
|
|
174
|
+
}, bo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
174
175
|
__proto__: null,
|
|
175
176
|
EQUAL: ee,
|
|
176
177
|
GREATER_THAN: $e,
|
|
177
178
|
LESS_THAN: xe,
|
|
178
|
-
isEqualTo:
|
|
179
|
-
isGreaterThan:
|
|
180
|
-
isGreaterThanEqual:
|
|
181
|
-
isLessThan:
|
|
179
|
+
isEqualTo: Jt,
|
|
180
|
+
isGreaterThan: Ht,
|
|
181
|
+
isGreaterThanEqual: yn,
|
|
182
|
+
isLessThan: Gt,
|
|
182
183
|
newF: Be,
|
|
183
|
-
newFieldF:
|
|
184
|
-
order:
|
|
185
|
-
primitiveArrays:
|
|
186
|
-
reverseF:
|
|
187
|
-
stringsWithNumbers:
|
|
188
|
-
uniqueUnorderedPrimitiveArrays:
|
|
189
|
-
unorderedPrimitiveArrays:
|
|
184
|
+
newFieldF: fn,
|
|
185
|
+
order: pn,
|
|
186
|
+
primitiveArrays: dn,
|
|
187
|
+
reverseF: Wt,
|
|
188
|
+
stringsWithNumbers: mn,
|
|
189
|
+
uniqueUnorderedPrimitiveArrays: gn,
|
|
190
|
+
unorderedPrimitiveArrays: Vt
|
|
190
191
|
}, Symbol.toStringTag, { value: "Module" })), Ue = a.tuple([a.number(), a.number()]);
|
|
191
192
|
a.tuple([a.bigint(), a.bigint()]);
|
|
192
|
-
const ft = a.object({ width: a.number(), height: a.number() }),
|
|
193
|
+
const ft = a.object({ width: a.number(), height: a.number() }), bn = a.object({
|
|
193
194
|
signedWidth: a.number(),
|
|
194
195
|
signedHeight: a.number()
|
|
195
|
-
}),
|
|
196
|
-
a.enum(bn);
|
|
197
|
-
const wn = ["start", "center", "end"], On = ["signedWidth", "signedHeight"];
|
|
198
|
-
a.enum(On);
|
|
199
|
-
const he = a.object({ x: a.number(), y: a.number() }), Jt = a.object({ clientX: a.number(), clientY: a.number() }), Ce = ["x", "y"], dt = a.enum(Ce), Xt = ["top", "right", "bottom", "left"], vn = a.enum(Xt), je = ["left", "right"], gt = a.enum(je), Re = ["top", "bottom"], pt = a.enum(Re), yt = ["center"], Xe = a.enum(yt), Tn = [...Xt, ...yt], mt = a.enum(Tn);
|
|
196
|
+
}), wn = ["width", "height"];
|
|
200
197
|
a.enum(wn);
|
|
201
|
-
const
|
|
202
|
-
a.enum(
|
|
203
|
-
const
|
|
204
|
-
a.
|
|
205
|
-
|
|
206
|
-
|
|
198
|
+
const On = ["start", "center", "end"], vn = ["signedWidth", "signedHeight"];
|
|
199
|
+
a.enum(vn);
|
|
200
|
+
const he = a.object({ x: a.number(), y: a.number() }), Xt = a.object({ clientX: a.number(), clientY: a.number() }), Ce = ["x", "y"], dt = a.enum(Ce), Kt = ["top", "right", "bottom", "left"], Tn = a.enum(Kt), je = ["left", "right"], gt = a.enum(je), Re = ["top", "bottom"], pt = a.enum(Re), yt = ["center"], Xe = a.enum(yt), xn = [...Kt, ...yt], mt = a.enum(xn);
|
|
201
|
+
a.enum(On);
|
|
202
|
+
const $n = ["first", "last"];
|
|
203
|
+
a.enum($n);
|
|
204
|
+
const Qt = a.object({ lower: a.number(), upper: a.number() }), Sn = a.object({ lower: a.bigint(), upper: a.bigint() });
|
|
205
|
+
a.union([Qt, Ue]);
|
|
206
|
+
a.union([Sn, Ue]);
|
|
207
|
+
const Nn = a.enum([...dt.options, ...mt.options]), In = a.union([dt, mt, a.instanceof(String)]), ae = (t, e) => typeof t == "bigint" ? t - BigInt(e) : t - Number(e), _t = (t, e) => typeof t == "bigint" ? t + BigInt(e) : t + Number(e), Mn = (t, e, r = 1e-4) => Math.abs(t - e) < r, Ke = (t, e) => typeof t == "bigint" ? t === BigInt(e) : t === Number(e), En = (t) => {
|
|
207
208
|
const e = 10 ** Math.floor(Math.log10(t));
|
|
208
209
|
return Math.round(t / e) * e;
|
|
209
|
-
},
|
|
210
|
+
}, er = (t, e) => t <= e ? t : typeof t == "bigint" ? t <= e ? t : BigInt(e) : t <= e ? t : Number(e), An = (t, e) => typeof t == "bigint" ? t >= e ? t : BigInt(e) : t >= e ? t : Number(e), tr = (t) => t < 0 ? -t : t, Y = (t, e) => typeof t == "bigint" ? t * BigInt(e) : t * Number(e), Bn = (t, e) => typeof t == "bigint" ? t / BigInt(e) : t / Number(e), y = (t, e, r) => {
|
|
210
211
|
const n = {};
|
|
211
212
|
if (typeof e == "object" && (r = e, e = void 0), r = { makeValid: !0, ...r }, typeof t == "number" || typeof t == "bigint")
|
|
212
213
|
e != null ? (n.lower = t, n.upper = e) : (n.lower = typeof t == "bigint" ? 0n : 0, n.upper = t);
|
|
@@ -215,13 +216,13 @@ const Sn = a.enum([...dt.options, ...mt.options]), Nn = a.union([dt, mt, a.insta
|
|
|
215
216
|
[n.lower, n.upper] = t;
|
|
216
217
|
} else
|
|
217
218
|
n.lower = t.lower, n.upper = t.upper;
|
|
218
|
-
return r?.makeValid ?
|
|
219
|
-
},
|
|
219
|
+
return r?.makeValid ? rr(n) : n;
|
|
220
|
+
}, Un = Object.freeze({ lower: 0, upper: 0 }), Cn = Object.freeze({ lower: -1 / 0, upper: 1 / 0 }), jn = Object.freeze({ lower: 0, upper: 1 }), Rn = Object.freeze({ lower: -1, upper: 1 }), Ln = (t, e) => {
|
|
220
221
|
if (t == null && e == null) return !0;
|
|
221
222
|
if (t == null || e == null) return !1;
|
|
222
223
|
const r = y(t), n = y(e);
|
|
223
224
|
return r?.lower === n?.lower && r?.upper === n?.upper;
|
|
224
|
-
},
|
|
225
|
+
}, rr = (t) => t.lower > t.upper ? { lower: t.upper, upper: t.lower } : t, Qe = (t, e) => {
|
|
225
226
|
const r = y(t);
|
|
226
227
|
return e < r.lower ? r.lower : e >= r.upper ? r.upper - (typeof r.upper == "number" ? 1 : 1n) : e;
|
|
227
228
|
}, I = (t, e) => {
|
|
@@ -230,31 +231,31 @@ const Sn = a.enum([...dt.options, ...mt.options]), Nn = a.union([dt, mt, a.insta
|
|
|
230
231
|
return e >= r.lower && e < r.upper;
|
|
231
232
|
const n = y(e);
|
|
232
233
|
return n.lower >= r.lower && n.upper <= r.upper;
|
|
233
|
-
},
|
|
234
|
+
}, Dn = (t, e) => {
|
|
234
235
|
const r = y(t), n = y(e);
|
|
235
236
|
return r.lower === n.lower ? !0 : n.upper === r.lower || n.lower === r.upper ? !1 : I(r, n.upper) || I(r, n.lower) || I(n, r.upper) || I(n, r.lower);
|
|
236
237
|
}, ye = (t) => {
|
|
237
238
|
const e = y(t);
|
|
238
239
|
return e.upper - e.lower;
|
|
239
|
-
},
|
|
240
|
+
}, Pn = (t) => {
|
|
240
241
|
const e = y(t);
|
|
241
242
|
return typeof e.lower == "bigint" ? e.lower === 0n && e.upper === 0n : e.lower === 0 && e.upper === 0;
|
|
242
|
-
},
|
|
243
|
+
}, qn = (t) => {
|
|
243
244
|
const e = ye(t);
|
|
244
245
|
return typeof e == "number" ? e === 0 : e === 0n;
|
|
245
|
-
},
|
|
246
|
+
}, kn = (t) => {
|
|
246
247
|
const e = y(t);
|
|
247
248
|
return typeof e.lower == "bigint" ? !0 : Number.isFinite(e.lower) && Number.isFinite(e.upper);
|
|
248
|
-
},
|
|
249
|
+
}, zn = (t) => {
|
|
249
250
|
const e = y(t);
|
|
250
251
|
return (e.upper + e.lower) / 2;
|
|
251
|
-
},
|
|
252
|
+
}, nr = (t) => ({
|
|
252
253
|
lower: Math.min(...t.map((e) => y(e).lower)),
|
|
253
254
|
upper: Math.max(...t.map((e) => y(e).upper))
|
|
254
|
-
}),
|
|
255
|
+
}), Fn = (t) => ({
|
|
255
256
|
lower: Math.max(...t.map((e) => y(e).lower)),
|
|
256
257
|
upper: Math.min(...t.map((e) => y(e).upper))
|
|
257
|
-
}),
|
|
258
|
+
}), Zn = (t) => {
|
|
258
259
|
const e = y(t), r = typeof e.lower == "bigint";
|
|
259
260
|
return Array.from({ length: Number(ye(t)) }, (n, s) => r ? e.lower + BigInt(s) : e.lower + s);
|
|
260
261
|
}, _e = (t, e) => {
|
|
@@ -267,8 +268,8 @@ const Sn = a.enum([...dt.options, ...mt.options]), Nn = a.union([dt, mt, a.insta
|
|
|
267
268
|
removeAfter: 0,
|
|
268
269
|
insertInto: 0,
|
|
269
270
|
deleteInBetween: 0
|
|
270
|
-
},
|
|
271
|
-
const r = t.map((
|
|
271
|
+
}, Yn = (t, e) => {
|
|
272
|
+
const r = t.map((h) => y(h)), n = y(e);
|
|
272
273
|
if (r.length === 0) return Ze;
|
|
273
274
|
const s = _e(r, n.lower), i = _e(r, n.upper);
|
|
274
275
|
if (s.index === t.length) return { ...Ze, insertInto: t.length };
|
|
@@ -287,7 +288,7 @@ const Sn = a.enum([...dt.options, ...mt.options]), Nn = a.union([dt, mt, a.insta
|
|
|
287
288
|
insertInto: c,
|
|
288
289
|
deleteInBetween: o
|
|
289
290
|
};
|
|
290
|
-
},
|
|
291
|
+
}, sr = (t, e, r) => {
|
|
291
292
|
const n = t.map((c) => y(c)), s = r > 0 ? 1 : r < 0 ? -1 : 0;
|
|
292
293
|
if (s === 0) return e;
|
|
293
294
|
let i = r, o = e;
|
|
@@ -295,29 +296,29 @@ const Sn = a.enum([...dt.options, ...mt.options]), Nn = a.union([dt, mt, a.insta
|
|
|
295
296
|
const c = n.findIndex((l) => s > 0 ? o >= l.lower && o < l.upper : o > l.lower && o <= l.upper);
|
|
296
297
|
if (c !== -1) {
|
|
297
298
|
const l = n[c];
|
|
298
|
-
let
|
|
299
|
-
if (s > 0 ?
|
|
300
|
-
const
|
|
301
|
-
if (o =
|
|
299
|
+
let h;
|
|
300
|
+
if (s > 0 ? h = ae(l.upper, o) : h = ae(o, l.lower), h > 0) {
|
|
301
|
+
const g = er(tr(i), h);
|
|
302
|
+
if (o = _t(
|
|
302
303
|
o,
|
|
303
|
-
s > 0 ?
|
|
304
|
-
), i = ae(i, s > 0 ?
|
|
304
|
+
s > 0 ? g : -g
|
|
305
|
+
), i = ae(i, s > 0 ? g : -g), Ke(i, 0)) return o;
|
|
305
306
|
continue;
|
|
306
307
|
}
|
|
307
308
|
}
|
|
308
309
|
if (s > 0) {
|
|
309
|
-
const l = n.filter((
|
|
310
|
+
const l = n.filter((h) => h.lower > o);
|
|
310
311
|
if (l.length > 0) o = l[0].lower;
|
|
311
312
|
else return o;
|
|
312
313
|
} else {
|
|
313
|
-
const l = n.filter((
|
|
314
|
+
const l = n.filter((h) => h.upper < o);
|
|
314
315
|
if (l.length > 0)
|
|
315
316
|
o = l[l.length - 1].upper;
|
|
316
317
|
else return o;
|
|
317
318
|
}
|
|
318
319
|
}
|
|
319
320
|
return o;
|
|
320
|
-
},
|
|
321
|
+
}, ir = (t, e, r) => {
|
|
321
322
|
const n = t.map((o) => y(o));
|
|
322
323
|
if (e === r) return typeof e == "bigint" ? 0n : 0;
|
|
323
324
|
const s = e < r ? y([e, r]) : y([r, e]);
|
|
@@ -325,66 +326,66 @@ const Sn = a.enum([...dt.options, ...mt.options]), Nn = a.union([dt, mt, a.insta
|
|
|
325
326
|
for (const o of n) {
|
|
326
327
|
const c = o.lower > s.lower ? o.lower : s.lower, l = o.upper < s.upper ? o.upper : s.upper;
|
|
327
328
|
if (c < l) {
|
|
328
|
-
const
|
|
329
|
-
i = i +
|
|
329
|
+
const h = l - c;
|
|
330
|
+
i = i + h;
|
|
330
331
|
}
|
|
331
332
|
}
|
|
332
333
|
return i;
|
|
333
|
-
},
|
|
334
|
+
}, wo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
334
335
|
__proto__: null,
|
|
335
|
-
CLIP:
|
|
336
|
-
DECIMAL:
|
|
337
|
-
INFINITE:
|
|
338
|
-
ZERO:
|
|
339
|
-
bounds:
|
|
340
|
-
buildInsertionPlan:
|
|
336
|
+
CLIP: Rn,
|
|
337
|
+
DECIMAL: jn,
|
|
338
|
+
INFINITE: Cn,
|
|
339
|
+
ZERO: Un,
|
|
340
|
+
bounds: Qt,
|
|
341
|
+
buildInsertionPlan: Yn,
|
|
341
342
|
clamp: Qe,
|
|
342
343
|
construct: y,
|
|
343
344
|
contains: I,
|
|
344
|
-
distance:
|
|
345
|
-
equals:
|
|
345
|
+
distance: ir,
|
|
346
|
+
equals: Ln,
|
|
346
347
|
findInsertPosition: _e,
|
|
347
|
-
isFinite:
|
|
348
|
-
isZero:
|
|
349
|
-
linspace:
|
|
350
|
-
makeValid:
|
|
351
|
-
max:
|
|
352
|
-
mean:
|
|
353
|
-
min:
|
|
354
|
-
overlapsWith:
|
|
348
|
+
isFinite: kn,
|
|
349
|
+
isZero: Pn,
|
|
350
|
+
linspace: Zn,
|
|
351
|
+
makeValid: rr,
|
|
352
|
+
max: nr,
|
|
353
|
+
mean: zn,
|
|
354
|
+
min: Fn,
|
|
355
|
+
overlapsWith: Dn,
|
|
355
356
|
span: ye,
|
|
356
|
-
spanIsZero:
|
|
357
|
-
traverse:
|
|
358
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
357
|
+
spanIsZero: qn,
|
|
358
|
+
traverse: sr
|
|
359
|
+
}, Symbol.toStringTag, { value: "Module" })), ar = Nn, Z = (t) => Ce.includes(t) ? t : Re.includes(t) ? "y" : "x", Vn = (t) => Z(t) === "x" ? "y" : "x", Wn = (t) => Z(t) === "x" ? "width" : "height", Gn = (t) => Z(t) === "x" ? "left" : "top", Hn = (t) => ar.safeParse(t).success, Jn = (t) => Z(t) === "x" ? "signedWidth" : "signedHeight", Xn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
359
360
|
__proto__: null,
|
|
360
361
|
DIRECTIONS: Ce,
|
|
361
362
|
construct: Z,
|
|
362
|
-
crude:
|
|
363
|
-
dimension:
|
|
363
|
+
crude: ar,
|
|
364
|
+
dimension: Wn,
|
|
364
365
|
direction: dt,
|
|
365
|
-
isDirection:
|
|
366
|
-
location:
|
|
367
|
-
signedDimension:
|
|
368
|
-
swap:
|
|
369
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
366
|
+
isDirection: Hn,
|
|
367
|
+
location: Gn,
|
|
368
|
+
signedDimension: Jn,
|
|
369
|
+
swap: Vn
|
|
370
|
+
}, Symbol.toStringTag, { value: "Module" })), Kn = gt, Qn = pt, _n = Xe, es = {
|
|
370
371
|
top: "bottom",
|
|
371
372
|
right: "left",
|
|
372
373
|
bottom: "top",
|
|
373
374
|
left: "right",
|
|
374
375
|
center: "center"
|
|
375
|
-
},
|
|
376
|
+
}, ts = {
|
|
376
377
|
top: "left",
|
|
377
378
|
right: "top",
|
|
378
379
|
bottom: "right",
|
|
379
380
|
left: "bottom",
|
|
380
381
|
center: "center"
|
|
381
|
-
},
|
|
382
|
+
}, rs = In, k = (t) => t instanceof String || !Ce.includes(t) ? t : t === "x" ? "left" : "top", ns = (t) => es[k(t)], ss = (t) => ts[k(t)], fe = (t) => {
|
|
382
383
|
const e = k(t);
|
|
383
384
|
return e === "top" || e === "bottom" ? "y" : "x";
|
|
384
|
-
},
|
|
385
|
+
}, is = a.object({
|
|
385
386
|
x: gt.or(Xe),
|
|
386
387
|
y: pt.or(Xe)
|
|
387
|
-
}),
|
|
388
|
+
}), or = a.object({ x: gt, y: pt }), me = Object.freeze({ x: "left", y: "top" }), bt = Object.freeze({ x: "right", y: "top" }), Le = Object.freeze({ x: "left", y: "bottom" }), wt = Object.freeze({ x: "right", y: "bottom" }), Ot = Object.freeze({ x: "center", y: "center" }), vt = Object.freeze({ x: "center", y: "top" }), Tt = Object.freeze({ x: "center", y: "bottom" }), xt = Object.freeze({ x: "right", y: "center" }), $t = Object.freeze({ x: "left", y: "center" }), as = Object.freeze([
|
|
388
389
|
$t,
|
|
389
390
|
xt,
|
|
390
391
|
vt,
|
|
@@ -394,13 +395,13 @@ const Sn = a.enum([...dt.options, ...mt.options]), Nn = a.union([dt, mt, a.insta
|
|
|
394
395
|
Le,
|
|
395
396
|
wt,
|
|
396
397
|
Ot
|
|
397
|
-
]), St = (t, e) => t.x === e.x && t.y === e.y,
|
|
398
|
+
]), St = (t, e) => t.x === e.x && t.y === e.y, os = (t, e) => {
|
|
398
399
|
if (typeof e == "object") {
|
|
399
400
|
let r = !0;
|
|
400
401
|
return "x" in e && (t.x === e.x || (r = !1)), "y" in e && (t.y === e.y || (r = !1)), r;
|
|
401
402
|
}
|
|
402
403
|
return t.x === e || t.y === e;
|
|
403
|
-
},
|
|
404
|
+
}, ur = (t) => [t.x, t.y], Se = (t) => fe(k(t)) === "x", us = (t) => fe(k(t)) === "y", ls = (t) => `${t.x}${Zt(t.y)}`, cs = (t, e) => {
|
|
404
405
|
let r, n;
|
|
405
406
|
if (typeof t == "object" && "x" in t ? (r = t.x, n = t.y) : (r = k(t), n = k(e ?? t)), fe(r) === fe(n) && r !== "center" && n !== "center")
|
|
406
407
|
throw new Error(
|
|
@@ -408,7 +409,7 @@ const Sn = a.enum([...dt.options, ...mt.options]), Nn = a.union([dt, mt, a.insta
|
|
|
408
409
|
);
|
|
409
410
|
const s = { ...Ot };
|
|
410
411
|
return r === "center" ? Se(n) ? [s.x, s.y] = [n, r] : [s.x, s.y] = [r, n] : n === "center" ? Se(r) ? [s.x, s.y] = [r, n] : [s.x, s.y] = [n, r] : Se(r) ? [s.x, s.y] = [r, n] : [s.x, s.y] = [n, r], s;
|
|
411
|
-
},
|
|
412
|
+
}, hs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
412
413
|
__proto__: null,
|
|
413
414
|
BOTTOM_CENTER: Tt,
|
|
414
415
|
BOTTOM_LEFT: Le,
|
|
@@ -420,75 +421,75 @@ const Sn = a.enum([...dt.options, ...mt.options]), Nn = a.union([dt, mt, a.insta
|
|
|
420
421
|
TOP_CENTER: vt,
|
|
421
422
|
TOP_LEFT: me,
|
|
422
423
|
TOP_RIGHT: bt,
|
|
423
|
-
XY_LOCATIONS:
|
|
424
|
+
XY_LOCATIONS: as,
|
|
424
425
|
X_LOCATIONS: je,
|
|
425
426
|
Y_LOCATIONS: Re,
|
|
426
|
-
center:
|
|
427
|
+
center: _n,
|
|
427
428
|
construct: k,
|
|
428
|
-
constructXY:
|
|
429
|
-
corner:
|
|
430
|
-
crude:
|
|
429
|
+
constructXY: cs,
|
|
430
|
+
corner: or,
|
|
431
|
+
crude: rs,
|
|
431
432
|
direction: fe,
|
|
432
433
|
isX: Se,
|
|
433
|
-
isY:
|
|
434
|
+
isY: us,
|
|
434
435
|
location: mt,
|
|
435
|
-
outer:
|
|
436
|
-
rotate90:
|
|
437
|
-
swap:
|
|
438
|
-
x:
|
|
439
|
-
xy:
|
|
440
|
-
xyCouple:
|
|
436
|
+
outer: Tn,
|
|
437
|
+
rotate90: ss,
|
|
438
|
+
swap: ns,
|
|
439
|
+
x: Kn,
|
|
440
|
+
xy: is,
|
|
441
|
+
xyCouple: ur,
|
|
441
442
|
xyEquals: St,
|
|
442
|
-
xyMatches:
|
|
443
|
-
xyToString:
|
|
444
|
-
y:
|
|
443
|
+
xyMatches: os,
|
|
444
|
+
xyToString: ls,
|
|
445
|
+
y: Qn
|
|
445
446
|
}, Symbol.toStringTag, { value: "Module" })), et = a.union([
|
|
446
447
|
a.number(),
|
|
447
448
|
he,
|
|
448
449
|
Ue,
|
|
449
450
|
ft,
|
|
450
|
-
|
|
451
|
-
|
|
451
|
+
bn,
|
|
452
|
+
Xt
|
|
452
453
|
]), v = (t, e) => {
|
|
453
454
|
if (typeof t == "string") {
|
|
454
455
|
if (e === void 0) throw new Error("The y coordinate must be given.");
|
|
455
456
|
return t === "x" ? { x: e, y: 0 } : { x: 0, y: e };
|
|
456
457
|
}
|
|
457
458
|
return typeof t == "number" ? { x: t, y: e ?? t } : Array.isArray(t) ? { x: t[0], y: t[1] } : "signedWidth" in t ? { x: t.signedWidth, y: t.signedHeight } : "clientX" in t ? { x: t.clientX, y: t.clientY } : "width" in t ? { x: t.width, y: t.height } : { x: t.x, y: t.y };
|
|
458
|
-
}, U = Object.freeze({ x: 0, y: 0 }),
|
|
459
|
+
}, U = Object.freeze({ x: 0, y: 0 }), lr = Object.freeze({ x: 1, y: 1 }), fs = Object.freeze({ x: 1 / 0, y: 1 / 0 }), ds = Object.freeze({ x: NaN, y: NaN }), Ae = (t, e, r = 0) => {
|
|
459
460
|
const n = v(t), s = v(e);
|
|
460
461
|
return r === 0 ? n.x === s.x && n.y === s.y : Math.abs(n.x - s.x) <= r && Math.abs(n.y - s.y) <= r;
|
|
461
|
-
},
|
|
462
|
+
}, gs = (t) => Ae(t, U), Nt = (t, e, r) => {
|
|
462
463
|
const n = v(t), s = v(e, r);
|
|
463
464
|
return { x: n.x * s.x, y: n.y * s.y };
|
|
464
|
-
},
|
|
465
|
+
}, cr = (t, e) => {
|
|
465
466
|
const r = v(t);
|
|
466
467
|
return { x: r.x + e, y: r.y };
|
|
467
|
-
},
|
|
468
|
+
}, hr = (t, e) => {
|
|
468
469
|
const r = v(t);
|
|
469
470
|
return { x: r.x, y: r.y + e };
|
|
470
|
-
}, de = (t, e, r, ...n) => typeof e == "string" && typeof r == "number" ? e === "x" ?
|
|
471
|
+
}, de = (t, e, r, ...n) => typeof e == "string" && typeof r == "number" ? e === "x" ? cr(t, r) : hr(t, r) : [t, e, r ?? U, ...n].reduce((s, i) => {
|
|
471
472
|
const o = v(i);
|
|
472
473
|
return { x: s.x + o.x, y: s.y + o.y };
|
|
473
|
-
}, U),
|
|
474
|
+
}, U), ps = (t, e, r) => {
|
|
474
475
|
const n = v(t);
|
|
475
476
|
return e === "x" ? { x: r, y: n.y } : { x: n.x, y: r };
|
|
476
|
-
},
|
|
477
|
+
}, ys = (t, e) => {
|
|
477
478
|
const r = v(t), n = v(e);
|
|
478
479
|
return Math.sqrt((r.x - n.x) ** 2 + (r.y - n.y) ** 2);
|
|
479
|
-
},
|
|
480
|
+
}, ms = (t, e) => {
|
|
480
481
|
const r = v(t), n = v(e);
|
|
481
482
|
return { x: n.x - r.x, y: n.y - r.y };
|
|
482
|
-
},
|
|
483
|
+
}, bs = (t) => {
|
|
483
484
|
const e = v(t);
|
|
484
485
|
return Number.isNaN(e.x) || Number.isNaN(e.y);
|
|
485
|
-
},
|
|
486
|
+
}, ws = (t) => {
|
|
486
487
|
const e = v(t);
|
|
487
488
|
return Number.isFinite(e.x) && Number.isFinite(e.y);
|
|
488
|
-
},
|
|
489
|
+
}, Os = (t) => {
|
|
489
490
|
const e = v(t);
|
|
490
491
|
return [e.x, e.y];
|
|
491
|
-
},
|
|
492
|
+
}, vs = (t) => {
|
|
492
493
|
const e = v(t);
|
|
493
494
|
return { left: e.x, top: e.y };
|
|
494
495
|
}, tt = (t, e = 0) => {
|
|
@@ -500,86 +501,86 @@ const Sn = a.enum([...dt.options, ...mt.options]), Nn = a.union([dt, mt, a.insta
|
|
|
500
501
|
}, se = (t) => {
|
|
501
502
|
const e = v(t), r = Math.hypot(e.x, e.y);
|
|
502
503
|
return r === 0 ? { x: 0, y: 0 } : { x: -e.y / r, y: e.x / r };
|
|
503
|
-
},
|
|
504
|
+
}, fr = (t) => {
|
|
504
505
|
const e = v(t), r = Math.hypot(e.x, e.y);
|
|
505
506
|
return r === 0 ? { x: 0, y: 0 } : { x: e.x / r, y: e.y / r };
|
|
506
|
-
},
|
|
507
|
+
}, dr = (...t) => {
|
|
507
508
|
const e = t.reduce((r, n) => de(r, n), U);
|
|
508
509
|
return Nt(e, 1 / t.length);
|
|
509
|
-
},
|
|
510
|
+
}, Ts = (t, e) => {
|
|
510
511
|
const r = [];
|
|
511
512
|
for (let n = 0; n < t.length; n++) {
|
|
512
513
|
const s = t[n];
|
|
513
514
|
let i, o, c, l;
|
|
514
515
|
if (n === 0) {
|
|
515
|
-
const
|
|
516
|
-
o = se(
|
|
516
|
+
const h = t[n + 1], g = ne(h, s);
|
|
517
|
+
o = se(g), c = o, l = e;
|
|
517
518
|
} else if (n === t.length - 1) {
|
|
518
|
-
const
|
|
519
|
-
i = se(
|
|
519
|
+
const h = t[n - 1], g = ne(s, h);
|
|
520
|
+
i = se(g), c = i, l = e;
|
|
520
521
|
} else {
|
|
521
|
-
const
|
|
522
|
-
i = se(
|
|
522
|
+
const h = t[n - 1], g = t[n + 1], p = ne(s, h), S = ne(g, s);
|
|
523
|
+
i = se(p), o = se(S);
|
|
523
524
|
const E = Math.acos(
|
|
524
|
-
(
|
|
525
|
+
(p.x * S.x + p.y * S.y) / (Math.hypot(p.x, p.y) * Math.hypot(S.x, S.y))
|
|
525
526
|
), te = Math.sin(E / 2);
|
|
526
|
-
te === 0 ? l = e : l = e / te, c =
|
|
527
|
+
te === 0 ? l = e : l = e / te, c = fr(dr(i, o));
|
|
527
528
|
}
|
|
528
529
|
r.push(Nt(c, l));
|
|
529
530
|
}
|
|
530
531
|
return r;
|
|
531
|
-
},
|
|
532
|
+
}, xs = (t) => {
|
|
532
533
|
const e = v(t);
|
|
533
534
|
return { x: e.y, y: e.x };
|
|
534
535
|
}, rt = (t) => {
|
|
535
536
|
const e = v(t);
|
|
536
537
|
return { x: Math.round(e.x), y: Math.round(e.y) };
|
|
537
|
-
},
|
|
538
|
+
}, Oo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
538
539
|
__proto__: null,
|
|
539
|
-
INFINITY:
|
|
540
|
-
NAN:
|
|
541
|
-
ONE:
|
|
540
|
+
INFINITY: fs,
|
|
541
|
+
NAN: ds,
|
|
542
|
+
ONE: lr,
|
|
542
543
|
ZERO: U,
|
|
543
|
-
average:
|
|
544
|
-
calculateMiters:
|
|
545
|
-
clientXY:
|
|
544
|
+
average: dr,
|
|
545
|
+
calculateMiters: Ts,
|
|
546
|
+
clientXY: Xt,
|
|
546
547
|
construct: v,
|
|
547
|
-
couple:
|
|
548
|
+
couple: Os,
|
|
548
549
|
crudeZ: et,
|
|
549
|
-
css:
|
|
550
|
-
distance:
|
|
550
|
+
css: vs,
|
|
551
|
+
distance: ys,
|
|
551
552
|
equals: Ae,
|
|
552
|
-
isFinite:
|
|
553
|
-
isNan:
|
|
554
|
-
isZero:
|
|
553
|
+
isFinite: ws,
|
|
554
|
+
isNan: bs,
|
|
555
|
+
isZero: gs,
|
|
555
556
|
normal: se,
|
|
556
|
-
normalize:
|
|
557
|
+
normalize: fr,
|
|
557
558
|
round: rt,
|
|
558
559
|
scale: Nt,
|
|
559
|
-
set:
|
|
560
|
+
set: ps,
|
|
560
561
|
sub: ne,
|
|
561
|
-
swap:
|
|
562
|
+
swap: xs,
|
|
562
563
|
translate: de,
|
|
563
|
-
translateX:
|
|
564
|
-
translateY:
|
|
565
|
-
translation:
|
|
564
|
+
translateX: cr,
|
|
565
|
+
translateY: hr,
|
|
566
|
+
translation: ms,
|
|
566
567
|
truncate: tt,
|
|
567
568
|
xy: he
|
|
568
|
-
}, Symbol.toStringTag, { value: "Module" })), we = a.union([a.number(), a.string()]),
|
|
569
|
+
}, Symbol.toStringTag, { value: "Module" })), we = a.union([a.number(), a.string()]), $s = a.object({
|
|
569
570
|
top: we,
|
|
570
571
|
left: we,
|
|
571
572
|
width: we,
|
|
572
573
|
height: we
|
|
573
|
-
}),
|
|
574
|
+
}), Ss = a.object({
|
|
574
575
|
left: a.number(),
|
|
575
576
|
top: a.number(),
|
|
576
577
|
right: a.number(),
|
|
577
578
|
bottom: a.number()
|
|
578
|
-
}),
|
|
579
|
+
}), Ns = a.object({
|
|
579
580
|
one: he,
|
|
580
581
|
two: he,
|
|
581
|
-
root:
|
|
582
|
-
}),
|
|
582
|
+
root: or
|
|
583
|
+
}), gr = { one: U, two: U, root: me }, Is = { one: U, two: lr, root: Le }, pr = (t, e) => ({
|
|
583
584
|
one: t.one,
|
|
584
585
|
two: t.two,
|
|
585
586
|
root: e ?? t.root
|
|
@@ -601,7 +602,7 @@ const Sn = a.enum([...dt.options, ...mt.options]), Nn = a.union([dt, mt, a.insta
|
|
|
601
602
|
x: i.one.x + e.signedWidth,
|
|
602
603
|
y: i.one.y + e.signedHeight
|
|
603
604
|
} : i.two = e, i));
|
|
604
|
-
},
|
|
605
|
+
}, Ms = (t, e, r) => {
|
|
605
606
|
const n = O(t);
|
|
606
607
|
if (typeof e == "string") {
|
|
607
608
|
if (r == null) throw new Error("Invalid arguments for resize");
|
|
@@ -615,17 +616,17 @@ const Sn = a.enum([...dt.options, ...mt.options]), Nn = a.union([dt, mt, a.insta
|
|
|
615
616
|
);
|
|
616
617
|
}
|
|
617
618
|
return O(n.one, e, void 0, void 0, n.root);
|
|
618
|
-
},
|
|
619
|
+
}, Es = (t, e, r = !0) => {
|
|
619
620
|
const n = O(t);
|
|
620
621
|
let s = (i, o) => i < o;
|
|
621
622
|
return r && (s = (i, o) => i <= o), "one" in e ? s(P(n), P(e)) && s(W(e), W(n)) && s(q(n), q(e)) && s(G(e), G(n)) : s(P(n), e.x) && s(e.x, W(n)) && s(q(n), e.y) && s(e.y, G(n));
|
|
622
|
-
},
|
|
623
|
+
}, As = (t, e) => Ae(t.one, e.one) && Ae(t.two, e.two) && St(t.root, e.root), yr = (t) => ({
|
|
623
624
|
width: z(t),
|
|
624
625
|
height: F(t)
|
|
625
|
-
}),
|
|
626
|
+
}), Bs = (t) => ({
|
|
626
627
|
signedWidth: De(t),
|
|
627
628
|
signedHeight: Pe(t)
|
|
628
|
-
}),
|
|
629
|
+
}), Us = (t) => ({
|
|
629
630
|
top: q(t),
|
|
630
631
|
left: P(t),
|
|
631
632
|
width: z(t),
|
|
@@ -640,15 +641,15 @@ const Sn = a.enum([...dt.options, ...mt.options]), Nn = a.union([dt, mt, a.insta
|
|
|
640
641
|
y: e.y === "center" ? nt(r).y : H(r, e.y)
|
|
641
642
|
};
|
|
642
643
|
}, H = (t, e) => {
|
|
643
|
-
const r = O(t), n =
|
|
644
|
+
const r = O(t), n = ur(r.root).includes(e) ? Math.min : Math.max;
|
|
644
645
|
return je.includes(e) ? n(r.one.x, r.two.x) : n(r.one.y, r.two.y);
|
|
645
|
-
},
|
|
646
|
+
}, Cs = (t) => t.one.x === t.two.x && t.one.y === t.two.y, z = (t) => It(t, "x"), F = (t) => It(t, "y"), De = (t) => {
|
|
646
647
|
const e = O(t);
|
|
647
648
|
return e.two.x - e.one.x;
|
|
648
649
|
}, Pe = (t) => {
|
|
649
650
|
const e = O(t);
|
|
650
651
|
return e.two.y - e.one.y;
|
|
651
|
-
},
|
|
652
|
+
}, mr = (t) => j(t, me), js = (t) => j(t, vt), Rs = (t) => j(t, bt), Ls = (t) => j(t, Le), Ds = (t) => j(t, Tt), Ps = (t) => j(t, wt), qs = (t) => j(t, $t), ks = (t) => j(t, xt), W = (t) => H(t, "right"), G = (t) => H(t, "bottom"), P = (t) => H(t, "left"), q = (t) => H(t, "top"), nt = (t) => de(mr(t), {
|
|
652
653
|
x: De(t) / 2,
|
|
653
654
|
y: Pe(t) / 2
|
|
654
655
|
}), Mt = (t) => {
|
|
@@ -657,21 +658,21 @@ const Sn = a.enum([...dt.options, ...mt.options]), Nn = a.union([dt, mt, a.insta
|
|
|
657
658
|
}, Et = (t) => {
|
|
658
659
|
const e = O(t);
|
|
659
660
|
return e.root.y === "top" ? q(e) : G(e);
|
|
660
|
-
},
|
|
661
|
+
}, zs = (t) => ({ x: Mt(t), y: Et(t) }), Ne = (t) => {
|
|
661
662
|
const e = O(t);
|
|
662
663
|
return { lower: e.one.x, upper: e.two.x };
|
|
663
664
|
}, Ie = (t) => {
|
|
664
665
|
const e = O(t);
|
|
665
666
|
return { lower: e.one.y, upper: e.two.y };
|
|
666
|
-
},
|
|
667
|
+
}, Fs = (t, e) => pr(t, e), Zs = (t, e) => {
|
|
667
668
|
const r = O(t), n = je.includes(e) ? "x" : Re.includes(e) ? "y" : null;
|
|
668
669
|
if (n === null) throw new Error(`Invalid location: ${e}`);
|
|
669
670
|
const s = e === "top" || e === "left" ? Math.min : Math.max, i = { ...r.one }, o = { ...r.two };
|
|
670
671
|
return i[n] = s(r.one[n], r.two[n]), o[n] = s(r.one[n], r.two[n]), [i, o];
|
|
671
|
-
},
|
|
672
|
+
}, Ys = (t, e) => {
|
|
672
673
|
const r = O(t), n = O(e), s = Mt(n) + (z(n) - z(r)) / 2, i = Et(n) + (F(n) - F(r)) / 2;
|
|
673
|
-
return O({ x: s, y: i },
|
|
674
|
-
},
|
|
674
|
+
return O({ x: s, y: i }, yr(r));
|
|
675
|
+
}, br = (t) => typeof t != "object" || t == null ? !1 : "one" in t && "two" in t && "root" in t, Vs = (t) => z(t) / F(t), Ws = (t, e, r) => {
|
|
675
676
|
if (typeof e == "string") {
|
|
676
677
|
if (r == null) throw new Error("Undefined amount passed into box.translate");
|
|
677
678
|
const s = Z(e);
|
|
@@ -685,10 +686,10 @@ const Sn = a.enum([...dt.options, ...mt.options]), Nn = a.union([dt, mt, a.insta
|
|
|
685
686
|
void 0,
|
|
686
687
|
n.root
|
|
687
688
|
);
|
|
688
|
-
},
|
|
689
|
+
}, Gs = (t, e) => {
|
|
689
690
|
const r = Math.max(P(t), P(e)), n = Math.max(q(t), q(e)), s = Math.min(W(t), W(e)), i = Math.min(G(t), G(e));
|
|
690
|
-
return r > s || n > i ?
|
|
691
|
-
},
|
|
691
|
+
return r > s || n > i ? gr : O({ x: r, y: n }, { x: s, y: i }, void 0, void 0, t.root);
|
|
692
|
+
}, Hs = (t) => z(t) * F(t), Js = (t, e) => {
|
|
692
693
|
const r = O(t);
|
|
693
694
|
return O(
|
|
694
695
|
tt(r.one, e),
|
|
@@ -697,121 +698,121 @@ const Sn = a.enum([...dt.options, ...mt.options]), Nn = a.union([dt, mt, a.insta
|
|
|
697
698
|
void 0,
|
|
698
699
|
r.root
|
|
699
700
|
);
|
|
700
|
-
},
|
|
701
|
+
}, Xs = (t, e, r, n, s, i) => {
|
|
701
702
|
const o = { x: t, y: e }, c = { x: t + r, y: e + n };
|
|
702
703
|
return s.x !== i.x && (s.x === "center" ? (o.x -= r / 2, c.x -= r / 2) : (o.x -= r, c.x -= r)), s.y !== i.y && (s.y === "center" ? (o.y -= n / 2, c.y -= n / 2) : (o.y -= n, c.y -= n)), O(o, c, void 0, void 0, i);
|
|
703
|
-
},
|
|
704
|
+
}, Ks = (t) => {
|
|
704
705
|
const e = O(t);
|
|
705
706
|
return O(rt(e.one), rt(e.two), void 0, void 0, e.root);
|
|
706
|
-
},
|
|
707
|
+
}, vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
707
708
|
__proto__: null,
|
|
708
|
-
DECIMAL:
|
|
709
|
-
ZERO:
|
|
710
|
-
area:
|
|
711
|
-
areaIsZero:
|
|
712
|
-
aspect:
|
|
709
|
+
DECIMAL: Is,
|
|
710
|
+
ZERO: gr,
|
|
711
|
+
area: Hs,
|
|
712
|
+
areaIsZero: Cs,
|
|
713
|
+
aspect: Vs,
|
|
713
714
|
bottom: G,
|
|
714
|
-
bottomCenter:
|
|
715
|
-
bottomLeft:
|
|
716
|
-
bottomRight:
|
|
717
|
-
box:
|
|
715
|
+
bottomCenter: Ds,
|
|
716
|
+
bottomLeft: Ls,
|
|
717
|
+
bottomRight: Ps,
|
|
718
|
+
box: Ns,
|
|
718
719
|
center: nt,
|
|
719
|
-
centerLeft:
|
|
720
|
-
centerRight:
|
|
720
|
+
centerLeft: qs,
|
|
721
|
+
centerRight: ks,
|
|
721
722
|
construct: O,
|
|
722
|
-
constructWithAlternateRoot:
|
|
723
|
-
contains:
|
|
724
|
-
copy:
|
|
725
|
-
css:
|
|
726
|
-
cssBox:
|
|
723
|
+
constructWithAlternateRoot: Xs,
|
|
724
|
+
contains: Es,
|
|
725
|
+
copy: pr,
|
|
726
|
+
css: Us,
|
|
727
|
+
cssBox: $s,
|
|
727
728
|
dim: It,
|
|
728
|
-
dims:
|
|
729
|
-
domRect:
|
|
730
|
-
edgePoints:
|
|
731
|
-
equals:
|
|
729
|
+
dims: yr,
|
|
730
|
+
domRect: Ss,
|
|
731
|
+
edgePoints: Zs,
|
|
732
|
+
equals: As,
|
|
732
733
|
height: F,
|
|
733
|
-
intersection:
|
|
734
|
-
isBox:
|
|
734
|
+
intersection: Gs,
|
|
735
|
+
isBox: br,
|
|
735
736
|
left: P,
|
|
736
737
|
loc: H,
|
|
737
|
-
positionInCenter:
|
|
738
|
-
reRoot:
|
|
739
|
-
resize:
|
|
738
|
+
positionInCenter: Ys,
|
|
739
|
+
reRoot: Fs,
|
|
740
|
+
resize: Ms,
|
|
740
741
|
right: W,
|
|
741
|
-
root:
|
|
742
|
-
round:
|
|
743
|
-
signedDims:
|
|
742
|
+
root: zs,
|
|
743
|
+
round: Ks,
|
|
744
|
+
signedDims: Bs,
|
|
744
745
|
signedHeight: Pe,
|
|
745
746
|
signedWidth: De,
|
|
746
747
|
top: q,
|
|
747
|
-
topCenter:
|
|
748
|
-
topLeft:
|
|
749
|
-
topRight:
|
|
750
|
-
translate:
|
|
751
|
-
truncate:
|
|
748
|
+
topCenter: js,
|
|
749
|
+
topLeft: mr,
|
|
750
|
+
topRight: Rs,
|
|
751
|
+
translate: Ws,
|
|
752
|
+
truncate: Js,
|
|
752
753
|
width: z,
|
|
753
754
|
x: Mt,
|
|
754
755
|
xBounds: Ne,
|
|
755
756
|
xyLoc: j,
|
|
756
757
|
y: Et,
|
|
757
758
|
yBounds: Ie
|
|
758
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
759
|
+
}, Symbol.toStringTag, { value: "Module" })), wr = a.object({ signedWidth: a.number(), signedHeight: a.number() }), Qs = a.union([ft, wr, he, Ue]), _s = { width: 0, height: 0 }, ei = { width: 1, height: 1 }, M = (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 }, ti = (t, e) => {
|
|
759
760
|
if (e == null) return !1;
|
|
760
761
|
const r = M(t), n = M(e);
|
|
761
762
|
return r.width === n.width && r.height === n.height;
|
|
762
|
-
},
|
|
763
|
+
}, ri = (t) => {
|
|
763
764
|
const e = M(t);
|
|
764
765
|
return { width: e.height, height: e.width };
|
|
765
|
-
},
|
|
766
|
+
}, ni = (t) => {
|
|
766
767
|
const e = M(t);
|
|
767
768
|
return `0 0 ${e.width} ${e.height}`;
|
|
768
|
-
},
|
|
769
|
+
}, si = (t) => {
|
|
769
770
|
const e = M(t);
|
|
770
771
|
return [e.width, e.height];
|
|
771
|
-
},
|
|
772
|
+
}, ii = (t) => ({
|
|
772
773
|
width: Math.max(...t.map((e) => M(e).width)),
|
|
773
774
|
height: Math.max(...t.map((e) => M(e).height))
|
|
774
|
-
}),
|
|
775
|
+
}), ai = (t) => ({
|
|
775
776
|
width: Math.min(...t.map((e) => M(e).width)),
|
|
776
777
|
height: Math.min(...t.map((e) => M(e).height))
|
|
777
|
-
}),
|
|
778
|
+
}), oi = (t, e) => {
|
|
778
779
|
const r = M(t);
|
|
779
780
|
return { width: r.width * e, height: r.height * e };
|
|
780
|
-
},
|
|
781
|
+
}, To = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
781
782
|
__proto__: null,
|
|
782
|
-
DECIMAL:
|
|
783
|
-
ZERO:
|
|
783
|
+
DECIMAL: ei,
|
|
784
|
+
ZERO: _s,
|
|
784
785
|
construct: M,
|
|
785
|
-
couple:
|
|
786
|
-
crude:
|
|
786
|
+
couple: si,
|
|
787
|
+
crude: Qs,
|
|
787
788
|
dimensions: ft,
|
|
788
|
-
equals:
|
|
789
|
-
max:
|
|
790
|
-
min:
|
|
791
|
-
scale:
|
|
792
|
-
signed:
|
|
793
|
-
svgViewBox:
|
|
794
|
-
swap:
|
|
795
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
789
|
+
equals: ti,
|
|
790
|
+
max: ii,
|
|
791
|
+
min: ai,
|
|
792
|
+
scale: oi,
|
|
793
|
+
signed: wr,
|
|
794
|
+
svgViewBox: ni,
|
|
795
|
+
swap: ri
|
|
796
|
+
}, Symbol.toStringTag, { value: "Module" })), ui = (t, e, r) => e !== void 0 && t < e ? e : r !== void 0 && t > r ? r : t, li = a.object({ offset: et, scale: et }), ci = a.object({ offset: a.number(), scale: a.number() }), hi = (t) => (e, r, n, s) => r === "dimension" ? [e, n] : [
|
|
796
797
|
e,
|
|
797
798
|
s ? n - t : n + t
|
|
798
|
-
],
|
|
799
|
+
], fi = (t) => (e, r, n, s) => [
|
|
799
800
|
e,
|
|
800
801
|
s ? n / t : n * t
|
|
801
|
-
],
|
|
802
|
+
], di = (t) => (e, r, n) => {
|
|
802
803
|
if (e === null) return [t, n];
|
|
803
|
-
const { lower: s, upper: i } = e, { lower: o, upper: c } = t, l = i - s,
|
|
804
|
-
if (r === "dimension") return [t, n * (
|
|
805
|
-
const
|
|
806
|
-
return [t,
|
|
807
|
-
},
|
|
804
|
+
const { lower: s, upper: i } = e, { lower: o, upper: c } = t, l = i - s, h = c - o;
|
|
805
|
+
if (r === "dimension") return [t, n * (h / l)];
|
|
806
|
+
const g = (n - s) * (h / l) + o;
|
|
807
|
+
return [t, g];
|
|
808
|
+
}, gi = (t) => (e, r, n) => [t, n], pi = () => (t, e, r) => {
|
|
808
809
|
if (t === null) throw new Error("cannot invert without bounds");
|
|
809
810
|
if (e === "dimension") return [t, r];
|
|
810
811
|
const { lower: n, upper: s } = t;
|
|
811
812
|
return [t, s - (r - n)];
|
|
812
|
-
},
|
|
813
|
+
}, yi = (t) => (e, r, n) => {
|
|
813
814
|
const { lower: s, upper: i } = t;
|
|
814
|
-
return n =
|
|
815
|
+
return n = ui(n, s, i), [e, n];
|
|
815
816
|
};
|
|
816
817
|
let st = class K {
|
|
817
818
|
ops = [];
|
|
@@ -847,7 +848,7 @@ let st = class K {
|
|
|
847
848
|
* @param value - The amount to translate by.
|
|
848
849
|
*/
|
|
849
850
|
translate(e) {
|
|
850
|
-
const r = this.new(), n =
|
|
851
|
+
const r = this.new(), n = hi(e);
|
|
851
852
|
return n.type = "translate", r.ops.push(n), r;
|
|
852
853
|
}
|
|
853
854
|
/**
|
|
@@ -857,23 +858,23 @@ let st = class K {
|
|
|
857
858
|
* @param value - The amount to magnify by.
|
|
858
859
|
*/
|
|
859
860
|
magnify(e) {
|
|
860
|
-
const r = this.new(), n =
|
|
861
|
+
const r = this.new(), n = fi(e);
|
|
861
862
|
return n.type = "magnify", r.ops.push(n), r;
|
|
862
863
|
}
|
|
863
864
|
scale(e, r) {
|
|
864
|
-
const n = y(e, r), s = this.new(), i =
|
|
865
|
+
const n = y(e, r), s = this.new(), i = di(n);
|
|
865
866
|
return i.type = "scale", s.ops.push(i), s;
|
|
866
867
|
}
|
|
867
868
|
clamp(e, r) {
|
|
868
|
-
const n = y(e, r), s = this.new(), i =
|
|
869
|
+
const n = y(e, r), s = this.new(), i = yi(n);
|
|
869
870
|
return i.type = "clamp", s.ops.push(i), s;
|
|
870
871
|
}
|
|
871
872
|
reBound(e, r) {
|
|
872
|
-
const n = y(e, r), s = this.new(), i =
|
|
873
|
+
const n = y(e, r), s = this.new(), i = gi(n);
|
|
873
874
|
return i.type = "re-bound", s.ops.push(i), s;
|
|
874
875
|
}
|
|
875
876
|
invert() {
|
|
876
|
-
const e =
|
|
877
|
+
const e = pi();
|
|
877
878
|
e.type = "invert";
|
|
878
879
|
const r = this.new();
|
|
879
880
|
return r.ops.push(e), r;
|
|
@@ -912,7 +913,7 @@ let st = class K {
|
|
|
912
913
|
return { scale: this.dim(1), offset: this.pos(0) };
|
|
913
914
|
}
|
|
914
915
|
static IDENTITY = new K();
|
|
915
|
-
},
|
|
916
|
+
}, mi = class A {
|
|
916
917
|
x;
|
|
917
918
|
y;
|
|
918
919
|
currRoot;
|
|
@@ -958,7 +959,7 @@ let st = class K {
|
|
|
958
959
|
}
|
|
959
960
|
scale(e) {
|
|
960
961
|
const r = this.copy();
|
|
961
|
-
if (
|
|
962
|
+
if (br(e)) {
|
|
962
963
|
const n = this.currRoot;
|
|
963
964
|
return r.currRoot = e.root, n != null && !St(n, e.root) && (n.x !== e.root.x && (r.x = r.x.invert()), n.y !== e.root.y && (r.y = r.y.invert())), r.x = r.x.scale(Ne(e)), r.y = r.y.scale(Ie(e)), r;
|
|
964
965
|
}
|
|
@@ -1003,43 +1004,43 @@ let st = class K {
|
|
|
1003
1004
|
}
|
|
1004
1005
|
static IDENTITY = new A();
|
|
1005
1006
|
};
|
|
1006
|
-
const
|
|
1007
|
+
const xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1007
1008
|
__proto__: null,
|
|
1008
1009
|
Scale: st,
|
|
1009
|
-
XY:
|
|
1010
|
-
crudeXYTransform:
|
|
1011
|
-
transform:
|
|
1010
|
+
XY: mi,
|
|
1011
|
+
crudeXYTransform: li,
|
|
1012
|
+
transform: ci
|
|
1012
1013
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1013
|
-
let
|
|
1014
|
+
let bi = (t, e = 21) => (r = e) => {
|
|
1014
1015
|
let n = "", s = r | 0;
|
|
1015
1016
|
for (; s--; )
|
|
1016
1017
|
n += t[Math.random() * t.length | 0];
|
|
1017
1018
|
return n;
|
|
1018
1019
|
};
|
|
1019
|
-
const
|
|
1020
|
+
const wi = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", Or = 11, Oi = bi(wi, Or), At = () => Oi(), $o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1020
1021
|
__proto__: null,
|
|
1021
|
-
LENGTH:
|
|
1022
|
+
LENGTH: Or,
|
|
1022
1023
|
create: At
|
|
1023
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1024
|
+
}, Symbol.toStringTag, { value: "Module" })), vi = (t, e) => (r) => r instanceof e || typeof r == "object" && r !== null && "discriminator" in r && r.discriminator === t, Ti = a.enum(["static", "dynamic"]), xi = a.union([
|
|
1024
1025
|
a.tuple([a.int()]),
|
|
1025
1026
|
a.tuple([a.int(), a.int().min(1).max(12)]),
|
|
1026
1027
|
a.tuple([a.int(), a.int().min(1).max(12), a.int().min(1).max(31)])
|
|
1027
|
-
]),
|
|
1028
|
+
]), vr = (t, e) => {
|
|
1028
1029
|
const r = new b(e);
|
|
1029
1030
|
if (![
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1031
|
+
f.DAY,
|
|
1032
|
+
f.HOUR,
|
|
1033
|
+
f.MINUTE,
|
|
1034
|
+
f.SECOND,
|
|
1035
|
+
f.MILLISECOND,
|
|
1036
|
+
f.MICROSECOND,
|
|
1037
|
+
f.NANOSECOND
|
|
1037
1038
|
].some((s) => s.equals(r)))
|
|
1038
1039
|
throw new Error(
|
|
1039
1040
|
"Invalid argument for remainder. Must be an even TimeSpan or Timestamp"
|
|
1040
1041
|
);
|
|
1041
1042
|
const n = t.valueOf() % r.valueOf();
|
|
1042
|
-
return t instanceof b ? new b(n) : new
|
|
1043
|
+
return t instanceof b ? new b(n) : new f(n);
|
|
1043
1044
|
};
|
|
1044
1045
|
let b = class d extends J {
|
|
1045
1046
|
constructor(e, r = "UTC") {
|
|
@@ -1121,7 +1122,7 @@ let b = class d extends J {
|
|
|
1121
1122
|
}
|
|
1122
1123
|
/** @returns The UTC offset for the time zone of the machine. */
|
|
1123
1124
|
static get utcOffset() {
|
|
1124
|
-
return new
|
|
1125
|
+
return new f(
|
|
1125
1126
|
BigInt((/* @__PURE__ */ new Date()).getTimezoneOffset()) * d.MINUTE.valueOf()
|
|
1126
1127
|
);
|
|
1127
1128
|
}
|
|
@@ -1250,28 +1251,28 @@ let b = class d extends J {
|
|
|
1250
1251
|
* value.
|
|
1251
1252
|
*/
|
|
1252
1253
|
get hours() {
|
|
1253
|
-
return Number(this.valueOf()) / Number(
|
|
1254
|
+
return Number(this.valueOf()) / Number(f.HOUR.valueOf());
|
|
1254
1255
|
}
|
|
1255
1256
|
/**
|
|
1256
1257
|
* @returns the floating point number of minutes since the unix epoch to the timestamp
|
|
1257
1258
|
* value.
|
|
1258
1259
|
*/
|
|
1259
1260
|
get minutes() {
|
|
1260
|
-
return Number(this.valueOf()) / Number(
|
|
1261
|
+
return Number(this.valueOf()) / Number(f.MINUTE.valueOf());
|
|
1261
1262
|
}
|
|
1262
1263
|
/**
|
|
1263
1264
|
* @returns the floating point number of days since the unix epoch to the timestamp
|
|
1264
1265
|
* value.
|
|
1265
1266
|
*/
|
|
1266
1267
|
get days() {
|
|
1267
|
-
return Number(this.valueOf()) / Number(
|
|
1268
|
+
return Number(this.valueOf()) / Number(f.DAY.valueOf());
|
|
1268
1269
|
}
|
|
1269
1270
|
/**
|
|
1270
1271
|
* @returns the floating point number of seconds since the unix epoch to the timestamp
|
|
1271
1272
|
* value.
|
|
1272
1273
|
*/
|
|
1273
1274
|
get seconds() {
|
|
1274
|
-
return Number(this.valueOf()) / Number(
|
|
1275
|
+
return Number(this.valueOf()) / Number(f.SECOND.valueOf());
|
|
1275
1276
|
}
|
|
1276
1277
|
/** @returns the floating point number of milliseconds since the unix epoch. */
|
|
1277
1278
|
get milliseconds() {
|
|
@@ -1397,11 +1398,11 @@ let b = class d extends J {
|
|
|
1397
1398
|
* @example TimeStamp.now().remainder(TimeStamp.DAY) // => TimeStamp representing the current day
|
|
1398
1399
|
*/
|
|
1399
1400
|
remainder(e) {
|
|
1400
|
-
return
|
|
1401
|
+
return vr(this, e);
|
|
1401
1402
|
}
|
|
1402
1403
|
/** @returns true if the day portion TimeStamp is today, false otherwise. */
|
|
1403
1404
|
get isToday() {
|
|
1404
|
-
return this.truncate(
|
|
1405
|
+
return this.truncate(f.DAY).equals(d.now().truncate(f.DAY));
|
|
1405
1406
|
}
|
|
1406
1407
|
/**
|
|
1407
1408
|
* Truncates the TimeStamp to the nearest multiple of the given span.
|
|
@@ -1509,8 +1510,8 @@ let b = class d extends J {
|
|
|
1509
1510
|
a.number().transform((e) => new d(e)),
|
|
1510
1511
|
a.bigint().transform((e) => new d(e)),
|
|
1511
1512
|
a.date().transform((e) => new d(e)),
|
|
1512
|
-
a.custom((e) => e instanceof
|
|
1513
|
-
|
|
1513
|
+
a.custom((e) => e instanceof f).transform((e) => new d(e)),
|
|
1514
|
+
xi.transform((e) => new d(e))
|
|
1514
1515
|
]);
|
|
1515
1516
|
/**
|
|
1516
1517
|
* Sorts two timestamps.
|
|
@@ -1524,7 +1525,7 @@ let b = class d extends J {
|
|
|
1524
1525
|
return Number(e.valueOf() - r.valueOf());
|
|
1525
1526
|
}
|
|
1526
1527
|
};
|
|
1527
|
-
class
|
|
1528
|
+
class f extends J {
|
|
1528
1529
|
constructor(e) {
|
|
1529
1530
|
typeof e == "number" && (e = Math.trunc(e.valueOf())), super(BigInt(e.valueOf()));
|
|
1530
1531
|
}
|
|
@@ -1535,7 +1536,7 @@ class h extends J {
|
|
|
1535
1536
|
* @returns A TimeSpan representing the given number of seconds.
|
|
1536
1537
|
*/
|
|
1537
1538
|
static fromSeconds(e) {
|
|
1538
|
-
return e instanceof
|
|
1539
|
+
return e instanceof f ? e : e instanceof Lt ? e.period : e instanceof b ? new f(e) : ["number", "bigint"].includes(typeof e) ? f.seconds(e) : new f(e);
|
|
1539
1540
|
}
|
|
1540
1541
|
/**
|
|
1541
1542
|
* Creates a TimeSpan representing the given number of milliseconds.
|
|
@@ -1544,7 +1545,7 @@ class h extends J {
|
|
|
1544
1545
|
* @returns A TimeSpan representing the given number of milliseconds.
|
|
1545
1546
|
*/
|
|
1546
1547
|
static fromMilliseconds(e) {
|
|
1547
|
-
return e instanceof
|
|
1548
|
+
return e instanceof f ? e : e instanceof Lt ? e.period : e instanceof b ? new f(e) : ["number", "bigint"].includes(typeof e) ? f.milliseconds(e) : new f(e);
|
|
1548
1549
|
}
|
|
1549
1550
|
/**
|
|
1550
1551
|
* @returns the primitive value of the TimeSpan. Overrides standard JS valueOf()
|
|
@@ -1560,7 +1561,7 @@ class h extends J {
|
|
|
1560
1561
|
* @returns True if the TimeSpan is less than the other TimeSpan, false otherwise.
|
|
1561
1562
|
*/
|
|
1562
1563
|
lessThan(e) {
|
|
1563
|
-
return this.valueOf() < new
|
|
1564
|
+
return this.valueOf() < new f(e).valueOf();
|
|
1564
1565
|
}
|
|
1565
1566
|
/**
|
|
1566
1567
|
* Checks if the TimeSpan is greater than another TimeSpan.
|
|
@@ -1569,7 +1570,7 @@ class h extends J {
|
|
|
1569
1570
|
* @returns True if the TimeSpan is greater than the other TimeSpan, false otherwise.
|
|
1570
1571
|
*/
|
|
1571
1572
|
greaterThan(e) {
|
|
1572
|
-
return this.valueOf() > new
|
|
1573
|
+
return this.valueOf() > new f(e).valueOf();
|
|
1573
1574
|
}
|
|
1574
1575
|
/**
|
|
1575
1576
|
* Checks if the TimeSpan is less than or equal to another TimeSpan.
|
|
@@ -1578,7 +1579,7 @@ class h extends J {
|
|
|
1578
1579
|
* @returns True if the TimeSpan is less than or equal to the other TimeSpan, false otherwise.
|
|
1579
1580
|
*/
|
|
1580
1581
|
lessThanOrEqual(e) {
|
|
1581
|
-
return this.valueOf() <= new
|
|
1582
|
+
return this.valueOf() <= new f(e).valueOf();
|
|
1582
1583
|
}
|
|
1583
1584
|
/**
|
|
1584
1585
|
* Checks if the TimeSpan is greater than or equal to another TimeSpan.
|
|
@@ -1587,7 +1588,7 @@ class h extends J {
|
|
|
1587
1588
|
* @returns True if the TimeSpan is greater than or equal to the other TimeSpan, false otherwise.
|
|
1588
1589
|
*/
|
|
1589
1590
|
greaterThanOrEqual(e) {
|
|
1590
|
-
return this.valueOf() >= new
|
|
1591
|
+
return this.valueOf() >= new f(e).valueOf();
|
|
1591
1592
|
}
|
|
1592
1593
|
/**
|
|
1593
1594
|
* Calculates the remainder of the TimeSpan when divided by another TimeSpan.
|
|
@@ -1596,7 +1597,7 @@ class h extends J {
|
|
|
1596
1597
|
* @returns A new TimeSpan representing the remainder.
|
|
1597
1598
|
*/
|
|
1598
1599
|
remainder(e) {
|
|
1599
|
-
return
|
|
1600
|
+
return vr(this, e);
|
|
1600
1601
|
}
|
|
1601
1602
|
/**
|
|
1602
1603
|
* Truncates the TimeSpan to the nearest multiple of the given span.
|
|
@@ -1605,7 +1606,7 @@ class h extends J {
|
|
|
1605
1606
|
* @returns A new TimeSpan that is truncated to the nearest multiple of the given span.
|
|
1606
1607
|
*/
|
|
1607
1608
|
truncate(e) {
|
|
1608
|
-
return new
|
|
1609
|
+
return new f(
|
|
1609
1610
|
BigInt(Math.trunc(Number(this.valueOf() / e.valueOf()))) * e.valueOf()
|
|
1610
1611
|
);
|
|
1611
1612
|
}
|
|
@@ -1615,9 +1616,9 @@ class h extends J {
|
|
|
1615
1616
|
* @returns A string representation of the TimeSpan.
|
|
1616
1617
|
*/
|
|
1617
1618
|
toString() {
|
|
1618
|
-
const e = this.truncate(
|
|
1619
|
+
const e = this.truncate(f.DAY), r = this.truncate(f.HOUR), n = this.truncate(f.MINUTE), s = this.truncate(f.SECOND), i = this.truncate(f.MILLISECOND), o = this.truncate(f.MICROSECOND), c = this.truncate(f.NANOSECOND), l = e, h = r.sub(e), g = n.sub(r), p = s.sub(n), S = i.sub(s), E = o.sub(i), te = c.sub(o);
|
|
1619
1620
|
let R = "";
|
|
1620
|
-
return l.isZero || (R += `${l.days}d `),
|
|
1621
|
+
return l.isZero || (R += `${l.days}d `), h.isZero || (R += `${h.hours}h `), g.isZero || (R += `${g.minutes}m `), p.isZero || (R += `${p.seconds}s `), S.isZero || (R += `${S.milliseconds}ms `), E.isZero || (R += `${E.microseconds}µs `), te.isZero || (R += `${te.nanoseconds}ns`), R.trim();
|
|
1621
1622
|
}
|
|
1622
1623
|
/**
|
|
1623
1624
|
* Multiplies the TimeSpan by a scalar value.
|
|
@@ -1626,31 +1627,31 @@ class h extends J {
|
|
|
1626
1627
|
* @returns A new TimeSpan that is this TimeSpan multiplied by the provided value.
|
|
1627
1628
|
*/
|
|
1628
1629
|
mult(e) {
|
|
1629
|
-
return new
|
|
1630
|
+
return new f(this.valueOf() * BigInt(e));
|
|
1630
1631
|
}
|
|
1631
1632
|
/** @returns the decimal number of days in the TimeSpan. */
|
|
1632
1633
|
get days() {
|
|
1633
|
-
return Number(this.valueOf()) / Number(
|
|
1634
|
+
return Number(this.valueOf()) / Number(f.DAY.valueOf());
|
|
1634
1635
|
}
|
|
1635
1636
|
/** @returns the decimal number of hours in the TimeSpan. */
|
|
1636
1637
|
get hours() {
|
|
1637
|
-
return Number(this.valueOf()) / Number(
|
|
1638
|
+
return Number(this.valueOf()) / Number(f.HOUR.valueOf());
|
|
1638
1639
|
}
|
|
1639
1640
|
/** @returns the decimal number of minutes in the TimeSpan. */
|
|
1640
1641
|
get minutes() {
|
|
1641
|
-
return Number(this.valueOf()) / Number(
|
|
1642
|
+
return Number(this.valueOf()) / Number(f.MINUTE.valueOf());
|
|
1642
1643
|
}
|
|
1643
1644
|
/** @returns The number of seconds in the TimeSpan. */
|
|
1644
1645
|
get seconds() {
|
|
1645
|
-
return Number(this.valueOf()) / Number(
|
|
1646
|
+
return Number(this.valueOf()) / Number(f.SECOND.valueOf());
|
|
1646
1647
|
}
|
|
1647
1648
|
/** @returns The number of milliseconds in the TimeSpan. */
|
|
1648
1649
|
get milliseconds() {
|
|
1649
|
-
return Number(this.valueOf()) / Number(
|
|
1650
|
+
return Number(this.valueOf()) / Number(f.MILLISECOND.valueOf());
|
|
1650
1651
|
}
|
|
1651
1652
|
/** @returns The number of microseconds in the TimeSpan. */
|
|
1652
1653
|
get microseconds() {
|
|
1653
|
-
return Number(this.valueOf()) / Number(
|
|
1654
|
+
return Number(this.valueOf()) / Number(f.MICROSECOND.valueOf());
|
|
1654
1655
|
}
|
|
1655
1656
|
/** @returns The number of nanoseconds in the TimeSpan. */
|
|
1656
1657
|
get nanoseconds() {
|
|
@@ -1670,7 +1671,7 @@ class h extends J {
|
|
|
1670
1671
|
* @returns True if the TimeSpans are equal, false otherwise.
|
|
1671
1672
|
*/
|
|
1672
1673
|
equals(e) {
|
|
1673
|
-
return this.valueOf() === new
|
|
1674
|
+
return this.valueOf() === new f(e).valueOf();
|
|
1674
1675
|
}
|
|
1675
1676
|
/**
|
|
1676
1677
|
* Adds a TimeSpan to the TimeSpan.
|
|
@@ -1678,7 +1679,7 @@ class h extends J {
|
|
|
1678
1679
|
* @returns A new TimeSpan representing the sum of the two TimeSpans.
|
|
1679
1680
|
*/
|
|
1680
1681
|
add(e) {
|
|
1681
|
-
return new
|
|
1682
|
+
return new f(this.valueOf() + new f(e).valueOf());
|
|
1682
1683
|
}
|
|
1683
1684
|
/**
|
|
1684
1685
|
* Creates a TimeSpan representing the duration between the two timestamps.
|
|
@@ -1686,7 +1687,7 @@ class h extends J {
|
|
|
1686
1687
|
* @param other
|
|
1687
1688
|
*/
|
|
1688
1689
|
sub(e) {
|
|
1689
|
-
return new
|
|
1690
|
+
return new f(this.valueOf() - new f(e).valueOf());
|
|
1690
1691
|
}
|
|
1691
1692
|
/**
|
|
1692
1693
|
* Creates a TimeSpan representing the given number of nanoseconds.
|
|
@@ -1695,10 +1696,10 @@ class h extends J {
|
|
|
1695
1696
|
* @returns A TimeSpan representing the given number of nanoseconds.
|
|
1696
1697
|
*/
|
|
1697
1698
|
static nanoseconds(e = 1) {
|
|
1698
|
-
return new
|
|
1699
|
+
return new f(e);
|
|
1699
1700
|
}
|
|
1700
1701
|
/** A nanosecond. */
|
|
1701
|
-
static NANOSECOND =
|
|
1702
|
+
static NANOSECOND = f.nanoseconds(1);
|
|
1702
1703
|
/**
|
|
1703
1704
|
* Creates a TimeSpan representing the given number of microseconds.
|
|
1704
1705
|
*
|
|
@@ -1706,10 +1707,10 @@ class h extends J {
|
|
|
1706
1707
|
* @returns A TimeSpan representing the given number of microseconds.
|
|
1707
1708
|
*/
|
|
1708
1709
|
static microseconds(e = 1) {
|
|
1709
|
-
return
|
|
1710
|
+
return f.nanoseconds(Y(e, 1e3));
|
|
1710
1711
|
}
|
|
1711
1712
|
/** A microsecond. */
|
|
1712
|
-
static MICROSECOND =
|
|
1713
|
+
static MICROSECOND = f.microseconds(1);
|
|
1713
1714
|
/**
|
|
1714
1715
|
* Creates a TimeSpan representing the given number of milliseconds.
|
|
1715
1716
|
*
|
|
@@ -1717,10 +1718,10 @@ class h extends J {
|
|
|
1717
1718
|
* @returns A TimeSpan representing the given number of milliseconds.
|
|
1718
1719
|
*/
|
|
1719
1720
|
static milliseconds(e = 1) {
|
|
1720
|
-
return
|
|
1721
|
+
return f.microseconds(Y(e, 1e3));
|
|
1721
1722
|
}
|
|
1722
1723
|
/** A millisecond. */
|
|
1723
|
-
static MILLISECOND =
|
|
1724
|
+
static MILLISECOND = f.milliseconds(1);
|
|
1724
1725
|
/**
|
|
1725
1726
|
* Creates a TimeSpan representing the given number of seconds.
|
|
1726
1727
|
*
|
|
@@ -1728,10 +1729,10 @@ class h extends J {
|
|
|
1728
1729
|
* @returns A TimeSpan representing the given number of seconds.
|
|
1729
1730
|
*/
|
|
1730
1731
|
static seconds(e = 1) {
|
|
1731
|
-
return
|
|
1732
|
+
return f.milliseconds(Y(e, 1e3));
|
|
1732
1733
|
}
|
|
1733
1734
|
/** A second. */
|
|
1734
|
-
static SECOND =
|
|
1735
|
+
static SECOND = f.seconds(1);
|
|
1735
1736
|
/**
|
|
1736
1737
|
* Creates a TimeSpan representing the given number of minutes.
|
|
1737
1738
|
*
|
|
@@ -1739,10 +1740,10 @@ class h extends J {
|
|
|
1739
1740
|
* @returns A TimeSpan representing the given number of minutes.
|
|
1740
1741
|
*/
|
|
1741
1742
|
static minutes(e = 1) {
|
|
1742
|
-
return
|
|
1743
|
+
return f.seconds(Y(e, 60));
|
|
1743
1744
|
}
|
|
1744
1745
|
/** A minute. */
|
|
1745
|
-
static MINUTE =
|
|
1746
|
+
static MINUTE = f.minutes(1);
|
|
1746
1747
|
/**
|
|
1747
1748
|
* Creates a TimeSpan representing the given number of hours.
|
|
1748
1749
|
*
|
|
@@ -1750,10 +1751,10 @@ class h extends J {
|
|
|
1750
1751
|
* @returns A TimeSpan representing the given number of hours.
|
|
1751
1752
|
*/
|
|
1752
1753
|
static hours(e) {
|
|
1753
|
-
return
|
|
1754
|
+
return f.minutes(Y(e, 60));
|
|
1754
1755
|
}
|
|
1755
1756
|
/** Represents an hour. */
|
|
1756
|
-
static HOUR =
|
|
1757
|
+
static HOUR = f.hours(1);
|
|
1757
1758
|
/**
|
|
1758
1759
|
* Creates a TimeSpan representing the given number of days.
|
|
1759
1760
|
*
|
|
@@ -1761,22 +1762,22 @@ class h extends J {
|
|
|
1761
1762
|
* @returns A TimeSpan representing the given number of days.
|
|
1762
1763
|
*/
|
|
1763
1764
|
static days(e) {
|
|
1764
|
-
return
|
|
1765
|
+
return f.hours(Y(e, 24));
|
|
1765
1766
|
}
|
|
1766
1767
|
/** Represents a day. */
|
|
1767
|
-
static DAY =
|
|
1768
|
+
static DAY = f.days(1);
|
|
1768
1769
|
/** The maximum possible value for a TimeSpan. */
|
|
1769
|
-
static MAX = new
|
|
1770
|
+
static MAX = new f((1n << 63n) - 1n);
|
|
1770
1771
|
/** The minimum possible value for a TimeSpan. */
|
|
1771
|
-
static MIN = new
|
|
1772
|
+
static MIN = new f(0);
|
|
1772
1773
|
/** The zero value for a TimeSpan. */
|
|
1773
|
-
static ZERO = new
|
|
1774
|
+
static ZERO = new f(0);
|
|
1774
1775
|
/** A zod schema for validating and transforming timespans */
|
|
1775
1776
|
static z = a.union([
|
|
1776
|
-
a.object({ value: a.bigint() }).transform((e) => new
|
|
1777
|
-
a.string().transform((e) => new
|
|
1778
|
-
a.number().transform((e) => new
|
|
1779
|
-
a.instanceof(
|
|
1777
|
+
a.object({ value: a.bigint() }).transform((e) => new f(e.value)),
|
|
1778
|
+
a.string().transform((e) => new f(BigInt(e))),
|
|
1779
|
+
a.number().transform((e) => new f(e)),
|
|
1780
|
+
a.instanceof(f)
|
|
1780
1781
|
]);
|
|
1781
1782
|
}
|
|
1782
1783
|
let Lt = class Q extends J {
|
|
@@ -1797,7 +1798,7 @@ let Lt = class Q extends J {
|
|
|
1797
1798
|
* @returns A TimeSpan representing the period of the Rate.
|
|
1798
1799
|
*/
|
|
1799
1800
|
get period() {
|
|
1800
|
-
return
|
|
1801
|
+
return f.seconds(1 / this.valueOf());
|
|
1801
1802
|
}
|
|
1802
1803
|
/**
|
|
1803
1804
|
* Calculates the number of samples in the given TimeSpan at this rate.
|
|
@@ -1806,7 +1807,7 @@ let Lt = class Q extends J {
|
|
|
1806
1807
|
* @returns The number of samples in the given TimeSpan at this rate.
|
|
1807
1808
|
*/
|
|
1808
1809
|
sampleCount(e) {
|
|
1809
|
-
return new
|
|
1810
|
+
return new f(e).seconds * this.valueOf();
|
|
1810
1811
|
}
|
|
1811
1812
|
/**
|
|
1812
1813
|
* Calculates the number of bytes in the given TimeSpan at this rate.
|
|
@@ -1825,7 +1826,7 @@ let Lt = class Q extends J {
|
|
|
1825
1826
|
* @returns A TimeSpan that corresponds to the given number of samples.
|
|
1826
1827
|
*/
|
|
1827
1828
|
span(e) {
|
|
1828
|
-
return
|
|
1829
|
+
return f.seconds(e / this.valueOf());
|
|
1829
1830
|
}
|
|
1830
1831
|
/**
|
|
1831
1832
|
* Calculates a TimeSpan given the number of bytes at this rate.
|
|
@@ -1936,7 +1937,7 @@ let Lt = class Q extends J {
|
|
|
1936
1937
|
}
|
|
1937
1938
|
/** @returns The TimeSpan occupied by the TimeRange. */
|
|
1938
1939
|
get span() {
|
|
1939
|
-
return new
|
|
1940
|
+
return new f(this.end.valueOf() - this.start.valueOf());
|
|
1940
1941
|
}
|
|
1941
1942
|
/**
|
|
1942
1943
|
* Checks if the timestamp is valid i.e. the start is before the end.
|
|
@@ -1988,7 +1989,7 @@ let Lt = class Q extends J {
|
|
|
1988
1989
|
* @param other - The TimeRange to compare to.
|
|
1989
1990
|
* @returns True if the TimeRange is equal to the given TimeRange.
|
|
1990
1991
|
*/
|
|
1991
|
-
equals(e, r =
|
|
1992
|
+
equals(e, r = f.ZERO) {
|
|
1992
1993
|
if (r.isZero)
|
|
1993
1994
|
return this.start.equals(e.start) && this.end.equals(e.end);
|
|
1994
1995
|
let n = this.start.sub(e.start).valueOf(), s = this.end.sub(e.end).valueOf();
|
|
@@ -2021,13 +2022,13 @@ let Lt = class Q extends J {
|
|
|
2021
2022
|
* checking for overlap.
|
|
2022
2023
|
* @returns True if the two TimeRanges overlap, false otherwise.
|
|
2023
2024
|
*/
|
|
2024
|
-
overlapsWith(e, r =
|
|
2025
|
+
overlapsWith(e, r = f.ZERO) {
|
|
2025
2026
|
e = e.makeValid();
|
|
2026
2027
|
const n = this.makeValid();
|
|
2027
2028
|
if (this.equals(e)) return !0;
|
|
2028
2029
|
if (e.end.equals(n.start) || n.end.equals(e.start)) return !1;
|
|
2029
2030
|
const s = b.max(n.start, e.start), i = b.min(n.end, e.end);
|
|
2030
|
-
return i.before(s) ? !1 : new
|
|
2031
|
+
return i.before(s) ? !1 : new f(i.sub(s)).greaterThanOrEqual(r);
|
|
2031
2032
|
}
|
|
2032
2033
|
contains(e) {
|
|
2033
2034
|
return e instanceof B ? this.contains(e.start) && this.contains(e.end) : this.start.beforeEq(e) && this.end.after(e);
|
|
@@ -2343,9 +2344,9 @@ class m extends J {
|
|
|
2343
2344
|
}
|
|
2344
2345
|
/** @returns a nicely formatted string representation of the Size. */
|
|
2345
2346
|
toString() {
|
|
2346
|
-
const e = this.truncate(m.TERABYTE), r = this.truncate(m.GIGABYTE), n = this.truncate(m.MEGABYTE), s = this.truncate(m.KILOBYTE), i = this.truncate(m.BYTE), o = e, c = r.sub(e), l = n.sub(r),
|
|
2347
|
-
let
|
|
2348
|
-
return o.isZero || (
|
|
2347
|
+
const e = this.truncate(m.TERABYTE), r = this.truncate(m.GIGABYTE), n = this.truncate(m.MEGABYTE), s = this.truncate(m.KILOBYTE), i = this.truncate(m.BYTE), o = e, c = r.sub(e), l = n.sub(r), h = s.sub(n), g = i.sub(s);
|
|
2348
|
+
let p = "";
|
|
2349
|
+
return o.isZero || (p += `${o.terabytes}TB `), c.isZero || (p += `${c.gigabytes}GB `), l.isZero || (p += `${l.megabytes}MB `), h.isZero || (p += `${h.kilobytes}KB `), (!g.isZero || p === "") && (p += `${g.valueOf()}B`), p.trim();
|
|
2349
2350
|
}
|
|
2350
2351
|
/**
|
|
2351
2352
|
* Creates a Size from the given number of bytes.
|
|
@@ -2414,7 +2415,7 @@ class m extends J {
|
|
|
2414
2415
|
return this.valueOf() === 0;
|
|
2415
2416
|
}
|
|
2416
2417
|
}
|
|
2417
|
-
const
|
|
2418
|
+
const So = a.union([
|
|
2418
2419
|
a.instanceof(Uint8Array),
|
|
2419
2420
|
a.instanceof(Uint16Array),
|
|
2420
2421
|
a.instanceof(Uint32Array),
|
|
@@ -2425,40 +2426,40 @@ const vo = a.union([
|
|
|
2425
2426
|
a.instanceof(Int16Array),
|
|
2426
2427
|
a.instanceof(Int32Array),
|
|
2427
2428
|
a.instanceof(BigInt64Array)
|
|
2428
|
-
]),
|
|
2429
|
+
]), Tr = (t) => {
|
|
2429
2430
|
const e = typeof t;
|
|
2430
|
-
return e === "string" || e === "number" || e === "boolean" || e === "bigint" || t instanceof b || t instanceof
|
|
2431
|
-
},
|
|
2432
|
-
function
|
|
2433
|
-
return typeof t == "string" &&
|
|
2431
|
+
return e === "string" || e === "number" || e === "boolean" || e === "bigint" || t instanceof b || t instanceof f || t instanceof Date;
|
|
2432
|
+
}, $i = (t, e, r, n = 0) => t.usesBigInt && !e.usesBigInt ? Number(r) - Number(n) : !t.usesBigInt && e.usesBigInt ? BigInt(r.valueOf()) - BigInt(n.valueOf()) : Me(r, -n), Me = (t, e) => e == 0 ? t : t == 0 ? e : typeof t == "bigint" && typeof e == "bigint" || typeof t == "number" && typeof e == "number" ? t + e : Number(t) + Number(e), Si = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
|
|
2433
|
+
function Ni(t) {
|
|
2434
|
+
return typeof t == "string" && Si.test(t);
|
|
2434
2435
|
}
|
|
2435
2436
|
const $ = [];
|
|
2436
2437
|
for (let t = 0; t < 256; ++t)
|
|
2437
2438
|
$.push((t + 256).toString(16).slice(1));
|
|
2438
|
-
function
|
|
2439
|
+
function Ii(t, e = 0) {
|
|
2439
2440
|
return ($[t[e + 0]] + $[t[e + 1]] + $[t[e + 2]] + $[t[e + 3]] + "-" + $[t[e + 4]] + $[t[e + 5]] + "-" + $[t[e + 6]] + $[t[e + 7]] + "-" + $[t[e + 8]] + $[t[e + 9]] + "-" + $[t[e + 10]] + $[t[e + 11]] + $[t[e + 12]] + $[t[e + 13]] + $[t[e + 14]] + $[t[e + 15]]).toLowerCase();
|
|
2440
2441
|
}
|
|
2441
|
-
function
|
|
2442
|
-
const r =
|
|
2443
|
-
if (!
|
|
2442
|
+
function Mi(t, e = 0) {
|
|
2443
|
+
const r = Ii(t, e);
|
|
2444
|
+
if (!Ni(r))
|
|
2444
2445
|
throw TypeError("Stringified UUID is invalid");
|
|
2445
2446
|
return r;
|
|
2446
2447
|
}
|
|
2447
2448
|
typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
2448
|
-
const
|
|
2449
|
+
const xr = (t, e) => Mi(t, e), L = -1, it = {
|
|
2449
2450
|
[Symbol.iterator]: () => it,
|
|
2450
2451
|
next: () => ({ done: !0, value: void 0 })
|
|
2451
|
-
},
|
|
2452
|
+
}, Ei = a.string().transform(
|
|
2452
2453
|
(t) => new Uint8Array(
|
|
2453
2454
|
atob(t).split("").map((e) => e.charCodeAt(0))
|
|
2454
2455
|
).buffer
|
|
2455
|
-
),
|
|
2456
|
+
), Ai = a.union([a.null(), a.undefined()]).transform(() => new Uint8Array().buffer), at = 10, $r = (t, e) => {
|
|
2456
2457
|
if (t === "number" && !e.isNumeric)
|
|
2457
2458
|
throw new Error(`cannot convert series of type ${e.toString()} to number`);
|
|
2458
2459
|
if (t === "bigint" && !e.usesBigInt)
|
|
2459
2460
|
throw new Error(`cannot convert series of type ${e.toString()} to bigint`);
|
|
2460
|
-
},
|
|
2461
|
-
let
|
|
2461
|
+
}, Sr = "sy_x_telem_series";
|
|
2462
|
+
let Nr = class D {
|
|
2462
2463
|
/**
|
|
2463
2464
|
* A unique identifier for the series. If specified by the user, it is their
|
|
2464
2465
|
* responsibility to ensure that it is unique. If not specified, a new ID will be
|
|
@@ -2469,7 +2470,7 @@ let Sr = class D {
|
|
|
2469
2470
|
* A discriminator used for identifying instances of the series class even
|
|
2470
2471
|
* when bundlers mangle the class name.
|
|
2471
2472
|
*/
|
|
2472
|
-
discriminator =
|
|
2473
|
+
discriminator = Sr;
|
|
2473
2474
|
/** The data type of the series. */
|
|
2474
2475
|
dataType;
|
|
2475
2476
|
/**
|
|
@@ -2512,12 +2513,12 @@ let Sr = class D {
|
|
|
2512
2513
|
dataType: T.z,
|
|
2513
2514
|
alignment: a.coerce.bigint().optional(),
|
|
2514
2515
|
data: a.union([
|
|
2515
|
-
Mi,
|
|
2516
2516
|
Ei,
|
|
2517
|
+
Ai,
|
|
2517
2518
|
a.instanceof(ArrayBuffer),
|
|
2518
2519
|
a.instanceof(Uint8Array)
|
|
2519
2520
|
]),
|
|
2520
|
-
glBufferUsage:
|
|
2521
|
+
glBufferUsage: Ti.optional().default("static").optional()
|
|
2521
2522
|
});
|
|
2522
2523
|
/**
|
|
2523
2524
|
* A zod schema that validates and constructs a series from it's crude
|
|
@@ -2598,7 +2599,7 @@ let Sr = class D {
|
|
|
2598
2599
|
* @throws Error if data type cannot be inferred from input
|
|
2599
2600
|
*/
|
|
2600
2601
|
constructor(e) {
|
|
2601
|
-
|
|
2602
|
+
Bi(e) && (e = { data: e }), e.data ??= [];
|
|
2602
2603
|
const {
|
|
2603
2604
|
dataType: r,
|
|
2604
2605
|
timeRange: n,
|
|
@@ -2608,57 +2609,57 @@ let Sr = class D {
|
|
|
2608
2609
|
key: c = At(),
|
|
2609
2610
|
data: l
|
|
2610
2611
|
} = e;
|
|
2611
|
-
if (
|
|
2612
|
-
const
|
|
2613
|
-
this.key =
|
|
2612
|
+
if (Ir(l)) {
|
|
2613
|
+
const p = l;
|
|
2614
|
+
this.key = p.key, this.dataType = p.dataType, this.sampleOffset = p.sampleOffset, this.gl = p.gl, this._data = p._data, this.timeRange = p.timeRange, this.alignment = p.alignment, this.cachedMin = p.cachedMin, this.cachedMax = p.cachedMax, this.writePos = p.writePos, this._refCount = p._refCount, this.cachedLength = p.cachedLength;
|
|
2614
2615
|
return;
|
|
2615
2616
|
}
|
|
2616
|
-
const
|
|
2617
|
+
const h = Tr(l), g = Array.isArray(l);
|
|
2617
2618
|
if (r != null) this.dataType = new T(r);
|
|
2618
2619
|
else {
|
|
2619
2620
|
if (l instanceof ArrayBuffer)
|
|
2620
2621
|
throw new Error(
|
|
2621
2622
|
"cannot infer data type from an ArrayBuffer instance when constructing a Series. Please provide a data type."
|
|
2622
2623
|
);
|
|
2623
|
-
if (
|
|
2624
|
-
let
|
|
2625
|
-
if (!
|
|
2624
|
+
if (g || h) {
|
|
2625
|
+
let p = l;
|
|
2626
|
+
if (!h) {
|
|
2626
2627
|
if (l.length === 0)
|
|
2627
2628
|
throw new Error(
|
|
2628
2629
|
"cannot infer data type from a zero length JS array when constructing a Series. Please provide a data type."
|
|
2629
2630
|
);
|
|
2630
|
-
|
|
2631
|
+
p = l[0];
|
|
2631
2632
|
}
|
|
2632
|
-
if (typeof
|
|
2633
|
-
else if (typeof
|
|
2634
|
-
else if (typeof
|
|
2635
|
-
else if (typeof
|
|
2636
|
-
else if (
|
|
2633
|
+
if (typeof p == "string") this.dataType = T.STRING;
|
|
2634
|
+
else if (typeof p == "number") this.dataType = T.FLOAT64;
|
|
2635
|
+
else if (typeof p == "bigint") this.dataType = T.INT64;
|
|
2636
|
+
else if (typeof p == "boolean") this.dataType = T.BOOLEAN;
|
|
2637
|
+
else if (p instanceof b || p instanceof Date || p instanceof b)
|
|
2637
2638
|
this.dataType = T.TIMESTAMP;
|
|
2638
|
-
else if (typeof
|
|
2639
|
+
else if (typeof p == "object") this.dataType = T.JSON;
|
|
2639
2640
|
else
|
|
2640
2641
|
throw new Error(
|
|
2641
|
-
`cannot infer data type of ${typeof
|
|
2642
|
+
`cannot infer data type of ${typeof p} when constructing a Series from a JS array`
|
|
2642
2643
|
);
|
|
2643
2644
|
} else this.dataType = new T(l);
|
|
2644
2645
|
}
|
|
2645
|
-
if (!
|
|
2646
|
-
else if (
|
|
2646
|
+
if (!g && !h) this._data = l;
|
|
2647
|
+
else if (g && l.length === 0)
|
|
2647
2648
|
this._data = new this.dataType.Array([]).buffer;
|
|
2648
2649
|
else {
|
|
2649
|
-
let
|
|
2650
|
-
const S =
|
|
2651
|
-
(S instanceof b || S instanceof Date || S instanceof
|
|
2650
|
+
let p = h ? [l] : l;
|
|
2651
|
+
const S = p[0];
|
|
2652
|
+
(S instanceof b || S instanceof Date || S instanceof f) && (p = p.map((E) => new b(E).valueOf())), this.dataType.equals(T.STRING) ? (this.cachedLength = p.length, this._data = new TextEncoder().encode(`${p.join(`
|
|
2652
2653
|
`)}
|
|
2653
|
-
`).buffer) : this.dataType.equals(T.JSON) ? (this.cachedLength =
|
|
2654
|
-
`${
|
|
2654
|
+
`).buffer) : this.dataType.equals(T.JSON) ? (this.cachedLength = p.length, this._data = new TextEncoder().encode(
|
|
2655
|
+
`${p.map((E) => He.encodeString(E)).join(`
|
|
2655
2656
|
`)}
|
|
2656
2657
|
`
|
|
2657
2658
|
).buffer) : this.dataType.usesBigInt && typeof S == "number" ? this._data = new this.dataType.Array(
|
|
2658
|
-
|
|
2659
|
+
p.map((E) => BigInt(Math.round(E)))
|
|
2659
2660
|
).buffer : !this.dataType.usesBigInt && typeof S == "bigint" ? this._data = new this.dataType.Array(
|
|
2660
|
-
|
|
2661
|
-
).buffer : this._data = new this.dataType.Array(
|
|
2661
|
+
p.map(Number)
|
|
2662
|
+
).buffer : this._data = new this.dataType.Array(p).buffer;
|
|
2662
2663
|
}
|
|
2663
2664
|
this.key = c, this.alignment = o, this.sampleOffset = s ?? 0, this.timeRange = n ?? V.ZERO, this.gl = {
|
|
2664
2665
|
control: null,
|
|
@@ -2824,7 +2825,7 @@ let Sr = class D {
|
|
|
2824
2825
|
if (this.dataType.equals(e)) return this;
|
|
2825
2826
|
const n = new e.Array(this.length);
|
|
2826
2827
|
for (let s = 0; s < this.length; s++)
|
|
2827
|
-
n[s] =
|
|
2828
|
+
n[s] = $i(this.dataType, e, this.data[s], r);
|
|
2828
2829
|
return new D({
|
|
2829
2830
|
data: n.buffer,
|
|
2830
2831
|
dataType: e,
|
|
@@ -2912,7 +2913,7 @@ let Sr = class D {
|
|
|
2912
2913
|
}
|
|
2913
2914
|
atUUID(e, r) {
|
|
2914
2915
|
e < 0 && (e = this.length + e);
|
|
2915
|
-
const n =
|
|
2916
|
+
const n = xr(
|
|
2916
2917
|
new Uint8Array(this.buffer, e * this.dataType.density.valueOf())
|
|
2917
2918
|
);
|
|
2918
2919
|
if (n == null) {
|
|
@@ -2982,7 +2983,7 @@ let Sr = class D {
|
|
|
2982
2983
|
), this.gl.prevBuffer = L;
|
|
2983
2984
|
}
|
|
2984
2985
|
as(e) {
|
|
2985
|
-
return
|
|
2986
|
+
return $r(e, this.dataType), this;
|
|
2986
2987
|
}
|
|
2987
2988
|
/** @returns a digest containing information about the series. */
|
|
2988
2989
|
get digest() {
|
|
@@ -3026,10 +3027,10 @@ let Sr = class D {
|
|
|
3026
3027
|
}
|
|
3027
3028
|
[Symbol.iterator]() {
|
|
3028
3029
|
if (this.dataType.isVariable) {
|
|
3029
|
-
const e = new
|
|
3030
|
-
return this.dataType.equals(T.JSON) ? new
|
|
3030
|
+
const e = new Ui(this);
|
|
3031
|
+
return this.dataType.equals(T.JSON) ? new Ci(e) : e;
|
|
3031
3032
|
}
|
|
3032
|
-
return this.dataType.equals(T.UUID) ? new
|
|
3033
|
+
return this.dataType.equals(T.UUID) ? new ji(this) : new Ri(this);
|
|
3033
3034
|
}
|
|
3034
3035
|
/**
|
|
3035
3036
|
* Returns a slice of the series from start to end.
|
|
@@ -3128,7 +3129,7 @@ let Sr = class D {
|
|
|
3128
3129
|
return e += "])", e;
|
|
3129
3130
|
}
|
|
3130
3131
|
};
|
|
3131
|
-
const
|
|
3132
|
+
const Bi = (t) => t == null ? !1 : Array.isArray(t) || t instanceof ArrayBuffer || ArrayBuffer.isView(t) && !(t instanceof DataView) || t instanceof Nr ? !0 : Tr(t), Ir = vi(Sr, Nr);
|
|
3132
3133
|
let Dt = class {
|
|
3133
3134
|
series;
|
|
3134
3135
|
end;
|
|
@@ -3142,7 +3143,7 @@ let Dt = class {
|
|
|
3142
3143
|
return this.index >= this.end ? { done: !0, value: void 0 } : { done: !1, value: this.series.at(this.index++, !0) };
|
|
3143
3144
|
}
|
|
3144
3145
|
};
|
|
3145
|
-
class
|
|
3146
|
+
class Ui {
|
|
3146
3147
|
series;
|
|
3147
3148
|
index;
|
|
3148
3149
|
decoder;
|
|
@@ -3160,7 +3161,7 @@ class Bi {
|
|
|
3160
3161
|
return e === n ? { done: !0, value: void 0 } : (this.index++, { done: !1, value: this.decoder.decode(this.series.buffer.slice(e, n)) });
|
|
3161
3162
|
}
|
|
3162
3163
|
}
|
|
3163
|
-
let
|
|
3164
|
+
let Ci = class Mr {
|
|
3164
3165
|
wrapped;
|
|
3165
3166
|
static schema = a.record(a.string(), a.unknown());
|
|
3166
3167
|
constructor(e) {
|
|
@@ -3170,10 +3171,10 @@ let Ui = class Ir {
|
|
|
3170
3171
|
const e = this.wrapped.next();
|
|
3171
3172
|
return e.done === !0 ? { done: !0, value: void 0 } : {
|
|
3172
3173
|
done: !1,
|
|
3173
|
-
value: He.decodeString(e.value,
|
|
3174
|
+
value: He.decodeString(e.value, Mr.schema)
|
|
3174
3175
|
};
|
|
3175
3176
|
}
|
|
3176
|
-
},
|
|
3177
|
+
}, ji = class {
|
|
3177
3178
|
series;
|
|
3178
3179
|
index;
|
|
3179
3180
|
data;
|
|
@@ -3185,10 +3186,10 @@ let Ui = class Ir {
|
|
|
3185
3186
|
}
|
|
3186
3187
|
next() {
|
|
3187
3188
|
if (this.index >= this.series.length) return { done: !0, value: void 0 };
|
|
3188
|
-
const e =
|
|
3189
|
+
const e = xr(this.data, this.index * this.density);
|
|
3189
3190
|
return this.index++, { done: !1, value: e };
|
|
3190
3191
|
}
|
|
3191
|
-
},
|
|
3192
|
+
}, Ri = class {
|
|
3192
3193
|
series;
|
|
3193
3194
|
index;
|
|
3194
3195
|
constructor(e) {
|
|
@@ -3200,7 +3201,7 @@ let Ui = class Ir {
|
|
|
3200
3201
|
value: this.series.at(this.index++, !0)
|
|
3201
3202
|
};
|
|
3202
3203
|
}
|
|
3203
|
-
},
|
|
3204
|
+
}, Eo = class {
|
|
3204
3205
|
/** The array of series in this collection */
|
|
3205
3206
|
series;
|
|
3206
3207
|
/**
|
|
@@ -3253,7 +3254,7 @@ let Ui = class Ir {
|
|
|
3253
3254
|
this.series = e;
|
|
3254
3255
|
}
|
|
3255
3256
|
as(e) {
|
|
3256
|
-
return
|
|
3257
|
+
return $r(e, this.dataType), this;
|
|
3257
3258
|
}
|
|
3258
3259
|
/**
|
|
3259
3260
|
* Returns the data type of the series in this collection. If the collection is empty,
|
|
@@ -3295,7 +3296,7 @@ let Ui = class Ir {
|
|
|
3295
3296
|
const r = () => new Error(
|
|
3296
3297
|
`cannot push a ${e.dataType.toString()} series to a ${this.dataType.toString()} multi-series`
|
|
3297
3298
|
), n = e.dataType.equals(this.dataType);
|
|
3298
|
-
if (
|
|
3299
|
+
if (Ir(e)) {
|
|
3299
3300
|
if (this.series.length !== 0 && !n) throw r();
|
|
3300
3301
|
this.series.push(e);
|
|
3301
3302
|
} else {
|
|
@@ -3397,7 +3398,7 @@ let Ui = class Ir {
|
|
|
3397
3398
|
* Returns the bounds containing the minimum and maximum values across all series.
|
|
3398
3399
|
*/
|
|
3399
3400
|
get bounds() {
|
|
3400
|
-
return
|
|
3401
|
+
return nr(this.series.map((e) => e.bounds));
|
|
3401
3402
|
}
|
|
3402
3403
|
/**
|
|
3403
3404
|
* Returns the sum of the byte lengths of all series.
|
|
@@ -3424,7 +3425,7 @@ let Ui = class Ir {
|
|
|
3424
3425
|
*/
|
|
3425
3426
|
traverseAlignment(e, r) {
|
|
3426
3427
|
const n = this.series.map((s) => s.alignmentBounds);
|
|
3427
|
-
return
|
|
3428
|
+
return sr(n, e, r);
|
|
3428
3429
|
}
|
|
3429
3430
|
/**
|
|
3430
3431
|
* Acquires a reference to the WebGL buffer for all series.
|
|
@@ -3447,7 +3448,7 @@ let Ui = class Ir {
|
|
|
3447
3448
|
*/
|
|
3448
3449
|
distance(e, r) {
|
|
3449
3450
|
const n = this.series.map((s) => s.alignmentBounds);
|
|
3450
|
-
return
|
|
3451
|
+
return ir(n, e, r);
|
|
3451
3452
|
}
|
|
3452
3453
|
/**
|
|
3453
3454
|
* Parses a JSON multi-series into an array of values using the provided zod schema.
|
|
@@ -3470,7 +3471,7 @@ let Ui = class Ir {
|
|
|
3470
3471
|
next() {
|
|
3471
3472
|
return { done: !0, value: void 0 };
|
|
3472
3473
|
}
|
|
3473
|
-
} : new
|
|
3474
|
+
} : new Li(this.series);
|
|
3474
3475
|
}
|
|
3475
3476
|
/**
|
|
3476
3477
|
* Returns an array of the values in the multi-series as strings.
|
|
@@ -3480,7 +3481,7 @@ let Ui = class Ir {
|
|
|
3480
3481
|
toStrings() {
|
|
3481
3482
|
return this.series.flatMap((e) => e.toStrings());
|
|
3482
3483
|
}
|
|
3483
|
-
},
|
|
3484
|
+
}, Li = class {
|
|
3484
3485
|
series;
|
|
3485
3486
|
seriesIndex;
|
|
3486
3487
|
internal;
|
|
@@ -3513,22 +3514,22 @@ const Pt = (t) => {
|
|
|
3513
3514
|
return { domain: e, sample: r };
|
|
3514
3515
|
};
|
|
3515
3516
|
a.object({ key: a.string(), value: a.string() });
|
|
3516
|
-
const
|
|
3517
|
+
const Di = a.record(
|
|
3517
3518
|
a.union([a.number(), a.string(), a.symbol()]),
|
|
3518
3519
|
a.unknown()
|
|
3519
|
-
), Bt = (t) => Object.entries(t),
|
|
3520
|
+
), Bt = (t) => Object.entries(t), Pi = (t, e) => Object.fromEntries(Bt(t).map(([r, n]) => [r, e(n, r)])), qi = (t) => Object.fromEntries(Bt(t).filter(([e, r]) => r !== void 0)), Co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3520
3521
|
__proto__: null,
|
|
3521
3522
|
entries: Bt,
|
|
3522
|
-
map:
|
|
3523
|
-
purgeUndefined:
|
|
3524
|
-
unknownZ:
|
|
3525
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
3523
|
+
map: Pi,
|
|
3524
|
+
purgeUndefined: qi,
|
|
3525
|
+
unknownZ: Di
|
|
3526
|
+
}, Symbol.toStringTag, { value: "Module" })), Er = () => typeof process < "u" && process.versions != null && process.versions.node != null ? "node" : typeof window > "u" || window.document === void 0 ? "webworker" : "browser", ki = Er(), Ar = ["macOS", "Windows", "Linux"], zi = ["macos", "windows", "linux"], Fi = {
|
|
3526
3527
|
macos: "macOS",
|
|
3527
3528
|
windows: "Windows",
|
|
3528
3529
|
linux: "Linux"
|
|
3529
|
-
},
|
|
3530
|
-
a.enum(
|
|
3531
|
-
),
|
|
3530
|
+
}, Zi = a.enum(Ar).or(
|
|
3531
|
+
a.enum(zi).transform((t) => Fi[t])
|
|
3532
|
+
), Yi = () => {
|
|
3532
3533
|
if (typeof window > "u") return;
|
|
3533
3534
|
const t = window.navigator.userAgent.toLowerCase();
|
|
3534
3535
|
if (t.includes("mac")) return "macOS";
|
|
@@ -3536,17 +3537,17 @@ const Li = a.record(
|
|
|
3536
3537
|
if (t.includes("linux")) return "Linux";
|
|
3537
3538
|
};
|
|
3538
3539
|
let Ve;
|
|
3539
|
-
const
|
|
3540
|
+
const Vi = (t = {}) => {
|
|
3540
3541
|
const { force: e, default: r } = t;
|
|
3541
|
-
return e ?? Ve ?? (Ve =
|
|
3542
|
-
},
|
|
3542
|
+
return e ?? Ve ?? (Ve = Yi(), Ve ?? r);
|
|
3543
|
+
}, jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3543
3544
|
__proto__: null,
|
|
3544
|
-
OPERATING_SYSTEMS:
|
|
3545
|
-
RUNTIME:
|
|
3546
|
-
detect:
|
|
3547
|
-
getOS:
|
|
3548
|
-
osZ:
|
|
3549
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
3545
|
+
OPERATING_SYSTEMS: Ar,
|
|
3546
|
+
RUNTIME: ki,
|
|
3547
|
+
detect: Er,
|
|
3548
|
+
getOS: Vi,
|
|
3549
|
+
osZ: Zi
|
|
3550
|
+
}, Symbol.toStringTag, { value: "Module" })), Wi = (...t) => t.map(Br).join(""), Br = (t) => (t.endsWith("/") || (t += "/"), t.startsWith("/") && (t = t.slice(1)), t), Gi = (t) => t.endsWith("/") ? t.slice(0, -1) : t;
|
|
3550
3551
|
class Ee {
|
|
3551
3552
|
protocol;
|
|
3552
3553
|
host;
|
|
@@ -3559,7 +3560,7 @@ class Ee {
|
|
|
3559
3560
|
* @param pathPrefix - A path prefix to use for all requests. Defaults to "".
|
|
3560
3561
|
*/
|
|
3561
3562
|
constructor({ host: e, port: r, protocol: n = "", pathPrefix: s = "" }) {
|
|
3562
|
-
this.protocol = n, this.host = e, this.port = r, this.path =
|
|
3563
|
+
this.protocol = n, this.host = e, this.port = r, this.path = Br(s);
|
|
3563
3564
|
}
|
|
3564
3565
|
/**
|
|
3565
3566
|
* Replaces creates a new URL with the specified properties replaced.
|
|
@@ -3582,77 +3583,77 @@ class Ee {
|
|
|
3582
3583
|
child(e) {
|
|
3583
3584
|
return new Ee({
|
|
3584
3585
|
...this,
|
|
3585
|
-
pathPrefix:
|
|
3586
|
+
pathPrefix: Wi(this.path, e)
|
|
3586
3587
|
});
|
|
3587
3588
|
}
|
|
3588
3589
|
/** @returns a string representation of the url */
|
|
3589
3590
|
toString() {
|
|
3590
|
-
return
|
|
3591
|
+
return Gi(
|
|
3591
3592
|
`${this.protocol}://${this.host}:${this.port}/${this.path}`
|
|
3592
3593
|
);
|
|
3593
3594
|
}
|
|
3594
3595
|
static UNKNOWN = new Ee({ host: "unknown", port: 0 });
|
|
3595
3596
|
}
|
|
3596
|
-
const
|
|
3597
|
+
const Hi = 2, Ji = 3, Xi = 2, Ki = (t, e) => {
|
|
3597
3598
|
if (Number.isNaN(t) || !Number.isFinite(t)) return t;
|
|
3598
3599
|
const r = ye(e);
|
|
3599
3600
|
if (r == 0) return t;
|
|
3600
3601
|
let n;
|
|
3601
|
-
r >= 1e3 ? n =
|
|
3602
|
+
r >= 1e3 ? n = Hi : r >= 1 ? n = Ji : n = Math.ceil(-Math.log10(r)) + Xi;
|
|
3602
3603
|
const s = 10 ** n;
|
|
3603
3604
|
return Math.round(t * s) / s;
|
|
3604
|
-
},
|
|
3605
|
+
}, Ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3605
3606
|
__proto__: null,
|
|
3606
|
-
abs:
|
|
3607
|
-
add:
|
|
3608
|
-
closeTo:
|
|
3609
|
-
div:
|
|
3607
|
+
abs: tr,
|
|
3608
|
+
add: _t,
|
|
3609
|
+
closeTo: Mn,
|
|
3610
|
+
div: Bn,
|
|
3610
3611
|
equal: Ke,
|
|
3611
|
-
max:
|
|
3612
|
-
min:
|
|
3612
|
+
max: An,
|
|
3613
|
+
min: er,
|
|
3613
3614
|
mult: Y,
|
|
3614
|
-
roundBySpan:
|
|
3615
|
-
roundToNearestMagnitude:
|
|
3615
|
+
roundBySpan: Ki,
|
|
3616
|
+
roundToNearestMagnitude: En,
|
|
3616
3617
|
sub: ae
|
|
3617
3618
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3618
3619
|
a.object({
|
|
3619
|
-
baseInterval:
|
|
3620
|
+
baseInterval: f.z.optional(),
|
|
3620
3621
|
maxRetries: a.number().optional(),
|
|
3621
3622
|
scale: a.number().optional()
|
|
3622
3623
|
});
|
|
3623
|
-
const
|
|
3624
|
+
const Qi = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Ur = a.string().regex(Qi), _ = a.number().min(0).max(255), Cr = a.number().min(0).max(1), qe = a.tuple([_, _, _, Cr]), _i = a.tuple([_, _, _]), ea = a.object({ rgba255: qe }), ta = a.number().min(0).max(360), ra = a.number().min(0).max(100), na = a.number().min(0).max(100), jr = a.tuple([ta, ra, na, Cr]), ke = a.union([Ur, _i, qe, jr, ea]), ze = ke.transform((t) => w(t)), sa = (t) => ze.safeParse(t).success, ia = (t) => qe.safeParse(t).success, aa = (t) => {
|
|
3624
3625
|
if (t == null) return;
|
|
3625
3626
|
const e = ze.safeParse(t);
|
|
3626
|
-
if (e.success) return
|
|
3627
|
+
if (e.success) return Lr(e.data);
|
|
3627
3628
|
if (typeof t == "string") return t;
|
|
3628
3629
|
throw e.error;
|
|
3629
3630
|
}, w = (t, e = 1) => {
|
|
3630
|
-
if (t = ke.parse(t), typeof t == "string") return
|
|
3631
|
+
if (t = ke.parse(t), typeof t == "string") return ma(t, e);
|
|
3631
3632
|
if (Array.isArray(t)) {
|
|
3632
3633
|
if (t.length < 3 || t.length > 4)
|
|
3633
3634
|
throw new Error(`Invalid color: [${t.join(", ")}]`);
|
|
3634
3635
|
return t.length === 3 ? [...t, e] : t;
|
|
3635
3636
|
}
|
|
3636
3637
|
return t.rgba255;
|
|
3637
|
-
},
|
|
3638
|
+
}, Rr = (t, e) => {
|
|
3638
3639
|
if (t == null || e == null) return t == e;
|
|
3639
3640
|
const r = w(t), n = w(e);
|
|
3640
3641
|
return r.every((s, i) => s === n[i]);
|
|
3641
|
-
},
|
|
3642
|
+
}, oa = (t) => {
|
|
3642
3643
|
if (t == null) return;
|
|
3643
3644
|
const [e, r, n, s] = w(t);
|
|
3644
3645
|
return `#${Oe(e)}${Oe(r)}${Oe(n)}${s === 1 ? "" : Oe(s * 255)}`;
|
|
3645
|
-
},
|
|
3646
|
+
}, Lr = (t) => {
|
|
3646
3647
|
const [e, r, n, s] = w(t);
|
|
3647
3648
|
return `rgba(${e}, ${r}, ${n}, ${s})`;
|
|
3648
|
-
},
|
|
3649
|
+
}, ua = (t) => `rgb(${Dr(t)})`, Dr = (t) => {
|
|
3649
3650
|
const [e, r, n] = w(t);
|
|
3650
3651
|
return `${e}, ${r}, ${n}`;
|
|
3651
|
-
},
|
|
3652
|
+
}, la = (t) => [...Ut(t), ce(t)], Ut = (t) => [
|
|
3652
3653
|
oe(t) / 255,
|
|
3653
3654
|
ue(t) / 255,
|
|
3654
3655
|
le(t) / 255
|
|
3655
|
-
], oe = (t) => w(t)[0], ue = (t) => w(t)[1], le = (t) => w(t)[2], ce = (t) => w(t)[3],
|
|
3656
|
+
], oe = (t) => w(t)[0], ue = (t) => w(t)[1], le = (t) => w(t)[2], ce = (t) => w(t)[3], ca = (t) => Rr(Ct, t), ha = (t) => Oa(w(t)), fa = (t, e) => {
|
|
3656
3657
|
const [r, n, s] = w(t);
|
|
3657
3658
|
if (e > 100)
|
|
3658
3659
|
throw new Error(`Color opacity must be between 0 and 100, got ${e}`);
|
|
@@ -3662,24 +3663,24 @@ const Ki = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Br = a.string().regex(Ki), _ = a.nu
|
|
|
3662
3663
|
(s) => s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4
|
|
3663
3664
|
);
|
|
3664
3665
|
return Number((0.2126 * e + 0.7152 * r + 0.0722 * n).toFixed(3));
|
|
3665
|
-
},
|
|
3666
|
+
}, da = (t) => {
|
|
3666
3667
|
const [e, r, n] = Ut(t);
|
|
3667
3668
|
return 1 - (Math.max(e, r, n) - Math.min(e, r, n));
|
|
3668
3669
|
}, ot = (t, e) => {
|
|
3669
3670
|
const r = w(t), n = w(e), s = ge(r), i = ge(n);
|
|
3670
3671
|
return (Math.max(s, i) + 0.5) / (Math.min(s, i) + 0.5);
|
|
3671
|
-
},
|
|
3672
|
+
}, ga = (t, ...e) => {
|
|
3672
3673
|
if (e.length === 0)
|
|
3673
3674
|
throw new Error("[Color.pickByContrast] - must provide at least one color");
|
|
3674
3675
|
const r = w(t), [n] = e.sort((s, i) => ot(r, i) - ot(r, s));
|
|
3675
3676
|
return w(n);
|
|
3676
|
-
},
|
|
3677
|
+
}, pa = (t) => ge(t) < 0.5, ya = (t) => ge(t) > 0.5, ma = (t, e = 1) => (t = Ur.parse(t), t = ba(t), [
|
|
3677
3678
|
ve(t, 0),
|
|
3678
3679
|
ve(t, 2),
|
|
3679
3680
|
ve(t, 4),
|
|
3680
3681
|
t.length === 8 ? ve(t, 6) / 255 : e
|
|
3681
|
-
]), Ct = [0, 0, 0, 0], Oe = (t) => Math.floor(t).toString(16).padStart(2, "0"), ve = (t, e) => parseInt(t.slice(e, e + 2), 16),
|
|
3682
|
-
t =
|
|
3682
|
+
]), Ct = [0, 0, 0, 0], Oe = (t) => Math.floor(t).toString(16).padStart(2, "0"), ve = (t, e) => parseInt(t.slice(e, e + 2), 16), ba = (t) => t.startsWith("#") ? t.slice(1) : t, wa = (t) => {
|
|
3683
|
+
t = jr.parse(t);
|
|
3683
3684
|
let [e, r, n] = t;
|
|
3684
3685
|
const s = t[3];
|
|
3685
3686
|
e /= 360, r /= 100, n /= 100;
|
|
@@ -3687,30 +3688,30 @@ const Ki = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Br = a.string().regex(Ki), _ = a.nu
|
|
|
3687
3688
|
if (r === 0)
|
|
3688
3689
|
i = o = c = n;
|
|
3689
3690
|
else {
|
|
3690
|
-
const l = n < 0.5 ? n * (1 + r) : n + r - n * r,
|
|
3691
|
-
i = We(
|
|
3691
|
+
const l = n < 0.5 ? n * (1 + r) : n + r - n * r, h = 2 * n - l;
|
|
3692
|
+
i = We(h, l, e + 1 / 3), o = We(h, l, e), c = We(h, l, e - 1 / 3);
|
|
3692
3693
|
}
|
|
3693
3694
|
return [Math.round(i * 255), Math.round(o * 255), Math.round(c * 255), s];
|
|
3694
|
-
}, We = (t, e, r) => (r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6 ? t + (e - t) * 6 * r : r < 1 / 2 ? e : r < 2 / 3 ? t + (e - t) * (2 / 3 - r) * 6 : t),
|
|
3695
|
+
}, We = (t, e, r) => (r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6 ? t + (e - t) * 6 * r : r < 1 / 2 ? e : r < 2 / 3 ? t + (e - t) * (2 / 3 - r) * 6 : t), Oa = (t) => {
|
|
3695
3696
|
t = qe.parse(t);
|
|
3696
3697
|
let [e, r, n] = t;
|
|
3697
3698
|
const s = t[3];
|
|
3698
3699
|
e /= 255, r /= 255, n /= 255;
|
|
3699
3700
|
const i = Math.max(e, r, n), o = Math.min(e, r, n);
|
|
3700
|
-
let c, l,
|
|
3701
|
+
let c, l, h = (i + o) / 2;
|
|
3701
3702
|
if (i === o)
|
|
3702
3703
|
c = l = 0;
|
|
3703
3704
|
else {
|
|
3704
|
-
const
|
|
3705
|
-
l =
|
|
3705
|
+
const g = i - o;
|
|
3706
|
+
l = h > 0.5 ? g / (2 - i - o) : g / (i + o), i === e ? c = (r - n) / g + (r < n ? 6 : 0) : i === r ? c = (n - e) / g + 2 : c = (e - r) / g + 4, c /= 6;
|
|
3706
3707
|
}
|
|
3707
|
-
return c *= 360, l *= 100,
|
|
3708
|
-
},
|
|
3708
|
+
return c *= 360, l *= 100, h *= 100, [Math.round(c), Math.round(l), Math.round(h), s];
|
|
3709
|
+
}, va = w("#000000"), Ta = w("#ffffff"), Pr = a.object({
|
|
3709
3710
|
key: a.string(),
|
|
3710
3711
|
color: ke,
|
|
3711
3712
|
position: a.number(),
|
|
3712
3713
|
switched: a.boolean().optional()
|
|
3713
|
-
}),
|
|
3714
|
+
}), xa = a.array(Pr), $a = (t, e) => {
|
|
3714
3715
|
if (t.length === 0) return Ct;
|
|
3715
3716
|
if (t = t.slice().sort((r, n) => r.position - n.position), e <= t[0].position) return w(t[0].color);
|
|
3716
3717
|
if (e >= t[t.length - 1].position)
|
|
@@ -3722,26 +3723,26 @@ const Ki = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Br = a.string().regex(Ki), _ = a.nu
|
|
|
3722
3723
|
if (e === s.position) return w(s.color);
|
|
3723
3724
|
const i = (e - n.position) / (s.position - n.position), o = w(n.color), c = w(s.color), l = Math.round(
|
|
3724
3725
|
oe(o) + i * (oe(c) - oe(o))
|
|
3725
|
-
),
|
|
3726
|
+
), h = Math.round(
|
|
3726
3727
|
ue(o) + i * (ue(c) - ue(o))
|
|
3727
|
-
),
|
|
3728
|
+
), g = Math.round(
|
|
3728
3729
|
le(o) + i * (le(c) - le(o))
|
|
3729
|
-
),
|
|
3730
|
-
return w([l,
|
|
3730
|
+
), p = ce(o) + i * (ce(c) - ce(o));
|
|
3731
|
+
return w([l, h, g, p]);
|
|
3731
3732
|
}
|
|
3732
3733
|
return w(t[t.length - 1].color);
|
|
3733
|
-
},
|
|
3734
|
+
}, Sa = a.object({
|
|
3734
3735
|
key: a.string(),
|
|
3735
3736
|
name: a.string(),
|
|
3736
3737
|
color: ze
|
|
3737
|
-
}),
|
|
3738
|
+
}), Na = a.object({
|
|
3738
3739
|
key: a.string(),
|
|
3739
3740
|
name: a.string(),
|
|
3740
|
-
swatches: a.array(
|
|
3741
|
-
}),
|
|
3741
|
+
swatches: a.array(Sa)
|
|
3742
|
+
}), Ia = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3742
3743
|
__proto__: null,
|
|
3743
|
-
BLACK:
|
|
3744
|
-
WHITE:
|
|
3744
|
+
BLACK: va,
|
|
3745
|
+
WHITE: Ta,
|
|
3745
3746
|
ZERO: Ct,
|
|
3746
3747
|
aValue: ce,
|
|
3747
3748
|
bValue: le,
|
|
@@ -3749,106 +3750,106 @@ const Ki = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Br = a.string().regex(Ki), _ = a.nu
|
|
|
3749
3750
|
construct: w,
|
|
3750
3751
|
contrast: ot,
|
|
3751
3752
|
crudeZ: ke,
|
|
3752
|
-
cssString:
|
|
3753
|
-
equals:
|
|
3754
|
-
fromGradient:
|
|
3755
|
-
fromHSLA:
|
|
3753
|
+
cssString: aa,
|
|
3754
|
+
equals: Rr,
|
|
3755
|
+
fromGradient: $a,
|
|
3756
|
+
fromHSLA: wa,
|
|
3756
3757
|
gValue: ue,
|
|
3757
|
-
gradientZ:
|
|
3758
|
-
grayness:
|
|
3759
|
-
hex:
|
|
3760
|
-
hsla:
|
|
3761
|
-
isColor:
|
|
3762
|
-
isCrude:
|
|
3763
|
-
isDark:
|
|
3764
|
-
isLight:
|
|
3765
|
-
isZero:
|
|
3758
|
+
gradientZ: xa,
|
|
3759
|
+
grayness: da,
|
|
3760
|
+
hex: oa,
|
|
3761
|
+
hsla: ha,
|
|
3762
|
+
isColor: ia,
|
|
3763
|
+
isCrude: sa,
|
|
3764
|
+
isDark: pa,
|
|
3765
|
+
isLight: ya,
|
|
3766
|
+
isZero: ca,
|
|
3766
3767
|
luminance: ge,
|
|
3767
|
-
paletteZ:
|
|
3768
|
-
pickByContrast:
|
|
3768
|
+
paletteZ: Na,
|
|
3769
|
+
pickByContrast: ga,
|
|
3769
3770
|
rValue: oe,
|
|
3770
|
-
rgbCSS:
|
|
3771
|
-
rgbString:
|
|
3772
|
-
rgba1:
|
|
3773
|
-
rgbaCSS:
|
|
3774
|
-
setAlpha:
|
|
3775
|
-
stopZ:
|
|
3776
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
3777
|
-
lower:
|
|
3778
|
-
upper:
|
|
3779
|
-
},
|
|
3771
|
+
rgbCSS: ua,
|
|
3772
|
+
rgbString: Dr,
|
|
3773
|
+
rgba1: la,
|
|
3774
|
+
rgbaCSS: Lr,
|
|
3775
|
+
setAlpha: fa,
|
|
3776
|
+
stopZ: Pr
|
|
3777
|
+
}, Symbol.toStringTag, { value: "Module" })), qr = a.int().min(0).max(255), kr = 255, zr = 0, Ma = {
|
|
3778
|
+
lower: zr,
|
|
3779
|
+
upper: kr + 1
|
|
3780
|
+
}, Fr = a.object({
|
|
3780
3781
|
name: a.string(),
|
|
3781
3782
|
key: a.string()
|
|
3782
3783
|
}), pe = (t) => a.object({
|
|
3783
|
-
subject:
|
|
3784
|
+
subject: Fr,
|
|
3784
3785
|
resource: t,
|
|
3785
|
-
authority:
|
|
3786
|
-
}),
|
|
3786
|
+
authority: qr
|
|
3787
|
+
}), Ea = (...t) => (e) => e.filter((r) => {
|
|
3787
3788
|
let n = !1;
|
|
3788
3789
|
return r.to != null && (n = t.includes(r.to.resource)), r.from != null && !n && (n = t.includes(r.from.resource)), n;
|
|
3789
|
-
}),
|
|
3790
|
+
}), Zr = (t) => a.object({
|
|
3790
3791
|
from: pe(t),
|
|
3791
3792
|
to: a.null()
|
|
3792
|
-
}),
|
|
3793
|
+
}), Yr = (t) => a.object({
|
|
3793
3794
|
from: a.null(),
|
|
3794
3795
|
to: pe(t)
|
|
3795
|
-
}),
|
|
3796
|
-
Fr(t),
|
|
3796
|
+
}), Aa = (t) => a.union([
|
|
3797
3797
|
Zr(t),
|
|
3798
|
+
Yr(t),
|
|
3798
3799
|
a.object({
|
|
3799
3800
|
from: pe(t),
|
|
3800
3801
|
to: pe(t)
|
|
3801
3802
|
})
|
|
3802
|
-
]),
|
|
3803
|
+
]), Lo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3803
3804
|
__proto__: null,
|
|
3804
|
-
ABSOLUTE_AUTHORITY:
|
|
3805
|
-
AUTHORITY_BOUNDS:
|
|
3806
|
-
ZERO_AUTHORITY:
|
|
3807
|
-
acquireZ:
|
|
3808
|
-
authorityZ:
|
|
3809
|
-
filterTransfersByChannelKey:
|
|
3810
|
-
releaseZ:
|
|
3805
|
+
ABSOLUTE_AUTHORITY: kr,
|
|
3806
|
+
AUTHORITY_BOUNDS: Ma,
|
|
3807
|
+
ZERO_AUTHORITY: zr,
|
|
3808
|
+
acquireZ: Yr,
|
|
3809
|
+
authorityZ: qr,
|
|
3810
|
+
filterTransfersByChannelKey: Ea,
|
|
3811
|
+
releaseZ: Zr,
|
|
3811
3812
|
stateZ: pe,
|
|
3812
|
-
subjectZ:
|
|
3813
|
-
transferZ:
|
|
3814
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
3813
|
+
subjectZ: Fr,
|
|
3814
|
+
transferZ: Aa
|
|
3815
|
+
}, Symbol.toStringTag, { value: "Module" })), Ba = (t) => Object.getOwnPropertySymbols(globalThis).includes(t), Ua = (t, e) => {
|
|
3815
3816
|
const r = Symbol.for(t);
|
|
3816
|
-
if (!
|
|
3817
|
+
if (!Ba(r)) {
|
|
3817
3818
|
const n = e();
|
|
3818
3819
|
Object.defineProperty(globalThis, r, { value: n });
|
|
3819
3820
|
}
|
|
3820
3821
|
return () => globalThis[r];
|
|
3821
|
-
},
|
|
3822
|
-
static discriminator =
|
|
3822
|
+
}, Vr = "sy_x_error", Ca = (t) => (e) => e != null && typeof e == "object" && "type" in e && typeof e.type == "string" ? e.type.startsWith(t) : e instanceof Error ? e.message.startsWith(t) : typeof e != "string" ? !1 : e.startsWith(t), Wr = (t) => class ie extends Error {
|
|
3823
|
+
static discriminator = Vr;
|
|
3823
3824
|
discriminator = ie.discriminator;
|
|
3824
3825
|
static TYPE = t;
|
|
3825
3826
|
type = ie.TYPE;
|
|
3826
|
-
static matches =
|
|
3827
|
+
static matches = Ca(t);
|
|
3827
3828
|
matches = ie.matches;
|
|
3828
3829
|
constructor(r, n) {
|
|
3829
3830
|
super(r, n), this.name = ie.TYPE;
|
|
3830
3831
|
}
|
|
3831
3832
|
static sub(r) {
|
|
3832
|
-
return
|
|
3833
|
+
return Wr(`${t}.${r}`);
|
|
3833
3834
|
}
|
|
3834
|
-
},
|
|
3835
|
+
}, ja = (t) => {
|
|
3835
3836
|
if (t == null || typeof t != "object") return !1;
|
|
3836
3837
|
const e = t;
|
|
3837
|
-
if (e.discriminator !==
|
|
3838
|
+
if (e.discriminator !== Vr) return !1;
|
|
3838
3839
|
if (!("type" in e))
|
|
3839
3840
|
throw new Error(
|
|
3840
3841
|
`X Error is missing its type property: ${JSON.stringify(e)}`
|
|
3841
3842
|
);
|
|
3842
3843
|
return !0;
|
|
3843
3844
|
}, re = "unknown", qt = "nil";
|
|
3844
|
-
class
|
|
3845
|
+
class Ra {
|
|
3845
3846
|
providers = [];
|
|
3846
3847
|
register(e) {
|
|
3847
3848
|
this.providers.push(e);
|
|
3848
3849
|
}
|
|
3849
3850
|
encode(e) {
|
|
3850
3851
|
if (e == null) return { type: qt, data: "" };
|
|
3851
|
-
if (
|
|
3852
|
+
if (ja(e))
|
|
3852
3853
|
for (const r of this.providers) {
|
|
3853
3854
|
const n = r.encode(e);
|
|
3854
3855
|
if (n != null) return n;
|
|
@@ -3871,11 +3872,11 @@ class ja {
|
|
|
3871
3872
|
return new kt(e.data);
|
|
3872
3873
|
}
|
|
3873
3874
|
}
|
|
3874
|
-
|
|
3875
|
-
class kt extends
|
|
3875
|
+
Ua("synnax-error-registry", () => new Ra());
|
|
3876
|
+
class kt extends Wr("unknown") {
|
|
3876
3877
|
}
|
|
3877
3878
|
a.object({ type: a.string(), data: a.string() });
|
|
3878
|
-
const
|
|
3879
|
+
const Do = () => new Promise((t) => setTimeout(t, 0)), Po = (t) => t ? -1 : 1, La = x.object({
|
|
3879
3880
|
jsonrpc: x.literal("2.0"),
|
|
3880
3881
|
method: x.string(),
|
|
3881
3882
|
// params should be z.union([z.record(z.string(), z.json()),
|
|
@@ -3883,12 +3884,12 @@ const Co = () => new Promise((t) => setTimeout(t, 0)), jo = (t) => t ? -1 : 1, R
|
|
|
3883
3884
|
// definition of params then in the JSON-RPC spec.
|
|
3884
3885
|
params: x.any().optional(),
|
|
3885
3886
|
id: x.union([x.string(), x.number(), x.null()]).optional()
|
|
3886
|
-
}),
|
|
3887
|
+
}), Gr = x.object({
|
|
3887
3888
|
jsonrpc: x.literal("2.0"),
|
|
3888
3889
|
id: x.union([x.string(), x.number(), x.null()])
|
|
3889
|
-
}),
|
|
3890
|
+
}), Da = Gr.extend({
|
|
3890
3891
|
result: x.json()
|
|
3891
|
-
}),
|
|
3892
|
+
}), Pa = Gr.extend({
|
|
3892
3893
|
error: x.object({
|
|
3893
3894
|
code: x.number().int(),
|
|
3894
3895
|
// This should be z.string(), but the VSCode JSON RPC implementation uses a looser
|
|
@@ -3896,31 +3897,31 @@ const Co = () => new Promise((t) => setTimeout(t, 0)), jo = (t) => t ? -1 : 1, R
|
|
|
3896
3897
|
message: x.string().optional(),
|
|
3897
3898
|
data: x.json().optional()
|
|
3898
3899
|
})
|
|
3899
|
-
}),
|
|
3900
|
-
x.union([
|
|
3901
|
-
const
|
|
3900
|
+
}), qa = x.union([Da, Pa]);
|
|
3901
|
+
x.union([La, qa]);
|
|
3902
|
+
const ka = (t, e, r) => {
|
|
3902
3903
|
const n = t.get(e);
|
|
3903
3904
|
return n === void 0 ? (t.set(e, r), r) : n;
|
|
3904
|
-
},
|
|
3905
|
+
}, qo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3905
3906
|
__proto__: null,
|
|
3906
|
-
getOrSetDefault:
|
|
3907
|
+
getOrSetDefault: ka
|
|
3907
3908
|
}, Symbol.toStringTag, { value: "Module" })), ut = a.string().regex(/^\d+\.\d+\.\d+$/), be = (t, e, r = {}) => {
|
|
3908
3909
|
r.checkMajor ??= !0, r.checkMinor ??= !0, r.checkPatch ??= !0;
|
|
3909
|
-
const n = ut.parse(t), s = ut.parse(e), [i, o, c] = n.split(".").map(Number), [l,
|
|
3910
|
+
const n = ut.parse(t), s = ut.parse(e), [i, o, c] = n.split(".").map(Number), [l, h, g] = s.split(".").map(Number);
|
|
3910
3911
|
if (r.checkMajor) {
|
|
3911
3912
|
if (i < l) return xe;
|
|
3912
3913
|
if (i > l) return $e;
|
|
3913
3914
|
}
|
|
3914
3915
|
if (r.checkMinor) {
|
|
3915
|
-
if (o <
|
|
3916
|
-
if (o >
|
|
3916
|
+
if (o < h) return xe;
|
|
3917
|
+
if (o > h) return $e;
|
|
3917
3918
|
}
|
|
3918
3919
|
if (r.checkPatch) {
|
|
3919
|
-
if (c <
|
|
3920
|
-
if (c >
|
|
3920
|
+
if (c < g) return xe;
|
|
3921
|
+
if (c > g) return $e;
|
|
3921
3922
|
}
|
|
3922
3923
|
return ee;
|
|
3923
|
-
},
|
|
3924
|
+
}, za = (t, e, r = {}) => Jt(be(t, e, r)), Hr = (t, e, r = {}) => Ht(be(t, e, r)), Fa = (t, e, r = {}) => Gt(be(t, e, r)), Za = ({
|
|
3924
3925
|
name: t,
|
|
3925
3926
|
migrate: e
|
|
3926
3927
|
}) => (r) => {
|
|
@@ -3930,7 +3931,7 @@ const qa = (t, e, r) => {
|
|
|
3930
3931
|
} catch (n) {
|
|
3931
3932
|
throw console.log(`${t} failed to migrate from ${r.version}`), console.error(n), n;
|
|
3932
3933
|
}
|
|
3933
|
-
},
|
|
3934
|
+
}, Ya = ({
|
|
3934
3935
|
name: t,
|
|
3935
3936
|
migrations: e,
|
|
3936
3937
|
targetSchema: r,
|
|
@@ -3939,59 +3940,59 @@ const qa = (t, e, r) => {
|
|
|
3939
3940
|
}) => {
|
|
3940
3941
|
const i = Object.keys(e).sort(be).pop();
|
|
3941
3942
|
if (i == null)
|
|
3942
|
-
return (
|
|
3943
|
-
if (
|
|
3943
|
+
return (h) => {
|
|
3944
|
+
if (h.version ??= n, h.version !== s.version)
|
|
3944
3945
|
return console.log(
|
|
3945
|
-
`${t} version ${
|
|
3946
|
+
`${t} version ${h.version} is newer than latest version of ${s.version}.
|
|
3946
3947
|
Returning default instead.
|
|
3947
3948
|
`
|
|
3948
3949
|
), s;
|
|
3949
3950
|
try {
|
|
3950
|
-
return r != null ? r.parse(
|
|
3951
|
-
} catch (
|
|
3952
|
-
return console.log(`${t} failed to parse default. Exiting with default`), console.error(
|
|
3951
|
+
return r != null ? r.parse(h) : h;
|
|
3952
|
+
} catch (g) {
|
|
3953
|
+
return console.log(`${t} failed to parse default. Exiting with default`), console.error(g), s;
|
|
3953
3954
|
}
|
|
3954
3955
|
};
|
|
3955
3956
|
const o = Object.keys(e).length;
|
|
3956
3957
|
let c = !1;
|
|
3957
|
-
const l = (
|
|
3958
|
+
const l = (h) => {
|
|
3958
3959
|
try {
|
|
3959
|
-
if (o === 0 ||
|
|
3960
|
-
return console.log(c ? `${t} ${
|
|
3961
|
-
const
|
|
3960
|
+
if (o === 0 || Hr(h.version, i))
|
|
3961
|
+
return console.log(c ? `${t} ${h.version} now up to date` : `${t} version ${h.version} is up to date with target version ${s.version}`), h;
|
|
3962
|
+
const g = h.version, p = e[g], S = p(h);
|
|
3962
3963
|
return c = !0, l(S);
|
|
3963
|
-
} catch (
|
|
3964
|
+
} catch (g) {
|
|
3964
3965
|
return console.log(
|
|
3965
|
-
`${t} failed to migrate from ${
|
|
3966
|
-
), console.error(
|
|
3966
|
+
`${t} failed to migrate from ${h.version} to ${i}`
|
|
3967
|
+
), console.error(g), s;
|
|
3967
3968
|
}
|
|
3968
3969
|
};
|
|
3969
|
-
return (
|
|
3970
|
+
return (h) => {
|
|
3970
3971
|
try {
|
|
3971
|
-
if (
|
|
3972
|
+
if (h.version == null)
|
|
3972
3973
|
if (n != null)
|
|
3973
3974
|
console.log(
|
|
3974
3975
|
`${t} version is null. Setting version to default of ${n}`
|
|
3975
|
-
),
|
|
3976
|
+
), h.version = n;
|
|
3976
3977
|
else
|
|
3977
3978
|
return console.log(
|
|
3978
3979
|
`${t} version is null and no default version set. Exiting with default`
|
|
3979
3980
|
), s;
|
|
3980
|
-
return l(
|
|
3981
|
-
} catch (
|
|
3982
|
-
return console.log(`${t} failed to parse final result. Exiting with default`), console.error(
|
|
3981
|
+
return l(h);
|
|
3982
|
+
} catch (g) {
|
|
3983
|
+
return console.log(`${t} failed to parse final result. Exiting with default`), console.error(g), s;
|
|
3983
3984
|
}
|
|
3984
3985
|
};
|
|
3985
|
-
},
|
|
3986
|
+
}, ko = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3986
3987
|
__proto__: null,
|
|
3987
3988
|
compareSemVer: be,
|
|
3988
|
-
createMigration:
|
|
3989
|
-
migrator:
|
|
3990
|
-
semVerNewer:
|
|
3991
|
-
semVerOlder:
|
|
3989
|
+
createMigration: Za,
|
|
3990
|
+
migrator: Ya,
|
|
3991
|
+
semVerNewer: Hr,
|
|
3992
|
+
semVerOlder: Fa,
|
|
3992
3993
|
semVerZ: ut,
|
|
3993
|
-
versionsEqual:
|
|
3994
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
3994
|
+
versionsEqual: za
|
|
3995
|
+
}, Symbol.toStringTag, { value: "Module" })), Jr = ["standard", "scientific", "engineering"], Va = a.enum(Jr), Wa = (t, e, r) => {
|
|
3995
3996
|
if (Number.isNaN(t)) return "NaN";
|
|
3996
3997
|
if (t === 1 / 0) return "∞";
|
|
3997
3998
|
if (t === -1 / 0) return "-∞";
|
|
@@ -4000,28 +4001,28 @@ const qa = (t, e, r) => {
|
|
|
4000
4001
|
return e === 0 ? "0ᴇ0" : `0.${"0".repeat(e)}ᴇ0`;
|
|
4001
4002
|
let n;
|
|
4002
4003
|
return r === "scientific" ? n = Math.floor(Math.log10(Math.abs(t))) : n = Math.floor(Math.log10(Math.abs(t)) / 3) * 3, `${(t / 10 ** n).toFixed(e)}ᴇ${n}`;
|
|
4003
|
-
},
|
|
4004
|
+
}, zo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4004
4005
|
__proto__: null,
|
|
4005
|
-
NOTATIONS:
|
|
4006
|
-
notationZ:
|
|
4007
|
-
stringifyNumber:
|
|
4008
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4006
|
+
NOTATIONS: Jr,
|
|
4007
|
+
notationZ: Va,
|
|
4008
|
+
stringifyNumber: Wa
|
|
4009
|
+
}, Symbol.toStringTag, { value: "Module" })), Fo = (t) => Array.isArray(t) ? [...t] : typeof t == "object" && t !== null ? { ...t } : t, Xr = a.enum([
|
|
4009
4010
|
"success",
|
|
4010
4011
|
"info",
|
|
4011
4012
|
"warning",
|
|
4012
4013
|
"error",
|
|
4013
4014
|
"loading",
|
|
4014
4015
|
"disabled"
|
|
4015
|
-
]),
|
|
4016
|
+
]), Ga = (t) => a.object({
|
|
4016
4017
|
key: a.string(),
|
|
4017
|
-
variant:
|
|
4018
|
+
variant: Xr,
|
|
4018
4019
|
message: a.string(),
|
|
4019
4020
|
description: a.string().optional(),
|
|
4020
4021
|
time: b.z,
|
|
4021
4022
|
details: t ?? a.unknown().optional()
|
|
4022
|
-
}),
|
|
4023
|
+
}), Ha = (t, e) => {
|
|
4023
4024
|
if (!(t instanceof Error)) throw t;
|
|
4024
|
-
return
|
|
4025
|
+
return Kr({
|
|
4025
4026
|
variant: "error",
|
|
4026
4027
|
message: e ?? t.message,
|
|
4027
4028
|
description: e != null ? t.message : void 0,
|
|
@@ -4029,58 +4030,84 @@ const qa = (t, e, r) => {
|
|
|
4029
4030
|
stack: t.stack ?? ""
|
|
4030
4031
|
}
|
|
4031
4032
|
});
|
|
4032
|
-
},
|
|
4033
|
+
}, Kr = (t) => ({
|
|
4033
4034
|
key: At(),
|
|
4034
4035
|
time: b.now(),
|
|
4035
4036
|
...t
|
|
4036
|
-
}),
|
|
4037
|
+
}), Zo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4037
4038
|
__proto__: null,
|
|
4038
|
-
create:
|
|
4039
|
-
fromException:
|
|
4040
|
-
statusZ:
|
|
4041
|
-
variantZ:
|
|
4042
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4043
|
-
|
|
4039
|
+
create: Kr,
|
|
4040
|
+
fromException: Ha,
|
|
4041
|
+
statusZ: Ga,
|
|
4042
|
+
variantZ: Xr
|
|
4043
|
+
}, Symbol.toStringTag, { value: "Module" })), Ja = (t, e = "") => {
|
|
4044
|
+
const r = t.length;
|
|
4045
|
+
return r === 0 ? e : r === 1 ? t[0] : r === 2 ? `${t[0]} and ${t[1]}` : `${t.slice(0, -1).join(", ")}, and ${t[r - 1]}`;
|
|
4046
|
+
}, Xa = (t) => {
|
|
4047
|
+
const e = t.split(" "), r = /* @__PURE__ */ new Set(), n = e.map((o) => o.charAt(0).toLowerCase()).join("");
|
|
4048
|
+
r.add(n.replace(/-/g, "_")), r.add(n.replace(/(.)(.)/g, "$1_$2").replace(/-/g, "_"));
|
|
4049
|
+
const s = /\d+/g;
|
|
4050
|
+
t.match(s) && e.forEach((o, c) => {
|
|
4051
|
+
if (s.test(o)) {
|
|
4052
|
+
const l = e.map((h, g) => g !== c ? h.charAt(0).toLowerCase() : h).join("");
|
|
4053
|
+
r.add(l.replace(/-/g, "_")), r.add(
|
|
4054
|
+
l.replace(/(.)(.)/g, "$1_$2").replace(/-/g, "_")
|
|
4055
|
+
);
|
|
4056
|
+
}
|
|
4057
|
+
});
|
|
4058
|
+
const i = e.map(
|
|
4059
|
+
(o) => (o.length > 3 ? o.substring(0, 3) : o).toLowerCase()
|
|
4060
|
+
);
|
|
4061
|
+
return r.add(i.join("").replace(/-/g, "_")), r.add(i.join("_").replace(/-/g, "_")), Array.from(r).filter(
|
|
4062
|
+
(o) => o.length >= 2 && o.length <= 12 && !/^\d/.test(o)
|
|
4063
|
+
);
|
|
4064
|
+
}, Ka = (t, e) => t.startsWith(e) ? t.slice(e.length) : t, Yo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4065
|
+
__proto__: null,
|
|
4066
|
+
createShortIdentifiers: Xa,
|
|
4067
|
+
naturalLanguageJoin: Ja,
|
|
4068
|
+
trimPrefix: Ka
|
|
4069
|
+
}, Symbol.toStringTag, { value: "Module" })), Qa = new Error("request for lock canceled");
|
|
4070
|
+
var _a = function(t, e, r, n) {
|
|
4044
4071
|
function s(i) {
|
|
4045
4072
|
return i instanceof r ? i : new r(function(o) {
|
|
4046
4073
|
o(i);
|
|
4047
4074
|
});
|
|
4048
4075
|
}
|
|
4049
4076
|
return new (r || (r = Promise))(function(i, o) {
|
|
4050
|
-
function c(
|
|
4077
|
+
function c(g) {
|
|
4051
4078
|
try {
|
|
4052
|
-
|
|
4053
|
-
} catch (
|
|
4054
|
-
o(
|
|
4079
|
+
h(n.next(g));
|
|
4080
|
+
} catch (p) {
|
|
4081
|
+
o(p);
|
|
4055
4082
|
}
|
|
4056
4083
|
}
|
|
4057
|
-
function l(
|
|
4084
|
+
function l(g) {
|
|
4058
4085
|
try {
|
|
4059
|
-
|
|
4060
|
-
} catch (
|
|
4061
|
-
o(
|
|
4086
|
+
h(n.throw(g));
|
|
4087
|
+
} catch (p) {
|
|
4088
|
+
o(p);
|
|
4062
4089
|
}
|
|
4063
4090
|
}
|
|
4064
|
-
function
|
|
4065
|
-
|
|
4091
|
+
function h(g) {
|
|
4092
|
+
g.done ? i(g.value) : s(g.value).then(c, l);
|
|
4066
4093
|
}
|
|
4067
|
-
|
|
4094
|
+
h((n = n.apply(t, e || [])).next());
|
|
4068
4095
|
});
|
|
4069
4096
|
};
|
|
4070
|
-
class
|
|
4071
|
-
constructor(e, r =
|
|
4097
|
+
class eo {
|
|
4098
|
+
constructor(e, r = Qa) {
|
|
4072
4099
|
this._value = e, this._cancelError = r, this._queue = [], this._weightedWaiters = [];
|
|
4073
4100
|
}
|
|
4074
4101
|
acquire(e = 1, r = 0) {
|
|
4075
4102
|
if (e <= 0)
|
|
4076
4103
|
throw new Error(`invalid weight ${e}: must be positive`);
|
|
4077
4104
|
return new Promise((n, s) => {
|
|
4078
|
-
const i = { resolve: n, reject: s, weight: e, priority: r }, o =
|
|
4105
|
+
const i = { resolve: n, reject: s, weight: e, priority: r }, o = Qr(this._queue, (c) => r <= c.priority);
|
|
4079
4106
|
o === -1 && e <= this._value ? this._dispatchItem(i) : this._queue.splice(o + 1, 0, i);
|
|
4080
4107
|
});
|
|
4081
4108
|
}
|
|
4082
4109
|
runExclusive(e) {
|
|
4083
|
-
return
|
|
4110
|
+
return _a(this, arguments, void 0, function* (r, n = 1, s = 0) {
|
|
4084
4111
|
const [i, o] = yield this.acquire(n, s);
|
|
4085
4112
|
try {
|
|
4086
4113
|
return yield r(i);
|
|
@@ -4093,7 +4120,7 @@ class Xa {
|
|
|
4093
4120
|
if (e <= 0)
|
|
4094
4121
|
throw new Error(`invalid weight ${e}: must be positive`);
|
|
4095
4122
|
return this._couldLockImmediately(e, r) ? Promise.resolve() : new Promise((n) => {
|
|
4096
|
-
this._weightedWaiters[e - 1] || (this._weightedWaiters[e - 1] = []),
|
|
4123
|
+
this._weightedWaiters[e - 1] || (this._weightedWaiters[e - 1] = []), to(this._weightedWaiters[e - 1], { resolve: n, priority: r });
|
|
4097
4124
|
});
|
|
4098
4125
|
}
|
|
4099
4126
|
isLocked() {
|
|
@@ -4148,49 +4175,49 @@ class Xa {
|
|
|
4148
4175
|
return (this._queue.length === 0 || this._queue[0].priority < r) && e <= this._value;
|
|
4149
4176
|
}
|
|
4150
4177
|
}
|
|
4151
|
-
function
|
|
4152
|
-
const r =
|
|
4178
|
+
function to(t, e) {
|
|
4179
|
+
const r = Qr(t, (n) => e.priority <= n.priority);
|
|
4153
4180
|
t.splice(r + 1, 0, e);
|
|
4154
4181
|
}
|
|
4155
|
-
function
|
|
4182
|
+
function Qr(t, e) {
|
|
4156
4183
|
for (let r = t.length - 1; r >= 0; r--)
|
|
4157
4184
|
if (e(t[r]))
|
|
4158
4185
|
return r;
|
|
4159
4186
|
return -1;
|
|
4160
4187
|
}
|
|
4161
|
-
var
|
|
4188
|
+
var ro = function(t, e, r, n) {
|
|
4162
4189
|
function s(i) {
|
|
4163
4190
|
return i instanceof r ? i : new r(function(o) {
|
|
4164
4191
|
o(i);
|
|
4165
4192
|
});
|
|
4166
4193
|
}
|
|
4167
4194
|
return new (r || (r = Promise))(function(i, o) {
|
|
4168
|
-
function c(
|
|
4195
|
+
function c(g) {
|
|
4169
4196
|
try {
|
|
4170
|
-
|
|
4171
|
-
} catch (
|
|
4172
|
-
o(
|
|
4197
|
+
h(n.next(g));
|
|
4198
|
+
} catch (p) {
|
|
4199
|
+
o(p);
|
|
4173
4200
|
}
|
|
4174
4201
|
}
|
|
4175
|
-
function l(
|
|
4202
|
+
function l(g) {
|
|
4176
4203
|
try {
|
|
4177
|
-
|
|
4178
|
-
} catch (
|
|
4179
|
-
o(
|
|
4204
|
+
h(n.throw(g));
|
|
4205
|
+
} catch (p) {
|
|
4206
|
+
o(p);
|
|
4180
4207
|
}
|
|
4181
4208
|
}
|
|
4182
|
-
function
|
|
4183
|
-
|
|
4209
|
+
function h(g) {
|
|
4210
|
+
g.done ? i(g.value) : s(g.value).then(c, l);
|
|
4184
4211
|
}
|
|
4185
|
-
|
|
4212
|
+
h((n = n.apply(t, e || [])).next());
|
|
4186
4213
|
});
|
|
4187
4214
|
};
|
|
4188
|
-
class
|
|
4215
|
+
class no {
|
|
4189
4216
|
constructor(e) {
|
|
4190
|
-
this._semaphore = new
|
|
4217
|
+
this._semaphore = new eo(1, e);
|
|
4191
4218
|
}
|
|
4192
4219
|
acquire() {
|
|
4193
|
-
return
|
|
4220
|
+
return ro(this, arguments, void 0, function* (e = 0) {
|
|
4194
4221
|
const [, r] = yield this._semaphore.acquire(1, e);
|
|
4195
4222
|
return r;
|
|
4196
4223
|
});
|
|
@@ -4211,34 +4238,34 @@ class _a {
|
|
|
4211
4238
|
return this._semaphore.cancel();
|
|
4212
4239
|
}
|
|
4213
4240
|
}
|
|
4214
|
-
class
|
|
4241
|
+
class _r extends no {
|
|
4215
4242
|
constructor(e) {
|
|
4216
4243
|
super(), Object.assign(this, e);
|
|
4217
4244
|
}
|
|
4218
4245
|
}
|
|
4219
|
-
const
|
|
4246
|
+
const so = (t) => new _r(t), Vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4220
4247
|
__proto__: null,
|
|
4221
|
-
mutex:
|
|
4222
|
-
newMutex:
|
|
4248
|
+
mutex: _r,
|
|
4249
|
+
newMutex: so
|
|
4223
4250
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4224
|
-
function
|
|
4251
|
+
function en(t) {
|
|
4225
4252
|
var e, r, n = "";
|
|
4226
4253
|
if (typeof t == "string" || typeof t == "number") n += t;
|
|
4227
4254
|
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
4228
4255
|
var s = t.length;
|
|
4229
|
-
for (e = 0; e < s; e++) t[e] && (r =
|
|
4256
|
+
for (e = 0; e < s; e++) t[e] && (r = en(t[e])) && (n && (n += " "), n += r);
|
|
4230
4257
|
} else for (r in t) t[r] && (n && (n += " "), n += r);
|
|
4231
4258
|
return n;
|
|
4232
4259
|
}
|
|
4233
|
-
function
|
|
4234
|
-
for (var t, e, r = 0, n = "", s = arguments.length; r < s; r++) (t = arguments[r]) && (e =
|
|
4260
|
+
function io() {
|
|
4261
|
+
for (var t, e, r = 0, n = "", s = arguments.length; r < s; r++) (t = arguments[r]) && (e = en(t)) && (n && (n += " "), n += e);
|
|
4235
4262
|
return n;
|
|
4236
4263
|
}
|
|
4237
|
-
const
|
|
4238
|
-
const e = (...r) =>
|
|
4239
|
-
return e.B = (...r) => t + X + r.join(X), e.E = (r) => t + zt + r, e.M = (...r) => t + Te + r.join("-"), e.BM = (r, ...n) => e.B(r) + Te + n.join("-"), e.BE = (r, ...n) => e.B(r) + zt + n.join(X), e.BEM = (r, n, ...s) => e.BE(r, n) + Te + s.join(X), e.extend = (r) =>
|
|
4264
|
+
const ao = io, X = "-", zt = "__", Te = "--", tn = (t) => {
|
|
4265
|
+
const e = (...r) => ao(...r);
|
|
4266
|
+
return e.B = (...r) => t + X + r.join(X), e.E = (r) => t + zt + r, e.M = (...r) => t + Te + r.join("-"), e.BM = (r, ...n) => e.B(r) + Te + n.join("-"), e.BE = (r, ...n) => e.B(r) + zt + n.join(X), e.BEM = (r, n, ...s) => e.BE(r, n) + Te + s.join(X), e.extend = (r) => tn(e.B(r)), e.var = (...r) => Te + t + X + r.join(X), e;
|
|
4240
4267
|
};
|
|
4241
|
-
class
|
|
4268
|
+
class oo {
|
|
4242
4269
|
rows = [];
|
|
4243
4270
|
columns = [];
|
|
4244
4271
|
prefix;
|
|
@@ -4267,71 +4294,72 @@ class no {
|
|
|
4267
4294
|
};
|
|
4268
4295
|
}
|
|
4269
4296
|
}
|
|
4270
|
-
const
|
|
4297
|
+
const uo = (t, e) => Object.entries(e).forEach(
|
|
4271
4298
|
([r, n]) => n != null && t.style.setProperty(r, `${n}`)
|
|
4272
|
-
),
|
|
4299
|
+
), lo = (t, e) => Array.from(t.style).forEach((r) => {
|
|
4273
4300
|
r.startsWith(e) && t.style.removeProperty(r);
|
|
4274
|
-
}),
|
|
4275
|
-
const e =
|
|
4276
|
-
return e.visible = (r) => e.M(r ? "visible" : "hidden"), e.expanded = (r) => e.M(r ? "expanded" : "collapsed"), e.loc = (r) => e.M("location",
|
|
4301
|
+
}), co = (t) => {
|
|
4302
|
+
const e = tn(t);
|
|
4303
|
+
return e.visible = (r) => e.M(r ? "visible" : "hidden"), e.expanded = (r) => e.M(r ? "expanded" : "collapsed"), e.loc = (r) => e.M("location", hs.construct(r)), e.disabled = (r) => r === !0 && e.M("disabled"), e.align = (r) => e.M(r), e.dir = (r) => r != null && e.M("direction", Xn.construct(r)), e.sharp = (r) => r !== !1 && e.M("sharp"), e.rounded = (r) => r !== !1 && e.M("rounded"), e.bordered = (r) => typeof r == "boolean" ? r && e.M("bordered") : r != null ? e.M(`bordered-${r.toString()}`) : e.M("bordered"), e.selected = (r) => r && e.M("selected"), e.altColor = (r) => r && e.M("alt-color"), e.editable = (r) => r && e.M("editable"), e.noSelect = e.M("no-select"), e.applyVars = uo, e.removeVars = lo, e.newGridBuilder = (r) => new oo(r), e.dropRegion = (r) => r && e.B("haul-drop-region"), e.px = (r) => `${r}px`, e.inheritDims = (r = !0) => r && e.M("inherit-dims"), e.shade = (r) => r != null && e.M(`shade-${r}`), e.colorVar = (r) => {
|
|
4277
4304
|
if (!(r == null || r === !1))
|
|
4278
|
-
return typeof r == "number" ? `var(--${t}-gray-l${r})` :
|
|
4305
|
+
return typeof r == "number" ? `var(--${t}-gray-l${r})` : Ia.cssString(r);
|
|
4279
4306
|
}, e.levelSizeVar = (r) => `var(--${t}-${r}-size)`, e.level = (r) => e.M(`level-${r}`), e;
|
|
4280
|
-
},
|
|
4307
|
+
}, Wo = co("pluto");
|
|
4281
4308
|
export {
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4309
|
+
$o as $,
|
|
4310
|
+
is as A,
|
|
4311
|
+
mt as B,
|
|
4312
|
+
Wo as C,
|
|
4313
|
+
Z as D,
|
|
4287
4314
|
Lt as E,
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4315
|
+
as as F,
|
|
4316
|
+
os as G,
|
|
4317
|
+
vo as H,
|
|
4318
|
+
Nr as I,
|
|
4319
|
+
St as J,
|
|
4320
|
+
Oo as K,
|
|
4321
|
+
Ot as L,
|
|
4322
|
+
O as M,
|
|
4323
|
+
j as N,
|
|
4324
|
+
mo as O,
|
|
4325
|
+
ns as P,
|
|
4326
|
+
Xs as Q,
|
|
4327
|
+
ui as R,
|
|
4328
|
+
jo as S,
|
|
4302
4329
|
me as T,
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
Po as
|
|
4313
|
-
|
|
4314
|
-
|
|
4330
|
+
F as U,
|
|
4331
|
+
Eo as V,
|
|
4332
|
+
wo as W,
|
|
4333
|
+
z as X,
|
|
4334
|
+
So as Y,
|
|
4335
|
+
Hs as Z,
|
|
4336
|
+
Zo as _,
|
|
4337
|
+
xo as a,
|
|
4338
|
+
Gs as a0,
|
|
4339
|
+
Po as a1,
|
|
4340
|
+
Fo as b,
|
|
4341
|
+
po as c,
|
|
4342
|
+
To as d,
|
|
4315
4343
|
b as e,
|
|
4316
|
-
|
|
4317
|
-
|
|
4344
|
+
f,
|
|
4345
|
+
Xn as g,
|
|
4318
4346
|
m as h,
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4347
|
+
Ia as i,
|
|
4348
|
+
Ro as j,
|
|
4349
|
+
Vo as k,
|
|
4350
|
+
bo as l,
|
|
4351
|
+
zo as m,
|
|
4352
|
+
tn as n,
|
|
4353
|
+
hs as o,
|
|
4354
|
+
Lo as p,
|
|
4355
|
+
io as q,
|
|
4328
4356
|
T as r,
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4357
|
+
ko as s,
|
|
4358
|
+
qo as t,
|
|
4359
|
+
Do as u,
|
|
4360
|
+
Co as v,
|
|
4333
4361
|
V as w,
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4362
|
+
N as x,
|
|
4363
|
+
Yo as y,
|
|
4364
|
+
fo as z
|
|
4337
4365
|
};
|