@synnaxlabs/x 0.56.0 → 0.56.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/x.js CHANGED
@@ -29,27 +29,27 @@ var n = Object.defineProperty, r = (e, t) => {
29
29
  upsert: () => o,
30
30
  upsertKeyed: () => c
31
31
  }), d = /* @__PURE__ */ r({
32
- camelToSnake: () => re,
33
- capitalize: () => ie,
32
+ camelToSnake: () => ie,
33
+ capitalize: () => ae,
34
34
  preserveCase: () => p,
35
- snakeToCamel: () => ne,
36
- toKebab: () => ce,
37
- toProperNoun: () => le
35
+ snakeToCamel: () => re,
36
+ toKebab: () => le,
37
+ toProperNoun: () => ue
38
38
  }), f = "synnax.caseconv.preserveCase", p = (e) => (e[f] = !0, e), m = (e) => {
39
39
  if (typeof e != "object" || !e) return !1;
40
40
  if (f in e) return !0;
41
41
  let t = e._zod?.def;
42
42
  return t == null ? !1 : t.innerType && m(t.innerType) ? !0 : t.type === "union" && Array.isArray(t.options) ? t.options.some(m) : t.type === "pipe" ? m(t.in) || m(t.out) : !1;
43
- }, h = (e) => {
43
+ }, ee = (e) => {
44
44
  if (e == null) return;
45
45
  let t = e._zod?.def;
46
46
  if (t?.type === "array" && t.element != null) return t.element;
47
- if (t?.innerType != null) return h(t.innerType);
47
+ if (t?.innerType != null) return ee(t.innerType);
48
48
  if (t?.type === "union" && Array.isArray(t.options)) for (let e of t.options) {
49
- let t = h(e);
49
+ let t = ee(e);
50
50
  if (t != null) return t;
51
51
  }
52
- }, g = (e) => {
52
+ }, h = (e) => {
53
53
  if (e == null) return null;
54
54
  let t = e;
55
55
  if (t.shape != null) return t.shape;
@@ -59,45 +59,45 @@ var n = Object.defineProperty, r = (e, t) => {
59
59
  }
60
60
  let n = t._zod?.def;
61
61
  if (n == null) return null;
62
- if (n.innerType != null) return g(n.innerType);
62
+ if (n.innerType != null) return h(n.innerType);
63
63
  if (n.type === "union" && Array.isArray(n.options)) {
64
64
  let e = null;
65
65
  for (let t of n.options) {
66
- let n = g(t);
66
+ let n = h(t);
67
67
  if (n != null) if (e == null) e = { ...n };
68
68
  else for (let t in n) t in e || (e[t] = n[t]);
69
69
  }
70
70
  return e;
71
71
  }
72
- return n.type === "pipe" ? g(n.in) ?? g(n.out) : null;
73
- }, ee = (e) => {
72
+ return n.type === "pipe" ? h(n.in) ?? h(n.out) : null;
73
+ }, te = (e) => {
74
74
  if (e.length === 0) return e;
75
75
  let t = e.indexOf("_") === -1 ? e : e.replace(/_[a-z]/g, (e) => e[1].toUpperCase()), n = t.charCodeAt(0);
76
76
  return n < 65 || n > 90 || t.length > 1 && t.charCodeAt(1) >= 65 && t.charCodeAt(1) <= 90 ? t : String.fromCharCode(n + 32) + t.slice(1);
77
- }, te = (e) => {
78
- let t = (n, r = ae) => {
77
+ }, ne = (e) => {
78
+ let t = (n, r = oe) => {
79
79
  if (typeof n == "string") return e(n);
80
80
  if (Array.isArray(n)) {
81
- let e = h(r.schema), i = {
81
+ let e = ee(r.schema), i = {
82
82
  recursive: r.recursive,
83
83
  recursiveInArray: r.recursiveInArray,
84
84
  schema: e
85
85
  };
86
86
  return n.map((e) => t(e, i));
87
87
  }
88
- if (!oe(n) || r.schema != null && m(r.schema)) return n;
88
+ if (!se(n) || r.schema != null && m(r.schema)) return n;
89
89
  let i = r.recursive ?? !0, a = r.recursiveInArray ?? i, o = r.schema, s = {}, c = n;
90
90
  if ("toJSON" in c && typeof c.toJSON == "function") return t(c.toJSON(), r);
91
- let l = g(o), u = {
91
+ let l = h(o), u = {
92
92
  recursive: i,
93
93
  recursiveInArray: a,
94
94
  schema: void 0
95
95
  }, d = Object.keys(c);
96
96
  for (let n = 0; n < d.length; n++) {
97
97
  let r = d[n], o = c[r], f = e(r), p = l == null ? void 0 : l[r] ?? l[f] ?? void 0;
98
- i && (oe(o) ? se(o) || (u.schema = p, o = t(o, u)) : a && Array.isArray(o) && (u.schema = h(p), o = o.map((e) => {
99
- if (oe(e)) {
100
- if (!se(e)) return t(e, u);
98
+ i && (se(o) ? ce(o) || (u.schema = p, o = t(o, u)) : a && Array.isArray(o) && (u.schema = ee(p), o = o.map((e) => {
99
+ if (se(e)) {
100
+ if (!ce(e)) return t(e, u);
101
101
  } else if (Array.isArray(e)) return t({ key: e }, u).key;
102
102
  return e;
103
103
  }))), s[f] = o;
@@ -105,22 +105,22 @@ var n = Object.defineProperty, r = (e, t) => {
105
105
  return s;
106
106
  };
107
107
  return t;
108
- }, ne = te(ee), re = te((e) => e.replace(/([a-z0-9])([A-Z])/g, (e, t, n) => `${t}_${n.toLowerCase()}`)), ie = (e) => e.length === 0 ? e : e[0].toUpperCase() + e.slice(1), ae = {
108
+ }, re = ne(te), ie = ne((e) => e.replace(/([a-z0-9])([A-Z])/g, (e, t, n) => `${t}_${n.toLowerCase()}`)), ae = (e) => e.length === 0 ? e : e[0].toUpperCase() + e.slice(1), oe = {
109
109
  recursive: !0,
110
110
  recursiveInArray: !0,
111
111
  schema: void 0
112
- }, oe = (e) => typeof e == "object" && !!e && !Array.isArray(e), se = (e) => e instanceof Uint8Array || e instanceof Number || e instanceof String, ce = te((e) => e.replace(/[\s_]+/g, "-").replace(/([a-z0-9])([A-Z])/g, (e, t, n) => `${t}-${n.toLowerCase()}`).toLowerCase()), le = te((e) => {
112
+ }, se = (e) => typeof e == "object" && !!e && !Array.isArray(e), ce = (e) => e instanceof Uint8Array || e instanceof Number || e instanceof String, le = ne((e) => e.replace(/[\s_]+/g, "-").replace(/([a-z0-9])([A-Z])/g, (e, t, n) => `${t}-${n.toLowerCase()}`).toLowerCase()), ue = ne((e) => {
113
113
  if (e.length === 0) return e;
114
114
  let t = e.replace(/[_-]/g, " ");
115
115
  return t = t.replace(/([a-z0-9])([A-Z])/g, (e, t, n) => `${t} ${n}`), t = t.replace(/([A-Z]+)([A-Z][a-z])/g, (e, t, n) => `${t} ${n}`), t = t.replace(/\s+/g, " ").trim(), t = t.replace(/\b\w/g, (e) => e.toUpperCase()), t;
116
- }), ue = /* @__PURE__ */ r({
117
- isObject: () => _,
118
- isPlainObject: () => de
119
- }), _ = (e) => typeof e == "object" && !!e && !Array.isArray(e), de = (e) => {
116
+ }), de = /* @__PURE__ */ r({
117
+ isObject: () => g,
118
+ isPlainObject: () => fe
119
+ }), g = (e) => typeof e == "object" && !!e && !Array.isArray(e), fe = (e) => {
120
120
  if (typeof e != "object" || !e || Array.isArray(e)) return !1;
121
121
  let t = Object.getPrototypeOf(e);
122
122
  return t === Object.prototype || t === null;
123
- }, fe = (e) => e.nullable().transform((e) => e === null ? void 0 : e).optional(), pe = (e, t) => {
123
+ }, pe = (e) => e.nullable().transform((e) => e === null ? void 0 : e).optional(), me = (e, t) => {
124
124
  let n = e;
125
125
  for (let e of t) {
126
126
  if (typeof n != "object" || !n) return {
@@ -138,13 +138,13 @@ var n = Object.defineProperty, r = (e, t) => {
138
138
  present: !0,
139
139
  value: n
140
140
  };
141
- }, me = (e) => {
141
+ }, he = (e) => {
142
142
  try {
143
143
  return structuredClone(e);
144
144
  } catch {
145
145
  return console.warn("Failed to deep copy object, falling back to JSON.parse(JSON.stringify)", e), console.trace(), JSON.parse(JSON.stringify(e));
146
146
  }
147
- }, he = (e, t, n = "") => {
147
+ }, ge = (e, t, n = "") => {
148
148
  let r = {}, i = (e, t, n) => {
149
149
  if (typeof e != typeof t || e === null || t === null) {
150
150
  r[n] = [e, t];
@@ -162,13 +162,13 @@ var n = Object.defineProperty, r = (e, t) => {
162
162
  else e !== t && (r[n] = [e, t]);
163
163
  };
164
164
  return i(e, t, n), r;
165
- }, ge = (e, t) => {
165
+ }, _e = (e, t) => {
166
166
  let n = Array.isArray(e), r = Array.isArray(t);
167
167
  if (n !== r) return !1;
168
168
  if (n && r) {
169
169
  let n = e, r = t;
170
170
  if (n.length !== r.length) return !1;
171
- for (let e = 0; e < n.length; e++) if (!ge(n[e], r[e])) return !1;
171
+ for (let e = 0; e < n.length; e++) if (!_e(n[e], r[e])) return !1;
172
172
  return !0;
173
173
  }
174
174
  if (e == null || t == null || typeof e != "object" || typeof t != "object") return e === t;
@@ -178,42 +178,42 @@ var n = Object.defineProperty, r = (e, t) => {
178
178
  for (let n of i) {
179
179
  let r = e[n], i = t[n];
180
180
  if (typeof r == "object" && typeof i == "object") {
181
- if (!ge(r, i)) return !1;
181
+ if (!_e(r, i)) return !1;
182
182
  } else if (r !== i) return !1;
183
183
  }
184
184
  return !0;
185
- }, _e = (e, t) => {
185
+ }, ve = (e, t) => {
186
186
  if (typeof e != "object" || !e) return e === t;
187
187
  let n = Object.keys(e), r = Object.keys(t);
188
188
  if (r.length > n.length) return !1;
189
189
  for (let n of r) {
190
190
  let r = e[n], i = t[n];
191
191
  if (typeof r == "object" && typeof i == "object") {
192
- if (!_e(r, i)) return !1;
192
+ if (!ve(r, i)) return !1;
193
193
  } else if (r !== i) return !1;
194
194
  }
195
195
  return !0;
196
- }, ve = (e, t, n = ".") => {
196
+ }, ye = (e, t, n = ".") => {
197
197
  let r = e.split(n);
198
198
  return r.map((e, i) => {
199
199
  let a = t(e, i, r);
200
200
  return a == null ? null : typeof a == "string" ? a : a.join(n);
201
201
  }).filter((e) => e != null).join(n);
202
- }, v = (e, t) => {
202
+ }, _ = (e, t) => {
203
203
  if (!Array.isArray(e)) return e[t];
204
204
  let n = e[t];
205
205
  if (n != null || e.length == 0) return n;
206
206
  let r = e[0];
207
207
  if (typeof r == "object" && "key" in r) return e.find((e) => e.key === t);
208
- }, ye = (e, t) => {
208
+ }, be = (e, t) => {
209
209
  let n = e.split(".");
210
210
  return n.forEach((e, r) => {
211
- t = v(t, e), typeof t == "object" && t && "key" in t && (n[r] = t.key);
211
+ t = _(t, e), typeof t == "object" && t && "key" in t && (n[r] = t.key);
212
212
  }), n.join(".");
213
- }, be = (e, t) => {
213
+ }, xe = (e, t) => {
214
214
  let n = e.split(".");
215
215
  return t < 0 ? n[n.length + t] : n[t];
216
- }, xe = (e, t) => {
216
+ }, Se = (e, t) => {
217
217
  if (t.length === 0) return !0;
218
218
  let n = e.split("."), r = t.split(".");
219
219
  if (r.length > n.length) return !1;
@@ -222,17 +222,17 @@ var n = Object.defineProperty, r = (e, t) => {
222
222
  if (i !== "*" && t !== i) return !1;
223
223
  }
224
224
  return !0;
225
- }, y = (e) => {
225
+ }, v = (e) => {
226
226
  let t = parseInt(e, 10);
227
227
  return isNaN(t) || t < 0 || t.toString() !== e ? null : t;
228
- }, Se = (e, t) => {
228
+ }, Ce = (e, t) => {
229
229
  for (let n = 1; n <= t.length; n++) {
230
230
  let r = t.slice(0, n).join(".");
231
- if (v(e, r) != null) return [r, n];
231
+ if (_(e, r) != null) return [r, n];
232
232
  }
233
233
  return null;
234
- }, Ce = ((e, t, n = { optional: !1 }) => {
235
- let { optional: r, getter: i = v } = n;
234
+ }, we = ((e, t, n = { optional: !1 }) => {
235
+ let { optional: r, getter: i = _ } = n;
236
236
  if (t === "") return e;
237
237
  let a = t.split(".");
238
238
  if (a.length === 1) {
@@ -260,16 +260,119 @@ var n = Object.defineProperty, r = (e, t) => {
260
260
  throw Error(`Path ${t} does not exist. ${a[n]} is undefined`);
261
261
  };
262
262
  return o(e, 0);
263
- }), we = (e, t) => Ce(e, t, { optional: !0 }) !== null, Te = (e, ...t) => {
263
+ }), Te = (e, t) => we(e, t, { optional: !0 }) !== null, Ee = (e) => Object.getOwnPropertySymbols(globalThis).includes(e), De = (e, t) => {
264
+ let n = Symbol.for(e);
265
+ if (!Ee(n)) {
266
+ let e = t();
267
+ Object.defineProperty(globalThis, n, { value: e });
268
+ }
269
+ return () => globalThis[n];
270
+ }, Oe = /* @__PURE__ */ r({
271
+ Canceled: () => Ue,
272
+ NONE: () => "nil",
273
+ NotImplemented: () => We,
274
+ UNKNOWN: () => Ne,
275
+ Unknown: () => Ve,
276
+ createTyped: () => y,
277
+ decode: () => Be,
278
+ encode: () => ze,
279
+ fromUnknown: () => Me,
280
+ isTyped: () => je,
281
+ payloadZ: () => He,
282
+ register: () => Re
283
+ }), ke = "sy_x_error", Ae = (e) => (t) => typeof t == "object" && t && "type" in t && typeof t.type == "string" ? t.type.startsWith(e) : t instanceof Error ? t.message.startsWith(e) : typeof t == "string" ? t.startsWith(e) : !1, y = (e) => class t extends Error {
284
+ static discriminator = ke;
285
+ discriminator = t.discriminator;
286
+ static TYPE = e;
287
+ type = t.TYPE;
288
+ static matches = Ae(e);
289
+ matches = t.matches;
290
+ constructor(e, n) {
291
+ super(e, n), this.name = t.TYPE;
292
+ }
293
+ static sub(t) {
294
+ return y(`${e}.${t}`);
295
+ }
296
+ }, je = (e) => {
297
+ if (typeof e != "object" || !e) return !1;
298
+ let t = e;
299
+ if (t.discriminator !== ke) return !1;
300
+ if (!("type" in t)) throw Error(`X Error is missing its type property: ${JSON.stringify(t)}`);
301
+ return !0;
302
+ }, Me = (e) => {
303
+ if (e instanceof Error) return e;
304
+ let t;
305
+ try {
306
+ t = JSON.stringify(e) ?? String(e);
307
+ } catch {
308
+ t = String(e);
309
+ }
310
+ return Error(t, { cause: e });
311
+ }, Ne = "unknown", Pe = (e, t) => ({
312
+ ...e,
313
+ name: t.name,
314
+ stack: t.stack
315
+ }), Fe = (e, t) => (t.name != null && (e.name = t.name), t.stack != null && (e.stack = t.stack), e), Ie = class {
316
+ providers = [];
317
+ register(e) {
318
+ this.providers.push(e);
319
+ }
320
+ encode(e) {
321
+ if (e == null) return {
322
+ type: "nil",
323
+ data: ""
324
+ };
325
+ if (je(e)) for (let t of this.providers) {
326
+ let n = t.encode(e);
327
+ if (n != null) return Pe(n, e);
328
+ }
329
+ if (e instanceof Error) return Pe({
330
+ type: Ne,
331
+ data: e.message
332
+ }, e);
333
+ if (typeof e == "string") return {
334
+ type: Ne,
335
+ data: e
336
+ };
337
+ try {
338
+ return {
339
+ type: Ne,
340
+ data: JSON.stringify(e)
341
+ };
342
+ } catch {
343
+ return {
344
+ type: Ne,
345
+ data: "unable to encode error information"
346
+ };
347
+ }
348
+ }
349
+ decode(e) {
350
+ if (e == null || e.type === "nil") return null;
351
+ if (e.type === "unknown") return Fe(new Ve(e.data), e);
352
+ for (let t of this.providers) {
353
+ let n = t.decode(e);
354
+ if (n != null) return Fe(n, e);
355
+ }
356
+ return Fe(new Ve(e.data), e);
357
+ }
358
+ }, Le = De("synnax-error-registry", () => new Ie()), Re = ({ encode: e, decode: t }) => Le().register({
359
+ encode: e,
360
+ decode: t
361
+ }), ze = (e) => Le().encode(e), Be = (e) => e == null ? null : Le().decode(e), Ve = class extends y("unknown") {}, He = t.object({
362
+ type: t.string(),
363
+ data: t.string(),
364
+ name: t.string().optional(),
365
+ stack: t.string().optional()
366
+ }), Ue = class extends y("canceled") {}, We = class extends y("not_implemented") {}, Ge = (e, ...t) => {
264
367
  if (t.length === 0) return e;
265
368
  let n = t.shift();
266
- if (_(e) && _(n)) for (let t in n) try {
267
- _(n[t]) ? (t in e || Object.assign(e, { [t]: {} }), Te(e[t], n[t])) : Object.assign(e, { [t]: n[t] });
369
+ if (g(e) && g(n)) for (let t in n) try {
370
+ g(n[t]) ? (t in e || Object.assign(e, { [t]: {} }), Ge(e[t], n[t])) : Object.assign(e, { [t]: n[t] });
268
371
  } catch (e) {
269
- throw e instanceof TypeError ? TypeError(`.${t}: ${e.message}`, { cause: e }) : e;
372
+ throw e instanceof TypeError ? TypeError(`.${t}: ${e.message}`, { cause: e }) : Me(e);
270
373
  }
271
- return Te(e, ...t);
272
- }, Ee = (e, t, n) => {
374
+ return Ge(e, ...t);
375
+ }, Ke = (e, t, n) => {
273
376
  let r = (e, t, n) => {
274
377
  if (n.def?.type === "union") return n.def.options.reduce((e, n) => r(e, t, n), e);
275
378
  if (n.def?.type === "intersection") return r(r(e, t, n.def.left), t, n.def.right);
@@ -290,7 +393,7 @@ var n = Object.defineProperty, r = (e, t) => {
290
393
  return e;
291
394
  };
292
395
  return r({ ...e }, t, n);
293
- }, De = (e, t) => {
396
+ }, qe = (e, t) => {
294
397
  let n = t.split("."), r = e, i = 0;
295
398
  for (; i < n.length;) {
296
399
  if (i === n.length - 1) {
@@ -342,35 +445,35 @@ var n = Object.defineProperty, r = (e, t) => {
342
445
  }
343
446
  }
344
447
  if (!e) {
345
- let e = v(r, n[i]);
448
+ let e = _(r, n[i]);
346
449
  if (e == null) return;
347
450
  r = e, i++;
348
451
  }
349
452
  }
350
- }, Oe = (e, t, n) => {
453
+ }, Je = (e, t, n) => {
351
454
  let r = t.split("."), i = e, a = 0;
352
455
  for (; a < r.length - 1;) {
353
- let e = Se(i, r.slice(a, r.length - 1)), t;
456
+ let e = Ce(i, r.slice(a, r.length - 1)), t;
354
457
  e == null ? (t = r[a], a++) : [t, a] = [e[0], a + e[1]];
355
- let n = v(i, t);
458
+ let n = _(i, t);
356
459
  if (n == null) {
357
- let e = r[a], o = y(e);
358
- o == null && e.startsWith("-") && y(e.substring(1)) != null && (o = 0), n = o == null ? {} : [], i[t] = n;
460
+ let e = r[a], o = v(e);
461
+ o == null && e.startsWith("-") && v(e.substring(1)) != null && (o = 0), n = o == null ? {} : [], i[t] = n;
359
462
  }
360
463
  i = n;
361
464
  }
362
465
  try {
363
466
  let e = r[r.length - 1];
364
467
  if (Array.isArray(i)) {
365
- let t = y(e);
468
+ let t = v(e);
366
469
  if (t == null) {
367
470
  if (e.startsWith("-")) {
368
- let n = y(e.substring(1));
471
+ let n = v(e.substring(1));
369
472
  n != null && (t = i.length - n);
370
473
  }
371
474
  if (t == null) {
372
475
  if (i.length === 0) {
373
- let t = y(e);
476
+ let t = v(e);
374
477
  if (t != null) {
375
478
  i[t] = n;
376
479
  return;
@@ -390,136 +493,43 @@ var n = Object.defineProperty, r = (e, t) => {
390
493
  i[t] = n;
391
494
  return;
392
495
  }
393
- let t = Se(i, [e]);
496
+ let t = Ce(i, [e]);
394
497
  if (t != null) {
395
498
  i[t[0]] = n;
396
499
  return;
397
500
  }
398
501
  i[e] = n;
399
502
  } catch (r) {
400
- throw console.error("failed to set value", n, "at path", t, "on object", e), r;
503
+ throw console.error("failed to set value", n, "at path", t, "on object", e), Me(r);
401
504
  }
402
- }, ke = /* @__PURE__ */ r({
505
+ }, Ye = /* @__PURE__ */ r({
403
506
  SEPARATOR: () => ".",
404
- atKeys: () => pe,
405
- copy: () => me,
406
- defaultGetter: () => v,
407
- difference: () => he,
408
- element: () => be,
409
- equal: () => ge,
410
- findBestKey: () => Se,
411
- get: () => Ce,
412
- getIndex: () => y,
413
- has: () => we,
414
- override: () => Te,
415
- overrideValidItems: () => Ee,
416
- partialEqual: () => _e,
417
- pathsMatch: () => xe,
418
- remove: () => De,
419
- resolvePath: () => ye,
420
- set: () => Oe,
421
- transformPath: () => ve
422
- }), Ae = (e) => Object.getOwnPropertySymbols(globalThis).includes(e), je = (e, t) => {
423
- let n = Symbol.for(e);
424
- if (!Ae(n)) {
425
- let e = t();
426
- Object.defineProperty(globalThis, n, { value: e });
427
- }
428
- return () => globalThis[n];
429
- }, Me = /* @__PURE__ */ r({
430
- Canceled: () => qe,
431
- NONE: () => "nil",
432
- NotImplemented: () => Je,
433
- UNKNOWN: () => Le,
434
- Unknown: () => Ge,
435
- createTyped: () => Fe,
436
- decode: () => We,
437
- encode: () => Ue,
438
- isTyped: () => Ie,
439
- payloadZ: () => Ke,
440
- register: () => He
441
- }), Ne = "sy_x_error", Pe = (e) => (t) => typeof t == "object" && t && "type" in t && typeof t.type == "string" ? t.type.startsWith(e) : t instanceof Error ? t.message.startsWith(e) : typeof t == "string" ? t.startsWith(e) : !1, Fe = (e) => class t extends Error {
442
- static discriminator = Ne;
443
- discriminator = t.discriminator;
444
- static TYPE = e;
445
- type = t.TYPE;
446
- static matches = Pe(e);
447
- matches = t.matches;
448
- constructor(e, n) {
449
- super(e, n), this.name = t.TYPE;
450
- }
451
- static sub(t) {
452
- return Fe(`${e}.${t}`);
453
- }
454
- }, Ie = (e) => {
455
- if (typeof e != "object" || !e) return !1;
456
- let t = e;
457
- if (t.discriminator !== Ne) return !1;
458
- if (!("type" in t)) throw Error(`X Error is missing its type property: ${JSON.stringify(t)}`);
459
- return !0;
460
- }, Le = "unknown", Re = (e, t) => ({
461
- ...e,
462
- name: t.name,
463
- stack: t.stack
464
- }), ze = (e, t) => (t.name != null && (e.name = t.name), t.stack != null && (e.stack = t.stack), e), Be = class {
465
- providers = [];
466
- register(e) {
467
- this.providers.push(e);
468
- }
469
- encode(e) {
470
- if (e == null) return {
471
- type: "nil",
472
- data: ""
473
- };
474
- if (Ie(e)) for (let t of this.providers) {
475
- let n = t.encode(e);
476
- if (n != null) return Re(n, e);
477
- }
478
- if (e instanceof Error) return Re({
479
- type: Le,
480
- data: e.message
481
- }, e);
482
- if (typeof e == "string") return {
483
- type: Le,
484
- data: e
485
- };
486
- try {
487
- return {
488
- type: Le,
489
- data: JSON.stringify(e)
490
- };
491
- } catch {
492
- return {
493
- type: Le,
494
- data: "unable to encode error information"
495
- };
496
- }
497
- }
498
- decode(e) {
499
- if (e == null || e.type === "nil") return null;
500
- if (e.type === "unknown") return ze(new Ge(e.data), e);
501
- for (let t of this.providers) {
502
- let n = t.decode(e);
503
- if (n != null) return ze(n, e);
504
- }
505
- return ze(new Ge(e.data), e);
506
- }
507
- }, Ve = je("synnax-error-registry", () => new Be()), He = ({ encode: e, decode: t }) => Ve().register({
508
- encode: e,
509
- decode: t
510
- }), Ue = (e) => Ve().encode(e), We = (e) => e == null ? null : Ve().decode(e), Ge = class extends Fe("unknown") {}, Ke = t.object({
511
- type: t.string(),
512
- data: t.string(),
513
- name: t.string().optional(),
514
- stack: t.string().optional()
515
- }), qe = class extends Fe("canceled") {}, Je = class extends Fe("not_implemented") {}, Ye = (e) => {
507
+ atKeys: () => me,
508
+ copy: () => he,
509
+ defaultGetter: () => _,
510
+ difference: () => ge,
511
+ element: () => xe,
512
+ equal: () => _e,
513
+ findBestKey: () => Ce,
514
+ get: () => we,
515
+ getIndex: () => v,
516
+ has: () => Te,
517
+ override: () => Ge,
518
+ overrideValidItems: () => Ke,
519
+ partialEqual: () => ve,
520
+ pathsMatch: () => Se,
521
+ remove: () => qe,
522
+ resolvePath: () => be,
523
+ set: () => Je,
524
+ transformPath: () => ye
525
+ }), Xe = (e) => {
516
526
  if (e.length === 0) return "<root>";
517
527
  let t = "";
518
528
  return e.forEach((e, n) => {
519
529
  typeof e == "number" ? t += `[${e}]` : n === 0 ? t += String(e) : t += `.${String(e)}`;
520
530
  }), t;
521
- }, Xe = 200, Ze = 10, Qe = 8, $e = (e, t = {}) => {
522
- let n = t.maxStringLength ?? Xe, r = t.maxArrayLength ?? Ze, i = t.maxDepth ?? Qe, a = (e, t) => {
531
+ }, Ze = 200, Qe = 10, $e = 8, et = (e, t = {}) => {
532
+ let n = t.maxStringLength ?? Ze, r = t.maxArrayLength ?? Qe, i = t.maxDepth ?? $e, a = (e, t) => {
523
533
  if (e === null) return null;
524
534
  if (e === void 0) return "[undefined]";
525
535
  let o = typeof e;
@@ -535,7 +545,7 @@ var n = Object.defineProperty, r = (e, t) => {
535
545
  let n = e.slice(0, r).map((e) => a(e, t + 1));
536
546
  return e.length > r && n.push(`…(+${e.length - r} more)`), n;
537
547
  }
538
- if (de(e)) {
548
+ if (fe(e)) {
539
549
  if (t >= i) return "[Object]";
540
550
  let n = {};
541
551
  for (let [r, i] of Object.entries(e)) n[r] = a(i, t + 1);
@@ -550,18 +560,18 @@ var n = Object.defineProperty, r = (e, t) => {
550
560
  }
551
561
  };
552
562
  return a(e, 0);
553
- }, et = (e, t = {}) => JSON.stringify($e(e, t), null, 2), tt = /* @__PURE__ */ r({
554
- path: () => Ye,
555
- stringify: () => et,
556
- value: () => $e
557
- }), nt = /* @__PURE__ */ r({
563
+ }, tt = (e, t = {}) => JSON.stringify(et(e, t), null, 2), nt = /* @__PURE__ */ r({
564
+ path: () => Xe,
565
+ stringify: () => tt,
566
+ value: () => et
567
+ }), rt = /* @__PURE__ */ r({
558
568
  ValueExtension: () => x,
559
- is: () => st,
569
+ is: () => ct,
560
570
  isCrudeValueExtension: () => b,
561
- isHashable: () => it,
562
- isNonZero: () => ot,
563
- isStringer: () => rt,
564
- isZero: () => at
571
+ isHashable: () => at,
572
+ isNonZero: () => st,
573
+ isStringer: () => it,
574
+ isZero: () => ot
565
575
  }), b = (e) => typeof e == "object" && !!e && "value" in e, x = class {
566
576
  value;
567
577
  constructor(e) {
@@ -576,8 +586,8 @@ var n = Object.defineProperty, r = (e, t) => {
576
586
  toString() {
577
587
  return this.value.toString();
578
588
  }
579
- }, rt = (e) => typeof e == "object" && !!e && "toString" in e, it = (e) => typeof e == "object" && !!e && "hash" in e && typeof e.hash == "function", at = (e) => {
580
- if (rt(e)) return e?.toString().length === 0;
589
+ }, it = (e) => typeof e == "object" && !!e && "toString" in e, at = (e) => typeof e == "object" && !!e && "hash" in e && typeof e.hash == "function", ot = (e) => {
590
+ if (it(e)) return e?.toString().length === 0;
581
591
  switch (typeof e) {
582
592
  case "string": return e.length === 0;
583
593
  case "number": return e === 0;
@@ -587,11 +597,11 @@ var n = Object.defineProperty, r = (e, t) => {
587
597
  case "object": return e == null;
588
598
  default: return !1;
589
599
  }
590
- }, ot = (e) => !at(e), st = (e) => e == null || typeof e != "object" && typeof e != "function", ct = "value", lt = "zod.parse", ut = "✗", dt = 60, ft = {
600
+ }, st = (e) => !ot(e), ct = (e) => e == null || typeof e != "object" && typeof e != "function", lt = "value", ut = "zod.parse", dt = "✗", ft = 60, pt = {
591
601
  maxStringLength: 60,
592
602
  maxArrayLength: 3,
593
603
  maxDepth: 3
594
- }, pt = (e) => e.slice(0, -1), mt = (e) => {
604
+ }, mt = (e) => e.slice(0, -1), ht = (e) => {
595
605
  switch (e.code) {
596
606
  case "invalid_type": return `expected ${e.expected}`;
597
607
  case "invalid_value": return `expected one of ${JSON.stringify(e.values)}`;
@@ -609,41 +619,41 @@ var n = Object.defineProperty, r = (e, t) => {
609
619
  case "custom": return e.message || "custom validation failed";
610
620
  default: return e.message;
611
621
  }
612
- }, ht = (e, t, n) => {
613
- let r = JSON.stringify($e(t, n));
614
- return `${mt(e)}, received ${r}`;
615
- }, gt = (e) => {
622
+ }, gt = (e, t, n) => {
623
+ let r = JSON.stringify(et(t, n));
624
+ return `${ht(e)}, received ${r}`;
625
+ }, _t = (e) => {
616
626
  let t = 0;
617
627
  for (let n of e) {
618
628
  if (n.path.length > t && (t = n.path.length), n.code === "invalid_union" && "errors" in n) for (let e of n.errors) {
619
- let n = gt(e);
629
+ let n = _t(e);
620
630
  n > t && (t = n);
621
631
  }
622
632
  if ((n.code === "invalid_key" || n.code === "invalid_element") && "issues" in n) {
623
- let e = gt(n.issues);
633
+ let e = _t(n.issues);
624
634
  e > t && (t = e);
625
635
  }
626
636
  }
627
637
  return t;
628
- }, _t = (e, t = []) => {
638
+ }, vt = (e, t = []) => {
629
639
  let n = [];
630
640
  for (let r of e) {
631
641
  let e = [...t, ...r.path];
632
642
  if (r.code === "invalid_union" && "errors" in r && r.errors.length > 0) {
633
- let t = r.errors[0], i = gt(t);
643
+ let t = r.errors[0], i = _t(t);
634
644
  for (let e = 1; e < r.errors.length; e++) {
635
- let n = gt(r.errors[e]);
645
+ let n = _t(r.errors[e]);
636
646
  n > i && (t = r.errors[e], i = n);
637
647
  }
638
- n.push(..._t(t, e));
648
+ n.push(...vt(t, e));
639
649
  continue;
640
650
  }
641
651
  if (r.code === "invalid_element" && "issues" in r && "key" in r && (typeof r.key == "string" || typeof r.key == "number")) {
642
- n.push(..._t(r.issues, [...e, r.key]));
652
+ n.push(...vt(r.issues, [...e, r.key]));
643
653
  continue;
644
654
  }
645
655
  if (r.code === "invalid_key" && "issues" in r) {
646
- n.push(..._t(r.issues, e));
656
+ n.push(...vt(r.issues, e));
647
657
  continue;
648
658
  }
649
659
  n.push({
@@ -652,7 +662,7 @@ var n = Object.defineProperty, r = (e, t) => {
652
662
  });
653
663
  }
654
664
  return n;
655
- }, vt = (e) => {
665
+ }, yt = (e) => {
656
666
  let t = [];
657
667
  for (let n of e) {
658
668
  if (n.code === "unrecognized_keys" && "keys" in n && Array.isArray(n.keys)) {
@@ -665,9 +675,9 @@ var n = Object.defineProperty, r = (e, t) => {
665
675
  t.push(n);
666
676
  }
667
677
  return t;
668
- }, yt = (e, t, n, r) => {
669
- let i = `${n} `, a = `${n + ut} `, o = {
670
- ...ft,
678
+ }, bt = (e, t, n, r) => {
679
+ let i = `${n} `, a = `${n + dt} `, o = {
680
+ ...pt,
671
681
  ...r
672
682
  };
673
683
  if (Array.isArray(e)) {
@@ -682,7 +692,7 @@ var n = Object.defineProperty, r = (e, t) => {
682
692
  maxArrayLength: e + 2
683
693
  });
684
694
  }
685
- let s = $e(e, o);
695
+ let s = et(e, o);
686
696
  if (typeof s != "object" || !s) {
687
697
  let e = JSON.stringify(s), n = t.values().next().value;
688
698
  return [`${a}${e}${n ? ` × ${n.reason}` : ""}`];
@@ -717,7 +727,7 @@ var n = Object.defineProperty, r = (e, t) => {
717
727
  return u.forEach((e, t) => {
718
728
  if (e.mark == null) return;
719
729
  let n = +(t < u.length - 1), r = e.content.length + n;
720
- r > d && r <= dt && (d = r);
730
+ r > d && r <= ft && (d = r);
721
731
  }), u.forEach((e, t) => {
722
732
  let n = t < u.length - 1 ? "," : "", r = e.content + n;
723
733
  if (e.mark != null) {
@@ -725,48 +735,48 @@ var n = Object.defineProperty, r = (e, t) => {
725
735
  c.push(`${a}${r}${t}× ${e.mark.reason}`);
726
736
  } else c.push(`${i}${r}`);
727
737
  }), c.push(n + (l ? "]" : "}")), c;
728
- }, bt = "__root__", xt = (e, t, n) => {
738
+ }, xt = "__root__", St = (e, t, n) => {
729
739
  let r = /* @__PURE__ */ new Map();
730
740
  for (let t of e) {
731
- let e = t.path.length === 0 ? bt : `::${Ye(pt(t.path))}`, n = r.get(e);
741
+ let e = t.path.length === 0 ? xt : `::${Xe(mt(t.path))}`, n = r.get(e);
732
742
  n == null ? r.set(e, [t]) : n.push(t);
733
743
  }
734
744
  let i = [];
735
745
  for (let [e, a] of r) {
736
- if (e === bt) {
737
- i.push(a.map((e) => ` × ${ht(e, t, n)}`).join("\n"));
746
+ if (e === xt) {
747
+ i.push(a.map((e) => ` × ${gt(e, t, n)}`).join("\n"));
738
748
  continue;
739
749
  }
740
- let r = pt(a[0].path), { present: o, value: s } = pe(t, r);
750
+ let r = mt(a[0].path), { present: o, value: s } = me(t, r);
741
751
  if (!o) {
742
- i.push(a.map((e) => ` at ${Ye(e.path)}\n × ${ht(e, t, n)}`).join("\n"));
752
+ i.push(a.map((e) => ` at ${Xe(e.path)}\n × ${gt(e, t, n)}`).join("\n"));
743
753
  continue;
744
754
  }
745
755
  let c = /* @__PURE__ */ new Map();
746
756
  for (let e of a) {
747
- let n = String(e.path[e.path.length - 1]), r = pe(t, e.path);
757
+ let n = String(e.path[e.path.length - 1]), r = me(t, e.path);
748
758
  c.set(n, {
749
- reason: mt(e),
759
+ reason: ht(e),
750
760
  missing: !r.present
751
761
  });
752
762
  }
753
- let l = r.length === 0, u = yt(s, c, l ? " " : " ", n);
754
- l ? i.push(u.join("\n")) : i.push([` at ${Ye(r)}`, ...u].join("\n"));
763
+ let l = r.length === 0, u = bt(s, c, l ? " " : " ", n);
764
+ l ? i.push(u.join("\n")) : i.push([` at ${Xe(r)}`, ...u].join("\n"));
755
765
  }
756
766
  return i.join("\n\n");
757
- }, St = (e, t) => {
767
+ }, Ct = (e, t) => {
758
768
  let n = Object.entries(e);
759
- return n.every(([, e]) => st(e)) ? n.map(([e, t]) => `${e}=${typeof t == "string" ? t : String(t)}`).join(", ") : et(e, t);
760
- }, Ct = ({ issues: e, input: t, label: n, context: r, formatOptions: i }) => {
761
- let a = i ?? {}, o = vt(_t(e)), s = [`Failed to parse ${n} (${o.length === 1 ? "1 issue" : `${o.length} issues`})`];
762
- return s.push(xt(o, t, a)), r != null && Object.keys(r).length > 0 && s.push(` context: ${St(r, a)}`), s.join("\n\n");
763
- }, wt = class extends Fe(lt) {
769
+ return n.every(([, e]) => ct(e)) ? n.map(([e, t]) => `${e}=${typeof t == "string" ? t : String(t)}`).join(", ") : tt(e, t);
770
+ }, wt = ({ issues: e, input: t, label: n, context: r, formatOptions: i }) => {
771
+ let a = i ?? {}, o = yt(vt(e)), s = [`Failed to parse ${n} (${o.length === 1 ? "1 issue" : `${o.length} issues`})`];
772
+ return s.push(St(o, t, a)), r != null && Object.keys(r).length > 0 && s.push(` context: ${Ct(r, a)}`), s.join("\n\n");
773
+ }, Tt = class extends y(ut) {
764
774
  issues;
765
775
  input;
766
776
  label;
767
777
  context;
768
778
  constructor({ issues: e, input: t, label: n, context: r, cause: i, formatOptions: a }) {
769
- super(Ct({
779
+ super(wt({
770
780
  issues: e,
771
781
  input: t,
772
782
  label: n,
@@ -776,7 +786,7 @@ var n = Object.defineProperty, r = (e, t) => {
776
786
  }
777
787
  toStatus() {
778
788
  let e = {
779
- input: $e(this.input),
789
+ input: et(this.input),
780
790
  issues: this.issues
781
791
  };
782
792
  return this.context != null && (e.context = this.context), {
@@ -786,24 +796,24 @@ var n = Object.defineProperty, r = (e, t) => {
786
796
  };
787
797
  }
788
798
  };
789
- He({
799
+ Re({
790
800
  encode: (e) => {
791
- if (!wt.matches(e)) return null;
801
+ if (!Tt.matches(e)) return null;
792
802
  let t = e, n = {
793
803
  label: t.label,
794
804
  context: t.context,
795
805
  issues: t.issues,
796
- input: $e(t.input)
806
+ input: et(t.input)
797
807
  };
798
808
  return {
799
- type: lt,
809
+ type: ut,
800
810
  data: JSON.stringify(n)
801
811
  };
802
812
  },
803
813
  decode: (e) => {
804
- if (e.type !== lt) return null;
814
+ if (e.type !== ut) return null;
805
815
  let t = JSON.parse(e.data);
806
- return new wt({
816
+ return new Tt({
807
817
  issues: t.issues,
808
818
  input: t.input,
809
819
  label: t.label,
@@ -811,131 +821,131 @@ He({
811
821
  });
812
822
  }
813
823
  });
814
- var Tt = (e, t, n = {}) => {
824
+ var Et = (e, t, n = {}) => {
815
825
  let r = e.safeParse(t);
816
826
  if (r.success) return r.data;
817
- throw new wt({
827
+ throw new Tt({
818
828
  issues: r.error.issues,
819
829
  input: t,
820
- label: n.label ?? ct,
830
+ label: n.label ?? lt,
821
831
  context: n.context,
822
832
  cause: r.error
823
833
  });
824
- }, Et = 2 ** 12 - 1, Dt = 2 ** 16 - 1, Ot = 2 ** 20 - 1, kt = 2 ** 32 - 1, At = 2n ** 64n - 1n, jt = 2 ** 64 - 1, Mt = -128, Nt = -(2 ** 15), Pt = 2 ** 15 - 1, Ft = -(2 ** 31), It = 2 ** 31 - 1, Lt = -(2n ** 63n), Rt = 2n ** 63n - 1n, zt = -(2 ** 63), Bt = 2 ** 63 - 1, Vt = (e) => (t, n) => {
834
+ }, Dt = 2 ** 12 - 1, Ot = 2 ** 16 - 1, kt = 2 ** 20 - 1, At = 2 ** 32 - 1, jt = 2n ** 64n - 1n, Mt = 2 ** 64 - 1, Nt = -128, Pt = -(2 ** 15), Ft = 2 ** 15 - 1, It = -(2 ** 31), Lt = 2 ** 31 - 1, Rt = -(2n ** 63n), zt = 2n ** 63n - 1n, Bt = -(2 ** 63), Vt = 2 ** 63 - 1, Ht = (e) => (t, n) => {
825
835
  if (typeof t == "bigint") {
826
- if (Kt(n)) return e(t, BigInt(n));
836
+ if (qt(n)) return e(t, BigInt(n));
827
837
  let r = e(Number(t), Number(n));
828
838
  return typeof r == "number" ? BigInt(Math.round(r)) : r;
829
839
  }
830
840
  return e(Number(t), Number(n));
831
- }, S = Vt((e, t) => e - t), C = Vt((e, t) => e + t), Ht = (e, t, n = 1e-4) => Math.abs(e - t) < n, Ut = (e, t) => {
841
+ }, S = Ht((e, t) => e - t), C = Ht((e, t) => e + t), Ut = (e, t, n = 1e-4) => Math.abs(e - t) < n, Wt = (e, t) => {
832
842
  let n = typeof e == "bigint", r = typeof t == "bigint";
833
- return n && r ? e === t : n && Kt(t) ? e === BigInt(t) : r && Kt(e) ? t === BigInt(e) : e === t;
834
- }, Wt = (e) => {
843
+ return n && r ? e === t : n && qt(t) ? e === BigInt(t) : r && qt(e) ? t === BigInt(e) : e === t;
844
+ }, Gt = (e) => {
835
845
  let t = 10 ** Math.floor(Math.log10(e));
836
846
  return Math.round(e / t) * t;
837
- }, Gt = Vt((e, t) => e <= t ? e : t), Kt = (e) => typeof e == "bigint" ? !0 : Number.isInteger(e), qt = Vt((e, t) => e >= t ? e : t), Jt = (e) => typeof e == "bigint" ? e < 0n ? -e : e : e < 0 ? -e : e, w = Vt((e, t) => e * t), Yt = Vt((e, t) => e / t), Xt = /* @__PURE__ */ r({
838
- ALIGNMENTS: () => mn,
839
- ANGULAR_DIRECTIONS: () => cn,
840
- CENTER_LOCATIONS: () => un,
841
- DIMENSIONS: () => vn,
842
- DIRECTIONS: () => on,
843
- LOCATIONS: () => fn,
844
- ORDERS: () => gn,
845
- OUTER_LOCATIONS: () => rn,
846
- SIGNED_DIMENSIONS: () => bn,
847
- STICKY_UNITS: () => tn,
848
- X_LOCATIONS: () => Zt,
849
- Y_LOCATIONS: () => $t,
850
- alignmentZ: () => hn,
851
- angularDirectionZ: () => ln,
852
- boundsZ: () => Dn,
853
- centerLocationZ: () => dn,
854
- clientXYZ: () => En,
855
- cornerLocationZ: () => Sn,
856
- dimensionZ: () => yn,
857
- dimensionsZ: () => wn,
858
- directionZ: () => sn,
859
- locationZ: () => pn,
860
- orderZ: () => _n,
861
- outerLocationZ: () => an,
862
- signedDimensionZ: () => xn,
863
- signedDimensionsZ: () => Tn,
864
- stickyUnitZ: () => nn,
865
- stickyUnitsZ: () => Cn,
866
- stickyXYZ: () => kn,
867
- viewportZ: () => On,
868
- xLocationZ: () => Qt,
847
+ }, Kt = Ht((e, t) => e <= t ? e : t), qt = (e) => typeof e == "bigint" ? !0 : Number.isInteger(e), Jt = Ht((e, t) => e >= t ? e : t), Yt = (e) => typeof e == "bigint" ? e < 0n ? -e : e : e < 0 ? -e : e, w = Ht((e, t) => e * t), Xt = Ht((e, t) => e / t), Zt = /* @__PURE__ */ r({
848
+ ALIGNMENTS: () => hn,
849
+ ANGULAR_DIRECTIONS: () => ln,
850
+ CENTER_LOCATIONS: () => dn,
851
+ DIMENSIONS: () => yn,
852
+ DIRECTIONS: () => sn,
853
+ LOCATIONS: () => pn,
854
+ ORDERS: () => _n,
855
+ OUTER_LOCATIONS: () => an,
856
+ SIGNED_DIMENSIONS: () => xn,
857
+ STICKY_UNITS: () => nn,
858
+ X_LOCATIONS: () => Qt,
859
+ Y_LOCATIONS: () => en,
860
+ alignmentZ: () => gn,
861
+ angularDirectionZ: () => un,
862
+ boundsZ: () => On,
863
+ centerLocationZ: () => fn,
864
+ clientXYZ: () => Dn,
865
+ cornerLocationZ: () => Cn,
866
+ dimensionZ: () => bn,
867
+ dimensionsZ: () => Tn,
868
+ directionZ: () => cn,
869
+ locationZ: () => mn,
870
+ orderZ: () => vn,
871
+ outerLocationZ: () => on,
872
+ signedDimensionZ: () => Sn,
873
+ signedDimensionsZ: () => En,
874
+ stickyUnitZ: () => rn,
875
+ stickyUnitsZ: () => wn,
876
+ stickyXYZ: () => An,
877
+ viewportZ: () => kn,
878
+ xLocationZ: () => $t,
869
879
  xyZ: () => T,
870
- yLocationZ: () => en
871
- }), Zt = ["left", "right"], Qt = t.enum(Zt), $t = ["top", "bottom"], en = t.enum($t), tn = ["px", "decimal"], nn = t.enum(tn), rn = [
880
+ yLocationZ: () => tn
881
+ }), Qt = ["left", "right"], $t = t.enum(Qt), en = ["top", "bottom"], tn = t.enum(en), nn = ["px", "decimal"], rn = t.enum(nn), an = [
872
882
  "top",
873
883
  "right",
874
884
  "bottom",
875
885
  "left"
876
- ], an = t.enum(rn), on = ["x", "y"], sn = t.enum(on), cn = ["clockwise", "counterclockwise"], ln = t.enum(cn), un = ["center"], dn = t.enum(un), fn = [
886
+ ], on = t.enum(an), sn = ["x", "y"], cn = t.enum(sn), ln = ["clockwise", "counterclockwise"], un = t.enum(ln), dn = ["center"], fn = t.enum(dn), pn = [
877
887
  "top",
878
888
  "right",
879
889
  "bottom",
880
890
  "left",
881
891
  "center"
882
- ], pn = t.enum(fn), mn = [
892
+ ], mn = t.enum(pn), hn = [
883
893
  "start",
884
894
  "center",
885
895
  "end"
886
- ], hn = t.enum(mn), gn = ["first", "last"], _n = t.enum(gn), vn = ["width", "height"], yn = t.enum(vn), bn = ["signedWidth", "signedHeight"], xn = t.enum(bn), T = t.object({
896
+ ], gn = t.enum(hn), _n = ["first", "last"], vn = t.enum(_n), yn = ["width", "height"], bn = t.enum(yn), xn = ["signedWidth", "signedHeight"], Sn = t.enum(xn), T = t.object({
887
897
  x: t.number(),
888
898
  y: t.number()
889
- }), Sn = t.object({
890
- x: Qt,
891
- y: en
892
899
  }), Cn = t.object({
893
- x: nn,
894
- y: nn
900
+ x: $t,
901
+ y: tn
895
902
  }), wn = t.object({
903
+ x: rn,
904
+ y: rn
905
+ }), Tn = t.object({
896
906
  width: t.number(),
897
907
  height: t.number()
898
- }), Tn = t.object({
908
+ }), En = t.object({
899
909
  signedWidth: t.number(),
900
910
  signedHeight: t.number()
901
- }), En = t.object({
911
+ }), Dn = t.object({
902
912
  clientX: t.number(),
903
913
  clientY: t.number()
904
- }), Dn = (e) => t.object({
914
+ }), On = (e) => t.object({
905
915
  lower: e ?? t.number(),
906
916
  upper: e ?? t.number()
907
- }), On = t.object({
917
+ }), kn = t.object({
908
918
  zoom: t.number().default(1),
909
919
  position: T
910
- }), kn = t.object({
920
+ }), An = t.object({
911
921
  x: t.number(),
912
922
  y: t.number(),
913
- root: Sn.optional(),
914
- units: Cn.optional()
915
- }), An = t.tuple([t.number(), t.number()]), jn = /* @__PURE__ */ r({
916
- CLIP: () => Fn,
917
- DECIMAL: () => Pn,
918
- INFINITE: () => Nn,
919
- ZERO: () => Mn,
920
- boundsZ: () => Dn,
921
- buildInsertionPlan: () => Xn,
922
- clamp: () => Rn,
923
+ root: Cn.optional(),
924
+ units: wn.optional()
925
+ }), jn = t.tuple([t.number(), t.number()]), Mn = /* @__PURE__ */ r({
926
+ CLIP: () => In,
927
+ DECIMAL: () => Fn,
928
+ INFINITE: () => Pn,
929
+ ZERO: () => Nn,
930
+ boundsZ: () => On,
931
+ buildInsertionPlan: () => Zn,
932
+ clamp: () => zn,
923
933
  construct: () => E,
924
934
  contains: () => D,
925
- distance: () => Qn,
926
- equals: () => In,
927
- findInsertPosition: () => Jn,
928
- isFinite: () => Un,
929
- isZero: () => Vn,
930
- linspace: () => qn,
931
- makeValid: () => Ln,
932
- max: () => Gn,
933
- mean: () => Wn,
934
- min: () => Kn,
935
- overlapsWith: () => zn,
936
- span: () => Bn,
937
- spanIsZero: () => Hn,
938
- traverse: () => Zn
935
+ distance: () => $n,
936
+ equals: () => Ln,
937
+ findInsertPosition: () => Yn,
938
+ isFinite: () => Wn,
939
+ isZero: () => Hn,
940
+ linspace: () => Jn,
941
+ makeValid: () => Rn,
942
+ max: () => Kn,
943
+ mean: () => Gn,
944
+ min: () => qn,
945
+ overlapsWith: () => Bn,
946
+ span: () => Vn,
947
+ spanIsZero: () => Un,
948
+ traverse: () => Qn
939
949
  }), E = (e, t, n) => {
940
950
  let r = {};
941
951
  if (typeof t == "object" && (n = t, t = void 0), n = {
@@ -946,28 +956,28 @@ var Tt = (e, t, n = {}) => {
946
956
  if (e.length !== 2) throw Error("bounds: expected array of length 2");
947
957
  [r.lower, r.upper] = e;
948
958
  } else r.lower = e.lower, r.upper = e.upper;
949
- return n?.makeValid ? Ln(r) : r;
950
- }, Mn = Object.freeze({
959
+ return n?.makeValid ? Rn(r) : r;
960
+ }, Nn = Object.freeze({
951
961
  lower: 0,
952
962
  upper: 0
953
- }), Nn = Object.freeze({
963
+ }), Pn = Object.freeze({
954
964
  lower: -Infinity,
955
965
  upper: Infinity
956
- }), Pn = Object.freeze({
966
+ }), Fn = Object.freeze({
957
967
  lower: 0,
958
968
  upper: 1
959
- }), Fn = Object.freeze({
969
+ }), In = Object.freeze({
960
970
  lower: -1,
961
971
  upper: 1
962
- }), In = (e, t) => {
972
+ }), Ln = (e, t) => {
963
973
  if (e == null && t == null) return !0;
964
974
  if (e == null || t == null) return !1;
965
975
  let n = E(e), r = E(t);
966
976
  return n?.lower === r?.lower && n?.upper === r?.upper;
967
- }, Ln = (e) => e.lower > e.upper ? {
977
+ }, Rn = (e) => e.lower > e.upper ? {
968
978
  lower: e.upper,
969
979
  upper: e.lower
970
- } : e, Rn = (e, t) => {
980
+ } : e, zn = (e, t) => {
971
981
  let n = E(e);
972
982
  return t < n.lower ? n.lower : t >= n.upper ? n.upper - (typeof n.upper == "number" ? 1 : 1n) : t;
973
983
  }, D = (e, t) => {
@@ -975,34 +985,34 @@ var Tt = (e, t, n = {}) => {
975
985
  if (typeof t == "number" || typeof t == "bigint") return t >= n.lower && t < n.upper;
976
986
  let r = E(t);
977
987
  return r.lower >= n.lower && r.upper <= n.upper;
978
- }, zn = (e, t) => {
988
+ }, Bn = (e, t) => {
979
989
  let n = E(e), r = E(t);
980
990
  return n.lower === r.lower ? !0 : r.upper === n.lower || r.lower === n.upper ? !1 : D(n, r.upper) || D(n, r.lower) || D(r, n.upper) || D(r, n.lower);
981
- }, Bn = (e) => {
991
+ }, Vn = (e) => {
982
992
  let t = E(e);
983
993
  return t.upper - t.lower;
984
- }, Vn = (e) => {
994
+ }, Hn = (e) => {
985
995
  let t = E(e);
986
996
  return typeof t.lower == "bigint" ? t.lower === 0n && t.upper === 0n : t.lower === 0 && t.upper === 0;
987
- }, Hn = (e) => {
988
- let t = Bn(e);
989
- return typeof t == "number" ? t === 0 : t === 0n;
990
997
  }, Un = (e) => {
998
+ let t = Vn(e);
999
+ return typeof t == "number" ? t === 0 : t === 0n;
1000
+ }, Wn = (e) => {
991
1001
  let t = E(e);
992
1002
  return typeof t.lower == "bigint" ? !0 : Number.isFinite(t.lower) && Number.isFinite(t.upper);
993
- }, Wn = (e) => {
1003
+ }, Gn = (e) => {
994
1004
  let t = E(e);
995
1005
  return (t.upper + t.lower) / 2;
996
- }, Gn = (e) => ({
1006
+ }, Kn = (e) => ({
997
1007
  lower: Math.min(...e.map((e) => E(e).lower)),
998
1008
  upper: Math.max(...e.map((e) => E(e).upper))
999
- }), Kn = (e) => ({
1009
+ }), qn = (e) => ({
1000
1010
  lower: Math.max(...e.map((e) => E(e).lower)),
1001
1011
  upper: Math.min(...e.map((e) => E(e).upper))
1002
- }), qn = (e) => {
1012
+ }), Jn = (e) => {
1003
1013
  let t = E(e), n = typeof t.lower == "bigint";
1004
- return Array.from({ length: Number(Bn(e)) }, (e, r) => n ? t.lower + BigInt(r) : t.lower + r);
1005
- }, Jn = (e, t) => {
1014
+ return Array.from({ length: Number(Vn(e)) }, (e, r) => n ? t.lower + BigInt(r) : t.lower + r);
1015
+ }, Yn = (e, t) => {
1006
1016
  let n = e.map((e) => E(e)), r = n.findIndex((e) => D(e, t) || t < e.lower);
1007
1017
  if (r === -1) return {
1008
1018
  index: e.length,
@@ -1016,21 +1026,21 @@ var Tt = (e, t, n = {}) => {
1016
1026
  index: r,
1017
1027
  position: 0
1018
1028
  };
1019
- }, Yn = {
1029
+ }, Xn = {
1020
1030
  removeBefore: 0,
1021
1031
  removeAfter: 0,
1022
1032
  insertInto: 0,
1023
1033
  deleteInBetween: 0
1024
- }, Xn = (e, t) => {
1034
+ }, Zn = (e, t) => {
1025
1035
  let n = e.map((e) => E(e)), r = E(t);
1026
- if (n.length === 0) return Yn;
1027
- let i = Jn(n, r.lower), a = Jn(n, r.upper);
1036
+ if (n.length === 0) return Xn;
1037
+ let i = Yn(n, r.lower), a = Yn(n, r.upper);
1028
1038
  if (i.index === e.length) return {
1029
- ...Yn,
1039
+ ...Xn,
1030
1040
  insertInto: e.length
1031
1041
  };
1032
1042
  if (a.index === 0) return {
1033
- ...Yn,
1043
+ ...Xn,
1034
1044
  removeAfter: a.position
1035
1045
  };
1036
1046
  if (i.index === a.index) return i.position !== 0 && a.position !== 0 ? null : {
@@ -1039,24 +1049,24 @@ var Tt = (e, t, n = {}) => {
1039
1049
  insertInto: i.index,
1040
1050
  deleteInBetween: 0
1041
1051
  };
1042
- let o = a.index - i.index, s = i.index, c = S(Number(Bn(n[i.index])), i.position);
1052
+ let o = a.index - i.index, s = i.index, c = S(Number(Vn(n[i.index])), i.position);
1043
1053
  return i.position === 0 ? c = 0 : (--o, s += 1), {
1044
1054
  removeBefore: c,
1045
1055
  removeAfter: a.position,
1046
1056
  insertInto: s,
1047
1057
  deleteInBetween: o
1048
1058
  };
1049
- }, Zn = (e, t, n) => {
1059
+ }, Qn = (e, t, n) => {
1050
1060
  let r = e.map((e) => E(e)), i = n > 0 ? 1 : n < 0 ? -1 : 0;
1051
1061
  if (i === 0) return t;
1052
1062
  let a = n, o = t;
1053
- for (; Ut(a, 0) === !1;) {
1063
+ for (; Wt(a, 0) === !1;) {
1054
1064
  let e = r.findIndex((e) => i > 0 ? o >= e.lower && o < e.upper : o > e.lower && o <= e.upper);
1055
1065
  if (e !== -1) {
1056
1066
  let t = r[e], n;
1057
1067
  if (n = i > 0 ? S(t.upper, o) : S(o, t.lower), n > 0) {
1058
- let e = Gt(Jt(a), n);
1059
- if (o = C(o, i > 0 ? e : -e), a = S(a, i > 0 ? e : -e), Ut(a, 0)) return o;
1068
+ let e = Kt(Yt(a), n);
1069
+ if (o = C(o, i > 0 ? e : -e), a = S(a, i > 0 ? e : -e), Wt(a, 0)) return o;
1060
1070
  continue;
1061
1071
  }
1062
1072
  }
@@ -1071,7 +1081,7 @@ var Tt = (e, t, n = {}) => {
1071
1081
  }
1072
1082
  }
1073
1083
  return o;
1074
- }, Qn = (e, t, n) => {
1084
+ }, $n = (e, t, n) => {
1075
1085
  let r = e.map((e) => E(e));
1076
1086
  if (t === n) return typeof t == "bigint" ? 0n : 0;
1077
1087
  let i = E(t < n ? [t, n] : [n, t]), a = typeof t == "bigint" ? 0n : 0;
@@ -1083,96 +1093,96 @@ var Tt = (e, t, n = {}) => {
1083
1093
  }
1084
1094
  }
1085
1095
  return a;
1086
- }, $n = 2, er = 3, tr = 2, nr = 5, rr = 1e-10, ir = (e, t) => {
1096
+ }, er = 2, tr = 3, nr = 2, rr = 5, ir = 1e-10, ar = (e, t) => {
1087
1097
  if (Number.isNaN(e) || !Number.isFinite(e)) return e;
1088
1098
  let n = Math.abs(e);
1089
1099
  if (n === 0) return 0;
1090
1100
  let r = !1, i = 0;
1091
1101
  if (t != null) {
1092
- i = Bn(t);
1102
+ i = Vn(t);
1093
1103
  let e = i / n;
1094
- r = i > 0 && e > rr;
1104
+ r = i > 0 && e > ir;
1095
1105
  }
1096
1106
  if (r) {
1097
1107
  let t;
1098
- t = i >= 1e3 ? $n : i >= 1 ? er : Math.ceil(-Math.log10(i)) + tr;
1108
+ t = i >= 1e3 ? er : i >= 1 ? tr : Math.ceil(-Math.log10(i)) + nr;
1099
1109
  let n = 10 ** t;
1100
1110
  return Math.round(e * n) / n;
1101
1111
  }
1102
1112
  if (n >= 1e3) {
1103
- let t = 10 ** $n;
1113
+ let t = 10 ** er;
1104
1114
  return Math.round(e * t) / t;
1105
1115
  }
1106
1116
  if (n >= 1) {
1107
- let t = 10 ** er;
1117
+ let t = 10 ** tr;
1108
1118
  return Math.round(e * t) / t;
1109
1119
  }
1110
- let a = 10 ** (nr - Math.floor(Math.log10(n)) - 1);
1120
+ let a = 10 ** (rr - Math.floor(Math.log10(n)) - 1);
1111
1121
  return Math.round(e * a) / a;
1112
- }, ar = /* @__PURE__ */ r({
1113
- MAX_INT16: () => Pt,
1114
- MAX_INT32: () => It,
1115
- MAX_INT64: () => Rt,
1116
- MAX_INT64_NUMBER: () => Bt,
1122
+ }, or = /* @__PURE__ */ r({
1123
+ MAX_INT16: () => Ft,
1124
+ MAX_INT32: () => Lt,
1125
+ MAX_INT64: () => zt,
1126
+ MAX_INT64_NUMBER: () => Vt,
1117
1127
  MAX_INT8: () => 127,
1118
- MAX_UINT12: () => Et,
1119
- MAX_UINT16: () => Dt,
1120
- MAX_UINT20: () => Ot,
1121
- MAX_UINT32: () => kt,
1122
- MAX_UINT64: () => At,
1123
- MAX_UINT64_NUMBER: () => jt,
1128
+ MAX_UINT12: () => Dt,
1129
+ MAX_UINT16: () => Ot,
1130
+ MAX_UINT20: () => kt,
1131
+ MAX_UINT32: () => At,
1132
+ MAX_UINT64: () => jt,
1133
+ MAX_UINT64_NUMBER: () => Mt,
1124
1134
  MAX_UINT8: () => 255,
1125
- MIN_INT16: () => Nt,
1126
- MIN_INT32: () => Ft,
1127
- MIN_INT64: () => Lt,
1128
- MIN_INT64_NUMBER: () => zt,
1129
- MIN_INT8: () => Mt,
1130
- abs: () => Jt,
1135
+ MIN_INT16: () => Pt,
1136
+ MIN_INT32: () => It,
1137
+ MIN_INT64: () => Rt,
1138
+ MIN_INT64_NUMBER: () => Bt,
1139
+ MIN_INT8: () => Nt,
1140
+ abs: () => Yt,
1131
1141
  add: () => C,
1132
- closeTo: () => Ht,
1133
- div: () => Yt,
1134
- equal: () => Ut,
1135
- isInteger: () => Kt,
1136
- max: () => qt,
1137
- min: () => Gt,
1142
+ closeTo: () => Ut,
1143
+ div: () => Xt,
1144
+ equal: () => Wt,
1145
+ isInteger: () => qt,
1146
+ max: () => Jt,
1147
+ min: () => Kt,
1138
1148
  mult: () => w,
1139
- roundToNearestMagnitude: () => Wt,
1140
- smartRound: () => ir,
1149
+ roundToNearestMagnitude: () => Gt,
1150
+ smartRound: () => ar,
1141
1151
  sub: () => S
1142
- }), or = t.int().min(Mt).max(127), sr = t.int().min(Nt).max(Pt), cr = t.int().min(zt).max(Bt), lr = t.int().min(0).max(255), ur = t.int().min(0).max(Et), dr = t.int().min(0).max(Dt), fr = t.int().min(0).max(Ot), pr = (t) => e.array(t).or(t.transform((e) => [e])), mr = (e) => e._zod.def.output, hr = (e) => ve(e, (e, t, n) => {
1152
+ }), sr = t.int().min(Nt).max(127), cr = t.int().min(Pt).max(Ft), lr = t.int().min(Bt).max(Vt), ur = t.int().min(0).max(255), dr = t.int().min(0).max(Dt), fr = t.int().min(0).max(Ot), pr = t.int().min(0).max(kt), mr = (t) => e.array(t).or(t.transform((e) => [e])), hr = (e) => e._zod.def.output, gr = (e) => ye(e, (e, t, n) => {
1143
1153
  let r = t === n.length - 1, i = !isNaN(parseInt(e, 10)), a = !isNaN(parseInt(n[t + 1], 10));
1144
1154
  return i && (e = "element"), r || a ? e : [e, "shape"];
1145
- }), gr = (e, t) => {
1155
+ }), _r = (e, t) => {
1146
1156
  if (e == null) return null;
1147
1157
  let n = e[t];
1148
1158
  return n == null && typeof e == "object" && "sourceType" in e ? e.sourceType()[t] : n;
1149
- }, _r = ((e, t, n) => t === "" ? e : Ce(gr(e, "shape"), hr(t), {
1159
+ }, vr = ((e, t, n) => t === "" ? e : we(_r(e, "shape"), gr(t), {
1150
1160
  ...n,
1151
- getter: gr
1152
- })), vr = /* @__PURE__ */ r({
1153
- ParseError: () => wt,
1154
- functionOutput: () => mr,
1155
- getFieldSchema: () => _r,
1156
- getFieldSchemaPath: () => hr,
1157
- int16: () => sr,
1158
- int64: () => cr,
1159
- int8: () => or,
1160
- nullToUndefined: () => fe,
1161
- parse: () => Tt,
1162
- toArray: () => pr,
1163
- uint12: () => ur,
1164
- uint16: () => dr,
1165
- uint20: () => fr,
1166
- uint8: () => lr
1167
- }), yr = /* @__PURE__ */ r({
1168
- CSVCodec: () => xr,
1169
- CSV_CODEC: () => wr,
1170
- ENCODERS: () => Er,
1171
- JSONCodec: () => br,
1172
- JSON_CODEC: () => Cr,
1173
- TEXT_CODEC: () => Tr,
1174
- TextCodec: () => Sr
1175
- }), br = class {
1161
+ getter: _r
1162
+ })), yr = /* @__PURE__ */ r({
1163
+ ParseError: () => Tt,
1164
+ functionOutput: () => hr,
1165
+ getFieldSchema: () => vr,
1166
+ getFieldSchemaPath: () => gr,
1167
+ int16: () => cr,
1168
+ int64: () => lr,
1169
+ int8: () => sr,
1170
+ nullToUndefined: () => pe,
1171
+ parse: () => Et,
1172
+ toArray: () => mr,
1173
+ uint12: () => dr,
1174
+ uint16: () => fr,
1175
+ uint20: () => pr,
1176
+ uint8: () => ur
1177
+ }), br = /* @__PURE__ */ r({
1178
+ CSVCodec: () => Sr,
1179
+ CSV_CODEC: () => Tr,
1180
+ ENCODERS: () => Dr,
1181
+ JSONCodec: () => xr,
1182
+ JSON_CODEC: () => wr,
1183
+ TEXT_CODEC: () => Er,
1184
+ TextCodec: () => Cr
1185
+ }), xr = class {
1176
1186
  contentType = "application/json";
1177
1187
  decoder;
1178
1188
  encoder;
@@ -1186,14 +1196,14 @@ var Tt = (e, t, n = {}) => {
1186
1196
  return this.decodeString(this.decoder.decode(e), t);
1187
1197
  }
1188
1198
  decodeString(e, t) {
1189
- let n = ne(JSON.parse(e), { schema: t });
1190
- return t == null ? n : Tt(t, n);
1199
+ let n = re(JSON.parse(e), { schema: t });
1200
+ return t == null ? n : Et(t, n);
1191
1201
  }
1192
1202
  encodeString(e, t) {
1193
- let n = re((t == null ? e : Tt(t, e)) ?? {}, { schema: t });
1203
+ let n = ie((t == null ? e : Et(t, e)) ?? {}, { schema: t });
1194
1204
  return JSON.stringify(n, (e, t) => ArrayBuffer.isView(t) ? Array.from(t) : typeof t == "bigint" ? t.toString() : t);
1195
1205
  }
1196
- }, xr = class {
1206
+ }, Sr = class {
1197
1207
  contentType = "text/csv";
1198
1208
  encode(e) {
1199
1209
  let t = this.encodeString(e);
@@ -1204,7 +1214,7 @@ var Tt = (e, t, n = {}) => {
1204
1214
  return this.decodeString(n, t);
1205
1215
  }
1206
1216
  encodeString(e) {
1207
- if (!Array.isArray(e) || e.length === 0 || !_(e[0])) throw Error("Payload must be an array of objects");
1217
+ if (!Array.isArray(e) || e.length === 0 || !g(e[0])) throw Error("Payload must be an array of objects");
1208
1218
  let t = Object.keys(e[0]), n = [t.join(",")];
1209
1219
  return e.forEach((e) => {
1210
1220
  let r = t.map((t) => JSON.stringify(e[t] ?? ""));
@@ -1230,7 +1240,7 @@ var Tt = (e, t, n = {}) => {
1230
1240
  let t = Number(e);
1231
1241
  return isNaN(t) ? e.startsWith("\"") && e.endsWith("\"") ? e.slice(1, -1) : e : t;
1232
1242
  }
1233
- }, Sr = class {
1243
+ }, Cr = class {
1234
1244
  contentType = "text/plain";
1235
1245
  encode(e) {
1236
1246
  if (typeof e != "string") throw Error("TextCodec.encode payload must be a string");
@@ -1240,7 +1250,7 @@ var Tt = (e, t, n = {}) => {
1240
1250
  let n = new TextDecoder().decode(e);
1241
1251
  return t == null ? n : t.parse(n);
1242
1252
  }
1243
- }, Cr = new br(), wr = new xr(), Tr = new Sr(), Er = [Cr], Dr = 365, Or = 30, kr = t.union([
1253
+ }, wr = new xr(), Tr = new Sr(), Er = new Cr(), Dr = [wr], Or = 365, kr = 30, Ar = t.union([
1244
1254
  t.tuple([t.int()]),
1245
1255
  t.tuple([t.int(), t.int().min(1).max(12)]),
1246
1256
  t.tuple([
@@ -1248,7 +1258,7 @@ var Tt = (e, t, n = {}) => {
1248
1258
  t.int().min(1).max(12),
1249
1259
  t.int().min(1).max(31)
1250
1260
  ])
1251
- ]), Ar = (e, t) => {
1261
+ ]), jr = (e, t) => {
1252
1262
  let n = new O(t);
1253
1263
  if (![
1254
1264
  k.DAY,
@@ -1272,7 +1282,7 @@ var Tt = (e, t, n = {}) => {
1272
1282
  else if (Array.isArray(t)) super(e.parseDate(t));
1273
1283
  else {
1274
1284
  let r = 0n;
1275
- t instanceof Number && (t = t.valueOf()), n === "local" && (r = e.utcOffset.valueOf()), typeof t == "number" && (isFinite(t) ? t = t === Bt ? Rt : Math.trunc(t) : (isNaN(t) && (t = 0), t = t === Infinity ? e.MAX : e.MIN)), b(t) && (t = t.value), super(BigInt(t.valueOf()) + r);
1285
+ t instanceof Number && (t = t.valueOf()), n === "local" && (r = e.utcOffset.valueOf()), typeof t == "number" && (isFinite(t) ? t = t === Vt ? zt : Math.trunc(t) : (isNaN(t) && (t = 0), t = t === Infinity ? e.MAX : e.MIN)), b(t) && (t = t.value), super(BigInt(t.valueOf()) + r);
1276
1286
  }
1277
1287
  }
1278
1288
  static parseDate([t = 1970, n = 1, r = 1]) {
@@ -1490,7 +1500,7 @@ var Tt = (e, t, n = {}) => {
1490
1500
  }
1491
1501
  }
1492
1502
  remainder(e) {
1493
- return Ar(this, e);
1503
+ return jr(this, e);
1494
1504
  }
1495
1505
  get isToday() {
1496
1506
  return this.truncate(k.DAY).equals(e.now().truncate(k.DAY));
@@ -1548,7 +1558,7 @@ var Tt = (e, t, n = {}) => {
1548
1558
  return e.hours(t * 24, n);
1549
1559
  }
1550
1560
  static DAY = e.days(1);
1551
- static MAX = new e(Rt);
1561
+ static MAX = new e(zt);
1552
1562
  static MIN = new e(0);
1553
1563
  static ZERO = new e(0);
1554
1564
  static z = t.union([
@@ -1559,7 +1569,7 @@ var Tt = (e, t, n = {}) => {
1559
1569
  t.bigint().transform((t) => new e(t)),
1560
1570
  t.date().transform((t) => new e(t)),
1561
1571
  t.custom((e) => e instanceof k).transform((t) => new e(t)),
1562
- kr.transform((t) => new e(t))
1572
+ Ar.transform((t) => new e(t))
1563
1573
  ]);
1564
1574
  static sort(e, t) {
1565
1575
  return Number(e.valueOf() - t.valueOf());
@@ -1593,37 +1603,37 @@ var Tt = (e, t, n = {}) => {
1593
1603
  return this.valueOf() >= new e(t).valueOf();
1594
1604
  }
1595
1605
  remainder(e) {
1596
- return Ar(this, e);
1606
+ return jr(this, e);
1597
1607
  }
1598
1608
  truncate(t) {
1599
1609
  return new e(BigInt(Math.trunc(Number(this.valueOf() / t.valueOf()))) * t.valueOf());
1600
1610
  }
1601
1611
  toString(t = "full") {
1602
1612
  if (t === "semantic") return this.toSemanticString();
1603
- let n = this.truncate(e.DAY), r = this.truncate(e.HOUR), i = this.truncate(e.MINUTE), a = this.truncate(e.SECOND), o = this.truncate(e.MILLISECOND), s = this.truncate(e.MICROSECOND), c = this.truncate(e.NANOSECOND), l = n, u = r.sub(n), d = i.sub(r), f = a.sub(i), p = o.sub(a), m = s.sub(o), h = c.sub(s), g = "";
1604
- return l.isZero || (g += `${l.days}d `), u.isZero || (g += `${u.hours}h `), d.isZero || (g += `${d.minutes}m `), f.isZero || (g += `${f.seconds}s `), p.isZero || (g += `${p.milliseconds}ms `), m.isZero || (g += `${m.microseconds}µs `), h.isZero || (g += `${h.nanoseconds}ns`), g.trim();
1613
+ let n = this.truncate(e.DAY), r = this.truncate(e.HOUR), i = this.truncate(e.MINUTE), a = this.truncate(e.SECOND), o = this.truncate(e.MILLISECOND), s = this.truncate(e.MICROSECOND), c = this.truncate(e.NANOSECOND), l = n, u = r.sub(n), d = i.sub(r), f = a.sub(i), p = o.sub(a), m = s.sub(o), ee = c.sub(s), h = "";
1614
+ return l.isZero || (h += `${l.days}d `), u.isZero || (h += `${u.hours}h `), d.isZero || (h += `${d.minutes}m `), f.isZero || (h += `${f.seconds}s `), p.isZero || (h += `${p.milliseconds}ms `), m.isZero || (h += `${m.microseconds}µs `), ee.isZero || (h += `${ee.nanoseconds}ns`), h.trim();
1605
1615
  }
1606
1616
  toSemanticString() {
1607
1617
  let t = new e(this.valueOf() < 0n ? -this.valueOf() : this.valueOf()), n = this.valueOf() < 0n;
1608
1618
  if (t.valueOf() === 0n) return "0s";
1609
1619
  if (t.lessThan(e.SECOND)) return "< 1s";
1610
- let r = t.days, i = t.hours, a = t.minutes, o = t.seconds, s = Math.floor(r / Dr), c = Math.floor(r / Or), l = Math.floor(r / 7), u = Math.floor(r), d = Math.floor(i), f = Math.floor(a), p = Math.floor(o), m = n ? "-" : "";
1620
+ let r = t.days, i = t.hours, a = t.minutes, o = t.seconds, s = Math.floor(r / Or), c = Math.floor(r / kr), l = Math.floor(r / 7), u = Math.floor(r), d = Math.floor(i), f = Math.floor(a), p = Math.floor(o), m = n ? "-" : "";
1611
1621
  if (s >= 1) {
1612
1622
  let e = `${s}y`;
1613
1623
  if (s < 2) {
1614
- let t = Math.floor(r % Dr / Or);
1624
+ let t = Math.floor(r % Or / kr);
1615
1625
  t > 0 && (e += ` ${t}mo`);
1616
1626
  }
1617
1627
  return m + e;
1618
1628
  }
1619
- if (l >= 1 && r < Or && r % 7 == 0) {
1629
+ if (l >= 1 && r < kr && r % 7 == 0) {
1620
1630
  let e = `${l}w`, t = Math.floor(r % 7), n = Math.floor(i - l * 7 * 24);
1621
1631
  return l < 2 && (t > 0 ? e += ` ${t}d` : n > 0 && n < 24 && (e += ` ${n}h`)), m + e;
1622
1632
  }
1623
1633
  if (c >= 1) {
1624
1634
  let e = `${c}mo`;
1625
1635
  if (c < 3) {
1626
- let t = Math.floor(r % Or);
1636
+ let t = Math.floor(r % kr);
1627
1637
  t > 0 && (e += ` ${t}d`);
1628
1638
  }
1629
1639
  return m + e;
@@ -1658,7 +1668,7 @@ var Tt = (e, t, n = {}) => {
1658
1668
  return new e(w(this.valueOf(), t));
1659
1669
  }
1660
1670
  div(t) {
1661
- return new e(Yt(this.valueOf(), t));
1671
+ return new e(Xt(this.valueOf(), t));
1662
1672
  }
1663
1673
  get days() {
1664
1674
  return Number(this.valueOf()) / Number(e.DAY.valueOf());
@@ -1725,7 +1735,7 @@ var Tt = (e, t, n = {}) => {
1725
1735
  return e.hours(w(t, 24));
1726
1736
  }
1727
1737
  static DAY = e.days(1);
1728
- static MAX = new e(Rt);
1738
+ static MAX = new e(zt);
1729
1739
  static MIN = new e(0);
1730
1740
  static ZERO = new e(0);
1731
1741
  static z = t.union([
@@ -1775,7 +1785,7 @@ var Tt = (e, t, n = {}) => {
1775
1785
  return new e(w(this.valueOf(), t));
1776
1786
  }
1777
1787
  div(t) {
1778
- return new e(Yt(this.valueOf(), t));
1788
+ return new e(Xt(this.valueOf(), t));
1779
1789
  }
1780
1790
  static hz(t) {
1781
1791
  return new e(t);
@@ -1804,7 +1814,7 @@ var Tt = (e, t, n = {}) => {
1804
1814
  return new e(w(this.valueOf(), t));
1805
1815
  }
1806
1816
  div(t) {
1807
- return new e(Yt(this.valueOf(), t));
1817
+ return new e(Xt(this.valueOf(), t));
1808
1818
  }
1809
1819
  static UNKNOWN = new e(0);
1810
1820
  static BIT128 = new e(16);
@@ -1884,7 +1894,7 @@ var Tt = (e, t, n = {}) => {
1884
1894
  start: O.z,
1885
1895
  end: O.z
1886
1896
  }).transform((t) => new e(t.start, t.end)), t.instanceof(e)]);
1887
- static boundedZ = e.z.refine(({ isValid: e }) => e, { message: "Time range start time must be before or equal to time range end time" }).refine(({ end: e }) => e.valueOf() <= Rt, { message: "Time range end time must be less than or equal to the maximum value of an int64" }).refine(({ start: e }) => e.valueOf() >= Lt, { message: "Time range start time must be greater than or equal to the minimum value of an int64" });
1897
+ static boundedZ = e.z.refine(({ isValid: e }) => e, { message: "Time range start time must be before or equal to time range end time" }).refine(({ end: e }) => e.valueOf() <= zt, { message: "Time range end time must be less than or equal to the maximum value of an int64" }).refine(({ start: e }) => e.valueOf() >= Rt, { message: "Time range start time must be greater than or equal to the minimum value of an int64" });
1888
1898
  static sort(e, t) {
1889
1899
  return O.sort(e.start, t.start) || O.sort(e.end, t.end);
1890
1900
  }
@@ -2076,7 +2086,7 @@ var Tt = (e, t, n = {}) => {
2076
2086
  return new e(w(this.valueOf(), t));
2077
2087
  }
2078
2088
  div(t) {
2079
- return new e(Yt(this.valueOf(), t));
2089
+ return new e(Xt(this.valueOf(), t));
2080
2090
  }
2081
2091
  truncate(t) {
2082
2092
  return new e(Math.trunc(this.valueOf() / new e(t).valueOf()) * new e(t).valueOf());
@@ -2125,10 +2135,10 @@ var Tt = (e, t, n = {}) => {
2125
2135
  get isZero() {
2126
2136
  return this.valueOf() === 0;
2127
2137
  }
2128
- }, jr = t.object({
2138
+ }, Mr = t.object({
2129
2139
  start: t.number(),
2130
2140
  end: t.number()
2131
- }), Mr = t.union([
2141
+ }), Nr = t.union([
2132
2142
  t.instanceof(Uint8Array),
2133
2143
  t.instanceof(Uint16Array),
2134
2144
  t.instanceof(Uint32Array),
@@ -2139,10 +2149,10 @@ var Tt = (e, t, n = {}) => {
2139
2149
  t.instanceof(Int16Array),
2140
2150
  t.instanceof(Int32Array),
2141
2151
  t.instanceof(BigInt64Array)
2142
- ]), Nr = (e) => {
2152
+ ]), Pr = (e) => {
2143
2153
  let t = typeof e;
2144
2154
  return t === "string" || t === "number" || t === "boolean" || t === "bigint" || e instanceof O || e instanceof k || e instanceof Date;
2145
- }, Pr = (e, t, n, r = 0) => e.usesBigInt && !t.usesBigInt ? Number(BigInt(n.valueOf()) - BigInt(r.valueOf())) : !e.usesBigInt && t.usesBigInt ? BigInt(n.valueOf()) - BigInt(r.valueOf()) : S(n, r), Fr = M.z, Ir = O.z, Lr = k.z, Rr = A.z, zr = P.z, Br = N.z, Vr = M.boundedZ, Hr = class {
2155
+ }, Fr = (e, t, n, r = 0) => e.usesBigInt && !t.usesBigInt ? Number(BigInt(n.valueOf()) - BigInt(r.valueOf())) : !e.usesBigInt && t.usesBigInt ? BigInt(n.valueOf()) - BigInt(r.valueOf()) : S(n, r), Ir = M.z, Lr = O.z, Rr = k.z, zr = A.z, Br = P.z, Vr = N.z, Hr = M.boundedZ, Ur = class {
2146
2156
  now;
2147
2157
  localStartT = new O(0);
2148
2158
  lastSkew = k.ZERO;
@@ -2163,10 +2173,10 @@ var Tt = (e, t, n = {}) => {
2163
2173
  let t = this.skew.valueOf();
2164
2174
  return (t < 0n ? -t : t) > new k(e).valueOf();
2165
2175
  }
2166
- }, Ur = /* @__PURE__ */ r({
2167
- by: () => Gr,
2168
- unique: () => Wr
2169
- }), Wr = (e) => [...new Set(e)], Gr = (e, t, n = !0) => {
2176
+ }, Wr = /* @__PURE__ */ r({
2177
+ by: () => Kr,
2178
+ unique: () => Gr
2179
+ }), Gr = (e) => [...new Set(e)], Kr = (e, t, n = !0) => {
2170
2180
  let r = /* @__PURE__ */ new Map();
2171
2181
  return e.forEach((e) => {
2172
2182
  let i = t(e);
@@ -2176,8 +2186,8 @@ var Tt = (e, t, n = {}) => {
2176
2186
  }
2177
2187
  r.set(i, e);
2178
2188
  }), Array.from(r.values());
2179
- }, Kr = (e, t = !1) => {
2180
- let n = rt(e) ? "stringer" : typeof e, r;
2189
+ }, qr = (e, t = !1) => {
2190
+ let n = it(e) ? "stringer" : typeof e, r;
2181
2191
  switch (n) {
2182
2192
  case "string":
2183
2193
  r = (e, t) => e.localeCompare(t);
@@ -2199,26 +2209,26 @@ var Tt = (e, t, n = {}) => {
2199
2209
  break;
2200
2210
  default: return console.warn(`sortFunc: unknown type ${n}`), () => -1;
2201
2211
  }
2202
- return t ? ei(r) : r;
2203
- }, qr = (e, t, n) => {
2204
- let r = Kr(t[e], n);
2212
+ return t ? ti(r) : r;
2213
+ }, Jr = (e, t, n) => {
2214
+ let r = qr(t[e], n);
2205
2215
  return (t, n) => r(t[e], n[e]);
2206
- }, Jr = (e, t) => e.length === t.length ? e.every((e, n) => e === t[n]) ? 0 : -1 : e.length - t.length, Yr = (e, t) => {
2216
+ }, Yr = (e, t) => e.length === t.length ? e.every((e, n) => e === t[n]) ? 0 : -1 : e.length - t.length, Xr = (e, t) => {
2207
2217
  if (e.length !== t.length) return e.length - t.length;
2208
2218
  if (e.length === 0) return 0;
2209
- let n = Kr(e[0]), r = [...e].sort(n), i = [...t].sort(n);
2219
+ let n = qr(e[0]), r = [...e].sort(n), i = [...t].sort(n);
2210
2220
  return r.every((e, t) => e === i[t]) ? 0 : -1;
2211
- }, Xr = (e, t) => Yr(Wr(e), Wr(t)), Zr = (e, t) => {
2221
+ }, Zr = (e, t) => Xr(Gr(e), Gr(t)), Qr = (e, t) => {
2212
2222
  if (e === t) return !0;
2213
2223
  if (e.size !== t.size) return !1;
2214
2224
  for (let [n, r] of e) if (!t.has(n) || t.get(n) !== r) return !1;
2215
2225
  return !0;
2216
- }, Qr = (e, t) => {
2226
+ }, $r = (e, t) => {
2217
2227
  if (e === t) return !0;
2218
2228
  if (e.length !== t.length) return !1;
2219
2229
  for (let n = 0; n < e.length; n++) if (e[n] !== t[n]) return !1;
2220
2230
  return !0;
2221
- }, $r = (e, t) => e === t ? 0 : e === "first" && t === "last" ? 1 : -1, ei = (e) => (t, n) => e(n, t), ti = (e) => e < 0, ni = (e) => e > 0, ri = (e) => e >= 0, ii = (e) => e === 0, ai = (e, t) => {
2231
+ }, ei = (e, t) => e === t ? 0 : e === "first" && t === "last" ? 1 : -1, ti = (e) => (t, n) => e(n, t), ni = (e) => e < 0, ri = (e) => e > 0, ii = (e) => e >= 0, ai = (e) => e === 0, oi = (e, t) => {
2222
2232
  let n = /([a-zA-Z]+)|(\d+)/g, r = e.replace(/[\s_.-]+/g, "").match(n), i = t.replace(/[\s_.-]+/g, "").match(n);
2223
2233
  if (!r || !i) return 0;
2224
2234
  for (let e = 0; e < Math.min(r.length, i.length); e++) {
@@ -2232,103 +2242,103 @@ var Tt = (e, t, n = {}) => {
2232
2242
  } else return isNaN(Number(t)) ? -1 : 1;
2233
2243
  }
2234
2244
  return r.length - i.length;
2235
- }, oi = (e, t, n) => {
2236
- let r = 0, i = e.length, a = n ?? Kr(t);
2245
+ }, si = (e, t, n) => {
2246
+ let r = 0, i = e.length, a = n ?? qr(t);
2237
2247
  for (; r < i;) {
2238
2248
  let n = Math.floor((r + i) / 2), o = a(e[n], t);
2239
2249
  if (o === 0) return n;
2240
2250
  o < 0 ? r = n + 1 : i = n;
2241
2251
  }
2242
2252
  return r;
2243
- }, si = (e, t, n) => {
2244
- let r = oi(e, t, n);
2253
+ }, ci = (e, t, n) => {
2254
+ let r = si(e, t, n);
2245
2255
  e.splice(r, 0, t);
2246
- }, ci = /* @__PURE__ */ r({
2256
+ }, li = /* @__PURE__ */ r({
2247
2257
  EQUAL: () => 0,
2248
2258
  GREATER_THAN: () => 1,
2249
2259
  LESS_THAN: () => -1,
2250
- arraysEqual: () => Qr,
2251
- insert: () => si,
2252
- isEqualTo: () => ii,
2253
- isGreaterThan: () => ni,
2254
- isGreaterThanEqual: () => ri,
2255
- isLessThan: () => ti,
2256
- mapsEqual: () => Zr,
2257
- newF: () => Kr,
2258
- newFieldF: () => qr,
2259
- order: () => $r,
2260
- primitiveArrays: () => Jr,
2261
- reverseF: () => ei,
2262
- search: () => oi,
2263
- stringsWithNumbers: () => ai,
2264
- uniqueUnorderedPrimitiveArrays: () => Xr,
2265
- unorderedPrimitiveArrays: () => Yr
2266
- }), li = (e, t = 21) => (n = t) => {
2260
+ arraysEqual: () => $r,
2261
+ insert: () => ci,
2262
+ isEqualTo: () => ai,
2263
+ isGreaterThan: () => ri,
2264
+ isGreaterThanEqual: () => ii,
2265
+ isLessThan: () => ni,
2266
+ mapsEqual: () => Qr,
2267
+ newF: () => qr,
2268
+ newFieldF: () => Jr,
2269
+ order: () => ei,
2270
+ primitiveArrays: () => Yr,
2271
+ reverseF: () => ti,
2272
+ search: () => si,
2273
+ stringsWithNumbers: () => oi,
2274
+ uniqueUnorderedPrimitiveArrays: () => Zr,
2275
+ unorderedPrimitiveArrays: () => Xr
2276
+ }), ui = (e, t = 21) => (n = t) => {
2267
2277
  let r = "", i = n | 0;
2268
2278
  for (; i--;) r += e[Math.random() * e.length | 0];
2269
2279
  return r;
2270
- }, ui = /* @__PURE__ */ r({
2280
+ }, di = /* @__PURE__ */ r({
2271
2281
  LENGTH: () => 11,
2272
- create: () => hi
2273
- }), di = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", fi = `0123456789${di}`, pi = li(di, 1), mi = li(fi, 10), hi = () => `${pi()}${mi()}`, gi = /* @__PURE__ */ r({ createMatcher: () => _i }), _i = (e, t) => (n) => n instanceof t || typeof n == "object" && !!n && "discriminator" in n && n.discriminator === e, vi = /* @__PURE__ */ r({
2274
- DIRECTIONS: () => on,
2282
+ create: () => gi
2283
+ }), fi = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", pi = `0123456789${fi}`, mi = ui(fi, 1), hi = ui(pi, 10), gi = () => `${mi()}${hi()}`, _i = /* @__PURE__ */ r({ createMatcher: () => vi }), vi = (e, t) => (n) => n instanceof t || typeof n == "object" && !!n && "discriminator" in n && n.discriminator === e, yi = /* @__PURE__ */ r({
2284
+ DIRECTIONS: () => sn,
2275
2285
  construct: () => F,
2276
- crudeZ: () => yi,
2277
- dimension: () => xi,
2278
- directionZ: () => sn,
2279
- isDirection: () => Ci,
2280
- isX: () => Ti,
2281
- isY: () => Ei,
2282
- location: () => Si,
2283
- signedDimension: () => wi,
2284
- swap: () => bi
2285
- }), yi = e.enum([
2286
+ crudeZ: () => bi,
2287
+ dimension: () => Si,
2288
+ directionZ: () => cn,
2289
+ isDirection: () => wi,
2290
+ isX: () => Ei,
2291
+ isY: () => Di,
2292
+ location: () => Ci,
2293
+ signedDimension: () => Ti,
2294
+ swap: () => xi
2295
+ }), bi = e.enum([
2286
2296
  "x",
2287
2297
  "y",
2288
- ...rn,
2289
- ...un
2290
- ]), F = (e) => on.includes(e) ? e : $t.includes(e) ? "y" : "x", bi = (e) => F(e) === "x" ? "y" : "x", xi = (e) => F(e) === "x" ? "width" : "height", Si = (e) => F(e) === "x" ? "left" : "top", Ci = (e) => yi.safeParse(e).success, wi = (e) => F(e) === "x" ? "signedWidth" : "signedHeight", Ti = (e) => e === "center" ? !1 : F(e) === "x", Ei = (e) => F(e) === "y", Di = /* @__PURE__ */ r({
2291
- BOTTOM_CENTER: () => Ki,
2292
- BOTTOM_LEFT: () => Hi,
2293
- BOTTOM_RIGHT: () => Ui,
2294
- CENTER: () => Wi,
2295
- CENTER_LEFT: () => Ji,
2296
- CENTER_LOCATIONS: () => un,
2297
- CENTER_RIGHT: () => qi,
2298
- LOCATIONS: () => fn,
2299
- OUTER_LOCATIONS: () => rn,
2300
- TOP_CENTER: () => Gi,
2301
- TOP_LEFT: () => Bi,
2302
- TOP_RIGHT: () => Vi,
2303
- XY_LOCATIONS: () => Yi,
2304
- X_LOCATIONS: () => Zt,
2305
- Y_LOCATIONS: () => $t,
2306
- centerZ: () => Ai,
2298
+ ...an,
2299
+ ...dn
2300
+ ]), F = (e) => sn.includes(e) ? e : en.includes(e) ? "y" : "x", xi = (e) => F(e) === "x" ? "y" : "x", Si = (e) => F(e) === "x" ? "width" : "height", Ci = (e) => F(e) === "x" ? "left" : "top", wi = (e) => bi.safeParse(e).success, Ti = (e) => F(e) === "x" ? "signedWidth" : "signedHeight", Ei = (e) => e === "center" ? !1 : F(e) === "x", Di = (e) => F(e) === "y", Oi = /* @__PURE__ */ r({
2301
+ BOTTOM_CENTER: () => qi,
2302
+ BOTTOM_LEFT: () => Ui,
2303
+ BOTTOM_RIGHT: () => Wi,
2304
+ CENTER: () => Gi,
2305
+ CENTER_LEFT: () => Yi,
2306
+ CENTER_LOCATIONS: () => dn,
2307
+ CENTER_RIGHT: () => Ji,
2308
+ LOCATIONS: () => pn,
2309
+ OUTER_LOCATIONS: () => an,
2310
+ TOP_CENTER: () => Ki,
2311
+ TOP_LEFT: () => Vi,
2312
+ TOP_RIGHT: () => Hi,
2313
+ XY_LOCATIONS: () => Xi,
2314
+ X_LOCATIONS: () => Qt,
2315
+ Y_LOCATIONS: () => en,
2316
+ centerZ: () => ji,
2307
2317
  construct: () => I,
2308
- constructXY: () => na,
2309
- cornerZ: () => Mi,
2310
- crudeZ: () => Fi,
2311
- direction: () => Ri,
2312
- isX: () => $i,
2313
- isY: () => ea,
2314
- locationZ: () => pn,
2315
- outerZ: () => ji,
2316
- rotate: () => Li,
2317
- swap: () => Ii,
2318
- xZ: () => Oi,
2319
- xy: () => zi,
2320
- xyCouple: () => Qi,
2321
- xyEquals: () => Xi,
2322
- xyMatches: () => Zi,
2323
- xyToString: () => ta,
2324
- yZ: () => ki
2325
- }), Oi = Qt, ki = en, Ai = dn, ji = an, Mi = Sn, Ni = {
2318
+ constructXY: () => ra,
2319
+ cornerZ: () => Ni,
2320
+ crudeZ: () => Ii,
2321
+ direction: () => zi,
2322
+ isX: () => ea,
2323
+ isY: () => ta,
2324
+ locationZ: () => mn,
2325
+ outerZ: () => Mi,
2326
+ rotate: () => Ri,
2327
+ swap: () => Li,
2328
+ xZ: () => ki,
2329
+ xy: () => Bi,
2330
+ xyCouple: () => $i,
2331
+ xyEquals: () => Zi,
2332
+ xyMatches: () => Qi,
2333
+ xyToString: () => na,
2334
+ yZ: () => Ai
2335
+ }), ki = $t, Ai = tn, ji = fn, Mi = on, Ni = Cn, Pi = {
2326
2336
  top: "bottom",
2327
2337
  right: "left",
2328
2338
  bottom: "top",
2329
2339
  left: "right",
2330
2340
  center: "center"
2331
- }, Pi = {
2341
+ }, Fi = {
2332
2342
  top: {
2333
2343
  clockwise: "left",
2334
2344
  counterclockwise: "right"
@@ -2345,103 +2355,103 @@ var Tt = (e, t, n = {}) => {
2345
2355
  clockwise: "bottom",
2346
2356
  counterclockwise: "top"
2347
2357
  }
2348
- }, Fi = t.union([
2349
- sn,
2350
- t.enum([...rn, ...un]),
2358
+ }, Ii = t.union([
2359
+ cn,
2360
+ t.enum([...an, ...dn]),
2351
2361
  t.instanceof(String)
2352
- ]), I = (e) => e instanceof String || !on.includes(e) ? e : e === "x" ? "left" : "top", Ii = (e) => Ni[I(e)], Li = (e, t) => Pi[e][t], Ri = (e) => {
2362
+ ]), I = (e) => e instanceof String || !sn.includes(e) ? e : e === "x" ? "left" : "top", Li = (e) => Pi[I(e)], Ri = (e, t) => Fi[e][t], zi = (e) => {
2353
2363
  let t = I(e);
2354
2364
  return t === "top" || t === "bottom" ? "y" : "x";
2355
- }, zi = t.object({
2356
- x: Qt.or(dn),
2357
- y: en.or(dn)
2358
- }), Bi = Object.freeze({
2365
+ }, Bi = t.object({
2366
+ x: $t.or(fn),
2367
+ y: tn.or(fn)
2368
+ }), Vi = Object.freeze({
2359
2369
  x: "left",
2360
2370
  y: "top"
2361
- }), Vi = Object.freeze({
2371
+ }), Hi = Object.freeze({
2362
2372
  x: "right",
2363
2373
  y: "top"
2364
- }), Hi = Object.freeze({
2374
+ }), Ui = Object.freeze({
2365
2375
  x: "left",
2366
2376
  y: "bottom"
2367
- }), Ui = Object.freeze({
2377
+ }), Wi = Object.freeze({
2368
2378
  x: "right",
2369
2379
  y: "bottom"
2370
- }), Wi = Object.freeze({
2380
+ }), Gi = Object.freeze({
2371
2381
  x: "center",
2372
2382
  y: "center"
2373
- }), Gi = Object.freeze({
2383
+ }), Ki = Object.freeze({
2374
2384
  x: "center",
2375
2385
  y: "top"
2376
- }), Ki = Object.freeze({
2386
+ }), qi = Object.freeze({
2377
2387
  x: "center",
2378
2388
  y: "bottom"
2379
- }), qi = Object.freeze({
2389
+ }), Ji = Object.freeze({
2380
2390
  x: "right",
2381
2391
  y: "center"
2382
- }), Ji = Object.freeze({
2392
+ }), Yi = Object.freeze({
2383
2393
  x: "left",
2384
2394
  y: "center"
2385
- }), Yi = Object.freeze([
2395
+ }), Xi = Object.freeze([
2396
+ Yi,
2386
2397
  Ji,
2387
- qi,
2388
- Gi,
2389
2398
  Ki,
2390
- Bi,
2399
+ qi,
2391
2400
  Vi,
2392
2401
  Hi,
2393
2402
  Ui,
2394
- Wi
2395
- ]), Xi = (e, t) => e.x === t.x && e.y === t.y, Zi = (e, t) => {
2403
+ Wi,
2404
+ Gi
2405
+ ]), Zi = (e, t) => e.x === t.x && e.y === t.y, Qi = (e, t) => {
2396
2406
  if (typeof t == "object") {
2397
2407
  let n = !0;
2398
2408
  return "x" in t && e.x !== t.x && (n = !1), "y" in t && e.y !== t.y && (n = !1), n;
2399
2409
  }
2400
2410
  return e.x === t || e.y === t;
2401
- }, Qi = (e) => [e.x, e.y], $i = (e) => Ri(I(e)) === "x", ea = (e) => Ri(I(e)) === "y", ta = (e) => `${e.x}${ie(e.y)}`, na = (e, t) => {
2411
+ }, $i = (e) => [e.x, e.y], ea = (e) => zi(I(e)) === "x", ta = (e) => zi(I(e)) === "y", na = (e) => `${e.x}${ae(e.y)}`, ra = (e, t) => {
2402
2412
  let n, r;
2403
- if (typeof e == "object" && "x" in e ? (n = e.x, r = e.y) : (n = I(e), r = I(t ?? e)), Ri(n) === Ri(r) && n !== "center" && r !== "center") throw Error(`[XYLocation] - encountered two locations with the same direction: ${n.toString()} - ${r.toString()}`);
2404
- let i = { ...Wi };
2405
- return n === "center" ? $i(r) ? [i.x, i.y] = [r, n] : [i.x, i.y] = [n, r] : $i(n) ? [i.x, i.y] = [n, r] : [i.x, i.y] = [r, n], i;
2406
- }, ra = /* @__PURE__ */ r({
2407
- INFINITY: () => oa,
2408
- NAN: () => sa,
2409
- ONE: () => aa,
2413
+ if (typeof e == "object" && "x" in e ? (n = e.x, r = e.y) : (n = I(e), r = I(t ?? e)), zi(n) === zi(r) && n !== "center" && r !== "center") throw Error(`[XYLocation] - encountered two locations with the same direction: ${n.toString()} - ${r.toString()}`);
2414
+ let i = { ...Gi };
2415
+ return n === "center" ? ea(r) ? [i.x, i.y] = [r, n] : [i.x, i.y] = [n, r] : ea(n) ? [i.x, i.y] = [n, r] : [i.x, i.y] = [r, n], i;
2416
+ }, ia = /* @__PURE__ */ r({
2417
+ INFINITY: () => sa,
2418
+ NAN: () => ca,
2419
+ ONE: () => oa,
2410
2420
  ZERO: () => R,
2411
- average: () => Ta,
2412
- calculateMiters: () => Ea,
2413
- clientXYZ: () => En,
2421
+ average: () => Ea,
2422
+ calculateMiters: () => Da,
2423
+ clientXYZ: () => Dn,
2414
2424
  construct: () => L,
2415
- couple: () => ya,
2416
- crudeZ: () => ia,
2417
- css: () => ba,
2418
- distance: () => ha,
2419
- equals: () => ca,
2420
- isFinite: () => va,
2421
- isNan: () => _a,
2422
- isZero: () => la,
2423
- normal: () => Ca,
2424
- normalize: () => wa,
2425
- reciprocal: () => ka,
2426
- rotate: () => Aa,
2427
- round: () => Oa,
2428
- scale: () => ua,
2429
- set: () => ma,
2430
- sub: () => Sa,
2431
- swap: () => Da,
2432
- translate: () => pa,
2433
- translateX: () => da,
2434
- translateY: () => fa,
2435
- translation: () => ga,
2436
- truncate: () => xa,
2425
+ couple: () => ba,
2426
+ crudeZ: () => aa,
2427
+ css: () => xa,
2428
+ distance: () => ga,
2429
+ equals: () => la,
2430
+ isFinite: () => ya,
2431
+ isNan: () => va,
2432
+ isZero: () => ua,
2433
+ normal: () => wa,
2434
+ normalize: () => Ta,
2435
+ reciprocal: () => Aa,
2436
+ rotate: () => ja,
2437
+ round: () => ka,
2438
+ scale: () => da,
2439
+ set: () => ha,
2440
+ sub: () => Ca,
2441
+ swap: () => Oa,
2442
+ translate: () => ma,
2443
+ translateX: () => fa,
2444
+ translateY: () => pa,
2445
+ translation: () => _a,
2446
+ truncate: () => Sa,
2437
2447
  xyZ: () => T
2438
- }), ia = t.union([
2448
+ }), aa = t.union([
2439
2449
  t.number(),
2440
2450
  T,
2441
- An,
2442
- wn,
2451
+ jn,
2443
2452
  Tn,
2444
- En
2453
+ En,
2454
+ Dn
2445
2455
  ]), L = (e, t) => {
2446
2456
  if (typeof e == "string") {
2447
2457
  if (t === void 0) throw Error("The y coordinate must be given.");
@@ -2475,40 +2485,40 @@ var Tt = (e, t, n = {}) => {
2475
2485
  }, R = Object.freeze({
2476
2486
  x: 0,
2477
2487
  y: 0
2478
- }), aa = Object.freeze({
2488
+ }), oa = Object.freeze({
2479
2489
  x: 1,
2480
2490
  y: 1
2481
- }), oa = Object.freeze({
2491
+ }), sa = Object.freeze({
2482
2492
  x: Infinity,
2483
2493
  y: Infinity
2484
- }), sa = Object.freeze({
2494
+ }), ca = Object.freeze({
2485
2495
  x: NaN,
2486
2496
  y: NaN
2487
- }), ca = (e, t, n = 0) => {
2497
+ }), la = (e, t, n = 0) => {
2488
2498
  let r = L(e), i = L(t);
2489
2499
  return n === 0 ? r.x === i.x && r.y === i.y : Math.abs(r.x - i.x) <= n && Math.abs(r.y - i.y) <= n;
2490
- }, la = (e) => ca(e, R), ua = (e, t, n) => {
2500
+ }, ua = (e) => la(e, R), da = (e, t, n) => {
2491
2501
  let r = L(e), i = L(t, n);
2492
2502
  return {
2493
2503
  x: r.x * i.x,
2494
2504
  y: r.y * i.y
2495
2505
  };
2496
- }, da = (e, t) => {
2506
+ }, fa = (e, t) => {
2497
2507
  let n = L(e);
2498
2508
  return {
2499
2509
  x: n.x + t,
2500
2510
  y: n.y
2501
2511
  };
2502
- }, fa = (e, t) => {
2512
+ }, pa = (e, t) => {
2503
2513
  let n = L(e);
2504
2514
  return {
2505
2515
  x: n.x,
2506
2516
  y: n.y + t
2507
2517
  };
2508
- }, pa = (e, t, n, ...r) => {
2518
+ }, ma = (e, t, n, ...r) => {
2509
2519
  if (typeof t == "string") {
2510
2520
  if (typeof n != "number") throw Error("The value must be a number.");
2511
- return t === "x" ? da(e, n) : fa(e, n);
2521
+ return t === "x" ? fa(e, n) : pa(e, n);
2512
2522
  }
2513
2523
  if (typeof t == "object" && "x" in t && typeof t.x == "string") {
2514
2524
  let r = L(n), i = L(e);
@@ -2529,7 +2539,7 @@ var Tt = (e, t, n = {}) => {
2529
2539
  y: e.y + n.y
2530
2540
  };
2531
2541
  }, R);
2532
- }, ma = (e, t, n) => {
2542
+ }, ha = (e, t, n) => {
2533
2543
  let r = L(e);
2534
2544
  return F(t) === "x" ? {
2535
2545
  x: n,
@@ -2538,43 +2548,43 @@ var Tt = (e, t, n = {}) => {
2538
2548
  x: r.x,
2539
2549
  y: n
2540
2550
  };
2541
- }, ha = (e, t) => {
2551
+ }, ga = (e, t) => {
2542
2552
  let n = L(e), r = L(t);
2543
2553
  return Math.sqrt((n.x - r.x) ** 2 + (n.y - r.y) ** 2);
2544
- }, ga = (e, t) => {
2554
+ }, _a = (e, t) => {
2545
2555
  let n = L(e), r = L(t);
2546
2556
  return {
2547
2557
  x: r.x - n.x,
2548
2558
  y: r.y - n.y
2549
2559
  };
2550
- }, _a = (e) => {
2560
+ }, va = (e) => {
2551
2561
  let t = L(e);
2552
2562
  return Number.isNaN(t.x) || Number.isNaN(t.y);
2553
- }, va = (e) => {
2563
+ }, ya = (e) => {
2554
2564
  let t = L(e);
2555
2565
  return Number.isFinite(t.x) && Number.isFinite(t.y);
2556
- }, ya = (e) => {
2566
+ }, ba = (e) => {
2557
2567
  let t = L(e);
2558
2568
  return [t.x, t.y];
2559
- }, ba = (e) => {
2569
+ }, xa = (e) => {
2560
2570
  let t = L(e);
2561
2571
  return {
2562
2572
  left: t.x,
2563
2573
  top: t.y
2564
2574
  };
2565
- }, xa = (e, t = 0) => {
2575
+ }, Sa = (e, t = 0) => {
2566
2576
  let n = L(e);
2567
2577
  return {
2568
2578
  x: Number(n.x.toFixed(t)),
2569
2579
  y: Number(n.y.toFixed(t))
2570
2580
  };
2571
- }, Sa = (e, t) => {
2581
+ }, Ca = (e, t) => {
2572
2582
  let n = L(e), r = L(t);
2573
2583
  return {
2574
2584
  x: n.x - r.x,
2575
2585
  y: n.y - r.y
2576
2586
  };
2577
- }, Ca = (e) => {
2587
+ }, wa = (e) => {
2578
2588
  let t = L(e), n = Math.hypot(t.x, t.y);
2579
2589
  return n === 0 ? {
2580
2590
  x: 0,
@@ -2583,7 +2593,7 @@ var Tt = (e, t, n = {}) => {
2583
2593
  x: -t.y / n,
2584
2594
  y: t.x / n
2585
2595
  };
2586
- }, wa = (e) => {
2596
+ }, Ta = (e) => {
2587
2597
  let t = L(e), n = Math.hypot(t.x, t.y);
2588
2598
  return n === 0 ? {
2589
2599
  x: 0,
@@ -2592,123 +2602,123 @@ var Tt = (e, t, n = {}) => {
2592
2602
  x: t.x / n,
2593
2603
  y: t.y / n
2594
2604
  };
2595
- }, Ta = (...e) => ua(e.reduce((e, t) => pa(e, t), R), 1 / e.length), Ea = (e, t) => {
2605
+ }, Ea = (...e) => da(e.reduce((e, t) => ma(e, t), R), 1 / e.length), Da = (e, t) => {
2596
2606
  let n = [];
2597
2607
  for (let r = 0; r < e.length; r++) {
2598
2608
  let i = e[r], a, o, s, c;
2599
2609
  if (r === 0) {
2600
2610
  let n = e[r + 1];
2601
- o = Ca(Sa(n, i)), s = o, c = t;
2611
+ o = wa(Ca(n, i)), s = o, c = t;
2602
2612
  } else if (r === e.length - 1) {
2603
2613
  let n = e[r - 1];
2604
- a = Ca(Sa(i, n)), s = a, c = t;
2614
+ a = wa(Ca(i, n)), s = a, c = t;
2605
2615
  } else {
2606
- let n = e[r - 1], l = e[r + 1], u = Sa(i, n), d = Sa(l, i);
2607
- a = Ca(u), o = Ca(d);
2616
+ let n = e[r - 1], l = e[r + 1], u = Ca(i, n), d = Ca(l, i);
2617
+ a = wa(u), o = wa(d);
2608
2618
  let f = Math.acos((u.x * d.x + u.y * d.y) / (Math.hypot(u.x, u.y) * Math.hypot(d.x, d.y))), p = Math.sin(f / 2);
2609
- c = p === 0 ? t : t / p, s = wa(Ta(a, o));
2619
+ c = p === 0 ? t : t / p, s = Ta(Ea(a, o));
2610
2620
  }
2611
- n.push(ua(s, c));
2621
+ n.push(da(s, c));
2612
2622
  }
2613
2623
  return n;
2614
- }, Da = (e) => {
2624
+ }, Oa = (e) => {
2615
2625
  let t = L(e);
2616
2626
  return {
2617
2627
  x: t.y,
2618
2628
  y: t.x
2619
2629
  };
2620
- }, Oa = (e) => {
2630
+ }, ka = (e) => {
2621
2631
  let t = L(e);
2622
2632
  return {
2623
2633
  x: Math.round(t.x),
2624
2634
  y: Math.round(t.y)
2625
2635
  };
2626
- }, ka = (e) => {
2636
+ }, Aa = (e) => {
2627
2637
  let t = L(e);
2628
2638
  return {
2629
2639
  x: 1 / t.x,
2630
2640
  y: 1 / t.y
2631
2641
  };
2632
- }, Aa = (e, t, n) => {
2642
+ }, ja = (e, t, n) => {
2633
2643
  let r = L(e), i = L(t), a = n === "clockwise" ? Math.PI / 2 : -Math.PI / 2, o = r.x - i.x, s = r.y - i.y, c = o * Math.cos(a) - s * Math.sin(a), l = o * Math.sin(a) + s * Math.cos(a);
2634
2644
  return {
2635
2645
  x: c + i.x,
2636
2646
  y: l + i.y
2637
2647
  };
2638
- }, ja = /* @__PURE__ */ r({
2639
- DECIMAL: () => La,
2640
- ZERO: () => Ia,
2641
- area: () => _o,
2642
- areaIsZero: () => Ka,
2643
- aspect: () => mo,
2648
+ }, Ma = /* @__PURE__ */ r({
2649
+ DECIMAL: () => Ra,
2650
+ ZERO: () => La,
2651
+ area: () => vo,
2652
+ areaIsZero: () => qa,
2653
+ aspect: () => ho,
2644
2654
  bottom: () => G,
2645
- bottomCenter: () => $a,
2646
- bottomLeft: () => Qa,
2647
- bottomRight: () => eo,
2648
- box: () => Fa,
2649
- center: () => ro,
2650
- centerLeft: () => to,
2651
- centerRight: () => no,
2655
+ bottomCenter: () => eo,
2656
+ bottomLeft: () => $a,
2657
+ bottomRight: () => to,
2658
+ box: () => Ia,
2659
+ center: () => io,
2660
+ centerLeft: () => no,
2661
+ centerRight: () => ro,
2652
2662
  construct: () => z,
2653
- constructWithAlternateRoot: () => yo,
2654
- contains: () => Ba,
2655
- copy: () => Ra,
2656
- css: () => Wa,
2657
- cssBox: () => Na,
2658
- dim: () => Ga,
2659
- dims: () => Ha,
2660
- domRect: () => Pa,
2661
- edgePoints: () => uo,
2662
- equals: () => Va,
2663
+ constructWithAlternateRoot: () => bo,
2664
+ contains: () => Va,
2665
+ copy: () => za,
2666
+ css: () => Ga,
2667
+ cssBox: () => Pa,
2668
+ dim: () => Ka,
2669
+ dims: () => Ua,
2670
+ domRect: () => Fa,
2671
+ edgePoints: () => fo,
2672
+ equals: () => Ha,
2663
2673
  height: () => U,
2664
- intersection: () => go,
2665
- isBox: () => po,
2674
+ intersection: () => _o,
2675
+ isBox: () => mo,
2666
2676
  left: () => K,
2667
2677
  loc: () => V,
2668
- positionInCenter: () => fo,
2669
- reRoot: () => lo,
2670
- resize: () => za,
2678
+ positionInCenter: () => po,
2679
+ reRoot: () => uo,
2680
+ resize: () => Ba,
2671
2681
  right: () => W,
2672
- root: () => oo,
2673
- round: () => bo,
2674
- signedDims: () => Ua,
2675
- signedHeight: () => Ja,
2676
- signedWidth: () => qa,
2682
+ root: () => so,
2683
+ round: () => xo,
2684
+ signedDims: () => Wa,
2685
+ signedHeight: () => Ya,
2686
+ signedWidth: () => Ja,
2677
2687
  top: () => q,
2678
- topCenter: () => Xa,
2679
- topLeft: () => Ya,
2680
- topRight: () => Za,
2681
- translate: () => ho,
2682
- truncate: () => vo,
2688
+ topCenter: () => Za,
2689
+ topLeft: () => Xa,
2690
+ topRight: () => Qa,
2691
+ translate: () => go,
2692
+ truncate: () => yo,
2683
2693
  width: () => H,
2684
- x: () => io,
2685
- xBounds: () => so,
2694
+ x: () => ao,
2695
+ xBounds: () => co,
2686
2696
  xyLoc: () => B,
2687
- y: () => ao,
2688
- yBounds: () => co
2689
- }), Ma = t.union([t.number(), t.string()]), Na = t.object({
2690
- top: Ma,
2691
- left: Ma,
2692
- width: Ma,
2693
- height: Ma
2694
- }), Pa = t.object({
2697
+ y: () => oo,
2698
+ yBounds: () => lo
2699
+ }), Na = t.union([t.number(), t.string()]), Pa = t.object({
2700
+ top: Na,
2701
+ left: Na,
2702
+ width: Na,
2703
+ height: Na
2704
+ }), Fa = t.object({
2695
2705
  left: t.number(),
2696
2706
  top: t.number(),
2697
2707
  right: t.number(),
2698
2708
  bottom: t.number()
2699
- }), Fa = t.object({
2709
+ }), Ia = t.object({
2700
2710
  one: T,
2701
2711
  two: T,
2702
- root: Mi
2703
- }), Ia = {
2712
+ root: Ni
2713
+ }), La = {
2704
2714
  one: R,
2705
2715
  two: R,
2706
- root: Bi
2707
- }, La = {
2716
+ root: Vi
2717
+ }, Ra = {
2708
2718
  one: R,
2709
- two: aa,
2710
- root: Hi
2711
- }, Ra = (e, t) => ({
2719
+ two: oa,
2720
+ root: Ui
2721
+ }, za = (e, t) => ({
2712
2722
  one: e.one,
2713
2723
  two: e.two,
2714
2724
  root: t ?? e.root
@@ -2716,7 +2726,7 @@ var Tt = (e, t, n = {}) => {
2716
2726
  let a = {
2717
2727
  one: { ...R },
2718
2728
  two: { ...R },
2719
- root: i ?? Bi
2729
+ root: i ?? Vi
2720
2730
  };
2721
2731
  if (typeof e == "number") {
2722
2732
  if (typeof t != "number") throw Error("Box constructor called with invalid arguments");
@@ -2750,7 +2760,7 @@ var Tt = (e, t, n = {}) => {
2750
2760
  x: a.one.x + t.signedWidth,
2751
2761
  y: a.one.y + t.signedHeight
2752
2762
  } : a.two = t, a));
2753
- }, za = (e, t, n) => {
2763
+ }, Ba = (e, t, n) => {
2754
2764
  let r = z(e);
2755
2765
  if (typeof t == "string") {
2756
2766
  if (n == null) throw Error("Invalid arguments for resize");
@@ -2758,93 +2768,93 @@ var Tt = (e, t, n = {}) => {
2758
2768
  return z(r.one, void 0, e === "x" ? n : H(r), e === "y" ? n : U(r), r.root);
2759
2769
  }
2760
2770
  return z(r.one, t, void 0, void 0, r.root);
2761
- }, Ba = (e, t, n = !0) => {
2771
+ }, Va = (e, t, n = !0) => {
2762
2772
  let r = z(e), i = (e, t) => e < t;
2763
2773
  return n && (i = (e, t) => e <= t), "one" in t ? i(K(r), K(t)) && i(W(t), W(r)) && i(q(r), q(t)) && i(G(t), G(r)) : i(K(r), t.x) && i(t.x, W(r)) && i(q(r), t.y) && i(t.y, G(r));
2764
- }, Va = (e, t) => ca(e.one, t.one) && ca(e.two, t.two) && Xi(e.root, t.root), Ha = (e) => ({
2774
+ }, Ha = (e, t) => la(e.one, t.one) && la(e.two, t.two) && Zi(e.root, t.root), Ua = (e) => ({
2765
2775
  width: H(e),
2766
2776
  height: U(e)
2767
- }), Ua = (e) => ({
2768
- signedWidth: qa(e),
2769
- signedHeight: Ja(e)
2770
2777
  }), Wa = (e) => ({
2778
+ signedWidth: Ja(e),
2779
+ signedHeight: Ya(e)
2780
+ }), Ga = (e) => ({
2771
2781
  top: q(e),
2772
2782
  left: K(e),
2773
2783
  width: H(e),
2774
2784
  height: U(e)
2775
- }), Ga = (e, t, n = !1) => {
2776
- let r = F(t) === "y" ? Ja(e) : qa(e);
2785
+ }), Ka = (e, t, n = !1) => {
2786
+ let r = F(t) === "y" ? Ya(e) : Ja(e);
2777
2787
  return n ? r : Math.abs(r);
2778
2788
  }, B = (e, t) => {
2779
2789
  let n = z(e);
2780
2790
  return {
2781
- x: t.x === "center" ? ro(n).x : V(n, t.x),
2782
- y: t.y === "center" ? ro(n).y : V(n, t.y)
2791
+ x: t.x === "center" ? io(n).x : V(n, t.x),
2792
+ y: t.y === "center" ? io(n).y : V(n, t.y)
2783
2793
  };
2784
2794
  }, V = (e, t) => {
2785
- let n = z(e), r = Qi(n.root).includes(t) ? Math.min : Math.max;
2786
- return Zt.includes(t) ? r(n.one.x, n.two.x) : r(n.one.y, n.two.y);
2787
- }, Ka = (e) => _o(e) === 0, H = (e) => Ga(e, "x"), U = (e) => Ga(e, "y"), qa = (e) => {
2795
+ let n = z(e), r = $i(n.root).includes(t) ? Math.min : Math.max;
2796
+ return Qt.includes(t) ? r(n.one.x, n.two.x) : r(n.one.y, n.two.y);
2797
+ }, qa = (e) => vo(e) === 0, H = (e) => Ka(e, "x"), U = (e) => Ka(e, "y"), Ja = (e) => {
2788
2798
  let t = z(e);
2789
2799
  return t.two.x - t.one.x;
2790
- }, Ja = (e) => {
2800
+ }, Ya = (e) => {
2791
2801
  let t = z(e);
2792
2802
  return t.two.y - t.one.y;
2793
- }, Ya = (e) => B(e, Bi), Xa = (e) => B(e, Gi), Za = (e) => B(e, Vi), Qa = (e) => B(e, Hi), $a = (e) => B(e, Ki), eo = (e) => B(e, Ui), to = (e) => B(e, Ji), no = (e) => B(e, qi), W = (e) => V(e, "right"), G = (e) => V(e, "bottom"), K = (e) => V(e, "left"), q = (e) => V(e, "top"), ro = (e) => pa(Ya(e), {
2794
- x: qa(e) / 2,
2795
- y: Ja(e) / 2
2796
- }), io = (e) => {
2803
+ }, Xa = (e) => B(e, Vi), Za = (e) => B(e, Ki), Qa = (e) => B(e, Hi), $a = (e) => B(e, Ui), eo = (e) => B(e, qi), to = (e) => B(e, Wi), no = (e) => B(e, Yi), ro = (e) => B(e, Ji), W = (e) => V(e, "right"), G = (e) => V(e, "bottom"), K = (e) => V(e, "left"), q = (e) => V(e, "top"), io = (e) => ma(Xa(e), {
2804
+ x: Ja(e) / 2,
2805
+ y: Ya(e) / 2
2806
+ }), ao = (e) => {
2797
2807
  let t = z(e);
2798
2808
  return t.root.x === "left" ? K(t) : W(t);
2799
- }, ao = (e) => {
2809
+ }, oo = (e) => {
2800
2810
  let t = z(e);
2801
2811
  return t.root.y === "top" ? q(t) : G(t);
2802
- }, oo = (e) => ({
2803
- x: io(e),
2804
- y: ao(e)
2805
- }), so = (e) => {
2812
+ }, so = (e) => ({
2813
+ x: ao(e),
2814
+ y: oo(e)
2815
+ }), co = (e) => {
2806
2816
  let t = z(e);
2807
2817
  return {
2808
2818
  lower: t.one.x,
2809
2819
  upper: t.two.x
2810
2820
  };
2811
- }, co = (e) => {
2821
+ }, lo = (e) => {
2812
2822
  let t = z(e);
2813
2823
  return {
2814
2824
  lower: t.one.y,
2815
2825
  upper: t.two.y
2816
2826
  };
2817
- }, lo = (e, t) => Ra(e, t), uo = (e, t) => {
2818
- let n = z(e), r = Zt.includes(t) ? "x" : $t.includes(t) ? "y" : null;
2827
+ }, uo = (e, t) => za(e, t), fo = (e, t) => {
2828
+ let n = z(e), r = Qt.includes(t) ? "x" : en.includes(t) ? "y" : null;
2819
2829
  if (r === null) throw Error(`Invalid location: ${t}`);
2820
2830
  let i = t === "top" || t === "left" ? Math.min : Math.max, a = { ...n.one }, o = { ...n.two };
2821
2831
  return a[r] = i(n.one[r], n.two[r]), o[r] = i(n.one[r], n.two[r]), [a, o];
2822
- }, fo = (e, t) => {
2832
+ }, po = (e, t) => {
2823
2833
  let n = z(e), r = z(t);
2824
2834
  return z({
2825
- x: io(r) + (H(r) - H(n)) / 2,
2826
- y: ao(r) + (U(r) - U(n)) / 2
2827
- }, Ha(n));
2828
- }, po = (e) => typeof e != "object" || !e ? !1 : "one" in e && "two" in e && "root" in e, mo = (e) => H(e) / U(e), ho = (e, t, n) => {
2835
+ x: ao(r) + (H(r) - H(n)) / 2,
2836
+ y: oo(r) + (U(r) - U(n)) / 2
2837
+ }, Ua(n));
2838
+ }, mo = (e) => typeof e != "object" || !e ? !1 : "one" in e && "two" in e && "root" in e, ho = (e) => H(e) / U(e), go = (e, t, n) => {
2829
2839
  if (typeof t == "string") {
2830
2840
  if (n == null) throw Error("Undefined amount passed into box.translate");
2831
2841
  t = L(F(t), n);
2832
2842
  }
2833
2843
  let r = z(e);
2834
- return z(pa(r.one, t), pa(r.two, t), void 0, void 0, r.root);
2835
- }, go = (e, t) => {
2844
+ return z(ma(r.one, t), ma(r.two, t), void 0, void 0, r.root);
2845
+ }, _o = (e, t) => {
2836
2846
  let n = Math.max(K(e), K(t)), r = Math.max(q(e), q(t)), i = Math.min(W(e), W(t)), a = Math.min(G(e), G(t));
2837
- return n > i || r > a ? Ia : z({
2847
+ return n > i || r > a ? La : z({
2838
2848
  x: n,
2839
2849
  y: r
2840
2850
  }, {
2841
2851
  x: i,
2842
2852
  y: a
2843
2853
  }, void 0, void 0, e.root);
2844
- }, _o = (e) => H(e) * U(e), vo = (e, t) => {
2854
+ }, vo = (e) => H(e) * U(e), yo = (e, t) => {
2845
2855
  let n = z(e);
2846
- return z(xa(n.one, t), xa(n.two, t), void 0, void 0, n.root);
2847
- }, yo = (e, t, n, r, i, a) => {
2856
+ return z(Sa(n.one, t), Sa(n.two, t), void 0, void 0, n.root);
2857
+ }, bo = (e, t, n, r, i, a) => {
2848
2858
  let o = {
2849
2859
  x: e,
2850
2860
  y: t
@@ -2853,32 +2863,32 @@ var Tt = (e, t, n = {}) => {
2853
2863
  y: t + r
2854
2864
  };
2855
2865
  return i.x !== a.x && (i.x === "center" ? (o.x -= n / 2, s.x -= n / 2) : (o.x -= n, s.x -= n)), i.y !== a.y && (i.y === "center" ? (o.y -= r / 2, s.y -= r / 2) : (o.y -= r, s.y -= r)), z(o, s, void 0, void 0, a);
2856
- }, bo = (e) => {
2866
+ }, xo = (e) => {
2857
2867
  let t = z(e);
2858
- return z(Oa(t.one), Oa(t.two), void 0, void 0, t.root);
2859
- }, xo = /* @__PURE__ */ r({
2860
- DECIMAL: () => wo,
2861
- ZERO: () => Co,
2868
+ return z(ka(t.one), ka(t.two), void 0, void 0, t.root);
2869
+ }, So = /* @__PURE__ */ r({
2870
+ DECIMAL: () => To,
2871
+ ZERO: () => wo,
2862
2872
  construct: () => J,
2863
- couple: () => Oo,
2864
- crude: () => So,
2865
- dimensionsZ: () => wn,
2866
- equals: () => To,
2867
- max: () => ko,
2868
- min: () => Ao,
2869
- scale: () => jo,
2870
- signedDimensionsZ: () => Tn,
2871
- svgViewBox: () => Do,
2872
- swap: () => Eo
2873
- }), So = t.union([
2874
- wn,
2873
+ couple: () => ko,
2874
+ crude: () => Co,
2875
+ dimensionsZ: () => Tn,
2876
+ equals: () => Eo,
2877
+ max: () => Ao,
2878
+ min: () => jo,
2879
+ scale: () => Mo,
2880
+ signedDimensionsZ: () => En,
2881
+ svgViewBox: () => Oo,
2882
+ swap: () => Do
2883
+ }), Co = t.union([
2875
2884
  Tn,
2885
+ En,
2876
2886
  T,
2877
- An
2878
- ]), Co = {
2887
+ jn
2888
+ ]), wo = {
2879
2889
  width: 0,
2880
2890
  height: 0
2881
- }, wo = {
2891
+ }, To = {
2882
2892
  width: 1,
2883
2893
  height: 1
2884
2894
  }, J = (e, t) => typeof e == "number" ? {
@@ -2893,58 +2903,58 @@ var Tt = (e, t, n = {}) => {
2893
2903
  } : "signedWidth" in e ? {
2894
2904
  width: e.signedWidth,
2895
2905
  height: e.signedHeight
2896
- } : { ...e }, To = (e, t) => {
2906
+ } : { ...e }, Eo = (e, t) => {
2897
2907
  if (t == null) return !1;
2898
2908
  let n = J(e), r = J(t);
2899
2909
  return n.width === r.width && n.height === r.height;
2900
- }, Eo = (e) => {
2910
+ }, Do = (e) => {
2901
2911
  let t = J(e);
2902
2912
  return {
2903
2913
  width: t.height,
2904
2914
  height: t.width
2905
2915
  };
2906
- }, Do = (e) => {
2916
+ }, Oo = (e) => {
2907
2917
  let t = J(e);
2908
2918
  return `0 0 ${t.width} ${t.height}`;
2909
- }, Oo = (e) => {
2919
+ }, ko = (e) => {
2910
2920
  let t = J(e);
2911
2921
  return [t.width, t.height];
2912
- }, ko = (e) => ({
2922
+ }, Ao = (e) => ({
2913
2923
  width: Math.max(...e.map((e) => J(e).width)),
2914
2924
  height: Math.max(...e.map((e) => J(e).height))
2915
- }), Ao = (e) => ({
2925
+ }), jo = (e) => ({
2916
2926
  width: Math.min(...e.map((e) => J(e).width)),
2917
2927
  height: Math.min(...e.map((e) => J(e).height))
2918
- }), jo = (e, t) => {
2928
+ }), Mo = (e, t) => {
2919
2929
  let n = J(e);
2920
2930
  return {
2921
2931
  width: n.width * t,
2922
2932
  height: n.height * t
2923
2933
  };
2924
- }, Mo = (e, t, n) => t !== void 0 && e < t ? t : n !== void 0 && e > n ? n : e, No = /* @__PURE__ */ r({
2925
- Scale: () => Ho,
2926
- XY: () => Uo,
2927
- crudeXYTransform: () => Po,
2928
- transform: () => Fo
2929
- }), Po = t.object({
2930
- offset: ia,
2931
- scale: ia
2934
+ }, No = (e, t, n) => t !== void 0 && e < t ? t : n !== void 0 && e > n ? n : e, Po = /* @__PURE__ */ r({
2935
+ Scale: () => Uo,
2936
+ XY: () => Wo,
2937
+ crudeXYTransform: () => Fo,
2938
+ transform: () => Io
2932
2939
  }), Fo = t.object({
2940
+ offset: aa,
2941
+ scale: aa
2942
+ }), Io = t.object({
2933
2943
  offset: t.number(),
2934
2944
  scale: t.number()
2935
- }), Io = (e) => (t, n, r, i) => n === "dimension" ? [t, r] : [t, i ? r - e : r + e], Lo = (e) => (t, n, r, i) => [t, i ? r / e : r * e], Ro = (e) => (t, n, r) => {
2945
+ }), Lo = (e) => (t, n, r, i) => n === "dimension" ? [t, r] : [t, i ? r - e : r + e], Ro = (e) => (t, n, r, i) => [t, i ? r / e : r * e], zo = (e) => (t, n, r) => {
2936
2946
  if (t === null) return [e, r];
2937
2947
  let { lower: i, upper: a } = t, { lower: o, upper: s } = e, c = a - i, l = s - o;
2938
2948
  return n === "dimension" ? [e, l / c * r] : [e, (r - i) * (l / c) + o];
2939
- }, zo = (e) => (t, n, r) => [e, r], Bo = () => (e, t, n) => {
2949
+ }, Bo = (e) => (t, n, r) => [e, r], Vo = () => (e, t, n) => {
2940
2950
  if (e === null) throw Error("cannot invert without bounds");
2941
2951
  if (t === "dimension") return [e, n];
2942
2952
  let { lower: r, upper: i } = e;
2943
2953
  return [e, i - (n - r)];
2944
- }, Vo = (e) => (t, n, r) => {
2954
+ }, Ho = (e) => (t, n, r) => {
2945
2955
  let { lower: i, upper: a } = e;
2946
- return r = Mo(r, i, a), [t, r];
2947
- }, Ho = class e {
2956
+ return r = No(r, i, a), [t, r];
2957
+ }, Uo = class e {
2948
2958
  ops = [];
2949
2959
  currBounds = null;
2950
2960
  currType = null;
@@ -2962,27 +2972,27 @@ var Tt = (e, t, n = {}) => {
2962
2972
  return new e().scale(t, n);
2963
2973
  }
2964
2974
  translate(e) {
2965
- let t = this.new(), n = Io(e);
2975
+ let t = this.new(), n = Lo(e);
2966
2976
  return n.type = "translate", t.ops.push(n), t;
2967
2977
  }
2968
2978
  magnify(e) {
2969
- let t = this.new(), n = Lo(e);
2979
+ let t = this.new(), n = Ro(e);
2970
2980
  return n.type = "magnify", t.ops.push(n), t;
2971
2981
  }
2972
2982
  scale(e, t) {
2973
- let n = E(e, t), r = this.new(), i = Ro(n);
2983
+ let n = E(e, t), r = this.new(), i = zo(n);
2974
2984
  return i.type = "scale", r.ops.push(i), r;
2975
2985
  }
2976
2986
  clamp(e, t) {
2977
- let n = E(e, t), r = this.new(), i = Vo(n);
2987
+ let n = E(e, t), r = this.new(), i = Ho(n);
2978
2988
  return i.type = "clamp", r.ops.push(i), r;
2979
2989
  }
2980
2990
  reBound(e, t) {
2981
- let n = E(e, t), r = this.new(), i = zo(n);
2991
+ let n = E(e, t), r = this.new(), i = Bo(n);
2982
2992
  return i.type = "re-bound", r.ops.push(i), r;
2983
2993
  }
2984
2994
  invert() {
2985
- let e = Bo();
2995
+ let e = Vo();
2986
2996
  e.type = "invert";
2987
2997
  let t = this.new();
2988
2998
  return t.ops.push(e), t;
@@ -3020,11 +3030,11 @@ var Tt = (e, t, n = {}) => {
3020
3030
  };
3021
3031
  }
3022
3032
  static IDENTITY = new e();
3023
- }, Uo = class e {
3033
+ }, Wo = class e {
3024
3034
  x;
3025
3035
  y;
3026
3036
  currRoot;
3027
- constructor(e = new Ho(), t = new Ho(), n = null) {
3037
+ constructor(e = new Uo(), t = new Uo(), n = null) {
3028
3038
  this.x = e, this.y = t, this.currRoot = n;
3029
3039
  }
3030
3040
  static translate(t, n) {
@@ -3066,19 +3076,19 @@ var Tt = (e, t, n = {}) => {
3066
3076
  }
3067
3077
  scale(e) {
3068
3078
  let t = this.copy();
3069
- if (po(e)) {
3079
+ if (mo(e)) {
3070
3080
  let n = this.currRoot;
3071
- return t.currRoot = e.root, n != null && !Xi(n, e.root) && (n.x !== e.root.x && (t.x = t.x.invert()), n.y !== e.root.y && (t.y = t.y.invert())), t.x = t.x.scale(so(e)), t.y = t.y.scale(co(e)), t;
3081
+ return t.currRoot = e.root, n != null && !Zi(n, e.root) && (n.x !== e.root.x && (t.x = t.x.invert()), n.y !== e.root.y && (t.y = t.y.invert())), t.x = t.x.scale(co(e)), t.y = t.y.scale(lo(e)), t;
3072
3082
  }
3073
3083
  return t.x = t.x.scale(e.width), t.y = t.y.scale(e.height), t;
3074
3084
  }
3075
3085
  reBound(e) {
3076
3086
  let t = this.copy();
3077
- return t.x = this.x.reBound(so(e)), t.y = this.y.reBound(co(e)), t;
3087
+ return t.x = this.x.reBound(co(e)), t.y = this.y.reBound(lo(e)), t;
3078
3088
  }
3079
3089
  clamp(e) {
3080
3090
  let t = this.copy();
3081
- return t.x = this.x.clamp(so(e)), t.y = this.y.clamp(co(e)), t;
3091
+ return t.x = this.x.clamp(co(e)), t.y = this.y.clamp(lo(e)), t;
3082
3092
  }
3083
3093
  copy() {
3084
3094
  let t = new e();
@@ -3116,29 +3126,29 @@ var Tt = (e, t, n = {}) => {
3116
3126
  };
3117
3127
  }
3118
3128
  static IDENTITY = new e();
3119
- }, Wo = /* @__PURE__ */ r({
3120
- calculate: () => Yo,
3121
- completeXYZ: () => Ko,
3122
- toCSS: () => qo,
3123
- toDecimal: () => Jo,
3124
- xyZ: () => Go
3125
- }), Go = kn, Ko = kn.required({
3129
+ }, Go = /* @__PURE__ */ r({
3130
+ calculate: () => Xo,
3131
+ completeXYZ: () => qo,
3132
+ toCSS: () => Jo,
3133
+ toDecimal: () => Yo,
3134
+ xyZ: () => Ko
3135
+ }), Ko = An, qo = An.required({
3126
3136
  root: !0,
3127
3137
  units: !0
3128
- }), qo = (e) => {
3138
+ }), Jo = (e) => {
3129
3139
  let t = {};
3130
3140
  return t[e.root?.x ?? "left"] = e?.units?.x === "px" ? `${e.x}px` : `${e.x * 100}%`, t[e.root?.y ?? "top"] = e?.units?.y === "px" ? `${e.y}px` : `${e.y * 100}%`, t;
3131
- }, Jo = ({ position: e, element: t, container: n }) => {
3141
+ }, Yo = ({ position: e, element: t, container: n }) => {
3132
3142
  let r = {
3133
3143
  x: e.x,
3134
3144
  y: e.y
3135
3145
  };
3136
3146
  return e.units?.x === "decimal" ? e.root?.x === "right" && (r.x = 1 - e.x) : e.root?.x === "right" ? r.x = 1 - (e.x + H(t)) / H(n) : r.x /= H(n), e.units?.y === "decimal" ? e.root?.y === "bottom" && (r.y = 1 - e.y) : e.root?.y === "bottom" ? r.y = 1 - (e.y + U(t)) / U(n) : r.y /= U(n), r;
3137
- }, Yo = ({ position: e, element: t, container: n, lowerThreshold: r = .2, upperThreshold: i = .8 }) => {
3147
+ }, Xo = ({ position: e, element: t, container: n, lowerThreshold: r = .2, upperThreshold: i = .8 }) => {
3138
3148
  let a = {
3139
3149
  x: e.x,
3140
3150
  y: e.y,
3141
- root: { ...Bi },
3151
+ root: { ...Vi },
3142
3152
  units: {
3143
3153
  x: "px",
3144
3154
  y: "px"
@@ -3146,55 +3156,55 @@ var Tt = (e, t, n = {}) => {
3146
3156
  };
3147
3157
  return e.x > i ? (a.x = (1 - e.x) * H(n) - H(t), a.root.x = "right") : e.x < r ? a.x = e.x * H(n) : a.units.x = "decimal", e.y > i ? (a.y = (1 - e.y) * U(n) - U(t), a.root.y = "bottom") : e.y < r ? a.y = e.y * U(n) : a.units.y = "decimal", a.x = Math.round(a.x * 100) / 100, {
3148
3158
  ...a,
3149
- ...xa(a, 3)
3159
+ ...Sa(a, 3)
3150
3160
  };
3151
- }, Xo = t.enum(["static", "dynamic"]), Zo = "00000000-0000-0000-0000-000000000000", Qo = /^(?:[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;
3161
+ }, Zo = t.enum(["static", "dynamic"]), Qo = "00000000-0000-0000-0000-000000000000", $o = /^(?:[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;
3152
3162
  //#endregion
3153
3163
  //#region ../../node_modules/.pnpm/uuid@14.0.0/node_modules/uuid/dist/validate.js
3154
- function $o(e) {
3155
- return typeof e == "string" && Qo.test(e);
3164
+ function es(e) {
3165
+ return typeof e == "string" && $o.test(e);
3156
3166
  }
3157
3167
  //#endregion
3158
3168
  //#region ../../node_modules/.pnpm/uuid@14.0.0/node_modules/uuid/dist/stringify.js
3159
3169
  var Y = [];
3160
3170
  for (let e = 0; e < 256; ++e) Y.push((e + 256).toString(16).slice(1));
3161
- function es(e, t = 0) {
3171
+ function ts(e, t = 0) {
3162
3172
  return (Y[e[t + 0]] + Y[e[t + 1]] + Y[e[t + 2]] + Y[e[t + 3]] + "-" + Y[e[t + 4]] + Y[e[t + 5]] + "-" + Y[e[t + 6]] + Y[e[t + 7]] + "-" + Y[e[t + 8]] + Y[e[t + 9]] + "-" + Y[e[t + 10]] + Y[e[t + 11]] + Y[e[t + 12]] + Y[e[t + 13]] + Y[e[t + 14]] + Y[e[t + 15]]).toLowerCase();
3163
3173
  }
3164
- function ts(e, t = 0) {
3165
- let n = es(e, t);
3166
- if (!$o(n)) throw TypeError("Stringified UUID is invalid");
3174
+ function ns(e, t = 0) {
3175
+ let n = ts(e, t);
3176
+ if (!es(n)) throw TypeError("Stringified UUID is invalid");
3167
3177
  return n;
3168
3178
  }
3169
3179
  //#endregion
3170
3180
  //#region ../../node_modules/.pnpm/uuid@14.0.0/node_modules/uuid/dist/rng.js
3171
- var ns = new Uint8Array(16);
3172
- function rs() {
3173
- return crypto.getRandomValues(ns);
3181
+ var rs = new Uint8Array(16);
3182
+ function is() {
3183
+ return crypto.getRandomValues(rs);
3174
3184
  }
3175
3185
  //#endregion
3176
3186
  //#region ../../node_modules/.pnpm/uuid@14.0.0/node_modules/uuid/dist/v4.js
3177
- function is(e, t, n) {
3178
- return !t && !e && crypto.randomUUID ? crypto.randomUUID() : as(e, t, n);
3179
- }
3180
3187
  function as(e, t, n) {
3188
+ return !t && !e && crypto.randomUUID ? crypto.randomUUID() : os(e, t, n);
3189
+ }
3190
+ function os(e, t, n) {
3181
3191
  e ||= {};
3182
- let r = e.random ?? e.rng?.() ?? rs();
3192
+ let r = e.random ?? e.rng?.() ?? is();
3183
3193
  if (r.length < 16) throw Error("Random bytes length must be >= 16");
3184
3194
  if (r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, t) {
3185
3195
  if (n ||= 0, n < 0 || n + 16 > t.length) throw RangeError(`UUID byte range ${n}:${n + 15} is out of buffer bounds`);
3186
3196
  for (let e = 0; e < 16; ++e) t[n + e] = r[e];
3187
3197
  return t;
3188
3198
  }
3189
- return es(r);
3199
+ return ts(r);
3190
3200
  }
3191
3201
  //#endregion
3192
3202
  //#region src/uuid/uuid.ts
3193
- var os = /* @__PURE__ */ r({
3194
- ZERO: () => ls,
3195
- create: () => ss,
3196
- parse: () => cs
3197
- }), ss = () => is(), cs = (e, t) => ts(e, t), ls = Zo, us = (e) => {
3203
+ var ss = /* @__PURE__ */ r({
3204
+ ZERO: () => us,
3205
+ create: () => cs,
3206
+ parse: () => ls
3207
+ }), cs = () => as(), ls = (e, t) => ns(e, t), us = Qo, ds = (e) => {
3198
3208
  let t = Math.fround(e);
3199
3209
  if (!Number.isFinite(t)) return t.toString();
3200
3210
  for (let e = 1; e <= 9; e++) {
@@ -3202,18 +3212,18 @@ var os = /* @__PURE__ */ r({
3202
3212
  if (Math.fround(n) === t) return n.toString();
3203
3213
  }
3204
3214
  return t.toString();
3205
- }, X = -1, ds = {
3206
- [Symbol.iterator]: () => ds,
3215
+ }, X = -1, fs = {
3216
+ [Symbol.iterator]: () => fs,
3207
3217
  next: () => ({
3208
3218
  done: !0,
3209
3219
  value: void 0
3210
3220
  })
3211
- }, fs = t.string().transform((e) => new Uint8Array(atob(e).split("").map((e) => e.charCodeAt(0))).buffer), ps = t.union([t.null(), t.undefined()]).transform(() => new Uint8Array().buffer), Z = 4, ms = (e, t) => {
3221
+ }, ps = t.string().transform((e) => new Uint8Array(atob(e).split("").map((e) => e.charCodeAt(0))).buffer), ms = t.union([t.null(), t.undefined()]).transform(() => new Uint8Array().buffer), Z = 4, hs = (e, t) => {
3212
3222
  if (e === "number" && !t.isNumeric) throw Error(`cannot convert series of type ${t.toString()} to number`);
3213
3223
  if (e === "bigint" && !t.usesBigInt) throw Error(`cannot convert series of type ${t.toString()} to bigint`);
3214
- }, hs = "sy_x_telem_series", gs = class e {
3224
+ }, gs = "sy_x_telem_series", _s = class e {
3215
3225
  key;
3216
- discriminator = hs;
3226
+ discriminator = gs;
3217
3227
  dataType;
3218
3228
  sampleOffset;
3219
3229
  gl;
@@ -3232,23 +3242,23 @@ var os = /* @__PURE__ */ r({
3232
3242
  dataType: N.z,
3233
3243
  alignment: t.coerce.bigint().optional(),
3234
3244
  data: t.union([
3235
- fs,
3236
3245
  ps,
3246
+ ms,
3237
3247
  t.instanceof(ArrayBuffer),
3238
3248
  t.instanceof(Uint8Array)
3239
3249
  ]).default(() => new Uint8Array().buffer),
3240
- glBufferUsage: Xo.default("static").optional()
3250
+ glBufferUsage: Zo.default("static").optional()
3241
3251
  });
3242
3252
  static z = e.crudeZ.transform((t) => new e(t));
3243
3253
  constructor(e) {
3244
- _s(e) && (e = { data: e }), e.data ??= [];
3245
- let { dataType: t, timeRange: n, sampleOffset: r = 0, glBufferUsage: i = "static", alignment: a = 0n, alignmentMultiple: o = 1n, key: s = hi(), data: c } = e;
3246
- if (vs(c)) {
3254
+ vs(e) && (e = { data: e }), e.data ??= [];
3255
+ let { dataType: t, timeRange: n, sampleOffset: r = 0, glBufferUsage: i = "static", alignment: a = 0n, alignmentMultiple: o = 1n, key: s = gi(), data: c } = e;
3256
+ if (ys(c)) {
3247
3257
  let e = c;
3248
3258
  this.key = e.key, this.dataType = e.dataType, this.sampleOffset = e.sampleOffset, this.gl = e.gl, this._data = e._data, this.timeRange = e.timeRange, this.alignment = e.alignment, this.alignmentMultiple = e.alignmentMultiple, this.cachedMin = e.cachedMin, this.cachedMax = e.cachedMax, this.writePos = e.writePos, this._refCount = e._refCount, this.cachedLength = e.cachedLength;
3249
3259
  return;
3250
3260
  }
3251
- let l = Nr(c), u = Array.isArray(c);
3261
+ let l = Pr(c), u = Array.isArray(c);
3252
3262
  if (t != null) this.dataType = new N(t);
3253
3263
  else if (c instanceof ArrayBuffer) throw Error("cannot infer data type from an ArrayBuffer instance when constructing a Series. Please provide a data type.");
3254
3264
  else if (u || l) {
@@ -3276,7 +3286,7 @@ var os = /* @__PURE__ */ r({
3276
3286
  this._data = r;
3277
3287
  } else if (this.dataType.equals(N.JSON)) {
3278
3288
  this.cachedLength = e.length;
3279
- let t = e.map((e) => new TextEncoder().encode(Cr.encodeString(e))), n = t.reduce((e, t) => e + Z + t.byteLength, 0), r = new ArrayBuffer(n), i = new DataView(r), a = new Uint8Array(r), o = 0;
3289
+ let t = e.map((e) => new TextEncoder().encode(wr.encodeString(e))), n = t.reduce((e, t) => e + Z + t.byteLength, 0), r = new ArrayBuffer(n), i = new DataView(r), a = new Uint8Array(r), o = 0;
3280
3290
  for (let e of t) i.setUint32(o, e.byteLength, !0), o += Z, a.set(e, o), o += e.byteLength;
3281
3291
  this._data = r;
3282
3292
  } else this.dataType.usesBigInt && typeof t == "number" ? this._data = new this.dataType.Array(e.map((e) => BigInt(Math.round(e)))).buffer : !this.dataType.usesBigInt && typeof t == "bigint" ? this._data = new this.dataType.Array(e.map(Number)).buffer : this._data = new this.dataType.Array(e).buffer;
@@ -3352,7 +3362,7 @@ var os = /* @__PURE__ */ r({
3352
3362
  }
3353
3363
  parseJSON(e) {
3354
3364
  if (!this.dataType.equals(N.JSON)) throw Error("cannot parse non-JSON series as JSON");
3355
- return this.toStrings().map((t) => e.parse(Cr.decodeString(t)));
3365
+ return this.toStrings().map((t) => e.parse(wr.decodeString(t)));
3356
3366
  }
3357
3367
  get byteCapacity() {
3358
3368
  return new P(this.underlyingData.byteLength);
@@ -3378,7 +3388,7 @@ var os = /* @__PURE__ */ r({
3378
3388
  convert(t, n = 0) {
3379
3389
  if (this.dataType.equals(t)) return this;
3380
3390
  let r = new t.Array(this.length);
3381
- for (let e = 0; e < this.length; e++) r[e] = Pr(this.dataType, t, this.data[e], n);
3391
+ for (let e = 0; e < this.length; e++) r[e] = Fr(this.dataType, t, this.data[e], n);
3382
3392
  return new e({
3383
3393
  data: r.buffer,
3384
3394
  dataType: t,
@@ -3450,7 +3460,7 @@ var os = /* @__PURE__ */ r({
3450
3460
  at(e, t = !1) {
3451
3461
  if (this.dataType.isVariable) {
3452
3462
  let n = this.atVariable(e, t);
3453
- return n == null ? void 0 : this.dataType.equals(N.STRING) ? n : ne(JSON.parse(n));
3463
+ return n == null ? void 0 : this.dataType.equals(N.STRING) ? n : re(JSON.parse(n));
3454
3464
  }
3455
3465
  if (this.dataType.equals(N.UUID)) return this.atUUID(e, t);
3456
3466
  e < 0 && (e = this.length + e);
@@ -3466,7 +3476,7 @@ var os = /* @__PURE__ */ r({
3466
3476
  }
3467
3477
  atUUID(e, t) {
3468
3478
  e < 0 && (e = this.length + e);
3469
- let n = cs(new Uint8Array(this.buffer, e * this.dataType.density.valueOf()));
3479
+ let n = ls(new Uint8Array(this.buffer, e * this.dataType.density.valueOf()));
3470
3480
  if (n == null) {
3471
3481
  if (t) throw Error(`[series] - no value at index ${e}`);
3472
3482
  return;
@@ -3477,7 +3487,7 @@ var os = /* @__PURE__ */ r({
3477
3487
  if (this.dataType.isVariable) return this.atVariable(e, t);
3478
3488
  if (this.dataType.equals(N.UUID)) return this.atUUID(e, t);
3479
3489
  let n = this.at(e, t);
3480
- if (n != null) return this.dataType.equals(N.FLOAT32) ? us(n) : String(n);
3490
+ if (n != null) return this.dataType.equals(N.FLOAT32) ? ds(n) : String(n);
3481
3491
  }
3482
3492
  atVariable(e, t) {
3483
3493
  let n = 0, r = 0, i = this.buffer, a = new DataView(i);
@@ -3507,7 +3517,7 @@ var os = /* @__PURE__ */ r({
3507
3517
  return new TextDecoder().decode(o);
3508
3518
  }
3509
3519
  binarySearch(e) {
3510
- let t = 0, n = this.length - 1, r = Kr(e);
3520
+ let t = 0, n = this.length - 1, r = qr(e);
3511
3521
  for (; t <= n;) {
3512
3522
  let i = Math.floor((t + n) / 2), a = r(this.at(i, !0), e);
3513
3523
  if (a === 0) return i;
@@ -3525,7 +3535,7 @@ var os = /* @__PURE__ */ r({
3525
3535
  } else e.bufferData(e.ARRAY_BUFFER, this.buffer, n === "static" ? e.STATIC_DRAW : e.DYNAMIC_DRAW), this.gl.prevBuffer = X;
3526
3536
  }
3527
3537
  as(e) {
3528
- return ms(e, this.dataType), this;
3538
+ return hs(e, this.dataType), this;
3529
3539
  }
3530
3540
  get digest() {
3531
3541
  return {
@@ -3533,8 +3543,8 @@ var os = /* @__PURE__ */ r({
3533
3543
  dataType: this.dataType.toString(),
3534
3544
  sampleOffset: this.sampleOffset,
3535
3545
  alignment: {
3536
- lower: Ds(this.alignmentBounds.lower),
3537
- upper: Ds(this.alignmentBounds.upper),
3546
+ lower: Os(this.alignmentBounds.lower),
3547
+ upper: Os(this.alignmentBounds.upper),
3538
3548
  multiple: this.alignmentMultiple
3539
3549
  },
3540
3550
  timeRange: this.timeRange.toString(),
@@ -3554,10 +3564,10 @@ var os = /* @__PURE__ */ r({
3554
3564
  }
3555
3565
  [Symbol.iterator]() {
3556
3566
  if (this.dataType.isVariable) {
3557
- let e = new bs(this);
3558
- return this.dataType.equals(N.JSON) ? new xs(e) : e;
3567
+ let e = new xs(this);
3568
+ return this.dataType.equals(N.JSON) ? new Ss(e) : e;
3559
3569
  }
3560
- return this.dataType.equals(N.UUID) ? new Ss(this) : new Cs(this);
3570
+ return this.dataType.equals(N.UUID) ? new Cs(this) : new ws(this);
3561
3571
  }
3562
3572
  slice(e, t) {
3563
3573
  return this.sliceSub(!1, e, t);
@@ -3566,11 +3576,11 @@ var os = /* @__PURE__ */ r({
3566
3576
  return this.sliceSub(!0, e, t);
3567
3577
  }
3568
3578
  subIterator(e, t) {
3569
- return new ys(this, e, t ?? this.length);
3579
+ return new bs(this, e, t ?? this.length);
3570
3580
  }
3571
3581
  subAlignmentIterator(e, t) {
3572
3582
  let n = Math.ceil(Number(e - this.alignment) / Number(this.alignmentMultiple)), r = Math.ceil(Number(t - this.alignment) / Number(this.alignmentMultiple));
3573
- return new ys(this, n, r);
3583
+ return new bs(this, n, r);
3574
3584
  }
3575
3585
  subBytes(t, n) {
3576
3586
  return t >= 0 && (n == null || n >= this.byteLength.valueOf()) ? this : new e({
@@ -3614,14 +3624,14 @@ var os = /* @__PURE__ */ r({
3614
3624
  }
3615
3625
  return e += "])", e;
3616
3626
  }
3617
- }, _s = (e) => e == null ? !1 : Array.isArray(e) || e instanceof ArrayBuffer || ArrayBuffer.isView(e) && !(e instanceof DataView) || e instanceof gs ? !0 : Nr(e), vs = _i(hs, gs), ys = class {
3627
+ }, vs = (e) => e == null ? !1 : Array.isArray(e) || e instanceof ArrayBuffer || ArrayBuffer.isView(e) && !(e instanceof DataView) || e instanceof _s ? !0 : Pr(e), ys = vi(gs, _s), bs = class {
3618
3628
  series;
3619
3629
  end;
3620
3630
  index;
3621
3631
  constructor(e, t, n) {
3622
3632
  this.series = e;
3623
3633
  let r = E(0, e.length + 1);
3624
- this.end = Rn(r, n), this.index = Rn(r, t);
3634
+ this.end = zn(r, n), this.index = zn(r, t);
3625
3635
  }
3626
3636
  next() {
3627
3637
  return this.index >= this.end ? {
@@ -3632,7 +3642,7 @@ var os = /* @__PURE__ */ r({
3632
3642
  value: this.series.at(this.index++, !0)
3633
3643
  };
3634
3644
  }
3635
- }, bs = class {
3645
+ }, xs = class {
3636
3646
  series;
3637
3647
  byteOffset;
3638
3648
  decoder;
@@ -3655,7 +3665,7 @@ var os = /* @__PURE__ */ r({
3655
3665
  value: n
3656
3666
  };
3657
3667
  }
3658
- }, xs = class e {
3668
+ }, Ss = class e {
3659
3669
  wrapped;
3660
3670
  static schema = t.record(t.string(), t.unknown());
3661
3671
  constructor(e) {
@@ -3668,10 +3678,10 @@ var os = /* @__PURE__ */ r({
3668
3678
  value: void 0
3669
3679
  } : {
3670
3680
  done: !1,
3671
- value: Cr.decodeString(t.value, e.schema)
3681
+ value: wr.decodeString(t.value, e.schema)
3672
3682
  };
3673
3683
  }
3674
- }, Ss = class {
3684
+ }, Cs = class {
3675
3685
  series;
3676
3686
  index;
3677
3687
  data;
@@ -3685,13 +3695,13 @@ var os = /* @__PURE__ */ r({
3685
3695
  done: !0,
3686
3696
  value: void 0
3687
3697
  };
3688
- let e = cs(this.data, this.index * this.density);
3698
+ let e = ls(this.data, this.index * this.density);
3689
3699
  return this.index++, {
3690
3700
  done: !1,
3691
3701
  value: e
3692
3702
  };
3693
3703
  }
3694
- }, Cs = class {
3704
+ }, ws = class {
3695
3705
  series;
3696
3706
  index;
3697
3707
  constructor(e) {
@@ -3706,7 +3716,7 @@ var os = /* @__PURE__ */ r({
3706
3716
  value: this.series.at(this.index++, !0)
3707
3717
  };
3708
3718
  }
3709
- }, ws = class {
3719
+ }, Ts = class {
3710
3720
  series;
3711
3721
  constructor(e = []) {
3712
3722
  if (e.length !== 0) {
@@ -3716,7 +3726,7 @@ var os = /* @__PURE__ */ r({
3716
3726
  this.series = e;
3717
3727
  }
3718
3728
  as(e) {
3719
- return ms(e, this.dataType), this;
3729
+ return hs(e, this.dataType), this;
3720
3730
  }
3721
3731
  get dataType() {
3722
3732
  return this.series.length === 0 ? N.UNKNOWN : this.series[0].dataType;
@@ -3732,7 +3742,7 @@ var os = /* @__PURE__ */ r({
3732
3742
  }
3733
3743
  push(e) {
3734
3744
  let t = () => /* @__PURE__ */ Error(`cannot push a ${e.dataType.toString()} series to a ${this.dataType.toString()} multi-series`), n = e.dataType.equals(this.dataType);
3735
- if (vs(e)) {
3745
+ if (ys(e)) {
3736
3746
  if (this.series.length !== 0 && !n) throw t();
3737
3747
  this.series.push(e);
3738
3748
  } else {
@@ -3756,10 +3766,10 @@ var os = /* @__PURE__ */ r({
3756
3766
  if (t) throw Error(`[series] - no value at index ${e}`);
3757
3767
  }
3758
3768
  subIterator(e, t) {
3759
- return new Es(this, e, t ?? this.length);
3769
+ return new Ds(this, e, t ?? this.length);
3760
3770
  }
3761
3771
  subAlignmentIterator(e, t) {
3762
- if (e >= this.alignmentBounds.upper || t <= this.alignmentBounds.lower) return ds;
3772
+ if (e >= this.alignmentBounds.upper || t <= this.alignmentBounds.lower) return fs;
3763
3773
  let n = 0;
3764
3774
  for (let t = 0; t < this.series.length; t++) {
3765
3775
  let r = this.series[t];
@@ -3780,10 +3790,10 @@ var os = /* @__PURE__ */ r({
3780
3790
  break;
3781
3791
  }
3782
3792
  }
3783
- return new Es(this, n, r);
3793
+ return new Ds(this, n, r);
3784
3794
  }
3785
3795
  subAlignmentSpanIterator(e, t) {
3786
- if (e >= this.alignmentBounds.upper) return ds;
3796
+ if (e >= this.alignmentBounds.upper) return fs;
3787
3797
  t = Math.min(t, Number(this.distance(e, this.alignmentBounds.upper)));
3788
3798
  let n = 0;
3789
3799
  for (let t = 0; t < this.series.length; t++) {
@@ -3795,13 +3805,13 @@ var os = /* @__PURE__ */ r({
3795
3805
  break;
3796
3806
  }
3797
3807
  }
3798
- return new Es(this, n, n + t);
3808
+ return new Ds(this, n, n + t);
3799
3809
  }
3800
3810
  updateGLBuffer(e) {
3801
3811
  this.series.forEach((t) => t.updateGLBuffer(e));
3802
3812
  }
3803
3813
  get bounds() {
3804
- return Gn(this.series.map((e) => e.bounds));
3814
+ return Kn(this.series.map((e) => e.bounds));
3805
3815
  }
3806
3816
  get byteLength() {
3807
3817
  return new P(this.series.reduce((e, t) => e + t.byteLength.valueOf(), 0));
@@ -3812,7 +3822,7 @@ var os = /* @__PURE__ */ r({
3812
3822
  return new this.dataType.Array(e.buffer);
3813
3823
  }
3814
3824
  traverseAlignment(e, t) {
3815
- return Zn(this.series.map((e) => e.alignmentBounds), e, t);
3825
+ return Qn(this.series.map((e) => e.alignmentBounds), e, t);
3816
3826
  }
3817
3827
  acquire(e) {
3818
3828
  this.series.forEach((t) => t.acquire(e));
@@ -3821,7 +3831,7 @@ var os = /* @__PURE__ */ r({
3821
3831
  this.series.forEach((e) => e.release());
3822
3832
  }
3823
3833
  distance(e, t) {
3824
- return Qn(this.series.map((e) => e.alignmentBounds), e, t);
3834
+ return $n(this.series.map((e) => e.alignmentBounds), e, t);
3825
3835
  }
3826
3836
  parseJSON(e) {
3827
3837
  if (!this.dataType.equals(N.JSON)) throw Error("cannot parse non-JSON series as JSON");
@@ -3833,12 +3843,12 @@ var os = /* @__PURE__ */ r({
3833
3843
  done: !0,
3834
3844
  value: void 0
3835
3845
  };
3836
- } } : new Ts(this.series);
3846
+ } } : new Es(this.series);
3837
3847
  }
3838
3848
  toStrings() {
3839
3849
  return this.series.flatMap((e) => e.toStrings());
3840
3850
  }
3841
- }, Ts = class {
3851
+ }, Es = class {
3842
3852
  series;
3843
3853
  seriesIndex;
3844
3854
  internal;
@@ -3855,7 +3865,7 @@ var os = /* @__PURE__ */ r({
3855
3865
  [Symbol.iterator]() {
3856
3866
  return this;
3857
3867
  }
3858
- }, Es = class {
3868
+ }, Ds = class {
3859
3869
  series;
3860
3870
  index;
3861
3871
  end;
@@ -3874,10 +3884,10 @@ var os = /* @__PURE__ */ r({
3874
3884
  [Symbol.iterator]() {
3875
3885
  return this;
3876
3886
  }
3877
- }, Ds = (e) => ({
3887
+ }, Os = (e) => ({
3878
3888
  domain: e >> 32n,
3879
3889
  sample: e & 4294967295n
3880
- }), Os = [
3890
+ }), ks = [
3881
3891
  "ISO",
3882
3892
  "ISODate",
3883
3893
  "time",
@@ -3885,37 +3895,37 @@ var os = /* @__PURE__ */ r({
3885
3895
  "date",
3886
3896
  "preciseDate",
3887
3897
  "dateTime"
3888
- ], ks = t.enum(Os), As = ["local", "UTC"], js = t.enum(As), Ms = /* @__PURE__ */ r({
3889
- ClockSkewCalculator: () => Hr,
3898
+ ], As = t.enum(ks), js = ["local", "UTC"], Ms = t.enum(js), Ns = /* @__PURE__ */ r({
3899
+ ClockSkewCalculator: () => Ur,
3890
3900
  DataType: () => N,
3891
3901
  Density: () => j,
3892
- MultiSeries: () => ws,
3902
+ MultiSeries: () => Ts,
3893
3903
  Rate: () => A,
3894
- Series: () => gs,
3904
+ Series: () => _s,
3895
3905
  Size: () => P,
3896
- TIMESTAMP_FORMATS: () => Os,
3897
- TIME_ZONES: () => As,
3906
+ TIMESTAMP_FORMATS: () => ks,
3907
+ TIME_ZONES: () => js,
3898
3908
  TimeRange: () => M,
3899
3909
  TimeSpan: () => k,
3900
3910
  TimeStamp: () => O,
3901
- convertDataType: () => Pr,
3902
- dataTypeZ: () => Br,
3903
- isCrudeSeries: () => _s,
3904
- isTelemValue: () => Nr,
3905
- numericTimeRangeZ: () => jr,
3906
- rateZ: () => Rr,
3907
- sizeZ: () => zr,
3908
- timeRangeBoundedZ: () => Vr,
3909
- timeRangeZ: () => Fr,
3910
- timeSpanZ: () => Lr,
3911
- timeStampZ: () => Ir,
3912
- timeZoneZ: () => js,
3913
- timestampFormatZ: () => ks,
3914
- typedArrayZ: () => Mr
3915
- }), Ns = /* @__PURE__ */ r({ sleep: () => Ps }), Ps = async (e) => await new Promise((t) => setTimeout(t, k.fromMilliseconds(e).milliseconds)), Fs = /* @__PURE__ */ r({
3916
- Breaker: () => Is,
3917
- breakerConfigZ: () => Ls
3918
- }), Is = class {
3911
+ convertDataType: () => Fr,
3912
+ dataTypeZ: () => Vr,
3913
+ isCrudeSeries: () => vs,
3914
+ isTelemValue: () => Pr,
3915
+ numericTimeRangeZ: () => Mr,
3916
+ rateZ: () => zr,
3917
+ sizeZ: () => Br,
3918
+ timeRangeBoundedZ: () => Hr,
3919
+ timeRangeZ: () => Ir,
3920
+ timeSpanZ: () => Rr,
3921
+ timeStampZ: () => Lr,
3922
+ timeZoneZ: () => Ms,
3923
+ timestampFormatZ: () => As,
3924
+ typedArrayZ: () => Nr
3925
+ }), Ps = /* @__PURE__ */ r({ sleep: () => Fs }), Fs = async (e) => await new Promise((t) => setTimeout(t, k.fromMilliseconds(e).milliseconds)), Is = /* @__PURE__ */ r({
3926
+ Breaker: () => Ls,
3927
+ breakerConfigZ: () => Rs
3928
+ }), Ls = class {
3919
3929
  config;
3920
3930
  retries;
3921
3931
  interval;
@@ -3924,7 +3934,7 @@ var os = /* @__PURE__ */ r({
3924
3934
  baseInterval: new k(e?.baseInterval ?? k.seconds(1)),
3925
3935
  maxRetries: e?.maxRetries ?? 5,
3926
3936
  scale: e?.scale ?? 1,
3927
- sleepFn: e?.sleepFn ?? Ps
3937
+ sleepFn: e?.sleepFn ?? Fs
3928
3938
  }, this.retries = 0, this.interval = new k(this.config.baseInterval);
3929
3939
  }
3930
3940
  async wait() {
@@ -3937,48 +3947,48 @@ var os = /* @__PURE__ */ r({
3937
3947
  reset() {
3938
3948
  this.retries = 0, this.interval = this.config.baseInterval;
3939
3949
  }
3940
- }, Ls = t.object({
3950
+ }, Rs = t.object({
3941
3951
  baseInterval: k.z.optional(),
3942
3952
  maxRetries: t.number().optional(),
3943
3953
  scale: t.number().optional()
3944
- }), Rs = /* @__PURE__ */ r({ Z: () => zs }), zs = (e) => t.object({
3954
+ }), zs = /* @__PURE__ */ r({ Z: () => Bs }), Bs = (e) => t.object({
3945
3955
  variant: t.enum(["set", "delete"]),
3946
3956
  key: t.string(),
3947
3957
  value: e
3948
- }), Bs = t.string().regex(/^#?([0-9a-f]{6}|[0-9a-f]{8})$/i), Q = lr, Vs = t.number().min(0).max(1), Hs = t.tuple([
3958
+ }), Vs = t.string().regex(/^#?([0-9a-f]{6}|[0-9a-f]{8})$/i), Q = ur, Hs = t.number().min(0).max(1), Us = t.tuple([
3949
3959
  Q,
3950
3960
  Q,
3951
3961
  Q,
3952
- Vs
3953
- ]), Us = t.tuple([
3962
+ Hs
3963
+ ]), Ws = t.tuple([
3954
3964
  Q,
3955
3965
  Q,
3956
3966
  Q
3957
- ]), Ws = t.object({ rgba255: Hs }), Gs = t.object({
3967
+ ]), Gs = t.object({ rgba255: Us }), Ks = t.object({
3958
3968
  r: Q,
3959
3969
  g: Q,
3960
3970
  b: Q,
3961
- a: Vs
3962
- }), Ks = t.number().min(0).max(360), qs = t.number().min(0).max(100), Js = t.number().min(0).max(100), Ys = t.tuple([
3963
- Ks,
3971
+ a: Hs
3972
+ }), qs = t.number().min(0).max(360), Js = t.number().min(0).max(100), Ys = t.number().min(0).max(100), Xs = t.tuple([
3964
3973
  qs,
3965
3974
  Js,
3966
- Vs
3967
- ]), Xs = t.union([
3968
- Bs,
3969
- Us,
3970
- Hs,
3971
3975
  Ys,
3976
+ Hs
3977
+ ]), Zs = t.union([
3978
+ Vs,
3972
3979
  Ws,
3973
- Gs
3974
- ]), Zs = Xs.transform((e) => $(e)), Qs = (e) => Zs.safeParse(e).success, $s = (e) => Hs.safeParse(e).success, ec = ((e) => {
3980
+ Us,
3981
+ Xs,
3982
+ Gs,
3983
+ Ks
3984
+ ]), Qs = Zs.transform((e) => $(e)), $s = (e) => Qs.safeParse(e).success, ec = (e) => Us.safeParse(e).success, tc = ((e) => {
3975
3985
  if (e == null) return;
3976
- let t = Zs.safeParse(e);
3977
- if (t.success) return rc(t.data);
3986
+ let t = Qs.safeParse(e);
3987
+ if (t.success) return ic(t.data);
3978
3988
  if (typeof e == "string") return e;
3979
3989
  throw t.error;
3980
3990
  }), $ = (e, t = 1) => {
3981
- if (e = Xs.parse(e), typeof e == "string") return xc(e, t);
3991
+ if (e = Zs.parse(e), typeof e == "string") return Sc(e, t);
3982
3992
  if (Array.isArray(e)) {
3983
3993
  if (e.length < 3 || e.length > 4) throw Error(`Invalid color: [${e.join(", ")}]`);
3984
3994
  return e.length === 3 ? [...e, t] : e;
@@ -3989,25 +3999,25 @@ var os = /* @__PURE__ */ r({
3989
3999
  e.b,
3990
4000
  e.a
3991
4001
  ] : e.rgba255;
3992
- }, tc = (e, t) => {
4002
+ }, nc = (e, t) => {
3993
4003
  if (e == null || t == null) return e == t;
3994
4004
  let n = $(e), r = $(t);
3995
4005
  return n.every((e, t) => e === r[t]);
3996
- }, nc = ((e) => {
4006
+ }, rc = ((e) => {
3997
4007
  if (e == null) return;
3998
4008
  let [t, n, r, i] = $(e), a = Math.round(i * 255);
3999
- return `#${Cc(t)}${Cc(n)}${Cc(r)}${a === 255 ? "" : Cc(a)}`;
4000
- }), rc = (e) => {
4009
+ return `#${wc(t)}${wc(n)}${wc(r)}${a === 255 ? "" : wc(a)}`;
4010
+ }), ic = (e) => {
4001
4011
  let [t, n, r, i] = $(e);
4002
4012
  return `rgba(${t}, ${n}, ${r}, ${i})`;
4003
- }, ic = (e) => `rgb(${ac(e)})`, ac = (e) => {
4013
+ }, ac = (e) => `rgb(${oc(e)})`, oc = (e) => {
4004
4014
  let [t, n, r] = $(e);
4005
4015
  return `${t}, ${n}, ${r}`;
4006
- }, oc = (e) => [...sc(e), dc(e)], sc = (e) => [
4007
- cc(e) / 255,
4016
+ }, sc = (e) => [...cc(e), fc(e)], cc = (e) => [
4008
4017
  lc(e) / 255,
4009
- uc(e) / 255
4010
- ], cc = (e) => $(e)[0], lc = (e) => $(e)[1], uc = (e) => $(e)[2], dc = (e) => $(e)[3], fc = (e) => tc(Sc, e), pc = (e) => Ac($(e)), mc = (e, t) => {
4018
+ uc(e) / 255,
4019
+ dc(e) / 255
4020
+ ], lc = (e) => $(e)[0], uc = (e) => $(e)[1], dc = (e) => $(e)[2], fc = (e) => $(e)[3], pc = (e) => nc(Cc, e), mc = (e) => jc($(e)), hc = (e, t) => {
4011
4021
  let [n, r, i] = $(e);
4012
4022
  if (t > 100) throw Error(`Color opacity must be between 0 and 100, got ${t}`);
4013
4023
  return t > 1 && (t /= 100), [
@@ -4016,30 +4026,30 @@ var os = /* @__PURE__ */ r({
4016
4026
  i,
4017
4027
  t
4018
4028
  ];
4019
- }, hc = (e) => {
4020
- let [t, n, r] = sc(e).map((e) => e <= .03928 ? e / 12.92 : ((e + .055) / 1.055) ** 2.4);
4021
- return Number((.2126 * t + .7152 * n + .0722 * r).toFixed(3));
4022
4029
  }, gc = (e) => {
4023
- let [t, n, r] = sc(e);
4030
+ let [t, n, r] = cc(e).map((e) => e <= .03928 ? e / 12.92 : ((e + .055) / 1.055) ** 2.4);
4031
+ return Number((.2126 * t + .7152 * n + .0722 * r).toFixed(3));
4032
+ }, _c = (e) => {
4033
+ let [t, n, r] = cc(e);
4024
4034
  return 1 - (Math.max(t, n, r) - Math.min(t, n, r));
4025
- }, _c = (e, t) => {
4026
- let n = $(e), r = $(t), i = hc(n), a = hc(r);
4035
+ }, vc = (e, t) => {
4036
+ let n = $(e), r = $(t), i = gc(n), a = gc(r);
4027
4037
  return (Math.max(i, a) + .5) / (Math.min(i, a) + .5);
4028
- }, vc = (e, ...t) => {
4038
+ }, yc = (e, ...t) => {
4029
4039
  if (t.length === 0) throw Error("[Color.pickByContrast] - must provide at least one color");
4030
- let n = $(e), [r] = t.sort((e, t) => _c(n, t) - _c(n, e));
4040
+ let n = $(e), [r] = t.sort((e, t) => vc(n, t) - vc(n, e));
4031
4041
  return $(r);
4032
- }, yc = (e) => hc(e) < .5, bc = (e) => hc(e) > .5, xc = (e, t = 1) => (e = Bs.parse(e), e = Tc(e), [
4033
- wc(e, 0),
4034
- wc(e, 2),
4035
- wc(e, 4),
4036
- e.length === 8 ? wc(e, 6) / 255 : t
4037
- ]), Sc = [
4042
+ }, bc = (e) => gc(e) < .5, xc = (e) => gc(e) > .5, Sc = (e, t = 1) => (e = Vs.parse(e), e = Ec(e), [
4043
+ Tc(e, 0),
4044
+ Tc(e, 2),
4045
+ Tc(e, 4),
4046
+ e.length === 8 ? Tc(e, 6) / 255 : t
4047
+ ]), Cc = [
4038
4048
  0,
4039
4049
  0,
4040
4050
  0,
4041
4051
  0
4042
- ], Cc = (e) => Math.floor(e).toString(16).padStart(2, "0"), wc = (e, t) => parseInt(e.slice(t, t + 2), 16), Tc = (e) => e.startsWith("#") ? e.slice(1) : e, Ec = {
4052
+ ], wc = (e) => Math.floor(e).toString(16).padStart(2, "0"), Tc = (e, t) => parseInt(e.slice(t, t + 2), 16), Ec = (e) => e.startsWith("#") ? e.slice(1) : e, Dc = {
4043
4053
  black: "#000000",
4044
4054
  white: "#ffffff",
4045
4055
  red: "#ff0000",
@@ -4071,16 +4081,16 @@ var os = /* @__PURE__ */ r({
4071
4081
  khaki: "#f0e68c",
4072
4082
  crimson: "#dc143c",
4073
4083
  transparent: "transparent"
4074
- }, Dc = (e) => {
4084
+ }, Oc = (e) => {
4075
4085
  if (!e) return;
4076
4086
  let t = e.trim().toLowerCase();
4077
4087
  if (!(t === "transparent" || t === "none")) {
4078
4088
  if (t.startsWith("#")) {
4079
4089
  if (t.length === 4) {
4080
4090
  let e = t[1], n = t[2], r = t[3], i = `#${e}${e}${n}${n}${r}${r}`;
4081
- if (Bs.safeParse(i).success) return xc(i);
4091
+ if (Vs.safeParse(i).success) return Sc(i);
4082
4092
  }
4083
- return (t.length === 7 || t.length === 9) && Bs.safeParse(t).success ? xc(t) : void 0;
4093
+ return (t.length === 7 || t.length === 9) && Vs.safeParse(t).success ? Sc(t) : void 0;
4084
4094
  }
4085
4095
  if (t.startsWith("rgb")) {
4086
4096
  let e = t.match(/rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/);
@@ -4094,17 +4104,17 @@ var os = /* @__PURE__ */ r({
4094
4104
  ];
4095
4105
  }
4096
4106
  }
4097
- if (Ec[t]) return xc(Ec[t]);
4107
+ if (Dc[t]) return Sc(Dc[t]);
4098
4108
  }
4099
- }, Oc = (e) => {
4100
- e = Ys.parse(e);
4109
+ }, kc = (e) => {
4110
+ e = Xs.parse(e);
4101
4111
  let [t, n, r] = e, i = e[3];
4102
4112
  t /= 360, n /= 100, r /= 100;
4103
4113
  let a, o, s;
4104
4114
  if (n === 0) a = o = s = r;
4105
4115
  else {
4106
4116
  let e = r < .5 ? r * (1 + n) : r + n - r * n, i = 2 * r - e;
4107
- a = kc(i, e, t + 1 / 3), o = kc(i, e, t), s = kc(i, e, t - 1 / 3);
4117
+ a = Ac(i, e, t + 1 / 3), o = Ac(i, e, t), s = Ac(i, e, t - 1 / 3);
4108
4118
  }
4109
4119
  return [
4110
4120
  Math.round(a * 255),
@@ -4112,8 +4122,8 @@ var os = /* @__PURE__ */ r({
4112
4122
  Math.round(s * 255),
4113
4123
  i
4114
4124
  ];
4115
- }, kc = (e, t, n) => (n < 0 && (n += 1), n > 1 && --n, n < 1 / 6 ? e + (t - e) * 6 * n : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e), Ac = (e) => {
4116
- e = Hs.parse(e);
4125
+ }, Ac = (e, t, n) => (n < 0 && (n += 1), n > 1 && --n, n < 1 / 6 ? e + (t - e) * 6 * n : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e), jc = (e) => {
4126
+ e = Us.parse(e);
4117
4127
  let [t, n, r] = e, i = e[3];
4118
4128
  t /= 255, n /= 255, r /= 255;
4119
4129
  let a = Math.max(t, n, r), o = Math.min(t, n, r), s, c, l = (a + o) / 2;
@@ -4128,13 +4138,13 @@ var os = /* @__PURE__ */ r({
4128
4138
  Math.round(l),
4129
4139
  i
4130
4140
  ];
4131
- }, jc = $("#000000"), Mc = $("#ffffff"), Nc = t.object({
4141
+ }, Mc = $("#000000"), Nc = $("#ffffff"), Pc = t.object({
4132
4142
  key: t.string(),
4133
- color: Xs,
4143
+ color: Zs,
4134
4144
  position: t.number(),
4135
4145
  switched: t.boolean().optional()
4136
- }), Pc = t.array(Nc), Fc = (e, t) => {
4137
- if (e.length === 0) return Sc;
4146
+ }), Fc = t.array(Pc), Ic = (e, t) => {
4147
+ if (e.length === 0) return Cc;
4138
4148
  if (e = e.slice().sort((e, t) => e.position - t.position), t <= e[0].position) return $(e[0].color);
4139
4149
  if (t >= e[e.length - 1].position) return $(e[e.length - 1].color);
4140
4150
  for (let n = 0; n < e.length - 1; n++) {
@@ -4144,99 +4154,99 @@ var os = /* @__PURE__ */ r({
4144
4154
  if (t === i.position) return $(i.color);
4145
4155
  let a = (t - r.position) / (i.position - r.position), o = $(r.color), s = $(i.color);
4146
4156
  return $([
4147
- Math.round(cc(o) + a * (cc(s) - cc(o))),
4148
4157
  Math.round(lc(o) + a * (lc(s) - lc(o))),
4149
4158
  Math.round(uc(o) + a * (uc(s) - uc(o))),
4150
- dc(o) + a * (dc(s) - dc(o))
4159
+ Math.round(dc(o) + a * (dc(s) - dc(o))),
4160
+ fc(o) + a * (fc(s) - fc(o))
4151
4161
  ]);
4152
4162
  }
4153
4163
  return $(e[e.length - 1].color);
4154
- }, Ic = t.object({
4164
+ }, Lc = t.object({
4155
4165
  key: t.string(),
4156
4166
  name: t.string(),
4157
- color: Zs
4158
- }), Lc = t.object({
4167
+ color: Qs
4168
+ }), Rc = t.object({
4159
4169
  key: t.string(),
4160
4170
  name: t.string(),
4161
- swatches: t.array(Ic)
4162
- }), Rc = /* @__PURE__ */ r({
4163
- BLACK: () => jc,
4164
- WHITE: () => Mc,
4165
- ZERO: () => Sc,
4166
- aValue: () => dc,
4167
- bValue: () => uc,
4168
- colorZ: () => Zs,
4171
+ swatches: t.array(Lc)
4172
+ }), zc = /* @__PURE__ */ r({
4173
+ BLACK: () => Mc,
4174
+ WHITE: () => Nc,
4175
+ ZERO: () => Cc,
4176
+ aValue: () => fc,
4177
+ bValue: () => dc,
4178
+ colorZ: () => Qs,
4169
4179
  construct: () => $,
4170
- contrast: () => _c,
4171
- crudeZ: () => Xs,
4172
- cssString: () => ec,
4173
- equals: () => tc,
4174
- fromCSS: () => Dc,
4175
- fromGradient: () => Fc,
4176
- fromHSLA: () => Oc,
4177
- gValue: () => lc,
4178
- gradientZ: () => Pc,
4179
- grayness: () => gc,
4180
- hex: () => nc,
4181
- hsla: () => pc,
4182
- isColor: () => $s,
4183
- isCrude: () => Qs,
4184
- isDark: () => yc,
4185
- isLight: () => bc,
4186
- isZero: () => fc,
4187
- luminance: () => hc,
4188
- paletteZ: () => Lc,
4189
- pickByContrast: () => vc,
4190
- rValue: () => cc,
4191
- rgbCSS: () => ic,
4192
- rgbString: () => ac,
4193
- rgba1: () => oc,
4194
- rgbaCSS: () => rc,
4195
- setAlpha: () => mc,
4196
- stopZ: () => Nc
4197
- }), zc = lr, Bc = /* @__PURE__ */ function(e) {
4180
+ contrast: () => vc,
4181
+ crudeZ: () => Zs,
4182
+ cssString: () => tc,
4183
+ equals: () => nc,
4184
+ fromCSS: () => Oc,
4185
+ fromGradient: () => Ic,
4186
+ fromHSLA: () => kc,
4187
+ gValue: () => uc,
4188
+ gradientZ: () => Fc,
4189
+ grayness: () => _c,
4190
+ hex: () => rc,
4191
+ hsla: () => mc,
4192
+ isColor: () => ec,
4193
+ isCrude: () => $s,
4194
+ isDark: () => bc,
4195
+ isLight: () => xc,
4196
+ isZero: () => pc,
4197
+ luminance: () => gc,
4198
+ paletteZ: () => Rc,
4199
+ pickByContrast: () => yc,
4200
+ rValue: () => lc,
4201
+ rgbCSS: () => ac,
4202
+ rgbString: () => oc,
4203
+ rgba1: () => sc,
4204
+ rgbaCSS: () => ic,
4205
+ setAlpha: () => hc,
4206
+ stopZ: () => Pc
4207
+ }), Bc = ur, Vc = /* @__PURE__ */ function(e) {
4198
4208
  return e[e.exclusive = 0] = "exclusive", e[e.shared = 1] = "shared", e;
4199
- }({}), Vc = t.enum(Bc), Hc = t.object({
4209
+ }({}), Hc = t.enum(Vc), Uc = t.object({
4200
4210
  key: t.string(),
4201
4211
  name: t.string(),
4202
4212
  group: t.uint32().optional()
4203
- }), Uc = (e) => t.object({
4204
- subject: Hc,
4213
+ }), Wc = (e) => t.object({
4214
+ subject: Uc,
4205
4215
  resource: e,
4206
- authority: zc
4207
- }), Wc = {
4216
+ authority: Bc
4217
+ }), Gc = {
4208
4218
  lower: 0,
4209
4219
  upper: 256
4210
- }, Gc = (...e) => (t) => t.filter((t) => {
4220
+ }, Kc = (...e) => (t) => t.filter((t) => {
4211
4221
  let n = !1;
4212
4222
  return t.to != null && (n = e.includes(t.to.resource)), t.from != null && !n && (n = e.includes(t.from.resource)), n;
4213
- }), Kc = (e) => t.object({
4214
- from: Uc(e),
4215
- to: t.null().optional()
4216
4223
  }), qc = (e) => t.object({
4224
+ from: Wc(e),
4225
+ to: t.null().optional()
4226
+ }), Jc = (e) => t.object({
4217
4227
  from: t.null().optional(),
4218
- to: Uc(e)
4219
- }), Jc = (e) => t.union([
4220
- Kc(e),
4228
+ to: Wc(e)
4229
+ }), Yc = (e) => t.union([
4221
4230
  qc(e),
4231
+ Jc(e),
4222
4232
  t.object({
4223
- from: Uc(e),
4224
- to: Uc(e)
4233
+ from: Wc(e),
4234
+ to: Wc(e)
4225
4235
  })
4226
- ]), Yc = /* @__PURE__ */ r({
4236
+ ]), Xc = /* @__PURE__ */ r({
4227
4237
  ABSOLUTE_AUTHORITY: () => 255,
4228
- AUTHORITY_BOUNDS: () => Wc,
4229
- Concurrency: () => Bc,
4238
+ AUTHORITY_BOUNDS: () => Gc,
4239
+ Concurrency: () => Vc,
4230
4240
  ZERO_AUTHORITY: () => 0,
4231
- acquireZ: () => qc,
4232
- authorityZ: () => zc,
4233
- concurrencyZ: () => Vc,
4234
- filterTransfersByChannelKey: () => Gc,
4235
- releaseZ: () => Kc,
4236
- stateZ: () => Uc,
4237
- subjectZ: () => Hc,
4238
- transferZ: () => Jc
4239
- }), Xc = /* @__PURE__ */ r({ formatValue: () => Zc }), Zc = (e) => {
4241
+ acquireZ: () => Jc,
4242
+ authorityZ: () => Bc,
4243
+ concurrencyZ: () => Hc,
4244
+ filterTransfersByChannelKey: () => Kc,
4245
+ releaseZ: () => qc,
4246
+ stateZ: () => Wc,
4247
+ subjectZ: () => Uc,
4248
+ transferZ: () => Yc
4249
+ }), Zc = /* @__PURE__ */ r({ formatValue: () => Qc }), Qc = (e) => {
4240
4250
  switch (typeof e) {
4241
4251
  case "bigint":
4242
4252
  case "number": return e.toString();
@@ -4244,14 +4254,14 @@ var os = /* @__PURE__ */ r({
4244
4254
  case "undefined": return "";
4245
4255
  case "string":
4246
4256
  case "symbol":
4247
- case "function": return $c(e.toString());
4248
- case "object": return e == null ? "" : $c(JSON.stringify(e));
4257
+ case "function": return el(e.toString());
4258
+ case "object": return e == null ? "" : el(JSON.stringify(e));
4249
4259
  }
4250
- }, Qc = /[",\n]/, $c = (e) => Qc.test(e) ? `"${e.replace(/"/g, "\"\"")}"` : e, el = () => {}, tl = (e, t) => {
4260
+ }, $c = /[",\n]/, el = (e) => $c.test(e) ? `"${e.replace(/"/g, "\"\"")}"` : e, tl = () => {}, nl = (e, t) => {
4251
4261
  let n = new k(t);
4252
4262
  if (n.valueOf() <= 0) {
4253
4263
  let t = ((...t) => e(...t));
4254
- return t.cancel = el, t.flush = el, t;
4264
+ return t.cancel = tl, t.flush = tl, t;
4255
4265
  }
4256
4266
  let r, i = null, a = () => {
4257
4267
  if (i === null) return;
@@ -4267,27 +4277,27 @@ var os = /* @__PURE__ */ r({
4267
4277
  }, o.flush = () => {
4268
4278
  r !== void 0 && (clearTimeout(r), r = void 0, a());
4269
4279
  }, o;
4270
- }, nl = /* @__PURE__ */ r({ NOOP: () => rl }), rl = () => {}, il = /* @__PURE__ */ r({
4271
- ZERO_PRIMITIVES: () => cl,
4272
- pointerZ: () => al,
4273
- primitiveTypeZ: () => sl,
4274
- primitiveZ: () => ol
4275
- }), al = t.string().regex(/^(?:$|(?:\/(?:[^~/]|~0|~1)*)+)$/, "must be a valid JSON pointer (RFC 6901)"), ol = t.union([
4280
+ }, rl = /* @__PURE__ */ r({ NOOP: () => il }), il = () => {}, al = /* @__PURE__ */ r({
4281
+ ZERO_PRIMITIVES: () => ll,
4282
+ pointerZ: () => ol,
4283
+ primitiveTypeZ: () => cl,
4284
+ primitiveZ: () => sl
4285
+ }), ol = t.string().regex(/^(?:$|(?:\/(?:[^~/]|~0|~1)*)+)$/, "must be a valid JSON pointer (RFC 6901)"), sl = t.union([
4276
4286
  t.string(),
4277
4287
  t.number(),
4278
4288
  t.boolean(),
4279
4289
  t.null()
4280
- ]), sl = t.enum([
4290
+ ]), cl = t.enum([
4281
4291
  "string",
4282
4292
  "number",
4283
4293
  "boolean",
4284
4294
  "null"
4285
- ]), cl = {
4295
+ ]), ll = {
4286
4296
  string: "",
4287
4297
  number: 0,
4288
4298
  boolean: !1,
4289
4299
  null: null
4290
- }, ll = class {
4300
+ }, ul = class {
4291
4301
  store = /* @__PURE__ */ new Map();
4292
4302
  async get(e) {
4293
4303
  return this.store.get(e) ?? null;
@@ -4304,7 +4314,7 @@ var os = /* @__PURE__ */ r({
4304
4314
  async clear() {
4305
4315
  this.store.clear();
4306
4316
  }
4307
- }, ul = class {
4317
+ }, dl = class {
4308
4318
  store = /* @__PURE__ */ new Map();
4309
4319
  get(e) {
4310
4320
  return this.store.get(e) ?? null;
@@ -4315,33 +4325,33 @@ var os = /* @__PURE__ */ r({
4315
4325
  delete(e) {
4316
4326
  this.store.delete(e);
4317
4327
  }
4318
- }, dl = t.object({
4328
+ }, fl = t.object({
4319
4329
  key: t.string(),
4320
4330
  value: t.string()
4321
- }), fl = /* @__PURE__ */ r({
4322
- MockAsync: () => ll,
4323
- MockSync: () => ul,
4324
- stringPairZ: () => dl
4325
4331
  }), pl = /* @__PURE__ */ r({
4326
- keyZ: () => ml,
4327
- labelZ: () => hl,
4328
- newZ: () => gl
4329
- }), ml = t.uuid(), hl = t.object({
4330
- key: ml,
4332
+ MockAsync: () => ul,
4333
+ MockSync: () => dl,
4334
+ stringPairZ: () => fl
4335
+ }), ml = /* @__PURE__ */ r({
4336
+ keyZ: () => hl,
4337
+ labelZ: () => gl,
4338
+ newZ: () => _l
4339
+ }), hl = t.uuid(), gl = t.object({
4340
+ key: hl,
4331
4341
  name: t.string().min(1),
4332
- color: Zs
4333
- }), gl = hl.partial({ key: !0 }), _l = /* @__PURE__ */ r({ is: () => yl }), vl = /* @__PURE__ */ RegExp("^(https?:\\/\\/)?((([a-zA-Z0-9][a-zA-Z0-9-]*\\.)+[a-zA-Z]{2,})|localhost|(\\d{1,3}\\.){3}\\d{1,3})(\\:\\d+)?(\\/[-a-zA-Z0-9@:%._\\+~#=]*)*(\\?[;&a-zA-Z0-9%_.,~+=-]*)?(#[-a-zA-Z0-9_]*)?$"), yl = (e) => vl.test(e), bl = /* @__PURE__ */ r({ getOrSetDefault: () => xl }), xl = (e, t, n) => {
4342
+ color: Qs
4343
+ }), _l = gl.partial({ key: !0 }), vl = /* @__PURE__ */ r({ is: () => bl }), yl = /* @__PURE__ */ RegExp("^(https?:\\/\\/)?((([a-zA-Z0-9][a-zA-Z0-9-]*\\.)+[a-zA-Z]{2,})|localhost|(\\d{1,3}\\.){3}\\d{1,3})(\\:\\d+)?(\\/[-a-zA-Z0-9@:%._\\+~#=]*)*(\\?[;&a-zA-Z0-9%_.,~+=-]*)?(#[-a-zA-Z0-9_]*)?$"), bl = (e) => yl.test(e), xl = /* @__PURE__ */ r({ getOrSetDefault: () => Sl }), Sl = (e, t, n) => {
4334
4344
  let r = e.get(t);
4335
4345
  return r === void 0 ? (e.set(t, n), n) : r;
4336
- }, Sl = /* @__PURE__ */ r({
4337
- compareSemVer: () => Tl,
4338
- createMigration: () => kl,
4339
- migrator: () => Al,
4340
- semVerNewer: () => Dl,
4341
- semVerOlder: () => Ol,
4342
- semVerZ: () => Cl,
4343
- versionsEqual: () => El
4344
- }), Cl = t.string().regex(/^\d+\.\d+\.\d+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$/), wl = (e, t) => {
4346
+ }, Cl = /* @__PURE__ */ r({
4347
+ compareSemVer: () => El,
4348
+ createMigration: () => Al,
4349
+ migrator: () => jl,
4350
+ semVerNewer: () => Ol,
4351
+ semVerOlder: () => kl,
4352
+ semVerZ: () => wl,
4353
+ versionsEqual: () => Dl
4354
+ }), wl = t.string().regex(/^\d+\.\d+\.\d+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$/), Tl = (e, t) => {
4345
4355
  let n = e.split("."), r = t.split("."), i = Math.max(n.length, r.length);
4346
4356
  for (let e = 0; e < i; e++) {
4347
4357
  let t = n[e], i = r[e];
@@ -4360,9 +4370,9 @@ var os = /* @__PURE__ */ r({
4360
4370
  }
4361
4371
  }
4362
4372
  return 0;
4363
- }, Tl = ((e, t, n = {}) => {
4373
+ }, El = ((e, t, n = {}) => {
4364
4374
  n.checkMajor ??= !0, n.checkMinor ??= !0, n.checkPatch ??= !0;
4365
- let r = Cl.parse(e), i = Cl.parse(t), [a, o] = r.split("-"), [s, c] = i.split("-"), [l, u, d] = a.split(".").map(Number), [f, p, m] = s.split(".").map(Number);
4375
+ let r = wl.parse(e), i = wl.parse(t), [a, o] = r.split("-"), [s, c] = i.split("-"), [l, u, d] = a.split(".").map(Number), [f, p, m] = s.split(".").map(Number);
4366
4376
  if (n.checkMajor) {
4367
4377
  if (l < f) return -1;
4368
4378
  if (l > f) return 1;
@@ -4375,16 +4385,16 @@ var os = /* @__PURE__ */ r({
4375
4385
  if (d < m) return -1;
4376
4386
  if (d > m) return 1;
4377
4387
  }
4378
- return o === void 0 && c === void 0 ? 0 : o === void 0 ? 1 : c === void 0 ? -1 : wl(o, c);
4379
- }), El = (e, t, n = {}) => ii(Tl(e, t, n)), Dl = (e, t, n = {}) => ni(Tl(e, t, n)), Ol = (e, t, n = {}) => ti(Tl(e, t, n)), kl = ({ name: e, migrate: t }) => (n) => {
4388
+ return o === void 0 && c === void 0 ? 0 : o === void 0 ? 1 : c === void 0 ? -1 : Tl(o, c);
4389
+ }), Dl = (e, t, n = {}) => ai(El(e, t, n)), Ol = (e, t, n = {}) => ri(El(e, t, n)), kl = (e, t, n = {}) => ni(El(e, t, n)), Al = ({ name: e, migrate: t }) => (n) => {
4380
4390
  try {
4381
4391
  let r = t(n);
4382
4392
  return console.log(`${e} migrated: ${n.version} -> ${r.version}`), r;
4383
4393
  } catch (t) {
4384
- throw console.log(`${e} failed to migrate from ${n.version}`), console.error(t), t;
4394
+ throw console.log(`${e} failed to migrate from ${n.version}`), console.error(t), Me(t);
4385
4395
  }
4386
- }, Al = ({ name: e, migrations: t, targetSchema: n, defaultVersion: r, def: i }) => {
4387
- let a = Object.keys(t).sort(Tl).pop();
4396
+ }, jl = ({ name: e, migrations: t, targetSchema: n, defaultVersion: r, def: i }) => {
4397
+ let a = Object.keys(t).sort(El).pop();
4388
4398
  if (a == null) return (t) => {
4389
4399
  if (t.version ??= r, t.version !== i.version) return console.log(`${e} version ${t.version} is newer than latest version of ${i.version}.
4390
4400
  Returning default instead.
@@ -4397,7 +4407,7 @@ var os = /* @__PURE__ */ r({
4397
4407
  };
4398
4408
  let o = Object.keys(t).length, s = !1, c = (n) => {
4399
4409
  try {
4400
- if (o === 0 || Dl(n.version, a)) return console.log(s ? `${e} ${n.version} now up to date` : `${e} version ${n.version} is up to date with target version ${i.version}`), n;
4410
+ if (o === 0 || Ol(n.version, a)) return console.log(s ? `${e} ${n.version} now up to date` : `${e} version ${n.version} is up to date with target version ${i.version}`), n;
4401
4411
  let r = t[n.version], l = r(n);
4402
4412
  return s = !0, c(l);
4403
4413
  } catch (t) {
@@ -4413,7 +4423,7 @@ var os = /* @__PURE__ */ r({
4413
4423
  return console.log(`${e} failed to parse final result. Exiting with default`), console.error(t), i;
4414
4424
  }
4415
4425
  };
4416
- }, jl = (e, t, n) => {
4426
+ }, Ml = (e, t, n) => {
4417
4427
  if (typeof e == "bigint" && n === "standard") return t === 0 ? e.toString() : `${e}.${"0".repeat(t)}`;
4418
4428
  if (typeof e == "bigint" && (e = Number(e)), Number.isNaN(e)) return "NaN";
4419
4429
  if (e === Infinity) return "∞";
@@ -4424,18 +4434,18 @@ var os = /* @__PURE__ */ r({
4424
4434
  r = n === "scientific" ? Math.floor(Math.log10(Math.abs(e))) : Math.floor(Math.log10(Math.abs(e)) / 3) * 3;
4425
4435
  let i = e / 10 ** r, a = n === "scientific" ? 10 : 1e3, o = 10 ** t;
4426
4436
  return Math.round(Math.abs(i) * o) / o >= a && (r += n === "scientific" ? 1 : 3, i = e / 10 ** r), `${i.toFixed(t)}ᴇ${r}`;
4427
- }, Ml = [
4437
+ }, Nl = [
4428
4438
  "standard",
4429
4439
  "scientific",
4430
4440
  "engineering"
4431
- ], Nl = t.enum(Ml), Pl = /* @__PURE__ */ r({
4432
- NOTATIONS: () => Ml,
4433
- notationZ: () => Nl,
4434
- stringifyNumber: () => jl
4435
- }), Fl = /* @__PURE__ */ r({}), Il = /* @__PURE__ */ r({
4436
- BaseObserver: () => Rl,
4437
- Observer: () => Ll
4438
- }), Ll = class {
4441
+ ], Pl = t.enum(Nl), Fl = /* @__PURE__ */ r({
4442
+ NOTATIONS: () => Nl,
4443
+ notationZ: () => Pl,
4444
+ stringifyNumber: () => Ml
4445
+ }), Il = /* @__PURE__ */ r({}), Ll = /* @__PURE__ */ r({
4446
+ BaseObserver: () => zl,
4447
+ Observer: () => Rl
4448
+ }), Rl = class {
4439
4449
  handlers;
4440
4450
  transform;
4441
4451
  closer;
@@ -4460,7 +4470,7 @@ var os = /* @__PURE__ */ r({
4460
4470
  async close() {
4461
4471
  return await this.closer?.();
4462
4472
  }
4463
- }, Rl = class {
4473
+ }, zl = class {
4464
4474
  handlers;
4465
4475
  constructor(e) {
4466
4476
  this.handlers = e ?? /* @__PURE__ */ new Map();
@@ -4471,85 +4481,84 @@ var os = /* @__PURE__ */ r({
4471
4481
  notify(e) {
4472
4482
  this.handlers.forEach((t, n) => n(e));
4473
4483
  }
4474
- }, zl = /* @__PURE__ */ r({}), Bl = /* @__PURE__ */ r({
4475
- entries: () => Ul,
4476
- keyZ: () => Vl,
4477
- map: () => Wl,
4478
- nullishToEmpty: () => ql,
4479
- omit: () => Kl,
4480
- purgeUndefined: () => Gl,
4481
- unknownZ: () => Hl
4482
- }), Vl = t.union([t.string(), t.number()]), Hl = () => t.record(Vl, t.unknown()), Ul = (e) => Object.entries(e), Wl = (e, t) => Object.fromEntries(Ul(e).map(([e, n]) => [e, t(n, e)])), Gl = (e) => Object.fromEntries(Ul(e).filter(([e, t]) => t !== void 0)), Kl = (e, ...t) => {
4484
+ }, Bl = /* @__PURE__ */ r({}), Vl = /* @__PURE__ */ r({
4485
+ entries: () => Wl,
4486
+ keyZ: () => Hl,
4487
+ map: () => Gl,
4488
+ nullishToEmpty: () => Jl,
4489
+ omit: () => ql,
4490
+ purgeUndefined: () => Kl,
4491
+ unknownZ: () => Ul
4492
+ }), Hl = t.union([t.string(), t.number()]), Ul = () => t.record(Hl, t.unknown()), Wl = (e) => Object.entries(e), Gl = (e, t) => Object.fromEntries(Wl(e).map(([e, n]) => [e, t(n, e)])), Kl = (e) => Object.fromEntries(Wl(e).filter(([e, t]) => t !== void 0)), ql = (e, ...t) => {
4483
4493
  let n = { ...e };
4484
4494
  for (let e of t) delete n[e];
4485
4495
  return n;
4486
- }, ql = ((e, n) => e === void 0 || n === void 0 ? t.union([t.null().transform(() => ({})), Hl()]).default(() => ({})) : t.union([t.null().transform(() => ({})), t.record(e, n)]).default(() => ({}))), Jl = /* @__PURE__ */ r({}), Yl = () => typeof process < "u" && process.versions != null && process.versions.node != null ? "node" : typeof window > "u" || window.document === void 0 ? "webworker" : "browser", Xl = Yl(), Zl = [
4496
+ }, Jl = ((e, n) => e === void 0 || n === void 0 ? t.union([t.null().transform(() => ({})), Ul()]).default(() => ({})) : t.union([t.null().transform(() => ({})), t.record(e, n)]).default(() => ({}))), Yl = /* @__PURE__ */ r({}), Xl = () => typeof process < "u" && process.versions != null && process.versions.node != null ? "node" : typeof window > "u" || window.document === void 0 ? "webworker" : "browser", Zl = Xl(), Ql = [
4487
4497
  "macOS",
4488
4498
  "Windows",
4489
4499
  "Linux"
4490
- ], Ql = [
4500
+ ], $l = [
4491
4501
  "macos",
4492
4502
  "windows",
4493
4503
  "linux"
4494
- ], $l = {
4504
+ ], eu = {
4495
4505
  macos: "macOS",
4496
4506
  windows: "Windows",
4497
4507
  linux: "Linux"
4498
- }, eu = t.enum(Zl).or(t.enum(Ql).transform((e) => $l[e])), tu = () => {
4508
+ }, tu = t.enum(Ql).or(t.enum($l).transform((e) => eu[e])), nu = () => {
4499
4509
  if (typeof window > "u") return;
4500
4510
  let e = window.navigator.userAgent.toLowerCase();
4501
4511
  if (e.includes("mac")) return "macOS";
4502
4512
  if (e.includes("win")) return "Windows";
4503
4513
  if (e.includes("linux")) return "Linux";
4504
- }, nu, ru = ((e = {}) => {
4514
+ }, ru, iu = ((e = {}) => {
4505
4515
  let { force: t, default: n } = e;
4506
- return t ?? nu ?? (nu = tu(), nu ?? n);
4507
- }), iu = /* @__PURE__ */ r({
4508
- OPERATING_SYSTEMS: () => Zl,
4509
- RUNTIME: () => Xl,
4510
- detect: () => Yl,
4511
- getOS: () => ru,
4512
- osZ: () => eu
4516
+ return t ?? ru ?? (ru = nu(), ru ?? n);
4513
4517
  }), au = /* @__PURE__ */ r({
4514
- flushMicrotasks: () => ou,
4515
- flushTaskQueue: () => su
4516
- }), ou = () => Promise.resolve(), su = () => new Promise((e) => setTimeout(e, 0)), cu = /* @__PURE__ */ r({ copy: () => lu }), lu = (e) => Array.isArray(e) ? [...e] : typeof e == "object" && e ? { ...e } : e, uu = t.object({
4518
+ OPERATING_SYSTEMS: () => Ql,
4519
+ RUNTIME: () => Zl,
4520
+ detect: () => Xl,
4521
+ getOS: () => iu,
4522
+ osZ: () => tu
4523
+ }), ou = /* @__PURE__ */ r({
4524
+ flushMicrotasks: () => su,
4525
+ flushTaskQueue: () => cu
4526
+ }), su = () => Promise.resolve(), cu = () => new Promise((e) => setTimeout(e, 0)), lu = /* @__PURE__ */ r({ copy: () => uu }), uu = (e) => Array.isArray(e) ? [...e] : typeof e == "object" && e ? { ...e } : e, du = t.object({
4517
4527
  message: t.string().optional(),
4518
4528
  description: t.string().optional(),
4519
- details: Hl().optional()
4520
- }), du = (e) => "toStatus" in e && typeof e.toStatus == "function", fu = (e) => {
4521
- if (!du(e)) return;
4529
+ details: Ul().optional()
4530
+ }), fu = (e) => {
4531
+ if (typeof e != "object" || !e || !("toStatus" in e) || typeof e.toStatus != "function") return;
4522
4532
  let t;
4523
4533
  try {
4524
4534
  t = e.toStatus();
4525
4535
  } catch {
4526
4536
  return;
4527
4537
  }
4528
- let n = uu.safeParse(t);
4538
+ let n = du.safeParse(t);
4529
4539
  return n.success ? n.data : void 0;
4530
4540
  }, pu = t.object({
4531
4541
  stack: t.string(),
4532
4542
  error: t.instanceof(Error)
4533
- }).and(Hl()), mu = (e, t) => {
4534
- if (!(e instanceof Error)) throw e;
4535
- let n = {
4543
+ }).and(Ul()), mu = (e, t) => {
4544
+ let n = Me(e), r = {
4536
4545
  variant: "error",
4537
- message: t ?? e.message,
4538
- description: t == null ? void 0 : e.message,
4546
+ message: t ?? n.message,
4547
+ description: t == null ? void 0 : n.message,
4539
4548
  details: {
4540
- stack: e.stack ?? "",
4541
- error: e
4549
+ stack: n.stack ?? "",
4550
+ error: n
4542
4551
  }
4543
- }, r = fu(e);
4544
- return r != null && (t != null && r.message != null ? n.message = `${t}: ${r.message}` : r.message != null && (n.message = r.message), r.description != null && (n.description = r.description), r.details != null && n.details != null && (n.details = {
4545
- ...n.details,
4546
- ...r.details
4547
- })), gu(n);
4552
+ }, i = fu(e);
4553
+ return i != null && (t != null && i.message != null ? r.message = `${t}: ${i.message}` : i.message != null && (r.message = i.message), i.description != null && (r.description = i.description), i.details != null && r.details != null && (r.details = {
4554
+ ...r.details,
4555
+ ...i.details
4556
+ })), gu(r);
4548
4557
  }, hu = (e) => {
4549
4558
  let t = e.details.error, n = Error(e.message, { cause: e });
4550
4559
  return n.name = t.name, n.stack = t.stack, n;
4551
4560
  }, gu = (e) => ({
4552
- key: hi(),
4561
+ key: gi(),
4553
4562
  time: O.now(),
4554
4563
  name: "",
4555
4564
  ...e
@@ -4573,7 +4582,7 @@ var os = /* @__PURE__ */ r({
4573
4582
  ...yu,
4574
4583
  ...t
4575
4584
  }, r = [], i = e.variant.toUpperCase();
4576
- if (n.includeName && ot(e.name) && (i += ` [${e.name}]`), i += `: ${e.message}`, n.includeTimestamp && (i += ` (${e.time.toString("dateTime", "local")})`), r.push(i), e.description != null && r.push(bu(e.description)), "details" in e && _(e.details)) {
4585
+ if (n.includeName && st(e.name) && (i += ` [${e.name}]`), i += `: ${e.message}`, n.includeTimestamp && (i += ` (${e.time.toString("dateTime", "local")})`), r.push(i), e.description != null && r.push(bu(e.description)), "details" in e && g(e.details)) {
4577
4586
  let t = e.details;
4578
4587
  "stack" in t && typeof t.stack == "string" && t.stack !== "" && r.push(`Stack Trace:\n${t.stack}`);
4579
4588
  let n = Object.fromEntries(Object.entries(t).filter(([e]) => e !== "stack" && e !== "error"));
@@ -4588,14 +4597,14 @@ var os = /* @__PURE__ */ r({
4588
4597
  "loading",
4589
4598
  "disabled"
4590
4599
  ], Cu = t.enum(Su), wu = t.literal("success"), Tu = t.literal("info"), Eu = t.literal("warning"), Du = t.literal("error"), Ou = t.literal("loading"), ku = t.literal("disabled"), Au = ({ details: e, v: n } = {}) => t.object({
4591
- key: t.string().default(() => hi()),
4600
+ key: t.string().default(() => gi()),
4592
4601
  name: t.string().default(""),
4593
4602
  variant: n ?? Cu,
4594
4603
  message: t.string(),
4595
4604
  description: t.string().optional(),
4596
- time: Ir.default(() => O.now()),
4605
+ time: Lr.default(() => O.now()),
4597
4606
  details: e ?? t.unknown().optional(),
4598
- labels: fe(hl.array())
4607
+ labels: pe(gl.array())
4599
4608
  }), ju = ({ details: e, v: t } = {}) => Au({
4600
4609
  details: e,
4601
4610
  v: t
@@ -4911,4 +4920,4 @@ var Gu = function(e, t, n, r) {
4911
4920
  });
4912
4921
  };
4913
4922
  //#endregion
4914
- export { Hr as ClockSkewCalculator, N as DataType, j as Density, ws as MultiSeries, A as Rate, gs as Series, P as Size, Os as TIMESTAMP_FORMATS, As as TIME_ZONES, M as TimeRange, k as TimeSpan, O as TimeStamp, ud as URL, u as array, yr as binary, jn as bounds, ja as box, Fs as breaker, ld as buildQueryString, d as caseconv, Rs as change, Mo as clamp, Rc as color, ci as compare, Yc as control, Pr as convertDataType, Xc as csv, Br as dataTypeZ, tl as debounce, ke as deep, nl as destructor, xo as dimensions, vi as direction, Me as errors, tt as fmt, ui as id, gi as instance, _s as isCrudeSeries, Nr as isTelemValue, il as json, fl as kv, pl as label, _l as link, Di as location, bl as map, ar as math, Sl as migrate, ue as narrow, Pl as notation, Fl as numeric, jr as numericTimeRangeZ, Il as observe, zl as optional, nt as primitive, Rr as rateZ, Bl as record, Jl as require, iu as runtime, No as scale, au as scheduler, cu as shallow, zr as sizeZ, Ns as sleep, Xt as spatial, Mu as status, Wo as sticky, zu as strings, qu as sync, Ms as telem, Xu as testutil, id as text, ad as throttle, Vr as timeRangeBoundedZ, Fr as timeRangeZ, Lr as timeSpanZ, Ir as timeStampZ, js as timeZoneZ, ks as timestampFormatZ, Mr as typedArrayZ, Ur as unique, os as uuid, ra as xy, vr as zod };
4923
+ export { Ur as ClockSkewCalculator, N as DataType, j as Density, Ts as MultiSeries, A as Rate, _s as Series, P as Size, ks as TIMESTAMP_FORMATS, js as TIME_ZONES, M as TimeRange, k as TimeSpan, O as TimeStamp, ud as URL, u as array, br as binary, Mn as bounds, Ma as box, Is as breaker, ld as buildQueryString, d as caseconv, zs as change, No as clamp, zc as color, li as compare, Xc as control, Fr as convertDataType, Zc as csv, Vr as dataTypeZ, nl as debounce, Ye as deep, rl as destructor, So as dimensions, yi as direction, Oe as errors, nt as fmt, di as id, _i as instance, vs as isCrudeSeries, Pr as isTelemValue, al as json, pl as kv, ml as label, vl as link, Oi as location, xl as map, or as math, Cl as migrate, de as narrow, Fl as notation, Il as numeric, Mr as numericTimeRangeZ, Ll as observe, Bl as optional, rt as primitive, zr as rateZ, Vl as record, Yl as require, au as runtime, Po as scale, ou as scheduler, lu as shallow, Br as sizeZ, Ps as sleep, Zt as spatial, Mu as status, Go as sticky, zu as strings, qu as sync, Ns as telem, Xu as testutil, id as text, ad as throttle, Hr as timeRangeBoundedZ, Ir as timeRangeZ, Rr as timeSpanZ, Lr as timeStampZ, Ms as timeZoneZ, As as timestampFormatZ, Nr as typedArrayZ, Wr as unique, ss as uuid, ia as xy, yr as zod };