@synnaxlabs/x 0.43.0 → 0.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +105 -93
- package/dist/base-BAM2mqCy.cjs +1 -0
- package/dist/base-DFq0vvGn.js +38 -0
- package/dist/binary.cjs +1 -1
- package/dist/binary.js +1 -1
- package/dist/bounds-D6e9xoHt.cjs +1 -0
- package/dist/bounds-Dj9nG39I.js +174 -0
- package/dist/bounds.cjs +1 -1
- package/dist/bounds.js +2 -2
- package/dist/box-BcGdqkt4.cjs +1 -0
- package/dist/box-D_qdUyEe.js +205 -0
- package/dist/box.cjs +1 -1
- package/dist/box.js +1 -1
- package/dist/caseconv.cjs +1 -1
- package/dist/caseconv.js +2 -2
- package/dist/change-C-YELKx6.cjs +1 -0
- package/dist/change-DLl6DccR.js +12 -0
- package/dist/change.cjs +1 -1
- package/dist/change.js +2 -10
- package/dist/compare.cjs +1 -1
- package/dist/compare.js +1 -1
- package/dist/deep.cjs +1 -1
- package/dist/deep.js +95 -96
- package/dist/dimensions-CRgergMS.js +43 -0
- package/dist/dimensions-D2QGoNXO.cjs +1 -0
- package/dist/dimensions.cjs +1 -1
- package/dist/dimensions.js +2 -41
- package/dist/direction-386XDm2w.cjs +1 -0
- package/dist/{index-DxU1zwsd.js → direction-8etxfKaR.js} +4 -3
- package/dist/direction.cjs +1 -1
- package/dist/direction.js +1 -1
- package/dist/external-B9AAGv50.cjs +1 -0
- package/dist/external-BFgJjMcS.js +23 -0
- package/dist/external-BPgtxa8d.js +29 -0
- package/dist/external-BYuXBYJh.js +40 -0
- package/dist/external-mffsMzJx.cjs +1 -0
- package/dist/external-uXk0Avrg.cjs +1 -0
- package/dist/index-B1m2qvBT.cjs +1 -0
- package/dist/{index-4GlOgZuh.js → index-B5l_quQn.js} +35 -42
- package/dist/index-BQe8OIgm.cjs +3 -0
- package/dist/index-D2xcvEO5.js +46 -0
- package/dist/index-DdhM_E4k.cjs +1 -0
- package/dist/index-PNh31WTW.js +125 -0
- package/dist/index.cjs +3 -5
- package/dist/index.js +685 -5363
- package/dist/kv.cjs +1 -1
- package/dist/kv.js +2 -45
- package/dist/{index-D6V-8SKw.js → location-Ar5y2DX2.js} +26 -26
- package/dist/location-DZi8ftXp.cjs +1 -0
- package/dist/location.cjs +1 -1
- package/dist/location.js +1 -1
- package/dist/observe.cjs +1 -1
- package/dist/observe.js +16 -20
- package/dist/path-BXdMenka.js +101 -0
- package/dist/path-st_E5-LJ.cjs +1 -0
- package/dist/position-DAL0Qqdf.cjs +1 -0
- package/dist/position-bA6pUwLn.js +85 -0
- package/dist/position.cjs +1 -1
- package/dist/position.js +2 -83
- package/dist/record-CAcQ5PNX.js +14 -0
- package/dist/record-YvCh7bzB.cjs +1 -0
- package/dist/record.cjs +1 -1
- package/dist/record.js +2 -8
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.js +2 -27
- package/dist/scale-Bzn1Cl0r.cjs +1 -0
- package/dist/{index-BUa-NXAX.js → scale-CdTNWu-d.js} +55 -59
- package/dist/scale.cjs +1 -1
- package/dist/scale.js +1 -1
- package/dist/{index-DBGAIs_7.js → series-BeJyqCoP.js} +835 -759
- package/dist/series-anlpaR_I.cjs +6 -0
- package/dist/spatial-BSWPzMkK.js +11 -0
- package/dist/spatial-DGpZ2sO3.cjs +1 -0
- package/dist/spatial.cjs +1 -1
- package/dist/spatial.js +18 -25
- package/dist/src/binary/codec.d.ts +1 -1
- package/dist/src/binary/codec.d.ts.map +1 -1
- package/dist/src/breaker/breaker.d.ts +2 -2
- package/dist/src/breaker/breaker.d.ts.map +1 -1
- package/dist/src/caseconv/caseconv.d.ts +0 -1
- package/dist/src/caseconv/caseconv.d.ts.map +1 -1
- package/dist/src/change/change.d.ts +1 -1
- package/dist/src/change/change.d.ts.map +1 -1
- package/dist/src/color/color.d.ts +2 -2
- package/dist/src/color/color.d.ts.map +1 -1
- package/dist/src/color/gradient.d.ts +1 -1
- package/dist/src/color/gradient.d.ts.map +1 -1
- package/dist/src/color/palette.d.ts +3 -3
- package/dist/src/color/palette.d.ts.map +1 -1
- package/dist/src/compare/compare.d.ts +4 -4
- package/dist/src/compare/compare.d.ts.map +1 -1
- package/dist/src/control/control.d.ts +9 -9
- package/dist/src/control/control.d.ts.map +1 -1
- package/dist/src/deep/merge.d.ts +1 -1
- package/dist/src/deep/merge.d.ts.map +1 -1
- package/dist/src/deep/path.d.ts +6 -6
- package/dist/src/deep/path.d.ts.map +1 -1
- package/dist/src/destructor.d.ts +6 -2
- package/dist/src/destructor.d.ts.map +1 -1
- package/dist/src/errors/errors.d.ts +5 -1
- package/dist/src/errors/errors.d.ts.map +1 -1
- package/dist/src/flush.d.ts +11 -0
- package/dist/src/flush.d.ts.map +1 -0
- package/dist/src/id/id.d.ts +1 -0
- package/dist/src/id/id.d.ts.map +1 -1
- package/dist/src/identity.d.ts +2 -2
- package/dist/src/identity.d.ts.map +1 -1
- package/dist/src/index.d.ts +3 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/jsonrpc/jsonrpc.d.ts +1 -1
- package/dist/src/jsonrpc/jsonrpc.d.ts.map +1 -1
- package/dist/src/kv/types.d.ts +1 -1
- package/dist/src/kv/types.d.ts.map +1 -1
- package/dist/src/map/index.d.ts +2 -0
- package/dist/src/map/index.d.ts.map +1 -0
- package/dist/src/map/map.d.ts +2 -0
- package/dist/src/map/map.d.ts.map +1 -0
- package/dist/src/map/map.spec.d.ts +2 -0
- package/dist/src/map/map.spec.d.ts.map +1 -0
- package/dist/src/math/math.d.ts +2 -4
- package/dist/src/math/math.d.ts.map +1 -1
- package/dist/src/migrate/migrate.d.ts +1 -1
- package/dist/src/migrate/migrate.d.ts.map +1 -1
- package/dist/src/notation/notation.d.ts +1 -1
- package/dist/src/notation/notation.d.ts.map +1 -1
- package/dist/src/optional.d.ts +0 -3
- package/dist/src/optional.d.ts.map +1 -1
- package/dist/src/record/index.d.ts +2 -0
- package/dist/src/record/index.d.ts.map +1 -0
- package/dist/src/record/record.d.ts +90 -0
- package/dist/src/record/record.d.ts.map +1 -0
- package/dist/src/record/record.spec.d.ts.map +1 -0
- package/dist/src/runtime/os.d.ts +1 -1
- package/dist/src/runtime/os.d.ts.map +1 -1
- package/dist/src/spatial/base.d.ts +1 -1
- package/dist/src/spatial/base.d.ts.map +1 -1
- package/dist/src/spatial/box/box.d.ts +1 -1
- package/dist/src/spatial/box/box.d.ts.map +1 -1
- package/dist/src/spatial/dimensions/dimensions.d.ts +1 -1
- package/dist/src/spatial/dimensions/dimensions.d.ts.map +1 -1
- package/dist/src/spatial/direction/direction.d.ts +3 -3
- package/dist/src/spatial/direction/direction.d.ts.map +1 -1
- package/dist/src/spatial/location/location.d.ts +1 -1
- package/dist/src/spatial/location/location.d.ts.map +1 -1
- package/dist/src/spatial/scale/scale.d.ts +1 -1
- package/dist/src/spatial/scale/scale.d.ts.map +1 -1
- package/dist/src/spatial/xy/xy.d.ts +1 -1
- package/dist/src/spatial/xy/xy.d.ts.map +1 -1
- package/dist/src/status/index.d.ts +1 -1
- package/dist/src/status/index.d.ts.map +1 -1
- package/dist/src/status/status.d.ts +42 -0
- package/dist/src/status/status.d.ts.map +1 -0
- package/dist/src/status/status.spec.d.ts +2 -0
- package/dist/src/status/status.spec.d.ts.map +1 -0
- package/dist/src/strings/strings.d.ts +16 -0
- package/dist/src/strings/strings.d.ts.map +1 -1
- package/dist/src/telem/gl.d.ts +1 -1
- package/dist/src/telem/gl.d.ts.map +1 -1
- package/dist/src/telem/series.d.ts +17 -16
- package/dist/src/telem/series.d.ts.map +1 -1
- package/dist/src/telem/telem.d.ts +42 -19
- package/dist/src/telem/telem.d.ts.map +1 -1
- package/dist/src/testutil/testutil.d.ts +1 -0
- package/dist/src/testutil/testutil.d.ts.map +1 -1
- package/dist/src/testutil/testutil.spec.d.ts +2 -0
- package/dist/src/testutil/testutil.spec.d.ts.map +1 -0
- package/dist/src/zod/external.d.ts +1 -0
- package/dist/src/zod/external.d.ts.map +1 -1
- package/dist/src/zod/nullToUndefined.d.ts +1 -1
- package/dist/src/zod/nullToUndefined.d.ts.map +1 -1
- package/dist/src/zod/toArray.d.ts +3 -0
- package/dist/src/zod/toArray.d.ts.map +1 -0
- package/dist/src/zod/toArray.spec.d.ts +2 -0
- package/dist/src/zod/toArray.spec.d.ts.map +1 -0
- package/dist/src/zod/util.d.ts +1 -1
- package/dist/src/zod/util.d.ts.map +1 -1
- package/dist/telem.cjs +1 -1
- package/dist/telem.js +10 -11
- package/dist/url.cjs +1 -1
- package/dist/url.js +16 -19
- package/dist/worker.cjs +1 -1
- package/dist/worker.js +18 -22
- package/dist/xy-B7065J2S.cjs +1 -0
- package/dist/{index-C-qYOegc.js → xy-D_LqxaGt.js} +62 -62
- package/dist/xy.cjs +1 -1
- package/dist/xy.js +1 -1
- package/dist/zod.cjs +1 -1
- package/dist/zod.js +2 -19
- package/package.json +13 -18
- package/src/binary/codec.spec.ts +1 -1
- package/src/binary/codec.ts +1 -1
- package/src/breaker/breaker.ts +1 -1
- package/src/caseconv/caseconv.ts +10 -12
- package/src/change/change.ts +1 -1
- package/src/color/color.ts +1 -1
- package/src/color/gradient.ts +1 -1
- package/src/color/palette.ts +1 -1
- package/src/compare/compare.ts +5 -5
- package/src/control/control.ts +2 -2
- package/src/deep/merge.spec.ts +2 -15
- package/src/deep/merge.ts +1 -1
- package/src/deep/path.spec.ts +41 -0
- package/src/deep/path.ts +48 -17
- package/src/destructor.ts +6 -2
- package/src/errors/errors.spec.ts +20 -20
- package/src/errors/errors.ts +4 -1
- package/src/flush.ts +21 -0
- package/src/id/id.spec.ts +1 -1
- package/src/id/id.ts +3 -1
- package/src/identity.ts +2 -2
- package/src/index.ts +3 -1
- package/src/instance/matcher.spec.ts +7 -7
- package/src/jsonrpc/jsonrpc.ts +1 -1
- package/src/kv/types.ts +1 -1
- package/src/map/index.ts +10 -0
- package/src/map/map.spec.ts +132 -0
- package/src/map/map.ts +17 -0
- package/src/math/math.ts +19 -27
- package/src/migrate/migrate.spec.ts +2 -2
- package/src/migrate/migrate.ts +2 -2
- package/src/notation/notation.ts +1 -1
- package/src/optional.ts +0 -4
- package/src/primitive/primitive.spec.ts +1 -1
- package/src/record/index.ts +10 -0
- package/src/record/record.spec.ts +319 -0
- package/src/record/record.ts +118 -0
- package/src/runtime/os.ts +1 -1
- package/src/spatial/base.ts +1 -1
- package/src/spatial/box/box.ts +1 -1
- package/src/spatial/dimensions/dimensions.ts +1 -1
- package/src/spatial/direction/direction.ts +1 -1
- package/src/spatial/location/location.ts +1 -1
- package/src/spatial/scale/scale.ts +1 -1
- package/src/spatial/xy/xy.ts +1 -1
- package/src/status/index.ts +1 -1
- package/src/status/status.spec.ts +25 -0
- package/src/status/status.ts +91 -0
- package/src/strings/strings.spec.ts +51 -13
- package/src/strings/strings.ts +20 -0
- package/src/telem/gl.ts +1 -1
- package/src/telem/series.spec.ts +193 -53
- package/src/telem/series.ts +53 -18
- package/src/telem/telem.spec.ts +202 -83
- package/src/telem/telem.ts +53 -35
- package/src/testutil/testutil.spec.ts +161 -0
- package/src/testutil/testutil.ts +12 -0
- package/src/zod/external.ts +1 -0
- package/src/zod/nullToUndefined.spec.ts +1 -1
- package/src/zod/nullToUndefined.ts +1 -1
- package/src/zod/toArray.spec.ts +182 -0
- package/src/{status/types.ts → zod/toArray.ts} +3 -12
- package/src/zod/util.spec.ts +2 -2
- package/src/zod/util.ts +3 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/vite.config.ts +1 -2
- package/dist/base-B5lQIJKc.js +0 -38
- package/dist/base-CTq-lhpU.cjs +0 -1
- package/dist/index-B58dnYRu.cjs +0 -1
- package/dist/index-BMGaoK93.cjs +0 -1
- package/dist/index-BTet04Hd.cjs +0 -6
- package/dist/index-C07SBJhr.js +0 -128
- package/dist/index-C9EdKeu1.js +0 -174
- package/dist/index-CM8ZDZ6s.cjs +0 -1
- package/dist/index-CV2JaHfw.cjs +0 -1
- package/dist/index-CeBvOwG8.cjs +0 -3
- package/dist/index-ClrGyGDp.js +0 -205
- package/dist/index-CqQXXeCI.cjs +0 -1
- package/dist/index-DEdq2tza.cjs +0 -1
- package/dist/index-DKMnHBGR.cjs +0 -1
- package/dist/index-Dql5FMcH.js +0 -47
- package/dist/index-WwMnwoLy.cjs +0 -1
- package/dist/path-1tZLZ4AN.cjs +0 -1
- package/dist/path-DD6ytXzr.js +0 -76
- package/dist/schemas-55Usj0Fg.js +0 -3998
- package/dist/schemas-DbXuI2Qr.cjs +0 -27
- package/dist/search.cjs +0 -1
- package/dist/search.js +0 -14
- package/dist/src/record.d.ts +0 -18
- package/dist/src/record.d.ts.map +0 -1
- package/dist/src/record.spec.d.ts.map +0 -1
- package/dist/src/search.d.ts +0 -18
- package/dist/src/search.d.ts.map +0 -1
- package/dist/src/status/types.d.ts +0 -11
- package/dist/src/status/types.d.ts.map +0 -1
- package/src/record.spec.ts +0 -38
- package/src/record.ts +0 -45
- package/src/search.ts +0 -42
- /package/dist/src/{record.spec.d.ts → record/record.spec.d.ts} +0 -0
package/vite.config.ts
CHANGED
|
@@ -42,9 +42,8 @@ export default defineConfig({
|
|
|
42
42
|
debounce: path.resolve(".", "src/debounce/index.ts"),
|
|
43
43
|
destructor: path.resolve(".", "src/destructor.ts"),
|
|
44
44
|
array: path.resolve(".", "src/array/index.ts"),
|
|
45
|
-
search: path.resolve(".", "src/search.ts"),
|
|
46
45
|
unique: path.resolve(".", "src/unique/index.ts"),
|
|
47
|
-
record: path.resolve(".", "src/record.ts"),
|
|
46
|
+
record: path.resolve(".", "src/record/index.ts"),
|
|
48
47
|
change: path.resolve(".", "src/change/index.ts"),
|
|
49
48
|
identity: path.resolve(".", "src/identity.ts"),
|
|
50
49
|
caseconv: path.resolve(".", "src/caseconv/index.ts"),
|
package/dist/base-B5lQIJKc.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { t as i, n as t, b as o, o as n, _ as s, u as c, a as O } from "./schemas-55Usj0Fg.js";
|
|
2
|
-
const e = i([t(), t()]);
|
|
3
|
-
i([o(), o()]);
|
|
4
|
-
const E = n({ width: t(), height: t() }), T = n({
|
|
5
|
-
signedWidth: t(),
|
|
6
|
-
signedHeight: t()
|
|
7
|
-
}), u = ["width", "height"];
|
|
8
|
-
s(u);
|
|
9
|
-
const N = ["start", "center", "end"], S = ["signedWidth", "signedHeight"];
|
|
10
|
-
s(S);
|
|
11
|
-
const D = n({ x: t(), y: t() }), _ = n({ clientX: t(), clientY: t() }), h = ["x", "y"], a = s(h), r = ["top", "right", "bottom", "left"], A = s(r), l = ["left", "right"], f = s(l), I = ["top", "bottom"], x = s(I), d = ["center"], y = s(d), p = [...r, ...d], g = s(p), R = s(N), L = ["first", "last"], w = s(L), b = n({ lower: t(), upper: t() }), m = n({ lower: o(), upper: o() });
|
|
12
|
-
c([b, e]);
|
|
13
|
-
c([m, e]);
|
|
14
|
-
const X = s([...a.options, ...g.options]), Y = c([a, g, O(String)]);
|
|
15
|
-
export {
|
|
16
|
-
N as A,
|
|
17
|
-
d as C,
|
|
18
|
-
h as D,
|
|
19
|
-
L as O,
|
|
20
|
-
l as X,
|
|
21
|
-
I as Y,
|
|
22
|
-
a,
|
|
23
|
-
b,
|
|
24
|
-
X as c,
|
|
25
|
-
E as d,
|
|
26
|
-
f as e,
|
|
27
|
-
y as f,
|
|
28
|
-
Y as g,
|
|
29
|
-
_ as h,
|
|
30
|
-
R as i,
|
|
31
|
-
w as j,
|
|
32
|
-
g as l,
|
|
33
|
-
e as n,
|
|
34
|
-
A as o,
|
|
35
|
-
T as s,
|
|
36
|
-
D as x,
|
|
37
|
-
x as y
|
|
38
|
-
};
|
package/dist/base-CTq-lhpU.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const n=require("./schemas-DbXuI2Qr.cjs"),t=n.tuple([n.number(),n.number()]);n.tuple([n.bigint(),n.bigint()]);const O=n.object({width:n.number(),height:n.number()}),N=n.object({signedWidth:n.number(),signedHeight:n.number()}),g=["width","height"];n._enum(g);const c=["start","center","end"],L=["signedWidth","signedHeight"];n._enum(L);const S=n.object({x:n.number(),y:n.number()}),_=n.object({clientX:n.number(),clientY:n.number()}),s=["x","y"],o=n._enum(s),u=["top","right","bottom","left"],I=n._enum(u),r=["left","right"],a=n._enum(r),m=["top","bottom"],l=n._enum(m),e=["center"],T=n._enum(e),C=[...u,...e],i=n._enum(C),E=n._enum(c),b=["first","last"],h=n._enum(b),d=n.object({lower:n.number(),upper:n.number()}),p=n.object({lower:n.bigint(),upper:n.bigint()});n.union([d,t]);n.union([p,t]);const D=n._enum([...o.options,...i.options]),A=n.union([o,i,n._instanceof(String)]);exports.ALIGNMENTS=c;exports.CENTER_LOCATIONS=e;exports.DIRECTIONS=s;exports.ORDERS=b;exports.X_LOCATIONS=r;exports.Y_LOCATIONS=m;exports.alignment=E;exports.bounds=d;exports.centerLocation=T;exports.clientXY=_;exports.crudeDirection=D;exports.crudeLocation=A;exports.dimensions=O;exports.direction=o;exports.location=i;exports.numberCouple=t;exports.order=h;exports.outerLocation=I;exports.signedDimensions=N;exports.xLocation=a;exports.xy=S;exports.yLocation=l;
|
package/dist/index-B58dnYRu.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const i=require("./base-CTq-lhpU.cjs"),n=i.crudeDirection,t=e=>i.DIRECTIONS.includes(e)?e:i.Y_LOCATIONS.includes(e)?"y":"x",o=e=>t(e)==="x"?"y":"x",s=e=>t(e)==="x"?"width":"height",c=e=>t(e)==="x"?"left":"top",r=e=>n.safeParse(e).success,d=e=>t(e)==="x"?"signedWidth":"signedHeight",u=Object.freeze(Object.defineProperty({__proto__:null,construct:t,crude:n,dimension:s,direction:i.direction,isDirection:r,location:c,signedDimension:d,swap:o},Symbol.toStringTag,{value:"Module"}));exports.construct=t;exports.direction=u;
|
package/dist/index-BMGaoK93.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const R=require("./index-B58dnYRu.cjs"),x=require("./index-CqQXXeCI.cjs"),i=require("./index-WwMnwoLy.cjs"),u=require("./schemas-DbXuI2Qr.cjs"),m=require("./base-CTq-lhpU.cjs"),p=u.union([u.number(),u.string()]),W=u.object({top:p,left:p,width:p,height:p}),S=u.object({left:u.number(),top:u.number(),right:u.number(),bottom:u.number()}),v=u.object({one:m.xy,two:m.xy,root:x.corner}),C={one:i.ZERO,two:i.ZERO,root:x.TOP_LEFT},z={one:i.ZERO,two:i.ONE,root:x.BOTTOM_LEFT},I=(t,o)=>({one:t.one,two:t.two,root:o??t.root}),c=(t,o,e=0,n=0,s)=>{const r={one:{...i.ZERO},two:{...i.ZERO},root:s??x.TOP_LEFT};if(typeof t=="number"){if(typeof o!="number")throw new Error("Box constructor called with invalid arguments");return r.one={x:t,y:o},r.two={x:r.one.x+e,y:r.one.y+n},r}return"one"in t&&"two"in t&&"root"in t?{...t,root:s??t.root}:("getBoundingClientRect"in t&&(t=t.getBoundingClientRect()),"left"in t?(r.one={x:t.left,y:t.top},r.two={x:t.right,y:t.bottom},r):(r.one=t,o==null?r.two={x:r.one.x+e,y:r.one.y+n}:typeof o=="number"?r.two={x:r.one.x+o,y:r.one.y+e}:"width"in o?r.two={x:r.one.x+o.width,y:r.one.y+o.height}:"signedWidth"in o?r.two={x:r.one.x+o.signedWidth,y:r.one.y+o.signedHeight}:r.two=o,r))},G=(t,o,e)=>{const n=c(t);if(typeof o=="string"){if(e==null)throw new Error("Invalid arguments for resize");const s=R.construct(o);return c(n.one,void 0,s==="x"?e:w(n),s==="y"?e:d(n),n.root)}return c(n.one,o,void 0,void 0,n.root)},D=(t,o,e=!0)=>{const n=c(t);let s=(r,y)=>r<y;return e&&(s=(r,y)=>r<=y),"one"in o?s(a(n),a(o))&&s(h(o),h(n))&&s(f(n),f(o))&&s(_(o),_(n)):s(a(n),o.x)&&s(o.x,h(n))&&s(f(n),o.y)&&s(o.y,_(n))},X=(t,o)=>i.equals(t.one,o.one)&&i.equals(t.two,o.two)&&x.xyEquals(t.root,o.root),q=t=>({width:w(t),height:d(t)}),$=t=>({signedWidth:O(t),signedHeight:E(t)}),U=t=>({top:f(t),left:a(t),width:w(t),height:d(t)}),L=(t,o,e=!1)=>{const n=R.construct(o)==="y"?E(t):O(t);return e?n:Math.abs(n)},l=(t,o)=>{const e=c(t);return{x:o.x==="center"?b(e).x:g(e,o.x),y:o.y==="center"?b(e).y:g(e,o.y)}},g=(t,o)=>{const e=c(t),n=x.xyCouple(e.root).includes(o)?Math.min:Math.max;return m.X_LOCATIONS.includes(o)?n(e.one.x,e.two.x):n(e.one.y,e.two.y)},Y=t=>t.one.x===t.two.x&&t.one.y===t.two.y,w=t=>L(t,"x"),d=t=>L(t,"y"),O=t=>{const o=c(t);return o.two.x-o.one.x},E=t=>{const o=c(t);return o.two.y-o.one.y},N=t=>l(t,x.TOP_LEFT),k=t=>l(t,x.TOP_CENTER),J=t=>l(t,x.TOP_RIGHT),K=t=>l(t,x.BOTTOM_LEFT),Q=t=>l(t,x.BOTTOM_CENTER),V=t=>l(t,x.BOTTOM_RIGHT),tt=t=>l(t,x.CENTER_LEFT),ot=t=>l(t,x.CENTER_RIGHT),h=t=>g(t,"right"),_=t=>g(t,"bottom"),a=t=>g(t,"left"),f=t=>g(t,"top"),b=t=>i.translate(N(t),{x:O(t)/2,y:E(t)/2}),M=t=>{const o=c(t);return o.root.x==="left"?a(o):h(o)},B=t=>{const o=c(t);return o.root.y==="top"?f(o):_(o)},nt=t=>({x:M(t),y:B(t)}),P=t=>{const o=c(t);return{lower:o.one.x,upper:o.two.x}},Z=t=>{const o=c(t);return{lower:o.one.y,upper:o.two.y}},et=(t,o)=>I(t,o),rt=(t,o)=>{const e=c(t),n=m.X_LOCATIONS.includes(o)?"x":m.Y_LOCATIONS.includes(o)?"y":null;if(n===null)throw new Error(`Invalid location: ${o}`);const s=o==="top"||o==="left"?Math.min:Math.max,r={...e.one},y={...e.two};return r[n]=s(e.one[n],e.two[n]),y[n]=s(e.one[n],e.two[n]),[r,y]},st=(t,o)=>{const e=c(t),n=c(o),s=M(n)+(w(n)-w(e))/2,r=B(n)+(d(n)-d(e))/2;return c({x:s,y:r},q(e))},j=t=>typeof t!="object"||t==null?!1:"one"in t&&"two"in t&&"root"in t,ct=t=>w(t)/d(t),it=(t,o,e)=>{if(typeof o=="string"){if(e==null)throw new Error("Undefined amount passed into box.translate");const s=R.construct(o);o=i.construct(s,e)}const n=c(t);return c(i.translate(n.one,o),i.translate(n.two,o),void 0,void 0,n.root)},A=(t,o)=>{const e=Math.max(a(t),a(o)),n=Math.max(f(t),f(o)),s=Math.min(h(t),h(o)),r=Math.min(_(t),_(o));return e>s||n>r?C:c({x:e,y:n},{x:s,y:r},void 0,void 0,t.root)},F=t=>w(t)*d(t),xt=(t,o)=>{const e=c(t);return c(i.truncate(e.one,o),i.truncate(e.two,o),void 0,void 0,e.root)},H=(t,o,e,n,s,r)=>{const y={x:t,y:o},T={x:t+e,y:o+n};return s.x!==r.x&&(s.x==="center"?(y.x-=e/2,T.x-=e/2):(y.x-=e,T.x-=e)),s.y!==r.y&&(s.y==="center"?(y.y-=n/2,T.y-=n/2):(y.y-=n,T.y-=n)),c(y,T,void 0,void 0,r)},yt=Object.freeze(Object.defineProperty({__proto__:null,DECIMAL:z,ZERO:C,area:F,areaIsZero:Y,aspect:ct,bottom:_,bottomCenter:Q,bottomLeft:K,bottomRight:V,box:v,center:b,centerLeft:tt,centerRight:ot,construct:c,constructWithAlternateRoot:H,contains:D,copy:I,css:U,cssBox:W,dim:L,dims:q,domRect:S,edgePoints:rt,equals:X,height:d,intersection:A,isBox:j,left:a,loc:g,positionInCenter:st,reRoot:et,resize:G,right:h,root:nt,signedDims:$,signedHeight:E,signedWidth:O,top:f,topCenter:k,topLeft:N,topRight:J,translate:it,truncate:xt,width:w,x:M,xBounds:P,xyLoc:l,y:B,yBounds:Z},Symbol.toStringTag,{value:"Module"}));exports.area=F;exports.box=yt;exports.construct=c;exports.constructWithAlternateRoot=H;exports.height=d;exports.intersection=A;exports.isBox=j;exports.width=w;exports.xBounds=P;exports.xyLoc=l;exports.yBounds=Z;
|
package/dist/index-BTet04Hd.cjs
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";var ut=Object.defineProperty;var ot=(s,t,e)=>t in s?ut(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var i=(s,t,e)=>ot(s,typeof t!="symbol"?t+"":t,e);const V=require("./index-CeBvOwG8.cjs"),lt=require("./index-DKMnHBGR.cjs"),D=require("./index-CV2JaHfw.cjs"),b=require("./index-CM8ZDZ6s.cjs");require("./index-BMGaoK93.cjs");require("./dimensions.cjs");require("./base-CTq-lhpU.cjs");require("./index-CqQXXeCI.cjs");require("./index-DEdq2tza.cjs");require("./index-WwMnwoLy.cjs");const l=require("./schemas-DbXuI2Qr.cjs");function ct(s){return l._coercedString(l.ZodString,s)}function ft(s){return l._coercedNumber(l.ZodNumber,s)}function ht(s){return l._coercedBoolean(l.ZodBoolean,s)}function K(s){return l._coercedBigint(l.ZodBigInt,s)}function dt(s){return l._coercedDate(l.ZodDate,s)}const gt=Object.freeze(Object.defineProperty({__proto__:null,bigint:K,boolean:ht,date:dt,number:ft,string:ct},Symbol.toStringTag,{value:"Module"}));let mt=(s,t=21)=>(e=t)=>{let n="",a=e|0;for(;a--;)n+=s[Math.random()*s.length|0];return n};const Ot="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",yt=mt(Ot,11),X=()=>yt(),bt=Object.freeze(Object.defineProperty({__proto__:null,create:X},Symbol.toStringTag,{value:"Module"})),Q=(s,t)=>e=>e instanceof t||typeof e=="object"&&e!==null&&"discriminator"in e&&e.discriminator===s,wt=Object.freeze(Object.defineProperty({__proto__:null,createMatcher:Q},Symbol.toStringTag,{value:"Module"})),It=l._enum(["static","dynamic"]),_=(s,t)=>{const e=new g(t);if(![m.DAY,m.HOUR,m.MINUTE,m.SECOND,m.MILLISECOND,m.MICROSECOND,m.NANOSECOND].some(a=>a.equals(e)))throw new Error("Invalid argument for remainder. Must be an even TimeSpan or Timestamp");const n=s.valueOf()%e.valueOf();return s instanceof g?new g(n):new m(n)},u=class u extends D.ValueExtension{constructor(t,e="UTC"){if(t==null)super(u.now().valueOf());else if(t instanceof Date)super(BigInt(t.getTime())*u.MILLISECOND.valueOf());else if(typeof t=="string")super(u.parseDateTimeString(t,e).valueOf());else if(Array.isArray(t))super(u.parseDate(t));else{let n=BigInt(0);t instanceof Number&&(t=t.valueOf()),e==="local"&&(n=u.utcOffset.valueOf()),typeof t=="number"&&(isFinite(t)?t=Math.trunc(t):(isNaN(t)&&(t=0),t===1/0?t=u.MAX:t=u.MIN)),super(BigInt(t.valueOf())+n)}}static parseDate([t=1970,e=1,n=1]){const a=new Date(t,e-1,n,0,0,0,0);return new u(BigInt(a.getTime())*u.MILLISECOND.valueOf()).truncate(u.DAY).valueOf()}valueOf(){return this.value}static parseTimeString(t,e="UTC"){const[n,a,f]=t.split(":");let d="00",U="00";f!=null&&([d,U]=f.split("."));let y=u.hours(parseInt(n??"00")).add(u.minutes(parseInt(a??"00"))).add(u.seconds(parseInt(d??"00"))).add(u.milliseconds(parseInt(U??"00")));return e==="local"&&(y=y.add(u.utcOffset)),y.valueOf()}static parseDateTimeString(t,e="UTC"){if(!t.includes("/")&&!t.includes("-"))return u.parseTimeString(t,e);const n=new Date(t);return t.includes(":")||n.setUTCHours(0,0,0,0),new u(BigInt(n.getTime())*u.MILLISECOND.valueOf(),e).valueOf()}fString(t="ISO",e="UTC"){switch(t){case"ISODate":return this.toISOString(e).slice(0,10);case"ISOTime":return this.toISOString(e).slice(11,23);case"time":return this.timeString(!1,e);case"preciseTime":return this.timeString(!0,e);case"date":return this.dateString();case"preciseDate":return`${this.dateString()} ${this.timeString(!0,e)}`;case"dateTime":return`${this.dateString()} ${this.timeString(!1,e)}`;default:return this.toISOString(e)}}toISOString(t="UTC"){return t==="UTC"?this.date().toISOString():this.sub(u.utcOffset).date().toISOString()}timeString(t=!1,e="UTC"){const n=this.toISOString(e);return t?n.slice(11,23):n.slice(11,19)}dateString(){const t=this.date(),e=t.toLocaleString("default",{month:"short"}),n=t.toLocaleString("default",{day:"numeric"});return`${e} ${n}`}static get utcOffset(){return new m(BigInt(new Date().getTimezoneOffset())*u.MINUTE.valueOf())}static since(t){return new u().span(t)}date(){return new Date(this.milliseconds)}equals(t){return this.valueOf()===new u(t).valueOf()}span(t){return this.range(t).span}range(t){return new A(this,t).makeValid()}spanRange(t){return this.range(this.add(t)).makeValid()}get isZero(){return this.valueOf()===BigInt(0)}after(t){return this.valueOf()>new u(t).valueOf()}afterEq(t){return this.valueOf()>=new u(t).valueOf()}before(t){return this.valueOf()<new u(t).valueOf()}beforeEq(t){return this.valueOf()<=new u(t).valueOf()}add(t){return new u(this.valueOf()+BigInt(t.valueOf()))}sub(t){return new u(this.valueOf()-BigInt(t.valueOf()))}get hours(){return Number(this.valueOf())/Number(m.HOUR.valueOf())}get minutes(){return Number(this.valueOf())/Number(m.MINUTE.valueOf())}get days(){return Number(this.valueOf())/Number(m.DAY.valueOf())}get seconds(){return Number(this.valueOf())/Number(m.SECOND.valueOf())}get milliseconds(){return Number(this.valueOf())/Number(u.MILLISECOND.valueOf())}get microseconds(){return Number(this.valueOf())/Number(u.MICROSECOND.valueOf())}get nanoseconds(){return Number(this.valueOf())}get year(){return this.date().getUTCFullYear()}setYear(t){const e=this.date();return e.setUTCFullYear(t),new u(e)}get month(){return this.date().getUTCMonth()}setMonth(t){const e=this.date();return e.setUTCMonth(t),new u(e)}get day(){return this.date().getUTCDate()}setDay(t){const e=this.date();return e.setUTCDate(t),new u(e)}get hour(){return this.date().getUTCHours()}setHour(t){const e=this.date();return e.setUTCHours(t),new u(e,"UTC")}get minute(){return this.date().getUTCMinutes()}setMinute(t){const e=this.date();return e.setUTCMinutes(t),new u(e)}get second(){return this.date().getUTCSeconds()}setSecond(t){const e=this.date();return e.setUTCSeconds(t),new u(e)}get millisecond(){return this.date().getUTCMilliseconds()}setMillisecond(t){const e=this.date();return e.setUTCMilliseconds(t),new u(e)}toString(){return this.date().toISOString()}remainder(t){return _(this,t)}get isToday(){return this.truncate(m.DAY).equals(u.now().truncate(m.DAY))}truncate(t){return this.sub(this.remainder(t))}static now(){return new u(new Date)}static max(...t){let e=u.MIN;for(const n of t){const a=new u(n);a.after(e)&&(e=a)}return e}static min(...t){let e=u.MAX;for(const n of t){const a=new u(n);a.before(e)&&(e=a)}return e}static nanoseconds(t,e="UTC"){return new u(t,e)}static microseconds(t,e="UTC"){return u.nanoseconds(t*1e3,e)}static milliseconds(t,e="UTC"){return u.microseconds(t*1e3,e)}static seconds(t,e="UTC"){return u.milliseconds(t*1e3,e)}static minutes(t,e="UTC"){return u.seconds(t*60,e)}static hours(t,e="UTC"){return u.minutes(t*60,e)}static days(t,e="UTC"){return u.hours(t*24,e)}};i(u,"NANOSECOND",u.nanoseconds(1)),i(u,"MICROSECOND",u.microseconds(1)),i(u,"MILLISECOND",u.milliseconds(1)),i(u,"SECOND",u.seconds(1)),i(u,"MINUTE",u.minutes(1)),i(u,"HOUR",u.hours(1)),i(u,"DAY",u.days(1)),i(u,"MAX",new u((1n<<63n)-1n)),i(u,"MIN",new u(0)),i(u,"ZERO",new u(0)),i(u,"z",l.union([l.object({value:l.bigint()}).transform(t=>new u(t.value)),l.string().transform(t=>new u(BigInt(t))),l._instanceof(Number).transform(t=>new u(t)),l.number().transform(t=>new u(t)),l._instanceof(u)]));let g=u;const o=class o extends D.ValueExtension{constructor(t){typeof t=="number"&&(t=Math.trunc(t.valueOf())),super(BigInt(t.valueOf()))}static fromSeconds(t){return t instanceof o?t:t instanceof q?t.period:t instanceof g?new o(t):["number","bigint"].includes(typeof t)?o.seconds(t):new o(t)}static fromMilliseconds(t){return t instanceof o?t:t instanceof q?t.period:t instanceof g?new o(t):["number","bigint"].includes(typeof t)?o.milliseconds(t):new o(t)}valueOf(){return this.value}lessThan(t){return this.valueOf()<new o(t).valueOf()}greaterThan(t){return this.valueOf()>new o(t).valueOf()}lessThanOrEqual(t){return this.valueOf()<=new o(t).valueOf()}greaterThanOrEqual(t){return this.valueOf()>=new o(t).valueOf()}remainder(t){return _(this,t)}truncate(t){return new o(BigInt(Math.trunc(Number(this.valueOf()/t.valueOf())))*t.valueOf())}toString(){const t=this.truncate(o.DAY),e=this.truncate(o.HOUR),n=this.truncate(o.MINUTE),a=this.truncate(o.SECOND),f=this.truncate(o.MILLISECOND),d=this.truncate(o.MICROSECOND),U=this.truncate(o.NANOSECOND),y=t,S=e.sub(t),B=n.sub(e),c=a.sub(n),M=f.sub(a),v=d.sub(f),j=U.sub(d);let C="";return y.isZero||(C+=`${y.days}d `),S.isZero||(C+=`${S.hours}h `),B.isZero||(C+=`${B.minutes}m `),c.isZero||(C+=`${c.seconds}s `),M.isZero||(C+=`${M.milliseconds}ms `),v.isZero||(C+=`${v.microseconds}µs `),j.isZero||(C+=`${j.nanoseconds}ns`),C.trim()}mult(t){return new o(this.valueOf()*BigInt(t))}get days(){return Number(this.valueOf())/Number(o.DAY.valueOf())}get hours(){return Number(this.valueOf())/Number(o.HOUR.valueOf())}get minutes(){return Number(this.valueOf())/Number(o.MINUTE.valueOf())}get seconds(){return Number(this.valueOf())/Number(o.SECOND.valueOf())}get milliseconds(){return Number(this.valueOf())/Number(o.MILLISECOND.valueOf())}get microseconds(){return Number(this.valueOf())/Number(o.MICROSECOND.valueOf())}get nanoseconds(){return Number(this.valueOf())}get isZero(){return this.valueOf()===BigInt(0)}equals(t){return this.valueOf()===new o(t).valueOf()}add(t){return new o(this.valueOf()+new o(t).valueOf())}sub(t){return new o(this.valueOf()-new o(t).valueOf())}static nanoseconds(t=1){return new o(t)}static microseconds(t=1){return o.nanoseconds(b.mult(t,1e3))}static milliseconds(t=1){return o.microseconds(b.mult(t,1e3))}static seconds(t=1){return o.milliseconds(b.mult(t,1e3))}static minutes(t=1){return o.seconds(b.mult(t,60))}static hours(t){return o.minutes(b.mult(t,60))}static days(t){return o.hours(b.mult(t,24))}};i(o,"NANOSECOND",o.nanoseconds(1)),i(o,"MICROSECOND",o.microseconds(1)),i(o,"MILLISECOND",o.milliseconds(1)),i(o,"SECOND",o.seconds(1)),i(o,"MINUTE",o.minutes(1)),i(o,"HOUR",o.hours(1)),i(o,"DAY",o.days(1)),i(o,"MAX",new o((1n<<63n)-1n)),i(o,"MIN",new o(0)),i(o,"ZERO",new o(0)),i(o,"z",l.union([l.object({value:l.bigint()}).transform(t=>new o(t.value)),l.string().transform(t=>new o(BigInt(t))),l._instanceof(Number).transform(t=>new o(t)),l.number().transform(t=>new o(t)),l._instanceof(o)]));let m=o;const E=class E extends D.ValueExtension{constructor(t){super(t.valueOf())}toString(){return`${this.valueOf()} Hz`}equals(t){return this.valueOf()===new E(t).valueOf()}get period(){return m.seconds(1/this.valueOf())}sampleCount(t){return new m(t).seconds*this.valueOf()}byteCount(t,e){return this.sampleCount(t)*new I(e).valueOf()}span(t){return m.seconds(t/this.valueOf())}byteSpan(t,e){return this.span(t.valueOf()/e.valueOf())}static hz(t){return new E(t)}static khz(t){return E.hz(t*1e3)}};i(E,"z",l.union([l.number().transform(t=>new E(t)),l._instanceof(Number).transform(t=>new E(t)),l._instanceof(E)]));let q=E;const w=class w extends D.ValueExtension{constructor(t){super(t.valueOf())}length(t){return t.valueOf()/this.valueOf()}size(t){return new x(t*this.valueOf())}};i(w,"UNKNOWN",new w(0)),i(w,"BIT128",new w(16)),i(w,"BIT64",new w(8)),i(w,"BIT32",new w(4)),i(w,"BIT16",new w(2)),i(w,"BIT8",new w(1)),i(w,"z",l.union([l.number().transform(t=>new w(t)),l._instanceof(Number).transform(t=>new w(t)),l._instanceof(w)]));let I=w;const N=class N{constructor(t,e){i(this,"start");i(this,"end");typeof t=="object"&&"start"in t?(this.start=new g(t.start),this.end=new g(t.end)):(this.start=new g(t),this.end=new g(e))}get span(){return new m(this.end.valueOf()-this.start.valueOf())}get isValid(){return this.start.valueOf()<=this.end.valueOf()}makeValid(){return this.isValid?this:this.swap()}get isZero(){return this.span.isZero}get numeric(){return{start:Number(this.start.valueOf()),end:Number(this.end.valueOf())}}swap(){return new N(this.end,this.start)}get numericBounds(){return{lower:Number(this.start.valueOf()),upper:Number(this.end.valueOf())}}equals(t,e=m.ZERO){if(e.isZero)return this.start.equals(t.start)&&this.end.equals(t.end);let n=this.start.sub(t.start).valueOf(),a=this.end.sub(t.end).valueOf();return n<0&&(n=-n),a<0&&(a=-a),n<=e.valueOf()&&a<=e.valueOf()}toString(){return`${this.start.toString()} - ${this.end.toString()}`}toPrettyString(){return`${this.start.fString("preciseDate")} - ${this.span.toString()}`}overlapsWith(t,e=m.ZERO){t=t.makeValid();const n=this.makeValid();if(this.equals(t))return!0;if(t.end.equals(n.start)||n.end.equals(t.start))return!1;const a=g.max(n.start,t.start),f=g.min(n.end,t.end);return f.before(a)?!1:new m(f.sub(a)).greaterThanOrEqual(e)}contains(t){return t instanceof N?this.contains(t.start)&&this.contains(t.end):this.start.beforeEq(t)&&this.end.after(t)}boundBy(t){const e=new N(this.start,this.end);return t.start.after(this.start)&&(e.start=t.start),t.start.after(this.end)&&(e.end=t.start),t.end.before(this.end)&&(e.end=t.end),t.end.before(this.start)&&(e.start=t.end),e}static max(...t){return new N(g.min(...t.map(e=>e.start)),g.max(...t.map(e=>e.end)))}};i(N,"MAX",new N(g.MIN,g.MAX)),i(N,"MIN",new N(g.MAX,g.MIN)),i(N,"ZERO",new N(g.ZERO,g.ZERO)),i(N,"z",l.union([l.object({start:g.z,end:g.z}).transform(t=>new N(t.start,t.end)),l._instanceof(N)]));let A=N;const Tt=(s,t)=>s.start.before(t.start)?-1:s.start.after(t.start)?1:s.end.before(t.end)?-1:s.end.after(t.end)?1:0,r=class r extends D.ValueExtension{constructor(t){if(t instanceof r||typeof t=="string"||typeof t.valueOf()=="string")super(t.valueOf());else{const e=r.ARRAY_CONSTRUCTOR_DATA_TYPES.get(t.constructor.name);if(e==null)throw new Error(`unable to find data type for ${t.toString()}`);super(e.valueOf())}}get Array(){const t=r.ARRAY_CONSTRUCTORS.get(this.toString());if(t==null)throw new Error(`unable to find array constructor for ${this.valueOf()}`);return t}equals(t){return this.valueOf()===t.valueOf()}matches(...t){return t.some(e=>this.equals(e))}toString(){return this.valueOf()}get isVariable(){return this.equals(r.JSON)||this.equals(r.STRING)}get isNumeric(){return!this.isVariable&&!this.equals(r.UUID)}get isInteger(){const t=this.toString();return t.startsWith("int")||t.startsWith("uint")}get isFloat(){return this.toString().startsWith("float")}get density(){const t=r.DENSITIES.get(this.toString());if(t==null)throw new Error(`unable to find density for ${this.valueOf()}`);return t}get isUnsignedInteger(){return this.equals(r.UINT8)||this.equals(r.UINT16)||this.equals(r.UINT32)||this.equals(r.UINT64)}get isSignedInteger(){return this.equals(r.INT8)||this.equals(r.INT16)||this.equals(r.INT32)||this.equals(r.INT64)}canSafelyCastTo(t){return this.equals(t)?!0:!this.isNumeric||!t.isNumeric||this.isVariable||t.isVariable||this.isUnsignedInteger&&t.isSignedInteger?!1:this.isFloat?t.isFloat&&this.density.valueOf()<=t.density.valueOf():this.equals(r.INT32)&&t.equals(r.FLOAT64)||this.equals(r.INT8)&&t.equals(r.FLOAT32)?!0:this.isInteger&&t.isInteger?this.density.valueOf()<=t.density.valueOf()&&this.isUnsignedInteger===t.isUnsignedInteger:!1}canCastTo(t){return this.isNumeric&&t.isNumeric?!0:this.equals(t)}checkArray(t){return t.constructor===this.Array}get usesBigInt(){return r.BIG_INT_TYPES.some(t=>t.equals(this))}};i(r,"UNKNOWN",new r("unknown")),i(r,"FLOAT64",new r("float64")),i(r,"FLOAT32",new r("float32")),i(r,"INT64",new r("int64")),i(r,"INT32",new r("int32")),i(r,"INT16",new r("int16")),i(r,"INT8",new r("int8")),i(r,"UINT64",new r("uint64")),i(r,"UINT32",new r("uint32")),i(r,"UINT16",new r("uint16")),i(r,"UINT8",new r("uint8")),i(r,"BOOLEAN",r.UINT8),i(r,"TIMESTAMP",new r("timestamp")),i(r,"UUID",new r("uuid")),i(r,"STRING",new r("string")),i(r,"JSON",new r("json")),i(r,"ARRAY_CONSTRUCTORS",new Map([[r.UINT8.toString(),Uint8Array],[r.UINT16.toString(),Uint16Array],[r.UINT32.toString(),Uint32Array],[r.UINT64.toString(),BigUint64Array],[r.FLOAT32.toString(),Float32Array],[r.FLOAT64.toString(),Float64Array],[r.INT8.toString(),Int8Array],[r.INT16.toString(),Int16Array],[r.INT32.toString(),Int32Array],[r.INT64.toString(),BigInt64Array],[r.TIMESTAMP.toString(),BigInt64Array],[r.STRING.toString(),Uint8Array],[r.JSON.toString(),Uint8Array],[r.UUID.toString(),Uint8Array]])),i(r,"ARRAY_CONSTRUCTOR_DATA_TYPES",new Map([[Uint8Array.name,r.UINT8],[Uint16Array.name,r.UINT16],[Uint32Array.name,r.UINT32],[BigUint64Array.name,r.UINT64],[Float32Array.name,r.FLOAT32],[Float64Array.name,r.FLOAT64],[Int8Array.name,r.INT8],[Int16Array.name,r.INT16],[Int32Array.name,r.INT32],[BigInt64Array.name,r.INT64]])),i(r,"DENSITIES",new Map([[r.UINT8.toString(),I.BIT8],[r.UINT16.toString(),I.BIT16],[r.UINT32.toString(),I.BIT32],[r.UINT64.toString(),I.BIT64],[r.FLOAT32.toString(),I.BIT32],[r.FLOAT64.toString(),I.BIT64],[r.INT8.toString(),I.BIT8],[r.INT16.toString(),I.BIT16],[r.INT32.toString(),I.BIT32],[r.INT64.toString(),I.BIT64],[r.TIMESTAMP.toString(),I.BIT64],[r.STRING.toString(),I.UNKNOWN],[r.JSON.toString(),I.UNKNOWN],[r.UUID.toString(),I.BIT128]])),i(r,"ALL",[r.UNKNOWN,r.FLOAT64,r.FLOAT32,r.INT64,r.INT32,r.INT16,r.INT8,r.UINT64,r.UINT32,r.UINT16,r.UINT8,r.TIMESTAMP,r.UUID,r.STRING,r.JSON]),i(r,"BIG_INT_TYPES",[r.INT64,r.UINT64,r.TIMESTAMP]),i(r,"z",l.union([l.string().transform(t=>new r(t)),l._instanceof(r)]));let O=r;const h=class h extends D.ValueExtension{constructor(t){super(t.valueOf())}largerThan(t){return this.valueOf()>t.valueOf()}smallerThan(t){return this.valueOf()<t.valueOf()}add(t){return h.bytes(this.valueOf()+t.valueOf())}sub(t){return h.bytes(this.valueOf()-t.valueOf())}truncate(t){return new h(Math.trunc(this.valueOf()/t.valueOf())*t.valueOf())}remainder(t){return h.bytes(this.valueOf()%t.valueOf())}get gigabytes(){return this.valueOf()/h.GIGABYTE.valueOf()}get megabytes(){return this.valueOf()/h.MEGABYTE.valueOf()}get kilobytes(){return this.valueOf()/h.KILOBYTE.valueOf()}get terabytes(){return this.valueOf()/h.TERABYTE.valueOf()}toString(){const t=this.truncate(h.TERABYTE),e=this.truncate(h.GIGABYTE),n=this.truncate(h.MEGABYTE),a=this.truncate(h.KILOBYTE),f=this.truncate(h.BYTE),d=t,U=e.sub(t),y=n.sub(e),S=a.sub(n),B=f.sub(a);let c="";return d.isZero||(c+=`${d.terabytes}TB `),U.isZero||(c+=`${U.gigabytes}GB `),y.isZero||(c+=`${y.megabytes}MB `),S.isZero||(c+=`${S.kilobytes}KB `),(!B.isZero||c==="")&&(c+=`${B.valueOf()}B`),c.trim()}static bytes(t=1){return new h(t)}static kilobytes(t=1){return h.bytes(t.valueOf()*1e3)}static megabytes(t=1){return h.kilobytes(t.valueOf()*1e3)}static gigabytes(t=1){return h.megabytes(t.valueOf()*1e3)}static terabytes(t){return h.gigabytes(t.valueOf()*1e3)}get isZero(){return this.valueOf()===0}};i(h,"BYTE",new h(1)),i(h,"KILOBYTE",h.kilobytes(1)),i(h,"MEGABYTE",h.megabytes(1)),i(h,"GIGABYTE",h.gigabytes(1)),i(h,"TERABYTE",h.terabytes(1)),i(h,"ZERO",new h(0)),i(h,"z",l.union([l.number().transform(t=>new h(t)),l._instanceof(h)]));let x=h;const Nt=l.union([l._instanceof(Uint8Array),l._instanceof(Uint16Array),l._instanceof(Uint32Array),l._instanceof(BigUint64Array),l._instanceof(Float32Array),l._instanceof(Float64Array),l._instanceof(Int8Array),l._instanceof(Int16Array),l._instanceof(Int32Array),l._instanceof(BigInt64Array)]),J=s=>{const t=typeof s;return t==="string"||t==="number"||t==="boolean"||t==="bigint"||s instanceof g||s instanceof m||s instanceof Date},tt=(s,t,e,n=0)=>s.usesBigInt&&!t.usesBigInt?Number(e)-Number(n):!s.usesBigInt&&t.usesBigInt?BigInt(e.valueOf())-BigInt(n.valueOf()):L(e,-n).valueOf(),L=(s,t)=>t==0?s:s==0?t:typeof s=="bigint"&&typeof t=="bigint"||typeof s=="number"&&typeof t=="number"?s+t:Number(s)+Number(t),pt="00000000-0000-0000-0000-000000000000",St=/^(?:[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;function vt(s){return typeof s=="string"&&St.test(s)}const T=[];for(let s=0;s<256;++s)T.push((s+256).toString(16).slice(1));function et(s,t=0){return(T[s[t+0]]+T[s[t+1]]+T[s[t+2]]+T[s[t+3]]+"-"+T[s[t+4]]+T[s[t+5]]+"-"+T[s[t+6]]+T[s[t+7]]+"-"+T[s[t+8]]+T[s[t+9]]+"-"+T[s[t+10]]+T[s[t+11]]+T[s[t+12]]+T[s[t+13]]+T[s[t+14]]+T[s[t+15]]).toLowerCase()}function At(s,t=0){const e=et(s,t);if(!vt(e))throw TypeError("Stringified UUID is invalid");return e}let Z;const Ut=new Uint8Array(16);function Et(){if(!Z){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Z=crypto.getRandomValues.bind(crypto)}return Z(Ut)}const Bt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),W={randomUUID:Bt};function Mt(s,t,e){var a;if(W.randomUUID&&!s)return W.randomUUID();s=s||{};const n=s.random??((a=s.rng)==null?void 0:a.call(s))??Et();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,et(n)}const Ct=()=>Mt(),nt=(s,t)=>At(s,t),Rt=pt,xt=Object.freeze(Object.defineProperty({__proto__:null,ZERO:Rt,create:Ct,parse:nt},Symbol.toStringTag,{value:"Module"})),R=-1,Y={[Symbol.iterator]:()=>Y,next:()=>({done:!0,value:void 0})},Dt=l.string().transform(s=>new Uint8Array(atob(s).split("").map(t=>t.charCodeAt(0))).buffer),Lt=l.union([l._null$1(),l._undefined$1()]).transform(()=>new Uint8Array().buffer),k=10,rt=(s,t)=>{if(s==="string"&&!t.isVariable)throw new Error(`cannot convert series of type ${t.toString()} to string`);if(s==="number"&&!t.isNumeric)throw new Error(`cannot convert series of type ${t.toString()} to number`);if(s==="bigint"&&!t.usesBigInt)throw new Error(`cannot convert series of type ${t.toString()} to bigint`)},st="sy_x_telem_series",p=class p{constructor(t){i(this,"key");i(this,"discriminator",st);i(this,"dataType");i(this,"sampleOffset");i(this,"gl");i(this,"_data");i(this,"timeRange",A.ZERO);i(this,"alignment",0n);i(this,"cachedMin");i(this,"cachedMax");i(this,"writePos",R);i(this,"_refCount",0);i(this,"cachedLength");i(this,"_cachedIndexes");it(t)&&(t={data:t}),t.data??(t.data=[]);const{dataType:e,timeRange:n,sampleOffset:a=0,glBufferUsage:f="static",alignment:d=0n,key:U=X(),data:y}=t;if(at(y)){const c=y;this.key=c.key,this.dataType=c.dataType,this.sampleOffset=c.sampleOffset,this.gl=c.gl,this._data=c._data,this.timeRange=c.timeRange,this.alignment=c.alignment,this.cachedMin=c.cachedMin,this.cachedMax=c.cachedMax,this.writePos=c.writePos,this._refCount=c._refCount,this.cachedLength=c.cachedLength;return}const S=J(y),B=Array.isArray(y);if(e!=null)this.dataType=new O(e);else{if(y instanceof ArrayBuffer)throw new Error("cannot infer data type from an ArrayBuffer instance when constructing a Series. Please provide a data type.");if(B||S){let c=y;if(!S){if(y.length===0)throw new Error("cannot infer data type from a zero length JS array when constructing a Series. Please provide a data type.");c=y[0]}if(typeof c=="string")this.dataType=O.STRING;else if(typeof c=="number")this.dataType=O.FLOAT64;else if(typeof c=="bigint")this.dataType=O.INT64;else if(typeof c=="boolean")this.dataType=O.BOOLEAN;else if(c instanceof g||c instanceof Date||c instanceof g)this.dataType=O.TIMESTAMP;else if(typeof c=="object")this.dataType=O.JSON;else throw new Error(`cannot infer data type of ${typeof c} when constructing a Series from a JS array`)}else this.dataType=new O(y)}if(!B&&!S)this._data=y;else{let c=S?[y]:y;const M=c[0];(M instanceof g||M instanceof Date||M instanceof m)&&(c=c.map(v=>new g(v).valueOf())),this.dataType.equals(O.STRING)?(this.cachedLength=c.length,this._data=new TextEncoder().encode(`${c.join(`
|
|
2
|
-
`)}
|
|
3
|
-
`).buffer):this.dataType.equals(O.JSON)?(this.cachedLength=c.length,this._data=new TextEncoder().encode(`${c.map(v=>V.JSON_CODEC.encodeString(v)).join(`
|
|
4
|
-
`)}
|
|
5
|
-
`).buffer):this.dataType.usesBigInt&&typeof M=="number"?this._data=new this.dataType.Array(c.map(v=>BigInt(Math.round(v)))).buffer:!this.dataType.usesBigInt&&typeof M=="bigint"?this._data=new this.dataType.Array(c.map(v=>Number(v))).buffer:this._data=new this.dataType.Array(c).buffer}this.key=U,this.alignment=d,this.sampleOffset=a??0,this.timeRange=n??A.ZERO,this.gl={control:null,buffer:null,prevBuffer:0,bufferUsage:f}}static alloc({capacity:t,dataType:e,...n}){if(t===0)throw new Error("[Series] - cannot allocate an array of length 0");const a=new new O(e).Array(t),f=new p({data:a.buffer,dataType:e,...n});return f.writePos=0,f}get refCount(){return this._refCount}acquire(t){this._refCount++,t!=null&&this.updateGLBuffer(t)}release(){this._refCount--,this.refCount===0&&this.gl.control!=null?this.maybeGarbageCollectGLBuffer(this.gl.control):this.refCount<0&&console.warn("cannot release a series with a negative reference count")}write(t){if(!t.dataType.equals(this.dataType))throw new Error("buffer must be of the same type as this array");return this.dataType.isVariable?this.writeVariable(t):this.writeFixed(t)}writeVariable(t){if(this.writePos===R)return 0;const e=this.byteCapacity.valueOf()-this.writePos,n=t.subBytes(0,e);return this.writeToUnderlyingData(n),this.writePos+=n.byteLength.valueOf(),this.cachedLength!=null&&(this.cachedLength+=n.length,this.calculateCachedLength()),n.length}writeFixed(t){if(this.writePos===R)return 0;const e=this.capacity-this.writePos,n=t.sub(0,e);return this.writeToUnderlyingData(n),this.cachedLength=void 0,this.maybeRecomputeMinMax(n),this.writePos+=n.length,n.length}writeToUnderlyingData(t){this.underlyingData.set(t.data,this.writePos)}get buffer(){return typeof this._data=="object"&&"buffer"in this._data?this._data.buffer:this._data}get underlyingData(){return new this.dataType.Array(this._data)}get data(){return this.writePos===R?this.underlyingData:new this.dataType.Array(this._data,0,this.writePos)}toStrings(){return this.dataType.isVariable?new TextDecoder().decode(this.underlyingData).split(`
|
|
6
|
-
`).slice(0,-1):Array.from(this).map(t=>t.toString())}toUUIDs(){if(!this.dataType.equals(O.UUID))throw new Error("cannot convert non-uuid series to uuids");const t=O.UUID.density.valueOf(),e=new Uint8Array(this.underlyingData.buffer);return Array.from({length:this.length},(n,a)=>nt(e,a*t))}parseJSON(t){if(!this.dataType.equals(O.JSON))throw new Error("cannot parse non-JSON series as JSON");return this.toStrings().map(e=>t.parse(V.JSON_CODEC.decodeString(e)))}get byteCapacity(){return new x(this.underlyingData.byteLength)}get capacity(){return this.dataType.isVariable?this.byteCapacity.valueOf():this.dataType.density.length(this.byteCapacity)}get byteLength(){return this.writePos===R?this.byteCapacity:this.dataType.isVariable?new x(this.writePos):this.dataType.density.size(this.writePos)}get length(){return this.cachedLength!=null?this.cachedLength:this.dataType.isVariable?this.calculateCachedLength():this.writePos===R?this.byteCapacity.valueOf()/this.dataType.density.valueOf():this.writePos}calculateCachedLength(){if(!this.dataType.isVariable)throw new Error("cannot calculate length of a non-variable length data type");let t=0;const e=[0];return this.data.forEach((n,a)=>{n===k&&(t++,e.push(a+1))}),this._cachedIndexes=e,this.cachedLength=t,t}convert(t,e=0){if(this.dataType.equals(t))return this;const n=new t.Array(this.length);for(let a=0;a<this.length;a++)n[a]=tt(this.dataType,t,this.data[a],e);return new p({data:n.buffer,dataType:t,timeRange:this.timeRange,sampleOffset:e,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment})}calcRawMax(){if(this.length===0)return-1/0;if(this.dataType.equals(O.TIMESTAMP))this.cachedMax=this.data[this.data.length-1];else if(this.dataType.usesBigInt){const t=this.data;this.cachedMax=t.reduce((e,n)=>e>n?e:n)}else{const t=this.data;this.cachedMax=t.reduce((e,n)=>e>n?e:n)}return this.cachedMax}get max(){return this.calcMax()}calcMax(){if(this.dataType.isVariable)throw new Error("cannot calculate maximum on a variable length data type");return this.writePos===0?-1/0:(this.cachedMax??(this.cachedMax=this.calcRawMax()),L(this.cachedMax,this.sampleOffset))}calcRawMin(){if(this.length===0)return 1/0;if(this.dataType.equals(O.TIMESTAMP))this.cachedMin=this.data[0];else if(this.dataType.usesBigInt){const t=this.data;this.cachedMin=t.reduce((e,n)=>e<n?e:n)}else{const t=this.data;this.cachedMin=t.reduce((e,n)=>e<n?e:n)}return this.cachedMin}get min(){return this.calcMin()}calcMin(){if(this.dataType.isVariable)throw new Error("cannot calculate minimum on a variable length data type");return this.writePos===0?1/0:(this.cachedMin??(this.cachedMin=this.calcRawMin()),L(this.cachedMin,this.sampleOffset))}get bounds(){return b.construct(Number(this.min),Number(this.max),{makeValid:!1})}maybeRecomputeMinMax(t){if(this.cachedMin!=null){const e=t.cachedMin??t.calcRawMin();e<this.cachedMin&&(this.cachedMin=e)}if(this.cachedMax!=null){const e=t.cachedMax??t.calcRawMax();e>this.cachedMax&&(this.cachedMax=e)}}atAlignment(t,e){const n=Number(t-this.alignment);if(n<0||n>=this.length){if(e===!0)throw new Error(`[series] - no value at index ${n}`);return}return this.at(n,e)}at(t,e){if(this.dataType.isVariable)return this.atVariable(t,e??!1);t<0&&(t=this.length+t);const n=this.data[t];if(n==null){if(e===!0)throw new Error(`[series] - no value at index ${t}`);return}return L(n,this.sampleOffset)}atVariable(t,e){let n=0,a=0;if(this._cachedIndexes!=null)n=this._cachedIndexes[t],a=this._cachedIndexes[t+1]-1;else{t<0&&(t=this.length+t);for(let d=0;d<this.data.length;d++)if(this.data[d]===k){if(t===0){a=d;break}n=d+1,t--}if(a===0&&(a=this.data.length),n>=a||t>0){if(e)throw new Error(`[series] - no value at index ${t}`);return}}const f=this.data.slice(n,a);return this.dataType.equals(O.STRING)?new TextDecoder().decode(f):lt.snakeToCamel(JSON.parse(new TextDecoder().decode(f)))}binarySearch(t){let e=0,n=this.length-1;const a=D.newF(t);for(;e<=n;){const f=Math.floor((e+n)/2),d=a(this.at(f,!0),t);if(d===0)return f;d<0?e=f+1:n=f-1}return e}updateGLBuffer(t){if(this.gl.control=t,!this.dataType.equals(O.FLOAT32)&&!this.dataType.equals(O.UINT8))throw new Error("Only FLOAT32 and UINT8 arrays can be used in WebGL");const{buffer:e,bufferUsage:n,prevBuffer:a}=this.gl;if(e==null&&(this.gl.buffer=t.createBuffer()),this.writePos!==a)if(t.bindBuffer(t.ARRAY_BUFFER,this.gl.buffer),this.writePos!==R){a===0&&t.bufferData(t.ARRAY_BUFFER,this.byteCapacity.valueOf(),t.STATIC_DRAW);const f=this.dataType.density.size(a).valueOf(),d=this.underlyingData.slice(this.gl.prevBuffer,this.writePos);t.bufferSubData(t.ARRAY_BUFFER,f,d.buffer),this.gl.prevBuffer=this.writePos}else t.bufferData(t.ARRAY_BUFFER,this.buffer,n==="static"?t.STATIC_DRAW:t.DYNAMIC_DRAW),this.gl.prevBuffer=R}as(t){return rt(t,this.dataType),this}get digest(){return{key:this.key,dataType:this.dataType.toString(),sampleOffset:this.sampleOffset,alignment:{lower:z(this.alignmentBounds.lower),upper:z(this.alignmentBounds.upper)},timeRange:this.timeRange.toString(),length:this.length,capacity:this.capacity}}get alignmentBounds(){return b.construct(this.alignment,this.alignment+BigInt(this.length))}maybeGarbageCollectGLBuffer(t){this.gl.buffer!=null&&(t.deleteBuffer(this.gl.buffer),this.gl.buffer=null,this.gl.prevBuffer=0,this.gl.control=null)}get glBuffer(){if(this.gl.buffer==null)throw new Error("gl buffer not initialized");return this.gl.prevBuffer!==this.writePos&&console.warn("buffer not updated"),this.gl.buffer}[Symbol.iterator](){if(this.dataType.isVariable){const t=new qt(this);return this.dataType.equals(O.JSON)?new G(t):t}return new $t(this)}slice(t,e){return this.sliceSub(!1,t,e)}sub(t,e){return this.sliceSub(!0,t,e)}subIterator(t,e){return new H(this,t,e??this.length)}subAlignmentIterator(t,e){return new H(this,Number(t-this.alignment),Number(e-this.alignment))}subBytes(t,e){if(t>=0&&(e==null||e>=this.byteLength.valueOf()))return this;const n=this.data.subarray(t,e);return new p({data:n,dataType:this.dataType,timeRange:this.timeRange,sampleOffset:this.sampleOffset,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment+BigInt(t)})}sliceSub(t,e,n){if(e<=0&&(n==null||n>=this.length))return this;let a;return t?a=this.data.subarray(e,n):a=this.data.slice(e,n),new p({data:a,dataType:this.dataType,timeRange:this.timeRange,sampleOffset:this.sampleOffset,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment+BigInt(e)})}reAlign(t){return new p({data:this.buffer,dataType:this.dataType,timeRange:A.ZERO,sampleOffset:this.sampleOffset,glBufferUsage:"static",alignment:t})}toString(){var e,n;let t=`Series(${this.dataType.toString()} ${this.length} [`;if(this.length<=10)t+=Array.from(this).map(a=>a.toString());else{for(let a=0;a<5;a++)t+=`${(e=this.at(a))==null?void 0:e.toString()}`,t+=",";t+="...,";for(let a=-5;a<0;a++)t+=(n=this.at(a))==null?void 0:n.toString(),a<-1&&(t+=",")}return t+="])",t}};i(p,"crudeZ",l.object({timeRange:A.z.optional(),dataType:O.z,alignment:K().optional(),data:l.union([Dt,Lt,l._instanceof(ArrayBuffer),l._instanceof(Uint8Array)]),glBufferUsage:It.optional().default("static").optional()})),i(p,"z",p.crudeZ.transform(t=>new p(t)));let $=p;const it=s=>s==null?!1:Array.isArray(s)||s instanceof ArrayBuffer||ArrayBuffer.isView(s)&&!(s instanceof DataView)||s instanceof $?!0:J(s),at=Q(st,$);class H{constructor(t,e,n){i(this,"series");i(this,"end");i(this,"index");this.series=t;const a=b.construct(0,t.length);this.end=b.clamp(a,n),this.index=b.clamp(a,e)}next(){return this.index>=this.end?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}}class qt{constructor(t){i(this,"series");i(this,"index");i(this,"decoder");if(!t.dataType.isVariable)throw new Error("cannot create a variable series iterator for a non-variable series");this.series=t,this.index=0,this.decoder=new TextDecoder}next(){const t=this.index,e=this.series.data;for(;this.index<e.length&&e[this.index]!==k;)this.index++;const n=this.index;return t===n?{done:!0,value:void 0}:(this.index++,{done:!1,value:this.decoder.decode(this.series.buffer.slice(t,n))})}}const P=class P{constructor(t){i(this,"wrapped");this.wrapped=t}next(){const t=this.wrapped.next();return t.done===!0?{done:!0,value:void 0}:{done:!1,value:V.JSON_CODEC.decodeString(t.value,P.schema)}}};i(P,"schema",l.record(l.string(),l.unknown()));let G=P;class $t{constructor(t){i(this,"series");i(this,"index");this.series=t,this.index=0}next(){return this.index>=this.series.length?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}}class Pt{constructor(t=[]){i(this,"series");if(t.length!==0){const e=t[0].dataType;for(let n=1;n<t.length;n++)if(!t[n].dataType.equals(e))throw new Error("[multi-series] - series must have the same data type")}this.series=t}as(t){return rt(t,this.dataType),this}get dataType(){return this.series.length===0?O.UNKNOWN:this.series[0].dataType}get timeRange(){return this.series.length===0?A.ZERO:new A(this.series[0].timeRange.start,this.series[this.series.length-1].timeRange.end)}get alignment(){return this.series.length===0?0n:this.series[0].alignment}get alignmentBounds(){return this.series.length===0?b.construct(0n,0n):b.construct(this.series[0].alignmentBounds.lower,this.series[this.series.length-1].alignmentBounds.upper)}push(t){const e=()=>new Error(`cannot push a ${t.dataType.toString()} series to a ${this.dataType.toString()} multi-series`),n=t.dataType.equals(this.dataType);if(at(t)){if(this.series.length!==0&&!n)throw e();this.series.push(t)}else{if(this.series.length!==0&&t.series.length!==0&&!n)throw e();this.series.push(...t.series)}}get length(){return this.series.reduce((t,e)=>t+e.length,0)}atAlignment(t,e){for(const n of this.series)if(b.contains(n.alignmentBounds,t))return n.atAlignment(t,e);if(e)throw new Error(`[series] - no value at alignment ${t}`)}at(t,e=!1){t<0&&(t=this.length+t);for(const n of this.series){if(t<n.length)return n.at(t,e);t-=n.length}if(e)throw new Error(`[series] - no value at index ${t}`)}subIterator(t,e){return new F(this,t,e??this.length)}subAlignmentIterator(t,e){if(t>=this.alignmentBounds.upper||e<=this.alignmentBounds.lower)return Y;let n=0;for(let f=0;f<this.series.length;f++){const d=this.series[f];if(t<d.alignment)break;if(t>=d.alignmentBounds.upper)n+=d.length;else if(b.contains(d.alignmentBounds,t)){n+=Number(t-d.alignment);break}}let a=0;for(let f=0;f<this.series.length;f++){const d=this.series[f];if(e<d.alignment)break;if(e>=d.alignmentBounds.upper)a+=d.length;else if(b.contains(d.alignmentBounds,e)){a+=Number(e-d.alignment);break}}return new F(this,n,a)}subAlignmentSpanIterator(t,e){if(t>=this.alignmentBounds.upper)return Y;e=Math.min(e,Number(this.distance(t,this.alignmentBounds.upper)));let n=0;for(let a=0;a<this.series.length;a++){const f=this.series[a];if(t<f.alignment)break;if(t>=f.alignmentBounds.upper)n+=f.length;else if(b.contains(f.alignmentBounds,t)){n+=Number(t-f.alignment);break}}return new F(this,n,n+e)}updateGLBuffer(t){this.series.forEach(e=>e.updateGLBuffer(t))}get bounds(){return b.max$1(this.series.map(t=>t.bounds))}get byteLength(){return new x(this.series.reduce((t,e)=>t+e.byteLength.valueOf(),0))}get data(){const t=new this.dataType.Array(this.length);let e=0;for(const n of this.series)t.set(n.data,e),e+=n.length;return new this.dataType.Array(t.buffer)}traverseAlignment(t,e){const n=this.series.map(a=>a.alignmentBounds);return b.traverse(n,t,e)}acquire(t){this.series.forEach(e=>e.acquire(t))}release(){this.series.forEach(t=>t.release())}distance(t,e){const n=this.series.map(a=>a.alignmentBounds);return b.distance(n,t,e)}parseJSON(t){if(!this.dataType.equals(O.JSON))throw new Error("cannot parse non-JSON series as JSON");return this.series.flatMap(e=>e.parseJSON(t))}[Symbol.iterator](){return this.series.length===0?{next(){return{done:!0,value:void 0}}}:new Zt(this.series)}}class Zt{constructor(t){i(this,"series");i(this,"seriesIndex");i(this,"internal");this.series=t,this.seriesIndex=0,this.internal=t[0][Symbol.iterator]()}next(){const t=this.internal.next();return t.done===!1?t:this.seriesIndex===this.series.length-1?{done:!0,value:void 0}:(this.internal=this.series[++this.seriesIndex][Symbol.iterator](),this.next())}[Symbol.iterator](){return this}}class F{constructor(t,e,n){i(this,"series");i(this,"index");i(this,"end");this.series=t,this.end=n,this.index=e}next(){return this.index>=this.end?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}[Symbol.iterator](){return this}}const z=s=>{const t=s>>32n,e=s&0xffffffffn;return{domain:t,sample:e}};exports.DataType=O;exports.Density=I;exports.MultiSeries=Pt;exports.Rate=q;exports.Series=$;exports.Size=x;exports.TimeRange=A;exports.TimeSpan=m;exports.TimeStamp=g;exports.addSamples=L;exports.coerce=gt;exports.convertDataType=tt;exports.id=bt;exports.isCrudeSeries=it;exports.isTelemValue=J;exports.matcher=wt;exports.sortTimeRange=Tt;exports.typedArrayZ=Nt;exports.uuid=xt;
|
package/dist/index-C07SBJhr.js
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
var N = Object.defineProperty;
|
|
2
|
-
var p = (e, t, r) => t in e ? N(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
-
var m = (e, t, r) => p(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
-
import { a as b } from "./index-D4NCYiQB.js";
|
|
5
|
-
class d {
|
|
6
|
-
constructor(t) {
|
|
7
|
-
/** The underlying primitive value */
|
|
8
|
-
m(this, "value");
|
|
9
|
-
this.value = t;
|
|
10
|
-
}
|
|
11
|
-
/** Overrides the JS default valueOf() function to return the primitive value. */
|
|
12
|
-
valueOf() {
|
|
13
|
-
return this.value;
|
|
14
|
-
}
|
|
15
|
-
/** toJSON ensures that only the primitive value gets encoded during JSON
|
|
16
|
-
* stringification. */
|
|
17
|
-
toJSON() {
|
|
18
|
-
return this.value;
|
|
19
|
-
}
|
|
20
|
-
/** @returns a string representation of the item. */
|
|
21
|
-
toString() {
|
|
22
|
-
return this.value.toString();
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
const l = (e) => e != null && typeof e == "object" && "toString" in e, S = (e) => {
|
|
26
|
-
if (l(e)) return (e == null ? void 0 : e.toString().length) === 0;
|
|
27
|
-
switch (typeof e) {
|
|
28
|
-
case "string":
|
|
29
|
-
return e.length === 0;
|
|
30
|
-
case "number":
|
|
31
|
-
return e === 0;
|
|
32
|
-
case "bigint":
|
|
33
|
-
return e === 0n;
|
|
34
|
-
case "boolean":
|
|
35
|
-
return !e;
|
|
36
|
-
case "undefined":
|
|
37
|
-
return !0;
|
|
38
|
-
case "object":
|
|
39
|
-
return e == null;
|
|
40
|
-
default:
|
|
41
|
-
return !1;
|
|
42
|
-
}
|
|
43
|
-
}, G = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
44
|
-
__proto__: null,
|
|
45
|
-
ValueExtension: d,
|
|
46
|
-
isStringer: l,
|
|
47
|
-
isZero: S
|
|
48
|
-
}, Symbol.toStringTag, { value: "Module" })), g = (e, t = !1) => {
|
|
49
|
-
const r = l(e) ? "stringer" : typeof e;
|
|
50
|
-
let n;
|
|
51
|
-
switch (r) {
|
|
52
|
-
case "string":
|
|
53
|
-
n = (s, o) => s.localeCompare(o);
|
|
54
|
-
break;
|
|
55
|
-
case "stringer":
|
|
56
|
-
n = (s, o) => s.toString().localeCompare(o.toString());
|
|
57
|
-
break;
|
|
58
|
-
case "number":
|
|
59
|
-
n = (s, o) => Number(s) - Number(o);
|
|
60
|
-
break;
|
|
61
|
-
case "bigint":
|
|
62
|
-
n = (s, o) => BigInt(s) - BigInt(o) > 0n ? 1 : -1;
|
|
63
|
-
break;
|
|
64
|
-
case "boolean":
|
|
65
|
-
n = (s, o) => Number(s) - Number(o);
|
|
66
|
-
break;
|
|
67
|
-
case "undefined":
|
|
68
|
-
n = () => 0;
|
|
69
|
-
break;
|
|
70
|
-
default:
|
|
71
|
-
return console.warn(`sortFunc: unknown type ${r}`), () => -1;
|
|
72
|
-
}
|
|
73
|
-
return t ? h(n) : n;
|
|
74
|
-
}, _ = (e, t, r) => {
|
|
75
|
-
const n = g(t[e], r);
|
|
76
|
-
return (s, o) => n(s[e], o[e]);
|
|
77
|
-
}, y = (e, t) => e.length !== t.length ? e.length - t.length : e.every((r, n) => r === t[n]) ? 0 : -1, f = (e, t) => {
|
|
78
|
-
if (e.length !== t.length) return e.length - t.length;
|
|
79
|
-
if (e.length === 0) return 0;
|
|
80
|
-
const r = g(e[0]), n = [...e].sort(r), s = [...t].sort(r);
|
|
81
|
-
return n.every((o, i) => o === s[i]) ? 0 : -1;
|
|
82
|
-
}, A = (e, t) => {
|
|
83
|
-
const r = b(e), n = b(t);
|
|
84
|
-
return f(r, n);
|
|
85
|
-
}, T = (e, t) => e === t ? 0 : e === "first" && t === "last" ? 1 : -1, h = (e) => (t, r) => e(r, t), c = 0, E = -1, P = 1, j = (e) => e < c, q = (e) => e > c, w = (e) => e >= c, F = (e) => e === c, O = (e, t) => {
|
|
86
|
-
const r = /([a-zA-Z]+)|(\d+)/g, n = e.replace(/[\s_.-]+/g, "").match(r), s = t.replace(/[\s_.-]+/g, "").match(r);
|
|
87
|
-
if (!n || !s) return 0;
|
|
88
|
-
for (let o = 0; o < Math.min(n.length, s.length); o++) {
|
|
89
|
-
const i = n[o], u = s[o];
|
|
90
|
-
if (isNaN(Number(i)) && isNaN(Number(u))) {
|
|
91
|
-
const a = i.localeCompare(u);
|
|
92
|
-
if (a !== 0) return a;
|
|
93
|
-
} else if (!isNaN(Number(i)) && !isNaN(Number(u))) {
|
|
94
|
-
const a = Number(i) - Number(u);
|
|
95
|
-
if (a !== 0) return a;
|
|
96
|
-
} else return isNaN(Number(i)) ? -1 : 1;
|
|
97
|
-
}
|
|
98
|
-
return n.length - s.length;
|
|
99
|
-
}, L = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
100
|
-
__proto__: null,
|
|
101
|
-
EQUAL: c,
|
|
102
|
-
GREATER_THAN: P,
|
|
103
|
-
LESS_THAN: E,
|
|
104
|
-
isEqualTo: F,
|
|
105
|
-
isGreaterThan: q,
|
|
106
|
-
isGreaterThanEqual: w,
|
|
107
|
-
isLessThan: j,
|
|
108
|
-
newF: g,
|
|
109
|
-
newFieldF: _,
|
|
110
|
-
order: T,
|
|
111
|
-
primitiveArrays: y,
|
|
112
|
-
reverseF: h,
|
|
113
|
-
stringsWithNumbers: O,
|
|
114
|
-
uniqueUnorderedPrimitiveArrays: A,
|
|
115
|
-
unorderedPrimitiveArrays: f
|
|
116
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
117
|
-
export {
|
|
118
|
-
c as E,
|
|
119
|
-
P as G,
|
|
120
|
-
E as L,
|
|
121
|
-
d as V,
|
|
122
|
-
q as a,
|
|
123
|
-
j as b,
|
|
124
|
-
L as c,
|
|
125
|
-
F as i,
|
|
126
|
-
g as n,
|
|
127
|
-
G as p
|
|
128
|
-
};
|
package/dist/index-C9EdKeu1.js
DELETED
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import { b } from "./base-B5lQIJKc.js";
|
|
2
|
-
const c = (e) => typeof e == "bigint" || e instanceof BigInt, v = (e, r) => c(e) ? e.valueOf() - BigInt(r.valueOf().valueOf()) : e.valueOf() - Number(r.valueOf()), B = (e, r) => c(e) ? e.valueOf() + BigInt(r.valueOf().valueOf()) : e + Number(r.valueOf()), q = (e, r, n = 1e-4) => Math.abs(e - r) < n, I = (e, r) => c(e) ? e === BigInt(r.valueOf().valueOf()) : e === Number(r.valueOf()), C = (e) => {
|
|
3
|
-
const r = 10 ** Math.floor(Math.log10(e));
|
|
4
|
-
return Math.round(e / r) * r;
|
|
5
|
-
}, h = (e, r) => c(e) ? e.valueOf() < BigInt(r.valueOf()) ? e : BigInt(r.valueOf()) : e.valueOf() < Number(r.valueOf()) ? e : Number(r.valueOf()), R = (e, r) => c(e) ? e.valueOf() > BigInt(r.valueOf()) ? e : BigInt(r.valueOf()) : e.valueOf() > Number(r.valueOf()) ? e : Number(r.valueOf()), y = (e) => c(e) || e instanceof BigInt ? e.valueOf() < 0n ? -e : e : e.valueOf() < 0 ? -e : e, U = (e, r) => c(e) ? e.valueOf() * BigInt(r.valueOf()) : e.valueOf() * Number(r.valueOf()), W = (e, r) => c(e) ? e.valueOf() / BigInt(r.valueOf()) : e.valueOf() / Number(r.valueOf()), i = (e, r, n) => {
|
|
6
|
-
const t = {};
|
|
7
|
-
if (typeof r == "object" && (n = r, r = void 0), n = { makeValid: !0, ...n }, typeof e == "number" || typeof e == "bigint")
|
|
8
|
-
r != null ? (t.lower = e, t.upper = r) : (t.lower = typeof e == "bigint" ? 0n : 0, t.upper = e);
|
|
9
|
-
else if (Array.isArray(e)) {
|
|
10
|
-
if (e.length !== 2) throw new Error("bounds: expected array of length 2");
|
|
11
|
-
[t.lower, t.upper] = e;
|
|
12
|
-
} else
|
|
13
|
-
t.lower = e.lower, t.upper = e.upper;
|
|
14
|
-
return n != null && n.makeValid ? g(t) : t;
|
|
15
|
-
}, x = Object.freeze({ lower: 0, upper: 0 }), N = Object.freeze({ lower: -1 / 0, upper: 1 / 0 }), _ = Object.freeze({ lower: 0, upper: 1 }), M = Object.freeze({ lower: -1, upper: 1 }), A = (e, r) => {
|
|
16
|
-
if (e == null && r == null) return !0;
|
|
17
|
-
if (e == null || r == null) return !1;
|
|
18
|
-
const n = i(e), t = i(r);
|
|
19
|
-
return (n == null ? void 0 : n.lower) === (t == null ? void 0 : t.lower) && (n == null ? void 0 : n.upper) === (t == null ? void 0 : t.upper);
|
|
20
|
-
}, g = (e) => e.lower > e.upper ? { lower: e.upper, upper: e.lower } : e, j = (e, r) => {
|
|
21
|
-
const n = i(e);
|
|
22
|
-
return r < n.lower ? n.lower : r >= n.upper ? n.upper - (typeof n.upper == "number" ? 1 : 1n) : r;
|
|
23
|
-
}, a = (e, r) => {
|
|
24
|
-
const n = i(e);
|
|
25
|
-
if (typeof r == "number" || typeof r == "bigint")
|
|
26
|
-
return r >= n.lower && r < n.upper;
|
|
27
|
-
const t = i(r);
|
|
28
|
-
return t.lower >= n.lower && t.upper <= n.upper;
|
|
29
|
-
}, P = (e, r) => {
|
|
30
|
-
const n = i(e), t = i(r);
|
|
31
|
-
return n.lower === t.lower ? !0 : t.upper === n.lower || t.lower === n.upper ? !1 : a(n, t.upper) || a(n, t.lower) || a(t, n.upper) || a(t, n.lower);
|
|
32
|
-
}, w = (e) => {
|
|
33
|
-
const r = i(e);
|
|
34
|
-
return r.upper - r.lower;
|
|
35
|
-
}, z = (e) => {
|
|
36
|
-
const r = i(e);
|
|
37
|
-
return typeof r.lower == "bigint" ? r.lower === 0n && r.upper === 0n : r.lower === 0 && r.upper === 0;
|
|
38
|
-
}, E = (e) => {
|
|
39
|
-
const r = w(e);
|
|
40
|
-
return typeof r == "number" ? r === 0 : r === 0n;
|
|
41
|
-
}, k = (e) => {
|
|
42
|
-
const r = i(e);
|
|
43
|
-
return typeof r.lower == "bigint" ? !0 : Number.isFinite(r.lower) && Number.isFinite(r.upper);
|
|
44
|
-
}, D = (e) => {
|
|
45
|
-
const r = i(e);
|
|
46
|
-
return (r.upper + r.lower) / 2;
|
|
47
|
-
}, F = (e) => ({
|
|
48
|
-
lower: Math.min(...e.map((r) => i(r).lower)),
|
|
49
|
-
upper: Math.max(...e.map((r) => i(r).upper))
|
|
50
|
-
}), L = (e) => ({
|
|
51
|
-
lower: Math.max(...e.map((r) => i(r).lower)),
|
|
52
|
-
upper: Math.min(...e.map((r) => i(r).upper))
|
|
53
|
-
}), T = (e) => {
|
|
54
|
-
const r = i(e), n = typeof r.lower == "bigint";
|
|
55
|
-
return Array.from({ length: Number(w(e)) }, (t, o) => n ? r.lower + BigInt(o) : r.lower + o);
|
|
56
|
-
}, O = (e, r) => {
|
|
57
|
-
const n = e.map((l) => i(l)), t = n.findIndex((l) => a(l, r) || r < l.lower);
|
|
58
|
-
if (t === -1) return { index: e.length, position: 0 };
|
|
59
|
-
const o = n[t];
|
|
60
|
-
return a(o, r) ? { index: t, position: Number(r - o.lower) } : { index: t, position: 0 };
|
|
61
|
-
}, d = {
|
|
62
|
-
removeBefore: 0,
|
|
63
|
-
removeAfter: 0,
|
|
64
|
-
insertInto: 0,
|
|
65
|
-
deleteInBetween: 0
|
|
66
|
-
}, Z = (e, r) => {
|
|
67
|
-
const n = e.map((p) => i(p)), t = i(r);
|
|
68
|
-
if (n.length === 0) return d;
|
|
69
|
-
const o = O(n, t.lower), l = O(n, t.upper);
|
|
70
|
-
if (o.index === e.length) return { ...d, insertInto: e.length };
|
|
71
|
-
if (l.index === 0) return { ...d, removeAfter: l.position };
|
|
72
|
-
if (o.index === l.index)
|
|
73
|
-
return o.position !== 0 && l.position !== 0 ? null : {
|
|
74
|
-
removeAfter: l.position,
|
|
75
|
-
removeBefore: o.position,
|
|
76
|
-
insertInto: o.index,
|
|
77
|
-
deleteInBetween: 0
|
|
78
|
-
};
|
|
79
|
-
let u = l.index - o.index, f = o.index, s = v(Number(w(n[o.index])), o.position);
|
|
80
|
-
return o.position !== 0 ? (u -= 1, f += 1) : s = 0, {
|
|
81
|
-
removeBefore: s,
|
|
82
|
-
removeAfter: l.position,
|
|
83
|
-
insertInto: f,
|
|
84
|
-
deleteInBetween: u
|
|
85
|
-
};
|
|
86
|
-
}, S = (e, r, n) => {
|
|
87
|
-
const t = e.map((f) => i(f)), o = n > 0 ? 1 : n < 0 ? -1 : 0;
|
|
88
|
-
if (o === 0) return r;
|
|
89
|
-
let l = n, u = r;
|
|
90
|
-
for (; I(l, 0) === !1; ) {
|
|
91
|
-
const f = t.findIndex((s) => o > 0 ? u >= s.lower && u < s.upper : u > s.lower && u <= s.upper);
|
|
92
|
-
if (f !== -1) {
|
|
93
|
-
const s = t[f];
|
|
94
|
-
let p;
|
|
95
|
-
if (o > 0 ? p = v(s.upper, u) : p = v(u, s.lower), p > 0) {
|
|
96
|
-
const m = h(y(l), p);
|
|
97
|
-
if (u = B(
|
|
98
|
-
u,
|
|
99
|
-
o > 0 ? m : -m
|
|
100
|
-
), l = v(l, o > 0 ? m : -m), I(l, 0)) return u;
|
|
101
|
-
continue;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
if (o > 0) {
|
|
105
|
-
const s = t.filter((p) => p.lower > u);
|
|
106
|
-
if (s.length > 0) u = s[0].lower;
|
|
107
|
-
else return u;
|
|
108
|
-
} else {
|
|
109
|
-
const s = t.filter((p) => p.upper < u);
|
|
110
|
-
if (s.length > 0)
|
|
111
|
-
u = s[s.length - 1].upper;
|
|
112
|
-
else return u;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
return u;
|
|
116
|
-
}, V = (e, r, n) => {
|
|
117
|
-
const t = e.map((u) => i(u));
|
|
118
|
-
if (r === n) return typeof r == "bigint" ? 0n : 0;
|
|
119
|
-
const o = r < n ? i([r, n]) : i([n, r]);
|
|
120
|
-
let l = typeof r == "bigint" ? 0n : 0;
|
|
121
|
-
for (const u of t) {
|
|
122
|
-
const f = u.lower > o.lower ? u.lower : o.lower, s = u.upper < o.upper ? u.upper : o.upper;
|
|
123
|
-
if (f < s) {
|
|
124
|
-
const p = s - f;
|
|
125
|
-
l = l + p;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
return l;
|
|
129
|
-
}, G = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
130
|
-
__proto__: null,
|
|
131
|
-
CLIP: M,
|
|
132
|
-
DECIMAL: _,
|
|
133
|
-
INFINITE: N,
|
|
134
|
-
ZERO: x,
|
|
135
|
-
bounds: b,
|
|
136
|
-
buildInsertionPlan: Z,
|
|
137
|
-
clamp: j,
|
|
138
|
-
construct: i,
|
|
139
|
-
contains: a,
|
|
140
|
-
distance: V,
|
|
141
|
-
equals: A,
|
|
142
|
-
findInsertPosition: O,
|
|
143
|
-
isFinite: k,
|
|
144
|
-
isZero: z,
|
|
145
|
-
linspace: T,
|
|
146
|
-
makeValid: g,
|
|
147
|
-
max: F,
|
|
148
|
-
mean: D,
|
|
149
|
-
min: L,
|
|
150
|
-
overlapsWith: P,
|
|
151
|
-
span: w,
|
|
152
|
-
spanIsZero: E,
|
|
153
|
-
traverse: S
|
|
154
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
155
|
-
export {
|
|
156
|
-
y as a,
|
|
157
|
-
B as b,
|
|
158
|
-
q as c,
|
|
159
|
-
W as d,
|
|
160
|
-
I as e,
|
|
161
|
-
h as f,
|
|
162
|
-
U as g,
|
|
163
|
-
v as h,
|
|
164
|
-
G as i,
|
|
165
|
-
i as j,
|
|
166
|
-
j as k,
|
|
167
|
-
a as l,
|
|
168
|
-
R as m,
|
|
169
|
-
F as n,
|
|
170
|
-
V as o,
|
|
171
|
-
C as r,
|
|
172
|
-
w as s,
|
|
173
|
-
S as t
|
|
174
|
-
};
|
package/dist/index-CM8ZDZ6s.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const M=require("./base-CTq-lhpU.cjs"),a=e=>typeof e=="bigint"||e instanceof BigInt,m=(e,r)=>a(e)?e.valueOf()-BigInt(r.valueOf().valueOf()):e.valueOf()-Number(r.valueOf()),g=(e,r)=>a(e)?e.valueOf()+BigInt(r.valueOf().valueOf()):e+Number(r.valueOf()),A=(e,r,n=1e-4)=>Math.abs(e-r)<n,O=(e,r)=>a(e)?e===BigInt(r.valueOf().valueOf()):e===Number(r.valueOf()),j=e=>{const r=10**Math.floor(Math.log10(e));return Math.round(e/r)*r},b=(e,r)=>a(e)?e.valueOf()<BigInt(r.valueOf())?e:BigInt(r.valueOf()):e.valueOf()<Number(r.valueOf())?e:Number(r.valueOf()),P=(e,r)=>a(e)?e.valueOf()>BigInt(r.valueOf())?e:BigInt(r.valueOf()):e.valueOf()>Number(r.valueOf())?e:Number(r.valueOf()),B=e=>a(e)||e instanceof BigInt?e.valueOf()<0n?-e:e:e.valueOf()<0?-e:e,T=(e,r)=>a(e)?e.valueOf()*BigInt(r.valueOf()):e.valueOf()*Number(r.valueOf()),z=(e,r)=>a(e)?e.valueOf()/BigInt(r.valueOf()):e.valueOf()/Number(r.valueOf()),i=(e,r,n)=>{const t={};if(typeof r=="object"&&(n=r,r=void 0),n={makeValid:!0,...n},typeof e=="number"||typeof e=="bigint")r!=null?(t.lower=e,t.upper=r):(t.lower=typeof e=="bigint"?0n:0,t.upper=e);else if(Array.isArray(e)){if(e.length!==2)throw new Error("bounds: expected array of length 2");[t.lower,t.upper]=e}else t.lower=e.lower,t.upper=e.upper;return n!=null&&n.makeValid?x(t):t},E=Object.freeze({lower:0,upper:0}),q=Object.freeze({lower:-1/0,upper:1/0}),D=Object.freeze({lower:0,upper:1}),F=Object.freeze({lower:-1,upper:1}),L=(e,r)=>{if(e==null&&r==null)return!0;if(e==null||r==null)return!1;const n=i(e),t=i(r);return(n==null?void 0:n.lower)===(t==null?void 0:t.lower)&&(n==null?void 0:n.upper)===(t==null?void 0:t.upper)},x=e=>e.lower>e.upper?{lower:e.upper,upper:e.lower}:e,y=(e,r)=>{const n=i(e);return r<n.lower?n.lower:r>=n.upper?n.upper-(typeof n.upper=="number"?1:1n):r},c=(e,r)=>{const n=i(e);if(typeof r=="number"||typeof r=="bigint")return r>=n.lower&&r<n.upper;const t=i(r);return t.lower>=n.lower&&t.upper<=n.upper},Z=(e,r)=>{const n=i(e),t=i(r);return n.lower===t.lower?!0:t.upper===n.lower||t.lower===n.upper?!1:c(n,t.upper)||c(n,t.lower)||c(t,n.upper)||c(t,n.lower)},v=e=>{const r=i(e);return r.upper-r.lower},k=e=>{const r=i(e);return typeof r.lower=="bigint"?r.lower===0n&&r.upper===0n:r.lower===0&&r.upper===0},S=e=>{const r=v(e);return typeof r=="number"?r===0:r===0n},V=e=>{const r=i(e);return typeof r.lower=="bigint"?!0:Number.isFinite(r.lower)&&Number.isFinite(r.upper)},$=e=>{const r=i(e);return(r.upper+r.lower)/2},h=e=>({lower:Math.min(...e.map(r=>i(r).lower)),upper:Math.max(...e.map(r=>i(r).upper))}),C=e=>({lower:Math.max(...e.map(r=>i(r).lower)),upper:Math.min(...e.map(r=>i(r).upper))}),R=e=>{const r=i(e),n=typeof r.lower=="bigint";return Array.from({length:Number(v(e))},(t,o)=>n?r.lower+BigInt(o):r.lower+o)},I=(e,r)=>{const n=e.map(l=>i(l)),t=n.findIndex(l=>c(l,r)||r<l.lower);if(t===-1)return{index:e.length,position:0};const o=n[t];return c(o,r)?{index:t,position:Number(r-o.lower)}:{index:t,position:0}},w={removeBefore:0,removeAfter:0,insertInto:0,deleteInBetween:0},U=(e,r)=>{const n=e.map(p=>i(p)),t=i(r);if(n.length===0)return w;const o=I(n,t.lower),l=I(n,t.upper);if(o.index===e.length)return{...w,insertInto:e.length};if(l.index===0)return{...w,removeAfter:l.position};if(o.index===l.index)return o.position!==0&&l.position!==0?null:{removeAfter:l.position,removeBefore:o.position,insertInto:o.index,deleteInBetween:0};let u=l.index-o.index,f=o.index,s=m(Number(v(n[o.index])),o.position);return o.position!==0?(u-=1,f+=1):s=0,{removeBefore:s,removeAfter:l.position,insertInto:f,deleteInBetween:u}},N=(e,r,n)=>{const t=e.map(f=>i(f)),o=n>0?1:n<0?-1:0;if(o===0)return r;let l=n,u=r;for(;O(l,0)===!1;){const f=t.findIndex(s=>o>0?u>=s.lower&&u<s.upper:u>s.lower&&u<=s.upper);if(f!==-1){const s=t[f];let p;if(o>0?p=m(s.upper,u):p=m(u,s.lower),p>0){const d=b(B(l),p);if(u=g(u,o>0?d:-d),l=m(l,o>0?d:-d),O(l,0))return u;continue}}if(o>0){const s=t.filter(p=>p.lower>u);if(s.length>0)u=s[0].lower;else return u}else{const s=t.filter(p=>p.upper<u);if(s.length>0)u=s[s.length-1].upper;else return u}}return u},_=(e,r,n)=>{const t=e.map(u=>i(u));if(r===n)return typeof r=="bigint"?0n:0;const o=r<n?i([r,n]):i([n,r]);let l=typeof r=="bigint"?0n:0;for(const u of t){const f=u.lower>o.lower?u.lower:o.lower,s=u.upper<o.upper?u.upper:o.upper;if(f<s){const p=s-f;l=l+p}}return l},W=Object.freeze(Object.defineProperty({__proto__:null,CLIP:F,DECIMAL:D,INFINITE:q,ZERO:E,bounds:M.bounds,buildInsertionPlan:U,clamp:y,construct:i,contains:c,distance:_,equals:L,findInsertPosition:I,isFinite:V,isZero:k,linspace:R,makeValid:x,max:h,mean:$,min:C,overlapsWith:Z,span:v,spanIsZero:S,traverse:N},Symbol.toStringTag,{value:"Module"}));exports.abs=B;exports.add=g;exports.bounds=W;exports.clamp=y;exports.closeTo=A;exports.construct=i;exports.contains=c;exports.distance=_;exports.div=z;exports.equal=O;exports.max=P;exports.max$1=h;exports.min=b;exports.mult=T;exports.roundToNearestMagnitude=j;exports.span=v;exports.sub=m;exports.traverse=N;
|
package/dist/index-CV2JaHfw.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var A=Object.defineProperty;var E=(e,t,r)=>t in e?A(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var m=(e,t,r)=>E(e,typeof t!="symbol"?t+"":t,r);const h=require("./index-udOjA9d-.cjs");class b{constructor(t){m(this,"value");this.value=t}valueOf(){return this.value}toJSON(){return this.value}toString(){return this.value.toString()}}const g=e=>e!=null&&typeof e=="object"&&"toString"in e,y=e=>{if(g(e))return(e==null?void 0:e.toString().length)===0;switch(typeof e){case"string":return e.length===0;case"number":return e===0;case"bigint":return e===0n;case"boolean":return!e;case"undefined":return!0;case"object":return e==null;default:return!1}},q=Object.freeze(Object.defineProperty({__proto__:null,ValueExtension:b,isStringer:g,isZero:y},Symbol.toStringTag,{value:"Module"})),l=(e,t=!1)=>{const r=g(e)?"stringer":typeof e;let n;switch(r){case"string":n=(s,o)=>s.localeCompare(o);break;case"stringer":n=(s,o)=>s.toString().localeCompare(o.toString());break;case"number":n=(s,o)=>Number(s)-Number(o);break;case"bigint":n=(s,o)=>BigInt(s)-BigInt(o)>0n?1:-1;break;case"boolean":n=(s,o)=>Number(s)-Number(o);break;case"undefined":n=()=>0;break;default:return console.warn(`sortFunc: unknown type ${r}`),()=>-1}return t?N(n):n},P=(e,t,r)=>{const n=l(t[e],r);return(s,o)=>n(s[e],o[e])},w=(e,t)=>e.length!==t.length?e.length-t.length:e.every((r,n)=>r===t[n])?0:-1,f=(e,t)=>{if(e.length!==t.length)return e.length-t.length;if(e.length===0)return 0;const r=l(e[0]),n=[...e].sort(r),s=[...t].sort(r);return n.every((o,i)=>o===s[i])?0:-1},F=(e,t)=>{const r=h.unique$1(e),n=h.unique$1(t);return f(r,n)},j=(e,t)=>e===t?0:e==="first"&&t==="last"?1:-1,N=e=>(t,r)=>e(r,t),u=0,p=-1,d=1,S=e=>e<u,T=e=>e>u,L=e=>e>=u,_=e=>e===u,O=(e,t)=>{const r=/([a-zA-Z]+)|(\d+)/g,n=e.replace(/[\s_.-]+/g,"").match(r),s=t.replace(/[\s_.-]+/g,"").match(r);if(!n||!s)return 0;for(let o=0;o<Math.min(n.length,s.length);o++){const i=n[o],a=s[o];if(isNaN(Number(i))&&isNaN(Number(a))){const c=i.localeCompare(a);if(c!==0)return c}else if(!isNaN(Number(i))&&!isNaN(Number(a))){const c=Number(i)-Number(a);if(c!==0)return c}else return isNaN(Number(i))?-1:1}return n.length-s.length},k=Object.freeze(Object.defineProperty({__proto__:null,EQUAL:u,GREATER_THAN:d,LESS_THAN:p,isEqualTo:_,isGreaterThan:T,isGreaterThanEqual:L,isLessThan:S,newF:l,newFieldF:P,order:j,primitiveArrays:w,reverseF:N,stringsWithNumbers:O,uniqueUnorderedPrimitiveArrays:F,unorderedPrimitiveArrays:f},Symbol.toStringTag,{value:"Module"}));exports.EQUAL=u;exports.GREATER_THAN=d;exports.LESS_THAN=p;exports.ValueExtension=b;exports.compare=k;exports.isEqualTo=_;exports.isGreaterThan=T;exports.isLessThan=S;exports.newF=l;exports.primitive=q;
|
package/dist/index-CeBvOwG8.cjs
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use strict";var E=Object.defineProperty;var T=(o,e,t)=>e in o?E(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var i=(o,e,t)=>T(o,typeof e!="symbol"?e+"":e,t);const p=require("./index-DKMnHBGR.cjs"),w=require("./identity.cjs");class f{constructor(){i(this,"contentType","application/json");i(this,"decoder");i(this,"encoder");this.decoder=new TextDecoder,this.encoder=new TextEncoder}encode(e){return this.encoder.encode(this.encodeString(e))}decode(e,t){return this.decodeString(this.decoder.decode(e),t)}decodeString(e,t){const n=JSON.parse(e),r=p.snakeToCamel(n);return t!=null?t.parse(r):r}encodeString(e){const t=p.camelToSnake(e);return JSON.stringify(t,(n,r)=>ArrayBuffer.isView(r)?Array.from(r):typeof r=="bigint"?r.toString():r)}}class S{constructor(){i(this,"contentType","text/csv")}encode(e){const t=this.encodeString(e);return new TextEncoder().encode(t)}decode(e,t){const n=new TextDecoder().decode(e);return this.decodeString(n,t)}encodeString(e){if(!Array.isArray(e)||e.length===0||!w.isObject(e[0]))throw new Error("Payload must be an array of objects");const t=Object.keys(e[0]),n=[t.join(",")];return e.forEach(r=>{const d=t.map(s=>JSON.stringify(r[s]??""));n.push(d.join(","))}),n.join(`
|
|
2
|
-
`)}decodeString(e,t){const[n,...r]=e.trim().split(`
|
|
3
|
-
`).map(c=>c.trim());if(n.length===0)return t!=null?t.parse({}):{};const d=n.split(",").map(c=>c.trim()),s={};return d.forEach(c=>{s[c]=[]}),r.forEach(c=>{const h=c.split(",").map(u=>u.trim());d.forEach((u,C)=>{const l=this.parseValue(h[C]);l!=null&&s[u].push(l)})}),t!=null?t.parse(s):s}parseValue(e){if(e==null||e.length===0)return null;const t=Number(e);return isNaN(t)?e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e:t}}class g{constructor(){i(this,"contentType","text/plain")}encode(e){if(typeof e!="string")throw new Error("TextCodec.encode payload must be a string");return new TextEncoder().encode(e)}decode(e,t){const n=new TextDecoder().decode(e);return t!=null?t.parse(n):n}}const a=new f,O=new S,y=new g,m=[a],x=Object.freeze(Object.defineProperty({__proto__:null,CSVCodec:S,CSV_CODEC:O,ENCODERS:m,JSONCodec:f,JSON_CODEC:a,TEXT_CODEC:y,TextCodec:g},Symbol.toStringTag,{value:"Module"}));exports.JSON_CODEC=a;exports.codec=x;
|