@pie-players/pie-tool-calculator-shared 1.0.0-beta.7 → 1.0.0-beta.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,10 +1,10 @@
1
1
  import { defineCustomElementSafely as En } from "@pie-players/pie-players-shared";
2
- import { coerceBooleanAttributes as Tn } from "@pie-players/pie-players-shared/ui/attribute-coercion";
3
- import { connectToolRuntimeContext as Sn, parseScopedToolId as xn } from "@pie-players/pie-assessment-toolkit/tools/registration";
2
+ import { coerceBooleanAttributes as xn } from "@pie-players/pie-players-shared/ui/attribute-coercion";
3
+ import { connectToolRuntimeContext as Tn, parseScopedToolId as Sn } from "@pie-players/pie-assessment-toolkit/tools/registration";
4
4
  import { resolveInterfaceI18n as An } from "@pie-players/pie-players-shared/i18n/provider";
5
5
  typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add("5");
6
6
  var ce = {}, M = /* @__PURE__ */ Symbol("uninitialized");
7
- var Cn = "http://www.w3.org/1999/xhtml", On = Array.isArray, Rn = Array.prototype.indexOf, ze = Array.prototype.includes, Mn = Array.from, _t = Object.keys, He = Object.defineProperty, me = Object.getOwnPropertyDescriptor, In = Object.getOwnPropertyDescriptors, Nn = Object.prototype, Pn = Array.prototype, yr = Object.getPrototypeOf, rr = Object.isExtensible, jn = () => {
7
+ var Cn = "http://www.w3.org/1999/xhtml", On = Array.isArray, Rn = Array.prototype.indexOf, ze = Array.prototype.includes, Mn = Array.from, _t = Object.keys, He = Object.defineProperty, we = Object.getOwnPropertyDescriptor, In = Object.getOwnPropertyDescriptors, Nn = Object.prototype, Pn = Array.prototype, yr = Object.getPrototypeOf, rr = Object.isExtensible, jn = () => {
8
8
  };
9
9
  function Ln(e) {
10
10
  for (var t = 0; t < e.length; t++) e[t]();
@@ -19,7 +19,7 @@ function mr() {
19
19
  reject: t
20
20
  };
21
21
  }
22
- var Es = 1 << 24, Y = 1024, z = 2048, be = 4096, qt = 8192, wr = 16384, Dt = 32768, Ot = 1 << 25, zt = 65536, Ts = 1 << 17, Ss = 1 << 18, Me = 1 << 19, qn = 1 << 20, nr = 1 << 21, Dn = 1 << 22, pt = 1 << 23, Pe = /* @__PURE__ */ Symbol("$state"), br = /* @__PURE__ */ Symbol("component"), $r = /* @__PURE__ */ Symbol("legacy props"), zn = /* @__PURE__ */ Symbol(""), Hn = /* @__PURE__ */ Symbol("proxy path"), kr = /* @__PURE__ */ Symbol("attributes"), Rt = /* @__PURE__ */ Symbol("class"), Fn = /* @__PURE__ */ Symbol("style"), Mt = /* @__PURE__ */ Symbol("text");
22
+ var Es = 1 << 24, Y = 1024, q = 2048, de = 4096, qt = 8192, wr = 16384, Dt = 32768, Ot = 1 << 25, zt = 65536, xs = 1 << 17, Ts = 1 << 18, Me = 1 << 19, qn = 1 << 20, nr = 1 << 21, Dn = 1 << 22, pt = 1 << 23, Pe = /* @__PURE__ */ Symbol("$state"), br = /* @__PURE__ */ Symbol("component"), $r = /* @__PURE__ */ Symbol("legacy props"), zn = /* @__PURE__ */ Symbol(""), Hn = /* @__PURE__ */ Symbol("proxy path"), kr = /* @__PURE__ */ Symbol("attributes"), Rt = /* @__PURE__ */ Symbol("class"), Fn = /* @__PURE__ */ Symbol("style"), Mt = /* @__PURE__ */ Symbol("text");
23
23
  var Ue = new class extends Error {
24
24
  name = "StaleReactionError";
25
25
  message = "The reaction that called `getAbortSignal()` was re-run or destroyed";
@@ -33,34 +33,34 @@ function wt(e) {
33
33
  function Yn() {
34
34
  console.warn("https://svelte.dev/e/svelte_boundary_reset_noop");
35
35
  }
36
- var A = !1;
37
- function Se(e) {
38
- A = e;
36
+ var x = !1;
37
+ function Te(e) {
38
+ x = e;
39
39
  }
40
- var C;
40
+ var A;
41
41
  function te(e) {
42
42
  if (e === null)
43
43
  throw wt(), ce;
44
- return C = e;
44
+ return A = e;
45
45
  }
46
46
  function Ht() {
47
- return te(/* @__PURE__ */ de(C));
47
+ return te(/* @__PURE__ */ ve(A));
48
48
  }
49
49
  function ft(e) {
50
- if (A) {
51
- if (/* @__PURE__ */ de(C) !== null)
50
+ if (x) {
51
+ if (/* @__PURE__ */ ve(A) !== null)
52
52
  throw wt(), ce;
53
- C = e;
53
+ A = e;
54
54
  }
55
55
  }
56
56
  function Vn(e = 1) {
57
- if (A) {
58
- for (var t = e, r = C; t--; ) r = /* @__PURE__ */ de(r);
59
- C = r;
57
+ if (x) {
58
+ for (var t = e, r = A; t--; ) r = /* @__PURE__ */ ve(r);
59
+ A = r;
60
60
  }
61
61
  }
62
62
  function Er(e = !0) {
63
- for (var t = 0, r = C; ; ) {
63
+ for (var t = 0, r = A; ; ) {
64
64
  if (r.nodeType === 8) {
65
65
  var n = r.data;
66
66
  if (n === "]") {
@@ -68,22 +68,22 @@ function Er(e = !0) {
68
68
  t -= 1;
69
69
  } else (n === "[" || n === "[!" || n[0] === "[" && !isNaN(Number(n.slice(1)))) && (t += 1);
70
70
  }
71
- var i = /* @__PURE__ */ de(r);
71
+ var i = /* @__PURE__ */ ve(r);
72
72
  e && r.remove(), r = i;
73
73
  }
74
74
  }
75
- function Tr(e) {
75
+ function xr(e) {
76
76
  if (!e || e.nodeType !== 8)
77
77
  throw wt(), ce;
78
78
  return e.data;
79
79
  }
80
- function Sr(e) {
80
+ function Tr(e) {
81
81
  return e === this.v;
82
82
  }
83
83
  function Gn(e, t) {
84
84
  return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function";
85
85
  }
86
- function xr(e) {
86
+ function Sr(e) {
87
87
  return !Gn(e, this.v);
88
88
  }
89
89
  function Kn(e) {
@@ -163,32 +163,32 @@ function Ut(e = {}) {
163
163
  function Ve() {
164
164
  return !Ye || T !== null && T.l === null;
165
165
  }
166
- var pe = [];
166
+ var ge = [];
167
167
  function Ar() {
168
- var e = pe;
169
- pe = [], Ln(e);
168
+ var e = ge;
169
+ ge = [], Ln(e);
170
170
  }
171
- function ge(e) {
172
- if (pe.length === 0 && !je) {
173
- var t = pe;
171
+ function ye(e) {
172
+ if (ge.length === 0 && !je) {
173
+ var t = ge;
174
174
  queueMicrotask(() => {
175
- t === pe && Ar();
175
+ t === ge && Ar();
176
176
  });
177
177
  }
178
- pe.push(e);
178
+ ge.push(e);
179
179
  }
180
180
  function li() {
181
- for (; pe.length > 0; ) Ar();
181
+ for (; ge.length > 0; ) Ar();
182
182
  }
183
- var oi = ~(z | be | Y);
184
- function x(e, t) {
183
+ var oi = ~(q | de | Y);
184
+ function O(e, t) {
185
185
  e.f = e.f & oi | t;
186
186
  }
187
187
  function Yt(e) {
188
- (e.f & 512) !== 0 || e.deps === null ? x(e, Y) : x(e, be);
188
+ (e.f & 512) !== 0 || e.deps === null ? O(e, Y) : O(e, de);
189
189
  }
190
- function Cr(e, t, r) {
191
- (e.f & 2048) !== 0 ? t.add(e) : (e.f & 4096) !== 0 && r.add(e), x(e, Y);
190
+ function Cr(e, t) {
191
+ (e.f & 2048) !== 0 ? t.set(e, q) : (e.f & 4096) !== 0 && t.get(e) !== 2048 && t.set(e, de), O(e, Y);
192
192
  }
193
193
  function bt(e) {
194
194
  var t = m, r = y;
@@ -206,10 +206,10 @@ function fi(e, t, r, n) {
206
206
  n(l);
207
207
  return;
208
208
  }
209
- var a = y, u = ui(), h = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((o) => o.promise)) : null;
209
+ var a = y, f = ui(), h = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((o) => o.promise)) : null;
210
210
  function g(o) {
211
211
  if ((a.f & 16384) === 0) {
212
- u();
212
+ f();
213
213
  try {
214
214
  n([...l, ...o]);
215
215
  } catch (d) {
@@ -223,7 +223,7 @@ function fi(e, t, r, n) {
223
223
  h.then(() => g([])).finally(c);
224
224
  return;
225
225
  }
226
- function f() {
226
+ function u() {
227
227
  Promise.all(r.map((o) => /* @__PURE__ */ di(o))).then(g).catch((o) => X(o, a)).finally(c);
228
228
  }
229
229
  h ? h.then(() => {
@@ -231,8 +231,8 @@ function fi(e, t, r, n) {
231
231
  c();
232
232
  return;
233
233
  }
234
- u(), f(), gt();
235
- }) : f();
234
+ f(), u(), gt();
235
+ }) : u();
236
236
  }
237
237
  function ui() {
238
238
  var e = y, t = m, r = T, n = w;
@@ -253,12 +253,12 @@ function Or() {
253
253
  }
254
254
  // @__NO_SIDE_EFFECTS__
255
255
  function Fe(e) {
256
- var t = 2 | z;
256
+ var t = 2 | q;
257
257
  return y !== null && (y.f |= Me), {
258
258
  ctx: T,
259
259
  deps: null,
260
260
  effects: null,
261
- equals: Sr,
261
+ equals: Tr,
262
262
  f: t,
263
263
  fn: e,
264
264
  reactions: null,
@@ -276,7 +276,7 @@ function di(e, t, r) {
276
276
  n === null && Wn();
277
277
  var i = void 0, s = Ge(M), l = !m, a = /* @__PURE__ */ new Set();
278
278
  return Oi(() => {
279
- var u = y, h = mr();
279
+ var f = y, h = mr();
280
280
  i = h.promise;
281
281
  try {
282
282
  Promise.resolve(e()).then(h.resolve, (o) => {
@@ -287,21 +287,21 @@ function di(e, t, r) {
287
287
  }
288
288
  var g = w;
289
289
  if (l) {
290
- if ((u.f & 32768) !== 0) var c = Or();
291
- if (n.b?.is_rendered()) g.async_deriveds.get(u)?.reject(Ne);
290
+ if ((f.f & 32768) !== 0) var c = Or();
291
+ if (n.b?.is_rendered()) g.async_deriveds.get(f)?.reject(Ne);
292
292
  else for (const o of a.values()) o.reject(Ne);
293
- a.add(h), g.async_deriveds.set(u, h);
293
+ a.add(h), g.async_deriveds.set(f, h);
294
294
  }
295
- const f = (o, d = void 0) => {
295
+ const u = (o, d = void 0) => {
296
296
  c?.(), a.delete(h), d !== Ne && (g.activate(), d ? (s.f |= pt, mt(s, d)) : ((s.f & 8388608) !== 0 && (s.f ^= pt), mt(s, o)), g.deactivate());
297
297
  };
298
- h.promise.then(f, (o) => f(null, o || "unknown"));
299
- }), xi(() => {
300
- for (const u of a) u.reject(Ne);
301
- }), new Promise((u) => {
298
+ h.promise.then(u, (o) => u(null, o || "unknown"));
299
+ }), Si(() => {
300
+ for (const f of a) f.reject(Ne);
301
+ }), new Promise((f) => {
302
302
  function h(g) {
303
303
  function c() {
304
- g === i ? u(s) : h(i);
304
+ g === i ? f(s) : h(i);
305
305
  }
306
306
  g.then(c, c);
307
307
  }
@@ -309,20 +309,20 @@ function di(e, t, r) {
309
309
  });
310
310
  }
311
311
  // @__NO_SIDE_EFFECTS__
312
- function he(e) {
312
+ function _e(e) {
313
313
  const t = /* @__PURE__ */ Fe(e);
314
314
  return ue || Xr(t), t;
315
315
  }
316
316
  // @__NO_SIDE_EFFECTS__
317
317
  function Rr(e) {
318
318
  const t = /* @__PURE__ */ Fe(e);
319
- return t.equals = xr, t;
319
+ return t.equals = Sr, t;
320
320
  }
321
321
  function vi(e) {
322
322
  var t = e.effects;
323
323
  if (t !== null) {
324
324
  e.effects = null;
325
- for (var r = 0; r < t.length; r += 1) q(t[r]);
325
+ for (var r = 0; r < t.length; r += 1) D(t[r]);
326
326
  }
327
327
  }
328
328
  function Vt(e) {
@@ -340,7 +340,7 @@ function Vt(e) {
340
340
  function Mr(e) {
341
341
  var t = Vt(e);
342
342
  if (!e.equals(t) && (e.wv = Qr(), (!w?.is_fork || e.deps === null) && (w !== null ? (w.capture(e, t, !0), Ae?.capture(e, t, !0)) : e.v = t, e.deps === null))) {
343
- x(e, Y);
343
+ O(e, Y);
344
344
  return;
345
345
  }
346
346
  le || (P !== null ? (Jt() || w?.is_fork) && P.set(e, t) : Yt(e));
@@ -355,66 +355,60 @@ function Ir(e) {
355
355
  if (e.effects !== null)
356
356
  for (const t of e.effects) t.teardown && t.fn !== null && Re(t);
357
357
  }
358
- var tt = null, ke = null, w = null, Ae = null, P = null, It = null, je = !1, Tt = !1, Le = null, ut = null, sr = 0;
358
+ var tt = null, ke = null, w = null, Ae = null, P = null, It = null, je = !1, xt = !1, Le = null, ut = null, sr = 0;
359
359
  var _i = 1, Ie = class Nt {
360
360
  id = _i++;
361
- #e = !1;
361
+ started = !1;
362
362
  linked = !0;
363
- #t = null;
364
- #r = null;
363
+ prev = null;
364
+ next = null;
365
365
  async_deriveds = /* @__PURE__ */ new Map();
366
366
  current = /* @__PURE__ */ new Map();
367
367
  previous = /* @__PURE__ */ new Map();
368
- #o = /* @__PURE__ */ new Set();
369
- #i = /* @__PURE__ */ new Set();
370
- #a = 0;
371
- #n = /* @__PURE__ */ new Map();
372
- #l = null;
373
- #s = [];
374
- #p = [];
375
- #f = /* @__PURE__ */ new Set();
376
- #u = /* @__PURE__ */ new Set();
377
- #d = /* @__PURE__ */ new Map();
378
- #g = /* @__PURE__ */ new Set();
368
+ #e = /* @__PURE__ */ new Set();
369
+ #t = /* @__PURE__ */ new Set();
370
+ #r = 0;
371
+ #l = /* @__PURE__ */ new Map();
372
+ #n = null;
373
+ #i = [];
374
+ #a = [];
375
+ #s = /* @__PURE__ */ new Map();
376
+ #o = /* @__PURE__ */ new Map();
377
+ #v = /* @__PURE__ */ new Set();
379
378
  is_fork = !1;
380
- #c = !1;
379
+ #f = !1;
381
380
  constructor() {
382
- ke === null ? tt = ke = this : (ke.#r = this, this.#t = ke), ke = this;
381
+ ke === null ? tt = ke = this : (ke.next = this, this.prev = ke), ke = this;
383
382
  }
384
- #b() {
383
+ #_() {
385
384
  if (this.is_fork) return !0;
386
- for (const n of this.#n.keys()) {
387
- for (var t = n, r = !1; t.parent !== null; ) {
388
- if (this.#d.has(t)) {
389
- r = !0;
390
- break;
391
- }
392
- t = t.parent;
393
- }
394
- if (!r) return !0;
395
- }
385
+ for (const t of this.#l.keys()) if (!this.#y(t)) return !0;
386
+ return !1;
387
+ }
388
+ #y(t) {
389
+ for (var r = t; r !== null; r = r.parent) if (this.#o.has(r)) return !0;
396
390
  return !1;
397
391
  }
398
392
  skip_effect(t) {
399
- this.#d.has(t) || this.#d.set(t, {
393
+ this.#o.has(t) || this.#o.set(t, {
400
394
  d: [],
401
395
  m: []
402
- }), this.#g.delete(t);
396
+ }), this.#v.delete(t);
403
397
  }
404
398
  unskip_effect(t, r = (n) => this.schedule(n)) {
405
- var n = this.#d.get(t);
399
+ var n = this.#o.get(t);
406
400
  if (n) {
407
- this.#d.delete(t);
401
+ this.#o.delete(t);
408
402
  for (var i of n.d)
409
- x(i, z), r(i);
403
+ O(i, q), r(i);
410
404
  for (i of n.m)
411
- x(i, be), r(i);
405
+ O(i, de), r(i);
412
406
  }
413
- this.#g.add(t);
407
+ this.#v.add(t);
414
408
  }
415
- #$() {
409
+ #u() {
416
410
  var t = [];
417
- for (const s of this.#s)
411
+ for (const s of this.#i)
418
412
  if (!((s.f & 16384) !== 0 || (s.f & 6144) === 0)) {
419
413
  for (var r = s, n = !1; r.parent !== null; ) {
420
414
  r = r.parent;
@@ -429,55 +423,48 @@ var _i = 1, Ie = class Nt {
429
423
  }
430
424
  n || t.push(r);
431
425
  }
432
- return this.#s = [], t;
433
- }
434
- #y() {
435
- this.#e = !0;
436
- for (const a of this.#f)
437
- this.#u.delete(a), x(a, z), this.schedule(a);
438
- for (const a of this.#u)
439
- x(a, be), this.schedule(a);
426
+ return this.#i = [], t;
427
+ }
428
+ #p() {
429
+ this.started = !0;
430
+ for (const [a, f] of this.#s)
431
+ O(a, f), this.schedule(a);
440
432
  this.apply();
441
- for (var t = Le = [], r = [], n = ut = []; this.#s.length > 0; ) {
442
- sr++ > 1e3 && (this.#_(), pi());
443
- for (const a of this.#$()) try {
444
- this.#w(a, t, r);
445
- } catch (u) {
446
- throw jr(a), this.#b() || this.discard(), u;
433
+ for (var t = Le = [], r = [], n = ut = []; this.#i.length > 0; ) {
434
+ sr++ > 1e3 && (this.#d(), pi());
435
+ for (const a of this.#u()) try {
436
+ this.#m(a, t, r);
437
+ } catch (f) {
438
+ throw jr(a), this.#_() || this.discard(), f;
447
439
  }
448
440
  }
449
441
  if (w = null, n.length > 0) {
450
442
  var i = Nt.ensure();
451
443
  for (const a of n) i.schedule(a);
452
444
  }
453
- if (Le = null, ut = null, this.#b()) {
445
+ if (Le = null, ut = null, this.#_()) {
454
446
  this.#h(r), this.#h(t);
455
- for (const [a, u] of this.#d) Pr(a, u);
456
- n.length > 0 && w.#y();
447
+ for (const [a, f] of this.#o) Pr(a, f);
448
+ n.length > 0 && w.#p();
457
449
  return;
458
450
  }
459
- const s = this.#v();
451
+ const s = this.#b();
460
452
  if (s) {
461
- this.#h(r), this.#h(t), s.#k(this);
453
+ this.#h(r), this.#h(t), s.#c(this);
462
454
  return;
463
455
  }
464
- this.#f.clear(), this.#u.clear();
465
- for (const a of this.#o) a(this);
466
- this.#o.clear(), Ae = this, ar(r), ar(t), Ae = null, this.#l?.resolve();
456
+ this.#s.clear();
457
+ for (const a of this.#e) a(this);
458
+ this.#e.clear(), Ae = this, ar(r), ar(t), Ae = null, this.#n?.resolve();
467
459
  var l = w;
468
- if (this.#a === 0 && (this.#s.length === 0 || l !== null) && (this.#_(), ue && (this.#m(), w = l)), this.#s.length > 0)
469
- if (l !== null) {
470
- for (const a of this.#s) l.#s.push(a);
471
- this.#s = [];
472
- } else l = this;
473
- l !== null && (Q.clear(), l.#y());
474
- }
475
- #w(t, r, n) {
460
+ this.#r === 0 && (this.#i.length === 0 || l !== null) && (this.#d(), ue && (this.#w(), w = l)), l !== null && (Q.clear(), l.#p());
461
+ }
462
+ #m(t, r, n) {
476
463
  t.f ^= Y;
477
464
  for (var i = t.first; i !== null; ) {
478
465
  var s = i.f, l = (s & 96) !== 0;
479
- if (!(l && (s & 1024) !== 0 || (s & 8192) !== 0 || this.#d.has(i)) && i.fn !== null) {
480
- l ? i.f ^= Y : (s & 4) !== 0 ? r.push(i) : ue && (s & 16777224) !== 0 ? n.push(i) : Ke(i) && ((s & 16) !== 0 && this.#u.add(i), Re(i));
466
+ if (!(l && (s & 1024) !== 0 || (s & 8192) !== 0 || this.#o.has(i)) && i.fn !== null) {
467
+ l ? i.f ^= Y : (s & 4) !== 0 ? r.push(i) : ue && (s & 16777224) !== 0 ? n.push(i) : Ke(i) && ((s & 16) !== 0 && this.add_dirty_reaction(i, de), Re(i));
481
468
  var a = i.first;
482
469
  if (a !== null) {
483
470
  i = a;
@@ -485,32 +472,33 @@ var _i = 1, Ie = class Nt {
485
472
  }
486
473
  }
487
474
  for (; i !== null; ) {
488
- var u = i.next;
489
- if (u !== null) {
490
- i = u;
475
+ var f = i.next;
476
+ if (f !== null) {
477
+ i = f;
491
478
  break;
492
479
  }
493
480
  i = i.parent;
494
481
  }
495
482
  }
496
483
  }
497
- #v() {
498
- for (var t = this.#t; t !== null; ) {
499
- if (!t.is_fork) {
500
- for (const [r, [, n]] of this.current) if (t.current.has(r) && !n) return t;
501
- }
502
- t = t.#t;
503
- }
484
+ #b() {
485
+ for (var t = this.prev; t !== null; t = t.prev) if (!t.is_fork && this.#g(t)) return t;
504
486
  return null;
505
487
  }
506
- #k(t) {
488
+ #g(t) {
489
+ for (const [r, [, n]] of this.current)
490
+ if (!n && t.current.has(r))
491
+ return !0;
492
+ return !1;
493
+ }
494
+ #c(t) {
507
495
  for (const [n, i] of t.current)
508
496
  !this.previous.has(n) && t.previous.has(n) && this.previous.set(n, t.previous.get(n)), this.current.set(n, i);
509
497
  for (const [n, i] of t.async_deriveds) {
510
498
  const s = this.async_deriveds.get(n);
511
499
  s && i.promise.then(s.resolve).catch(s.reject);
512
500
  }
513
- t.async_deriveds.clear(), this.transfer_effects(t.#f, t.#u);
501
+ t.async_deriveds.clear(), this.transfer_reactions(t.#s);
514
502
  const r = (n) => {
515
503
  var i = n.reactions;
516
504
  if (i !== null && !((n.f & 2) !== 0 && (n.f & 6144) === 0))
@@ -519,15 +507,15 @@ var _i = 1, Ie = class Nt {
519
507
  if ((s & 2) !== 0) r(a);
520
508
  else {
521
509
  var l = a;
522
- s & 4194320 && !this.async_deriveds.has(l) && (this.#u.delete(l), x(l, z), this.schedule(l));
510
+ s & 4194320 && !this.async_deriveds.has(l) && (this.#s.delete(l), O(l, q), this.schedule(l));
523
511
  }
524
512
  }
525
513
  };
526
514
  for (const n of this.current.keys()) r(n);
527
- this.oncommit(() => t.discard()), t.#_(), w = this, this.#y();
515
+ this.oncommit(() => t.discard()), t.#d(), w = this, this.#p();
528
516
  }
529
517
  #h(t) {
530
- for (var r = 0; r < t.length; r += 1) Cr(t[r], this.#f, this.#u);
518
+ for (var r = 0; r < t.length; r += 1) Cr(t[r], this.#s);
531
519
  }
532
520
  capture(t, r, n = !1) {
533
521
  t.v !== M && !this.previous.has(t) && this.previous.set(t, t.v), (t.f & 8388608) === 0 && (this.current.set(t, [r, n]), P?.set(t, r)), this.is_fork || (t.v = r);
@@ -540,57 +528,57 @@ var _i = 1, Ie = class Nt {
540
528
  }
541
529
  flush() {
542
530
  try {
543
- Tt = !0, w = this, this.#y();
531
+ xt = !0, w = this, this.#p();
544
532
  } finally {
545
- sr = 0, It = null, Le = null, ut = null, Tt = !1, w = null, P = null, Q.clear();
533
+ sr = 0, It = null, Le = null, ut = null, xt = !1, w = null, P = null, Q.clear();
546
534
  }
547
535
  }
548
536
  discard() {
549
- for (const t of this.#i) t(this);
550
- this.#i.clear();
537
+ for (const t of this.#t) t(this);
538
+ this.#t.clear();
551
539
  for (const t of this.async_deriveds.values()) t.reject(Ne);
552
- this.#_(), this.#l?.resolve();
540
+ this.#d(), this.#n?.resolve();
553
541
  }
554
542
  register_created_effect(t) {
555
- this.#p.push(t);
543
+ this.#a.push(t);
556
544
  }
557
- #m() {
558
- for (let c = tt; c !== null; c = c.#r) {
545
+ #w() {
546
+ for (let c = tt; c !== null; c = c.next) {
559
547
  var t = c.id < this.id, r = [];
560
- for (const [f, [o, d]] of this.current) {
561
- if (c.current.has(f)) {
562
- var n = c.current.get(f)[0];
563
- if (t && o !== n) c.current.set(f, [o, d]);
548
+ for (const [u, [o, d]] of this.current) {
549
+ if (c.current.has(u)) {
550
+ var n = c.current.get(u)[0];
551
+ if (t && o !== n) c.current.set(u, [o, d]);
564
552
  else continue;
565
553
  }
566
- r.push(f);
554
+ r.push(u);
567
555
  }
568
- if (t) for (const [f, o] of this.async_deriveds) {
569
- const d = c.async_deriveds.get(f);
556
+ if (t) for (const [u, o] of this.async_deriveds) {
557
+ const d = c.async_deriveds.get(u);
570
558
  d && o.promise.then(d.resolve).catch(d.reject);
571
559
  }
572
- var i = [...c.current.keys()].filter((f) => !c.current.get(f)[1]);
573
- if (!(!c.#e || i.length === 0)) {
574
- var s = i.filter((f) => !this.current.has(f));
560
+ var i = [...c.current.keys()].filter((u) => !c.current.get(u)[1]);
561
+ if (!(!c.started || i.length === 0)) {
562
+ var s = i.filter((u) => !this.current.has(u));
575
563
  if (s.length === 0)
576
564
  t && c.discard();
577
565
  else if (r.length > 0) {
578
- if (t) for (const f of this.#g) c.unskip_effect(f, (o) => {
566
+ if (t) for (const u of this.#v) c.unskip_effect(u, (o) => {
579
567
  (o.f & 4194320) !== 0 ? c.schedule(o) : c.#h([o]);
580
568
  });
581
569
  c.activate();
582
570
  var l = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Map();
583
- for (var u of r) Nr(u, s, l, a);
571
+ for (var f of r) Nr(f, s, l, a);
584
572
  a = /* @__PURE__ */ new Map();
585
- var h = [...c.current].filter(([f, o]) => {
586
- const d = this.current.get(f);
573
+ var h = [...c.current].filter(([u, o]) => {
574
+ const d = this.current.get(u);
587
575
  return d ? d[0] !== o[0] || d[1] !== o[1] : !0;
588
- }).map(([f]) => f);
576
+ }).map(([u]) => u);
589
577
  if (h.length > 0)
590
- for (const f of this.#p) (f.f & 155648) === 0 && Gt(f, h, a) && ((f.f & 4194320) !== 0 ? (x(f, z), c.schedule(f)) : c.#f.add(f));
591
- if (c.#s.length > 0 && !c.#c) {
578
+ for (const u of this.#a) (u.f & 155648) === 0 && Gt(u, h, a) && ((u.f & 4194320) !== 0 ? (O(u, q), c.schedule(u)) : c.add_dirty_reaction(u, q));
579
+ if (c.#i.length > 0 && !c.#f) {
592
580
  c.apply();
593
- for (var g of c.#$()) c.#w(g, [], []);
581
+ for (var g of c.#u()) c.#m(g, [], []);
594
582
  }
595
583
  c.deactivate();
596
584
  }
@@ -598,75 +586,67 @@ var _i = 1, Ie = class Nt {
598
586
  }
599
587
  }
600
588
  increment(t, r) {
601
- if (this.#a += 1, t) {
602
- let n = this.#n.get(r) ?? 0;
603
- this.#n.set(r, n + 1);
589
+ if (this.#r += 1, t) {
590
+ let n = this.#l.get(r) ?? 0;
591
+ this.#l.set(r, n + 1);
604
592
  }
605
593
  }
606
594
  decrement(t, r) {
607
- if (this.#a -= 1, t) {
608
- let n = this.#n.get(r) ?? 0;
609
- n === 1 ? this.#n.delete(r) : this.#n.set(r, n - 1);
595
+ if (this.#r -= 1, t) {
596
+ let n = this.#l.get(r) ?? 0;
597
+ n === 1 ? this.#l.delete(r) : this.#l.set(r, n - 1);
610
598
  }
611
- this.#c || (this.#c = !0, ge(() => {
612
- this.#c = !1, this.linked && this.flush();
599
+ this.#f || (this.#f = !0, ye(() => {
600
+ this.#f = !1, this.linked && this.flush();
613
601
  }));
614
602
  }
615
- transfer_effects(t, r) {
616
- for (const n of t) this.#f.add(n);
617
- for (const n of r) this.#u.add(n);
618
- t.clear(), r.clear();
603
+ transfer_reactions(t) {
604
+ for (const [r, n] of t) this.add_dirty_reaction(r, n);
605
+ t.clear();
606
+ }
607
+ add_dirty_reaction(t, r) {
608
+ (r === 2048 || this.#s.get(t) !== 2048) && this.#s.set(t, r);
619
609
  }
620
610
  oncommit(t) {
621
- this.#o.add(t);
611
+ this.#e.add(t);
622
612
  }
623
613
  ondiscard(t) {
624
- this.#i.add(t);
614
+ this.#t.add(t);
625
615
  }
626
616
  settled() {
627
- return (this.#l ??= mr()).promise;
617
+ return (this.#n ??= mr()).promise;
628
618
  }
629
619
  static ensure() {
630
620
  if (w === null) {
631
621
  const t = w = new Nt();
632
- !Tt && !je && ge(() => {
633
- t.#e || t.flush();
622
+ !xt && !je && ye(() => {
623
+ t.started || t.flush();
634
624
  });
635
625
  }
636
626
  return w;
637
627
  }
638
628
  apply() {
639
- if (!ue || !this.is_fork && this.#t === null && this.#r === null) {
629
+ if (!ue || !this.is_fork && this.prev === null && this.next === null) {
640
630
  P = null;
641
631
  return;
642
632
  }
643
633
  P = /* @__PURE__ */ new Map();
644
- for (const [r, [n]] of this.current) P.set(r, n);
645
- for (let r = tt; r !== null; r = r.#r)
646
- if (!(r === this || r.is_fork)) {
647
- var t = !1;
648
- if (r.id < this.id) {
649
- for (const [n, [, i]] of r.current)
650
- if (!i && this.current.has(n)) {
651
- t = !0;
652
- break;
653
- }
654
- }
655
- if (!t)
656
- for (const [n, i] of r.previous) P.has(n) || P.set(n, i);
657
- }
634
+ for (const [t, [r]] of this.current) P.set(t, r);
635
+ for (let t = tt; t !== null; t = t.next)
636
+ if (!(t === this || t.is_fork) && (t.id >= this.id || !t.#g(this)))
637
+ for (const [r, n] of t.previous) P.has(r) || P.set(r, n);
658
638
  }
659
639
  schedule(t) {
660
640
  if (It = t, t.b?.is_pending && (t.f & 16777228) !== 0 && (t.f & 32768) === 0) {
661
641
  t.b.defer_effect(t);
662
642
  return;
663
643
  }
664
- this.#s.push(t);
644
+ this.#i.push(t);
665
645
  }
666
- #_() {
646
+ #d() {
667
647
  if (this.linked) {
668
- var t = this.#t, r = this.#r;
669
- t === null ? tt = r : t.#r = r, r === null ? ke = t : r.#t = t, this.linked = !1;
648
+ var t = this.prev, r = this.next;
649
+ t === null ? tt = r : t.next = r, r === null ? ke = t : r.prev = t, this.linked = !1;
670
650
  }
671
651
  }
672
652
  };
@@ -710,8 +690,8 @@ function ar(e) {
710
690
  for (; l !== null; )
711
691
  J.has(l) && (J.delete(l), s.push(l)), l = l.parent;
712
692
  for (let a = s.length - 1; a >= 0; a--) {
713
- const u = s[a];
714
- (u.f & 24576) === 0 && Re(u);
693
+ const f = s[a];
694
+ (f.f & 24576) === 0 && Re(f);
715
695
  }
716
696
  }
717
697
  J.clear();
@@ -724,7 +704,7 @@ function Nr(e, t, r, n) {
724
704
  if (!r.has(e) && (r.add(e), e.reactions !== null))
725
705
  for (const i of e.reactions) {
726
706
  const s = i.f;
727
- (s & 2) !== 0 ? Nr(i, t, r, n) : (s & 4194320) !== 0 && (s & 2048) === 0 && Gt(i, t, n) && (x(i, z), Kt(i));
707
+ (s & 2) !== 0 ? Nr(i, t, r, n) : (s & 4194320) !== 0 && (s & 2048) === 0 && Gt(i, t, n) && (O(i, q), Kt(i));
728
708
  }
729
709
  }
730
710
  function Gt(e, t, r) {
@@ -742,13 +722,13 @@ function Kt(e) {
742
722
  }
743
723
  function Pr(e, t) {
744
724
  if (!((e.f & 32) !== 0 && (e.f & 1024) !== 0)) {
745
- (e.f & 2048) !== 0 ? t.d.push(e) : (e.f & 4096) !== 0 && t.m.push(e), x(e, Y);
725
+ (e.f & 2048) !== 0 ? t.d.push(e) : (e.f & 4096) !== 0 && t.m.push(e), O(e, Y);
746
726
  for (var r = e.first; r !== null; )
747
727
  Pr(r, t), r = r.next;
748
728
  }
749
729
  }
750
730
  function jr(e) {
751
- x(e, Y);
731
+ O(e, Y);
752
732
  for (var t = e.first; t !== null; )
753
733
  jr(t), t = t.next;
754
734
  }
@@ -759,7 +739,7 @@ function Ge(e, t) {
759
739
  f: 0,
760
740
  v: e,
761
741
  reactions: null,
762
- equals: Sr,
742
+ equals: Tr,
763
743
  rv: 0,
764
744
  wv: 0
765
745
  };
@@ -773,14 +753,14 @@ function j(e, t) {
773
753
  // @__NO_SIDE_EFFECTS__
774
754
  function gi(e, t = !1, r = !0) {
775
755
  const n = Ge(e);
776
- return t || (n.equals = xr), Ye && r && T !== null && T.l !== null && (T.l.s ??= []).push(n), n;
756
+ return t || (n.equals = Sr), Ye && r && T !== null && T.l !== null && (T.l.s ??= []).push(n), n;
777
757
  }
778
758
  function $(e, t, r = !1) {
779
759
  m !== null && (!K || (m.f & 131072) !== 0) && Ve() && (m.f & 4325394) !== 0 && (ee === null || !ee.has(e)) && ii();
780
- let n = r ? xe(t) : t;
760
+ let n = r ? Se(t) : t;
781
761
  return mt(e, n, ut);
782
762
  }
783
- var _e = null, Pt = 0;
763
+ var pe = null, Pt = 0;
784
764
  function mt(e, t, r = null) {
785
765
  if (!e.equals(t)) {
786
766
  le ? Q.set(e, t) : Q.has(e) || Q.set(e, e.v);
@@ -789,14 +769,14 @@ function mt(e, t, r = null) {
789
769
  const i = e;
790
770
  (e.f & 2048) !== 0 && Vt(i), P === null && Yt(i);
791
771
  }
792
- e.wv = Qr(), _e = null, Pt = 0, qr(e, z, r), _e = null, Ve() && y !== null && (y.f & 1024) !== 0 && (y.f & 96) === 0 && (B === null ? Ni([e]) : B.push(e)), !n.is_fork && yt.size > 0 && !Lr && yi();
772
+ e.wv = Qr(), pe = null, Pt = 0, qr(e, q, r), pe = null, Ve() && y !== null && (y.f & 1024) !== 0 && (y.f & 96) === 0 && (B === null ? Ni([e]) : B.push(e)), !n.is_fork && yt.size > 0 && !Lr && yi();
793
773
  }
794
774
  return t;
795
775
  }
796
776
  function yi() {
797
777
  Lr = !1;
798
778
  for (const e of yt) {
799
- (e.f & 1024) !== 0 && x(e, be);
779
+ (e.f & 1024) !== 0 && O(e, de);
800
780
  let t;
801
781
  try {
802
782
  t = Ke(e);
@@ -814,83 +794,83 @@ function qr(e, t, r) {
814
794
  var n = e.reactions;
815
795
  if (n !== null) {
816
796
  var i = Ve(), s = n.length;
817
- if (Pt += s, Pt > 1e5 && _e === null && (_e = /* @__PURE__ */ new Set()), _e !== null) {
818
- if (_e.has(e)) return;
819
- _e.add(e);
797
+ if (Pt += s, Pt > 1e5 && pe === null && (pe = /* @__PURE__ */ new Set()), pe !== null) {
798
+ if (pe.has(e)) return;
799
+ pe.add(e);
820
800
  }
821
801
  for (var l = 0; l < s; l++) {
822
- var a = n[l], u = a.f;
802
+ var a = n[l], f = a.f;
823
803
  if (!(!i && a === y)) {
824
- var h = (u & z) === 0;
825
- if (h && x(a, t), (u & 131072) !== 0) yt.add(a);
826
- else if ((u & 2) !== 0) {
804
+ var h = (f & q) === 0;
805
+ if (h && O(a, t), (f & 131072) !== 0) yt.add(a);
806
+ else if ((f & 2) !== 0) {
827
807
  var g = a;
828
- P?.delete(g), qr(g, be, r);
808
+ P?.delete(g), qr(g, de, r);
829
809
  } else if (h) {
830
810
  var c = a;
831
- (u & 16) !== 0 && J !== null && J.add(c), r !== null ? r.push(c) : Kt(c);
811
+ (f & 16) !== 0 && J !== null && J.add(c), r !== null ? r.push(c) : Kt(c);
832
812
  }
833
813
  }
834
814
  }
835
815
  }
836
816
  }
837
817
  var mi = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;
838
- function xe(e) {
818
+ function Se(e) {
839
819
  if (typeof e != "object" || e === null || Pe in e || br in e) return e;
840
820
  const t = yr(e);
841
821
  if (t !== Nn && t !== Pn) return e;
842
- var r = /* @__PURE__ */ new Map(), n = On(e), i = /* @__PURE__ */ j(0), s = null, l = we, a = (c) => {
843
- if (we === l) return c();
844
- var f = m, o = we;
822
+ var r = /* @__PURE__ */ new Map(), n = On(e), i = /* @__PURE__ */ j(0), s = null, l = be, a = (c) => {
823
+ if (be === l) return c();
824
+ var u = m, o = be;
845
825
  V(null), ur(l);
846
826
  var d = c();
847
- return V(f), ur(o), d;
827
+ return V(u), ur(o), d;
848
828
  };
849
829
  n && r.set("length", /* @__PURE__ */ j(e.length, s));
850
- var u = "";
830
+ var f = "";
851
831
  let h = !1;
852
832
  function g(c) {
853
833
  if (!h) {
854
- h = !0, u = c, ir(i, `${u} version`);
855
- for (const [f, o] of r) ir(o, wi(u, f));
834
+ h = !0, f = c, ir(i, `${f} version`);
835
+ for (const [u, o] of r) ir(o, wi(f, u));
856
836
  h = !1;
857
837
  }
858
838
  }
859
839
  return new Proxy(e, {
860
- defineProperty(c, f, o) {
840
+ defineProperty(c, u, o) {
861
841
  (!("value" in o) || o.configurable === !1 || o.enumerable === !1 || o.writable === !1) && ri();
862
- var d = r.get(f);
842
+ var d = r.get(u);
863
843
  return d === void 0 ? a(() => {
864
844
  var _ = /* @__PURE__ */ j(o.value, s);
865
- return r.set(f, _), _;
845
+ return r.set(u, _), _;
866
846
  }) : $(d, o.value, !0), !0;
867
847
  },
868
- deleteProperty(c, f) {
869
- var o = r.get(f);
848
+ deleteProperty(c, u) {
849
+ var o = r.get(u);
870
850
  if (o === void 0) {
871
- if (f in c) {
851
+ if (u in c) {
872
852
  const d = a(() => /* @__PURE__ */ j(M, s));
873
- r.set(f, d), qe(i);
853
+ r.set(u, d), qe(i);
874
854
  }
875
855
  } else
876
856
  $(o, M), qe(i);
877
857
  return !0;
878
858
  },
879
- get(c, f, o) {
880
- if (f === Pe) return e;
881
- var d = r.get(f), _ = f in c;
882
- if (d === void 0 && (!_ || me(c, f)?.writable) && (d = a(() => {
883
- var O = xe(_ ? c[f] : M), R = /* @__PURE__ */ j(O, s);
859
+ get(c, u, o) {
860
+ if (u === Pe) return e;
861
+ var d = r.get(u), _ = u in c;
862
+ if (d === void 0 && (!_ || we(c, u)?.writable) && (d = a(() => {
863
+ var C = Se(_ ? c[u] : M), R = /* @__PURE__ */ j(C, s);
884
864
  return R;
885
- }), r.set(f, d)), d !== void 0) {
865
+ }), r.set(u, d)), d !== void 0) {
886
866
  var b = v(d);
887
867
  return b === M ? void 0 : b;
888
868
  }
889
- return Reflect.get(c, f, o);
869
+ return Reflect.get(c, u, o);
890
870
  },
891
- getOwnPropertyDescriptor(c, f) {
892
- this.has?.(c, f);
893
- var o = Reflect.getOwnPropertyDescriptor(c, f), d = r.get(f);
871
+ getOwnPropertyDescriptor(c, u) {
872
+ this.has?.(c, u);
873
+ var o = Reflect.getOwnPropertyDescriptor(c, u), d = r.get(u);
894
874
  if (d !== void 0) {
895
875
  var _ = v(d);
896
876
  if (_ === M) return;
@@ -904,31 +884,31 @@ function xe(e) {
904
884
  }
905
885
  return o;
906
886
  },
907
- has(c, f) {
908
- if (f === Pe) return !0;
909
- var o = r.get(f), d = o !== void 0 && o.v !== M || Reflect.has(c, f);
910
- return (o !== void 0 || y !== null && (!d || me(c, f)?.writable)) && (o === void 0 && (o = a(() => {
911
- var _ = d ? xe(c[f]) : M, b = /* @__PURE__ */ j(_, s);
887
+ has(c, u) {
888
+ if (u === Pe) return !0;
889
+ var o = r.get(u), d = o !== void 0 && o.v !== M || Reflect.has(c, u);
890
+ return (o !== void 0 || (y !== null || m !== null) && (!d || we(c, u)?.writable)) && (o === void 0 && (o = a(() => {
891
+ var _ = d ? Se(c[u]) : M, b = /* @__PURE__ */ j(_, s);
912
892
  return b;
913
- }), r.set(f, o)), v(o) === M) ? !1 : d;
893
+ }), r.set(u, o)), v(o) === M) ? !1 : d;
914
894
  },
915
- set(c, f, o, d) {
916
- var _ = r.get(f), b = f in c;
917
- if (n && f === "length") for (var O = o; O < _.v; O += 1) {
918
- var R = r.get(O + "");
919
- R !== void 0 ? $(R, M) : O in c && (R = a(() => /* @__PURE__ */ j(M, s)), r.set(O + "", R));
895
+ set(c, u, o, d) {
896
+ var _ = r.get(u), b = u in c;
897
+ if (n && u === "length") for (var C = o; C < _.v; C += 1) {
898
+ var R = r.get(C + "");
899
+ R !== void 0 ? $(R, M) : C in c && (R = a(() => /* @__PURE__ */ j(M, s)), r.set(C + "", R));
920
900
  }
921
901
  if (_ === void 0)
922
- (!b || me(c, f)?.writable) && (_ = a(() => /* @__PURE__ */ j(void 0, s)), $(_, xe(o)), r.set(f, _));
902
+ (!b || we(c, u)?.writable) && (_ = a(() => /* @__PURE__ */ j(void 0, s)), $(_, Se(o)), r.set(u, _));
923
903
  else {
924
904
  b = _.v !== M;
925
- var W = a(() => xe(o));
905
+ var W = a(() => Se(o));
926
906
  $(_, W);
927
907
  }
928
- var k = Reflect.getOwnPropertyDescriptor(c, f);
908
+ var k = Reflect.getOwnPropertyDescriptor(c, u);
929
909
  if (k?.set && k.set.call(d, o), !b) {
930
- if (n && typeof f == "string") {
931
- var G = r.get("length"), H = Number(f);
910
+ if (n && typeof u == "string") {
911
+ var G = r.get("length"), H = Number(u);
932
912
  Number.isInteger(H) && H >= G.v && $(G, H + 1);
933
913
  }
934
914
  qe(i);
@@ -937,12 +917,12 @@ function xe(e) {
937
917
  },
938
918
  ownKeys(c) {
939
919
  v(i);
940
- var f = Reflect.ownKeys(c).filter((_) => {
920
+ var u = Reflect.ownKeys(c).filter((_) => {
941
921
  var b = r.get(_);
942
922
  return b === void 0 || b.v !== M;
943
923
  });
944
- for (var [o, d] of r) d.v !== M && !(o in c) && f.push(o);
945
- return f;
924
+ for (var [o, d] of r) d.v !== M && !(o in c) && u.push(o);
925
+ return u;
946
926
  },
947
927
  setPrototypeOf() {
948
928
  ni();
@@ -957,7 +937,7 @@ function jt() {
957
937
  if (lr === void 0) {
958
938
  lr = window, bi = document, Dr = /Firefox/.test(navigator.userAgent);
959
939
  var e = Element.prototype, t = Node.prototype, r = Text.prototype;
960
- zr = me(t, "firstChild").get, Hr = me(t, "nextSibling").get, rr(e) && (e[Rt] = void 0, e[kr] = null, e[Fn] = void 0, e.__e = void 0), rr(r) && (r[Mt] = void 0);
940
+ zr = we(t, "firstChild").get, Hr = we(t, "nextSibling").get, rr(e) && (e[Rt] = void 0, e[kr] = null, e[Fn] = void 0, e.__e = void 0), rr(r) && (r[Mt] = void 0);
961
941
  }
962
942
  }
963
943
  function $e(e = "") {
@@ -968,29 +948,29 @@ function Oe(e) {
968
948
  return zr.call(e);
969
949
  }
970
950
  // @__NO_SIDE_EFFECTS__
971
- function de(e) {
951
+ function ve(e) {
972
952
  return Hr.call(e);
973
953
  }
974
954
  function ct(e, t) {
975
- if (!A) return /* @__PURE__ */ Oe(e);
976
- var r = /* @__PURE__ */ Oe(C);
977
- if (r === null) r = C.appendChild($e());
955
+ if (!x) return /* @__PURE__ */ Oe(e);
956
+ var r = /* @__PURE__ */ Oe(A);
957
+ if (r === null) r = A.appendChild($e());
978
958
  else if (t && r.nodeType !== 3) {
979
959
  var n = $e();
980
960
  return r?.before(n), te(n), n;
981
961
  }
982
962
  return t && Fr(r), te(r), r;
983
963
  }
984
- function St(e, t = !1) {
985
- if (!A) return /* @__PURE__ */ Oe(e);
964
+ function Tt(e, t = !1) {
965
+ if (!x) return /* @__PURE__ */ Oe(e);
986
966
  var r = ct(e, t);
987
967
  return ft(e), r;
988
968
  }
989
969
  function rt(e, t = 1, r = !1) {
990
- let n = A ? C : e;
970
+ let n = x ? A : e;
991
971
  for (var i; t--; )
992
- i = n, n = /* @__PURE__ */ de(n);
993
- if (!A) return n;
972
+ i = n, n = /* @__PURE__ */ ve(n);
973
+ if (!x) return n;
994
974
  if (r) {
995
975
  if (n?.nodeType !== 3) {
996
976
  var s = $e();
@@ -1041,10 +1021,10 @@ function X(e, t) {
1041
1021
  throw e;
1042
1022
  }
1043
1023
  }
1044
- function Ti(e) {
1024
+ function xi(e) {
1045
1025
  y === null && (m === null && Zn(e), Xn()), le && Jn(e);
1046
1026
  }
1047
- function Si(e, t) {
1027
+ function Ti(e, t) {
1048
1028
  var r = t.last;
1049
1029
  r === null ? t.last = t.first = e : (r.next = e, e.prev = r, t.last = e);
1050
1030
  }
@@ -1055,7 +1035,7 @@ function ne(e, t) {
1055
1035
  ctx: T,
1056
1036
  deps: null,
1057
1037
  nodes: null,
1058
- f: e | z | 512,
1038
+ f: e | q | 512,
1059
1039
  first: null,
1060
1040
  fn: t,
1061
1041
  last: null,
@@ -1075,11 +1055,11 @@ function ne(e, t) {
1075
1055
  try {
1076
1056
  Re(n);
1077
1057
  } catch (l) {
1078
- throw q(n), l;
1058
+ throw D(n), l;
1079
1059
  }
1080
1060
  i.deps === null && i.teardown === null && i.nodes === null && i.first === i.last && (i.f & 524288) === 0 && (i = i.first, (e & 16) !== 0 && (e & 65536) !== 0 && i !== null && (i.f |= zt));
1081
1061
  }
1082
- if (i !== null && (i.parent = r, r !== null && Si(i, r), m !== null && (m.f & 2) !== 0 && (e & 64) === 0)) {
1062
+ if (i !== null && (i.parent = r, r !== null && Ti(i, r), m !== null && (m.f & 2) !== 0 && (e & 64) === 0)) {
1083
1063
  var s = m;
1084
1064
  (s.effects ??= []).push(i);
1085
1065
  }
@@ -1088,12 +1068,12 @@ function ne(e, t) {
1088
1068
  function Jt() {
1089
1069
  return m !== null && !K;
1090
1070
  }
1091
- function xi(e) {
1071
+ function Si(e) {
1092
1072
  const t = ne(8, null);
1093
- return x(t, Y), t.teardown = e, t;
1073
+ return O(t, Y), t.teardown = e, t;
1094
1074
  }
1095
1075
  function dt(e) {
1096
- Ti("$effect");
1076
+ xi("$effect");
1097
1077
  var t = y.f;
1098
1078
  if (!m && (t & 32) !== 0 && T !== null && !T.i) {
1099
1079
  var r = T;
@@ -1107,7 +1087,7 @@ function Ai(e) {
1107
1087
  Ie.ensure();
1108
1088
  const t = ne(64 | Me, e);
1109
1089
  return () => {
1110
- q(t);
1090
+ D(t);
1111
1091
  };
1112
1092
  }
1113
1093
  function Ci(e) {
@@ -1115,8 +1095,8 @@ function Ci(e) {
1115
1095
  const t = ne(64 | Me, e);
1116
1096
  return (r = {}) => new Promise((n) => {
1117
1097
  r.outro ? De(t, () => {
1118
- q(t), n(void 0);
1119
- }) : (q(t), n(void 0));
1098
+ D(t), n(void 0);
1099
+ }) : (D(t), n(void 0));
1120
1100
  });
1121
1101
  }
1122
1102
  function Ur(e) {
@@ -1164,16 +1144,16 @@ function Zt(e, t = !1) {
1164
1144
  i.abort(Ue);
1165
1145
  });
1166
1146
  var n = r.next;
1167
- (r.f & 64) !== 0 ? r.parent = null : q(r, t), r = n;
1147
+ (r.f & 64) !== 0 ? r.parent = null : D(r, t), r = n;
1168
1148
  }
1169
1149
  }
1170
1150
  function Ri(e) {
1171
1151
  for (var t = e.first; t !== null; ) {
1172
1152
  var r = t.next;
1173
- (t.f & 32) === 0 && q(t), t = r;
1153
+ (t.f & 32) === 0 && D(t), t = r;
1174
1154
  }
1175
1155
  }
1176
- function q(e, t = !0) {
1156
+ function D(e, t = !0) {
1177
1157
  var r = !1;
1178
1158
  (t || (e.f & 262144) !== 0) && e.nodes !== null && e.nodes.end !== null && (Mi(e.nodes.start, e.nodes.end), r = !0), e.f |= Ot, Zt(e, t && !r), Be(e, 0);
1179
1159
  var n = e.nodes && e.nodes.t;
@@ -1184,7 +1164,7 @@ function q(e, t = !0) {
1184
1164
  }
1185
1165
  function Mi(e, t) {
1186
1166
  for (; e !== null; ) {
1187
- var r = e === t ? null : /* @__PURE__ */ de(e);
1167
+ var r = e === t ? null : /* @__PURE__ */ ve(e);
1188
1168
  e.remove(), e = r;
1189
1169
  }
1190
1170
  }
@@ -1196,7 +1176,7 @@ function De(e, t, r = !0) {
1196
1176
  var n = [];
1197
1177
  e.f |= 256, Kr(e, n, !0);
1198
1178
  var i = () => {
1199
- r && q(e), t && t();
1179
+ r && D(e), t && t();
1200
1180
  }, s = n.length;
1201
1181
  if (s > 0) {
1202
1182
  var l = () => --s || i();
@@ -1224,7 +1204,7 @@ function or(e) {
1224
1204
  }
1225
1205
  function Wr(e, t) {
1226
1206
  if ((e.f & 256) === 0 && (e.f & 8192) !== 0) {
1227
- e.f ^= qt, (e.f & 1024) === 0 && (x(e, z), Ie.ensure().schedule(e));
1207
+ e.f ^= qt, (e.f & 1024) === 0 && (O(e, q), Ie.ensure().schedule(e));
1228
1208
  for (var r = e.first; r !== null; ) {
1229
1209
  var n = r.next, i = (r.f & 65536) !== 0 || (r.f & 32) !== 0;
1230
1210
  Wr(r, i ? t : !1), r = n;
@@ -1237,7 +1217,7 @@ function Wr(e, t) {
1237
1217
  function Jr(e, t) {
1238
1218
  if (e.nodes)
1239
1219
  for (var r = e.nodes.start, n = e.nodes.end; r !== null; ) {
1240
- var i = r === n ? null : /* @__PURE__ */ de(r);
1220
+ var i = r === n ? null : /* @__PURE__ */ ve(r);
1241
1221
  t.append(r), r = i;
1242
1222
  }
1243
1223
  }
@@ -1257,13 +1237,13 @@ var ee = null;
1257
1237
  function Xr(e) {
1258
1238
  m !== null && (!ue && (m.f & 2097152) !== 0 || (m.f & 2) !== 0) && (ee ??= /* @__PURE__ */ new Set()).add(e);
1259
1239
  }
1260
- var L = null, D = 0, B = null;
1240
+ var L = null, z = 0, B = null;
1261
1241
  function Ni(e) {
1262
1242
  B = e;
1263
1243
  }
1264
- var Zr = 1, ye = 0, we = ye;
1244
+ var Zr = 1, me = 0, be = me;
1265
1245
  function ur(e) {
1266
- we = e;
1246
+ be = e;
1267
1247
  }
1268
1248
  function Qr() {
1269
1249
  return ++Zr;
@@ -1276,7 +1256,7 @@ function Ke(e) {
1276
1256
  var s = r[i];
1277
1257
  if (Ke(s) && Mr(s), s.wv > e.wv) return !0;
1278
1258
  }
1279
- (t & 512) !== 0 && P === null && x(e, Y);
1259
+ (t & 512) !== 0 && P === null && O(e, Y);
1280
1260
  }
1281
1261
  return !1;
1282
1262
  }
@@ -1285,41 +1265,41 @@ function en(e, t, r = !0) {
1285
1265
  if (n !== null && !(!ue && ee !== null && ee.has(e)))
1286
1266
  for (var i = 0; i < n.length; i++) {
1287
1267
  var s = n[i];
1288
- (s.f & 2) !== 0 ? en(s, t, !1) : t === s && (r ? x(s, z) : (s.f & 1024) !== 0 && x(s, be), Kt(s));
1268
+ (s.f & 2) !== 0 ? en(s, t, !1) : t === s && (r ? O(s, q) : (s.f & 1024) !== 0 && O(s, de), Kt(s));
1289
1269
  }
1290
1270
  }
1291
1271
  function tn(e) {
1292
- var t = L, r = D, n = B, i = m, s = ee, l = T, a = K, u = we, h = e.f;
1293
- L = null, D = 0, B = null, m = (h & 96) === 0 ? e : null, ee = null, Ce(e.ctx), K = !1, we = ++ye, e.ac !== null && (bt(() => {
1272
+ var t = L, r = z, n = B, i = m, s = ee, l = T, a = K, f = be, h = e.f;
1273
+ L = null, z = 0, B = null, m = (h & 96) === 0 ? e : null, ee = null, Ce(e.ctx), K = !1, be = ++me, e.ac !== null && (bt(() => {
1294
1274
  e.ac.abort(Ue);
1295
1275
  }), e.ac = null);
1296
1276
  try {
1297
1277
  e.f |= nr;
1298
1278
  var g = e.fn, c = g();
1299
1279
  e.f |= Dt;
1300
- var f = cr(e);
1301
- if (Ve() && B !== null && !K && f !== null && (e.f & 6146) === 0) for (var o = 0; o < B.length; o++) en(B[o], e);
1280
+ var u = cr(e);
1281
+ if (Ve() && B !== null && !K && u !== null && (e.f & 6146) === 0) for (var o = 0; o < B.length; o++) en(B[o], e);
1302
1282
  if (i !== null && i !== e) {
1303
- if (ye++, i.deps !== null) for (let d = 0; d < r; d += 1) i.deps[d].rv = ye;
1304
- if (t !== null) for (const d of t) d.rv = ye;
1283
+ if (me++, i.deps !== null) for (let d = 0; d < r; d += 1) i.deps[d].rv = me;
1284
+ if (t !== null) for (const d of t) d.rv = me;
1305
1285
  B !== null && (n === null ? n = B : n.push(...B));
1306
1286
  }
1307
1287
  return (e.f & 8388608) !== 0 && (e.f ^= pt), c;
1308
1288
  } catch (d) {
1309
1289
  return cr(e), Ei(d);
1310
1290
  } finally {
1311
- e.f ^= nr, L = t, D = r, B = n, m = i, ee = s, Ce(l), K = a, we = u;
1291
+ e.f ^= nr, L = t, z = r, B = n, m = i, ee = s, Ce(l), K = a, be = f;
1312
1292
  }
1313
1293
  }
1314
1294
  function cr(e) {
1315
1295
  var t = e.deps, r = w?.is_fork;
1316
1296
  if (L !== null) {
1317
1297
  var n;
1318
- if (r || Be(e, D), t !== null && D > 0)
1319
- for (t.length = D + L.length, n = 0; n < L.length; n++) t[D + n] = L[n];
1298
+ if (r || Be(e, z), t !== null && z > 0)
1299
+ for (t.length = z + L.length, n = 0; n < L.length; n++) t[z + n] = L[n];
1320
1300
  else e.deps = t = L;
1321
- if (Jt() && (e.f & 512) !== 0) for (n = D; n < t.length; n++) (t[n].reactions ??= []).push(e);
1322
- } else !r && t !== null && D < t.length && (Be(e, D), t.length = D);
1301
+ if (Jt() && (e.f & 512) !== 0) for (n = z; n < t.length; n++) (t[n].reactions ??= []).push(e);
1302
+ } else !r && t !== null && z < t.length && (Be(e, z), t.length = z);
1323
1303
  return t;
1324
1304
  }
1325
1305
  function Pi(e, t) {
@@ -1334,7 +1314,7 @@ function Pi(e, t) {
1334
1314
  if (r === null && (t.f & 2) !== 0 && (L === null || !ze.call(L, t))) {
1335
1315
  var s = t;
1336
1316
  (s.f & 512) !== 0 && (s.f ^= 512), s.v !== M && Yt(s), s.ac !== null && bt(() => {
1337
- s.ac.abort(Ue), s.ac = null, x(s, z);
1317
+ s.ac.abort(Ue), s.ac = null, O(s, q);
1338
1318
  }), hi(s), Be(s, 0);
1339
1319
  }
1340
1320
  }
@@ -1346,7 +1326,7 @@ function Be(e, t) {
1346
1326
  function Re(e) {
1347
1327
  var t = e.f;
1348
1328
  if ((t & 16384) === 0) {
1349
- x(e, Y);
1329
+ O(e, Y);
1350
1330
  var r = y;
1351
1331
  if (y = e, 0)
1352
1332
  var n, i;
@@ -1365,7 +1345,7 @@ function v(e) {
1365
1345
  if (Ii?.add(e), m !== null && !K && !(y !== null && (y.f & 16384) !== 0) && (ee === null || !ee.has(e))) {
1366
1346
  var r = m.deps;
1367
1347
  if ((m.f & 2097152) !== 0)
1368
- e.rv < ye && (e.rv = ye, L === null && r !== null && r[D] === e ? D++ : L === null ? L = [e] : L.push(e));
1348
+ e.rv < me && (e.rv = me, L === null && r !== null && r[z] === e ? z++ : L === null ? L = [e] : L.push(e));
1369
1349
  else {
1370
1350
  m.deps ??= [], ze.call(m.deps, e) || m.deps.push(e);
1371
1351
  var n = e.reactions;
@@ -1384,8 +1364,8 @@ function v(e) {
1384
1364
  if (t) {
1385
1365
  var a = e;
1386
1366
  if (le) {
1387
- var u = a.v;
1388
- return ((a.f & 1024) === 0 && a.reactions !== null || nn(a)) && (u = Vt(a)), Q.set(a, u), u;
1367
+ var f = a.v;
1368
+ return ((a.f & 1024) === 0 && a.reactions !== null || nn(a)) && (f = Vt(a)), Q.set(a, f), f;
1389
1369
  }
1390
1370
  var h = (a.f & 512) === 0 && !K && m !== null && (m.f & 512) !== 0, g = (a.f & Dt) === 0;
1391
1371
  Ke(a) && (h && (a.f |= 512), Mr(a)), h && !g && (Ir(a), rn(a));
@@ -1416,22 +1396,22 @@ function We(e) {
1416
1396
  K = t;
1417
1397
  }
1418
1398
  }
1419
- var it = /* @__PURE__ */ Symbol("events"), ji = /* @__PURE__ */ new Set(), dr = /* @__PURE__ */ new Set(), xt = null, At = !1;
1399
+ var it = /* @__PURE__ */ Symbol("events"), ji = /* @__PURE__ */ new Set(), dr = /* @__PURE__ */ new Set(), St = null, At = !1;
1420
1400
  function vr(e) {
1421
1401
  var t = this, r = t.ownerDocument, n = e.type, i = e.composedPath?.() || [], s = i[0] || e.target;
1422
- xt = e, At || (At = !0, setTimeout(() => {
1423
- At = !1, xt = null;
1402
+ St = e, At || (At = !0, setTimeout(() => {
1403
+ At = !1, St = null;
1424
1404
  }));
1425
- var l = 0, a = xt === e && e[it];
1405
+ var l = 0, a = St === e && e[it];
1426
1406
  if (a) {
1427
- var u = i.indexOf(a);
1428
- if (u !== -1 && (t === document || t === window)) {
1407
+ var f = i.indexOf(a);
1408
+ if (f !== -1 && (t === document || t === window)) {
1429
1409
  e[it] = t;
1430
1410
  return;
1431
1411
  }
1432
1412
  var h = i.indexOf(t);
1433
1413
  if (h === -1) return;
1434
- u <= h && (l = u);
1414
+ f <= h && (l = f);
1435
1415
  }
1436
1416
  if (s = i[l] || e.target, s !== t) {
1437
1417
  He(e, "currentTarget", {
@@ -1443,21 +1423,21 @@ function vr(e) {
1443
1423
  var g = m, c = y;
1444
1424
  V(null), re(null);
1445
1425
  try {
1446
- for (var f, o = []; s !== null && s !== t; ) {
1426
+ for (var u, o = []; s !== null && s !== t; ) {
1447
1427
  try {
1448
1428
  var d = s[it]?.[n];
1449
1429
  d != null && (!s.disabled || e.target === s) && d.call(s, e);
1450
1430
  } catch (_) {
1451
- f ? o.push(_) : f = _;
1431
+ u ? o.push(_) : u = _;
1452
1432
  }
1453
1433
  if (e.cancelBubble) break;
1454
1434
  l++, s = l < i.length ? i[l] : null;
1455
1435
  }
1456
- if (f) {
1436
+ if (u) {
1457
1437
  for (let _ of o) queueMicrotask(() => {
1458
1438
  throw _;
1459
1439
  });
1460
- throw f;
1440
+ throw u;
1461
1441
  }
1462
1442
  } finally {
1463
1443
  e[it] = t, delete e.currentTarget, V(g), re(c);
@@ -1485,21 +1465,21 @@ function vt(e, t) {
1485
1465
  function Je(e, t) {
1486
1466
  var r = (t & 1) !== 0, n = (t & 2) !== 0, i, s = !e.startsWith("<!>");
1487
1467
  return () => {
1488
- if (A)
1489
- return vt(C, null), C;
1468
+ if (x)
1469
+ return vt(A, null), A;
1490
1470
  i === void 0 && (i = Di(s ? e : "<!>" + e), r || (i = /* @__PURE__ */ Oe(i)));
1491
1471
  var l = n || Dr ? document.importNode(i, !0) : i.cloneNode(!0);
1492
1472
  if (r) {
1493
- var a = /* @__PURE__ */ Oe(l), u = l.lastChild;
1494
- vt(a, u);
1473
+ var a = /* @__PURE__ */ Oe(l), f = l.lastChild;
1474
+ vt(a, f);
1495
1475
  } else vt(l, l);
1496
1476
  return l;
1497
1477
  };
1498
1478
  }
1499
- function Te(e, t) {
1500
- if (A) {
1479
+ function xe(e, t) {
1480
+ if (x) {
1501
1481
  var r = y;
1502
- ((r.f & 32768) === 0 || r.nodes.end === null) && (r.nodes.end = C), Ht();
1482
+ ((r.f & 32768) === 0 || r.nodes.end === null) && (r.nodes.end = A), Ht();
1503
1483
  return;
1504
1484
  }
1505
1485
  e !== null && e.before(t);
@@ -1579,7 +1559,7 @@ function Ui(e) {
1579
1559
  let t = 0, r = Ge(0), n;
1580
1560
  return () => {
1581
1561
  Jt() && (v(r), Xt(() => (t === 0 && (n = We(() => e(() => qe(r)))), t += 1, () => {
1582
- ge(() => {
1562
+ ye(() => {
1583
1563
  t -= 1, t === 0 && (n?.(), n = void 0, qe(r));
1584
1564
  });
1585
1565
  })));
@@ -1594,127 +1574,126 @@ var Gi = class {
1594
1574
  is_pending = !1;
1595
1575
  transform_error;
1596
1576
  #e;
1597
- #t = A ? C : null;
1577
+ #t = x ? A : null;
1598
1578
  #r;
1599
- #o;
1600
- #i;
1579
+ #l;
1580
+ #n;
1581
+ #i = null;
1601
1582
  #a = null;
1602
- #n = null;
1603
- #l = null;
1604
1583
  #s = null;
1605
- #p = 0;
1584
+ #o = null;
1585
+ #v = 0;
1606
1586
  #f = 0;
1607
- #u = !1;
1608
- #d = /* @__PURE__ */ new Set();
1609
- #g = /* @__PURE__ */ new Set();
1610
- #c = null;
1611
- #b = Ui(() => (this.#c = Ge(this.#p), () => {
1612
- this.#c = null;
1587
+ #_ = !1;
1588
+ #y = /* @__PURE__ */ new Map();
1589
+ #u = null;
1590
+ #p = Ui(() => (this.#u = Ge(this.#v), () => {
1591
+ this.#u = null;
1613
1592
  }));
1614
1593
  constructor(e, t, r, n) {
1615
- this.#e = e, this.#r = t, this.#o = (i) => {
1594
+ this.#e = e, this.#r = t, this.#l = (i) => {
1616
1595
  var s = y;
1617
1596
  s.b = this, s.f |= 128, r(i);
1618
- }, this.parent = y.b, this.transform_error = n ?? this.parent?.transform_error ?? ((i) => i), this.#i = Yr(() => {
1619
- if (A) {
1620
- const i = Tr(this.#t);
1597
+ }, this.parent = y.b, this.transform_error = n ?? this.parent?.transform_error ?? ((i) => i), this.#n = Yr(() => {
1598
+ if (x) {
1599
+ const i = xr(this.#t);
1621
1600
  Ht();
1622
1601
  const s = i === "[!";
1623
1602
  if (i.startsWith("[?")) {
1624
1603
  const l = JSON.parse(i.slice(2));
1625
- this.#y(l);
1626
- } else s ? this.#k() : this.#$();
1627
- } else this.#h();
1628
- }, Yi), A && (this.#e = C);
1604
+ this.#b(l);
1605
+ } else s ? this.#h() : this.#m();
1606
+ } else this.#w();
1607
+ }, Yi), x && (this.#e = A);
1629
1608
  }
1630
- #$() {
1609
+ #m() {
1631
1610
  try {
1632
- this.#a = ae(() => this.#o(this.#e));
1611
+ this.#i = ae(() => this.#l(this.#e));
1633
1612
  } catch (e) {
1634
1613
  this.error(e);
1635
1614
  }
1636
1615
  }
1637
- #y(e) {
1638
- const t = this.#r.failed, { reset: r, invoke_onerror: n } = this.#w(e);
1639
- ge(n), t && (this.#l = ae(() => {
1616
+ #b(e) {
1617
+ const t = this.#r.failed, { reset: r, invoke_onerror: n } = this.#g(e);
1618
+ ye(n), t && (this.#s = ae(() => {
1640
1619
  t(this.#e, () => e, () => r);
1641
1620
  }));
1642
1621
  }
1643
- #w(e) {
1622
+ #g(e) {
1644
1623
  var t = !1, r = !1;
1645
1624
  const n = () => {
1646
- if (!this.#v()) {
1625
+ if (!this.#c()) {
1647
1626
  if (t) {
1648
1627
  Yn();
1649
1628
  return;
1650
1629
  }
1651
- t = !0, r && si(), this.#l !== null && De(this.#l, () => {
1652
- this.#l = null;
1653
- }), this.#_(() => {
1654
- this.#h();
1630
+ t = !0, r && si(), this.#s !== null && De(this.#s, () => {
1631
+ this.#s = null;
1632
+ }), this.#$(() => {
1633
+ this.#w();
1655
1634
  });
1656
1635
  }
1657
1636
  };
1658
1637
  return {
1659
1638
  reset: n,
1660
1639
  invoke_onerror: () => {
1661
- if (!this.#v())
1640
+ if (!this.#c())
1662
1641
  try {
1663
1642
  r = !0, this.#r.onerror?.(e, n), r = !1;
1664
1643
  } catch (s) {
1665
- X(s, this.#i && this.#i.parent);
1644
+ X(s, this.#n && this.#n.parent);
1666
1645
  }
1667
1646
  }
1668
1647
  };
1669
1648
  }
1670
- #v() {
1671
- return (this.#i.f & (wr | Ot)) !== 0;
1649
+ #c() {
1650
+ return (this.#n.f & (wr | Ot)) !== 0;
1672
1651
  }
1673
- #k() {
1652
+ #h() {
1674
1653
  const e = this.#r.pending;
1675
- e && (this.is_pending = !0, this.#n = ae(() => e(this.#e)), ge(() => {
1676
- if (!this.#v()) {
1677
- var t = this.#s = document.createDocumentFragment(), r = $e(), n = !1;
1678
- if (t.append(r), this.#a = this.#_(() => {
1654
+ e && (this.is_pending = !0, this.#a = ae(() => e(this.#e)), ye(() => {
1655
+ if (!this.#c()) {
1656
+ var t = this.#o = document.createDocumentFragment(), r = $e(), n = !1;
1657
+ if (t.append(r), this.#i = this.#$(() => {
1679
1658
  try {
1680
- return ae(() => this.#o(r));
1659
+ return ae(() => this.#l(r));
1681
1660
  } catch (i) {
1682
1661
  try {
1683
1662
  this.error(i), n = !0;
1684
1663
  } catch (s) {
1685
- X(s, this.#i.parent);
1664
+ X(s, this.#n.parent);
1686
1665
  }
1687
1666
  return null;
1688
1667
  }
1689
- }), this.#a === null) {
1690
- this.#s = null, n && this.#m(w);
1668
+ }), this.#i === null) {
1669
+ this.#o = null, n && this.#d(w);
1691
1670
  return;
1692
1671
  }
1693
- this.#f === 0 && (this.#e.before(t), this.#s = null, De(this.#n, () => {
1694
- this.#n = null;
1695
- }), this.#m(w));
1672
+ this.#f === 0 && (this.#e.before(t), this.#o = null, De(this.#a, () => {
1673
+ this.#a = null;
1674
+ }), this.#d(w));
1696
1675
  }
1697
1676
  }));
1698
1677
  }
1699
- #h() {
1678
+ #w() {
1700
1679
  try {
1701
- if (this.is_pending = this.has_pending_snippet(), this.#f = 0, this.#p = 0, this.#a = ae(() => {
1702
- this.#o(this.#e);
1680
+ if (this.is_pending = this.has_pending_snippet(), this.#f = 0, this.#v = 0, this.#i = ae(() => {
1681
+ this.#l(this.#e);
1703
1682
  }), this.#f > 0) {
1704
- var e = this.#s = document.createDocumentFragment();
1705
- Jr(this.#a, e);
1683
+ var e = this.#o = document.createDocumentFragment();
1684
+ Jr(this.#i, e);
1706
1685
  const t = this.#r.pending;
1707
- this.#n = ae(() => t(this.#e));
1708
- } else this.#m(w);
1686
+ this.#a = ae(() => t(this.#e));
1687
+ } else this.#d(w);
1709
1688
  } catch (t) {
1710
1689
  this.error(t);
1711
1690
  }
1712
1691
  }
1713
- #m(e) {
1714
- this.is_pending = !1, e.transfer_effects(this.#d, this.#g);
1692
+ #d(e) {
1693
+ this.is_pending = !1, e.transfer_reactions(this.#y);
1715
1694
  }
1716
1695
  defer_effect(e) {
1717
- Cr(e, this.#d, this.#g);
1696
+ Cr(e, this.#y);
1718
1697
  }
1719
1698
  is_rendered() {
1720
1699
  return !this.is_pending && (!this.parent || this.parent.is_rendered());
@@ -1722,65 +1701,65 @@ var Gi = class {
1722
1701
  has_pending_snippet() {
1723
1702
  return !!this.#r.pending;
1724
1703
  }
1725
- #_(e) {
1704
+ #$(e) {
1726
1705
  var t = y, r = m, n = T;
1727
- re(this.#i), V(this.#i), Ce(this.#i.ctx);
1706
+ re(this.#n), V(this.#n), Ce(this.#n.ctx);
1728
1707
  try {
1729
1708
  return Ie.ensure(), e();
1730
1709
  } finally {
1731
1710
  re(t), V(r), Ce(n);
1732
1711
  }
1733
1712
  }
1734
- #E(e, t) {
1713
+ #k(e, t) {
1735
1714
  if (!this.has_pending_snippet()) {
1736
- this.parent && this.parent.#E(e, t);
1715
+ this.parent && this.parent.#k(e, t);
1737
1716
  return;
1738
1717
  }
1739
- this.#f += e, this.#f === 0 && (this.#m(t), this.#n && De(this.#n, () => {
1740
- this.#n = null;
1741
- }), this.#s && (this.#e.before(this.#s), this.#s = null));
1718
+ this.#f += e, this.#f === 0 && (this.#d(t), this.#a && De(this.#a, () => {
1719
+ this.#a = null;
1720
+ }), this.#o && (this.#e.before(this.#o), this.#o = null));
1742
1721
  }
1743
1722
  update_pending_count(e, t) {
1744
- this.#E(e, t), this.#p += e, !(!this.#c || this.#u) && (this.#u = !0, ge(() => {
1745
- this.#u = !1, this.#c && mt(this.#c, this.#p);
1723
+ this.#k(e, t), this.#v += e, !(!this.#u || this.#_) && (this.#_ = !0, ye(() => {
1724
+ this.#_ = !1, this.#u && mt(this.#u, this.#v);
1746
1725
  }));
1747
1726
  }
1748
1727
  get_effect_pending() {
1749
- return this.#b(), v(this.#c);
1728
+ return this.#p(), v(this.#u);
1750
1729
  }
1751
1730
  error(e) {
1752
1731
  if (e === ce || !this.#r.onerror && !this.#r.failed) throw e;
1753
- w?.is_fork ? (this.#a && w.skip_effect(this.#a), this.#n && w.skip_effect(this.#n), this.#l && w.skip_effect(this.#l), w.oncommit(() => {
1754
- this.#v() || this.#T(e);
1755
- })) : this.#T(e);
1732
+ w?.is_fork ? (this.#i && w.skip_effect(this.#i), this.#a && w.skip_effect(this.#a), this.#s && w.skip_effect(this.#s), w.oncommit(() => {
1733
+ this.#c() || this.#E(e);
1734
+ })) : this.#E(e);
1756
1735
  }
1757
- #T(e) {
1758
- this.#a && (q(this.#a), this.#a = null), this.#n && (q(this.#n), this.#n = null), this.#l && (q(this.#l), this.#l = null), A && (te(this.#t), Vn(), te(Er()));
1736
+ #E(e) {
1737
+ this.#i && (D(this.#i), this.#i = null), this.#a && (D(this.#a), this.#a = null), this.#s && (D(this.#s), this.#s = null), x && (te(this.#t), Vn(), te(Er()));
1759
1738
  let t = this.#r.failed;
1760
1739
  const r = (n) => {
1761
- if (this.#v()) return;
1762
- const { reset: i, invoke_onerror: s } = this.#w(n);
1763
- s(), t && !this.#v() && (this.#l = this.#_(() => {
1740
+ if (this.#c()) return;
1741
+ const { reset: i, invoke_onerror: s } = this.#g(n);
1742
+ s(), t && !this.#c() && (this.#s = this.#$(() => {
1764
1743
  try {
1765
1744
  return ae(() => {
1766
1745
  var l = y;
1767
1746
  l.b = this, l.f |= 128, t(this.#e, () => n, () => i);
1768
1747
  });
1769
1748
  } catch (l) {
1770
- return X(l, this.#i.parent), null;
1749
+ return X(l, this.#n.parent), null;
1771
1750
  }
1772
1751
  }));
1773
1752
  };
1774
- ge(() => {
1775
- if (!this.#v()) {
1753
+ ye(() => {
1754
+ if (!this.#c()) {
1776
1755
  var n;
1777
1756
  try {
1778
1757
  n = this.transform_error(e);
1779
1758
  } catch (i) {
1780
- X(i, this.#i && this.#i.parent);
1759
+ X(i, this.#n && this.#n.parent);
1781
1760
  return;
1782
1761
  }
1783
- n !== null && typeof n == "object" && typeof n.then == "function" ? n.then(r, (i) => X(i, this.#i && this.#i.parent)) : r(n);
1762
+ n !== null && typeof n == "object" && typeof n.then == "function" ? n.then(r, (i) => X(i, this.#n && this.#n.parent)) : r(n);
1784
1763
  }
1785
1764
  });
1786
1765
  }
@@ -1794,61 +1773,61 @@ function sn(e, t) {
1794
1773
  }
1795
1774
  function Ki(e, t) {
1796
1775
  jt(), t.intro = t.intro ?? !1;
1797
- const r = t.target, n = A, i = C;
1776
+ const r = t.target, n = x, i = A;
1798
1777
  try {
1799
- for (var s = /* @__PURE__ */ Oe(r); s && (s.nodeType !== 8 || s.data !== "["); ) s = /* @__PURE__ */ de(s);
1778
+ for (var s = /* @__PURE__ */ Oe(r); s && (s.nodeType !== 8 || s.data !== "["); ) s = /* @__PURE__ */ ve(s);
1800
1779
  if (!s) throw ce;
1801
- Se(!0), te(s);
1780
+ Te(!0), te(s);
1802
1781
  const l = an(e, {
1803
1782
  ...t,
1804
1783
  anchor: s
1805
1784
  });
1806
- return Se(!1), l;
1785
+ return Te(!1), l;
1807
1786
  } catch (l) {
1808
1787
  if (l instanceof Error && l.message.split(`
1809
1788
  `).some((a) => a.startsWith("https://svelte.dev/e/"))) throw l;
1810
- return l !== ce && console.warn("Failed to hydrate: ", l), t.recover === !1 && ei(), jt(), $i(r), Se(!1), sn(e, t);
1789
+ return l !== ce && console.warn("Failed to hydrate: ", l), t.recover === !1 && ei(), jt(), $i(r), Te(!1), sn(e, t);
1811
1790
  } finally {
1812
- Se(n), te(i);
1791
+ Te(n), te(i);
1813
1792
  }
1814
1793
  }
1815
1794
  var at = /* @__PURE__ */ new Map();
1816
1795
  function an(e, { target: t, anchor: r, props: n = {}, events: i, context: s, intro: l = !0, transformError: a }) {
1817
1796
  jt();
1818
- var u = void 0, h = Ci(() => {
1797
+ var f = void 0, h = Ci(() => {
1819
1798
  var g = r ?? t.appendChild($e());
1820
1799
  Vi(g, { pending: () => {
1821
1800
  } }, (o) => {
1822
1801
  Ft({});
1823
1802
  var d = T;
1824
- if (s && (d.c = s), i && (n.$$events = i), A && vt(o, null), hr = l, u = e(o, n) || Ut(), hr = !0, A && (y.nodes.end = C, C === null || C.nodeType !== 8 || C.data !== "]"))
1803
+ if (s && (d.c = s), i && (n.$$events = i), x && vt(o, null), hr = l, f = e(o, n) || Ut(), hr = !0, x && (y.nodes.end = A, A === null || A.nodeType !== 8 || A.data !== "]"))
1825
1804
  throw wt(), ce;
1826
1805
  Bt();
1827
1806
  }, a);
1828
- var c = /* @__PURE__ */ new Set(), f = (o) => {
1807
+ var c = /* @__PURE__ */ new Set(), u = (o) => {
1829
1808
  for (var d = 0; d < o.length; d++) {
1830
1809
  var _ = o[d];
1831
1810
  if (!c.has(_)) {
1832
1811
  c.add(_);
1833
1812
  var b = Fi(_);
1834
1813
  for (const W of [t, document]) {
1835
- var O = at.get(W);
1836
- O === void 0 && (O = /* @__PURE__ */ new Map(), at.set(W, O));
1837
- var R = O.get(_);
1838
- R === void 0 ? (W.addEventListener(_, vr, { passive: b }), O.set(_, 1)) : O.set(_, R + 1);
1814
+ var C = at.get(W);
1815
+ C === void 0 && (C = /* @__PURE__ */ new Map(), at.set(W, C));
1816
+ var R = C.get(_);
1817
+ R === void 0 ? (W.addEventListener(_, vr, { passive: b }), C.set(_, 1)) : C.set(_, R + 1);
1839
1818
  }
1840
1819
  }
1841
1820
  }
1842
1821
  };
1843
- return f(Mn(ji)), dr.add(f), () => {
1822
+ return u(Mn(ji)), dr.add(u), () => {
1844
1823
  for (var o of c) for (const b of [t, document]) {
1845
1824
  var d = at.get(b), _ = d.get(o);
1846
1825
  --_ == 0 ? (b.removeEventListener(o, vr), d.delete(o), d.size === 0 && at.delete(b)) : d.set(o, _);
1847
1826
  }
1848
- dr.delete(f), g !== r && g.parentNode?.removeChild(g);
1827
+ dr.delete(u), g !== r && g.parentNode?.removeChild(g);
1849
1828
  };
1850
1829
  });
1851
- return Lt.set(u, h), u;
1830
+ return Lt.set(f, h), f;
1852
1831
  }
1853
1832
  var Lt = /* @__PURE__ */ new WeakMap();
1854
1833
  function Wi(e, t) {
@@ -1860,16 +1839,16 @@ var Ji = class {
1860
1839
  #e = /* @__PURE__ */ new Map();
1861
1840
  #t = /* @__PURE__ */ new Map();
1862
1841
  #r = /* @__PURE__ */ new Map();
1863
- #o = /* @__PURE__ */ new Set();
1864
- #i = !0;
1842
+ #l = /* @__PURE__ */ new Set();
1843
+ #n = !0;
1865
1844
  constructor(e, t = !0) {
1866
- this.anchor = e, this.#i = t;
1845
+ this.anchor = e, this.#n = t;
1867
1846
  }
1868
- #a = (e) => {
1847
+ #i = (e) => {
1869
1848
  if (this.#e.has(e)) {
1870
1849
  var t = this.#e.get(e), r = this.#t.get(t);
1871
1850
  if (r)
1872
- or(r), this.#o.delete(t);
1851
+ or(r), this.#l.delete(t);
1873
1852
  else {
1874
1853
  var n = this.#r.get(t);
1875
1854
  n && (or(n.effect), this.#t.set(t, n.effect), this.#r.delete(t), n.fragment.lastChild.remove(), this.anchor.before(n.fragment), r = n.effect);
@@ -1877,10 +1856,10 @@ var Ji = class {
1877
1856
  for (const [i, s] of this.#e) {
1878
1857
  if (this.#e.delete(i), i === e) break;
1879
1858
  const l = this.#r.get(s);
1880
- l && (q(l.effect), this.#r.delete(s));
1859
+ l && (D(l.effect), this.#r.delete(s));
1881
1860
  }
1882
1861
  for (const [i, s] of this.#t) {
1883
- if (i === t || this.#o.has(i)) continue;
1862
+ if (i === t || this.#l.has(i)) continue;
1884
1863
  const l = () => {
1885
1864
  if (Array.from(this.#e.values()).includes(i)) {
1886
1865
  var a = document.createDocumentFragment();
@@ -1888,17 +1867,17 @@ var Ji = class {
1888
1867
  effect: s,
1889
1868
  fragment: a
1890
1869
  });
1891
- } else q(s);
1892
- this.#o.delete(i), this.#t.delete(i);
1870
+ } else D(s);
1871
+ this.#l.delete(i), this.#t.delete(i);
1893
1872
  };
1894
- this.#i || !r ? (this.#o.add(i), De(s, l, !1)) : l();
1873
+ this.#n || !r ? (this.#l.add(i), De(s, l, !1)) : l();
1895
1874
  }
1896
1875
  }
1897
1876
  };
1898
- #n = (e) => {
1877
+ #a = (e) => {
1899
1878
  this.#e.delete(e);
1900
1879
  const t = Array.from(this.#e.values());
1901
- for (const [r, n] of this.#r) t.includes(r) || (q(n.effect), this.#r.delete(r));
1880
+ for (const [r, n] of this.#r) t.includes(r) || (D(n.effect), this.#r.delete(r));
1902
1881
  };
1903
1882
  ensure(e, t) {
1904
1883
  var r = w, n = ki();
@@ -1913,9 +1892,9 @@ var Ji = class {
1913
1892
  if (this.#e.set(r, e), n) {
1914
1893
  for (const [l, a] of this.#t) l === e ? r.unskip_effect(a) : r.skip_effect(a);
1915
1894
  for (const [l, a] of this.#r) l === e ? r.unskip_effect(a.effect) : r.skip_effect(a.effect);
1916
- r.oncommit(this.#a), r.ondiscard(this.#n);
1895
+ r.oncommit(this.#i), r.ondiscard(this.#a);
1917
1896
  } else
1918
- A && (this.anchor = C), this.#a(r);
1897
+ x && (this.anchor = A), this.#i(r);
1919
1898
  }
1920
1899
  };
1921
1900
  function Xi(e) {
@@ -1934,23 +1913,23 @@ function Zi(e) {
1934
1913
  }
1935
1914
  function lt(e, t, r = !1) {
1936
1915
  var n;
1937
- A && (n = C, Ht());
1916
+ x && (n = A, Ht());
1938
1917
  var i = new Ji(e), s = r ? zt : 0;
1939
- function l(a, u) {
1940
- if (A) {
1941
- var h = Tr(n);
1918
+ function l(a, f) {
1919
+ if (x) {
1920
+ var h = xr(n);
1942
1921
  if (a !== parseInt(h.substring(1))) {
1943
1922
  var g = Er();
1944
- te(g), i.anchor = g, Se(!1), i.ensure(a, u), Se(!0);
1923
+ te(g), i.anchor = g, Te(!1), i.ensure(a, f), Te(!0);
1945
1924
  return;
1946
1925
  }
1947
1926
  }
1948
- i.ensure(a, u);
1927
+ i.ensure(a, f);
1949
1928
  }
1950
1929
  Yr(() => {
1951
1930
  var a = !1;
1952
- t((u, h = 0) => {
1953
- a = !0, l(h, u);
1931
+ t((f, h = 0) => {
1932
+ a = !0, l(h, f);
1954
1933
  }), a || l(-1, null);
1955
1934
  }, s);
1956
1935
  }
@@ -1980,23 +1959,24 @@ function Qi(e, t, r) {
1980
1959
  }
1981
1960
  function es(e, t, r, n, i, s) {
1982
1961
  var l = e[Rt];
1983
- if (A || l !== r || l === void 0) {
1962
+ if (x || l !== r || l === void 0) {
1984
1963
  var a = Qi(r, n, s);
1985
- (!A || a !== e.getAttribute("class")) && (a == null ? e.removeAttribute("class") : t ? e.className = a : e.setAttribute("class", a)), e[Rt] = r;
1986
- } else if (s && i !== s) for (var u in s) {
1987
- var h = !!s[u];
1988
- (i == null || h !== !!i[u]) && e.classList.toggle(u, h);
1964
+ (!x || a !== e.getAttribute("class")) && (a == null ? e.removeAttribute("class") : t ? e.className = a : e.setAttribute("class", a)), e[Rt] = r;
1965
+ } else if (s && i !== s) for (var f in s) {
1966
+ var h = !!s[f];
1967
+ (i == null || h !== !!i[f]) && e.classList.toggle(f, h);
1989
1968
  }
1990
1969
  return s;
1991
1970
  }
1992
1971
  var ts = /* @__PURE__ */ Symbol("is custom element"), rs = /* @__PURE__ */ Symbol("is html"), ns = Bn ? "link" : "LINK";
1993
1972
  function Ee(e, t, r, n) {
1994
1973
  var i = is(e);
1995
- if (A && (i[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === ns)) {
1974
+ if (x && (i[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === ns)) {
1996
1975
  n || void 0;
1997
1976
  return;
1998
1977
  }
1999
- i[t] !== (i[t] = r) && (t === "loading" && (e[zn] = r), r == null ? e.removeAttribute(t) : typeof r != "string" && ss(e).has(t) ? e[t] = r : e.setAttribute(t, r));
1978
+ var s = i[t];
1979
+ s !== (i[t] = r) && (t === "loading" && (e[zn] = r), r == null ? e.removeAttribute(t) : typeof r != "string" && ss(e).has(t) ? e[t] = r : x && (typeof r == "number" || typeof r == "boolean") && s === String(r) || e.setAttribute(t, r));
2000
1980
  }
2001
1981
  function is(e) {
2002
1982
  return e[kr] ??= {
@@ -2028,12 +2008,12 @@ function gr(e = Ut(), t, r, n) {
2028
2008
  Ct(r(...a), e) || (t(e, ...a), l && Ct(r(...l), e) && t(null, ...l));
2029
2009
  });
2030
2010
  }), () => {
2031
- let u = s;
2032
- for (; u !== i && u.parent !== null && u.parent.f & 33554432; ) u = u.parent;
2011
+ let f = s;
2012
+ for (; f !== i && f.parent !== null && f.parent.f & 33554432; ) f = f.parent;
2033
2013
  const h = () => {
2034
2014
  a && Ct(r(...a), e) && t(null, ...a);
2035
- }, g = u.teardown;
2036
- u.teardown = () => {
2015
+ }, g = f.teardown;
2016
+ f.teardown = () => {
2037
2017
  h(), g?.();
2038
2018
  };
2039
2019
  };
@@ -2049,18 +2029,18 @@ function as(e) {
2049
2029
  }
2050
2030
  }
2051
2031
  function Z(e, t, r, n) {
2052
- var i = !Ye || (r & 2) !== 0, s = (r & 8) !== 0, l = (r & 16) !== 0, a = n, u = !0, h = void 0, g = () => l && i ? (h ??= /* @__PURE__ */ Fe(n), v(h)) : (u && (u = !1, a = l ? We(n) : n), a);
2032
+ var i = !Ye || (r & 2) !== 0, s = (r & 8) !== 0, l = (r & 16) !== 0, a = n, f = !0, h = void 0, g = () => l && i ? (h ??= /* @__PURE__ */ Fe(n), v(h)) : (f && (f = !1, a = l ? We(n) : n), a);
2053
2033
  let c;
2054
2034
  if (s) {
2055
- var f = Pe in e || $r in e;
2056
- c = me(e, t)?.set ?? (f && t in e ? (k) => e[t] = k : void 0);
2035
+ var u = Pe in e || $r in e;
2036
+ c = we(e, t)?.set ?? (u && t in e ? (k) => e[t] = k : void 0);
2057
2037
  }
2058
2038
  var o, d = !1;
2059
2039
  s ? [o, d] = as(() => e[t]) : o = e[t], o === void 0 && n !== void 0 && (o = g(), c && (i && ti(t), c(o)));
2060
2040
  var _;
2061
2041
  if (i ? _ = () => {
2062
2042
  var k = e[t];
2063
- return k === void 0 ? g() : (u = !0, k);
2043
+ return k === void 0 ? g() : (f = !0, k);
2064
2044
  } : _ = () => {
2065
2045
  var k = e[t];
2066
2046
  return k !== void 0 && (a = void 0), k === void 0 ? a : k;
@@ -2071,15 +2051,15 @@ function Z(e, t, r, n) {
2071
2051
  return arguments.length > 0 ? ((!i || !G || b || d) && c(G ? _() : k), k) : _();
2072
2052
  });
2073
2053
  }
2074
- var O = !1, R = ((r & 1) !== 0 ? Fe : Rr)(() => (O = !1, _()));
2054
+ var C = !1, R = ((r & 1) !== 0 ? Fe : Rr)(() => (C = !1, _()));
2075
2055
  s && v(R);
2076
2056
  var W = y;
2077
2057
  return (function(k, G) {
2078
2058
  if (arguments.length > 0) {
2079
- const H = G ? v(R) : i && s ? xe(k) : k;
2080
- return $(R, H), O = !0, a !== void 0 && (a = H), k;
2059
+ const H = G ? v(R) : i && s ? Se(k) : k;
2060
+ return $(R, H), C = !0, a !== void 0 && (a = H), k;
2081
2061
  }
2082
- return le && O || (W.f & 16384) !== 0 ? R.v : v(R);
2062
+ return le && C || (W.f & 16384) !== 0 ? R.v : v(R);
2083
2063
  });
2084
2064
  }
2085
2065
  function ls(e) {
@@ -2179,7 +2159,7 @@ typeof HTMLElement == "function" && (on = class extends HTMLElement {
2179
2159
  let e = function(n) {
2180
2160
  return (i) => {
2181
2161
  const s = Wt("slot");
2182
- n !== "default" && (s.name = n), Te(i, s);
2162
+ n !== "default" && (s.name = n), xe(i, s);
2183
2163
  };
2184
2164
  };
2185
2165
  if (await Promise.resolve(), !this.$$cn || this.$$c) return;
@@ -2275,10 +2255,10 @@ function fn(e, t, r, n, i, s) {
2275
2255
  get() {
2276
2256
  return this.$$c && a in this.$$c ? this.$$c[a] : this.$$d[a];
2277
2257
  },
2278
- set(u) {
2279
- u = ht(a, u, t), this.$$d[a] = u;
2258
+ set(f) {
2259
+ f = ht(a, f, t), this.$$d[a] = f;
2280
2260
  var h = this.$$c;
2281
- h && (me(h, a)?.get ? h[a] = u : h.$set({ [a]: u }));
2261
+ h && (we(h, a)?.get ? h[a] = f : h.$set({ [a]: f }));
2282
2262
  }
2283
2263
  });
2284
2264
  }), n.forEach((a) => {
@@ -2329,13 +2309,13 @@ function un(e, t) {
2329
2309
  "basic",
2330
2310
  "scientific",
2331
2311
  "graphing"
2332
- ]), l = Z(t, "calculatorConfig", 23, () => ({})), a = /* @__PURE__ */ j(null), u = /* @__PURE__ */ j(null), h = /* @__PURE__ */ j(null), g = /* @__PURE__ */ j(null), c = /* @__PURE__ */ j(!1), f = /* @__PURE__ */ j(null), o = /* @__PURE__ */ j(!1);
2333
- const d = /* @__PURE__ */ he(() => An(v(h))), _ = /* @__PURE__ */ he(() => v(h)?.toolkitCoordinator), b = /* @__PURE__ */ he(() => xn(n())?.baseToolId ?? n()), O = /* @__PURE__ */ he(() => (typeof s() == "string" ? s().split(",").map((p) => p.trim()) : s()).filter((p) => p === "basic" || p === "scientific" || p === "graphing")), R = /* @__PURE__ */ he(() => v(O).includes(i()) ? i() : v(O)[0] ?? "basic"), W = /* @__PURE__ */ he(() => us(l())), k = /* @__PURE__ */ he(() => v(g)?.provider.attribution ?? null);
2312
+ ]), l = Z(t, "calculatorConfig", 23, () => ({})), a = /* @__PURE__ */ j(null), f = /* @__PURE__ */ j(null), h = /* @__PURE__ */ j(null), g = /* @__PURE__ */ j(null), c = /* @__PURE__ */ j(!1), u = /* @__PURE__ */ j(null), o = /* @__PURE__ */ j(!1);
2313
+ const d = /* @__PURE__ */ _e(() => An(v(h))), _ = /* @__PURE__ */ _e(() => v(h)?.toolkitCoordinator), b = /* @__PURE__ */ _e(() => Sn(n())?.baseToolId ?? n()), C = /* @__PURE__ */ _e(() => (typeof s() == "string" ? s().split(",").map((p) => p.trim()) : s()).filter((p) => p === "basic" || p === "scientific" || p === "graphing")), R = /* @__PURE__ */ _e(() => v(C).includes(i()) ? i() : v(C)[0] ?? "basic"), W = /* @__PURE__ */ _e(() => us(l())), k = /* @__PURE__ */ _e(() => v(g)?.provider.attribution ?? null);
2334
2314
  let G = null, H = null, ie = null, oe = 0, $t = !1, Xe = null;
2335
2315
  const Ze = /* @__PURE__ */ new Set();
2336
2316
  dt(() => {
2337
2317
  if (v(a))
2338
- return Sn(v(a), (p) => {
2318
+ return Tn(v(a), (p) => {
2339
2319
  $(h, p, !0);
2340
2320
  });
2341
2321
  });
@@ -2379,7 +2359,7 @@ function un(e, t) {
2379
2359
  }
2380
2360
  async function vn(p, S, E) {
2381
2361
  const I = () => p !== oe || !r() || !E.isConnected;
2382
- $(c, !0), $(f, null);
2362
+ $(c, !0), $(u, null);
2383
2363
  try {
2384
2364
  if (!v(_)) throw new Error("Calculator provider registry is unavailable");
2385
2365
  const se = await v(_).ensureProviderReady(v(b)), kt = await se.createInstance();
@@ -2387,29 +2367,29 @@ function un(e, t) {
2387
2367
  E.remove();
2388
2368
  return;
2389
2369
  }
2390
- const ve = await kt.createCalculator(v(R), E, l());
2370
+ const he = await kt.createCalculator(v(R), E, l());
2391
2371
  if (I()) {
2392
- ve.destroy(), E.remove();
2372
+ he.destroy(), E.remove();
2393
2373
  return;
2394
2374
  }
2395
- $(g, ve, !0), G = S, H = se, $(o, E.childElementCount > 0), dn(ve, E), requestAnimationFrame(() => {
2396
- p === oe && (ve.resize?.(), $(o, E.childElementCount > 0), er());
2375
+ $(g, he, !0), G = S, H = se, $(o, E.childElementCount > 0), dn(he, E), requestAnimationFrame(() => {
2376
+ p === oe && (he.resize?.(), $(o, E.childElementCount > 0), er());
2397
2377
  });
2398
2378
  } catch (se) {
2399
2379
  if (p !== oe) {
2400
2380
  E.remove();
2401
2381
  return;
2402
2382
  }
2403
- $(f, se instanceof Error ? se.message : String(se), !0), $(g, null), ie === E && (ie = null), E.remove(), $(o, !1);
2383
+ $(u, se instanceof Error ? se.message : String(se), !0), $(g, null), ie === E && (ie = null), E.remove(), $(o, !1);
2404
2384
  } finally {
2405
2385
  p === oe && $(c, !1);
2406
2386
  }
2407
2387
  }
2408
2388
  function hn() {
2409
2389
  $t = !1;
2410
- const p = v(u), S = v(_);
2390
+ const p = v(f), S = v(_);
2411
2391
  if (!r() || !p || !p.isConnected || !S) {
2412
- (v(g) || v(c) || ie) && Qe(), $(f, null);
2392
+ (v(g) || v(c) || ie) && Qe(), $(u, null);
2413
2393
  return;
2414
2394
  }
2415
2395
  const E = `${v(b)}:${v(R)}:${v(W)}`;
@@ -2439,7 +2419,7 @@ function un(e, t) {
2439
2419
  });
2440
2420
  });
2441
2421
  }), dt(() => {
2442
- r(), v(b), v(R), l(), v(W), v(u), v(_), We(tr);
2422
+ r(), v(b), v(R), l(), v(W), v(f), v(_), We(tr);
2443
2423
  }), Xi(() => () => Qe());
2444
2424
  var pn = {
2445
2425
  get visible() {
@@ -2480,42 +2460,42 @@ function un(e, t) {
2480
2460
  var S = hs();
2481
2461
  let E;
2482
2462
  var I = ct(S);
2483
- gr(I, (N) => $(u, N), () => v(u));
2463
+ gr(I, (N) => $(f, N), () => v(f));
2484
2464
  var se = rt(I, 2), kt = (N) => {
2485
- var F = cs(), fe = St(F, !0);
2465
+ var F = cs(), fe = Tt(F, !0);
2486
2466
  nt(() => {
2487
2467
  Ee(F, "href", v(k).href), st(fe, v(k).label);
2488
- }), Te(N, F);
2468
+ }), xe(N, F);
2489
2469
  };
2490
2470
  lt(se, (N) => {
2491
2471
  v(k) && N(kt);
2492
2472
  });
2493
- var ve = rt(se, 2), mn = (N) => {
2494
- var F = ds(), fe = St(F, !0);
2495
- nt((Et) => st(fe, Et), [() => v(d).t("tools.calculator.loading")]), Te(N, F);
2473
+ var he = rt(se, 2), mn = (N) => {
2474
+ var F = ds(), fe = Tt(F, !0);
2475
+ nt((Et) => st(fe, Et), [() => v(d).t("tools.calculator.loading")]), xe(N, F);
2496
2476
  };
2497
- lt(ve, (N) => {
2498
- (v(c) || !v(f) && !v(o)) && N(mn);
2477
+ lt(he, (N) => {
2478
+ (v(c) || !v(u) && !v(o)) && N(mn);
2499
2479
  });
2500
- var wn = rt(ve, 2), bn = (N) => {
2501
- var F = vs(), fe = ct(F), Et = rt(fe), $n = St(Et, !0);
2480
+ var wn = rt(he, 2), bn = (N) => {
2481
+ var F = vs(), fe = ct(F), Et = rt(fe), $n = Tt(Et, !0);
2502
2482
  ft(F), nt((kn) => {
2503
- st(fe, `${kn ?? ""} `), st($n, v(f));
2504
- }, [() => v(d).t("tools.calculator.initFailed")]), Te(N, F);
2483
+ st(fe, `${kn ?? ""} `), st($n, v(u));
2484
+ }, [() => v(d).t("tools.calculator.initFailed")]), xe(N, F);
2505
2485
  };
2506
2486
  lt(wn, (N) => {
2507
- v(f) && N(bn);
2487
+ v(u) && N(bn);
2508
2488
  }), ft(S), nt((N, F, fe) => {
2509
2489
  E = es(S, 1, "pie-tool-calculator notranslate svelte-16ps7c2", null, E, { "pie-tool-calculator--attributed": v(k) !== null }), Ee(S, "data-pie-tool-id", n()), Ee(S, "lang", N), Ee(S, "dir", F), Ee(S, "aria-label", fe), Ee(I, "data-calculator-type", v(R)), S.dir = S.dir;
2510
2490
  }, [
2511
2491
  () => v(d).getLocale(),
2512
2492
  () => v(d).getDirection?.() ?? "ltr",
2513
2493
  () => v(d).t("tools.calculator.toolA11y")
2514
- ]), Te(p, S);
2494
+ ]), xe(p, S);
2515
2495
  };
2516
2496
  return lt(gn, (p) => {
2517
2497
  r() && p(yn);
2518
- }), ft(et), gr(et, (p) => $(a, p), () => v(a)), Te(e, et), Bt(pn);
2498
+ }), ft(et), gr(et, (p) => $(a, p), () => v(a)), xe(e, et), Bt(pn);
2519
2499
  }
2520
2500
  fn(un, {
2521
2501
  visible: {},
@@ -2539,36 +2519,36 @@ function cn(e, t) {
2539
2519
  get visible() {
2540
2520
  return r();
2541
2521
  },
2542
- set visible(u = !1) {
2543
- r(u), U();
2522
+ set visible(f = !1) {
2523
+ r(f), U();
2544
2524
  },
2545
2525
  get toolId() {
2546
2526
  return n();
2547
2527
  },
2548
- set toolId(u = "calculator") {
2549
- n(u), U();
2528
+ set toolId(f = "calculator") {
2529
+ n(f), U();
2550
2530
  },
2551
2531
  get calculatorType() {
2552
2532
  return i();
2553
2533
  },
2554
- set calculatorType(u = "basic") {
2555
- i(u), U();
2534
+ set calculatorType(f = "basic") {
2535
+ i(f), U();
2556
2536
  },
2557
2537
  get availableTypes() {
2558
2538
  return s();
2559
2539
  },
2560
- set availableTypes(u = [
2540
+ set availableTypes(f = [
2561
2541
  "basic",
2562
2542
  "scientific",
2563
2543
  "graphing"
2564
2544
  ]) {
2565
- s(u), U();
2545
+ s(f), U();
2566
2546
  },
2567
2547
  get calculatorConfig() {
2568
2548
  return l();
2569
2549
  },
2570
- set calculatorConfig(u = {}) {
2571
- l(u), U();
2550
+ set calculatorConfig(f = {}) {
2551
+ l(f), U();
2572
2552
  }
2573
2553
  };
2574
2554
  return un(e, {
@@ -2607,6 +2587,6 @@ fn(cn, {
2607
2587
  type: "Array"
2608
2588
  },
2609
2589
  calculatorConfig: { type: "Object" }
2610
- }, [], [], void 0, Tn);
2590
+ }, [], [], void 0, xn);
2611
2591
  var ms = cn.element;
2612
2592
  En(gs.tag, ms);