@pie-players/pie-tool-tts-inline 0.1.3 → 0.1.5

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.
@@ -1,130 +1,133 @@
1
- import { ZIndexLayer as Kn } from "@pie-players/pie-assessment-toolkit";
2
- const Jn = "5";
3
- typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add(Jn);
4
- const Xn = 2, dt = "[", vt = "[!", Ut = "]", Se = {}, S = /* @__PURE__ */ Symbol(), Gt = "http://www.w3.org/1999/xhtml", st = !1;
5
- var Zn = Array.isArray, Qn = Array.prototype.indexOf, ke = Array.prototype.includes, er = Array.from, Ke = Object.keys, Je = Object.defineProperty, xe = Object.getOwnPropertyDescriptor, tr = Object.getOwnPropertyDescriptors, nr = Object.prototype, rr = Array.prototype, Wt = Object.getPrototypeOf, Nt = Object.isExtensible;
6
- const ir = () => {
1
+ import { ZIndexLayer as Xn } from "@pie-players/pie-assessment-toolkit";
2
+ const Zn = "5";
3
+ typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add(Zn);
4
+ const Qn = 2, _t = "[", pt = "[!", Kt = "]", ke = {}, k = /* @__PURE__ */ Symbol(), Jt = "http://www.w3.org/1999/xhtml", lt = !1;
5
+ var er = Array.isArray, tr = Array.prototype.indexOf, ze = Array.prototype.includes, nr = Array.from, Ke = Object.keys, Je = Object.defineProperty, xe = Object.getOwnPropertyDescriptor, rr = Object.getOwnPropertyDescriptors, ir = Object.prototype, sr = Array.prototype, Xt = Object.getPrototypeOf, Ct = Object.isExtensible;
6
+ const lr = () => {
7
7
  };
8
- function sr(e) {
8
+ function or(e) {
9
9
  for (var t = 0; t < e.length; t++)
10
10
  e[t]();
11
11
  }
12
- function Kt() {
12
+ function Zt() {
13
13
  var e, t, n = new Promise((r, i) => {
14
14
  e = r, t = i;
15
15
  });
16
16
  return { promise: n, resolve: e, reject: t };
17
17
  }
18
- const k = 2, Fe = 4, Ze = 8, Jt = 1 << 24, se = 16, X = 32, ce = 64, Xt = 128, D = 512, x = 1024, z = 2048, U = 4096, K = 8192, ne = 16384, Ce = 32768, ze = 65536, Rt = 1 << 17, Zt = 1 << 18, $e = 1 << 19, lr = 1 << 20, we = 65536, lt = 1 << 21, _t = 1 << 22, ae = 1 << 23, Ue = /* @__PURE__ */ Symbol("$state"), or = /* @__PURE__ */ Symbol("legacy props"), ar = /* @__PURE__ */ Symbol(""), ve = new class extends Error {
18
+ const z = 2, je = 4, Ze = 8, Qt = 1 << 24, ie = 16, X = 32, he = 64, ot = 128, P = 512, x = 1024, A = 2048, U = 4096, K = 8192, te = 16384, Oe = 32768, Ae = 65536, Ot = 1 << 17, en = 1 << 18, Ee = 1 << 19, ar = 1 << 20, be = 65536, at = 1 << 21, gt = 1 << 22, fe = 1 << 23, Ue = /* @__PURE__ */ Symbol("$state"), fr = /* @__PURE__ */ Symbol("legacy props"), ur = /* @__PURE__ */ Symbol(""), _e = new class extends Error {
19
19
  name = "StaleReactionError";
20
20
  message = "The reaction that called `getAbortSignal()` was re-run or destroyed";
21
- }(), fr = /* @__PURE__ */ globalThis.document?.contentType.includes("xml") ?? !1, Qe = 3, He = 8;
22
- function ur() {
21
+ }(), cr = (
22
+ // We gotta write it like this because after downleveling the pure comment may end up in the wrong location
23
+ !!globalThis.document?.contentType && /* @__PURE__ */ globalThis.document.contentType.includes("xml")
24
+ ), Qe = 3, et = 8;
25
+ function hr() {
23
26
  throw new Error("https://svelte.dev/e/async_derived_orphan");
24
27
  }
25
- function cr(e) {
28
+ function dr(e) {
26
29
  throw new Error("https://svelte.dev/e/effect_in_teardown");
27
30
  }
28
- function hr() {
31
+ function vr() {
29
32
  throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
30
33
  }
31
- function dr(e) {
34
+ function _r(e) {
32
35
  throw new Error("https://svelte.dev/e/effect_orphan");
33
36
  }
34
- function vr() {
37
+ function pr() {
35
38
  throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
36
39
  }
37
- function _r() {
40
+ function gr() {
38
41
  throw new Error("https://svelte.dev/e/hydration_failed");
39
42
  }
40
- function pr() {
43
+ function mr() {
41
44
  throw new Error("https://svelte.dev/e/state_descriptors_fixed");
42
45
  }
43
- function gr() {
46
+ function wr() {
44
47
  throw new Error("https://svelte.dev/e/state_prototype_fixed");
45
48
  }
46
- function mr() {
49
+ function br() {
47
50
  throw new Error("https://svelte.dev/e/state_unsafe_mutation");
48
51
  }
49
- function wr() {
52
+ function yr() {
50
53
  throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror");
51
54
  }
52
- function et(e) {
55
+ function tt(e) {
53
56
  console.warn("https://svelte.dev/e/hydration_mismatch");
54
57
  }
55
- function br() {
58
+ function $r() {
56
59
  console.warn("https://svelte.dev/e/svelte_boundary_reset_noop");
57
60
  }
58
- let y = !1;
59
- function Te(e) {
60
- y = e;
61
+ let b = !1;
62
+ function Se(e) {
63
+ b = e;
61
64
  }
62
65
  let m;
63
66
  function G(e) {
64
67
  if (e === null)
65
- throw et(), Se;
68
+ throw tt(), ke;
66
69
  return m = e;
67
70
  }
68
- function pt() {
69
- return G(/* @__PURE__ */ le(m));
71
+ function mt() {
72
+ return G(/* @__PURE__ */ se(m));
70
73
  }
71
- function nt(e) {
72
- if (y) {
73
- if (/* @__PURE__ */ le(m) !== null)
74
- throw et(), Se;
74
+ function rt(e) {
75
+ if (b) {
76
+ if (/* @__PURE__ */ se(m) !== null)
77
+ throw tt(), ke;
75
78
  m = e;
76
79
  }
77
80
  }
78
- function yr(e = 1) {
79
- if (y) {
81
+ function Er(e = 1) {
82
+ if (b) {
80
83
  for (var t = e, n = m; t--; )
81
84
  n = /** @type {TemplateNode} */
82
- /* @__PURE__ */ le(n);
85
+ /* @__PURE__ */ se(n);
83
86
  m = n;
84
87
  }
85
88
  }
86
- function Qt(e = !0) {
89
+ function tn(e = !0) {
87
90
  for (var t = 0, n = m; ; ) {
88
- if (n.nodeType === He) {
91
+ if (n.nodeType === et) {
89
92
  var r = (
90
93
  /** @type {Comment} */
91
94
  n.data
92
95
  );
93
- if (r === Ut) {
96
+ if (r === Kt) {
94
97
  if (t === 0) return n;
95
98
  t -= 1;
96
- } else (r === dt || r === vt || // "[1", "[2", etc. for if blocks
99
+ } else (r === _t || r === pt || // "[1", "[2", etc. for if blocks
97
100
  r[0] === "[" && !isNaN(Number(r.slice(1)))) && (t += 1);
98
101
  }
99
102
  var i = (
100
103
  /** @type {TemplateNode} */
101
- /* @__PURE__ */ le(n)
104
+ /* @__PURE__ */ se(n)
102
105
  );
103
106
  e && n.remove(), n = i;
104
107
  }
105
108
  }
106
- function $r(e) {
107
- if (!e || e.nodeType !== He)
108
- throw et(), Se;
109
+ function Tr(e) {
110
+ if (!e || e.nodeType !== et)
111
+ throw tt(), ke;
109
112
  return (
110
113
  /** @type {Comment} */
111
114
  e.data
112
115
  );
113
116
  }
114
- function en(e) {
117
+ function nn(e) {
115
118
  return e === this.v;
116
119
  }
117
- function Er(e, t) {
120
+ function Sr(e, t) {
118
121
  return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function";
119
122
  }
120
- function Tr(e) {
121
- return !Er(e, this.v);
123
+ function xr(e) {
124
+ return !Sr(e, this.v);
122
125
  }
123
- let xr = !1, F = null;
124
- function Ae(e) {
126
+ let kr = !1, F = null;
127
+ function Ne(e) {
125
128
  F = e;
126
129
  }
127
- function tn(e, t = !1, n) {
130
+ function rn(e, t = !1, n) {
128
131
  F = {
129
132
  p: F,
130
133
  i: !1,
@@ -135,7 +138,7 @@ function tn(e, t = !1, n) {
135
138
  l: null
136
139
  };
137
140
  }
138
- function nn(e) {
141
+ function sn(e) {
139
142
  var t = (
140
143
  /** @type {ComponentContext} */
141
144
  F
@@ -143,44 +146,44 @@ function nn(e) {
143
146
  if (n !== null) {
144
147
  t.e = null;
145
148
  for (var r of n)
146
- yn(r);
149
+ En(r);
147
150
  }
148
151
  return e !== void 0 && (t.x = e), t.i = !0, F = t.p, e ?? /** @type {T} */
149
152
  {};
150
153
  }
151
- function rn() {
154
+ function ln() {
152
155
  return !0;
153
156
  }
154
- let _e = [];
155
- function sn() {
156
- var e = _e;
157
- _e = [], sr(e);
157
+ let pe = [];
158
+ function on() {
159
+ var e = pe;
160
+ pe = [], or(e);
158
161
  }
159
- function ge(e) {
160
- if (_e.length === 0 && !Pe) {
161
- var t = _e;
162
+ function me(e) {
163
+ if (pe.length === 0 && !Pe) {
164
+ var t = pe;
162
165
  queueMicrotask(() => {
163
- t === _e && sn();
166
+ t === pe && on();
164
167
  });
165
168
  }
166
- _e.push(e);
169
+ pe.push(e);
167
170
  }
168
- function Sr() {
169
- for (; _e.length > 0; )
170
- sn();
171
+ function zr() {
172
+ for (; pe.length > 0; )
173
+ on();
171
174
  }
172
- function ln(e) {
175
+ function an(e) {
173
176
  var t = g;
174
177
  if (t === null)
175
- return _.f |= ae, e;
176
- if ((t.f & Ce) === 0 && (t.f & Fe) === 0)
178
+ return _.f |= fe, e;
179
+ if ((t.f & Oe) === 0 && (t.f & je) === 0)
177
180
  throw e;
178
- Ne(e, t);
181
+ Re(e, t);
179
182
  }
180
- function Ne(e, t) {
183
+ function Re(e, t) {
181
184
  for (; t !== null; ) {
182
- if ((t.f & Xt) !== 0) {
183
- if ((t.f & Ce) === 0)
185
+ if ((t.f & ot) !== 0) {
186
+ if ((t.f & Oe) === 0)
184
187
  throw e;
185
188
  try {
186
189
  t.b.error(e);
@@ -193,27 +196,27 @@ function Ne(e, t) {
193
196
  }
194
197
  throw e;
195
198
  }
196
- const kr = -7169;
199
+ const Ar = -7169;
197
200
  function T(e, t) {
198
- e.f = e.f & kr | t;
201
+ e.f = e.f & Ar | t;
199
202
  }
200
- function gt(e) {
201
- (e.f & D) !== 0 || e.deps === null ? T(e, x) : T(e, U);
203
+ function wt(e) {
204
+ (e.f & P) !== 0 || e.deps === null ? T(e, x) : T(e, U);
202
205
  }
203
- function on(e) {
206
+ function fn(e) {
204
207
  if (e !== null)
205
208
  for (const t of e)
206
- (t.f & k) === 0 || (t.f & we) === 0 || (t.f ^= we, on(
209
+ (t.f & z) === 0 || (t.f & be) === 0 || (t.f ^= be, fn(
207
210
  /** @type {Derived} */
208
211
  t.deps
209
212
  ));
210
213
  }
211
- function an(e, t, n) {
212
- (e.f & z) !== 0 ? t.add(e) : (e.f & U) !== 0 && n.add(e), on(e.deps), T(e, x);
214
+ function un(e, t, n) {
215
+ (e.f & A) !== 0 ? t.add(e) : (e.f & U) !== 0 && n.add(e), fn(e.deps), T(e, x);
213
216
  }
214
217
  const qe = /* @__PURE__ */ new Set();
215
- let $ = null, V = null, R = [], tt = null, ot = !1, Pe = !1;
216
- class re {
218
+ let $ = null, V = null, R = [], nt = null, ft = !1, Pe = !1;
219
+ class ne {
217
220
  committed = !1;
218
221
  /**
219
222
  * The current values of any sources that are updated in this batch
@@ -245,18 +248,18 @@ class re {
245
248
  /**
246
249
  * The number of async effects that are currently in flight, _not_ inside a pending boundary
247
250
  */
248
- #l = 0;
251
+ #s = 0;
249
252
  /**
250
253
  * A deferred that resolves when the batch is committed, used with `settled()`
251
254
  * TODO replace with Promise.withResolvers once supported widely enough
252
255
  * @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
253
256
  */
254
- #o = null;
257
+ #l = null;
255
258
  /**
256
259
  * Deferred effects (which run after async work has completed) that are DIRTY
257
260
  * @type {Set<Effect>}
258
261
  */
259
- #i = /* @__PURE__ */ new Set();
262
+ #o = /* @__PURE__ */ new Set();
260
263
  /**
261
264
  * Deferred effects that are MAYBE_DIRTY
262
265
  * @type {Set<Effect>}
@@ -269,18 +272,18 @@ class re {
269
272
  * so they can be rescheduled if the branch survives.
270
273
  * @type {Map<Effect, { d: Effect[], m: Effect[] }>}
271
274
  */
272
- #s = /* @__PURE__ */ new Map();
275
+ #i = /* @__PURE__ */ new Map();
273
276
  is_fork = !1;
274
277
  #a = !1;
275
278
  is_deferred() {
276
- return this.is_fork || this.#l > 0;
279
+ return this.is_fork || this.#s > 0;
277
280
  }
278
281
  /**
279
282
  * Add an effect to the #skipped_branches map and reset its children
280
283
  * @param {Effect} effect
281
284
  */
282
285
  skip_effect(t) {
283
- this.#s.has(t) || this.#s.set(t, { d: [], m: [] });
286
+ this.#i.has(t) || this.#i.set(t, { d: [], m: [] });
284
287
  }
285
288
  /**
286
289
  * Remove an effect from the #skipped_branches map and reschedule
@@ -288,11 +291,11 @@ class re {
288
291
  * @param {Effect} effect
289
292
  */
290
293
  unskip_effect(t) {
291
- var n = this.#s.get(t);
294
+ var n = this.#i.get(t);
292
295
  if (n) {
293
- this.#s.delete(t);
296
+ this.#i.delete(t);
294
297
  for (var r of n.d)
295
- T(r, z), q(r);
298
+ T(r, A), q(r);
296
299
  for (r of n.m)
297
300
  T(r, U), q(r);
298
301
  }
@@ -305,14 +308,14 @@ class re {
305
308
  R = [], this.apply();
306
309
  var n = [], r = [];
307
310
  for (const i of t)
308
- this.#f(i, n, r);
311
+ this.#u(i, n, r);
309
312
  if (this.is_deferred()) {
310
- this.#c(r), this.#c(n);
311
- for (const [i, s] of this.#s)
312
- hn(i, s);
313
+ this.#f(r), this.#f(n);
314
+ for (const [i, s] of this.#i)
315
+ vn(i, s);
313
316
  } else {
314
317
  for (const i of this.#e) i();
315
- this.#e.clear(), this.#n === 0 && this.#u(), $ = null, Ct(r), Ct(n), this.#o?.resolve();
318
+ this.#e.clear(), this.#n === 0 && this.#h(), $ = null, It(r), It(n), this.#l?.resolve();
316
319
  }
317
320
  V = null;
318
321
  }
@@ -323,29 +326,35 @@ class re {
323
326
  * @param {Effect[]} effects
324
327
  * @param {Effect[]} render_effects
325
328
  */
326
- #f(t, n, r) {
329
+ #u(t, n, r) {
327
330
  t.f ^= x;
328
331
  for (var i = t.first, s = null; i !== null; ) {
329
- var l = i.f, o = (l & (X | ce)) !== 0, a = o && (l & x) !== 0, f = a || (l & K) !== 0 || this.#s.has(i);
332
+ var l = i.f, o = (l & (X | he)) !== 0, a = o && (l & x) !== 0, f = a || (l & K) !== 0 || this.#i.has(i);
330
333
  if (!f && i.fn !== null) {
331
- o ? i.f ^= x : s !== null && (l & (Fe | Ze | Jt)) !== 0 ? s.b.defer_effect(i) : (l & Fe) !== 0 ? n.push(i) : Ve(i) && ((l & se) !== 0 && this.#r.add(i), Re(i));
334
+ o ? i.f ^= x : s !== null && (l & (je | Ze | Qt)) !== 0 ? s.b.defer_effect(i) : (l & je) !== 0 ? n.push(i) : Ve(i) && ((l & ie) !== 0 && this.#r.add(i), Ce(i));
332
335
  var c = i.first;
333
336
  if (c !== null) {
334
337
  i = c;
335
338
  continue;
336
339
  }
337
340
  }
338
- var d = i.parent;
339
- for (i = i.next; i === null && d !== null; )
340
- d === s && (s = null), i = d.next, d = d.parent;
341
+ for (; i !== null; ) {
342
+ i === s && (s = null);
343
+ var v = i.next;
344
+ if (v !== null) {
345
+ i = v;
346
+ break;
347
+ }
348
+ i = i.parent;
349
+ }
341
350
  }
342
351
  }
343
352
  /**
344
353
  * @param {Effect[]} effects
345
354
  */
346
- #c(t) {
355
+ #f(t) {
347
356
  for (var n = 0; n < t.length; n += 1)
348
- an(t[n], this.#i, this.#r);
357
+ un(t[n], this.#o, this.#r);
349
358
  }
350
359
  /**
351
360
  * Associate a change to a given source with the current
@@ -354,7 +363,7 @@ class re {
354
363
  * @param {any} value
355
364
  */
356
365
  capture(t, n) {
357
- n !== S && !this.previous.has(t) && this.previous.set(t, n), (t.f & ae) === 0 && (this.current.set(t, t.v), V?.set(t, t.v));
366
+ n !== k && !this.previous.has(t) && this.previous.set(t, n), (t.f & fe) === 0 && (this.current.set(t, t.v), V?.set(t, t.v));
358
367
  }
359
368
  activate() {
360
369
  $ = this, this.apply();
@@ -364,7 +373,7 @@ class re {
364
373
  }
365
374
  flush() {
366
375
  if (this.activate(), R.length > 0) {
367
- if (fn(), $ !== null && $ !== this)
376
+ if (cn(), $ !== null && $ !== this)
368
377
  return;
369
378
  } else this.#n === 0 && this.process([]);
370
379
  this.deactivate();
@@ -373,7 +382,7 @@ class re {
373
382
  for (const t of this.#t) t(this);
374
383
  this.#t.clear();
375
384
  }
376
- #u() {
385
+ #h() {
377
386
  if (qe.size > 1) {
378
387
  this.previous.clear();
379
388
  var t = V, n = !0;
@@ -399,11 +408,11 @@ class re {
399
408
  R = [];
400
409
  const o = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Map();
401
410
  for (const f of s)
402
- un(f, l, o, a);
411
+ hn(f, l, o, a);
403
412
  if (R.length > 0) {
404
413
  $ = i, i.apply();
405
414
  for (const f of R)
406
- i.#f(f, [], []);
415
+ i.#u(f, [], []);
407
416
  i.deactivate();
408
417
  }
409
418
  R = r;
@@ -418,20 +427,20 @@ class re {
418
427
  * @param {boolean} blocking
419
428
  */
420
429
  increment(t) {
421
- this.#n += 1, t && (this.#l += 1);
430
+ this.#n += 1, t && (this.#s += 1);
422
431
  }
423
432
  /**
424
433
  *
425
434
  * @param {boolean} blocking
426
435
  */
427
436
  decrement(t) {
428
- this.#n -= 1, t && (this.#l -= 1), !this.#a && (this.#a = !0, ge(() => {
437
+ this.#n -= 1, t && (this.#s -= 1), !this.#a && (this.#a = !0, me(() => {
429
438
  this.#a = !1, this.is_deferred() ? R.length > 0 && this.flush() : this.revive();
430
439
  }));
431
440
  }
432
441
  revive() {
433
- for (const t of this.#i)
434
- this.#r.delete(t), T(t, z), q(t);
442
+ for (const t of this.#o)
443
+ this.#r.delete(t), T(t, A), q(t);
435
444
  for (const t of this.#r)
436
445
  T(t, U), q(t);
437
446
  this.flush();
@@ -445,12 +454,12 @@ class re {
445
454
  this.#t.add(t);
446
455
  }
447
456
  settled() {
448
- return (this.#o ??= Kt()).promise;
457
+ return (this.#l ??= Zt()).promise;
449
458
  }
450
459
  static ensure() {
451
460
  if ($ === null) {
452
- const t = $ = new re();
453
- qe.add($), Pe || ge(() => {
461
+ const t = $ = new ne();
462
+ qe.add($), Pe || me(() => {
454
463
  $ === t && t.flush();
455
464
  });
456
465
  }
@@ -464,55 +473,55 @@ function oe(e) {
464
473
  Pe = !0;
465
474
  try {
466
475
  for (var n; ; ) {
467
- if (Sr(), R.length === 0 && ($?.flush(), R.length === 0))
468
- return tt = null, /** @type {T} */
476
+ if (zr(), R.length === 0 && ($?.flush(), R.length === 0))
477
+ return nt = null, /** @type {T} */
469
478
  n;
470
- fn();
479
+ cn();
471
480
  }
472
481
  } finally {
473
482
  Pe = t;
474
483
  }
475
484
  }
476
- function fn() {
477
- ot = !0;
485
+ function cn() {
486
+ ft = !0;
478
487
  var e = null;
479
488
  try {
480
489
  for (var t = 0; R.length > 0; ) {
481
- var n = re.ensure();
490
+ var n = ne.ensure();
482
491
  if (t++ > 1e3) {
483
492
  var r, i;
484
- zr();
493
+ Nr();
485
494
  }
486
- n.process(R), fe.clear();
495
+ n.process(R), ue.clear();
487
496
  }
488
497
  } finally {
489
- R = [], ot = !1, tt = null;
498
+ R = [], ft = !1, nt = null;
490
499
  }
491
500
  }
492
- function zr() {
501
+ function Nr() {
493
502
  try {
494
- vr();
503
+ pr();
495
504
  } catch (e) {
496
- Ne(e, tt);
505
+ Re(e, nt);
497
506
  }
498
507
  }
499
508
  let ee = null;
500
- function Ct(e) {
509
+ function It(e) {
501
510
  var t = e.length;
502
511
  if (t !== 0) {
503
512
  for (var n = 0; n < t; ) {
504
513
  var r = e[n++];
505
- if ((r.f & (ne | K)) === 0 && Ve(r) && (ee = /* @__PURE__ */ new Set(), Re(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && xn(r), ee?.size > 0)) {
506
- fe.clear();
514
+ if ((r.f & (te | K)) === 0 && Ve(r) && (ee = /* @__PURE__ */ new Set(), Ce(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && kn(r), ee?.size > 0)) {
515
+ ue.clear();
507
516
  for (const i of ee) {
508
- if ((i.f & (ne | K)) !== 0) continue;
517
+ if ((i.f & (te | K)) !== 0) continue;
509
518
  const s = [i];
510
519
  let l = i.parent;
511
520
  for (; l !== null; )
512
521
  ee.has(l) && (ee.delete(l), s.push(l)), l = l.parent;
513
522
  for (let o = s.length - 1; o >= 0; o--) {
514
523
  const a = s[o];
515
- (a.f & (ne | K)) === 0 && Re(a);
524
+ (a.f & (te | K)) === 0 && Ce(a);
516
525
  }
517
526
  }
518
527
  ee.clear();
@@ -521,30 +530,30 @@ function Ct(e) {
521
530
  ee = null;
522
531
  }
523
532
  }
524
- function un(e, t, n, r) {
533
+ function hn(e, t, n, r) {
525
534
  if (!n.has(e) && (n.add(e), e.reactions !== null))
526
535
  for (const i of e.reactions) {
527
536
  const s = i.f;
528
- (s & k) !== 0 ? un(
537
+ (s & z) !== 0 ? hn(
529
538
  /** @type {Derived} */
530
539
  i,
531
540
  t,
532
541
  n,
533
542
  r
534
- ) : (s & (_t | se)) !== 0 && (s & z) === 0 && cn(i, t, r) && (T(i, z), q(
543
+ ) : (s & (gt | ie)) !== 0 && (s & A) === 0 && dn(i, t, r) && (T(i, A), q(
535
544
  /** @type {Effect} */
536
545
  i
537
546
  ));
538
547
  }
539
548
  }
540
- function cn(e, t, n) {
549
+ function dn(e, t, n) {
541
550
  const r = n.get(e);
542
551
  if (r !== void 0) return r;
543
552
  if (e.deps !== null)
544
553
  for (const i of e.deps) {
545
- if (ke.call(t, i))
554
+ if (ze.call(t, i))
546
555
  return !0;
547
- if ((i.f & k) !== 0 && cn(
556
+ if ((i.f & z) !== 0 && dn(
548
557
  /** @type {Derived} */
549
558
  i,
550
559
  t,
@@ -559,71 +568,68 @@ function cn(e, t, n) {
559
568
  return n.set(e, !1), !1;
560
569
  }
561
570
  function q(e) {
562
- for (var t = tt = e; t.parent !== null; ) {
571
+ for (var t = nt = e; t.parent !== null; ) {
563
572
  t = t.parent;
564
573
  var n = t.f;
565
- if (ot && t === g && (n & se) !== 0 && (n & Zt) === 0)
574
+ if (ft && t === g && (n & ie) !== 0 && (n & en) === 0)
566
575
  return;
567
- if ((n & (ce | X)) !== 0) {
576
+ if ((n & (he | X)) !== 0) {
568
577
  if ((n & x) === 0) return;
569
578
  t.f ^= x;
570
579
  }
571
580
  }
572
581
  R.push(t);
573
582
  }
574
- function hn(e, t) {
583
+ function vn(e, t) {
575
584
  if (!((e.f & X) !== 0 && (e.f & x) !== 0)) {
576
- (e.f & z) !== 0 ? t.d.push(e) : (e.f & U) !== 0 && t.m.push(e), T(e, x);
585
+ (e.f & A) !== 0 ? t.d.push(e) : (e.f & U) !== 0 && t.m.push(e), T(e, x);
577
586
  for (var n = e.first; n !== null; )
578
- hn(n, t), n = n.next;
587
+ vn(n, t), n = n.next;
579
588
  }
580
589
  }
581
- function Ar(e) {
590
+ function Rr(e) {
582
591
  let t = 0, n = Be(0), r;
583
592
  return () => {
584
- $t() && (p(n), Et(() => (t === 0 && (r = Pn(() => e(() => De(n)))), t += 1, () => {
585
- ge(() => {
586
- t -= 1, t === 0 && (r?.(), r = void 0, De(n));
593
+ Tt() && (p(n), St(() => (t === 0 && (r = Ln(() => e(() => Le(n)))), t += 1, () => {
594
+ me(() => {
595
+ t -= 1, t === 0 && (r?.(), r = void 0, Le(n));
587
596
  });
588
597
  })));
589
598
  };
590
599
  }
591
- var Nr = ze | $e | Xt;
592
- function Rr(e, t, n) {
593
- new Cr(e, t, n);
600
+ var Cr = Ae | Ee;
601
+ function Or(e, t, n) {
602
+ new Ir(e, t, n);
594
603
  }
595
- class Cr {
604
+ class Ir {
596
605
  /** @type {Boundary | null} */
597
606
  parent;
598
607
  is_pending = !1;
599
608
  /** @type {TemplateNode} */
600
609
  #e;
601
610
  /** @type {TemplateNode | null} */
602
- #t = y ? m : null;
611
+ #t = b ? m : null;
603
612
  /** @type {BoundaryProps} */
604
613
  #n;
605
614
  /** @type {((anchor: Node) => void)} */
606
- #l;
615
+ #s;
607
616
  /** @type {Effect} */
608
- #o;
617
+ #l;
609
618
  /** @type {Effect | null} */
610
- #i = null;
619
+ #o = null;
611
620
  /** @type {Effect | null} */
612
621
  #r = null;
613
622
  /** @type {Effect | null} */
614
- #s = null;
623
+ #i = null;
615
624
  /** @type {DocumentFragment | null} */
616
625
  #a = null;
617
- /** @type {TemplateNode | null} */
618
- #f = null;
619
- #c = 0;
620
626
  #u = 0;
621
- #v = !1;
622
- #d = !1;
627
+ #f = 0;
628
+ #h = !1;
623
629
  /** @type {Set<Effect>} */
624
- #_ = /* @__PURE__ */ new Set();
630
+ #d = /* @__PURE__ */ new Set();
625
631
  /** @type {Set<Effect>} */
626
- #p = /* @__PURE__ */ new Set();
632
+ #v = /* @__PURE__ */ new Set();
627
633
  /**
628
634
  * A source containing the number of pending async deriveds/expressions.
629
635
  * Only created if `$effect.pending()` is used inside the boundary,
@@ -631,9 +637,9 @@ class Cr {
631
637
  * calls followed by no-op flushes
632
638
  * @type {Source<number> | null}
633
639
  */
634
- #h = null;
635
- #y = Ar(() => (this.#h = Be(this.#c), () => {
636
- this.#h = null;
640
+ #c = null;
641
+ #m = Rr(() => (this.#c = Be(this.#u), () => {
642
+ this.#c = null;
637
643
  }));
638
644
  /**
639
645
  * @param {TemplateNode} node
@@ -641,39 +647,36 @@ class Cr {
641
647
  * @param {((anchor: Node) => void)} children
642
648
  */
643
649
  constructor(t, n, r) {
644
- this.#e = t, this.#n = n, this.#l = r, this.parent = /** @type {Effect} */
645
- g.b, this.is_pending = !!this.#n.pending, this.#o = En(() => {
646
- if (g.b = this, y) {
647
- const s = this.#t;
648
- pt(), /** @type {Comment} */
649
- s.nodeType === He && /** @type {Comment} */
650
- s.data === vt ? this.#E() : (this.#$(), this.#u === 0 && (this.is_pending = !1));
651
- } else {
652
- var i = this.#w();
653
- try {
654
- this.#i = te(() => r(i));
655
- } catch (s) {
656
- this.error(s);
657
- }
658
- this.#u > 0 ? this.#m() : this.is_pending = !1;
659
- }
660
- return () => {
661
- this.#f?.remove();
662
- };
663
- }, Nr), y && (this.#e = m);
650
+ this.#e = t, this.#n = n, this.#s = (i) => {
651
+ var s = (
652
+ /** @type {Effect} */
653
+ g
654
+ );
655
+ s.b = this, s.f |= ot, r(i);
656
+ }, this.parent = /** @type {Effect} */
657
+ g.b, this.#l = Sn(() => {
658
+ if (b) {
659
+ const i = (
660
+ /** @type {Comment} */
661
+ this.#t
662
+ );
663
+ mt(), i.data === pt ? this.#b() : this.#w();
664
+ } else
665
+ this.#p();
666
+ }, Cr), b && (this.#e = m);
664
667
  }
665
- #$() {
668
+ #w() {
666
669
  try {
667
- this.#i = te(() => this.#l(this.#e));
670
+ this.#o = ae(() => this.#s(this.#e));
668
671
  } catch (t) {
669
672
  this.error(t);
670
673
  }
671
674
  }
672
- #E() {
675
+ #b() {
673
676
  const t = this.#n.pending;
674
- t && (this.#r = te(() => t(this.#e)), ge(() => {
675
- var n = this.#w();
676
- this.#i = this.#g(() => (re.ensure(), te(() => this.#l(n)))), this.#u > 0 ? this.#m() : (Le(
677
+ t && (this.is_pending = !0, this.#r = ae(() => t(this.#e)), me(() => {
678
+ var n = this.#a = document.createDocumentFragment(), r = re();
679
+ n.append(r), this.#o = this.#_(() => (ne.ensure(), ae(() => this.#s(r)))), this.#f === 0 && (this.#e.before(n), this.#a = null, Fe(
677
680
  /** @type {Effect} */
678
681
  this.#r,
679
682
  () => {
@@ -682,16 +685,30 @@ class Cr {
682
685
  ), this.is_pending = !1);
683
686
  }));
684
687
  }
685
- #w() {
686
- var t = this.#e;
687
- return this.is_pending && (this.#f = ie(), this.#e.before(this.#f), t = this.#f), t;
688
+ #p() {
689
+ try {
690
+ if (this.is_pending = this.has_pending_snippet(), this.#f = 0, this.#u = 0, this.#o = ae(() => {
691
+ this.#s(this.#e);
692
+ }), this.#f > 0) {
693
+ var t = this.#a = document.createDocumentFragment();
694
+ Nn(this.#o, t);
695
+ const n = (
696
+ /** @type {(anchor: Node) => void} */
697
+ this.#n.pending
698
+ );
699
+ this.#r = ae(() => n(this.#e));
700
+ } else
701
+ this.is_pending = !1;
702
+ } catch (n) {
703
+ this.error(n);
704
+ }
688
705
  }
689
706
  /**
690
707
  * Defer an effect inside a pending boundary until the boundary resolves
691
708
  * @param {Effect} effect
692
709
  */
693
710
  defer_effect(t) {
694
- an(t, this.#_, this.#p);
711
+ un(t, this.#d, this.#v);
695
712
  }
696
713
  /**
697
714
  * Returns `false` if the effect exists inside a boundary whose pending snippet is shown
@@ -704,46 +721,37 @@ class Cr {
704
721
  return !!this.#n.pending;
705
722
  }
706
723
  /**
707
- * @param {() => Effect | null} fn
724
+ * @template T
725
+ * @param {() => T} fn
708
726
  */
709
- #g(t) {
727
+ #_(t) {
710
728
  var n = g, r = _, i = F;
711
- J(this.#o), j(this.#o), Ae(this.#o.ctx);
729
+ J(this.#l), j(this.#l), Ne(this.#l.ctx);
712
730
  try {
713
731
  return t();
714
732
  } catch (s) {
715
- return ln(s), null;
733
+ return an(s), null;
716
734
  } finally {
717
- J(n), j(r), Ae(i);
735
+ J(n), j(r), Ne(i);
718
736
  }
719
737
  }
720
- #m() {
721
- const t = (
722
- /** @type {(anchor: Node) => void} */
723
- this.#n.pending
724
- );
725
- this.#i !== null && (this.#a = document.createDocumentFragment(), this.#a.append(
726
- /** @type {TemplateNode} */
727
- this.#f
728
- ), zn(this.#i, this.#a)), this.#r === null && (this.#r = te(() => t(this.#e)));
729
- }
730
738
  /**
731
739
  * Updates the pending count associated with the currently visible pending snippet,
732
740
  * if any, such that we can replace the snippet with content once work is done
733
741
  * @param {1 | -1} d
734
742
  */
735
- #b(t) {
743
+ #g(t) {
736
744
  if (!this.has_pending_snippet()) {
737
- this.parent && this.parent.#b(t);
745
+ this.parent && this.parent.#g(t);
738
746
  return;
739
747
  }
740
- if (this.#u += t, this.#u === 0) {
748
+ if (this.#f += t, this.#f === 0) {
741
749
  this.is_pending = !1;
742
- for (const n of this.#_)
743
- T(n, z), q(n);
744
- for (const n of this.#p)
750
+ for (const n of this.#d)
751
+ T(n, A), q(n);
752
+ for (const n of this.#v)
745
753
  T(n, U), q(n);
746
- this.#_.clear(), this.#p.clear(), this.#r && Le(this.#r, () => {
754
+ this.#d.clear(), this.#v.clear(), this.#r && Fe(this.#r, () => {
747
755
  this.#r = null;
748
756
  }), this.#a && (this.#e.before(this.#a), this.#a = null);
749
757
  }
@@ -755,67 +763,71 @@ class Cr {
755
763
  * @param {1 | -1} d
756
764
  */
757
765
  update_pending_count(t) {
758
- this.#b(t), this.#c += t, !(!this.#h || this.#v) && (this.#v = !0, ge(() => {
759
- this.#v = !1, this.#h && Xe(this.#h, this.#c);
766
+ this.#g(t), this.#u += t, !(!this.#c || this.#h) && (this.#h = !0, me(() => {
767
+ this.#h = !1, this.#c && Xe(this.#c, this.#u);
760
768
  }));
761
769
  }
762
770
  get_effect_pending() {
763
- return this.#y(), p(
771
+ return this.#m(), p(
764
772
  /** @type {Source<number>} */
765
- this.#h
773
+ this.#c
766
774
  );
767
775
  }
768
776
  /** @param {unknown} error */
769
777
  error(t) {
770
778
  var n = this.#n.onerror;
771
779
  let r = this.#n.failed;
772
- if (this.#d || !n && !r)
780
+ if (!n && !r)
773
781
  throw t;
774
- this.#i && (O(this.#i), this.#i = null), this.#r && (O(this.#r), this.#r = null), this.#s && (O(this.#s), this.#s = null), y && (G(
782
+ this.#o && (O(this.#o), this.#o = null), this.#r && (O(this.#r), this.#r = null), this.#i && (O(this.#i), this.#i = null), b && (G(
775
783
  /** @type {TemplateNode} */
776
784
  this.#t
777
- ), yr(), G(Qt()));
785
+ ), Er(), G(tn()));
778
786
  var i = !1, s = !1;
779
787
  const l = () => {
780
788
  if (i) {
781
- br();
789
+ $r();
782
790
  return;
783
791
  }
784
- i = !0, s && wr(), re.ensure(), this.#c = 0, this.#s !== null && Le(this.#s, () => {
785
- this.#s = null;
786
- }), this.is_pending = this.has_pending_snippet(), this.#i = this.#g(() => (this.#d = !1, te(() => this.#l(this.#e)))), this.#u > 0 ? this.#m() : this.is_pending = !1;
792
+ i = !0, s && yr(), this.#i !== null && Fe(this.#i, () => {
793
+ this.#i = null;
794
+ }), this.#_(() => {
795
+ ne.ensure(), this.#p();
796
+ });
787
797
  };
788
- ge(() => {
798
+ me(() => {
789
799
  try {
790
800
  s = !0, n?.(t, l), s = !1;
791
801
  } catch (o) {
792
- Ne(o, this.#o && this.#o.parent);
802
+ Re(o, this.#l && this.#l.parent);
793
803
  }
794
- r && (this.#s = this.#g(() => {
795
- re.ensure(), this.#d = !0;
804
+ r && (this.#i = this.#_(() => {
805
+ ne.ensure();
796
806
  try {
797
- return te(() => {
798
- r(
807
+ return ae(() => {
808
+ var o = (
809
+ /** @type {Effect} */
810
+ g
811
+ );
812
+ o.b = this, o.f |= ot, r(
799
813
  this.#e,
800
814
  () => t,
801
815
  () => l
802
816
  );
803
817
  });
804
818
  } catch (o) {
805
- return Ne(
819
+ return Re(
806
820
  o,
807
821
  /** @type {Effect} */
808
- this.#o.parent
822
+ this.#l.parent
809
823
  ), null;
810
- } finally {
811
- this.#d = !1;
812
824
  }
813
825
  }));
814
826
  });
815
827
  }
816
828
  }
817
- function Or(e, t, n, r) {
818
- const i = mt;
829
+ function Mr(e, t, n, r) {
830
+ const i = bt;
819
831
  var s = e.filter((u) => !u.settled);
820
832
  if (n.length === 0 && s.length === 0) {
821
833
  r(t.map(i));
@@ -824,52 +836,52 @@ function Or(e, t, n, r) {
824
836
  var l = $, o = (
825
837
  /** @type {Effect} */
826
838
  g
827
- ), a = Ir(), f = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((u) => u.promise)) : null;
839
+ ), a = Dr(), f = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((u) => u.promise)) : null;
828
840
  function c(u) {
829
841
  a();
830
842
  try {
831
843
  r(u);
832
844
  } catch (h) {
833
- (o.f & ne) === 0 && Ne(h, o);
845
+ (o.f & te) === 0 && Re(h, o);
834
846
  }
835
- l?.deactivate(), at();
847
+ l?.deactivate(), ut();
836
848
  }
837
849
  if (n.length === 0) {
838
850
  f.then(() => c(t.map(i)));
839
851
  return;
840
852
  }
841
- function d() {
842
- a(), Promise.all(n.map((u) => /* @__PURE__ */ Mr(u))).then((u) => c([...t.map(i), ...u])).catch((u) => Ne(u, o));
853
+ function v() {
854
+ a(), Promise.all(n.map((u) => /* @__PURE__ */ Pr(u))).then((u) => c([...t.map(i), ...u])).catch((u) => Re(u, o));
843
855
  }
844
- f ? f.then(d) : d();
856
+ f ? f.then(v) : v();
845
857
  }
846
- function Ir() {
858
+ function Dr() {
847
859
  var e = g, t = _, n = F, r = $;
848
860
  return function(s = !0) {
849
- J(e), j(t), Ae(n), s && r?.activate();
861
+ J(e), j(t), Ne(n), s && r?.activate();
850
862
  };
851
863
  }
852
- function at() {
853
- J(null), j(null), Ae(null);
864
+ function ut() {
865
+ J(null), j(null), Ne(null);
854
866
  }
855
867
  // @__NO_SIDE_EFFECTS__
856
- function mt(e) {
857
- var t = k | z, n = _ !== null && (_.f & k) !== 0 ? (
868
+ function bt(e) {
869
+ var t = z | A, n = _ !== null && (_.f & z) !== 0 ? (
858
870
  /** @type {Derived} */
859
871
  _
860
872
  ) : null;
861
- return g !== null && (g.f |= $e), {
873
+ return g !== null && (g.f |= Ee), {
862
874
  ctx: F,
863
875
  deps: null,
864
876
  effects: null,
865
- equals: en,
877
+ equals: nn,
866
878
  f: t,
867
879
  fn: e,
868
880
  reactions: null,
869
881
  rv: 0,
870
882
  v: (
871
883
  /** @type {V} */
872
- S
884
+ k
873
885
  ),
874
886
  wv: 0,
875
887
  parent: n ?? g,
@@ -877,12 +889,12 @@ function mt(e) {
877
889
  };
878
890
  }
879
891
  // @__NO_SIDE_EFFECTS__
880
- function Mr(e, t, n) {
892
+ function Pr(e, t, n) {
881
893
  let r = (
882
894
  /** @type {Effect | null} */
883
895
  g
884
896
  );
885
- r === null && ur();
897
+ r === null && hr();
886
898
  var i = (
887
899
  /** @type {Boundary} */
888
900
  r.b
@@ -892,58 +904,58 @@ function Mr(e, t, n) {
892
904
  void 0
893
905
  ), l = Be(
894
906
  /** @type {V} */
895
- S
907
+ k
896
908
  ), o = !_, a = /* @__PURE__ */ new Map();
897
- return Jr(() => {
898
- var f = Kt();
909
+ return Zr(() => {
910
+ var f = Zt();
899
911
  s = f.promise;
900
912
  try {
901
913
  Promise.resolve(e()).then(f.resolve, f.reject).then(() => {
902
- c === $ && c.committed && c.deactivate(), at();
914
+ c === $ && c.committed && c.deactivate(), ut();
903
915
  });
904
916
  } catch (h) {
905
- f.reject(h), at();
917
+ f.reject(h), ut();
906
918
  }
907
919
  var c = (
908
920
  /** @type {Batch} */
909
921
  $
910
922
  );
911
923
  if (o) {
912
- var d = i.is_rendered();
913
- i.update_pending_count(1), c.increment(d), a.get(c)?.reject(ve), a.delete(c), a.set(c, f);
924
+ var v = i.is_rendered();
925
+ i.update_pending_count(1), c.increment(v), a.get(c)?.reject(_e), a.delete(c), a.set(c, f);
914
926
  }
915
- const u = (h, v = void 0) => {
916
- if (c.activate(), v)
917
- v !== ve && (l.f |= ae, Xe(l, v));
927
+ const u = (h, d = void 0) => {
928
+ if (c.activate(), d)
929
+ d !== _e && (l.f |= fe, Xe(l, d));
918
930
  else {
919
- (l.f & ae) !== 0 && (l.f ^= ae), Xe(l, h);
920
- for (const [w, N] of a) {
921
- if (a.delete(w), w === c) break;
922
- N.reject(ve);
931
+ (l.f & fe) !== 0 && (l.f ^= fe), Xe(l, h);
932
+ for (const [y, S] of a) {
933
+ if (a.delete(y), y === c) break;
934
+ S.reject(_e);
923
935
  }
924
936
  }
925
- o && (i.update_pending_count(-1), c.decrement(d));
937
+ o && (i.update_pending_count(-1), c.decrement(v));
926
938
  };
927
939
  f.promise.then(u, (h) => u(null, h || "unknown"));
928
- }), Gr(() => {
940
+ }), Kr(() => {
929
941
  for (const f of a.values())
930
- f.reject(ve);
942
+ f.reject(_e);
931
943
  }), new Promise((f) => {
932
- function c(d) {
944
+ function c(v) {
933
945
  function u() {
934
- d === s ? f(l) : c(s);
946
+ v === s ? f(l) : c(s);
935
947
  }
936
- d.then(u, u);
948
+ v.then(u, u);
937
949
  }
938
950
  c(s);
939
951
  });
940
952
  }
941
953
  // @__NO_SIDE_EFFECTS__
942
- function Pr(e) {
943
- const t = /* @__PURE__ */ mt(e);
944
- return An(t), t;
954
+ function Lr(e) {
955
+ const t = /* @__PURE__ */ bt(e);
956
+ return Rn(t), t;
945
957
  }
946
- function Dr(e) {
958
+ function Fr(e) {
947
959
  var t = e.effects;
948
960
  if (t !== null) {
949
961
  e.effects = null;
@@ -954,10 +966,10 @@ function Dr(e) {
954
966
  );
955
967
  }
956
968
  }
957
- function Lr(e) {
969
+ function jr(e) {
958
970
  for (var t = e.parent; t !== null; ) {
959
- if ((t.f & k) === 0)
960
- return (t.f & ne) === 0 ? (
971
+ if ((t.f & z) === 0)
972
+ return (t.f & te) === 0 ? (
961
973
  /** @type {Effect} */
962
974
  t
963
975
  ) : null;
@@ -965,44 +977,44 @@ function Lr(e) {
965
977
  }
966
978
  return null;
967
979
  }
968
- function wt(e) {
980
+ function yt(e) {
969
981
  var t, n = g;
970
- J(Lr(e));
982
+ J(jr(e));
971
983
  try {
972
- e.f &= ~we, Dr(e), t = On(e);
984
+ e.f &= ~be, Fr(e), t = Mn(e);
973
985
  } finally {
974
986
  J(n);
975
987
  }
976
988
  return t;
977
989
  }
978
- function dn(e) {
979
- var t = wt(e);
980
- if (!e.equals(t) && (e.wv = Rn(), (!$?.is_fork || e.deps === null) && (e.v = t, e.deps === null))) {
990
+ function _n(e) {
991
+ var t = yt(e);
992
+ if (!e.equals(t) && (e.wv = On(), (!$?.is_fork || e.deps === null) && (e.v = t, e.deps === null))) {
981
993
  T(e, x);
982
994
  return;
983
995
  }
984
- ue || (V !== null ? ($t() || $?.is_fork) && V.set(e, t) : gt(e));
996
+ ce || (V !== null ? (Tt() || $?.is_fork) && V.set(e, t) : wt(e));
985
997
  }
986
- function Fr(e) {
998
+ function Hr(e) {
987
999
  if (e.effects !== null)
988
1000
  for (const t of e.effects)
989
- (t.teardown || t.ac) && (t.teardown?.(), t.ac?.abort(ve), t.teardown = ir, t.ac = null, je(t, 0), Tt(t));
1001
+ (t.teardown || t.ac) && (t.teardown?.(), t.ac?.abort(_e), t.teardown = lr, t.ac = null, He(t, 0), xt(t));
990
1002
  }
991
- function vn(e) {
1003
+ function pn(e) {
992
1004
  if (e.effects !== null)
993
1005
  for (const t of e.effects)
994
- t.teardown && Re(t);
1006
+ t.teardown && Ce(t);
995
1007
  }
996
- let ft = /* @__PURE__ */ new Set();
997
- const fe = /* @__PURE__ */ new Map();
998
- let _n = !1;
1008
+ let ct = /* @__PURE__ */ new Set();
1009
+ const ue = /* @__PURE__ */ new Map();
1010
+ let gn = !1;
999
1011
  function Be(e, t) {
1000
1012
  var n = {
1001
1013
  f: 0,
1002
1014
  // TODO ideally we could skip this altogether, but it causes type errors
1003
1015
  v: e,
1004
1016
  reactions: null,
1005
- equals: en,
1017
+ equals: nn,
1006
1018
  rv: 0,
1007
1019
  wv: 0
1008
1020
  };
@@ -1011,57 +1023,57 @@ function Be(e, t) {
1011
1023
  // @__NO_SIDE_EFFECTS__
1012
1024
  function M(e, t) {
1013
1025
  const n = Be(e);
1014
- return An(n), n;
1026
+ return Rn(n), n;
1015
1027
  }
1016
1028
  // @__NO_SIDE_EFFECTS__
1017
- function jr(e, t = !1, n = !0) {
1029
+ function Br(e, t = !1, n = !0) {
1018
1030
  const r = Be(e);
1019
- return t || (r.equals = Tr), r;
1031
+ return t || (r.equals = xr), r;
1020
1032
  }
1021
- function b(e, t, n = !1) {
1033
+ function w(e, t, n = !1) {
1022
1034
  _ !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
1023
1035
  // to ensure we error if state is set inside an inspect effect
1024
- (!Y || (_.f & Rt) !== 0) && rn() && (_.f & (k | se | _t | Rt)) !== 0 && (L === null || !ke.call(L, e)) && mr();
1036
+ (!Y || (_.f & Ot) !== 0) && ln() && (_.f & (z | ie | gt | Ot)) !== 0 && (L === null || !ze.call(L, e)) && br();
1025
1037
  let r = n ? Me(t) : t;
1026
1038
  return Xe(e, r);
1027
1039
  }
1028
1040
  function Xe(e, t) {
1029
1041
  if (!e.equals(t)) {
1030
1042
  var n = e.v;
1031
- ue ? fe.set(e, t) : fe.set(e, n), e.v = t;
1032
- var r = re.ensure();
1033
- if (r.capture(e, n), (e.f & k) !== 0) {
1043
+ ce ? ue.set(e, t) : ue.set(e, n), e.v = t;
1044
+ var r = ne.ensure();
1045
+ if (r.capture(e, n), (e.f & z) !== 0) {
1034
1046
  const i = (
1035
1047
  /** @type {Derived} */
1036
1048
  e
1037
1049
  );
1038
- (e.f & z) !== 0 && wt(i), gt(i);
1050
+ (e.f & A) !== 0 && yt(i), wt(i);
1039
1051
  }
1040
- e.wv = Rn(), pn(e, z), g !== null && (g.f & x) !== 0 && (g.f & (X | ce)) === 0 && (P === null ? ei([e]) : P.push(e)), !r.is_fork && ft.size > 0 && !_n && Hr();
1052
+ e.wv = On(), mn(e, A), g !== null && (g.f & x) !== 0 && (g.f & (X | he)) === 0 && (D === null ? ni([e]) : D.push(e)), !r.is_fork && ct.size > 0 && !gn && Vr();
1041
1053
  }
1042
1054
  return t;
1043
1055
  }
1044
- function Hr() {
1045
- _n = !1;
1046
- for (const e of ft)
1047
- (e.f & x) !== 0 && T(e, U), Ve(e) && Re(e);
1048
- ft.clear();
1056
+ function Vr() {
1057
+ gn = !1;
1058
+ for (const e of ct)
1059
+ (e.f & x) !== 0 && T(e, U), Ve(e) && Ce(e);
1060
+ ct.clear();
1049
1061
  }
1050
- function De(e) {
1051
- b(e, e.v + 1);
1062
+ function Le(e) {
1063
+ w(e, e.v + 1);
1052
1064
  }
1053
- function pn(e, t) {
1065
+ function mn(e, t) {
1054
1066
  var n = e.reactions;
1055
1067
  if (n !== null)
1056
1068
  for (var r = n.length, i = 0; i < r; i++) {
1057
- var s = n[i], l = s.f, o = (l & z) === 0;
1058
- if (o && T(s, t), (l & k) !== 0) {
1069
+ var s = n[i], l = s.f, o = (l & A) === 0;
1070
+ if (o && T(s, t), (l & z) !== 0) {
1059
1071
  var a = (
1060
1072
  /** @type {Derived} */
1061
1073
  s
1062
1074
  );
1063
- V?.delete(a), (l & we) === 0 && (l & D && (s.f |= we), pn(a, U));
1064
- } else o && ((l & se) !== 0 && ee !== null && ee.add(
1075
+ V?.delete(a), (l & be) === 0 && (l & P && (s.f |= be), mn(a, U));
1076
+ } else o && ((l & ie) !== 0 && ee !== null && ee.add(
1065
1077
  /** @type {Effect} */
1066
1078
  s
1067
1079
  ), q(
@@ -1073,16 +1085,16 @@ function pn(e, t) {
1073
1085
  function Me(e) {
1074
1086
  if (typeof e != "object" || e === null || Ue in e)
1075
1087
  return e;
1076
- const t = Wt(e);
1077
- if (t !== nr && t !== rr)
1088
+ const t = Xt(e);
1089
+ if (t !== ir && t !== sr)
1078
1090
  return e;
1079
- var n = /* @__PURE__ */ new Map(), r = Zn(e), i = /* @__PURE__ */ M(0), s = me, l = (o) => {
1080
- if (me === s)
1091
+ var n = /* @__PURE__ */ new Map(), r = er(e), i = /* @__PURE__ */ M(0), s = we, l = (o) => {
1092
+ if (we === s)
1081
1093
  return o();
1082
- var a = _, f = me;
1083
- j(null), Lt(s);
1094
+ var a = _, f = we;
1095
+ j(null), jt(s);
1084
1096
  var c = o();
1085
- return j(a), Lt(f), c;
1097
+ return j(a), jt(f), c;
1086
1098
  };
1087
1099
  return r && n.set("length", /* @__PURE__ */ M(
1088
1100
  /** @type {any[]} */
@@ -1092,34 +1104,34 @@ function Me(e) {
1092
1104
  e,
1093
1105
  {
1094
1106
  defineProperty(o, a, f) {
1095
- (!("value" in f) || f.configurable === !1 || f.enumerable === !1 || f.writable === !1) && pr();
1107
+ (!("value" in f) || f.configurable === !1 || f.enumerable === !1 || f.writable === !1) && mr();
1096
1108
  var c = n.get(a);
1097
1109
  return c === void 0 ? l(() => {
1098
- var d = /* @__PURE__ */ M(f.value);
1099
- return n.set(a, d), d;
1100
- }) : b(c, f.value, !0), !0;
1110
+ var v = /* @__PURE__ */ M(f.value);
1111
+ return n.set(a, v), v;
1112
+ }) : w(c, f.value, !0), !0;
1101
1113
  },
1102
1114
  deleteProperty(o, a) {
1103
1115
  var f = n.get(a);
1104
1116
  if (f === void 0) {
1105
1117
  if (a in o) {
1106
- const c = l(() => /* @__PURE__ */ M(S));
1107
- n.set(a, c), De(i);
1118
+ const c = l(() => /* @__PURE__ */ M(k));
1119
+ n.set(a, c), Le(i);
1108
1120
  }
1109
1121
  } else
1110
- b(f, S), De(i);
1122
+ w(f, k), Le(i);
1111
1123
  return !0;
1112
1124
  },
1113
1125
  get(o, a, f) {
1114
1126
  if (a === Ue)
1115
1127
  return e;
1116
- var c = n.get(a), d = a in o;
1117
- if (c === void 0 && (!d || xe(o, a)?.writable) && (c = l(() => {
1118
- var h = Me(d ? o[a] : S), v = /* @__PURE__ */ M(h);
1119
- return v;
1128
+ var c = n.get(a), v = a in o;
1129
+ if (c === void 0 && (!v || xe(o, a)?.writable) && (c = l(() => {
1130
+ var h = Me(v ? o[a] : k), d = /* @__PURE__ */ M(h);
1131
+ return d;
1120
1132
  }), n.set(a, c)), c !== void 0) {
1121
1133
  var u = p(c);
1122
- return u === S ? void 0 : u;
1134
+ return u === k ? void 0 : u;
1123
1135
  }
1124
1136
  return Reflect.get(o, a, f);
1125
1137
  },
@@ -1129,8 +1141,8 @@ function Me(e) {
1129
1141
  var c = n.get(a);
1130
1142
  c && (f.value = p(c));
1131
1143
  } else if (f === void 0) {
1132
- var d = n.get(a), u = d?.v;
1133
- if (d !== void 0 && u !== S)
1144
+ var v = n.get(a), u = v?.v;
1145
+ if (v !== void 0 && u !== k)
1134
1146
  return {
1135
1147
  enumerable: !0,
1136
1148
  configurable: !0,
@@ -1143,151 +1155,151 @@ function Me(e) {
1143
1155
  has(o, a) {
1144
1156
  if (a === Ue)
1145
1157
  return !0;
1146
- var f = n.get(a), c = f !== void 0 && f.v !== S || Reflect.has(o, a);
1158
+ var f = n.get(a), c = f !== void 0 && f.v !== k || Reflect.has(o, a);
1147
1159
  if (f !== void 0 || g !== null && (!c || xe(o, a)?.writable)) {
1148
1160
  f === void 0 && (f = l(() => {
1149
- var u = c ? Me(o[a]) : S, h = /* @__PURE__ */ M(u);
1161
+ var u = c ? Me(o[a]) : k, h = /* @__PURE__ */ M(u);
1150
1162
  return h;
1151
1163
  }), n.set(a, f));
1152
- var d = p(f);
1153
- if (d === S)
1164
+ var v = p(f);
1165
+ if (v === k)
1154
1166
  return !1;
1155
1167
  }
1156
1168
  return c;
1157
1169
  },
1158
1170
  set(o, a, f, c) {
1159
- var d = n.get(a), u = a in o;
1171
+ var v = n.get(a), u = a in o;
1160
1172
  if (r && a === "length")
1161
1173
  for (var h = f; h < /** @type {Source<number>} */
1162
- d.v; h += 1) {
1163
- var v = n.get(h + "");
1164
- v !== void 0 ? b(v, S) : h in o && (v = l(() => /* @__PURE__ */ M(S)), n.set(h + "", v));
1174
+ v.v; h += 1) {
1175
+ var d = n.get(h + "");
1176
+ d !== void 0 ? w(d, k) : h in o && (d = l(() => /* @__PURE__ */ M(k)), n.set(h + "", d));
1165
1177
  }
1166
- if (d === void 0)
1167
- (!u || xe(o, a)?.writable) && (d = l(() => /* @__PURE__ */ M(void 0)), b(d, Me(f)), n.set(a, d));
1178
+ if (v === void 0)
1179
+ (!u || xe(o, a)?.writable) && (v = l(() => /* @__PURE__ */ M(void 0)), w(v, Me(f)), n.set(a, v));
1168
1180
  else {
1169
- u = d.v !== S;
1170
- var w = l(() => Me(f));
1171
- b(d, w);
1181
+ u = v.v !== k;
1182
+ var y = l(() => Me(f));
1183
+ w(v, y);
1172
1184
  }
1173
- var N = Reflect.getOwnPropertyDescriptor(o, a);
1174
- if (N?.set && N.set.call(c, f), !u) {
1185
+ var S = Reflect.getOwnPropertyDescriptor(o, a);
1186
+ if (S?.set && S.set.call(c, f), !u) {
1175
1187
  if (r && typeof a == "string") {
1176
- var Q = (
1188
+ var le = (
1177
1189
  /** @type {Source<number>} */
1178
1190
  n.get("length")
1179
- ), Oe = Number(a);
1180
- Number.isInteger(Oe) && Oe >= Q.v && b(Q, Oe + 1);
1191
+ ), Q = Number(a);
1192
+ Number.isInteger(Q) && Q >= le.v && w(le, Q + 1);
1181
1193
  }
1182
- De(i);
1194
+ Le(i);
1183
1195
  }
1184
1196
  return !0;
1185
1197
  },
1186
1198
  ownKeys(o) {
1187
1199
  p(i);
1188
- var a = Reflect.ownKeys(o).filter((d) => {
1189
- var u = n.get(d);
1190
- return u === void 0 || u.v !== S;
1200
+ var a = Reflect.ownKeys(o).filter((v) => {
1201
+ var u = n.get(v);
1202
+ return u === void 0 || u.v !== k;
1191
1203
  });
1192
1204
  for (var [f, c] of n)
1193
- c.v !== S && !(f in o) && a.push(f);
1205
+ c.v !== k && !(f in o) && a.push(f);
1194
1206
  return a;
1195
1207
  },
1196
1208
  setPrototypeOf() {
1197
- gr();
1209
+ wr();
1198
1210
  }
1199
1211
  }
1200
1212
  );
1201
1213
  }
1202
- var Ot, gn, mn, wn;
1203
- function ut() {
1204
- if (Ot === void 0) {
1205
- Ot = window, gn = /Firefox/.test(navigator.userAgent);
1214
+ var Mt, wn, bn, yn;
1215
+ function ht() {
1216
+ if (Mt === void 0) {
1217
+ Mt = window, wn = /Firefox/.test(navigator.userAgent);
1206
1218
  var e = Element.prototype, t = Node.prototype, n = Text.prototype;
1207
- mn = xe(t, "firstChild").get, wn = xe(t, "nextSibling").get, Nt(e) && (e.__click = void 0, e.__className = void 0, e.__attributes = null, e.__style = void 0, e.__e = void 0), Nt(n) && (n.__t = void 0);
1219
+ bn = xe(t, "firstChild").get, yn = xe(t, "nextSibling").get, Ct(e) && (e.__click = void 0, e.__className = void 0, e.__attributes = null, e.__style = void 0, e.__e = void 0), Ct(n) && (n.__t = void 0);
1208
1220
  }
1209
1221
  }
1210
- function ie(e = "") {
1222
+ function re(e = "") {
1211
1223
  return document.createTextNode(e);
1212
1224
  }
1213
1225
  // @__NO_SIDE_EFFECTS__
1214
- function be(e) {
1226
+ function ye(e) {
1215
1227
  return (
1216
1228
  /** @type {TemplateNode | null} */
1217
- mn.call(e)
1229
+ bn.call(e)
1218
1230
  );
1219
1231
  }
1220
1232
  // @__NO_SIDE_EFFECTS__
1221
- function le(e) {
1233
+ function se(e) {
1222
1234
  return (
1223
1235
  /** @type {TemplateNode | null} */
1224
- wn.call(e)
1236
+ yn.call(e)
1225
1237
  );
1226
1238
  }
1227
- function rt(e, t) {
1228
- if (!y)
1229
- return /* @__PURE__ */ be(e);
1230
- var n = /* @__PURE__ */ be(m);
1239
+ function it(e, t) {
1240
+ if (!b)
1241
+ return /* @__PURE__ */ ye(e);
1242
+ var n = /* @__PURE__ */ ye(m);
1231
1243
  if (n === null)
1232
- n = m.appendChild(ie());
1244
+ n = m.appendChild(re());
1233
1245
  else if (t && n.nodeType !== Qe) {
1234
- var r = ie();
1246
+ var r = re();
1235
1247
  return n?.before(r), G(r), r;
1236
1248
  }
1237
- return t && yt(
1249
+ return t && Et(
1238
1250
  /** @type {Text} */
1239
1251
  n
1240
1252
  ), G(n), n;
1241
1253
  }
1242
- function Br(e, t = !1) {
1243
- if (!y) {
1244
- var n = /* @__PURE__ */ be(e);
1245
- return n instanceof Comment && n.data === "" ? /* @__PURE__ */ le(n) : n;
1254
+ function qr(e, t = !1) {
1255
+ if (!b) {
1256
+ var n = /* @__PURE__ */ ye(e);
1257
+ return n instanceof Comment && n.data === "" ? /* @__PURE__ */ se(n) : n;
1246
1258
  }
1247
1259
  if (t) {
1248
1260
  if (m?.nodeType !== Qe) {
1249
- var r = ie();
1261
+ var r = re();
1250
1262
  return m?.before(r), G(r), r;
1251
1263
  }
1252
- yt(
1264
+ Et(
1253
1265
  /** @type {Text} */
1254
1266
  m
1255
1267
  );
1256
1268
  }
1257
1269
  return m;
1258
1270
  }
1259
- function It(e, t = 1, n = !1) {
1260
- let r = y ? m : e;
1271
+ function Dt(e, t = 1, n = !1) {
1272
+ let r = b ? m : e;
1261
1273
  for (var i; t--; )
1262
1274
  i = r, r = /** @type {TemplateNode} */
1263
- /* @__PURE__ */ le(r);
1264
- if (!y)
1275
+ /* @__PURE__ */ se(r);
1276
+ if (!b)
1265
1277
  return r;
1266
1278
  if (n) {
1267
1279
  if (r?.nodeType !== Qe) {
1268
- var s = ie();
1280
+ var s = re();
1269
1281
  return r === null ? i?.after(s) : r.before(s), G(s), s;
1270
1282
  }
1271
- yt(
1283
+ Et(
1272
1284
  /** @type {Text} */
1273
1285
  r
1274
1286
  );
1275
1287
  }
1276
1288
  return G(r), r;
1277
1289
  }
1278
- function Vr(e) {
1290
+ function Yr(e) {
1279
1291
  e.textContent = "";
1280
1292
  }
1281
- function qr() {
1293
+ function Ur() {
1282
1294
  return !1;
1283
1295
  }
1284
- function bt(e, t, n) {
1296
+ function $t(e, t, n) {
1285
1297
  return (
1286
1298
  /** @type {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element} */
1287
- document.createElementNS(Gt, e, void 0)
1299
+ document.createElementNS(Jt, e, void 0)
1288
1300
  );
1289
1301
  }
1290
- function yt(e) {
1302
+ function Et(e) {
1291
1303
  if (
1292
1304
  /** @type {string} */
1293
1305
  e.nodeValue.length < 65536
@@ -1298,7 +1310,7 @@ function yt(e) {
1298
1310
  t.remove(), e.nodeValue += /** @type {string} */
1299
1311
  t.nodeValue, t = e.nextSibling;
1300
1312
  }
1301
- function bn(e) {
1313
+ function $n(e) {
1302
1314
  var t = _, n = g;
1303
1315
  j(null), J(null);
1304
1316
  try {
@@ -1307,10 +1319,10 @@ function bn(e) {
1307
1319
  j(t), J(n);
1308
1320
  }
1309
1321
  }
1310
- function Yr(e) {
1311
- g === null && (_ === null && dr(), hr()), ue && cr();
1322
+ function Gr(e) {
1323
+ g === null && (_ === null && _r(), vr()), ce && dr();
1312
1324
  }
1313
- function Ur(e, t) {
1325
+ function Wr(e, t) {
1314
1326
  var n = t.last;
1315
1327
  n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e);
1316
1328
  }
@@ -1321,7 +1333,7 @@ function Z(e, t, n) {
1321
1333
  ctx: F,
1322
1334
  deps: null,
1323
1335
  nodes: null,
1324
- f: e | z | D,
1336
+ f: e | A | P,
1325
1337
  first: null,
1326
1338
  fn: t,
1327
1339
  last: null,
@@ -1335,14 +1347,14 @@ function Z(e, t, n) {
1335
1347
  };
1336
1348
  if (n)
1337
1349
  try {
1338
- Re(i);
1350
+ Ce(i);
1339
1351
  } catch (o) {
1340
1352
  throw O(i), o;
1341
1353
  }
1342
1354
  else t !== null && q(i);
1343
1355
  var s = i;
1344
1356
  if (n && s.deps === null && s.teardown === null && s.nodes === null && s.first === s.last && // either `null`, or a singular child
1345
- (s.f & $e) === 0 && (s = s.first, (e & se) !== 0 && (e & ze) !== 0 && s !== null && (s.f |= ze)), s !== null && (s.parent = r, r !== null && Ur(s, r), _ !== null && (_.f & k) !== 0 && (e & ce) === 0)) {
1357
+ (s.f & Ee) === 0 && (s = s.first, (e & ie) !== 0 && (e & Ae) !== 0 && s !== null && (s.f |= Ae)), s !== null && (s.parent = r, r !== null && Wr(s, r), _ !== null && (_.f & z) !== 0 && (e & he) === 0)) {
1346
1358
  var l = (
1347
1359
  /** @type {Derived} */
1348
1360
  _
@@ -1351,19 +1363,19 @@ function Z(e, t, n) {
1351
1363
  }
1352
1364
  return i;
1353
1365
  }
1354
- function $t() {
1366
+ function Tt() {
1355
1367
  return _ !== null && !Y;
1356
1368
  }
1357
- function Gr(e) {
1369
+ function Kr(e) {
1358
1370
  const t = Z(Ze, null, !1);
1359
1371
  return T(t, x), t.teardown = e, t;
1360
1372
  }
1361
- function Mt(e) {
1362
- Yr();
1373
+ function Pt(e) {
1374
+ Gr();
1363
1375
  var t = (
1364
1376
  /** @type {Effect} */
1365
1377
  g.f
1366
- ), n = !_ && (t & X) !== 0 && (t & Ce) === 0;
1378
+ ), n = !_ && (t & X) !== 0 && (t & Oe) === 0;
1367
1379
  if (n) {
1368
1380
  var r = (
1369
1381
  /** @type {ComponentContext} */
@@ -1371,72 +1383,72 @@ function Mt(e) {
1371
1383
  );
1372
1384
  (r.e ??= []).push(e);
1373
1385
  } else
1374
- return yn(e);
1386
+ return En(e);
1375
1387
  }
1376
- function yn(e) {
1377
- return Z(Fe | lr, e, !1);
1388
+ function En(e) {
1389
+ return Z(je | ar, e, !1);
1378
1390
  }
1379
- function Wr(e) {
1380
- re.ensure();
1381
- const t = Z(ce | $e, e, !0);
1391
+ function Jr(e) {
1392
+ ne.ensure();
1393
+ const t = Z(he | Ee, e, !0);
1382
1394
  return () => {
1383
1395
  O(t);
1384
1396
  };
1385
1397
  }
1386
- function Kr(e) {
1387
- re.ensure();
1388
- const t = Z(ce | $e, e, !0);
1398
+ function Xr(e) {
1399
+ ne.ensure();
1400
+ const t = Z(he | Ee, e, !0);
1389
1401
  return (n = {}) => new Promise((r) => {
1390
- n.outro ? Le(t, () => {
1402
+ n.outro ? Fe(t, () => {
1391
1403
  O(t), r(void 0);
1392
1404
  }) : (O(t), r(void 0));
1393
1405
  });
1394
1406
  }
1395
- function $n(e) {
1396
- return Z(Fe, e, !1);
1407
+ function Tn(e) {
1408
+ return Z(je, e, !1);
1397
1409
  }
1398
- function Jr(e) {
1399
- return Z(_t | $e, e, !0);
1410
+ function Zr(e) {
1411
+ return Z(gt | Ee, e, !0);
1400
1412
  }
1401
- function Et(e, t = 0) {
1413
+ function St(e, t = 0) {
1402
1414
  return Z(Ze | t, e, !0);
1403
1415
  }
1404
- function Pt(e, t = [], n = [], r = []) {
1405
- Or(r, t, n, (i) => {
1416
+ function Lt(e, t = [], n = [], r = []) {
1417
+ Mr(r, t, n, (i) => {
1406
1418
  Z(Ze, () => e(...i.map(p)), !0);
1407
1419
  });
1408
1420
  }
1409
- function En(e, t = 0) {
1410
- var n = Z(se | t, e, !0);
1421
+ function Sn(e, t = 0) {
1422
+ var n = Z(ie | t, e, !0);
1411
1423
  return n;
1412
1424
  }
1413
- function te(e) {
1414
- return Z(X | $e, e, !0);
1425
+ function ae(e) {
1426
+ return Z(X | Ee, e, !0);
1415
1427
  }
1416
- function Tn(e) {
1428
+ function xn(e) {
1417
1429
  var t = e.teardown;
1418
1430
  if (t !== null) {
1419
- const n = ue, r = _;
1420
- Dt(!0), j(null);
1431
+ const n = ce, r = _;
1432
+ Ft(!0), j(null);
1421
1433
  try {
1422
1434
  t.call(null);
1423
1435
  } finally {
1424
- Dt(n), j(r);
1436
+ Ft(n), j(r);
1425
1437
  }
1426
1438
  }
1427
1439
  }
1428
- function Tt(e, t = !1) {
1440
+ function xt(e, t = !1) {
1429
1441
  var n = e.first;
1430
1442
  for (e.first = e.last = null; n !== null; ) {
1431
1443
  const i = n.ac;
1432
- i !== null && bn(() => {
1433
- i.abort(ve);
1444
+ i !== null && $n(() => {
1445
+ i.abort(_e);
1434
1446
  });
1435
1447
  var r = n.next;
1436
- (n.f & ce) !== 0 ? n.parent = null : O(n, t), n = r;
1448
+ (n.f & he) !== 0 ? n.parent = null : O(n, t), n = r;
1437
1449
  }
1438
1450
  }
1439
- function Xr(e) {
1451
+ function Qr(e) {
1440
1452
  for (var t = e.first; t !== null; ) {
1441
1453
  var n = t.next;
1442
1454
  (t.f & X) === 0 && O(t), t = n;
@@ -1444,32 +1456,32 @@ function Xr(e) {
1444
1456
  }
1445
1457
  function O(e, t = !0) {
1446
1458
  var n = !1;
1447
- (t || (e.f & Zt) !== 0) && e.nodes !== null && e.nodes.end !== null && (Zr(
1459
+ (t || (e.f & en) !== 0) && e.nodes !== null && e.nodes.end !== null && (ei(
1448
1460
  e.nodes.start,
1449
1461
  /** @type {TemplateNode} */
1450
1462
  e.nodes.end
1451
- ), n = !0), Tt(e, t && !n), je(e, 0), T(e, ne);
1463
+ ), n = !0), xt(e, t && !n), He(e, 0), T(e, te);
1452
1464
  var r = e.nodes && e.nodes.t;
1453
1465
  if (r !== null)
1454
1466
  for (const s of r)
1455
1467
  s.stop();
1456
- Tn(e);
1468
+ xn(e);
1457
1469
  var i = e.parent;
1458
- i !== null && i.first !== null && xn(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = null;
1470
+ i !== null && i.first !== null && kn(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = null;
1459
1471
  }
1460
- function Zr(e, t) {
1472
+ function ei(e, t) {
1461
1473
  for (; e !== null; ) {
1462
- var n = e === t ? null : /* @__PURE__ */ le(e);
1474
+ var n = e === t ? null : /* @__PURE__ */ se(e);
1463
1475
  e.remove(), e = n;
1464
1476
  }
1465
1477
  }
1466
- function xn(e) {
1478
+ function kn(e) {
1467
1479
  var t = e.parent, n = e.prev, r = e.next;
1468
1480
  n !== null && (n.next = r), r !== null && (r.prev = n), t !== null && (t.first === e && (t.first = r), t.last === e && (t.last = n));
1469
1481
  }
1470
- function Le(e, t, n = !0) {
1482
+ function Fe(e, t, n = !0) {
1471
1483
  var r = [];
1472
- Sn(e, r, !0);
1484
+ zn(e, r, !0);
1473
1485
  var i = () => {
1474
1486
  n && O(e), t && t();
1475
1487
  }, s = r.length;
@@ -1480,7 +1492,7 @@ function Le(e, t, n = !0) {
1480
1492
  } else
1481
1493
  i();
1482
1494
  }
1483
- function Sn(e, t, n) {
1495
+ function zn(e, t, n) {
1484
1496
  if ((e.f & K) === 0) {
1485
1497
  e.f ^= K;
1486
1498
  var r = e.nodes && e.nodes.t;
@@ -1488,23 +1500,23 @@ function Sn(e, t, n) {
1488
1500
  for (const o of r)
1489
1501
  (o.is_global || n) && t.push(o);
1490
1502
  for (var i = e.first; i !== null; ) {
1491
- var s = i.next, l = (i.f & ze) !== 0 || // If this is a branch effect without a block effect parent,
1503
+ var s = i.next, l = (i.f & Ae) !== 0 || // If this is a branch effect without a block effect parent,
1492
1504
  // it means the parent block effect was pruned. In that case,
1493
1505
  // transparency information was transferred to the branch effect.
1494
- (i.f & X) !== 0 && (e.f & se) !== 0;
1495
- Sn(i, t, l ? n : !1), i = s;
1506
+ (i.f & X) !== 0 && (e.f & ie) !== 0;
1507
+ zn(i, t, l ? n : !1), i = s;
1496
1508
  }
1497
1509
  }
1498
1510
  }
1499
- function Qr(e) {
1500
- kn(e, !0);
1511
+ function ti(e) {
1512
+ An(e, !0);
1501
1513
  }
1502
- function kn(e, t) {
1514
+ function An(e, t) {
1503
1515
  if ((e.f & K) !== 0) {
1504
- e.f ^= K, (e.f & x) === 0 && (T(e, z), q(e));
1516
+ e.f ^= K, (e.f & x) === 0 && (T(e, A), q(e));
1505
1517
  for (var n = e.first; n !== null; ) {
1506
- var r = n.next, i = (n.f & ze) !== 0 || (n.f & X) !== 0;
1507
- kn(n, i ? t : !1), n = r;
1518
+ var r = n.next, i = (n.f & Ae) !== 0 || (n.f & X) !== 0;
1519
+ An(n, i ? t : !1), n = r;
1508
1520
  }
1509
1521
  var s = e.nodes && e.nodes.t;
1510
1522
  if (s !== null)
@@ -1512,16 +1524,16 @@ function kn(e, t) {
1512
1524
  (l.is_global || t) && l.in();
1513
1525
  }
1514
1526
  }
1515
- function zn(e, t) {
1527
+ function Nn(e, t) {
1516
1528
  if (e.nodes)
1517
1529
  for (var n = e.nodes.start, r = e.nodes.end; n !== null; ) {
1518
- var i = n === r ? null : /* @__PURE__ */ le(n);
1530
+ var i = n === r ? null : /* @__PURE__ */ se(n);
1519
1531
  t.append(n), n = i;
1520
1532
  }
1521
1533
  }
1522
- let Ge = !1, ue = !1;
1523
- function Dt(e) {
1524
- ue = e;
1534
+ let Ge = !1, ce = !1;
1535
+ function Ft(e) {
1536
+ ce = e;
1525
1537
  }
1526
1538
  let _ = null, Y = !1;
1527
1539
  function j(e) {
@@ -1532,25 +1544,25 @@ function J(e) {
1532
1544
  g = e;
1533
1545
  }
1534
1546
  let L = null;
1535
- function An(e) {
1547
+ function Rn(e) {
1536
1548
  _ !== null && (L === null ? L = [e] : L.push(e));
1537
1549
  }
1538
- let C = null, I = 0, P = null;
1539
- function ei(e) {
1540
- P = e;
1550
+ let C = null, I = 0, D = null;
1551
+ function ni(e) {
1552
+ D = e;
1541
1553
  }
1542
- let Nn = 1, pe = 0, me = pe;
1543
- function Lt(e) {
1544
- me = e;
1554
+ let Cn = 1, ge = 0, we = ge;
1555
+ function jt(e) {
1556
+ we = e;
1545
1557
  }
1546
- function Rn() {
1547
- return ++Nn;
1558
+ function On() {
1559
+ return ++Cn;
1548
1560
  }
1549
1561
  function Ve(e) {
1550
1562
  var t = e.f;
1551
- if ((t & z) !== 0)
1563
+ if ((t & A) !== 0)
1552
1564
  return !0;
1553
- if (t & k && (e.f &= ~we), (t & U) !== 0) {
1565
+ if (t & z && (e.f &= ~be), (t & U) !== 0) {
1554
1566
  for (var n = (
1555
1567
  /** @type {Value[]} */
1556
1568
  e.deps
@@ -1559,185 +1571,185 @@ function Ve(e) {
1559
1571
  if (Ve(
1560
1572
  /** @type {Derived} */
1561
1573
  s
1562
- ) && dn(
1574
+ ) && _n(
1563
1575
  /** @type {Derived} */
1564
1576
  s
1565
1577
  ), s.wv > e.wv)
1566
1578
  return !0;
1567
1579
  }
1568
- (t & D) !== 0 && // During time traveling we don't want to reset the status so that
1580
+ (t & P) !== 0 && // During time traveling we don't want to reset the status so that
1569
1581
  // traversal of the graph in the other batches still happens
1570
1582
  V === null && T(e, x);
1571
1583
  }
1572
1584
  return !1;
1573
1585
  }
1574
- function Cn(e, t, n = !0) {
1586
+ function In(e, t, n = !0) {
1575
1587
  var r = e.reactions;
1576
- if (r !== null && !(L !== null && ke.call(L, e)))
1588
+ if (r !== null && !(L !== null && ze.call(L, e)))
1577
1589
  for (var i = 0; i < r.length; i++) {
1578
1590
  var s = r[i];
1579
- (s.f & k) !== 0 ? Cn(
1591
+ (s.f & z) !== 0 ? In(
1580
1592
  /** @type {Derived} */
1581
1593
  s,
1582
1594
  t,
1583
1595
  !1
1584
- ) : t === s && (n ? T(s, z) : (s.f & x) !== 0 && T(s, U), q(
1596
+ ) : t === s && (n ? T(s, A) : (s.f & x) !== 0 && T(s, U), q(
1585
1597
  /** @type {Effect} */
1586
1598
  s
1587
1599
  ));
1588
1600
  }
1589
1601
  }
1590
- function On(e) {
1591
- var t = C, n = I, r = P, i = _, s = L, l = F, o = Y, a = me, f = e.f;
1602
+ function Mn(e) {
1603
+ var t = C, n = I, r = D, i = _, s = L, l = F, o = Y, a = we, f = e.f;
1592
1604
  C = /** @type {null | Value[]} */
1593
- null, I = 0, P = null, _ = (f & (X | ce)) === 0 ? e : null, L = null, Ae(e.ctx), Y = !1, me = ++pe, e.ac !== null && (bn(() => {
1594
- e.ac.abort(ve);
1605
+ null, I = 0, D = null, _ = (f & (X | he)) === 0 ? e : null, L = null, Ne(e.ctx), Y = !1, we = ++ge, e.ac !== null && ($n(() => {
1606
+ e.ac.abort(_e);
1595
1607
  }), e.ac = null);
1596
1608
  try {
1597
- e.f |= lt;
1609
+ e.f |= at;
1598
1610
  var c = (
1599
1611
  /** @type {Function} */
1600
1612
  e.fn
1601
- ), d = c();
1602
- e.f |= Ce;
1613
+ ), v = c();
1614
+ e.f |= Oe;
1603
1615
  var u = e.deps, h = $?.is_fork;
1604
1616
  if (C !== null) {
1605
- var v;
1606
- if (h || je(e, I), u !== null && I > 0)
1607
- for (u.length = I + C.length, v = 0; v < C.length; v++)
1608
- u[I + v] = C[v];
1617
+ var d;
1618
+ if (h || He(e, I), u !== null && I > 0)
1619
+ for (u.length = I + C.length, d = 0; d < C.length; d++)
1620
+ u[I + d] = C[d];
1609
1621
  else
1610
1622
  e.deps = u = C;
1611
- if ($t() && (e.f & D) !== 0)
1612
- for (v = I; v < u.length; v++)
1613
- (u[v].reactions ??= []).push(e);
1614
- } else !h && u !== null && I < u.length && (je(e, I), u.length = I);
1615
- if (rn() && P !== null && !Y && u !== null && (e.f & (k | U | z)) === 0)
1616
- for (v = 0; v < /** @type {Source[]} */
1617
- P.length; v++)
1618
- Cn(
1619
- P[v],
1623
+ if (Tt() && (e.f & P) !== 0)
1624
+ for (d = I; d < u.length; d++)
1625
+ (u[d].reactions ??= []).push(e);
1626
+ } else !h && u !== null && I < u.length && (He(e, I), u.length = I);
1627
+ if (ln() && D !== null && !Y && u !== null && (e.f & (z | U | A)) === 0)
1628
+ for (d = 0; d < /** @type {Source[]} */
1629
+ D.length; d++)
1630
+ In(
1631
+ D[d],
1620
1632
  /** @type {Effect} */
1621
1633
  e
1622
1634
  );
1623
1635
  if (i !== null && i !== e) {
1624
- if (pe++, i.deps !== null)
1625
- for (let w = 0; w < n; w += 1)
1626
- i.deps[w].rv = pe;
1636
+ if (ge++, i.deps !== null)
1637
+ for (let y = 0; y < n; y += 1)
1638
+ i.deps[y].rv = ge;
1627
1639
  if (t !== null)
1628
- for (const w of t)
1629
- w.rv = pe;
1630
- P !== null && (r === null ? r = P : r.push(.../** @type {Source[]} */
1631
- P));
1640
+ for (const y of t)
1641
+ y.rv = ge;
1642
+ D !== null && (r === null ? r = D : r.push(.../** @type {Source[]} */
1643
+ D));
1632
1644
  }
1633
- return (e.f & ae) !== 0 && (e.f ^= ae), d;
1634
- } catch (w) {
1635
- return ln(w);
1645
+ return (e.f & fe) !== 0 && (e.f ^= fe), v;
1646
+ } catch (y) {
1647
+ return an(y);
1636
1648
  } finally {
1637
- e.f ^= lt, C = t, I = n, P = r, _ = i, L = s, Ae(l), Y = o, me = a;
1649
+ e.f ^= at, C = t, I = n, D = r, _ = i, L = s, Ne(l), Y = o, we = a;
1638
1650
  }
1639
1651
  }
1640
- function ti(e, t) {
1652
+ function ri(e, t) {
1641
1653
  let n = t.reactions;
1642
1654
  if (n !== null) {
1643
- var r = Qn.call(n, e);
1655
+ var r = tr.call(n, e);
1644
1656
  if (r !== -1) {
1645
1657
  var i = n.length - 1;
1646
1658
  i === 0 ? n = t.reactions = null : (n[r] = n[i], n.pop());
1647
1659
  }
1648
1660
  }
1649
- if (n === null && (t.f & k) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
1661
+ if (n === null && (t.f & z) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
1650
1662
  // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
1651
1663
  // allows us to skip the expensive work of disconnecting and immediately reconnecting it
1652
- (C === null || !ke.call(C, t))) {
1664
+ (C === null || !ze.call(C, t))) {
1653
1665
  var s = (
1654
1666
  /** @type {Derived} */
1655
1667
  t
1656
1668
  );
1657
- (s.f & D) !== 0 && (s.f ^= D, s.f &= ~we), gt(s), Fr(s), je(s, 0);
1669
+ (s.f & P) !== 0 && (s.f ^= P, s.f &= ~be), wt(s), Hr(s), He(s, 0);
1658
1670
  }
1659
1671
  }
1660
- function je(e, t) {
1672
+ function He(e, t) {
1661
1673
  var n = e.deps;
1662
1674
  if (n !== null)
1663
1675
  for (var r = t; r < n.length; r++)
1664
- ti(e, n[r]);
1676
+ ri(e, n[r]);
1665
1677
  }
1666
- function Re(e) {
1678
+ function Ce(e) {
1667
1679
  var t = e.f;
1668
- if ((t & ne) === 0) {
1680
+ if ((t & te) === 0) {
1669
1681
  T(e, x);
1670
1682
  var n = g, r = Ge;
1671
1683
  g = e, Ge = !0;
1672
1684
  try {
1673
- (t & (se | Jt)) !== 0 ? Xr(e) : Tt(e), Tn(e);
1674
- var i = On(e);
1675
- e.teardown = typeof i == "function" ? i : null, e.wv = Nn;
1685
+ (t & (ie | Qt)) !== 0 ? Qr(e) : xt(e), xn(e);
1686
+ var i = Mn(e);
1687
+ e.teardown = typeof i == "function" ? i : null, e.wv = Cn;
1676
1688
  var s;
1677
- st && xr && (e.f & z) !== 0 && e.deps;
1689
+ lt && kr && (e.f & A) !== 0 && e.deps;
1678
1690
  } finally {
1679
1691
  Ge = r, g = n;
1680
1692
  }
1681
1693
  }
1682
1694
  }
1683
1695
  function p(e) {
1684
- var t = e.f, n = (t & k) !== 0;
1696
+ var t = e.f, n = (t & z) !== 0;
1685
1697
  if (_ !== null && !Y) {
1686
- var r = g !== null && (g.f & ne) !== 0;
1687
- if (!r && (L === null || !ke.call(L, e))) {
1698
+ var r = g !== null && (g.f & te) !== 0;
1699
+ if (!r && (L === null || !ze.call(L, e))) {
1688
1700
  var i = _.deps;
1689
- if ((_.f & lt) !== 0)
1690
- e.rv < pe && (e.rv = pe, C === null && i !== null && i[I] === e ? I++ : C === null ? C = [e] : C.push(e));
1701
+ if ((_.f & at) !== 0)
1702
+ e.rv < ge && (e.rv = ge, C === null && i !== null && i[I] === e ? I++ : C === null ? C = [e] : C.push(e));
1691
1703
  else {
1692
1704
  (_.deps ??= []).push(e);
1693
1705
  var s = e.reactions;
1694
- s === null ? e.reactions = [_] : ke.call(s, _) || s.push(_);
1706
+ s === null ? e.reactions = [_] : ze.call(s, _) || s.push(_);
1695
1707
  }
1696
1708
  }
1697
1709
  }
1698
- if (ue && fe.has(e))
1699
- return fe.get(e);
1710
+ if (ce && ue.has(e))
1711
+ return ue.get(e);
1700
1712
  if (n) {
1701
1713
  var l = (
1702
1714
  /** @type {Derived} */
1703
1715
  e
1704
1716
  );
1705
- if (ue) {
1717
+ if (ce) {
1706
1718
  var o = l.v;
1707
- return ((l.f & x) === 0 && l.reactions !== null || Mn(l)) && (o = wt(l)), fe.set(l, o), o;
1719
+ return ((l.f & x) === 0 && l.reactions !== null || Pn(l)) && (o = yt(l)), ue.set(l, o), o;
1708
1720
  }
1709
- var a = (l.f & D) === 0 && !Y && _ !== null && (Ge || (_.f & D) !== 0), f = (l.f & Ce) === 0;
1710
- Ve(l) && (a && (l.f |= D), dn(l)), a && !f && (vn(l), In(l));
1721
+ var a = (l.f & P) === 0 && !Y && _ !== null && (Ge || (_.f & P) !== 0), f = (l.f & Oe) === 0;
1722
+ Ve(l) && (a && (l.f |= P), _n(l)), a && !f && (pn(l), Dn(l));
1711
1723
  }
1712
1724
  if (V?.has(e))
1713
1725
  return V.get(e);
1714
- if ((e.f & ae) !== 0)
1726
+ if ((e.f & fe) !== 0)
1715
1727
  throw e.v;
1716
1728
  return e.v;
1717
1729
  }
1718
- function In(e) {
1719
- if (e.f |= D, e.deps !== null)
1730
+ function Dn(e) {
1731
+ if (e.f |= P, e.deps !== null)
1720
1732
  for (const t of e.deps)
1721
- (t.reactions ??= []).push(e), (t.f & k) !== 0 && (t.f & D) === 0 && (vn(
1733
+ (t.reactions ??= []).push(e), (t.f & z) !== 0 && (t.f & P) === 0 && (pn(
1722
1734
  /** @type {Derived} */
1723
1735
  t
1724
- ), In(
1736
+ ), Dn(
1725
1737
  /** @type {Derived} */
1726
1738
  t
1727
1739
  ));
1728
1740
  }
1729
- function Mn(e) {
1730
- if (e.v === S) return !0;
1741
+ function Pn(e) {
1742
+ if (e.v === k) return !0;
1731
1743
  if (e.deps === null) return !1;
1732
1744
  for (const t of e.deps)
1733
- if (fe.has(t) || (t.f & k) !== 0 && Mn(
1745
+ if (ue.has(t) || (t.f & z) !== 0 && Pn(
1734
1746
  /** @type {Derived} */
1735
1747
  t
1736
1748
  ))
1737
1749
  return !0;
1738
1750
  return !1;
1739
1751
  }
1740
- function Pn(e) {
1752
+ function Ln(e) {
1741
1753
  var t = Y;
1742
1754
  try {
1743
1755
  return Y = !0, e();
@@ -1745,15 +1757,18 @@ function Pn(e) {
1745
1757
  Y = t;
1746
1758
  }
1747
1759
  }
1748
- const Dn = /* @__PURE__ */ new Set(), ct = /* @__PURE__ */ new Set();
1749
- function ni(e) {
1760
+ const De = /* @__PURE__ */ Symbol("events"), Fn = /* @__PURE__ */ new Set(), dt = /* @__PURE__ */ new Set();
1761
+ function Ht(e, t, n) {
1762
+ (t[De] ??= {})[e] = n;
1763
+ }
1764
+ function ii(e) {
1750
1765
  for (var t = 0; t < e.length; t++)
1751
- Dn.add(e[t]);
1752
- for (var n of ct)
1766
+ Fn.add(e[t]);
1767
+ for (var n of dt)
1753
1768
  n(e);
1754
1769
  }
1755
- let Ft = null;
1756
- function jt(e) {
1770
+ let Bt = null;
1771
+ function Vt(e) {
1757
1772
  var t = this, n = (
1758
1773
  /** @type {Node} */
1759
1774
  t.ownerDocument
@@ -1761,13 +1776,13 @@ function jt(e) {
1761
1776
  /** @type {null | Element} */
1762
1777
  i[0] || e.target
1763
1778
  );
1764
- Ft = e;
1765
- var l = 0, o = Ft === e && e.__root;
1779
+ Bt = e;
1780
+ var l = 0, o = Bt === e && e[De];
1766
1781
  if (o) {
1767
1782
  var a = i.indexOf(o);
1768
1783
  if (a !== -1 && (t === document || t === /** @type {any} */
1769
1784
  window)) {
1770
- e.__root = t;
1785
+ e[De] = t;
1771
1786
  return;
1772
1787
  }
1773
1788
  var f = i.indexOf(t);
@@ -1783,55 +1798,55 @@ function jt(e) {
1783
1798
  return s || n;
1784
1799
  }
1785
1800
  });
1786
- var c = _, d = g;
1801
+ var c = _, v = g;
1787
1802
  j(null), J(null);
1788
1803
  try {
1789
1804
  for (var u, h = []; s !== null; ) {
1790
- var v = s.assignedSlot || s.parentNode || /** @type {any} */
1805
+ var d = s.assignedSlot || s.parentNode || /** @type {any} */
1791
1806
  s.host || null;
1792
1807
  try {
1793
- var w = s["__" + r];
1794
- w != null && (!/** @type {any} */
1808
+ var y = s[De]?.[r];
1809
+ y != null && (!/** @type {any} */
1795
1810
  s.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
1796
1811
  // -> the target could not have been disabled because it emits the event in the first place
1797
- e.target === s) && w.call(s, e);
1798
- } catch (N) {
1799
- u ? h.push(N) : u = N;
1812
+ e.target === s) && y.call(s, e);
1813
+ } catch (S) {
1814
+ u ? h.push(S) : u = S;
1800
1815
  }
1801
- if (e.cancelBubble || v === t || v === null)
1816
+ if (e.cancelBubble || d === t || d === null)
1802
1817
  break;
1803
- s = v;
1818
+ s = d;
1804
1819
  }
1805
1820
  if (u) {
1806
- for (let N of h)
1821
+ for (let S of h)
1807
1822
  queueMicrotask(() => {
1808
- throw N;
1823
+ throw S;
1809
1824
  });
1810
1825
  throw u;
1811
1826
  }
1812
1827
  } finally {
1813
- e.__root = t, delete e.currentTarget, j(c), J(d);
1828
+ e[De] = t, delete e.currentTarget, j(c), J(v);
1814
1829
  }
1815
1830
  }
1816
1831
  }
1817
- const ri = /* @__PURE__ */ globalThis?.window?.trustedTypes?.createPolicy(
1818
- "svelte-trusted-html",
1819
- {
1832
+ const si = (
1833
+ // We gotta write it like this because after downleveling the pure comment may end up in the wrong location
1834
+ globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", {
1820
1835
  /** @param {string} html */
1821
1836
  createHTML: (e) => e
1822
- }
1837
+ })
1823
1838
  );
1824
- function ii(e) {
1839
+ function li(e) {
1825
1840
  return (
1826
1841
  /** @type {string} */
1827
- ri?.createHTML(e) ?? e
1842
+ si?.createHTML(e) ?? e
1828
1843
  );
1829
1844
  }
1830
- function Ln(e, t = !1) {
1831
- var n = bt("template");
1832
- return e = e.replaceAll("<!>", "<!---->"), n.innerHTML = t ? ii(e) : e, n.content;
1845
+ function jn(e, t = !1) {
1846
+ var n = $t("template");
1847
+ return e = e.replaceAll("<!>", "<!---->"), n.innerHTML = t ? li(e) : e, n.content;
1833
1848
  }
1834
- function ye(e, t) {
1849
+ function $e(e, t) {
1835
1850
  var n = (
1836
1851
  /** @type {Effect} */
1837
1852
  g
@@ -1839,61 +1854,61 @@ function ye(e, t) {
1839
1854
  n.nodes === null && (n.nodes = { start: e, end: t, a: null, t: null });
1840
1855
  }
1841
1856
  // @__NO_SIDE_EFFECTS__
1842
- function Fn(e, t) {
1843
- var n = (t & Xn) !== 0, r, i = !e.startsWith("<!>");
1857
+ function Hn(e, t) {
1858
+ var n = (t & Qn) !== 0, r, i = !e.startsWith("<!>");
1844
1859
  return () => {
1845
- if (y)
1846
- return ye(m, null), m;
1847
- r === void 0 && (r = Ln(i ? e : "<!>" + e, !0), r = /** @type {TemplateNode} */
1848
- /* @__PURE__ */ be(r));
1860
+ if (b)
1861
+ return $e(m, null), m;
1862
+ r === void 0 && (r = jn(i ? e : "<!>" + e, !0), r = /** @type {TemplateNode} */
1863
+ /* @__PURE__ */ ye(r));
1849
1864
  var s = (
1850
1865
  /** @type {TemplateNode} */
1851
- n || gn ? document.importNode(r, !0) : r.cloneNode(!0)
1866
+ n || wn ? document.importNode(r, !0) : r.cloneNode(!0)
1852
1867
  );
1853
- return ye(s, s), s;
1868
+ return $e(s, s), s;
1854
1869
  };
1855
1870
  }
1856
1871
  // @__NO_SIDE_EFFECTS__
1857
- function si(e, t, n = "svg") {
1872
+ function oi(e, t, n = "svg") {
1858
1873
  var r = !e.startsWith("<!>"), i = `<${n}>${r ? e : "<!>" + e}</${n}>`, s;
1859
1874
  return () => {
1860
- if (y)
1861
- return ye(m, null), m;
1875
+ if (b)
1876
+ return $e(m, null), m;
1862
1877
  if (!s) {
1863
1878
  var l = (
1864
1879
  /** @type {DocumentFragment} */
1865
- Ln(i, !0)
1880
+ jn(i, !0)
1866
1881
  ), o = (
1867
1882
  /** @type {Element} */
1868
- /* @__PURE__ */ be(l)
1883
+ /* @__PURE__ */ ye(l)
1869
1884
  );
1870
1885
  s = /** @type {Element} */
1871
- /* @__PURE__ */ be(o);
1886
+ /* @__PURE__ */ ye(o);
1872
1887
  }
1873
1888
  var a = (
1874
1889
  /** @type {TemplateNode} */
1875
1890
  s.cloneNode(!0)
1876
1891
  );
1877
- return ye(a, a), a;
1892
+ return $e(a, a), a;
1878
1893
  };
1879
1894
  }
1880
1895
  // @__NO_SIDE_EFFECTS__
1881
- function xt(e, t) {
1882
- return /* @__PURE__ */ si(e, t, "svg");
1896
+ function kt(e, t) {
1897
+ return /* @__PURE__ */ oi(e, t, "svg");
1883
1898
  }
1884
- function li() {
1885
- if (y)
1886
- return ye(m, null), m;
1887
- var e = document.createDocumentFragment(), t = document.createComment(""), n = ie();
1888
- return e.append(t, n), ye(t, n), e;
1899
+ function ai() {
1900
+ if (b)
1901
+ return $e(m, null), m;
1902
+ var e = document.createDocumentFragment(), t = document.createComment(""), n = re();
1903
+ return e.append(t, n), $e(t, n), e;
1889
1904
  }
1890
- function de(e, t) {
1891
- if (y) {
1905
+ function ve(e, t) {
1906
+ if (b) {
1892
1907
  var n = (
1893
1908
  /** @type {Effect & { nodes: EffectNodes }} */
1894
1909
  g
1895
1910
  );
1896
- ((n.f & Ce) === 0 || n.nodes.end === null) && (n.nodes.end = m), pt();
1911
+ ((n.f & Oe) === 0 || n.nodes.end === null) && (n.nodes.end = m), mt();
1897
1912
  return;
1898
1913
  }
1899
1914
  e !== null && e.before(
@@ -1901,108 +1916,108 @@ function de(e, t) {
1901
1916
  t
1902
1917
  );
1903
1918
  }
1904
- const oi = ["touchstart", "touchmove"];
1905
- function ai(e) {
1906
- return oi.includes(e);
1919
+ const fi = ["touchstart", "touchmove"];
1920
+ function ui(e) {
1921
+ return fi.includes(e);
1907
1922
  }
1908
- function fi(e, t) {
1923
+ function ci(e, t) {
1909
1924
  var n = t == null ? "" : typeof t == "object" ? t + "" : t;
1910
1925
  n !== (e.__t ??= e.nodeValue) && (e.__t = n, e.nodeValue = n + "");
1911
1926
  }
1912
- function jn(e, t) {
1913
- return Hn(e, t);
1927
+ function Bn(e, t) {
1928
+ return Vn(e, t);
1914
1929
  }
1915
- function ui(e, t) {
1916
- ut(), t.intro = t.intro ?? !1;
1917
- const n = t.target, r = y, i = m;
1930
+ function hi(e, t) {
1931
+ ht(), t.intro = t.intro ?? !1;
1932
+ const n = t.target, r = b, i = m;
1918
1933
  try {
1919
- for (var s = /* @__PURE__ */ be(n); s && (s.nodeType !== He || /** @type {Comment} */
1920
- s.data !== dt); )
1921
- s = /* @__PURE__ */ le(s);
1934
+ for (var s = /* @__PURE__ */ ye(n); s && (s.nodeType !== et || /** @type {Comment} */
1935
+ s.data !== _t); )
1936
+ s = /* @__PURE__ */ se(s);
1922
1937
  if (!s)
1923
- throw Se;
1924
- Te(!0), G(
1938
+ throw ke;
1939
+ Se(!0), G(
1925
1940
  /** @type {Comment} */
1926
1941
  s
1927
1942
  );
1928
- const l = Hn(e, { ...t, anchor: s });
1929
- return Te(!1), /** @type {Exports} */
1943
+ const l = Vn(e, { ...t, anchor: s });
1944
+ return Se(!1), /** @type {Exports} */
1930
1945
  l;
1931
1946
  } catch (l) {
1932
1947
  if (l instanceof Error && l.message.split(`
1933
1948
  `).some((o) => o.startsWith("https://svelte.dev/e/")))
1934
1949
  throw l;
1935
- return l !== Se && console.warn("Failed to hydrate: ", l), t.recover === !1 && _r(), ut(), Vr(n), Te(!1), jn(e, t);
1950
+ return l !== ke && console.warn("Failed to hydrate: ", l), t.recover === !1 && gr(), ht(), Yr(n), Se(!1), Bn(e, t);
1936
1951
  } finally {
1937
- Te(r), G(i);
1952
+ Se(r), G(i);
1938
1953
  }
1939
1954
  }
1940
1955
  const Ye = /* @__PURE__ */ new Map();
1941
- function Hn(e, { target: t, anchor: n, props: r = {}, events: i, context: s, intro: l = !0 }) {
1942
- ut();
1943
- var o = /* @__PURE__ */ new Set(), a = (d) => {
1944
- for (var u = 0; u < d.length; u++) {
1945
- var h = d[u];
1946
- if (!o.has(h)) {
1947
- o.add(h);
1948
- var v = ai(h);
1949
- for (const Q of [t, document]) {
1950
- var w = Ye.get(Q);
1951
- w === void 0 && (w = /* @__PURE__ */ new Map(), Ye.set(Q, w));
1952
- var N = w.get(h);
1953
- N === void 0 ? (Q.addEventListener(h, jt, { passive: v }), w.set(h, 1)) : w.set(h, N + 1);
1954
- }
1955
- }
1956
- }
1957
- };
1958
- a(er(Dn)), ct.add(a);
1959
- var f = void 0, c = Kr(() => {
1960
- var d = n ?? t.appendChild(ie());
1961
- return Rr(
1956
+ function Vn(e, { target: t, anchor: n, props: r = {}, events: i, context: s, intro: l = !0 }) {
1957
+ ht();
1958
+ var o = void 0, a = Xr(() => {
1959
+ var f = n ?? t.appendChild(re());
1960
+ Or(
1962
1961
  /** @type {TemplateNode} */
1963
- d,
1962
+ f,
1964
1963
  {
1965
1964
  pending: () => {
1966
1965
  }
1967
1966
  },
1968
1967
  (u) => {
1969
- tn({});
1968
+ rn({});
1970
1969
  var h = (
1971
1970
  /** @type {ComponentContext} */
1972
1971
  F
1973
1972
  );
1974
- if (s && (h.c = s), i && (r.$$events = i), y && ye(
1973
+ if (s && (h.c = s), i && (r.$$events = i), b && $e(
1975
1974
  /** @type {TemplateNode} */
1976
1975
  u,
1977
1976
  null
1978
- ), f = e(u, r) || {}, y && (g.nodes.end = m, m === null || m.nodeType !== He || /** @type {Comment} */
1979
- m.data !== Ut))
1980
- throw et(), Se;
1981
- nn();
1977
+ ), o = e(u, r) || {}, b && (g.nodes.end = m, m === null || m.nodeType !== et || /** @type {Comment} */
1978
+ m.data !== Kt))
1979
+ throw tt(), ke;
1980
+ sn();
1982
1981
  }
1983
- ), () => {
1984
- for (var u of o)
1985
- for (const w of [t, document]) {
1982
+ );
1983
+ var c = /* @__PURE__ */ new Set(), v = (u) => {
1984
+ for (var h = 0; h < u.length; h++) {
1985
+ var d = u[h];
1986
+ if (!c.has(d)) {
1987
+ c.add(d);
1988
+ var y = ui(d);
1989
+ for (const Q of [t, document]) {
1990
+ var S = Ye.get(Q);
1991
+ S === void 0 && (S = /* @__PURE__ */ new Map(), Ye.set(Q, S));
1992
+ var le = S.get(d);
1993
+ le === void 0 ? (Q.addEventListener(d, Vt, { passive: y }), S.set(d, 1)) : S.set(d, le + 1);
1994
+ }
1995
+ }
1996
+ }
1997
+ };
1998
+ return v(nr(Fn)), dt.add(v), () => {
1999
+ for (var u of c)
2000
+ for (const y of [t, document]) {
1986
2001
  var h = (
1987
2002
  /** @type {Map<string, number>} */
1988
- Ye.get(w)
1989
- ), v = (
2003
+ Ye.get(y)
2004
+ ), d = (
1990
2005
  /** @type {number} */
1991
2006
  h.get(u)
1992
2007
  );
1993
- --v == 0 ? (w.removeEventListener(u, jt), h.delete(u), h.size === 0 && Ye.delete(w)) : h.set(u, v);
2008
+ --d == 0 ? (y.removeEventListener(u, Vt), h.delete(u), h.size === 0 && Ye.delete(y)) : h.set(u, d);
1994
2009
  }
1995
- ct.delete(a), d !== n && d.parentNode?.removeChild(d);
2010
+ dt.delete(v), f !== n && f.parentNode?.removeChild(f);
1996
2011
  };
1997
2012
  });
1998
- return ht.set(f, c), f;
2013
+ return vt.set(o, a), o;
1999
2014
  }
2000
- let ht = /* @__PURE__ */ new WeakMap();
2001
- function ci(e, t) {
2002
- const n = ht.get(e);
2003
- return n ? (ht.delete(e), n(t)) : Promise.resolve();
2015
+ let vt = /* @__PURE__ */ new WeakMap();
2016
+ function di(e, t) {
2017
+ const n = vt.get(e);
2018
+ return n ? (vt.delete(e), n(t)) : Promise.resolve();
2004
2019
  }
2005
- class hi {
2020
+ class vi {
2006
2021
  /** @type {TemplateNode} */
2007
2022
  anchor;
2008
2023
  /** @type {Map<Batch, Key>} */
@@ -2032,20 +2047,20 @@ class hi {
2032
2047
  * Keys of effects that are currently outroing
2033
2048
  * @type {Set<Key>}
2034
2049
  */
2035
- #l = /* @__PURE__ */ new Set();
2050
+ #s = /* @__PURE__ */ new Set();
2036
2051
  /**
2037
2052
  * Whether to pause (i.e. outro) on change, or destroy immediately.
2038
2053
  * This is necessary for `<svelte:element>`
2039
2054
  */
2040
- #o = !0;
2055
+ #l = !0;
2041
2056
  /**
2042
2057
  * @param {TemplateNode} anchor
2043
2058
  * @param {boolean} transition
2044
2059
  */
2045
2060
  constructor(t, n = !0) {
2046
- this.anchor = t, this.#o = n;
2061
+ this.anchor = t, this.#l = n;
2047
2062
  }
2048
- #i = () => {
2063
+ #o = () => {
2049
2064
  var t = (
2050
2065
  /** @type {Batch} */
2051
2066
  $
@@ -2056,7 +2071,7 @@ class hi {
2056
2071
  this.#e.get(t)
2057
2072
  ), r = this.#t.get(n);
2058
2073
  if (r)
2059
- Qr(r), this.#l.delete(n);
2074
+ ti(r), this.#s.delete(n);
2060
2075
  else {
2061
2076
  var i = this.#n.get(n);
2062
2077
  i && (this.#t.set(n, i.effect), this.#n.delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect);
@@ -2068,16 +2083,16 @@ class hi {
2068
2083
  o && (O(o.effect), this.#n.delete(l));
2069
2084
  }
2070
2085
  for (const [s, l] of this.#t) {
2071
- if (s === n || this.#l.has(s)) continue;
2086
+ if (s === n || this.#s.has(s)) continue;
2072
2087
  const o = () => {
2073
2088
  if (Array.from(this.#e.values()).includes(s)) {
2074
2089
  var f = document.createDocumentFragment();
2075
- zn(l, f), f.append(ie()), this.#n.set(s, { effect: l, fragment: f });
2090
+ Nn(l, f), f.append(re()), this.#n.set(s, { effect: l, fragment: f });
2076
2091
  } else
2077
2092
  O(l);
2078
- this.#l.delete(s), this.#t.delete(s);
2093
+ this.#s.delete(s), this.#t.delete(s);
2079
2094
  };
2080
- this.#o || !r ? (this.#l.add(s), Le(l, o, !1)) : o();
2095
+ this.#l || !r ? (this.#s.add(s), Fe(l, o, !1)) : o();
2081
2096
  }
2082
2097
  }
2083
2098
  };
@@ -2099,53 +2114,53 @@ class hi {
2099
2114
  var r = (
2100
2115
  /** @type {Batch} */
2101
2116
  $
2102
- ), i = qr();
2117
+ ), i = Ur();
2103
2118
  if (n && !this.#t.has(t) && !this.#n.has(t))
2104
2119
  if (i) {
2105
- var s = document.createDocumentFragment(), l = ie();
2120
+ var s = document.createDocumentFragment(), l = re();
2106
2121
  s.append(l), this.#n.set(t, {
2107
- effect: te(() => n(l)),
2122
+ effect: ae(() => n(l)),
2108
2123
  fragment: s
2109
2124
  });
2110
2125
  } else
2111
2126
  this.#t.set(
2112
2127
  t,
2113
- te(() => n(this.anchor))
2128
+ ae(() => n(this.anchor))
2114
2129
  );
2115
2130
  if (this.#e.set(r, t), i) {
2116
2131
  for (const [o, a] of this.#t)
2117
2132
  o === t ? r.unskip_effect(a) : r.skip_effect(a);
2118
2133
  for (const [o, a] of this.#n)
2119
2134
  o === t ? r.unskip_effect(a.effect) : r.skip_effect(a.effect);
2120
- r.oncommit(this.#i), r.ondiscard(this.#r);
2135
+ r.oncommit(this.#o), r.ondiscard(this.#r);
2121
2136
  } else
2122
- y && (this.anchor = m), this.#i();
2137
+ b && (this.anchor = m), this.#o();
2123
2138
  }
2124
2139
  }
2125
- function it(e, t, n = !1) {
2126
- y && pt();
2127
- var r = new hi(e), i = n ? ze : 0;
2140
+ function st(e, t, n = !1) {
2141
+ b && mt();
2142
+ var r = new vi(e), i = n ? Ae : 0;
2128
2143
  function s(l, o) {
2129
- if (y) {
2130
- const c = $r(e);
2144
+ if (b) {
2145
+ const c = Tr(e);
2131
2146
  var a;
2132
- if (c === dt ? a = 0 : c === vt ? a = !1 : a = parseInt(c.substring(1)), l !== a) {
2133
- var f = Qt();
2134
- G(f), r.anchor = f, Te(!1), r.ensure(l, o), Te(!0);
2147
+ if (c === _t ? a = 0 : c === pt ? a = !1 : a = parseInt(c.substring(1)), l !== a) {
2148
+ var f = tn();
2149
+ G(f), r.anchor = f, Se(!1), r.ensure(l, o), Se(!0);
2135
2150
  return;
2136
2151
  }
2137
2152
  }
2138
2153
  r.ensure(l, o);
2139
2154
  }
2140
- En(() => {
2155
+ Sn(() => {
2141
2156
  var l = !1;
2142
2157
  t((o, a = 0) => {
2143
2158
  l = !0, s(a, o);
2144
2159
  }), l || s(!1, null);
2145
2160
  }, i);
2146
2161
  }
2147
- function di(e, t) {
2148
- $n(() => {
2162
+ function _i(e, t) {
2163
+ Tn(() => {
2149
2164
  var n = e.getRootNode(), r = (
2150
2165
  /** @type {ShadowRoot} */
2151
2166
  n.host ? (
@@ -2158,14 +2173,14 @@ function di(e, t) {
2158
2173
  )
2159
2174
  );
2160
2175
  if (!r.querySelector("#" + t.hash)) {
2161
- const i = bt("style");
2176
+ const i = $t("style");
2162
2177
  i.id = t.hash, i.textContent = t.code, r.appendChild(i);
2163
2178
  }
2164
2179
  });
2165
2180
  }
2166
- const Ht = [...`
2181
+ const qt = [...`
2167
2182
  \r\f \v\uFEFF`];
2168
- function vi(e, t, n) {
2183
+ function pi(e, t, n) {
2169
2184
  var r = e == null ? "" : "" + e;
2170
2185
  if (r = r ? r + " " + t : t, n) {
2171
2186
  for (var i in n)
@@ -2174,16 +2189,16 @@ function vi(e, t, n) {
2174
2189
  else if (r.length)
2175
2190
  for (var s = i.length, l = 0; (l = r.indexOf(i, l)) >= 0; ) {
2176
2191
  var o = l + s;
2177
- (l === 0 || Ht.includes(r[l - 1])) && (o === r.length || Ht.includes(r[o])) ? r = (l === 0 ? "" : r.substring(0, l)) + r.substring(o + 1) : l = o;
2192
+ (l === 0 || qt.includes(r[l - 1])) && (o === r.length || qt.includes(r[o])) ? r = (l === 0 ? "" : r.substring(0, l)) + r.substring(o + 1) : l = o;
2178
2193
  }
2179
2194
  }
2180
2195
  return r === "" ? null : r;
2181
2196
  }
2182
- function Bt(e, t, n, r, i, s) {
2197
+ function Yt(e, t, n, r, i, s) {
2183
2198
  var l = e.__className;
2184
- if (y || l !== n || l === void 0) {
2185
- var o = vi(n, r, s);
2186
- (!y || o !== e.getAttribute("class")) && (o == null ? e.removeAttribute("class") : e.className = o), e.__className = n;
2199
+ if (b || l !== n || l === void 0) {
2200
+ var o = pi(n, r, s);
2201
+ (!b || o !== e.getAttribute("class")) && (o == null ? e.removeAttribute("class") : e.className = o), e.__className = n;
2187
2202
  } else if (s && i !== s)
2188
2203
  for (var a in s) {
2189
2204
  var f = !!s[a];
@@ -2191,52 +2206,52 @@ function Bt(e, t, n, r, i, s) {
2191
2206
  }
2192
2207
  return s;
2193
2208
  }
2194
- const _i = /* @__PURE__ */ Symbol("is custom element"), pi = /* @__PURE__ */ Symbol("is html"), gi = fr ? "link" : "LINK";
2195
- function Vt(e, t, n, r) {
2196
- var i = mi(e);
2197
- y && (i[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === gi) || i[t] !== (i[t] = n) && (t === "loading" && (e[ar] = n), n == null ? e.removeAttribute(t) : typeof n != "string" && wi(e).includes(t) ? e[t] = n : e.setAttribute(t, n));
2209
+ const gi = /* @__PURE__ */ Symbol("is custom element"), mi = /* @__PURE__ */ Symbol("is html"), wi = cr ? "link" : "LINK";
2210
+ function Ut(e, t, n, r) {
2211
+ var i = bi(e);
2212
+ b && (i[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === wi) || i[t] !== (i[t] = n) && (t === "loading" && (e[ur] = n), n == null ? e.removeAttribute(t) : typeof n != "string" && yi(e).includes(t) ? e[t] = n : e.setAttribute(t, n));
2198
2213
  }
2199
- function mi(e) {
2214
+ function bi(e) {
2200
2215
  return (
2201
2216
  /** @type {Record<string | symbol, unknown>} **/
2202
2217
  // @ts-expect-error
2203
2218
  e.__attributes ??= {
2204
- [_i]: e.nodeName.includes("-"),
2205
- [pi]: e.namespaceURI === Gt
2219
+ [gi]: e.nodeName.includes("-"),
2220
+ [mi]: e.namespaceURI === Jt
2206
2221
  }
2207
2222
  );
2208
2223
  }
2209
- var qt = /* @__PURE__ */ new Map();
2210
- function wi(e) {
2211
- var t = e.getAttribute("is") || e.nodeName, n = qt.get(t);
2224
+ var Gt = /* @__PURE__ */ new Map();
2225
+ function yi(e) {
2226
+ var t = e.getAttribute("is") || e.nodeName, n = Gt.get(t);
2212
2227
  if (n) return n;
2213
- qt.set(t, n = []);
2228
+ Gt.set(t, n = []);
2214
2229
  for (var r, i = e, s = Element.prototype; s !== i; ) {
2215
- r = tr(i);
2230
+ r = rr(i);
2216
2231
  for (var l in r)
2217
2232
  r[l].set && n.push(l);
2218
- i = Wt(i);
2233
+ i = Xt(i);
2219
2234
  }
2220
2235
  return n;
2221
2236
  }
2222
- function Yt(e, t) {
2237
+ function Wt(e, t) {
2223
2238
  return e === t || e?.[Ue] === t;
2224
2239
  }
2225
- function bi(e = {}, t, n, r) {
2226
- return $n(() => {
2240
+ function $i(e = {}, t, n, r) {
2241
+ return Tn(() => {
2227
2242
  var i, s;
2228
- return Et(() => {
2229
- i = s, s = [], Pn(() => {
2230
- e !== n(...s) && (t(e, ...s), i && Yt(n(...i), e) && t(null, ...i));
2243
+ return St(() => {
2244
+ i = s, s = [], Ln(() => {
2245
+ e !== n(...s) && (t(e, ...s), i && Wt(n(...i), e) && t(null, ...i));
2231
2246
  });
2232
2247
  }), () => {
2233
- ge(() => {
2234
- s && Yt(n(...s), e) && t(null, ...s);
2248
+ me(() => {
2249
+ s && Wt(n(...s), e) && t(null, ...s);
2235
2250
  });
2236
2251
  };
2237
2252
  }), e;
2238
2253
  }
2239
- function he(e, t, n, r) {
2254
+ function de(e, t, n, r) {
2240
2255
  var i = (
2241
2256
  /** @type {V} */
2242
2257
  r
@@ -2252,7 +2267,7 @@ function he(e, t, n, r) {
2252
2267
  );
2253
2268
  return u === void 0 ? l() : (s = !0, u);
2254
2269
  };
2255
- var f = !1, c = /* @__PURE__ */ mt(() => (f = !1, a())), d = (
2270
+ var f = !1, c = /* @__PURE__ */ bt(() => (f = !1, a())), v = (
2256
2271
  /** @type {Effect} */
2257
2272
  g
2258
2273
  );
@@ -2260,17 +2275,17 @@ function he(e, t, n, r) {
2260
2275
  /** @type {() => V} */
2261
2276
  (function(u, h) {
2262
2277
  if (arguments.length > 0) {
2263
- const v = h ? p(c) : u;
2264
- return b(c, v), f = !0, i !== void 0 && (i = v), u;
2278
+ const d = h ? p(c) : u;
2279
+ return w(c, d), f = !0, i !== void 0 && (i = d), u;
2265
2280
  }
2266
- return ue && f || (d.f & ne) !== 0 ? c.v : p(c);
2281
+ return ce && f || (v.f & te) !== 0 ? c.v : p(c);
2267
2282
  })
2268
2283
  );
2269
2284
  }
2270
- function yi(e) {
2271
- return new $i(e);
2285
+ function Ei(e) {
2286
+ return new Ti(e);
2272
2287
  }
2273
- class $i {
2288
+ class Ti {
2274
2289
  /** @type {any} */
2275
2290
  #e;
2276
2291
  /** @type {Record<string, any>} */
@@ -2282,7 +2297,7 @@ class $i {
2282
2297
  */
2283
2298
  constructor(t) {
2284
2299
  var n = /* @__PURE__ */ new Map(), r = (s, l) => {
2285
- var o = /* @__PURE__ */ jr(l, !1, !1);
2300
+ var o = /* @__PURE__ */ Br(l, !1, !1);
2286
2301
  return n.set(s, o), o;
2287
2302
  };
2288
2303
  const i = new Proxy(
@@ -2292,14 +2307,14 @@ class $i {
2292
2307
  return p(n.get(l) ?? r(l, Reflect.get(s, l)));
2293
2308
  },
2294
2309
  has(s, l) {
2295
- return l === or ? !0 : (p(n.get(l) ?? r(l, Reflect.get(s, l))), Reflect.has(s, l));
2310
+ return l === fr ? !0 : (p(n.get(l) ?? r(l, Reflect.get(s, l))), Reflect.has(s, l));
2296
2311
  },
2297
2312
  set(s, l, o) {
2298
- return b(n.get(l) ?? r(l, o), o), Reflect.set(s, l, o);
2313
+ return w(n.get(l) ?? r(l, o), o), Reflect.set(s, l, o);
2299
2314
  }
2300
2315
  }
2301
2316
  );
2302
- this.#t = (t.hydrate ? ui : jn)(t.component, {
2317
+ this.#t = (t.hydrate ? hi : Bn)(t.component, {
2303
2318
  target: t.target,
2304
2319
  anchor: t.anchor,
2305
2320
  props: i,
@@ -2322,7 +2337,7 @@ class $i {
2322
2337
  (s) => {
2323
2338
  Object.assign(i, s);
2324
2339
  }, this.#t.$destroy = () => {
2325
- ci(this.#t);
2340
+ di(this.#t);
2326
2341
  };
2327
2342
  }
2328
2343
  /** @param {Record<string, any>} props */
@@ -2348,8 +2363,8 @@ class $i {
2348
2363
  this.#t.$destroy();
2349
2364
  }
2350
2365
  }
2351
- let Bn;
2352
- typeof HTMLElement == "function" && (Bn = class extends HTMLElement {
2366
+ let qn;
2367
+ typeof HTMLElement == "function" && (qn = class extends HTMLElement {
2353
2368
  /** The Svelte component constructor */
2354
2369
  $$ctor;
2355
2370
  /** Slots */
@@ -2407,13 +2422,13 @@ typeof HTMLElement == "function" && (Bn = class extends HTMLElement {
2407
2422
  if (this.$$cn = !0, !this.$$c) {
2408
2423
  let e = function(r) {
2409
2424
  return (i) => {
2410
- const s = bt("slot");
2411
- r !== "default" && (s.name = r), de(i, s);
2425
+ const s = $t("slot");
2426
+ r !== "default" && (s.name = r), ve(i, s);
2412
2427
  };
2413
2428
  };
2414
2429
  if (await Promise.resolve(), !this.$$cn || this.$$c)
2415
2430
  return;
2416
- const t = {}, n = Ei(this);
2431
+ const t = {}, n = Si(this);
2417
2432
  for (const r of this.$$s)
2418
2433
  r in n && (r === "default" && !this.$$d.children ? (this.$$d.children = e(r), t.default = !0) : t[r] = e(r));
2419
2434
  for (const r of this.attributes) {
@@ -2422,7 +2437,7 @@ typeof HTMLElement == "function" && (Bn = class extends HTMLElement {
2422
2437
  }
2423
2438
  for (const r in this.$$p_d)
2424
2439
  !(r in this.$$d) && this[r] !== void 0 && (this.$$d[r] = this[r], delete this[r]);
2425
- this.$$c = yi({
2440
+ this.$$c = Ei({
2426
2441
  component: this.$$ctor,
2427
2442
  target: this.$$shadowRoot || this,
2428
2443
  props: {
@@ -2430,8 +2445,8 @@ typeof HTMLElement == "function" && (Bn = class extends HTMLElement {
2430
2445
  $$slots: t,
2431
2446
  $$host: this
2432
2447
  }
2433
- }), this.$$me = Wr(() => {
2434
- Et(() => {
2448
+ }), this.$$me = Jr(() => {
2449
+ St(() => {
2435
2450
  this.$$r = !0;
2436
2451
  for (const r of Ke(this.$$c)) {
2437
2452
  if (!this.$$p_d[r]?.reflect) continue;
@@ -2509,7 +2524,7 @@ function We(e, t, n, r) {
2509
2524
  return t;
2510
2525
  }
2511
2526
  }
2512
- function Ei(e) {
2527
+ function Si(e) {
2513
2528
  const t = {};
2514
2529
  return e.childNodes.forEach((n) => {
2515
2530
  t[
@@ -2518,8 +2533,8 @@ function Ei(e) {
2518
2533
  ] = !0;
2519
2534
  }), t;
2520
2535
  }
2521
- function Ti(e, t, n, r, i, s) {
2522
- let l = class extends Bn {
2536
+ function xi(e, t, n, r, i, s) {
2537
+ let l = class extends qn {
2523
2538
  constructor() {
2524
2539
  super(e, n, i), this.$$p_d = t;
2525
2540
  }
@@ -2552,8 +2567,8 @@ function Ti(e, t, n, r, i, s) {
2552
2567
  }), e.element = /** @type {any} */
2553
2568
  l, l;
2554
2569
  }
2555
- var xi = /* @__PURE__ */ xt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="tts-inline__icon svelte-18mzc0g" aria-hidden="true"><path d="M8 5v14l11-7z" class="svelte-18mzc0g"></path></svg>'), Si = /* @__PURE__ */ xt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="tts-inline__icon svelte-18mzc0g" aria-hidden="true"><path d="M6 19h4V5H6v14zm8-14v14h4V5h-4z" class="svelte-18mzc0g"></path></svg>'), ki = /* @__PURE__ */ xt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="tts-inline__icon svelte-18mzc0g" aria-hidden="true"><path d="M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z" class="svelte-18mzc0g"></path></svg>'), zi = /* @__PURE__ */ Fn('<button type="button" aria-label="Stop reading"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="tts-inline__icon svelte-18mzc0g" aria-hidden="true"><path d="M6 6h12v12H6z" class="svelte-18mzc0g"></path></svg></button>'), Ai = /* @__PURE__ */ Fn('<div class="tts-inline-controls svelte-18mzc0g"><button type="button"><!></button> <!> <div class="sr-only svelte-18mzc0g" role="status" aria-live="polite" aria-atomic="true"> </div></div>');
2556
- const Ni = {
2570
+ var ki = /* @__PURE__ */ kt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="tts-inline__icon svelte-18mzc0g" aria-hidden="true"><path d="M8 5v14l11-7z" class="svelte-18mzc0g"></path></svg>'), zi = /* @__PURE__ */ kt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="tts-inline__icon svelte-18mzc0g" aria-hidden="true"><path d="M6 19h4V5H6v14zm8-14v14h4V5h-4z" class="svelte-18mzc0g"></path></svg>'), Ai = /* @__PURE__ */ kt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="tts-inline__icon svelte-18mzc0g" aria-hidden="true"><path d="M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z" class="svelte-18mzc0g"></path></svg>'), Ni = /* @__PURE__ */ Hn('<button type="button" aria-label="Stop reading"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="tts-inline__icon svelte-18mzc0g" aria-hidden="true"><path d="M6 6h12v12H6z" class="svelte-18mzc0g"></path></svg></button>'), Ri = /* @__PURE__ */ Hn('<div class="tts-inline-controls svelte-18mzc0g"><button type="button"><!></button> <!> <div class="sr-only svelte-18mzc0g" role="status" aria-live="polite" aria-atomic="true"> </div></div>');
2571
+ const Ci = {
2557
2572
  hash: "svelte-18mzc0g",
2558
2573
  code: `.tts-inline-controls.svelte-18mzc0g {display:inline-flex;align-items:center;gap:0.25rem;}.tts-inline.svelte-18mzc0g {display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--pie-border, #ccc);background-color:var(--pie-background, white);color:var(--pie-text, #333);border-radius:4px;cursor:pointer;transition:background-color 0.15s ease,
2559
2574
  transform 0.1s ease,
@@ -2583,66 +2598,66 @@ const Ni = {
2583
2598
  animation: none !important;transition:none !important;}
2584
2599
  }`
2585
2600
  };
2586
- function Ri(e, t) {
2587
- tn(t, !0), di(e, Ni);
2588
- let n = he(t, "toolId", 7, "tts-inline"), r = he(
2601
+ function Oi(e, t) {
2602
+ rn(t, !0), _i(e, Ci);
2603
+ let n = de(t, "toolId", 7, "tts-inline"), r = de(
2589
2604
  t,
2590
2605
  "catalogId",
2591
2606
  7,
2592
2607
  ""
2593
2608
  // Explicit catalog ID
2594
- ), i = he(t, "language", 7, "en-US"), s = he(t, "size", 7, "md"), l = he(t, "coordinator"), o = he(t, "ttsService"), a = he(t, "highlightCoordinator");
2609
+ ), i = de(t, "language", 7, "en-US"), s = de(t, "size", 7, "md"), l = de(t, "coordinator"), o = de(t, "ttsService"), a = de(t, "highlightCoordinator");
2595
2610
  const f = typeof window < "u";
2596
- let c = /* @__PURE__ */ M(void 0), d = /* @__PURE__ */ M(!1), u = /* @__PURE__ */ M(!1), h = /* @__PURE__ */ M(!1), v = /* @__PURE__ */ M("");
2597
- Mt(() => {
2598
- l() && n() && p(c) && !p(d) && (l().registerTool(n(), "TTS Inline", p(c), Kn.TOOL), b(d, !0));
2599
- }), Mt(() => () => {
2611
+ let c = /* @__PURE__ */ M(void 0), v = /* @__PURE__ */ M(!1), u = /* @__PURE__ */ M(!1), h = /* @__PURE__ */ M(!1), d = /* @__PURE__ */ M("");
2612
+ Pt(() => {
2613
+ l() && n() && p(c) && !p(v) && (l().registerTool(n(), "TTS Inline", p(c), Xn.TOOL), w(v, !0));
2614
+ }), Pt(() => () => {
2600
2615
  l() && n() && l().unregisterTool(n());
2601
2616
  });
2602
- async function w() {
2617
+ async function y() {
2603
2618
  if (o()) {
2604
2619
  if (p(h)) {
2605
- o().resume(), b(h, !1), b(v, "Reading resumed");
2620
+ o().resume(), w(h, !1), w(d, "Reading resumed");
2606
2621
  return;
2607
2622
  }
2608
2623
  if (p(u) && !p(h)) {
2609
- o().pause(), b(h, !0), b(v, "Reading paused");
2624
+ o().pause(), w(h, !0), w(d, "Reading paused");
2610
2625
  return;
2611
2626
  }
2612
2627
  try {
2613
- b(u, !0), b(h, !1), b(v, "Reading started");
2628
+ w(u, !0), w(h, !1), w(d, "Reading started");
2614
2629
  const E = p(c)?.closest(".passage-header, .item-header");
2615
2630
  let H = null;
2616
2631
  if (E && (H = E.parentElement?.querySelector(".passage-content, .item-content") || null), H || (H = p(c)?.closest(".passage-content, .item-content") || null), !H) {
2617
- console.warn("[TTS Inline] No target container found"), b(u, !1);
2632
+ console.warn("[TTS Inline] No target container found"), w(u, !1);
2618
2633
  return;
2619
2634
  }
2620
2635
  const B = document.createRange();
2621
2636
  B.selectNodeContents(H);
2622
- const Ie = B.toString(), Ee = Ie.trim().replace(/\s+/g, " ");
2637
+ const Ie = B.toString(), Te = Ie.trim().replace(/\s+/g, " ");
2623
2638
  if (console.log("[TTS Inline] Text extraction:", {
2624
2639
  rawLength: Ie.length,
2625
- normalizedLength: Ee.length,
2626
- preview: Ee.substring(0, 100)
2627
- }), !Ee) {
2628
- console.warn("[TTS Inline] No text content found"), b(u, !1);
2640
+ normalizedLength: Te.length,
2641
+ preview: Te.substring(0, 100)
2642
+ }), !Te) {
2643
+ console.warn("[TTS Inline] No text content found"), w(u, !1);
2629
2644
  return;
2630
2645
  }
2631
- a() && o().setHighlightCoordinator && o().setHighlightCoordinator(a()), await o().speak(Ee, {
2646
+ a() && o().setHighlightCoordinator && o().setHighlightCoordinator(a()), await o().speak(Te, {
2632
2647
  catalogId: r() || void 0,
2633
2648
  language: i(),
2634
2649
  contentElement: H
2635
- }), b(u, !1), b(h, !1), a() && a().clearTTS();
2650
+ }), w(u, !1), w(h, !1), a() && a().clearTTS();
2636
2651
  } catch (E) {
2637
- console.error("[TTS Inline] Error:", E), b(u, !1), b(h, !1), a() && a().clearTTS();
2652
+ console.error("[TTS Inline] Error:", E), w(u, !1), w(h, !1), a() && a().clearTTS();
2638
2653
  }
2639
2654
  }
2640
2655
  }
2641
- function N() {
2642
- o() && (o().stop(), b(u, !1), b(h, !1), b(v, "Reading stopped"), a() && a().clearTTS());
2656
+ function S() {
2657
+ o() && (o().stop(), w(u, !1), w(h, !1), w(d, "Reading stopped"), a() && a().clearTTS());
2643
2658
  }
2644
- const Q = /* @__PURE__ */ Pr(() => s() === "sm" ? "tts-inline--sm" : s() === "lg" ? "tts-inline--lg" : "tts-inline--md");
2645
- var Oe = {
2659
+ const le = /* @__PURE__ */ Lr(() => s() === "sm" ? "tts-inline--sm" : s() === "lg" ? "tts-inline--lg" : "tts-inline--md");
2660
+ var Q = {
2646
2661
  get toolId() {
2647
2662
  return n();
2648
2663
  },
@@ -2685,58 +2700,57 @@ function Ri(e, t) {
2685
2700
  set highlightCoordinator(E) {
2686
2701
  a(E), oe();
2687
2702
  }
2688
- }, St = li(), Vn = Br(St);
2703
+ }, zt = ai(), Yn = qr(zt);
2689
2704
  {
2690
- var qn = (E) => {
2691
- var H = Ai(), B = rt(H);
2705
+ var Un = (E) => {
2706
+ var H = Ri(), B = it(H);
2692
2707
  let Ie;
2693
- B.__click = w;
2694
- var Ee = rt(B);
2708
+ var Te = it(B);
2695
2709
  {
2696
- var kt = (A) => {
2697
- var W = xi();
2698
- de(A, W);
2699
- }, Yn = (A) => {
2700
- var W = Si();
2701
- de(A, W);
2702
- }, Un = (A) => {
2710
+ var At = (N) => {
2703
2711
  var W = ki();
2704
- de(A, W);
2712
+ ve(N, W);
2713
+ }, Gn = (N) => {
2714
+ var W = zi();
2715
+ ve(N, W);
2716
+ }, Wn = (N) => {
2717
+ var W = Ai();
2718
+ ve(N, W);
2705
2719
  };
2706
- it(Ee, (A) => {
2707
- p(h) ? A(kt) : p(u) ? A(Yn, 1) : A(Un, !1);
2720
+ st(Te, (N) => {
2721
+ p(h) ? N(At) : p(u) ? N(Gn, 1) : N(Wn, !1);
2708
2722
  });
2709
2723
  }
2710
- nt(B);
2711
- var zt = It(B, 2);
2724
+ rt(B);
2725
+ var Nt = Dt(B, 2);
2712
2726
  {
2713
- var Gn = (A) => {
2714
- var W = zi();
2715
- W.__click = N, Pt(() => {
2716
- Bt(W, 1, `tts-inline tts-inline--stop ${p(Q) ?? ""}`, "svelte-18mzc0g"), W.disabled = !o();
2717
- }), de(A, W);
2727
+ var Kn = (N) => {
2728
+ var W = Ni();
2729
+ Lt(() => {
2730
+ Yt(W, 1, `tts-inline tts-inline--stop ${p(le) ?? ""}`, "svelte-18mzc0g"), W.disabled = !o();
2731
+ }), Ht("click", W, S), ve(N, W);
2718
2732
  };
2719
- it(zt, (A) => {
2720
- (p(u) || p(h)) && A(Gn);
2733
+ st(Nt, (N) => {
2734
+ (p(u) || p(h)) && N(Kn);
2721
2735
  });
2722
2736
  }
2723
- var At = It(zt, 2), Wn = rt(At, !0);
2724
- nt(At), nt(H), bi(H, (A) => b(c, A), () => p(c)), Pt(() => {
2725
- Ie = Bt(B, 1, `tts-inline ${p(Q) ?? ""}`, "svelte-18mzc0g", Ie, {
2737
+ var Rt = Dt(Nt, 2), Jn = it(Rt, !0);
2738
+ rt(Rt), rt(H), $i(H, (N) => w(c, N), () => p(c)), Lt(() => {
2739
+ Ie = Yt(B, 1, `tts-inline ${p(le) ?? ""}`, "svelte-18mzc0g", Ie, {
2726
2740
  "tts-inline--speaking": p(u),
2727
2741
  "tts-inline--paused": p(h)
2728
- }), Vt(B, "aria-label", p(h) ? "Resume reading" : p(u) ? "Pause reading" : "Read aloud"), Vt(B, "aria-pressed", p(u) || p(h)), B.disabled = !o(), fi(Wn, p(v));
2729
- }), de(E, H);
2742
+ }), Ut(B, "aria-label", p(h) ? "Resume reading" : p(u) ? "Pause reading" : "Read aloud"), Ut(B, "aria-pressed", p(u) || p(h)), B.disabled = !o(), ci(Jn, p(d));
2743
+ }), Ht("click", B, y), ve(E, H);
2730
2744
  };
2731
- it(Vn, (E) => {
2732
- f && E(qn);
2745
+ st(Yn, (E) => {
2746
+ f && E(Un);
2733
2747
  });
2734
2748
  }
2735
- return de(e, St), nn(Oe);
2749
+ return ve(e, zt), sn(Q);
2736
2750
  }
2737
- ni(["click"]);
2738
- customElements.define("pie-tool-tts-inline", Ti(
2739
- Ri,
2751
+ ii(["click"]);
2752
+ customElements.define("pie-tool-tts-inline", xi(
2753
+ Oi,
2740
2754
  {
2741
2755
  toolId: { attribute: "tool-id", type: "String" },
2742
2756
  catalogId: { attribute: "catalog-id", type: "String" },
@@ -2750,5 +2764,5 @@ customElements.define("pie-tool-tts-inline", Ti(
2750
2764
  []
2751
2765
  ));
2752
2766
  export {
2753
- Ri as default
2767
+ Oi as default
2754
2768
  };