@pie-players/pie-tool-text-to-speech 0.1.4 → 0.1.6

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