@synnaxlabs/pluto 0.35.2 → 0.36.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/dist/{Animated-B3meZ8Go.cjs → Animated-BAoBw9cC.cjs} +1 -1
- package/dist/Animated-DkZIfEYP.js +19 -0
- package/dist/Item-BjErngVu.cjs +1 -0
- package/dist/{Item-C3mh5Jo-.js → Item-C7Q_zqsK.js} +21 -22
- package/dist/LinePlot-CQN3l2Pu.cjs +24 -0
- package/dist/LinePlot-rWkRDg70.js +5729 -0
- package/dist/{Link-C-KaB73i.cjs → Link-DIP4E5h4.cjs} +1 -1
- package/dist/{Link-By1w1FIv.js → Link-DkPbZ9Vw.js} +2 -2
- package/dist/Pack-ClLR2ywa.cjs +1 -0
- package/dist/Pack-D8EcIVa2.js +140 -0
- package/dist/Toggle-CZlnDV1Y.js +63934 -0
- package/dist/Toggle-Dwz8HiqJ.cjs +163 -0
- package/dist/{Video-BGyV37o3.js → Video-CI9sBV9l.js} +2 -2
- package/dist/{Video-CGe5Hscl.cjs → Video-xr1Ey5qV.cjs} +1 -1
- package/dist/aggregator-D6gAHK4j.js +13699 -0
- package/dist/aggregator-q3hNa4qv.cjs +77 -0
- package/dist/align.cjs +1 -1
- package/dist/align.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-C3zWKgOb.cjs +1 -0
- package/dist/{css-DJCM-h5_.js → css-DnIb4t_E.js} +288 -281
- package/dist/css.cjs +1 -1
- package/dist/css.js +2 -2
- package/dist/dropdown.cjs +1 -1
- package/dist/dropdown.js +1 -1
- package/dist/ether.cjs +1 -1
- package/dist/ether.js +45 -45
- package/dist/{external-CDXLxcOI.js → external-6FH5NjXf.js} +2 -2
- package/dist/{external-Bwu7ljGW.cjs → external-8w5Eg-ce.cjs} +1 -1
- package/dist/external-AQutxNrw.cjs +1 -0
- package/dist/external-BDzzt6lF.js +75 -0
- package/dist/external-BX17kwZc.cjs +1 -0
- package/dist/{external-BeFZRZSq.js → external-BeoanEV1.js} +37 -38
- package/dist/{external-CDYYyyoJ.js → external-BpqHq8f8.js} +13 -13
- package/dist/{external-BzRCbp_C.js → external-BxiJID8F.js} +2 -2
- package/dist/external-C-tizEE4.js +254 -0
- package/dist/external-CFaZ_vCi.js +91 -0
- package/dist/{external-8wTAbTHd.cjs → external-CIm5lpCQ.cjs} +1 -1
- package/dist/{external-BEwtU2Lv.cjs → external-CXQMoMS3.cjs} +1 -1
- package/dist/{external-DRBGP7qn.js → external-CetHCRLx.js} +37 -37
- package/dist/{external-BRbXi-YB.js → external-Ckaptp3S.js} +78 -79
- package/dist/external-Cy8UF9vk.cjs +1 -0
- package/dist/{external-k9_z2UE6.cjs → external-Czhk9fZS.cjs} +1 -1
- package/dist/{external-DaWss0D_.cjs → external-DAn-_GLc.cjs} +1 -1
- package/dist/{external-1M4_dCzb.cjs → external-DlCfhkx8.cjs} +1 -1
- package/dist/external-DtsEr2ls.cjs +1 -0
- package/dist/{external-Dk1cXh1i.cjs → external-Lmd8cJhx.cjs} +1 -1
- package/dist/external-bByVUOOg.cjs +1 -0
- package/dist/{external-CTvBPOgF.js → external-feiUnuJI.js} +2 -2
- package/dist/{external-xhGCeglf.js → external-wgG3P6Dp.js} +1 -1
- package/dist/{external-D08DFJfB.js → external-xPdBJlsz.js} +12 -12
- package/dist/header.cjs +1 -1
- package/dist/header.js +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.js +5191 -5501
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/jsx-runtime-DGh1k5sI.cjs +31 -0
- package/dist/jsx-runtime-Dx-03ztt.js +445 -0
- 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 -0
- package/dist/src/aether/main.d.ts +1 -1
- package/dist/src/aether/main.d.ts.map +1 -1
- package/dist/src/align/Center.d.ts +1 -1
- package/dist/src/align/Center.d.ts.map +1 -1
- package/dist/src/align/Pack.d.ts.map +1 -1
- package/dist/src/align/Space.d.ts +1 -0
- package/dist/src/align/Space.d.ts.map +1 -1
- package/dist/src/breadcrumb/Breadcrumb.d.ts +3 -2
- package/dist/src/breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/src/button/Button.d.ts +5 -4
- package/dist/src/button/Button.d.ts.map +1 -1
- package/dist/src/button/Toggle.d.ts +2 -2
- package/dist/src/channel/LinePlot.d.ts +2 -1
- package/dist/src/channel/LinePlot.d.ts.map +1 -1
- package/dist/src/css/css.d.ts +1 -1
- package/dist/src/css/css.d.ts.map +1 -1
- package/dist/src/form/Field.d.ts.map +1 -1
- package/dist/src/generic/Generic.d.ts +1 -1
- package/dist/src/generic/Generic.d.ts.map +1 -1
- package/dist/src/haul/Haul.d.ts +2 -2
- package/dist/src/haul/Haul.d.ts.map +1 -1
- package/dist/src/hooks/useClickOutside.d.ts +1 -1
- package/dist/src/hooks/useClickOutside.d.ts.map +1 -1
- package/dist/src/hooks/useCursorDrag/types.d.ts +1 -1
- package/dist/src/hooks/useCursorDrag/types.d.ts.map +1 -1
- package/dist/src/icon/Icon.d.ts +5 -5
- package/dist/src/icon/Icon.d.ts.map +1 -1
- package/dist/src/input/DateTime.d.ts +20 -3
- package/dist/src/input/DateTime.d.ts.map +1 -1
- package/dist/src/input/Item.d.ts.map +1 -1
- package/dist/src/input/Switch.d.ts.map +1 -1
- package/dist/src/input/Text.d.ts +2 -1
- package/dist/src/input/Text.d.ts.map +1 -1
- package/dist/src/input/types.d.ts +2 -0
- package/dist/src/input/types.d.ts.map +1 -1
- package/dist/src/list/Selector.d.ts.map +1 -1
- package/dist/src/main.d.ts +1 -0
- package/dist/src/main.d.ts.map +1 -0
- package/dist/src/mock/MockGLBufferController.d.ts +2 -2
- package/dist/src/mock/MockGLBufferController.d.ts.map +1 -1
- package/dist/src/note/Note.d.ts +2 -1
- package/dist/src/note/Note.d.ts.map +1 -1
- package/dist/src/pluto/Pluto.d.ts.map +1 -1
- package/dist/src/resize/Multiple.d.ts +1 -1
- package/dist/src/resize/Multiple.d.ts.map +1 -1
- package/dist/src/select/Alignment.d.ts +2 -1
- package/dist/src/select/Alignment.d.ts.map +1 -1
- package/dist/src/select/Button.d.ts +4 -1
- package/dist/src/select/Button.d.ts.map +1 -1
- package/dist/src/select/Direction.d.ts +2 -1
- package/dist/src/select/Direction.d.ts.map +1 -1
- package/dist/src/select/Single.d.ts +1 -0
- package/dist/src/select/Single.d.ts.map +1 -1
- package/dist/src/status/aether/aggregator.d.ts.map +1 -1
- package/dist/src/status/aether/types.d.ts.map +1 -1
- package/dist/src/synnax/aether/provider.d.ts +141 -0
- package/dist/src/synnax/aether/provider.d.ts.map +1 -1
- package/dist/src/table/aether/Table.d.ts.map +1 -1
- package/dist/src/table/cells/Cells.d.ts.map +1 -1
- package/dist/src/tabs/types.d.ts +2 -1
- package/dist/src/tabs/types.d.ts.map +1 -1
- package/dist/src/tag/Tag.d.ts +2 -1
- package/dist/src/tag/Tag.d.ts.map +1 -1
- package/dist/src/telem/aether/remote.d.ts.map +1 -1
- package/dist/src/telem/aether/static.d.ts +9 -9
- package/dist/src/telem/aether/transformers.d.ts.map +1 -1
- package/dist/src/telem/control/aether/chip.d.ts.map +1 -1
- package/dist/src/telem/control/aether/controller.d.ts.map +1 -1
- package/dist/src/telem/control/aether/indicator.d.ts.map +1 -1
- package/dist/src/telem/control/aether/legend.d.ts.map +1 -1
- package/dist/src/telem/control/aether/state.d.ts.map +1 -1
- package/dist/src/text/DateTime.d.ts +1 -1
- package/dist/src/text/DateTime.d.ts.map +1 -1
- package/dist/src/text/Editable.d.ts.map +1 -1
- package/dist/src/text/Keyboard.d.ts +1 -1
- package/dist/src/text/Keyboard.d.ts.map +1 -1
- package/dist/src/text/Link.d.ts.map +1 -1
- package/dist/src/text/Text.d.ts.map +1 -1
- package/dist/src/tooltip/Dialog.d.ts +7 -1
- package/dist/src/tooltip/Dialog.d.ts.map +1 -1
- package/dist/src/tree/Tree.d.ts.map +1 -1
- package/dist/src/tree/core.d.ts +2 -1
- package/dist/src/tree/core.d.ts.map +1 -1
- package/dist/src/triggers/hooks.d.ts +1 -1
- package/dist/src/triggers/hooks.d.ts.map +1 -1
- package/dist/src/triggers/useDrag.d.ts +1 -1
- package/dist/src/triggers/useDrag.d.ts.map +1 -1
- package/dist/src/util/renderProp.d.ts +1 -1
- package/dist/src/util/renderProp.d.ts.map +1 -1
- package/dist/src/viewport/SelectMode.d.ts.map +1 -1
- package/dist/src/viewport/use.d.ts.map +1 -1
- package/dist/src/vis/canvas/aether/canvas.d.ts.map +1 -1
- package/dist/src/vis/diagram/Diagram.d.ts +2 -1
- package/dist/src/vis/diagram/Diagram.d.ts.map +1 -1
- package/dist/src/vis/diagram/aether/Diagram.d.ts.map +1 -1
- package/dist/src/vis/diagram/aether/types.d.ts +2 -2
- package/dist/src/vis/diagram/aether/types.d.ts.map +1 -1
- package/dist/src/vis/diagram/edge/paths.d.ts +1 -1
- package/dist/src/vis/diagram/edge/paths.d.ts.map +1 -1
- package/dist/src/vis/eraser/aether/eraser.d.ts.map +1 -1
- package/dist/src/vis/legend/Container.d.ts +1 -1
- package/dist/src/vis/legend/Container.d.ts.map +1 -1
- package/dist/src/vis/lineplot/LinePlot.d.ts +1 -0
- package/dist/src/vis/lineplot/LinePlot.d.ts.map +1 -1
- package/dist/src/vis/lineplot/Viewport.d.ts.map +1 -1
- package/dist/src/vis/lineplot/aether/LinePlot.d.ts.map +1 -1
- package/dist/src/vis/lineplot/aether/YAxis.d.ts.map +1 -1
- package/dist/src/vis/lineplot/aether/axis.d.ts.map +1 -1
- package/dist/src/vis/lineplot/range/aether/annotation.d.ts.map +1 -1
- package/dist/src/vis/lineplot/range/aether/provider.d.ts.map +1 -1
- package/dist/src/vis/lineplot/tooltip/aether/tooltip.d.ts.map +1 -1
- package/dist/src/vis/log/aether/Log.d.ts +6 -6
- package/dist/src/vis/log/aether/Log.d.ts.map +1 -1
- package/dist/src/vis/measure/aether/measure.d.ts.map +1 -1
- package/dist/src/vis/rule/Rule.d.ts +3 -1
- package/dist/src/vis/rule/Rule.d.ts.map +1 -1
- package/dist/src/vis/rule/aether/aether.d.ts +1 -0
- package/dist/src/vis/rule/aether/aether.d.ts.map +1 -1
- package/dist/src/vis/schematic/Forms.d.ts.map +1 -1
- package/dist/src/vis/schematic/Grid.d.ts +7 -2
- package/dist/src/vis/schematic/Grid.d.ts.map +1 -1
- package/dist/src/vis/schematic/primitives/Primitives.d.ts.map +1 -1
- package/dist/src/vis/value/aether/value.d.ts.map +1 -1
- package/dist/src/vis/value/use.d.ts.map +1 -1
- 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-D19WggGS.js → units-CKQQRvyD.js} +1 -1
- package/dist/{units-9h1yAbxY.cjs → units-YvMXZR11.cjs} +1 -1
- package/dist/video.cjs +1 -1
- package/dist/video.js +1 -1
- package/package.json +56 -54
- package/dist/Animated-BMxljHxY.js +0 -19
- package/dist/Item-DsAGorI8.cjs +0 -1
- package/dist/Keyboard-D-76mv1a.cjs +0 -1
- package/dist/Keyboard-DbyeBAzq.js +0 -25
- package/dist/LinePlot-DbXPZbQH.cjs +0 -34
- package/dist/LinePlot-DqoSTxNs.js +0 -6534
- package/dist/List-CZxRbYfm.cjs +0 -1
- package/dist/List-S1wnpuEv.js +0 -22
- package/dist/Pack-BzCJQZ58.js +0 -137
- package/dist/Pack-Dvf8sQVK.cjs +0 -1
- package/dist/Text-Bq9B_1wQ.cjs +0 -1
- package/dist/Text-tqSP4klc.js +0 -32
- package/dist/Toggle-DcPmH9Uq.js +0 -44517
- package/dist/Toggle-DrfPMqBr.cjs +0 -143
- package/dist/aggregator-23mu0FOF.js +0 -12640
- package/dist/aggregator-y-jNJhKX.cjs +0 -67
- package/dist/css-BghghSL0.cjs +0 -1
- package/dist/external-BFHPc8Ng.cjs +0 -1
- package/dist/external-Brk-4hys.cjs +0 -1
- package/dist/external-CY1bjqlD.js +0 -76
- package/dist/external-CxBbtPtX.cjs +0 -1
- package/dist/external-DOQ51UTh.cjs +0 -1
- package/dist/external-DcKg8NOr.js +0 -127
- package/dist/external-bMSKTtt-.cjs +0 -1
- package/dist/external-fvuMSTBJ.js +0 -248
- package/dist/jsx-runtime-B6kdoens.js +0 -634
- package/dist/jsx-runtime-Cek9Ww4S.cjs +0 -30
- package/dist/style.css +0 -1
|
@@ -11,19 +11,19 @@ const Oe = i.object({ width: i.number(), height: i.number() }), Mt = i.object({
|
|
|
11
11
|
i.enum(jt);
|
|
12
12
|
const Tt = ["start", "center", "end"], It = ["signedWidth", "signedHeight"];
|
|
13
13
|
i.enum(It);
|
|
14
|
-
const H = i.object({ x: i.number(), y: i.number() }),
|
|
14
|
+
const H = i.object({ x: i.number(), y: i.number() }), ke = i.object({ clientX: i.number(), clientY: i.number() }), Me = ["x", "y"], je = i.enum(Me), Fe = ["top", "right", "bottom", "left"], Et = i.enum(Fe), re = ["left", "right"], Te = i.enum(re), ne = ["top", "bottom"], Ie = i.enum(ne), Ee = ["center"], ce = i.enum(Ee), St = [...Fe, ...Ee], Se = i.enum(St);
|
|
15
15
|
i.enum(Tt);
|
|
16
16
|
const Bt = ["first", "last"];
|
|
17
17
|
i.enum(Bt);
|
|
18
|
-
const
|
|
19
|
-
i.union([
|
|
18
|
+
const We = i.object({ lower: i.number(), upper: i.number() }), Nt = i.object({ lower: i.bigint(), upper: i.bigint() });
|
|
19
|
+
i.union([We, te]);
|
|
20
20
|
i.union([Nt, te]);
|
|
21
21
|
const zt = i.union([je, Se]), Ct = i.union([je, Se, i.instanceof(String)]), T = (t) => typeof t == "bigint" || t instanceof BigInt, Z = (t, e) => T(t) ? t.valueOf() - BigInt(e.valueOf().valueOf()) : t.valueOf() - Number(e.valueOf()), Xe = (t, e) => T(t) ? t.valueOf() + BigInt(e.valueOf().valueOf()) : t + Number(e.valueOf()), At = (t, e, r = 1e-4) => Math.abs(t - e) < r, pe = (t, e) => T(t) ? t === BigInt(e.valueOf().valueOf()) : t === Number(e.valueOf()), Rt = (t) => {
|
|
22
22
|
const e = 10 ** Math.floor(Math.log10(t));
|
|
23
23
|
return Math.round(t / e) * e;
|
|
24
|
-
}, De = (t, e) => T(t) ? t.valueOf() < BigInt(e.valueOf()) ? t : BigInt(e.valueOf()) : t.valueOf() < Number(e.valueOf()) ? t : Number(e.valueOf()), Lt = (t, e) => T(t) ? t.valueOf() > BigInt(e.valueOf()) ? t : BigInt(e.valueOf()) : t.valueOf() > Number(e.valueOf()) ? t : Number(e.valueOf()),
|
|
24
|
+
}, De = (t, e) => T(t) ? t.valueOf() < BigInt(e.valueOf()) ? t : BigInt(e.valueOf()) : t.valueOf() < Number(e.valueOf()) ? t : Number(e.valueOf()), Lt = (t, e) => T(t) ? t.valueOf() > BigInt(e.valueOf()) ? t : BigInt(e.valueOf()) : t.valueOf() > Number(e.valueOf()) ? t : Number(e.valueOf()), Ve = (t) => T(t) || t instanceof BigInt ? t.valueOf() < 0n ? -t : t : t.valueOf() < 0 ? -t : t, _t = (t, e) => T(t) ? t.valueOf() * BigInt(e.valueOf()) : t.valueOf() * Number(e.valueOf()), Pt = (t, e) => T(t) ? t.valueOf() / BigInt(e.valueOf()) : t.valueOf() / Number(e.valueOf()), Wn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
25
25
|
__proto__: null,
|
|
26
|
-
abs:
|
|
26
|
+
abs: Ve,
|
|
27
27
|
add: Xe,
|
|
28
28
|
closeTo: At,
|
|
29
29
|
div: Pt,
|
|
@@ -42,12 +42,12 @@ const zt = i.union([je, Se]), Ct = i.union([je, Se, i.instanceof(String)]), T =
|
|
|
42
42
|
[r.lower, r.upper] = t;
|
|
43
43
|
} else return he(t);
|
|
44
44
|
return he(r);
|
|
45
|
-
}, Zt = Object.freeze({ lower: 0, upper: 0 }), Ht = Object.freeze({ lower: -1 / 0, upper: 1 / 0 }),
|
|
45
|
+
}, Zt = Object.freeze({ lower: 0, upper: 0 }), Ht = Object.freeze({ lower: -1 / 0, upper: 1 / 0 }), Yt = Object.freeze({ lower: 0, upper: 1 }), kt = Object.freeze({ lower: -1, upper: 1 }), Ft = (t, e) => {
|
|
46
46
|
if (t == null && e == null) return !0;
|
|
47
47
|
if (t == null || e == null) return !1;
|
|
48
48
|
const r = p(t), n = p(e);
|
|
49
49
|
return (r == null ? void 0 : r.lower) === (n == null ? void 0 : n.lower) && (r == null ? void 0 : r.upper) === (n == null ? void 0 : n.upper);
|
|
50
|
-
}, he = (t) => t.lower > t.upper ? { lower: t.upper, upper: t.lower } : t,
|
|
50
|
+
}, he = (t) => t.lower > t.upper ? { lower: t.upper, upper: t.lower } : t, Wt = (t, e) => {
|
|
51
51
|
const r = p(t);
|
|
52
52
|
return e < r.lower ? r.lower : e >= r.upper ? r.upper - (typeof r.upper == "number" ? 1 : 1n) : e;
|
|
53
53
|
}, S = (t, e) => {
|
|
@@ -65,19 +65,22 @@ const zt = i.union([je, Se]), Ct = i.union([je, Se, i.instanceof(String)]), T =
|
|
|
65
65
|
}, Dt = (t) => {
|
|
66
66
|
const e = p(t);
|
|
67
67
|
return typeof e.lower == "bigint" ? e.lower === 0n && e.upper === 0n : e.lower === 0 && e.upper === 0;
|
|
68
|
-
},
|
|
68
|
+
}, Vt = (t) => {
|
|
69
69
|
const e = oe(t);
|
|
70
70
|
return typeof e == "number" ? e === 0 : e === 0n;
|
|
71
|
-
},
|
|
71
|
+
}, qt = (t) => {
|
|
72
72
|
const e = p(t);
|
|
73
73
|
return typeof e.lower == "bigint" ? !0 : Number.isFinite(e.lower) && Number.isFinite(e.upper);
|
|
74
|
-
}, Ut = (t) =>
|
|
74
|
+
}, Ut = (t) => {
|
|
75
|
+
const e = p(t);
|
|
76
|
+
return (e.upper + e.lower) / 2;
|
|
77
|
+
}, Gt = (t) => ({
|
|
75
78
|
lower: Math.min(...t.map((e) => p(e).lower)),
|
|
76
79
|
upper: Math.max(...t.map((e) => p(e).upper))
|
|
77
|
-
}),
|
|
80
|
+
}), Kt = (t) => ({
|
|
78
81
|
lower: Math.max(...t.map((e) => p(e).lower)),
|
|
79
82
|
upper: Math.min(...t.map((e) => p(e).upper))
|
|
80
|
-
}),
|
|
83
|
+
}), Jt = (t) => {
|
|
81
84
|
const e = p(t), r = typeof e.lower == "bigint";
|
|
82
85
|
return Array.from({ length: Number(oe(t)) }, (n, o) => r ? e.lower + BigInt(o) : e.lower + o);
|
|
83
86
|
}, ye = (t, e) => {
|
|
@@ -90,8 +93,8 @@ const zt = i.union([je, Se]), Ct = i.union([je, Se, i.instanceof(String)]), T =
|
|
|
90
93
|
removeAfter: 0,
|
|
91
94
|
insertInto: 0,
|
|
92
95
|
deleteInBetween: 0
|
|
93
|
-
},
|
|
94
|
-
const r = t.map((
|
|
96
|
+
}, Qt = (t, e) => {
|
|
97
|
+
const r = t.map((c) => p(c)), n = p(e);
|
|
95
98
|
if (r.length === 0) return ae;
|
|
96
99
|
const o = ye(r, n.lower), s = ye(r, n.upper);
|
|
97
100
|
if (o.index === t.length) return { ...ae, insertInto: t.length };
|
|
@@ -103,24 +106,24 @@ const zt = i.union([je, Se]), Ct = i.union([je, Se, i.instanceof(String)]), T =
|
|
|
103
106
|
insertInto: o.index,
|
|
104
107
|
deleteInBetween: 0
|
|
105
108
|
};
|
|
106
|
-
let u = s.index - o.index, a = o.index,
|
|
107
|
-
return o.position !== 0 ? (u -= 1, a += 1) :
|
|
108
|
-
removeBefore:
|
|
109
|
+
let u = s.index - o.index, a = o.index, l = Z(Number(oe(r[o.index])), o.position);
|
|
110
|
+
return o.position !== 0 ? (u -= 1, a += 1) : l = 0, {
|
|
111
|
+
removeBefore: l,
|
|
109
112
|
removeAfter: s.position,
|
|
110
113
|
insertInto: a,
|
|
111
114
|
deleteInBetween: u
|
|
112
115
|
};
|
|
113
|
-
},
|
|
116
|
+
}, er = (t, e, r) => {
|
|
114
117
|
const n = t.map((a) => p(a)), o = r > 0 ? 1 : r < 0 ? -1 : 0;
|
|
115
118
|
if (o === 0) return e;
|
|
116
119
|
let s = r, u = e;
|
|
117
120
|
for (; pe(s, 0) === !1; ) {
|
|
118
|
-
const a = n.findIndex((
|
|
121
|
+
const a = n.findIndex((l) => o > 0 ? u >= l.lower && u < l.upper : u > l.lower && u <= l.upper);
|
|
119
122
|
if (a !== -1) {
|
|
120
|
-
const
|
|
121
|
-
let
|
|
122
|
-
if (o > 0 ?
|
|
123
|
-
const h = De(
|
|
123
|
+
const l = n[a];
|
|
124
|
+
let c;
|
|
125
|
+
if (o > 0 ? c = Z(l.upper, u) : c = Z(u, l.lower), c > 0) {
|
|
126
|
+
const h = De(Ve(s), c);
|
|
124
127
|
if (u = Xe(
|
|
125
128
|
u,
|
|
126
129
|
o > 0 ? h : -h
|
|
@@ -129,65 +132,66 @@ const zt = i.union([je, Se]), Ct = i.union([je, Se, i.instanceof(String)]), T =
|
|
|
129
132
|
}
|
|
130
133
|
}
|
|
131
134
|
if (o > 0) {
|
|
132
|
-
const
|
|
133
|
-
if (
|
|
135
|
+
const l = n.filter((c) => c.lower > u);
|
|
136
|
+
if (l.length > 0) u = l[0].lower;
|
|
134
137
|
else return u;
|
|
135
138
|
} else {
|
|
136
|
-
const
|
|
137
|
-
if (
|
|
138
|
-
u =
|
|
139
|
+
const l = n.filter((c) => c.upper < u);
|
|
140
|
+
if (l.length > 0)
|
|
141
|
+
u = l[l.length - 1].upper;
|
|
139
142
|
else return u;
|
|
140
143
|
}
|
|
141
144
|
}
|
|
142
145
|
return u;
|
|
143
|
-
},
|
|
146
|
+
}, tr = (t, e, r) => {
|
|
144
147
|
const n = t.map((u) => p(u));
|
|
145
148
|
if (e === r) return typeof e == "bigint" ? 0n : 0;
|
|
146
149
|
const o = e < r ? p([e, r]) : p([r, e]);
|
|
147
150
|
let s = typeof e == "bigint" ? 0n : 0;
|
|
148
151
|
for (const u of n) {
|
|
149
|
-
const a = u.lower > o.lower ? u.lower : o.lower,
|
|
150
|
-
if (a <
|
|
151
|
-
const
|
|
152
|
-
s = s +
|
|
152
|
+
const a = u.lower > o.lower ? u.lower : o.lower, l = u.upper < o.upper ? u.upper : o.upper;
|
|
153
|
+
if (a < l) {
|
|
154
|
+
const c = l - a;
|
|
155
|
+
s = s + c;
|
|
153
156
|
}
|
|
154
157
|
}
|
|
155
158
|
return s;
|
|
156
|
-
},
|
|
159
|
+
}, Xn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
157
160
|
__proto__: null,
|
|
158
|
-
CLIP:
|
|
159
|
-
DECIMAL:
|
|
161
|
+
CLIP: kt,
|
|
162
|
+
DECIMAL: Yt,
|
|
160
163
|
INFINITE: Ht,
|
|
161
164
|
ZERO: Zt,
|
|
162
|
-
bounds:
|
|
163
|
-
buildInsertionPlan:
|
|
164
|
-
clamp:
|
|
165
|
+
bounds: We,
|
|
166
|
+
buildInsertionPlan: Qt,
|
|
167
|
+
clamp: Wt,
|
|
165
168
|
construct: p,
|
|
166
169
|
contains: S,
|
|
167
|
-
distance:
|
|
168
|
-
equals:
|
|
170
|
+
distance: tr,
|
|
171
|
+
equals: Ft,
|
|
169
172
|
findInsertPosition: ye,
|
|
170
|
-
isFinite:
|
|
173
|
+
isFinite: qt,
|
|
171
174
|
isZero: Dt,
|
|
172
|
-
linspace:
|
|
175
|
+
linspace: Jt,
|
|
173
176
|
makeValid: he,
|
|
174
|
-
max:
|
|
175
|
-
|
|
177
|
+
max: Gt,
|
|
178
|
+
mean: Ut,
|
|
179
|
+
min: Kt,
|
|
176
180
|
overlapsWith: Xt,
|
|
177
181
|
span: oe,
|
|
178
|
-
spanIsZero:
|
|
179
|
-
traverse:
|
|
180
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
182
|
+
spanIsZero: Vt,
|
|
183
|
+
traverse: er
|
|
184
|
+
}, Symbol.toStringTag, { value: "Module" })), qe = zt, I = (t) => Me.includes(t) ? t : ne.includes(t) ? "y" : "x", rr = (t) => I(t) === "x" ? "y" : "x", nr = (t) => I(t) === "x" ? "width" : "height", or = (t) => I(t) === "x" ? "left" : "top", sr = (t) => qe.safeParse(t).success, ir = (t) => I(t) === "x" ? "signedWidth" : "signedHeight", ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
181
185
|
__proto__: null,
|
|
182
186
|
construct: I,
|
|
183
|
-
crude:
|
|
184
|
-
dimension:
|
|
187
|
+
crude: qe,
|
|
188
|
+
dimension: nr,
|
|
185
189
|
direction: je,
|
|
186
|
-
isDirection:
|
|
187
|
-
location:
|
|
188
|
-
signedDimension:
|
|
189
|
-
swap:
|
|
190
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
190
|
+
isDirection: sr,
|
|
191
|
+
location: or,
|
|
192
|
+
signedDimension: ir,
|
|
193
|
+
swap: rr
|
|
194
|
+
}, Symbol.toStringTag, { value: "Module" })), ar = (t) => {
|
|
191
195
|
const e = t.replace(/_[a-z]/g, (r) => r[1].toUpperCase());
|
|
192
196
|
return e.length > 1 && e[0] === e[0].toUpperCase() && e[1] === e[1].toUpperCase() || e.length === 0 ? e : e[0].toLowerCase() + e.slice(1);
|
|
193
197
|
}, Ue = (t) => {
|
|
@@ -199,69 +203,69 @@ const zt = i.union([je, Se]), Ct = i.union([je, Se, i.instanceof(String)]), T =
|
|
|
199
203
|
const o = {}, s = r;
|
|
200
204
|
return Object.keys(s).forEach((u) => {
|
|
201
205
|
let a = s[u];
|
|
202
|
-
const
|
|
203
|
-
n.recursive && (U(a) ? de(a, n.keepTypesOnRecursion) || (a = e(a, n)) : n.recursiveInArray && fe(a) && (a = [...a].map((
|
|
204
|
-
let h =
|
|
205
|
-
return U(
|
|
206
|
-
}))), o[
|
|
206
|
+
const l = t(u);
|
|
207
|
+
n.recursive && (U(a) ? de(a, n.keepTypesOnRecursion) || (a = e(a, n)) : n.recursiveInArray && fe(a) && (a = [...a].map((c) => {
|
|
208
|
+
let h = c;
|
|
209
|
+
return U(c) ? de(h, n.keepTypesOnRecursion) || (h = e(c, n)) : fe(c) && (h = e({ key: c }, n).key), h;
|
|
210
|
+
}))), o[l] = a;
|
|
207
211
|
}), o;
|
|
208
212
|
};
|
|
209
213
|
return e;
|
|
210
|
-
},
|
|
214
|
+
}, lr = Ue(ar), cr = (t) => (
|
|
211
215
|
// Don't convert the first character and don't convert a character that is after a
|
|
212
216
|
// non-alphanumeric character
|
|
213
217
|
t.replace(/([a-z0-9])([A-Z])/g, (e, r, n) => `${r}_${n.toLowerCase()}`)
|
|
214
|
-
),
|
|
218
|
+
), pr = Ue(cr), Ge = (t) => t.length === 0 ? t : t[0].toUpperCase() + t.slice(1), Q = {
|
|
215
219
|
recursive: !0,
|
|
216
220
|
recursiveInArray: !0,
|
|
217
221
|
keepTypesOnRecursion: [Number, String, Uint8Array]
|
|
218
|
-
}, Ke = (t = Q) => (t.recursive == null ? t = Q : t.recursiveInArray ?? (t.recursiveInArray = !1), t), fe = (t) => t != null && Array.isArray(t), U = (t) => t != null && typeof t == "object" && !Array.isArray(t), de = (t, e) => (e || []).some((r) => t instanceof r),
|
|
222
|
+
}, Ke = (t = Q) => (t.recursive == null ? t = Q : t.recursiveInArray ?? (t.recursiveInArray = !1), t), fe = (t) => t != null && Array.isArray(t), U = (t) => t != null && typeof t == "object" && !Array.isArray(t), de = (t, e) => (e || []).some((r) => t instanceof r), Dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
219
223
|
__proto__: null,
|
|
220
224
|
belongToTypes: de,
|
|
221
|
-
camelToSnake:
|
|
225
|
+
camelToSnake: pr,
|
|
222
226
|
capitalize: Ge,
|
|
223
227
|
defaultOptions: Q,
|
|
224
228
|
isArrayObject: fe,
|
|
225
229
|
isValidObject: U,
|
|
226
|
-
snakeToCamel:
|
|
230
|
+
snakeToCamel: lr,
|
|
227
231
|
validateOptions: Ke
|
|
228
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
232
|
+
}, Symbol.toStringTag, { value: "Module" })), hr = Te, yr = Ie, fr = ce, dr = {
|
|
229
233
|
top: "bottom",
|
|
230
234
|
right: "left",
|
|
231
235
|
bottom: "top",
|
|
232
236
|
left: "right",
|
|
233
237
|
center: "center"
|
|
234
|
-
},
|
|
238
|
+
}, gr = {
|
|
235
239
|
top: "left",
|
|
236
240
|
right: "top",
|
|
237
241
|
bottom: "right",
|
|
238
242
|
left: "bottom",
|
|
239
243
|
center: "center"
|
|
240
|
-
},
|
|
244
|
+
}, br = Ct, O = (t) => t instanceof String || !Me.includes(t) ? t : t === "x" ? "left" : "top", xr = (t) => dr[O(t)], mr = (t) => gr[O(t)], Y = (t) => {
|
|
241
245
|
const e = O(t);
|
|
242
246
|
return e === "top" || e === "bottom" ? "y" : "x";
|
|
243
|
-
},
|
|
244
|
-
x: Te.or(
|
|
245
|
-
y: Ie.or(
|
|
246
|
-
}), Je = i.object({ x: Te, y: Ie }),
|
|
247
|
+
}, wr = i.object({
|
|
248
|
+
x: Te.or(ce),
|
|
249
|
+
y: Ie.or(ce)
|
|
250
|
+
}), Je = i.object({ x: Te, y: Ie }), F = Object.freeze({ x: "left", y: "top" }), Be = Object.freeze({ x: "right", y: "top" }), se = Object.freeze({ x: "left", y: "bottom" }), Ne = Object.freeze({ x: "right", y: "bottom" }), ze = Object.freeze({ x: "center", y: "center" }), Qe = Object.freeze({ x: "center", y: "top" }), et = Object.freeze({ x: "center", y: "bottom" }), tt = Object.freeze({ x: "right", y: "center" }), rt = Object.freeze({ x: "left", y: "center" }), $r = Object.freeze([
|
|
247
251
|
rt,
|
|
248
252
|
tt,
|
|
249
253
|
Qe,
|
|
250
254
|
et,
|
|
251
|
-
|
|
255
|
+
F,
|
|
252
256
|
Be,
|
|
253
257
|
se,
|
|
254
258
|
Ne,
|
|
255
259
|
ze
|
|
256
|
-
]), Ce = (t, e) => t.x === e.x && t.y === e.y,
|
|
260
|
+
]), Ce = (t, e) => t.x === e.x && t.y === e.y, vr = (t, e) => {
|
|
257
261
|
if (typeof e == "object") {
|
|
258
262
|
let r = !0;
|
|
259
263
|
return "x" in e && (t.x === e.x || (r = !1)), "y" in e && (t.y === e.y || (r = !1)), r;
|
|
260
264
|
}
|
|
261
265
|
return t.x === e || t.y === e;
|
|
262
|
-
}, nt = (t) => [t.x, t.y], G = (t) =>
|
|
266
|
+
}, nt = (t) => [t.x, t.y], G = (t) => Y(O(t)) === "x", Or = (t) => Y(O(t)) === "y", Mr = (t) => `${t.x}${Ge(t.y)}`, jr = (t, e) => {
|
|
263
267
|
let r, n;
|
|
264
|
-
if (typeof t == "object" && "x" in t ? (r = t.x, n = t.y) : (r = O(t), n = O(e ?? t)),
|
|
268
|
+
if (typeof t == "object" && "x" in t ? (r = t.x, n = t.y) : (r = O(t), n = O(e ?? t)), Y(r) === Y(n) && r !== "center" && n !== "center")
|
|
265
269
|
throw new Error(
|
|
266
270
|
`[XYLocation] - encountered two locations with the same direction: ${r.toString()} - ${n.toString()}`
|
|
267
271
|
);
|
|
@@ -277,47 +281,47 @@ const zt = i.union([je, Se]), Ct = i.union([je, Se, i.instanceof(String)]), T =
|
|
|
277
281
|
LEFT_CENTER: rt,
|
|
278
282
|
RIGHT_CENTER: tt,
|
|
279
283
|
TOP_CENTER: Qe,
|
|
280
|
-
TOP_LEFT:
|
|
284
|
+
TOP_LEFT: F,
|
|
281
285
|
TOP_RIGHT: Be,
|
|
282
|
-
XY_LOCATIONS:
|
|
286
|
+
XY_LOCATIONS: $r,
|
|
283
287
|
X_LOCATIONS: re,
|
|
284
288
|
Y_LOCATIONS: ne,
|
|
285
|
-
center:
|
|
289
|
+
center: fr,
|
|
286
290
|
construct: O,
|
|
287
|
-
constructXY:
|
|
291
|
+
constructXY: jr,
|
|
288
292
|
corner: Je,
|
|
289
|
-
crude:
|
|
290
|
-
direction:
|
|
293
|
+
crude: br,
|
|
294
|
+
direction: Y,
|
|
291
295
|
isX: G,
|
|
292
|
-
isY:
|
|
296
|
+
isY: Or,
|
|
293
297
|
location: Se,
|
|
294
298
|
outer: Et,
|
|
295
|
-
rotate90:
|
|
296
|
-
swap:
|
|
297
|
-
x:
|
|
298
|
-
xy:
|
|
299
|
+
rotate90: mr,
|
|
300
|
+
swap: xr,
|
|
301
|
+
x: hr,
|
|
302
|
+
xy: wr,
|
|
299
303
|
xyCouple: nt,
|
|
300
304
|
xyEquals: Ce,
|
|
301
|
-
xyMatches:
|
|
302
|
-
xyToString:
|
|
303
|
-
y:
|
|
305
|
+
xyMatches: vr,
|
|
306
|
+
xyToString: Mr,
|
|
307
|
+
y: yr
|
|
304
308
|
}, Symbol.toStringTag, { value: "Module" })), ge = i.union([
|
|
305
309
|
i.number(),
|
|
306
310
|
H,
|
|
307
311
|
te,
|
|
308
312
|
Oe,
|
|
309
313
|
Mt,
|
|
310
|
-
|
|
314
|
+
ke
|
|
311
315
|
]), f = (t, e) => {
|
|
312
316
|
if (typeof t == "string") {
|
|
313
317
|
if (e === void 0) throw new Error("The y coordinate must be given.");
|
|
314
318
|
return t === "x" ? { x: e, y: 0 } : { x: 0, y: e };
|
|
315
319
|
}
|
|
316
320
|
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 };
|
|
317
|
-
}, x = Object.freeze({ x: 0, y: 0 }), st = Object.freeze({ x: 1, y: 1 }),
|
|
321
|
+
}, x = Object.freeze({ x: 0, y: 0 }), st = Object.freeze({ x: 1, y: 1 }), Tr = Object.freeze({ x: 1 / 0, y: 1 / 0 }), Ir = Object.freeze({ x: NaN, y: NaN }), ee = (t, e, r = 0) => {
|
|
318
322
|
const n = f(t), o = f(e);
|
|
319
323
|
return r === 0 ? n.x === o.x && n.y === o.y : Math.abs(n.x - o.x) <= r && Math.abs(n.y - o.y) <= r;
|
|
320
|
-
},
|
|
324
|
+
}, Er = (t) => ee(t, x), Ae = (t, e, r) => {
|
|
321
325
|
const n = f(t), o = f(e, r);
|
|
322
326
|
return { x: n.x * o.x, y: n.y * o.y };
|
|
323
327
|
}, it = (t, e) => {
|
|
@@ -326,28 +330,28 @@ const zt = i.union([je, Se]), Ct = i.union([je, Se, i.instanceof(String)]), T =
|
|
|
326
330
|
}, ut = (t, e) => {
|
|
327
331
|
const r = f(t);
|
|
328
332
|
return { x: r.x, y: r.y + e };
|
|
329
|
-
},
|
|
333
|
+
}, k = (t, e, r, ...n) => typeof e == "string" && typeof r == "number" ? e === "x" ? it(t, r) : ut(t, r) : [t, e, r ?? x, ...n].reduce((o, s) => {
|
|
330
334
|
const u = f(s);
|
|
331
335
|
return { x: o.x + u.x, y: o.y + u.y };
|
|
332
|
-
}, x),
|
|
336
|
+
}, x), Sr = (t, e, r) => {
|
|
333
337
|
const n = f(t);
|
|
334
338
|
return e === "x" ? { x: r, y: n.y } : { x: n.x, y: r };
|
|
335
|
-
},
|
|
339
|
+
}, Br = (t, e) => {
|
|
336
340
|
const r = f(t), n = f(e);
|
|
337
341
|
return Math.sqrt((r.x - n.x) ** 2 + (r.y - n.y) ** 2);
|
|
338
|
-
},
|
|
342
|
+
}, Nr = (t, e) => {
|
|
339
343
|
const r = f(t), n = f(e);
|
|
340
344
|
return { x: n.x - r.x, y: n.y - r.y };
|
|
341
|
-
},
|
|
345
|
+
}, zr = (t) => {
|
|
342
346
|
const e = f(t);
|
|
343
347
|
return Number.isNaN(e.x) || Number.isNaN(e.y);
|
|
344
|
-
},
|
|
348
|
+
}, Cr = (t) => {
|
|
345
349
|
const e = f(t);
|
|
346
350
|
return Number.isFinite(e.x) && Number.isFinite(e.y);
|
|
347
|
-
},
|
|
351
|
+
}, Ar = (t) => {
|
|
348
352
|
const e = f(t);
|
|
349
353
|
return [e.x, e.y];
|
|
350
|
-
},
|
|
354
|
+
}, Rr = (t) => {
|
|
351
355
|
const e = f(t);
|
|
352
356
|
return { left: e.x, top: e.y };
|
|
353
357
|
}, be = (t, e = 0) => {
|
|
@@ -362,75 +366,75 @@ const zt = i.union([je, Se]), Ct = i.union([je, Se, i.instanceof(String)]), T =
|
|
|
362
366
|
}, at = (t) => {
|
|
363
367
|
const e = f(t), r = Math.hypot(e.x, e.y);
|
|
364
368
|
return r === 0 ? { x: 0, y: 0 } : { x: e.x / r, y: e.y / r };
|
|
365
|
-
},
|
|
366
|
-
const e = t.reduce((r, n) =>
|
|
369
|
+
}, lt = (...t) => {
|
|
370
|
+
const e = t.reduce((r, n) => k(r, n), x);
|
|
367
371
|
return Ae(e, 1 / t.length);
|
|
368
|
-
},
|
|
372
|
+
}, Lr = (t, e) => {
|
|
369
373
|
const r = [];
|
|
370
374
|
for (let n = 0; n < t.length; n++) {
|
|
371
375
|
const o = t[n];
|
|
372
|
-
let s, u, a,
|
|
376
|
+
let s, u, a, l;
|
|
373
377
|
if (n === 0) {
|
|
374
|
-
const
|
|
375
|
-
u = _(h), a = u,
|
|
378
|
+
const c = t[n + 1], h = L(c, o);
|
|
379
|
+
u = _(h), a = u, l = e;
|
|
376
380
|
} else if (n === t.length - 1) {
|
|
377
|
-
const
|
|
378
|
-
s = _(h), a = s,
|
|
381
|
+
const c = t[n - 1], h = L(o, c);
|
|
382
|
+
s = _(h), a = s, l = e;
|
|
379
383
|
} else {
|
|
380
|
-
const
|
|
384
|
+
const c = t[n - 1], h = t[n + 1], E = L(o, c), R = L(h, o);
|
|
381
385
|
s = _(E), u = _(R);
|
|
382
386
|
const $t = Math.acos(
|
|
383
387
|
(E.x * R.x + E.y * R.y) / (Math.hypot(E.x, E.y) * Math.hypot(R.x, R.y))
|
|
384
388
|
), Ze = Math.sin($t / 2);
|
|
385
|
-
Ze === 0 ?
|
|
389
|
+
Ze === 0 ? l = e : l = e / Ze, a = at(lt(s, u));
|
|
386
390
|
}
|
|
387
|
-
r.push(Ae(a,
|
|
391
|
+
r.push(Ae(a, l));
|
|
388
392
|
}
|
|
389
393
|
return r;
|
|
390
|
-
},
|
|
394
|
+
}, Vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
391
395
|
__proto__: null,
|
|
392
|
-
INFINITY:
|
|
393
|
-
NAN:
|
|
396
|
+
INFINITY: Tr,
|
|
397
|
+
NAN: Ir,
|
|
394
398
|
ONE: st,
|
|
395
399
|
ZERO: x,
|
|
396
|
-
average:
|
|
397
|
-
calculateMiters:
|
|
398
|
-
clientXY:
|
|
400
|
+
average: lt,
|
|
401
|
+
calculateMiters: Lr,
|
|
402
|
+
clientXY: ke,
|
|
399
403
|
construct: f,
|
|
400
|
-
couple:
|
|
404
|
+
couple: Ar,
|
|
401
405
|
crudeZ: ge,
|
|
402
|
-
css:
|
|
403
|
-
distance:
|
|
406
|
+
css: Rr,
|
|
407
|
+
distance: Br,
|
|
404
408
|
equals: ee,
|
|
405
|
-
isFinite:
|
|
406
|
-
isNan:
|
|
407
|
-
isZero:
|
|
409
|
+
isFinite: Cr,
|
|
410
|
+
isNan: zr,
|
|
411
|
+
isZero: Er,
|
|
408
412
|
normal: _,
|
|
409
413
|
normalize: at,
|
|
410
414
|
scale: Ae,
|
|
411
|
-
set:
|
|
415
|
+
set: Sr,
|
|
412
416
|
sub: L,
|
|
413
|
-
translate:
|
|
417
|
+
translate: k,
|
|
414
418
|
translateX: it,
|
|
415
419
|
translateY: ut,
|
|
416
|
-
translation:
|
|
420
|
+
translation: Nr,
|
|
417
421
|
truncate: be,
|
|
418
422
|
xy: H
|
|
419
|
-
}, Symbol.toStringTag, { value: "Module" })), X = i.union([i.number(), i.string()]),
|
|
423
|
+
}, Symbol.toStringTag, { value: "Module" })), X = i.union([i.number(), i.string()]), _r = i.object({
|
|
420
424
|
top: X,
|
|
421
425
|
left: X,
|
|
422
426
|
width: X,
|
|
423
427
|
height: X
|
|
424
|
-
}),
|
|
428
|
+
}), Pr = i.object({
|
|
425
429
|
left: i.number(),
|
|
426
430
|
top: i.number(),
|
|
427
431
|
right: i.number(),
|
|
428
432
|
bottom: i.number()
|
|
429
|
-
}),
|
|
433
|
+
}), Zr = i.object({
|
|
430
434
|
one: H,
|
|
431
435
|
two: H,
|
|
432
436
|
root: Je
|
|
433
|
-
}),
|
|
437
|
+
}), ct = { one: x, two: x, root: F }, Hr = { one: x, two: st, root: se }, pt = (t, e) => ({
|
|
434
438
|
one: t.one,
|
|
435
439
|
two: t.two,
|
|
436
440
|
root: e ?? t.root
|
|
@@ -438,7 +442,7 @@ const zt = i.union([je, Se]), Ct = i.union([je, Se, i.instanceof(String)]), T =
|
|
|
438
442
|
const s = {
|
|
439
443
|
one: { ...x },
|
|
440
444
|
two: { ...x },
|
|
441
|
-
root: o ??
|
|
445
|
+
root: o ?? F
|
|
442
446
|
};
|
|
443
447
|
if (typeof t == "number") {
|
|
444
448
|
if (typeof e != "number")
|
|
@@ -452,7 +456,7 @@ const zt = i.union([je, Se]), Ct = i.union([je, Se, i.instanceof(String)]), T =
|
|
|
452
456
|
x: s.one.x + e.signedWidth,
|
|
453
457
|
y: s.one.y + e.signedHeight
|
|
454
458
|
} : s.two = e, s));
|
|
455
|
-
},
|
|
459
|
+
}, Yr = (t, e, r) => {
|
|
456
460
|
const n = y(t);
|
|
457
461
|
if (typeof e == "string") {
|
|
458
462
|
if (r == null) throw new Error("Invalid arguments for resize");
|
|
@@ -466,17 +470,17 @@ const zt = i.union([je, Se]), Ct = i.union([je, Se, i.instanceof(String)]), T =
|
|
|
466
470
|
);
|
|
467
471
|
}
|
|
468
472
|
return y(n.one, e, void 0, void 0, n.root);
|
|
469
|
-
},
|
|
473
|
+
}, kr = (t, e, r = !0) => {
|
|
470
474
|
const n = y(t);
|
|
471
475
|
let o = (s, u) => s < u;
|
|
472
476
|
return r && (o = (s, u) => s <= u), "one" in e ? o($(n), $(e)) && o(B(e), B(n)) && o(v(n), v(e)) && o(N(e), N(n)) : o($(n), e.x) && o(e.x, B(n)) && o(v(n), e.y) && o(e.y, N(n));
|
|
473
|
-
},
|
|
477
|
+
}, Fr = (t, e) => ee(t.one, e.one) && ee(t.two, e.two) && Ce(t.root, e.root), ht = (t) => ({
|
|
474
478
|
width: M(t),
|
|
475
479
|
height: j(t)
|
|
476
|
-
}),
|
|
480
|
+
}), Wr = (t) => ({
|
|
477
481
|
signedWidth: ie(t),
|
|
478
482
|
signedHeight: ue(t)
|
|
479
|
-
}),
|
|
483
|
+
}), Xr = (t) => ({
|
|
480
484
|
top: v(t),
|
|
481
485
|
left: $(t),
|
|
482
486
|
width: M(t),
|
|
@@ -484,7 +488,7 @@ const zt = i.union([je, Se]), Ct = i.union([je, Se, i.instanceof(String)]), T =
|
|
|
484
488
|
}), Re = (t, e, r = !1) => {
|
|
485
489
|
const n = I(e) === "y" ? ue(t) : ie(t);
|
|
486
490
|
return r ? n : Math.abs(n);
|
|
487
|
-
},
|
|
491
|
+
}, W = (t, e) => {
|
|
488
492
|
const r = y(t);
|
|
489
493
|
return {
|
|
490
494
|
x: e.x === "center" ? xe(r).x : z(r, e.x),
|
|
@@ -493,13 +497,13 @@ const zt = i.union([je, Se]), Ct = i.union([je, Se, i.instanceof(String)]), T =
|
|
|
493
497
|
}, z = (t, e) => {
|
|
494
498
|
const r = y(t), n = nt(r.root).includes(e) ? Math.min : Math.max;
|
|
495
499
|
return re.includes(e) ? n(r.one.x, r.two.x) : n(r.one.y, r.two.y);
|
|
496
|
-
},
|
|
500
|
+
}, Dr = (t) => t.one.x === t.two.x && t.one.y === t.two.y, M = (t) => Re(t, "x"), j = (t) => Re(t, "y"), ie = (t) => {
|
|
497
501
|
const e = y(t);
|
|
498
502
|
return e.two.x - e.one.x;
|
|
499
503
|
}, ue = (t) => {
|
|
500
504
|
const e = y(t);
|
|
501
505
|
return e.two.y - e.one.y;
|
|
502
|
-
}, yt = (t) =>
|
|
506
|
+
}, yt = (t) => W(t, F), Vr = (t) => W(t, Be), qr = (t) => W(t, se), Ur = (t) => W(t, Ne), B = (t) => z(t, "right"), N = (t) => z(t, "bottom"), $ = (t) => z(t, "left"), v = (t) => z(t, "top"), xe = (t) => k(yt(t), {
|
|
503
507
|
x: ie(t) / 2,
|
|
504
508
|
y: ue(t) / 2
|
|
505
509
|
}), Le = (t) => {
|
|
@@ -508,21 +512,21 @@ const zt = i.union([je, Se]), Ct = i.union([je, Se, i.instanceof(String)]), T =
|
|
|
508
512
|
}, _e = (t) => {
|
|
509
513
|
const e = y(t);
|
|
510
514
|
return e.root.y === "top" ? v(e) : N(e);
|
|
511
|
-
},
|
|
515
|
+
}, Gr = (t) => ({ x: Le(t), y: _e(t) }), K = (t) => {
|
|
512
516
|
const e = y(t);
|
|
513
517
|
return { lower: e.one.x, upper: e.two.x };
|
|
514
518
|
}, J = (t) => {
|
|
515
519
|
const e = y(t);
|
|
516
520
|
return { lower: e.one.y, upper: e.two.y };
|
|
517
|
-
},
|
|
521
|
+
}, Kr = (t, e) => pt(t, e), Jr = (t, e) => {
|
|
518
522
|
const r = y(t), n = re.includes(e) ? "x" : ne.includes(e) ? "y" : null;
|
|
519
523
|
if (n === null) throw new Error(`Invalid location: ${ot}`);
|
|
520
524
|
const o = e === "top" || e === "left" ? Math.min : Math.max, s = { ...r.one }, u = { ...r.two };
|
|
521
525
|
return s[n] = o(r.one[n], r.two[n]), u[n] = o(r.one[n], r.two[n]), [s, u];
|
|
522
|
-
},
|
|
526
|
+
}, Qr = (t, e) => {
|
|
523
527
|
const r = y(t), n = y(e), o = Le(n) + (M(n) - M(r)) / 2, s = _e(n) + (j(n) - j(r)) / 2;
|
|
524
528
|
return y({ x: o, y: s }, ht(r));
|
|
525
|
-
}, ft = (t) => typeof t != "object" || t == null ? !1 : "one" in t && "two" in t && "root" in t,
|
|
529
|
+
}, ft = (t) => typeof t != "object" || t == null ? !1 : "one" in t && "two" in t && "root" in t, en = (t) => M(t) / j(t), tn = (t, e, r) => {
|
|
526
530
|
if (typeof e == "string") {
|
|
527
531
|
if (r == null) throw new Error("Undefined amount passed into box.translate");
|
|
528
532
|
const o = I(e);
|
|
@@ -530,16 +534,16 @@ const zt = i.union([je, Se]), Ct = i.union([je, Se, i.instanceof(String)]), T =
|
|
|
530
534
|
}
|
|
531
535
|
const n = y(t);
|
|
532
536
|
return y(
|
|
533
|
-
|
|
534
|
-
|
|
537
|
+
k(n.one, e),
|
|
538
|
+
k(n.two, e),
|
|
535
539
|
void 0,
|
|
536
540
|
void 0,
|
|
537
541
|
n.root
|
|
538
542
|
);
|
|
539
|
-
},
|
|
543
|
+
}, rn = (t, e) => {
|
|
540
544
|
const r = Math.max($(t), $(e)), n = Math.max(v(t), v(e)), o = Math.min(B(t), B(e)), s = Math.min(N(t), N(e));
|
|
541
|
-
return r > o || n > s ?
|
|
542
|
-
},
|
|
545
|
+
return r > o || n > s ? ct : y({ x: r, y: n }, { x: o, y: s }, void 0, void 0, t.root);
|
|
546
|
+
}, nn = (t) => M(t) * j(t), on = (t, e) => {
|
|
543
547
|
const r = y(t);
|
|
544
548
|
return y(
|
|
545
549
|
be(r.one, e),
|
|
@@ -548,115 +552,115 @@ const zt = i.union([je, Se]), Ct = i.union([je, Se, i.instanceof(String)]), T =
|
|
|
548
552
|
void 0,
|
|
549
553
|
r.root
|
|
550
554
|
);
|
|
551
|
-
},
|
|
555
|
+
}, sn = (t, e, r, n, o, s) => {
|
|
552
556
|
const u = { x: t, y: e }, a = { x: t + r, y: e + n };
|
|
553
557
|
return o.x !== s.x && (o.x === "center" ? (u.x -= r / 2, a.x -= r / 2) : (u.x -= r, a.x -= r)), o.y !== s.y && (o.y === "center" ? (u.y -= n / 2, a.y -= n / 2) : (u.y -= n, a.y -= n)), y(u, a, void 0, void 0, s);
|
|
554
558
|
}, qn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
555
559
|
__proto__: null,
|
|
556
|
-
DECIMAL:
|
|
557
|
-
ZERO:
|
|
558
|
-
area:
|
|
559
|
-
areaIsZero:
|
|
560
|
-
aspect:
|
|
560
|
+
DECIMAL: Hr,
|
|
561
|
+
ZERO: ct,
|
|
562
|
+
area: nn,
|
|
563
|
+
areaIsZero: Dr,
|
|
564
|
+
aspect: en,
|
|
561
565
|
bottom: N,
|
|
562
566
|
bottomLeft: qr,
|
|
563
|
-
bottomRight:
|
|
564
|
-
box:
|
|
567
|
+
bottomRight: Ur,
|
|
568
|
+
box: Zr,
|
|
565
569
|
center: xe,
|
|
566
570
|
construct: y,
|
|
567
|
-
constructWithAlternateRoot:
|
|
568
|
-
contains:
|
|
571
|
+
constructWithAlternateRoot: sn,
|
|
572
|
+
contains: kr,
|
|
569
573
|
copy: pt,
|
|
570
|
-
css:
|
|
571
|
-
cssBox:
|
|
574
|
+
css: Xr,
|
|
575
|
+
cssBox: _r,
|
|
572
576
|
dim: Re,
|
|
573
577
|
dims: ht,
|
|
574
|
-
domRect:
|
|
575
|
-
edgePoints:
|
|
576
|
-
equals:
|
|
578
|
+
domRect: Pr,
|
|
579
|
+
edgePoints: Jr,
|
|
580
|
+
equals: Fr,
|
|
577
581
|
height: j,
|
|
578
|
-
intersection:
|
|
582
|
+
intersection: rn,
|
|
579
583
|
isBox: ft,
|
|
580
584
|
left: $,
|
|
581
585
|
loc: z,
|
|
582
|
-
positionInCenter:
|
|
583
|
-
reRoot:
|
|
584
|
-
resize:
|
|
586
|
+
positionInCenter: Qr,
|
|
587
|
+
reRoot: Kr,
|
|
588
|
+
resize: Yr,
|
|
585
589
|
right: B,
|
|
586
|
-
root:
|
|
587
|
-
signedDims:
|
|
590
|
+
root: Gr,
|
|
591
|
+
signedDims: Wr,
|
|
588
592
|
signedHeight: ue,
|
|
589
593
|
signedWidth: ie,
|
|
590
594
|
top: v,
|
|
591
595
|
topLeft: yt,
|
|
592
|
-
topRight:
|
|
593
|
-
translate:
|
|
594
|
-
truncate:
|
|
596
|
+
topRight: Vr,
|
|
597
|
+
translate: tn,
|
|
598
|
+
truncate: on,
|
|
595
599
|
width: M,
|
|
596
600
|
x: Le,
|
|
597
601
|
xBounds: K,
|
|
598
|
-
xyLoc:
|
|
602
|
+
xyLoc: W,
|
|
599
603
|
y: _e,
|
|
600
604
|
yBounds: J
|
|
601
|
-
}, Symbol.toStringTag, { value: "Module" })), dt = i.object({ signedWidth: i.number(), signedHeight: i.number() }),
|
|
605
|
+
}, Symbol.toStringTag, { value: "Module" })), dt = i.object({ signedWidth: i.number(), signedHeight: i.number() }), un = i.union([Oe, dt, H, te]), an = { width: 0, height: 0 }, ln = { width: 1, height: 1 }, g = (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 }, cn = (t, e) => {
|
|
602
606
|
if (e == null) return !1;
|
|
603
607
|
const r = g(t), n = g(e);
|
|
604
608
|
return r.width === n.width && r.height === n.height;
|
|
605
|
-
},
|
|
609
|
+
}, pn = (t) => {
|
|
606
610
|
const e = g(t);
|
|
607
611
|
return { width: e.height, height: e.width };
|
|
608
|
-
},
|
|
612
|
+
}, hn = (t) => {
|
|
609
613
|
const e = g(t);
|
|
610
614
|
return `0 0 ${e.width} ${e.height}`;
|
|
611
|
-
},
|
|
615
|
+
}, yn = (t) => {
|
|
612
616
|
const e = g(t);
|
|
613
617
|
return [e.width, e.height];
|
|
614
|
-
},
|
|
618
|
+
}, fn = (t) => ({
|
|
615
619
|
width: Math.max(...t.map((e) => g(e).width)),
|
|
616
620
|
height: Math.max(...t.map((e) => g(e).height))
|
|
617
|
-
}),
|
|
621
|
+
}), dn = (t) => ({
|
|
618
622
|
width: Math.min(...t.map((e) => g(e).width)),
|
|
619
623
|
height: Math.min(...t.map((e) => g(e).height))
|
|
620
|
-
}),
|
|
624
|
+
}), gn = (t, e) => {
|
|
621
625
|
const r = g(t);
|
|
622
626
|
return { width: r.width * e, height: r.height * e };
|
|
623
|
-
},
|
|
627
|
+
}, Un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
624
628
|
__proto__: null,
|
|
625
|
-
DECIMAL:
|
|
626
|
-
ZERO:
|
|
629
|
+
DECIMAL: ln,
|
|
630
|
+
ZERO: an,
|
|
627
631
|
construct: g,
|
|
628
|
-
couple:
|
|
629
|
-
crude:
|
|
632
|
+
couple: yn,
|
|
633
|
+
crude: un,
|
|
630
634
|
dimensions: Oe,
|
|
631
635
|
equals: cn,
|
|
632
|
-
max:
|
|
633
|
-
min:
|
|
634
|
-
scale:
|
|
636
|
+
max: fn,
|
|
637
|
+
min: dn,
|
|
638
|
+
scale: gn,
|
|
635
639
|
signed: dt,
|
|
636
|
-
svgViewBox:
|
|
637
|
-
swap:
|
|
640
|
+
svgViewBox: hn,
|
|
641
|
+
swap: pn
|
|
638
642
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
639
|
-
var
|
|
640
|
-
const
|
|
643
|
+
var bn = Object.defineProperty, xn = (t, e, r) => e in t ? bn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, w = (t, e, r) => xn(t, typeof e != "symbol" ? e + "" : e, r);
|
|
644
|
+
const mn = (t, e, r) => e !== void 0 && t < e ? e : r !== void 0 && t > r ? r : t, wn = i.object({ offset: ge, scale: ge }), $n = i.object({ offset: i.number(), scale: i.number() }), vn = (t) => (e, r, n, o) => r === "dimension" ? [e, n] : [
|
|
641
645
|
e,
|
|
642
646
|
o ? n - t : n + t
|
|
643
|
-
],
|
|
647
|
+
], On = (t) => (e, r, n, o) => [
|
|
644
648
|
e,
|
|
645
649
|
o ? n / t : n * t
|
|
646
|
-
],
|
|
650
|
+
], Mn = (t) => (e, r, n) => {
|
|
647
651
|
if (e === null) return [t, n];
|
|
648
|
-
const { lower: o, upper: s } = e, { lower: u, upper: a } = t,
|
|
649
|
-
if (r === "dimension") return [t, n * (
|
|
650
|
-
const h = (n - o) * (
|
|
652
|
+
const { lower: o, upper: s } = e, { lower: u, upper: a } = t, l = s - o, c = a - u;
|
|
653
|
+
if (r === "dimension") return [t, n * (c / l)];
|
|
654
|
+
const h = (n - o) * (c / l) + u;
|
|
651
655
|
return [t, h];
|
|
652
|
-
},
|
|
656
|
+
}, jn = (t) => (e, r, n) => [t, n], Tn = () => (t, e, r) => {
|
|
653
657
|
if (t === null) throw new Error("cannot invert without bounds");
|
|
654
658
|
if (e === "dimension") return [t, r];
|
|
655
659
|
const { lower: n, upper: o } = t;
|
|
656
660
|
return [t, o - (r - n)];
|
|
657
|
-
},
|
|
661
|
+
}, In = (t) => (e, r, n) => {
|
|
658
662
|
const { lower: o, upper: s } = t;
|
|
659
|
-
return n =
|
|
663
|
+
return n = mn(n, o, s), [e, n];
|
|
660
664
|
}, me = class P {
|
|
661
665
|
constructor() {
|
|
662
666
|
w(this, "ops", []), w(this, "currBounds", null), w(this, "currType", null), w(this, "reversed", !1), this.ops = [];
|
|
@@ -687,7 +691,7 @@ const xn = (t, e, r) => e !== void 0 && t < e ? e : r !== void 0 && t > r ? r :
|
|
|
687
691
|
* @param value - The amount to translate by.
|
|
688
692
|
*/
|
|
689
693
|
translate(e) {
|
|
690
|
-
const r = this.new(), n =
|
|
694
|
+
const r = this.new(), n = vn(e);
|
|
691
695
|
return n.type = "translate", r.ops.push(n), r;
|
|
692
696
|
}
|
|
693
697
|
/**
|
|
@@ -697,23 +701,23 @@ const xn = (t, e, r) => e !== void 0 && t < e ? e : r !== void 0 && t > r ? r :
|
|
|
697
701
|
* @param value - The amount to magnify by.
|
|
698
702
|
*/
|
|
699
703
|
magnify(e) {
|
|
700
|
-
const r = this.new(), n =
|
|
704
|
+
const r = this.new(), n = On(e);
|
|
701
705
|
return n.type = "magnify", r.ops.push(n), r;
|
|
702
706
|
}
|
|
703
707
|
scale(e, r) {
|
|
704
|
-
const n = p(e, r), o = this.new(), s =
|
|
708
|
+
const n = p(e, r), o = this.new(), s = Mn(n);
|
|
705
709
|
return s.type = "scale", o.ops.push(s), o;
|
|
706
710
|
}
|
|
707
711
|
clamp(e, r) {
|
|
708
|
-
const n = p(e, r), o = this.new(), s =
|
|
712
|
+
const n = p(e, r), o = this.new(), s = In(n);
|
|
709
713
|
return s.type = "clamp", o.ops.push(s), o;
|
|
710
714
|
}
|
|
711
715
|
reBound(e, r) {
|
|
712
|
-
const n = p(e, r), o = this.new(), s =
|
|
716
|
+
const n = p(e, r), o = this.new(), s = jn(n);
|
|
713
717
|
return s.type = "re-bound", o.ops.push(s), o;
|
|
714
718
|
}
|
|
715
719
|
invert() {
|
|
716
|
-
const e =
|
|
720
|
+
const e = Tn();
|
|
717
721
|
e.type = "invert";
|
|
718
722
|
const r = this.new();
|
|
719
723
|
return r.ops.push(e), r;
|
|
@@ -842,13 +846,13 @@ const $e = class m {
|
|
|
842
846
|
}
|
|
843
847
|
};
|
|
844
848
|
w($e, "IDENTITY", new $e());
|
|
845
|
-
let
|
|
846
|
-
const
|
|
849
|
+
let En = $e;
|
|
850
|
+
const Gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
847
851
|
__proto__: null,
|
|
848
852
|
Scale: we,
|
|
849
|
-
XY:
|
|
850
|
-
crudeXYTransform:
|
|
851
|
-
transform:
|
|
853
|
+
XY: En,
|
|
854
|
+
crudeXYTransform: wn,
|
|
855
|
+
transform: $n
|
|
852
856
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
853
857
|
function gt(t) {
|
|
854
858
|
var e, r, n = "";
|
|
@@ -859,14 +863,14 @@ function gt(t) {
|
|
|
859
863
|
} else for (r in t) t[r] && (n && (n += " "), n += r);
|
|
860
864
|
return n;
|
|
861
865
|
}
|
|
862
|
-
function
|
|
866
|
+
function Sn() {
|
|
863
867
|
for (var t, e, r = 0, n = "", o = arguments.length; r < o; r++) (t = arguments[r]) && (e = gt(t)) && (n && (n += " "), n += e);
|
|
864
868
|
return n;
|
|
865
869
|
}
|
|
866
|
-
const
|
|
867
|
-
const e = (...r) =>
|
|
868
|
-
return e.B = (r) => t + He + r, e.E = (r) => t +
|
|
869
|
-
},
|
|
870
|
+
const Bn = Sn, He = "-", Ye = "__", D = "--", bt = (t) => {
|
|
871
|
+
const e = (...r) => Bn(...r);
|
|
872
|
+
return e.B = (r) => t + He + r, e.E = (r) => t + Ye + r, e.M = (r) => t + D + r, e.BM = (r, n) => e.B(r) + D + n, e.BE = (r, n) => e.B(r) + Ye + n, e.BEM = (r, n, o) => e.BE(r, n) + D + o, e.extend = (r) => bt(e.B(r)), e.var = (r) => D + t + He + r, e;
|
|
873
|
+
}, Nn = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, ve = i.string().regex(Nn), A = i.number().min(0).max(255), zn = i.number().min(0).max(1), Pe = i.tuple([A, A, A, zn]), xt = i.tuple([A, A, A]), mt = i.object({ rgba255: Pe }), Kn = (t) => t == null ? void 0 : new d(t).hex, Jn = (t) => {
|
|
870
874
|
if (t == null) return;
|
|
871
875
|
const e = d.z.safeParse(t);
|
|
872
876
|
if (e.success) return e.data.rgbaCSS;
|
|
@@ -916,7 +920,7 @@ const Sn = En, He = "-", We = "__", D = "--", bt = (t) => {
|
|
|
916
920
|
*/
|
|
917
921
|
get hex() {
|
|
918
922
|
const [e, r, n, o] = this.rgba255;
|
|
919
|
-
return `#${
|
|
923
|
+
return `#${V(e)}${V(r)}${V(n)}${o === 1 ? "" : V(o * 255)}`;
|
|
920
924
|
}
|
|
921
925
|
/**
|
|
922
926
|
* @returns the color as a CSS RGBA string.
|
|
@@ -970,7 +974,7 @@ const Sn = En, He = "-", We = "__", D = "--", bt = (t) => {
|
|
|
970
974
|
return this.equals(wt);
|
|
971
975
|
}
|
|
972
976
|
get hsla() {
|
|
973
|
-
return
|
|
977
|
+
return An(this.rgba255);
|
|
974
978
|
}
|
|
975
979
|
/**
|
|
976
980
|
* Creates a new color with the given alpha.
|
|
@@ -1019,17 +1023,17 @@ const Sn = En, He = "-", We = "__", D = "--", bt = (t) => {
|
|
|
1019
1023
|
}
|
|
1020
1024
|
static fromHex(e, r = 1) {
|
|
1021
1025
|
if (!ve.safeParse(e).success) throw new Error(`Invalid hex color: ${e}`);
|
|
1022
|
-
return e =
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
e.length === 8 ?
|
|
1026
|
+
return e = Cn(e), [
|
|
1027
|
+
q(e, 0),
|
|
1028
|
+
q(e, 2),
|
|
1029
|
+
q(e, 4),
|
|
1030
|
+
e.length === 8 ? q(e, 6) / 255 : r
|
|
1027
1031
|
];
|
|
1028
1032
|
}
|
|
1029
1033
|
};
|
|
1030
1034
|
C(b, "z", i.union([ve, Pe, xt, i.instanceof(b), mt]).transform((e) => new b(e)));
|
|
1031
1035
|
let d = b;
|
|
1032
|
-
const wt = new d([0, 0, 0, 0]),
|
|
1036
|
+
const wt = new d([0, 0, 0, 0]), V = (t) => Math.floor(t).toString(16).padStart(2, "0"), q = (t, e) => parseInt(t.slice(e, e + 2), 16), Cn = (t) => t.startsWith("#") ? t.slice(1) : t, Qn = (t) => {
|
|
1033
1037
|
let [e, r, n] = t;
|
|
1034
1038
|
const o = t[3];
|
|
1035
1039
|
e /= 360, r /= 100, n /= 100;
|
|
@@ -1037,36 +1041,36 @@ const wt = new d([0, 0, 0, 0]), q = (t) => Math.floor(t).toString(16).padStart(2
|
|
|
1037
1041
|
if (r === 0)
|
|
1038
1042
|
s = u = a = n;
|
|
1039
1043
|
else {
|
|
1040
|
-
const
|
|
1041
|
-
s =
|
|
1044
|
+
const l = n < 0.5 ? n * (1 + r) : n + r - n * r, c = 2 * n - l;
|
|
1045
|
+
s = le(c, l, e + 1 / 3), u = le(c, l, e), a = le(c, l, e - 1 / 3);
|
|
1042
1046
|
}
|
|
1043
1047
|
return [Math.round(s * 255), Math.round(u * 255), Math.round(a * 255), o];
|
|
1044
|
-
},
|
|
1048
|
+
}, le = (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), An = (t) => {
|
|
1045
1049
|
let [e, r, n] = t;
|
|
1046
1050
|
const o = t[3];
|
|
1047
1051
|
e /= 255, r /= 255, n /= 255, e /= 255, r /= 255, n /= 255;
|
|
1048
1052
|
const s = Math.max(e, r, n), u = Math.min(e, r, n);
|
|
1049
|
-
let a,
|
|
1053
|
+
let a, l, c = (s + u) / 2;
|
|
1050
1054
|
if (s === u)
|
|
1051
|
-
a =
|
|
1055
|
+
a = l = 0;
|
|
1052
1056
|
else {
|
|
1053
1057
|
const h = s - u;
|
|
1054
|
-
|
|
1058
|
+
l = c > 0.5 ? h / (2 - s - u) : h / (s + u), s === e ? a = (r - n) / h + (r < n ? 6 : 0) : s === r ? a = (n - e) / h + 2 : a = (e - r) / h + 4, a /= 6;
|
|
1055
1059
|
}
|
|
1056
|
-
return a *= 360,
|
|
1057
|
-
},
|
|
1060
|
+
return a *= 360, l *= 100, c *= 100, [Math.round(a), Math.round(l), Math.round(c), o];
|
|
1061
|
+
}, Rn = i.union([
|
|
1058
1062
|
ve,
|
|
1059
1063
|
Pe,
|
|
1060
1064
|
i.instanceof(d),
|
|
1061
1065
|
i.string(),
|
|
1062
1066
|
xt,
|
|
1063
1067
|
mt
|
|
1064
|
-
]),
|
|
1068
|
+
]), Ln = i.object({
|
|
1065
1069
|
key: i.string(),
|
|
1066
|
-
color:
|
|
1070
|
+
color: Rn,
|
|
1067
1071
|
position: i.number(),
|
|
1068
1072
|
switched: i.boolean().optional()
|
|
1069
|
-
}),
|
|
1073
|
+
}), eo = i.array(Ln), to = (t, e) => {
|
|
1070
1074
|
if (t.length === 0) return wt;
|
|
1071
1075
|
if (t = t.slice().sort((r, n) => r.position - n.position), e <= t[0].position) return new d(t[0].color);
|
|
1072
1076
|
if (e >= t[t.length - 1].position)
|
|
@@ -1076,21 +1080,21 @@ const wt = new d([0, 0, 0, 0]), q = (t) => Math.floor(t).toString(16).padStart(2
|
|
|
1076
1080
|
if (e >= n.position && e <= o.position) {
|
|
1077
1081
|
if (e === n.position) return new d(n.color);
|
|
1078
1082
|
if (e === o.position) return new d(o.color);
|
|
1079
|
-
const s = (e - n.position) / (o.position - n.position), u = new d(n.color), a = new d(o.color),
|
|
1080
|
-
return new d([
|
|
1083
|
+
const s = (e - n.position) / (o.position - n.position), u = new d(n.color), a = new d(o.color), l = Math.round(u.r + s * (a.r - u.r)), c = Math.round(u.g + s * (a.g - u.g)), h = Math.round(u.b + s * (a.b - u.b)), E = u.a + s * (a.a - u.a);
|
|
1084
|
+
return new d([l, c, h, E]);
|
|
1081
1085
|
}
|
|
1082
1086
|
}
|
|
1083
1087
|
return new d(t[t.length - 1].color);
|
|
1084
|
-
},
|
|
1088
|
+
}, _n = i.object({
|
|
1085
1089
|
key: i.string(),
|
|
1086
1090
|
name: i.string(),
|
|
1087
1091
|
color: d.z
|
|
1088
|
-
}),
|
|
1092
|
+
}), ro = i.object({
|
|
1089
1093
|
key: i.string(),
|
|
1090
1094
|
name: i.string(),
|
|
1091
|
-
swatches: i.array(
|
|
1095
|
+
swatches: i.array(_n)
|
|
1092
1096
|
});
|
|
1093
|
-
class
|
|
1097
|
+
class Pn {
|
|
1094
1098
|
constructor(e = "") {
|
|
1095
1099
|
C(this, "rows", []);
|
|
1096
1100
|
C(this, "columns", []);
|
|
@@ -1119,60 +1123,63 @@ class _n {
|
|
|
1119
1123
|
};
|
|
1120
1124
|
}
|
|
1121
1125
|
}
|
|
1122
|
-
const
|
|
1126
|
+
const Zn = (t, e) => Object.entries(e).forEach(
|
|
1123
1127
|
([r, n]) => n != null && t.style.setProperty(r, `${n}`)
|
|
1124
|
-
),
|
|
1128
|
+
), Hn = (t, e) => Array.from(t.style).forEach((r) => {
|
|
1125
1129
|
r.startsWith(e) && t.style.removeProperty(r);
|
|
1126
|
-
}),
|
|
1130
|
+
}), Yn = (t) => {
|
|
1127
1131
|
const e = bt(t);
|
|
1128
|
-
return e.visible = (r) => e.M(r ? "visible" : "hidden"), e.expanded = (r) => e.M(r ? "expanded" : "collapsed"), e.loc = (r) => e.M(ot.construct(r)), e.disabled = (r) => r === !0 && e.M("disabled"), e.align = (r) => e.M(r), e.dir = (r) => r != null && e.M(
|
|
1129
|
-
|
|
1132
|
+
return e.visible = (r) => e.M(r ? "visible" : "hidden"), e.expanded = (r) => e.M(r ? "expanded" : "collapsed"), e.loc = (r) => e.M(ot.construct(r)), e.disabled = (r) => r === !0 && e.M("disabled"), e.align = (r) => e.M(r), e.dir = (r) => r != null && e.M(ur.construct(r)), e.size = (r) => typeof r == "string" && e.M(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}`) : 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.noWrap = (r) => r && e.M("no-wrap"), e.applyVars = Zn, e.removeVars = Hn, e.newGridBuilder = (r) => new Pn(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) => e.M(`shade-${r}`), e.shadeVar = (r) => {
|
|
1133
|
+
if (r != null)
|
|
1134
|
+
return `var(--${t}-gray-l${r})`;
|
|
1135
|
+
}, e.levelSizeVar = (r) => `var(--${t}-${r}-size)`, e;
|
|
1136
|
+
}, no = Yn("pluto");
|
|
1130
1137
|
export {
|
|
1131
|
-
|
|
1132
|
-
|
|
1138
|
+
$r as $,
|
|
1139
|
+
j as A,
|
|
1133
1140
|
Ce as B,
|
|
1134
|
-
|
|
1135
|
-
|
|
1141
|
+
no as C,
|
|
1142
|
+
vr as D,
|
|
1136
1143
|
qn as E,
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1144
|
+
M as F,
|
|
1145
|
+
Vn as G,
|
|
1146
|
+
Xn as H,
|
|
1147
|
+
nn as I,
|
|
1141
1148
|
rn as J,
|
|
1142
1149
|
ot as K,
|
|
1143
|
-
|
|
1150
|
+
Sn as L,
|
|
1144
1151
|
_t as M,
|
|
1145
|
-
|
|
1146
|
-
|
|
1152
|
+
xr as P,
|
|
1153
|
+
Wt as T,
|
|
1147
1154
|
er as U,
|
|
1148
|
-
|
|
1149
|
-
|
|
1155
|
+
tr as V,
|
|
1156
|
+
mn as Y,
|
|
1150
1157
|
wt as Z,
|
|
1151
|
-
|
|
1158
|
+
Un as _,
|
|
1152
1159
|
d as a,
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
+
Jn as b,
|
|
1161
|
+
Rn as c,
|
|
1162
|
+
Qn as d,
|
|
1163
|
+
ur as e,
|
|
1164
|
+
to as f,
|
|
1165
|
+
eo as g,
|
|
1166
|
+
pr as h,
|
|
1160
1167
|
p as i,
|
|
1161
1168
|
S as j,
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1169
|
+
lr as k,
|
|
1170
|
+
Gn as l,
|
|
1171
|
+
Wn as m,
|
|
1165
1172
|
bt as n,
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1173
|
+
Dn as o,
|
|
1174
|
+
ro as p,
|
|
1175
|
+
Se as q,
|
|
1176
|
+
I as r,
|
|
1177
|
+
Ln as s,
|
|
1178
|
+
Kn as t,
|
|
1179
|
+
y as u,
|
|
1180
|
+
W as v,
|
|
1181
|
+
wr as w,
|
|
1175
1182
|
ze as x,
|
|
1176
|
-
y,
|
|
1183
|
+
sn as y,
|
|
1177
1184
|
F as z
|
|
1178
1185
|
};
|