@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/.turbo/turbo-build.log +4 -4
- package/dist/src/deep/merge.d.ts.map +1 -1
- package/dist/src/deep/set.d.ts.map +1 -1
- package/dist/src/errors/errors.d.ts +12 -0
- package/dist/src/errors/errors.d.ts.map +1 -1
- package/dist/src/migrate/migrate.d.ts.map +1 -1
- package/dist/src/status/status.d.ts.map +1 -1
- package/dist/x.cjs +10 -10
- package/dist/x.js +1099 -1090
- package/package.json +3 -3
- package/src/deep/merge.ts +2 -1
- package/src/deep/set.ts +2 -1
- package/src/errors/errors.spec.ts +92 -0
- package/src/errors/errors.ts +22 -0
- package/src/migrate/migrate.ts +2 -1
- package/src/status/status.spec.ts +17 -2
- package/src/status/status.ts +15 -9
- package/tsconfig.tsbuildinfo +1 -1
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: () =>
|
|
33
|
-
capitalize: () =>
|
|
32
|
+
camelToSnake: () => ie,
|
|
33
|
+
capitalize: () => ae,
|
|
34
34
|
preserveCase: () => p,
|
|
35
|
-
snakeToCamel: () =>
|
|
36
|
-
toKebab: () =>
|
|
37
|
-
toProperNoun: () =>
|
|
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
|
-
},
|
|
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
|
|
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 =
|
|
49
|
+
let t = ee(e);
|
|
50
50
|
if (t != null) return t;
|
|
51
51
|
}
|
|
52
|
-
},
|
|
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
|
|
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 =
|
|
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" ?
|
|
73
|
-
},
|
|
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
|
-
},
|
|
78
|
-
let t = (n, r =
|
|
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 =
|
|
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 (!
|
|
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 =
|
|
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 && (
|
|
99
|
-
if (
|
|
100
|
-
if (!
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
}),
|
|
117
|
-
isObject: () =>
|
|
118
|
-
isPlainObject: () =>
|
|
119
|
-
}),
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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 (!
|
|
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 (!
|
|
181
|
+
if (!_e(r, i)) return !1;
|
|
182
182
|
} else if (r !== i) return !1;
|
|
183
183
|
}
|
|
184
184
|
return !0;
|
|
185
|
-
},
|
|
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 (!
|
|
192
|
+
if (!ve(r, i)) return !1;
|
|
193
193
|
} else if (r !== i) return !1;
|
|
194
194
|
}
|
|
195
195
|
return !0;
|
|
196
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
208
|
+
}, be = (e, t) => {
|
|
209
209
|
let n = e.split(".");
|
|
210
210
|
return n.forEach((e, r) => {
|
|
211
|
-
t =
|
|
211
|
+
t = _(t, e), typeof t == "object" && t && "key" in t && (n[r] = t.key);
|
|
212
212
|
}), n.join(".");
|
|
213
|
-
},
|
|
213
|
+
}, xe = (e, t) => {
|
|
214
214
|
let n = e.split(".");
|
|
215
215
|
return t < 0 ? n[n.length + t] : n[t];
|
|
216
|
-
},
|
|
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
|
-
},
|
|
225
|
+
}, v = (e) => {
|
|
226
226
|
let t = parseInt(e, 10);
|
|
227
227
|
return isNaN(t) || t < 0 || t.toString() !== e ? null : t;
|
|
228
|
-
},
|
|
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 (
|
|
231
|
+
if (_(e, r) != null) return [r, n];
|
|
232
232
|
}
|
|
233
233
|
return null;
|
|
234
|
-
},
|
|
235
|
-
let { optional: r, getter: i =
|
|
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
|
-
}),
|
|
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 (
|
|
267
|
-
|
|
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
|
|
272
|
-
},
|
|
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
|
-
},
|
|
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 =
|
|
448
|
+
let e = _(r, n[i]);
|
|
346
449
|
if (e == null) return;
|
|
347
450
|
r = e, i++;
|
|
348
451
|
}
|
|
349
452
|
}
|
|
350
|
-
},
|
|
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 =
|
|
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 =
|
|
458
|
+
let n = _(i, t);
|
|
356
459
|
if (n == null) {
|
|
357
|
-
let e = r[a], o =
|
|
358
|
-
o == null && e.startsWith("-") &&
|
|
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 =
|
|
468
|
+
let t = v(e);
|
|
366
469
|
if (t == null) {
|
|
367
470
|
if (e.startsWith("-")) {
|
|
368
|
-
let n =
|
|
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 =
|
|
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 =
|
|
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
|
-
},
|
|
505
|
+
}, Ye = /* @__PURE__ */ r({
|
|
403
506
|
SEPARATOR: () => ".",
|
|
404
|
-
atKeys: () =>
|
|
405
|
-
copy: () =>
|
|
406
|
-
defaultGetter: () =>
|
|
407
|
-
difference: () =>
|
|
408
|
-
element: () =>
|
|
409
|
-
equal: () =>
|
|
410
|
-
findBestKey: () =>
|
|
411
|
-
get: () =>
|
|
412
|
-
getIndex: () =>
|
|
413
|
-
has: () =>
|
|
414
|
-
override: () =>
|
|
415
|
-
overrideValidItems: () =>
|
|
416
|
-
partialEqual: () =>
|
|
417
|
-
pathsMatch: () =>
|
|
418
|
-
remove: () =>
|
|
419
|
-
resolvePath: () =>
|
|
420
|
-
set: () =>
|
|
421
|
-
transformPath: () =>
|
|
422
|
-
}),
|
|
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
|
-
},
|
|
522
|
-
let n = t.maxStringLength ??
|
|
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 (
|
|
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
|
-
},
|
|
554
|
-
path: () =>
|
|
555
|
-
stringify: () =>
|
|
556
|
-
value: () =>
|
|
557
|
-
}),
|
|
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: () =>
|
|
569
|
+
is: () => ct,
|
|
560
570
|
isCrudeValueExtension: () => b,
|
|
561
|
-
isHashable: () =>
|
|
562
|
-
isNonZero: () =>
|
|
563
|
-
isStringer: () =>
|
|
564
|
-
isZero: () =>
|
|
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
|
-
},
|
|
580
|
-
if (
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
613
|
-
let r = JSON.stringify(
|
|
614
|
-
return `${
|
|
615
|
-
},
|
|
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 =
|
|
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 =
|
|
633
|
+
let e = _t(n.issues);
|
|
624
634
|
e > t && (t = e);
|
|
625
635
|
}
|
|
626
636
|
}
|
|
627
637
|
return t;
|
|
628
|
-
},
|
|
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 =
|
|
643
|
+
let t = r.errors[0], i = _t(t);
|
|
634
644
|
for (let e = 1; e < r.errors.length; e++) {
|
|
635
|
-
let n =
|
|
645
|
+
let n = _t(r.errors[e]);
|
|
636
646
|
n > i && (t = r.errors[e], i = n);
|
|
637
647
|
}
|
|
638
|
-
n.push(...
|
|
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(...
|
|
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(...
|
|
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
|
-
},
|
|
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
|
-
},
|
|
669
|
-
let i = `${n} `, a = `${n +
|
|
670
|
-
...
|
|
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 =
|
|
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 <=
|
|
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
|
-
},
|
|
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 ?
|
|
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 ===
|
|
737
|
-
i.push(a.map((e) => ` × ${
|
|
746
|
+
if (e === xt) {
|
|
747
|
+
i.push(a.map((e) => ` × ${gt(e, t, n)}`).join("\n"));
|
|
738
748
|
continue;
|
|
739
749
|
}
|
|
740
|
-
let 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 ${
|
|
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 =
|
|
757
|
+
let n = String(e.path[e.path.length - 1]), r = me(t, e.path);
|
|
748
758
|
c.set(n, {
|
|
749
|
-
reason:
|
|
759
|
+
reason: ht(e),
|
|
750
760
|
missing: !r.present
|
|
751
761
|
});
|
|
752
762
|
}
|
|
753
|
-
let l = r.length === 0, u =
|
|
754
|
-
l ? i.push(u.join("\n")) : i.push([` at ${
|
|
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
|
-
},
|
|
767
|
+
}, Ct = (e, t) => {
|
|
758
768
|
let n = Object.entries(e);
|
|
759
|
-
return n.every(([, e]) =>
|
|
760
|
-
},
|
|
761
|
-
let a = i ?? {}, o = vt(
|
|
762
|
-
return s.push(
|
|
763
|
-
},
|
|
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(
|
|
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:
|
|
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
|
-
|
|
799
|
+
Re({
|
|
790
800
|
encode: (e) => {
|
|
791
|
-
if (!
|
|
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:
|
|
806
|
+
input: et(t.input)
|
|
797
807
|
};
|
|
798
808
|
return {
|
|
799
|
-
type:
|
|
809
|
+
type: ut,
|
|
800
810
|
data: JSON.stringify(n)
|
|
801
811
|
};
|
|
802
812
|
},
|
|
803
813
|
decode: (e) => {
|
|
804
|
-
if (e.type !==
|
|
814
|
+
if (e.type !== ut) return null;
|
|
805
815
|
let t = JSON.parse(e.data);
|
|
806
|
-
return new
|
|
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
|
|
824
|
+
var Et = (e, t, n = {}) => {
|
|
815
825
|
let r = e.safeParse(t);
|
|
816
826
|
if (r.success) return r.data;
|
|
817
|
-
throw new
|
|
827
|
+
throw new Tt({
|
|
818
828
|
issues: r.error.issues,
|
|
819
829
|
input: t,
|
|
820
|
-
label: n.label ??
|
|
830
|
+
label: n.label ?? lt,
|
|
821
831
|
context: n.context,
|
|
822
832
|
cause: r.error
|
|
823
833
|
});
|
|
824
|
-
},
|
|
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 (
|
|
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 =
|
|
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 &&
|
|
834
|
-
},
|
|
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
|
-
},
|
|
838
|
-
ALIGNMENTS: () =>
|
|
839
|
-
ANGULAR_DIRECTIONS: () =>
|
|
840
|
-
CENTER_LOCATIONS: () =>
|
|
841
|
-
DIMENSIONS: () =>
|
|
842
|
-
DIRECTIONS: () =>
|
|
843
|
-
LOCATIONS: () =>
|
|
844
|
-
ORDERS: () =>
|
|
845
|
-
OUTER_LOCATIONS: () =>
|
|
846
|
-
SIGNED_DIMENSIONS: () =>
|
|
847
|
-
STICKY_UNITS: () =>
|
|
848
|
-
X_LOCATIONS: () =>
|
|
849
|
-
Y_LOCATIONS: () =>
|
|
850
|
-
alignmentZ: () =>
|
|
851
|
-
angularDirectionZ: () =>
|
|
852
|
-
boundsZ: () =>
|
|
853
|
-
centerLocationZ: () =>
|
|
854
|
-
clientXYZ: () =>
|
|
855
|
-
cornerLocationZ: () =>
|
|
856
|
-
dimensionZ: () =>
|
|
857
|
-
dimensionsZ: () =>
|
|
858
|
-
directionZ: () =>
|
|
859
|
-
locationZ: () =>
|
|
860
|
-
orderZ: () =>
|
|
861
|
-
outerLocationZ: () =>
|
|
862
|
-
signedDimensionZ: () =>
|
|
863
|
-
signedDimensionsZ: () =>
|
|
864
|
-
stickyUnitZ: () =>
|
|
865
|
-
stickyUnitsZ: () =>
|
|
866
|
-
stickyXYZ: () =>
|
|
867
|
-
viewportZ: () =>
|
|
868
|
-
xLocationZ: () =>
|
|
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: () =>
|
|
871
|
-
}),
|
|
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
|
-
],
|
|
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
|
-
],
|
|
892
|
+
], mn = t.enum(pn), hn = [
|
|
883
893
|
"start",
|
|
884
894
|
"center",
|
|
885
895
|
"end"
|
|
886
|
-
],
|
|
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:
|
|
894
|
-
y:
|
|
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
|
-
}),
|
|
908
|
+
}), En = t.object({
|
|
899
909
|
signedWidth: t.number(),
|
|
900
910
|
signedHeight: t.number()
|
|
901
|
-
}),
|
|
911
|
+
}), Dn = t.object({
|
|
902
912
|
clientX: t.number(),
|
|
903
913
|
clientY: t.number()
|
|
904
|
-
}),
|
|
914
|
+
}), On = (e) => t.object({
|
|
905
915
|
lower: e ?? t.number(),
|
|
906
916
|
upper: e ?? t.number()
|
|
907
|
-
}),
|
|
917
|
+
}), kn = t.object({
|
|
908
918
|
zoom: t.number().default(1),
|
|
909
919
|
position: T
|
|
910
|
-
}),
|
|
920
|
+
}), An = t.object({
|
|
911
921
|
x: t.number(),
|
|
912
922
|
y: t.number(),
|
|
913
|
-
root:
|
|
914
|
-
units:
|
|
915
|
-
}),
|
|
916
|
-
CLIP: () =>
|
|
917
|
-
DECIMAL: () =>
|
|
918
|
-
INFINITE: () =>
|
|
919
|
-
ZERO: () =>
|
|
920
|
-
boundsZ: () =>
|
|
921
|
-
buildInsertionPlan: () =>
|
|
922
|
-
clamp: () =>
|
|
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: () =>
|
|
926
|
-
equals: () =>
|
|
927
|
-
findInsertPosition: () =>
|
|
928
|
-
isFinite: () =>
|
|
929
|
-
isZero: () =>
|
|
930
|
-
linspace: () =>
|
|
931
|
-
makeValid: () =>
|
|
932
|
-
max: () =>
|
|
933
|
-
mean: () =>
|
|
934
|
-
min: () =>
|
|
935
|
-
overlapsWith: () =>
|
|
936
|
-
span: () =>
|
|
937
|
-
spanIsZero: () =>
|
|
938
|
-
traverse: () =>
|
|
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 ?
|
|
950
|
-
},
|
|
959
|
+
return n?.makeValid ? Rn(r) : r;
|
|
960
|
+
}, Nn = Object.freeze({
|
|
951
961
|
lower: 0,
|
|
952
962
|
upper: 0
|
|
953
|
-
}),
|
|
963
|
+
}), Pn = Object.freeze({
|
|
954
964
|
lower: -Infinity,
|
|
955
965
|
upper: Infinity
|
|
956
|
-
}),
|
|
966
|
+
}), Fn = Object.freeze({
|
|
957
967
|
lower: 0,
|
|
958
968
|
upper: 1
|
|
959
|
-
}),
|
|
969
|
+
}), In = Object.freeze({
|
|
960
970
|
lower: -1,
|
|
961
971
|
upper: 1
|
|
962
|
-
}),
|
|
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
|
-
},
|
|
977
|
+
}, Rn = (e) => e.lower > e.upper ? {
|
|
968
978
|
lower: e.upper,
|
|
969
979
|
upper: e.lower
|
|
970
|
-
} : e,
|
|
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
|
-
},
|
|
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
|
-
},
|
|
991
|
+
}, Vn = (e) => {
|
|
982
992
|
let t = E(e);
|
|
983
993
|
return t.upper - t.lower;
|
|
984
|
-
},
|
|
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
|
-
},
|
|
1003
|
+
}, Gn = (e) => {
|
|
994
1004
|
let t = E(e);
|
|
995
1005
|
return (t.upper + t.lower) / 2;
|
|
996
|
-
},
|
|
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
|
-
}),
|
|
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
|
-
}),
|
|
1012
|
+
}), Jn = (e) => {
|
|
1003
1013
|
let t = E(e), n = typeof t.lower == "bigint";
|
|
1004
|
-
return Array.from({ length: Number(
|
|
1005
|
-
},
|
|
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
|
-
},
|
|
1029
|
+
}, Xn = {
|
|
1020
1030
|
removeBefore: 0,
|
|
1021
1031
|
removeAfter: 0,
|
|
1022
1032
|
insertInto: 0,
|
|
1023
1033
|
deleteInBetween: 0
|
|
1024
|
-
},
|
|
1034
|
+
}, Zn = (e, t) => {
|
|
1025
1035
|
let n = e.map((e) => E(e)), r = E(t);
|
|
1026
|
-
if (n.length === 0) return
|
|
1027
|
-
let i =
|
|
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
|
-
...
|
|
1039
|
+
...Xn,
|
|
1030
1040
|
insertInto: e.length
|
|
1031
1041
|
};
|
|
1032
1042
|
if (a.index === 0) return {
|
|
1033
|
-
...
|
|
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(
|
|
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
|
-
},
|
|
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 (;
|
|
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 =
|
|
1059
|
-
if (o = C(o, i > 0 ? e : -e), a = S(a, i > 0 ? e : -e),
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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 =
|
|
1102
|
+
i = Vn(t);
|
|
1093
1103
|
let e = i / n;
|
|
1094
|
-
r = i > 0 && e >
|
|
1104
|
+
r = i > 0 && e > ir;
|
|
1095
1105
|
}
|
|
1096
1106
|
if (r) {
|
|
1097
1107
|
let t;
|
|
1098
|
-
t = i >= 1e3 ?
|
|
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 **
|
|
1113
|
+
let t = 10 ** er;
|
|
1104
1114
|
return Math.round(e * t) / t;
|
|
1105
1115
|
}
|
|
1106
1116
|
if (n >= 1) {
|
|
1107
|
-
let t = 10 **
|
|
1117
|
+
let t = 10 ** tr;
|
|
1108
1118
|
return Math.round(e * t) / t;
|
|
1109
1119
|
}
|
|
1110
|
-
let a = 10 ** (
|
|
1120
|
+
let a = 10 ** (rr - Math.floor(Math.log10(n)) - 1);
|
|
1111
1121
|
return Math.round(e * a) / a;
|
|
1112
|
-
},
|
|
1113
|
-
MAX_INT16: () =>
|
|
1114
|
-
MAX_INT32: () =>
|
|
1115
|
-
MAX_INT64: () =>
|
|
1116
|
-
MAX_INT64_NUMBER: () =>
|
|
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: () =>
|
|
1119
|
-
MAX_UINT16: () =>
|
|
1120
|
-
MAX_UINT20: () =>
|
|
1121
|
-
MAX_UINT32: () =>
|
|
1122
|
-
MAX_UINT64: () =>
|
|
1123
|
-
MAX_UINT64_NUMBER: () =>
|
|
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: () =>
|
|
1126
|
-
MIN_INT32: () =>
|
|
1127
|
-
MIN_INT64: () =>
|
|
1128
|
-
MIN_INT64_NUMBER: () =>
|
|
1129
|
-
MIN_INT8: () =>
|
|
1130
|
-
abs: () =>
|
|
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: () =>
|
|
1133
|
-
div: () =>
|
|
1134
|
-
equal: () =>
|
|
1135
|
-
isInteger: () =>
|
|
1136
|
-
max: () =>
|
|
1137
|
-
min: () =>
|
|
1142
|
+
closeTo: () => Ut,
|
|
1143
|
+
div: () => Xt,
|
|
1144
|
+
equal: () => Wt,
|
|
1145
|
+
isInteger: () => qt,
|
|
1146
|
+
max: () => Jt,
|
|
1147
|
+
min: () => Kt,
|
|
1138
1148
|
mult: () => w,
|
|
1139
|
-
roundToNearestMagnitude: () =>
|
|
1140
|
-
smartRound: () =>
|
|
1149
|
+
roundToNearestMagnitude: () => Gt,
|
|
1150
|
+
smartRound: () => ar,
|
|
1141
1151
|
sub: () => S
|
|
1142
|
-
}),
|
|
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
|
-
}),
|
|
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
|
-
},
|
|
1159
|
+
}, vr = ((e, t, n) => t === "" ? e : we(_r(e, "shape"), gr(t), {
|
|
1150
1160
|
...n,
|
|
1151
|
-
getter:
|
|
1152
|
-
})),
|
|
1153
|
-
ParseError: () =>
|
|
1154
|
-
functionOutput: () =>
|
|
1155
|
-
getFieldSchema: () =>
|
|
1156
|
-
getFieldSchemaPath: () =>
|
|
1157
|
-
int16: () =>
|
|
1158
|
-
int64: () =>
|
|
1159
|
-
int8: () =>
|
|
1160
|
-
nullToUndefined: () =>
|
|
1161
|
-
parse: () =>
|
|
1162
|
-
toArray: () =>
|
|
1163
|
-
uint12: () =>
|
|
1164
|
-
uint16: () =>
|
|
1165
|
-
uint20: () =>
|
|
1166
|
-
uint8: () =>
|
|
1167
|
-
}),
|
|
1168
|
-
CSVCodec: () =>
|
|
1169
|
-
CSV_CODEC: () =>
|
|
1170
|
-
ENCODERS: () =>
|
|
1171
|
-
JSONCodec: () =>
|
|
1172
|
-
JSON_CODEC: () =>
|
|
1173
|
-
TEXT_CODEC: () =>
|
|
1174
|
-
TextCodec: () =>
|
|
1175
|
-
}),
|
|
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 =
|
|
1190
|
-
return t == null ? 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 =
|
|
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
|
-
},
|
|
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 || !
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
]),
|
|
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 ===
|
|
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
|
|
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(
|
|
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
|
-
|
|
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
|
|
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),
|
|
1604
|
-
return l.isZero || (
|
|
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 /
|
|
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 %
|
|
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 <
|
|
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 %
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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() <=
|
|
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(
|
|
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
|
-
},
|
|
2138
|
+
}, Mr = t.object({
|
|
2129
2139
|
start: t.number(),
|
|
2130
2140
|
end: t.number()
|
|
2131
|
-
}),
|
|
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
|
-
]),
|
|
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
|
-
},
|
|
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
|
-
},
|
|
2167
|
-
by: () =>
|
|
2168
|
-
unique: () =>
|
|
2169
|
-
}),
|
|
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
|
-
},
|
|
2180
|
-
let n =
|
|
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 ?
|
|
2203
|
-
},
|
|
2204
|
-
let r =
|
|
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
|
-
},
|
|
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 =
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
2236
|
-
let r = 0, i = e.length, a = n ??
|
|
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
|
-
},
|
|
2244
|
-
let r =
|
|
2253
|
+
}, ci = (e, t, n) => {
|
|
2254
|
+
let r = si(e, t, n);
|
|
2245
2255
|
e.splice(r, 0, t);
|
|
2246
|
-
},
|
|
2256
|
+
}, li = /* @__PURE__ */ r({
|
|
2247
2257
|
EQUAL: () => 0,
|
|
2248
2258
|
GREATER_THAN: () => 1,
|
|
2249
2259
|
LESS_THAN: () => -1,
|
|
2250
|
-
arraysEqual: () =>
|
|
2251
|
-
insert: () =>
|
|
2252
|
-
isEqualTo: () =>
|
|
2253
|
-
isGreaterThan: () =>
|
|
2254
|
-
isGreaterThanEqual: () =>
|
|
2255
|
-
isLessThan: () =>
|
|
2256
|
-
mapsEqual: () =>
|
|
2257
|
-
newF: () =>
|
|
2258
|
-
newFieldF: () =>
|
|
2259
|
-
order: () =>
|
|
2260
|
-
primitiveArrays: () =>
|
|
2261
|
-
reverseF: () =>
|
|
2262
|
-
search: () =>
|
|
2263
|
-
stringsWithNumbers: () =>
|
|
2264
|
-
uniqueUnorderedPrimitiveArrays: () =>
|
|
2265
|
-
unorderedPrimitiveArrays: () =>
|
|
2266
|
-
}),
|
|
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
|
-
},
|
|
2280
|
+
}, di = /* @__PURE__ */ r({
|
|
2271
2281
|
LENGTH: () => 11,
|
|
2272
|
-
create: () =>
|
|
2273
|
-
}),
|
|
2274
|
-
DIRECTIONS: () =>
|
|
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: () =>
|
|
2277
|
-
dimension: () =>
|
|
2278
|
-
directionZ: () =>
|
|
2279
|
-
isDirection: () =>
|
|
2280
|
-
isX: () =>
|
|
2281
|
-
isY: () =>
|
|
2282
|
-
location: () =>
|
|
2283
|
-
signedDimension: () =>
|
|
2284
|
-
swap: () =>
|
|
2285
|
-
}),
|
|
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
|
-
...
|
|
2289
|
-
...
|
|
2290
|
-
]), F = (e) =>
|
|
2291
|
-
BOTTOM_CENTER: () =>
|
|
2292
|
-
BOTTOM_LEFT: () =>
|
|
2293
|
-
BOTTOM_RIGHT: () =>
|
|
2294
|
-
CENTER: () =>
|
|
2295
|
-
CENTER_LEFT: () =>
|
|
2296
|
-
CENTER_LOCATIONS: () =>
|
|
2297
|
-
CENTER_RIGHT: () =>
|
|
2298
|
-
LOCATIONS: () =>
|
|
2299
|
-
OUTER_LOCATIONS: () =>
|
|
2300
|
-
TOP_CENTER: () =>
|
|
2301
|
-
TOP_LEFT: () =>
|
|
2302
|
-
TOP_RIGHT: () =>
|
|
2303
|
-
XY_LOCATIONS: () =>
|
|
2304
|
-
X_LOCATIONS: () =>
|
|
2305
|
-
Y_LOCATIONS: () =>
|
|
2306
|
-
centerZ: () =>
|
|
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: () =>
|
|
2309
|
-
cornerZ: () =>
|
|
2310
|
-
crudeZ: () =>
|
|
2311
|
-
direction: () =>
|
|
2312
|
-
isX: () =>
|
|
2313
|
-
isY: () =>
|
|
2314
|
-
locationZ: () =>
|
|
2315
|
-
outerZ: () =>
|
|
2316
|
-
rotate: () =>
|
|
2317
|
-
swap: () =>
|
|
2318
|
-
xZ: () =>
|
|
2319
|
-
xy: () =>
|
|
2320
|
-
xyCouple: () =>
|
|
2321
|
-
xyEquals: () =>
|
|
2322
|
-
xyMatches: () =>
|
|
2323
|
-
xyToString: () =>
|
|
2324
|
-
yZ: () =>
|
|
2325
|
-
}),
|
|
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
|
-
},
|
|
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
|
-
},
|
|
2349
|
-
|
|
2350
|
-
t.enum([...
|
|
2358
|
+
}, Ii = t.union([
|
|
2359
|
+
cn,
|
|
2360
|
+
t.enum([...an, ...dn]),
|
|
2351
2361
|
t.instanceof(String)
|
|
2352
|
-
]), I = (e) => e instanceof String || !
|
|
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
|
-
},
|
|
2356
|
-
x:
|
|
2357
|
-
y:
|
|
2358
|
-
}),
|
|
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
|
-
}),
|
|
2371
|
+
}), Hi = Object.freeze({
|
|
2362
2372
|
x: "right",
|
|
2363
2373
|
y: "top"
|
|
2364
|
-
}),
|
|
2374
|
+
}), Ui = Object.freeze({
|
|
2365
2375
|
x: "left",
|
|
2366
2376
|
y: "bottom"
|
|
2367
|
-
}),
|
|
2377
|
+
}), Wi = Object.freeze({
|
|
2368
2378
|
x: "right",
|
|
2369
2379
|
y: "bottom"
|
|
2370
|
-
}),
|
|
2380
|
+
}), Gi = Object.freeze({
|
|
2371
2381
|
x: "center",
|
|
2372
2382
|
y: "center"
|
|
2373
|
-
}),
|
|
2383
|
+
}), Ki = Object.freeze({
|
|
2374
2384
|
x: "center",
|
|
2375
2385
|
y: "top"
|
|
2376
|
-
}),
|
|
2386
|
+
}), qi = Object.freeze({
|
|
2377
2387
|
x: "center",
|
|
2378
2388
|
y: "bottom"
|
|
2379
|
-
}),
|
|
2389
|
+
}), Ji = Object.freeze({
|
|
2380
2390
|
x: "right",
|
|
2381
2391
|
y: "center"
|
|
2382
|
-
}),
|
|
2392
|
+
}), Yi = Object.freeze({
|
|
2383
2393
|
x: "left",
|
|
2384
2394
|
y: "center"
|
|
2385
|
-
}),
|
|
2395
|
+
}), Xi = Object.freeze([
|
|
2396
|
+
Yi,
|
|
2386
2397
|
Ji,
|
|
2387
|
-
qi,
|
|
2388
|
-
Gi,
|
|
2389
2398
|
Ki,
|
|
2390
|
-
|
|
2399
|
+
qi,
|
|
2391
2400
|
Vi,
|
|
2392
2401
|
Hi,
|
|
2393
2402
|
Ui,
|
|
2394
|
-
Wi
|
|
2395
|
-
|
|
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
|
-
},
|
|
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)),
|
|
2404
|
-
let i = { ...
|
|
2405
|
-
return n === "center" ?
|
|
2406
|
-
},
|
|
2407
|
-
INFINITY: () =>
|
|
2408
|
-
NAN: () =>
|
|
2409
|
-
ONE: () =>
|
|
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: () =>
|
|
2412
|
-
calculateMiters: () =>
|
|
2413
|
-
clientXYZ: () =>
|
|
2421
|
+
average: () => Ea,
|
|
2422
|
+
calculateMiters: () => Da,
|
|
2423
|
+
clientXYZ: () => Dn,
|
|
2414
2424
|
construct: () => L,
|
|
2415
|
-
couple: () =>
|
|
2416
|
-
crudeZ: () =>
|
|
2417
|
-
css: () =>
|
|
2418
|
-
distance: () =>
|
|
2419
|
-
equals: () =>
|
|
2420
|
-
isFinite: () =>
|
|
2421
|
-
isNan: () =>
|
|
2422
|
-
isZero: () =>
|
|
2423
|
-
normal: () =>
|
|
2424
|
-
normalize: () =>
|
|
2425
|
-
reciprocal: () =>
|
|
2426
|
-
rotate: () =>
|
|
2427
|
-
round: () =>
|
|
2428
|
-
scale: () =>
|
|
2429
|
-
set: () =>
|
|
2430
|
-
sub: () =>
|
|
2431
|
-
swap: () =>
|
|
2432
|
-
translate: () =>
|
|
2433
|
-
translateX: () =>
|
|
2434
|
-
translateY: () =>
|
|
2435
|
-
translation: () =>
|
|
2436
|
-
truncate: () =>
|
|
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
|
-
}),
|
|
2448
|
+
}), aa = t.union([
|
|
2439
2449
|
t.number(),
|
|
2440
2450
|
T,
|
|
2441
|
-
|
|
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
|
-
}),
|
|
2488
|
+
}), oa = Object.freeze({
|
|
2479
2489
|
x: 1,
|
|
2480
2490
|
y: 1
|
|
2481
|
-
}),
|
|
2491
|
+
}), sa = Object.freeze({
|
|
2482
2492
|
x: Infinity,
|
|
2483
2493
|
y: Infinity
|
|
2484
|
-
}),
|
|
2494
|
+
}), ca = Object.freeze({
|
|
2485
2495
|
x: NaN,
|
|
2486
2496
|
y: NaN
|
|
2487
|
-
}),
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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" ?
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
2560
|
+
}, va = (e) => {
|
|
2551
2561
|
let t = L(e);
|
|
2552
2562
|
return Number.isNaN(t.x) || Number.isNaN(t.y);
|
|
2553
|
-
},
|
|
2563
|
+
}, ya = (e) => {
|
|
2554
2564
|
let t = L(e);
|
|
2555
2565
|
return Number.isFinite(t.x) && Number.isFinite(t.y);
|
|
2556
|
-
},
|
|
2566
|
+
}, ba = (e) => {
|
|
2557
2567
|
let t = L(e);
|
|
2558
2568
|
return [t.x, t.y];
|
|
2559
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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(
|
|
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(
|
|
2614
|
+
a = wa(Ca(i, n)), s = a, c = t;
|
|
2605
2615
|
} else {
|
|
2606
|
-
let n = e[r - 1], l = e[r + 1], u =
|
|
2607
|
-
a =
|
|
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 =
|
|
2619
|
+
c = p === 0 ? t : t / p, s = Ta(Ea(a, o));
|
|
2610
2620
|
}
|
|
2611
|
-
n.push(
|
|
2621
|
+
n.push(da(s, c));
|
|
2612
2622
|
}
|
|
2613
2623
|
return n;
|
|
2614
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
2639
|
-
DECIMAL: () =>
|
|
2640
|
-
ZERO: () =>
|
|
2641
|
-
area: () =>
|
|
2642
|
-
areaIsZero: () =>
|
|
2643
|
-
aspect: () =>
|
|
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: () =>
|
|
2646
|
-
bottomLeft: () =>
|
|
2647
|
-
bottomRight: () =>
|
|
2648
|
-
box: () =>
|
|
2649
|
-
center: () =>
|
|
2650
|
-
centerLeft: () =>
|
|
2651
|
-
centerRight: () =>
|
|
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: () =>
|
|
2654
|
-
contains: () =>
|
|
2655
|
-
copy: () =>
|
|
2656
|
-
css: () =>
|
|
2657
|
-
cssBox: () =>
|
|
2658
|
-
dim: () =>
|
|
2659
|
-
dims: () =>
|
|
2660
|
-
domRect: () =>
|
|
2661
|
-
edgePoints: () =>
|
|
2662
|
-
equals: () =>
|
|
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: () =>
|
|
2665
|
-
isBox: () =>
|
|
2674
|
+
intersection: () => _o,
|
|
2675
|
+
isBox: () => mo,
|
|
2666
2676
|
left: () => K,
|
|
2667
2677
|
loc: () => V,
|
|
2668
|
-
positionInCenter: () =>
|
|
2669
|
-
reRoot: () =>
|
|
2670
|
-
resize: () =>
|
|
2678
|
+
positionInCenter: () => po,
|
|
2679
|
+
reRoot: () => uo,
|
|
2680
|
+
resize: () => Ba,
|
|
2671
2681
|
right: () => W,
|
|
2672
|
-
root: () =>
|
|
2673
|
-
round: () =>
|
|
2674
|
-
signedDims: () =>
|
|
2675
|
-
signedHeight: () =>
|
|
2676
|
-
signedWidth: () =>
|
|
2682
|
+
root: () => so,
|
|
2683
|
+
round: () => xo,
|
|
2684
|
+
signedDims: () => Wa,
|
|
2685
|
+
signedHeight: () => Ya,
|
|
2686
|
+
signedWidth: () => Ja,
|
|
2677
2687
|
top: () => q,
|
|
2678
|
-
topCenter: () =>
|
|
2679
|
-
topLeft: () =>
|
|
2680
|
-
topRight: () =>
|
|
2681
|
-
translate: () =>
|
|
2682
|
-
truncate: () =>
|
|
2688
|
+
topCenter: () => Za,
|
|
2689
|
+
topLeft: () => Xa,
|
|
2690
|
+
topRight: () => Qa,
|
|
2691
|
+
translate: () => go,
|
|
2692
|
+
truncate: () => yo,
|
|
2683
2693
|
width: () => H,
|
|
2684
|
-
x: () =>
|
|
2685
|
-
xBounds: () =>
|
|
2694
|
+
x: () => ao,
|
|
2695
|
+
xBounds: () => co,
|
|
2686
2696
|
xyLoc: () => B,
|
|
2687
|
-
y: () =>
|
|
2688
|
-
yBounds: () =>
|
|
2689
|
-
}),
|
|
2690
|
-
top:
|
|
2691
|
-
left:
|
|
2692
|
-
width:
|
|
2693
|
-
height:
|
|
2694
|
-
}),
|
|
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
|
-
}),
|
|
2709
|
+
}), Ia = t.object({
|
|
2700
2710
|
one: T,
|
|
2701
2711
|
two: T,
|
|
2702
|
-
root:
|
|
2703
|
-
}),
|
|
2712
|
+
root: Ni
|
|
2713
|
+
}), La = {
|
|
2704
2714
|
one: R,
|
|
2705
2715
|
two: R,
|
|
2706
|
-
root:
|
|
2707
|
-
},
|
|
2716
|
+
root: Vi
|
|
2717
|
+
}, Ra = {
|
|
2708
2718
|
one: R,
|
|
2709
|
-
two:
|
|
2710
|
-
root:
|
|
2711
|
-
},
|
|
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 ??
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
}),
|
|
2776
|
-
let r = F(t) === "y" ?
|
|
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" ?
|
|
2782
|
-
y: t.y === "center" ?
|
|
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 =
|
|
2786
|
-
return
|
|
2787
|
-
},
|
|
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
|
-
},
|
|
2800
|
+
}, Ya = (e) => {
|
|
2791
2801
|
let t = z(e);
|
|
2792
2802
|
return t.two.y - t.one.y;
|
|
2793
|
-
},
|
|
2794
|
-
x:
|
|
2795
|
-
y:
|
|
2796
|
-
}),
|
|
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
|
-
},
|
|
2809
|
+
}, oo = (e) => {
|
|
2800
2810
|
let t = z(e);
|
|
2801
2811
|
return t.root.y === "top" ? q(t) : G(t);
|
|
2802
|
-
},
|
|
2803
|
-
x:
|
|
2804
|
-
y:
|
|
2805
|
-
}),
|
|
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
|
-
},
|
|
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
|
-
},
|
|
2818
|
-
let n = z(e), r =
|
|
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
|
-
},
|
|
2832
|
+
}, po = (e, t) => {
|
|
2823
2833
|
let n = z(e), r = z(t);
|
|
2824
2834
|
return z({
|
|
2825
|
-
x:
|
|
2826
|
-
y:
|
|
2827
|
-
},
|
|
2828
|
-
},
|
|
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(
|
|
2835
|
-
},
|
|
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 ?
|
|
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
|
-
},
|
|
2854
|
+
}, vo = (e) => H(e) * U(e), yo = (e, t) => {
|
|
2845
2855
|
let n = z(e);
|
|
2846
|
-
return z(
|
|
2847
|
-
},
|
|
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
|
-
},
|
|
2866
|
+
}, xo = (e) => {
|
|
2857
2867
|
let t = z(e);
|
|
2858
|
-
return z(
|
|
2859
|
-
},
|
|
2860
|
-
DECIMAL: () =>
|
|
2861
|
-
ZERO: () =>
|
|
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: () =>
|
|
2864
|
-
crude: () =>
|
|
2865
|
-
dimensionsZ: () =>
|
|
2866
|
-
equals: () =>
|
|
2867
|
-
max: () =>
|
|
2868
|
-
min: () =>
|
|
2869
|
-
scale: () =>
|
|
2870
|
-
signedDimensionsZ: () =>
|
|
2871
|
-
svgViewBox: () =>
|
|
2872
|
-
swap: () =>
|
|
2873
|
-
}),
|
|
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
|
-
|
|
2878
|
-
]),
|
|
2887
|
+
jn
|
|
2888
|
+
]), wo = {
|
|
2879
2889
|
width: 0,
|
|
2880
2890
|
height: 0
|
|
2881
|
-
},
|
|
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 },
|
|
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
|
-
},
|
|
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
|
-
},
|
|
2916
|
+
}, Oo = (e) => {
|
|
2907
2917
|
let t = J(e);
|
|
2908
2918
|
return `0 0 ${t.width} ${t.height}`;
|
|
2909
|
-
},
|
|
2919
|
+
}, ko = (e) => {
|
|
2910
2920
|
let t = J(e);
|
|
2911
2921
|
return [t.width, t.height];
|
|
2912
|
-
},
|
|
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
|
-
}),
|
|
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
|
-
}),
|
|
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
|
-
},
|
|
2925
|
-
Scale: () =>
|
|
2926
|
-
XY: () =>
|
|
2927
|
-
crudeXYTransform: () =>
|
|
2928
|
-
transform: () =>
|
|
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
|
-
}),
|
|
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
|
-
},
|
|
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
|
-
},
|
|
2954
|
+
}, Ho = (e) => (t, n, r) => {
|
|
2945
2955
|
let { lower: i, upper: a } = e;
|
|
2946
|
-
return r =
|
|
2947
|
-
},
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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
|
-
},
|
|
3033
|
+
}, Wo = class e {
|
|
3024
3034
|
x;
|
|
3025
3035
|
y;
|
|
3026
3036
|
currRoot;
|
|
3027
|
-
constructor(e = new
|
|
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 (
|
|
3079
|
+
if (mo(e)) {
|
|
3070
3080
|
let n = this.currRoot;
|
|
3071
|
-
return t.currRoot = e.root, n != null && !
|
|
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(
|
|
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(
|
|
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
|
-
},
|
|
3120
|
-
calculate: () =>
|
|
3121
|
-
completeXYZ: () =>
|
|
3122
|
-
toCSS: () =>
|
|
3123
|
-
toDecimal: () =>
|
|
3124
|
-
xyZ: () =>
|
|
3125
|
-
}),
|
|
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
|
-
}),
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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: { ...
|
|
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
|
-
...
|
|
3159
|
+
...Sa(a, 3)
|
|
3150
3160
|
};
|
|
3151
|
-
},
|
|
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
|
|
3155
|
-
return typeof e == "string" &&
|
|
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
|
|
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
|
|
3165
|
-
let n =
|
|
3166
|
-
if (
|
|
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
|
|
3172
|
-
function
|
|
3173
|
-
return crypto.getRandomValues(
|
|
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?.() ??
|
|
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
|
|
3199
|
+
return ts(r);
|
|
3190
3200
|
}
|
|
3191
3201
|
//#endregion
|
|
3192
3202
|
//#region src/uuid/uuid.ts
|
|
3193
|
-
var
|
|
3194
|
-
ZERO: () =>
|
|
3195
|
-
create: () =>
|
|
3196
|
-
parse: () =>
|
|
3197
|
-
}),
|
|
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,
|
|
3206
|
-
[Symbol.iterator]: () =>
|
|
3215
|
+
}, X = -1, fs = {
|
|
3216
|
+
[Symbol.iterator]: () => fs,
|
|
3207
3217
|
next: () => ({
|
|
3208
3218
|
done: !0,
|
|
3209
3219
|
value: void 0
|
|
3210
3220
|
})
|
|
3211
|
-
},
|
|
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
|
-
},
|
|
3224
|
+
}, gs = "sy_x_telem_series", _s = class e {
|
|
3215
3225
|
key;
|
|
3216
|
-
discriminator =
|
|
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:
|
|
3250
|
+
glBufferUsage: Zo.default("static").optional()
|
|
3241
3251
|
});
|
|
3242
3252
|
static z = e.crudeZ.transform((t) => new e(t));
|
|
3243
3253
|
constructor(e) {
|
|
3244
|
-
|
|
3245
|
-
let { dataType: t, timeRange: n, sampleOffset: r = 0, glBufferUsage: i = "static", alignment: a = 0n, alignmentMultiple: o = 1n, key: s =
|
|
3246
|
-
if (
|
|
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 =
|
|
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(
|
|
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(
|
|
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] =
|
|
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 :
|
|
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 =
|
|
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) ?
|
|
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 =
|
|
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
|
|
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:
|
|
3537
|
-
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
|
|
3558
|
-
return this.dataType.equals(N.JSON) ? new
|
|
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
|
|
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
|
|
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
|
|
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
|
-
},
|
|
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 =
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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:
|
|
3681
|
+
value: wr.decodeString(t.value, e.schema)
|
|
3672
3682
|
};
|
|
3673
3683
|
}
|
|
3674
|
-
},
|
|
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 =
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
|
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 (
|
|
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
|
|
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
|
|
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
|
|
3793
|
+
return new Ds(this, n, r);
|
|
3784
3794
|
}
|
|
3785
3795
|
subAlignmentSpanIterator(e, t) {
|
|
3786
|
-
if (e >= this.alignmentBounds.upper) return
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
3846
|
+
} } : new Es(this.series);
|
|
3837
3847
|
}
|
|
3838
3848
|
toStrings() {
|
|
3839
3849
|
return this.series.flatMap((e) => e.toStrings());
|
|
3840
3850
|
}
|
|
3841
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
3887
|
+
}, Os = (e) => ({
|
|
3878
3888
|
domain: e >> 32n,
|
|
3879
3889
|
sample: e & 4294967295n
|
|
3880
|
-
}),
|
|
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
|
-
],
|
|
3889
|
-
ClockSkewCalculator: () =>
|
|
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: () =>
|
|
3902
|
+
MultiSeries: () => Ts,
|
|
3893
3903
|
Rate: () => A,
|
|
3894
|
-
Series: () =>
|
|
3904
|
+
Series: () => _s,
|
|
3895
3905
|
Size: () => P,
|
|
3896
|
-
TIMESTAMP_FORMATS: () =>
|
|
3897
|
-
TIME_ZONES: () =>
|
|
3906
|
+
TIMESTAMP_FORMATS: () => ks,
|
|
3907
|
+
TIME_ZONES: () => js,
|
|
3898
3908
|
TimeRange: () => M,
|
|
3899
3909
|
TimeSpan: () => k,
|
|
3900
3910
|
TimeStamp: () => O,
|
|
3901
|
-
convertDataType: () =>
|
|
3902
|
-
dataTypeZ: () =>
|
|
3903
|
-
isCrudeSeries: () =>
|
|
3904
|
-
isTelemValue: () =>
|
|
3905
|
-
numericTimeRangeZ: () =>
|
|
3906
|
-
rateZ: () =>
|
|
3907
|
-
sizeZ: () =>
|
|
3908
|
-
timeRangeBoundedZ: () =>
|
|
3909
|
-
timeRangeZ: () =>
|
|
3910
|
-
timeSpanZ: () =>
|
|
3911
|
-
timeStampZ: () =>
|
|
3912
|
-
timeZoneZ: () =>
|
|
3913
|
-
timestampFormatZ: () =>
|
|
3914
|
-
typedArrayZ: () =>
|
|
3915
|
-
}),
|
|
3916
|
-
Breaker: () =>
|
|
3917
|
-
breakerConfigZ: () =>
|
|
3918
|
-
}),
|
|
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 ??
|
|
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
|
-
},
|
|
3950
|
+
}, Rs = t.object({
|
|
3941
3951
|
baseInterval: k.z.optional(),
|
|
3942
3952
|
maxRetries: t.number().optional(),
|
|
3943
3953
|
scale: t.number().optional()
|
|
3944
|
-
}),
|
|
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
|
-
}),
|
|
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
|
-
|
|
3953
|
-
]),
|
|
3962
|
+
Hs
|
|
3963
|
+
]), Ws = t.tuple([
|
|
3954
3964
|
Q,
|
|
3955
3965
|
Q,
|
|
3956
3966
|
Q
|
|
3957
|
-
]),
|
|
3967
|
+
]), Gs = t.object({ rgba255: Us }), Ks = t.object({
|
|
3958
3968
|
r: Q,
|
|
3959
3969
|
g: Q,
|
|
3960
3970
|
b: Q,
|
|
3961
|
-
a:
|
|
3962
|
-
}),
|
|
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
|
-
|
|
3974
|
-
|
|
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 =
|
|
3977
|
-
if (t.success) return
|
|
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 =
|
|
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
|
-
},
|
|
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
|
-
},
|
|
4006
|
+
}, rc = ((e) => {
|
|
3997
4007
|
if (e == null) return;
|
|
3998
4008
|
let [t, n, r, i] = $(e), a = Math.round(i * 255);
|
|
3999
|
-
return `#${
|
|
4000
|
-
}),
|
|
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
|
-
},
|
|
4013
|
+
}, ac = (e) => `rgb(${oc(e)})`, oc = (e) => {
|
|
4004
4014
|
let [t, n, r] = $(e);
|
|
4005
4015
|
return `${t}, ${n}, ${r}`;
|
|
4006
|
-
},
|
|
4007
|
-
cc(e) / 255,
|
|
4016
|
+
}, sc = (e) => [...cc(e), fc(e)], cc = (e) => [
|
|
4008
4017
|
lc(e) / 255,
|
|
4009
|
-
uc(e) / 255
|
|
4010
|
-
|
|
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] =
|
|
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
|
-
},
|
|
4026
|
-
let n = $(e), r = $(t), i =
|
|
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
|
-
},
|
|
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) =>
|
|
4040
|
+
let n = $(e), [r] = t.sort((e, t) => vc(n, t) - vc(n, e));
|
|
4031
4041
|
return $(r);
|
|
4032
|
-
},
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
e.length === 8 ?
|
|
4037
|
-
]),
|
|
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
|
-
],
|
|
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
|
-
},
|
|
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 (
|
|
4091
|
+
if (Vs.safeParse(i).success) return Sc(i);
|
|
4082
4092
|
}
|
|
4083
|
-
return (t.length === 7 || t.length === 9) &&
|
|
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 (
|
|
4107
|
+
if (Dc[t]) return Sc(Dc[t]);
|
|
4098
4108
|
}
|
|
4099
|
-
},
|
|
4100
|
-
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 =
|
|
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
|
-
},
|
|
4116
|
-
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
|
-
},
|
|
4141
|
+
}, Mc = $("#000000"), Nc = $("#ffffff"), Pc = t.object({
|
|
4132
4142
|
key: t.string(),
|
|
4133
|
-
color:
|
|
4143
|
+
color: Zs,
|
|
4134
4144
|
position: t.number(),
|
|
4135
4145
|
switched: t.boolean().optional()
|
|
4136
|
-
}),
|
|
4137
|
-
if (e.length === 0) return
|
|
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
|
-
},
|
|
4164
|
+
}, Lc = t.object({
|
|
4155
4165
|
key: t.string(),
|
|
4156
4166
|
name: t.string(),
|
|
4157
|
-
color:
|
|
4158
|
-
}),
|
|
4167
|
+
color: Qs
|
|
4168
|
+
}), Rc = t.object({
|
|
4159
4169
|
key: t.string(),
|
|
4160
4170
|
name: t.string(),
|
|
4161
|
-
swatches: t.array(
|
|
4162
|
-
}),
|
|
4163
|
-
BLACK: () =>
|
|
4164
|
-
WHITE: () =>
|
|
4165
|
-
ZERO: () =>
|
|
4166
|
-
aValue: () =>
|
|
4167
|
-
bValue: () =>
|
|
4168
|
-
colorZ: () =>
|
|
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: () =>
|
|
4171
|
-
crudeZ: () =>
|
|
4172
|
-
cssString: () =>
|
|
4173
|
-
equals: () =>
|
|
4174
|
-
fromCSS: () =>
|
|
4175
|
-
fromGradient: () =>
|
|
4176
|
-
fromHSLA: () =>
|
|
4177
|
-
gValue: () =>
|
|
4178
|
-
gradientZ: () =>
|
|
4179
|
-
grayness: () =>
|
|
4180
|
-
hex: () =>
|
|
4181
|
-
hsla: () =>
|
|
4182
|
-
isColor: () =>
|
|
4183
|
-
isCrude: () =>
|
|
4184
|
-
isDark: () =>
|
|
4185
|
-
isLight: () =>
|
|
4186
|
-
isZero: () =>
|
|
4187
|
-
luminance: () =>
|
|
4188
|
-
paletteZ: () =>
|
|
4189
|
-
pickByContrast: () =>
|
|
4190
|
-
rValue: () =>
|
|
4191
|
-
rgbCSS: () =>
|
|
4192
|
-
rgbString: () =>
|
|
4193
|
-
rgba1: () =>
|
|
4194
|
-
rgbaCSS: () =>
|
|
4195
|
-
setAlpha: () =>
|
|
4196
|
-
stopZ: () =>
|
|
4197
|
-
}),
|
|
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
|
-
}({}),
|
|
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
|
-
}),
|
|
4204
|
-
subject:
|
|
4213
|
+
}), Wc = (e) => t.object({
|
|
4214
|
+
subject: Uc,
|
|
4205
4215
|
resource: e,
|
|
4206
|
-
authority:
|
|
4207
|
-
}),
|
|
4216
|
+
authority: Bc
|
|
4217
|
+
}), Gc = {
|
|
4208
4218
|
lower: 0,
|
|
4209
4219
|
upper: 256
|
|
4210
|
-
},
|
|
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:
|
|
4219
|
-
}),
|
|
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:
|
|
4224
|
-
to:
|
|
4233
|
+
from: Wc(e),
|
|
4234
|
+
to: Wc(e)
|
|
4225
4235
|
})
|
|
4226
|
-
]),
|
|
4236
|
+
]), Xc = /* @__PURE__ */ r({
|
|
4227
4237
|
ABSOLUTE_AUTHORITY: () => 255,
|
|
4228
|
-
AUTHORITY_BOUNDS: () =>
|
|
4229
|
-
Concurrency: () =>
|
|
4238
|
+
AUTHORITY_BOUNDS: () => Gc,
|
|
4239
|
+
Concurrency: () => Vc,
|
|
4230
4240
|
ZERO_AUTHORITY: () => 0,
|
|
4231
|
-
acquireZ: () =>
|
|
4232
|
-
authorityZ: () =>
|
|
4233
|
-
concurrencyZ: () =>
|
|
4234
|
-
filterTransfersByChannelKey: () =>
|
|
4235
|
-
releaseZ: () =>
|
|
4236
|
-
stateZ: () =>
|
|
4237
|
-
subjectZ: () =>
|
|
4238
|
-
transferZ: () =>
|
|
4239
|
-
}),
|
|
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
|
|
4248
|
-
case "object": return e == null ? "" :
|
|
4257
|
+
case "function": return el(e.toString());
|
|
4258
|
+
case "object": return e == null ? "" : el(JSON.stringify(e));
|
|
4249
4259
|
}
|
|
4250
|
-
},
|
|
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 =
|
|
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
|
-
},
|
|
4271
|
-
ZERO_PRIMITIVES: () =>
|
|
4272
|
-
pointerZ: () =>
|
|
4273
|
-
primitiveTypeZ: () =>
|
|
4274
|
-
primitiveZ: () =>
|
|
4275
|
-
}),
|
|
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
|
-
]),
|
|
4290
|
+
]), cl = t.enum([
|
|
4281
4291
|
"string",
|
|
4282
4292
|
"number",
|
|
4283
4293
|
"boolean",
|
|
4284
4294
|
"null"
|
|
4285
|
-
]),
|
|
4295
|
+
]), ll = {
|
|
4286
4296
|
string: "",
|
|
4287
4297
|
number: 0,
|
|
4288
4298
|
boolean: !1,
|
|
4289
4299
|
null: null
|
|
4290
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
}), ml =
|
|
4330
|
-
|
|
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:
|
|
4333
|
-
}),
|
|
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
|
-
},
|
|
4337
|
-
compareSemVer: () =>
|
|
4338
|
-
createMigration: () =>
|
|
4339
|
-
migrator: () =>
|
|
4340
|
-
semVerNewer: () =>
|
|
4341
|
-
semVerOlder: () =>
|
|
4342
|
-
semVerZ: () =>
|
|
4343
|
-
versionsEqual: () =>
|
|
4344
|
-
}),
|
|
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
|
-
},
|
|
4373
|
+
}, El = ((e, t, n = {}) => {
|
|
4364
4374
|
n.checkMajor ??= !0, n.checkMinor ??= !0, n.checkPatch ??= !0;
|
|
4365
|
-
let r =
|
|
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 :
|
|
4379
|
-
}),
|
|
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
|
-
},
|
|
4387
|
-
let a = Object.keys(t).sort(
|
|
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 ||
|
|
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
|
-
},
|
|
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
|
-
},
|
|
4437
|
+
}, Nl = [
|
|
4428
4438
|
"standard",
|
|
4429
4439
|
"scientific",
|
|
4430
4440
|
"engineering"
|
|
4431
|
-
],
|
|
4432
|
-
NOTATIONS: () =>
|
|
4433
|
-
notationZ: () =>
|
|
4434
|
-
stringifyNumber: () =>
|
|
4435
|
-
}),
|
|
4436
|
-
BaseObserver: () =>
|
|
4437
|
-
Observer: () =>
|
|
4438
|
-
}),
|
|
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
|
-
},
|
|
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
|
-
},
|
|
4475
|
-
entries: () =>
|
|
4476
|
-
keyZ: () =>
|
|
4477
|
-
map: () =>
|
|
4478
|
-
nullishToEmpty: () =>
|
|
4479
|
-
omit: () =>
|
|
4480
|
-
purgeUndefined: () =>
|
|
4481
|
-
unknownZ: () =>
|
|
4482
|
-
}),
|
|
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
|
-
},
|
|
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
|
-
],
|
|
4500
|
+
], $l = [
|
|
4491
4501
|
"macos",
|
|
4492
4502
|
"windows",
|
|
4493
4503
|
"linux"
|
|
4494
|
-
],
|
|
4504
|
+
], eu = {
|
|
4495
4505
|
macos: "macOS",
|
|
4496
4506
|
windows: "Windows",
|
|
4497
4507
|
linux: "Linux"
|
|
4498
|
-
},
|
|
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
|
-
},
|
|
4514
|
+
}, ru, iu = ((e = {}) => {
|
|
4505
4515
|
let { force: t, default: n } = e;
|
|
4506
|
-
return t ??
|
|
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
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
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:
|
|
4520
|
-
}),
|
|
4521
|
-
if (!
|
|
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 =
|
|
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(
|
|
4534
|
-
|
|
4535
|
-
let n = {
|
|
4543
|
+
}).and(Ul()), mu = (e, t) => {
|
|
4544
|
+
let n = Me(e), r = {
|
|
4536
4545
|
variant: "error",
|
|
4537
|
-
message: t ??
|
|
4538
|
-
description: t == null ? void 0 :
|
|
4546
|
+
message: t ?? n.message,
|
|
4547
|
+
description: t == null ? void 0 : n.message,
|
|
4539
4548
|
details: {
|
|
4540
|
-
stack:
|
|
4541
|
-
error:
|
|
4549
|
+
stack: n.stack ?? "",
|
|
4550
|
+
error: n
|
|
4542
4551
|
}
|
|
4543
|
-
},
|
|
4544
|
-
return
|
|
4545
|
-
...
|
|
4546
|
-
...
|
|
4547
|
-
})), gu(
|
|
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:
|
|
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 &&
|
|
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(() =>
|
|
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:
|
|
4605
|
+
time: Lr.default(() => O.now()),
|
|
4597
4606
|
details: e ?? t.unknown().optional(),
|
|
4598
|
-
labels:
|
|
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 {
|
|
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 };
|