@pie-players/pie-tool-tts-inline 0.3.2 → 0.3.4

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