@synnaxlabs/pluto 0.32.0 → 0.33.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.
Files changed (183) hide show
  1. package/dist/{Animated-C_WGrQwR.cjs → Animated-BGm8tACN.cjs} +1 -1
  2. package/dist/{Animated-NyYe8Svx.js → Animated-Cg0ftviS.js} +2 -2
  3. package/dist/{Item-CcXMlZIY.js → Item-B8JWj3fN.js} +5 -5
  4. package/dist/{Item-DGKnKb6c.cjs → Item-C89uBEra.cjs} +1 -1
  5. package/dist/{Keyboard-87LPq07J.cjs → Keyboard-B1757gtH.cjs} +1 -1
  6. package/dist/{Keyboard-i5fqTDMP.js → Keyboard-BAU1UuVp.js} +2 -2
  7. package/dist/{LinePlot-CCzgiKg5.js → LinePlot-CgkhTRJT.js} +3531 -3360
  8. package/dist/LinePlot-oIHuM9Jz.cjs +66 -0
  9. package/dist/Link-BGZki0c9.cjs +1 -0
  10. package/dist/Link-Du1lxpym.js +14 -0
  11. package/dist/{List-BjRQA8wb.js → List-KmtaD0qw.js} +2 -2
  12. package/dist/{List-B3WCj8GQ.cjs → List-e1hOSGSX.cjs} +1 -1
  13. package/dist/{Pack-BrxYNh7B.js → Pack-CxtceW7N.js} +1 -1
  14. package/dist/{Pack-C_SrDA3a.cjs → Pack-uflj5a28.cjs} +1 -1
  15. package/dist/{Text-MNWCdS6X.js → Text-D1VocrR6.js} +5 -5
  16. package/dist/{Text-XcCNQVZj.cjs → Text-DWBEhfiF.cjs} +1 -1
  17. package/dist/{Toggle-C1k6Tnpo.js → Toggle-B96EPQ2x.js} +14463 -14342
  18. package/dist/Toggle-C5E2dVg4.cjs +143 -0
  19. package/dist/{Video-DR3tjTFZ.cjs → Video-DKosAU7v.cjs} +1 -1
  20. package/dist/{Video-DdIv_1Yq.js → Video-o34bcpwh.js} +1 -1
  21. package/dist/{aggregator-f5OfPmNc.js → aggregator-B36SA-20.js} +5061 -4512
  22. package/dist/aggregator-CU9VgdUJ.cjs +67 -0
  23. package/dist/align.cjs +1 -1
  24. package/dist/align.js +1 -1
  25. package/dist/button.cjs +1 -1
  26. package/dist/button.js +1 -1
  27. package/dist/color.cjs +1 -1
  28. package/dist/color.js +1 -1
  29. package/dist/css-4MXuPP5v.cjs +1 -0
  30. package/dist/css-C8qHWSpT.js +1085 -0
  31. package/dist/css.cjs +1 -1
  32. package/dist/css.js +2 -2
  33. package/dist/dropdown.cjs +1 -1
  34. package/dist/dropdown.js +1 -1
  35. package/dist/ether.cjs +1 -1
  36. package/dist/ether.js +53 -51
  37. package/dist/{external-DLa89w3J.cjs → external-BHkFTefx.cjs} +1 -1
  38. package/dist/{external-CSyZPKK4.cjs → external-BRdQZoOL.cjs} +1 -1
  39. package/dist/external-BSHY-kgQ.cjs +1 -0
  40. package/dist/{external-CIvyZ-Hc.js → external-BSqwgq7l.js} +2 -2
  41. package/dist/external-BdZ8kC55.cjs +1 -0
  42. package/dist/{external-CDGv7k3p.js → external-BpIfVU6K.js} +12 -12
  43. package/dist/{external-DAQPXD3z.cjs → external-C-PNFpoV.cjs} +1 -1
  44. package/dist/{external-DmJZ_zIB.js → external-C2PoeTKJ.js} +2 -2
  45. package/dist/{external-Cl_evqYY.cjs → external-CPTY4-IY.cjs} +1 -1
  46. package/dist/{external-n_t7VfzS.js → external-Cc1Bqjmm.js} +1 -1
  47. package/dist/{external-FeE2ijEU.js → external-Ckdd7teZ.js} +14 -14
  48. package/dist/{external-BryXmBqR.js → external-CvTy-Tj3.js} +4 -4
  49. package/dist/external-CxatFj2t.js +1191 -0
  50. package/dist/{external-DfIxCAg2.js → external-CzrKYxlg.js} +2 -2
  51. package/dist/{external-DE4i3A2z.cjs → external-DDwIRENP.cjs} +1 -1
  52. package/dist/{external-BI9DOL9G.js → external-DWm3_4ZA.js} +28 -28
  53. package/dist/{external-CNrnZ1L5.js → external-DZhjjzue.js} +73 -73
  54. package/dist/{external-CmbBTupJ.js → external-Dk66psus.js} +20 -20
  55. package/dist/{external-i13duWIn.cjs → external-GtPAaR7c.cjs} +1 -1
  56. package/dist/external-Icf6LMl2.cjs +1 -0
  57. package/dist/{external-C2Ri5xWS.cjs → external-LyF1vgNR.cjs} +1 -1
  58. package/dist/{external-BUjAebk2.cjs → external-T318T5Xe.cjs} +1 -1
  59. package/dist/{external-CbjdO9a0.js → external-uvD747pL.js} +31 -31
  60. package/dist/{external-DjE3je-g.cjs → external-w5-jxIYn.cjs} +1 -1
  61. package/dist/header.cjs +1 -1
  62. package/dist/header.js +1 -1
  63. package/dist/index.cjs +1 -1
  64. package/dist/index.js +2261 -2166
  65. package/dist/input.cjs +1 -1
  66. package/dist/input.js +1 -1
  67. package/dist/list.cjs +1 -1
  68. package/dist/list.js +1 -1
  69. package/dist/menu.cjs +1 -1
  70. package/dist/menu.js +1 -1
  71. package/dist/src/aether/main.d.ts +1 -0
  72. package/dist/src/aether/main.d.ts.map +1 -1
  73. package/dist/src/button/Button.d.ts +8 -2
  74. package/dist/src/button/Button.d.ts.map +1 -1
  75. package/dist/src/button/Link.d.ts +2 -1
  76. package/dist/src/button/Link.d.ts.map +1 -1
  77. package/dist/src/button/Toggle.d.ts +1 -1
  78. package/dist/src/dropdown/Dropdown.d.ts.map +1 -1
  79. package/dist/src/form/Form.d.ts +2 -2
  80. package/dist/src/form/Form.d.ts.map +1 -1
  81. package/dist/src/index.d.ts +3 -1
  82. package/dist/src/index.d.ts.map +1 -1
  83. package/dist/src/input/Numeric.d.ts.map +1 -1
  84. package/dist/src/input/types.d.ts +1 -1
  85. package/dist/src/input/types.d.ts.map +1 -1
  86. package/dist/src/memo/proxyMemo.d.ts +1 -1
  87. package/dist/src/memo/proxyMemo.d.ts.map +1 -1
  88. package/dist/src/modal/Modal.d.ts.map +1 -1
  89. package/dist/src/override/factory.d.ts +3 -0
  90. package/dist/src/override/factory.d.ts.map +1 -0
  91. package/dist/src/override/index.d.ts +2 -0
  92. package/dist/src/override/index.d.ts.map +1 -0
  93. package/dist/src/pluto/aether/pluto.d.ts.map +1 -1
  94. package/dist/src/select/Button.d.ts +1 -1
  95. package/dist/src/select/Button.d.ts.map +1 -1
  96. package/dist/src/select/Multiple.d.ts.map +1 -1
  97. package/dist/src/select/Single.d.ts.map +1 -1
  98. package/dist/src/status/Aggregator.d.ts +2 -6
  99. package/dist/src/status/Aggregator.d.ts.map +1 -1
  100. package/dist/src/status/Circle.d.ts.map +1 -1
  101. package/dist/src/status/aether/aggregator.d.ts.map +1 -1
  102. package/dist/src/status/aether/types.d.ts.map +1 -1
  103. package/dist/src/tabs/Tabs.d.ts +8 -8
  104. package/dist/src/tabs/Tabs.d.ts.map +1 -1
  105. package/dist/src/telem/aether/convertSeries.d.ts +2 -2
  106. package/dist/src/telem/aether/convertSeries.d.ts.map +1 -1
  107. package/dist/src/telem/aether/noop.d.ts +2 -1
  108. package/dist/src/telem/aether/noop.d.ts.map +1 -1
  109. package/dist/src/telem/aether/remote.d.ts.map +1 -1
  110. package/dist/src/telem/aether/static.d.ts +2 -2
  111. package/dist/src/telem/client/cache/cache.d.ts +1 -1
  112. package/dist/src/telem/client/cache/cache.d.ts.map +1 -1
  113. package/dist/src/telem/client/cache/dynamic.d.ts +3 -3
  114. package/dist/src/telem/client/cache/dynamic.d.ts.map +1 -1
  115. package/dist/src/telem/client/cache/static.d.ts +1 -1
  116. package/dist/src/telem/client/cache/static.d.ts.map +1 -1
  117. package/dist/src/telem/control/aether/chip.d.ts.map +1 -1
  118. package/dist/src/telem/control/aether/indicator.d.ts.map +1 -1
  119. package/dist/src/theming/Provider.d.ts.map +1 -1
  120. package/dist/src/theming/aether/provider.d.ts +5846 -3
  121. package/dist/src/theming/aether/provider.d.ts.map +1 -1
  122. package/dist/src/theming/core/fontString.d.ts +1 -1
  123. package/dist/src/theming/core/fontString.d.ts.map +1 -1
  124. package/dist/src/theming/core/theme.d.ts +9 -0
  125. package/dist/src/theming/core/theme.d.ts.map +1 -1
  126. package/dist/src/theming/css.d.ts.map +1 -1
  127. package/dist/src/triggers/hooks.d.ts +2 -1
  128. package/dist/src/triggers/hooks.d.ts.map +1 -1
  129. package/dist/src/vis/canvas/aether/canvas.d.ts.map +1 -1
  130. package/dist/src/vis/diagram/aether/Diagram.d.ts +0 -1
  131. package/dist/src/vis/diagram/aether/Diagram.d.ts.map +1 -1
  132. package/dist/src/vis/draw2d/index.d.ts +2 -1
  133. package/dist/src/vis/draw2d/index.d.ts.map +1 -1
  134. package/dist/src/vis/eraser/aether/eraser.d.ts.map +1 -1
  135. package/dist/src/vis/line/aether/line.d.ts +3 -1
  136. package/dist/src/vis/line/aether/line.d.ts.map +1 -1
  137. package/dist/src/vis/lineplot/aether/LinePlot.d.ts.map +1 -1
  138. package/dist/src/vis/lineplot/aether/axis.d.ts.map +1 -1
  139. package/dist/src/vis/lineplot/range/aether/annotation.d.ts.map +1 -1
  140. package/dist/src/vis/log/Log.d.ts +12 -0
  141. package/dist/src/vis/log/Log.d.ts.map +1 -0
  142. package/dist/src/vis/log/aether/Log.d.ts +556 -0
  143. package/dist/src/vis/log/aether/Log.d.ts.map +1 -0
  144. package/dist/src/vis/log/aether/index.d.ts +2 -0
  145. package/dist/src/vis/log/aether/index.d.ts.map +1 -0
  146. package/dist/src/vis/log/index.d.ts +2 -0
  147. package/dist/src/vis/log/index.d.ts.map +1 -0
  148. package/dist/src/vis/render/context.d.ts +3 -1
  149. package/dist/src/vis/render/context.d.ts.map +1 -1
  150. package/dist/src/vis/schematic/Forms.d.ts.map +1 -1
  151. package/dist/src/vis/schematic/primitives/Primitives.d.ts +2 -2
  152. package/dist/src/vis/schematic/primitives/Primitives.d.ts.map +1 -1
  153. package/dist/src/vis/schematic/registry.d.ts.map +1 -1
  154. package/dist/src/vis/value/aether/value.d.ts +1 -0
  155. package/dist/src/vis/value/aether/value.d.ts.map +1 -1
  156. package/dist/src/vis/value/use.d.ts.map +1 -1
  157. package/dist/style.css +1 -1
  158. package/dist/tabs.cjs +1 -1
  159. package/dist/tabs.js +1 -1
  160. package/dist/text.cjs +1 -1
  161. package/dist/text.js +2 -2
  162. package/dist/theming.cjs +1 -1
  163. package/dist/theming.js +2 -2
  164. package/dist/tree.cjs +1 -1
  165. package/dist/tree.js +1 -1
  166. package/dist/triggers.cjs +1 -1
  167. package/dist/triggers.js +1 -1
  168. package/dist/{units-CnA_yWxx.js → units-CmWU_YzJ.js} +1 -1
  169. package/dist/{units-CMXTKjnN.cjs → units-DbfWaeE2.cjs} +1 -1
  170. package/dist/video.cjs +1 -1
  171. package/dist/video.js +1 -1
  172. package/package.json +20 -22
  173. package/dist/LinePlot-BcVyfdeK.cjs +0 -66
  174. package/dist/Link-B83uKMKM.cjs +0 -1
  175. package/dist/Link-DlC5z0Wm.js +0 -10
  176. package/dist/Toggle-CIXrEiVA.cjs +0 -143
  177. package/dist/aggregator-q0CY7-QS.cjs +0 -67
  178. package/dist/css-B8RwzK24.js +0 -1042
  179. package/dist/css-LxkguM_s.cjs +0 -1
  180. package/dist/external-CDChKvhl.cjs +0 -1
  181. package/dist/external-CN-OhewX.cjs +0 -1
  182. package/dist/external-cIvhYaqB.cjs +0 -1
  183. package/dist/external-kSaQF2Vi.js +0 -1169
@@ -1,1042 +0,0 @@
1
- var lt = Object.defineProperty;
2
- var pt = (t, e, r) => e in t ? lt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
- var z = (t, e, r) => pt(t, typeof e != "symbol" ? e + "" : e, r);
4
- import { z as i } from "zod";
5
- const G = i.tuple([i.number(), i.number()]);
6
- i.tuple([i.bigint(), i.bigint()]);
7
- const ge = i.object({ width: i.number(), height: i.number() }), ht = i.object({
8
- signedWidth: i.number(),
9
- signedHeight: i.number()
10
- }), yt = ["width", "height"];
11
- i.enum(yt);
12
- const dt = ["start", "center", "end"], gt = ["signedWidth", "signedHeight"];
13
- i.enum(gt);
14
- const R = i.object({ x: i.number(), y: i.number() }), Ce = i.object({ clientX: i.number(), clientY: i.number() }), be = ["x", "y"], xe = i.enum(be), Re = ["top", "right", "bottom", "left"], bt = i.enum(Re), J = ["left", "right"], fe = i.enum(J), K = ["top", "bottom"], me = i.enum(K), we = ["center"], Ae = i.enum(we), xt = [...Re, ...we], $e = i.enum(xt);
15
- i.enum(dt);
16
- const ft = ["first", "last"];
17
- i.enum(ft);
18
- const _e = i.object({ lower: i.number(), upper: i.number() }), mt = i.object({ lower: i.bigint(), upper: i.bigint() });
19
- i.union([_e, G]);
20
- i.union([mt, G]);
21
- const wt = i.union([xe, $e]), $t = i.union([xe, $e, i.instanceof(String)]), ve = (t, e) => typeof t == "bigint" ? t - BigInt(e) : t - Number(e), Le = (t, e) => typeof t == "bigint" ? t + BigInt(e) : t + Number(e), vt = (t, e, r = 1e-4) => Math.abs(t - e) < r, Mt = (t) => {
22
- const e = Math.pow(10, Math.floor(Math.log10(t)));
23
- return Math.round(t / e) * e;
24
- }, Tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
25
- __proto__: null,
26
- add: Le,
27
- closeTo: vt,
28
- roundToNearestMagnitude: Mt,
29
- sub: ve
30
- }, Symbol.toStringTag, { value: "Module" })), c = (t, e) => {
31
- const r = {};
32
- if (typeof t == "number" || typeof t == "bigint")
33
- e != null ? (r.lower = t, r.upper = e) : (r.lower = typeof t == "bigint" ? 0n : 0, r.upper = t);
34
- else if (Array.isArray(t)) {
35
- if (t.length !== 2) throw new Error("bounds: expected array of length 2");
36
- [r.lower, r.upper] = t;
37
- } else return oe(t);
38
- return oe(r);
39
- }, Ot = Object.freeze({ lower: 0, upper: 0 }), Tt = Object.freeze({ lower: -1 / 0, upper: 1 / 0 }), jt = Object.freeze({ lower: 0, upper: 1 }), St = Object.freeze({ lower: -1, upper: 1 }), Et = (t, e) => {
40
- if (t == null && e == null) return !0;
41
- if (t == null || e == null) return !1;
42
- const r = c(t), n = c(e);
43
- 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);
44
- }, oe = (t) => t.lower > t.upper ? { lower: t.upper, upper: t.lower } : t, It = (t, e) => {
45
- const r = c(t);
46
- return e < r.lower ? r.lower : e >= r.upper ? r.upper - (typeof r.upper == "number" ? 1 : 1n) : e;
47
- }, S = (t, e) => {
48
- const r = c(t);
49
- if (typeof e == "number" || typeof e == "bigint")
50
- return e >= r.lower && e < r.upper;
51
- const n = c(e);
52
- return n.lower >= r.lower && n.upper <= r.upper;
53
- }, Bt = (t, e) => {
54
- const r = c(t), n = c(e);
55
- return r.lower === n.lower ? !0 : n.upper === r.lower || n.lower === r.upper ? !1 : S(r, n.upper) || S(r, n.lower) || S(n, r.upper) || S(n, r.lower);
56
- }, w = (t) => {
57
- const e = c(t);
58
- return e.upper - e.lower;
59
- }, At = (t) => {
60
- const e = c(t);
61
- return typeof e.lower == "bigint" ? e.lower === 0n && e.upper === 0n : e.lower === 0 && e.upper === 0;
62
- }, zt = (t) => {
63
- const e = w(t);
64
- return typeof e == "number" ? e === 0 : e === 0n;
65
- }, Nt = (t) => {
66
- const e = c(t);
67
- return typeof e.lower == "bigint" ? !0 : Number.isFinite(e.lower) && Number.isFinite(e.upper);
68
- }, Ct = (t) => ({
69
- lower: Math.min(...t.map((e) => c(e).lower)),
70
- upper: Math.max(...t.map((e) => c(e).upper))
71
- }), Rt = (t) => ({
72
- lower: Math.max(...t.map((e) => c(e).lower)),
73
- upper: Math.min(...t.map((e) => c(e).upper))
74
- }), _t = (t) => {
75
- const e = c(t), r = typeof e.lower == "bigint";
76
- return Array.from({ length: Number(w(t)) }, (n, o) => r ? e.lower + BigInt(o) : e.lower + o);
77
- }, se = (t, e) => {
78
- const r = t.map((s) => c(s)), n = r.findIndex(
79
- (s, u) => S(s, e) || e < r[u].lower
80
- );
81
- if (n === -1) return { index: t.length, position: 0 };
82
- const o = r[n];
83
- return S(o, e) ? { index: n, position: Number(e - o.lower) } : { index: n, position: 0 };
84
- }, re = {
85
- removeBefore: 0,
86
- removeAfter: 0,
87
- insertInto: 0,
88
- deleteInBetween: 0
89
- }, Pe = (t, e) => {
90
- const r = t.map((h) => c(h)), n = c(e);
91
- if (r.length === 0) return re;
92
- const o = se(r, n.lower), s = se(r, n.upper);
93
- if (o.index === t.length) return { ...re, insertInto: t.length };
94
- if (s.index === 0) return { ...re, removeAfter: s.position };
95
- if (o.index === s.index)
96
- return o.position !== 0 && s.position !== 0 ? null : {
97
- removeAfter: s.position,
98
- removeBefore: o.position,
99
- insertInto: o.index,
100
- deleteInBetween: 0
101
- };
102
- let u = s.index - o.index, a = o.index, y = ve(Number(w(r[o.index])), o.position);
103
- return o.position !== 0 ? (u -= 1, a += 1) : y = 0, {
104
- removeBefore: y,
105
- removeAfter: s.position,
106
- insertInto: a,
107
- deleteInBetween: u
108
- };
109
- }, Lt = (t, e) => {
110
- const r = Pe(t, e), n = t.map((s) => c(s));
111
- if (r == null) return n;
112
- const o = c(e);
113
- return o.lower = Le(o.lower, r.removeBefore), o.upper = ve(o.upper, r.removeAfter), n.splice(r.insertInto, r.deleteInBetween, o), n;
114
- }, Pt = (t, e) => {
115
- const r = c(t), n = c(e);
116
- return r.upper <= n.lower || r.lower >= n.upper ? 0 : r.lower >= n.lower && r.upper <= n.upper ? 1 : r.lower <= n.lower && r.upper >= n.upper ? w(n) / w(r) : r.lower <= n.lower ? (r.upper - n.lower) / w(r) : (n.upper - r.lower) / w(r);
117
- }, jn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
118
- __proto__: null,
119
- CLIP: St,
120
- DECIMAL: jt,
121
- INFINITE: Tt,
122
- ZERO: Ot,
123
- bounds: _e,
124
- buildInsertionPlan: Pe,
125
- clamp: It,
126
- construct: c,
127
- contains: S,
128
- equals: Et,
129
- exposure: Pt,
130
- findInsertPosition: se,
131
- insert: Lt,
132
- isFinite: Nt,
133
- isZero: At,
134
- linspace: _t,
135
- makeValid: oe,
136
- max: Ct,
137
- min: Rt,
138
- overlapsWith: Bt,
139
- span: w,
140
- spanIsZero: zt
141
- }, Symbol.toStringTag, { value: "Module" })), Ze = wt, j = (t) => be.includes(t) ? t : K.includes(t) ? "y" : "x", Zt = (t) => j(t) === "x" ? "y" : "x", Ht = (t) => j(t) === "x" ? "width" : "height", Yt = (t) => j(t) === "x" ? "left" : "top", Ft = (t) => Ze.safeParse(t).success, Wt = (t) => j(t) === "x" ? "signedWidth" : "signedHeight", Xt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
142
- __proto__: null,
143
- construct: j,
144
- crude: Ze,
145
- dimension: Ht,
146
- direction: xe,
147
- isDirection: Ft,
148
- location: Yt,
149
- signedDimension: Wt,
150
- swap: Zt
151
- }, Symbol.toStringTag, { value: "Module" })), kt = (t) => {
152
- const e = t.replace(/_[a-z]/g, (r) => r[1].toUpperCase());
153
- return e.length > 1 && e[0] === e[0].toUpperCase() && e[1] === e[1].toUpperCase() ? e : e[0].toLowerCase() + e.slice(1);
154
- }, He = (t) => {
155
- const e = (r, n = V) => {
156
- if (typeof r == "string") return t(r);
157
- if (Array.isArray(r)) return r.map((u) => e(u, n));
158
- if (!W(r)) return r;
159
- n = Fe(n);
160
- const o = {}, s = r;
161
- return Object.keys(s).forEach((u) => {
162
- let a = s[u];
163
- const y = t(u);
164
- n.recursive && (W(a) ? ue(a, n.keepTypesOnRecursion) || (a = e(a, n)) : n.recursiveInArray && ie(a) && (a = [...a].map((h) => {
165
- let d = h;
166
- return W(h) ? ue(d, n.keepTypesOnRecursion) || (d = e(h, n)) : ie(h) && (d = e({ key: h }, n).key), d;
167
- }))), o[y] = a;
168
- }), o;
169
- };
170
- return e;
171
- }, Dt = He(kt), Vt = (t) => t.replace(/([a-z0-9])([A-Z])/g, (e, r, n) => `${r}_${n.toLowerCase()}`), qt = He(Vt), Ye = (t) => t.length === 0 ? t : t[0].toUpperCase() + t.slice(1), V = {
172
- recursive: !0,
173
- recursiveInArray: !0,
174
- keepTypesOnRecursion: [Number, String, Uint8Array]
175
- }, Fe = (t = V) => (t.recursive == null ? t = V : t.recursiveInArray == null && (t.recursiveInArray = !1), t), ie = (t) => t != null && Array.isArray(t), W = (t) => t != null && typeof t == "object" && !Array.isArray(t), ue = (t, e) => (e || []).some((r) => t instanceof r), Sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
176
- __proto__: null,
177
- belongToTypes: ue,
178
- camelToSnake: qt,
179
- capitalize: Ye,
180
- defaultOptions: V,
181
- isArrayObject: ie,
182
- isValidObject: W,
183
- snakeToCamel: Dt,
184
- validateOptions: Fe
185
- }, Symbol.toStringTag, { value: "Module" })), Ut = fe, Gt = me, Jt = {
186
- top: "bottom",
187
- right: "left",
188
- bottom: "top",
189
- left: "right",
190
- center: "center"
191
- }, Kt = {
192
- top: "left",
193
- right: "top",
194
- bottom: "right",
195
- left: "bottom",
196
- center: "center"
197
- }, Qt = $t, M = (t) => t instanceof String ? t : be.includes(t) ? t === "x" ? "left" : "top" : t, er = (t) => Jt[M(t)], tr = (t) => Kt[M(t)], _ = (t) => {
198
- const e = M(t);
199
- return e === "top" || e === "bottom" ? "y" : "x";
200
- }, rr = i.object({
201
- x: fe.or(Ae),
202
- y: me.or(Ae)
203
- }), We = i.object({ x: fe, y: me }), L = Object.freeze({ x: "left", y: "top" }), Me = Object.freeze({ x: "right", y: "top" }), Q = Object.freeze({ x: "left", y: "bottom" }), Oe = Object.freeze({ x: "right", y: "bottom" }), Te = Object.freeze({ x: "center", y: "center" }), Xe = Object.freeze({ x: "center", y: "top" }), ke = Object.freeze({ x: "center", y: "bottom" }), De = Object.freeze({ x: "right", y: "center" }), Ve = Object.freeze({ x: "left", y: "center" }), nr = Object.freeze([
204
- Ve,
205
- De,
206
- Xe,
207
- ke,
208
- L,
209
- Me,
210
- Q,
211
- Oe,
212
- Te
213
- ]), je = (t, e) => t.x === e.x && t.y === e.y, or = (t, e) => {
214
- if (typeof e == "object") {
215
- let r = !0;
216
- return "x" in e && (t.x === e.x || (r = !1)), "y" in e && (t.y === e.y || (r = !1)), r;
217
- }
218
- return t.x === e || t.y === e;
219
- }, qe = (t) => [t.x, t.y], X = (t) => _(M(t)) === "x", sr = (t) => _(M(t)) === "y", ir = (t) => `${t.x}${Ye(t.y)}`, ur = (t, e) => {
220
- let r, n;
221
- if (typeof t == "object" && "x" in t ? (r = t.x, n = t.y) : (r = M(t), n = M(e ?? t)), _(r) === _(n) && r !== "center" && n !== "center")
222
- throw new Error(
223
- `[XYLocation] - encountered two locations with the same direction: ${r.toString()} - ${n.toString()}`
224
- );
225
- const o = { ...Te };
226
- return r === "center" ? X(n) ? [o.x, o.y] = [n, r] : [o.x, o.y] = [r, n] : n === "center" ? X(r) ? [o.x, o.y] = [r, n] : [o.x, o.y] = [n, r] : X(r) ? [o.x, o.y] = [r, n] : [o.x, o.y] = [n, r], o;
227
- }, Ue = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
228
- __proto__: null,
229
- BOTTOM_CENTER: ke,
230
- BOTTOM_LEFT: Q,
231
- BOTTOM_RIGHT: Oe,
232
- CENTER: Te,
233
- CENTER_LOCATIONS: we,
234
- LEFT_CENTER: Ve,
235
- RIGHT_CENTER: De,
236
- TOP_CENTER: Xe,
237
- TOP_LEFT: L,
238
- TOP_RIGHT: Me,
239
- XY_LOCATIONS: nr,
240
- X_LOCATIONS: J,
241
- Y_LOCATIONS: K,
242
- construct: M,
243
- constructXY: ur,
244
- corner: We,
245
- crude: Qt,
246
- direction: _,
247
- isX: X,
248
- isY: sr,
249
- location: $e,
250
- outer: bt,
251
- rotate90: tr,
252
- swap: er,
253
- x: Ut,
254
- xy: rr,
255
- xyCouple: qe,
256
- xyEquals: je,
257
- xyMatches: or,
258
- xyToString: ir,
259
- y: Gt
260
- }, Symbol.toStringTag, { value: "Module" })), ae = i.union([
261
- i.number(),
262
- R,
263
- G,
264
- ge,
265
- ht,
266
- Ce
267
- ]), p = (t, e) => {
268
- if (typeof t == "string") {
269
- if (e === void 0) throw new Error("The y coordinate must be given.");
270
- return t === "x" ? { x: e, y: 0 } : { x: 0, y: e };
271
- }
272
- 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 };
273
- }, m = Object.freeze({ x: 0, y: 0 }), Ge = Object.freeze({ x: 1, y: 1 }), ar = Object.freeze({ x: 1 / 0, y: 1 / 0 }), cr = Object.freeze({ x: NaN, y: NaN }), q = (t, e, r = 0) => {
274
- const n = p(t), o = p(e);
275
- 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;
276
- }, lr = (t) => q(t, m), pr = (t, e, r) => {
277
- const n = p(t), o = p(e, r);
278
- return { x: n.x * o.x, y: n.y * o.y };
279
- }, Je = (t, e) => {
280
- const r = p(t);
281
- return { x: r.x + e, y: r.y };
282
- }, Ke = (t, e) => {
283
- const r = p(t);
284
- return { x: r.x, y: r.y + e };
285
- }, U = (t, e, r, ...n) => typeof e == "string" && typeof r == "number" ? e === "x" ? Je(t, r) : Ke(t, r) : [t, e, r ?? m, ...n].reduce((o, s) => {
286
- const u = p(s);
287
- return { x: o.x + u.x, y: o.y + u.y };
288
- }, m), hr = (t, e, r) => {
289
- const n = p(t);
290
- return e === "x" ? { x: r, y: n.y } : { x: n.x, y: r };
291
- }, yr = (t, e) => {
292
- const r = p(t), n = p(e);
293
- return Math.sqrt((r.x - n.x) ** 2 + (r.y - n.y) ** 2);
294
- }, dr = (t, e) => {
295
- const r = p(t), n = p(e);
296
- return { x: n.x - r.x, y: n.y - r.y };
297
- }, gr = (t) => {
298
- const e = p(t);
299
- return Number.isNaN(e.x) || Number.isNaN(e.y);
300
- }, br = (t) => {
301
- const e = p(t);
302
- return Number.isFinite(e.x) && Number.isFinite(e.y);
303
- }, xr = (t) => {
304
- const e = p(t);
305
- return [e.x, e.y];
306
- }, fr = (t) => {
307
- const e = p(t);
308
- return { left: e.x, top: e.y };
309
- }, ce = (t, e = 0) => {
310
- const r = p(t);
311
- return { x: Number(r.x.toFixed(e)), y: Number(r.y.toFixed(e)) };
312
- }, En = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
313
- __proto__: null,
314
- INFINITY: ar,
315
- NAN: cr,
316
- ONE: Ge,
317
- ZERO: m,
318
- clientXY: Ce,
319
- construct: p,
320
- couple: xr,
321
- crudeZ: ae,
322
- css: fr,
323
- distance: yr,
324
- equals: q,
325
- isFinite: br,
326
- isNan: gr,
327
- isZero: lr,
328
- scale: pr,
329
- set: hr,
330
- translate: U,
331
- translateX: Je,
332
- translateY: Ke,
333
- translation: dr,
334
- truncate: ce,
335
- xy: R
336
- }, Symbol.toStringTag, { value: "Module" })), Z = i.union([i.number(), i.string()]);
337
- i.object({
338
- top: Z,
339
- left: Z,
340
- width: Z,
341
- height: Z
342
- });
343
- i.object({
344
- left: i.number(),
345
- top: i.number(),
346
- right: i.number(),
347
- bottom: i.number()
348
- });
349
- const mr = i.object({
350
- one: R,
351
- two: R,
352
- root: We
353
- }), Qe = { one: m, two: m, root: L }, wr = { one: m, two: Ge, root: Q }, et = (t, e) => ({
354
- one: t.one,
355
- two: t.two,
356
- root: e ?? t.root
357
- }), l = (t, e, r = 0, n = 0, o) => {
358
- const s = {
359
- one: { ...m },
360
- two: { ...m },
361
- root: o ?? L
362
- };
363
- if (typeof t == "number") {
364
- if (typeof e != "number")
365
- throw new Error("Box constructor called with invalid arguments");
366
- return s.one = { x: t, y: e }, s.two = { x: s.one.x + r, y: s.one.y + n }, s;
367
- }
368
- return "one" in t && "two" in t && "root" in t ? { ...t, root: o ?? t.root } : ("getBoundingClientRect" in t && (t = t.getBoundingClientRect()), "left" in t ? (s.one = { x: t.left, y: t.top }, s.two = { x: t.right, y: t.bottom }, s) : (s.one = t, e == null ? s.two = { x: s.one.x + r, y: s.one.y + n } : typeof e == "number" ? s.two = { x: s.one.x + e, y: s.one.y + r } : "width" in e ? s.two = {
369
- x: s.one.x + e.width,
370
- y: s.one.y + e.height
371
- } : "signedWidth" in e ? s.two = {
372
- x: s.one.x + e.signedWidth,
373
- y: s.one.y + e.signedHeight
374
- } : s.two = e, s));
375
- }, $r = (t, e, r) => {
376
- const n = l(t);
377
- if (typeof e == "string") {
378
- if (r == null) throw new Error("Invalid arguments for resize");
379
- const o = j(e);
380
- return l(
381
- n.one,
382
- void 0,
383
- o === "x" ? r : O(n),
384
- o === "y" ? r : T(n),
385
- n.root
386
- );
387
- }
388
- return l(n.one, e, void 0, void 0, n.root);
389
- }, vr = (t, e, r = !0) => {
390
- const n = l(t);
391
- let o = (s, u) => s < u;
392
- return r && (o = (s, u) => s <= u), "one" in e ? o($(n), $(e)) && o(E(e), E(n)) && o(v(n), v(e)) && o(I(e), I(n)) : o($(n), e.x) && o(e.x, E(n)) && o(v(n), e.y) && o(e.y, I(n));
393
- }, Mr = (t, e) => q(t.one, e.one) && q(t.two, e.two) && je(t.root, e.root), tt = (t) => ({
394
- width: O(t),
395
- height: T(t)
396
- }), Or = (t) => ({
397
- signedWidth: ee(t),
398
- signedHeight: te(t)
399
- }), Tr = (t) => ({
400
- top: v(t),
401
- left: $(t),
402
- width: O(t),
403
- height: T(t)
404
- }), Se = (t, e, r = !1) => {
405
- const n = j(e) === "y" ? te(t) : ee(t);
406
- return r ? n : Math.abs(n);
407
- }, P = (t, e) => {
408
- const r = l(t);
409
- return {
410
- x: e.x === "center" ? le(r).x : B(r, e.x),
411
- y: e.y === "center" ? le(r).y : B(r, e.y)
412
- };
413
- }, B = (t, e) => {
414
- const r = l(t), n = qe(r.root).includes(e) ? Math.min : Math.max;
415
- return J.includes(e) ? n(r.one.x, r.two.x) : n(r.one.y, r.two.y);
416
- }, jr = (t) => t.one.x === t.two.x && t.one.y === t.two.y, O = (t) => Se(t, "x"), T = (t) => Se(t, "y"), ee = (t) => {
417
- const e = l(t);
418
- return e.two.x - e.one.x;
419
- }, te = (t) => {
420
- const e = l(t);
421
- return e.two.y - e.one.y;
422
- }, rt = (t) => P(t, L), Sr = (t) => P(t, Me), Er = (t) => P(t, Q), Ir = (t) => P(t, Oe), E = (t) => B(t, "right"), I = (t) => B(t, "bottom"), $ = (t) => B(t, "left"), v = (t) => B(t, "top"), le = (t) => U(rt(t), {
423
- x: ee(t) / 2,
424
- y: te(t) / 2
425
- }), Ee = (t) => {
426
- const e = l(t);
427
- return e.root.x === "left" ? $(e) : E(e);
428
- }, Ie = (t) => {
429
- const e = l(t);
430
- return e.root.y === "top" ? v(e) : I(e);
431
- }, Br = (t) => ({ x: Ee(t), y: Ie(t) }), k = (t) => {
432
- const e = l(t);
433
- return { lower: e.one.x, upper: e.two.x };
434
- }, D = (t) => {
435
- const e = l(t);
436
- return { lower: e.one.y, upper: e.two.y };
437
- }, Ar = (t, e) => et(t, e), zr = (t, e) => {
438
- const r = l(t), n = J.includes(e) ? "x" : K.includes(e) ? "y" : null;
439
- if (n === null) throw new Error(`Invalid location: ${Ue}`);
440
- const o = e === "top" || e === "left" ? Math.min : Math.max, s = { ...r.one }, u = { ...r.two };
441
- return s[n] = o(r.one[n], r.two[n]), u[n] = o(r.one[n], r.two[n]), [s, u];
442
- }, Nr = (t, e) => {
443
- const r = l(t), n = l(e), o = Ee(n) + (O(n) - O(r)) / 2, s = Ie(n) + (T(n) - T(r)) / 2;
444
- return l({ x: o, y: s }, tt(r));
445
- }, nt = (t) => typeof t != "object" || t == null ? !1 : "one" in t && "two" in t && "root" in t, Cr = (t) => O(t) / T(t), Rr = (t, e, r) => {
446
- if (typeof e == "string") {
447
- if (r == null) throw new Error("Undefined amount passed into box.translate");
448
- const o = j(e);
449
- e = p(o, r);
450
- }
451
- const n = l(t);
452
- return l(
453
- U(n.one, e),
454
- U(n.two, e),
455
- void 0,
456
- void 0,
457
- n.root
458
- );
459
- }, _r = (t, e) => {
460
- const r = Math.max($(t), $(e)), n = Math.max(v(t), v(e)), o = Math.min(E(t), E(e)), s = Math.min(I(t), I(e));
461
- return r > o || n > s ? Qe : l({ x: r, y: n }, { x: o, y: s }, void 0, void 0, t.root);
462
- }, Lr = (t) => O(t) * T(t), Pr = (t, e) => {
463
- const r = l(t);
464
- return l(
465
- ce(r.one, e),
466
- ce(r.two, e),
467
- void 0,
468
- void 0,
469
- r.root
470
- );
471
- }, Zr = (t, e, r, n, o, s) => {
472
- const u = { x: t, y: e }, a = { x: t + r, y: e + n };
473
- 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)), l(u, a, void 0, void 0, s);
474
- }, In = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
475
- __proto__: null,
476
- DECIMAL: wr,
477
- ZERO: Qe,
478
- area: Lr,
479
- areaIsZero: jr,
480
- aspect: Cr,
481
- bottom: I,
482
- bottomLeft: Er,
483
- bottomRight: Ir,
484
- box: mr,
485
- center: le,
486
- construct: l,
487
- constructWithAlternateRoot: Zr,
488
- contains: vr,
489
- copy: et,
490
- css: Tr,
491
- dim: Se,
492
- dims: tt,
493
- edgePoints: zr,
494
- equals: Mr,
495
- height: T,
496
- intersection: _r,
497
- isBox: nt,
498
- left: $,
499
- loc: B,
500
- positionInCenter: Nr,
501
- reRoot: Ar,
502
- resize: $r,
503
- right: E,
504
- root: Br,
505
- signedDims: Or,
506
- signedHeight: te,
507
- signedWidth: ee,
508
- top: v,
509
- topLeft: rt,
510
- topRight: Sr,
511
- translate: Rr,
512
- truncate: Pr,
513
- width: O,
514
- x: Ee,
515
- xBounds: k,
516
- xyLoc: P,
517
- y: Ie,
518
- yBounds: D
519
- }, Symbol.toStringTag, { value: "Module" })), ot = i.object({ signedWidth: i.number(), signedHeight: i.number() }), Hr = i.union([ge, ot, R, G]), Yr = { width: 0, height: 0 }, Fr = { 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 }, Wr = (t, e) => {
520
- if (e == null) return !1;
521
- const r = g(t), n = g(e);
522
- return r.width === n.width && r.height === n.height;
523
- }, Xr = (t) => {
524
- const e = g(t);
525
- return { width: e.height, height: e.width };
526
- }, kr = (t) => {
527
- const e = g(t);
528
- return `0 0 ${e.width} ${e.height}`;
529
- }, Dr = (t) => {
530
- const e = g(t);
531
- return [e.width, e.height];
532
- }, Vr = (t) => ({
533
- width: Math.max(...t.map((e) => g(e).width)),
534
- height: Math.max(...t.map((e) => g(e).height))
535
- }), qr = (t) => ({
536
- width: Math.min(...t.map((e) => g(e).width)),
537
- height: Math.min(...t.map((e) => g(e).height))
538
- }), Ur = (t, e) => {
539
- const r = g(t);
540
- return { width: r.width * e, height: r.height * e };
541
- }, Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
542
- __proto__: null,
543
- DECIMAL: Fr,
544
- ZERO: Yr,
545
- construct: g,
546
- couple: Dr,
547
- crude: Hr,
548
- dimensions: ge,
549
- equals: Wr,
550
- max: Vr,
551
- min: qr,
552
- scale: Ur,
553
- signed: ot,
554
- svgViewBox: kr,
555
- swap: Xr
556
- }, Symbol.toStringTag, { value: "Module" }));
557
- var Gr = Object.defineProperty, Jr = (t, e, r) => e in t ? Gr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, f = (t, e, r) => Jr(t, typeof e != "symbol" ? e + "" : e, r);
558
- const Kr = (t, e, r) => e !== void 0 && t < e ? e : r !== void 0 && t > r ? r : t, Qr = i.object({ offset: ae, scale: ae }), en = (t) => (e, r, n, o) => r === "dimension" ? [e, n] : [
559
- e,
560
- o ? n - t : n + t
561
- ], tn = (t) => (e, r, n, o) => [
562
- e,
563
- o ? n / t : n * t
564
- ], rn = (t) => (e, r, n) => {
565
- if (e === null) return [t, n];
566
- const { lower: o, upper: s } = e, { lower: u, upper: a } = t, y = s - o, h = a - u;
567
- if (r === "dimension") return [t, n * (h / y)];
568
- const d = (n - o) * (h / y) + u;
569
- return [t, d];
570
- }, nn = (t) => (e, r, n) => [t, n], on = () => (t, e, r) => {
571
- if (t === null) throw new Error("cannot invert without bounds");
572
- if (e === "dimension") return [t, r];
573
- const { lower: n, upper: o } = t;
574
- return [t, o - (r - n)];
575
- }, sn = (t) => (e, r, n) => {
576
- const { lower: o, upper: s } = t;
577
- return n = Kr(n, o, s), [e, n];
578
- }, pe = class C {
579
- constructor() {
580
- f(this, "ops", []), f(this, "currBounds", null), f(this, "currType", null), f(this, "reversed", !1), this.ops = [];
581
- }
582
- static translate(e) {
583
- return new C().translate(e);
584
- }
585
- static magnify(e) {
586
- return new C().magnify(e);
587
- }
588
- static scale(e, r) {
589
- return new C().scale(e, r);
590
- }
591
- translate(e) {
592
- const r = this.new(), n = en(e);
593
- return n.type = "translate", r.ops.push(n), r;
594
- }
595
- magnify(e) {
596
- const r = this.new(), n = tn(e);
597
- return n.type = "magnify", r.ops.push(n), r;
598
- }
599
- scale(e, r) {
600
- const n = c(e, r), o = this.new(), s = rn(n);
601
- return s.type = "scale", o.ops.push(s), o;
602
- }
603
- clamp(e, r) {
604
- const n = c(e, r), o = this.new(), s = sn(n);
605
- return s.type = "clamp", o.ops.push(s), o;
606
- }
607
- reBound(e, r) {
608
- const n = c(e, r), o = this.new(), s = nn(n);
609
- return s.type = "re-bound", o.ops.push(s), o;
610
- }
611
- invert() {
612
- const e = on();
613
- e.type = "invert";
614
- const r = this.new();
615
- return r.ops.push(e), r;
616
- }
617
- pos(e) {
618
- return this.exec("position", e);
619
- }
620
- dim(e) {
621
- return this.exec("dimension", e);
622
- }
623
- new() {
624
- const e = new C();
625
- return e.ops = this.ops.slice(), e.reversed = this.reversed, e;
626
- }
627
- exec(e, r) {
628
- return this.currBounds = null, this.ops.reduce(
629
- ([n, o], s) => s(n, e, o, this.reversed),
630
- [null, r]
631
- )[1];
632
- }
633
- reverse() {
634
- const e = this.new();
635
- e.ops.reverse();
636
- const r = [];
637
- return e.ops.forEach((n, o) => {
638
- if (n.type === "scale" || r.some(([u, a]) => o >= u && o <= a))
639
- return;
640
- const s = e.ops.findIndex((u, a) => u.type === "scale" && a > o);
641
- s !== -1 && r.push([o, s]);
642
- }), r.forEach(([n, o]) => {
643
- const s = e.ops.slice(n, o);
644
- s.unshift(e.ops[o]), e.ops.splice(n, o - n + 1, ...s);
645
- }), e.reversed = !e.reversed, e;
646
- }
647
- };
648
- f(pe, "IDENTITY", new pe());
649
- let he = pe;
650
- const un = (t) => ({
651
- scale: {
652
- x: t.x.dim(1),
653
- y: t.y.dim(1)
654
- },
655
- offset: {
656
- x: t.x.pos(0),
657
- y: t.y.pos(0)
658
- }
659
- }), ye = class x {
660
- constructor(e = new he(), r = new he(), n = null) {
661
- f(this, "x"), f(this, "y"), f(this, "currRoot"), this.x = e, this.y = r, this.currRoot = n;
662
- }
663
- static translate(e, r) {
664
- return new x().translate(e, r);
665
- }
666
- static translateX(e) {
667
- return new x().translateX(e);
668
- }
669
- static translateY(e) {
670
- return new x().translateY(e);
671
- }
672
- static clamp(e) {
673
- return new x().clamp(e);
674
- }
675
- static magnify(e) {
676
- return new x().magnify(e);
677
- }
678
- static scale(e) {
679
- return new x().scale(e);
680
- }
681
- static reBound(e) {
682
- return new x().reBound(e);
683
- }
684
- translate(e, r) {
685
- const n = p(e, r), o = this.copy();
686
- return o.x = this.x.translate(n.x), o.y = this.y.translate(n.y), o;
687
- }
688
- translateX(e) {
689
- const r = this.copy();
690
- return r.x = this.x.translate(e), r;
691
- }
692
- translateY(e) {
693
- const r = this.copy();
694
- return r.y = this.y.translate(e), r;
695
- }
696
- magnify(e) {
697
- const r = this.copy();
698
- return r.x = this.x.magnify(e.x), r.y = this.y.magnify(e.y), r;
699
- }
700
- scale(e) {
701
- const r = this.copy();
702
- if (nt(e)) {
703
- const n = this.currRoot;
704
- return r.currRoot = e.root, n != null && !je(n, e.root) && (n.x !== e.root.x && (r.x = r.x.invert()), n.y !== e.root.y && (r.y = r.y.invert())), r.x = r.x.scale(k(e)), r.y = r.y.scale(D(e)), r;
705
- }
706
- return r.x = r.x.scale(e.width), r.y = r.y.scale(e.height), r;
707
- }
708
- reBound(e) {
709
- const r = this.copy();
710
- return r.x = this.x.reBound(k(e)), r.y = this.y.reBound(D(e)), r;
711
- }
712
- clamp(e) {
713
- const r = this.copy();
714
- return r.x = this.x.clamp(k(e)), r.y = this.y.clamp(D(e)), r;
715
- }
716
- copy() {
717
- const e = new x();
718
- return e.currRoot = this.currRoot, e.x = this.x, e.y = this.y, e;
719
- }
720
- reverse() {
721
- const e = this.copy();
722
- return e.x = this.x.reverse(), e.y = this.y.reverse(), e;
723
- }
724
- pos(e) {
725
- return { x: this.x.pos(e.x), y: this.y.pos(e.y) };
726
- }
727
- box(e) {
728
- return l(
729
- this.pos(e.one),
730
- this.pos(e.two),
731
- 0,
732
- 0,
733
- this.currRoot ?? e.root
734
- );
735
- }
736
- };
737
- f(ye, "IDENTITY", new ye());
738
- let an = ye;
739
- const An = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
740
- __proto__: null,
741
- Scale: he,
742
- XY: an,
743
- crudeXYTransform: Qr,
744
- xyScaleToTransform: un
745
- }, Symbol.toStringTag, { value: "Module" }));
746
- function st(t) {
747
- var e, r, n = "";
748
- if (typeof t == "string" || typeof t == "number") n += t;
749
- else if (typeof t == "object") if (Array.isArray(t)) {
750
- var o = t.length;
751
- for (e = 0; e < o; e++) t[e] && (r = st(t[e])) && (n && (n += " "), n += r);
752
- } else for (r in t) t[r] && (n && (n += " "), n += r);
753
- return n;
754
- }
755
- function cn() {
756
- for (var t, e, r = 0, n = "", o = arguments.length; r < o; r++) (t = arguments[r]) && (e = st(t)) && (n && (n += " "), n += e);
757
- return n;
758
- }
759
- const ln = cn, ze = "-", Ne = "__", H = "--", it = (t) => {
760
- const e = (...r) => ln(...r);
761
- return e.B = (r) => t + ze + r, e.E = (r) => t + Ne + r, e.M = (r) => t + H + r, e.BM = (r, n) => e.B(r) + H + n, e.BE = (r, n) => e.B(r) + Ne + n, e.BEM = (r, n, o) => e.BE(r, n) + H + o, e.extend = (r) => it(e.B(r)), e.var = (r) => H + t + ze + r, e;
762
- }, pn = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, de = i.string().regex(pn), N = i.number().min(0).max(255), hn = i.number().min(0).max(1), Be = i.tuple([N, N, N, hn]), ut = i.tuple([N, N, N]), at = i.object({ rgba255: Be }), yn = (t) => t == null ? void 0 : new A(t).hex, dn = (t) => {
763
- if (t == null) return;
764
- const e = A.z.safeParse(t);
765
- if (e.success) return e.data.rgbaCSS;
766
- if (typeof t == "string") return t;
767
- throw e.error;
768
- }, b = class b {
769
- /**
770
- * @constructor Creates a new color from the given color value. The color value can be
771
- * a hex string, an array of RGB or RGBA values, or another color.
772
- *
773
- * @param color - The color value to create the color from. If the color value is a
774
- * string, it must be a valid hex color (with or without the '#') with a hasheless
775
- * length 6 or 8. If the hex color is 8 characters long, the last twoc haracters are
776
- * used as the alpha value. If the color value is an array, it must be an array of
777
- * length 3 or 4, with each value between 0 and 255. If the color value is another
778
- * color, the color will be copied.
779
- *
780
- * @param alpha - An optional alpha value to set. If the color value carries its own
781
- * alpha value, this value will be ignored. Defaults to 1.
782
- */
783
- constructor(e, r = 1) {
784
- /**
785
- * @property the color as an RGBA tuple, with each color value between 0 and 255,
786
- * and the alpha value between 0 and 1.
787
- */
788
- z(this, "rgba255");
789
- if (typeof e == "string")
790
- this.rgba255 = b.fromHex(e, r);
791
- else if (Array.isArray(e)) {
792
- if (e.length < 3 || e.length > 4)
793
- throw new Error(`Invalid color: [${e.join(", ")}]`);
794
- this.rgba255 = e.length === 3 ? [...e, r ?? 1] : e;
795
- } else this.rgba255 = e.rgba255;
796
- }
797
- /**
798
- * @returns true if the given color is semantically equal to this color. Different
799
- * representations of the same color are considered equal (e.g. hex and rgba).
800
- */
801
- equals(e) {
802
- if (e == null) return !1;
803
- const r = new b(e);
804
- return this.rgba255.every((n, o) => n === r.rgba255[o]);
805
- }
806
- /**
807
- * @returns the hex representation of the color. If the color has an opacity of 1,
808
- * the returned hex will be 6 characters long. Otherwise, it will be 8 characters
809
- * long.
810
- */
811
- get hex() {
812
- const [e, r, n, o] = this.rgba255;
813
- return `#${Y(e)}${Y(r)}${Y(n)}${o === 1 ? "" : Y(o * 255)}`;
814
- }
815
- /**
816
- * @returns the color as a CSS RGBA string.
817
- */
818
- get rgbaCSS() {
819
- const [e, r, n, o] = this.rgba255;
820
- return `rgba(${e}, ${r}, ${n}, ${o})`;
821
- }
822
- /**
823
- * @returns the color as a CSS RGB string with no alpha value.
824
- */
825
- get rgbCSS() {
826
- return `rgb(${this.rgbString})`;
827
- }
828
- /**
829
- * @returns the color as an RGB string, with each color value between 0 and 255.
830
- * @example "255, 255, 255"
831
- */
832
- get rgbString() {
833
- const [e, r, n] = this.rgba255;
834
- return `${e}, ${r}, ${n}`;
835
- }
836
- /**
837
- * @returns the color as an RGBA tuple, with each color value between 0 and 1,
838
- * and the alpha value between 0 and 1.
839
- */
840
- get rgba1() {
841
- return [...this.rgb1, this.rgba255[3]];
842
- }
843
- get rgb1() {
844
- return [this.rgba255[0] / 255, this.rgba255[1] / 255, this.rgba255[2] / 255];
845
- }
846
- /** @returns the red value of the color, between 0 and 255. */
847
- get r() {
848
- return this.rgba255[0];
849
- }
850
- /** @returns the green value of the color, between 0 and 255. */
851
- get g() {
852
- return this.rgba255[1];
853
- }
854
- /** @returns the blue value of the color, between 0 and 255. */
855
- get b() {
856
- return this.rgba255[2];
857
- }
858
- /** @returns the alpha value of the color, between 0 and 1. */
859
- get a() {
860
- return this.rgba255[3];
861
- }
862
- /** @returns true if all RGBA values are 0. */
863
- get isZero() {
864
- return this.equals(ct);
865
- }
866
- get hsla() {
867
- return xn(this.rgba255);
868
- }
869
- /**
870
- * Creates a new color with the given alpha.
871
- *
872
- * @param alpha - The alpha value to set. If the value is greater than 1, it will be
873
- * divided by 100.
874
- * @returns A new color with the given alpha.
875
- */
876
- setAlpha(e) {
877
- const [r, n, o] = this.rgba255;
878
- if (e > 100)
879
- throw new Error(`Color opacity must be between 0 and 100, got ${e}`);
880
- return e > 1 && (e = e / 100), new b([r, n, o, e]);
881
- }
882
- /**
883
- * @returns the luminance of the color, between 0 and 1.
884
- */
885
- get luminance() {
886
- const [e, r, n] = this.rgb1.map((o) => o <= 0.03928 ? o / 12.92 : ((o + 0.055) / 1.055) ** 2.4);
887
- return Number((0.2126 * e + 0.7152 * r + 0.0722 * n).toFixed(3));
888
- }
889
- /**
890
- * @returns the contrast ratio between this color and the given color. The contrast
891
- * ratio is a number between 1 and 21, where 1 is the lowest contrast and 21 is the
892
- * highest.
893
- * @param other
894
- * @returns
895
- */
896
- contrast(e) {
897
- const r = new b(e), n = this.luminance, o = r.luminance;
898
- return (Math.max(n, o) + 0.5) / (Math.min(n, o) + 0.5);
899
- }
900
- pickByContrast(...e) {
901
- if (e.length === 0)
902
- throw new Error("[Color.pickByContrast] - must provide at least one color");
903
- const [r] = e.map((n) => new b(n)).sort((n, o) => this.contrast(o) - this.contrast(n));
904
- return r;
905
- }
906
- get isDark() {
907
- return this.luminance < 0.5;
908
- }
909
- get isLight() {
910
- return !this.isDark;
911
- }
912
- static fromHex(e, r = 1) {
913
- if (!de.safeParse(e).success) throw new Error(`Invalid hex color: ${e}`);
914
- return e = gn(e), [
915
- F(e, 0),
916
- F(e, 2),
917
- F(e, 4),
918
- e.length === 8 ? F(e, 6) / 255 : r
919
- ];
920
- }
921
- };
922
- z(b, "z", i.union([de, Be, ut, i.instanceof(b), at]).transform((e) => new b(e)));
923
- let A = b;
924
- const ct = new A([0, 0, 0, 0]), Y = (t) => Math.floor(t).toString(16).padStart(2, "0"), F = (t, e) => parseInt(t.slice(e, e + 2), 16), gn = (t) => t.startsWith("#") ? t.slice(1) : t, bn = (t) => {
925
- let [e, r, n] = t;
926
- const o = t[3];
927
- e /= 360, r /= 100, n /= 100;
928
- let s, u, a;
929
- if (r === 0)
930
- s = u = a = n;
931
- else {
932
- const y = n < 0.5 ? n * (1 + r) : n + r - n * r, h = 2 * n - y;
933
- s = ne(h, y, e + 1 / 3), u = ne(h, y, e), a = ne(h, y, e - 1 / 3);
934
- }
935
- return [Math.round(s * 255), Math.round(u * 255), Math.round(a * 255), o];
936
- }, ne = (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), xn = (t) => {
937
- let [e, r, n] = t;
938
- const o = t[3];
939
- e /= 255, r /= 255, n /= 255, e /= 255, r /= 255, n /= 255;
940
- const s = Math.max(e, r, n), u = Math.min(e, r, n);
941
- let a, y, h = (s + u) / 2;
942
- if (s === u)
943
- a = y = 0;
944
- else {
945
- const d = s - u;
946
- y = h > 0.5 ? d / (2 - s - u) : d / (s + u), s === e ? a = (r - n) / d + (r < n ? 6 : 0) : s === r ? a = (n - e) / d + 2 : a = (e - r) / d + 4, a /= 6;
947
- }
948
- return a *= 360, y *= 100, h *= 100, [Math.round(a), Math.round(y), Math.round(h), o];
949
- }, fn = i.union([
950
- de,
951
- Be,
952
- i.instanceof(A),
953
- i.string(),
954
- ut,
955
- at
956
- ]), zn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
957
- __proto__: null,
958
- Color: A,
959
- ZERO: ct,
960
- crudeZ: fn,
961
- cssString: dn,
962
- fromHSLA: bn,
963
- toHex: yn
964
- }, Symbol.toStringTag, { value: "Module" }));
965
- class mn {
966
- constructor(e = "") {
967
- z(this, "rows", []);
968
- z(this, "columns", []);
969
- z(this, "prefix");
970
- this.prefix = e;
971
- }
972
- row(e, r, n) {
973
- const { prefix: o } = this;
974
- return this.rows.push({ startLabel: o + e, endLabel: o + r, size: n }), this;
975
- }
976
- col(e, r, n) {
977
- const { prefix: o } = this;
978
- return this.columns.push({ startLabel: o + e, endLabel: o + r, size: n }), this;
979
- }
980
- build() {
981
- return {
982
- display: "grid",
983
- gridTemplateRows: this.rows.map((e, r) => {
984
- let n = r === 0 ? "[" : "";
985
- return n += `${e.startLabel}] ${e.size}${typeof e.size == "number" ? "px" : ""} [${e.endLabel}`, n += r === this.rows.length - 1 ? "]" : "", n;
986
- }).join(" "),
987
- gridTemplateColumns: this.columns.map((e, r) => {
988
- let n = r === 0 ? "[" : "";
989
- return n += `${e.startLabel}] ${e.size}${typeof e.size == "number" ? "px" : ""} [${e.endLabel}`, n += r === this.columns.length - 1 ? "]" : "", n;
990
- }).join(" ")
991
- };
992
- }
993
- }
994
- const wn = (t, e) => Object.entries(e).forEach(
995
- ([r, n]) => n != null && t.style.setProperty(r, `${n}`)
996
- ), $n = (t, e) => Array.from(t.style).forEach((r) => {
997
- r.startsWith(e) && t.style.removeProperty(r);
998
- }), vn = (t) => {
999
- const e = it(t);
1000
- return e.visible = (r) => e.M(r ? "visible" : "hidden"), e.expanded = (r) => e.M(r ? "expanded" : "collapsed"), e.loc = (r) => e.M(Ue.construct(r)), e.disabled = (r) => r === !0 && e.M("disabled"), e.align = (r) => e.M(r), e.dir = (r) => r != null && e.M(Xt.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 = wn, e.removeVars = $n, e.newGridBuilder = (r) => new mn(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) => `var(--${t}-gray-l${r})`, e.levelSizeVar = (r) => `var(--${t}-${r}-size)`, e;
1001
- }, Nn = vn("pluto");
1002
- export {
1003
- je as $,
1004
- O as A,
1005
- or as B,
1006
- Nn as C,
1007
- Lr as D,
1008
- _r as E,
1009
- er as F,
1010
- Ue as J,
1011
- nr as M,
1012
- jn as R,
1013
- In as T,
1014
- ct as Z,
1015
- Sn as _,
1016
- A as a,
1017
- fn as b,
1018
- dn as c,
1019
- zn as d,
1020
- Dt as e,
1021
- bn as f,
1022
- Xt as g,
1023
- Tn as h,
1024
- cn as i,
1025
- Kr as j,
1026
- An as k,
1027
- Bn as l,
1028
- rr as m,
1029
- it as n,
1030
- c as o,
1031
- $e as p,
1032
- En as q,
1033
- j as r,
1034
- l as s,
1035
- yn as t,
1036
- P as u,
1037
- qt as v,
1038
- Zr as w,
1039
- L as x,
1040
- Te as y,
1041
- T as z
1042
- };