@arenarium/maps 1.0.206 → 1.0.208
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/main.cjs.js +1 -1
- package/dist/main.es.js +1040 -1050
- package/package.json +6 -6
package/dist/main.es.js
CHANGED
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var Cs = Object.defineProperty;
|
|
2
|
+
var Qr = (r) => {
|
|
3
3
|
throw TypeError(r);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var f = (r, e, t) =>
|
|
7
|
-
var k = (r, e, t) => (
|
|
8
|
-
var
|
|
9
|
-
function
|
|
5
|
+
var Ts = (r, e, t) => e in r ? Cs(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
6
|
+
var f = (r, e, t) => Ts(r, typeof e != "symbol" ? e + "" : e, t), nr = (r, e, t) => e.has(r) || Qr("Cannot " + t);
|
|
7
|
+
var k = (r, e, t) => (nr(r, e, "read from private field"), t ? t.call(r) : e.get(r)), D = (r, e, t) => e.has(r) ? Qr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), Z = (r, e, t, n) => (nr(r, e, "write to private field"), n ? n.call(r, t) : e.set(r, t), t), Ae = (r, e, t) => (nr(r, e, "access private method"), t);
|
|
8
|
+
var Mn = Array.isArray, Ms = Array.prototype.indexOf, As = Array.from, lr = Object.defineProperty, ft = Object.getOwnPropertyDescriptor, Os = Object.prototype, Ns = Array.prototype, Rs = Object.getPrototypeOf, en = Object.isExtensible;
|
|
9
|
+
function Is(r) {
|
|
10
10
|
for (var e = 0; e < r.length; e++)
|
|
11
11
|
r[e]();
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function Ps() {
|
|
14
14
|
var r, e, t = new Promise((n, s) => {
|
|
15
15
|
r = n, e = s;
|
|
16
16
|
});
|
|
17
17
|
return { promise: t, resolve: r, reject: e };
|
|
18
18
|
}
|
|
19
|
-
const
|
|
19
|
+
const X = 2, Ir = 4, An = 8, At = 16, Te = 32, Ze = 64, On = 128, K = 256, zt = 512, W = 1024, ue = 2048, Me = 4096, et = 8192, it = 16384, Pr = 32768, Ls = 65536, tn = 1 << 17, Ds = 1 << 18, Ot = 1 << 19, Zs = 1 << 20, ur = 1 << 21, Lr = 1 << 22, Ie = 1 << 23, Dt = Symbol("$state"), Dr = new class extends Error {
|
|
20
20
|
constructor() {
|
|
21
21
|
super(...arguments);
|
|
22
22
|
f(this, "name", "StaleReactionError");
|
|
23
23
|
f(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed");
|
|
24
24
|
}
|
|
25
25
|
}();
|
|
26
|
-
function
|
|
26
|
+
function js() {
|
|
27
27
|
throw new Error("https://svelte.dev/e/await_outside_boundary");
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function Fs() {
|
|
30
30
|
throw new Error("https://svelte.dev/e/async_derived_orphan");
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function zs(r) {
|
|
33
33
|
throw new Error("https://svelte.dev/e/effect_in_teardown");
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function Vs() {
|
|
36
36
|
throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function Us(r) {
|
|
39
39
|
throw new Error("https://svelte.dev/e/effect_orphan");
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function Bs() {
|
|
42
42
|
throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function $s() {
|
|
45
45
|
throw new Error("https://svelte.dev/e/state_descriptors_fixed");
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function qs() {
|
|
48
48
|
throw new Error("https://svelte.dev/e/state_prototype_fixed");
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function Ws() {
|
|
51
51
|
throw new Error("https://svelte.dev/e/state_unsafe_mutation");
|
|
52
52
|
}
|
|
53
|
-
const
|
|
54
|
-
function
|
|
53
|
+
const Hs = 2, j = Symbol();
|
|
54
|
+
function Nn(r) {
|
|
55
55
|
return r === this.v;
|
|
56
56
|
}
|
|
57
|
-
let
|
|
58
|
-
function
|
|
59
|
-
|
|
57
|
+
let se = null;
|
|
58
|
+
function Vt(r) {
|
|
59
|
+
se = r;
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
|
|
63
|
-
p:
|
|
61
|
+
function Zr(r, e = !1, t) {
|
|
62
|
+
se = {
|
|
63
|
+
p: se,
|
|
64
64
|
c: null,
|
|
65
65
|
e: null,
|
|
66
66
|
s: r,
|
|
@@ -68,37 +68,37 @@ function Dr(r, e = !1, t) {
|
|
|
68
68
|
l: null
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function jr(r) {
|
|
72
72
|
var e = (
|
|
73
73
|
/** @type {ComponentContext} */
|
|
74
|
-
|
|
74
|
+
se
|
|
75
75
|
), t = e.e;
|
|
76
76
|
if (t !== null) {
|
|
77
77
|
e.e = null;
|
|
78
78
|
for (var n of t)
|
|
79
|
-
|
|
79
|
+
Hn(n);
|
|
80
80
|
}
|
|
81
|
-
return r !== void 0 && (e.x = r),
|
|
81
|
+
return r !== void 0 && (e.x = r), se = e.p, r ?? /** @type {T} */
|
|
82
82
|
{};
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function Rn() {
|
|
85
85
|
return !0;
|
|
86
86
|
}
|
|
87
|
-
const
|
|
88
|
-
function
|
|
89
|
-
var e =
|
|
87
|
+
const Ys = /* @__PURE__ */ new WeakMap();
|
|
88
|
+
function Xs(r) {
|
|
89
|
+
var e = M;
|
|
90
90
|
if (e === null)
|
|
91
91
|
return S.f |= Ie, r;
|
|
92
|
-
if ((e.f &
|
|
93
|
-
if ((e.f &
|
|
94
|
-
throw !e.parent && r instanceof Error &&
|
|
92
|
+
if ((e.f & Pr) === 0) {
|
|
93
|
+
if ((e.f & On) === 0)
|
|
94
|
+
throw !e.parent && r instanceof Error && In(r), r;
|
|
95
95
|
e.b.error(r);
|
|
96
96
|
} else
|
|
97
|
-
|
|
97
|
+
Fr(r, e);
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function Fr(r, e) {
|
|
100
100
|
for (; e !== null; ) {
|
|
101
|
-
if ((e.f &
|
|
101
|
+
if ((e.f & On) !== 0)
|
|
102
102
|
try {
|
|
103
103
|
e.b.error(r);
|
|
104
104
|
return;
|
|
@@ -107,43 +107,43 @@ function jr(r, e) {
|
|
|
107
107
|
}
|
|
108
108
|
e = e.parent;
|
|
109
109
|
}
|
|
110
|
-
throw r instanceof Error &&
|
|
110
|
+
throw r instanceof Error && In(r), r;
|
|
111
111
|
}
|
|
112
|
-
function
|
|
113
|
-
const e =
|
|
114
|
-
e && (
|
|
112
|
+
function In(r) {
|
|
113
|
+
const e = Ys.get(r);
|
|
114
|
+
e && (lr(r, "message", {
|
|
115
115
|
value: e.message
|
|
116
|
-
}),
|
|
116
|
+
}), lr(r, "stack", {
|
|
117
117
|
value: e.stack
|
|
118
118
|
}));
|
|
119
119
|
}
|
|
120
|
-
let
|
|
121
|
-
function
|
|
122
|
-
var r =
|
|
123
|
-
|
|
120
|
+
let Ut = [];
|
|
121
|
+
function Gs() {
|
|
122
|
+
var r = Ut;
|
|
123
|
+
Ut = [], Is(r);
|
|
124
124
|
}
|
|
125
|
-
function
|
|
126
|
-
|
|
125
|
+
function Js(r) {
|
|
126
|
+
Ut.length === 0 && queueMicrotask(Gs), Ut.push(r);
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function Ks() {
|
|
129
129
|
for (var r = (
|
|
130
130
|
/** @type {Effect} */
|
|
131
|
-
|
|
131
|
+
M.b
|
|
132
132
|
); r !== null && !r.has_pending_snippet(); )
|
|
133
133
|
r = r.parent;
|
|
134
|
-
return r === null &&
|
|
134
|
+
return r === null && js(), r;
|
|
135
135
|
}
|
|
136
136
|
// @__NO_SIDE_EFFECTS__
|
|
137
|
-
function
|
|
138
|
-
var e =
|
|
137
|
+
function Qs(r) {
|
|
138
|
+
var e = X | ue, t = S !== null && (S.f & X) !== 0 ? (
|
|
139
139
|
/** @type {Derived} */
|
|
140
140
|
S
|
|
141
141
|
) : null;
|
|
142
|
-
return
|
|
143
|
-
ctx:
|
|
142
|
+
return M === null || t !== null && (t.f & K) !== 0 ? e |= K : M.f |= Ot, {
|
|
143
|
+
ctx: se,
|
|
144
144
|
deps: null,
|
|
145
145
|
effects: null,
|
|
146
|
-
equals:
|
|
146
|
+
equals: Nn,
|
|
147
147
|
f: e,
|
|
148
148
|
fn: r,
|
|
149
149
|
reactions: null,
|
|
@@ -153,17 +153,17 @@ function Ks(r) {
|
|
|
153
153
|
j
|
|
154
154
|
),
|
|
155
155
|
wv: 0,
|
|
156
|
-
parent: t ??
|
|
156
|
+
parent: t ?? M,
|
|
157
157
|
ac: null
|
|
158
158
|
};
|
|
159
159
|
}
|
|
160
160
|
// @__NO_SIDE_EFFECTS__
|
|
161
|
-
function
|
|
161
|
+
function ea(r, e) {
|
|
162
162
|
let t = (
|
|
163
163
|
/** @type {Effect | null} */
|
|
164
|
-
|
|
164
|
+
M
|
|
165
165
|
);
|
|
166
|
-
t === null &&
|
|
166
|
+
t === null && Fs();
|
|
167
167
|
var n = (
|
|
168
168
|
/** @type {Boundary} */
|
|
169
169
|
t.b
|
|
@@ -171,13 +171,15 @@ function Qs(r, e) {
|
|
|
171
171
|
/** @type {Promise<V>} */
|
|
172
172
|
/** @type {unknown} */
|
|
173
173
|
void 0
|
|
174
|
-
), a =
|
|
174
|
+
), a = Fn(
|
|
175
175
|
/** @type {V} */
|
|
176
176
|
j
|
|
177
177
|
), i = null, o = !S;
|
|
178
|
-
return
|
|
178
|
+
return ha(() => {
|
|
179
179
|
try {
|
|
180
180
|
var l = r();
|
|
181
|
+
i && Promise.resolve(l).catch(() => {
|
|
182
|
+
});
|
|
181
183
|
} catch (m) {
|
|
182
184
|
l = Promise.reject(m);
|
|
183
185
|
}
|
|
@@ -185,11 +187,11 @@ function Qs(r, e) {
|
|
|
185
187
|
s = (i == null ? void 0 : i.then(u, u)) ?? Promise.resolve(l), i = s;
|
|
186
188
|
var d = (
|
|
187
189
|
/** @type {Batch} */
|
|
188
|
-
|
|
190
|
+
V
|
|
189
191
|
), p = n.pending;
|
|
190
192
|
o && (n.update_pending_count(1), p || d.increment());
|
|
191
193
|
const g = (m, y = void 0) => {
|
|
192
|
-
i = null, p || d.activate(), y ? y !==
|
|
194
|
+
i = null, p || d.activate(), y ? y !== Dr && (a.f |= Ie, fr(a, y)) : ((a.f & Ie) !== 0 && (a.f ^= Ie), fr(a, m)), o && (n.update_pending_count(-1), p || d.decrement()), Dn();
|
|
193
195
|
};
|
|
194
196
|
if (s.then(g, (m) => g(null, m || "unknown")), d)
|
|
195
197
|
return () => {
|
|
@@ -205,7 +207,7 @@ function Qs(r, e) {
|
|
|
205
207
|
u(s);
|
|
206
208
|
});
|
|
207
209
|
}
|
|
208
|
-
function
|
|
210
|
+
function Pn(r) {
|
|
209
211
|
var e = r.effects;
|
|
210
212
|
if (e !== null) {
|
|
211
213
|
r.effects = null;
|
|
@@ -216,9 +218,9 @@ function In(r) {
|
|
|
216
218
|
);
|
|
217
219
|
}
|
|
218
220
|
}
|
|
219
|
-
function
|
|
221
|
+
function ta(r) {
|
|
220
222
|
for (var e = r.parent; e !== null; ) {
|
|
221
|
-
if ((e.f &
|
|
223
|
+
if ((e.f & X) === 0)
|
|
222
224
|
return (
|
|
223
225
|
/** @type {Effect} */
|
|
224
226
|
e
|
|
@@ -227,71 +229,68 @@ function ea(r) {
|
|
|
227
229
|
}
|
|
228
230
|
return null;
|
|
229
231
|
}
|
|
230
|
-
function
|
|
231
|
-
var e, t =
|
|
232
|
-
|
|
232
|
+
function zr(r) {
|
|
233
|
+
var e, t = M;
|
|
234
|
+
Ee(ta(r));
|
|
233
235
|
try {
|
|
234
|
-
|
|
236
|
+
Pn(r), e = ns(r);
|
|
235
237
|
} finally {
|
|
236
|
-
|
|
238
|
+
Ee(t);
|
|
237
239
|
}
|
|
238
240
|
return e;
|
|
239
241
|
}
|
|
240
|
-
function
|
|
241
|
-
var e =
|
|
242
|
-
if (r.equals(e) || (r.v = e, r.wv =
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
var t = (ye || (r.f & J) !== 0) && r.deps !== null ? Te : $;
|
|
247
|
-
K(r, t);
|
|
248
|
-
}
|
|
242
|
+
function Ln(r) {
|
|
243
|
+
var e = zr(r);
|
|
244
|
+
if (r.equals(e) || (r.v = e, r.wv = ts()), !ot) {
|
|
245
|
+
var t = (we || (r.f & K) !== 0) && r.deps !== null ? Me : W;
|
|
246
|
+
Q(r, t);
|
|
247
|
+
}
|
|
249
248
|
}
|
|
250
|
-
function
|
|
251
|
-
const n =
|
|
249
|
+
function ra(r, e, t) {
|
|
250
|
+
const n = Qs;
|
|
252
251
|
if (e.length === 0) {
|
|
253
252
|
t(r.map(n));
|
|
254
253
|
return;
|
|
255
254
|
}
|
|
256
|
-
var s =
|
|
255
|
+
var s = V, a = (
|
|
257
256
|
/** @type {Effect} */
|
|
258
|
-
|
|
259
|
-
), i =
|
|
260
|
-
Promise.all(e.map((l) => /* @__PURE__ */
|
|
257
|
+
M
|
|
258
|
+
), i = na(), o = Ks();
|
|
259
|
+
Promise.all(e.map((l) => /* @__PURE__ */ ea(l))).then((l) => {
|
|
261
260
|
s == null || s.activate(), i();
|
|
262
261
|
try {
|
|
263
262
|
t([...r.map(n), ...l]);
|
|
264
263
|
} catch (u) {
|
|
265
|
-
(a.f & it) === 0 &&
|
|
264
|
+
(a.f & it) === 0 && Fr(u, a);
|
|
266
265
|
}
|
|
267
|
-
s == null || s.deactivate(),
|
|
266
|
+
s == null || s.deactivate(), Dn();
|
|
268
267
|
}).catch((l) => {
|
|
269
268
|
o.error(l);
|
|
270
269
|
});
|
|
271
270
|
}
|
|
272
|
-
function
|
|
273
|
-
var r =
|
|
271
|
+
function na() {
|
|
272
|
+
var r = M, e = S, t = se, n = V;
|
|
274
273
|
return function() {
|
|
275
|
-
|
|
274
|
+
Ee(r), de(e), Vt(t), n == null || n.activate();
|
|
276
275
|
};
|
|
277
276
|
}
|
|
278
|
-
function Ln() {
|
|
279
|
-
be(null), le(null), zt(null);
|
|
280
|
-
}
|
|
281
|
-
const ct = /* @__PURE__ */ new Set();
|
|
282
|
-
let U = null, ge = null, tn = /* @__PURE__ */ new Set(), Ut = [];
|
|
283
277
|
function Dn() {
|
|
278
|
+
Ee(null), de(null), Vt(null);
|
|
279
|
+
}
|
|
280
|
+
const sr = /* @__PURE__ */ new Set();
|
|
281
|
+
let V = null, rn = /* @__PURE__ */ new Set(), Bt = [];
|
|
282
|
+
function Zn() {
|
|
284
283
|
const r = (
|
|
285
284
|
/** @type {() => void} */
|
|
286
|
-
|
|
285
|
+
Bt.shift()
|
|
287
286
|
);
|
|
288
|
-
|
|
287
|
+
Bt.length > 0 && queueMicrotask(Zn), r();
|
|
289
288
|
}
|
|
290
|
-
let
|
|
291
|
-
var
|
|
292
|
-
const
|
|
289
|
+
let mt = [], Vr = null, dr = !1;
|
|
290
|
+
var bt, Ge, ge, Et, St, Oe, Je, Ne, ye, Ke, Ct, Tt, ne, jn, Zt, cr;
|
|
291
|
+
const Gt = class Gt {
|
|
293
292
|
constructor() {
|
|
294
|
-
|
|
293
|
+
D(this, ne);
|
|
295
294
|
/**
|
|
296
295
|
* The current values of any sources that are updated in this batch
|
|
297
296
|
* They keys of this map are identical to `this.#previous`
|
|
@@ -303,68 +302,68 @@ const Xt = class Xt {
|
|
|
303
302
|
* They keys of this map are identical to `this.#current`
|
|
304
303
|
* @type {Map<Source, any>}
|
|
305
304
|
*/
|
|
306
|
-
|
|
305
|
+
D(this, bt, /* @__PURE__ */ new Map());
|
|
307
306
|
/**
|
|
308
307
|
* When the batch is committed (and the DOM is updated), we need to remove old branches
|
|
309
308
|
* and append new ones by calling the functions added inside (if/each/key/etc) blocks
|
|
310
309
|
* @type {Set<() => void>}
|
|
311
310
|
*/
|
|
312
|
-
|
|
311
|
+
D(this, Ge, /* @__PURE__ */ new Set());
|
|
313
312
|
/**
|
|
314
313
|
* The number of async effects that are currently in flight
|
|
315
314
|
*/
|
|
316
|
-
|
|
315
|
+
D(this, ge, 0);
|
|
317
316
|
/**
|
|
318
317
|
* A deferred that resolves when the batch is committed, used with `settled()`
|
|
319
318
|
* TODO replace with Promise.withResolvers once supported widely enough
|
|
320
319
|
* @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
|
|
321
320
|
*/
|
|
322
|
-
|
|
321
|
+
D(this, Et, null);
|
|
323
322
|
/**
|
|
324
323
|
* True if an async effect inside this batch resolved and
|
|
325
324
|
* its parent branch was already deleted
|
|
326
325
|
*/
|
|
327
|
-
|
|
326
|
+
D(this, St, !1);
|
|
328
327
|
/**
|
|
329
328
|
* Async effects (created inside `async_derived`) encountered during processing.
|
|
330
329
|
* These run after the rest of the batch has updated, since they should
|
|
331
330
|
* always have the latest values
|
|
332
331
|
* @type {Effect[]}
|
|
333
332
|
*/
|
|
334
|
-
|
|
333
|
+
D(this, Oe, []);
|
|
335
334
|
/**
|
|
336
335
|
* The same as `#async_effects`, but for effects inside a newly-created
|
|
337
336
|
* `<svelte:boundary>` — these do not prevent the batch from committing
|
|
338
337
|
* @type {Effect[]}
|
|
339
338
|
*/
|
|
340
|
-
|
|
339
|
+
D(this, Je, []);
|
|
341
340
|
/**
|
|
342
341
|
* Template effects and `$effect.pre` effects, which run when
|
|
343
342
|
* a batch is committed
|
|
344
343
|
* @type {Effect[]}
|
|
345
344
|
*/
|
|
346
|
-
|
|
345
|
+
D(this, Ne, []);
|
|
347
346
|
/**
|
|
348
347
|
* The same as `#render_effects`, but for `$effect` (which runs after)
|
|
349
348
|
* @type {Effect[]}
|
|
350
349
|
*/
|
|
351
|
-
|
|
350
|
+
D(this, ye, []);
|
|
352
351
|
/**
|
|
353
352
|
* Block effects, which may need to re-run on subsequent flushes
|
|
354
353
|
* in order to update internal sources (e.g. each block items)
|
|
355
354
|
* @type {Effect[]}
|
|
356
355
|
*/
|
|
357
|
-
|
|
356
|
+
D(this, Ke, []);
|
|
358
357
|
/**
|
|
359
358
|
* Deferred effects (which run after async work has completed) that are DIRTY
|
|
360
359
|
* @type {Effect[]}
|
|
361
360
|
*/
|
|
362
|
-
|
|
361
|
+
D(this, Ct, []);
|
|
363
362
|
/**
|
|
364
363
|
* Deferred effects that are MAYBE_DIRTY
|
|
365
364
|
* @type {Effect[]}
|
|
366
365
|
*/
|
|
367
|
-
|
|
366
|
+
D(this, Tt, []);
|
|
368
367
|
/**
|
|
369
368
|
* A set of branches that still exist, but will be destroyed when this batch
|
|
370
369
|
* is committed — we skip over these during `process`
|
|
@@ -377,35 +376,20 @@ const Xt = class Xt {
|
|
|
377
376
|
* @param {Effect[]} root_effects
|
|
378
377
|
*/
|
|
379
378
|
process(e) {
|
|
380
|
-
var
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
if (i !== this)
|
|
389
|
-
for (const [o, l] of k(i, Xe))
|
|
390
|
-
t.has(o) || (t.set(o, { v: o.v, wv: o.wv }), o.v = l);
|
|
391
|
-
}
|
|
392
|
-
for (const i of e)
|
|
393
|
-
Me(this, te, Zn).call(this, i);
|
|
394
|
-
if (k(this, Oe).length === 0 && k(this, ve) === 0) {
|
|
395
|
-
Me(this, te, ur).call(this);
|
|
396
|
-
var n = k(this, Ne), s = k(this, _e);
|
|
397
|
-
Z(this, Ne, []), Z(this, _e, []), Z(this, Ke, []), U = null, rn(n), rn(s), U === null ? U = this : ct.delete(this), (a = k(this, St)) == null || a.resolve();
|
|
379
|
+
var s;
|
|
380
|
+
mt = [];
|
|
381
|
+
for (const a of e)
|
|
382
|
+
Ae(this, ne, jn).call(this, a);
|
|
383
|
+
if (k(this, Oe).length === 0 && k(this, ge) === 0) {
|
|
384
|
+
Ae(this, ne, cr).call(this);
|
|
385
|
+
var t = k(this, Ne), n = k(this, ye);
|
|
386
|
+
Z(this, Ne, []), Z(this, ye, []), Z(this, Ke, []), V = null, nn(t), nn(n), V === null ? V = this : sr.delete(this), (s = k(this, Et)) == null || s.resolve();
|
|
398
387
|
} else
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
}
|
|
405
|
-
for (const i of k(this, Oe))
|
|
406
|
-
He(i);
|
|
407
|
-
for (const i of k(this, Je))
|
|
408
|
-
He(i);
|
|
388
|
+
Ae(this, ne, Zt).call(this, k(this, Ne)), Ae(this, ne, Zt).call(this, k(this, ye)), Ae(this, ne, Zt).call(this, k(this, Ke));
|
|
389
|
+
for (const a of k(this, Oe))
|
|
390
|
+
Ye(a);
|
|
391
|
+
for (const a of k(this, Je))
|
|
392
|
+
Ye(a);
|
|
409
393
|
Z(this, Oe, []), Z(this, Je, []);
|
|
410
394
|
}
|
|
411
395
|
/**
|
|
@@ -415,33 +399,33 @@ const Xt = class Xt {
|
|
|
415
399
|
* @param {any} value
|
|
416
400
|
*/
|
|
417
401
|
capture(e, t) {
|
|
418
|
-
k(this,
|
|
402
|
+
k(this, bt).has(e) || k(this, bt).set(e, t), this.current.set(e, e.v);
|
|
419
403
|
}
|
|
420
404
|
activate() {
|
|
421
|
-
|
|
405
|
+
V = this;
|
|
422
406
|
}
|
|
423
407
|
deactivate() {
|
|
424
|
-
|
|
425
|
-
for (const e of
|
|
426
|
-
if (
|
|
408
|
+
V = null;
|
|
409
|
+
for (const e of rn)
|
|
410
|
+
if (rn.delete(e), e(), V !== null)
|
|
427
411
|
break;
|
|
428
412
|
}
|
|
429
413
|
neuter() {
|
|
430
|
-
Z(this,
|
|
414
|
+
Z(this, St, !0);
|
|
431
415
|
}
|
|
432
416
|
flush() {
|
|
433
|
-
|
|
417
|
+
mt.length > 0 ? sa() : Ae(this, ne, cr).call(this), V === this && (k(this, ge) === 0 && sr.delete(this), this.deactivate());
|
|
434
418
|
}
|
|
435
419
|
increment() {
|
|
436
|
-
Z(this,
|
|
420
|
+
Z(this, ge, k(this, ge) + 1);
|
|
437
421
|
}
|
|
438
422
|
decrement() {
|
|
439
|
-
if (Z(this,
|
|
423
|
+
if (Z(this, ge, k(this, ge) - 1), k(this, ge) === 0) {
|
|
424
|
+
for (const e of k(this, Ct))
|
|
425
|
+
Q(e, ue), _t(e);
|
|
440
426
|
for (const e of k(this, Tt))
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
K(e, Te), yt(e);
|
|
444
|
-
Z(this, Ne, []), Z(this, _e, []), this.flush();
|
|
427
|
+
Q(e, Me), _t(e);
|
|
428
|
+
Z(this, Ne, []), Z(this, ye, []), this.flush();
|
|
445
429
|
} else
|
|
446
430
|
this.deactivate();
|
|
447
431
|
}
|
|
@@ -450,42 +434,42 @@ const Xt = class Xt {
|
|
|
450
434
|
k(this, Ge).add(e);
|
|
451
435
|
}
|
|
452
436
|
settled() {
|
|
453
|
-
return (k(this,
|
|
437
|
+
return (k(this, Et) ?? Z(this, Et, Ps())).promise;
|
|
454
438
|
}
|
|
455
439
|
static ensure() {
|
|
456
|
-
if (
|
|
457
|
-
const e =
|
|
458
|
-
|
|
459
|
-
|
|
440
|
+
if (V === null) {
|
|
441
|
+
const e = V = new Gt();
|
|
442
|
+
sr.add(V), Gt.enqueue(() => {
|
|
443
|
+
V === e && e.flush();
|
|
460
444
|
});
|
|
461
445
|
}
|
|
462
|
-
return
|
|
446
|
+
return V;
|
|
463
447
|
}
|
|
464
448
|
/** @param {() => void} task */
|
|
465
449
|
static enqueue(e) {
|
|
466
|
-
|
|
450
|
+
Bt.length === 0 && queueMicrotask(Zn), Bt.unshift(e);
|
|
467
451
|
}
|
|
468
452
|
};
|
|
469
|
-
|
|
453
|
+
bt = new WeakMap(), Ge = new WeakMap(), ge = new WeakMap(), Et = new WeakMap(), St = new WeakMap(), Oe = new WeakMap(), Je = new WeakMap(), Ne = new WeakMap(), ye = new WeakMap(), Ke = new WeakMap(), Ct = new WeakMap(), Tt = new WeakMap(), ne = new WeakSet(), /**
|
|
470
454
|
* Traverse the effect tree, executing effects or stashing
|
|
471
455
|
* them for later execution as appropriate
|
|
472
456
|
* @param {Effect} root
|
|
473
457
|
*/
|
|
474
|
-
|
|
458
|
+
jn = function(e) {
|
|
475
459
|
var d;
|
|
476
|
-
e.f ^=
|
|
460
|
+
e.f ^= W;
|
|
477
461
|
for (var t = e.first; t !== null; ) {
|
|
478
|
-
var n = t.f, s = (n & (
|
|
462
|
+
var n = t.f, s = (n & (Te | Ze)) !== 0, a = s && (n & W) !== 0, i = a || (n & et) !== 0 || this.skipped_effects.has(t);
|
|
479
463
|
if (!i && t.fn !== null) {
|
|
480
464
|
if (s)
|
|
481
|
-
t.f ^=
|
|
482
|
-
else if ((n &
|
|
483
|
-
k(this,
|
|
484
|
-
else if ((n &
|
|
485
|
-
if ((n &
|
|
465
|
+
t.f ^= W;
|
|
466
|
+
else if ((n & Ir) !== 0)
|
|
467
|
+
k(this, ye).push(t);
|
|
468
|
+
else if ((n & W) === 0)
|
|
469
|
+
if ((n & Lr) !== 0) {
|
|
486
470
|
var o = (d = t.b) != null && d.pending ? k(this, Je) : k(this, Oe);
|
|
487
471
|
o.push(t);
|
|
488
|
-
} else
|
|
472
|
+
} else Qt(t) && ((t.f & At) !== 0 && k(this, Ke).push(t), Ye(t));
|
|
489
473
|
var l = t.first;
|
|
490
474
|
if (l !== null) {
|
|
491
475
|
t = l;
|
|
@@ -499,146 +483,146 @@ Zn = function(e) {
|
|
|
499
483
|
}, /**
|
|
500
484
|
* @param {Effect[]} effects
|
|
501
485
|
*/
|
|
502
|
-
|
|
486
|
+
Zt = function(e) {
|
|
503
487
|
for (const t of e)
|
|
504
|
-
((t.f &
|
|
488
|
+
((t.f & ue) !== 0 ? k(this, Ct) : k(this, Tt)).push(t), Q(t, W);
|
|
505
489
|
e.length = 0;
|
|
506
490
|
}, /**
|
|
507
491
|
* Append and remove branches to/from the DOM
|
|
508
492
|
*/
|
|
509
|
-
|
|
510
|
-
if (!k(this,
|
|
493
|
+
cr = function() {
|
|
494
|
+
if (!k(this, St))
|
|
511
495
|
for (const e of k(this, Ge))
|
|
512
496
|
e();
|
|
513
497
|
k(this, Ge).clear();
|
|
514
498
|
};
|
|
515
|
-
let
|
|
516
|
-
function
|
|
517
|
-
var r =
|
|
518
|
-
|
|
499
|
+
let vt = Gt;
|
|
500
|
+
function sa() {
|
|
501
|
+
var r = He;
|
|
502
|
+
dr = !0;
|
|
519
503
|
try {
|
|
520
504
|
var e = 0;
|
|
521
|
-
for (
|
|
522
|
-
var t =
|
|
505
|
+
for (an(!0); mt.length > 0; ) {
|
|
506
|
+
var t = vt.ensure();
|
|
523
507
|
if (e++ > 1e3) {
|
|
524
508
|
var n, s;
|
|
525
|
-
|
|
509
|
+
aa();
|
|
526
510
|
}
|
|
527
|
-
t.process(
|
|
511
|
+
t.process(mt), ke.clear();
|
|
528
512
|
}
|
|
529
513
|
} finally {
|
|
530
|
-
|
|
514
|
+
dr = !1, an(r), Vr = null;
|
|
531
515
|
}
|
|
532
516
|
}
|
|
533
|
-
function
|
|
517
|
+
function aa() {
|
|
534
518
|
try {
|
|
535
|
-
|
|
519
|
+
Bs();
|
|
536
520
|
} catch (r) {
|
|
537
|
-
|
|
521
|
+
Fr(r, Vr);
|
|
538
522
|
}
|
|
539
523
|
}
|
|
540
|
-
let
|
|
541
|
-
function
|
|
524
|
+
let fe = null;
|
|
525
|
+
function nn(r) {
|
|
542
526
|
var e = r.length;
|
|
543
527
|
if (e !== 0) {
|
|
544
528
|
for (var t = 0; t < e; ) {
|
|
545
529
|
var n = r[t++];
|
|
546
|
-
if ((n.f & (it | et)) === 0 &&
|
|
547
|
-
|
|
548
|
-
for (const s of
|
|
549
|
-
|
|
550
|
-
|
|
530
|
+
if ((n.f & (it | et)) === 0 && Qt(n) && (fe = [], Ye(n), n.deps === null && n.first === null && n.nodes_start === null && (n.teardown === null && n.ac === null ? Kn(n) : n.fn = null), (fe == null ? void 0 : fe.length) > 0)) {
|
|
531
|
+
ke.clear();
|
|
532
|
+
for (const s of fe)
|
|
533
|
+
Ye(s);
|
|
534
|
+
fe = [];
|
|
551
535
|
}
|
|
552
536
|
}
|
|
553
|
-
|
|
537
|
+
fe = null;
|
|
554
538
|
}
|
|
555
539
|
}
|
|
556
|
-
function
|
|
557
|
-
for (var e =
|
|
540
|
+
function _t(r) {
|
|
541
|
+
for (var e = Vr = r; e.parent !== null; ) {
|
|
558
542
|
e = e.parent;
|
|
559
543
|
var t = e.f;
|
|
560
|
-
if (
|
|
544
|
+
if (dr && e === M && (t & At) !== 0)
|
|
561
545
|
return;
|
|
562
|
-
if ((t & (Ze |
|
|
563
|
-
if ((t &
|
|
564
|
-
e.f ^=
|
|
546
|
+
if ((t & (Ze | Te)) !== 0) {
|
|
547
|
+
if ((t & W) === 0) return;
|
|
548
|
+
e.f ^= W;
|
|
565
549
|
}
|
|
566
550
|
}
|
|
567
|
-
|
|
551
|
+
mt.push(e);
|
|
568
552
|
}
|
|
569
|
-
const
|
|
570
|
-
function
|
|
553
|
+
const ke = /* @__PURE__ */ new Map();
|
|
554
|
+
function Fn(r, e) {
|
|
571
555
|
var t = {
|
|
572
556
|
f: 0,
|
|
573
557
|
// TODO ideally we could skip this altogether, but it causes type errors
|
|
574
558
|
v: r,
|
|
575
559
|
reactions: null,
|
|
576
|
-
equals:
|
|
560
|
+
equals: Nn,
|
|
577
561
|
rv: 0,
|
|
578
562
|
wv: 0
|
|
579
563
|
};
|
|
580
564
|
return t;
|
|
581
565
|
}
|
|
582
566
|
// @__NO_SIDE_EFFECTS__
|
|
583
|
-
function
|
|
584
|
-
const t =
|
|
585
|
-
return
|
|
567
|
+
function U(r, e) {
|
|
568
|
+
const t = Fn(r);
|
|
569
|
+
return ya(t), t;
|
|
586
570
|
}
|
|
587
|
-
function
|
|
571
|
+
function F(r, e, t = !1) {
|
|
588
572
|
S !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
|
|
589
573
|
// to ensure we error if state is set inside an inspect effect
|
|
590
|
-
(!
|
|
591
|
-
let n = t ?
|
|
592
|
-
return
|
|
574
|
+
(!ie || (S.f & tn) !== 0) && Rn() && (S.f & (X | At | Lr | tn)) !== 0 && !($ != null && $.includes(r)) && Ws();
|
|
575
|
+
let n = t ? dt(e) : e;
|
|
576
|
+
return fr(r, n);
|
|
593
577
|
}
|
|
594
|
-
function
|
|
578
|
+
function fr(r, e) {
|
|
595
579
|
if (!r.equals(e)) {
|
|
596
580
|
var t = r.v;
|
|
597
|
-
ot ?
|
|
598
|
-
var n =
|
|
599
|
-
n.capture(r, t), (r.f &
|
|
581
|
+
ot ? ke.set(r, e) : ke.set(r, t), r.v = e;
|
|
582
|
+
var n = vt.ensure();
|
|
583
|
+
n.capture(r, t), (r.f & X) !== 0 && ((r.f & ue) !== 0 && zr(
|
|
600
584
|
/** @type {Derived} */
|
|
601
585
|
r
|
|
602
|
-
),
|
|
586
|
+
), Q(r, (r.f & K) === 0 ? W : Me)), r.wv = ts(), zn(r, ue), M !== null && (M.f & W) !== 0 && (M.f & (Te | Ze)) === 0 && (J === null ? wa([r]) : J.push(r));
|
|
603
587
|
}
|
|
604
588
|
return e;
|
|
605
589
|
}
|
|
606
|
-
function
|
|
607
|
-
|
|
590
|
+
function ar(r) {
|
|
591
|
+
F(r, r.v + 1);
|
|
608
592
|
}
|
|
609
|
-
function
|
|
593
|
+
function zn(r, e) {
|
|
610
594
|
var t = r.reactions;
|
|
611
595
|
if (t !== null)
|
|
612
596
|
for (var n = t.length, s = 0; s < n; s++) {
|
|
613
|
-
var a = t[s], i = a.f, o = (i &
|
|
614
|
-
o &&
|
|
597
|
+
var a = t[s], i = a.f, o = (i & ue) === 0;
|
|
598
|
+
o && Q(a, e), (i & X) !== 0 ? zn(
|
|
615
599
|
/** @type {Derived} */
|
|
616
600
|
a,
|
|
617
|
-
|
|
618
|
-
) : o && ((i &
|
|
601
|
+
Me
|
|
602
|
+
) : o && ((i & At) !== 0 && fe !== null && fe.push(
|
|
619
603
|
/** @type {Effect} */
|
|
620
604
|
a
|
|
621
|
-
),
|
|
605
|
+
), _t(
|
|
622
606
|
/** @type {Effect} */
|
|
623
607
|
a
|
|
624
608
|
));
|
|
625
609
|
}
|
|
626
610
|
}
|
|
627
|
-
function
|
|
628
|
-
if (typeof r != "object" || r === null ||
|
|
611
|
+
function dt(r) {
|
|
612
|
+
if (typeof r != "object" || r === null || Dt in r)
|
|
629
613
|
return r;
|
|
630
|
-
const e =
|
|
631
|
-
if (e !==
|
|
614
|
+
const e = Rs(r);
|
|
615
|
+
if (e !== Os && e !== Ns)
|
|
632
616
|
return r;
|
|
633
|
-
var t = /* @__PURE__ */ new Map(), n =
|
|
617
|
+
var t = /* @__PURE__ */ new Map(), n = Mn(r), s = /* @__PURE__ */ U(0), a = Pe, i = (o) => {
|
|
634
618
|
if (Pe === a)
|
|
635
619
|
return o();
|
|
636
620
|
var l = S, u = Pe;
|
|
637
|
-
|
|
621
|
+
de(null), ln(a);
|
|
638
622
|
var d = o();
|
|
639
|
-
return
|
|
623
|
+
return de(l), ln(u), d;
|
|
640
624
|
};
|
|
641
|
-
return n && t.set("length", /* @__PURE__ */
|
|
625
|
+
return n && t.set("length", /* @__PURE__ */ U(
|
|
642
626
|
/** @type {any[]} */
|
|
643
627
|
r.length
|
|
644
628
|
)), new Proxy(
|
|
@@ -646,34 +630,34 @@ function ft(r) {
|
|
|
646
630
|
r,
|
|
647
631
|
{
|
|
648
632
|
defineProperty(o, l, u) {
|
|
649
|
-
(!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) &&
|
|
633
|
+
(!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && $s();
|
|
650
634
|
var d = t.get(l);
|
|
651
635
|
return d === void 0 ? d = i(() => {
|
|
652
|
-
var p = /* @__PURE__ */
|
|
636
|
+
var p = /* @__PURE__ */ U(u.value);
|
|
653
637
|
return t.set(l, p), p;
|
|
654
|
-
}) :
|
|
638
|
+
}) : F(d, u.value, !0), !0;
|
|
655
639
|
},
|
|
656
640
|
deleteProperty(o, l) {
|
|
657
641
|
var u = t.get(l);
|
|
658
642
|
if (u === void 0) {
|
|
659
643
|
if (l in o) {
|
|
660
|
-
const d = i(() => /* @__PURE__ */
|
|
661
|
-
t.set(l, d),
|
|
644
|
+
const d = i(() => /* @__PURE__ */ U(j));
|
|
645
|
+
t.set(l, d), ar(s);
|
|
662
646
|
}
|
|
663
647
|
} else
|
|
664
|
-
|
|
648
|
+
F(u, j), ar(s);
|
|
665
649
|
return !0;
|
|
666
650
|
},
|
|
667
651
|
get(o, l, u) {
|
|
668
652
|
var m;
|
|
669
|
-
if (l ===
|
|
653
|
+
if (l === Dt)
|
|
670
654
|
return r;
|
|
671
655
|
var d = t.get(l), p = l in o;
|
|
672
|
-
if (d === void 0 && (!p || (m =
|
|
673
|
-
var y =
|
|
674
|
-
return
|
|
656
|
+
if (d === void 0 && (!p || (m = ft(o, l)) != null && m.writable) && (d = i(() => {
|
|
657
|
+
var y = dt(p ? o[l] : j), P = /* @__PURE__ */ U(y);
|
|
658
|
+
return P;
|
|
675
659
|
}), t.set(l, d)), d !== void 0) {
|
|
676
|
-
var g =
|
|
660
|
+
var g = R(d);
|
|
677
661
|
return g === j ? void 0 : g;
|
|
678
662
|
}
|
|
679
663
|
return Reflect.get(o, l, u);
|
|
@@ -682,7 +666,7 @@ function ft(r) {
|
|
|
682
666
|
var u = Reflect.getOwnPropertyDescriptor(o, l);
|
|
683
667
|
if (u && "value" in u) {
|
|
684
668
|
var d = t.get(l);
|
|
685
|
-
d && (u.value =
|
|
669
|
+
d && (u.value = R(d));
|
|
686
670
|
} else if (u === void 0) {
|
|
687
671
|
var p = t.get(l), g = p == null ? void 0 : p.v;
|
|
688
672
|
if (p !== void 0 && g !== j)
|
|
@@ -697,51 +681,51 @@ function ft(r) {
|
|
|
697
681
|
},
|
|
698
682
|
has(o, l) {
|
|
699
683
|
var g;
|
|
700
|
-
if (l ===
|
|
684
|
+
if (l === Dt)
|
|
701
685
|
return !0;
|
|
702
686
|
var u = t.get(l), d = u !== void 0 && u.v !== j || Reflect.has(o, l);
|
|
703
|
-
if (u !== void 0 ||
|
|
687
|
+
if (u !== void 0 || M !== null && (!d || (g = ft(o, l)) != null && g.writable)) {
|
|
704
688
|
u === void 0 && (u = i(() => {
|
|
705
|
-
var m = d ?
|
|
689
|
+
var m = d ? dt(o[l]) : j, y = /* @__PURE__ */ U(m);
|
|
706
690
|
return y;
|
|
707
691
|
}), t.set(l, u));
|
|
708
|
-
var p =
|
|
692
|
+
var p = R(u);
|
|
709
693
|
if (p === j)
|
|
710
694
|
return !1;
|
|
711
695
|
}
|
|
712
696
|
return d;
|
|
713
697
|
},
|
|
714
698
|
set(o, l, u, d) {
|
|
715
|
-
var
|
|
699
|
+
var q;
|
|
716
700
|
var p = t.get(l), g = l in o;
|
|
717
701
|
if (n && l === "length")
|
|
718
702
|
for (var m = u; m < /** @type {Source<number>} */
|
|
719
703
|
p.v; m += 1) {
|
|
720
704
|
var y = t.get(m + "");
|
|
721
|
-
y !== void 0 ?
|
|
705
|
+
y !== void 0 ? F(y, j) : m in o && (y = i(() => /* @__PURE__ */ U(j)), t.set(m + "", y));
|
|
722
706
|
}
|
|
723
707
|
if (p === void 0)
|
|
724
|
-
(!g || (
|
|
708
|
+
(!g || (q = ft(o, l)) != null && q.writable) && (p = i(() => /* @__PURE__ */ U(void 0)), F(p, dt(u)), t.set(l, p));
|
|
725
709
|
else {
|
|
726
710
|
g = p.v !== j;
|
|
727
|
-
var
|
|
728
|
-
|
|
711
|
+
var P = i(() => dt(u));
|
|
712
|
+
F(p, P);
|
|
729
713
|
}
|
|
730
|
-
var
|
|
731
|
-
if (
|
|
714
|
+
var z = Reflect.getOwnPropertyDescriptor(o, l);
|
|
715
|
+
if (z != null && z.set && z.set.call(d, u), !g) {
|
|
732
716
|
if (n && typeof l == "string") {
|
|
733
|
-
var
|
|
717
|
+
var te = (
|
|
734
718
|
/** @type {Source<number>} */
|
|
735
719
|
t.get("length")
|
|
736
|
-
),
|
|
737
|
-
Number.isInteger(
|
|
720
|
+
), A = Number(l);
|
|
721
|
+
Number.isInteger(A) && A >= te.v && F(te, A + 1);
|
|
738
722
|
}
|
|
739
|
-
|
|
723
|
+
ar(s);
|
|
740
724
|
}
|
|
741
725
|
return !0;
|
|
742
726
|
},
|
|
743
727
|
ownKeys(o) {
|
|
744
|
-
|
|
728
|
+
R(s);
|
|
745
729
|
var l = Reflect.ownKeys(o).filter((p) => {
|
|
746
730
|
var g = t.get(p);
|
|
747
731
|
return g === void 0 || g.v !== j;
|
|
@@ -751,65 +735,65 @@ function ft(r) {
|
|
|
751
735
|
return l;
|
|
752
736
|
},
|
|
753
737
|
setPrototypeOf() {
|
|
754
|
-
|
|
738
|
+
qs();
|
|
755
739
|
}
|
|
756
740
|
}
|
|
757
741
|
);
|
|
758
742
|
}
|
|
759
|
-
var
|
|
760
|
-
function
|
|
761
|
-
if (
|
|
762
|
-
|
|
743
|
+
var sn, Vn, Un, Bn;
|
|
744
|
+
function ia() {
|
|
745
|
+
if (sn === void 0) {
|
|
746
|
+
sn = window, Vn = /Firefox/.test(navigator.userAgent);
|
|
763
747
|
var r = Element.prototype, e = Node.prototype, t = Text.prototype;
|
|
764
|
-
|
|
748
|
+
Un = ft(e, "firstChild").get, Bn = ft(e, "nextSibling").get, en(r) && (r.__click = void 0, r.__className = void 0, r.__attributes = null, r.__style = void 0, r.__e = void 0), en(t) && (t.__t = void 0);
|
|
765
749
|
}
|
|
766
750
|
}
|
|
767
|
-
function
|
|
751
|
+
function oa(r = "") {
|
|
768
752
|
return document.createTextNode(r);
|
|
769
753
|
}
|
|
770
754
|
// @__NO_SIDE_EFFECTS__
|
|
771
|
-
function Bn(r) {
|
|
772
|
-
return Vn.call(r);
|
|
773
|
-
}
|
|
774
|
-
// @__NO_SIDE_EFFECTS__
|
|
775
755
|
function $n(r) {
|
|
776
756
|
return Un.call(r);
|
|
777
757
|
}
|
|
778
|
-
|
|
779
|
-
|
|
758
|
+
// @__NO_SIDE_EFFECTS__
|
|
759
|
+
function qn(r) {
|
|
760
|
+
return Bn.call(r);
|
|
780
761
|
}
|
|
781
|
-
function
|
|
762
|
+
function hr(r, e) {
|
|
763
|
+
return /* @__PURE__ */ $n(r);
|
|
764
|
+
}
|
|
765
|
+
function la(r, e = 1, t = !1) {
|
|
782
766
|
let n = r;
|
|
783
767
|
for (; e--; )
|
|
784
768
|
n = /** @type {TemplateNode} */
|
|
785
|
-
/* @__PURE__ */
|
|
769
|
+
/* @__PURE__ */ qn(n);
|
|
786
770
|
return n;
|
|
787
771
|
}
|
|
788
|
-
function
|
|
789
|
-
var e = S, t =
|
|
790
|
-
|
|
772
|
+
function Wn(r) {
|
|
773
|
+
var e = S, t = M;
|
|
774
|
+
de(null), Ee(null);
|
|
791
775
|
try {
|
|
792
776
|
return r();
|
|
793
777
|
} finally {
|
|
794
|
-
|
|
778
|
+
de(e), Ee(t);
|
|
795
779
|
}
|
|
796
780
|
}
|
|
797
|
-
function
|
|
798
|
-
|
|
781
|
+
function ua(r) {
|
|
782
|
+
M === null && S === null && Us(), S !== null && (S.f & K) !== 0 && M === null && Vs(), ot && zs();
|
|
799
783
|
}
|
|
800
|
-
function
|
|
784
|
+
function da(r, e) {
|
|
801
785
|
var t = e.last;
|
|
802
786
|
t === null ? e.last = e.first = r : (t.next = r, r.prev = t, e.last = r);
|
|
803
787
|
}
|
|
804
788
|
function je(r, e, t, n = !0) {
|
|
805
|
-
var s =
|
|
789
|
+
var s = M;
|
|
806
790
|
s !== null && (s.f & et) !== 0 && (r |= et);
|
|
807
791
|
var a = {
|
|
808
|
-
ctx:
|
|
792
|
+
ctx: se,
|
|
809
793
|
deps: null,
|
|
810
794
|
nodes_start: null,
|
|
811
795
|
nodes_end: null,
|
|
812
|
-
f: r |
|
|
796
|
+
f: r | ue,
|
|
813
797
|
first: null,
|
|
814
798
|
fn: e,
|
|
815
799
|
last: null,
|
|
@@ -824,129 +808,132 @@ function je(r, e, t, n = !0) {
|
|
|
824
808
|
};
|
|
825
809
|
if (t)
|
|
826
810
|
try {
|
|
827
|
-
|
|
811
|
+
Ye(a), a.f |= Pr;
|
|
828
812
|
} catch (l) {
|
|
829
813
|
throw De(a), l;
|
|
830
814
|
}
|
|
831
|
-
else e !== null &&
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
815
|
+
else e !== null && _t(a);
|
|
816
|
+
if (n) {
|
|
817
|
+
var i = a;
|
|
818
|
+
if (t && i.deps === null && i.teardown === null && i.nodes_start === null && i.first === i.last && // either `null`, or a singular child
|
|
819
|
+
(i.f & Ot) === 0 && (i = i.first), i !== null && (i.parent = s, s !== null && da(i, s), S !== null && (S.f & X) !== 0 && (r & Ze) === 0)) {
|
|
820
|
+
var o = (
|
|
821
|
+
/** @type {Derived} */
|
|
822
|
+
S
|
|
823
|
+
);
|
|
824
|
+
(o.effects ?? (o.effects = [])).push(i);
|
|
825
|
+
}
|
|
839
826
|
}
|
|
840
827
|
return a;
|
|
841
828
|
}
|
|
842
|
-
function
|
|
843
|
-
|
|
829
|
+
function ae(r) {
|
|
830
|
+
ua();
|
|
844
831
|
var e = (
|
|
845
832
|
/** @type {Effect} */
|
|
846
|
-
|
|
847
|
-
), t = !S && (e &
|
|
833
|
+
M.f
|
|
834
|
+
), t = !S && (e & Te) !== 0 && (e & Pr) === 0;
|
|
848
835
|
if (t) {
|
|
849
836
|
var n = (
|
|
850
837
|
/** @type {ComponentContext} */
|
|
851
|
-
|
|
838
|
+
se
|
|
852
839
|
);
|
|
853
840
|
(n.e ?? (n.e = [])).push(r);
|
|
854
841
|
} else
|
|
855
|
-
return
|
|
842
|
+
return Hn(r);
|
|
856
843
|
}
|
|
857
|
-
function
|
|
858
|
-
return je(
|
|
844
|
+
function Hn(r) {
|
|
845
|
+
return je(Ir | Zs, r, !1);
|
|
859
846
|
}
|
|
860
|
-
function
|
|
861
|
-
|
|
862
|
-
const e = je(Ze, r, !0);
|
|
847
|
+
function ca(r) {
|
|
848
|
+
vt.ensure();
|
|
849
|
+
const e = je(Ze | Ot, r, !0);
|
|
863
850
|
return (t = {}) => new Promise((n) => {
|
|
864
|
-
t.outro ?
|
|
851
|
+
t.outro ? _a(e, () => {
|
|
865
852
|
De(e), n(void 0);
|
|
866
853
|
}) : (De(e), n(void 0));
|
|
867
854
|
});
|
|
868
855
|
}
|
|
869
|
-
function ca(r) {
|
|
870
|
-
return je(Nr, r, !1);
|
|
871
|
-
}
|
|
872
856
|
function fa(r) {
|
|
873
|
-
return je(
|
|
857
|
+
return je(Ir, r, !1);
|
|
874
858
|
}
|
|
875
|
-
function
|
|
876
|
-
return je(
|
|
859
|
+
function ha(r) {
|
|
860
|
+
return je(Lr | Ot, r, !0);
|
|
877
861
|
}
|
|
878
|
-
function Yn(r, e =
|
|
879
|
-
|
|
880
|
-
|
|
862
|
+
function Yn(r, e = 0) {
|
|
863
|
+
return je(An | e, r, !0);
|
|
864
|
+
}
|
|
865
|
+
function Xn(r, e = [], t = []) {
|
|
866
|
+
ra(e, t, (n) => {
|
|
867
|
+
je(An, () => r(...n.map(R)), !0);
|
|
881
868
|
});
|
|
882
869
|
}
|
|
883
|
-
function
|
|
884
|
-
return je(
|
|
870
|
+
function pa(r, e = !0) {
|
|
871
|
+
return je(Te | Ot, r, !0, e);
|
|
885
872
|
}
|
|
886
|
-
function
|
|
873
|
+
function Gn(r) {
|
|
887
874
|
var e = r.teardown;
|
|
888
875
|
if (e !== null) {
|
|
889
876
|
const t = ot, n = S;
|
|
890
|
-
|
|
877
|
+
on(!0), de(null);
|
|
891
878
|
try {
|
|
892
879
|
e.call(null);
|
|
893
880
|
} finally {
|
|
894
|
-
|
|
881
|
+
on(t), de(n);
|
|
895
882
|
}
|
|
896
883
|
}
|
|
897
884
|
}
|
|
898
|
-
function
|
|
885
|
+
function Jn(r, e = !1) {
|
|
899
886
|
var t = r.first;
|
|
900
887
|
for (r.first = r.last = null; t !== null; ) {
|
|
901
888
|
const s = t.ac;
|
|
902
|
-
s !== null &&
|
|
903
|
-
s.abort(
|
|
889
|
+
s !== null && Wn(() => {
|
|
890
|
+
s.abort(Dr);
|
|
904
891
|
});
|
|
905
892
|
var n = t.next;
|
|
906
893
|
(t.f & Ze) !== 0 ? t.parent = null : De(t, e), t = n;
|
|
907
894
|
}
|
|
908
895
|
}
|
|
909
|
-
function
|
|
896
|
+
function ma(r) {
|
|
910
897
|
for (var e = r.first; e !== null; ) {
|
|
911
898
|
var t = e.next;
|
|
912
|
-
(e.f &
|
|
899
|
+
(e.f & Te) === 0 && De(e), e = t;
|
|
913
900
|
}
|
|
914
901
|
}
|
|
915
902
|
function De(r, e = !0) {
|
|
916
903
|
var t = !1;
|
|
917
|
-
(e || (r.f &
|
|
904
|
+
(e || (r.f & Ds) !== 0) && r.nodes_start !== null && r.nodes_end !== null && (va(
|
|
918
905
|
r.nodes_start,
|
|
919
906
|
/** @type {TemplateNode} */
|
|
920
907
|
r.nodes_end
|
|
921
|
-
), t = !0),
|
|
908
|
+
), t = !0), Jn(r, e && !t), $t(r, 0), Q(r, it);
|
|
922
909
|
var n = r.transitions;
|
|
923
910
|
if (n !== null)
|
|
924
911
|
for (const a of n)
|
|
925
912
|
a.stop();
|
|
926
|
-
|
|
913
|
+
Gn(r);
|
|
927
914
|
var s = r.parent;
|
|
928
|
-
s !== null && s.first !== null &&
|
|
915
|
+
s !== null && s.first !== null && Kn(r), r.next = r.prev = r.teardown = r.ctx = r.deps = r.fn = r.nodes_start = r.nodes_end = r.ac = null;
|
|
929
916
|
}
|
|
930
|
-
function
|
|
917
|
+
function va(r, e) {
|
|
931
918
|
for (; r !== null; ) {
|
|
932
919
|
var t = r === e ? null : (
|
|
933
920
|
/** @type {TemplateNode} */
|
|
934
|
-
/* @__PURE__ */
|
|
921
|
+
/* @__PURE__ */ qn(r)
|
|
935
922
|
);
|
|
936
923
|
r.remove(), r = t;
|
|
937
924
|
}
|
|
938
925
|
}
|
|
939
|
-
function
|
|
926
|
+
function Kn(r) {
|
|
940
927
|
var e = r.parent, t = r.prev, n = r.next;
|
|
941
928
|
t !== null && (t.next = n), n !== null && (n.prev = t), e !== null && (e.first === r && (e.first = n), e.last === r && (e.last = t));
|
|
942
929
|
}
|
|
943
|
-
function
|
|
930
|
+
function _a(r, e) {
|
|
944
931
|
var t = [];
|
|
945
|
-
|
|
932
|
+
Qn(r, t, !0), ga(t, () => {
|
|
946
933
|
De(r), e && e();
|
|
947
934
|
});
|
|
948
935
|
}
|
|
949
|
-
function
|
|
936
|
+
function ga(r, e) {
|
|
950
937
|
var t = r.length;
|
|
951
938
|
if (t > 0) {
|
|
952
939
|
var n = () => --t || e();
|
|
@@ -955,190 +942,190 @@ function _a(r, e) {
|
|
|
955
942
|
} else
|
|
956
943
|
e();
|
|
957
944
|
}
|
|
958
|
-
function
|
|
945
|
+
function Qn(r, e, t) {
|
|
959
946
|
if ((r.f & et) === 0) {
|
|
960
947
|
if (r.f ^= et, r.transitions !== null)
|
|
961
948
|
for (const i of r.transitions)
|
|
962
949
|
(i.is_global || t) && e.push(i);
|
|
963
950
|
for (var n = r.first; n !== null; ) {
|
|
964
|
-
var s = n.next, a = (n.f &
|
|
965
|
-
|
|
951
|
+
var s = n.next, a = (n.f & Ls) !== 0 || (n.f & Te) !== 0;
|
|
952
|
+
Qn(n, e, a ? t : !1), n = s;
|
|
966
953
|
}
|
|
967
954
|
}
|
|
968
955
|
}
|
|
969
|
-
let
|
|
970
|
-
function
|
|
971
|
-
|
|
956
|
+
let He = !1;
|
|
957
|
+
function an(r) {
|
|
958
|
+
He = r;
|
|
972
959
|
}
|
|
973
960
|
let ot = !1;
|
|
974
|
-
function
|
|
961
|
+
function on(r) {
|
|
975
962
|
ot = r;
|
|
976
963
|
}
|
|
977
|
-
let S = null,
|
|
978
|
-
function
|
|
964
|
+
let S = null, ie = !1;
|
|
965
|
+
function de(r) {
|
|
979
966
|
S = r;
|
|
980
967
|
}
|
|
981
|
-
let
|
|
982
|
-
function
|
|
983
|
-
|
|
984
|
-
}
|
|
985
|
-
let V = null;
|
|
986
|
-
function ga(r) {
|
|
987
|
-
S !== null && (V === null ? V = [r] : V.push(r));
|
|
968
|
+
let M = null;
|
|
969
|
+
function Ee(r) {
|
|
970
|
+
M = r;
|
|
988
971
|
}
|
|
989
|
-
let
|
|
972
|
+
let $ = null;
|
|
990
973
|
function ya(r) {
|
|
991
|
-
|
|
974
|
+
S !== null && ($ === null ? $ = [r] : $.push(r));
|
|
992
975
|
}
|
|
993
|
-
let
|
|
994
|
-
function
|
|
976
|
+
let B = null, Y = 0, J = null;
|
|
977
|
+
function wa(r) {
|
|
978
|
+
J = r;
|
|
979
|
+
}
|
|
980
|
+
let es = 1, gt = 0, Pe = gt;
|
|
981
|
+
function ln(r) {
|
|
995
982
|
Pe = r;
|
|
996
983
|
}
|
|
997
|
-
let
|
|
998
|
-
function
|
|
999
|
-
return ++
|
|
984
|
+
let we = !1;
|
|
985
|
+
function ts() {
|
|
986
|
+
return ++es;
|
|
1000
987
|
}
|
|
1001
|
-
function
|
|
988
|
+
function Qt(r) {
|
|
1002
989
|
var p;
|
|
1003
990
|
var e = r.f;
|
|
1004
|
-
if ((e &
|
|
991
|
+
if ((e & ue) !== 0)
|
|
1005
992
|
return !0;
|
|
1006
|
-
if ((e &
|
|
1007
|
-
var t = r.deps, n = (e &
|
|
993
|
+
if ((e & Me) !== 0) {
|
|
994
|
+
var t = r.deps, n = (e & K) !== 0;
|
|
1008
995
|
if (t !== null) {
|
|
1009
|
-
var s, a, i = (e &
|
|
1010
|
-
if ((i || o) && (
|
|
996
|
+
var s, a, i = (e & zt) !== 0, o = n && M !== null && !we, l = t.length;
|
|
997
|
+
if ((i || o) && (M === null || (M.f & it) === 0)) {
|
|
1011
998
|
var u = (
|
|
1012
999
|
/** @type {Derived} */
|
|
1013
1000
|
r
|
|
1014
1001
|
), d = u.parent;
|
|
1015
1002
|
for (s = 0; s < l; s++)
|
|
1016
1003
|
a = t[s], (i || !((p = a == null ? void 0 : a.reactions) != null && p.includes(u))) && (a.reactions ?? (a.reactions = [])).push(u);
|
|
1017
|
-
i && (u.f ^=
|
|
1004
|
+
i && (u.f ^= zt), o && d !== null && (d.f & K) === 0 && (u.f ^= K);
|
|
1018
1005
|
}
|
|
1019
1006
|
for (s = 0; s < l; s++)
|
|
1020
|
-
if (a = t[s],
|
|
1007
|
+
if (a = t[s], Qt(
|
|
1021
1008
|
/** @type {Derived} */
|
|
1022
1009
|
a
|
|
1023
|
-
) &&
|
|
1010
|
+
) && Ln(
|
|
1024
1011
|
/** @type {Derived} */
|
|
1025
1012
|
a
|
|
1026
1013
|
), a.wv > r.wv)
|
|
1027
1014
|
return !0;
|
|
1028
1015
|
}
|
|
1029
|
-
(!n ||
|
|
1016
|
+
(!n || M !== null && !we) && Q(r, W);
|
|
1030
1017
|
}
|
|
1031
1018
|
return !1;
|
|
1032
1019
|
}
|
|
1033
|
-
function
|
|
1020
|
+
function rs(r, e, t = !0) {
|
|
1034
1021
|
var n = r.reactions;
|
|
1035
|
-
if (n !== null && !(
|
|
1022
|
+
if (n !== null && !($ != null && $.includes(r)))
|
|
1036
1023
|
for (var s = 0; s < n.length; s++) {
|
|
1037
1024
|
var a = n[s];
|
|
1038
|
-
(a.f &
|
|
1025
|
+
(a.f & X) !== 0 ? rs(
|
|
1039
1026
|
/** @type {Derived} */
|
|
1040
1027
|
a,
|
|
1041
1028
|
e,
|
|
1042
1029
|
!1
|
|
1043
|
-
) : e === a && (t ?
|
|
1030
|
+
) : e === a && (t ? Q(a, ue) : (a.f & W) !== 0 && Q(a, Me), _t(
|
|
1044
1031
|
/** @type {Effect} */
|
|
1045
1032
|
a
|
|
1046
1033
|
));
|
|
1047
1034
|
}
|
|
1048
1035
|
}
|
|
1049
|
-
function
|
|
1050
|
-
var
|
|
1051
|
-
var e =
|
|
1052
|
-
|
|
1053
|
-
null,
|
|
1054
|
-
r.ac.abort(
|
|
1036
|
+
function ns(r) {
|
|
1037
|
+
var P;
|
|
1038
|
+
var e = B, t = Y, n = J, s = S, a = we, i = $, o = se, l = ie, u = Pe, d = r.f;
|
|
1039
|
+
B = /** @type {null | Value[]} */
|
|
1040
|
+
null, Y = 0, J = null, we = (d & K) !== 0 && (ie || !He || S === null), S = (d & (Te | Ze)) === 0 ? r : null, $ = null, Vt(r.ctx), ie = !1, Pe = ++gt, r.ac !== null && (Wn(() => {
|
|
1041
|
+
r.ac.abort(Dr);
|
|
1055
1042
|
}), r.ac = null);
|
|
1056
1043
|
try {
|
|
1057
|
-
r.f |=
|
|
1044
|
+
r.f |= ur;
|
|
1058
1045
|
var p = (
|
|
1059
1046
|
/** @type {Function} */
|
|
1060
1047
|
r.fn
|
|
1061
1048
|
), g = p(), m = r.deps;
|
|
1062
|
-
if (
|
|
1049
|
+
if (B !== null) {
|
|
1063
1050
|
var y;
|
|
1064
|
-
if (
|
|
1065
|
-
for (m.length =
|
|
1066
|
-
m[
|
|
1051
|
+
if ($t(r, Y), m !== null && Y > 0)
|
|
1052
|
+
for (m.length = Y + B.length, y = 0; y < B.length; y++)
|
|
1053
|
+
m[Y + y] = B[y];
|
|
1067
1054
|
else
|
|
1068
|
-
r.deps = m =
|
|
1069
|
-
if (!
|
|
1070
|
-
(d &
|
|
1055
|
+
r.deps = m = B;
|
|
1056
|
+
if (!we || // Deriveds that already have reactions can cleanup, so we still add them as reactions
|
|
1057
|
+
(d & X) !== 0 && /** @type {import('#client').Derived} */
|
|
1071
1058
|
r.reactions !== null)
|
|
1072
|
-
for (y =
|
|
1073
|
-
((
|
|
1074
|
-
} else m !== null &&
|
|
1075
|
-
if (
|
|
1059
|
+
for (y = Y; y < m.length; y++)
|
|
1060
|
+
((P = m[y]).reactions ?? (P.reactions = [])).push(r);
|
|
1061
|
+
} else m !== null && Y < m.length && ($t(r, Y), m.length = Y);
|
|
1062
|
+
if (Rn() && J !== null && !ie && m !== null && (r.f & (X | Me | ue)) === 0)
|
|
1076
1063
|
for (y = 0; y < /** @type {Source[]} */
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1064
|
+
J.length; y++)
|
|
1065
|
+
rs(
|
|
1066
|
+
J[y],
|
|
1080
1067
|
/** @type {Effect} */
|
|
1081
1068
|
r
|
|
1082
1069
|
);
|
|
1083
|
-
return s !== null && s !== r && (
|
|
1084
|
-
|
|
1085
|
-
} catch (
|
|
1086
|
-
return
|
|
1070
|
+
return s !== null && s !== r && (gt++, J !== null && (n === null ? n = J : n.push(.../** @type {Source[]} */
|
|
1071
|
+
J))), (r.f & Ie) !== 0 && (r.f ^= Ie), g;
|
|
1072
|
+
} catch (z) {
|
|
1073
|
+
return Xs(z);
|
|
1087
1074
|
} finally {
|
|
1088
|
-
r.f ^=
|
|
1075
|
+
r.f ^= ur, B = e, Y = t, J = n, S = s, we = a, $ = i, Vt(o), ie = l, Pe = u;
|
|
1089
1076
|
}
|
|
1090
1077
|
}
|
|
1091
|
-
function
|
|
1078
|
+
function xa(r, e) {
|
|
1092
1079
|
let t = e.reactions;
|
|
1093
1080
|
if (t !== null) {
|
|
1094
|
-
var n =
|
|
1081
|
+
var n = Ms.call(t, r);
|
|
1095
1082
|
if (n !== -1) {
|
|
1096
1083
|
var s = t.length - 1;
|
|
1097
1084
|
s === 0 ? t = e.reactions = null : (t[n] = t[s], t.pop());
|
|
1098
1085
|
}
|
|
1099
1086
|
}
|
|
1100
|
-
t === null && (e.f &
|
|
1087
|
+
t === null && (e.f & X) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
|
|
1101
1088
|
// to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
|
|
1102
1089
|
// allows us to skip the expensive work of disconnecting and immediately reconnecting it
|
|
1103
|
-
(
|
|
1090
|
+
(B === null || !B.includes(e)) && (Q(e, Me), (e.f & (K | zt)) === 0 && (e.f ^= zt), Pn(
|
|
1104
1091
|
/** @type {Derived} **/
|
|
1105
1092
|
e
|
|
1106
|
-
),
|
|
1093
|
+
), $t(
|
|
1107
1094
|
/** @type {Derived} **/
|
|
1108
1095
|
e,
|
|
1109
1096
|
0
|
|
1110
1097
|
));
|
|
1111
1098
|
}
|
|
1112
|
-
function
|
|
1099
|
+
function $t(r, e) {
|
|
1113
1100
|
var t = r.deps;
|
|
1114
1101
|
if (t !== null)
|
|
1115
1102
|
for (var n = e; n < t.length; n++)
|
|
1116
|
-
|
|
1103
|
+
xa(r, t[n]);
|
|
1117
1104
|
}
|
|
1118
|
-
function
|
|
1105
|
+
function Ye(r) {
|
|
1119
1106
|
var e = r.f;
|
|
1120
1107
|
if ((e & it) === 0) {
|
|
1121
|
-
|
|
1122
|
-
var t =
|
|
1123
|
-
|
|
1108
|
+
Q(r, W);
|
|
1109
|
+
var t = M, n = He;
|
|
1110
|
+
M = r, He = !0;
|
|
1124
1111
|
try {
|
|
1125
|
-
(e &
|
|
1126
|
-
var s =
|
|
1127
|
-
r.teardown = typeof s == "function" ? s : null, r.wv =
|
|
1112
|
+
(e & At) !== 0 ? ma(r) : Jn(r), Gn(r);
|
|
1113
|
+
var s = ns(r);
|
|
1114
|
+
r.teardown = typeof s == "function" ? s : null, r.wv = es;
|
|
1128
1115
|
var a;
|
|
1129
1116
|
} finally {
|
|
1130
|
-
|
|
1117
|
+
He = n, M = t;
|
|
1131
1118
|
}
|
|
1132
1119
|
}
|
|
1133
1120
|
}
|
|
1134
|
-
function
|
|
1135
|
-
var e = r.f, t = (e &
|
|
1136
|
-
if (S !== null && !
|
|
1137
|
-
var n =
|
|
1138
|
-
if (!n && !(
|
|
1121
|
+
function R(r) {
|
|
1122
|
+
var e = r.f, t = (e & X) !== 0;
|
|
1123
|
+
if (S !== null && !ie) {
|
|
1124
|
+
var n = M !== null && (M.f & it) !== 0;
|
|
1125
|
+
if (!n && !($ != null && $.includes(r))) {
|
|
1139
1126
|
var s = S.deps;
|
|
1140
|
-
if ((S.f &
|
|
1141
|
-
r.rv <
|
|
1127
|
+
if ((S.f & ur) !== 0)
|
|
1128
|
+
r.rv < gt && (r.rv = gt, B === null && s !== null && s[Y] === r ? Y++ : B === null ? B = [r] : (!we || !B.includes(r)) && B.push(r));
|
|
1142
1129
|
else {
|
|
1143
1130
|
(S.deps ?? (S.deps = [])).push(r);
|
|
1144
1131
|
var a = r.reactions;
|
|
@@ -1152,67 +1139,63 @@ function I(r) {
|
|
|
1152
1139
|
/** @type {Derived} */
|
|
1153
1140
|
r
|
|
1154
1141
|
), o = i.parent;
|
|
1155
|
-
o !== null && (o.f &
|
|
1142
|
+
o !== null && (o.f & K) === 0 && (i.f ^= K);
|
|
1156
1143
|
}
|
|
1157
1144
|
if (ot) {
|
|
1158
|
-
if (
|
|
1159
|
-
return
|
|
1145
|
+
if (ke.has(r))
|
|
1146
|
+
return ke.get(r);
|
|
1160
1147
|
if (t) {
|
|
1161
1148
|
i = /** @type {Derived} */
|
|
1162
1149
|
r;
|
|
1163
1150
|
var l = i.v;
|
|
1164
|
-
return ((i.f &
|
|
1151
|
+
return ((i.f & W) === 0 && i.reactions !== null || ss(i)) && (l = zr(i)), ke.set(i, l), l;
|
|
1165
1152
|
}
|
|
1166
|
-
} else
|
|
1167
|
-
|
|
1168
|
-
r, ge != null && ge.has(i))
|
|
1169
|
-
return ge.get(i);
|
|
1170
|
-
Kt(i) && Pn(i);
|
|
1171
|
-
}
|
|
1153
|
+
} else t && (i = /** @type {Derived} */
|
|
1154
|
+
r, Qt(i) && Ln(i));
|
|
1172
1155
|
if ((r.f & Ie) !== 0)
|
|
1173
1156
|
throw r.v;
|
|
1174
1157
|
return r.v;
|
|
1175
1158
|
}
|
|
1176
|
-
function
|
|
1159
|
+
function ss(r) {
|
|
1177
1160
|
if (r.v === j) return !0;
|
|
1178
1161
|
if (r.deps === null) return !1;
|
|
1179
1162
|
for (const e of r.deps)
|
|
1180
|
-
if (
|
|
1163
|
+
if (ke.has(e) || (e.f & X) !== 0 && ss(
|
|
1181
1164
|
/** @type {Derived} */
|
|
1182
1165
|
e
|
|
1183
1166
|
))
|
|
1184
1167
|
return !0;
|
|
1185
1168
|
return !1;
|
|
1186
1169
|
}
|
|
1187
|
-
function
|
|
1188
|
-
var e =
|
|
1170
|
+
function ka(r) {
|
|
1171
|
+
var e = ie;
|
|
1189
1172
|
try {
|
|
1190
|
-
return
|
|
1173
|
+
return ie = !0, r();
|
|
1191
1174
|
} finally {
|
|
1192
|
-
|
|
1175
|
+
ie = e;
|
|
1193
1176
|
}
|
|
1194
1177
|
}
|
|
1195
|
-
const
|
|
1196
|
-
function
|
|
1197
|
-
r.f = r.f &
|
|
1178
|
+
const ba = -7169;
|
|
1179
|
+
function Q(r, e) {
|
|
1180
|
+
r.f = r.f & ba | e;
|
|
1198
1181
|
}
|
|
1199
|
-
const
|
|
1200
|
-
function
|
|
1201
|
-
return
|
|
1182
|
+
const Ea = ["touchstart", "touchmove"];
|
|
1183
|
+
function Sa(r) {
|
|
1184
|
+
return Ea.includes(r);
|
|
1202
1185
|
}
|
|
1203
|
-
const
|
|
1204
|
-
let
|
|
1205
|
-
function
|
|
1206
|
-
var
|
|
1186
|
+
const Ca = /* @__PURE__ */ new Set(), un = /* @__PURE__ */ new Set();
|
|
1187
|
+
let dn = null;
|
|
1188
|
+
function Lt(r) {
|
|
1189
|
+
var A;
|
|
1207
1190
|
var e = this, t = (
|
|
1208
1191
|
/** @type {Node} */
|
|
1209
1192
|
e.ownerDocument
|
|
1210
|
-
), n = r.type, s = ((
|
|
1193
|
+
), n = r.type, s = ((A = r.composedPath) == null ? void 0 : A.call(r)) || [], a = (
|
|
1211
1194
|
/** @type {null | Element} */
|
|
1212
1195
|
s[0] || r.target
|
|
1213
1196
|
);
|
|
1214
|
-
|
|
1215
|
-
var i = 0, o =
|
|
1197
|
+
dn = r;
|
|
1198
|
+
var i = 0, o = dn === r && r.__root;
|
|
1216
1199
|
if (o) {
|
|
1217
1200
|
var l = s.indexOf(o);
|
|
1218
1201
|
if (l !== -1 && (e === document || e === /** @type {any} */
|
|
@@ -1227,165 +1210,165 @@ function Pt(r) {
|
|
|
1227
1210
|
}
|
|
1228
1211
|
if (a = /** @type {Element} */
|
|
1229
1212
|
s[i] || r.target, a !== e) {
|
|
1230
|
-
|
|
1213
|
+
lr(r, "currentTarget", {
|
|
1231
1214
|
configurable: !0,
|
|
1232
1215
|
get() {
|
|
1233
1216
|
return a || t;
|
|
1234
1217
|
}
|
|
1235
1218
|
});
|
|
1236
|
-
var d = S, p =
|
|
1237
|
-
|
|
1219
|
+
var d = S, p = M;
|
|
1220
|
+
de(null), Ee(null);
|
|
1238
1221
|
try {
|
|
1239
1222
|
for (var g, m = []; a !== null; ) {
|
|
1240
1223
|
var y = a.assignedSlot || a.parentNode || /** @type {any} */
|
|
1241
1224
|
a.host || null;
|
|
1242
1225
|
try {
|
|
1243
|
-
var
|
|
1244
|
-
if (
|
|
1226
|
+
var P = a["__" + n];
|
|
1227
|
+
if (P != null && (!/** @type {any} */
|
|
1245
1228
|
a.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
|
|
1246
1229
|
// -> the target could not have been disabled because it emits the event in the first place
|
|
1247
1230
|
r.target === a))
|
|
1248
|
-
if (
|
|
1249
|
-
var [
|
|
1250
|
-
|
|
1231
|
+
if (Mn(P)) {
|
|
1232
|
+
var [z, ...te] = P;
|
|
1233
|
+
z.apply(a, [r, ...te]);
|
|
1251
1234
|
} else
|
|
1252
|
-
|
|
1253
|
-
} catch (
|
|
1254
|
-
g ? m.push(
|
|
1235
|
+
P.call(a, r);
|
|
1236
|
+
} catch (q) {
|
|
1237
|
+
g ? m.push(q) : g = q;
|
|
1255
1238
|
}
|
|
1256
1239
|
if (r.cancelBubble || y === e || y === null)
|
|
1257
1240
|
break;
|
|
1258
1241
|
a = y;
|
|
1259
1242
|
}
|
|
1260
1243
|
if (g) {
|
|
1261
|
-
for (let
|
|
1244
|
+
for (let q of m)
|
|
1262
1245
|
queueMicrotask(() => {
|
|
1263
|
-
throw
|
|
1246
|
+
throw q;
|
|
1264
1247
|
});
|
|
1265
1248
|
throw g;
|
|
1266
1249
|
}
|
|
1267
1250
|
} finally {
|
|
1268
|
-
r.__root = e, delete r.currentTarget,
|
|
1251
|
+
r.__root = e, delete r.currentTarget, de(d), Ee(p);
|
|
1269
1252
|
}
|
|
1270
1253
|
}
|
|
1271
1254
|
}
|
|
1272
|
-
function
|
|
1255
|
+
function Ta(r) {
|
|
1273
1256
|
var e = document.createElement("template");
|
|
1274
1257
|
return e.innerHTML = r.replaceAll("<!>", "<!---->"), e.content;
|
|
1275
1258
|
}
|
|
1276
|
-
function
|
|
1259
|
+
function Ma(r, e) {
|
|
1277
1260
|
var t = (
|
|
1278
1261
|
/** @type {Effect} */
|
|
1279
|
-
|
|
1262
|
+
M
|
|
1280
1263
|
);
|
|
1281
1264
|
t.nodes_start === null && (t.nodes_start = r, t.nodes_end = e);
|
|
1282
1265
|
}
|
|
1283
1266
|
// @__NO_SIDE_EFFECTS__
|
|
1284
|
-
function
|
|
1285
|
-
var t = (e &
|
|
1267
|
+
function as(r, e) {
|
|
1268
|
+
var t = (e & Hs) !== 0, n, s = !r.startsWith("<!>");
|
|
1286
1269
|
return () => {
|
|
1287
|
-
n === void 0 && (n =
|
|
1288
|
-
/* @__PURE__ */
|
|
1270
|
+
n === void 0 && (n = Ta(s ? r : "<!>" + r), n = /** @type {Node} */
|
|
1271
|
+
/* @__PURE__ */ $n(n));
|
|
1289
1272
|
var a = (
|
|
1290
1273
|
/** @type {TemplateNode} */
|
|
1291
|
-
t ||
|
|
1274
|
+
t || Vn ? document.importNode(n, !0) : n.cloneNode(!0)
|
|
1292
1275
|
);
|
|
1293
|
-
return
|
|
1276
|
+
return Ma(a, a), a;
|
|
1294
1277
|
};
|
|
1295
1278
|
}
|
|
1296
|
-
function
|
|
1279
|
+
function is(r, e) {
|
|
1297
1280
|
r !== null && r.before(
|
|
1298
1281
|
/** @type {Node} */
|
|
1299
1282
|
e
|
|
1300
1283
|
);
|
|
1301
1284
|
}
|
|
1302
|
-
function
|
|
1303
|
-
return
|
|
1285
|
+
function Ur(r, e) {
|
|
1286
|
+
return Aa(r, e);
|
|
1304
1287
|
}
|
|
1305
|
-
const
|
|
1306
|
-
function
|
|
1307
|
-
|
|
1288
|
+
const Ve = /* @__PURE__ */ new Map();
|
|
1289
|
+
function Aa(r, { target: e, anchor: t, props: n = {}, events: s, context: a, intro: i = !0 }) {
|
|
1290
|
+
ia();
|
|
1308
1291
|
var o = /* @__PURE__ */ new Set(), l = (p) => {
|
|
1309
1292
|
for (var g = 0; g < p.length; g++) {
|
|
1310
1293
|
var m = p[g];
|
|
1311
1294
|
if (!o.has(m)) {
|
|
1312
1295
|
o.add(m);
|
|
1313
|
-
var y =
|
|
1314
|
-
e.addEventListener(m,
|
|
1315
|
-
var
|
|
1316
|
-
|
|
1296
|
+
var y = Sa(m);
|
|
1297
|
+
e.addEventListener(m, Lt, { passive: y });
|
|
1298
|
+
var P = Ve.get(m);
|
|
1299
|
+
P === void 0 ? (document.addEventListener(m, Lt, { passive: y }), Ve.set(m, 1)) : Ve.set(m, P + 1);
|
|
1317
1300
|
}
|
|
1318
1301
|
}
|
|
1319
1302
|
};
|
|
1320
|
-
l(
|
|
1321
|
-
var u = void 0, d =
|
|
1322
|
-
var p = t ?? e.appendChild(
|
|
1323
|
-
return
|
|
1303
|
+
l(As(Ca)), un.add(l);
|
|
1304
|
+
var u = void 0, d = ca(() => {
|
|
1305
|
+
var p = t ?? e.appendChild(oa());
|
|
1306
|
+
return pa(() => {
|
|
1324
1307
|
if (a) {
|
|
1325
|
-
|
|
1308
|
+
Zr({});
|
|
1326
1309
|
var g = (
|
|
1327
1310
|
/** @type {ComponentContext} */
|
|
1328
|
-
|
|
1311
|
+
se
|
|
1329
1312
|
);
|
|
1330
1313
|
g.c = a;
|
|
1331
1314
|
}
|
|
1332
|
-
s && (n.$$events = s), u = r(p, n) || {}, a &&
|
|
1315
|
+
s && (n.$$events = s), u = r(p, n) || {}, a && jr();
|
|
1333
1316
|
}), () => {
|
|
1334
1317
|
var y;
|
|
1335
1318
|
for (var g of o) {
|
|
1336
|
-
e.removeEventListener(g,
|
|
1319
|
+
e.removeEventListener(g, Lt);
|
|
1337
1320
|
var m = (
|
|
1338
1321
|
/** @type {number} */
|
|
1339
|
-
|
|
1322
|
+
Ve.get(g)
|
|
1340
1323
|
);
|
|
1341
|
-
--m === 0 ? (document.removeEventListener(g,
|
|
1324
|
+
--m === 0 ? (document.removeEventListener(g, Lt), Ve.delete(g)) : Ve.set(g, m);
|
|
1342
1325
|
}
|
|
1343
|
-
|
|
1326
|
+
un.delete(l), p !== t && ((y = p.parentNode) == null || y.removeChild(p));
|
|
1344
1327
|
};
|
|
1345
1328
|
});
|
|
1346
|
-
return
|
|
1329
|
+
return Oa.set(u, d), u;
|
|
1347
1330
|
}
|
|
1348
|
-
let
|
|
1349
|
-
function
|
|
1331
|
+
let Oa = /* @__PURE__ */ new WeakMap();
|
|
1332
|
+
function os(r) {
|
|
1350
1333
|
var e, t, n = "";
|
|
1351
1334
|
if (typeof r == "string" || typeof r == "number") n += r;
|
|
1352
1335
|
else if (typeof r == "object") if (Array.isArray(r)) {
|
|
1353
1336
|
var s = r.length;
|
|
1354
|
-
for (e = 0; e < s; e++) r[e] && (t =
|
|
1337
|
+
for (e = 0; e < s; e++) r[e] && (t = os(r[e])) && (n && (n += " "), n += t);
|
|
1355
1338
|
} else for (t in r) r[t] && (n && (n += " "), n += t);
|
|
1356
1339
|
return n;
|
|
1357
1340
|
}
|
|
1358
|
-
function
|
|
1359
|
-
for (var r, e, t = 0, n = "", s = arguments.length; t < s; t++) (r = arguments[t]) && (e =
|
|
1341
|
+
function Na() {
|
|
1342
|
+
for (var r, e, t = 0, n = "", s = arguments.length; t < s; t++) (r = arguments[t]) && (e = os(r)) && (n && (n += " "), n += e);
|
|
1360
1343
|
return n;
|
|
1361
1344
|
}
|
|
1362
|
-
function
|
|
1363
|
-
return typeof r == "object" ?
|
|
1345
|
+
function ls(r) {
|
|
1346
|
+
return typeof r == "object" ? Na(r) : r ?? "";
|
|
1364
1347
|
}
|
|
1365
|
-
function
|
|
1348
|
+
function Ra(r, e, t) {
|
|
1366
1349
|
var n = r == null ? "" : "" + r;
|
|
1367
1350
|
return e && (n = n ? n + " " + e : e), n === "" ? null : n;
|
|
1368
1351
|
}
|
|
1369
|
-
function
|
|
1352
|
+
function Ia(r, e) {
|
|
1370
1353
|
return r == null ? null : String(r);
|
|
1371
1354
|
}
|
|
1372
|
-
function
|
|
1355
|
+
function us(r, e, t, n, s, a) {
|
|
1373
1356
|
var i = r.__className;
|
|
1374
1357
|
if (i !== t || i === void 0) {
|
|
1375
|
-
var o =
|
|
1358
|
+
var o = Ra(t, n);
|
|
1376
1359
|
o == null ? r.removeAttribute("class") : r.className = o, r.__className = t;
|
|
1377
1360
|
}
|
|
1378
1361
|
return a;
|
|
1379
1362
|
}
|
|
1380
|
-
function
|
|
1363
|
+
function qt(r, e, t, n) {
|
|
1381
1364
|
var s = r.__style;
|
|
1382
1365
|
if (s !== e) {
|
|
1383
|
-
var a =
|
|
1366
|
+
var a = Ia(e);
|
|
1384
1367
|
a == null ? r.removeAttribute("style") : r.style.cssText = a, r.__style = e;
|
|
1385
1368
|
}
|
|
1386
1369
|
return n;
|
|
1387
1370
|
}
|
|
1388
|
-
const
|
|
1371
|
+
const Pa = () => performance.now(), oe = {
|
|
1389
1372
|
// don't access requestAnimationFrame eagerly outside method
|
|
1390
1373
|
// this allows basic testing of user code without JSDOM
|
|
1391
1374
|
// bunder will eval and remove ternary when the user's app is built
|
|
@@ -1393,65 +1376,65 @@ const Ia = () => performance.now(), ae = {
|
|
|
1393
1376
|
/** @param {any} _ */
|
|
1394
1377
|
(r) => requestAnimationFrame(r)
|
|
1395
1378
|
),
|
|
1396
|
-
now: () =>
|
|
1379
|
+
now: () => Pa(),
|
|
1397
1380
|
tasks: /* @__PURE__ */ new Set()
|
|
1398
1381
|
};
|
|
1399
|
-
function
|
|
1400
|
-
const r =
|
|
1401
|
-
|
|
1402
|
-
e.c(r) || (
|
|
1403
|
-
}),
|
|
1382
|
+
function ds() {
|
|
1383
|
+
const r = oe.now();
|
|
1384
|
+
oe.tasks.forEach((e) => {
|
|
1385
|
+
e.c(r) || (oe.tasks.delete(e), e.f());
|
|
1386
|
+
}), oe.tasks.size !== 0 && oe.tick(ds);
|
|
1404
1387
|
}
|
|
1405
|
-
function
|
|
1388
|
+
function La(r) {
|
|
1406
1389
|
let e;
|
|
1407
|
-
return
|
|
1390
|
+
return oe.tasks.size === 0 && oe.tick(ds), {
|
|
1408
1391
|
promise: new Promise((t) => {
|
|
1409
|
-
|
|
1392
|
+
oe.tasks.add(e = { c: r, f: t });
|
|
1410
1393
|
}),
|
|
1411
1394
|
abort() {
|
|
1412
|
-
|
|
1395
|
+
oe.tasks.delete(e);
|
|
1413
1396
|
}
|
|
1414
1397
|
};
|
|
1415
1398
|
}
|
|
1416
|
-
function
|
|
1417
|
-
return r === e || (r == null ? void 0 : r[
|
|
1399
|
+
function cn(r, e) {
|
|
1400
|
+
return r === e || (r == null ? void 0 : r[Dt]) === e;
|
|
1418
1401
|
}
|
|
1419
|
-
function
|
|
1420
|
-
return
|
|
1402
|
+
function Be(r = {}, e, t, n) {
|
|
1403
|
+
return fa(() => {
|
|
1421
1404
|
var s, a;
|
|
1422
|
-
return
|
|
1423
|
-
s = a, a = [],
|
|
1424
|
-
r !== t(...a) && (e(r, ...a), s &&
|
|
1405
|
+
return Yn(() => {
|
|
1406
|
+
s = a, a = [], ka(() => {
|
|
1407
|
+
r !== t(...a) && (e(r, ...a), s && cn(t(...s), r) && e(null, ...s));
|
|
1425
1408
|
});
|
|
1426
1409
|
}), () => {
|
|
1427
|
-
|
|
1428
|
-
a &&
|
|
1410
|
+
Js(() => {
|
|
1411
|
+
a && cn(t(...a), r) && e(null, ...a);
|
|
1429
1412
|
});
|
|
1430
1413
|
};
|
|
1431
1414
|
}), r;
|
|
1432
1415
|
}
|
|
1433
|
-
const
|
|
1434
|
-
var
|
|
1435
|
-
typeof window < "u" && ((
|
|
1436
|
-
function
|
|
1416
|
+
const Da = "5";
|
|
1417
|
+
var Tn;
|
|
1418
|
+
typeof window < "u" && ((Tn = window.__svelte ?? (window.__svelte = {})).v ?? (Tn.v = /* @__PURE__ */ new Set())).add(Da);
|
|
1419
|
+
function Za(r) {
|
|
1437
1420
|
return r;
|
|
1438
1421
|
}
|
|
1439
|
-
function
|
|
1422
|
+
function pr(r) {
|
|
1440
1423
|
return -0.5 * (Math.cos(Math.PI * r) - 1);
|
|
1441
1424
|
}
|
|
1442
|
-
function
|
|
1425
|
+
function ja(r) {
|
|
1443
1426
|
const e = Math.cos(r * Math.PI * 0.5);
|
|
1444
1427
|
return Math.abs(e) < 1e-14 ? 1 : 1 - e;
|
|
1445
1428
|
}
|
|
1446
|
-
function
|
|
1429
|
+
function Fa(r) {
|
|
1447
1430
|
return Math.sin(r * Math.PI / 2);
|
|
1448
1431
|
}
|
|
1449
|
-
const
|
|
1450
|
-
class
|
|
1432
|
+
const za = 128, Va = 0, Ua = 1, Ba = 2;
|
|
1433
|
+
class $a {
|
|
1451
1434
|
constructor() {
|
|
1452
1435
|
f(this, "animationsStarted", !1);
|
|
1453
1436
|
f(this, "animationsCount", 0);
|
|
1454
|
-
f(this, "animationsLimit",
|
|
1437
|
+
f(this, "animationsLimit", za);
|
|
1455
1438
|
f(this, "layers", new Array());
|
|
1456
1439
|
}
|
|
1457
1440
|
start() {
|
|
@@ -1508,11 +1491,11 @@ class Ba {
|
|
|
1508
1491
|
this.animationsLimit = e;
|
|
1509
1492
|
}
|
|
1510
1493
|
}
|
|
1511
|
-
const
|
|
1512
|
-
function
|
|
1494
|
+
const _e = new $a();
|
|
1495
|
+
function fn(r) {
|
|
1513
1496
|
return Object.prototype.toString.call(r) === "[object Date]";
|
|
1514
1497
|
}
|
|
1515
|
-
function
|
|
1498
|
+
function mr(r, e) {
|
|
1516
1499
|
if (r === e || r !== r) return () => r;
|
|
1517
1500
|
const t = typeof r;
|
|
1518
1501
|
if (t !== typeof e || Array.isArray(r) !== Array.isArray(e))
|
|
@@ -1520,7 +1503,7 @@ function hr(r, e) {
|
|
|
1520
1503
|
if (Array.isArray(r)) {
|
|
1521
1504
|
const n = (
|
|
1522
1505
|
/** @type {Array<any>} */
|
|
1523
|
-
e.map((s, a) =>
|
|
1506
|
+
e.map((s, a) => mr(
|
|
1524
1507
|
/** @type {Array<any>} */
|
|
1525
1508
|
r[a],
|
|
1526
1509
|
s
|
|
@@ -1531,13 +1514,13 @@ function hr(r, e) {
|
|
|
1531
1514
|
if (t === "object") {
|
|
1532
1515
|
if (!r || !e)
|
|
1533
1516
|
throw new Error("Object cannot be null");
|
|
1534
|
-
if (
|
|
1517
|
+
if (fn(r) && fn(e)) {
|
|
1535
1518
|
const a = r.getTime(), o = e.getTime() - a;
|
|
1536
1519
|
return (l) => new Date(a + l * o);
|
|
1537
1520
|
}
|
|
1538
1521
|
const n = Object.keys(e), s = {};
|
|
1539
1522
|
return n.forEach((a) => {
|
|
1540
|
-
s[a] =
|
|
1523
|
+
s[a] = mr(r[a], e[a]);
|
|
1541
1524
|
}), (a) => {
|
|
1542
1525
|
const i = {};
|
|
1543
1526
|
return n.forEach((o) => {
|
|
@@ -1555,20 +1538,20 @@ function hr(r, e) {
|
|
|
1555
1538
|
}
|
|
1556
1539
|
return () => e;
|
|
1557
1540
|
}
|
|
1558
|
-
var
|
|
1559
|
-
const
|
|
1541
|
+
var he, Qe, Mt, Re;
|
|
1542
|
+
const Hr = class Hr {
|
|
1560
1543
|
/**
|
|
1561
1544
|
* @param {T} value
|
|
1562
1545
|
* @param {TweenedOptions<T>} options
|
|
1563
1546
|
*/
|
|
1564
1547
|
constructor(e, t = {}) {
|
|
1565
|
-
|
|
1566
|
-
|
|
1548
|
+
D(this, he);
|
|
1549
|
+
D(this, Qe);
|
|
1567
1550
|
/** @type {TweenedOptions<T>} */
|
|
1568
|
-
|
|
1551
|
+
D(this, Mt);
|
|
1569
1552
|
/** @type {import('../internal/client/types').Task | null} */
|
|
1570
|
-
|
|
1571
|
-
Z(this,
|
|
1553
|
+
D(this, Re, null);
|
|
1554
|
+
Z(this, he, /* @__PURE__ */ U(e)), Z(this, Qe, /* @__PURE__ */ U(e)), Z(this, Mt, t);
|
|
1572
1555
|
}
|
|
1573
1556
|
/**
|
|
1574
1557
|
* Create a tween whose value is bound to the return value of `fn`. This must be called
|
|
@@ -1588,8 +1571,8 @@ const Wr = class Wr {
|
|
|
1588
1571
|
* @param {TweenedOptions<U>} [options]
|
|
1589
1572
|
*/
|
|
1590
1573
|
static of(e, t) {
|
|
1591
|
-
const n = new
|
|
1592
|
-
return
|
|
1574
|
+
const n = new Hr(e(), t);
|
|
1575
|
+
return Yn(() => {
|
|
1593
1576
|
n.set(e());
|
|
1594
1577
|
}), n;
|
|
1595
1578
|
}
|
|
@@ -1603,48 +1586,48 @@ const Wr = class Wr {
|
|
|
1603
1586
|
*/
|
|
1604
1587
|
set(e, t) {
|
|
1605
1588
|
var p;
|
|
1606
|
-
|
|
1589
|
+
F(k(this, Qe), e);
|
|
1607
1590
|
let {
|
|
1608
1591
|
delay: n = 0,
|
|
1609
1592
|
duration: s = 400,
|
|
1610
|
-
easing: a =
|
|
1611
|
-
interpolate: i =
|
|
1612
|
-
} = { ...k(this,
|
|
1593
|
+
easing: a = Za,
|
|
1594
|
+
interpolate: i = mr
|
|
1595
|
+
} = { ...k(this, Mt), ...t };
|
|
1613
1596
|
if (s === 0)
|
|
1614
|
-
return (p = k(this, Re)) == null || p.abort(),
|
|
1615
|
-
const o =
|
|
1597
|
+
return (p = k(this, Re)) == null || p.abort(), F(k(this, he), e), Promise.resolve();
|
|
1598
|
+
const o = oe.now() + n;
|
|
1616
1599
|
let l, u = !1, d = k(this, Re);
|
|
1617
|
-
return Z(this, Re,
|
|
1600
|
+
return Z(this, Re, La((g) => {
|
|
1618
1601
|
if (g < o)
|
|
1619
1602
|
return !0;
|
|
1620
1603
|
if (!u) {
|
|
1621
1604
|
u = !0;
|
|
1622
|
-
const y = k(this,
|
|
1605
|
+
const y = k(this, he).v;
|
|
1623
1606
|
l = i(y, e), typeof s == "function" && (s = s(y, e)), d == null || d.abort();
|
|
1624
1607
|
}
|
|
1625
1608
|
const m = g - o;
|
|
1626
1609
|
return m > /** @type {number} */
|
|
1627
|
-
s ? (
|
|
1610
|
+
s ? (F(k(this, he), e), !1) : (F(k(this, he), l(a(m / /** @type {number} */
|
|
1628
1611
|
s))), !0);
|
|
1629
1612
|
})), k(this, Re).promise;
|
|
1630
1613
|
}
|
|
1631
1614
|
get current() {
|
|
1632
|
-
return
|
|
1615
|
+
return R(k(this, he));
|
|
1633
1616
|
}
|
|
1634
1617
|
get target() {
|
|
1635
|
-
return
|
|
1618
|
+
return R(k(this, Qe));
|
|
1636
1619
|
}
|
|
1637
1620
|
set target(e) {
|
|
1638
1621
|
this.set(e);
|
|
1639
1622
|
}
|
|
1640
1623
|
};
|
|
1641
|
-
|
|
1642
|
-
let
|
|
1643
|
-
class
|
|
1624
|
+
he = new WeakMap(), Qe = new WeakMap(), Mt = new WeakMap(), Re = new WeakMap();
|
|
1625
|
+
let vr = Hr;
|
|
1626
|
+
class jt {
|
|
1644
1627
|
constructor(e, t) {
|
|
1645
1628
|
f(this, "value");
|
|
1646
1629
|
f(this, "motion");
|
|
1647
|
-
this.value = e, this.motion = new
|
|
1630
|
+
this.value = e, this.motion = new vr(e, t);
|
|
1648
1631
|
}
|
|
1649
1632
|
set(e, t) {
|
|
1650
1633
|
this.value = e, this.motion.set(e, t);
|
|
@@ -1656,60 +1639,67 @@ class Zt {
|
|
|
1656
1639
|
this.motion.set(this.value, { duration: 0 });
|
|
1657
1640
|
}
|
|
1658
1641
|
}
|
|
1659
|
-
var
|
|
1660
|
-
function
|
|
1661
|
-
|
|
1642
|
+
var qa = /* @__PURE__ */ as('<div><div class="body svelte-1nfn9j8"></div></div>');
|
|
1643
|
+
function Wa(r, e) {
|
|
1644
|
+
Zr(e, !0);
|
|
1662
1645
|
let t, n;
|
|
1663
1646
|
function s() {
|
|
1664
1647
|
return n;
|
|
1665
1648
|
}
|
|
1666
|
-
let a = /* @__PURE__ */
|
|
1667
|
-
function i(
|
|
1668
|
-
|
|
1649
|
+
let a = /* @__PURE__ */ U(!1);
|
|
1650
|
+
function i(N) {
|
|
1651
|
+
F(a, N, !0);
|
|
1669
1652
|
}
|
|
1670
1653
|
function o() {
|
|
1671
|
-
return
|
|
1672
|
-
}
|
|
1673
|
-
let l =
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
}
|
|
1677
|
-
|
|
1654
|
+
return R(a);
|
|
1655
|
+
}
|
|
1656
|
+
let l = /* @__PURE__ */ U(!0), u = 0, d = 150;
|
|
1657
|
+
function p(N) {
|
|
1658
|
+
N != R(l) && (F(l, N, !0), u = performance.now());
|
|
1659
|
+
}
|
|
1660
|
+
function g(N) {
|
|
1661
|
+
return N - u < d ? y.motion.current == 0 : y.value == 0;
|
|
1662
|
+
}
|
|
1663
|
+
let m = 0, y = new jt(0, { easing: pr });
|
|
1664
|
+
ae(() => {
|
|
1665
|
+
R(a) == !1 && (y.snap(), _e.clear(e.priority, e.id));
|
|
1666
|
+
}), ae(() => {
|
|
1667
|
+
y.set(R(l) ? 0 : m, { duration: 75 });
|
|
1668
|
+
}), ae(() => {
|
|
1669
|
+
P(y.motion.current);
|
|
1678
1670
|
});
|
|
1679
|
-
function
|
|
1680
|
-
t &&
|
|
1681
|
-
t.style.scale =
|
|
1671
|
+
function P(N) {
|
|
1672
|
+
t && _e.equeue(e.layer, e.priority, e.id, () => {
|
|
1673
|
+
t.style.scale = N.toString(), t.style.filter = `brightness(${0.25 + 0.75 * N})`, n.style.opacity = N.toString();
|
|
1682
1674
|
});
|
|
1683
1675
|
}
|
|
1684
|
-
function
|
|
1685
|
-
|
|
1686
|
-
}
|
|
1687
|
-
function p() {
|
|
1688
|
-
return l.motion.current == 0;
|
|
1676
|
+
function z(N) {
|
|
1677
|
+
N != m && (m = N, y.set(N, { duration: 75 }));
|
|
1689
1678
|
}
|
|
1690
|
-
function
|
|
1691
|
-
return
|
|
1679
|
+
function te() {
|
|
1680
|
+
return y.value;
|
|
1692
1681
|
}
|
|
1693
|
-
var
|
|
1694
|
-
return
|
|
1695
|
-
|
|
1696
|
-
(
|
|
1682
|
+
var A = qa(), q = hr(A);
|
|
1683
|
+
return Be(
|
|
1684
|
+
q,
|
|
1685
|
+
(N) => (
|
|
1697
1686
|
//#endregion
|
|
1698
|
-
n =
|
|
1687
|
+
n = N
|
|
1699
1688
|
),
|
|
1700
1689
|
() => n
|
|
1701
|
-
),
|
|
1702
|
-
|
|
1703
|
-
}),
|
|
1690
|
+
), Be(A, (N) => t = N, () => t), Xn(() => {
|
|
1691
|
+
us(A, 1, ls(["pin", R(a) && "displayed"]), "svelte-1nfn9j8"), qt(A, `width: ${e.width}px; height: ${e.height}px; border-radius: ${e.radius}px`), qt(q, `width: ${e.width - 4}px; height: ${e.height - 4}px; border-radius: ${e.radius - 2}px`);
|
|
1692
|
+
}), is(r, A), jr({
|
|
1704
1693
|
getBody: s,
|
|
1705
1694
|
setDisplayed: i,
|
|
1706
1695
|
getDisplayed: o,
|
|
1707
|
-
|
|
1708
|
-
getCollapsed:
|
|
1709
|
-
|
|
1696
|
+
setCollapsed: p,
|
|
1697
|
+
getCollapsed: g,
|
|
1698
|
+
setScale: z,
|
|
1699
|
+
getScale: te
|
|
1710
1700
|
});
|
|
1711
1701
|
}
|
|
1712
|
-
var
|
|
1702
|
+
var ht;
|
|
1713
1703
|
((r) => {
|
|
1714
1704
|
function e(t, n, s) {
|
|
1715
1705
|
const a = t / 2, i = n / 2, o = Math.sqrt(a * a + i * i), l = Math.atan(i / a) * (180 / Math.PI), u = s * (Math.PI / 180);
|
|
@@ -1740,96 +1730,96 @@ var mt;
|
|
|
1740
1730
|
};
|
|
1741
1731
|
}
|
|
1742
1732
|
r.getOffsets = e;
|
|
1743
|
-
})(
|
|
1744
|
-
var
|
|
1745
|
-
function
|
|
1746
|
-
|
|
1733
|
+
})(ht || (ht = {}));
|
|
1734
|
+
var Ha = /* @__PURE__ */ as('<div><div class="pointer svelte-j5igi2"></div> <div class="bubble svelte-j5igi2"><div class="body svelte-j5igi2"></div></div></div>');
|
|
1735
|
+
function cs(r, e) {
|
|
1736
|
+
Zr(e, !0);
|
|
1747
1737
|
let t, n, s, a;
|
|
1748
1738
|
const i = e.width + 2 * e.margin, o = e.height + 2 * e.margin, l = () => a;
|
|
1749
|
-
|
|
1739
|
+
ae(() => {
|
|
1750
1740
|
s.style.width = `${e.margin * 4}px`, s.style.height = `${e.margin * 4}px`;
|
|
1751
1741
|
});
|
|
1752
|
-
let u = /* @__PURE__ */
|
|
1742
|
+
let u = /* @__PURE__ */ U(!0);
|
|
1753
1743
|
function d(O) {
|
|
1754
|
-
|
|
1744
|
+
F(u, O, !0);
|
|
1755
1745
|
}
|
|
1756
1746
|
function p() {
|
|
1757
|
-
return
|
|
1747
|
+
return R(u);
|
|
1758
1748
|
}
|
|
1759
|
-
let g = /* @__PURE__ */
|
|
1760
|
-
function
|
|
1761
|
-
|
|
1749
|
+
let g = /* @__PURE__ */ U(!0), m = 0, y = 300;
|
|
1750
|
+
function P(O) {
|
|
1751
|
+
O != R(g) && (F(g, O, !0), m = performance.now());
|
|
1762
1752
|
}
|
|
1763
|
-
function
|
|
1764
|
-
return
|
|
1753
|
+
function z() {
|
|
1754
|
+
return performance.now() - m < y ? A.motion.current == 0 : A.value == 0;
|
|
1765
1755
|
}
|
|
1766
|
-
function
|
|
1767
|
-
return
|
|
1756
|
+
function te() {
|
|
1757
|
+
return performance.now() - m < y ? A.motion.current == 1 : A.value == 1;
|
|
1768
1758
|
}
|
|
1769
|
-
let
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
}),
|
|
1773
|
-
|
|
1774
|
-
}),
|
|
1775
|
-
|
|
1759
|
+
let A = new jt(0);
|
|
1760
|
+
ae(() => {
|
|
1761
|
+
R(u) == !1 && (A.snap(), _e.clear(e.priority, e.id + "_scale"));
|
|
1762
|
+
}), ae(() => {
|
|
1763
|
+
R(g) == !0 && A.value != 0 && (_e.stacked() ? A.set(0, { duration: 0 }) : A.set(0, { duration: 150, easing: ja })), R(g) == !1 && A.value != 1 && A.set(1, { duration: 150, easing: Fa });
|
|
1764
|
+
}), ae(() => {
|
|
1765
|
+
q(A.motion.current);
|
|
1776
1766
|
});
|
|
1777
|
-
function
|
|
1778
|
-
!t || !n || !s ||
|
|
1767
|
+
function q(O) {
|
|
1768
|
+
!t || !n || !s || _e.equeue(R(g) ? 0 : e.layer, e.priority, e.id + "_scale", () => {
|
|
1779
1769
|
t.style.opacity = `${O}`, n.style.scale = `${O}`, s.style.scale = `${O}`;
|
|
1780
1770
|
});
|
|
1781
1771
|
}
|
|
1782
|
-
let
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
}),
|
|
1786
|
-
|
|
1787
|
-
}),
|
|
1788
|
-
|
|
1772
|
+
let N = NaN, er = /* @__PURE__ */ U(!1), me = new jt(-i / 2, { easing: pr }), Nt = new jt(-o / 2, { easing: pr });
|
|
1773
|
+
ae(() => {
|
|
1774
|
+
R(u) == !1 && (me.snap(), me.snap(), _e.clear(e.priority, e.id + "_angle"));
|
|
1775
|
+
}), ae(() => {
|
|
1776
|
+
R(g) == !0 && R(er) && (me.update({ duration: 75 }), me.update({ duration: 75 }));
|
|
1777
|
+
}), ae(() => {
|
|
1778
|
+
Yr(me.motion.current, Nt.motion.current);
|
|
1789
1779
|
});
|
|
1790
|
-
function
|
|
1780
|
+
function Yr(O, It) {
|
|
1791
1781
|
if (!t || !n || !s) return;
|
|
1792
|
-
const
|
|
1793
|
-
|
|
1794
|
-
n.style.transform = `translate(${Math.round(O)}px, ${Math.round(
|
|
1782
|
+
const ce = O + i / 2, Pt = It + o / 2, Fe = o < i ? ce * o / i : ce, ze = o > i ? Pt * i / o : Pt, xs = Math.atan2(ze, Fe) / Math.PI * 180 - 45, Jr = 0, ks = 30, rr = Math.sqrt(Fe * Fe + ze * ze), ut = Math.min(i, o) / 2, bs = ut * Math.SQRT2, Es = (rr - ut) / (bs - ut), Kr = Jr + Es * (ks - Jr), Ss = rr < ut ? rr / ut : 1;
|
|
1783
|
+
_e.equeue(e.layer, e.priority, e.id + "_angle", () => {
|
|
1784
|
+
n.style.transform = `translate(${Math.round(O)}px, ${Math.round(It)}px)`, s.style.transform = `scale(${Ss}) rotate(${xs}deg) skew(${Kr}deg, ${Kr}deg)`;
|
|
1795
1785
|
});
|
|
1796
1786
|
}
|
|
1797
|
-
function
|
|
1798
|
-
if (
|
|
1799
|
-
let
|
|
1800
|
-
|
|
1801
|
-
} else if (O !=
|
|
1802
|
-
let
|
|
1803
|
-
|
|
1787
|
+
function ys(O, It) {
|
|
1788
|
+
if (R(er) == !1 || It == !0) {
|
|
1789
|
+
let ce = ht.getOffsets(i, o, O);
|
|
1790
|
+
me.set(Math.round(ce.x), { duration: 0 }), Nt.set(Math.round(ce.y), { duration: 0 }), Yr(me.value, Nt.value), N = O, F(er, !0);
|
|
1791
|
+
} else if (O != N) {
|
|
1792
|
+
let ce = Math.abs(O - N), Pt = ce < 180 ? ce : 360 - ce, Fe = Math.log(Pt) * 75, ze = ht.getOffsets(i, o, O);
|
|
1793
|
+
me.set(Math.round(ze.x), { duration: Fe }), Nt.set(Math.round(ze.y), { duration: Fe }), N = O;
|
|
1804
1794
|
}
|
|
1805
1795
|
}
|
|
1806
|
-
function
|
|
1807
|
-
return
|
|
1796
|
+
function ws() {
|
|
1797
|
+
return ht.getOffsets(i, o, N);
|
|
1808
1798
|
}
|
|
1809
|
-
var Rt =
|
|
1810
|
-
|
|
1811
|
-
|
|
1799
|
+
var Rt = Ha(), Xr = hr(Rt);
|
|
1800
|
+
Be(
|
|
1801
|
+
Xr,
|
|
1812
1802
|
(O) => (
|
|
1813
1803
|
//#endregion
|
|
1814
1804
|
s = O
|
|
1815
1805
|
),
|
|
1816
1806
|
() => s
|
|
1817
1807
|
);
|
|
1818
|
-
var
|
|
1819
|
-
return
|
|
1820
|
-
|
|
1821
|
-
}),
|
|
1808
|
+
var tr = la(Xr, 2), Gr = hr(tr);
|
|
1809
|
+
return Be(Gr, (O) => a = O, () => a), Be(tr, (O) => n = O, () => n), Be(Rt, (O) => t = O, () => t), Xn(() => {
|
|
1810
|
+
us(Rt, 1, ls(["anchor", R(u) && "displayed"]), "svelte-j5igi2"), qt(tr, `margin: ${e.margin}px;`), qt(Gr, `width: ${e.width}px; height: ${e.height}px; border-radius: ${e.radius}px;`);
|
|
1811
|
+
}), is(r, Rt), jr({
|
|
1822
1812
|
getBody: l,
|
|
1823
1813
|
setDisplayed: d,
|
|
1824
1814
|
getDisplayed: p,
|
|
1825
|
-
setCollapsed:
|
|
1826
|
-
getCollapsed:
|
|
1827
|
-
getExpanded:
|
|
1828
|
-
setAngle:
|
|
1829
|
-
getOffsets:
|
|
1815
|
+
setCollapsed: P,
|
|
1816
|
+
getCollapsed: z,
|
|
1817
|
+
getExpanded: te,
|
|
1818
|
+
setAngle: ys,
|
|
1819
|
+
getOffsets: ws
|
|
1830
1820
|
});
|
|
1831
1821
|
}
|
|
1832
|
-
var
|
|
1822
|
+
var $e;
|
|
1833
1823
|
((r) => {
|
|
1834
1824
|
function e(o, l, u) {
|
|
1835
1825
|
return {
|
|
@@ -1857,8 +1847,8 @@ var Be;
|
|
|
1857
1847
|
function i(o) {
|
|
1858
1848
|
return 360 / Math.PI * Math.atan(Math.exp((180 - o * 360) * Math.PI / 180)) - 90;
|
|
1859
1849
|
}
|
|
1860
|
-
})(
|
|
1861
|
-
class
|
|
1850
|
+
})($e || ($e = {}));
|
|
1851
|
+
class fs {
|
|
1862
1852
|
/**
|
|
1863
1853
|
* @param mapBounds - The bounds of the map.
|
|
1864
1854
|
* @param mapZoom - The zoom level of the map.
|
|
@@ -1871,14 +1861,14 @@ class cs {
|
|
|
1871
1861
|
f(this, "swLng");
|
|
1872
1862
|
f(this, "neLat");
|
|
1873
1863
|
f(this, "neLng");
|
|
1874
|
-
const i = n * Math.pow(2, t), o =
|
|
1864
|
+
const i = n * Math.pow(2, t), o = $e.project(e.sw.lat, e.sw.lng, i), l = $e.project(e.ne.lat, e.ne.lng, i), u = o.x - s, d = o.y + a, p = l.x + s, g = l.y - a, m = $e.unproject(u, d, i), y = $e.unproject(p, g, i);
|
|
1875
1865
|
this.swLat = m.lat, this.swLng = m.lng, this.neLat = y.lat, this.neLng = y.lng;
|
|
1876
1866
|
}
|
|
1877
1867
|
contains(e, t) {
|
|
1878
1868
|
return this.swLat <= e && e <= this.neLat ? this.swLng < this.neLng ? this.swLng <= t && t <= this.neLng : t <= this.neLng || this.swLng <= t : !1;
|
|
1879
1869
|
}
|
|
1880
1870
|
}
|
|
1881
|
-
var
|
|
1871
|
+
var T;
|
|
1882
1872
|
(function(r) {
|
|
1883
1873
|
r.assertEqual = (s) => {
|
|
1884
1874
|
};
|
|
@@ -1914,16 +1904,16 @@ var M;
|
|
|
1914
1904
|
return s.map((i) => typeof i == "string" ? `'${i}'` : i).join(a);
|
|
1915
1905
|
}
|
|
1916
1906
|
r.joinValues = n, r.jsonStringifyReplacer = (s, a) => typeof a == "bigint" ? a.toString() : a;
|
|
1917
|
-
})(
|
|
1918
|
-
var
|
|
1907
|
+
})(T || (T = {}));
|
|
1908
|
+
var hn;
|
|
1919
1909
|
(function(r) {
|
|
1920
1910
|
r.mergeShapes = (e, t) => ({
|
|
1921
1911
|
...e,
|
|
1922
1912
|
...t
|
|
1923
1913
|
// second overwrites first
|
|
1924
1914
|
});
|
|
1925
|
-
})(
|
|
1926
|
-
const v =
|
|
1915
|
+
})(hn || (hn = {}));
|
|
1916
|
+
const v = T.arrayToEnum([
|
|
1927
1917
|
"string",
|
|
1928
1918
|
"nan",
|
|
1929
1919
|
"number",
|
|
@@ -1944,7 +1934,7 @@ const v = M.arrayToEnum([
|
|
|
1944
1934
|
"never",
|
|
1945
1935
|
"map",
|
|
1946
1936
|
"set"
|
|
1947
|
-
]),
|
|
1937
|
+
]), ve = (r) => {
|
|
1948
1938
|
switch (typeof r) {
|
|
1949
1939
|
case "undefined":
|
|
1950
1940
|
return v.undefined;
|
|
@@ -1965,7 +1955,7 @@ const v = M.arrayToEnum([
|
|
|
1965
1955
|
default:
|
|
1966
1956
|
return v.unknown;
|
|
1967
1957
|
}
|
|
1968
|
-
}, c =
|
|
1958
|
+
}, c = T.arrayToEnum([
|
|
1969
1959
|
"invalid_type",
|
|
1970
1960
|
"invalid_literal",
|
|
1971
1961
|
"custom",
|
|
@@ -1983,7 +1973,7 @@ const v = M.arrayToEnum([
|
|
|
1983
1973
|
"not_multiple_of",
|
|
1984
1974
|
"not_finite"
|
|
1985
1975
|
]);
|
|
1986
|
-
class
|
|
1976
|
+
class ee extends Error {
|
|
1987
1977
|
get errors() {
|
|
1988
1978
|
return this.issues;
|
|
1989
1979
|
}
|
|
@@ -2020,14 +2010,14 @@ class Q extends Error {
|
|
|
2020
2010
|
return s(this), n;
|
|
2021
2011
|
}
|
|
2022
2012
|
static assert(e) {
|
|
2023
|
-
if (!(e instanceof
|
|
2013
|
+
if (!(e instanceof ee))
|
|
2024
2014
|
throw new Error(`Not a ZodError: ${e}`);
|
|
2025
2015
|
}
|
|
2026
2016
|
toString() {
|
|
2027
2017
|
return this.message;
|
|
2028
2018
|
}
|
|
2029
2019
|
get message() {
|
|
2030
|
-
return JSON.stringify(this.issues,
|
|
2020
|
+
return JSON.stringify(this.issues, T.jsonStringifyReplacer, 2);
|
|
2031
2021
|
}
|
|
2032
2022
|
get isEmpty() {
|
|
2033
2023
|
return this.issues.length === 0;
|
|
@@ -2046,27 +2036,27 @@ class Q extends Error {
|
|
|
2046
2036
|
return this.flatten();
|
|
2047
2037
|
}
|
|
2048
2038
|
}
|
|
2049
|
-
|
|
2050
|
-
const
|
|
2039
|
+
ee.create = (r) => new ee(r);
|
|
2040
|
+
const yt = (r, e) => {
|
|
2051
2041
|
let t;
|
|
2052
2042
|
switch (r.code) {
|
|
2053
2043
|
case c.invalid_type:
|
|
2054
2044
|
r.received === v.undefined ? t = "Required" : t = `Expected ${r.expected}, received ${r.received}`;
|
|
2055
2045
|
break;
|
|
2056
2046
|
case c.invalid_literal:
|
|
2057
|
-
t = `Invalid literal value, expected ${JSON.stringify(r.expected,
|
|
2047
|
+
t = `Invalid literal value, expected ${JSON.stringify(r.expected, T.jsonStringifyReplacer)}`;
|
|
2058
2048
|
break;
|
|
2059
2049
|
case c.unrecognized_keys:
|
|
2060
|
-
t = `Unrecognized key(s) in object: ${
|
|
2050
|
+
t = `Unrecognized key(s) in object: ${T.joinValues(r.keys, ", ")}`;
|
|
2061
2051
|
break;
|
|
2062
2052
|
case c.invalid_union:
|
|
2063
2053
|
t = "Invalid input";
|
|
2064
2054
|
break;
|
|
2065
2055
|
case c.invalid_union_discriminator:
|
|
2066
|
-
t = `Invalid discriminator value. Expected ${
|
|
2056
|
+
t = `Invalid discriminator value. Expected ${T.joinValues(r.options)}`;
|
|
2067
2057
|
break;
|
|
2068
2058
|
case c.invalid_enum_value:
|
|
2069
|
-
t = `Invalid enum value. Expected ${
|
|
2059
|
+
t = `Invalid enum value. Expected ${T.joinValues(r.options)}, received '${r.received}'`;
|
|
2070
2060
|
break;
|
|
2071
2061
|
case c.invalid_arguments:
|
|
2072
2062
|
t = "Invalid function arguments";
|
|
@@ -2078,7 +2068,7 @@ const xt = (r, e) => {
|
|
|
2078
2068
|
t = "Invalid date";
|
|
2079
2069
|
break;
|
|
2080
2070
|
case c.invalid_string:
|
|
2081
|
-
typeof r.validation == "object" ? "includes" in r.validation ? (t = `Invalid input: must include "${r.validation.includes}"`, typeof r.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${r.validation.position}`)) : "startsWith" in r.validation ? t = `Invalid input: must start with "${r.validation.startsWith}"` : "endsWith" in r.validation ? t = `Invalid input: must end with "${r.validation.endsWith}"` :
|
|
2071
|
+
typeof r.validation == "object" ? "includes" in r.validation ? (t = `Invalid input: must include "${r.validation.includes}"`, typeof r.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${r.validation.position}`)) : "startsWith" in r.validation ? t = `Invalid input: must start with "${r.validation.startsWith}"` : "endsWith" in r.validation ? t = `Invalid input: must end with "${r.validation.endsWith}"` : T.assertNever(r.validation) : r.validation !== "regex" ? t = `Invalid ${r.validation}` : t = "Invalid";
|
|
2082
2072
|
break;
|
|
2083
2073
|
case c.too_small:
|
|
2084
2074
|
r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "more than"} ${r.minimum} element(s)` : r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "over"} ${r.minimum} character(s)` : r.type === "number" ? t = `Number must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${r.minimum}` : r.type === "bigint" ? t = `Number must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${r.minimum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(r.minimum))}` : t = "Invalid input";
|
|
@@ -2099,15 +2089,15 @@ const xt = (r, e) => {
|
|
|
2099
2089
|
t = "Number must be finite";
|
|
2100
2090
|
break;
|
|
2101
2091
|
default:
|
|
2102
|
-
t = e.defaultError,
|
|
2092
|
+
t = e.defaultError, T.assertNever(r);
|
|
2103
2093
|
}
|
|
2104
2094
|
return { message: t };
|
|
2105
2095
|
};
|
|
2106
|
-
let
|
|
2107
|
-
function
|
|
2108
|
-
return
|
|
2096
|
+
let Ya = yt;
|
|
2097
|
+
function _r() {
|
|
2098
|
+
return Ya;
|
|
2109
2099
|
}
|
|
2110
|
-
const
|
|
2100
|
+
const gr = (r) => {
|
|
2111
2101
|
const { data: e, path: t, errorMaps: n, issueData: s } = r, a = [...t, ...s.path || []], i = {
|
|
2112
2102
|
...s,
|
|
2113
2103
|
path: a
|
|
@@ -2129,7 +2119,7 @@ const vr = (r) => {
|
|
|
2129
2119
|
};
|
|
2130
2120
|
};
|
|
2131
2121
|
function h(r, e) {
|
|
2132
|
-
const t =
|
|
2122
|
+
const t = _r(), n = gr({
|
|
2133
2123
|
issueData: e,
|
|
2134
2124
|
data: r.data,
|
|
2135
2125
|
path: r.path,
|
|
@@ -2140,13 +2130,13 @@ function h(r, e) {
|
|
|
2140
2130
|
// then schema-bound map if available
|
|
2141
2131
|
t,
|
|
2142
2132
|
// then global override map
|
|
2143
|
-
t ===
|
|
2133
|
+
t === yt ? void 0 : yt
|
|
2144
2134
|
// then global default map
|
|
2145
2135
|
].filter((s) => !!s)
|
|
2146
2136
|
});
|
|
2147
2137
|
r.common.issues.push(n);
|
|
2148
2138
|
}
|
|
2149
|
-
class
|
|
2139
|
+
class G {
|
|
2150
2140
|
constructor() {
|
|
2151
2141
|
this.value = "valid";
|
|
2152
2142
|
}
|
|
@@ -2174,7 +2164,7 @@ class X {
|
|
|
2174
2164
|
value: i
|
|
2175
2165
|
});
|
|
2176
2166
|
}
|
|
2177
|
-
return
|
|
2167
|
+
return G.mergeObjectSync(e, n);
|
|
2178
2168
|
}
|
|
2179
2169
|
static mergeObjectSync(e, t) {
|
|
2180
2170
|
const n = {};
|
|
@@ -2189,12 +2179,12 @@ class X {
|
|
|
2189
2179
|
}
|
|
2190
2180
|
const w = Object.freeze({
|
|
2191
2181
|
status: "aborted"
|
|
2192
|
-
}),
|
|
2182
|
+
}), ct = (r) => ({ status: "dirty", value: r }), H = (r) => ({ status: "valid", value: r }), pn = (r) => r.status === "aborted", mn = (r) => r.status === "dirty", tt = (r) => r.status === "valid", Wt = (r) => typeof Promise < "u" && r instanceof Promise;
|
|
2193
2183
|
var _;
|
|
2194
2184
|
(function(r) {
|
|
2195
2185
|
r.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, r.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
2196
2186
|
})(_ || (_ = {}));
|
|
2197
|
-
class
|
|
2187
|
+
class Se {
|
|
2198
2188
|
constructor(e, t, n, s) {
|
|
2199
2189
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = n, this._key = s;
|
|
2200
2190
|
}
|
|
@@ -2202,7 +2192,7 @@ class Ee {
|
|
|
2202
2192
|
return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
2203
2193
|
}
|
|
2204
2194
|
}
|
|
2205
|
-
const
|
|
2195
|
+
const vn = (r, e) => {
|
|
2206
2196
|
if (tt(e))
|
|
2207
2197
|
return { success: !0, data: e.value };
|
|
2208
2198
|
if (!r.common.issues.length)
|
|
@@ -2212,7 +2202,7 @@ const mn = (r, e) => {
|
|
|
2212
2202
|
get error() {
|
|
2213
2203
|
if (this._error)
|
|
2214
2204
|
return this._error;
|
|
2215
|
-
const t = new
|
|
2205
|
+
const t = new ee(r.common.issues);
|
|
2216
2206
|
return this._error = t, this._error;
|
|
2217
2207
|
}
|
|
2218
2208
|
};
|
|
@@ -2233,13 +2223,13 @@ class C {
|
|
|
2233
2223
|
return this._def.description;
|
|
2234
2224
|
}
|
|
2235
2225
|
_getType(e) {
|
|
2236
|
-
return
|
|
2226
|
+
return ve(e.data);
|
|
2237
2227
|
}
|
|
2238
2228
|
_getOrReturnCtx(e, t) {
|
|
2239
2229
|
return t || {
|
|
2240
2230
|
common: e.parent.common,
|
|
2241
2231
|
data: e.data,
|
|
2242
|
-
parsedType:
|
|
2232
|
+
parsedType: ve(e.data),
|
|
2243
2233
|
schemaErrorMap: this._def.errorMap,
|
|
2244
2234
|
path: e.path,
|
|
2245
2235
|
parent: e.parent
|
|
@@ -2247,11 +2237,11 @@ class C {
|
|
|
2247
2237
|
}
|
|
2248
2238
|
_processInputParams(e) {
|
|
2249
2239
|
return {
|
|
2250
|
-
status: new
|
|
2240
|
+
status: new G(),
|
|
2251
2241
|
ctx: {
|
|
2252
2242
|
common: e.parent.common,
|
|
2253
2243
|
data: e.data,
|
|
2254
|
-
parsedType:
|
|
2244
|
+
parsedType: ve(e.data),
|
|
2255
2245
|
schemaErrorMap: this._def.errorMap,
|
|
2256
2246
|
path: e.path,
|
|
2257
2247
|
parent: e.parent
|
|
@@ -2260,7 +2250,7 @@ class C {
|
|
|
2260
2250
|
}
|
|
2261
2251
|
_parseSync(e) {
|
|
2262
2252
|
const t = this._parse(e);
|
|
2263
|
-
if (
|
|
2253
|
+
if (Wt(t))
|
|
2264
2254
|
throw new Error("Synchronous parse encountered promise.");
|
|
2265
2255
|
return t;
|
|
2266
2256
|
}
|
|
@@ -2285,9 +2275,9 @@ class C {
|
|
|
2285
2275
|
schemaErrorMap: this._def.errorMap,
|
|
2286
2276
|
parent: null,
|
|
2287
2277
|
data: e,
|
|
2288
|
-
parsedType:
|
|
2278
|
+
parsedType: ve(e)
|
|
2289
2279
|
}, s = this._parseSync({ data: e, path: n.path, parent: n });
|
|
2290
|
-
return
|
|
2280
|
+
return vn(n, s);
|
|
2291
2281
|
}
|
|
2292
2282
|
"~validate"(e) {
|
|
2293
2283
|
var n, s;
|
|
@@ -2300,7 +2290,7 @@ class C {
|
|
|
2300
2290
|
schemaErrorMap: this._def.errorMap,
|
|
2301
2291
|
parent: null,
|
|
2302
2292
|
data: e,
|
|
2303
|
-
parsedType:
|
|
2293
|
+
parsedType: ve(e)
|
|
2304
2294
|
};
|
|
2305
2295
|
if (!this["~standard"].async)
|
|
2306
2296
|
try {
|
|
@@ -2339,9 +2329,9 @@ class C {
|
|
|
2339
2329
|
schemaErrorMap: this._def.errorMap,
|
|
2340
2330
|
parent: null,
|
|
2341
2331
|
data: e,
|
|
2342
|
-
parsedType:
|
|
2343
|
-
}, s = this._parse({ data: e, path: n.path, parent: n }), a = await (
|
|
2344
|
-
return
|
|
2332
|
+
parsedType: ve(e)
|
|
2333
|
+
}, s = this._parse({ data: e, path: n.path, parent: n }), a = await (Wt(s) ? s : Promise.resolve(s));
|
|
2334
|
+
return vn(n, a);
|
|
2345
2335
|
}
|
|
2346
2336
|
refine(e, t) {
|
|
2347
2337
|
const n = (s) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(s) : t;
|
|
@@ -2374,7 +2364,7 @@ class C {
|
|
|
2374
2364
|
};
|
|
2375
2365
|
}
|
|
2376
2366
|
optional() {
|
|
2377
|
-
return
|
|
2367
|
+
return be.create(this, this._def);
|
|
2378
2368
|
}
|
|
2379
2369
|
nullable() {
|
|
2380
2370
|
return at.create(this, this._def);
|
|
@@ -2383,16 +2373,16 @@ class C {
|
|
|
2383
2373
|
return this.nullable().optional();
|
|
2384
2374
|
}
|
|
2385
2375
|
array() {
|
|
2386
|
-
return
|
|
2376
|
+
return le.create(this);
|
|
2387
2377
|
}
|
|
2388
2378
|
promise() {
|
|
2389
|
-
return
|
|
2379
|
+
return kt.create(this, this._def);
|
|
2390
2380
|
}
|
|
2391
2381
|
or(e) {
|
|
2392
|
-
return
|
|
2382
|
+
return Yt.create([this, e], this._def);
|
|
2393
2383
|
}
|
|
2394
2384
|
and(e) {
|
|
2395
|
-
return
|
|
2385
|
+
return Xt.create(this, e, this._def);
|
|
2396
2386
|
}
|
|
2397
2387
|
transform(e) {
|
|
2398
2388
|
return new st({
|
|
@@ -2404,7 +2394,7 @@ class C {
|
|
|
2404
2394
|
}
|
|
2405
2395
|
default(e) {
|
|
2406
2396
|
const t = typeof e == "function" ? e : () => e;
|
|
2407
|
-
return new
|
|
2397
|
+
return new br({
|
|
2408
2398
|
...E(this._def),
|
|
2409
2399
|
innerType: this,
|
|
2410
2400
|
defaultValue: t,
|
|
@@ -2412,7 +2402,7 @@ class C {
|
|
|
2412
2402
|
});
|
|
2413
2403
|
}
|
|
2414
2404
|
brand() {
|
|
2415
|
-
return new
|
|
2405
|
+
return new _i({
|
|
2416
2406
|
typeName: x.ZodBranded,
|
|
2417
2407
|
type: this,
|
|
2418
2408
|
...E(this._def)
|
|
@@ -2420,7 +2410,7 @@ class C {
|
|
|
2420
2410
|
}
|
|
2421
2411
|
catch(e) {
|
|
2422
2412
|
const t = typeof e == "function" ? e : () => e;
|
|
2423
|
-
return new
|
|
2413
|
+
return new Er({
|
|
2424
2414
|
...E(this._def),
|
|
2425
2415
|
innerType: this,
|
|
2426
2416
|
catchValue: t,
|
|
@@ -2435,10 +2425,10 @@ class C {
|
|
|
2435
2425
|
});
|
|
2436
2426
|
}
|
|
2437
2427
|
pipe(e) {
|
|
2438
|
-
return
|
|
2428
|
+
return Br.create(this, e);
|
|
2439
2429
|
}
|
|
2440
2430
|
readonly() {
|
|
2441
|
-
return
|
|
2431
|
+
return Sr.create(this);
|
|
2442
2432
|
}
|
|
2443
2433
|
isOptional() {
|
|
2444
2434
|
return this.safeParse(void 0).success;
|
|
@@ -2447,28 +2437,28 @@ class C {
|
|
|
2447
2437
|
return this.safeParse(null).success;
|
|
2448
2438
|
}
|
|
2449
2439
|
}
|
|
2450
|
-
const
|
|
2451
|
-
let
|
|
2452
|
-
const
|
|
2453
|
-
function
|
|
2440
|
+
const Xa = /^c[^\s-]{8,}$/i, Ga = /^[0-9a-z]+$/, Ja = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Ka = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Qa = /^[a-z0-9_-]{21}$/i, ei = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, ti = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, ri = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ni = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
2441
|
+
let ir;
|
|
2442
|
+
const si = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, ai = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, ii = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, oi = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, li = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, ui = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, hs = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", di = new RegExp(`^${hs}$`);
|
|
2443
|
+
function ps(r) {
|
|
2454
2444
|
let e = "[0-5]\\d";
|
|
2455
2445
|
r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`);
|
|
2456
2446
|
const t = r.precision ? "+" : "?";
|
|
2457
2447
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`;
|
|
2458
2448
|
}
|
|
2459
|
-
function di(r) {
|
|
2460
|
-
return new RegExp(`^${hs(r)}$`);
|
|
2461
|
-
}
|
|
2462
2449
|
function ci(r) {
|
|
2463
|
-
|
|
2450
|
+
return new RegExp(`^${ps(r)}$`);
|
|
2451
|
+
}
|
|
2452
|
+
function fi(r) {
|
|
2453
|
+
let e = `${hs}T${ps(r)}`;
|
|
2464
2454
|
const t = [];
|
|
2465
2455
|
return t.push(r.local ? "Z?" : "Z"), r.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
2466
2456
|
}
|
|
2467
|
-
function fi(r, e) {
|
|
2468
|
-
return !!((e === "v4" || !e) && ni.test(r) || (e === "v6" || !e) && ai.test(r));
|
|
2469
|
-
}
|
|
2470
2457
|
function hi(r, e) {
|
|
2471
|
-
|
|
2458
|
+
return !!((e === "v4" || !e) && si.test(r) || (e === "v6" || !e) && ii.test(r));
|
|
2459
|
+
}
|
|
2460
|
+
function pi(r, e) {
|
|
2461
|
+
if (!ei.test(r))
|
|
2472
2462
|
return !1;
|
|
2473
2463
|
try {
|
|
2474
2464
|
const [t] = r.split(".");
|
|
@@ -2480,10 +2470,10 @@ function hi(r, e) {
|
|
|
2480
2470
|
return !1;
|
|
2481
2471
|
}
|
|
2482
2472
|
}
|
|
2483
|
-
function
|
|
2484
|
-
return !!((e === "v4" || !e) &&
|
|
2473
|
+
function mi(r, e) {
|
|
2474
|
+
return !!((e === "v4" || !e) && ai.test(r) || (e === "v6" || !e) && oi.test(r));
|
|
2485
2475
|
}
|
|
2486
|
-
class
|
|
2476
|
+
class xe extends C {
|
|
2487
2477
|
_parse(e) {
|
|
2488
2478
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== v.string) {
|
|
2489
2479
|
const a = this._getOrReturnCtx(e);
|
|
@@ -2493,7 +2483,7 @@ class we extends C {
|
|
|
2493
2483
|
received: a.parsedType
|
|
2494
2484
|
}), w;
|
|
2495
2485
|
}
|
|
2496
|
-
const n = new
|
|
2486
|
+
const n = new G();
|
|
2497
2487
|
let s;
|
|
2498
2488
|
for (const a of this._def.checks)
|
|
2499
2489
|
if (a.kind === "min")
|
|
@@ -2532,43 +2522,43 @@ class we extends C {
|
|
|
2532
2522
|
message: a.message
|
|
2533
2523
|
}), n.dirty());
|
|
2534
2524
|
} else if (a.kind === "email")
|
|
2535
|
-
|
|
2525
|
+
ri.test(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2536
2526
|
validation: "email",
|
|
2537
2527
|
code: c.invalid_string,
|
|
2538
2528
|
message: a.message
|
|
2539
2529
|
}), n.dirty());
|
|
2540
2530
|
else if (a.kind === "emoji")
|
|
2541
|
-
|
|
2531
|
+
ir || (ir = new RegExp(ni, "u")), ir.test(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2542
2532
|
validation: "emoji",
|
|
2543
2533
|
code: c.invalid_string,
|
|
2544
2534
|
message: a.message
|
|
2545
2535
|
}), n.dirty());
|
|
2546
2536
|
else if (a.kind === "uuid")
|
|
2547
|
-
|
|
2537
|
+
Ka.test(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2548
2538
|
validation: "uuid",
|
|
2549
2539
|
code: c.invalid_string,
|
|
2550
2540
|
message: a.message
|
|
2551
2541
|
}), n.dirty());
|
|
2552
2542
|
else if (a.kind === "nanoid")
|
|
2553
|
-
|
|
2543
|
+
Qa.test(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2554
2544
|
validation: "nanoid",
|
|
2555
2545
|
code: c.invalid_string,
|
|
2556
2546
|
message: a.message
|
|
2557
2547
|
}), n.dirty());
|
|
2558
2548
|
else if (a.kind === "cuid")
|
|
2559
|
-
|
|
2549
|
+
Xa.test(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2560
2550
|
validation: "cuid",
|
|
2561
2551
|
code: c.invalid_string,
|
|
2562
2552
|
message: a.message
|
|
2563
2553
|
}), n.dirty());
|
|
2564
2554
|
else if (a.kind === "cuid2")
|
|
2565
|
-
|
|
2555
|
+
Ga.test(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2566
2556
|
validation: "cuid2",
|
|
2567
2557
|
code: c.invalid_string,
|
|
2568
2558
|
message: a.message
|
|
2569
2559
|
}), n.dirty());
|
|
2570
2560
|
else if (a.kind === "ulid")
|
|
2571
|
-
|
|
2561
|
+
Ja.test(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2572
2562
|
validation: "ulid",
|
|
2573
2563
|
code: c.invalid_string,
|
|
2574
2564
|
message: a.message
|
|
@@ -2599,43 +2589,43 @@ class we extends C {
|
|
|
2599
2589
|
code: c.invalid_string,
|
|
2600
2590
|
validation: { endsWith: a.value },
|
|
2601
2591
|
message: a.message
|
|
2602
|
-
}), n.dirty()) : a.kind === "datetime" ?
|
|
2592
|
+
}), n.dirty()) : a.kind === "datetime" ? fi(a).test(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2603
2593
|
code: c.invalid_string,
|
|
2604
2594
|
validation: "datetime",
|
|
2605
2595
|
message: a.message
|
|
2606
|
-
}), n.dirty()) : a.kind === "date" ?
|
|
2596
|
+
}), n.dirty()) : a.kind === "date" ? di.test(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2607
2597
|
code: c.invalid_string,
|
|
2608
2598
|
validation: "date",
|
|
2609
2599
|
message: a.message
|
|
2610
|
-
}), n.dirty()) : a.kind === "time" ?
|
|
2600
|
+
}), n.dirty()) : a.kind === "time" ? ci(a).test(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2611
2601
|
code: c.invalid_string,
|
|
2612
2602
|
validation: "time",
|
|
2613
2603
|
message: a.message
|
|
2614
|
-
}), n.dirty()) : a.kind === "duration" ?
|
|
2604
|
+
}), n.dirty()) : a.kind === "duration" ? ti.test(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2615
2605
|
validation: "duration",
|
|
2616
2606
|
code: c.invalid_string,
|
|
2617
2607
|
message: a.message
|
|
2618
|
-
}), n.dirty()) : a.kind === "ip" ?
|
|
2608
|
+
}), n.dirty()) : a.kind === "ip" ? hi(e.data, a.version) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2619
2609
|
validation: "ip",
|
|
2620
2610
|
code: c.invalid_string,
|
|
2621
2611
|
message: a.message
|
|
2622
|
-
}), n.dirty()) : a.kind === "jwt" ?
|
|
2612
|
+
}), n.dirty()) : a.kind === "jwt" ? pi(e.data, a.alg) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2623
2613
|
validation: "jwt",
|
|
2624
2614
|
code: c.invalid_string,
|
|
2625
2615
|
message: a.message
|
|
2626
|
-
}), n.dirty()) : a.kind === "cidr" ?
|
|
2616
|
+
}), n.dirty()) : a.kind === "cidr" ? mi(e.data, a.version) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2627
2617
|
validation: "cidr",
|
|
2628
2618
|
code: c.invalid_string,
|
|
2629
2619
|
message: a.message
|
|
2630
|
-
}), n.dirty()) : a.kind === "base64" ?
|
|
2620
|
+
}), n.dirty()) : a.kind === "base64" ? li.test(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2631
2621
|
validation: "base64",
|
|
2632
2622
|
code: c.invalid_string,
|
|
2633
2623
|
message: a.message
|
|
2634
|
-
}), n.dirty()) : a.kind === "base64url" ?
|
|
2624
|
+
}), n.dirty()) : a.kind === "base64url" ? ui.test(e.data) || (s = this._getOrReturnCtx(e, s), h(s, {
|
|
2635
2625
|
validation: "base64url",
|
|
2636
2626
|
code: c.invalid_string,
|
|
2637
2627
|
message: a.message
|
|
2638
|
-
}), n.dirty()) :
|
|
2628
|
+
}), n.dirty()) : T.assertNever(a);
|
|
2639
2629
|
return { status: n.value, value: e.data };
|
|
2640
2630
|
}
|
|
2641
2631
|
_regex(e, t, n) {
|
|
@@ -2646,7 +2636,7 @@ class we extends C {
|
|
|
2646
2636
|
});
|
|
2647
2637
|
}
|
|
2648
2638
|
_addCheck(e) {
|
|
2649
|
-
return new
|
|
2639
|
+
return new xe({
|
|
2650
2640
|
...this._def,
|
|
2651
2641
|
checks: [...this._def.checks, e]
|
|
2652
2642
|
});
|
|
@@ -2782,19 +2772,19 @@ class we extends C {
|
|
|
2782
2772
|
return this.min(1, _.errToObj(e));
|
|
2783
2773
|
}
|
|
2784
2774
|
trim() {
|
|
2785
|
-
return new
|
|
2775
|
+
return new xe({
|
|
2786
2776
|
...this._def,
|
|
2787
2777
|
checks: [...this._def.checks, { kind: "trim" }]
|
|
2788
2778
|
});
|
|
2789
2779
|
}
|
|
2790
2780
|
toLowerCase() {
|
|
2791
|
-
return new
|
|
2781
|
+
return new xe({
|
|
2792
2782
|
...this._def,
|
|
2793
2783
|
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
2794
2784
|
});
|
|
2795
2785
|
}
|
|
2796
2786
|
toUpperCase() {
|
|
2797
|
-
return new
|
|
2787
|
+
return new xe({
|
|
2798
2788
|
...this._def,
|
|
2799
2789
|
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
2800
2790
|
});
|
|
@@ -2860,13 +2850,13 @@ class we extends C {
|
|
|
2860
2850
|
return e;
|
|
2861
2851
|
}
|
|
2862
2852
|
}
|
|
2863
|
-
|
|
2853
|
+
xe.create = (r) => new xe({
|
|
2864
2854
|
checks: [],
|
|
2865
2855
|
typeName: x.ZodString,
|
|
2866
2856
|
coerce: (r == null ? void 0 : r.coerce) ?? !1,
|
|
2867
2857
|
...E(r)
|
|
2868
2858
|
});
|
|
2869
|
-
function
|
|
2859
|
+
function vi(r, e) {
|
|
2870
2860
|
const t = (r.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, s = t > n ? t : n, a = Number.parseInt(r.toFixed(s).replace(".", "")), i = Number.parseInt(e.toFixed(s).replace(".", ""));
|
|
2871
2861
|
return a % i / 10 ** s;
|
|
2872
2862
|
}
|
|
@@ -2884,9 +2874,9 @@ class rt extends C {
|
|
|
2884
2874
|
}), w;
|
|
2885
2875
|
}
|
|
2886
2876
|
let n;
|
|
2887
|
-
const s = new
|
|
2877
|
+
const s = new G();
|
|
2888
2878
|
for (const a of this._def.checks)
|
|
2889
|
-
a.kind === "int" ?
|
|
2879
|
+
a.kind === "int" ? T.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
2890
2880
|
code: c.invalid_type,
|
|
2891
2881
|
expected: "integer",
|
|
2892
2882
|
received: "float",
|
|
@@ -2905,14 +2895,14 @@ class rt extends C {
|
|
|
2905
2895
|
inclusive: a.inclusive,
|
|
2906
2896
|
exact: !1,
|
|
2907
2897
|
message: a.message
|
|
2908
|
-
}), s.dirty()) : a.kind === "multipleOf" ?
|
|
2898
|
+
}), s.dirty()) : a.kind === "multipleOf" ? vi(e.data, a.value) !== 0 && (n = this._getOrReturnCtx(e, n), h(n, {
|
|
2909
2899
|
code: c.not_multiple_of,
|
|
2910
2900
|
multipleOf: a.value,
|
|
2911
2901
|
message: a.message
|
|
2912
2902
|
}), s.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
2913
2903
|
code: c.not_finite,
|
|
2914
2904
|
message: a.message
|
|
2915
|
-
}), s.dirty()) :
|
|
2905
|
+
}), s.dirty()) : T.assertNever(a);
|
|
2916
2906
|
return { status: s.value, value: e.data };
|
|
2917
2907
|
}
|
|
2918
2908
|
gte(e, t) {
|
|
@@ -3024,7 +3014,7 @@ class rt extends C {
|
|
|
3024
3014
|
return e;
|
|
3025
3015
|
}
|
|
3026
3016
|
get isInt() {
|
|
3027
|
-
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" &&
|
|
3017
|
+
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && T.isInteger(e.value));
|
|
3028
3018
|
}
|
|
3029
3019
|
get isFinite() {
|
|
3030
3020
|
let e = null, t = null;
|
|
@@ -3042,7 +3032,7 @@ rt.create = (r) => new rt({
|
|
|
3042
3032
|
coerce: (r == null ? void 0 : r.coerce) || !1,
|
|
3043
3033
|
...E(r)
|
|
3044
3034
|
});
|
|
3045
|
-
class
|
|
3035
|
+
class wt extends C {
|
|
3046
3036
|
constructor() {
|
|
3047
3037
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
3048
3038
|
}
|
|
@@ -3056,7 +3046,7 @@ class kt extends C {
|
|
|
3056
3046
|
if (this._getType(e) !== v.bigint)
|
|
3057
3047
|
return this._getInvalidInput(e);
|
|
3058
3048
|
let n;
|
|
3059
|
-
const s = new
|
|
3049
|
+
const s = new G();
|
|
3060
3050
|
for (const a of this._def.checks)
|
|
3061
3051
|
a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (n = this._getOrReturnCtx(e, n), h(n, {
|
|
3062
3052
|
code: c.too_small,
|
|
@@ -3074,7 +3064,7 @@ class kt extends C {
|
|
|
3074
3064
|
code: c.not_multiple_of,
|
|
3075
3065
|
multipleOf: a.value,
|
|
3076
3066
|
message: a.message
|
|
3077
|
-
}), s.dirty()) :
|
|
3067
|
+
}), s.dirty()) : T.assertNever(a);
|
|
3078
3068
|
return { status: s.value, value: e.data };
|
|
3079
3069
|
}
|
|
3080
3070
|
_getInvalidInput(e) {
|
|
@@ -3098,7 +3088,7 @@ class kt extends C {
|
|
|
3098
3088
|
return this.setLimit("max", e, !1, _.toString(t));
|
|
3099
3089
|
}
|
|
3100
3090
|
setLimit(e, t, n, s) {
|
|
3101
|
-
return new
|
|
3091
|
+
return new wt({
|
|
3102
3092
|
...this._def,
|
|
3103
3093
|
checks: [
|
|
3104
3094
|
...this._def.checks,
|
|
@@ -3112,7 +3102,7 @@ class kt extends C {
|
|
|
3112
3102
|
});
|
|
3113
3103
|
}
|
|
3114
3104
|
_addCheck(e) {
|
|
3115
|
-
return new
|
|
3105
|
+
return new wt({
|
|
3116
3106
|
...this._def,
|
|
3117
3107
|
checks: [...this._def.checks, e]
|
|
3118
3108
|
});
|
|
@@ -3169,13 +3159,13 @@ class kt extends C {
|
|
|
3169
3159
|
return e;
|
|
3170
3160
|
}
|
|
3171
3161
|
}
|
|
3172
|
-
|
|
3162
|
+
wt.create = (r) => new wt({
|
|
3173
3163
|
checks: [],
|
|
3174
3164
|
typeName: x.ZodBigInt,
|
|
3175
3165
|
coerce: (r == null ? void 0 : r.coerce) ?? !1,
|
|
3176
3166
|
...E(r)
|
|
3177
3167
|
});
|
|
3178
|
-
class
|
|
3168
|
+
class yr extends C {
|
|
3179
3169
|
_parse(e) {
|
|
3180
3170
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== v.boolean) {
|
|
3181
3171
|
const n = this._getOrReturnCtx(e);
|
|
@@ -3185,15 +3175,15 @@ class _r extends C {
|
|
|
3185
3175
|
received: n.parsedType
|
|
3186
3176
|
}), w;
|
|
3187
3177
|
}
|
|
3188
|
-
return
|
|
3178
|
+
return H(e.data);
|
|
3189
3179
|
}
|
|
3190
3180
|
}
|
|
3191
|
-
|
|
3181
|
+
yr.create = (r) => new yr({
|
|
3192
3182
|
typeName: x.ZodBoolean,
|
|
3193
3183
|
coerce: (r == null ? void 0 : r.coerce) || !1,
|
|
3194
3184
|
...E(r)
|
|
3195
3185
|
});
|
|
3196
|
-
class
|
|
3186
|
+
class Ht extends C {
|
|
3197
3187
|
_parse(e) {
|
|
3198
3188
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== v.date) {
|
|
3199
3189
|
const a = this._getOrReturnCtx(e);
|
|
@@ -3209,7 +3199,7 @@ class Wt extends C {
|
|
|
3209
3199
|
code: c.invalid_date
|
|
3210
3200
|
}), w;
|
|
3211
3201
|
}
|
|
3212
|
-
const n = new
|
|
3202
|
+
const n = new G();
|
|
3213
3203
|
let s;
|
|
3214
3204
|
for (const a of this._def.checks)
|
|
3215
3205
|
a.kind === "min" ? e.data.getTime() < a.value && (s = this._getOrReturnCtx(e, s), h(s, {
|
|
@@ -3226,14 +3216,14 @@ class Wt extends C {
|
|
|
3226
3216
|
exact: !1,
|
|
3227
3217
|
maximum: a.value,
|
|
3228
3218
|
type: "date"
|
|
3229
|
-
}), n.dirty()) :
|
|
3219
|
+
}), n.dirty()) : T.assertNever(a);
|
|
3230
3220
|
return {
|
|
3231
3221
|
status: n.value,
|
|
3232
3222
|
value: new Date(e.data.getTime())
|
|
3233
3223
|
};
|
|
3234
3224
|
}
|
|
3235
3225
|
_addCheck(e) {
|
|
3236
|
-
return new
|
|
3226
|
+
return new Ht({
|
|
3237
3227
|
...this._def,
|
|
3238
3228
|
checks: [...this._def.checks, e]
|
|
3239
3229
|
});
|
|
@@ -3265,13 +3255,13 @@ class Wt extends C {
|
|
|
3265
3255
|
return e != null ? new Date(e) : null;
|
|
3266
3256
|
}
|
|
3267
3257
|
}
|
|
3268
|
-
|
|
3258
|
+
Ht.create = (r) => new Ht({
|
|
3269
3259
|
checks: [],
|
|
3270
3260
|
coerce: (r == null ? void 0 : r.coerce) || !1,
|
|
3271
3261
|
typeName: x.ZodDate,
|
|
3272
3262
|
...E(r)
|
|
3273
3263
|
});
|
|
3274
|
-
class
|
|
3264
|
+
class _n extends C {
|
|
3275
3265
|
_parse(e) {
|
|
3276
3266
|
if (this._getType(e) !== v.symbol) {
|
|
3277
3267
|
const n = this._getOrReturnCtx(e);
|
|
@@ -3281,14 +3271,14 @@ class vn extends C {
|
|
|
3281
3271
|
received: n.parsedType
|
|
3282
3272
|
}), w;
|
|
3283
3273
|
}
|
|
3284
|
-
return
|
|
3274
|
+
return H(e.data);
|
|
3285
3275
|
}
|
|
3286
3276
|
}
|
|
3287
|
-
|
|
3277
|
+
_n.create = (r) => new _n({
|
|
3288
3278
|
typeName: x.ZodSymbol,
|
|
3289
3279
|
...E(r)
|
|
3290
3280
|
});
|
|
3291
|
-
class
|
|
3281
|
+
class gn extends C {
|
|
3292
3282
|
_parse(e) {
|
|
3293
3283
|
if (this._getType(e) !== v.undefined) {
|
|
3294
3284
|
const n = this._getOrReturnCtx(e);
|
|
@@ -3298,14 +3288,14 @@ class _n extends C {
|
|
|
3298
3288
|
received: n.parsedType
|
|
3299
3289
|
}), w;
|
|
3300
3290
|
}
|
|
3301
|
-
return
|
|
3291
|
+
return H(e.data);
|
|
3302
3292
|
}
|
|
3303
3293
|
}
|
|
3304
|
-
|
|
3294
|
+
gn.create = (r) => new gn({
|
|
3305
3295
|
typeName: x.ZodUndefined,
|
|
3306
3296
|
...E(r)
|
|
3307
3297
|
});
|
|
3308
|
-
class
|
|
3298
|
+
class yn extends C {
|
|
3309
3299
|
_parse(e) {
|
|
3310
3300
|
if (this._getType(e) !== v.null) {
|
|
3311
3301
|
const n = this._getOrReturnCtx(e);
|
|
@@ -3315,38 +3305,38 @@ class gn extends C {
|
|
|
3315
3305
|
received: n.parsedType
|
|
3316
3306
|
}), w;
|
|
3317
3307
|
}
|
|
3318
|
-
return
|
|
3308
|
+
return H(e.data);
|
|
3319
3309
|
}
|
|
3320
3310
|
}
|
|
3321
|
-
|
|
3311
|
+
yn.create = (r) => new yn({
|
|
3322
3312
|
typeName: x.ZodNull,
|
|
3323
3313
|
...E(r)
|
|
3324
3314
|
});
|
|
3325
|
-
class
|
|
3315
|
+
class wr extends C {
|
|
3326
3316
|
constructor() {
|
|
3327
3317
|
super(...arguments), this._any = !0;
|
|
3328
3318
|
}
|
|
3329
3319
|
_parse(e) {
|
|
3330
|
-
return
|
|
3320
|
+
return H(e.data);
|
|
3331
3321
|
}
|
|
3332
3322
|
}
|
|
3333
|
-
|
|
3323
|
+
wr.create = (r) => new wr({
|
|
3334
3324
|
typeName: x.ZodAny,
|
|
3335
3325
|
...E(r)
|
|
3336
3326
|
});
|
|
3337
|
-
class
|
|
3327
|
+
class Xe extends C {
|
|
3338
3328
|
constructor() {
|
|
3339
3329
|
super(...arguments), this._unknown = !0;
|
|
3340
3330
|
}
|
|
3341
3331
|
_parse(e) {
|
|
3342
|
-
return
|
|
3332
|
+
return H(e.data);
|
|
3343
3333
|
}
|
|
3344
3334
|
}
|
|
3345
|
-
|
|
3335
|
+
Xe.create = (r) => new Xe({
|
|
3346
3336
|
typeName: x.ZodUnknown,
|
|
3347
3337
|
...E(r)
|
|
3348
3338
|
});
|
|
3349
|
-
class
|
|
3339
|
+
class Ce extends C {
|
|
3350
3340
|
_parse(e) {
|
|
3351
3341
|
const t = this._getOrReturnCtx(e);
|
|
3352
3342
|
return h(t, {
|
|
@@ -3356,11 +3346,11 @@ class Se extends C {
|
|
|
3356
3346
|
}), w;
|
|
3357
3347
|
}
|
|
3358
3348
|
}
|
|
3359
|
-
|
|
3349
|
+
Ce.create = (r) => new Ce({
|
|
3360
3350
|
typeName: x.ZodNever,
|
|
3361
3351
|
...E(r)
|
|
3362
3352
|
});
|
|
3363
|
-
class
|
|
3353
|
+
class xr extends C {
|
|
3364
3354
|
_parse(e) {
|
|
3365
3355
|
if (this._getType(e) !== v.undefined) {
|
|
3366
3356
|
const n = this._getOrReturnCtx(e);
|
|
@@ -3370,14 +3360,14 @@ class yr extends C {
|
|
|
3370
3360
|
received: n.parsedType
|
|
3371
3361
|
}), w;
|
|
3372
3362
|
}
|
|
3373
|
-
return
|
|
3363
|
+
return H(e.data);
|
|
3374
3364
|
}
|
|
3375
3365
|
}
|
|
3376
|
-
|
|
3366
|
+
xr.create = (r) => new xr({
|
|
3377
3367
|
typeName: x.ZodVoid,
|
|
3378
3368
|
...E(r)
|
|
3379
3369
|
});
|
|
3380
|
-
class
|
|
3370
|
+
class le extends C {
|
|
3381
3371
|
_parse(e) {
|
|
3382
3372
|
const { ctx: t, status: n } = this._processInputParams(e), s = this._def;
|
|
3383
3373
|
if (t.parsedType !== v.array)
|
|
@@ -3413,27 +3403,27 @@ class ie extends C {
|
|
|
3413
3403
|
exact: !1,
|
|
3414
3404
|
message: s.maxLength.message
|
|
3415
3405
|
}), n.dirty()), t.common.async)
|
|
3416
|
-
return Promise.all([...t.data].map((i, o) => s.type._parseAsync(new
|
|
3417
|
-
const a = [...t.data].map((i, o) => s.type._parseSync(new
|
|
3418
|
-
return
|
|
3406
|
+
return Promise.all([...t.data].map((i, o) => s.type._parseAsync(new Se(t, i, t.path, o)))).then((i) => G.mergeArray(n, i));
|
|
3407
|
+
const a = [...t.data].map((i, o) => s.type._parseSync(new Se(t, i, t.path, o)));
|
|
3408
|
+
return G.mergeArray(n, a);
|
|
3419
3409
|
}
|
|
3420
3410
|
get element() {
|
|
3421
3411
|
return this._def.type;
|
|
3422
3412
|
}
|
|
3423
3413
|
min(e, t) {
|
|
3424
|
-
return new
|
|
3414
|
+
return new le({
|
|
3425
3415
|
...this._def,
|
|
3426
3416
|
minLength: { value: e, message: _.toString(t) }
|
|
3427
3417
|
});
|
|
3428
3418
|
}
|
|
3429
3419
|
max(e, t) {
|
|
3430
|
-
return new
|
|
3420
|
+
return new le({
|
|
3431
3421
|
...this._def,
|
|
3432
3422
|
maxLength: { value: e, message: _.toString(t) }
|
|
3433
3423
|
});
|
|
3434
3424
|
}
|
|
3435
3425
|
length(e, t) {
|
|
3436
|
-
return new
|
|
3426
|
+
return new le({
|
|
3437
3427
|
...this._def,
|
|
3438
3428
|
exactLength: { value: e, message: _.toString(t) }
|
|
3439
3429
|
});
|
|
@@ -3442,7 +3432,7 @@ class ie extends C {
|
|
|
3442
3432
|
return this.min(1, e);
|
|
3443
3433
|
}
|
|
3444
3434
|
}
|
|
3445
|
-
|
|
3435
|
+
le.create = (r, e) => new le({
|
|
3446
3436
|
type: r,
|
|
3447
3437
|
minLength: null,
|
|
3448
3438
|
maxLength: null,
|
|
@@ -3450,30 +3440,30 @@ ie.create = (r, e) => new ie({
|
|
|
3450
3440
|
typeName: x.ZodArray,
|
|
3451
3441
|
...E(e)
|
|
3452
3442
|
});
|
|
3453
|
-
function
|
|
3454
|
-
if (r instanceof
|
|
3443
|
+
function Ue(r) {
|
|
3444
|
+
if (r instanceof L) {
|
|
3455
3445
|
const e = {};
|
|
3456
3446
|
for (const t in r.shape) {
|
|
3457
3447
|
const n = r.shape[t];
|
|
3458
|
-
e[t] =
|
|
3448
|
+
e[t] = be.create(Ue(n));
|
|
3459
3449
|
}
|
|
3460
|
-
return new
|
|
3450
|
+
return new L({
|
|
3461
3451
|
...r._def,
|
|
3462
3452
|
shape: () => e
|
|
3463
3453
|
});
|
|
3464
|
-
} else return r instanceof
|
|
3454
|
+
} else return r instanceof le ? new le({
|
|
3465
3455
|
...r._def,
|
|
3466
|
-
type:
|
|
3467
|
-
}) : r instanceof
|
|
3456
|
+
type: Ue(r.element)
|
|
3457
|
+
}) : r instanceof be ? be.create(Ue(r.unwrap())) : r instanceof at ? at.create(Ue(r.unwrap())) : r instanceof pe ? pe.create(r.items.map((e) => Ue(e))) : r;
|
|
3468
3458
|
}
|
|
3469
|
-
class
|
|
3459
|
+
class L extends C {
|
|
3470
3460
|
constructor() {
|
|
3471
3461
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
3472
3462
|
}
|
|
3473
3463
|
_getCached() {
|
|
3474
3464
|
if (this._cached !== null)
|
|
3475
3465
|
return this._cached;
|
|
3476
|
-
const e = this._def.shape(), t =
|
|
3466
|
+
const e = this._def.shape(), t = T.objectKeys(e);
|
|
3477
3467
|
return this._cached = { shape: e, keys: t }, this._cached;
|
|
3478
3468
|
}
|
|
3479
3469
|
_parse(e) {
|
|
@@ -3486,7 +3476,7 @@ class P extends C {
|
|
|
3486
3476
|
}), w;
|
|
3487
3477
|
}
|
|
3488
3478
|
const { status: n, ctx: s } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
|
|
3489
|
-
if (!(this._def.catchall instanceof
|
|
3479
|
+
if (!(this._def.catchall instanceof Ce && this._def.unknownKeys === "strip"))
|
|
3490
3480
|
for (const u in s.data)
|
|
3491
3481
|
i.includes(u) || o.push(u);
|
|
3492
3482
|
const l = [];
|
|
@@ -3494,11 +3484,11 @@ class P extends C {
|
|
|
3494
3484
|
const d = a[u], p = s.data[u];
|
|
3495
3485
|
l.push({
|
|
3496
3486
|
key: { status: "valid", value: u },
|
|
3497
|
-
value: d._parse(new
|
|
3487
|
+
value: d._parse(new Se(s, p, s.path, u)),
|
|
3498
3488
|
alwaysSet: u in s.data
|
|
3499
3489
|
});
|
|
3500
3490
|
}
|
|
3501
|
-
if (this._def.catchall instanceof
|
|
3491
|
+
if (this._def.catchall instanceof Ce) {
|
|
3502
3492
|
const u = this._def.unknownKeys;
|
|
3503
3493
|
if (u === "passthrough")
|
|
3504
3494
|
for (const d of o)
|
|
@@ -3519,7 +3509,7 @@ class P extends C {
|
|
|
3519
3509
|
l.push({
|
|
3520
3510
|
key: { status: "valid", value: d },
|
|
3521
3511
|
value: u._parse(
|
|
3522
|
-
new
|
|
3512
|
+
new Se(s, p, s.path, d)
|
|
3523
3513
|
//, ctx.child(key), value, getParsedType(value)
|
|
3524
3514
|
),
|
|
3525
3515
|
alwaysSet: d in s.data
|
|
@@ -3537,13 +3527,13 @@ class P extends C {
|
|
|
3537
3527
|
});
|
|
3538
3528
|
}
|
|
3539
3529
|
return u;
|
|
3540
|
-
}).then((u) =>
|
|
3530
|
+
}).then((u) => G.mergeObjectSync(n, u)) : G.mergeObjectSync(n, l);
|
|
3541
3531
|
}
|
|
3542
3532
|
get shape() {
|
|
3543
3533
|
return this._def.shape();
|
|
3544
3534
|
}
|
|
3545
3535
|
strict(e) {
|
|
3546
|
-
return _.errToObj, new
|
|
3536
|
+
return _.errToObj, new L({
|
|
3547
3537
|
...this._def,
|
|
3548
3538
|
unknownKeys: "strict",
|
|
3549
3539
|
...e !== void 0 ? {
|
|
@@ -3560,13 +3550,13 @@ class P extends C {
|
|
|
3560
3550
|
});
|
|
3561
3551
|
}
|
|
3562
3552
|
strip() {
|
|
3563
|
-
return new
|
|
3553
|
+
return new L({
|
|
3564
3554
|
...this._def,
|
|
3565
3555
|
unknownKeys: "strip"
|
|
3566
3556
|
});
|
|
3567
3557
|
}
|
|
3568
3558
|
passthrough() {
|
|
3569
|
-
return new
|
|
3559
|
+
return new L({
|
|
3570
3560
|
...this._def,
|
|
3571
3561
|
unknownKeys: "passthrough"
|
|
3572
3562
|
});
|
|
@@ -3589,7 +3579,7 @@ class P extends C {
|
|
|
3589
3579
|
// }) as any;
|
|
3590
3580
|
// };
|
|
3591
3581
|
extend(e) {
|
|
3592
|
-
return new
|
|
3582
|
+
return new L({
|
|
3593
3583
|
...this._def,
|
|
3594
3584
|
shape: () => ({
|
|
3595
3585
|
...this._def.shape(),
|
|
@@ -3603,7 +3593,7 @@ class P extends C {
|
|
|
3603
3593
|
* upgrade if you are experiencing issues.
|
|
3604
3594
|
*/
|
|
3605
3595
|
merge(e) {
|
|
3606
|
-
return new
|
|
3596
|
+
return new L({
|
|
3607
3597
|
unknownKeys: e._def.unknownKeys,
|
|
3608
3598
|
catchall: e._def.catchall,
|
|
3609
3599
|
shape: () => ({
|
|
@@ -3673,25 +3663,25 @@ class P extends C {
|
|
|
3673
3663
|
// return merged;
|
|
3674
3664
|
// }
|
|
3675
3665
|
catchall(e) {
|
|
3676
|
-
return new
|
|
3666
|
+
return new L({
|
|
3677
3667
|
...this._def,
|
|
3678
3668
|
catchall: e
|
|
3679
3669
|
});
|
|
3680
3670
|
}
|
|
3681
3671
|
pick(e) {
|
|
3682
3672
|
const t = {};
|
|
3683
|
-
for (const n of
|
|
3673
|
+
for (const n of T.objectKeys(e))
|
|
3684
3674
|
e[n] && this.shape[n] && (t[n] = this.shape[n]);
|
|
3685
|
-
return new
|
|
3675
|
+
return new L({
|
|
3686
3676
|
...this._def,
|
|
3687
3677
|
shape: () => t
|
|
3688
3678
|
});
|
|
3689
3679
|
}
|
|
3690
3680
|
omit(e) {
|
|
3691
3681
|
const t = {};
|
|
3692
|
-
for (const n of
|
|
3682
|
+
for (const n of T.objectKeys(this.shape))
|
|
3693
3683
|
e[n] || (t[n] = this.shape[n]);
|
|
3694
|
-
return new
|
|
3684
|
+
return new L({
|
|
3695
3685
|
...this._def,
|
|
3696
3686
|
shape: () => t
|
|
3697
3687
|
});
|
|
@@ -3700,61 +3690,61 @@ class P extends C {
|
|
|
3700
3690
|
* @deprecated
|
|
3701
3691
|
*/
|
|
3702
3692
|
deepPartial() {
|
|
3703
|
-
return
|
|
3693
|
+
return Ue(this);
|
|
3704
3694
|
}
|
|
3705
3695
|
partial(e) {
|
|
3706
3696
|
const t = {};
|
|
3707
|
-
for (const n of
|
|
3697
|
+
for (const n of T.objectKeys(this.shape)) {
|
|
3708
3698
|
const s = this.shape[n];
|
|
3709
3699
|
e && !e[n] ? t[n] = s : t[n] = s.optional();
|
|
3710
3700
|
}
|
|
3711
|
-
return new
|
|
3701
|
+
return new L({
|
|
3712
3702
|
...this._def,
|
|
3713
3703
|
shape: () => t
|
|
3714
3704
|
});
|
|
3715
3705
|
}
|
|
3716
3706
|
required(e) {
|
|
3717
3707
|
const t = {};
|
|
3718
|
-
for (const n of
|
|
3708
|
+
for (const n of T.objectKeys(this.shape))
|
|
3719
3709
|
if (e && !e[n])
|
|
3720
3710
|
t[n] = this.shape[n];
|
|
3721
3711
|
else {
|
|
3722
3712
|
let a = this.shape[n];
|
|
3723
|
-
for (; a instanceof
|
|
3713
|
+
for (; a instanceof be; )
|
|
3724
3714
|
a = a._def.innerType;
|
|
3725
3715
|
t[n] = a;
|
|
3726
3716
|
}
|
|
3727
|
-
return new
|
|
3717
|
+
return new L({
|
|
3728
3718
|
...this._def,
|
|
3729
3719
|
shape: () => t
|
|
3730
3720
|
});
|
|
3731
3721
|
}
|
|
3732
3722
|
keyof() {
|
|
3733
|
-
return
|
|
3723
|
+
return ms(T.objectKeys(this.shape));
|
|
3734
3724
|
}
|
|
3735
3725
|
}
|
|
3736
|
-
|
|
3726
|
+
L.create = (r, e) => new L({
|
|
3737
3727
|
shape: () => r,
|
|
3738
3728
|
unknownKeys: "strip",
|
|
3739
|
-
catchall:
|
|
3729
|
+
catchall: Ce.create(),
|
|
3740
3730
|
typeName: x.ZodObject,
|
|
3741
3731
|
...E(e)
|
|
3742
3732
|
});
|
|
3743
|
-
|
|
3733
|
+
L.strictCreate = (r, e) => new L({
|
|
3744
3734
|
shape: () => r,
|
|
3745
3735
|
unknownKeys: "strict",
|
|
3746
|
-
catchall:
|
|
3736
|
+
catchall: Ce.create(),
|
|
3747
3737
|
typeName: x.ZodObject,
|
|
3748
3738
|
...E(e)
|
|
3749
3739
|
});
|
|
3750
|
-
|
|
3740
|
+
L.lazycreate = (r, e) => new L({
|
|
3751
3741
|
shape: r,
|
|
3752
3742
|
unknownKeys: "strip",
|
|
3753
|
-
catchall:
|
|
3743
|
+
catchall: Ce.create(),
|
|
3754
3744
|
typeName: x.ZodObject,
|
|
3755
3745
|
...E(e)
|
|
3756
3746
|
});
|
|
3757
|
-
class
|
|
3747
|
+
class Yt extends C {
|
|
3758
3748
|
_parse(e) {
|
|
3759
3749
|
const { ctx: t } = this._processInputParams(e), n = this._def.options;
|
|
3760
3750
|
function s(a) {
|
|
@@ -3764,7 +3754,7 @@ class Ht extends C {
|
|
|
3764
3754
|
for (const o of a)
|
|
3765
3755
|
if (o.result.status === "dirty")
|
|
3766
3756
|
return t.common.issues.push(...o.ctx.common.issues), o.result;
|
|
3767
|
-
const i = a.map((o) => new
|
|
3757
|
+
const i = a.map((o) => new ee(o.ctx.common.issues));
|
|
3768
3758
|
return h(t, {
|
|
3769
3759
|
code: c.invalid_union,
|
|
3770
3760
|
unionErrors: i
|
|
@@ -3811,7 +3801,7 @@ class Ht extends C {
|
|
|
3811
3801
|
}
|
|
3812
3802
|
if (a)
|
|
3813
3803
|
return t.common.issues.push(...a.ctx.common.issues), a.result;
|
|
3814
|
-
const o = i.map((l) => new
|
|
3804
|
+
const o = i.map((l) => new ee(l));
|
|
3815
3805
|
return h(t, {
|
|
3816
3806
|
code: c.invalid_union,
|
|
3817
3807
|
unionErrors: o
|
|
@@ -3822,19 +3812,19 @@ class Ht extends C {
|
|
|
3822
3812
|
return this._def.options;
|
|
3823
3813
|
}
|
|
3824
3814
|
}
|
|
3825
|
-
|
|
3815
|
+
Yt.create = (r, e) => new Yt({
|
|
3826
3816
|
options: r,
|
|
3827
3817
|
typeName: x.ZodUnion,
|
|
3828
3818
|
...E(e)
|
|
3829
3819
|
});
|
|
3830
|
-
function
|
|
3831
|
-
const t =
|
|
3820
|
+
function kr(r, e) {
|
|
3821
|
+
const t = ve(r), n = ve(e);
|
|
3832
3822
|
if (r === e)
|
|
3833
3823
|
return { valid: !0, data: r };
|
|
3834
3824
|
if (t === v.object && n === v.object) {
|
|
3835
|
-
const s =
|
|
3825
|
+
const s = T.objectKeys(e), a = T.objectKeys(r).filter((o) => s.indexOf(o) !== -1), i = { ...r, ...e };
|
|
3836
3826
|
for (const o of a) {
|
|
3837
|
-
const l =
|
|
3827
|
+
const l = kr(r[o], e[o]);
|
|
3838
3828
|
if (!l.valid)
|
|
3839
3829
|
return { valid: !1 };
|
|
3840
3830
|
i[o] = l.data;
|
|
@@ -3845,7 +3835,7 @@ function wr(r, e) {
|
|
|
3845
3835
|
return { valid: !1 };
|
|
3846
3836
|
const s = [];
|
|
3847
3837
|
for (let a = 0; a < r.length; a++) {
|
|
3848
|
-
const i = r[a], o = e[a], l =
|
|
3838
|
+
const i = r[a], o = e[a], l = kr(i, o);
|
|
3849
3839
|
if (!l.valid)
|
|
3850
3840
|
return { valid: !1 };
|
|
3851
3841
|
s.push(l.data);
|
|
@@ -3853,13 +3843,13 @@ function wr(r, e) {
|
|
|
3853
3843
|
return { valid: !0, data: s };
|
|
3854
3844
|
} else return t === v.date && n === v.date && +r == +e ? { valid: !0, data: r } : { valid: !1 };
|
|
3855
3845
|
}
|
|
3856
|
-
class
|
|
3846
|
+
class Xt extends C {
|
|
3857
3847
|
_parse(e) {
|
|
3858
3848
|
const { status: t, ctx: n } = this._processInputParams(e), s = (a, i) => {
|
|
3859
|
-
if (
|
|
3849
|
+
if (pn(a) || pn(i))
|
|
3860
3850
|
return w;
|
|
3861
|
-
const o =
|
|
3862
|
-
return o.valid ? ((
|
|
3851
|
+
const o = kr(a.value, i.value);
|
|
3852
|
+
return o.valid ? ((mn(a) || mn(i)) && t.dirty(), { status: t.value, value: o.data }) : (h(n, {
|
|
3863
3853
|
code: c.invalid_intersection_types
|
|
3864
3854
|
}), w);
|
|
3865
3855
|
};
|
|
@@ -3885,13 +3875,13 @@ class Yt extends C {
|
|
|
3885
3875
|
}));
|
|
3886
3876
|
}
|
|
3887
3877
|
}
|
|
3888
|
-
|
|
3878
|
+
Xt.create = (r, e, t) => new Xt({
|
|
3889
3879
|
left: r,
|
|
3890
3880
|
right: e,
|
|
3891
3881
|
typeName: x.ZodIntersection,
|
|
3892
3882
|
...E(t)
|
|
3893
3883
|
});
|
|
3894
|
-
class
|
|
3884
|
+
class pe extends C {
|
|
3895
3885
|
_parse(e) {
|
|
3896
3886
|
const { status: t, ctx: n } = this._processInputParams(e);
|
|
3897
3887
|
if (n.parsedType !== v.array)
|
|
@@ -3917,31 +3907,31 @@ class he extends C {
|
|
|
3917
3907
|
}), t.dirty());
|
|
3918
3908
|
const a = [...n.data].map((i, o) => {
|
|
3919
3909
|
const l = this._def.items[o] || this._def.rest;
|
|
3920
|
-
return l ? l._parse(new
|
|
3910
|
+
return l ? l._parse(new Se(n, i, n.path, o)) : null;
|
|
3921
3911
|
}).filter((i) => !!i);
|
|
3922
|
-
return n.common.async ? Promise.all(a).then((i) =>
|
|
3912
|
+
return n.common.async ? Promise.all(a).then((i) => G.mergeArray(t, i)) : G.mergeArray(t, a);
|
|
3923
3913
|
}
|
|
3924
3914
|
get items() {
|
|
3925
3915
|
return this._def.items;
|
|
3926
3916
|
}
|
|
3927
3917
|
rest(e) {
|
|
3928
|
-
return new
|
|
3918
|
+
return new pe({
|
|
3929
3919
|
...this._def,
|
|
3930
3920
|
rest: e
|
|
3931
3921
|
});
|
|
3932
3922
|
}
|
|
3933
3923
|
}
|
|
3934
|
-
|
|
3924
|
+
pe.create = (r, e) => {
|
|
3935
3925
|
if (!Array.isArray(r))
|
|
3936
3926
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
3937
|
-
return new
|
|
3927
|
+
return new pe({
|
|
3938
3928
|
items: r,
|
|
3939
3929
|
typeName: x.ZodTuple,
|
|
3940
3930
|
rest: null,
|
|
3941
3931
|
...E(e)
|
|
3942
3932
|
});
|
|
3943
3933
|
};
|
|
3944
|
-
class
|
|
3934
|
+
class wn extends C {
|
|
3945
3935
|
get keySchema() {
|
|
3946
3936
|
return this._def.keyType;
|
|
3947
3937
|
}
|
|
@@ -3957,8 +3947,8 @@ class yn extends C {
|
|
|
3957
3947
|
received: n.parsedType
|
|
3958
3948
|
}), w;
|
|
3959
3949
|
const s = this._def.keyType, a = this._def.valueType, i = [...n.data.entries()].map(([o, l], u) => ({
|
|
3960
|
-
key: s._parse(new
|
|
3961
|
-
value: a._parse(new
|
|
3950
|
+
key: s._parse(new Se(n, o, n.path, [u, "key"])),
|
|
3951
|
+
value: a._parse(new Se(n, l, n.path, [u, "value"]))
|
|
3962
3952
|
}));
|
|
3963
3953
|
if (n.common.async) {
|
|
3964
3954
|
const o = /* @__PURE__ */ new Map();
|
|
@@ -3983,13 +3973,13 @@ class yn extends C {
|
|
|
3983
3973
|
}
|
|
3984
3974
|
}
|
|
3985
3975
|
}
|
|
3986
|
-
|
|
3976
|
+
wn.create = (r, e, t) => new wn({
|
|
3987
3977
|
valueType: e,
|
|
3988
3978
|
keyType: r,
|
|
3989
3979
|
typeName: x.ZodMap,
|
|
3990
3980
|
...E(t)
|
|
3991
3981
|
});
|
|
3992
|
-
class
|
|
3982
|
+
class xt extends C {
|
|
3993
3983
|
_parse(e) {
|
|
3994
3984
|
const { status: t, ctx: n } = this._processInputParams(e);
|
|
3995
3985
|
if (n.parsedType !== v.set)
|
|
@@ -4024,17 +4014,17 @@ class bt extends C {
|
|
|
4024
4014
|
}
|
|
4025
4015
|
return { status: t.value, value: u };
|
|
4026
4016
|
}
|
|
4027
|
-
const o = [...n.data.values()].map((l, u) => a._parse(new
|
|
4017
|
+
const o = [...n.data.values()].map((l, u) => a._parse(new Se(n, l, n.path, u)));
|
|
4028
4018
|
return n.common.async ? Promise.all(o).then((l) => i(l)) : i(o);
|
|
4029
4019
|
}
|
|
4030
4020
|
min(e, t) {
|
|
4031
|
-
return new
|
|
4021
|
+
return new xt({
|
|
4032
4022
|
...this._def,
|
|
4033
4023
|
minSize: { value: e, message: _.toString(t) }
|
|
4034
4024
|
});
|
|
4035
4025
|
}
|
|
4036
4026
|
max(e, t) {
|
|
4037
|
-
return new
|
|
4027
|
+
return new xt({
|
|
4038
4028
|
...this._def,
|
|
4039
4029
|
maxSize: { value: e, message: _.toString(t) }
|
|
4040
4030
|
});
|
|
@@ -4046,14 +4036,14 @@ class bt extends C {
|
|
|
4046
4036
|
return this.min(1, e);
|
|
4047
4037
|
}
|
|
4048
4038
|
}
|
|
4049
|
-
|
|
4039
|
+
xt.create = (r, e) => new xt({
|
|
4050
4040
|
valueType: r,
|
|
4051
4041
|
minSize: null,
|
|
4052
4042
|
maxSize: null,
|
|
4053
4043
|
typeName: x.ZodSet,
|
|
4054
4044
|
...E(e)
|
|
4055
4045
|
});
|
|
4056
|
-
class
|
|
4046
|
+
class pt extends C {
|
|
4057
4047
|
constructor() {
|
|
4058
4048
|
super(...arguments), this.validate = this.implement;
|
|
4059
4049
|
}
|
|
@@ -4066,10 +4056,10 @@ class vt extends C {
|
|
|
4066
4056
|
received: t.parsedType
|
|
4067
4057
|
}), w;
|
|
4068
4058
|
function n(o, l) {
|
|
4069
|
-
return
|
|
4059
|
+
return gr({
|
|
4070
4060
|
data: o,
|
|
4071
4061
|
path: t.path,
|
|
4072
|
-
errorMaps: [t.common.contextualErrorMap, t.schemaErrorMap,
|
|
4062
|
+
errorMaps: [t.common.contextualErrorMap, t.schemaErrorMap, _r(), yt].filter((u) => !!u),
|
|
4073
4063
|
issueData: {
|
|
4074
4064
|
code: c.invalid_arguments,
|
|
4075
4065
|
argumentsError: l
|
|
@@ -4077,10 +4067,10 @@ class vt extends C {
|
|
|
4077
4067
|
});
|
|
4078
4068
|
}
|
|
4079
4069
|
function s(o, l) {
|
|
4080
|
-
return
|
|
4070
|
+
return gr({
|
|
4081
4071
|
data: o,
|
|
4082
4072
|
path: t.path,
|
|
4083
|
-
errorMaps: [t.common.contextualErrorMap, t.schemaErrorMap,
|
|
4073
|
+
errorMaps: [t.common.contextualErrorMap, t.schemaErrorMap, _r(), yt].filter((u) => !!u),
|
|
4084
4074
|
issueData: {
|
|
4085
4075
|
code: c.invalid_return_type,
|
|
4086
4076
|
returnTypeError: l
|
|
@@ -4088,10 +4078,10 @@ class vt extends C {
|
|
|
4088
4078
|
});
|
|
4089
4079
|
}
|
|
4090
4080
|
const a = { errorMap: t.common.contextualErrorMap }, i = t.data;
|
|
4091
|
-
if (this._def.returns instanceof
|
|
4081
|
+
if (this._def.returns instanceof kt) {
|
|
4092
4082
|
const o = this;
|
|
4093
|
-
return
|
|
4094
|
-
const u = new
|
|
4083
|
+
return H(async function(...l) {
|
|
4084
|
+
const u = new ee([]), d = await o._def.args.parseAsync(l, a).catch((m) => {
|
|
4095
4085
|
throw u.addIssue(n(l, m)), u;
|
|
4096
4086
|
}), p = await Reflect.apply(i, this, d);
|
|
4097
4087
|
return await o._def.returns._def.type.parseAsync(p, a).catch((m) => {
|
|
@@ -4100,13 +4090,13 @@ class vt extends C {
|
|
|
4100
4090
|
});
|
|
4101
4091
|
} else {
|
|
4102
4092
|
const o = this;
|
|
4103
|
-
return
|
|
4093
|
+
return H(function(...l) {
|
|
4104
4094
|
const u = o._def.args.safeParse(l, a);
|
|
4105
4095
|
if (!u.success)
|
|
4106
|
-
throw new
|
|
4096
|
+
throw new ee([n(l, u.error)]);
|
|
4107
4097
|
const d = Reflect.apply(i, this, u.data), p = o._def.returns.safeParse(d, a);
|
|
4108
4098
|
if (!p.success)
|
|
4109
|
-
throw new
|
|
4099
|
+
throw new ee([s(d, p.error)]);
|
|
4110
4100
|
return p.data;
|
|
4111
4101
|
});
|
|
4112
4102
|
}
|
|
@@ -4118,13 +4108,13 @@ class vt extends C {
|
|
|
4118
4108
|
return this._def.returns;
|
|
4119
4109
|
}
|
|
4120
4110
|
args(...e) {
|
|
4121
|
-
return new
|
|
4111
|
+
return new pt({
|
|
4122
4112
|
...this._def,
|
|
4123
|
-
args:
|
|
4113
|
+
args: pe.create(e).rest(Xe.create())
|
|
4124
4114
|
});
|
|
4125
4115
|
}
|
|
4126
4116
|
returns(e) {
|
|
4127
|
-
return new
|
|
4117
|
+
return new pt({
|
|
4128
4118
|
...this._def,
|
|
4129
4119
|
returns: e
|
|
4130
4120
|
});
|
|
@@ -4136,15 +4126,15 @@ class vt extends C {
|
|
|
4136
4126
|
return this.parse(e);
|
|
4137
4127
|
}
|
|
4138
4128
|
static create(e, t, n) {
|
|
4139
|
-
return new
|
|
4140
|
-
args: e ||
|
|
4141
|
-
returns: t ||
|
|
4129
|
+
return new pt({
|
|
4130
|
+
args: e || pe.create([]).rest(Xe.create()),
|
|
4131
|
+
returns: t || Xe.create(),
|
|
4142
4132
|
typeName: x.ZodFunction,
|
|
4143
4133
|
...E(n)
|
|
4144
4134
|
});
|
|
4145
4135
|
}
|
|
4146
4136
|
}
|
|
4147
|
-
class
|
|
4137
|
+
class xn extends C {
|
|
4148
4138
|
get schema() {
|
|
4149
4139
|
return this._def.getter();
|
|
4150
4140
|
}
|
|
@@ -4153,12 +4143,12 @@ class wn extends C {
|
|
|
4153
4143
|
return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
|
|
4154
4144
|
}
|
|
4155
4145
|
}
|
|
4156
|
-
|
|
4146
|
+
xn.create = (r, e) => new xn({
|
|
4157
4147
|
getter: r,
|
|
4158
4148
|
typeName: x.ZodLazy,
|
|
4159
4149
|
...E(e)
|
|
4160
4150
|
});
|
|
4161
|
-
class
|
|
4151
|
+
class kn extends C {
|
|
4162
4152
|
_parse(e) {
|
|
4163
4153
|
if (e.data !== this._def.value) {
|
|
4164
4154
|
const t = this._getOrReturnCtx(e);
|
|
@@ -4174,12 +4164,12 @@ class xn extends C {
|
|
|
4174
4164
|
return this._def.value;
|
|
4175
4165
|
}
|
|
4176
4166
|
}
|
|
4177
|
-
|
|
4167
|
+
kn.create = (r, e) => new kn({
|
|
4178
4168
|
value: r,
|
|
4179
4169
|
typeName: x.ZodLiteral,
|
|
4180
4170
|
...E(e)
|
|
4181
4171
|
});
|
|
4182
|
-
function
|
|
4172
|
+
function ms(r, e) {
|
|
4183
4173
|
return new nt({
|
|
4184
4174
|
values: r,
|
|
4185
4175
|
typeName: x.ZodEnum,
|
|
@@ -4191,7 +4181,7 @@ class nt extends C {
|
|
|
4191
4181
|
if (typeof e.data != "string") {
|
|
4192
4182
|
const t = this._getOrReturnCtx(e), n = this._def.values;
|
|
4193
4183
|
return h(t, {
|
|
4194
|
-
expected:
|
|
4184
|
+
expected: T.joinValues(n),
|
|
4195
4185
|
received: t.parsedType,
|
|
4196
4186
|
code: c.invalid_type
|
|
4197
4187
|
}), w;
|
|
@@ -4204,7 +4194,7 @@ class nt extends C {
|
|
|
4204
4194
|
options: n
|
|
4205
4195
|
}), w;
|
|
4206
4196
|
}
|
|
4207
|
-
return
|
|
4197
|
+
return H(e.data);
|
|
4208
4198
|
}
|
|
4209
4199
|
get options() {
|
|
4210
4200
|
return this._def.values;
|
|
@@ -4240,38 +4230,38 @@ class nt extends C {
|
|
|
4240
4230
|
});
|
|
4241
4231
|
}
|
|
4242
4232
|
}
|
|
4243
|
-
nt.create =
|
|
4244
|
-
class
|
|
4233
|
+
nt.create = ms;
|
|
4234
|
+
class bn extends C {
|
|
4245
4235
|
_parse(e) {
|
|
4246
|
-
const t =
|
|
4236
|
+
const t = T.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
4247
4237
|
if (n.parsedType !== v.string && n.parsedType !== v.number) {
|
|
4248
|
-
const s =
|
|
4238
|
+
const s = T.objectValues(t);
|
|
4249
4239
|
return h(n, {
|
|
4250
|
-
expected:
|
|
4240
|
+
expected: T.joinValues(s),
|
|
4251
4241
|
received: n.parsedType,
|
|
4252
4242
|
code: c.invalid_type
|
|
4253
4243
|
}), w;
|
|
4254
4244
|
}
|
|
4255
|
-
if (this._cache || (this._cache = new Set(
|
|
4256
|
-
const s =
|
|
4245
|
+
if (this._cache || (this._cache = new Set(T.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
|
|
4246
|
+
const s = T.objectValues(t);
|
|
4257
4247
|
return h(n, {
|
|
4258
4248
|
received: n.data,
|
|
4259
4249
|
code: c.invalid_enum_value,
|
|
4260
4250
|
options: s
|
|
4261
4251
|
}), w;
|
|
4262
4252
|
}
|
|
4263
|
-
return
|
|
4253
|
+
return H(e.data);
|
|
4264
4254
|
}
|
|
4265
4255
|
get enum() {
|
|
4266
4256
|
return this._def.values;
|
|
4267
4257
|
}
|
|
4268
4258
|
}
|
|
4269
|
-
|
|
4259
|
+
bn.create = (r, e) => new bn({
|
|
4270
4260
|
values: r,
|
|
4271
4261
|
typeName: x.ZodNativeEnum,
|
|
4272
4262
|
...E(e)
|
|
4273
4263
|
});
|
|
4274
|
-
class
|
|
4264
|
+
class kt extends C {
|
|
4275
4265
|
unwrap() {
|
|
4276
4266
|
return this._def.type;
|
|
4277
4267
|
}
|
|
@@ -4284,13 +4274,13 @@ class Et extends C {
|
|
|
4284
4274
|
received: t.parsedType
|
|
4285
4275
|
}), w;
|
|
4286
4276
|
const n = t.parsedType === v.promise ? t.data : Promise.resolve(t.data);
|
|
4287
|
-
return
|
|
4277
|
+
return H(n.then((s) => this._def.type.parseAsync(s, {
|
|
4288
4278
|
path: t.path,
|
|
4289
4279
|
errorMap: t.common.contextualErrorMap
|
|
4290
4280
|
})));
|
|
4291
4281
|
}
|
|
4292
4282
|
}
|
|
4293
|
-
|
|
4283
|
+
kt.create = (r, e) => new kt({
|
|
4294
4284
|
type: r,
|
|
4295
4285
|
typeName: x.ZodPromise,
|
|
4296
4286
|
...E(e)
|
|
@@ -4322,7 +4312,7 @@ class st extends C {
|
|
|
4322
4312
|
path: n.path,
|
|
4323
4313
|
parent: n
|
|
4324
4314
|
});
|
|
4325
|
-
return l.status === "aborted" ? w : l.status === "dirty" || t.value === "dirty" ?
|
|
4315
|
+
return l.status === "aborted" ? w : l.status === "dirty" || t.value === "dirty" ? ct(l.value) : l;
|
|
4326
4316
|
});
|
|
4327
4317
|
{
|
|
4328
4318
|
if (t.value === "aborted")
|
|
@@ -4332,7 +4322,7 @@ class st extends C {
|
|
|
4332
4322
|
path: n.path,
|
|
4333
4323
|
parent: n
|
|
4334
4324
|
});
|
|
4335
|
-
return o.status === "aborted" ? w : o.status === "dirty" || t.value === "dirty" ?
|
|
4325
|
+
return o.status === "aborted" ? w : o.status === "dirty" || t.value === "dirty" ? ct(o.value) : o;
|
|
4336
4326
|
}
|
|
4337
4327
|
}
|
|
4338
4328
|
if (s.type === "refinement") {
|
|
@@ -4372,7 +4362,7 @@ class st extends C {
|
|
|
4372
4362
|
status: t.value,
|
|
4373
4363
|
value: o
|
|
4374
4364
|
})) : w);
|
|
4375
|
-
|
|
4365
|
+
T.assertNever(s);
|
|
4376
4366
|
}
|
|
4377
4367
|
}
|
|
4378
4368
|
st.create = (r, e, t) => new st({
|
|
@@ -4387,22 +4377,22 @@ st.createWithPreprocess = (r, e, t) => new st({
|
|
|
4387
4377
|
typeName: x.ZodEffects,
|
|
4388
4378
|
...E(t)
|
|
4389
4379
|
});
|
|
4390
|
-
class
|
|
4380
|
+
class be extends C {
|
|
4391
4381
|
_parse(e) {
|
|
4392
|
-
return this._getType(e) === v.undefined ?
|
|
4382
|
+
return this._getType(e) === v.undefined ? H(void 0) : this._def.innerType._parse(e);
|
|
4393
4383
|
}
|
|
4394
4384
|
unwrap() {
|
|
4395
4385
|
return this._def.innerType;
|
|
4396
4386
|
}
|
|
4397
4387
|
}
|
|
4398
|
-
|
|
4388
|
+
be.create = (r, e) => new be({
|
|
4399
4389
|
innerType: r,
|
|
4400
4390
|
typeName: x.ZodOptional,
|
|
4401
4391
|
...E(e)
|
|
4402
4392
|
});
|
|
4403
4393
|
class at extends C {
|
|
4404
4394
|
_parse(e) {
|
|
4405
|
-
return this._getType(e) === v.null ?
|
|
4395
|
+
return this._getType(e) === v.null ? H(null) : this._def.innerType._parse(e);
|
|
4406
4396
|
}
|
|
4407
4397
|
unwrap() {
|
|
4408
4398
|
return this._def.innerType;
|
|
@@ -4413,7 +4403,7 @@ at.create = (r, e) => new at({
|
|
|
4413
4403
|
typeName: x.ZodNullable,
|
|
4414
4404
|
...E(e)
|
|
4415
4405
|
});
|
|
4416
|
-
class
|
|
4406
|
+
class br extends C {
|
|
4417
4407
|
_parse(e) {
|
|
4418
4408
|
const { ctx: t } = this._processInputParams(e);
|
|
4419
4409
|
let n = t.data;
|
|
@@ -4427,13 +4417,13 @@ class xr extends C {
|
|
|
4427
4417
|
return this._def.innerType;
|
|
4428
4418
|
}
|
|
4429
4419
|
}
|
|
4430
|
-
|
|
4420
|
+
br.create = (r, e) => new br({
|
|
4431
4421
|
innerType: r,
|
|
4432
4422
|
typeName: x.ZodDefault,
|
|
4433
4423
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
4434
4424
|
...E(e)
|
|
4435
4425
|
});
|
|
4436
|
-
class
|
|
4426
|
+
class Er extends C {
|
|
4437
4427
|
_parse(e) {
|
|
4438
4428
|
const { ctx: t } = this._processInputParams(e), n = {
|
|
4439
4429
|
...t,
|
|
@@ -4448,11 +4438,11 @@ class kr extends C {
|
|
|
4448
4438
|
...n
|
|
4449
4439
|
}
|
|
4450
4440
|
});
|
|
4451
|
-
return
|
|
4441
|
+
return Wt(s) ? s.then((a) => ({
|
|
4452
4442
|
status: "valid",
|
|
4453
4443
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
4454
4444
|
get error() {
|
|
4455
|
-
return new
|
|
4445
|
+
return new ee(n.common.issues);
|
|
4456
4446
|
},
|
|
4457
4447
|
input: n.data
|
|
4458
4448
|
})
|
|
@@ -4460,7 +4450,7 @@ class kr extends C {
|
|
|
4460
4450
|
status: "valid",
|
|
4461
4451
|
value: s.status === "valid" ? s.value : this._def.catchValue({
|
|
4462
4452
|
get error() {
|
|
4463
|
-
return new
|
|
4453
|
+
return new ee(n.common.issues);
|
|
4464
4454
|
},
|
|
4465
4455
|
input: n.data
|
|
4466
4456
|
})
|
|
@@ -4470,13 +4460,13 @@ class kr extends C {
|
|
|
4470
4460
|
return this._def.innerType;
|
|
4471
4461
|
}
|
|
4472
4462
|
}
|
|
4473
|
-
|
|
4463
|
+
Er.create = (r, e) => new Er({
|
|
4474
4464
|
innerType: r,
|
|
4475
4465
|
typeName: x.ZodCatch,
|
|
4476
4466
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
4477
4467
|
...E(e)
|
|
4478
4468
|
});
|
|
4479
|
-
class
|
|
4469
|
+
class En extends C {
|
|
4480
4470
|
_parse(e) {
|
|
4481
4471
|
if (this._getType(e) !== v.nan) {
|
|
4482
4472
|
const n = this._getOrReturnCtx(e);
|
|
@@ -4489,11 +4479,11 @@ class bn extends C {
|
|
|
4489
4479
|
return { status: "valid", value: e.data };
|
|
4490
4480
|
}
|
|
4491
4481
|
}
|
|
4492
|
-
|
|
4482
|
+
En.create = (r) => new En({
|
|
4493
4483
|
typeName: x.ZodNaN,
|
|
4494
4484
|
...E(r)
|
|
4495
4485
|
});
|
|
4496
|
-
class
|
|
4486
|
+
class _i extends C {
|
|
4497
4487
|
_parse(e) {
|
|
4498
4488
|
const { ctx: t } = this._processInputParams(e), n = t.data;
|
|
4499
4489
|
return this._def.type._parse({
|
|
@@ -4506,7 +4496,7 @@ class vi extends C {
|
|
|
4506
4496
|
return this._def.type;
|
|
4507
4497
|
}
|
|
4508
4498
|
}
|
|
4509
|
-
class
|
|
4499
|
+
class Br extends C {
|
|
4510
4500
|
_parse(e) {
|
|
4511
4501
|
const { status: t, ctx: n } = this._processInputParams(e);
|
|
4512
4502
|
if (n.common.async)
|
|
@@ -4516,7 +4506,7 @@ class Ur extends C {
|
|
|
4516
4506
|
path: n.path,
|
|
4517
4507
|
parent: n
|
|
4518
4508
|
});
|
|
4519
|
-
return a.status === "aborted" ? w : a.status === "dirty" ? (t.dirty(),
|
|
4509
|
+
return a.status === "aborted" ? w : a.status === "dirty" ? (t.dirty(), ct(a.value)) : this._def.out._parseAsync({
|
|
4520
4510
|
data: a.value,
|
|
4521
4511
|
path: n.path,
|
|
4522
4512
|
parent: n
|
|
@@ -4539,23 +4529,23 @@ class Ur extends C {
|
|
|
4539
4529
|
}
|
|
4540
4530
|
}
|
|
4541
4531
|
static create(e, t) {
|
|
4542
|
-
return new
|
|
4532
|
+
return new Br({
|
|
4543
4533
|
in: e,
|
|
4544
4534
|
out: t,
|
|
4545
4535
|
typeName: x.ZodPipeline
|
|
4546
4536
|
});
|
|
4547
4537
|
}
|
|
4548
4538
|
}
|
|
4549
|
-
class
|
|
4539
|
+
class Sr extends C {
|
|
4550
4540
|
_parse(e) {
|
|
4551
4541
|
const t = this._def.innerType._parse(e), n = (s) => (tt(s) && (s.value = Object.freeze(s.value)), s);
|
|
4552
|
-
return
|
|
4542
|
+
return Wt(t) ? t.then((s) => n(s)) : n(t);
|
|
4553
4543
|
}
|
|
4554
4544
|
unwrap() {
|
|
4555
4545
|
return this._def.innerType;
|
|
4556
4546
|
}
|
|
4557
4547
|
}
|
|
4558
|
-
|
|
4548
|
+
Sr.create = (r, e) => new Sr({
|
|
4559
4549
|
innerType: r,
|
|
4560
4550
|
typeName: x.ZodReadonly,
|
|
4561
4551
|
...E(e)
|
|
@@ -4564,96 +4554,96 @@ var x;
|
|
|
4564
4554
|
(function(r) {
|
|
4565
4555
|
r.ZodString = "ZodString", r.ZodNumber = "ZodNumber", r.ZodNaN = "ZodNaN", r.ZodBigInt = "ZodBigInt", r.ZodBoolean = "ZodBoolean", r.ZodDate = "ZodDate", r.ZodSymbol = "ZodSymbol", r.ZodUndefined = "ZodUndefined", r.ZodNull = "ZodNull", r.ZodAny = "ZodAny", r.ZodUnknown = "ZodUnknown", r.ZodNever = "ZodNever", r.ZodVoid = "ZodVoid", r.ZodArray = "ZodArray", r.ZodObject = "ZodObject", r.ZodUnion = "ZodUnion", r.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", r.ZodIntersection = "ZodIntersection", r.ZodTuple = "ZodTuple", r.ZodRecord = "ZodRecord", r.ZodMap = "ZodMap", r.ZodSet = "ZodSet", r.ZodFunction = "ZodFunction", r.ZodLazy = "ZodLazy", r.ZodLiteral = "ZodLiteral", r.ZodEnum = "ZodEnum", r.ZodEffects = "ZodEffects", r.ZodNativeEnum = "ZodNativeEnum", r.ZodOptional = "ZodOptional", r.ZodNullable = "ZodNullable", r.ZodDefault = "ZodDefault", r.ZodCatch = "ZodCatch", r.ZodPromise = "ZodPromise", r.ZodBranded = "ZodBranded", r.ZodPipeline = "ZodPipeline", r.ZodReadonly = "ZodReadonly";
|
|
4566
4556
|
})(x || (x = {}));
|
|
4567
|
-
const lt =
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
const
|
|
4571
|
-
Ht.create;
|
|
4557
|
+
const lt = xe.create, b = rt.create, vs = yr.create, $r = wr.create;
|
|
4558
|
+
Xe.create;
|
|
4559
|
+
Ce.create;
|
|
4560
|
+
const Ft = xr.create, qr = le.create, I = L.create;
|
|
4572
4561
|
Yt.create;
|
|
4573
|
-
|
|
4574
|
-
|
|
4562
|
+
Xt.create;
|
|
4563
|
+
const Sn = pe.create, re = pt.create, gi = nt.create, yi = kt.create;
|
|
4564
|
+
be.create;
|
|
4575
4565
|
at.create;
|
|
4576
|
-
|
|
4577
|
-
pin:
|
|
4578
|
-
fade:
|
|
4566
|
+
I({
|
|
4567
|
+
pin: I({
|
|
4568
|
+
fade: vs().optional(),
|
|
4579
4569
|
maxCount: b().optional(),
|
|
4580
4570
|
maxZoom: b().optional()
|
|
4581
4571
|
}).optional(),
|
|
4582
|
-
animation:
|
|
4583
|
-
queue:
|
|
4572
|
+
animation: I({
|
|
4573
|
+
queue: I({
|
|
4584
4574
|
limit: b().optional()
|
|
4585
4575
|
}).optional()
|
|
4586
4576
|
}).optional(),
|
|
4587
|
-
api:
|
|
4588
|
-
states:
|
|
4577
|
+
api: I({
|
|
4578
|
+
states: I({
|
|
4589
4579
|
url: lt()
|
|
4590
4580
|
}).optional()
|
|
4591
4581
|
}).optional()
|
|
4592
4582
|
});
|
|
4593
|
-
const
|
|
4594
|
-
sw:
|
|
4595
|
-
ne:
|
|
4596
|
-
}),
|
|
4583
|
+
const Cr = b().min(-90).max(90), Tr = b().min(-180).max(180), wi = I({
|
|
4584
|
+
sw: I({ lat: Cr, lng: Tr }),
|
|
4585
|
+
ne: I({ lat: Cr, lng: Tr })
|
|
4586
|
+
}), Mr = $r().refine((r) => r instanceof HTMLElement, "Must be an HTMLElement"), xi = I({
|
|
4597
4587
|
mapSize: b().min(1),
|
|
4598
4588
|
zoomMin: b().min(0),
|
|
4599
4589
|
zoomMax: b().min(0),
|
|
4600
4590
|
zoomScale: b().min(1).max(10)
|
|
4601
|
-
}),
|
|
4602
|
-
instance:
|
|
4603
|
-
inserted:
|
|
4604
|
-
insert:
|
|
4605
|
-
remove:
|
|
4606
|
-
update:
|
|
4607
|
-
}),
|
|
4608
|
-
getParameters:
|
|
4609
|
-
getContainer:
|
|
4610
|
-
getZoom:
|
|
4611
|
-
getBounds:
|
|
4612
|
-
panBy:
|
|
4613
|
-
createMarker:
|
|
4614
|
-
}),
|
|
4591
|
+
}), ki = I({
|
|
4592
|
+
instance: $r(),
|
|
4593
|
+
inserted: re().returns(vs()),
|
|
4594
|
+
insert: re().returns(Ft()),
|
|
4595
|
+
remove: re().returns(Ft()),
|
|
4596
|
+
update: re().args(b()).returns(Ft())
|
|
4597
|
+
}), bi = I({
|
|
4598
|
+
getParameters: re().args().returns(xi),
|
|
4599
|
+
getContainer: re().args().returns(Mr),
|
|
4600
|
+
getZoom: re().args().returns(b()),
|
|
4601
|
+
getBounds: re().args().returns(wi),
|
|
4602
|
+
panBy: re().args(b(), b()).returns(Ft()),
|
|
4603
|
+
createMarker: re().args(Mr, Cr, Tr, b()).returns(ki)
|
|
4604
|
+
}), or = re().args(lt()).returns(yi(Mr)), Ei = I({
|
|
4615
4605
|
id: lt().min(1),
|
|
4616
4606
|
rank: b(),
|
|
4617
4607
|
lat: b().min(-90).max(90),
|
|
4618
4608
|
lng: b().min(-180).max(180),
|
|
4619
|
-
tooltip:
|
|
4620
|
-
style:
|
|
4609
|
+
tooltip: I({
|
|
4610
|
+
style: I({
|
|
4621
4611
|
width: b(),
|
|
4622
4612
|
height: b(),
|
|
4623
4613
|
margin: b(),
|
|
4624
4614
|
radius: b()
|
|
4625
4615
|
}).refine((r) => Math.min(r.width, r.height) / r.margin >= 5, "Tooltip width and height must be at least 5 times the margin"),
|
|
4626
|
-
body:
|
|
4616
|
+
body: or
|
|
4627
4617
|
}),
|
|
4628
|
-
pin:
|
|
4629
|
-
style:
|
|
4618
|
+
pin: I({
|
|
4619
|
+
style: I({
|
|
4630
4620
|
width: b(),
|
|
4631
4621
|
height: b(),
|
|
4632
4622
|
radius: b()
|
|
4633
4623
|
}),
|
|
4634
|
-
body:
|
|
4624
|
+
body: or
|
|
4635
4625
|
}).optional(),
|
|
4636
|
-
popup:
|
|
4637
|
-
style:
|
|
4626
|
+
popup: I({
|
|
4627
|
+
style: I({
|
|
4638
4628
|
width: b(),
|
|
4639
4629
|
height: b(),
|
|
4640
4630
|
radius: b(),
|
|
4641
4631
|
margin: b()
|
|
4642
4632
|
}),
|
|
4643
|
-
body:
|
|
4633
|
+
body: or
|
|
4644
4634
|
}).optional()
|
|
4645
|
-
}),
|
|
4635
|
+
}), Si = qr(Ei);
|
|
4646
4636
|
var Le;
|
|
4647
4637
|
((r) => {
|
|
4648
4638
|
r.COUNT = 12, r.DEGREES = [0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330], r.DEGREES_DEFAULT = 270;
|
|
4649
4639
|
})(Le || (Le = {}));
|
|
4650
|
-
|
|
4651
|
-
const
|
|
4640
|
+
Sn([b(), qr(Sn([b(), b()]))]);
|
|
4641
|
+
const _s = I({
|
|
4652
4642
|
mapSize: b().min(1),
|
|
4653
4643
|
zoomMin: b().min(0).max(24),
|
|
4654
4644
|
zoomMax: b().min(0).max(24),
|
|
4655
4645
|
zoomScale: b().min(1).max(10)
|
|
4656
|
-
}),
|
|
4646
|
+
}), Ci = I({
|
|
4657
4647
|
id: lt(),
|
|
4658
4648
|
rank: b(),
|
|
4659
4649
|
lat: b(),
|
|
@@ -4662,19 +4652,19 @@ const vs = N({
|
|
|
4662
4652
|
height: b(),
|
|
4663
4653
|
margin: b()
|
|
4664
4654
|
});
|
|
4665
|
-
|
|
4655
|
+
I({
|
|
4666
4656
|
key: lt(),
|
|
4667
|
-
parameters:
|
|
4668
|
-
input:
|
|
4657
|
+
parameters: _s,
|
|
4658
|
+
input: qr(Ci)
|
|
4669
4659
|
});
|
|
4670
|
-
const
|
|
4671
|
-
|
|
4660
|
+
const Ti = gi(["info", "warn", "error"]);
|
|
4661
|
+
I({
|
|
4672
4662
|
title: lt(),
|
|
4673
|
-
level:
|
|
4674
|
-
content:
|
|
4663
|
+
level: Ti,
|
|
4664
|
+
content: $r()
|
|
4675
4665
|
});
|
|
4676
|
-
const
|
|
4677
|
-
class
|
|
4666
|
+
const Cn = "1.0.207", gs = "https://maps.api.arenarium.dev", Mi = `${gs}/log`, Ai = `${gs}/tooltip/states`;
|
|
4667
|
+
class Di {
|
|
4678
4668
|
constructor(e, t, n) {
|
|
4679
4669
|
f(this, "apiKey");
|
|
4680
4670
|
f(this, "apiStatesUrl");
|
|
@@ -4686,14 +4676,14 @@ class Li {
|
|
|
4686
4676
|
f(this, "markerPinProcessor");
|
|
4687
4677
|
f(this, "markerTooltipProcessor");
|
|
4688
4678
|
f(this, "markerPopupProcessor");
|
|
4689
|
-
|
|
4679
|
+
bi.parse(t), this.apiKey = e, this.apiDevEnvironment = (window == null ? void 0 : window.location.host.startsWith("localhost")) || (window == null ? void 0 : window.location.host.startsWith("127.0.0.1")), this.mapProvider = t, this.markerPinProcessor = new Or(t), this.markerTooltipProcessor = new Ni(t), this.markerPopupProcessor = new Ri(t), this.configuration = n, this.log("info", "Loaded");
|
|
4690
4680
|
}
|
|
4691
4681
|
set configuration(e) {
|
|
4692
4682
|
var t, n, s, a;
|
|
4693
|
-
this.markerPinProcessor.setConfiguration(e), this.apiStatesUrl = ((n = (t = e == null ? void 0 : e.api) == null ? void 0 : t.states) == null ? void 0 : n.url) ?? void 0,
|
|
4683
|
+
this.markerPinProcessor.setConfiguration(e), this.apiStatesUrl = ((n = (t = e == null ? void 0 : e.api) == null ? void 0 : t.states) == null ? void 0 : n.url) ?? void 0, _e.setLimit(((a = (s = e == null ? void 0 : e.animation) == null ? void 0 : s.queue) == null ? void 0 : a.limit) ?? 8 * navigator.hardwareConcurrency);
|
|
4694
4684
|
}
|
|
4695
4685
|
async updateMarkers(e) {
|
|
4696
|
-
|
|
4686
|
+
Si.parse(e);
|
|
4697
4687
|
try {
|
|
4698
4688
|
await this.updateMarkerData(e), this.processMarkerDataCallback();
|
|
4699
4689
|
} catch (t) {
|
|
@@ -4744,7 +4734,7 @@ class Li {
|
|
|
4744
4734
|
let n;
|
|
4745
4735
|
if (e.length > 1) {
|
|
4746
4736
|
const s = this.mapProvider.getParameters();
|
|
4747
|
-
|
|
4737
|
+
_s.parse(s);
|
|
4748
4738
|
const a = t.map((u) => ({
|
|
4749
4739
|
id: u.id,
|
|
4750
4740
|
rank: u.rank,
|
|
@@ -4757,7 +4747,7 @@ class Li {
|
|
|
4757
4747
|
key: this.apiKey,
|
|
4758
4748
|
parameters: s,
|
|
4759
4749
|
input: a
|
|
4760
|
-
}, o = this.apiStatesUrl ??
|
|
4750
|
+
}, o = this.apiStatesUrl ?? Ai, l = await fetch(o, {
|
|
4761
4751
|
method: "POST",
|
|
4762
4752
|
headers: {
|
|
4763
4753
|
"Content-Type": "application/json",
|
|
@@ -4777,11 +4767,11 @@ class Li {
|
|
|
4777
4767
|
if (o)
|
|
4778
4768
|
o.update(i);
|
|
4779
4769
|
else {
|
|
4780
|
-
const l = new
|
|
4770
|
+
const l = new Oi(this.mapProvider, a, i);
|
|
4781
4771
|
l.create(), this.markerDataMap.set(a.id, l), this.markerDataArray.push(l);
|
|
4782
4772
|
}
|
|
4783
4773
|
}
|
|
4784
|
-
this.markerDataArray.sort((s, a) => s.zoom - a.zoom), this.markerPinProcessor.updateElements(this.markerDataArray.map((s) => s.pin)), this.markerTooltipProcessor.updateElements(this.markerDataArray.map((s) => s.tooltip));
|
|
4774
|
+
this.markerDataArray.sort((s, a) => s.zoom - a.zoom), this.markerPinProcessor.updateElements(this.markerDataArray.map((s) => s.pin)), this.markerTooltipProcessor.updateElements(this.markerDataArray.map((s) => s.tooltip)), this.markerPopupProcessor.updateElements(this.markerDataArray.map((s) => s.popup));
|
|
4785
4775
|
} finally {
|
|
4786
4776
|
this.markerDataUpdating = !1;
|
|
4787
4777
|
}
|
|
@@ -4793,7 +4783,7 @@ class Li {
|
|
|
4793
4783
|
}
|
|
4794
4784
|
removeMarkerData() {
|
|
4795
4785
|
try {
|
|
4796
|
-
this.markerDataUpdating = !0, this.markerPinProcessor.removeElements(), this.markerTooltipProcessor.removeElements(), this.markerPopupProcessor.
|
|
4786
|
+
this.markerDataUpdating = !0, this.markerPinProcessor.removeElements(), this.markerTooltipProcessor.removeElements(), this.markerPopupProcessor.removeElements(), this.markerDataArray.length = 0, this.markerDataMap.clear();
|
|
4797
4787
|
} catch (e) {
|
|
4798
4788
|
throw console.error(e), e instanceof Error && this.log("error", "Failed to remove marker data", e), e;
|
|
4799
4789
|
} finally {
|
|
@@ -4817,14 +4807,14 @@ class Li {
|
|
|
4817
4807
|
if (!this.apiDevEnvironment)
|
|
4818
4808
|
try {
|
|
4819
4809
|
const s = {
|
|
4820
|
-
title: `[CLIENT:${
|
|
4810
|
+
title: `[CLIENT:${Cn}] ${t}`,
|
|
4821
4811
|
level: e,
|
|
4822
4812
|
content: {
|
|
4823
|
-
version:
|
|
4813
|
+
version: Cn,
|
|
4824
4814
|
...n
|
|
4825
4815
|
}
|
|
4826
4816
|
};
|
|
4827
|
-
await fetch(
|
|
4817
|
+
await fetch(Mi, {
|
|
4828
4818
|
method: "POST",
|
|
4829
4819
|
headers: { "Content-Type": "application/json" },
|
|
4830
4820
|
body: JSON.stringify(s)
|
|
@@ -4834,25 +4824,26 @@ class Li {
|
|
|
4834
4824
|
}
|
|
4835
4825
|
}
|
|
4836
4826
|
}
|
|
4837
|
-
class
|
|
4827
|
+
class Oi {
|
|
4838
4828
|
constructor(e, t, n) {
|
|
4839
4829
|
f(this, "marker");
|
|
4840
4830
|
f(this, "zoom");
|
|
4841
4831
|
f(this, "pin");
|
|
4842
4832
|
f(this, "tooltip");
|
|
4843
|
-
|
|
4833
|
+
f(this, "popup");
|
|
4834
|
+
this.marker = t, this.zoom = n[0], this.pin = new Ar(e, t, n), this.tooltip = new Nr(e, t, n), this.popup = new Rr(e, t);
|
|
4844
4835
|
}
|
|
4845
4836
|
create() {
|
|
4846
|
-
this.pin.create(), this.tooltip.create();
|
|
4837
|
+
this.pin.create(), this.tooltip.create(), this.popup.create();
|
|
4847
4838
|
}
|
|
4848
4839
|
update(e) {
|
|
4849
4840
|
this.pin.update(e), this.tooltip.update(e);
|
|
4850
4841
|
}
|
|
4851
4842
|
remove() {
|
|
4852
|
-
this.pin.remove(), this.tooltip.remove();
|
|
4843
|
+
this.pin.remove(), this.tooltip.remove(), this.popup.remove();
|
|
4853
4844
|
}
|
|
4854
4845
|
}
|
|
4855
|
-
class
|
|
4846
|
+
class Wr {
|
|
4856
4847
|
constructor(e, t) {
|
|
4857
4848
|
f(this, "provider");
|
|
4858
4849
|
f(this, "id");
|
|
@@ -4888,11 +4879,11 @@ class qr {
|
|
|
4888
4879
|
throw new Error("Get z-index not implemented");
|
|
4889
4880
|
}
|
|
4890
4881
|
remove() {
|
|
4891
|
-
var e
|
|
4892
|
-
(e = this.marker) == null || e.remove()
|
|
4882
|
+
var e;
|
|
4883
|
+
(e = this.marker) == null || e.remove();
|
|
4893
4884
|
}
|
|
4894
4885
|
}
|
|
4895
|
-
const
|
|
4886
|
+
const qe = class qe extends Wr {
|
|
4896
4887
|
constructor(t, n, s) {
|
|
4897
4888
|
var a, i, o, l;
|
|
4898
4889
|
super(t, n);
|
|
@@ -4903,14 +4894,14 @@ const $e = class $e extends qr {
|
|
|
4903
4894
|
f(this, "bodyLoading", !1);
|
|
4904
4895
|
f(this, "bodyLoaded", !1);
|
|
4905
4896
|
f(this, "bodyCallback");
|
|
4906
|
-
this.width = ((a = n.pin) == null ? void 0 : a.style.width) ??
|
|
4897
|
+
this.width = ((a = n.pin) == null ? void 0 : a.style.width) ?? qe.DEFAULT_SIZE, this.height = ((i = n.pin) == null ? void 0 : i.style.height) ?? qe.DEFAULT_SIZE, this.radius = ((o = n.pin) == null ? void 0 : o.style.radius) ?? qe.DEFAULT_SIZE, this.zoom = s[0], this.bodyCallback = (l = n.pin) == null ? void 0 : l.body;
|
|
4907
4898
|
}
|
|
4908
4899
|
createElement() {
|
|
4909
|
-
this.element = document.createElement("div"), this.element.classList.add("pin"), this.component =
|
|
4900
|
+
this.element = document.createElement("div"), this.element.classList.add("pin"), this.component = Ur(Wa, {
|
|
4910
4901
|
target: this.element,
|
|
4911
4902
|
props: {
|
|
4912
4903
|
id: this.id + "_pin",
|
|
4913
|
-
layer:
|
|
4904
|
+
layer: Ba,
|
|
4914
4905
|
priority: this.zoom * this.provider.getParameters().zoomScale,
|
|
4915
4906
|
width: this.width,
|
|
4916
4907
|
height: this.height,
|
|
@@ -4925,10 +4916,6 @@ const $e = class $e extends qr {
|
|
|
4925
4916
|
var n;
|
|
4926
4917
|
super.updateMap(t), (n = this.component) == null || n.setDisplayed(t);
|
|
4927
4918
|
}
|
|
4928
|
-
updateState(t) {
|
|
4929
|
-
if (this.component == null) throw new Error("Failed to update pin state");
|
|
4930
|
-
this.component.setScale(this.getScale(t));
|
|
4931
|
-
}
|
|
4932
4919
|
updateBody() {
|
|
4933
4920
|
var n;
|
|
4934
4921
|
if (this.bodyCallback == null || this.bodyLoaded || this.bodyLoading) return;
|
|
@@ -4941,9 +4928,13 @@ const $e = class $e extends qr {
|
|
|
4941
4928
|
}
|
|
4942
4929
|
setCollapsed(t) {
|
|
4943
4930
|
if (this.component == null) throw new Error("Failed to set pin collapsed");
|
|
4944
|
-
this.component.
|
|
4931
|
+
this.component.setCollapsed(t);
|
|
4932
|
+
}
|
|
4933
|
+
setScale(t) {
|
|
4934
|
+
if (this.component == null) throw new Error("Failed to set pin scale");
|
|
4935
|
+
this.component.setScale(t);
|
|
4945
4936
|
}
|
|
4946
|
-
|
|
4937
|
+
getScaleFromZoomDistance(t) {
|
|
4947
4938
|
return this.zoom < t ? 1 : Math.max(0, 1 - (this.zoom - t) * 0.125);
|
|
4948
4939
|
}
|
|
4949
4940
|
getZindex() {
|
|
@@ -4957,9 +4948,9 @@ const $e = class $e extends qr {
|
|
|
4957
4948
|
return this.bodyCallback == null || this.bodyLoaded;
|
|
4958
4949
|
}
|
|
4959
4950
|
};
|
|
4960
|
-
f(
|
|
4961
|
-
let
|
|
4962
|
-
const
|
|
4951
|
+
f(qe, "DEFAULT_SIZE", 16);
|
|
4952
|
+
let Ar = qe;
|
|
4953
|
+
const We = class We {
|
|
4963
4954
|
constructor(e) {
|
|
4964
4955
|
f(this, "provider");
|
|
4965
4956
|
// Data
|
|
@@ -4974,7 +4965,7 @@ const qe = class qe {
|
|
|
4974
4965
|
}
|
|
4975
4966
|
setConfiguration(e) {
|
|
4976
4967
|
var t, n, s;
|
|
4977
|
-
this.pinFade = ((t = e == null ? void 0 : e.pin) == null ? void 0 : t.fade) ?? !0, this.pinMaxCount = ((n = e == null ? void 0 : e.pin) == null ? void 0 : n.maxCount) ?? Math.max(
|
|
4968
|
+
this.pinFade = ((t = e == null ? void 0 : e.pin) == null ? void 0 : t.fade) ?? !0, this.pinMaxCount = ((n = e == null ? void 0 : e.pin) == null ? void 0 : n.maxCount) ?? Math.max(We.MAP_PINS_MAX_COUNT, 8 * navigator.hardwareConcurrency), this.pinMaxZoomDelta = ((s = e == null ? void 0 : e.pin) == null ? void 0 : s.maxZoom) ?? We.MAP_PINS_MAX_ZOOM;
|
|
4978
4969
|
}
|
|
4979
4970
|
updateElements(e) {
|
|
4980
4971
|
this.pinElements = e, this.pinMaxWidth = e.reduce((t, n) => Math.max(t, n.width), 0), this.pinMaxHeight = e.reduce((t, n) => Math.max(t, n.height), 0);
|
|
@@ -4983,15 +4974,15 @@ const qe = class qe {
|
|
|
4983
4974
|
this.pinElements.forEach((e) => e.remove()), this.pinElements.length = 0;
|
|
4984
4975
|
}
|
|
4985
4976
|
process(e, t) {
|
|
4986
|
-
const n = this.provider.getParameters().mapSize, s = new
|
|
4977
|
+
const n = this.provider.getParameters().mapSize, s = new fs(e, t, n, this.pinMaxWidth * 2, this.pinMaxHeight * 2);
|
|
4987
4978
|
let a = 0;
|
|
4988
4979
|
for (const i of this.pinElements)
|
|
4989
|
-
s.contains(i.lat, i.lng) ? i.shown && t < i.zoom && i.zoom < t + this.pinMaxZoomDelta ? (a < this.pinMaxCount && (this.pinFade
|
|
4980
|
+
s.contains(i.lat, i.lng) ? i.shown && t < i.zoom && i.zoom < t + this.pinMaxZoomDelta ? (a < this.pinMaxCount && (i.setCollapsed(!1), i.setScale(this.pinFade ? i.getScaleFromZoomDistance(t) : 1), i.updateMap(!0), i.isBodyLoaded() == !1 && i.updateBody()), a++) : (i.setCollapsed(!0), i.isCollapsed() && i.updateMap(!1)) : i.updateMap(!1);
|
|
4990
4981
|
}
|
|
4991
4982
|
};
|
|
4992
|
-
f(
|
|
4993
|
-
let
|
|
4994
|
-
const
|
|
4983
|
+
f(We, "MAP_PINS_MAX_ZOOM", 2), f(We, "MAP_PINS_MAX_COUNT", 128);
|
|
4984
|
+
let Or = We;
|
|
4985
|
+
const Jt = class Jt extends Wr {
|
|
4995
4986
|
constructor(t, n, s) {
|
|
4996
4987
|
super(t, n);
|
|
4997
4988
|
f(this, "width");
|
|
@@ -5007,11 +4998,11 @@ const Gt = class Gt extends qr {
|
|
|
5007
4998
|
this.width = n.tooltip.style.width, this.height = n.tooltip.style.height, this.margin = n.tooltip.style.margin, this.radius = n.tooltip.style.radius, this.zoom = s[0], this.angle = Le.DEGREES_DEFAULT, this.states = s[1].map((a) => [a[0], Le.DEGREES[a[1]]]), this.bodyCallback = n.tooltip.body;
|
|
5008
4999
|
}
|
|
5009
5000
|
createElement() {
|
|
5010
|
-
this.element = document.createElement("div"), this.element.classList.add("tooltip"), this.component =
|
|
5001
|
+
this.element = document.createElement("div"), this.element.classList.add("tooltip"), this.component = Ur(cs, {
|
|
5011
5002
|
target: this.element,
|
|
5012
5003
|
props: {
|
|
5013
5004
|
id: this.id + "_tooltip",
|
|
5014
|
-
layer:
|
|
5005
|
+
layer: Ua,
|
|
5015
5006
|
priority: this.zoom * this.provider.getParameters().zoomScale,
|
|
5016
5007
|
width: this.width,
|
|
5017
5008
|
height: this.height,
|
|
@@ -5048,7 +5039,7 @@ const Gt = class Gt extends qr {
|
|
|
5048
5039
|
}
|
|
5049
5040
|
getZindex() {
|
|
5050
5041
|
const t = this.provider.getParameters();
|
|
5051
|
-
return Math.round((t.zoomMax - this.zoom) * t.zoomScale) +
|
|
5042
|
+
return Math.round((t.zoomMax - this.zoom) * t.zoomScale) + Jt.Z_INDEX_OFFSET;
|
|
5052
5043
|
}
|
|
5053
5044
|
setCollapsed(t) {
|
|
5054
5045
|
if (this.component == null) throw new Error("Failed to set tooltip collapsed");
|
|
@@ -5064,9 +5055,9 @@ const Gt = class Gt extends qr {
|
|
|
5064
5055
|
return this.bodyLoaded;
|
|
5065
5056
|
}
|
|
5066
5057
|
};
|
|
5067
|
-
f(
|
|
5068
|
-
let
|
|
5069
|
-
class
|
|
5058
|
+
f(Jt, "Z_INDEX_OFFSET", 1e6);
|
|
5059
|
+
let Nr = Jt;
|
|
5060
|
+
class Ni {
|
|
5070
5061
|
constructor(e) {
|
|
5071
5062
|
f(this, "provider");
|
|
5072
5063
|
// Data
|
|
@@ -5083,12 +5074,12 @@ class Oi {
|
|
|
5083
5074
|
this.tooltipElements.forEach((e) => e.remove()), this.tooltipElements.length = 0;
|
|
5084
5075
|
}
|
|
5085
5076
|
process(e, t) {
|
|
5086
|
-
const n = this.provider.getParameters().mapSize, s = new
|
|
5077
|
+
const n = this.provider.getParameters().mapSize, s = new fs(e, t, n, this.tooltipMaxWidth * 2, this.tooltipMaxHeight * 2);
|
|
5087
5078
|
for (const a of this.tooltipElements)
|
|
5088
5079
|
s.contains(a.lat, a.lng) ? a.shown && a.zoom <= t ? (a.updateState(t), a.setCollapsed(!1), a.updateMap(!0), a.isCollapsed() == !1 && a.isBodyLoaded() == !1 && a.updateBody()) : (a.setCollapsed(!0), a.isCollapsed() && a.updateMap(!1)) : a.updateMap(!1);
|
|
5089
5080
|
}
|
|
5090
5081
|
}
|
|
5091
|
-
const
|
|
5082
|
+
const Kt = class Kt extends Wr {
|
|
5092
5083
|
constructor(t, n) {
|
|
5093
5084
|
if (n.popup == null) throw new Error("Failed to create popup");
|
|
5094
5085
|
super(t, n);
|
|
@@ -5102,11 +5093,11 @@ const Jt = class Jt extends qr {
|
|
|
5102
5093
|
this.shown = !1, this.width = n.popup.style.width, this.height = n.popup.style.height, this.margin = n.popup.style.margin, this.radius = n.popup.style.radius, this.bodyCallback = n.popup.body;
|
|
5103
5094
|
}
|
|
5104
5095
|
createElement() {
|
|
5105
|
-
this.element = document.createElement("div"), this.element.classList.add("popup"), this.component =
|
|
5096
|
+
this.element = document.createElement("div"), this.element.classList.add("popup"), this.component = Ur(cs, {
|
|
5106
5097
|
target: this.element,
|
|
5107
5098
|
props: {
|
|
5108
5099
|
id: this.id + "_popup",
|
|
5109
|
-
layer:
|
|
5100
|
+
layer: Va,
|
|
5110
5101
|
priority: 0,
|
|
5111
5102
|
width: this.width,
|
|
5112
5103
|
height: this.height,
|
|
@@ -5130,7 +5121,7 @@ const Jt = class Jt extends qr {
|
|
|
5130
5121
|
}));
|
|
5131
5122
|
}
|
|
5132
5123
|
getZindex() {
|
|
5133
|
-
return
|
|
5124
|
+
return Kt.Z_INDEX_OFFSET;
|
|
5134
5125
|
}
|
|
5135
5126
|
setCollapsed(t) {
|
|
5136
5127
|
if (this.component == null) throw new Error("Failed to set popup collapsed");
|
|
@@ -5138,7 +5129,7 @@ const Jt = class Jt extends qr {
|
|
|
5138
5129
|
}
|
|
5139
5130
|
setAngle(t) {
|
|
5140
5131
|
if (this.component == null) throw new Error("Failed to set popup angle");
|
|
5141
|
-
this.component.setAngle(t);
|
|
5132
|
+
this.component.setAngle(t, !0);
|
|
5142
5133
|
}
|
|
5143
5134
|
isExpanded() {
|
|
5144
5135
|
return this.component == null ? !1 : this.component.getExpanded();
|
|
@@ -5150,32 +5141,31 @@ const Jt = class Jt extends qr {
|
|
|
5150
5141
|
return this.bodyLoaded;
|
|
5151
5142
|
}
|
|
5152
5143
|
};
|
|
5153
|
-
f(
|
|
5154
|
-
let
|
|
5155
|
-
class
|
|
5144
|
+
f(Kt, "Z_INDEX_OFFSET", 2e6);
|
|
5145
|
+
let Rr = Kt;
|
|
5146
|
+
class Ri {
|
|
5156
5147
|
constructor(e) {
|
|
5157
5148
|
f(this, "provider");
|
|
5158
5149
|
// Data
|
|
5159
|
-
f(this, "popupElements",
|
|
5150
|
+
f(this, "popupElements", new Array());
|
|
5160
5151
|
f(this, "popupPositioned", /* @__PURE__ */ new Map());
|
|
5161
5152
|
this.provider = e;
|
|
5162
5153
|
}
|
|
5163
5154
|
show(e) {
|
|
5164
|
-
e.pin.shown = !1, e.tooltip.shown = !1;
|
|
5165
|
-
const t = new Or(this.provider, e.marker);
|
|
5166
|
-
this.popupElements.set(e.marker.id, t), this.popupPositioned.set(e.marker.id, !1), t.create(), t.setAngle(e.tooltip.angle), t.shown = !0;
|
|
5155
|
+
e.pin.shown = !1, e.tooltip.shown = !1, this.popupPositioned.set(e.marker.id, !1), e.popup.setAngle(e.tooltip.angle), e.popup.shown = !0;
|
|
5167
5156
|
}
|
|
5168
5157
|
hide(e) {
|
|
5169
|
-
e.pin.shown = !0, e.tooltip.shown = !0;
|
|
5170
|
-
|
|
5171
|
-
|
|
5158
|
+
e.pin.shown = !0, e.tooltip.shown = !0, e.popup.shown = !1;
|
|
5159
|
+
}
|
|
5160
|
+
updateElements(e) {
|
|
5161
|
+
this.popupElements = e, this.popupPositioned = new Map(e.map((t) => [t.id, !1]));
|
|
5172
5162
|
}
|
|
5173
|
-
|
|
5174
|
-
this.popupElements.
|
|
5163
|
+
removeElements() {
|
|
5164
|
+
this.popupElements.forEach((e) => e.remove()), this.popupElements.length = 0, this.popupPositioned.clear();
|
|
5175
5165
|
}
|
|
5176
5166
|
process() {
|
|
5177
5167
|
var e, t;
|
|
5178
|
-
for (const n of this.popupElements
|
|
5168
|
+
for (const n of this.popupElements)
|
|
5179
5169
|
if (n.shown) {
|
|
5180
5170
|
if (n.setCollapsed(!1), n.updateMap(!0), n.isExpanded() && n.isBodyLoaded() == !1 && n.updateBody(), n.isCollapsed() == !1 && this.popupPositioned.get(n.id) == !1) {
|
|
5181
5171
|
const s = (e = n.component) == null ? void 0 : e.getBody();
|
|
@@ -5184,13 +5174,13 @@ class Ni {
|
|
|
5184
5174
|
if (a == null) continue;
|
|
5185
5175
|
const i = s.getBoundingClientRect();
|
|
5186
5176
|
if (i.x == 0 && i.y == 0 && i.width == 0 && i.height == 0) continue;
|
|
5187
|
-
const o = i.x + i.width / 2, l = i.y + i.height / 2, u = o + a.x, d = l + a.y, p = u + n.width, g = d + n.height, m = this.provider.getContainer().getBoundingClientRect(), y = u - m.left,
|
|
5188
|
-
this.provider.panBy(
|
|
5177
|
+
const o = i.x + i.width / 2, l = i.y + i.height / 2, u = o + a.x, d = l + a.y, p = u + n.width, g = d + n.height, m = this.provider.getContainer().getBoundingClientRect(), y = u - m.left, P = m.right - p, z = d - m.top, te = m.bottom - g, A = Math.min(n.width, n.height) / 4, q = y < 0 ? y - A : P < 0 ? -P + A : 0, N = z < 0 ? z - A : te < 0 ? -te + A : 0;
|
|
5178
|
+
this.provider.panBy(q, N), this.popupPositioned.set(n.id, !0);
|
|
5189
5179
|
}
|
|
5190
5180
|
} else
|
|
5191
|
-
n.setCollapsed(!0), n.isCollapsed() &&
|
|
5181
|
+
n.setCollapsed(!0), n.isCollapsed() && n.updateMap(!1);
|
|
5192
5182
|
}
|
|
5193
5183
|
}
|
|
5194
5184
|
export {
|
|
5195
|
-
|
|
5185
|
+
Di as MapManager
|
|
5196
5186
|
};
|