@synnaxlabs/pluto 0.44.5 → 0.44.7

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 (167) hide show
  1. package/dist/{Animated-BDoJWl9g.cjs → Animated-D5LYKEkW.cjs} +1 -1
  2. package/dist/{Animated-fI-NFaha.js → Animated-DdcRuSba.js} +2 -2
  3. package/dist/Editable-7Abx7gK5.cjs +92 -0
  4. package/dist/{Editable-C1g_CFYk.js → Editable-BrtvNf66.js} +11315 -11270
  5. package/dist/{LinePlot-Ck0rhtFk.js → LinePlot-BIZ1E3Rb.js} +423 -420
  6. package/dist/LinePlot-DslwDvAo.cjs +53 -0
  7. package/dist/{Toggle-DUKDeqpe.cjs → Toggle-BVFmU1mL.cjs} +1 -1
  8. package/dist/{Toggle-DEJ8Uvun.js → Toggle-DfINNQZ3.js} +1 -1
  9. package/dist/{Video-B6tujjr8.js → Video-CMuBiBcp.js} +1 -1
  10. package/dist/{Video-BjRd9sFv.cjs → Video-CbaEeyGH.cjs} +1 -1
  11. package/dist/button.cjs +1 -1
  12. package/dist/button.js +1 -1
  13. package/dist/color.cjs +1 -1
  14. package/dist/color.js +1 -1
  15. package/dist/{css-DvIPI3Qm.js → css-BlHGoCgb.js} +578 -559
  16. package/dist/css-CZ_XGkIB.cjs +8 -0
  17. package/dist/css.cjs +1 -1
  18. package/dist/css.js +2 -2
  19. package/dist/dialog.cjs +1 -1
  20. package/dist/dialog.js +1 -1
  21. package/dist/{eraser-CnRJY__h.js → eraser-BstNvEkO.js} +1940 -1889
  22. package/dist/eraser-DiJNbabo.cjs +63 -0
  23. package/dist/ether.cjs +1 -1
  24. package/dist/ether.js +13 -13
  25. package/dist/{external-DKh0JhWO.cjs → external-B33LW5pz.cjs} +1 -1
  26. package/dist/{external-Dfr7xymv.js → external-BNwo0Mju.js} +3 -3
  27. package/dist/{external-CAAPXpVr.cjs → external-C3hm9xgd.cjs} +1 -1
  28. package/dist/external-CE5Gf1U4.cjs +1 -0
  29. package/dist/{external-D6hAP7eJ.js → external-CSkXMvdW.js} +7 -7
  30. package/dist/{external-R9a28aP6.js → external-C_25EtbW.js} +31 -31
  31. package/dist/{external-dew29Q0v.js → external-ClD0dLdB.js} +2 -2
  32. package/dist/{external-CKhbbig_.js → external-CoEPLcYb.js} +12 -12
  33. package/dist/{external-DwRvB5ZT.cjs → external-CoVeaXHg.cjs} +1 -1
  34. package/dist/{external-CNF5TNBY.cjs → external-Cs-XdMNw.cjs} +1 -1
  35. package/dist/{external-BzV_PGNe.js → external-CsZA1s33.js} +2 -2
  36. package/dist/{external-Db9iKa8k.js → external-CtRU4mkG.js} +3 -3
  37. package/dist/{external-D98a3YQJ.cjs → external-D-FHwqls.cjs} +1 -1
  38. package/dist/{external-BS9S-b49.cjs → external-D91gCQ3U.cjs} +1 -1
  39. package/dist/external-DE-uFhwW.cjs +1 -0
  40. package/dist/{external-DOEaBrpz.cjs → external-DSkHe-2Y.cjs} +1 -1
  41. package/dist/{external-DNO3FJLl.cjs → external-DXm6LsSg.cjs} +1 -1
  42. package/dist/{external-C2iqWGd2.js → external-DkZwoQZk.js} +29 -29
  43. package/dist/external-Ds3Wz9sk.js +44 -0
  44. package/dist/{external-B3dPSZUg.js → external-FrSPoRvt.js} +2 -2
  45. package/dist/{external-DRuZ24L7.js → external-GS2AbOOd.js} +6 -6
  46. package/dist/{external-Blrrgnzw.cjs → external-IBErJ3kF.cjs} +1 -1
  47. package/dist/{external-GR-20z_c.js → external-J5kFGShS.js} +20 -20
  48. package/dist/{external-Daage1AI.js → external-V3Tbt95R.js} +10 -10
  49. package/dist/{external-BenP6Hcm.cjs → external-mX8u0eSb.cjs} +1 -1
  50. package/dist/{external-BVDQNHbo.cjs → external-vdf1a_j1.cjs} +1 -1
  51. package/dist/flex.cjs +1 -1
  52. package/dist/flex.js +1 -1
  53. package/dist/{fontString-CW0wLG5g.js → fontString-Ca1-oixk.js} +2 -2
  54. package/dist/{fontString-aK--tYMM.cjs → fontString-Cp4X6CqQ.cjs} +1 -1
  55. package/dist/header.cjs +1 -1
  56. package/dist/header.js +1 -1
  57. package/dist/index.cjs +7 -7
  58. package/dist/index.js +6521 -6434
  59. package/dist/input.cjs +1 -1
  60. package/dist/input.js +1 -1
  61. package/dist/list.cjs +1 -1
  62. package/dist/list.js +1 -1
  63. package/dist/menu.cjs +1 -1
  64. package/dist/menu.js +1 -1
  65. package/dist/pluto.css +1 -1
  66. package/dist/src/channel/LinePlot.d.ts +0 -4
  67. package/dist/src/channel/LinePlot.d.ts.map +1 -1
  68. package/dist/src/channel/queries.d.ts +13 -13
  69. package/dist/src/channel/queries.d.ts.map +1 -1
  70. package/dist/src/dialog/Dialog.d.ts.map +1 -1
  71. package/dist/src/dialog/Frame.d.ts +13 -7
  72. package/dist/src/dialog/Frame.d.ts.map +1 -1
  73. package/dist/src/dialog/position.d.ts +22 -8
  74. package/dist/src/dialog/position.d.ts.map +1 -1
  75. package/dist/src/dialog/position.spec.d.ts +2 -0
  76. package/dist/src/dialog/position.spec.d.ts.map +1 -0
  77. package/dist/src/flux/core/store.d.ts +2 -0
  78. package/dist/src/flux/core/store.d.ts.map +1 -1
  79. package/dist/src/flux/list.d.ts +9 -2
  80. package/dist/src/flux/list.d.ts.map +1 -1
  81. package/dist/src/group/index.d.ts +2 -0
  82. package/dist/src/group/index.d.ts.map +1 -0
  83. package/dist/src/group/queries.d.ts +35 -0
  84. package/dist/src/group/queries.d.ts.map +1 -0
  85. package/dist/src/group/queries.spec.d.ts +2 -0
  86. package/dist/src/group/queries.spec.d.ts.map +1 -0
  87. package/dist/src/hardware/device/queries.d.ts +1 -1
  88. package/dist/src/hardware/device/queries.d.ts.map +1 -1
  89. package/dist/src/hardware/rack/queries.d.ts +1 -1
  90. package/dist/src/hardware/rack/queries.d.ts.map +1 -1
  91. package/dist/src/hardware/task/queries.d.ts +1 -1
  92. package/dist/src/hardware/task/queries.d.ts.map +1 -1
  93. package/dist/src/hooks/index.d.ts +0 -2
  94. package/dist/src/hooks/index.d.ts.map +1 -1
  95. package/dist/src/hooks/useDestructors.d.ts.map +1 -1
  96. package/dist/src/hooks/useDestructors.spec.d.ts +2 -0
  97. package/dist/src/hooks/useDestructors.spec.d.ts.map +1 -0
  98. package/dist/src/hooks/useResize.d.ts +1 -0
  99. package/dist/src/hooks/useResize.d.ts.map +1 -1
  100. package/dist/src/icon/registry.d.ts +1 -0
  101. package/dist/src/icon/registry.d.ts.map +1 -1
  102. package/dist/src/label/queries.d.ts +1 -1
  103. package/dist/src/label/queries.d.ts.map +1 -1
  104. package/dist/src/menu/ContextMenu.d.ts +1 -1
  105. package/dist/src/menu/ContextMenu.d.ts.map +1 -1
  106. package/dist/src/ontology/queries.d.ts +2 -2
  107. package/dist/src/ontology/queries.d.ts.map +1 -1
  108. package/dist/src/pluto/Pluto.d.ts +2 -0
  109. package/dist/src/pluto/Pluto.d.ts.map +1 -1
  110. package/dist/src/ranger/aether/queries.d.ts +1 -1
  111. package/dist/src/ranger/aether/queries.d.ts.map +1 -1
  112. package/dist/src/ranger/queries.d.ts +2 -2
  113. package/dist/src/ranger/queries.d.ts.map +1 -1
  114. package/dist/src/state/state.d.ts.map +1 -1
  115. package/dist/src/telem/control/aether/controller.d.ts +2 -2
  116. package/dist/src/telem/control/aether/legend.d.ts +2 -2
  117. package/dist/src/testutil/Synnax.d.ts +1 -1
  118. package/dist/src/testutil/Synnax.d.ts.map +1 -1
  119. package/dist/src/vis/legend/Container.d.ts +3 -29
  120. package/dist/src/vis/legend/Container.d.ts.map +1 -1
  121. package/dist/src/vis/legend/Entries.d.ts +22 -0
  122. package/dist/src/vis/legend/Entries.d.ts.map +1 -0
  123. package/dist/src/vis/legend/Grouped.d.ts +15 -0
  124. package/dist/src/vis/legend/Grouped.d.ts.map +1 -0
  125. package/dist/src/vis/legend/Simple.d.ts +5 -19
  126. package/dist/src/vis/legend/Simple.d.ts.map +1 -1
  127. package/dist/src/vis/legend/external.d.ts +1 -0
  128. package/dist/src/vis/legend/external.d.ts.map +1 -1
  129. package/dist/src/vis/light/aether/light.d.ts +4 -5
  130. package/dist/src/vis/light/aether/light.d.ts.map +1 -1
  131. package/dist/src/vis/light/use.d.ts +2 -2
  132. package/dist/src/vis/light/use.d.ts.map +1 -1
  133. package/dist/src/vis/lineplot/Legend.d.ts +3 -3
  134. package/dist/src/vis/lineplot/Legend.d.ts.map +1 -1
  135. package/dist/src/vis/lineplot/Line.d.ts +2 -1
  136. package/dist/src/vis/lineplot/Line.d.ts.map +1 -1
  137. package/dist/src/vis/lineplot/LinePlot.d.ts +1 -0
  138. package/dist/src/vis/lineplot/LinePlot.d.ts.map +1 -1
  139. package/dist/src/vis/schematic/Forms.d.ts.map +1 -1
  140. package/dist/src/workspace/queries.d.ts +1 -1
  141. package/dist/src/workspace/queries.d.ts.map +1 -1
  142. package/dist/tabs.cjs +1 -1
  143. package/dist/tabs.js +1 -1
  144. package/dist/text.cjs +1 -1
  145. package/dist/text.js +2 -2
  146. package/dist/theming.cjs +1 -1
  147. package/dist/theming.js +2 -2
  148. package/dist/tree.cjs +1 -1
  149. package/dist/tree.js +1 -1
  150. package/dist/triggers.cjs +1 -1
  151. package/dist/triggers.js +1 -1
  152. package/dist/{units-WWUmv-rf.cjs → units-Cqxg-SBx.cjs} +1 -1
  153. package/dist/{units-Dh7MflIZ.js → units-D8blpqyN.js} +1 -1
  154. package/dist/video.cjs +1 -1
  155. package/dist/video.js +1 -1
  156. package/package.json +6 -6
  157. package/dist/Editable-DUtJOqJ5.cjs +0 -92
  158. package/dist/LinePlot-6cl8_hmn.cjs +0 -53
  159. package/dist/css-DI0uCCGq.cjs +0 -8
  160. package/dist/eraser-B03ej59l.cjs +0 -63
  161. package/dist/external-BEd3F7zY.cjs +0 -1
  162. package/dist/external-D16M7vHB.js +0 -43
  163. package/dist/external-I_-aclFy.cjs +0 -1
  164. package/dist/src/hooks/useDelayedState.d.ts +0 -11
  165. package/dist/src/hooks/useDelayedState.d.ts.map +0 -1
  166. package/dist/src/hooks/useTransforms.d.ts +0 -16
  167. package/dist/src/hooks/useTransforms.d.ts.map +0 -1
@@ -32,7 +32,7 @@ const ln = (t) => {
32
32
  }, fn = (t = _e) => (t.recursive == null ? t = _e : t.recursiveInArray ??= !1, t), kt = (t) => t != null && Array.isArray(t), He = (t) => t != null && typeof t == "object" && !Array.isArray(t), zt = (t) => hn.some((e) => t instanceof e), dn = (t) => t.replace(/\s+/g, "-").replace(
33
33
  /([a-z0-9])([A-Z])/g,
34
34
  (e, r, n) => `${r}-${n.toLowerCase()}`
35
- ).toLowerCase(), gn = pt(dn), wo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
35
+ ).toLowerCase(), gn = pt(dn), xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
36
36
  __proto__: null,
37
37
  camelToSnake: Gt,
38
38
  capitalize: Ht,
@@ -71,7 +71,7 @@ const et = new pn(), tt = (t) => [...new Set(t)], mn = (t, e, r = !0) => {
71
71
  }
72
72
  n.set(i, s);
73
73
  }), Array.from(n.values());
74
- }, vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
74
+ }, $o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
75
75
  __proto__: null,
76
76
  by: mn,
77
77
  unique: tt
@@ -114,7 +114,7 @@ const yt = (t) => t != null && typeof t == "object" && "toString" in t, Jt = (t)
114
114
  default:
115
115
  return !1;
116
116
  }
117
- }, yn = (t) => !Jt(t), xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
117
+ }, yn = (t) => !Jt(t), No = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
118
118
  __proto__: null,
119
119
  ValueExtension: _,
120
120
  isNonZero: yn,
@@ -157,7 +157,7 @@ const yt = (t) => t != null && typeof t == "object" && "toString" in t, Jt = (t)
157
157
  }, On = (t, e) => {
158
158
  const r = tt(t), n = tt(e);
159
159
  return Xt(r, n);
160
- }, vn = (t, e) => t === e ? 0 : t === "first" && e === "last" ? 1 : -1, Kt = (t) => (e, r) => t(r, e), ne = 0, Ie = -1, Me = 1, Qt = (t) => t < ne, _t = (t) => t > ne, Tn = (t) => t >= ne, er = (t) => t === ne, xn = (t, e) => {
160
+ }, vn = (t, e) => t === e ? 0 : t === "first" && e === "last" ? 1 : -1, Kt = (t) => (e, r) => t(r, e), ne = 0, Ie = -1, Me = 1, Qt = (t) => t < ne, _t = (t) => t > ne, xn = (t) => t >= ne, er = (t) => t === ne, Tn = (t, e) => {
161
161
  const r = /([a-zA-Z]+)|(\d+)/g, n = t.replace(/[\s_.-]+/g, "").match(r), s = e.replace(/[\s_.-]+/g, "").match(r);
162
162
  if (!n || !s) return 0;
163
163
  for (let i = 0; i < Math.min(n.length, s.length); i++) {
@@ -171,21 +171,21 @@ const yt = (t) => t != null && typeof t == "object" && "toString" in t, Jt = (t)
171
171
  } else return isNaN(Number(o)) ? -1 : 1;
172
172
  }
173
173
  return n.length - s.length;
174
- }, $o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
174
+ }, Io = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
175
175
  __proto__: null,
176
176
  EQUAL: ne,
177
177
  GREATER_THAN: Me,
178
178
  LESS_THAN: Ie,
179
179
  isEqualTo: er,
180
180
  isGreaterThan: _t,
181
- isGreaterThanEqual: Tn,
181
+ isGreaterThanEqual: xn,
182
182
  isLessThan: Qt,
183
183
  newF: De,
184
184
  newFieldF: bn,
185
185
  order: vn,
186
186
  primitiveArrays: wn,
187
187
  reverseF: Kt,
188
- stringsWithNumbers: xn,
188
+ stringsWithNumbers: Tn,
189
189
  uniqueUnorderedPrimitiveArrays: On,
190
190
  unorderedPrimitiveArrays: Xt
191
191
  }, Symbol.toStringTag, { value: "Module" })), Pe = a.tuple([a.number(), a.number()]);
@@ -197,14 +197,17 @@ const bt = a.object({ width: a.number(), height: a.number() }), $n = a.object({
197
197
  a.enum(Sn);
198
198
  const Nn = ["start", "center", "end"], In = ["signedWidth", "signedHeight"];
199
199
  a.enum(In);
200
- const ge = a.object({ x: a.number(), y: a.number() }), tr = a.object({ clientX: a.number(), clientY: a.number() }), qe = ["x", "y"], wt = a.enum(qe), rr = ["top", "right", "bottom", "left"], Mn = a.enum(rr), ke = ["left", "right"], Ot = a.enum(ke), ze = ["top", "bottom"], vt = a.enum(ze), Tt = ["center"], rt = a.enum(Tt), En = [...rr, ...Tt], xt = a.enum(En);
200
+ const ge = a.object({ x: a.number(), y: a.number() }), tr = a.object({ clientX: a.number(), clientY: a.number() }), qe = ["x", "y"], wt = a.enum(qe), rr = ["top", "right", "bottom", "left"], Mn = a.enum(rr), ke = ["left", "right"], Ot = a.enum(ke), ze = ["top", "bottom"], vt = a.enum(ze), xt = ["center"], rt = a.enum(xt), En = [...rr, ...xt], Tt = a.enum(En);
201
201
  a.enum(Nn);
202
202
  const An = ["first", "last"];
203
203
  a.enum(An);
204
204
  const nr = a.object({ lower: a.number(), upper: a.number() }), Bn = a.object({ lower: a.bigint(), upper: a.bigint() });
205
205
  a.union([nr, Pe]);
206
206
  a.union([Bn, Pe]);
207
- const Un = a.enum([...wt.options, ...xt.options]), Cn = a.union([wt, xt, a.instanceof(String)]), se = (t) => (e, r) => {
207
+ const Un = a.enum([...wt.options, ...Tt.options]);
208
+ a.enum(["x", "left", "right"]);
209
+ a.enum(["y", "top", "bottom"]);
210
+ const Cn = a.union([wt, Tt, a.instanceof(String)]), se = (t) => (e, r) => {
208
211
  if (typeof e == "bigint") {
209
212
  if (je(r))
210
213
  return t(e, BigInt(r));
@@ -212,13 +215,13 @@ const Un = a.enum([...wt.options, ...xt.options]), Cn = a.union([wt, xt, a.insta
212
215
  return typeof n == "number" ? BigInt(Math.round(n)) : n;
213
216
  }
214
217
  return t(Number(e), Number(r));
215
- }, P = se((t, e) => t - e), ie = se((t, e) => t + e), jn = (t, e, r = 1e-4) => Math.abs(t - e) < r, nt = (t, e) => {
218
+ }, q = se((t, e) => t - e), ie = se((t, e) => t + e), jn = (t, e, r = 1e-4) => Math.abs(t - e) < r, nt = (t, e) => {
216
219
  const r = typeof t == "bigint", n = typeof e == "bigint";
217
220
  return r && n ? t === e : r && je(e) ? t === BigInt(e) : n && je(t) ? e === BigInt(t) : t === e;
218
221
  }, Rn = (t) => {
219
222
  const e = 10 ** Math.floor(Math.log10(t));
220
223
  return Math.round(t / e) * e;
221
- }, sr = se((t, e) => t <= e ? t : e), je = (t) => typeof t == "bigint" ? !0 : Number.isInteger(t), Ln = se((t, e) => t >= e ? t : e), ir = (t) => typeof t == "bigint" ? t < 0n ? -t : t : t < 0 ? -t : t, B = se((t, e) => t * e), we = se((t, e) => t / e), y = (t, e, r) => {
224
+ }, sr = se((t, e) => t <= e ? t : e), je = (t) => typeof t == "bigint" ? !0 : Number.isInteger(t), Ln = se((t, e) => t >= e ? t : e), ir = (t) => typeof t == "bigint" ? t < 0n ? -t : t : t < 0 ? -t : t, U = se((t, e) => t * e), we = se((t, e) => t / e), b = (t, e, r) => {
222
225
  const n = {};
223
226
  if (typeof e == "object" && (r = e, e = void 0), r = { makeValid: !0, ...r }, typeof t == "number" || typeof t == "bigint")
224
227
  e != null ? (n.lower = t, n.upper = e) : (n.lower = typeof t == "bigint" ? 0n : 0, n.upper = t);
@@ -231,56 +234,56 @@ const Un = a.enum([...wt.options, ...xt.options]), Cn = a.union([wt, xt, a.insta
231
234
  }, Dn = Object.freeze({ lower: 0, upper: 0 }), Pn = Object.freeze({ lower: -1 / 0, upper: 1 / 0 }), qn = Object.freeze({ lower: 0, upper: 1 }), kn = Object.freeze({ lower: -1, upper: 1 }), zn = (t, e) => {
232
235
  if (t == null && e == null) return !0;
233
236
  if (t == null || e == null) return !1;
234
- const r = y(t), n = y(e);
237
+ const r = b(t), n = b(e);
235
238
  return r?.lower === n?.lower && r?.upper === n?.upper;
236
239
  }, ar = (t) => t.lower > t.upper ? { lower: t.upper, upper: t.lower } : t, st = (t, e) => {
237
- const r = y(t);
240
+ const r = b(t);
238
241
  return e < r.lower ? r.lower : e >= r.upper ? r.upper - (typeof r.upper == "number" ? 1 : 1n) : e;
239
- }, U = (t, e) => {
240
- const r = y(t);
242
+ }, C = (t, e) => {
243
+ const r = b(t);
241
244
  if (typeof e == "number" || typeof e == "bigint")
242
245
  return e >= r.lower && e < r.upper;
243
- const n = y(e);
246
+ const n = b(e);
244
247
  return n.lower >= r.lower && n.upper <= r.upper;
245
- }, Fn = (t, e) => {
246
- const r = y(t), n = y(e);
247
- return r.lower === n.lower ? !0 : n.upper === r.lower || n.lower === r.upper ? !1 : U(r, n.upper) || U(r, n.lower) || U(n, r.upper) || U(n, r.lower);
248
+ }, Zn = (t, e) => {
249
+ const r = b(t), n = b(e);
250
+ return r.lower === n.lower ? !0 : n.upper === r.lower || n.lower === r.upper ? !1 : C(r, n.upper) || C(r, n.lower) || C(n, r.upper) || C(n, r.lower);
248
251
  }, Oe = (t) => {
249
- const e = y(t);
252
+ const e = b(t);
250
253
  return e.upper - e.lower;
251
- }, Zn = (t) => {
252
- const e = y(t);
254
+ }, Fn = (t) => {
255
+ const e = b(t);
253
256
  return typeof e.lower == "bigint" ? e.lower === 0n && e.upper === 0n : e.lower === 0 && e.upper === 0;
254
257
  }, Yn = (t) => {
255
258
  const e = Oe(t);
256
259
  return typeof e == "number" ? e === 0 : e === 0n;
257
260
  }, Wn = (t) => {
258
- const e = y(t);
261
+ const e = b(t);
259
262
  return typeof e.lower == "bigint" ? !0 : Number.isFinite(e.lower) && Number.isFinite(e.upper);
260
263
  }, Vn = (t) => {
261
- const e = y(t);
264
+ const e = b(t);
262
265
  return (e.upper + e.lower) / 2;
263
266
  }, or = (t) => ({
264
- lower: Math.min(...t.map((e) => y(e).lower)),
265
- upper: Math.max(...t.map((e) => y(e).upper))
267
+ lower: Math.min(...t.map((e) => b(e).lower)),
268
+ upper: Math.max(...t.map((e) => b(e).upper))
266
269
  }), Gn = (t) => ({
267
- lower: Math.max(...t.map((e) => y(e).lower)),
268
- upper: Math.min(...t.map((e) => y(e).upper))
270
+ lower: Math.max(...t.map((e) => b(e).lower)),
271
+ upper: Math.min(...t.map((e) => b(e).upper))
269
272
  }), Hn = (t) => {
270
- const e = y(t), r = typeof e.lower == "bigint";
273
+ const e = b(t), r = typeof e.lower == "bigint";
271
274
  return Array.from({ length: Number(Oe(t)) }, (n, s) => r ? e.lower + BigInt(s) : e.lower + s);
272
275
  }, it = (t, e) => {
273
- const r = t.map((i) => y(i)), n = r.findIndex((i) => U(i, e) || e < i.lower);
276
+ const r = t.map((i) => b(i)), n = r.findIndex((i) => C(i, e) || e < i.lower);
274
277
  if (n === -1) return { index: t.length, position: 0 };
275
278
  const s = r[n];
276
- return U(s, e) ? { index: n, position: Number(e - s.lower) } : { index: n, position: 0 };
279
+ return C(s, e) ? { index: n, position: Number(e - s.lower) } : { index: n, position: 0 };
277
280
  }, Je = {
278
281
  removeBefore: 0,
279
282
  removeAfter: 0,
280
283
  insertInto: 0,
281
284
  deleteInBetween: 0
282
285
  }, Jn = (t, e) => {
283
- const r = t.map((l) => y(l)), n = y(e);
286
+ const r = t.map((l) => b(l)), n = b(e);
284
287
  if (r.length === 0) return Je;
285
288
  const s = it(r, n.lower), i = it(r, n.upper);
286
289
  if (s.index === t.length) return { ...Je, insertInto: t.length };
@@ -292,7 +295,7 @@ const Un = a.enum([...wt.options, ...xt.options]), Cn = a.union([wt, xt, a.insta
292
295
  insertInto: s.index,
293
296
  deleteInBetween: 0
294
297
  };
295
- let o = i.index - s.index, c = s.index, h = P(Number(Oe(r[s.index])), s.position);
298
+ let o = i.index - s.index, c = s.index, h = q(Number(Oe(r[s.index])), s.position);
296
299
  return s.position !== 0 ? (o -= 1, c += 1) : h = 0, {
297
300
  removeBefore: h,
298
301
  removeAfter: i.position,
@@ -300,7 +303,7 @@ const Un = a.enum([...wt.options, ...xt.options]), Cn = a.union([wt, xt, a.insta
300
303
  deleteInBetween: o
301
304
  };
302
305
  }, ur = (t, e, r) => {
303
- const n = t.map((c) => y(c)), s = r > 0 ? 1 : r < 0 ? -1 : 0;
306
+ const n = t.map((c) => b(c)), s = r > 0 ? 1 : r < 0 ? -1 : 0;
304
307
  if (s === 0) return e;
305
308
  let i = r, o = e;
306
309
  for (; nt(i, 0) === !1; ) {
@@ -308,12 +311,12 @@ const Un = a.enum([...wt.options, ...xt.options]), Cn = a.union([wt, xt, a.insta
308
311
  if (c !== -1) {
309
312
  const h = n[c];
310
313
  let l;
311
- if (s > 0 ? l = P(h.upper, o) : l = P(o, h.lower), l > 0) {
314
+ if (s > 0 ? l = q(h.upper, o) : l = q(o, h.lower), l > 0) {
312
315
  const d = sr(ir(i), l);
313
316
  if (o = ie(
314
317
  o,
315
318
  s > 0 ? d : -d
316
- ), i = P(i, s > 0 ? d : -d), nt(i, 0)) return o;
319
+ ), i = q(i, s > 0 ? d : -d), nt(i, 0)) return o;
317
320
  continue;
318
321
  }
319
322
  }
@@ -330,9 +333,9 @@ const Un = a.enum([...wt.options, ...xt.options]), Cn = a.union([wt, xt, a.insta
330
333
  }
331
334
  return o;
332
335
  }, lr = (t, e, r) => {
333
- const n = t.map((o) => y(o));
336
+ const n = t.map((o) => b(o));
334
337
  if (e === r) return typeof e == "bigint" ? 0n : 0;
335
- const s = e < r ? y([e, r]) : y([r, e]);
338
+ const s = e < r ? b([e, r]) : b([r, e]);
336
339
  let i = typeof e == "bigint" ? 0n : 0;
337
340
  for (const o of n) {
338
341
  const c = o.lower > s.lower ? o.lower : s.lower, h = o.upper < s.upper ? o.upper : s.upper;
@@ -342,7 +345,7 @@ const Un = a.enum([...wt.options, ...xt.options]), Cn = a.union([wt, xt, a.insta
342
345
  }
343
346
  }
344
347
  return i;
345
- }, So = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
348
+ }, Mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
346
349
  __proto__: null,
347
350
  CLIP: kn,
348
351
  DECIMAL: qn,
@@ -351,109 +354,111 @@ const Un = a.enum([...wt.options, ...xt.options]), Cn = a.union([wt, xt, a.insta
351
354
  bounds: nr,
352
355
  buildInsertionPlan: Jn,
353
356
  clamp: st,
354
- construct: y,
355
- contains: U,
357
+ construct: b,
358
+ contains: C,
356
359
  distance: lr,
357
360
  equals: zn,
358
361
  findInsertPosition: it,
359
362
  isFinite: Wn,
360
- isZero: Zn,
363
+ isZero: Fn,
361
364
  linspace: Hn,
362
365
  makeValid: ar,
363
366
  max: or,
364
367
  mean: Vn,
365
368
  min: Gn,
366
- overlapsWith: Fn,
369
+ overlapsWith: Zn,
367
370
  span: Oe,
368
371
  spanIsZero: Yn,
369
372
  traverse: ur
370
- }, Symbol.toStringTag, { value: "Module" })), cr = Un, H = (t) => qe.includes(t) ? t : ze.includes(t) ? "y" : "x", Xn = (t) => H(t) === "x" ? "y" : "x", Kn = (t) => H(t) === "x" ? "width" : "height", Qn = (t) => H(t) === "x" ? "left" : "top", _n = (t) => cr.safeParse(t).success, es = (t) => H(t) === "x" ? "signedWidth" : "signedHeight", ts = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
373
+ }, Symbol.toStringTag, { value: "Module" })), cr = Un, P = (t) => qe.includes(t) ? t : ze.includes(t) ? "y" : "x", Xn = (t) => P(t) === "x" ? "y" : "x", Kn = (t) => P(t) === "x" ? "width" : "height", Qn = (t) => P(t) === "x" ? "left" : "top", _n = (t) => cr.safeParse(t).success, es = (t) => P(t) === "x" ? "signedWidth" : "signedHeight", ts = (t) => t === "center" ? !1 : P(t) === "x", rs = (t) => P(t) === "y", ns = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
371
374
  __proto__: null,
372
375
  DIRECTIONS: qe,
373
- construct: H,
376
+ construct: P,
374
377
  crude: cr,
375
378
  dimension: Kn,
376
379
  direction: wt,
377
380
  isDirection: _n,
381
+ isX: ts,
382
+ isY: rs,
378
383
  location: Qn,
379
384
  signedDimension: es,
380
385
  swap: Xn
381
- }, Symbol.toStringTag, { value: "Module" })), rs = Ot, ns = vt, ss = rt, is = {
386
+ }, Symbol.toStringTag, { value: "Module" })), ss = Ot, is = vt, as = rt, os = {
382
387
  top: "bottom",
383
388
  right: "left",
384
389
  bottom: "top",
385
390
  left: "right",
386
391
  center: "center"
387
- }, as = {
392
+ }, us = {
388
393
  top: "left",
389
394
  right: "top",
390
395
  bottom: "right",
391
396
  left: "bottom",
392
397
  center: "center"
393
- }, os = Cn, W = (t) => t instanceof String || !qe.includes(t) ? t : t === "x" ? "left" : "top", us = (t) => is[W(t)], ls = (t) => as[W(t)], pe = (t) => {
394
- const e = W(t);
398
+ }, ls = Cn, V = (t) => t instanceof String || !qe.includes(t) ? t : t === "x" ? "left" : "top", cs = (t) => os[V(t)], hs = (t) => us[V(t)], pe = (t) => {
399
+ const e = V(t);
395
400
  return e === "top" || e === "bottom" ? "y" : "x";
396
- }, cs = a.object({
401
+ }, fs = a.object({
397
402
  x: Ot.or(rt),
398
403
  y: vt.or(rt)
399
- }), hr = a.object({ x: Ot, y: vt }), ve = Object.freeze({ x: "left", y: "top" }), $t = Object.freeze({ x: "right", y: "top" }), Fe = Object.freeze({ x: "left", y: "bottom" }), St = Object.freeze({ x: "right", y: "bottom" }), Nt = Object.freeze({ x: "center", y: "center" }), It = Object.freeze({ x: "center", y: "top" }), Mt = Object.freeze({ x: "center", y: "bottom" }), Et = Object.freeze({ x: "right", y: "center" }), At = Object.freeze({ x: "left", y: "center" }), hs = Object.freeze([
404
+ }), hr = a.object({ x: Ot, y: vt }), ve = Object.freeze({ x: "left", y: "top" }), $t = Object.freeze({ x: "right", y: "top" }), Ze = Object.freeze({ x: "left", y: "bottom" }), St = Object.freeze({ x: "right", y: "bottom" }), Nt = Object.freeze({ x: "center", y: "center" }), It = Object.freeze({ x: "center", y: "top" }), Mt = Object.freeze({ x: "center", y: "bottom" }), Et = Object.freeze({ x: "right", y: "center" }), At = Object.freeze({ x: "left", y: "center" }), ds = Object.freeze([
400
405
  At,
401
406
  Et,
402
407
  It,
403
408
  Mt,
404
409
  ve,
405
410
  $t,
406
- Fe,
411
+ Ze,
407
412
  St,
408
413
  Nt
409
- ]), Bt = (t, e) => t.x === e.x && t.y === e.y, fs = (t, e) => {
414
+ ]), Bt = (t, e) => t.x === e.x && t.y === e.y, gs = (t, e) => {
410
415
  if (typeof e == "object") {
411
416
  let r = !0;
412
417
  return "x" in e && (t.x === e.x || (r = !1)), "y" in e && (t.y === e.y || (r = !1)), r;
413
418
  }
414
419
  return t.x === e || t.y === e;
415
- }, fr = (t) => [t.x, t.y], Ee = (t) => pe(W(t)) === "x", ds = (t) => pe(W(t)) === "y", gs = (t) => `${t.x}${Ht(t.y)}`, ps = (t, e) => {
420
+ }, fr = (t) => [t.x, t.y], Ee = (t) => pe(V(t)) === "x", ps = (t) => pe(V(t)) === "y", ms = (t) => `${t.x}${Ht(t.y)}`, ys = (t, e) => {
416
421
  let r, n;
417
- if (typeof t == "object" && "x" in t ? (r = t.x, n = t.y) : (r = W(t), n = W(e ?? t)), pe(r) === pe(n) && r !== "center" && n !== "center")
422
+ if (typeof t == "object" && "x" in t ? (r = t.x, n = t.y) : (r = V(t), n = V(e ?? t)), pe(r) === pe(n) && r !== "center" && n !== "center")
418
423
  throw new Error(
419
424
  `[XYLocation] - encountered two locations with the same direction: ${r.toString()} - ${n.toString()}`
420
425
  );
421
426
  const s = { ...Nt };
422
427
  return r === "center" ? Ee(n) ? [s.x, s.y] = [n, r] : [s.x, s.y] = [r, n] : n === "center" ? Ee(r) ? [s.x, s.y] = [r, n] : [s.x, s.y] = [n, r] : Ee(r) ? [s.x, s.y] = [r, n] : [s.x, s.y] = [n, r], s;
423
- }, ms = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
428
+ }, bs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
424
429
  __proto__: null,
425
430
  BOTTOM_CENTER: Mt,
426
- BOTTOM_LEFT: Fe,
431
+ BOTTOM_LEFT: Ze,
427
432
  BOTTOM_RIGHT: St,
428
433
  CENTER: Nt,
429
434
  CENTER_LEFT: At,
430
- CENTER_LOCATIONS: Tt,
435
+ CENTER_LOCATIONS: xt,
431
436
  CENTER_RIGHT: Et,
432
437
  TOP_CENTER: It,
433
438
  TOP_LEFT: ve,
434
439
  TOP_RIGHT: $t,
435
- XY_LOCATIONS: hs,
440
+ XY_LOCATIONS: ds,
436
441
  X_LOCATIONS: ke,
437
442
  Y_LOCATIONS: ze,
438
- center: ss,
439
- construct: W,
440
- constructXY: ps,
443
+ center: as,
444
+ construct: V,
445
+ constructXY: ys,
441
446
  corner: hr,
442
- crude: os,
447
+ crude: ls,
443
448
  direction: pe,
444
449
  isX: Ee,
445
- isY: ds,
446
- location: xt,
450
+ isY: ps,
451
+ location: Tt,
447
452
  outer: Mn,
448
- rotate90: ls,
449
- swap: us,
450
- x: rs,
451
- xy: cs,
453
+ rotate90: hs,
454
+ swap: cs,
455
+ x: ss,
456
+ xy: fs,
452
457
  xyCouple: fr,
453
458
  xyEquals: Bt,
454
- xyMatches: fs,
455
- xyToString: gs,
456
- y: ns
459
+ xyMatches: gs,
460
+ xyToString: ms,
461
+ y: is
457
462
  }, Symbol.toStringTag, { value: "Module" })), at = a.union([
458
463
  a.number(),
459
464
  ge,
@@ -461,64 +466,74 @@ const Un = a.enum([...wt.options, ...xt.options]), Cn = a.union([wt, xt, a.insta
461
466
  bt,
462
467
  $n,
463
468
  tr
464
- ]), x = (t, e) => {
469
+ ]), v = (t, e) => {
465
470
  if (typeof t == "string") {
466
471
  if (e === void 0) throw new Error("The y coordinate must be given.");
467
472
  return t === "x" ? { x: e, y: 0 } : { x: 0, y: e };
468
473
  }
469
474
  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 };
470
- }, D = Object.freeze({ x: 0, y: 0 }), dr = Object.freeze({ x: 1, y: 1 }), ys = Object.freeze({ x: 1 / 0, y: 1 / 0 }), bs = Object.freeze({ x: NaN, y: NaN }), Re = (t, e, r = 0) => {
471
- const n = x(t), s = x(e);
475
+ }, D = Object.freeze({ x: 0, y: 0 }), dr = Object.freeze({ x: 1, y: 1 }), ws = Object.freeze({ x: 1 / 0, y: 1 / 0 }), Os = Object.freeze({ x: NaN, y: NaN }), Re = (t, e, r = 0) => {
476
+ const n = v(t), s = v(e);
472
477
  return r === 0 ? n.x === s.x && n.y === s.y : Math.abs(n.x - s.x) <= r && Math.abs(n.y - s.y) <= r;
473
- }, ws = (t) => Re(t, D), Ut = (t, e, r) => {
474
- const n = x(t), s = x(e, r);
478
+ }, vs = (t) => Re(t, D), Ut = (t, e, r) => {
479
+ const n = v(t), s = v(e, r);
475
480
  return { x: n.x * s.x, y: n.y * s.y };
476
481
  }, gr = (t, e) => {
477
- const r = x(t);
482
+ const r = v(t);
478
483
  return { x: r.x + e, y: r.y };
479
484
  }, pr = (t, e) => {
480
- const r = x(t);
485
+ const r = v(t);
481
486
  return { x: r.x, y: r.y + e };
482
- }, me = (t, e, r, ...n) => typeof e == "string" && typeof r == "number" ? e === "x" ? gr(t, r) : pr(t, r) : [t, e, r ?? D, ...n].reduce((s, i) => {
483
- const o = x(i);
484
- return { x: s.x + o.x, y: s.y + o.y };
485
- }, D), Os = (t, e, r) => {
486
- const n = x(t);
487
+ }, me = (t, e, r, ...n) => {
488
+ if (typeof e == "string") {
489
+ if (typeof r != "number") throw new Error("The value must be a number.");
490
+ return e === "x" ? gr(t, r) : pr(t, r);
491
+ }
492
+ if (typeof e == "object" && "x" in e && typeof e.x == "string") {
493
+ const s = v(r), i = v(t);
494
+ return e.x === "left" ? s.x = -s.x : e.x === "center" && (s.x = 0), e.y === "top" ? s.y = -s.y : e.y === "center" && (s.y = 0), { x: i.x + s.x, y: i.y + s.y };
495
+ }
496
+ return [t, e, r ?? D, ...n].reduce((s, i) => {
497
+ const o = v(i);
498
+ return { x: s.x + o.x, y: s.y + o.y };
499
+ }, D);
500
+ }, xs = (t, e, r) => {
501
+ const n = v(t);
487
502
  return e === "x" ? { x: r, y: n.y } : { x: n.x, y: r };
488
- }, vs = (t, e) => {
489
- const r = x(t), n = x(e);
490
- return Math.sqrt((r.x - n.x) ** 2 + (r.y - n.y) ** 2);
491
503
  }, Ts = (t, e) => {
492
- const r = x(t), n = x(e);
504
+ const r = v(t), n = v(e);
505
+ return Math.sqrt((r.x - n.x) ** 2 + (r.y - n.y) ** 2);
506
+ }, $s = (t, e) => {
507
+ const r = v(t), n = v(e);
493
508
  return { x: n.x - r.x, y: n.y - r.y };
494
- }, xs = (t) => {
495
- const e = x(t);
509
+ }, Ss = (t) => {
510
+ const e = v(t);
496
511
  return Number.isNaN(e.x) || Number.isNaN(e.y);
497
- }, $s = (t) => {
498
- const e = x(t);
512
+ }, Ns = (t) => {
513
+ const e = v(t);
499
514
  return Number.isFinite(e.x) && Number.isFinite(e.y);
500
- }, Ss = (t) => {
501
- const e = x(t);
515
+ }, Is = (t) => {
516
+ const e = v(t);
502
517
  return [e.x, e.y];
503
- }, Ns = (t) => {
504
- const e = x(t);
518
+ }, Ms = (t) => {
519
+ const e = v(t);
505
520
  return { left: e.x, top: e.y };
506
521
  }, ot = (t, e = 0) => {
507
- const r = x(t);
522
+ const r = v(t);
508
523
  return { x: Number(r.x.toFixed(e)), y: Number(r.y.toFixed(e)) };
509
524
  }, oe = (t, e) => {
510
- const r = x(t), n = x(e);
525
+ const r = v(t), n = v(e);
511
526
  return { x: r.x - n.x, y: r.y - n.y };
512
527
  }, ue = (t) => {
513
- const e = x(t), r = Math.hypot(e.x, e.y);
528
+ const e = v(t), r = Math.hypot(e.x, e.y);
514
529
  return r === 0 ? { x: 0, y: 0 } : { x: -e.y / r, y: e.x / r };
515
530
  }, mr = (t) => {
516
- const e = x(t), r = Math.hypot(e.x, e.y);
531
+ const e = v(t), r = Math.hypot(e.x, e.y);
517
532
  return r === 0 ? { x: 0, y: 0 } : { x: e.x / r, y: e.y / r };
518
533
  }, yr = (...t) => {
519
534
  const e = t.reduce((r, n) => me(r, n), D);
520
535
  return Ut(e, 1 / t.length);
521
- }, Is = (t, e) => {
536
+ }, Es = (t, e) => {
522
537
  const r = [];
523
538
  for (let n = 0; n < t.length; n++) {
524
539
  const s = t[n];
@@ -532,66 +547,66 @@ const Un = a.enum([...wt.options, ...xt.options]), Cn = a.union([wt, xt, a.insta
532
547
  } else {
533
548
  const l = t[n - 1], d = t[n + 1], m = oe(s, l), p = oe(d, s);
534
549
  i = ue(m), o = ue(p);
535
- const j = Math.acos(
550
+ const R = Math.acos(
536
551
  (m.x * p.x + m.y * p.y) / (Math.hypot(m.x, m.y) * Math.hypot(p.x, p.y))
537
- ), A = Math.sin(j / 2);
552
+ ), A = Math.sin(R / 2);
538
553
  A === 0 ? h = e : h = e / A, c = mr(yr(i, o));
539
554
  }
540
555
  r.push(Ut(c, h));
541
556
  }
542
557
  return r;
543
- }, Ms = (t) => {
544
- const e = x(t);
558
+ }, As = (t) => {
559
+ const e = v(t);
545
560
  return { x: e.y, y: e.x };
546
561
  }, ut = (t) => {
547
- const e = x(t);
562
+ const e = v(t);
548
563
  return { x: Math.round(e.x), y: Math.round(e.y) };
549
- }, No = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
564
+ }, Eo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
550
565
  __proto__: null,
551
- INFINITY: ys,
552
- NAN: bs,
566
+ INFINITY: ws,
567
+ NAN: Os,
553
568
  ONE: dr,
554
569
  ZERO: D,
555
570
  average: yr,
556
- calculateMiters: Is,
571
+ calculateMiters: Es,
557
572
  clientXY: tr,
558
- construct: x,
559
- couple: Ss,
573
+ construct: v,
574
+ couple: Is,
560
575
  crudeZ: at,
561
- css: Ns,
562
- distance: vs,
576
+ css: Ms,
577
+ distance: Ts,
563
578
  equals: Re,
564
- isFinite: $s,
565
- isNan: xs,
566
- isZero: ws,
579
+ isFinite: Ns,
580
+ isNan: Ss,
581
+ isZero: vs,
567
582
  normal: ue,
568
583
  normalize: mr,
569
584
  round: ut,
570
585
  scale: Ut,
571
- set: Os,
586
+ set: xs,
572
587
  sub: oe,
573
- swap: Ms,
588
+ swap: As,
574
589
  translate: me,
575
590
  translateX: gr,
576
591
  translateY: pr,
577
- translation: Ts,
592
+ translation: $s,
578
593
  truncate: ot,
579
594
  xy: ge
580
- }, Symbol.toStringTag, { value: "Module" })), xe = a.union([a.number(), a.string()]), Es = a.object({
581
- top: xe,
582
- left: xe,
583
- width: xe,
584
- height: xe
585
- }), As = a.object({
595
+ }, Symbol.toStringTag, { value: "Module" })), Te = a.union([a.number(), a.string()]), Bs = a.object({
596
+ top: Te,
597
+ left: Te,
598
+ width: Te,
599
+ height: Te
600
+ }), Us = a.object({
586
601
  left: a.number(),
587
602
  top: a.number(),
588
603
  right: a.number(),
589
604
  bottom: a.number()
590
- }), Bs = a.object({
605
+ }), Cs = a.object({
591
606
  one: ge,
592
607
  two: ge,
593
608
  root: hr
594
- }), br = { one: D, two: D, root: ve }, Us = { one: D, two: dr, root: Fe }, wr = (t, e) => ({
609
+ }), br = { one: D, two: D, root: ve }, js = { one: D, two: dr, root: Ze }, wr = (t, e) => ({
595
610
  one: t.one,
596
611
  two: t.two,
597
612
  root: e ?? t.root
@@ -613,39 +628,39 @@ const Un = a.enum([...wt.options, ...xt.options]), Cn = a.union([wt, xt, a.insta
613
628
  x: i.one.x + e.signedWidth,
614
629
  y: i.one.y + e.signedHeight
615
630
  } : i.two = e, i));
616
- }, Cs = (t, e, r) => {
631
+ }, Rs = (t, e, r) => {
617
632
  const n = T(t);
618
633
  if (typeof e == "string") {
619
634
  if (r == null) throw new Error("Invalid arguments for resize");
620
- const s = H(e);
635
+ const s = P(e);
621
636
  return T(
622
637
  n.one,
623
638
  void 0,
624
- s === "x" ? r : V(n),
625
- s === "y" ? r : G(n),
639
+ s === "x" ? r : G(n),
640
+ s === "y" ? r : H(n),
626
641
  n.root
627
642
  );
628
643
  }
629
644
  return T(n.one, e, void 0, void 0, n.root);
630
- }, js = (t, e, r = !0) => {
645
+ }, Ls = (t, e, r = !0) => {
631
646
  const n = T(t);
632
647
  let s = (i, o) => i < o;
633
- return r && (s = (i, o) => i <= o), "one" in e ? s(Z(n), Z(e)) && s(X(e), X(n)) && s(Y(n), Y(e)) && s(K(e), K(n)) : s(Z(n), e.x) && s(e.x, X(n)) && s(Y(n), e.y) && s(e.y, K(n));
634
- }, Rs = (t, e) => Re(t.one, e.one) && Re(t.two, e.two) && Bt(t.root, e.root), Or = (t) => ({
635
- width: V(t),
636
- height: G(t)
637
- }), Ls = (t) => ({
638
- signedWidth: Ze(t),
648
+ return r && (s = (i, o) => i <= o), "one" in e ? s(Y(n), Y(e)) && s(X(e), X(n)) && s(W(n), W(e)) && s(K(e), K(n)) : s(Y(n), e.x) && s(e.x, X(n)) && s(W(n), e.y) && s(e.y, K(n));
649
+ }, Ds = (t, e) => Re(t.one, e.one) && Re(t.two, e.two) && Bt(t.root, e.root), Or = (t) => ({
650
+ width: G(t),
651
+ height: H(t)
652
+ }), Ps = (t) => ({
653
+ signedWidth: Fe(t),
639
654
  signedHeight: Ye(t)
640
- }), Ds = (t) => ({
641
- top: Y(t),
642
- left: Z(t),
643
- width: V(t),
644
- height: G(t)
655
+ }), qs = (t) => ({
656
+ top: W(t),
657
+ left: Y(t),
658
+ width: G(t),
659
+ height: H(t)
645
660
  }), Ct = (t, e, r = !1) => {
646
- const n = H(e) === "y" ? Ye(t) : Ze(t);
661
+ const n = P(e) === "y" ? Ye(t) : Fe(t);
647
662
  return r ? n : Math.abs(n);
648
- }, q = (t, e) => {
663
+ }, k = (t, e) => {
649
664
  const r = T(t);
650
665
  return {
651
666
  x: e.x === "center" ? lt(r).x : Q(r, e.x),
@@ -654,40 +669,40 @@ const Un = a.enum([...wt.options, ...xt.options]), Cn = a.union([wt, xt, a.insta
654
669
  }, Q = (t, e) => {
655
670
  const r = T(t), n = fr(r.root).includes(e) ? Math.min : Math.max;
656
671
  return ke.includes(e) ? n(r.one.x, r.two.x) : n(r.one.y, r.two.y);
657
- }, Ps = (t) => t.one.x === t.two.x && t.one.y === t.two.y, V = (t) => Ct(t, "x"), G = (t) => Ct(t, "y"), Ze = (t) => {
672
+ }, ks = (t) => t.one.x === t.two.x && t.one.y === t.two.y, G = (t) => Ct(t, "x"), H = (t) => Ct(t, "y"), Fe = (t) => {
658
673
  const e = T(t);
659
674
  return e.two.x - e.one.x;
660
675
  }, Ye = (t) => {
661
676
  const e = T(t);
662
677
  return e.two.y - e.one.y;
663
- }, vr = (t) => q(t, ve), qs = (t) => q(t, It), ks = (t) => q(t, $t), zs = (t) => q(t, Fe), Fs = (t) => q(t, Mt), Zs = (t) => q(t, St), Ys = (t) => q(t, At), Ws = (t) => q(t, Et), X = (t) => Q(t, "right"), K = (t) => Q(t, "bottom"), Z = (t) => Q(t, "left"), Y = (t) => Q(t, "top"), lt = (t) => me(vr(t), {
664
- x: Ze(t) / 2,
678
+ }, vr = (t) => k(t, ve), zs = (t) => k(t, It), Zs = (t) => k(t, $t), Fs = (t) => k(t, Ze), Ys = (t) => k(t, Mt), Ws = (t) => k(t, St), Vs = (t) => k(t, At), Gs = (t) => k(t, Et), X = (t) => Q(t, "right"), K = (t) => Q(t, "bottom"), Y = (t) => Q(t, "left"), W = (t) => Q(t, "top"), lt = (t) => me(vr(t), {
679
+ x: Fe(t) / 2,
665
680
  y: Ye(t) / 2
666
681
  }), jt = (t) => {
667
682
  const e = T(t);
668
- return e.root.x === "left" ? Z(e) : X(e);
683
+ return e.root.x === "left" ? Y(e) : X(e);
669
684
  }, Rt = (t) => {
670
685
  const e = T(t);
671
- return e.root.y === "top" ? Y(e) : K(e);
672
- }, Vs = (t) => ({ x: jt(t), y: Rt(t) }), Ae = (t) => {
686
+ return e.root.y === "top" ? W(e) : K(e);
687
+ }, Hs = (t) => ({ x: jt(t), y: Rt(t) }), Ae = (t) => {
673
688
  const e = T(t);
674
689
  return { lower: e.one.x, upper: e.two.x };
675
690
  }, Be = (t) => {
676
691
  const e = T(t);
677
692
  return { lower: e.one.y, upper: e.two.y };
678
- }, Gs = (t, e) => wr(t, e), Hs = (t, e) => {
693
+ }, Js = (t, e) => wr(t, e), Xs = (t, e) => {
679
694
  const r = T(t), n = ke.includes(e) ? "x" : ze.includes(e) ? "y" : null;
680
695
  if (n === null) throw new Error(`Invalid location: ${e}`);
681
696
  const s = e === "top" || e === "left" ? Math.min : Math.max, i = { ...r.one }, o = { ...r.two };
682
697
  return i[n] = s(r.one[n], r.two[n]), o[n] = s(r.one[n], r.two[n]), [i, o];
683
- }, Js = (t, e) => {
684
- const r = T(t), n = T(e), s = jt(n) + (V(n) - V(r)) / 2, i = Rt(n) + (G(n) - G(r)) / 2;
698
+ }, Ks = (t, e) => {
699
+ const r = T(t), n = T(e), s = jt(n) + (G(n) - G(r)) / 2, i = Rt(n) + (H(n) - H(r)) / 2;
685
700
  return T({ x: s, y: i }, Or(r));
686
- }, Tr = (t) => typeof t != "object" || t == null ? !1 : "one" in t && "two" in t && "root" in t, Xs = (t) => V(t) / G(t), Ks = (t, e, r) => {
701
+ }, xr = (t) => typeof t != "object" || t == null ? !1 : "one" in t && "two" in t && "root" in t, Qs = (t) => G(t) / H(t), _s = (t, e, r) => {
687
702
  if (typeof e == "string") {
688
703
  if (r == null) throw new Error("Undefined amount passed into box.translate");
689
- const s = H(e);
690
- e = x(s, r);
704
+ const s = P(e);
705
+ e = v(s, r);
691
706
  }
692
707
  const n = T(t);
693
708
  return T(
@@ -697,10 +712,10 @@ const Un = a.enum([...wt.options, ...xt.options]), Cn = a.union([wt, xt, a.insta
697
712
  void 0,
698
713
  n.root
699
714
  );
700
- }, Qs = (t, e) => {
701
- const r = Math.max(Z(t), Z(e)), n = Math.max(Y(t), Y(e)), s = Math.min(X(t), X(e)), i = Math.min(K(t), K(e));
715
+ }, ei = (t, e) => {
716
+ const r = Math.max(Y(t), Y(e)), n = Math.max(W(t), W(e)), s = Math.min(X(t), X(e)), i = Math.min(K(t), K(e));
702
717
  return r > s || n > i ? br : T({ x: r, y: n }, { x: s, y: i }, void 0, void 0, t.root);
703
- }, _s = (t) => V(t) * G(t), ei = (t, e) => {
718
+ }, ti = (t) => G(t) * H(t), ri = (t, e) => {
704
719
  const r = T(t);
705
720
  return T(
706
721
  ot(r.one, e),
@@ -709,121 +724,121 @@ const Un = a.enum([...wt.options, ...xt.options]), Cn = a.union([wt, xt, a.insta
709
724
  void 0,
710
725
  r.root
711
726
  );
712
- }, ti = (t, e, r, n, s, i) => {
727
+ }, ni = (t, e, r, n, s, i) => {
713
728
  const o = { x: t, y: e }, c = { x: t + r, y: e + n };
714
729
  return s.x !== i.x && (s.x === "center" ? (o.x -= r / 2, c.x -= r / 2) : (o.x -= r, c.x -= r)), s.y !== i.y && (s.y === "center" ? (o.y -= n / 2, c.y -= n / 2) : (o.y -= n, c.y -= n)), T(o, c, void 0, void 0, i);
715
- }, ri = (t) => {
730
+ }, si = (t) => {
716
731
  const e = T(t);
717
732
  return T(ut(e.one), ut(e.two), void 0, void 0, e.root);
718
- }, Io = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
733
+ }, Ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
719
734
  __proto__: null,
720
- DECIMAL: Us,
735
+ DECIMAL: js,
721
736
  ZERO: br,
722
- area: _s,
723
- areaIsZero: Ps,
724
- aspect: Xs,
737
+ area: ti,
738
+ areaIsZero: ks,
739
+ aspect: Qs,
725
740
  bottom: K,
726
- bottomCenter: Fs,
727
- bottomLeft: zs,
728
- bottomRight: Zs,
729
- box: Bs,
741
+ bottomCenter: Ys,
742
+ bottomLeft: Fs,
743
+ bottomRight: Ws,
744
+ box: Cs,
730
745
  center: lt,
731
- centerLeft: Ys,
732
- centerRight: Ws,
746
+ centerLeft: Vs,
747
+ centerRight: Gs,
733
748
  construct: T,
734
- constructWithAlternateRoot: ti,
735
- contains: js,
749
+ constructWithAlternateRoot: ni,
750
+ contains: Ls,
736
751
  copy: wr,
737
- css: Ds,
738
- cssBox: Es,
752
+ css: qs,
753
+ cssBox: Bs,
739
754
  dim: Ct,
740
755
  dims: Or,
741
- domRect: As,
742
- edgePoints: Hs,
743
- equals: Rs,
744
- height: G,
745
- intersection: Qs,
746
- isBox: Tr,
747
- left: Z,
756
+ domRect: Us,
757
+ edgePoints: Xs,
758
+ equals: Ds,
759
+ height: H,
760
+ intersection: ei,
761
+ isBox: xr,
762
+ left: Y,
748
763
  loc: Q,
749
- positionInCenter: Js,
750
- reRoot: Gs,
751
- resize: Cs,
764
+ positionInCenter: Ks,
765
+ reRoot: Js,
766
+ resize: Rs,
752
767
  right: X,
753
- root: Vs,
754
- round: ri,
755
- signedDims: Ls,
768
+ root: Hs,
769
+ round: si,
770
+ signedDims: Ps,
756
771
  signedHeight: Ye,
757
- signedWidth: Ze,
758
- top: Y,
759
- topCenter: qs,
772
+ signedWidth: Fe,
773
+ top: W,
774
+ topCenter: zs,
760
775
  topLeft: vr,
761
- topRight: ks,
762
- translate: Ks,
763
- truncate: ei,
764
- width: V,
776
+ topRight: Zs,
777
+ translate: _s,
778
+ truncate: ri,
779
+ width: G,
765
780
  x: jt,
766
781
  xBounds: Ae,
767
- xyLoc: q,
782
+ xyLoc: k,
768
783
  y: Rt,
769
784
  yBounds: Be
770
- }, Symbol.toStringTag, { value: "Module" })), xr = a.object({ signedWidth: a.number(), signedHeight: a.number() }), ni = a.union([bt, xr, ge, Pe]), si = { width: 0, height: 0 }, ii = { width: 1, height: 1 }, C = (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 }, ai = (t, e) => {
785
+ }, Symbol.toStringTag, { value: "Module" })), Tr = a.object({ signedWidth: a.number(), signedHeight: a.number() }), ii = a.union([bt, Tr, ge, Pe]), ai = { width: 0, height: 0 }, oi = { width: 1, height: 1 }, j = (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 }, ui = (t, e) => {
771
786
  if (e == null) return !1;
772
- const r = C(t), n = C(e);
787
+ const r = j(t), n = j(e);
773
788
  return r.width === n.width && r.height === n.height;
774
- }, oi = (t) => {
775
- const e = C(t);
789
+ }, li = (t) => {
790
+ const e = j(t);
776
791
  return { width: e.height, height: e.width };
777
- }, ui = (t) => {
778
- const e = C(t);
792
+ }, ci = (t) => {
793
+ const e = j(t);
779
794
  return `0 0 ${e.width} ${e.height}`;
780
- }, li = (t) => {
781
- const e = C(t);
795
+ }, hi = (t) => {
796
+ const e = j(t);
782
797
  return [e.width, e.height];
783
- }, ci = (t) => ({
784
- width: Math.max(...t.map((e) => C(e).width)),
785
- height: Math.max(...t.map((e) => C(e).height))
786
- }), hi = (t) => ({
787
- width: Math.min(...t.map((e) => C(e).width)),
788
- height: Math.min(...t.map((e) => C(e).height))
789
- }), fi = (t, e) => {
790
- const r = C(t);
798
+ }, fi = (t) => ({
799
+ width: Math.max(...t.map((e) => j(e).width)),
800
+ height: Math.max(...t.map((e) => j(e).height))
801
+ }), di = (t) => ({
802
+ width: Math.min(...t.map((e) => j(e).width)),
803
+ height: Math.min(...t.map((e) => j(e).height))
804
+ }), gi = (t, e) => {
805
+ const r = j(t);
791
806
  return { width: r.width * e, height: r.height * e };
792
- }, Mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
807
+ }, Bo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
793
808
  __proto__: null,
794
- DECIMAL: ii,
795
- ZERO: si,
796
- construct: C,
797
- couple: li,
798
- crude: ni,
809
+ DECIMAL: oi,
810
+ ZERO: ai,
811
+ construct: j,
812
+ couple: hi,
813
+ crude: ii,
799
814
  dimensions: bt,
800
- equals: ai,
801
- max: ci,
802
- min: hi,
803
- scale: fi,
804
- signed: xr,
805
- svgViewBox: ui,
806
- swap: oi
807
- }, Symbol.toStringTag, { value: "Module" })), di = (t, e, r) => e !== void 0 && t < e ? e : r !== void 0 && t > r ? r : t, gi = a.object({ offset: at, scale: at }), pi = a.object({ offset: a.number(), scale: a.number() }), mi = (t) => (e, r, n, s) => r === "dimension" ? [e, n] : [
815
+ equals: ui,
816
+ max: fi,
817
+ min: di,
818
+ scale: gi,
819
+ signed: Tr,
820
+ svgViewBox: ci,
821
+ swap: li
822
+ }, Symbol.toStringTag, { value: "Module" })), pi = (t, e, r) => e !== void 0 && t < e ? e : r !== void 0 && t > r ? r : t, mi = a.object({ offset: at, scale: at }), yi = a.object({ offset: a.number(), scale: a.number() }), bi = (t) => (e, r, n, s) => r === "dimension" ? [e, n] : [
808
823
  e,
809
824
  s ? n - t : n + t
810
- ], yi = (t) => (e, r, n, s) => [
825
+ ], wi = (t) => (e, r, n, s) => [
811
826
  e,
812
827
  s ? n / t : n * t
813
- ], bi = (t) => (e, r, n) => {
828
+ ], Oi = (t) => (e, r, n) => {
814
829
  if (e === null) return [t, n];
815
830
  const { lower: s, upper: i } = e, { lower: o, upper: c } = t, h = i - s, l = c - o;
816
831
  if (r === "dimension") return [t, n * (l / h)];
817
832
  const d = (n - s) * (l / h) + o;
818
833
  return [t, d];
819
- }, wi = (t) => (e, r, n) => [t, n], Oi = () => (t, e, r) => {
834
+ }, vi = (t) => (e, r, n) => [t, n], xi = () => (t, e, r) => {
820
835
  if (t === null) throw new Error("cannot invert without bounds");
821
836
  if (e === "dimension") return [t, r];
822
837
  const { lower: n, upper: s } = t;
823
838
  return [t, s - (r - n)];
824
- }, vi = (t) => (e, r, n) => {
839
+ }, Ti = (t) => (e, r, n) => {
825
840
  const { lower: s, upper: i } = t;
826
- return n = di(n, s, i), [e, n];
841
+ return n = pi(n, s, i), [e, n];
827
842
  };
828
843
  let ct = class te {
829
844
  ops = [];
@@ -859,7 +874,7 @@ let ct = class te {
859
874
  * @param value - The amount to translate by.
860
875
  */
861
876
  translate(e) {
862
- const r = this.new(), n = mi(e);
877
+ const r = this.new(), n = bi(e);
863
878
  return n.type = "translate", r.ops.push(n), r;
864
879
  }
865
880
  /**
@@ -869,23 +884,23 @@ let ct = class te {
869
884
  * @param value - The amount to magnify by.
870
885
  */
871
886
  magnify(e) {
872
- const r = this.new(), n = yi(e);
887
+ const r = this.new(), n = wi(e);
873
888
  return n.type = "magnify", r.ops.push(n), r;
874
889
  }
875
890
  scale(e, r) {
876
- const n = y(e, r), s = this.new(), i = bi(n);
891
+ const n = b(e, r), s = this.new(), i = Oi(n);
877
892
  return i.type = "scale", s.ops.push(i), s;
878
893
  }
879
894
  clamp(e, r) {
880
- const n = y(e, r), s = this.new(), i = vi(n);
895
+ const n = b(e, r), s = this.new(), i = Ti(n);
881
896
  return i.type = "clamp", s.ops.push(i), s;
882
897
  }
883
898
  reBound(e, r) {
884
- const n = y(e, r), s = this.new(), i = wi(n);
899
+ const n = b(e, r), s = this.new(), i = vi(n);
885
900
  return i.type = "re-bound", s.ops.push(i), s;
886
901
  }
887
902
  invert() {
888
- const e = Oi();
903
+ const e = xi();
889
904
  e.type = "invert";
890
905
  const r = this.new();
891
906
  return r.ops.push(e), r;
@@ -924,7 +939,7 @@ let ct = class te {
924
939
  return { scale: this.dim(1), offset: this.pos(0) };
925
940
  }
926
941
  static IDENTITY = new te();
927
- }, Ti = class R {
942
+ }, $i = class L {
928
943
  x;
929
944
  y;
930
945
  currRoot;
@@ -932,28 +947,28 @@ let ct = class te {
932
947
  this.x = e, this.y = r, this.currRoot = n;
933
948
  }
934
949
  static translate(e, r) {
935
- return new R().translate(e, r);
950
+ return new L().translate(e, r);
936
951
  }
937
952
  static translateX(e) {
938
- return new R().translateX(e);
953
+ return new L().translateX(e);
939
954
  }
940
955
  static translateY(e) {
941
- return new R().translateY(e);
956
+ return new L().translateY(e);
942
957
  }
943
958
  static clamp(e) {
944
- return new R().clamp(e);
959
+ return new L().clamp(e);
945
960
  }
946
961
  static magnify(e) {
947
- return new R().magnify(e);
962
+ return new L().magnify(e);
948
963
  }
949
964
  static scale(e) {
950
- return new R().scale(e);
965
+ return new L().scale(e);
951
966
  }
952
967
  static reBound(e) {
953
- return new R().reBound(e);
968
+ return new L().reBound(e);
954
969
  }
955
970
  translate(e, r) {
956
- const n = x(e, r), s = this.copy();
971
+ const n = v(e, r), s = this.copy();
957
972
  return s.x = this.x.translate(n.x), s.y = this.y.translate(n.y), s;
958
973
  }
959
974
  translateX(e) {
@@ -970,7 +985,7 @@ let ct = class te {
970
985
  }
971
986
  scale(e) {
972
987
  const r = this.copy();
973
- if (Tr(e)) {
988
+ if (xr(e)) {
974
989
  const n = this.currRoot;
975
990
  return r.currRoot = e.root, n != null && !Bt(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(Ae(e)), r.y = r.y.scale(Be(e)), r;
976
991
  }
@@ -985,7 +1000,7 @@ let ct = class te {
985
1000
  return r.x = this.x.clamp(Ae(e)), r.y = this.y.clamp(Be(e)), r;
986
1001
  }
987
1002
  copy() {
988
- const e = new R();
1003
+ const e = new L();
989
1004
  return e.currRoot = this.currRoot, e.x = this.x, e.y = this.y, e;
990
1005
  }
991
1006
  reverse() {
@@ -1013,14 +1028,14 @@ let ct = class te {
1013
1028
  offset: this.pos({ x: 0, y: 0 })
1014
1029
  };
1015
1030
  }
1016
- static IDENTITY = new R();
1031
+ static IDENTITY = new L();
1017
1032
  };
1018
- const Eo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1033
+ const Uo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1019
1034
  __proto__: null,
1020
1035
  Scale: ct,
1021
- XY: Ti,
1022
- crudeXYTransform: gi,
1023
- transform: pi
1036
+ XY: $i,
1037
+ crudeXYTransform: mi,
1038
+ transform: yi
1024
1039
  }, Symbol.toStringTag, { value: "Module" }));
1025
1040
  let $r = (t, e = 21) => (r = e) => {
1026
1041
  let n = "", s = r | 0;
@@ -1028,16 +1043,16 @@ let $r = (t, e = 21) => (r = e) => {
1028
1043
  n += t[Math.random() * t.length | 0];
1029
1044
  return n;
1030
1045
  };
1031
- const Sr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", xi = `0123456789${Sr}`, Nr = 11, $i = $r(Sr, 1), Si = $r(xi, Nr - 1), Lt = () => `${$i()}${Si()}`, Ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1046
+ const Sr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", Si = `0123456789${Sr}`, Nr = 11, Ni = $r(Sr, 1), Ii = $r(Si, Nr - 1), Lt = () => `${Ni()}${Ii()}`, Co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1032
1047
  __proto__: null,
1033
1048
  LENGTH: Nr,
1034
1049
  create: Lt
1035
- }, Symbol.toStringTag, { value: "Module" })), Ni = (t, e) => (r) => r instanceof e || typeof r == "object" && r !== null && "discriminator" in r && r.discriminator === t, Ii = a.enum(["static", "dynamic"]), Mi = a.union([
1050
+ }, Symbol.toStringTag, { value: "Module" })), Mi = (t, e) => (r) => r instanceof e || typeof r == "object" && r !== null && "discriminator" in r && r.discriminator === t, Ei = a.enum(["static", "dynamic"]), Ai = a.union([
1036
1051
  a.tuple([a.int()]),
1037
1052
  a.tuple([a.int(), a.int().min(1).max(12)]),
1038
1053
  a.tuple([a.int(), a.int().min(1).max(12), a.int().min(1).max(31)])
1039
1054
  ]), Ir = (t, e) => {
1040
- const r = new b(e);
1055
+ const r = new y(e);
1041
1056
  if (![
1042
1057
  O.DAY,
1043
1058
  O.HOUR,
@@ -1051,9 +1066,9 @@ const Sr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", xi = `0123456
1051
1066
  "Invalid argument for remainder. Must be an even TimeSpan or Timestamp"
1052
1067
  );
1053
1068
  const n = t.valueOf() % r.valueOf();
1054
- return t instanceof b ? new b(n) : new O(n);
1069
+ return t instanceof y ? new y(n) : new O(n);
1055
1070
  };
1056
- let b = class f extends _ {
1071
+ let y = class f extends _ {
1057
1072
  constructor(e, r = "UTC") {
1058
1073
  if (e == null) super(f.now().valueOf());
1059
1074
  else if (e instanceof Date)
@@ -1255,7 +1270,7 @@ let b = class f extends _ {
1255
1270
  * TimeSpan.
1256
1271
  */
1257
1272
  sub(e) {
1258
- return new f(P(this.valueOf(), new O(e).valueOf()));
1273
+ return new f(q(this.valueOf(), new O(e).valueOf()));
1259
1274
  }
1260
1275
  /**
1261
1276
  * @returns the floating point number of hours since the unix epoch to the timestamp
@@ -1522,7 +1537,7 @@ let b = class f extends _ {
1522
1537
  a.bigint().transform((e) => new f(e)),
1523
1538
  a.date().transform((e) => new f(e)),
1524
1539
  a.custom((e) => e instanceof O).transform((e) => new f(e)),
1525
- Mi.transform((e) => new f(e))
1540
+ Ai.transform((e) => new f(e))
1526
1541
  ]);
1527
1542
  /**
1528
1543
  * Sorts two timestamps.
@@ -1546,7 +1561,7 @@ let b = class f extends _ {
1546
1561
  * @returns A TimeSpan representing the given number of seconds.
1547
1562
  */
1548
1563
  static fromSeconds(e) {
1549
- return e instanceof g ? e : e instanceof E ? e.period : e instanceof b ? new g(e) : ["number", "bigint"].includes(typeof e) ? g.seconds(e) : new g(e);
1564
+ return e instanceof g ? e : e instanceof E ? e.period : e instanceof y ? new g(e) : ["number", "bigint"].includes(typeof e) ? g.seconds(e) : new g(e);
1550
1565
  }
1551
1566
  /**
1552
1567
  * Creates a TimeSpan representing the given number of milliseconds.
@@ -1555,7 +1570,7 @@ let b = class f extends _ {
1555
1570
  * @returns A TimeSpan representing the given number of milliseconds.
1556
1571
  */
1557
1572
  static fromMilliseconds(e) {
1558
- return e instanceof g ? e : e instanceof E ? e.period : e instanceof b ? new g(e) : ["number", "bigint"].includes(typeof e) ? g.milliseconds(e) : new g(e);
1573
+ return e instanceof g ? e : e instanceof E ? e.period : e instanceof y ? new g(e) : ["number", "bigint"].includes(typeof e) ? g.milliseconds(e) : new g(e);
1559
1574
  }
1560
1575
  /**
1561
1576
  * @returns the primitive value of the TimeSpan. Overrides standard JS valueOf()
@@ -1626,9 +1641,9 @@ let b = class f extends _ {
1626
1641
  * @returns A string representation of the TimeSpan.
1627
1642
  */
1628
1643
  toString() {
1629
- const e = this.truncate(g.DAY), r = this.truncate(g.HOUR), n = this.truncate(g.MINUTE), s = this.truncate(g.SECOND), i = this.truncate(g.MILLISECOND), o = this.truncate(g.MICROSECOND), c = this.truncate(g.NANOSECOND), h = e, l = r.sub(e), d = n.sub(r), m = s.sub(n), p = i.sub(s), j = o.sub(i), A = c.sub(o);
1630
- let k = "";
1631
- return h.isZero || (k += `${h.days}d `), l.isZero || (k += `${l.hours}h `), d.isZero || (k += `${d.minutes}m `), m.isZero || (k += `${m.seconds}s `), p.isZero || (k += `${p.milliseconds}ms `), j.isZero || (k += `${j.microseconds}µs `), A.isZero || (k += `${A.nanoseconds}ns`), k.trim();
1644
+ const e = this.truncate(g.DAY), r = this.truncate(g.HOUR), n = this.truncate(g.MINUTE), s = this.truncate(g.SECOND), i = this.truncate(g.MILLISECOND), o = this.truncate(g.MICROSECOND), c = this.truncate(g.NANOSECOND), h = e, l = r.sub(e), d = n.sub(r), m = s.sub(n), p = i.sub(s), R = o.sub(i), A = c.sub(o);
1645
+ let z = "";
1646
+ return h.isZero || (z += `${h.days}d `), l.isZero || (z += `${l.hours}h `), d.isZero || (z += `${d.minutes}m `), m.isZero || (z += `${m.seconds}s `), p.isZero || (z += `${p.milliseconds}ms `), R.isZero || (z += `${R.microseconds}µs `), A.isZero || (z += `${A.nanoseconds}ns`), z.trim();
1632
1647
  }
1633
1648
  /**
1634
1649
  * Multiplies the TimeSpan by a scalar value.
@@ -1637,7 +1652,7 @@ let b = class f extends _ {
1637
1652
  * @returns A new TimeSpan that is this TimeSpan multiplied by the provided value.
1638
1653
  */
1639
1654
  mult(e) {
1640
- return new g(B(this.valueOf(), e));
1655
+ return new g(U(this.valueOf(), e));
1641
1656
  }
1642
1657
  /**
1643
1658
  * Divides the TimeSpan by a scalar value.
@@ -1726,7 +1741,7 @@ let b = class f extends _ {
1726
1741
  * @returns A TimeSpan representing the given number of microseconds.
1727
1742
  */
1728
1743
  static microseconds(e = 1) {
1729
- return g.nanoseconds(B(e, 1e3));
1744
+ return g.nanoseconds(U(e, 1e3));
1730
1745
  }
1731
1746
  /** A microsecond. */
1732
1747
  static MICROSECOND = g.microseconds(1);
@@ -1737,7 +1752,7 @@ let b = class f extends _ {
1737
1752
  * @returns A TimeSpan representing the given number of milliseconds.
1738
1753
  */
1739
1754
  static milliseconds(e = 1) {
1740
- return g.microseconds(B(e, 1e3));
1755
+ return g.microseconds(U(e, 1e3));
1741
1756
  }
1742
1757
  /** A millisecond. */
1743
1758
  static MILLISECOND = g.milliseconds(1);
@@ -1748,7 +1763,7 @@ let b = class f extends _ {
1748
1763
  * @returns A TimeSpan representing the given number of seconds.
1749
1764
  */
1750
1765
  static seconds(e = 1) {
1751
- return g.milliseconds(B(e, 1e3));
1766
+ return g.milliseconds(U(e, 1e3));
1752
1767
  }
1753
1768
  /** A second. */
1754
1769
  static SECOND = g.seconds(1);
@@ -1759,7 +1774,7 @@ let b = class f extends _ {
1759
1774
  * @returns A TimeSpan representing the given number of minutes.
1760
1775
  */
1761
1776
  static minutes(e = 1) {
1762
- return g.seconds(B(e, 60));
1777
+ return g.seconds(U(e, 60));
1763
1778
  }
1764
1779
  /** A minute. */
1765
1780
  static MINUTE = g.minutes(1);
@@ -1770,7 +1785,7 @@ let b = class f extends _ {
1770
1785
  * @returns A TimeSpan representing the given number of hours.
1771
1786
  */
1772
1787
  static hours(e) {
1773
- return g.minutes(B(e, 60));
1788
+ return g.minutes(U(e, 60));
1774
1789
  }
1775
1790
  /** Represents an hour. */
1776
1791
  static HOUR = g.hours(1);
@@ -1781,7 +1796,7 @@ let b = class f extends _ {
1781
1796
  * @returns A TimeSpan representing the given number of days.
1782
1797
  */
1783
1798
  static days(e) {
1784
- return g.hours(B(e, 24));
1799
+ return g.hours(U(e, 24));
1785
1800
  }
1786
1801
  /** Represents a day. */
1787
1802
  static DAY = g.days(1);
@@ -1798,7 +1813,7 @@ let b = class f extends _ {
1798
1813
  a.number().transform((e) => new g(e)),
1799
1814
  a.bigint().transform((e) => new g(e)),
1800
1815
  a.instanceof(g),
1801
- a.instanceof(b).transform((e) => new g(e)),
1816
+ a.instanceof(y).transform((e) => new g(e)),
1802
1817
  a.custom((e) => e instanceof E).transform((e) => new g(e))
1803
1818
  ]);
1804
1819
  };
@@ -1876,7 +1891,7 @@ class E extends _ {
1876
1891
  * @returns A new Rate representing the difference of the two rates.
1877
1892
  */
1878
1893
  sub(e) {
1879
- return new E(P(this.valueOf(), e.valueOf()));
1894
+ return new E(q(this.valueOf(), e.valueOf()));
1880
1895
  }
1881
1896
  /**
1882
1897
  * Multiplies this Rate by a scalar value.
@@ -1885,7 +1900,7 @@ class E extends _ {
1885
1900
  * @returns A new Rate representing this Rate multiplied by the value.
1886
1901
  */
1887
1902
  mult(e) {
1888
- return new E(B(this.valueOf(), e));
1903
+ return new E(U(this.valueOf(), e));
1889
1904
  }
1890
1905
  /**
1891
1906
  * Divides this Rate by a scalar value.
@@ -1965,7 +1980,7 @@ let I = class M extends _ {
1965
1980
  * @returns A new Density representing the difference of the two densities.
1966
1981
  */
1967
1982
  sub(e) {
1968
- return new M(P(this.valueOf(), e.valueOf()));
1983
+ return new M(q(this.valueOf(), e.valueOf()));
1969
1984
  }
1970
1985
  /**
1971
1986
  * Multiplies this Density by a scalar value.
@@ -1974,7 +1989,7 @@ let I = class M extends _ {
1974
1989
  * @returns A new Density representing this Density multiplied by the value.
1975
1990
  */
1976
1991
  mult(e) {
1977
- return new M(B(this.valueOf(), e));
1992
+ return new M(U(this.valueOf(), e));
1978
1993
  }
1979
1994
  /**
1980
1995
  * Divides this Density by a scalar value.
@@ -2002,7 +2017,7 @@ let I = class M extends _ {
2002
2017
  a.number().transform((e) => new M(e)),
2003
2018
  a.instanceof(M)
2004
2019
  ]);
2005
- }, J = class L {
2020
+ }, J = class B {
2006
2021
  /**
2007
2022
  * The starting TimeStamp of the TimeRange.
2008
2023
  *
@@ -2028,7 +2043,7 @@ let I = class M extends _ {
2028
2043
  * @param end - A TimeStamp representing the end of the range.
2029
2044
  */
2030
2045
  constructor(e, r) {
2031
- typeof e == "object" && "start" in e ? (this.start = new b(e.start), this.end = new b(e.end)) : (this.start = new b(e), this.end = new b(r));
2046
+ typeof e == "object" && "start" in e ? (this.start = new y(e.start), this.end = new y(e.end)) : (this.start = new y(e), this.end = new y(r));
2032
2047
  }
2033
2048
  /** @returns The TimeSpan occupied by the TimeRange. */
2034
2049
  get span() {
@@ -2070,7 +2085,7 @@ let I = class M extends _ {
2070
2085
  * @returns A TimeRange with the start and end swapped.
2071
2086
  */
2072
2087
  swap() {
2073
- return new L(this.end, this.start);
2088
+ return new B(this.end, this.start);
2074
2089
  }
2075
2090
  get numericBounds() {
2076
2091
  return {
@@ -2122,11 +2137,11 @@ let I = class M extends _ {
2122
2137
  const n = this.makeValid();
2123
2138
  if (this.equals(e)) return !0;
2124
2139
  if (e.end.equals(n.start) || n.end.equals(e.start)) return !1;
2125
- const s = b.max(n.start, e.start), i = b.min(n.end, e.end);
2140
+ const s = y.max(n.start, e.start), i = y.min(n.end, e.end);
2126
2141
  return i.before(s) ? !1 : new O(i.sub(s)).greaterThanOrEqual(r);
2127
2142
  }
2128
2143
  contains(e) {
2129
- return e instanceof L ? this.contains(e.start) && this.contains(e.end) : this.start.beforeEq(e) && this.end.after(e);
2144
+ return e instanceof B ? this.contains(e.start) && this.contains(e.end) : this.start.beforeEq(e) && this.end.after(e);
2130
2145
  }
2131
2146
  /**
2132
2147
  * Returns a new TimeRange that is bound by the given TimeRange.
@@ -2140,25 +2155,25 @@ let I = class M extends _ {
2140
2155
  * console.log(bounded); // TimeRange(1500, 2000)
2141
2156
  */
2142
2157
  boundBy(e) {
2143
- const r = new L(this.start, this.end);
2158
+ const r = new B(this.start, this.end);
2144
2159
  return e.start.after(this.start) && (r.start = e.start), e.start.after(this.end) && (r.end = e.start), e.end.before(this.end) && (r.end = e.end), e.end.before(this.start) && (r.start = e.end), r;
2145
2160
  }
2146
2161
  static max(...e) {
2147
- return new L(
2148
- b.min(...e.map((r) => r.start)),
2149
- b.max(...e.map((r) => r.end))
2162
+ return new B(
2163
+ y.min(...e.map((r) => r.start)),
2164
+ y.max(...e.map((r) => r.end))
2150
2165
  );
2151
2166
  }
2152
2167
  /** The maximum possible time range. */
2153
- static MAX = new L(b.MIN, b.MAX);
2168
+ static MAX = new B(y.MIN, y.MAX);
2154
2169
  /** The minimum possible time range. */
2155
- static MIN = new L(b.MAX, b.MIN);
2170
+ static MIN = new B(y.MAX, y.MIN);
2156
2171
  /** A time range whose start and end are both zero. */
2157
- static ZERO = new L(b.ZERO, b.ZERO);
2172
+ static ZERO = new B(y.ZERO, y.ZERO);
2158
2173
  /** A zod schema for validating and transforming time ranges */
2159
2174
  static z = a.union([
2160
- a.object({ start: b.z, end: b.z }).transform((e) => new L(e.start, e.end)),
2161
- a.instanceof(L)
2175
+ a.object({ start: y.z, end: y.z }).transform((e) => new B(e.start, e.end)),
2176
+ a.instanceof(B)
2162
2177
  ]);
2163
2178
  /**
2164
2179
  * Sorts two time ranges. The range with the earlier start time is considered less than
@@ -2172,7 +2187,23 @@ let I = class M extends _ {
2172
2187
  * equal.
2173
2188
  */
2174
2189
  static sort(e, r) {
2175
- return b.sort(e.start, r.start) || b.sort(e.end, r.end);
2190
+ return y.sort(e.start, r.start) || y.sort(e.end, r.end);
2191
+ }
2192
+ /**
2193
+ * Simplify takes the list of `TimeRange`s, makes all of them valid, sorts them, and
2194
+ * merges any overlapping ranges.
2195
+ *
2196
+ * @param ranges - The list of `TimeRange`s to simplify.
2197
+ * @returns A list of simplified `TimeRange`s.
2198
+ */
2199
+ static simplify(e) {
2200
+ return e.map((r) => r.makeValid()).sort((r, n) => B.sort(r, n)).reduce((r, n) => {
2201
+ if (n.isZero) return r;
2202
+ if (r.length === 0)
2203
+ return r.push(n), r;
2204
+ const s = r[r.length - 1];
2205
+ return s.overlapsWith(n) || s.end.equals(n.start) ? s.end = y.max(s.end, n.end) : r.push(n), r;
2206
+ }, []);
2176
2207
  }
2177
2208
  }, $ = class u extends _ {
2178
2209
  constructor(e) {
@@ -2410,7 +2441,7 @@ let I = class M extends _ {
2410
2441
  }
2411
2442
  /** @returns a new Size representing the difference of the two Sizes. */
2412
2443
  sub(e) {
2413
- return new w(P(this.valueOf(), e.valueOf()));
2444
+ return new w(q(this.valueOf(), e.valueOf()));
2414
2445
  }
2415
2446
  /**
2416
2447
  * Multiplies this Size by a scalar value.
@@ -2419,7 +2450,7 @@ let I = class M extends _ {
2419
2450
  * @returns A new Size representing this Size multiplied by the value.
2420
2451
  */
2421
2452
  mult(e) {
2422
- return new w(B(this.valueOf(), e));
2453
+ return new w(U(this.valueOf(), e));
2423
2454
  }
2424
2455
  /**
2425
2456
  * Divides this Size by a scalar value.
@@ -2527,7 +2558,7 @@ let I = class M extends _ {
2527
2558
  return this.valueOf() === 0;
2528
2559
  }
2529
2560
  };
2530
- const Bo = a.union([
2561
+ const jo = a.union([
2531
2562
  a.instanceof(Uint8Array),
2532
2563
  a.instanceof(Uint16Array),
2533
2564
  a.instanceof(Uint32Array),
@@ -2540,32 +2571,32 @@ const Bo = a.union([
2540
2571
  a.instanceof(BigInt64Array)
2541
2572
  ]), Mr = (t) => {
2542
2573
  const e = typeof t;
2543
- return e === "string" || e === "number" || e === "boolean" || e === "bigint" || t instanceof b || t instanceof O || t instanceof Date;
2544
- }, Ei = (t, e, r, n = 0) => t.usesBigInt && !e.usesBigInt ? Number(r) - Number(n) : !t.usesBigInt && e.usesBigInt ? BigInt(r.valueOf()) - BigInt(n.valueOf()) : Ue(r, -n), Ue = (t, e) => e == 0 ? t : t == 0 ? e : typeof t == "bigint" && typeof e == "bigint" || typeof t == "number" && typeof e == "number" ? t + e : Number(t) + Number(e), Ai = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
2545
- function Bi(t) {
2546
- return typeof t == "string" && Ai.test(t);
2574
+ return e === "string" || e === "number" || e === "boolean" || e === "bigint" || t instanceof y || t instanceof O || t instanceof Date;
2575
+ }, Bi = (t, e, r, n = 0) => t.usesBigInt && !e.usesBigInt ? Number(r) - Number(n) : !t.usesBigInt && e.usesBigInt ? BigInt(r.valueOf()) - BigInt(n.valueOf()) : Ue(r, -n), Ue = (t, e) => e == 0 ? t : t == 0 ? e : typeof t == "bigint" && typeof e == "bigint" || typeof t == "number" && typeof e == "number" ? t + e : Number(t) + Number(e), Ui = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
2576
+ function Ci(t) {
2577
+ return typeof t == "string" && Ui.test(t);
2547
2578
  }
2548
2579
  const N = [];
2549
2580
  for (let t = 0; t < 256; ++t)
2550
2581
  N.push((t + 256).toString(16).slice(1));
2551
- function Ui(t, e = 0) {
2582
+ function ji(t, e = 0) {
2552
2583
  return (N[t[e + 0]] + N[t[e + 1]] + N[t[e + 2]] + N[t[e + 3]] + "-" + N[t[e + 4]] + N[t[e + 5]] + "-" + N[t[e + 6]] + N[t[e + 7]] + "-" + N[t[e + 8]] + N[t[e + 9]] + "-" + N[t[e + 10]] + N[t[e + 11]] + N[t[e + 12]] + N[t[e + 13]] + N[t[e + 14]] + N[t[e + 15]]).toLowerCase();
2553
2584
  }
2554
- function Ci(t, e = 0) {
2555
- const r = Ui(t, e);
2556
- if (!Bi(r))
2585
+ function Ri(t, e = 0) {
2586
+ const r = ji(t, e);
2587
+ if (!Ci(r))
2557
2588
  throw TypeError("Stringified UUID is invalid");
2558
2589
  return r;
2559
2590
  }
2560
2591
  typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
2561
- const Er = (t, e) => Ci(t, e), z = -1, ht = {
2592
+ const Er = (t, e) => Ri(t, e), Z = -1, ht = {
2562
2593
  [Symbol.iterator]: () => ht,
2563
2594
  next: () => ({ done: !0, value: void 0 })
2564
- }, ji = a.string().transform(
2595
+ }, Li = a.string().transform(
2565
2596
  (t) => new Uint8Array(
2566
2597
  atob(t).split("").map((e) => e.charCodeAt(0))
2567
2598
  ).buffer
2568
- ), Ri = a.union([a.null(), a.undefined()]).transform(() => new Uint8Array().buffer), ft = 10, Ar = (t, e) => {
2599
+ ), Di = a.union([a.null(), a.undefined()]).transform(() => new Uint8Array().buffer), ft = 10, Ar = (t, e) => {
2569
2600
  if (t === "number" && !e.isNumeric)
2570
2601
  throw new Error(`cannot convert series of type ${e.toString()} to number`);
2571
2602
  if (t === "bigint" && !e.usesBigInt)
@@ -2615,7 +2646,7 @@ let Ur = class F {
2615
2646
  /** A cached maximum value. */
2616
2647
  cachedMax;
2617
2648
  /** The write position of the buffer. */
2618
- writePos = z;
2649
+ writePos = Z;
2619
2650
  /** Tracks the number of entities currently using this array. */
2620
2651
  _refCount = 0;
2621
2652
  /** Caches the length of the array for variable length data types. */
@@ -2631,12 +2662,12 @@ let Ur = class F {
2631
2662
  dataType: $.z,
2632
2663
  alignment: a.coerce.bigint().optional(),
2633
2664
  data: a.union([
2634
- ji,
2635
- Ri,
2665
+ Li,
2666
+ Di,
2636
2667
  a.instanceof(ArrayBuffer),
2637
2668
  a.instanceof(Uint8Array)
2638
2669
  ]),
2639
- glBufferUsage: Ii.optional().default("static").optional()
2670
+ glBufferUsage: Ei.optional().default("static").optional()
2640
2671
  });
2641
2672
  /**
2642
2673
  * A zod schema that validates and constructs a series from it's crude
@@ -2717,7 +2748,7 @@ let Ur = class F {
2717
2748
  * @throws Error if data type cannot be inferred from input
2718
2749
  */
2719
2750
  constructor(e) {
2720
- Li(e) && (e = { data: e }), e.data ??= [];
2751
+ Pi(e) && (e = { data: e }), e.data ??= [];
2721
2752
  const {
2722
2753
  dataType: r,
2723
2754
  timeRange: n,
@@ -2753,7 +2784,7 @@ let Ur = class F {
2753
2784
  else if (typeof p == "number") this.dataType = $.FLOAT64;
2754
2785
  else if (typeof p == "bigint") this.dataType = $.INT64;
2755
2786
  else if (typeof p == "boolean") this.dataType = $.BOOLEAN;
2756
- else if (p instanceof b || p instanceof Date || p instanceof b)
2787
+ else if (p instanceof y || p instanceof Date || p instanceof y)
2757
2788
  this.dataType = $.TIMESTAMP;
2758
2789
  else if (typeof p == "object") this.dataType = $.JSON;
2759
2790
  else
@@ -2767,16 +2798,16 @@ let Ur = class F {
2767
2798
  this._data = new this.dataType.Array([]).buffer;
2768
2799
  else {
2769
2800
  let p = d ? [l] : l;
2770
- const j = p[0];
2771
- (j instanceof b || j instanceof Date || j instanceof O) && (p = p.map((A) => new b(A).valueOf())), this.dataType.equals($.STRING) ? (this.cachedLength = p.length, this._data = new TextEncoder().encode(`${p.join(`
2801
+ const R = p[0];
2802
+ (R instanceof y || R instanceof Date || R instanceof O) && (p = p.map((A) => new y(A).valueOf())), this.dataType.equals($.STRING) ? (this.cachedLength = p.length, this._data = new TextEncoder().encode(`${p.join(`
2772
2803
  `)}
2773
2804
  `).buffer) : this.dataType.equals($.JSON) ? (this.cachedLength = p.length, this._data = new TextEncoder().encode(
2774
2805
  `${p.map((A) => et.encodeString(A)).join(`
2775
2806
  `)}
2776
2807
  `
2777
- ).buffer) : this.dataType.usesBigInt && typeof j == "number" ? this._data = new this.dataType.Array(
2808
+ ).buffer) : this.dataType.usesBigInt && typeof R == "number" ? this._data = new this.dataType.Array(
2778
2809
  p.map((A) => BigInt(Math.round(A)))
2779
- ).buffer : !this.dataType.usesBigInt && typeof j == "bigint" ? this._data = new this.dataType.Array(
2810
+ ).buffer : !this.dataType.usesBigInt && typeof R == "bigint" ? this._data = new this.dataType.Array(
2780
2811
  p.map(Number)
2781
2812
  ).buffer : this._data = new this.dataType.Array(p).buffer;
2782
2813
  }
@@ -2840,12 +2871,12 @@ let Ur = class F {
2840
2871
  return this.dataType.isVariable ? this.writeVariable(e) : this.writeFixed(e);
2841
2872
  }
2842
2873
  writeVariable(e) {
2843
- if (this.writePos === z) return 0;
2874
+ if (this.writePos === Z) return 0;
2844
2875
  const r = this.byteCapacity.valueOf() - this.writePos, n = e.subBytes(0, r);
2845
2876
  return this.writeToUnderlyingData(n), this.writePos += n.byteLength.valueOf(), this.cachedLength != null && (this.cachedLength += n.length, this.calculateCachedLength()), n.length;
2846
2877
  }
2847
2878
  writeFixed(e) {
2848
- if (this.writePos === z) return 0;
2879
+ if (this.writePos === Z) return 0;
2849
2880
  const r = this.capacity - this.writePos, n = e.sub(0, r);
2850
2881
  return this.writeToUnderlyingData(n), this.cachedLength = void 0, this.maybeRecomputeMinMax(n), this.writePos += n.length, n.length;
2851
2882
  }
@@ -2868,7 +2899,7 @@ let Ur = class F {
2868
2899
  * @returns A typed array containing the series data.
2869
2900
  */
2870
2901
  get data() {
2871
- return this.writePos === z ? this.underlyingData : new this.dataType.Array(this._data, 0, this.writePos);
2902
+ return this.writePos === Z ? this.underlyingData : new this.dataType.Array(this._data, 0, this.writePos);
2872
2903
  }
2873
2904
  /**
2874
2905
  * Returns an array of the values in the series as strings.
@@ -2912,7 +2943,7 @@ let Ur = class F {
2912
2943
  * @returns The size of the data in bytes.
2913
2944
  */
2914
2945
  get byteLength() {
2915
- return this.writePos === z ? this.byteCapacity : this.dataType.isVariable ? new Le(this.writePos) : this.dataType.density.size(this.writePos);
2946
+ return this.writePos === Z ? this.byteCapacity : this.dataType.isVariable ? new Le(this.writePos) : this.dataType.density.size(this.writePos);
2916
2947
  }
2917
2948
  /**
2918
2949
  * Returns the number of samples in this array.
@@ -2920,7 +2951,7 @@ let Ur = class F {
2920
2951
  * @returns The number of samples in the series.
2921
2952
  */
2922
2953
  get length() {
2923
- return this.cachedLength != null ? this.cachedLength : this.dataType.isVariable ? this.calculateCachedLength() : this.writePos === z ? this.byteCapacity.valueOf() / this.dataType.density.valueOf() : this.writePos;
2954
+ return this.cachedLength != null ? this.cachedLength : this.dataType.isVariable ? this.calculateCachedLength() : this.writePos === Z ? this.byteCapacity.valueOf() / this.dataType.density.valueOf() : this.writePos;
2924
2955
  }
2925
2956
  calculateCachedLength() {
2926
2957
  if (!this.dataType.isVariable)
@@ -2944,7 +2975,7 @@ let Ur = class F {
2944
2975
  if (this.dataType.equals(e)) return this;
2945
2976
  const n = new e.Array(this.length);
2946
2977
  for (let s = 0; s < this.length; s++)
2947
- n[s] = Ei(this.dataType, e, this.data[s], r);
2978
+ n[s] = Bi(this.dataType, e, this.data[s], r);
2948
2979
  return new F({
2949
2980
  data: n.buffer,
2950
2981
  dataType: e,
@@ -2999,7 +3030,7 @@ let Ur = class F {
2999
3030
  }
3000
3031
  /** @returns the bounds of the series. */
3001
3032
  get bounds() {
3002
- return y(Number(this.min), Number(this.max), { makeValid: !1 });
3033
+ return b(Number(this.min), Number(this.max), { makeValid: !1 });
3003
3034
  }
3004
3035
  maybeRecomputeMinMax(e) {
3005
3036
  if (this.cachedMin != null) {
@@ -3090,7 +3121,7 @@ let Ur = class F {
3090
3121
  throw new Error("Only FLOAT32 and UINT8 arrays can be used in WebGL");
3091
3122
  const { buffer: r, bufferUsage: n, prevBuffer: s } = this.gl;
3092
3123
  if (r == null && (this.gl.buffer = e.createBuffer()), this.writePos !== s)
3093
- if (e.bindBuffer(e.ARRAY_BUFFER, this.gl.buffer), this.writePos !== z) {
3124
+ if (e.bindBuffer(e.ARRAY_BUFFER, this.gl.buffer), this.writePos !== Z) {
3094
3125
  s === 0 && e.bufferData(e.ARRAY_BUFFER, this.byteCapacity.valueOf(), e.STATIC_DRAW);
3095
3126
  const i = this.dataType.density.size(s).valueOf(), o = this.underlyingData.slice(this.gl.prevBuffer, this.writePos);
3096
3127
  e.bufferSubData(e.ARRAY_BUFFER, i, o.buffer), this.gl.prevBuffer = this.writePos;
@@ -3099,7 +3130,7 @@ let Ur = class F {
3099
3130
  e.ARRAY_BUFFER,
3100
3131
  this.buffer,
3101
3132
  n === "static" ? e.STATIC_DRAW : e.DYNAMIC_DRAW
3102
- ), this.gl.prevBuffer = z;
3133
+ ), this.gl.prevBuffer = Z;
3103
3134
  }
3104
3135
  as(e) {
3105
3136
  return Ar(e, this.dataType), this;
@@ -3111,8 +3142,8 @@ let Ur = class F {
3111
3142
  dataType: this.dataType.toString(),
3112
3143
  sampleOffset: this.sampleOffset,
3113
3144
  alignment: {
3114
- lower: Zt(this.alignmentBounds.lower),
3115
- upper: Zt(this.alignmentBounds.upper)
3145
+ lower: Ft(this.alignmentBounds.lower),
3146
+ upper: Ft(this.alignmentBounds.upper)
3116
3147
  },
3117
3148
  timeRange: this.timeRange.toString(),
3118
3149
  length: this.length,
@@ -3129,7 +3160,7 @@ let Ur = class F {
3129
3160
  * is exclusive.
3130
3161
  */
3131
3162
  get alignmentBounds() {
3132
- return y(
3163
+ return b(
3133
3164
  this.alignment,
3134
3165
  this.alignment + BigInt(this.length) * this.alignmentMultiple
3135
3166
  );
@@ -3149,10 +3180,10 @@ let Ur = class F {
3149
3180
  }
3150
3181
  [Symbol.iterator]() {
3151
3182
  if (this.dataType.isVariable) {
3152
- const e = new Di(this);
3153
- return this.dataType.equals($.JSON) ? new Pi(e) : e;
3183
+ const e = new qi(this);
3184
+ return this.dataType.equals($.JSON) ? new ki(e) : e;
3154
3185
  }
3155
- return this.dataType.equals($.UUID) ? new qi(this) : new ki(this);
3186
+ return this.dataType.equals($.UUID) ? new zi(this) : new Zi(this);
3156
3187
  }
3157
3188
  /**
3158
3189
  * Returns a slice of the series from start to end.
@@ -3179,7 +3210,7 @@ let Ur = class F {
3179
3210
  * @returns An iterator over the specified range.
3180
3211
  */
3181
3212
  subIterator(e, r) {
3182
- return new Ft(this, e, r ?? this.length);
3213
+ return new Zt(this, e, r ?? this.length);
3183
3214
  }
3184
3215
  /**
3185
3216
  * Returns an iterator over a portion of the series based on alignment.
@@ -3193,7 +3224,7 @@ let Ur = class F {
3193
3224
  ), s = Math.ceil(
3194
3225
  Number(r - this.alignment) / Number(this.alignmentMultiple)
3195
3226
  );
3196
- return new Ft(this, n, s);
3227
+ return new Zt(this, n, s);
3197
3228
  }
3198
3229
  subBytes(e, r) {
3199
3230
  if (e >= 0 && (r == null || r >= this.byteLength.valueOf())) return this;
@@ -3252,20 +3283,20 @@ let Ur = class F {
3252
3283
  return e += "])", e;
3253
3284
  }
3254
3285
  };
3255
- const Li = (t) => t == null ? !1 : Array.isArray(t) || t instanceof ArrayBuffer || ArrayBuffer.isView(t) && !(t instanceof DataView) || t instanceof Ur ? !0 : Mr(t), Cr = Ni(Br, Ur);
3256
- let Ft = class {
3286
+ const Pi = (t) => t == null ? !1 : Array.isArray(t) || t instanceof ArrayBuffer || ArrayBuffer.isView(t) && !(t instanceof DataView) || t instanceof Ur ? !0 : Mr(t), Cr = Mi(Br, Ur);
3287
+ let Zt = class {
3257
3288
  series;
3258
3289
  end;
3259
3290
  index;
3260
3291
  constructor(e, r, n) {
3261
3292
  this.series = e;
3262
- const s = y(0, e.length + 1);
3293
+ const s = b(0, e.length + 1);
3263
3294
  this.end = st(s, n), this.index = st(s, r);
3264
3295
  }
3265
3296
  next() {
3266
3297
  return this.index >= this.end ? { done: !0, value: void 0 } : { done: !1, value: this.series.at(this.index++, !0) };
3267
3298
  }
3268
- }, Di = class {
3299
+ }, qi = class {
3269
3300
  series;
3270
3301
  index;
3271
3302
  decoder;
@@ -3282,7 +3313,7 @@ let Ft = class {
3282
3313
  const n = this.index;
3283
3314
  return e === n ? { done: !0, value: void 0 } : (this.index++, { done: !1, value: this.decoder.decode(this.series.buffer.slice(e, n)) });
3284
3315
  }
3285
- }, Pi = class jr {
3316
+ }, ki = class jr {
3286
3317
  wrapped;
3287
3318
  static schema = a.record(a.string(), a.unknown());
3288
3319
  constructor(e) {
@@ -3295,7 +3326,7 @@ let Ft = class {
3295
3326
  value: et.decodeString(e.value, jr.schema)
3296
3327
  };
3297
3328
  }
3298
- }, qi = class {
3329
+ }, zi = class {
3299
3330
  series;
3300
3331
  index;
3301
3332
  data;
@@ -3311,7 +3342,7 @@ let Ft = class {
3311
3342
  return this.index++, { done: !1, value: e };
3312
3343
  }
3313
3344
  };
3314
- class ki {
3345
+ class Zi {
3315
3346
  series;
3316
3347
  index;
3317
3348
  constructor(e) {
@@ -3324,7 +3355,7 @@ class ki {
3324
3355
  };
3325
3356
  }
3326
3357
  }
3327
- let Ro = class {
3358
+ let Po = class {
3328
3359
  /** The array of series in this collection */
3329
3360
  series;
3330
3361
  /**
@@ -3410,7 +3441,7 @@ let Ro = class {
3410
3441
  * series + its length. If the collection is empty, returns bounds.construct(0n, 0n).
3411
3442
  */
3412
3443
  get alignmentBounds() {
3413
- return this.series.length === 0 ? y(0n, 0n) : y(
3444
+ return this.series.length === 0 ? b(0n, 0n) : b(
3414
3445
  this.series[0].alignmentBounds.lower,
3415
3446
  this.series[this.series.length - 1].alignmentBounds.upper
3416
3447
  );
@@ -3437,7 +3468,7 @@ let Ro = class {
3437
3468
  }
3438
3469
  atAlignment(e, r) {
3439
3470
  for (const n of this.series)
3440
- if (U(n.alignmentBounds, e))
3471
+ if (C(n.alignmentBounds, e))
3441
3472
  return n.atAlignment(e, r);
3442
3473
  if (r) throw new Error(`[series] - no value at alignment ${e}`);
3443
3474
  }
@@ -3472,7 +3503,7 @@ let Ro = class {
3472
3503
  const o = this.series[i];
3473
3504
  if (e < o.alignment) break;
3474
3505
  if (e >= o.alignmentBounds.upper) n += o.length;
3475
- else if (U(o.alignmentBounds, e)) {
3506
+ else if (C(o.alignmentBounds, e)) {
3476
3507
  n += Math.ceil(
3477
3508
  Number(e - o.alignment) / Number(o.alignmentMultiple)
3478
3509
  );
@@ -3484,7 +3515,7 @@ let Ro = class {
3484
3515
  const o = this.series[i];
3485
3516
  if (r < o.alignment) break;
3486
3517
  if (r >= o.alignmentBounds.upper) s += o.length;
3487
- else if (U(o.alignmentBounds, r)) {
3518
+ else if (C(o.alignmentBounds, r)) {
3488
3519
  s += Math.ceil(
3489
3520
  Number(r - o.alignment) / Number(o.alignmentMultiple)
3490
3521
  );
@@ -3507,7 +3538,7 @@ let Ro = class {
3507
3538
  const i = this.series[s];
3508
3539
  if (e < i.alignment) break;
3509
3540
  if (e >= i.alignmentBounds.upper) n += i.length;
3510
- else if (U(i.alignmentBounds, e)) {
3541
+ else if (C(i.alignmentBounds, e)) {
3511
3542
  n += Number(e - i.alignment);
3512
3543
  break;
3513
3544
  }
@@ -3598,7 +3629,7 @@ let Ro = class {
3598
3629
  next() {
3599
3630
  return { done: !0, value: void 0 };
3600
3631
  }
3601
- } : new zi(this.series);
3632
+ } : new Fi(this.series);
3602
3633
  }
3603
3634
  /**
3604
3635
  * Returns an array of the values in the multi-series as strings.
@@ -3608,7 +3639,7 @@ let Ro = class {
3608
3639
  toStrings() {
3609
3640
  return this.series.flatMap((e) => e.toStrings());
3610
3641
  }
3611
- }, zi = class {
3642
+ }, Fi = class {
3612
3643
  series;
3613
3644
  seriesIndex;
3614
3645
  internal;
@@ -3637,27 +3668,32 @@ class Xe {
3637
3668
  return this;
3638
3669
  }
3639
3670
  }
3640
- const Zt = (t) => {
3671
+ const Ft = (t) => {
3641
3672
  const e = t >> 32n, r = t & 0xffffffffn;
3642
3673
  return { domain: e, sample: r };
3643
3674
  };
3644
3675
  a.object({ key: a.string(), value: a.string() });
3645
- const Fi = a.record(
3676
+ const Yi = a.record(
3646
3677
  a.union([a.number(), a.string(), a.symbol()]),
3647
3678
  a.unknown()
3648
- ), Dt = (t) => Object.entries(t), Zi = (t, e) => Object.fromEntries(Dt(t).map(([r, n]) => [r, e(n, r)])), Yi = (t) => Object.fromEntries(Dt(t).filter(([e, r]) => r !== void 0)), Po = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3679
+ ), Dt = (t) => Object.entries(t), Wi = (t, e) => Object.fromEntries(Dt(t).map(([r, n]) => [r, e(n, r)])), Vi = (t) => Object.fromEntries(Dt(t).filter(([e, r]) => r !== void 0)), Gi = (t, ...e) => {
3680
+ const r = { ...t };
3681
+ for (const n of e) delete r[n];
3682
+ return r;
3683
+ }, zo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3649
3684
  __proto__: null,
3650
3685
  entries: Dt,
3651
- map: Zi,
3652
- purgeUndefined: Yi,
3653
- unknownZ: Fi
3654
- }, Symbol.toStringTag, { value: "Module" })), Rr = () => typeof process < "u" && process.versions != null && process.versions.node != null ? "node" : typeof window > "u" || window.document === void 0 ? "webworker" : "browser", Wi = Rr(), Lr = ["macOS", "Windows", "Linux"], Vi = ["macos", "windows", "linux"], Gi = {
3686
+ map: Wi,
3687
+ omit: Gi,
3688
+ purgeUndefined: Vi,
3689
+ unknownZ: Yi
3690
+ }, Symbol.toStringTag, { value: "Module" })), Rr = () => typeof process < "u" && process.versions != null && process.versions.node != null ? "node" : typeof window > "u" || window.document === void 0 ? "webworker" : "browser", Hi = Rr(), Lr = ["macOS", "Windows", "Linux"], Ji = ["macos", "windows", "linux"], Xi = {
3655
3691
  macos: "macOS",
3656
3692
  windows: "Windows",
3657
3693
  linux: "Linux"
3658
- }, Hi = a.enum(Lr).or(
3659
- a.enum(Vi).transform((t) => Gi[t])
3660
- ), Ji = () => {
3694
+ }, Ki = a.enum(Lr).or(
3695
+ a.enum(Ji).transform((t) => Xi[t])
3696
+ ), Qi = () => {
3661
3697
  if (typeof window > "u") return;
3662
3698
  const t = window.navigator.userAgent.toLowerCase();
3663
3699
  if (t.includes("mac")) return "macOS";
@@ -3665,17 +3701,17 @@ const Fi = a.record(
3665
3701
  if (t.includes("linux")) return "Linux";
3666
3702
  };
3667
3703
  let Ke;
3668
- const Xi = (t = {}) => {
3704
+ const _i = (t = {}) => {
3669
3705
  const { force: e, default: r } = t;
3670
- return e ?? Ke ?? (Ke = Ji(), Ke ?? r);
3671
- }, qo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3706
+ return e ?? Ke ?? (Ke = Qi(), Ke ?? r);
3707
+ }, Zo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3672
3708
  __proto__: null,
3673
3709
  OPERATING_SYSTEMS: Lr,
3674
- RUNTIME: Wi,
3710
+ RUNTIME: Hi,
3675
3711
  detect: Rr,
3676
- getOS: Xi,
3677
- osZ: Hi
3678
- }, Symbol.toStringTag, { value: "Module" })), Ki = (...t) => t.map(Dr).join(""), Dr = (t) => (t.endsWith("/") || (t += "/"), t.startsWith("/") && (t = t.slice(1)), t), Qi = (t) => t.endsWith("/") ? t.slice(0, -1) : t;
3712
+ getOS: _i,
3713
+ osZ: Ki
3714
+ }, Symbol.toStringTag, { value: "Module" })), ea = (...t) => t.map(Dr).join(""), Dr = (t) => (t.endsWith("/") || (t += "/"), t.startsWith("/") && (t = t.slice(1)), t), ta = (t) => t.endsWith("/") ? t.slice(0, -1) : t;
3679
3715
  class Ce {
3680
3716
  protocol;
3681
3717
  host;
@@ -3711,26 +3747,26 @@ class Ce {
3711
3747
  child(e) {
3712
3748
  return new Ce({
3713
3749
  ...this,
3714
- pathPrefix: Ki(this.path, e)
3750
+ pathPrefix: ea(this.path, e)
3715
3751
  });
3716
3752
  }
3717
3753
  /** @returns a string representation of the url */
3718
3754
  toString() {
3719
- return Qi(
3755
+ return ta(
3720
3756
  `${this.protocol}://${this.host}:${this.port}/${this.path}`
3721
3757
  );
3722
3758
  }
3723
3759
  static UNKNOWN = new Ce({ host: "unknown", port: 0 });
3724
3760
  }
3725
- const _i = 2, ea = 3, ta = 2, ra = (t, e) => {
3761
+ const ra = 2, na = 3, sa = 2, ia = (t, e) => {
3726
3762
  if (Number.isNaN(t) || !Number.isFinite(t)) return t;
3727
3763
  const r = Oe(e);
3728
3764
  if (r == 0) return t;
3729
3765
  let n;
3730
- r >= 1e3 ? n = _i : r >= 1 ? n = ea : n = Math.ceil(-Math.log10(r)) + ta;
3766
+ r >= 1e3 ? n = ra : r >= 1 ? n = na : n = Math.ceil(-Math.log10(r)) + sa;
3731
3767
  const s = 10 ** n;
3732
3768
  return Math.round(t * s) / s;
3733
- }, ko = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3769
+ }, Fo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3734
3770
  __proto__: null,
3735
3771
  abs: ir,
3736
3772
  add: ie,
@@ -3740,24 +3776,24 @@ const _i = 2, ea = 3, ta = 2, ra = (t, e) => {
3740
3776
  isInteger: je,
3741
3777
  max: Ln,
3742
3778
  min: sr,
3743
- mult: B,
3744
- roundBySpan: ra,
3779
+ mult: U,
3780
+ roundBySpan: ia,
3745
3781
  roundToNearestMagnitude: Rn,
3746
- sub: P
3782
+ sub: q
3747
3783
  }, Symbol.toStringTag, { value: "Module" }));
3748
3784
  a.object({
3749
3785
  baseInterval: O.z.optional(),
3750
3786
  maxRetries: a.number().optional(),
3751
3787
  scale: a.number().optional()
3752
3788
  });
3753
- const na = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Pr = a.string().regex(na), re = a.number().min(0).max(255), qr = a.number().min(0).max(1), We = a.tuple([re, re, re, qr]), sa = a.tuple([re, re, re]), ia = a.object({ rgba255: We }), aa = a.number().min(0).max(360), oa = a.number().min(0).max(100), ua = a.number().min(0).max(100), kr = a.tuple([aa, oa, ua, qr]), Ve = a.union([Pr, sa, We, kr, ia]), Ge = Ve.transform((t) => v(t)), la = (t) => Ge.safeParse(t).success, ca = (t) => We.safeParse(t).success, ha = (t) => {
3789
+ const aa = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Pr = a.string().regex(aa), re = a.number().min(0).max(255), qr = a.number().min(0).max(1), We = a.tuple([re, re, re, qr]), oa = a.tuple([re, re, re]), ua = a.object({ rgba255: We }), la = a.number().min(0).max(360), ca = a.number().min(0).max(100), ha = a.number().min(0).max(100), kr = a.tuple([la, ca, ha, qr]), Ve = a.union([Pr, oa, We, kr, ua]), Ge = Ve.transform((t) => x(t)), fa = (t) => Ge.safeParse(t).success, da = (t) => We.safeParse(t).success, ga = (t) => {
3754
3790
  if (t == null) return;
3755
3791
  const e = Ge.safeParse(t);
3756
- if (e.success) return Fr(e.data);
3792
+ if (e.success) return Zr(e.data);
3757
3793
  if (typeof t == "string") return t;
3758
3794
  throw e.error;
3759
- }, v = (t, e = 1) => {
3760
- if (t = Ve.parse(t), typeof t == "string") return Ta(t, e);
3795
+ }, x = (t, e = 1) => {
3796
+ if (t = Ve.parse(t), typeof t == "string") return Sa(t, e);
3761
3797
  if (Array.isArray(t)) {
3762
3798
  if (t.length < 3 || t.length > 4)
3763
3799
  throw new Error(`Invalid color: [${t.join(", ")}]`);
@@ -3766,24 +3802,24 @@ const na = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Pr = a.string().regex(na), re = a.n
3766
3802
  return t.rgba255;
3767
3803
  }, zr = (t, e) => {
3768
3804
  if (t == null || e == null) return t == e;
3769
- const r = v(t), n = v(e);
3805
+ const r = x(t), n = x(e);
3770
3806
  return r.every((s, i) => s === n[i]);
3771
- }, fa = (t) => {
3807
+ }, pa = (t) => {
3772
3808
  if (t == null) return;
3773
- const [e, r, n, s] = v(t);
3809
+ const [e, r, n, s] = x(t);
3774
3810
  return `#${$e(e)}${$e(r)}${$e(n)}${s === 1 ? "" : $e(s * 255)}`;
3775
- }, Fr = (t) => {
3776
- const [e, r, n, s] = v(t);
3811
+ }, Zr = (t) => {
3812
+ const [e, r, n, s] = x(t);
3777
3813
  return `rgba(${e}, ${r}, ${n}, ${s})`;
3778
- }, da = (t) => `rgb(${Zr(t)})`, Zr = (t) => {
3779
- const [e, r, n] = v(t);
3814
+ }, ma = (t) => `rgb(${Fr(t)})`, Fr = (t) => {
3815
+ const [e, r, n] = x(t);
3780
3816
  return `${e}, ${r}, ${n}`;
3781
- }, ga = (t) => [...Pt(t), de(t)], Pt = (t) => [
3817
+ }, ya = (t) => [...Pt(t), de(t)], Pt = (t) => [
3782
3818
  ce(t) / 255,
3783
3819
  he(t) / 255,
3784
3820
  fe(t) / 255
3785
- ], ce = (t) => v(t)[0], he = (t) => v(t)[1], fe = (t) => v(t)[2], de = (t) => v(t)[3], pa = (t) => zr(qt, t), ma = (t) => Sa(v(t)), ya = (t, e) => {
3786
- const [r, n, s] = v(t);
3821
+ ], ce = (t) => x(t)[0], he = (t) => x(t)[1], fe = (t) => x(t)[2], de = (t) => x(t)[3], ba = (t) => zr(qt, t), wa = (t) => Ma(x(t)), Oa = (t, e) => {
3822
+ const [r, n, s] = x(t);
3787
3823
  if (e > 100)
3788
3824
  throw new Error(`Color opacity must be between 0 and 100, got ${e}`);
3789
3825
  return e > 1 && (e /= 100), [r, n, s, e];
@@ -3792,23 +3828,23 @@ const na = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Pr = a.string().regex(na), re = a.n
3792
3828
  (s) => s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4
3793
3829
  );
3794
3830
  return Number((0.2126 * e + 0.7152 * r + 0.0722 * n).toFixed(3));
3795
- }, ba = (t) => {
3831
+ }, va = (t) => {
3796
3832
  const [e, r, n] = Pt(t);
3797
3833
  return 1 - (Math.max(e, r, n) - Math.min(e, r, n));
3798
3834
  }, dt = (t, e) => {
3799
- const r = v(t), n = v(e), s = ye(r), i = ye(n);
3835
+ const r = x(t), n = x(e), s = ye(r), i = ye(n);
3800
3836
  return (Math.max(s, i) + 0.5) / (Math.min(s, i) + 0.5);
3801
- }, wa = (t, ...e) => {
3837
+ }, xa = (t, ...e) => {
3802
3838
  if (e.length === 0)
3803
3839
  throw new Error("[Color.pickByContrast] - must provide at least one color");
3804
- const r = v(t), [n] = e.sort((s, i) => dt(r, i) - dt(r, s));
3805
- return v(n);
3806
- }, Oa = (t) => ye(t) < 0.5, va = (t) => ye(t) > 0.5, Ta = (t, e = 1) => (t = Pr.parse(t), t = xa(t), [
3840
+ const r = x(t), [n] = e.sort((s, i) => dt(r, i) - dt(r, s));
3841
+ return x(n);
3842
+ }, Ta = (t) => ye(t) < 0.5, $a = (t) => ye(t) > 0.5, Sa = (t, e = 1) => (t = Pr.parse(t), t = Na(t), [
3807
3843
  Se(t, 0),
3808
3844
  Se(t, 2),
3809
3845
  Se(t, 4),
3810
3846
  t.length === 8 ? Se(t, 6) / 255 : e
3811
- ]), qt = [0, 0, 0, 0], $e = (t) => Math.floor(t).toString(16).padStart(2, "0"), Se = (t, e) => parseInt(t.slice(e, e + 2), 16), xa = (t) => t.startsWith("#") ? t.slice(1) : t, $a = (t) => {
3847
+ ]), qt = [0, 0, 0, 0], $e = (t) => Math.floor(t).toString(16).padStart(2, "0"), Se = (t, e) => parseInt(t.slice(e, e + 2), 16), Na = (t) => t.startsWith("#") ? t.slice(1) : t, Ia = (t) => {
3812
3848
  t = kr.parse(t);
3813
3849
  let [e, r, n] = t;
3814
3850
  const s = t[3];
@@ -3821,7 +3857,7 @@ const na = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Pr = a.string().regex(na), re = a.n
3821
3857
  i = Qe(l, h, e + 1 / 3), o = Qe(l, h, e), c = Qe(l, h, e - 1 / 3);
3822
3858
  }
3823
3859
  return [Math.round(i * 255), Math.round(o * 255), Math.round(c * 255), s];
3824
- }, Qe = (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), Sa = (t) => {
3860
+ }, Qe = (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), Ma = (t) => {
3825
3861
  t = We.parse(t);
3826
3862
  let [e, r, n] = t;
3827
3863
  const s = t[3];
@@ -3835,75 +3871,75 @@ const na = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Pr = a.string().regex(na), re = a.n
3835
3871
  h = l > 0.5 ? d / (2 - i - o) : d / (i + o), i === e ? c = (r - n) / d + (r < n ? 6 : 0) : i === r ? c = (n - e) / d + 2 : c = (e - r) / d + 4, c /= 6;
3836
3872
  }
3837
3873
  return c *= 360, h *= 100, l *= 100, [Math.round(c), Math.round(h), Math.round(l), s];
3838
- }, Na = v("#000000"), Ia = v("#ffffff"), Yr = a.object({
3874
+ }, Ea = x("#000000"), Aa = x("#ffffff"), Yr = a.object({
3839
3875
  key: a.string(),
3840
3876
  color: Ve,
3841
3877
  position: a.number(),
3842
3878
  switched: a.boolean().optional()
3843
- }), Ma = a.array(Yr), Ea = (t, e) => {
3879
+ }), Ba = a.array(Yr), Ua = (t, e) => {
3844
3880
  if (t.length === 0) return qt;
3845
- if (t = t.slice().sort((r, n) => r.position - n.position), e <= t[0].position) return v(t[0].color);
3881
+ if (t = t.slice().sort((r, n) => r.position - n.position), e <= t[0].position) return x(t[0].color);
3846
3882
  if (e >= t[t.length - 1].position)
3847
- return v(t[t.length - 1].color);
3883
+ return x(t[t.length - 1].color);
3848
3884
  for (let r = 0; r < t.length - 1; r++) {
3849
3885
  const n = t[r], s = t[r + 1];
3850
3886
  if (e < n.position || e > s.position) continue;
3851
- if (e === n.position) return v(n.color);
3852
- if (e === s.position) return v(s.color);
3853
- const i = (e - n.position) / (s.position - n.position), o = v(n.color), c = v(s.color), h = Math.round(
3887
+ if (e === n.position) return x(n.color);
3888
+ if (e === s.position) return x(s.color);
3889
+ const i = (e - n.position) / (s.position - n.position), o = x(n.color), c = x(s.color), h = Math.round(
3854
3890
  ce(o) + i * (ce(c) - ce(o))
3855
3891
  ), l = Math.round(
3856
3892
  he(o) + i * (he(c) - he(o))
3857
3893
  ), d = Math.round(
3858
3894
  fe(o) + i * (fe(c) - fe(o))
3859
3895
  ), m = de(o) + i * (de(c) - de(o));
3860
- return v([h, l, d, m]);
3896
+ return x([h, l, d, m]);
3861
3897
  }
3862
- return v(t[t.length - 1].color);
3863
- }, Aa = a.object({
3898
+ return x(t[t.length - 1].color);
3899
+ }, Ca = a.object({
3864
3900
  key: a.string(),
3865
3901
  name: a.string(),
3866
3902
  color: Ge
3867
- }), Ba = a.object({
3903
+ }), ja = a.object({
3868
3904
  key: a.string(),
3869
3905
  name: a.string(),
3870
- swatches: a.array(Aa)
3871
- }), Ua = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3906
+ swatches: a.array(Ca)
3907
+ }), Ra = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3872
3908
  __proto__: null,
3873
- BLACK: Na,
3874
- WHITE: Ia,
3909
+ BLACK: Ea,
3910
+ WHITE: Aa,
3875
3911
  ZERO: qt,
3876
3912
  aValue: de,
3877
3913
  bValue: fe,
3878
3914
  colorZ: Ge,
3879
- construct: v,
3915
+ construct: x,
3880
3916
  contrast: dt,
3881
3917
  crudeZ: Ve,
3882
- cssString: ha,
3918
+ cssString: ga,
3883
3919
  equals: zr,
3884
- fromGradient: Ea,
3885
- fromHSLA: $a,
3920
+ fromGradient: Ua,
3921
+ fromHSLA: Ia,
3886
3922
  gValue: he,
3887
- gradientZ: Ma,
3888
- grayness: ba,
3889
- hex: fa,
3890
- hsla: ma,
3891
- isColor: ca,
3892
- isCrude: la,
3893
- isDark: Oa,
3894
- isLight: va,
3895
- isZero: pa,
3923
+ gradientZ: Ba,
3924
+ grayness: va,
3925
+ hex: pa,
3926
+ hsla: wa,
3927
+ isColor: da,
3928
+ isCrude: fa,
3929
+ isDark: Ta,
3930
+ isLight: $a,
3931
+ isZero: ba,
3896
3932
  luminance: ye,
3897
- paletteZ: Ba,
3898
- pickByContrast: wa,
3933
+ paletteZ: ja,
3934
+ pickByContrast: xa,
3899
3935
  rValue: ce,
3900
- rgbCSS: da,
3901
- rgbString: Zr,
3902
- rgba1: ga,
3903
- rgbaCSS: Fr,
3904
- setAlpha: ya,
3936
+ rgbCSS: ma,
3937
+ rgbString: Fr,
3938
+ rgba1: ya,
3939
+ rgbaCSS: Zr,
3940
+ setAlpha: Oa,
3905
3941
  stopZ: Yr
3906
- }, Symbol.toStringTag, { value: "Module" })), Wr = a.int().min(0).max(255), Vr = 255, Gr = 0, Ca = {
3942
+ }, Symbol.toStringTag, { value: "Module" })), Wr = a.int().min(0).max(255), Vr = 255, Gr = 0, La = {
3907
3943
  lower: Gr,
3908
3944
  upper: Vr + 1
3909
3945
  }, Hr = a.object({
@@ -3913,7 +3949,7 @@ const na = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Pr = a.string().regex(na), re = a.n
3913
3949
  subject: Hr,
3914
3950
  resource: t,
3915
3951
  authority: Wr
3916
- }), ja = (...t) => (e) => e.filter((r) => {
3952
+ }), Da = (...t) => (e) => e.filter((r) => {
3917
3953
  let n = !1;
3918
3954
  return r.to != null && (n = t.includes(r.to.resource)), r.from != null && !n && (n = t.includes(r.from.resource)), n;
3919
3955
  }), Jr = (t) => a.object({
@@ -3922,38 +3958,38 @@ const na = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Pr = a.string().regex(na), re = a.n
3922
3958
  }), Xr = (t) => a.object({
3923
3959
  from: a.null(),
3924
3960
  to: be(t)
3925
- }), Ra = (t) => a.union([
3961
+ }), Pa = (t) => a.union([
3926
3962
  Jr(t),
3927
3963
  Xr(t),
3928
3964
  a.object({
3929
3965
  from: be(t),
3930
3966
  to: be(t)
3931
3967
  })
3932
- ]), zo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3968
+ ]), Yo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3933
3969
  __proto__: null,
3934
3970
  ABSOLUTE_AUTHORITY: Vr,
3935
- AUTHORITY_BOUNDS: Ca,
3971
+ AUTHORITY_BOUNDS: La,
3936
3972
  ZERO_AUTHORITY: Gr,
3937
3973
  acquireZ: Xr,
3938
3974
  authorityZ: Wr,
3939
- filterTransfersByChannelKey: ja,
3975
+ filterTransfersByChannelKey: Da,
3940
3976
  releaseZ: Jr,
3941
3977
  stateZ: be,
3942
3978
  subjectZ: Hr,
3943
- transferZ: Ra
3944
- }, Symbol.toStringTag, { value: "Module" })), La = (t) => Object.getOwnPropertySymbols(globalThis).includes(t), Da = (t, e) => {
3979
+ transferZ: Pa
3980
+ }, Symbol.toStringTag, { value: "Module" })), qa = (t) => Object.getOwnPropertySymbols(globalThis).includes(t), ka = (t, e) => {
3945
3981
  const r = Symbol.for(t);
3946
- if (!La(r)) {
3982
+ if (!qa(r)) {
3947
3983
  const n = e();
3948
3984
  Object.defineProperty(globalThis, r, { value: n });
3949
3985
  }
3950
3986
  return () => globalThis[r];
3951
- }, Kr = "sy_x_error", Pa = (t) => (e) => e != null && typeof e == "object" && "type" in e && typeof e.type == "string" ? e.type.startsWith(t) : e instanceof Error ? e.message.startsWith(t) : typeof e != "string" ? !1 : e.startsWith(t), Qr = (t) => class le extends Error {
3987
+ }, Kr = "sy_x_error", za = (t) => (e) => e != null && typeof e == "object" && "type" in e && typeof e.type == "string" ? e.type.startsWith(t) : e instanceof Error ? e.message.startsWith(t) : typeof e != "string" ? !1 : e.startsWith(t), Qr = (t) => class le extends Error {
3952
3988
  static discriminator = Kr;
3953
3989
  discriminator = le.discriminator;
3954
3990
  static TYPE = t;
3955
3991
  type = le.TYPE;
3956
- static matches = Pa(t);
3992
+ static matches = za(t);
3957
3993
  matches = le.matches;
3958
3994
  constructor(r, n) {
3959
3995
  super(r, n), this.name = le.TYPE;
@@ -3961,7 +3997,7 @@ const na = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Pr = a.string().regex(na), re = a.n
3961
3997
  static sub(r) {
3962
3998
  return Qr(`${t}.${r}`);
3963
3999
  }
3964
- }, qa = (t) => {
4000
+ }, Za = (t) => {
3965
4001
  if (t == null || typeof t != "object") return !1;
3966
4002
  const e = t;
3967
4003
  if (e.discriminator !== Kr) return !1;
@@ -3971,14 +4007,14 @@ const na = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Pr = a.string().regex(na), re = a.n
3971
4007
  );
3972
4008
  return !0;
3973
4009
  }, ae = "unknown", Yt = "nil";
3974
- class ka {
4010
+ class Fa {
3975
4011
  providers = [];
3976
4012
  register(e) {
3977
4013
  this.providers.push(e);
3978
4014
  }
3979
4015
  encode(e) {
3980
4016
  if (e == null) return { type: Yt, data: "" };
3981
- if (qa(e))
4017
+ if (Za(e))
3982
4018
  for (const r of this.providers) {
3983
4019
  const n = r.encode(e);
3984
4020
  if (n != null) return n;
@@ -4001,11 +4037,11 @@ class ka {
4001
4037
  return new Wt(e.data);
4002
4038
  }
4003
4039
  }
4004
- Da("synnax-error-registry", () => new ka());
4040
+ ka("synnax-error-registry", () => new Fa());
4005
4041
  class Wt extends Qr("unknown") {
4006
4042
  }
4007
4043
  a.object({ type: a.string(), data: a.string() });
4008
- const Fo = () => new Promise((t) => setTimeout(t, 0)), Zo = (t) => t ? -1 : 1, za = S.object({
4044
+ const Wo = () => new Promise((t) => setTimeout(t, 0)), Ya = S.object({
4009
4045
  jsonrpc: S.literal("2.0"),
4010
4046
  method: S.string(),
4011
4047
  // params should be z.union([z.record(z.string(), z.json()),
@@ -4016,9 +4052,9 @@ const Fo = () => new Promise((t) => setTimeout(t, 0)), Zo = (t) => t ? -1 : 1, z
4016
4052
  }), _r = S.object({
4017
4053
  jsonrpc: S.literal("2.0"),
4018
4054
  id: S.union([S.string(), S.number(), S.null()])
4019
- }), Fa = _r.extend({
4055
+ }), Wa = _r.extend({
4020
4056
  result: S.json()
4021
- }), Za = _r.extend({
4057
+ }), Va = _r.extend({
4022
4058
  error: S.object({
4023
4059
  code: S.number().int(),
4024
4060
  // This should be z.string(), but the VSCode JSON RPC implementation uses a looser
@@ -4026,15 +4062,15 @@ const Fo = () => new Promise((t) => setTimeout(t, 0)), Zo = (t) => t ? -1 : 1, z
4026
4062
  message: S.string().optional(),
4027
4063
  data: S.json().optional()
4028
4064
  })
4029
- }), Ya = S.union([Fa, Za]);
4030
- S.union([za, Ya]);
4031
- const Wa = (t, e, r) => {
4065
+ }), Ga = S.union([Wa, Va]);
4066
+ S.union([Ya, Ga]);
4067
+ const Ha = (t, e, r) => {
4032
4068
  const n = t.get(e);
4033
4069
  return n === void 0 ? (t.set(e, r), r) : n;
4034
- }, Yo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4070
+ }, Vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4035
4071
  __proto__: null,
4036
- getOrSetDefault: Wa
4037
- }, Symbol.toStringTag, { value: "Module" })), gt = a.string().regex(/^\d+\.\d+\.\d+$/), Te = (t, e, r = {}) => {
4072
+ getOrSetDefault: Ha
4073
+ }, Symbol.toStringTag, { value: "Module" })), gt = a.string().regex(/^\d+\.\d+\.\d+$/), xe = (t, e, r = {}) => {
4038
4074
  r.checkMajor ??= !0, r.checkMinor ??= !0, r.checkPatch ??= !0;
4039
4075
  const n = gt.parse(t), s = gt.parse(e), [i, o, c] = n.split(".").map(Number), [h, l, d] = s.split(".").map(Number);
4040
4076
  if (r.checkMajor) {
@@ -4050,7 +4086,7 @@ const Wa = (t, e, r) => {
4050
4086
  if (c > d) return Me;
4051
4087
  }
4052
4088
  return ne;
4053
- }, Va = (t, e, r = {}) => er(Te(t, e, r)), en = (t, e, r = {}) => _t(Te(t, e, r)), Ga = (t, e, r = {}) => Qt(Te(t, e, r)), Ha = ({
4089
+ }, Ja = (t, e, r = {}) => er(xe(t, e, r)), en = (t, e, r = {}) => _t(xe(t, e, r)), Xa = (t, e, r = {}) => Qt(xe(t, e, r)), Ka = ({
4054
4090
  name: t,
4055
4091
  migrate: e
4056
4092
  }) => (r) => {
@@ -4060,14 +4096,14 @@ const Wa = (t, e, r) => {
4060
4096
  } catch (n) {
4061
4097
  throw console.log(`${t} failed to migrate from ${r.version}`), console.error(n), n;
4062
4098
  }
4063
- }, Ja = ({
4099
+ }, Qa = ({
4064
4100
  name: t,
4065
4101
  migrations: e,
4066
4102
  targetSchema: r,
4067
4103
  defaultVersion: n,
4068
4104
  def: s
4069
4105
  }) => {
4070
- const i = Object.keys(e).sort(Te).pop();
4106
+ const i = Object.keys(e).sort(xe).pop();
4071
4107
  if (i == null)
4072
4108
  return (l) => {
4073
4109
  if (l.version ??= n, l.version !== s.version)
@@ -4112,16 +4148,16 @@ const Wa = (t, e, r) => {
4112
4148
  return console.log(`${t} failed to parse final result. Exiting with default`), console.error(d), s;
4113
4149
  }
4114
4150
  };
4115
- }, Wo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4151
+ }, Go = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4116
4152
  __proto__: null,
4117
- compareSemVer: Te,
4118
- createMigration: Ha,
4119
- migrator: Ja,
4153
+ compareSemVer: xe,
4154
+ createMigration: Ka,
4155
+ migrator: Qa,
4120
4156
  semVerNewer: en,
4121
- semVerOlder: Ga,
4157
+ semVerOlder: Xa,
4122
4158
  semVerZ: gt,
4123
- versionsEqual: Va
4124
- }, Symbol.toStringTag, { value: "Module" })), tn = ["standard", "scientific", "engineering"], Xa = a.enum(tn), Ka = (t, e, r) => {
4159
+ versionsEqual: Ja
4160
+ }, Symbol.toStringTag, { value: "Module" })), tn = ["standard", "scientific", "engineering"], _a = a.enum(tn), eo = (t, e, r) => {
4125
4161
  if (Number.isNaN(t)) return "NaN";
4126
4162
  if (t === 1 / 0) return "∞";
4127
4163
  if (t === -1 / 0) return "-∞";
@@ -4130,26 +4166,26 @@ const Wa = (t, e, r) => {
4130
4166
  return e === 0 ? "0ᴇ0" : `0.${"0".repeat(e)}ᴇ0`;
4131
4167
  let n;
4132
4168
  return r === "scientific" ? n = Math.floor(Math.log10(Math.abs(t))) : n = Math.floor(Math.log10(Math.abs(t)) / 3) * 3, `${(t / 10 ** n).toFixed(e)}ᴇ${n}`;
4133
- }, Vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4169
+ }, Ho = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4134
4170
  __proto__: null,
4135
4171
  NOTATIONS: tn,
4136
- notationZ: Xa,
4137
- stringifyNumber: Ka
4138
- }, Symbol.toStringTag, { value: "Module" })), Go = (t) => Array.isArray(t) ? [...t] : typeof t == "object" && t !== null ? { ...t } : t, rn = a.enum([
4172
+ notationZ: _a,
4173
+ stringifyNumber: eo
4174
+ }, Symbol.toStringTag, { value: "Module" })), Jo = (t) => Array.isArray(t) ? [...t] : typeof t == "object" && t !== null ? { ...t } : t, rn = a.enum([
4139
4175
  "success",
4140
4176
  "info",
4141
4177
  "warning",
4142
4178
  "error",
4143
4179
  "loading",
4144
4180
  "disabled"
4145
- ]), Qa = (t) => a.object({
4181
+ ]), to = (t) => a.object({
4146
4182
  key: a.string(),
4147
4183
  variant: rn,
4148
4184
  message: a.string(),
4149
4185
  description: a.string().optional(),
4150
- time: b.z,
4186
+ time: y.z,
4151
4187
  details: t ?? a.unknown().optional()
4152
- }), _a = (t, e) => {
4188
+ }), ro = (t, e) => {
4153
4189
  if (!(t instanceof Error)) throw t;
4154
4190
  return nn({
4155
4191
  variant: "error",
@@ -4161,20 +4197,20 @@ const Wa = (t, e, r) => {
4161
4197
  });
4162
4198
  }, nn = (t) => ({
4163
4199
  key: Lt(),
4164
- time: b.now(),
4200
+ time: y.now(),
4165
4201
  ...t
4166
- }), eo = (t, e = []) => Array.isArray(e) ? e.includes(t) ? t : void 0 : e === t ? t : void 0, Ho = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4202
+ }), no = (t, e = []) => Array.isArray(e) ? e.includes(t) ? t : void 0 : e === t ? t : void 0, Xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4167
4203
  __proto__: null,
4168
4204
  create: nn,
4169
- filterVariant: eo,
4170
- fromException: _a,
4171
- statusZ: Qa,
4205
+ filterVariant: no,
4206
+ fromException: ro,
4207
+ statusZ: to,
4172
4208
  variantZ: rn
4173
- }, Symbol.toStringTag, { value: "Module" })), to = (t, e = "") => {
4209
+ }, Symbol.toStringTag, { value: "Module" })), so = (t, e = "") => {
4174
4210
  if (typeof t == "string") return t;
4175
4211
  const r = t.length;
4176
4212
  return r === 0 ? e : r === 1 ? t[0] : r === 2 ? `${t[0]} and ${t[1]}` : `${t.slice(0, -1).join(", ")}, and ${t[r - 1]}`;
4177
- }, ro = (t) => {
4213
+ }, io = (t) => {
4178
4214
  const e = t.split(" "), r = /* @__PURE__ */ new Set(), n = e.map((o) => o.charAt(0).toLowerCase()).join("");
4179
4215
  r.add(n.replace(/-/g, "_")), r.add(n.replace(/(.)(.)/g, "$1_$2").replace(/-/g, "_"));
4180
4216
  const s = /\d+/g;
@@ -4192,13 +4228,13 @@ const Wa = (t, e, r) => {
4192
4228
  return r.add(i.join("").replace(/-/g, "_")), r.add(i.join("_").replace(/-/g, "_")), Array.from(r).filter(
4193
4229
  (o) => o.length >= 2 && o.length <= 12 && !/^\d/.test(o)
4194
4230
  );
4195
- }, no = (t, e) => t.startsWith(e) ? t.slice(e.length) : t, Jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4231
+ }, ao = (t, e) => t.startsWith(e) ? t.slice(e.length) : t, Ko = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4196
4232
  __proto__: null,
4197
- createShortIdentifiers: ro,
4198
- naturalLanguageJoin: to,
4199
- trimPrefix: no
4200
- }, Symbol.toStringTag, { value: "Module" })), so = new Error("request for lock canceled");
4201
- var io = function(t, e, r, n) {
4233
+ createShortIdentifiers: io,
4234
+ naturalLanguageJoin: so,
4235
+ trimPrefix: ao
4236
+ }, Symbol.toStringTag, { value: "Module" })), oo = new Error("request for lock canceled");
4237
+ var uo = function(t, e, r, n) {
4202
4238
  function s(i) {
4203
4239
  return i instanceof r ? i : new r(function(o) {
4204
4240
  o(i);
@@ -4225,8 +4261,8 @@ var io = function(t, e, r, n) {
4225
4261
  l((n = n.apply(t, e || [])).next());
4226
4262
  });
4227
4263
  };
4228
- class ao {
4229
- constructor(e, r = so) {
4264
+ class lo {
4265
+ constructor(e, r = oo) {
4230
4266
  this._value = e, this._cancelError = r, this._queue = [], this._weightedWaiters = [];
4231
4267
  }
4232
4268
  acquire(e = 1, r = 0) {
@@ -4238,7 +4274,7 @@ class ao {
4238
4274
  });
4239
4275
  }
4240
4276
  runExclusive(e) {
4241
- return io(this, arguments, void 0, function* (r, n = 1, s = 0) {
4277
+ return uo(this, arguments, void 0, function* (r, n = 1, s = 0) {
4242
4278
  const [i, o] = yield this.acquire(n, s);
4243
4279
  try {
4244
4280
  return yield r(i);
@@ -4251,7 +4287,7 @@ class ao {
4251
4287
  if (e <= 0)
4252
4288
  throw new Error(`invalid weight ${e}: must be positive`);
4253
4289
  return this._couldLockImmediately(e, r) ? Promise.resolve() : new Promise((n) => {
4254
- this._weightedWaiters[e - 1] || (this._weightedWaiters[e - 1] = []), oo(this._weightedWaiters[e - 1], { resolve: n, priority: r });
4290
+ this._weightedWaiters[e - 1] || (this._weightedWaiters[e - 1] = []), co(this._weightedWaiters[e - 1], { resolve: n, priority: r });
4255
4291
  });
4256
4292
  }
4257
4293
  isLocked() {
@@ -4306,7 +4342,7 @@ class ao {
4306
4342
  return (this._queue.length === 0 || this._queue[0].priority < r) && e <= this._value;
4307
4343
  }
4308
4344
  }
4309
- function oo(t, e) {
4345
+ function co(t, e) {
4310
4346
  const r = sn(t, (n) => e.priority <= n.priority);
4311
4347
  t.splice(r + 1, 0, e);
4312
4348
  }
@@ -4316,7 +4352,7 @@ function sn(t, e) {
4316
4352
  return r;
4317
4353
  return -1;
4318
4354
  }
4319
- var uo = function(t, e, r, n) {
4355
+ var ho = function(t, e, r, n) {
4320
4356
  function s(i) {
4321
4357
  return i instanceof r ? i : new r(function(o) {
4322
4358
  o(i);
@@ -4343,12 +4379,12 @@ var uo = function(t, e, r, n) {
4343
4379
  l((n = n.apply(t, e || [])).next());
4344
4380
  });
4345
4381
  };
4346
- class lo {
4382
+ class fo {
4347
4383
  constructor(e) {
4348
- this._semaphore = new ao(1, e);
4384
+ this._semaphore = new lo(1, e);
4349
4385
  }
4350
4386
  acquire() {
4351
- return uo(this, arguments, void 0, function* (e = 0) {
4387
+ return ho(this, arguments, void 0, function* (e = 0) {
4352
4388
  const [, r] = yield this._semaphore.acquire(1, e);
4353
4389
  return r;
4354
4390
  });
@@ -4369,15 +4405,15 @@ class lo {
4369
4405
  return this._semaphore.cancel();
4370
4406
  }
4371
4407
  }
4372
- class an extends lo {
4408
+ class an extends fo {
4373
4409
  constructor(e) {
4374
4410
  super(), Object.assign(this, e);
4375
4411
  }
4376
4412
  }
4377
- const co = (t) => new an(t), Xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4413
+ const go = (t) => new an(t), Qo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4378
4414
  __proto__: null,
4379
4415
  mutex: an,
4380
- newMutex: co
4416
+ newMutex: go
4381
4417
  }, Symbol.toStringTag, { value: "Module" }));
4382
4418
  function on(t) {
4383
4419
  var e, r, n = "";
@@ -4388,15 +4424,15 @@ function on(t) {
4388
4424
  } else for (r in t) t[r] && (n && (n += " "), n += r);
4389
4425
  return n;
4390
4426
  }
4391
- function ho() {
4427
+ function po() {
4392
4428
  for (var t, e, r = 0, n = "", s = arguments.length; r < s; r++) (t = arguments[r]) && (e = on(t)) && (n && (n += " "), n += e);
4393
4429
  return n;
4394
4430
  }
4395
- const fo = ho, ee = "-", Vt = "__", Ne = "--", un = (t) => {
4396
- const e = (...r) => fo(...r);
4431
+ const mo = po, ee = "-", Vt = "__", Ne = "--", un = (t) => {
4432
+ const e = (...r) => mo(...r);
4397
4433
  return e.B = (...r) => t + ee + r.join(ee), e.E = (r) => t + Vt + r, e.M = (...r) => t + Ne + r.join("-"), e.BM = (r, ...n) => e.B(r) + Ne + n.join("-"), e.BE = (r, ...n) => e.B(r) + Vt + n.join(ee), e.BEM = (r, n, ...s) => e.BE(r, n) + Ne + s.join(ee), e.extend = (r) => un(e.B(r)), e.var = (...r) => Ne + t + ee + r.join(ee), e;
4398
4434
  };
4399
- class go {
4435
+ class yo {
4400
4436
  rows = [];
4401
4437
  columns = [];
4402
4438
  prefix;
@@ -4425,72 +4461,55 @@ class go {
4425
4461
  };
4426
4462
  }
4427
4463
  }
4428
- const po = (t, e) => Object.entries(e).forEach(
4464
+ const bo = (t, e) => Object.entries(e).forEach(
4429
4465
  ([r, n]) => n != null && t.style.setProperty(r, `${n}`)
4430
- ), mo = (t, e) => Array.from(t.style).forEach((r) => {
4466
+ ), wo = (t, e) => Array.from(t.style).forEach((r) => {
4431
4467
  r.startsWith(e) && t.style.removeProperty(r);
4432
- }), yo = (t) => {
4468
+ }), Oo = (t) => {
4433
4469
  const e = un(t);
4434
- return e.visible = (r) => e.M(r ? "visible" : "hidden"), e.expanded = (r) => e.M(r ? "expanded" : "collapsed"), e.loc = (r) => e.M("location", ms.construct(r)), e.disabled = (r) => r === !0 && e.M("disabled"), e.align = (r) => e.M(r), e.dir = (r) => r != null && e.M("direction", ts.construct(r)), e.sharp = (r) => r !== !1 && e.M("sharp"), e.rounded = (r) => r !== !1 && e.M("rounded"), e.bordered = (r) => typeof r == "boolean" ? r && e.M("bordered") : r != null ? e.M(`bordered-${r.toString()}`) : e.M("bordered"), e.selected = (r) => r && e.M("selected"), e.altColor = (r) => r && e.M("alt-color"), e.editable = (r) => r && e.M("editable"), e.noSelect = e.M("no-select"), e.applyVars = po, e.removeVars = mo, e.newGridBuilder = (r) => new go(r), e.dropRegion = (r) => r && e.B("haul-drop-region"), e.px = (r) => `${r}px`, e.inheritDims = (r = !0) => r && e.M("inherit-dims"), e.shade = (r) => r != null && e.M(`shade-${r}`), e.colorVar = (r) => {
4470
+ return e.visible = (r) => e.M(r ? "visible" : "hidden"), e.expanded = (r) => e.M(r ? "expanded" : "collapsed"), e.loc = (r) => e.M("location", bs.construct(r)), e.disabled = (r) => r === !0 && e.M("disabled"), e.align = (r) => e.M(r), e.dir = (r) => r != null && e.M("direction", ns.construct(r)), e.sharp = (r) => r !== !1 && e.M("sharp"), e.rounded = (r) => r !== !1 && e.M("rounded"), e.bordered = (r) => typeof r == "boolean" ? r && e.M("bordered") : r != null ? e.M(`bordered-${r.toString()}`) : e.M("bordered"), e.selected = (r) => r && e.M("selected"), e.altColor = (r) => r && e.M("alt-color"), e.editable = (r) => r && e.M("editable"), e.noSelect = e.M("no-select"), e.applyVars = bo, e.removeVars = wo, e.newGridBuilder = (r) => new yo(r), e.dropRegion = (r) => r && e.B("haul-drop-region"), e.px = (r) => `${r}px`, e.inheritDims = (r = !0) => r && e.M("inherit-dims"), e.shade = (r) => r != null && e.M(`shade-${r}`), e.colorVar = (r) => {
4435
4471
  if (!(r == null || r === !1))
4436
- return typeof r == "number" ? `var(--${t}-gray-l${r})` : Ua.cssString(r);
4472
+ return typeof r == "number" ? `var(--${t}-gray-l${r})` : Ra.cssString(r);
4437
4473
  }, e.levelSizeVar = (r) => `var(--${t}-${r}-size)`, e.level = (r) => e.M(`level-${r}`), e;
4438
- }, Ko = yo("pluto");
4474
+ }, _o = Oo("pluto");
4439
4475
  export {
4440
- hs as $,
4441
- Wo as A,
4442
- Po as B,
4443
- Ko as C,
4476
+ Go as A,
4477
+ zo as B,
4478
+ _o as C,
4444
4479
  I as D,
4445
- cs as E,
4446
- xt as F,
4447
- H as G,
4448
- Io as H,
4480
+ Ao as H,
4449
4481
  E as I,
4450
- Bo as J,
4451
- No as K,
4452
- fs as L,
4453
- Bt as M,
4454
- Nt as N,
4455
- xo as O,
4456
- us as P,
4457
- T as Q,
4458
- di as R,
4459
- qo as S,
4460
- q as T,
4461
- ti as U,
4462
- ve as V,
4463
- Ro as W,
4464
- G as X,
4465
- V as Y,
4466
- _s as Z,
4467
- Mo as _,
4468
- vo as a,
4469
- Qs as a0,
4470
- Zo as a1,
4471
- Eo as b,
4472
- Ua as c,
4473
- So as d,
4474
- J as e,
4482
+ jo as J,
4483
+ Eo as K,
4484
+ J as O,
4485
+ pi as R,
4486
+ Zo as S,
4487
+ Po as W,
4488
+ Bo as _,
4489
+ $o as a,
4490
+ Uo as b,
4491
+ Ra as c,
4492
+ Mo as d,
4493
+ No as e,
4475
4494
  $ as f,
4476
- ts as g,
4477
- Vo as h,
4495
+ Ho as g,
4496
+ Le as h,
4478
4497
  O as i,
4479
- Le as j,
4480
- Ao as k,
4481
- Xo as l,
4482
- $o as m,
4498
+ Qo as j,
4499
+ Co as k,
4500
+ Io as l,
4501
+ bs as m,
4483
4502
  un as n,
4484
- ko as o,
4485
- ms as p,
4486
- zo as q,
4487
- b as r,
4488
- Jo as s,
4489
- Fo as t,
4490
- ho as u,
4503
+ Fo as o,
4504
+ ns as p,
4505
+ Yo as q,
4506
+ y as r,
4507
+ Ko as s,
4508
+ Wo as t,
4509
+ po as u,
4491
4510
  Ur as v,
4492
- Ho as w,
4493
- Yo as x,
4494
- Go as y,
4495
- wo as z
4511
+ Xo as w,
4512
+ Vo as x,
4513
+ Jo as y,
4514
+ xo as z
4496
4515
  };