@pie-players/pie-tool-magnifier 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Magnifier.svelte +340 -0
- package/README.md +135 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/tool-magnifier.js +3064 -0
- package/dist/tool-magnifier.js.map +1 -0
- package/index.ts +8 -0
- package/package.json +64 -0
- package/tool-magnifier.svelte +140 -0
|
@@ -0,0 +1,3064 @@
|
|
|
1
|
+
var $i = Object.defineProperty;
|
|
2
|
+
var Xn = (e) => {
|
|
3
|
+
throw TypeError(e);
|
|
4
|
+
};
|
|
5
|
+
var Ei = (e, t, n) => t in e ? $i(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
6
|
+
var N = (e, t, n) => Ei(e, typeof t != "symbol" ? t + "" : t, n), gn = (e, t, n) => t.has(e) || Xn("Cannot " + n);
|
|
7
|
+
var u = (e, t, n) => (gn(e, t, "read from private field"), n ? n.call(e) : t.get(e)), y = (e, t, n) => t.has(e) ? Xn("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), m = (e, t, n, r) => (gn(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), M = (e, t, n) => (gn(e, t, "access private method"), n);
|
|
8
|
+
var vr;
|
|
9
|
+
typeof window < "u" && ((vr = window.__svelte ?? (window.__svelte = {})).v ?? (vr.v = /* @__PURE__ */ new Set())).add("5");
|
|
10
|
+
const Ti = 1, Si = 2, Ai = 16, Oi = 1, Ci = 4, xi = 8, Ni = 16, Ri = 2, _r = "[", ln = "[!", Ln = "]", bt = {}, F = /* @__PURE__ */ Symbol(), ki = "http://www.w3.org/1999/xhtml", bn = !1;
|
|
11
|
+
var pr = Array.isArray, Pi = Array.prototype.indexOf, wt = Array.prototype.includes, on = Array.from, Qt = Object.keys, Zt = Object.defineProperty, tt = Object.getOwnPropertyDescriptor, Li = Object.getOwnPropertyDescriptors, Ii = Object.prototype, Mi = Array.prototype, gr = Object.getPrototypeOf, Jn = Object.isExtensible;
|
|
12
|
+
function Di(e) {
|
|
13
|
+
for (var t = 0; t < e.length; t++)
|
|
14
|
+
e[t]();
|
|
15
|
+
}
|
|
16
|
+
function mr() {
|
|
17
|
+
var e, t, n = new Promise((r, i) => {
|
|
18
|
+
e = r, t = i;
|
|
19
|
+
});
|
|
20
|
+
return { promise: n, resolve: e, reject: t };
|
|
21
|
+
}
|
|
22
|
+
const q = 2, en = 4, fn = 8, br = 1 << 24, Ie = 16, _e = 32, Ve = 64, In = 128, le = 512, D = 1024, j = 2048, Me = 4096, J = 8192, ke = 16384, un = 32768, yt = 65536, Qn = 1 << 17, wr = 1 << 18, ft = 1 << 19, Fi = 1 << 20, Ue = 1 << 25, lt = 32768, wn = 1 << 21, Mn = 1 << 22, je = 1 << 23, Nt = /* @__PURE__ */ Symbol("$state"), yr = /* @__PURE__ */ Symbol("legacy props"), qi = /* @__PURE__ */ Symbol(""), ct = new class extends Error {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
N(this, "name", "StaleReactionError");
|
|
26
|
+
N(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed");
|
|
27
|
+
}
|
|
28
|
+
}(), Dn = 3, At = 8;
|
|
29
|
+
function zi(e) {
|
|
30
|
+
throw new Error("https://svelte.dev/e/lifecycle_outside_component");
|
|
31
|
+
}
|
|
32
|
+
function Ui() {
|
|
33
|
+
throw new Error("https://svelte.dev/e/async_derived_orphan");
|
|
34
|
+
}
|
|
35
|
+
function Bi(e) {
|
|
36
|
+
throw new Error("https://svelte.dev/e/effect_in_teardown");
|
|
37
|
+
}
|
|
38
|
+
function ji() {
|
|
39
|
+
throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
|
|
40
|
+
}
|
|
41
|
+
function Hi(e) {
|
|
42
|
+
throw new Error("https://svelte.dev/e/effect_orphan");
|
|
43
|
+
}
|
|
44
|
+
function Yi() {
|
|
45
|
+
throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
|
|
46
|
+
}
|
|
47
|
+
function Vi() {
|
|
48
|
+
throw new Error("https://svelte.dev/e/hydration_failed");
|
|
49
|
+
}
|
|
50
|
+
function Gi(e) {
|
|
51
|
+
throw new Error("https://svelte.dev/e/props_invalid_value");
|
|
52
|
+
}
|
|
53
|
+
function Ki() {
|
|
54
|
+
throw new Error("https://svelte.dev/e/state_descriptors_fixed");
|
|
55
|
+
}
|
|
56
|
+
function Wi() {
|
|
57
|
+
throw new Error("https://svelte.dev/e/state_prototype_fixed");
|
|
58
|
+
}
|
|
59
|
+
function Xi() {
|
|
60
|
+
throw new Error("https://svelte.dev/e/state_unsafe_mutation");
|
|
61
|
+
}
|
|
62
|
+
function Ji() {
|
|
63
|
+
throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror");
|
|
64
|
+
}
|
|
65
|
+
function an(e) {
|
|
66
|
+
console.warn("https://svelte.dev/e/hydration_mismatch");
|
|
67
|
+
}
|
|
68
|
+
function Qi() {
|
|
69
|
+
console.warn("https://svelte.dev/e/svelte_boundary_reset_noop");
|
|
70
|
+
}
|
|
71
|
+
let E = !1;
|
|
72
|
+
function Re(e) {
|
|
73
|
+
E = e;
|
|
74
|
+
}
|
|
75
|
+
let T;
|
|
76
|
+
function Q(e) {
|
|
77
|
+
if (e === null)
|
|
78
|
+
throw an(), bt;
|
|
79
|
+
return T = e;
|
|
80
|
+
}
|
|
81
|
+
function Bt() {
|
|
82
|
+
return Q(/* @__PURE__ */ Ee(T));
|
|
83
|
+
}
|
|
84
|
+
function Gt(e) {
|
|
85
|
+
if (E) {
|
|
86
|
+
if (/* @__PURE__ */ Ee(T) !== null)
|
|
87
|
+
throw an(), bt;
|
|
88
|
+
T = e;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function Zi(e = 1) {
|
|
92
|
+
if (E) {
|
|
93
|
+
for (var t = e, n = T; t--; )
|
|
94
|
+
n = /** @type {TemplateNode} */
|
|
95
|
+
/* @__PURE__ */ Ee(n);
|
|
96
|
+
T = n;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function tn(e = !0) {
|
|
100
|
+
for (var t = 0, n = T; ; ) {
|
|
101
|
+
if (n.nodeType === At) {
|
|
102
|
+
var r = (
|
|
103
|
+
/** @type {Comment} */
|
|
104
|
+
n.data
|
|
105
|
+
);
|
|
106
|
+
if (r === Ln) {
|
|
107
|
+
if (t === 0) return n;
|
|
108
|
+
t -= 1;
|
|
109
|
+
} else (r === _r || r === ln) && (t += 1);
|
|
110
|
+
}
|
|
111
|
+
var i = (
|
|
112
|
+
/** @type {TemplateNode} */
|
|
113
|
+
/* @__PURE__ */ Ee(n)
|
|
114
|
+
);
|
|
115
|
+
e && n.remove(), n = i;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
function $r(e) {
|
|
119
|
+
if (!e || e.nodeType !== At)
|
|
120
|
+
throw an(), bt;
|
|
121
|
+
return (
|
|
122
|
+
/** @type {Comment} */
|
|
123
|
+
e.data
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
function Er(e) {
|
|
127
|
+
return e === this.v;
|
|
128
|
+
}
|
|
129
|
+
function es(e, t) {
|
|
130
|
+
return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function";
|
|
131
|
+
}
|
|
132
|
+
function Tr(e) {
|
|
133
|
+
return !es(e, this.v);
|
|
134
|
+
}
|
|
135
|
+
let ts = !1, Z = null;
|
|
136
|
+
function $t(e) {
|
|
137
|
+
Z = e;
|
|
138
|
+
}
|
|
139
|
+
function Fn(e, t = !1, n) {
|
|
140
|
+
Z = {
|
|
141
|
+
p: Z,
|
|
142
|
+
i: !1,
|
|
143
|
+
c: null,
|
|
144
|
+
e: null,
|
|
145
|
+
s: e,
|
|
146
|
+
x: null,
|
|
147
|
+
l: null
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
function qn(e) {
|
|
151
|
+
var t = (
|
|
152
|
+
/** @type {ComponentContext} */
|
|
153
|
+
Z
|
|
154
|
+
), n = t.e;
|
|
155
|
+
if (n !== null) {
|
|
156
|
+
t.e = null;
|
|
157
|
+
for (var r of n)
|
|
158
|
+
Xr(r);
|
|
159
|
+
}
|
|
160
|
+
return e !== void 0 && (t.x = e), t.i = !0, Z = t.p, e ?? /** @type {T} */
|
|
161
|
+
{};
|
|
162
|
+
}
|
|
163
|
+
function Sr() {
|
|
164
|
+
return !0;
|
|
165
|
+
}
|
|
166
|
+
let Ge = [];
|
|
167
|
+
function Ar() {
|
|
168
|
+
var e = Ge;
|
|
169
|
+
Ge = [], Di(e);
|
|
170
|
+
}
|
|
171
|
+
function nt(e) {
|
|
172
|
+
if (Ge.length === 0 && !Rt) {
|
|
173
|
+
var t = Ge;
|
|
174
|
+
queueMicrotask(() => {
|
|
175
|
+
t === Ge && Ar();
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
Ge.push(e);
|
|
179
|
+
}
|
|
180
|
+
function ns() {
|
|
181
|
+
for (; Ge.length > 0; )
|
|
182
|
+
Ar();
|
|
183
|
+
}
|
|
184
|
+
function Or(e) {
|
|
185
|
+
var t = S;
|
|
186
|
+
if (t === null)
|
|
187
|
+
return $.f |= je, e;
|
|
188
|
+
if ((t.f & un) === 0) {
|
|
189
|
+
if ((t.f & In) === 0)
|
|
190
|
+
throw e;
|
|
191
|
+
t.b.error(e);
|
|
192
|
+
} else
|
|
193
|
+
Et(e, t);
|
|
194
|
+
}
|
|
195
|
+
function Et(e, t) {
|
|
196
|
+
for (; t !== null; ) {
|
|
197
|
+
if ((t.f & In) !== 0)
|
|
198
|
+
try {
|
|
199
|
+
t.b.error(e);
|
|
200
|
+
return;
|
|
201
|
+
} catch (n) {
|
|
202
|
+
e = n;
|
|
203
|
+
}
|
|
204
|
+
t = t.parent;
|
|
205
|
+
}
|
|
206
|
+
throw e;
|
|
207
|
+
}
|
|
208
|
+
const rs = -7169;
|
|
209
|
+
function I(e, t) {
|
|
210
|
+
e.f = e.f & rs | t;
|
|
211
|
+
}
|
|
212
|
+
function zn(e) {
|
|
213
|
+
(e.f & le) !== 0 || e.deps === null ? I(e, D) : I(e, Me);
|
|
214
|
+
}
|
|
215
|
+
function Cr(e) {
|
|
216
|
+
if (e !== null)
|
|
217
|
+
for (const t of e)
|
|
218
|
+
(t.f & q) === 0 || (t.f & lt) === 0 || (t.f ^= lt, Cr(
|
|
219
|
+
/** @type {Derived} */
|
|
220
|
+
t.deps
|
|
221
|
+
));
|
|
222
|
+
}
|
|
223
|
+
function xr(e, t, n) {
|
|
224
|
+
(e.f & j) !== 0 ? t.add(e) : (e.f & Me) !== 0 && n.add(e), Cr(e.deps), I(e, D);
|
|
225
|
+
}
|
|
226
|
+
const Ht = /* @__PURE__ */ new Set();
|
|
227
|
+
let x = null, de = null, X = [], cn = null, yn = !1, Rt = !1;
|
|
228
|
+
var dt, ht, We, vt, Dt, Ft, Xe, _t, $e, $n, En, Nr;
|
|
229
|
+
const Gn = class Gn {
|
|
230
|
+
constructor() {
|
|
231
|
+
y(this, $e);
|
|
232
|
+
N(this, "committed", !1);
|
|
233
|
+
/**
|
|
234
|
+
* The current values of any sources that are updated in this batch
|
|
235
|
+
* They keys of this map are identical to `this.#previous`
|
|
236
|
+
* @type {Map<Source, any>}
|
|
237
|
+
*/
|
|
238
|
+
N(this, "current", /* @__PURE__ */ new Map());
|
|
239
|
+
/**
|
|
240
|
+
* The values of any sources that are updated in this batch _before_ those updates took place.
|
|
241
|
+
* They keys of this map are identical to `this.#current`
|
|
242
|
+
* @type {Map<Source, any>}
|
|
243
|
+
*/
|
|
244
|
+
N(this, "previous", /* @__PURE__ */ new Map());
|
|
245
|
+
/**
|
|
246
|
+
* When the batch is committed (and the DOM is updated), we need to remove old branches
|
|
247
|
+
* and append new ones by calling the functions added inside (if/each/key/etc) blocks
|
|
248
|
+
* @type {Set<() => void>}
|
|
249
|
+
*/
|
|
250
|
+
y(this, dt, /* @__PURE__ */ new Set());
|
|
251
|
+
/**
|
|
252
|
+
* If a fork is discarded, we need to destroy any effects that are no longer needed
|
|
253
|
+
* @type {Set<(batch: Batch) => void>}
|
|
254
|
+
*/
|
|
255
|
+
y(this, ht, /* @__PURE__ */ new Set());
|
|
256
|
+
/**
|
|
257
|
+
* The number of async effects that are currently in flight
|
|
258
|
+
*/
|
|
259
|
+
y(this, We, 0);
|
|
260
|
+
/**
|
|
261
|
+
* The number of async effects that are currently in flight, _not_ inside a pending boundary
|
|
262
|
+
*/
|
|
263
|
+
y(this, vt, 0);
|
|
264
|
+
/**
|
|
265
|
+
* A deferred that resolves when the batch is committed, used with `settled()`
|
|
266
|
+
* TODO replace with Promise.withResolvers once supported widely enough
|
|
267
|
+
* @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
|
|
268
|
+
*/
|
|
269
|
+
y(this, Dt, null);
|
|
270
|
+
/**
|
|
271
|
+
* Deferred effects (which run after async work has completed) that are DIRTY
|
|
272
|
+
* @type {Set<Effect>}
|
|
273
|
+
*/
|
|
274
|
+
y(this, Ft, /* @__PURE__ */ new Set());
|
|
275
|
+
/**
|
|
276
|
+
* Deferred effects that are MAYBE_DIRTY
|
|
277
|
+
* @type {Set<Effect>}
|
|
278
|
+
*/
|
|
279
|
+
y(this, Xe, /* @__PURE__ */ new Set());
|
|
280
|
+
/**
|
|
281
|
+
* A set of branches that still exist, but will be destroyed when this batch
|
|
282
|
+
* is committed — we skip over these during `process`
|
|
283
|
+
* @type {Set<Effect>}
|
|
284
|
+
*/
|
|
285
|
+
N(this, "skipped_effects", /* @__PURE__ */ new Set());
|
|
286
|
+
N(this, "is_fork", !1);
|
|
287
|
+
y(this, _t, !1);
|
|
288
|
+
}
|
|
289
|
+
is_deferred() {
|
|
290
|
+
return this.is_fork || u(this, vt) > 0;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
*
|
|
294
|
+
* @param {Effect[]} root_effects
|
|
295
|
+
*/
|
|
296
|
+
process(t) {
|
|
297
|
+
X = [], this.apply();
|
|
298
|
+
var n = [], r = [];
|
|
299
|
+
for (const i of t)
|
|
300
|
+
M(this, $e, $n).call(this, i, n, r);
|
|
301
|
+
if (this.is_deferred()) {
|
|
302
|
+
M(this, $e, En).call(this, r), M(this, $e, En).call(this, n);
|
|
303
|
+
for (const i of this.skipped_effects)
|
|
304
|
+
Lr(i);
|
|
305
|
+
} else {
|
|
306
|
+
for (const i of u(this, dt)) i();
|
|
307
|
+
u(this, dt).clear(), u(this, We) === 0 && M(this, $e, Nr).call(this), x = null, Zn(r), Zn(n), u(this, Dt)?.resolve();
|
|
308
|
+
}
|
|
309
|
+
de = null;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Associate a change to a given source with the current
|
|
313
|
+
* batch, noting its previous and current values
|
|
314
|
+
* @param {Source} source
|
|
315
|
+
* @param {any} value
|
|
316
|
+
*/
|
|
317
|
+
capture(t, n) {
|
|
318
|
+
n !== F && !this.previous.has(t) && this.previous.set(t, n), (t.f & je) === 0 && (this.current.set(t, t.v), de?.set(t, t.v));
|
|
319
|
+
}
|
|
320
|
+
activate() {
|
|
321
|
+
x = this, this.apply();
|
|
322
|
+
}
|
|
323
|
+
deactivate() {
|
|
324
|
+
x === this && (x = null, de = null);
|
|
325
|
+
}
|
|
326
|
+
flush() {
|
|
327
|
+
if (this.activate(), X.length > 0) {
|
|
328
|
+
if (Rr(), x !== null && x !== this)
|
|
329
|
+
return;
|
|
330
|
+
} else u(this, We) === 0 && this.process([]);
|
|
331
|
+
this.deactivate();
|
|
332
|
+
}
|
|
333
|
+
discard() {
|
|
334
|
+
for (const t of u(this, ht)) t(this);
|
|
335
|
+
u(this, ht).clear();
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
*
|
|
339
|
+
* @param {boolean} blocking
|
|
340
|
+
*/
|
|
341
|
+
increment(t) {
|
|
342
|
+
m(this, We, u(this, We) + 1), t && m(this, vt, u(this, vt) + 1);
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
*
|
|
346
|
+
* @param {boolean} blocking
|
|
347
|
+
*/
|
|
348
|
+
decrement(t) {
|
|
349
|
+
m(this, We, u(this, We) - 1), t && m(this, vt, u(this, vt) - 1), !u(this, _t) && (m(this, _t, !0), nt(() => {
|
|
350
|
+
m(this, _t, !1), this.is_deferred() ? X.length > 0 && this.flush() : this.revive();
|
|
351
|
+
}));
|
|
352
|
+
}
|
|
353
|
+
revive() {
|
|
354
|
+
for (const t of u(this, Ft))
|
|
355
|
+
u(this, Xe).delete(t), I(t, j), Le(t);
|
|
356
|
+
for (const t of u(this, Xe))
|
|
357
|
+
I(t, Me), Le(t);
|
|
358
|
+
this.flush();
|
|
359
|
+
}
|
|
360
|
+
/** @param {() => void} fn */
|
|
361
|
+
oncommit(t) {
|
|
362
|
+
u(this, dt).add(t);
|
|
363
|
+
}
|
|
364
|
+
/** @param {(batch: Batch) => void} fn */
|
|
365
|
+
ondiscard(t) {
|
|
366
|
+
u(this, ht).add(t);
|
|
367
|
+
}
|
|
368
|
+
settled() {
|
|
369
|
+
return (u(this, Dt) ?? m(this, Dt, mr())).promise;
|
|
370
|
+
}
|
|
371
|
+
static ensure() {
|
|
372
|
+
if (x === null) {
|
|
373
|
+
const t = x = new Gn();
|
|
374
|
+
Ht.add(x), Rt || nt(() => {
|
|
375
|
+
x === t && t.flush();
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
return x;
|
|
379
|
+
}
|
|
380
|
+
apply() {
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
dt = new WeakMap(), ht = new WeakMap(), We = new WeakMap(), vt = new WeakMap(), Dt = new WeakMap(), Ft = new WeakMap(), Xe = new WeakMap(), _t = new WeakMap(), $e = new WeakSet(), /**
|
|
384
|
+
* Traverse the effect tree, executing effects or stashing
|
|
385
|
+
* them for later execution as appropriate
|
|
386
|
+
* @param {Effect} root
|
|
387
|
+
* @param {Effect[]} effects
|
|
388
|
+
* @param {Effect[]} render_effects
|
|
389
|
+
*/
|
|
390
|
+
$n = function(t, n, r) {
|
|
391
|
+
t.f ^= D;
|
|
392
|
+
for (var i = t.first, s = null; i !== null; ) {
|
|
393
|
+
var l = i.f, o = (l & (_e | Ve)) !== 0, a = o && (l & D) !== 0, f = a || (l & J) !== 0 || this.skipped_effects.has(i);
|
|
394
|
+
if (!f && i.fn !== null) {
|
|
395
|
+
o ? i.f ^= D : s !== null && (l & (en | fn | br)) !== 0 ? s.b.defer_effect(i) : (l & en) !== 0 ? n.push(i) : jt(i) && ((l & Ie) !== 0 && u(this, Xe).add(i), It(i));
|
|
396
|
+
var h = i.first;
|
|
397
|
+
if (h !== null) {
|
|
398
|
+
i = h;
|
|
399
|
+
continue;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
var v = i.parent;
|
|
403
|
+
for (i = i.next; i === null && v !== null; )
|
|
404
|
+
v === s && (s = null), i = v.next, v = v.parent;
|
|
405
|
+
}
|
|
406
|
+
}, /**
|
|
407
|
+
* @param {Effect[]} effects
|
|
408
|
+
*/
|
|
409
|
+
En = function(t) {
|
|
410
|
+
for (var n = 0; n < t.length; n += 1)
|
|
411
|
+
xr(t[n], u(this, Ft), u(this, Xe));
|
|
412
|
+
}, Nr = function() {
|
|
413
|
+
var i;
|
|
414
|
+
if (Ht.size > 1) {
|
|
415
|
+
this.previous.clear();
|
|
416
|
+
var t = de, n = !0;
|
|
417
|
+
for (const s of Ht) {
|
|
418
|
+
if (s === this) {
|
|
419
|
+
n = !1;
|
|
420
|
+
continue;
|
|
421
|
+
}
|
|
422
|
+
const l = [];
|
|
423
|
+
for (const [a, f] of this.current) {
|
|
424
|
+
if (s.current.has(a))
|
|
425
|
+
if (n && f !== s.current.get(a))
|
|
426
|
+
s.current.set(a, f);
|
|
427
|
+
else
|
|
428
|
+
continue;
|
|
429
|
+
l.push(a);
|
|
430
|
+
}
|
|
431
|
+
if (l.length === 0)
|
|
432
|
+
continue;
|
|
433
|
+
const o = [...s.current.keys()].filter((a) => !this.current.has(a));
|
|
434
|
+
if (o.length > 0) {
|
|
435
|
+
var r = X;
|
|
436
|
+
X = [];
|
|
437
|
+
const a = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Map();
|
|
438
|
+
for (const h of l)
|
|
439
|
+
kr(h, o, a, f);
|
|
440
|
+
if (X.length > 0) {
|
|
441
|
+
x = s, s.apply();
|
|
442
|
+
for (const h of X)
|
|
443
|
+
M(i = s, $e, $n).call(i, h, [], []);
|
|
444
|
+
s.deactivate();
|
|
445
|
+
}
|
|
446
|
+
X = r;
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
x = null, de = t;
|
|
450
|
+
}
|
|
451
|
+
this.committed = !0, Ht.delete(this);
|
|
452
|
+
};
|
|
453
|
+
let Pe = Gn;
|
|
454
|
+
function ce(e) {
|
|
455
|
+
var t = Rt;
|
|
456
|
+
Rt = !0;
|
|
457
|
+
try {
|
|
458
|
+
for (var n; ; ) {
|
|
459
|
+
if (ns(), X.length === 0 && (x?.flush(), X.length === 0))
|
|
460
|
+
return cn = null, /** @type {T} */
|
|
461
|
+
n;
|
|
462
|
+
Rr();
|
|
463
|
+
}
|
|
464
|
+
} finally {
|
|
465
|
+
Rt = t;
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
function Rr() {
|
|
469
|
+
yn = !0;
|
|
470
|
+
var e = null;
|
|
471
|
+
try {
|
|
472
|
+
for (var t = 0; X.length > 0; ) {
|
|
473
|
+
var n = Pe.ensure();
|
|
474
|
+
if (t++ > 1e3) {
|
|
475
|
+
var r, i;
|
|
476
|
+
is();
|
|
477
|
+
}
|
|
478
|
+
n.process(X), He.clear();
|
|
479
|
+
}
|
|
480
|
+
} finally {
|
|
481
|
+
yn = !1, cn = null;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
function is() {
|
|
485
|
+
try {
|
|
486
|
+
Yi();
|
|
487
|
+
} catch (e) {
|
|
488
|
+
Et(e, cn);
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
let Ae = null;
|
|
492
|
+
function Zn(e) {
|
|
493
|
+
var t = e.length;
|
|
494
|
+
if (t !== 0) {
|
|
495
|
+
for (var n = 0; n < t; ) {
|
|
496
|
+
var r = e[n++];
|
|
497
|
+
if ((r.f & (ke | J)) === 0 && jt(r) && (Ae = /* @__PURE__ */ new Set(), It(r), r.deps === null && r.first === null && r.nodes === null && (r.teardown === null && r.ac === null ? ti(r) : r.fn = null), Ae?.size > 0)) {
|
|
498
|
+
He.clear();
|
|
499
|
+
for (const i of Ae) {
|
|
500
|
+
if ((i.f & (ke | J)) !== 0) continue;
|
|
501
|
+
const s = [i];
|
|
502
|
+
let l = i.parent;
|
|
503
|
+
for (; l !== null; )
|
|
504
|
+
Ae.has(l) && (Ae.delete(l), s.push(l)), l = l.parent;
|
|
505
|
+
for (let o = s.length - 1; o >= 0; o--) {
|
|
506
|
+
const a = s[o];
|
|
507
|
+
(a.f & (ke | J)) === 0 && It(a);
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
Ae.clear();
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
Ae = null;
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
function kr(e, t, n, r) {
|
|
517
|
+
if (!n.has(e) && (n.add(e), e.reactions !== null))
|
|
518
|
+
for (const i of e.reactions) {
|
|
519
|
+
const s = i.f;
|
|
520
|
+
(s & q) !== 0 ? kr(
|
|
521
|
+
/** @type {Derived} */
|
|
522
|
+
i,
|
|
523
|
+
t,
|
|
524
|
+
n,
|
|
525
|
+
r
|
|
526
|
+
) : (s & (Mn | Ie)) !== 0 && (s & j) === 0 && Pr(i, t, r) && (I(i, j), Le(
|
|
527
|
+
/** @type {Effect} */
|
|
528
|
+
i
|
|
529
|
+
));
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
function Pr(e, t, n) {
|
|
533
|
+
const r = n.get(e);
|
|
534
|
+
if (r !== void 0) return r;
|
|
535
|
+
if (e.deps !== null)
|
|
536
|
+
for (const i of e.deps) {
|
|
537
|
+
if (wt.call(t, i))
|
|
538
|
+
return !0;
|
|
539
|
+
if ((i.f & q) !== 0 && Pr(
|
|
540
|
+
/** @type {Derived} */
|
|
541
|
+
i,
|
|
542
|
+
t,
|
|
543
|
+
n
|
|
544
|
+
))
|
|
545
|
+
return n.set(
|
|
546
|
+
/** @type {Derived} */
|
|
547
|
+
i,
|
|
548
|
+
!0
|
|
549
|
+
), !0;
|
|
550
|
+
}
|
|
551
|
+
return n.set(e, !1), !1;
|
|
552
|
+
}
|
|
553
|
+
function Le(e) {
|
|
554
|
+
for (var t = cn = e; t.parent !== null; ) {
|
|
555
|
+
t = t.parent;
|
|
556
|
+
var n = t.f;
|
|
557
|
+
if (yn && t === S && (n & Ie) !== 0 && (n & wr) === 0)
|
|
558
|
+
return;
|
|
559
|
+
if ((n & (Ve | _e)) !== 0) {
|
|
560
|
+
if ((n & D) === 0) return;
|
|
561
|
+
t.f ^= D;
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
X.push(t);
|
|
565
|
+
}
|
|
566
|
+
function Lr(e) {
|
|
567
|
+
if (!((e.f & _e) !== 0 && (e.f & D) !== 0)) {
|
|
568
|
+
I(e, D);
|
|
569
|
+
for (var t = e.first; t !== null; )
|
|
570
|
+
Lr(t), t = t.next;
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
function ss(e) {
|
|
574
|
+
let t = 0, n = ot(0), r;
|
|
575
|
+
return () => {
|
|
576
|
+
Bn() && (_(n), jn(() => (t === 0 && (r = st(() => e(() => kt(n)))), t += 1, () => {
|
|
577
|
+
nt(() => {
|
|
578
|
+
t -= 1, t === 0 && (r?.(), r = void 0, kt(n));
|
|
579
|
+
});
|
|
580
|
+
})));
|
|
581
|
+
};
|
|
582
|
+
}
|
|
583
|
+
var ls = yt | ft | In;
|
|
584
|
+
function os(e, t, n) {
|
|
585
|
+
new fs(e, t, n);
|
|
586
|
+
}
|
|
587
|
+
var K, qt, ge, Je, me, re, Y, be, Oe, ze, Qe, Ce, pt, Ze, gt, mt, xe, rn, R, Ir, Mr, Tn, Kt, Wt, Sn;
|
|
588
|
+
class fs {
|
|
589
|
+
/**
|
|
590
|
+
* @param {TemplateNode} node
|
|
591
|
+
* @param {BoundaryProps} props
|
|
592
|
+
* @param {((anchor: Node) => void)} children
|
|
593
|
+
*/
|
|
594
|
+
constructor(t, n, r) {
|
|
595
|
+
y(this, R);
|
|
596
|
+
/** @type {Boundary | null} */
|
|
597
|
+
N(this, "parent");
|
|
598
|
+
N(this, "is_pending", !1);
|
|
599
|
+
/** @type {TemplateNode} */
|
|
600
|
+
y(this, K);
|
|
601
|
+
/** @type {TemplateNode | null} */
|
|
602
|
+
y(this, qt, E ? T : null);
|
|
603
|
+
/** @type {BoundaryProps} */
|
|
604
|
+
y(this, ge);
|
|
605
|
+
/** @type {((anchor: Node) => void)} */
|
|
606
|
+
y(this, Je);
|
|
607
|
+
/** @type {Effect} */
|
|
608
|
+
y(this, me);
|
|
609
|
+
/** @type {Effect | null} */
|
|
610
|
+
y(this, re, null);
|
|
611
|
+
/** @type {Effect | null} */
|
|
612
|
+
y(this, Y, null);
|
|
613
|
+
/** @type {Effect | null} */
|
|
614
|
+
y(this, be, null);
|
|
615
|
+
/** @type {DocumentFragment | null} */
|
|
616
|
+
y(this, Oe, null);
|
|
617
|
+
/** @type {TemplateNode | null} */
|
|
618
|
+
y(this, ze, null);
|
|
619
|
+
y(this, Qe, 0);
|
|
620
|
+
y(this, Ce, 0);
|
|
621
|
+
y(this, pt, !1);
|
|
622
|
+
y(this, Ze, !1);
|
|
623
|
+
/** @type {Set<Effect>} */
|
|
624
|
+
y(this, gt, /* @__PURE__ */ new Set());
|
|
625
|
+
/** @type {Set<Effect>} */
|
|
626
|
+
y(this, mt, /* @__PURE__ */ new Set());
|
|
627
|
+
/**
|
|
628
|
+
* A source containing the number of pending async deriveds/expressions.
|
|
629
|
+
* Only created if `$effect.pending()` is used inside the boundary,
|
|
630
|
+
* otherwise updating the source results in needless `Batch.ensure()`
|
|
631
|
+
* calls followed by no-op flushes
|
|
632
|
+
* @type {Source<number> | null}
|
|
633
|
+
*/
|
|
634
|
+
y(this, xe, null);
|
|
635
|
+
y(this, rn, ss(() => (m(this, xe, ot(u(this, Qe))), () => {
|
|
636
|
+
m(this, xe, null);
|
|
637
|
+
})));
|
|
638
|
+
m(this, K, t), m(this, ge, n), m(this, Je, r), this.parent = /** @type {Effect} */
|
|
639
|
+
S.b, this.is_pending = !!u(this, ge).pending, m(this, me, Hn(() => {
|
|
640
|
+
if (S.b = this, E) {
|
|
641
|
+
const s = u(this, qt);
|
|
642
|
+
Bt(), /** @type {Comment} */
|
|
643
|
+
s.nodeType === At && /** @type {Comment} */
|
|
644
|
+
s.data === ln ? M(this, R, Mr).call(this) : (M(this, R, Ir).call(this), u(this, Ce) === 0 && (this.is_pending = !1));
|
|
645
|
+
} else {
|
|
646
|
+
var i = M(this, R, Tn).call(this);
|
|
647
|
+
try {
|
|
648
|
+
m(this, re, se(() => r(i)));
|
|
649
|
+
} catch (s) {
|
|
650
|
+
this.error(s);
|
|
651
|
+
}
|
|
652
|
+
u(this, Ce) > 0 ? M(this, R, Wt).call(this) : this.is_pending = !1;
|
|
653
|
+
}
|
|
654
|
+
return () => {
|
|
655
|
+
u(this, ze)?.remove();
|
|
656
|
+
};
|
|
657
|
+
}, ls)), E && m(this, K, T);
|
|
658
|
+
}
|
|
659
|
+
/**
|
|
660
|
+
* Defer an effect inside a pending boundary until the boundary resolves
|
|
661
|
+
* @param {Effect} effect
|
|
662
|
+
*/
|
|
663
|
+
defer_effect(t) {
|
|
664
|
+
xr(t, u(this, gt), u(this, mt));
|
|
665
|
+
}
|
|
666
|
+
/**
|
|
667
|
+
* Returns `false` if the effect exists inside a boundary whose pending snippet is shown
|
|
668
|
+
* @returns {boolean}
|
|
669
|
+
*/
|
|
670
|
+
is_rendered() {
|
|
671
|
+
return !this.is_pending && (!this.parent || this.parent.is_rendered());
|
|
672
|
+
}
|
|
673
|
+
has_pending_snippet() {
|
|
674
|
+
return !!u(this, ge).pending;
|
|
675
|
+
}
|
|
676
|
+
/**
|
|
677
|
+
* Update the source that powers `$effect.pending()` inside this boundary,
|
|
678
|
+
* and controls when the current `pending` snippet (if any) is removed.
|
|
679
|
+
* Do not call from inside the class
|
|
680
|
+
* @param {1 | -1} d
|
|
681
|
+
*/
|
|
682
|
+
update_pending_count(t) {
|
|
683
|
+
M(this, R, Sn).call(this, t), m(this, Qe, u(this, Qe) + t), !(!u(this, xe) || u(this, pt)) && (m(this, pt, !0), nt(() => {
|
|
684
|
+
m(this, pt, !1), u(this, xe) && Tt(u(this, xe), u(this, Qe));
|
|
685
|
+
}));
|
|
686
|
+
}
|
|
687
|
+
get_effect_pending() {
|
|
688
|
+
return u(this, rn).call(this), _(
|
|
689
|
+
/** @type {Source<number>} */
|
|
690
|
+
u(this, xe)
|
|
691
|
+
);
|
|
692
|
+
}
|
|
693
|
+
/** @param {unknown} error */
|
|
694
|
+
error(t) {
|
|
695
|
+
var n = u(this, ge).onerror;
|
|
696
|
+
let r = u(this, ge).failed;
|
|
697
|
+
if (u(this, Ze) || !n && !r)
|
|
698
|
+
throw t;
|
|
699
|
+
u(this, re) && (B(u(this, re)), m(this, re, null)), u(this, Y) && (B(u(this, Y)), m(this, Y, null)), u(this, be) && (B(u(this, be)), m(this, be, null)), E && (Q(
|
|
700
|
+
/** @type {TemplateNode} */
|
|
701
|
+
u(this, qt)
|
|
702
|
+
), Zi(), Q(tn()));
|
|
703
|
+
var i = !1, s = !1;
|
|
704
|
+
const l = () => {
|
|
705
|
+
if (i) {
|
|
706
|
+
Qi();
|
|
707
|
+
return;
|
|
708
|
+
}
|
|
709
|
+
i = !0, s && Ji(), Pe.ensure(), m(this, Qe, 0), u(this, be) !== null && rt(u(this, be), () => {
|
|
710
|
+
m(this, be, null);
|
|
711
|
+
}), this.is_pending = this.has_pending_snippet(), m(this, re, M(this, R, Kt).call(this, () => (m(this, Ze, !1), se(() => u(this, Je).call(this, u(this, K)))))), u(this, Ce) > 0 ? M(this, R, Wt).call(this) : this.is_pending = !1;
|
|
712
|
+
};
|
|
713
|
+
nt(() => {
|
|
714
|
+
try {
|
|
715
|
+
s = !0, n?.(t, l), s = !1;
|
|
716
|
+
} catch (o) {
|
|
717
|
+
Et(o, u(this, me) && u(this, me).parent);
|
|
718
|
+
}
|
|
719
|
+
r && m(this, be, M(this, R, Kt).call(this, () => {
|
|
720
|
+
Pe.ensure(), m(this, Ze, !0);
|
|
721
|
+
try {
|
|
722
|
+
return se(() => {
|
|
723
|
+
r(
|
|
724
|
+
u(this, K),
|
|
725
|
+
() => t,
|
|
726
|
+
() => l
|
|
727
|
+
);
|
|
728
|
+
});
|
|
729
|
+
} catch (o) {
|
|
730
|
+
return Et(
|
|
731
|
+
o,
|
|
732
|
+
/** @type {Effect} */
|
|
733
|
+
u(this, me).parent
|
|
734
|
+
), null;
|
|
735
|
+
} finally {
|
|
736
|
+
m(this, Ze, !1);
|
|
737
|
+
}
|
|
738
|
+
}));
|
|
739
|
+
});
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
K = new WeakMap(), qt = new WeakMap(), ge = new WeakMap(), Je = new WeakMap(), me = new WeakMap(), re = new WeakMap(), Y = new WeakMap(), be = new WeakMap(), Oe = new WeakMap(), ze = new WeakMap(), Qe = new WeakMap(), Ce = new WeakMap(), pt = new WeakMap(), Ze = new WeakMap(), gt = new WeakMap(), mt = new WeakMap(), xe = new WeakMap(), rn = new WeakMap(), R = new WeakSet(), Ir = function() {
|
|
743
|
+
try {
|
|
744
|
+
m(this, re, se(() => u(this, Je).call(this, u(this, K))));
|
|
745
|
+
} catch (t) {
|
|
746
|
+
this.error(t);
|
|
747
|
+
}
|
|
748
|
+
}, Mr = function() {
|
|
749
|
+
const t = u(this, ge).pending;
|
|
750
|
+
t && (m(this, Y, se(() => t(u(this, K)))), nt(() => {
|
|
751
|
+
var n = M(this, R, Tn).call(this);
|
|
752
|
+
m(this, re, M(this, R, Kt).call(this, () => (Pe.ensure(), se(() => u(this, Je).call(this, n))))), u(this, Ce) > 0 ? M(this, R, Wt).call(this) : (rt(
|
|
753
|
+
/** @type {Effect} */
|
|
754
|
+
u(this, Y),
|
|
755
|
+
() => {
|
|
756
|
+
m(this, Y, null);
|
|
757
|
+
}
|
|
758
|
+
), this.is_pending = !1);
|
|
759
|
+
}));
|
|
760
|
+
}, Tn = function() {
|
|
761
|
+
var t = u(this, K);
|
|
762
|
+
return this.is_pending && (m(this, ze, ve()), u(this, K).before(u(this, ze)), t = u(this, ze)), t;
|
|
763
|
+
}, /**
|
|
764
|
+
* @param {() => Effect | null} fn
|
|
765
|
+
*/
|
|
766
|
+
Kt = function(t) {
|
|
767
|
+
var n = S, r = $, i = Z;
|
|
768
|
+
ye(u(this, me)), fe(u(this, me)), $t(u(this, me).ctx);
|
|
769
|
+
try {
|
|
770
|
+
return t();
|
|
771
|
+
} catch (s) {
|
|
772
|
+
return Or(s), null;
|
|
773
|
+
} finally {
|
|
774
|
+
ye(n), fe(r), $t(i);
|
|
775
|
+
}
|
|
776
|
+
}, Wt = function() {
|
|
777
|
+
const t = (
|
|
778
|
+
/** @type {(anchor: Node) => void} */
|
|
779
|
+
u(this, ge).pending
|
|
780
|
+
);
|
|
781
|
+
u(this, re) !== null && (m(this, Oe, document.createDocumentFragment()), u(this, Oe).append(
|
|
782
|
+
/** @type {TemplateNode} */
|
|
783
|
+
u(this, ze)
|
|
784
|
+
), ii(u(this, re), u(this, Oe))), u(this, Y) === null && m(this, Y, se(() => t(u(this, K))));
|
|
785
|
+
}, /**
|
|
786
|
+
* Updates the pending count associated with the currently visible pending snippet,
|
|
787
|
+
* if any, such that we can replace the snippet with content once work is done
|
|
788
|
+
* @param {1 | -1} d
|
|
789
|
+
*/
|
|
790
|
+
Sn = function(t) {
|
|
791
|
+
var n;
|
|
792
|
+
if (!this.has_pending_snippet()) {
|
|
793
|
+
this.parent && M(n = this.parent, R, Sn).call(n, t);
|
|
794
|
+
return;
|
|
795
|
+
}
|
|
796
|
+
if (m(this, Ce, u(this, Ce) + t), u(this, Ce) === 0) {
|
|
797
|
+
this.is_pending = !1;
|
|
798
|
+
for (const r of u(this, gt))
|
|
799
|
+
I(r, j), Le(r);
|
|
800
|
+
for (const r of u(this, mt))
|
|
801
|
+
I(r, Me), Le(r);
|
|
802
|
+
u(this, gt).clear(), u(this, mt).clear(), u(this, Y) && rt(u(this, Y), () => {
|
|
803
|
+
m(this, Y, null);
|
|
804
|
+
}), u(this, Oe) && (u(this, K).before(u(this, Oe)), m(this, Oe, null));
|
|
805
|
+
}
|
|
806
|
+
};
|
|
807
|
+
function us(e, t, n, r) {
|
|
808
|
+
const i = dn;
|
|
809
|
+
var s = e.filter((d) => !d.settled);
|
|
810
|
+
if (n.length === 0 && s.length === 0) {
|
|
811
|
+
r(t.map(i));
|
|
812
|
+
return;
|
|
813
|
+
}
|
|
814
|
+
var l = x, o = (
|
|
815
|
+
/** @type {Effect} */
|
|
816
|
+
S
|
|
817
|
+
), a = as(), f = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((d) => d.promise)) : null;
|
|
818
|
+
function h(d) {
|
|
819
|
+
a();
|
|
820
|
+
try {
|
|
821
|
+
r(d);
|
|
822
|
+
} catch (p) {
|
|
823
|
+
(o.f & ke) === 0 && Et(p, o);
|
|
824
|
+
}
|
|
825
|
+
l?.deactivate(), An();
|
|
826
|
+
}
|
|
827
|
+
if (n.length === 0) {
|
|
828
|
+
f.then(() => h(t.map(i)));
|
|
829
|
+
return;
|
|
830
|
+
}
|
|
831
|
+
function v() {
|
|
832
|
+
a(), Promise.all(n.map((d) => /* @__PURE__ */ cs(d))).then((d) => h([...t.map(i), ...d])).catch((d) => Et(d, o));
|
|
833
|
+
}
|
|
834
|
+
f ? f.then(v) : v();
|
|
835
|
+
}
|
|
836
|
+
function as() {
|
|
837
|
+
var e = S, t = $, n = Z, r = x;
|
|
838
|
+
return function(s = !0) {
|
|
839
|
+
ye(e), fe(t), $t(n), s && r?.activate();
|
|
840
|
+
};
|
|
841
|
+
}
|
|
842
|
+
function An() {
|
|
843
|
+
ye(null), fe(null), $t(null);
|
|
844
|
+
}
|
|
845
|
+
// @__NO_SIDE_EFFECTS__
|
|
846
|
+
function dn(e) {
|
|
847
|
+
var t = q | j, n = $ !== null && ($.f & q) !== 0 ? (
|
|
848
|
+
/** @type {Derived} */
|
|
849
|
+
$
|
|
850
|
+
) : null;
|
|
851
|
+
return S !== null && (S.f |= ft), {
|
|
852
|
+
ctx: Z,
|
|
853
|
+
deps: null,
|
|
854
|
+
effects: null,
|
|
855
|
+
equals: Er,
|
|
856
|
+
f: t,
|
|
857
|
+
fn: e,
|
|
858
|
+
reactions: null,
|
|
859
|
+
rv: 0,
|
|
860
|
+
v: (
|
|
861
|
+
/** @type {V} */
|
|
862
|
+
F
|
|
863
|
+
),
|
|
864
|
+
wv: 0,
|
|
865
|
+
parent: n ?? S,
|
|
866
|
+
ac: null
|
|
867
|
+
};
|
|
868
|
+
}
|
|
869
|
+
// @__NO_SIDE_EFFECTS__
|
|
870
|
+
function cs(e, t, n) {
|
|
871
|
+
let r = (
|
|
872
|
+
/** @type {Effect | null} */
|
|
873
|
+
S
|
|
874
|
+
);
|
|
875
|
+
r === null && Ui();
|
|
876
|
+
var i = (
|
|
877
|
+
/** @type {Boundary} */
|
|
878
|
+
r.b
|
|
879
|
+
), s = (
|
|
880
|
+
/** @type {Promise<V>} */
|
|
881
|
+
/** @type {unknown} */
|
|
882
|
+
void 0
|
|
883
|
+
), l = ot(
|
|
884
|
+
/** @type {V} */
|
|
885
|
+
F
|
|
886
|
+
), o = !$, a = /* @__PURE__ */ new Map();
|
|
887
|
+
return ys(() => {
|
|
888
|
+
var f = mr();
|
|
889
|
+
s = f.promise;
|
|
890
|
+
try {
|
|
891
|
+
Promise.resolve(e()).then(f.resolve, f.reject).then(() => {
|
|
892
|
+
h === x && h.committed && h.deactivate(), An();
|
|
893
|
+
});
|
|
894
|
+
} catch (p) {
|
|
895
|
+
f.reject(p), An();
|
|
896
|
+
}
|
|
897
|
+
var h = (
|
|
898
|
+
/** @type {Batch} */
|
|
899
|
+
x
|
|
900
|
+
);
|
|
901
|
+
if (o) {
|
|
902
|
+
var v = i.is_rendered();
|
|
903
|
+
i.update_pending_count(1), h.increment(v), a.get(h)?.reject(ct), a.delete(h), a.set(h, f);
|
|
904
|
+
}
|
|
905
|
+
const d = (p, c = void 0) => {
|
|
906
|
+
if (h.activate(), c)
|
|
907
|
+
c !== ct && (l.f |= je, Tt(l, c));
|
|
908
|
+
else {
|
|
909
|
+
(l.f & je) !== 0 && (l.f ^= je), Tt(l, p);
|
|
910
|
+
for (const [w, g] of a) {
|
|
911
|
+
if (a.delete(w), w === h) break;
|
|
912
|
+
g.reject(ct);
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
o && (i.update_pending_count(-1), h.decrement(v));
|
|
916
|
+
};
|
|
917
|
+
f.promise.then(d, (p) => d(null, p || "unknown"));
|
|
918
|
+
}), ms(() => {
|
|
919
|
+
for (const f of a.values())
|
|
920
|
+
f.reject(ct);
|
|
921
|
+
}), new Promise((f) => {
|
|
922
|
+
function h(v) {
|
|
923
|
+
function d() {
|
|
924
|
+
v === s ? f(l) : h(s);
|
|
925
|
+
}
|
|
926
|
+
v.then(d, d);
|
|
927
|
+
}
|
|
928
|
+
h(s);
|
|
929
|
+
});
|
|
930
|
+
}
|
|
931
|
+
// @__NO_SIDE_EFFECTS__
|
|
932
|
+
function er(e) {
|
|
933
|
+
const t = /* @__PURE__ */ dn(e);
|
|
934
|
+
return si(t), t;
|
|
935
|
+
}
|
|
936
|
+
// @__NO_SIDE_EFFECTS__
|
|
937
|
+
function Dr(e) {
|
|
938
|
+
const t = /* @__PURE__ */ dn(e);
|
|
939
|
+
return t.equals = Tr, t;
|
|
940
|
+
}
|
|
941
|
+
function Fr(e) {
|
|
942
|
+
var t = e.effects;
|
|
943
|
+
if (t !== null) {
|
|
944
|
+
e.effects = null;
|
|
945
|
+
for (var n = 0; n < t.length; n += 1)
|
|
946
|
+
B(
|
|
947
|
+
/** @type {Effect} */
|
|
948
|
+
t[n]
|
|
949
|
+
);
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
function ds(e) {
|
|
953
|
+
for (var t = e.parent; t !== null; ) {
|
|
954
|
+
if ((t.f & q) === 0)
|
|
955
|
+
return (t.f & ke) === 0 ? (
|
|
956
|
+
/** @type {Effect} */
|
|
957
|
+
t
|
|
958
|
+
) : null;
|
|
959
|
+
t = t.parent;
|
|
960
|
+
}
|
|
961
|
+
return null;
|
|
962
|
+
}
|
|
963
|
+
function Un(e) {
|
|
964
|
+
var t, n = S;
|
|
965
|
+
ye(ds(e));
|
|
966
|
+
try {
|
|
967
|
+
e.f &= ~lt, Fr(e), t = ui(e);
|
|
968
|
+
} finally {
|
|
969
|
+
ye(n);
|
|
970
|
+
}
|
|
971
|
+
return t;
|
|
972
|
+
}
|
|
973
|
+
function qr(e) {
|
|
974
|
+
var t = Un(e);
|
|
975
|
+
if (!e.equals(t) && (e.wv = oi(), (!x?.is_fork || e.deps === null) && (e.v = t, e.deps === null))) {
|
|
976
|
+
I(e, D);
|
|
977
|
+
return;
|
|
978
|
+
}
|
|
979
|
+
Ye || (de !== null ? (Bn() || x?.is_fork) && de.set(e, t) : zn(e));
|
|
980
|
+
}
|
|
981
|
+
let On = /* @__PURE__ */ new Set();
|
|
982
|
+
const He = /* @__PURE__ */ new Map();
|
|
983
|
+
let zr = !1;
|
|
984
|
+
function ot(e, t) {
|
|
985
|
+
var n = {
|
|
986
|
+
f: 0,
|
|
987
|
+
// TODO ideally we could skip this altogether, but it causes type errors
|
|
988
|
+
v: e,
|
|
989
|
+
reactions: null,
|
|
990
|
+
equals: Er,
|
|
991
|
+
rv: 0,
|
|
992
|
+
wv: 0
|
|
993
|
+
};
|
|
994
|
+
return n;
|
|
995
|
+
}
|
|
996
|
+
// @__NO_SIDE_EFFECTS__
|
|
997
|
+
function U(e, t) {
|
|
998
|
+
const n = ot(e);
|
|
999
|
+
return si(n), n;
|
|
1000
|
+
}
|
|
1001
|
+
// @__NO_SIDE_EFFECTS__
|
|
1002
|
+
function Ur(e, t = !1, n = !0) {
|
|
1003
|
+
const r = ot(e);
|
|
1004
|
+
return t || (r.equals = Tr), r;
|
|
1005
|
+
}
|
|
1006
|
+
function L(e, t, n = !1) {
|
|
1007
|
+
$ !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
|
|
1008
|
+
// to ensure we error if state is set inside an inspect effect
|
|
1009
|
+
(!he || ($.f & Qn) !== 0) && Sr() && ($.f & (q | Ie | Mn | Qn)) !== 0 && (oe === null || !wt.call(oe, e)) && Xi();
|
|
1010
|
+
let r = n ? Be(t) : t;
|
|
1011
|
+
return Tt(e, r);
|
|
1012
|
+
}
|
|
1013
|
+
function Tt(e, t) {
|
|
1014
|
+
if (!e.equals(t)) {
|
|
1015
|
+
var n = e.v;
|
|
1016
|
+
Ye ? He.set(e, t) : He.set(e, n), e.v = t;
|
|
1017
|
+
var r = Pe.ensure();
|
|
1018
|
+
if (r.capture(e, n), (e.f & q) !== 0) {
|
|
1019
|
+
const i = (
|
|
1020
|
+
/** @type {Derived} */
|
|
1021
|
+
e
|
|
1022
|
+
);
|
|
1023
|
+
(e.f & j) !== 0 && Un(i), zn(i);
|
|
1024
|
+
}
|
|
1025
|
+
e.wv = oi(), Br(e, j), S !== null && (S.f & D) !== 0 && (S.f & (_e | Ve)) === 0 && (ne === null ? Ts([e]) : ne.push(e)), !r.is_fork && On.size > 0 && !zr && hs();
|
|
1026
|
+
}
|
|
1027
|
+
return t;
|
|
1028
|
+
}
|
|
1029
|
+
function hs() {
|
|
1030
|
+
zr = !1;
|
|
1031
|
+
for (const e of On)
|
|
1032
|
+
(e.f & D) !== 0 && I(e, Me), jt(e) && It(e);
|
|
1033
|
+
On.clear();
|
|
1034
|
+
}
|
|
1035
|
+
function kt(e) {
|
|
1036
|
+
L(e, e.v + 1);
|
|
1037
|
+
}
|
|
1038
|
+
function Br(e, t) {
|
|
1039
|
+
var n = e.reactions;
|
|
1040
|
+
if (n !== null)
|
|
1041
|
+
for (var r = n.length, i = 0; i < r; i++) {
|
|
1042
|
+
var s = n[i], l = s.f, o = (l & j) === 0;
|
|
1043
|
+
if (o && I(s, t), (l & q) !== 0) {
|
|
1044
|
+
var a = (
|
|
1045
|
+
/** @type {Derived} */
|
|
1046
|
+
s
|
|
1047
|
+
);
|
|
1048
|
+
de?.delete(a), (l & lt) === 0 && (l & le && (s.f |= lt), Br(a, Me));
|
|
1049
|
+
} else o && ((l & Ie) !== 0 && Ae !== null && Ae.add(
|
|
1050
|
+
/** @type {Effect} */
|
|
1051
|
+
s
|
|
1052
|
+
), Le(
|
|
1053
|
+
/** @type {Effect} */
|
|
1054
|
+
s
|
|
1055
|
+
));
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
function Be(e) {
|
|
1059
|
+
if (typeof e != "object" || e === null || Nt in e)
|
|
1060
|
+
return e;
|
|
1061
|
+
const t = gr(e);
|
|
1062
|
+
if (t !== Ii && t !== Mi)
|
|
1063
|
+
return e;
|
|
1064
|
+
var n = /* @__PURE__ */ new Map(), r = pr(e), i = /* @__PURE__ */ U(0), s = it, l = (o) => {
|
|
1065
|
+
if (it === s)
|
|
1066
|
+
return o();
|
|
1067
|
+
var a = $, f = it;
|
|
1068
|
+
fe(null), rr(s);
|
|
1069
|
+
var h = o();
|
|
1070
|
+
return fe(a), rr(f), h;
|
|
1071
|
+
};
|
|
1072
|
+
return r && n.set("length", /* @__PURE__ */ U(
|
|
1073
|
+
/** @type {any[]} */
|
|
1074
|
+
e.length
|
|
1075
|
+
)), new Proxy(
|
|
1076
|
+
/** @type {any} */
|
|
1077
|
+
e,
|
|
1078
|
+
{
|
|
1079
|
+
defineProperty(o, a, f) {
|
|
1080
|
+
(!("value" in f) || f.configurable === !1 || f.enumerable === !1 || f.writable === !1) && Ki();
|
|
1081
|
+
var h = n.get(a);
|
|
1082
|
+
return h === void 0 ? h = l(() => {
|
|
1083
|
+
var v = /* @__PURE__ */ U(f.value);
|
|
1084
|
+
return n.set(a, v), v;
|
|
1085
|
+
}) : L(h, f.value, !0), !0;
|
|
1086
|
+
},
|
|
1087
|
+
deleteProperty(o, a) {
|
|
1088
|
+
var f = n.get(a);
|
|
1089
|
+
if (f === void 0) {
|
|
1090
|
+
if (a in o) {
|
|
1091
|
+
const h = l(() => /* @__PURE__ */ U(F));
|
|
1092
|
+
n.set(a, h), kt(i);
|
|
1093
|
+
}
|
|
1094
|
+
} else
|
|
1095
|
+
L(f, F), kt(i);
|
|
1096
|
+
return !0;
|
|
1097
|
+
},
|
|
1098
|
+
get(o, a, f) {
|
|
1099
|
+
if (a === Nt)
|
|
1100
|
+
return e;
|
|
1101
|
+
var h = n.get(a), v = a in o;
|
|
1102
|
+
if (h === void 0 && (!v || tt(o, a)?.writable) && (h = l(() => {
|
|
1103
|
+
var p = Be(v ? o[a] : F), c = /* @__PURE__ */ U(p);
|
|
1104
|
+
return c;
|
|
1105
|
+
}), n.set(a, h)), h !== void 0) {
|
|
1106
|
+
var d = _(h);
|
|
1107
|
+
return d === F ? void 0 : d;
|
|
1108
|
+
}
|
|
1109
|
+
return Reflect.get(o, a, f);
|
|
1110
|
+
},
|
|
1111
|
+
getOwnPropertyDescriptor(o, a) {
|
|
1112
|
+
var f = Reflect.getOwnPropertyDescriptor(o, a);
|
|
1113
|
+
if (f && "value" in f) {
|
|
1114
|
+
var h = n.get(a);
|
|
1115
|
+
h && (f.value = _(h));
|
|
1116
|
+
} else if (f === void 0) {
|
|
1117
|
+
var v = n.get(a), d = v?.v;
|
|
1118
|
+
if (v !== void 0 && d !== F)
|
|
1119
|
+
return {
|
|
1120
|
+
enumerable: !0,
|
|
1121
|
+
configurable: !0,
|
|
1122
|
+
value: d,
|
|
1123
|
+
writable: !0
|
|
1124
|
+
};
|
|
1125
|
+
}
|
|
1126
|
+
return f;
|
|
1127
|
+
},
|
|
1128
|
+
has(o, a) {
|
|
1129
|
+
if (a === Nt)
|
|
1130
|
+
return !0;
|
|
1131
|
+
var f = n.get(a), h = f !== void 0 && f.v !== F || Reflect.has(o, a);
|
|
1132
|
+
if (f !== void 0 || S !== null && (!h || tt(o, a)?.writable)) {
|
|
1133
|
+
f === void 0 && (f = l(() => {
|
|
1134
|
+
var d = h ? Be(o[a]) : F, p = /* @__PURE__ */ U(d);
|
|
1135
|
+
return p;
|
|
1136
|
+
}), n.set(a, f));
|
|
1137
|
+
var v = _(f);
|
|
1138
|
+
if (v === F)
|
|
1139
|
+
return !1;
|
|
1140
|
+
}
|
|
1141
|
+
return h;
|
|
1142
|
+
},
|
|
1143
|
+
set(o, a, f, h) {
|
|
1144
|
+
var v = n.get(a), d = a in o;
|
|
1145
|
+
if (r && a === "length")
|
|
1146
|
+
for (var p = f; p < /** @type {Source<number>} */
|
|
1147
|
+
v.v; p += 1) {
|
|
1148
|
+
var c = n.get(p + "");
|
|
1149
|
+
c !== void 0 ? L(c, F) : p in o && (c = l(() => /* @__PURE__ */ U(F)), n.set(p + "", c));
|
|
1150
|
+
}
|
|
1151
|
+
if (v === void 0)
|
|
1152
|
+
(!d || tt(o, a)?.writable) && (v = l(() => /* @__PURE__ */ U(void 0)), L(v, Be(f)), n.set(a, v));
|
|
1153
|
+
else {
|
|
1154
|
+
d = v.v !== F;
|
|
1155
|
+
var w = l(() => Be(f));
|
|
1156
|
+
L(v, w);
|
|
1157
|
+
}
|
|
1158
|
+
var g = Reflect.getOwnPropertyDescriptor(o, a);
|
|
1159
|
+
if (g?.set && g.set.call(h, f), !d) {
|
|
1160
|
+
if (r && typeof a == "string") {
|
|
1161
|
+
var k = (
|
|
1162
|
+
/** @type {Source<number>} */
|
|
1163
|
+
n.get("length")
|
|
1164
|
+
), A = Number(a);
|
|
1165
|
+
Number.isInteger(A) && A >= k.v && L(k, A + 1);
|
|
1166
|
+
}
|
|
1167
|
+
kt(i);
|
|
1168
|
+
}
|
|
1169
|
+
return !0;
|
|
1170
|
+
},
|
|
1171
|
+
ownKeys(o) {
|
|
1172
|
+
_(i);
|
|
1173
|
+
var a = Reflect.ownKeys(o).filter((v) => {
|
|
1174
|
+
var d = n.get(v);
|
|
1175
|
+
return d === void 0 || d.v !== F;
|
|
1176
|
+
});
|
|
1177
|
+
for (var [f, h] of n)
|
|
1178
|
+
h.v !== F && !(f in o) && a.push(f);
|
|
1179
|
+
return a;
|
|
1180
|
+
},
|
|
1181
|
+
setPrototypeOf() {
|
|
1182
|
+
Wi();
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
);
|
|
1186
|
+
}
|
|
1187
|
+
var tr, jr, Hr, Yr;
|
|
1188
|
+
function Cn() {
|
|
1189
|
+
if (tr === void 0) {
|
|
1190
|
+
tr = window, jr = /Firefox/.test(navigator.userAgent);
|
|
1191
|
+
var e = Element.prototype, t = Node.prototype, n = Text.prototype;
|
|
1192
|
+
Hr = tt(t, "firstChild").get, Yr = tt(t, "nextSibling").get, Jn(e) && (e.__click = void 0, e.__className = void 0, e.__attributes = null, e.__style = void 0, e.__e = void 0), Jn(n) && (n.__t = void 0);
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
function ve(e = "") {
|
|
1196
|
+
return document.createTextNode(e);
|
|
1197
|
+
}
|
|
1198
|
+
// @__NO_SIDE_EFFECTS__
|
|
1199
|
+
function St(e) {
|
|
1200
|
+
return (
|
|
1201
|
+
/** @type {TemplateNode | null} */
|
|
1202
|
+
Hr.call(e)
|
|
1203
|
+
);
|
|
1204
|
+
}
|
|
1205
|
+
// @__NO_SIDE_EFFECTS__
|
|
1206
|
+
function Ee(e) {
|
|
1207
|
+
return (
|
|
1208
|
+
/** @type {TemplateNode | null} */
|
|
1209
|
+
Yr.call(e)
|
|
1210
|
+
);
|
|
1211
|
+
}
|
|
1212
|
+
function xn(e, t) {
|
|
1213
|
+
if (!E)
|
|
1214
|
+
return /* @__PURE__ */ St(e);
|
|
1215
|
+
var n = /* @__PURE__ */ St(T);
|
|
1216
|
+
return n === null && (n = T.appendChild(ve())), Q(n), n;
|
|
1217
|
+
}
|
|
1218
|
+
function vs(e, t = !1) {
|
|
1219
|
+
if (!E) {
|
|
1220
|
+
var n = /* @__PURE__ */ St(e);
|
|
1221
|
+
return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Ee(n) : n;
|
|
1222
|
+
}
|
|
1223
|
+
if (t) {
|
|
1224
|
+
if (T?.nodeType !== Dn) {
|
|
1225
|
+
var r = ve();
|
|
1226
|
+
return T?.before(r), Q(r), r;
|
|
1227
|
+
}
|
|
1228
|
+
Kr(
|
|
1229
|
+
/** @type {Text} */
|
|
1230
|
+
T
|
|
1231
|
+
);
|
|
1232
|
+
}
|
|
1233
|
+
return T;
|
|
1234
|
+
}
|
|
1235
|
+
function _s(e, t = 1, n = !1) {
|
|
1236
|
+
let r = E ? T : e;
|
|
1237
|
+
for (var i; t--; )
|
|
1238
|
+
i = r, r = /** @type {TemplateNode} */
|
|
1239
|
+
/* @__PURE__ */ Ee(r);
|
|
1240
|
+
if (!E)
|
|
1241
|
+
return r;
|
|
1242
|
+
if (n) {
|
|
1243
|
+
if (r?.nodeType !== Dn) {
|
|
1244
|
+
var s = ve();
|
|
1245
|
+
return r === null ? i?.after(s) : r.before(s), Q(s), s;
|
|
1246
|
+
}
|
|
1247
|
+
Kr(
|
|
1248
|
+
/** @type {Text} */
|
|
1249
|
+
r
|
|
1250
|
+
);
|
|
1251
|
+
}
|
|
1252
|
+
return Q(r), r;
|
|
1253
|
+
}
|
|
1254
|
+
function Vr(e) {
|
|
1255
|
+
e.textContent = "";
|
|
1256
|
+
}
|
|
1257
|
+
function Gr() {
|
|
1258
|
+
return !1;
|
|
1259
|
+
}
|
|
1260
|
+
function Kr(e) {
|
|
1261
|
+
if (
|
|
1262
|
+
/** @type {string} */
|
|
1263
|
+
e.nodeValue.length < 65536
|
|
1264
|
+
)
|
|
1265
|
+
return;
|
|
1266
|
+
let t = e.nextSibling;
|
|
1267
|
+
for (; t !== null && t.nodeType === Dn; )
|
|
1268
|
+
t.remove(), e.nodeValue += /** @type {string} */
|
|
1269
|
+
t.nodeValue, t = e.nextSibling;
|
|
1270
|
+
}
|
|
1271
|
+
function Wr(e) {
|
|
1272
|
+
var t = $, n = S;
|
|
1273
|
+
fe(null), ye(null);
|
|
1274
|
+
try {
|
|
1275
|
+
return e();
|
|
1276
|
+
} finally {
|
|
1277
|
+
fe(t), ye(n);
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
function ps(e) {
|
|
1281
|
+
S === null && ($ === null && Hi(), ji()), Ye && Bi();
|
|
1282
|
+
}
|
|
1283
|
+
function gs(e, t) {
|
|
1284
|
+
var n = t.last;
|
|
1285
|
+
n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e);
|
|
1286
|
+
}
|
|
1287
|
+
function Te(e, t, n) {
|
|
1288
|
+
var r = S;
|
|
1289
|
+
r !== null && (r.f & J) !== 0 && (e |= J);
|
|
1290
|
+
var i = {
|
|
1291
|
+
ctx: Z,
|
|
1292
|
+
deps: null,
|
|
1293
|
+
nodes: null,
|
|
1294
|
+
f: e | j | le,
|
|
1295
|
+
first: null,
|
|
1296
|
+
fn: t,
|
|
1297
|
+
last: null,
|
|
1298
|
+
next: null,
|
|
1299
|
+
parent: r,
|
|
1300
|
+
b: r && r.b,
|
|
1301
|
+
prev: null,
|
|
1302
|
+
teardown: null,
|
|
1303
|
+
wv: 0,
|
|
1304
|
+
ac: null
|
|
1305
|
+
};
|
|
1306
|
+
if (n)
|
|
1307
|
+
try {
|
|
1308
|
+
It(i), i.f |= un;
|
|
1309
|
+
} catch (o) {
|
|
1310
|
+
throw B(i), o;
|
|
1311
|
+
}
|
|
1312
|
+
else t !== null && Le(i);
|
|
1313
|
+
var s = i;
|
|
1314
|
+
if (n && s.deps === null && s.teardown === null && s.nodes === null && s.first === s.last && // either `null`, or a singular child
|
|
1315
|
+
(s.f & ft) === 0 && (s = s.first, (e & Ie) !== 0 && (e & yt) !== 0 && s !== null && (s.f |= yt)), s !== null && (s.parent = r, r !== null && gs(s, r), $ !== null && ($.f & q) !== 0 && (e & Ve) === 0)) {
|
|
1316
|
+
var l = (
|
|
1317
|
+
/** @type {Derived} */
|
|
1318
|
+
$
|
|
1319
|
+
);
|
|
1320
|
+
(l.effects ?? (l.effects = [])).push(s);
|
|
1321
|
+
}
|
|
1322
|
+
return i;
|
|
1323
|
+
}
|
|
1324
|
+
function Bn() {
|
|
1325
|
+
return $ !== null && !he;
|
|
1326
|
+
}
|
|
1327
|
+
function ms(e) {
|
|
1328
|
+
const t = Te(fn, null, !1);
|
|
1329
|
+
return I(t, D), t.teardown = e, t;
|
|
1330
|
+
}
|
|
1331
|
+
function Lt(e) {
|
|
1332
|
+
ps();
|
|
1333
|
+
var t = (
|
|
1334
|
+
/** @type {Effect} */
|
|
1335
|
+
S.f
|
|
1336
|
+
), n = !$ && (t & _e) !== 0 && (t & un) === 0;
|
|
1337
|
+
if (n) {
|
|
1338
|
+
var r = (
|
|
1339
|
+
/** @type {ComponentContext} */
|
|
1340
|
+
Z
|
|
1341
|
+
);
|
|
1342
|
+
(r.e ?? (r.e = [])).push(e);
|
|
1343
|
+
} else
|
|
1344
|
+
return Xr(e);
|
|
1345
|
+
}
|
|
1346
|
+
function Xr(e) {
|
|
1347
|
+
return Te(en | Fi, e, !1);
|
|
1348
|
+
}
|
|
1349
|
+
function bs(e) {
|
|
1350
|
+
Pe.ensure();
|
|
1351
|
+
const t = Te(Ve | ft, e, !0);
|
|
1352
|
+
return () => {
|
|
1353
|
+
B(t);
|
|
1354
|
+
};
|
|
1355
|
+
}
|
|
1356
|
+
function ws(e) {
|
|
1357
|
+
Pe.ensure();
|
|
1358
|
+
const t = Te(Ve | ft, e, !0);
|
|
1359
|
+
return (n = {}) => new Promise((r) => {
|
|
1360
|
+
n.outro ? rt(t, () => {
|
|
1361
|
+
B(t), r(void 0);
|
|
1362
|
+
}) : (B(t), r(void 0));
|
|
1363
|
+
});
|
|
1364
|
+
}
|
|
1365
|
+
function Jr(e) {
|
|
1366
|
+
return Te(en, e, !1);
|
|
1367
|
+
}
|
|
1368
|
+
function ys(e) {
|
|
1369
|
+
return Te(Mn | ft, e, !0);
|
|
1370
|
+
}
|
|
1371
|
+
function jn(e, t = 0) {
|
|
1372
|
+
return Te(fn | t, e, !0);
|
|
1373
|
+
}
|
|
1374
|
+
function Qr(e, t = [], n = [], r = []) {
|
|
1375
|
+
us(r, t, n, (i) => {
|
|
1376
|
+
Te(fn, () => e(...i.map(_)), !0);
|
|
1377
|
+
});
|
|
1378
|
+
}
|
|
1379
|
+
function Hn(e, t = 0) {
|
|
1380
|
+
var n = Te(Ie | t, e, !0);
|
|
1381
|
+
return n;
|
|
1382
|
+
}
|
|
1383
|
+
function se(e) {
|
|
1384
|
+
return Te(_e | ft, e, !0);
|
|
1385
|
+
}
|
|
1386
|
+
function Zr(e) {
|
|
1387
|
+
var t = e.teardown;
|
|
1388
|
+
if (t !== null) {
|
|
1389
|
+
const n = Ye, r = $;
|
|
1390
|
+
nr(!0), fe(null);
|
|
1391
|
+
try {
|
|
1392
|
+
t.call(null);
|
|
1393
|
+
} finally {
|
|
1394
|
+
nr(n), fe(r);
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1397
|
+
}
|
|
1398
|
+
function ei(e, t = !1) {
|
|
1399
|
+
var n = e.first;
|
|
1400
|
+
for (e.first = e.last = null; n !== null; ) {
|
|
1401
|
+
const i = n.ac;
|
|
1402
|
+
i !== null && Wr(() => {
|
|
1403
|
+
i.abort(ct);
|
|
1404
|
+
});
|
|
1405
|
+
var r = n.next;
|
|
1406
|
+
(n.f & Ve) !== 0 ? n.parent = null : B(n, t), n = r;
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
function $s(e) {
|
|
1410
|
+
for (var t = e.first; t !== null; ) {
|
|
1411
|
+
var n = t.next;
|
|
1412
|
+
(t.f & _e) === 0 && B(t), t = n;
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
function B(e, t = !0) {
|
|
1416
|
+
var n = !1;
|
|
1417
|
+
(t || (e.f & wr) !== 0) && e.nodes !== null && e.nodes.end !== null && (Es(
|
|
1418
|
+
e.nodes.start,
|
|
1419
|
+
/** @type {TemplateNode} */
|
|
1420
|
+
e.nodes.end
|
|
1421
|
+
), n = !0), ei(e, t && !n), nn(e, 0), I(e, ke);
|
|
1422
|
+
var r = e.nodes && e.nodes.t;
|
|
1423
|
+
if (r !== null)
|
|
1424
|
+
for (const s of r)
|
|
1425
|
+
s.stop();
|
|
1426
|
+
Zr(e);
|
|
1427
|
+
var i = e.parent;
|
|
1428
|
+
i !== null && i.first !== null && ti(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = null;
|
|
1429
|
+
}
|
|
1430
|
+
function Es(e, t) {
|
|
1431
|
+
for (; e !== null; ) {
|
|
1432
|
+
var n = e === t ? null : /* @__PURE__ */ Ee(e);
|
|
1433
|
+
e.remove(), e = n;
|
|
1434
|
+
}
|
|
1435
|
+
}
|
|
1436
|
+
function ti(e) {
|
|
1437
|
+
var t = e.parent, n = e.prev, r = e.next;
|
|
1438
|
+
n !== null && (n.next = r), r !== null && (r.prev = n), t !== null && (t.first === e && (t.first = r), t.last === e && (t.last = n));
|
|
1439
|
+
}
|
|
1440
|
+
function rt(e, t, n = !0) {
|
|
1441
|
+
var r = [];
|
|
1442
|
+
ni(e, r, !0);
|
|
1443
|
+
var i = () => {
|
|
1444
|
+
n && B(e), t && t();
|
|
1445
|
+
}, s = r.length;
|
|
1446
|
+
if (s > 0) {
|
|
1447
|
+
var l = () => --s || i();
|
|
1448
|
+
for (var o of r)
|
|
1449
|
+
o.out(l);
|
|
1450
|
+
} else
|
|
1451
|
+
i();
|
|
1452
|
+
}
|
|
1453
|
+
function ni(e, t, n) {
|
|
1454
|
+
if ((e.f & J) === 0) {
|
|
1455
|
+
e.f ^= J;
|
|
1456
|
+
var r = e.nodes && e.nodes.t;
|
|
1457
|
+
if (r !== null)
|
|
1458
|
+
for (const o of r)
|
|
1459
|
+
(o.is_global || n) && t.push(o);
|
|
1460
|
+
for (var i = e.first; i !== null; ) {
|
|
1461
|
+
var s = i.next, l = (i.f & yt) !== 0 || // If this is a branch effect without a block effect parent,
|
|
1462
|
+
// it means the parent block effect was pruned. In that case,
|
|
1463
|
+
// transparency information was transferred to the branch effect.
|
|
1464
|
+
(i.f & _e) !== 0 && (e.f & Ie) !== 0;
|
|
1465
|
+
ni(i, t, l ? n : !1), i = s;
|
|
1466
|
+
}
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
function Yn(e) {
|
|
1470
|
+
ri(e, !0);
|
|
1471
|
+
}
|
|
1472
|
+
function ri(e, t) {
|
|
1473
|
+
if ((e.f & J) !== 0) {
|
|
1474
|
+
e.f ^= J, (e.f & D) === 0 && (I(e, j), Le(e));
|
|
1475
|
+
for (var n = e.first; n !== null; ) {
|
|
1476
|
+
var r = n.next, i = (n.f & yt) !== 0 || (n.f & _e) !== 0;
|
|
1477
|
+
ri(n, i ? t : !1), n = r;
|
|
1478
|
+
}
|
|
1479
|
+
var s = e.nodes && e.nodes.t;
|
|
1480
|
+
if (s !== null)
|
|
1481
|
+
for (const l of s)
|
|
1482
|
+
(l.is_global || t) && l.in();
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1485
|
+
function ii(e, t) {
|
|
1486
|
+
if (e.nodes)
|
|
1487
|
+
for (var n = e.nodes.start, r = e.nodes.end; n !== null; ) {
|
|
1488
|
+
var i = n === r ? null : /* @__PURE__ */ Ee(n);
|
|
1489
|
+
t.append(n), n = i;
|
|
1490
|
+
}
|
|
1491
|
+
}
|
|
1492
|
+
let Xt = !1, Ye = !1;
|
|
1493
|
+
function nr(e) {
|
|
1494
|
+
Ye = e;
|
|
1495
|
+
}
|
|
1496
|
+
let $ = null, he = !1;
|
|
1497
|
+
function fe(e) {
|
|
1498
|
+
$ = e;
|
|
1499
|
+
}
|
|
1500
|
+
let S = null;
|
|
1501
|
+
function ye(e) {
|
|
1502
|
+
S = e;
|
|
1503
|
+
}
|
|
1504
|
+
let oe = null;
|
|
1505
|
+
function si(e) {
|
|
1506
|
+
$ !== null && (oe === null ? oe = [e] : oe.push(e));
|
|
1507
|
+
}
|
|
1508
|
+
let V = null, G = 0, ne = null;
|
|
1509
|
+
function Ts(e) {
|
|
1510
|
+
ne = e;
|
|
1511
|
+
}
|
|
1512
|
+
let li = 1, Ke = 0, it = Ke;
|
|
1513
|
+
function rr(e) {
|
|
1514
|
+
it = e;
|
|
1515
|
+
}
|
|
1516
|
+
function oi() {
|
|
1517
|
+
return ++li;
|
|
1518
|
+
}
|
|
1519
|
+
function jt(e) {
|
|
1520
|
+
var t = e.f;
|
|
1521
|
+
if ((t & j) !== 0)
|
|
1522
|
+
return !0;
|
|
1523
|
+
if (t & q && (e.f &= ~lt), (t & Me) !== 0) {
|
|
1524
|
+
for (var n = (
|
|
1525
|
+
/** @type {Value[]} */
|
|
1526
|
+
e.deps
|
|
1527
|
+
), r = n.length, i = 0; i < r; i++) {
|
|
1528
|
+
var s = n[i];
|
|
1529
|
+
if (jt(
|
|
1530
|
+
/** @type {Derived} */
|
|
1531
|
+
s
|
|
1532
|
+
) && qr(
|
|
1533
|
+
/** @type {Derived} */
|
|
1534
|
+
s
|
|
1535
|
+
), s.wv > e.wv)
|
|
1536
|
+
return !0;
|
|
1537
|
+
}
|
|
1538
|
+
(t & le) !== 0 && // During time traveling we don't want to reset the status so that
|
|
1539
|
+
// traversal of the graph in the other batches still happens
|
|
1540
|
+
de === null && I(e, D);
|
|
1541
|
+
}
|
|
1542
|
+
return !1;
|
|
1543
|
+
}
|
|
1544
|
+
function fi(e, t, n = !0) {
|
|
1545
|
+
var r = e.reactions;
|
|
1546
|
+
if (r !== null && !(oe !== null && wt.call(oe, e)))
|
|
1547
|
+
for (var i = 0; i < r.length; i++) {
|
|
1548
|
+
var s = r[i];
|
|
1549
|
+
(s.f & q) !== 0 ? fi(
|
|
1550
|
+
/** @type {Derived} */
|
|
1551
|
+
s,
|
|
1552
|
+
t,
|
|
1553
|
+
!1
|
|
1554
|
+
) : t === s && (n ? I(s, j) : (s.f & D) !== 0 && I(s, Me), Le(
|
|
1555
|
+
/** @type {Effect} */
|
|
1556
|
+
s
|
|
1557
|
+
));
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
function ui(e) {
|
|
1561
|
+
var w;
|
|
1562
|
+
var t = V, n = G, r = ne, i = $, s = oe, l = Z, o = he, a = it, f = e.f;
|
|
1563
|
+
V = /** @type {null | Value[]} */
|
|
1564
|
+
null, G = 0, ne = null, $ = (f & (_e | Ve)) === 0 ? e : null, oe = null, $t(e.ctx), he = !1, it = ++Ke, e.ac !== null && (Wr(() => {
|
|
1565
|
+
e.ac.abort(ct);
|
|
1566
|
+
}), e.ac = null);
|
|
1567
|
+
try {
|
|
1568
|
+
e.f |= wn;
|
|
1569
|
+
var h = (
|
|
1570
|
+
/** @type {Function} */
|
|
1571
|
+
e.fn
|
|
1572
|
+
), v = h(), d = e.deps, p = x?.is_fork;
|
|
1573
|
+
if (V !== null) {
|
|
1574
|
+
var c;
|
|
1575
|
+
if (p || nn(e, G), d !== null && G > 0)
|
|
1576
|
+
for (d.length = G + V.length, c = 0; c < V.length; c++)
|
|
1577
|
+
d[G + c] = V[c];
|
|
1578
|
+
else
|
|
1579
|
+
e.deps = d = V;
|
|
1580
|
+
if (Bn() && (e.f & le) !== 0)
|
|
1581
|
+
for (c = G; c < d.length; c++)
|
|
1582
|
+
((w = d[c]).reactions ?? (w.reactions = [])).push(e);
|
|
1583
|
+
} else !p && d !== null && G < d.length && (nn(e, G), d.length = G);
|
|
1584
|
+
if (Sr() && ne !== null && !he && d !== null && (e.f & (q | Me | j)) === 0)
|
|
1585
|
+
for (c = 0; c < /** @type {Source[]} */
|
|
1586
|
+
ne.length; c++)
|
|
1587
|
+
fi(
|
|
1588
|
+
ne[c],
|
|
1589
|
+
/** @type {Effect} */
|
|
1590
|
+
e
|
|
1591
|
+
);
|
|
1592
|
+
if (i !== null && i !== e) {
|
|
1593
|
+
if (Ke++, i.deps !== null)
|
|
1594
|
+
for (let g = 0; g < n; g += 1)
|
|
1595
|
+
i.deps[g].rv = Ke;
|
|
1596
|
+
if (t !== null)
|
|
1597
|
+
for (const g of t)
|
|
1598
|
+
g.rv = Ke;
|
|
1599
|
+
ne !== null && (r === null ? r = ne : r.push(.../** @type {Source[]} */
|
|
1600
|
+
ne));
|
|
1601
|
+
}
|
|
1602
|
+
return (e.f & je) !== 0 && (e.f ^= je), v;
|
|
1603
|
+
} catch (g) {
|
|
1604
|
+
return Or(g);
|
|
1605
|
+
} finally {
|
|
1606
|
+
e.f ^= wn, V = t, G = n, ne = r, $ = i, oe = s, $t(l), he = o, it = a;
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
function Ss(e, t) {
|
|
1610
|
+
let n = t.reactions;
|
|
1611
|
+
if (n !== null) {
|
|
1612
|
+
var r = Pi.call(n, e);
|
|
1613
|
+
if (r !== -1) {
|
|
1614
|
+
var i = n.length - 1;
|
|
1615
|
+
i === 0 ? n = t.reactions = null : (n[r] = n[i], n.pop());
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
if (n === null && (t.f & q) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
|
|
1619
|
+
// to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
|
|
1620
|
+
// allows us to skip the expensive work of disconnecting and immediately reconnecting it
|
|
1621
|
+
(V === null || !wt.call(V, t))) {
|
|
1622
|
+
var s = (
|
|
1623
|
+
/** @type {Derived} */
|
|
1624
|
+
t
|
|
1625
|
+
);
|
|
1626
|
+
(s.f & le) !== 0 && (s.f ^= le, s.f &= ~lt), zn(s), Fr(s), nn(s, 0);
|
|
1627
|
+
}
|
|
1628
|
+
}
|
|
1629
|
+
function nn(e, t) {
|
|
1630
|
+
var n = e.deps;
|
|
1631
|
+
if (n !== null)
|
|
1632
|
+
for (var r = t; r < n.length; r++)
|
|
1633
|
+
Ss(e, n[r]);
|
|
1634
|
+
}
|
|
1635
|
+
function It(e) {
|
|
1636
|
+
var t = e.f;
|
|
1637
|
+
if ((t & ke) === 0) {
|
|
1638
|
+
I(e, D);
|
|
1639
|
+
var n = S, r = Xt;
|
|
1640
|
+
S = e, Xt = !0;
|
|
1641
|
+
try {
|
|
1642
|
+
(t & (Ie | br)) !== 0 ? $s(e) : ei(e), Zr(e);
|
|
1643
|
+
var i = ui(e);
|
|
1644
|
+
e.teardown = typeof i == "function" ? i : null, e.wv = li;
|
|
1645
|
+
var s;
|
|
1646
|
+
bn && ts && (e.f & j) !== 0 && e.deps;
|
|
1647
|
+
} finally {
|
|
1648
|
+
Xt = r, S = n;
|
|
1649
|
+
}
|
|
1650
|
+
}
|
|
1651
|
+
}
|
|
1652
|
+
function _(e) {
|
|
1653
|
+
var t = e.f, n = (t & q) !== 0;
|
|
1654
|
+
if ($ !== null && !he) {
|
|
1655
|
+
var r = S !== null && (S.f & ke) !== 0;
|
|
1656
|
+
if (!r && (oe === null || !wt.call(oe, e))) {
|
|
1657
|
+
var i = $.deps;
|
|
1658
|
+
if (($.f & wn) !== 0)
|
|
1659
|
+
e.rv < Ke && (e.rv = Ke, V === null && i !== null && i[G] === e ? G++ : V === null ? V = [e] : V.push(e));
|
|
1660
|
+
else {
|
|
1661
|
+
($.deps ?? ($.deps = [])).push(e);
|
|
1662
|
+
var s = e.reactions;
|
|
1663
|
+
s === null ? e.reactions = [$] : wt.call(s, $) || s.push($);
|
|
1664
|
+
}
|
|
1665
|
+
}
|
|
1666
|
+
}
|
|
1667
|
+
if (Ye && He.has(e))
|
|
1668
|
+
return He.get(e);
|
|
1669
|
+
if (n) {
|
|
1670
|
+
var l = (
|
|
1671
|
+
/** @type {Derived} */
|
|
1672
|
+
e
|
|
1673
|
+
);
|
|
1674
|
+
if (Ye) {
|
|
1675
|
+
var o = l.v;
|
|
1676
|
+
return ((l.f & D) === 0 && l.reactions !== null || ci(l)) && (o = Un(l)), He.set(l, o), o;
|
|
1677
|
+
}
|
|
1678
|
+
var a = (l.f & le) === 0 && !he && $ !== null && (Xt || ($.f & le) !== 0), f = l.deps === null;
|
|
1679
|
+
jt(l) && (a && (l.f |= le), qr(l)), a && !f && ai(l);
|
|
1680
|
+
}
|
|
1681
|
+
if (de?.has(e))
|
|
1682
|
+
return de.get(e);
|
|
1683
|
+
if ((e.f & je) !== 0)
|
|
1684
|
+
throw e.v;
|
|
1685
|
+
return e.v;
|
|
1686
|
+
}
|
|
1687
|
+
function ai(e) {
|
|
1688
|
+
if (e.deps !== null) {
|
|
1689
|
+
e.f |= le;
|
|
1690
|
+
for (const t of e.deps)
|
|
1691
|
+
(t.reactions ?? (t.reactions = [])).push(e), (t.f & q) !== 0 && (t.f & le) === 0 && ai(
|
|
1692
|
+
/** @type {Derived} */
|
|
1693
|
+
t
|
|
1694
|
+
);
|
|
1695
|
+
}
|
|
1696
|
+
}
|
|
1697
|
+
function ci(e) {
|
|
1698
|
+
if (e.v === F) return !0;
|
|
1699
|
+
if (e.deps === null) return !1;
|
|
1700
|
+
for (const t of e.deps)
|
|
1701
|
+
if (He.has(t) || (t.f & q) !== 0 && ci(
|
|
1702
|
+
/** @type {Derived} */
|
|
1703
|
+
t
|
|
1704
|
+
))
|
|
1705
|
+
return !0;
|
|
1706
|
+
return !1;
|
|
1707
|
+
}
|
|
1708
|
+
function st(e) {
|
|
1709
|
+
var t = he;
|
|
1710
|
+
try {
|
|
1711
|
+
return he = !0, e();
|
|
1712
|
+
} finally {
|
|
1713
|
+
he = t;
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
const di = /* @__PURE__ */ new Set(), Nn = /* @__PURE__ */ new Set();
|
|
1717
|
+
function hi(e) {
|
|
1718
|
+
for (var t = 0; t < e.length; t++)
|
|
1719
|
+
di.add(e[t]);
|
|
1720
|
+
for (var n of Nn)
|
|
1721
|
+
n(e);
|
|
1722
|
+
}
|
|
1723
|
+
let ir = null;
|
|
1724
|
+
function Yt(e) {
|
|
1725
|
+
var t = this, n = (
|
|
1726
|
+
/** @type {Node} */
|
|
1727
|
+
t.ownerDocument
|
|
1728
|
+
), r = e.type, i = e.composedPath?.() || [], s = (
|
|
1729
|
+
/** @type {null | Element} */
|
|
1730
|
+
i[0] || e.target
|
|
1731
|
+
);
|
|
1732
|
+
ir = e;
|
|
1733
|
+
var l = 0, o = ir === e && e.__root;
|
|
1734
|
+
if (o) {
|
|
1735
|
+
var a = i.indexOf(o);
|
|
1736
|
+
if (a !== -1 && (t === document || t === /** @type {any} */
|
|
1737
|
+
window)) {
|
|
1738
|
+
e.__root = t;
|
|
1739
|
+
return;
|
|
1740
|
+
}
|
|
1741
|
+
var f = i.indexOf(t);
|
|
1742
|
+
if (f === -1)
|
|
1743
|
+
return;
|
|
1744
|
+
a <= f && (l = a);
|
|
1745
|
+
}
|
|
1746
|
+
if (s = /** @type {Element} */
|
|
1747
|
+
i[l] || e.target, s !== t) {
|
|
1748
|
+
Zt(e, "currentTarget", {
|
|
1749
|
+
configurable: !0,
|
|
1750
|
+
get() {
|
|
1751
|
+
return s || n;
|
|
1752
|
+
}
|
|
1753
|
+
});
|
|
1754
|
+
var h = $, v = S;
|
|
1755
|
+
fe(null), ye(null);
|
|
1756
|
+
try {
|
|
1757
|
+
for (var d, p = []; s !== null; ) {
|
|
1758
|
+
var c = s.assignedSlot || s.parentNode || /** @type {any} */
|
|
1759
|
+
s.host || null;
|
|
1760
|
+
try {
|
|
1761
|
+
var w = s["__" + r];
|
|
1762
|
+
w != null && (!/** @type {any} */
|
|
1763
|
+
s.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
|
|
1764
|
+
// -> the target could not have been disabled because it emits the event in the first place
|
|
1765
|
+
e.target === s) && w.call(s, e);
|
|
1766
|
+
} catch (g) {
|
|
1767
|
+
d ? p.push(g) : d = g;
|
|
1768
|
+
}
|
|
1769
|
+
if (e.cancelBubble || c === t || c === null)
|
|
1770
|
+
break;
|
|
1771
|
+
s = c;
|
|
1772
|
+
}
|
|
1773
|
+
if (d) {
|
|
1774
|
+
for (let g of p)
|
|
1775
|
+
queueMicrotask(() => {
|
|
1776
|
+
throw g;
|
|
1777
|
+
});
|
|
1778
|
+
throw d;
|
|
1779
|
+
}
|
|
1780
|
+
} finally {
|
|
1781
|
+
e.__root = t, delete e.currentTarget, fe(h), ye(v);
|
|
1782
|
+
}
|
|
1783
|
+
}
|
|
1784
|
+
}
|
|
1785
|
+
function As(e) {
|
|
1786
|
+
var t = document.createElement("template");
|
|
1787
|
+
return t.innerHTML = e.replaceAll("<!>", "<!---->"), t.content;
|
|
1788
|
+
}
|
|
1789
|
+
function Mt(e, t) {
|
|
1790
|
+
var n = (
|
|
1791
|
+
/** @type {Effect} */
|
|
1792
|
+
S
|
|
1793
|
+
);
|
|
1794
|
+
n.nodes === null && (n.nodes = { start: e, end: t, a: null, t: null });
|
|
1795
|
+
}
|
|
1796
|
+
// @__NO_SIDE_EFFECTS__
|
|
1797
|
+
function Vn(e, t) {
|
|
1798
|
+
var n = (t & Ri) !== 0, r, i = !e.startsWith("<!>");
|
|
1799
|
+
return () => {
|
|
1800
|
+
if (E)
|
|
1801
|
+
return Mt(T, null), T;
|
|
1802
|
+
r === void 0 && (r = As(i ? e : "<!>" + e), r = /** @type {TemplateNode} */
|
|
1803
|
+
/* @__PURE__ */ St(r));
|
|
1804
|
+
var s = (
|
|
1805
|
+
/** @type {TemplateNode} */
|
|
1806
|
+
n || jr ? document.importNode(r, !0) : r.cloneNode(!0)
|
|
1807
|
+
);
|
|
1808
|
+
return Mt(s, s), s;
|
|
1809
|
+
};
|
|
1810
|
+
}
|
|
1811
|
+
function Os() {
|
|
1812
|
+
if (E)
|
|
1813
|
+
return Mt(T, null), T;
|
|
1814
|
+
var e = document.createDocumentFragment(), t = document.createComment(""), n = ve();
|
|
1815
|
+
return e.append(t, n), Mt(t, n), e;
|
|
1816
|
+
}
|
|
1817
|
+
function Pt(e, t) {
|
|
1818
|
+
if (E) {
|
|
1819
|
+
var n = (
|
|
1820
|
+
/** @type {Effect & { nodes: EffectNodes }} */
|
|
1821
|
+
S
|
|
1822
|
+
);
|
|
1823
|
+
((n.f & un) === 0 || n.nodes.end === null) && (n.nodes.end = T), Bt();
|
|
1824
|
+
return;
|
|
1825
|
+
}
|
|
1826
|
+
e !== null && e.before(
|
|
1827
|
+
/** @type {Node} */
|
|
1828
|
+
t
|
|
1829
|
+
);
|
|
1830
|
+
}
|
|
1831
|
+
const Cs = ["touchstart", "touchmove"];
|
|
1832
|
+
function xs(e) {
|
|
1833
|
+
return Cs.includes(e);
|
|
1834
|
+
}
|
|
1835
|
+
function Ns(e, t) {
|
|
1836
|
+
var n = t == null ? "" : typeof t == "object" ? t + "" : t;
|
|
1837
|
+
n !== (e.__t ?? (e.__t = e.nodeValue)) && (e.__t = n, e.nodeValue = n + "");
|
|
1838
|
+
}
|
|
1839
|
+
function vi(e, t) {
|
|
1840
|
+
return _i(e, t);
|
|
1841
|
+
}
|
|
1842
|
+
function Rs(e, t) {
|
|
1843
|
+
Cn(), t.intro = t.intro ?? !1;
|
|
1844
|
+
const n = t.target, r = E, i = T;
|
|
1845
|
+
try {
|
|
1846
|
+
for (var s = /* @__PURE__ */ St(n); s && (s.nodeType !== At || /** @type {Comment} */
|
|
1847
|
+
s.data !== _r); )
|
|
1848
|
+
s = /* @__PURE__ */ Ee(s);
|
|
1849
|
+
if (!s)
|
|
1850
|
+
throw bt;
|
|
1851
|
+
Re(!0), Q(
|
|
1852
|
+
/** @type {Comment} */
|
|
1853
|
+
s
|
|
1854
|
+
);
|
|
1855
|
+
const l = _i(e, { ...t, anchor: s });
|
|
1856
|
+
return Re(!1), /** @type {Exports} */
|
|
1857
|
+
l;
|
|
1858
|
+
} catch (l) {
|
|
1859
|
+
if (l instanceof Error && l.message.split(`
|
|
1860
|
+
`).some((o) => o.startsWith("https://svelte.dev/e/")))
|
|
1861
|
+
throw l;
|
|
1862
|
+
return l !== bt && console.warn("Failed to hydrate: ", l), t.recover === !1 && Vi(), Cn(), Vr(n), Re(!1), vi(e, t);
|
|
1863
|
+
} finally {
|
|
1864
|
+
Re(r), Q(i);
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1867
|
+
const at = /* @__PURE__ */ new Map();
|
|
1868
|
+
function _i(e, { target: t, anchor: n, props: r = {}, events: i, context: s, intro: l = !0 }) {
|
|
1869
|
+
Cn();
|
|
1870
|
+
var o = /* @__PURE__ */ new Set(), a = (v) => {
|
|
1871
|
+
for (var d = 0; d < v.length; d++) {
|
|
1872
|
+
var p = v[d];
|
|
1873
|
+
if (!o.has(p)) {
|
|
1874
|
+
o.add(p);
|
|
1875
|
+
var c = xs(p);
|
|
1876
|
+
t.addEventListener(p, Yt, { passive: c });
|
|
1877
|
+
var w = at.get(p);
|
|
1878
|
+
w === void 0 ? (document.addEventListener(p, Yt, { passive: c }), at.set(p, 1)) : at.set(p, w + 1);
|
|
1879
|
+
}
|
|
1880
|
+
}
|
|
1881
|
+
};
|
|
1882
|
+
a(on(di)), Nn.add(a);
|
|
1883
|
+
var f = void 0, h = ws(() => {
|
|
1884
|
+
var v = n ?? t.appendChild(ve());
|
|
1885
|
+
return os(
|
|
1886
|
+
/** @type {TemplateNode} */
|
|
1887
|
+
v,
|
|
1888
|
+
{
|
|
1889
|
+
pending: () => {
|
|
1890
|
+
}
|
|
1891
|
+
},
|
|
1892
|
+
(d) => {
|
|
1893
|
+
if (s) {
|
|
1894
|
+
Fn({});
|
|
1895
|
+
var p = (
|
|
1896
|
+
/** @type {ComponentContext} */
|
|
1897
|
+
Z
|
|
1898
|
+
);
|
|
1899
|
+
p.c = s;
|
|
1900
|
+
}
|
|
1901
|
+
if (i && (r.$$events = i), E && Mt(
|
|
1902
|
+
/** @type {TemplateNode} */
|
|
1903
|
+
d,
|
|
1904
|
+
null
|
|
1905
|
+
), f = e(d, r) || {}, E && (S.nodes.end = T, T === null || T.nodeType !== At || /** @type {Comment} */
|
|
1906
|
+
T.data !== Ln))
|
|
1907
|
+
throw an(), bt;
|
|
1908
|
+
s && qn();
|
|
1909
|
+
}
|
|
1910
|
+
), () => {
|
|
1911
|
+
for (var d of o) {
|
|
1912
|
+
t.removeEventListener(d, Yt);
|
|
1913
|
+
var p = (
|
|
1914
|
+
/** @type {number} */
|
|
1915
|
+
at.get(d)
|
|
1916
|
+
);
|
|
1917
|
+
--p === 0 ? (document.removeEventListener(d, Yt), at.delete(d)) : at.set(d, p);
|
|
1918
|
+
}
|
|
1919
|
+
Nn.delete(a), v !== n && v.parentNode?.removeChild(v);
|
|
1920
|
+
};
|
|
1921
|
+
});
|
|
1922
|
+
return Rn.set(f, h), f;
|
|
1923
|
+
}
|
|
1924
|
+
let Rn = /* @__PURE__ */ new WeakMap();
|
|
1925
|
+
function ks(e, t) {
|
|
1926
|
+
const n = Rn.get(e);
|
|
1927
|
+
return n ? (Rn.delete(e), n(t)) : Promise.resolve();
|
|
1928
|
+
}
|
|
1929
|
+
var ae, we, W, et, zt, Ut, sn;
|
|
1930
|
+
class Ps {
|
|
1931
|
+
/**
|
|
1932
|
+
* @param {TemplateNode} anchor
|
|
1933
|
+
* @param {boolean} transition
|
|
1934
|
+
*/
|
|
1935
|
+
constructor(t, n = !0) {
|
|
1936
|
+
/** @type {TemplateNode} */
|
|
1937
|
+
N(this, "anchor");
|
|
1938
|
+
/** @type {Map<Batch, Key>} */
|
|
1939
|
+
y(this, ae, /* @__PURE__ */ new Map());
|
|
1940
|
+
/**
|
|
1941
|
+
* Map of keys to effects that are currently rendered in the DOM.
|
|
1942
|
+
* These effects are visible and actively part of the document tree.
|
|
1943
|
+
* Example:
|
|
1944
|
+
* ```
|
|
1945
|
+
* {#if condition}
|
|
1946
|
+
* foo
|
|
1947
|
+
* {:else}
|
|
1948
|
+
* bar
|
|
1949
|
+
* {/if}
|
|
1950
|
+
* ```
|
|
1951
|
+
* Can result in the entries `true->Effect` and `false->Effect`
|
|
1952
|
+
* @type {Map<Key, Effect>}
|
|
1953
|
+
*/
|
|
1954
|
+
y(this, we, /* @__PURE__ */ new Map());
|
|
1955
|
+
/**
|
|
1956
|
+
* Similar to #onscreen with respect to the keys, but contains branches that are not yet
|
|
1957
|
+
* in the DOM, because their insertion is deferred.
|
|
1958
|
+
* @type {Map<Key, Branch>}
|
|
1959
|
+
*/
|
|
1960
|
+
y(this, W, /* @__PURE__ */ new Map());
|
|
1961
|
+
/**
|
|
1962
|
+
* Keys of effects that are currently outroing
|
|
1963
|
+
* @type {Set<Key>}
|
|
1964
|
+
*/
|
|
1965
|
+
y(this, et, /* @__PURE__ */ new Set());
|
|
1966
|
+
/**
|
|
1967
|
+
* Whether to pause (i.e. outro) on change, or destroy immediately.
|
|
1968
|
+
* This is necessary for `<svelte:element>`
|
|
1969
|
+
*/
|
|
1970
|
+
y(this, zt, !0);
|
|
1971
|
+
y(this, Ut, () => {
|
|
1972
|
+
var t = (
|
|
1973
|
+
/** @type {Batch} */
|
|
1974
|
+
x
|
|
1975
|
+
);
|
|
1976
|
+
if (u(this, ae).has(t)) {
|
|
1977
|
+
var n = (
|
|
1978
|
+
/** @type {Key} */
|
|
1979
|
+
u(this, ae).get(t)
|
|
1980
|
+
), r = u(this, we).get(n);
|
|
1981
|
+
if (r)
|
|
1982
|
+
Yn(r), u(this, et).delete(n);
|
|
1983
|
+
else {
|
|
1984
|
+
var i = u(this, W).get(n);
|
|
1985
|
+
i && (u(this, we).set(n, i.effect), u(this, W).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect);
|
|
1986
|
+
}
|
|
1987
|
+
for (const [s, l] of u(this, ae)) {
|
|
1988
|
+
if (u(this, ae).delete(s), s === t)
|
|
1989
|
+
break;
|
|
1990
|
+
const o = u(this, W).get(l);
|
|
1991
|
+
o && (B(o.effect), u(this, W).delete(l));
|
|
1992
|
+
}
|
|
1993
|
+
for (const [s, l] of u(this, we)) {
|
|
1994
|
+
if (s === n || u(this, et).has(s)) continue;
|
|
1995
|
+
const o = () => {
|
|
1996
|
+
if (Array.from(u(this, ae).values()).includes(s)) {
|
|
1997
|
+
var f = document.createDocumentFragment();
|
|
1998
|
+
ii(l, f), f.append(ve()), u(this, W).set(s, { effect: l, fragment: f });
|
|
1999
|
+
} else
|
|
2000
|
+
B(l);
|
|
2001
|
+
u(this, et).delete(s), u(this, we).delete(s);
|
|
2002
|
+
};
|
|
2003
|
+
u(this, zt) || !r ? (u(this, et).add(s), rt(l, o, !1)) : o();
|
|
2004
|
+
}
|
|
2005
|
+
}
|
|
2006
|
+
});
|
|
2007
|
+
/**
|
|
2008
|
+
* @param {Batch} batch
|
|
2009
|
+
*/
|
|
2010
|
+
y(this, sn, (t) => {
|
|
2011
|
+
u(this, ae).delete(t);
|
|
2012
|
+
const n = Array.from(u(this, ae).values());
|
|
2013
|
+
for (const [r, i] of u(this, W))
|
|
2014
|
+
n.includes(r) || (B(i.effect), u(this, W).delete(r));
|
|
2015
|
+
});
|
|
2016
|
+
this.anchor = t, m(this, zt, n);
|
|
2017
|
+
}
|
|
2018
|
+
/**
|
|
2019
|
+
*
|
|
2020
|
+
* @param {any} key
|
|
2021
|
+
* @param {null | ((target: TemplateNode) => void)} fn
|
|
2022
|
+
*/
|
|
2023
|
+
ensure(t, n) {
|
|
2024
|
+
var r = (
|
|
2025
|
+
/** @type {Batch} */
|
|
2026
|
+
x
|
|
2027
|
+
), i = Gr();
|
|
2028
|
+
if (n && !u(this, we).has(t) && !u(this, W).has(t))
|
|
2029
|
+
if (i) {
|
|
2030
|
+
var s = document.createDocumentFragment(), l = ve();
|
|
2031
|
+
s.append(l), u(this, W).set(t, {
|
|
2032
|
+
effect: se(() => n(l)),
|
|
2033
|
+
fragment: s
|
|
2034
|
+
});
|
|
2035
|
+
} else
|
|
2036
|
+
u(this, we).set(
|
|
2037
|
+
t,
|
|
2038
|
+
se(() => n(this.anchor))
|
|
2039
|
+
);
|
|
2040
|
+
if (u(this, ae).set(r, t), i) {
|
|
2041
|
+
for (const [o, a] of u(this, we))
|
|
2042
|
+
o === t ? r.skipped_effects.delete(a) : r.skipped_effects.add(a);
|
|
2043
|
+
for (const [o, a] of u(this, W))
|
|
2044
|
+
o === t ? r.skipped_effects.delete(a.effect) : r.skipped_effects.add(a.effect);
|
|
2045
|
+
r.oncommit(u(this, Ut)), r.ondiscard(u(this, sn));
|
|
2046
|
+
} else
|
|
2047
|
+
E && (this.anchor = T), u(this, Ut).call(this);
|
|
2048
|
+
}
|
|
2049
|
+
}
|
|
2050
|
+
ae = new WeakMap(), we = new WeakMap(), W = new WeakMap(), et = new WeakMap(), zt = new WeakMap(), Ut = new WeakMap(), sn = new WeakMap();
|
|
2051
|
+
function Ls(e) {
|
|
2052
|
+
Z === null && zi(), Lt(() => {
|
|
2053
|
+
const t = st(e);
|
|
2054
|
+
if (typeof t == "function") return (
|
|
2055
|
+
/** @type {() => void} */
|
|
2056
|
+
t
|
|
2057
|
+
);
|
|
2058
|
+
});
|
|
2059
|
+
}
|
|
2060
|
+
function Is(e, t, n = !1) {
|
|
2061
|
+
E && Bt();
|
|
2062
|
+
var r = new Ps(e), i = n ? yt : 0;
|
|
2063
|
+
function s(l, o) {
|
|
2064
|
+
if (E) {
|
|
2065
|
+
const f = $r(e) === ln;
|
|
2066
|
+
if (l === f) {
|
|
2067
|
+
var a = tn();
|
|
2068
|
+
Q(a), r.anchor = a, Re(!1), r.ensure(l, o), Re(!0);
|
|
2069
|
+
return;
|
|
2070
|
+
}
|
|
2071
|
+
}
|
|
2072
|
+
r.ensure(l, o);
|
|
2073
|
+
}
|
|
2074
|
+
Hn(() => {
|
|
2075
|
+
var l = !1;
|
|
2076
|
+
t((o, a = !0) => {
|
|
2077
|
+
l = !0, s(a, o);
|
|
2078
|
+
}), l || s(!1, null);
|
|
2079
|
+
}, i);
|
|
2080
|
+
}
|
|
2081
|
+
function Ms(e, t) {
|
|
2082
|
+
return t;
|
|
2083
|
+
}
|
|
2084
|
+
function Ds(e, t, n) {
|
|
2085
|
+
for (var r = [], i = t.length, s, l = t.length, o = 0; o < i; o++) {
|
|
2086
|
+
let v = t[o];
|
|
2087
|
+
rt(
|
|
2088
|
+
v,
|
|
2089
|
+
() => {
|
|
2090
|
+
if (s) {
|
|
2091
|
+
if (s.pending.delete(v), s.done.add(v), s.pending.size === 0) {
|
|
2092
|
+
var d = (
|
|
2093
|
+
/** @type {Set<EachOutroGroup>} */
|
|
2094
|
+
e.outrogroups
|
|
2095
|
+
);
|
|
2096
|
+
kn(on(s.done)), d.delete(s), d.size === 0 && (e.outrogroups = null);
|
|
2097
|
+
}
|
|
2098
|
+
} else
|
|
2099
|
+
l -= 1;
|
|
2100
|
+
},
|
|
2101
|
+
!1
|
|
2102
|
+
);
|
|
2103
|
+
}
|
|
2104
|
+
if (l === 0) {
|
|
2105
|
+
var a = r.length === 0 && n !== null;
|
|
2106
|
+
if (a) {
|
|
2107
|
+
var f = (
|
|
2108
|
+
/** @type {Element} */
|
|
2109
|
+
n
|
|
2110
|
+
), h = (
|
|
2111
|
+
/** @type {Element} */
|
|
2112
|
+
f.parentNode
|
|
2113
|
+
);
|
|
2114
|
+
Vr(h), h.append(f), e.items.clear();
|
|
2115
|
+
}
|
|
2116
|
+
kn(t, !a);
|
|
2117
|
+
} else
|
|
2118
|
+
s = {
|
|
2119
|
+
pending: new Set(t),
|
|
2120
|
+
done: /* @__PURE__ */ new Set()
|
|
2121
|
+
}, (e.outrogroups ?? (e.outrogroups = /* @__PURE__ */ new Set())).add(s);
|
|
2122
|
+
}
|
|
2123
|
+
function kn(e, t = !0) {
|
|
2124
|
+
for (var n = 0; n < e.length; n++)
|
|
2125
|
+
B(e[n], t);
|
|
2126
|
+
}
|
|
2127
|
+
var sr;
|
|
2128
|
+
function Fs(e, t, n, r, i, s = null) {
|
|
2129
|
+
var l = e, o = /* @__PURE__ */ new Map();
|
|
2130
|
+
{
|
|
2131
|
+
var a = (
|
|
2132
|
+
/** @type {Element} */
|
|
2133
|
+
e
|
|
2134
|
+
);
|
|
2135
|
+
l = E ? Q(/* @__PURE__ */ St(a)) : a.appendChild(ve());
|
|
2136
|
+
}
|
|
2137
|
+
E && Bt();
|
|
2138
|
+
var f = null, h = /* @__PURE__ */ Dr(() => {
|
|
2139
|
+
var g = n();
|
|
2140
|
+
return pr(g) ? g : g == null ? [] : on(g);
|
|
2141
|
+
}), v, d = !0;
|
|
2142
|
+
function p() {
|
|
2143
|
+
w.fallback = f, qs(w, v, l, t, r), f !== null && (v.length === 0 ? (f.f & Ue) === 0 ? Yn(f) : (f.f ^= Ue, xt(f, null, l)) : rt(f, () => {
|
|
2144
|
+
f = null;
|
|
2145
|
+
}));
|
|
2146
|
+
}
|
|
2147
|
+
var c = Hn(() => {
|
|
2148
|
+
v = /** @type {V[]} */
|
|
2149
|
+
_(h);
|
|
2150
|
+
var g = v.length;
|
|
2151
|
+
let k = !1;
|
|
2152
|
+
if (E) {
|
|
2153
|
+
var A = $r(l) === ln;
|
|
2154
|
+
A !== (g === 0) && (l = tn(), Q(l), Re(!1), k = !0);
|
|
2155
|
+
}
|
|
2156
|
+
for (var P = /* @__PURE__ */ new Set(), C = (
|
|
2157
|
+
/** @type {Batch} */
|
|
2158
|
+
x
|
|
2159
|
+
), ee = Gr(), z = 0; z < g; z += 1) {
|
|
2160
|
+
E && T.nodeType === At && /** @type {Comment} */
|
|
2161
|
+
T.data === Ln && (l = /** @type {Comment} */
|
|
2162
|
+
T, k = !0, Re(!1));
|
|
2163
|
+
var Se = v[z], H = r(Se, z), ue = d ? null : o.get(H);
|
|
2164
|
+
ue ? (ue.v && Tt(ue.v, Se), ue.i && Tt(ue.i, z), ee && C.skipped_effects.delete(ue.e)) : (ue = zs(
|
|
2165
|
+
o,
|
|
2166
|
+
d ? l : sr ?? (sr = ve()),
|
|
2167
|
+
Se,
|
|
2168
|
+
H,
|
|
2169
|
+
z,
|
|
2170
|
+
i,
|
|
2171
|
+
t,
|
|
2172
|
+
n
|
|
2173
|
+
), d || (ue.e.f |= Ue), o.set(H, ue)), P.add(H);
|
|
2174
|
+
}
|
|
2175
|
+
if (g === 0 && s && !f && (d ? f = se(() => s(l)) : (f = se(() => s(sr ?? (sr = ve()))), f.f |= Ue)), E && g > 0 && Q(tn()), !d)
|
|
2176
|
+
if (ee) {
|
|
2177
|
+
for (const [hn, vn] of o)
|
|
2178
|
+
P.has(hn) || C.skipped_effects.add(vn.e);
|
|
2179
|
+
C.oncommit(p), C.ondiscard(() => {
|
|
2180
|
+
});
|
|
2181
|
+
} else
|
|
2182
|
+
p();
|
|
2183
|
+
k && Re(!0), _(h);
|
|
2184
|
+
}), w = { effect: c, items: o, outrogroups: null, fallback: f };
|
|
2185
|
+
d = !1, E && (l = T);
|
|
2186
|
+
}
|
|
2187
|
+
function Ct(e) {
|
|
2188
|
+
for (; e !== null && (e.f & _e) === 0; )
|
|
2189
|
+
e = e.next;
|
|
2190
|
+
return e;
|
|
2191
|
+
}
|
|
2192
|
+
function qs(e, t, n, r, i) {
|
|
2193
|
+
var s = t.length, l = e.items, o = Ct(e.effect.first), a, f = null, h = [], v = [], d, p, c, w;
|
|
2194
|
+
for (w = 0; w < s; w += 1) {
|
|
2195
|
+
if (d = t[w], p = i(d, w), c = /** @type {EachItem} */
|
|
2196
|
+
l.get(p).e, e.outrogroups !== null)
|
|
2197
|
+
for (const H of e.outrogroups)
|
|
2198
|
+
H.pending.delete(c), H.done.delete(c);
|
|
2199
|
+
if ((c.f & Ue) !== 0)
|
|
2200
|
+
if (c.f ^= Ue, c === o)
|
|
2201
|
+
xt(c, null, n);
|
|
2202
|
+
else {
|
|
2203
|
+
var g = f ? f.next : o;
|
|
2204
|
+
c === e.effect.last && (e.effect.last = c.prev), c.prev && (c.prev.next = c.next), c.next && (c.next.prev = c.prev), qe(e, f, c), qe(e, c, g), xt(c, g, n), f = c, h = [], v = [], o = Ct(f.next);
|
|
2205
|
+
continue;
|
|
2206
|
+
}
|
|
2207
|
+
if ((c.f & J) !== 0 && Yn(c), c !== o) {
|
|
2208
|
+
if (a !== void 0 && a.has(c)) {
|
|
2209
|
+
if (h.length < v.length) {
|
|
2210
|
+
var k = v[0], A;
|
|
2211
|
+
f = k.prev;
|
|
2212
|
+
var P = h[0], C = h[h.length - 1];
|
|
2213
|
+
for (A = 0; A < h.length; A += 1)
|
|
2214
|
+
xt(h[A], k, n);
|
|
2215
|
+
for (A = 0; A < v.length; A += 1)
|
|
2216
|
+
a.delete(v[A]);
|
|
2217
|
+
qe(e, P.prev, C.next), qe(e, f, P), qe(e, C, k), o = k, f = C, w -= 1, h = [], v = [];
|
|
2218
|
+
} else
|
|
2219
|
+
a.delete(c), xt(c, o, n), qe(e, c.prev, c.next), qe(e, c, f === null ? e.effect.first : f.next), qe(e, f, c), f = c;
|
|
2220
|
+
continue;
|
|
2221
|
+
}
|
|
2222
|
+
for (h = [], v = []; o !== null && o !== c; )
|
|
2223
|
+
(a ?? (a = /* @__PURE__ */ new Set())).add(o), v.push(o), o = Ct(o.next);
|
|
2224
|
+
if (o === null)
|
|
2225
|
+
continue;
|
|
2226
|
+
}
|
|
2227
|
+
(c.f & Ue) === 0 && h.push(c), f = c, o = Ct(c.next);
|
|
2228
|
+
}
|
|
2229
|
+
if (e.outrogroups !== null) {
|
|
2230
|
+
for (const H of e.outrogroups)
|
|
2231
|
+
H.pending.size === 0 && (kn(on(H.done)), e.outrogroups?.delete(H));
|
|
2232
|
+
e.outrogroups.size === 0 && (e.outrogroups = null);
|
|
2233
|
+
}
|
|
2234
|
+
if (o !== null || a !== void 0) {
|
|
2235
|
+
var ee = [];
|
|
2236
|
+
if (a !== void 0)
|
|
2237
|
+
for (c of a)
|
|
2238
|
+
(c.f & J) === 0 && ee.push(c);
|
|
2239
|
+
for (; o !== null; )
|
|
2240
|
+
(o.f & J) === 0 && o !== e.fallback && ee.push(o), o = Ct(o.next);
|
|
2241
|
+
var z = ee.length;
|
|
2242
|
+
if (z > 0) {
|
|
2243
|
+
var Se = s === 0 ? n : null;
|
|
2244
|
+
Ds(e, ee, Se);
|
|
2245
|
+
}
|
|
2246
|
+
}
|
|
2247
|
+
}
|
|
2248
|
+
function zs(e, t, n, r, i, s, l, o) {
|
|
2249
|
+
var a = (l & Ti) !== 0 ? (l & Ai) === 0 ? /* @__PURE__ */ Ur(n, !1, !1) : ot(n) : null, f = (l & Si) !== 0 ? ot(i) : null;
|
|
2250
|
+
return {
|
|
2251
|
+
v: a,
|
|
2252
|
+
i: f,
|
|
2253
|
+
e: se(() => (s(t, a ?? n, f ?? i, o), () => {
|
|
2254
|
+
e.delete(r);
|
|
2255
|
+
}))
|
|
2256
|
+
};
|
|
2257
|
+
}
|
|
2258
|
+
function xt(e, t, n) {
|
|
2259
|
+
if (e.nodes)
|
|
2260
|
+
for (var r = e.nodes.start, i = e.nodes.end, s = t && (t.f & Ue) === 0 ? (
|
|
2261
|
+
/** @type {EffectNodes} */
|
|
2262
|
+
t.nodes.start
|
|
2263
|
+
) : n; r !== null; ) {
|
|
2264
|
+
var l = (
|
|
2265
|
+
/** @type {TemplateNode} */
|
|
2266
|
+
/* @__PURE__ */ Ee(r)
|
|
2267
|
+
);
|
|
2268
|
+
if (s.before(r), r === i)
|
|
2269
|
+
return;
|
|
2270
|
+
r = l;
|
|
2271
|
+
}
|
|
2272
|
+
}
|
|
2273
|
+
function qe(e, t, n) {
|
|
2274
|
+
t === null ? e.effect.first = n : t.next = n, n === null ? e.effect.last = t : n.prev = t;
|
|
2275
|
+
}
|
|
2276
|
+
function Us(e, t, n, r, i) {
|
|
2277
|
+
E && Bt();
|
|
2278
|
+
var s = t.$$slots?.[n], l = !1;
|
|
2279
|
+
s === !0 && (s = t.children, l = !0), s === void 0 || s(e, l ? () => r : r);
|
|
2280
|
+
}
|
|
2281
|
+
function pi(e, t) {
|
|
2282
|
+
Jr(() => {
|
|
2283
|
+
var n = e.getRootNode(), r = (
|
|
2284
|
+
/** @type {ShadowRoot} */
|
|
2285
|
+
n.host ? (
|
|
2286
|
+
/** @type {ShadowRoot} */
|
|
2287
|
+
n
|
|
2288
|
+
) : (
|
|
2289
|
+
/** @type {Document} */
|
|
2290
|
+
n.head ?? /** @type {Document} */
|
|
2291
|
+
n.ownerDocument.head
|
|
2292
|
+
)
|
|
2293
|
+
);
|
|
2294
|
+
if (!r.querySelector("#" + t.hash)) {
|
|
2295
|
+
const i = document.createElement("style");
|
|
2296
|
+
i.id = t.hash, i.textContent = t.code, r.appendChild(i);
|
|
2297
|
+
}
|
|
2298
|
+
});
|
|
2299
|
+
}
|
|
2300
|
+
const lr = [...`
|
|
2301
|
+
\r\f \v\uFEFF`];
|
|
2302
|
+
function Bs(e, t, n) {
|
|
2303
|
+
var r = "" + e;
|
|
2304
|
+
if (n) {
|
|
2305
|
+
for (var i in n)
|
|
2306
|
+
if (n[i])
|
|
2307
|
+
r = r ? r + " " + i : i;
|
|
2308
|
+
else if (r.length)
|
|
2309
|
+
for (var s = i.length, l = 0; (l = r.indexOf(i, l)) >= 0; ) {
|
|
2310
|
+
var o = l + s;
|
|
2311
|
+
(l === 0 || lr.includes(r[l - 1])) && (o === r.length || lr.includes(r[o])) ? r = (l === 0 ? "" : r.substring(0, l)) + r.substring(o + 1) : l = o;
|
|
2312
|
+
}
|
|
2313
|
+
}
|
|
2314
|
+
return r === "" ? null : r;
|
|
2315
|
+
}
|
|
2316
|
+
function js(e, t) {
|
|
2317
|
+
return e == null ? null : String(e);
|
|
2318
|
+
}
|
|
2319
|
+
function Hs(e, t, n, r, i, s) {
|
|
2320
|
+
var l = e.__className;
|
|
2321
|
+
if (E || l !== n || l === void 0) {
|
|
2322
|
+
var o = Bs(n, r, s);
|
|
2323
|
+
(!E || o !== e.getAttribute("class")) && (o == null ? e.removeAttribute("class") : e.className = o), e.__className = n;
|
|
2324
|
+
} else if (s && i !== s)
|
|
2325
|
+
for (var a in s) {
|
|
2326
|
+
var f = !!s[a];
|
|
2327
|
+
(i == null || f !== !!i[a]) && e.classList.toggle(a, f);
|
|
2328
|
+
}
|
|
2329
|
+
return s;
|
|
2330
|
+
}
|
|
2331
|
+
function or(e, t, n, r) {
|
|
2332
|
+
var i = e.__style;
|
|
2333
|
+
if (E || i !== t) {
|
|
2334
|
+
var s = js(t);
|
|
2335
|
+
(!E || s !== e.getAttribute("style")) && (s == null ? e.removeAttribute("style") : e.style.cssText = s), e.__style = t;
|
|
2336
|
+
}
|
|
2337
|
+
return r;
|
|
2338
|
+
}
|
|
2339
|
+
const Ys = /* @__PURE__ */ Symbol("is custom element"), Vs = /* @__PURE__ */ Symbol("is html");
|
|
2340
|
+
function mn(e, t, n, r) {
|
|
2341
|
+
var i = Gs(e);
|
|
2342
|
+
E && (i[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === "LINK") || i[t] !== (i[t] = n) && (t === "loading" && (e[qi] = n), n == null ? e.removeAttribute(t) : typeof n != "string" && Ks(e).includes(t) ? e[t] = n : e.setAttribute(t, n));
|
|
2343
|
+
}
|
|
2344
|
+
function Gs(e) {
|
|
2345
|
+
return (
|
|
2346
|
+
/** @type {Record<string | symbol, unknown>} **/
|
|
2347
|
+
// @ts-expect-error
|
|
2348
|
+
e.__attributes ?? (e.__attributes = {
|
|
2349
|
+
[Ys]: e.nodeName.includes("-"),
|
|
2350
|
+
[Vs]: e.namespaceURI === ki
|
|
2351
|
+
})
|
|
2352
|
+
);
|
|
2353
|
+
}
|
|
2354
|
+
var fr = /* @__PURE__ */ new Map();
|
|
2355
|
+
function Ks(e) {
|
|
2356
|
+
var t = e.getAttribute("is") || e.nodeName, n = fr.get(t);
|
|
2357
|
+
if (n) return n;
|
|
2358
|
+
fr.set(t, n = []);
|
|
2359
|
+
for (var r, i = e, s = Element.prototype; s !== i; ) {
|
|
2360
|
+
r = Li(i);
|
|
2361
|
+
for (var l in r)
|
|
2362
|
+
r[l].set && n.push(l);
|
|
2363
|
+
i = gr(i);
|
|
2364
|
+
}
|
|
2365
|
+
return n;
|
|
2366
|
+
}
|
|
2367
|
+
function ur(e, t) {
|
|
2368
|
+
return e === t || e?.[Nt] === t;
|
|
2369
|
+
}
|
|
2370
|
+
function ar(e = {}, t, n, r) {
|
|
2371
|
+
return Jr(() => {
|
|
2372
|
+
var i, s;
|
|
2373
|
+
return jn(() => {
|
|
2374
|
+
i = s, s = [], st(() => {
|
|
2375
|
+
e !== n(...s) && (t(e, ...s), i && ur(n(...i), e) && t(null, ...i));
|
|
2376
|
+
});
|
|
2377
|
+
}), () => {
|
|
2378
|
+
nt(() => {
|
|
2379
|
+
s && ur(n(...s), e) && t(null, ...s);
|
|
2380
|
+
});
|
|
2381
|
+
};
|
|
2382
|
+
}), e;
|
|
2383
|
+
}
|
|
2384
|
+
let Vt = !1;
|
|
2385
|
+
function Ws(e) {
|
|
2386
|
+
var t = Vt;
|
|
2387
|
+
try {
|
|
2388
|
+
return Vt = !1, [e(), Vt];
|
|
2389
|
+
} finally {
|
|
2390
|
+
Vt = t;
|
|
2391
|
+
}
|
|
2392
|
+
}
|
|
2393
|
+
function pe(e, t, n, r) {
|
|
2394
|
+
var i = (n & xi) !== 0, s = (n & Ni) !== 0, l = (
|
|
2395
|
+
/** @type {V} */
|
|
2396
|
+
r
|
|
2397
|
+
), o = !0, a = () => (o && (o = !1, l = s ? st(
|
|
2398
|
+
/** @type {() => V} */
|
|
2399
|
+
r
|
|
2400
|
+
) : (
|
|
2401
|
+
/** @type {V} */
|
|
2402
|
+
r
|
|
2403
|
+
)), l), f;
|
|
2404
|
+
if (i) {
|
|
2405
|
+
var h = Nt in e || yr in e;
|
|
2406
|
+
f = tt(e, t)?.set ?? (h && t in e ? (A) => e[t] = A : void 0);
|
|
2407
|
+
}
|
|
2408
|
+
var v, d = !1;
|
|
2409
|
+
i ? [v, d] = Ws(() => (
|
|
2410
|
+
/** @type {V} */
|
|
2411
|
+
e[t]
|
|
2412
|
+
)) : v = /** @type {V} */
|
|
2413
|
+
e[t], v === void 0 && r !== void 0 && (v = a(), f && (Gi(), f(v)));
|
|
2414
|
+
var p;
|
|
2415
|
+
if (p = () => {
|
|
2416
|
+
var A = (
|
|
2417
|
+
/** @type {V} */
|
|
2418
|
+
e[t]
|
|
2419
|
+
);
|
|
2420
|
+
return A === void 0 ? a() : (o = !0, A);
|
|
2421
|
+
}, (n & Ci) === 0)
|
|
2422
|
+
return p;
|
|
2423
|
+
if (f) {
|
|
2424
|
+
var c = e.$$legacy;
|
|
2425
|
+
return (
|
|
2426
|
+
/** @type {() => V} */
|
|
2427
|
+
(function(A, P) {
|
|
2428
|
+
return arguments.length > 0 ? ((!P || c || d) && f(P ? p() : A), A) : p();
|
|
2429
|
+
})
|
|
2430
|
+
);
|
|
2431
|
+
}
|
|
2432
|
+
var w = !1, g = ((n & Oi) !== 0 ? dn : Dr)(() => (w = !1, p()));
|
|
2433
|
+
i && _(g);
|
|
2434
|
+
var k = (
|
|
2435
|
+
/** @type {Effect} */
|
|
2436
|
+
S
|
|
2437
|
+
);
|
|
2438
|
+
return (
|
|
2439
|
+
/** @type {() => V} */
|
|
2440
|
+
(function(A, P) {
|
|
2441
|
+
if (arguments.length > 0) {
|
|
2442
|
+
const C = P ? _(g) : i ? Be(A) : A;
|
|
2443
|
+
return L(g, C), w = !0, l !== void 0 && (l = C), A;
|
|
2444
|
+
}
|
|
2445
|
+
return Ye && w || (k.f & ke) !== 0 ? g.v : _(g);
|
|
2446
|
+
})
|
|
2447
|
+
);
|
|
2448
|
+
}
|
|
2449
|
+
function Xs(e) {
|
|
2450
|
+
return new Js(e);
|
|
2451
|
+
}
|
|
2452
|
+
var Ne, ie;
|
|
2453
|
+
class Js {
|
|
2454
|
+
/**
|
|
2455
|
+
* @param {ComponentConstructorOptions & {
|
|
2456
|
+
* component: any;
|
|
2457
|
+
* }} options
|
|
2458
|
+
*/
|
|
2459
|
+
constructor(t) {
|
|
2460
|
+
/** @type {any} */
|
|
2461
|
+
y(this, Ne);
|
|
2462
|
+
/** @type {Record<string, any>} */
|
|
2463
|
+
y(this, ie);
|
|
2464
|
+
var n = /* @__PURE__ */ new Map(), r = (s, l) => {
|
|
2465
|
+
var o = /* @__PURE__ */ Ur(l, !1, !1);
|
|
2466
|
+
return n.set(s, o), o;
|
|
2467
|
+
};
|
|
2468
|
+
const i = new Proxy(
|
|
2469
|
+
{ ...t.props || {}, $$events: {} },
|
|
2470
|
+
{
|
|
2471
|
+
get(s, l) {
|
|
2472
|
+
return _(n.get(l) ?? r(l, Reflect.get(s, l)));
|
|
2473
|
+
},
|
|
2474
|
+
has(s, l) {
|
|
2475
|
+
return l === yr ? !0 : (_(n.get(l) ?? r(l, Reflect.get(s, l))), Reflect.has(s, l));
|
|
2476
|
+
},
|
|
2477
|
+
set(s, l, o) {
|
|
2478
|
+
return L(n.get(l) ?? r(l, o), o), Reflect.set(s, l, o);
|
|
2479
|
+
}
|
|
2480
|
+
}
|
|
2481
|
+
);
|
|
2482
|
+
m(this, ie, (t.hydrate ? Rs : vi)(t.component, {
|
|
2483
|
+
target: t.target,
|
|
2484
|
+
anchor: t.anchor,
|
|
2485
|
+
props: i,
|
|
2486
|
+
context: t.context,
|
|
2487
|
+
intro: t.intro ?? !1,
|
|
2488
|
+
recover: t.recover
|
|
2489
|
+
})), (!t?.props?.$$host || t.sync === !1) && ce(), m(this, Ne, i.$$events);
|
|
2490
|
+
for (const s of Object.keys(u(this, ie)))
|
|
2491
|
+
s === "$set" || s === "$destroy" || s === "$on" || Zt(this, s, {
|
|
2492
|
+
get() {
|
|
2493
|
+
return u(this, ie)[s];
|
|
2494
|
+
},
|
|
2495
|
+
/** @param {any} value */
|
|
2496
|
+
set(l) {
|
|
2497
|
+
u(this, ie)[s] = l;
|
|
2498
|
+
},
|
|
2499
|
+
enumerable: !0
|
|
2500
|
+
});
|
|
2501
|
+
u(this, ie).$set = /** @param {Record<string, any>} next */
|
|
2502
|
+
(s) => {
|
|
2503
|
+
Object.assign(i, s);
|
|
2504
|
+
}, u(this, ie).$destroy = () => {
|
|
2505
|
+
ks(u(this, ie));
|
|
2506
|
+
};
|
|
2507
|
+
}
|
|
2508
|
+
/** @param {Record<string, any>} props */
|
|
2509
|
+
$set(t) {
|
|
2510
|
+
u(this, ie).$set(t);
|
|
2511
|
+
}
|
|
2512
|
+
/**
|
|
2513
|
+
* @param {string} event
|
|
2514
|
+
* @param {(...args: any[]) => any} callback
|
|
2515
|
+
* @returns {any}
|
|
2516
|
+
*/
|
|
2517
|
+
$on(t, n) {
|
|
2518
|
+
u(this, Ne)[t] = u(this, Ne)[t] || [];
|
|
2519
|
+
const r = (...i) => n.call(this, ...i);
|
|
2520
|
+
return u(this, Ne)[t].push(r), () => {
|
|
2521
|
+
u(this, Ne)[t] = u(this, Ne)[t].filter(
|
|
2522
|
+
/** @param {any} fn */
|
|
2523
|
+
(i) => i !== r
|
|
2524
|
+
);
|
|
2525
|
+
};
|
|
2526
|
+
}
|
|
2527
|
+
$destroy() {
|
|
2528
|
+
u(this, ie).$destroy();
|
|
2529
|
+
}
|
|
2530
|
+
}
|
|
2531
|
+
Ne = new WeakMap(), ie = new WeakMap();
|
|
2532
|
+
let gi;
|
|
2533
|
+
typeof HTMLElement == "function" && (gi = class extends HTMLElement {
|
|
2534
|
+
/**
|
|
2535
|
+
* @param {*} $$componentCtor
|
|
2536
|
+
* @param {*} $$slots
|
|
2537
|
+
* @param {ShadowRootInit | undefined} shadow_root_init
|
|
2538
|
+
*/
|
|
2539
|
+
constructor(t, n, r) {
|
|
2540
|
+
super();
|
|
2541
|
+
/** The Svelte component constructor */
|
|
2542
|
+
N(this, "$$ctor");
|
|
2543
|
+
/** Slots */
|
|
2544
|
+
N(this, "$$s");
|
|
2545
|
+
/** @type {any} The Svelte component instance */
|
|
2546
|
+
N(this, "$$c");
|
|
2547
|
+
/** Whether or not the custom element is connected */
|
|
2548
|
+
N(this, "$$cn", !1);
|
|
2549
|
+
/** @type {Record<string, any>} Component props data */
|
|
2550
|
+
N(this, "$$d", {});
|
|
2551
|
+
/** `true` if currently in the process of reflecting component props back to attributes */
|
|
2552
|
+
N(this, "$$r", !1);
|
|
2553
|
+
/** @type {Record<string, CustomElementPropDefinition>} Props definition (name, reflected, type etc) */
|
|
2554
|
+
N(this, "$$p_d", {});
|
|
2555
|
+
/** @type {Record<string, EventListenerOrEventListenerObject[]>} Event listeners */
|
|
2556
|
+
N(this, "$$l", {});
|
|
2557
|
+
/** @type {Map<EventListenerOrEventListenerObject, Function>} Event listener unsubscribe functions */
|
|
2558
|
+
N(this, "$$l_u", /* @__PURE__ */ new Map());
|
|
2559
|
+
/** @type {any} The managed render effect for reflecting attributes */
|
|
2560
|
+
N(this, "$$me");
|
|
2561
|
+
/** @type {ShadowRoot | null} The ShadowRoot of the custom element */
|
|
2562
|
+
N(this, "$$shadowRoot", null);
|
|
2563
|
+
this.$$ctor = t, this.$$s = n, r && (this.$$shadowRoot = this.attachShadow(r));
|
|
2564
|
+
}
|
|
2565
|
+
/**
|
|
2566
|
+
* @param {string} type
|
|
2567
|
+
* @param {EventListenerOrEventListenerObject} listener
|
|
2568
|
+
* @param {boolean | AddEventListenerOptions} [options]
|
|
2569
|
+
*/
|
|
2570
|
+
addEventListener(t, n, r) {
|
|
2571
|
+
if (this.$$l[t] = this.$$l[t] || [], this.$$l[t].push(n), this.$$c) {
|
|
2572
|
+
const i = this.$$c.$on(t, n);
|
|
2573
|
+
this.$$l_u.set(n, i);
|
|
2574
|
+
}
|
|
2575
|
+
super.addEventListener(t, n, r);
|
|
2576
|
+
}
|
|
2577
|
+
/**
|
|
2578
|
+
* @param {string} type
|
|
2579
|
+
* @param {EventListenerOrEventListenerObject} listener
|
|
2580
|
+
* @param {boolean | AddEventListenerOptions} [options]
|
|
2581
|
+
*/
|
|
2582
|
+
removeEventListener(t, n, r) {
|
|
2583
|
+
if (super.removeEventListener(t, n, r), this.$$c) {
|
|
2584
|
+
const i = this.$$l_u.get(n);
|
|
2585
|
+
i && (i(), this.$$l_u.delete(n));
|
|
2586
|
+
}
|
|
2587
|
+
}
|
|
2588
|
+
async connectedCallback() {
|
|
2589
|
+
if (this.$$cn = !0, !this.$$c) {
|
|
2590
|
+
let t = function(i) {
|
|
2591
|
+
return (s) => {
|
|
2592
|
+
const l = document.createElement("slot");
|
|
2593
|
+
i !== "default" && (l.name = i), Pt(s, l);
|
|
2594
|
+
};
|
|
2595
|
+
};
|
|
2596
|
+
if (await Promise.resolve(), !this.$$cn || this.$$c)
|
|
2597
|
+
return;
|
|
2598
|
+
const n = {}, r = Qs(this);
|
|
2599
|
+
for (const i of this.$$s)
|
|
2600
|
+
i in r && (i === "default" && !this.$$d.children ? (this.$$d.children = t(i), n.default = !0) : n[i] = t(i));
|
|
2601
|
+
for (const i of this.attributes) {
|
|
2602
|
+
const s = this.$$g_p(i.name);
|
|
2603
|
+
s in this.$$d || (this.$$d[s] = Jt(s, i.value, this.$$p_d, "toProp"));
|
|
2604
|
+
}
|
|
2605
|
+
for (const i in this.$$p_d)
|
|
2606
|
+
!(i in this.$$d) && this[i] !== void 0 && (this.$$d[i] = this[i], delete this[i]);
|
|
2607
|
+
this.$$c = Xs({
|
|
2608
|
+
component: this.$$ctor,
|
|
2609
|
+
target: this.$$shadowRoot || this,
|
|
2610
|
+
props: {
|
|
2611
|
+
...this.$$d,
|
|
2612
|
+
$$slots: n,
|
|
2613
|
+
$$host: this
|
|
2614
|
+
}
|
|
2615
|
+
}), this.$$me = bs(() => {
|
|
2616
|
+
jn(() => {
|
|
2617
|
+
this.$$r = !0;
|
|
2618
|
+
for (const i of Qt(this.$$c)) {
|
|
2619
|
+
if (!this.$$p_d[i]?.reflect) continue;
|
|
2620
|
+
this.$$d[i] = this.$$c[i];
|
|
2621
|
+
const s = Jt(
|
|
2622
|
+
i,
|
|
2623
|
+
this.$$d[i],
|
|
2624
|
+
this.$$p_d,
|
|
2625
|
+
"toAttribute"
|
|
2626
|
+
);
|
|
2627
|
+
s == null ? this.removeAttribute(this.$$p_d[i].attribute || i) : this.setAttribute(this.$$p_d[i].attribute || i, s);
|
|
2628
|
+
}
|
|
2629
|
+
this.$$r = !1;
|
|
2630
|
+
});
|
|
2631
|
+
});
|
|
2632
|
+
for (const i in this.$$l)
|
|
2633
|
+
for (const s of this.$$l[i]) {
|
|
2634
|
+
const l = this.$$c.$on(i, s);
|
|
2635
|
+
this.$$l_u.set(s, l);
|
|
2636
|
+
}
|
|
2637
|
+
this.$$l = {};
|
|
2638
|
+
}
|
|
2639
|
+
}
|
|
2640
|
+
// We don't need this when working within Svelte code, but for compatibility of people using this outside of Svelte
|
|
2641
|
+
// and setting attributes through setAttribute etc, this is helpful
|
|
2642
|
+
/**
|
|
2643
|
+
* @param {string} attr
|
|
2644
|
+
* @param {string} _oldValue
|
|
2645
|
+
* @param {string} newValue
|
|
2646
|
+
*/
|
|
2647
|
+
attributeChangedCallback(t, n, r) {
|
|
2648
|
+
this.$$r || (t = this.$$g_p(t), this.$$d[t] = Jt(t, r, this.$$p_d, "toProp"), this.$$c?.$set({ [t]: this.$$d[t] }));
|
|
2649
|
+
}
|
|
2650
|
+
disconnectedCallback() {
|
|
2651
|
+
this.$$cn = !1, Promise.resolve().then(() => {
|
|
2652
|
+
!this.$$cn && this.$$c && (this.$$c.$destroy(), this.$$me(), this.$$c = void 0);
|
|
2653
|
+
});
|
|
2654
|
+
}
|
|
2655
|
+
/**
|
|
2656
|
+
* @param {string} attribute_name
|
|
2657
|
+
*/
|
|
2658
|
+
$$g_p(t) {
|
|
2659
|
+
return Qt(this.$$p_d).find(
|
|
2660
|
+
(n) => this.$$p_d[n].attribute === t || !this.$$p_d[n].attribute && n.toLowerCase() === t
|
|
2661
|
+
) || t;
|
|
2662
|
+
}
|
|
2663
|
+
});
|
|
2664
|
+
function Jt(e, t, n, r) {
|
|
2665
|
+
const i = n[e]?.type;
|
|
2666
|
+
if (t = i === "Boolean" && typeof t != "boolean" ? t != null : t, !r || !n[e])
|
|
2667
|
+
return t;
|
|
2668
|
+
if (r === "toAttribute")
|
|
2669
|
+
switch (i) {
|
|
2670
|
+
case "Object":
|
|
2671
|
+
case "Array":
|
|
2672
|
+
return t == null ? null : JSON.stringify(t);
|
|
2673
|
+
case "Boolean":
|
|
2674
|
+
return t ? "" : null;
|
|
2675
|
+
case "Number":
|
|
2676
|
+
return t ?? null;
|
|
2677
|
+
default:
|
|
2678
|
+
return t;
|
|
2679
|
+
}
|
|
2680
|
+
else
|
|
2681
|
+
switch (i) {
|
|
2682
|
+
case "Object":
|
|
2683
|
+
case "Array":
|
|
2684
|
+
return t && JSON.parse(t);
|
|
2685
|
+
case "Boolean":
|
|
2686
|
+
return t;
|
|
2687
|
+
// conversion already handled above
|
|
2688
|
+
case "Number":
|
|
2689
|
+
return t != null ? +t : t;
|
|
2690
|
+
default:
|
|
2691
|
+
return t;
|
|
2692
|
+
}
|
|
2693
|
+
}
|
|
2694
|
+
function Qs(e) {
|
|
2695
|
+
const t = {};
|
|
2696
|
+
return e.childNodes.forEach((n) => {
|
|
2697
|
+
t[
|
|
2698
|
+
/** @type {Element} node */
|
|
2699
|
+
n.slot || "default"
|
|
2700
|
+
] = !0;
|
|
2701
|
+
}), t;
|
|
2702
|
+
}
|
|
2703
|
+
function mi(e, t, n, r, i, s) {
|
|
2704
|
+
let l = class extends gi {
|
|
2705
|
+
constructor() {
|
|
2706
|
+
super(e, n, i), this.$$p_d = t;
|
|
2707
|
+
}
|
|
2708
|
+
static get observedAttributes() {
|
|
2709
|
+
return Qt(t).map(
|
|
2710
|
+
(o) => (t[o].attribute || o).toLowerCase()
|
|
2711
|
+
);
|
|
2712
|
+
}
|
|
2713
|
+
};
|
|
2714
|
+
return Qt(t).forEach((o) => {
|
|
2715
|
+
Zt(l.prototype, o, {
|
|
2716
|
+
get() {
|
|
2717
|
+
return this.$$c && o in this.$$c ? this.$$c[o] : this.$$d[o];
|
|
2718
|
+
},
|
|
2719
|
+
set(a) {
|
|
2720
|
+
a = Jt(o, a, t), this.$$d[o] = a;
|
|
2721
|
+
var f = this.$$c;
|
|
2722
|
+
if (f) {
|
|
2723
|
+
var h = tt(f, o)?.get;
|
|
2724
|
+
h ? f[o] = a : f.$set({ [o]: a });
|
|
2725
|
+
}
|
|
2726
|
+
}
|
|
2727
|
+
});
|
|
2728
|
+
}), r.forEach((o) => {
|
|
2729
|
+
Zt(l.prototype, o, {
|
|
2730
|
+
get() {
|
|
2731
|
+
return this.$$c?.[o];
|
|
2732
|
+
}
|
|
2733
|
+
});
|
|
2734
|
+
}), e.element = /** @type {any} */
|
|
2735
|
+
l, l;
|
|
2736
|
+
}
|
|
2737
|
+
var cr;
|
|
2738
|
+
(function(e) {
|
|
2739
|
+
e.TTS_WORD = "tts-word", e.TTS_SENTENCE = "tts-sentence", e.ANNOTATION = "annotation";
|
|
2740
|
+
})(cr || (cr = {}));
|
|
2741
|
+
var dr;
|
|
2742
|
+
(function(e) {
|
|
2743
|
+
e.YELLOW = "yellow", e.GREEN = "green", e.BLUE = "blue", e.PINK = "pink", e.ORANGE = "orange";
|
|
2744
|
+
})(dr || (dr = {}));
|
|
2745
|
+
const Zs = {
|
|
2746
|
+
// Standard QTI 3.0 PNP supports
|
|
2747
|
+
textToSpeech: "pie-tool-text-to-speech",
|
|
2748
|
+
calculator: "pie-tool-calculator",
|
|
2749
|
+
ruler: "pie-tool-ruler",
|
|
2750
|
+
protractor: "pie-tool-protractor",
|
|
2751
|
+
highlighter: "pie-tool-annotation-toolbar",
|
|
2752
|
+
lineReader: "pie-tool-line-reader",
|
|
2753
|
+
magnifier: "pie-tool-magnifier",
|
|
2754
|
+
colorContrast: "pie-theme-contrast",
|
|
2755
|
+
answerMasking: "pie-tool-answer-eliminator",
|
|
2756
|
+
dictionaryLookup: "pie-tool-dictionary",
|
|
2757
|
+
// Common extensions (not in QTI standard but widely used)
|
|
2758
|
+
graphingCalculator: "pie-tool-calculator",
|
|
2759
|
+
scientificCalculator: "pie-tool-calculator",
|
|
2760
|
+
basicCalculator: "pie-tool-calculator"
|
|
2761
|
+
};
|
|
2762
|
+
Object.fromEntries(Object.entries(Zs).map(([e, t]) => [t, e]));
|
|
2763
|
+
var Pn;
|
|
2764
|
+
(function(e) {
|
|
2765
|
+
e[e.BASE = 0] = "BASE", e[e.TOOL = 1e3] = "TOOL", e[e.MODAL = 2e3] = "MODAL", e[e.CONTROL = 3e3] = "CONTROL", e[e.HIGHLIGHT = 4e3] = "HIGHLIGHT";
|
|
2766
|
+
})(Pn || (Pn = {}));
|
|
2767
|
+
var hr;
|
|
2768
|
+
(function(e) {
|
|
2769
|
+
e.IDLE = "idle", e.LOADING = "loading", e.PLAYING = "playing", e.PAUSED = "paused", e.ERROR = "error";
|
|
2770
|
+
})(hr || (hr = {}));
|
|
2771
|
+
var el = /* @__PURE__ */ Vn('<div class="magnifier svelte-13ngm4o" role="region" aria-label="Content magnifier"><div class="magnifier-content svelte-13ngm4o"></div> <div class="magnifier-glass svelte-13ngm4o"></div> <!></div>');
|
|
2772
|
+
const tl = {
|
|
2773
|
+
hash: "svelte-13ngm4o",
|
|
2774
|
+
code: ".magnifier.svelte-13ngm4o {position:fixed;overflow:hidden;background-color:white;border:1px solid #555;border-radius:4px;z-index:10000;cursor:move;touch-action:none;}.magnifier-content.svelte-13ngm4o {position:absolute;top:0;left:0;overflow:visible;display:block;transform-origin:left top;user-select:none;pointer-events:none;}.magnifier-glass.svelte-13ngm4o {position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;background-color:transparent;pointer-events:all;}"
|
|
2775
|
+
};
|
|
2776
|
+
function bi(e, t) {
|
|
2777
|
+
Fn(t, !0), pi(e, tl);
|
|
2778
|
+
let n = pe(t, "zoom", 7, 2), r = pe(t, "width", 7, 420), i = pe(t, "height", 7, 280), s = pe(t, "shape", 7, "square"), l = pe(t, "visible", 15, !1), o = pe(t, "onPrepareContent", 7), a = pe(t, "onContentUpdated", 7), f = /* @__PURE__ */ U(null), h = /* @__PURE__ */ U(null), v = /* @__PURE__ */ U(null), d = /* @__PURE__ */ U(Be({ x: 200, y: 200 })), p = /* @__PURE__ */ U(!1), c = /* @__PURE__ */ U(Be({ x: 0, y: 0 })), w = null, g = null, k = /* @__PURE__ */ er(() => `
|
|
2779
|
+
left: ${_(d).x}px;
|
|
2780
|
+
top: ${_(d).y}px;
|
|
2781
|
+
width: ${r()}px;
|
|
2782
|
+
height: ${i()}px;
|
|
2783
|
+
${s() === "circle" ? "border-radius: 50%;" : ""}
|
|
2784
|
+
display: ${l() ? "block" : "none"};
|
|
2785
|
+
`), A = /* @__PURE__ */ er(() => `
|
|
2786
|
+
transform: scale(${n()});
|
|
2787
|
+
left: ${-_(d).x * n() - window.scrollX * n()}px;
|
|
2788
|
+
top: ${-_(d).y * n() - window.scrollY * n()}px;
|
|
2789
|
+
width: ${document.body.scrollWidth}px;
|
|
2790
|
+
height: ${document.body.scrollHeight}px;
|
|
2791
|
+
`);
|
|
2792
|
+
function P() {
|
|
2793
|
+
const b = document.body, O = b.cloneNode(!0), Fe = getComputedStyle(b).backgroundColor;
|
|
2794
|
+
Fe && _(f) && (_(f).style.backgroundColor = Fe), O.style.cursor = "auto", O.style.paddingTop = "0px", O.setAttribute("unselectable", "on");
|
|
2795
|
+
const te = b.querySelectorAll("canvas"), Ot = O.querySelectorAll("canvas");
|
|
2796
|
+
if (te.length > 0 && te.length === Ot.length)
|
|
2797
|
+
for (let ut = 0; ut < te.length; ut++) {
|
|
2798
|
+
const Wn = Ot[ut].getContext("2d");
|
|
2799
|
+
if (Wn)
|
|
2800
|
+
try {
|
|
2801
|
+
Wn.drawImage(te[ut], 0, 0);
|
|
2802
|
+
} catch {
|
|
2803
|
+
}
|
|
2804
|
+
}
|
|
2805
|
+
return [
|
|
2806
|
+
...O.querySelectorAll("script"),
|
|
2807
|
+
...O.querySelectorAll("audio"),
|
|
2808
|
+
...O.querySelectorAll("video"),
|
|
2809
|
+
...O.querySelectorAll(".magnifier"),
|
|
2810
|
+
...O.querySelectorAll(".magnifier-clone-ignore"),
|
|
2811
|
+
...O.querySelectorAll("[data-magnifier-ignore]")
|
|
2812
|
+
].forEach((ut) => ut.remove()), o() && o()(O), O;
|
|
2813
|
+
}
|
|
2814
|
+
function C() {
|
|
2815
|
+
if (!(!l() || !_(h)) && (_(h).innerHTML = "", L(v, P(), !0), _(h).appendChild(_(v)), ee(), a() && _(v))) {
|
|
2816
|
+
const b = _(v).querySelector("body");
|
|
2817
|
+
b && a()(b);
|
|
2818
|
+
}
|
|
2819
|
+
}
|
|
2820
|
+
function ee() {
|
|
2821
|
+
if (!_(v)) return;
|
|
2822
|
+
Array.from(document.querySelectorAll("div")).filter((O) => O.scrollTop > 0 && !_(f)?.contains(O)).forEach((O) => {
|
|
2823
|
+
const Fe = [];
|
|
2824
|
+
O.id && Fe.push("#" + O.id), O.className && Fe.push("." + O.className.split(" ").join(".")), Fe.forEach((te) => {
|
|
2825
|
+
const Ot = _(v).querySelectorAll(te);
|
|
2826
|
+
if (Ot.length === 1) {
|
|
2827
|
+
const pn = Ot[0];
|
|
2828
|
+
pn.scrollTop = O.scrollTop, pn.scrollLeft = O.scrollLeft;
|
|
2829
|
+
}
|
|
2830
|
+
});
|
|
2831
|
+
});
|
|
2832
|
+
}
|
|
2833
|
+
function z() {
|
|
2834
|
+
g !== null && clearTimeout(g), g = window.setTimeout(
|
|
2835
|
+
() => {
|
|
2836
|
+
C();
|
|
2837
|
+
},
|
|
2838
|
+
100
|
|
2839
|
+
);
|
|
2840
|
+
}
|
|
2841
|
+
function Se() {
|
|
2842
|
+
w || (w = new MutationObserver((b) => {
|
|
2843
|
+
for (const O of b)
|
|
2844
|
+
if (!(_(f) && _(f).contains(O.target))) {
|
|
2845
|
+
z();
|
|
2846
|
+
break;
|
|
2847
|
+
}
|
|
2848
|
+
}), w.observe(document.body, {
|
|
2849
|
+
childList: !0,
|
|
2850
|
+
subtree: !0,
|
|
2851
|
+
attributes: !0,
|
|
2852
|
+
attributeFilter: ["class", "width", "height", "style"],
|
|
2853
|
+
attributeOldValue: !0
|
|
2854
|
+
}));
|
|
2855
|
+
}
|
|
2856
|
+
function H() {
|
|
2857
|
+
w && (w.disconnect(), w = null), g !== null && (clearTimeout(g), g = null);
|
|
2858
|
+
}
|
|
2859
|
+
function ue(b) {
|
|
2860
|
+
const O = b.target, Fe = ["INPUT", "TEXTAREA", "SELECT", "BUTTON", "A"];
|
|
2861
|
+
let te = O;
|
|
2862
|
+
for (; te && te !== _(f); ) {
|
|
2863
|
+
if (Fe.includes(te.tagName.toUpperCase()))
|
|
2864
|
+
return;
|
|
2865
|
+
te = te.parentElement;
|
|
2866
|
+
}
|
|
2867
|
+
L(p, !0), L(
|
|
2868
|
+
c,
|
|
2869
|
+
{
|
|
2870
|
+
x: b.clientX - _(d).x,
|
|
2871
|
+
y: b.clientY - _(d).y
|
|
2872
|
+
},
|
|
2873
|
+
!0
|
|
2874
|
+
), _(f) && _(f).setPointerCapture(b.pointerId);
|
|
2875
|
+
}
|
|
2876
|
+
function hn(b) {
|
|
2877
|
+
_(p) && L(
|
|
2878
|
+
d,
|
|
2879
|
+
{
|
|
2880
|
+
x: b.clientX - _(c).x,
|
|
2881
|
+
y: b.clientY - _(c).y
|
|
2882
|
+
},
|
|
2883
|
+
!0
|
|
2884
|
+
);
|
|
2885
|
+
}
|
|
2886
|
+
function vn(b) {
|
|
2887
|
+
_(p) && _(f) && _(f).releasePointerCapture(b.pointerId), L(p, !1);
|
|
2888
|
+
}
|
|
2889
|
+
function Kn(b) {
|
|
2890
|
+
if (!l()) return;
|
|
2891
|
+
const O = b.target;
|
|
2892
|
+
_(f)?.contains(O) || z();
|
|
2893
|
+
}
|
|
2894
|
+
Lt(() => {
|
|
2895
|
+
l() ? st(() => {
|
|
2896
|
+
C(), Se();
|
|
2897
|
+
}) : st(() => {
|
|
2898
|
+
H();
|
|
2899
|
+
});
|
|
2900
|
+
}), Lt(() => {
|
|
2901
|
+
n(), l() && st(() => {
|
|
2902
|
+
C();
|
|
2903
|
+
});
|
|
2904
|
+
}), Ls(() => (window.addEventListener("scroll", Kn, !0), window.addEventListener("resize", z), () => {
|
|
2905
|
+
H(), window.removeEventListener("scroll", Kn, !0), window.removeEventListener("resize", z);
|
|
2906
|
+
}));
|
|
2907
|
+
var wi = {
|
|
2908
|
+
get zoom() {
|
|
2909
|
+
return n();
|
|
2910
|
+
},
|
|
2911
|
+
set zoom(b = 2) {
|
|
2912
|
+
n(b), ce();
|
|
2913
|
+
},
|
|
2914
|
+
get width() {
|
|
2915
|
+
return r();
|
|
2916
|
+
},
|
|
2917
|
+
set width(b = 420) {
|
|
2918
|
+
r(b), ce();
|
|
2919
|
+
},
|
|
2920
|
+
get height() {
|
|
2921
|
+
return i();
|
|
2922
|
+
},
|
|
2923
|
+
set height(b = 280) {
|
|
2924
|
+
i(b), ce();
|
|
2925
|
+
},
|
|
2926
|
+
get shape() {
|
|
2927
|
+
return s();
|
|
2928
|
+
},
|
|
2929
|
+
set shape(b = "square") {
|
|
2930
|
+
s(b), ce();
|
|
2931
|
+
},
|
|
2932
|
+
get visible() {
|
|
2933
|
+
return l();
|
|
2934
|
+
},
|
|
2935
|
+
set visible(b = !1) {
|
|
2936
|
+
l(b), ce();
|
|
2937
|
+
},
|
|
2938
|
+
get onPrepareContent() {
|
|
2939
|
+
return o();
|
|
2940
|
+
},
|
|
2941
|
+
set onPrepareContent(b) {
|
|
2942
|
+
o(b), ce();
|
|
2943
|
+
},
|
|
2944
|
+
get onContentUpdated() {
|
|
2945
|
+
return a();
|
|
2946
|
+
},
|
|
2947
|
+
set onContentUpdated(b) {
|
|
2948
|
+
a(b), ce();
|
|
2949
|
+
}
|
|
2950
|
+
}, De = el();
|
|
2951
|
+
De.__pointerdown = ue, De.__pointermove = hn, De.__pointerup = vn;
|
|
2952
|
+
var _n = xn(De);
|
|
2953
|
+
ar(_n, (b) => L(h, b), () => _(h));
|
|
2954
|
+
var yi = _s(_n, 4);
|
|
2955
|
+
return Us(yi, t, "default", {}), Gt(De), ar(De, (b) => L(f, b), () => _(f)), Qr(() => {
|
|
2956
|
+
or(De, _(k)), or(_n, _(A));
|
|
2957
|
+
}), Pt(e, De), qn(wi);
|
|
2958
|
+
}
|
|
2959
|
+
hi(["pointerdown", "pointermove", "pointerup"]);
|
|
2960
|
+
mi(
|
|
2961
|
+
bi,
|
|
2962
|
+
{
|
|
2963
|
+
zoom: {},
|
|
2964
|
+
width: {},
|
|
2965
|
+
height: {},
|
|
2966
|
+
shape: {},
|
|
2967
|
+
visible: {},
|
|
2968
|
+
onPrepareContent: {},
|
|
2969
|
+
onContentUpdated: {}
|
|
2970
|
+
},
|
|
2971
|
+
["default"],
|
|
2972
|
+
[],
|
|
2973
|
+
{ mode: "open" }
|
|
2974
|
+
);
|
|
2975
|
+
var nl = /* @__PURE__ */ Vn('<button><span class="btn-label svelte-1um3llb"> </span></button>'), rl = /* @__PURE__ */ Vn('<div class="btn-group magnifier-clone-ignore svelte-1um3llb" data-magnifier-ignore="true"></div>');
|
|
2976
|
+
const il = {
|
|
2977
|
+
hash: "svelte-1um3llb",
|
|
2978
|
+
code: ".btn-group.svelte-1um3llb {background-color:rgba(255, 255, 255, 0.8);border:1px solid var(--pie-primary, #007bff);border-radius:4px;bottom:0.5rem;left:0.5rem;position:absolute;z-index:1001;display:flex;overflow:hidden;}.zoom-btn.svelte-1um3llb {background:white;border:none;border-right:1px solid var(--pie-primary, #007bff);color:var(--pie-primary, #007bff);cursor:pointer;padding:4px 8px;font-size:12px;transition:background-color 0.2s, color 0.2s;}.zoom-btn.svelte-1um3llb:last-child {border-right:none;}.zoom-btn.svelte-1um3llb:hover {background-color:rgba(0, 123, 255, 0.1);}.zoom-btn.active.svelte-1um3llb {background-color:var(--pie-primary, #007bff);color:white;}.zoom-btn.svelte-1um3llb:focus-visible {outline:2px solid var(--pie-primary, #007bff);outline-offset:2px;}.btn-label.svelte-1um3llb {font-size:0.8em;}"
|
|
2979
|
+
};
|
|
2980
|
+
function sl(e, t) {
|
|
2981
|
+
Fn(t, !0), pi(e, il);
|
|
2982
|
+
let n = pe(t, "visible", 7, !1), r = pe(t, "toolId", 7, "magnifier"), i = pe(t, "coordinator", 7);
|
|
2983
|
+
const s = typeof window < "u";
|
|
2984
|
+
let l = /* @__PURE__ */ U(!1), o = /* @__PURE__ */ U(1.5);
|
|
2985
|
+
const a = [1.5, 2, 3];
|
|
2986
|
+
function f(c) {
|
|
2987
|
+
L(o, c, !0);
|
|
2988
|
+
}
|
|
2989
|
+
Lt(() => {
|
|
2990
|
+
i() && r() && !_(l) && (i().registerTool(r(), "Magnifier", void 0, Pn.TOOL), L(l, !0));
|
|
2991
|
+
}), Lt(() => () => {
|
|
2992
|
+
i() && r() && _(l) && (i().unregisterTool(r()), L(l, !1));
|
|
2993
|
+
});
|
|
2994
|
+
var h = {
|
|
2995
|
+
get visible() {
|
|
2996
|
+
return n();
|
|
2997
|
+
},
|
|
2998
|
+
set visible(c = !1) {
|
|
2999
|
+
n(c), ce();
|
|
3000
|
+
},
|
|
3001
|
+
get toolId() {
|
|
3002
|
+
return r();
|
|
3003
|
+
},
|
|
3004
|
+
set toolId(c = "magnifier") {
|
|
3005
|
+
r(c), ce();
|
|
3006
|
+
},
|
|
3007
|
+
get coordinator() {
|
|
3008
|
+
return i();
|
|
3009
|
+
},
|
|
3010
|
+
set coordinator(c) {
|
|
3011
|
+
i(c), ce();
|
|
3012
|
+
}
|
|
3013
|
+
}, v = Os(), d = vs(v);
|
|
3014
|
+
{
|
|
3015
|
+
var p = (c) => {
|
|
3016
|
+
bi(c, {
|
|
3017
|
+
get zoom() {
|
|
3018
|
+
return _(o);
|
|
3019
|
+
},
|
|
3020
|
+
width: 420,
|
|
3021
|
+
height: 280,
|
|
3022
|
+
shape: "square",
|
|
3023
|
+
get visible() {
|
|
3024
|
+
return n();
|
|
3025
|
+
},
|
|
3026
|
+
set visible(w) {
|
|
3027
|
+
n(w);
|
|
3028
|
+
},
|
|
3029
|
+
children: (w, g) => {
|
|
3030
|
+
var k = rl();
|
|
3031
|
+
Fs(k, 21, () => a, Ms, (A, P) => {
|
|
3032
|
+
var C = nl();
|
|
3033
|
+
let ee;
|
|
3034
|
+
C.__click = () => f(_(P));
|
|
3035
|
+
var z = xn(C), Se = xn(z);
|
|
3036
|
+
Gt(z), Gt(C), Qr(() => {
|
|
3037
|
+
ee = Hs(C, 1, "zoom-btn svelte-1um3llb", null, ee, { active: _(o) === _(P) }), mn(C, "data-zoom", _(P)), mn(C, "title", `${_(P) ?? ""}x zoom`), mn(C, "aria-label", `Set zoom to ${_(P) ?? ""}x`), Ns(Se, `${_(P) ?? ""}x`);
|
|
3038
|
+
}), Pt(A, C);
|
|
3039
|
+
}), Gt(k), Pt(w, k);
|
|
3040
|
+
},
|
|
3041
|
+
$$slots: { default: !0 }
|
|
3042
|
+
});
|
|
3043
|
+
};
|
|
3044
|
+
Is(d, (c) => {
|
|
3045
|
+
s && c(p);
|
|
3046
|
+
});
|
|
3047
|
+
}
|
|
3048
|
+
return Pt(e, v), qn(h);
|
|
3049
|
+
}
|
|
3050
|
+
hi(["click"]);
|
|
3051
|
+
customElements.define("pie-tool-magnifier", mi(
|
|
3052
|
+
sl,
|
|
3053
|
+
{
|
|
3054
|
+
visible: { attribute: "visible", type: "Boolean" },
|
|
3055
|
+
toolId: { attribute: "tool-id", type: "String" },
|
|
3056
|
+
coordinator: { type: "Object" }
|
|
3057
|
+
},
|
|
3058
|
+
[],
|
|
3059
|
+
[]
|
|
3060
|
+
));
|
|
3061
|
+
export {
|
|
3062
|
+
sl as default
|
|
3063
|
+
};
|
|
3064
|
+
//# sourceMappingURL=tool-magnifier.js.map
|