@pie-players/pie-tool-answer-eliminator 0.2.6 → 0.2.8

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