@pie-players/pie-tool-calculator-shared 0.3.73 → 0.3.74

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,91 +1,2556 @@
1
- import { t as g } from "./CalculatorTool-Dhv9G4lI.js";
2
- import "svelte/internal/disclose-version";
3
- import * as t from "svelte/internal/client";
4
- import { defineCustomElementSafely as v } from "@pie-players/pie-players-shared";
5
- var b = { tag: "pie-tool-calculator" }, y = {
6
- hash: "svelte-2sv5xw",
7
- code: ".pie-tool-calculator__container .dcg-container {width:100% !important;height:100% !important;}"
1
+ import { defineCustomElementSafely as hn } from "@pie-players/pie-players-shared";
2
+ import { coerceBooleanAttributes as _n } from "@pie-players/pie-players-shared/ui/attribute-coercion";
3
+ import { connectToolRuntimeContext as pn } from "@pie-players/pie-assessment-toolkit";
4
+ import { resolveInterfaceI18n as gn } from "@pie-players/pie-players-shared/i18n/provider";
5
+ typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add("5");
6
+ var $e = {}, I = /* @__PURE__ */ Symbol("uninitialized");
7
+ var yn = "http://www.w3.org/1999/xhtml", mn = Array.isArray, wn = Array.prototype.indexOf, st = Array.prototype.includes, bn = Array.from, at = Object.keys, Le = Object.defineProperty, ve = Object.getOwnPropertyDescriptor, $n = Object.getOwnPropertyDescriptors, kn = Object.prototype, En = Array.prototype, hr = Object.getPrototypeOf, Jt = Object.isExtensible, Tn = () => {
8
8
  };
9
- function p(s, r) {
10
- t.push(r, !0), t.append_styles(s, y);
11
- let o = t.prop(r, "visible", 7, !1), l = t.prop(r, "toolId", 7, "calculator"), a = t.prop(r, "providerId", 7, "calculator-desmos"), i = t.prop(r, "calculatorType", 7, "basic"), c = t.prop(r, "availableTypes", 23, () => [
9
+ function Sn(e) {
10
+ for (var t = 0; t < e.length; t++) e[t]();
11
+ }
12
+ function _r() {
13
+ var e, t;
14
+ return {
15
+ promise: new Promise((r, n) => {
16
+ e = r, t = n;
17
+ }),
18
+ resolve: e,
19
+ reject: t
20
+ };
21
+ }
22
+ var vs = 1 << 24, Y = 1024, B = 2048, _e = 4096, Mt = 8192, xn = 16384, Nt = 32768, Xt = 1 << 25, jt = 65536, hs = 1 << 17, _s = 1 << 18, Se = 1 << 19, Cn = 1 << 20, Zt = 1 << 21, An = 1 << 22, lt = 1 << 23, Re = /* @__PURE__ */ Symbol("$state"), pr = /* @__PURE__ */ Symbol("component"), gr = /* @__PURE__ */ Symbol("legacy props"), On = /* @__PURE__ */ Symbol(""), In = /* @__PURE__ */ Symbol("proxy path"), yr = /* @__PURE__ */ Symbol("attributes"), Rn = /* @__PURE__ */ Symbol("class"), Mn = /* @__PURE__ */ Symbol("style"), Tt = /* @__PURE__ */ Symbol("text");
23
+ var ze = new class extends Error {
24
+ name = "StaleReactionError";
25
+ message = "The reaction that called `getAbortSignal()` was re-run or destroyed";
26
+ }(), Nn = !!globalThis.document?.contentType && /* @__PURE__ */ globalThis.document.contentType.includes("xml");
27
+ function jn() {
28
+ console.warn("https://svelte.dev/e/derived_inert");
29
+ }
30
+ function ct(e) {
31
+ console.warn("https://svelte.dev/e/hydration_mismatch");
32
+ }
33
+ function Pn() {
34
+ console.warn("https://svelte.dev/e/svelte_boundary_reset_noop");
35
+ }
36
+ var O = !1;
37
+ function we(e) {
38
+ O = e;
39
+ }
40
+ var x;
41
+ function ee(e) {
42
+ if (e === null)
43
+ throw ct(), $e;
44
+ return x = e;
45
+ }
46
+ function Pt() {
47
+ return ee(/* @__PURE__ */ le(x));
48
+ }
49
+ function Qe(e) {
50
+ if (O) {
51
+ if (/* @__PURE__ */ le(x) !== null)
52
+ throw ct(), $e;
53
+ x = e;
54
+ }
55
+ }
56
+ function Ln(e = 1) {
57
+ if (O) {
58
+ for (var t = e, r = x; t--; ) r = /* @__PURE__ */ le(r);
59
+ x = r;
60
+ }
61
+ }
62
+ function mr(e = !0) {
63
+ for (var t = 0, r = x; ; ) {
64
+ if (r.nodeType === 8) {
65
+ var n = r.data;
66
+ if (n === "]") {
67
+ if (t === 0) return r;
68
+ t -= 1;
69
+ } else (n === "[" || n === "[!" || n[0] === "[" && !isNaN(Number(n.slice(1)))) && (t += 1);
70
+ }
71
+ var i = /* @__PURE__ */ le(r);
72
+ e && r.remove(), r = i;
73
+ }
74
+ }
75
+ function qn(e) {
76
+ if (!e || e.nodeType !== 8)
77
+ throw ct(), $e;
78
+ return e.data;
79
+ }
80
+ function wr(e) {
81
+ return e === this.v;
82
+ }
83
+ function Dn(e, t) {
84
+ return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function";
85
+ }
86
+ function br(e) {
87
+ return !Dn(e, this.v);
88
+ }
89
+ function zn(e) {
90
+ throw new Error("https://svelte.dev/e/lifecycle_outside_component");
91
+ }
92
+ function Hn() {
93
+ throw new Error("https://svelte.dev/e/async_derived_orphan");
94
+ }
95
+ function Bn(e) {
96
+ throw new Error("https://svelte.dev/e/effect_in_teardown");
97
+ }
98
+ function Fn() {
99
+ throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
100
+ }
101
+ function Un(e) {
102
+ throw new Error("https://svelte.dev/e/effect_orphan");
103
+ }
104
+ function Yn() {
105
+ throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
106
+ }
107
+ function Vn() {
108
+ throw new Error("https://svelte.dev/e/hydration_failed");
109
+ }
110
+ function Gn(e) {
111
+ throw new Error("https://svelte.dev/e/props_invalid_value");
112
+ }
113
+ function Kn() {
114
+ throw new Error("https://svelte.dev/e/state_descriptors_fixed");
115
+ }
116
+ function Wn() {
117
+ throw new Error("https://svelte.dev/e/state_prototype_fixed");
118
+ }
119
+ function Jn() {
120
+ throw new Error("https://svelte.dev/e/state_unsafe_mutation");
121
+ }
122
+ function Xn() {
123
+ throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror");
124
+ }
125
+ var ae = !1, He = !1;
126
+ function Qt(e, t) {
127
+ return e.label = t, Zn(e.v, t), e;
128
+ }
129
+ function Zn(e, t) {
130
+ return e?.[In]?.(t), e;
131
+ }
132
+ var k = null;
133
+ function ke(e) {
134
+ k = e;
135
+ }
136
+ function Lt(e, t = !1, r) {
137
+ k = {
138
+ p: k,
139
+ i: !1,
140
+ c: null,
141
+ e: null,
142
+ s: e,
143
+ x: null,
144
+ r: y,
145
+ l: He && !t ? {
146
+ s: null,
147
+ u: null,
148
+ $: []
149
+ } : null
150
+ };
151
+ }
152
+ function qt(e) {
153
+ var t = k, r = t.e;
154
+ if (r !== null) {
155
+ t.e = null;
156
+ for (var n of r) Lr(n);
157
+ }
158
+ return e !== void 0 && (t.x = e), t.i = !0, k = t.p, Dt(e);
159
+ }
160
+ function Dt(e = {}) {
161
+ return Le(e, pr, { value: !0 }), e;
162
+ }
163
+ function Be() {
164
+ return !He || k !== null && k.l === null;
165
+ }
166
+ var ue = [];
167
+ function $r() {
168
+ var e = ue;
169
+ ue = [], Sn(e);
170
+ }
171
+ function ce(e) {
172
+ if (ue.length === 0 && !Me) {
173
+ var t = ue;
174
+ queueMicrotask(() => {
175
+ t === ue && $r();
176
+ });
177
+ }
178
+ ue.push(e);
179
+ }
180
+ function Qn() {
181
+ for (; ue.length > 0; ) $r();
182
+ }
183
+ var ei = ~(B | _e | Y);
184
+ function S(e, t) {
185
+ e.f = e.f & ei | t;
186
+ }
187
+ function zt(e) {
188
+ (e.f & 512) !== 0 || e.deps === null ? S(e, Y) : S(e, _e);
189
+ }
190
+ function kr(e, t, r) {
191
+ (e.f & 2048) !== 0 ? t.add(e) : (e.f & 4096) !== 0 && r.add(e), S(e, Y);
192
+ }
193
+ function dt(e) {
194
+ var t = w, r = y;
195
+ V(null), te(null);
196
+ try {
197
+ return e();
198
+ } finally {
199
+ V(t), te(r);
200
+ }
201
+ }
202
+ function ti(e, t, r, n) {
203
+ const i = Be() ? qe : Tr;
204
+ var s = e.filter((o) => !o.settled), l = t.map(i);
205
+ if (r.length === 0 && s.length === 0) {
206
+ n(l);
207
+ return;
208
+ }
209
+ var a = y, c = ri(), v = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((o) => o.promise)) : null;
210
+ function h(o) {
211
+ if ((a.f & 16384) === 0) {
212
+ c();
213
+ try {
214
+ n([...l, ...o]);
215
+ } catch (d) {
216
+ X(d, a);
217
+ }
218
+ ot();
219
+ }
220
+ }
221
+ var u = Er();
222
+ if (r.length === 0) {
223
+ v.then(() => h([])).finally(u);
224
+ return;
225
+ }
226
+ function f() {
227
+ Promise.all(r.map((o) => /* @__PURE__ */ ii(o))).then(h).catch((o) => X(o, a)).finally(u);
228
+ }
229
+ v ? v.then(() => {
230
+ c(), f(), ot();
231
+ }) : f();
232
+ }
233
+ function ri() {
234
+ var e = y, t = w, r = k, n = m;
235
+ if (0) var i;
236
+ return function(l = !0) {
237
+ te(e), V(t), ke(r), l && (e.f & 16384) === 0 && (n?.activate(), n?.apply());
238
+ };
239
+ }
240
+ var ni = !1;
241
+ function ot(e = !0) {
242
+ ni = !1, te(null), V(null), ke(null), e && m?.deactivate();
243
+ }
244
+ function Er() {
245
+ var e = y, t = e.b, r = m, n = !!t?.is_rendered();
246
+ return t?.update_pending_count(1, r), r.increment(n, e), () => {
247
+ t?.update_pending_count(-1, r), r.decrement(n, e);
248
+ };
249
+ }
250
+ // @__NO_SIDE_EFFECTS__
251
+ function qe(e) {
252
+ var t = 2 | B;
253
+ return y !== null && (y.f |= Se), {
254
+ ctx: k,
255
+ deps: null,
256
+ effects: null,
257
+ equals: wr,
258
+ f: t,
259
+ fn: e,
260
+ reactions: null,
261
+ rv: 0,
262
+ v: I,
263
+ wv: 0,
264
+ parent: y,
265
+ ac: null
266
+ };
267
+ }
268
+ var Oe = /* @__PURE__ */ Symbol("obsolete");
269
+ // @__NO_SIDE_EFFECTS__
270
+ function ii(e, t, r) {
271
+ let n = y;
272
+ n === null && Hn();
273
+ var i = void 0, s = Fe(I), l = !w, a = /* @__PURE__ */ new Set();
274
+ return $i(() => {
275
+ var c = y, v = _r();
276
+ i = v.promise;
277
+ try {
278
+ Promise.resolve(e()).then(v.resolve, (o) => {
279
+ o !== ze && v.reject(o);
280
+ }).finally(ot);
281
+ } catch (o) {
282
+ v.reject(o), ot();
283
+ }
284
+ var h = m;
285
+ if (l) {
286
+ if ((c.f & 32768) !== 0) var u = Er();
287
+ if (n.b?.is_rendered()) h.async_deriveds.get(c)?.reject(Oe);
288
+ else for (const o of a.values()) o.reject(Oe);
289
+ a.add(v), h.async_deriveds.set(c, v);
290
+ }
291
+ const f = (o, d = void 0) => {
292
+ u?.(), a.delete(v), d !== Oe && (h.activate(), d ? (s.f |= lt, ut(s, d)) : ((s.f & 8388608) !== 0 && (s.f ^= lt), ut(s, o)), h.deactivate());
293
+ };
294
+ v.promise.then(f, (o) => f(null, o || "unknown"));
295
+ }), mi(() => {
296
+ for (const c of a) c.reject(Oe);
297
+ }), new Promise((c) => {
298
+ function v(h) {
299
+ function u() {
300
+ h === i ? c(s) : v(i);
301
+ }
302
+ h.then(u, u);
303
+ }
304
+ v(i);
305
+ });
306
+ }
307
+ // @__NO_SIDE_EFFECTS__
308
+ function Ae(e) {
309
+ const t = /* @__PURE__ */ qe(e);
310
+ return ae || Yr(t), t;
311
+ }
312
+ // @__NO_SIDE_EFFECTS__
313
+ function Tr(e) {
314
+ const t = /* @__PURE__ */ qe(e);
315
+ return t.equals = br, t;
316
+ }
317
+ function si(e) {
318
+ var t = e.effects;
319
+ if (t !== null) {
320
+ e.effects = null;
321
+ for (var r = 0; r < t.length; r += 1) z(t[r]);
322
+ }
323
+ }
324
+ function Ht(e) {
325
+ var t, r = y, n = e.parent;
326
+ if (!ie && n !== null && e.v !== I && (n.f & 24576) !== 0)
327
+ return jn(), e.v;
328
+ te(n);
329
+ try {
330
+ si(e), t = Wr(e);
331
+ } finally {
332
+ te(r);
333
+ }
334
+ return t;
335
+ }
336
+ function Sr(e) {
337
+ var t = Ht(e);
338
+ if (!e.equals(t) && (e.wv = Gr(), (!m?.is_fork || e.deps === null) && (m !== null ? (m.capture(e, t, !0), St?.capture(e, t, !0)) : e.v = t, e.deps === null))) {
339
+ S(e, Y);
340
+ return;
341
+ }
342
+ ie || (j !== null ? (Yt() || m?.is_fork) && j.set(e, t) : zt(e));
343
+ }
344
+ function ai(e) {
345
+ if (e.effects !== null)
346
+ for (const t of e.effects) (t.teardown || t.ac) && (t.teardown?.(), t.ac !== null && dt(() => {
347
+ t.ac.abort(ze), t.ac = null;
348
+ }), t.fn !== null && (t.teardown = Tn), De(t, 0), Gt(t));
349
+ }
350
+ function xr(e) {
351
+ if (e.effects !== null)
352
+ for (const t of e.effects) t.teardown && t.fn !== null && Te(t);
353
+ }
354
+ var We = null, ye = null, m = null, St = null, j = null, xt = null, Me = !1, yt = !1, Ne = null, et = null, er = 0;
355
+ var li = 1, xe = class Ct {
356
+ id = li++;
357
+ #e = !1;
358
+ linked = !0;
359
+ #t = null;
360
+ #r = null;
361
+ async_deriveds = /* @__PURE__ */ new Map();
362
+ current = /* @__PURE__ */ new Map();
363
+ previous = /* @__PURE__ */ new Map();
364
+ #o = /* @__PURE__ */ new Set();
365
+ #i = /* @__PURE__ */ new Set();
366
+ #a = 0;
367
+ #n = /* @__PURE__ */ new Map();
368
+ #l = null;
369
+ #s = [];
370
+ #h = [];
371
+ #f = /* @__PURE__ */ new Set();
372
+ #u = /* @__PURE__ */ new Set();
373
+ #d = /* @__PURE__ */ new Map();
374
+ #p = /* @__PURE__ */ new Set();
375
+ is_fork = !1;
376
+ #c = !1;
377
+ constructor() {
378
+ ye === null ? We = ye = this : (ye.#r = this, this.#t = ye), ye = this;
379
+ }
380
+ #w() {
381
+ if (this.is_fork) return !0;
382
+ for (const n of this.#n.keys()) {
383
+ for (var t = n, r = !1; t.parent !== null; ) {
384
+ if (this.#d.has(t)) {
385
+ r = !0;
386
+ break;
387
+ }
388
+ t = t.parent;
389
+ }
390
+ if (!r) return !0;
391
+ }
392
+ return !1;
393
+ }
394
+ skip_effect(t) {
395
+ this.#d.has(t) || this.#d.set(t, {
396
+ d: [],
397
+ m: []
398
+ }), this.#p.delete(t);
399
+ }
400
+ unskip_effect(t, r = (n) => this.schedule(n)) {
401
+ var n = this.#d.get(t);
402
+ if (n) {
403
+ this.#d.delete(t);
404
+ for (var i of n.d)
405
+ S(i, B), r(i);
406
+ for (i of n.m)
407
+ S(i, _e), r(i);
408
+ }
409
+ this.#p.add(t);
410
+ }
411
+ #b() {
412
+ var t = [];
413
+ for (const s of this.#s)
414
+ if (!((s.f & 16384) !== 0 || (s.f & 6144) === 0)) {
415
+ for (var r = s, n = !1; r.parent !== null; ) {
416
+ r = r.parent;
417
+ var i = r.f;
418
+ if ((i & 96) !== 0) {
419
+ if ((i & 1024) === 0) {
420
+ n = !0;
421
+ break;
422
+ }
423
+ r.f ^= Y;
424
+ }
425
+ }
426
+ n || t.push(r);
427
+ }
428
+ return this.#s = [], t;
429
+ }
430
+ #g() {
431
+ this.#e = !0;
432
+ for (const a of this.#f)
433
+ this.#u.delete(a), S(a, B), this.schedule(a);
434
+ for (const a of this.#u)
435
+ S(a, _e), this.schedule(a);
436
+ this.apply();
437
+ for (var t = Ne = [], r = [], n = et = []; this.#s.length > 0; ) {
438
+ er++ > 1e3 && (this.#_(), oi());
439
+ for (const a of this.#b()) try {
440
+ this.#y(a, t, r);
441
+ } catch (c) {
442
+ throw Or(a), this.#w() || this.discard(), c;
443
+ }
444
+ }
445
+ if (m = null, n.length > 0) {
446
+ var i = Ct.ensure();
447
+ for (const a of n) i.schedule(a);
448
+ }
449
+ if (Ne = null, et = null, this.#w()) {
450
+ this.#v(r), this.#v(t);
451
+ for (const [a, c] of this.#d) Ar(a, c);
452
+ n.length > 0 && m.#g();
453
+ return;
454
+ }
455
+ const s = this.#k();
456
+ if (s) {
457
+ this.#v(r), this.#v(t), s.#$(this);
458
+ return;
459
+ }
460
+ this.#f.clear(), this.#u.clear();
461
+ for (const a of this.#o) a(this);
462
+ this.#o.clear(), St = this, tr(r), tr(t), St = null, this.#l?.resolve();
463
+ var l = m;
464
+ if (this.#a === 0 && (this.#s.length === 0 || l !== null) && (this.#_(), ae && (this.#m(), m = l)), this.#s.length > 0)
465
+ if (l !== null) {
466
+ for (const a of this.#s) l.#s.push(a);
467
+ this.#s = [];
468
+ } else l = this;
469
+ l !== null && (Z.clear(), l.#g());
470
+ }
471
+ #y(t, r, n) {
472
+ t.f ^= Y;
473
+ for (var i = t.first; i !== null; ) {
474
+ var s = i.f, l = (s & 96) !== 0;
475
+ if (!(l && (s & 1024) !== 0 || (s & 8192) !== 0 || this.#d.has(i)) && i.fn !== null) {
476
+ l ? i.f ^= Y : (s & 4) !== 0 ? r.push(i) : ae && (s & 16777224) !== 0 ? n.push(i) : Ue(i) && ((s & 16) !== 0 && this.#u.add(i), Te(i));
477
+ var a = i.first;
478
+ if (a !== null) {
479
+ i = a;
480
+ continue;
481
+ }
482
+ }
483
+ for (; i !== null; ) {
484
+ var c = i.next;
485
+ if (c !== null) {
486
+ i = c;
487
+ break;
488
+ }
489
+ i = i.parent;
490
+ }
491
+ }
492
+ }
493
+ #k() {
494
+ for (var t = this.#t; t !== null; ) {
495
+ if (!t.is_fork) {
496
+ for (const [r, [, n]] of this.current) if (t.current.has(r) && !n) return t;
497
+ }
498
+ t = t.#t;
499
+ }
500
+ return null;
501
+ }
502
+ #$(t) {
503
+ for (const [n, i] of t.current)
504
+ !this.previous.has(n) && t.previous.has(n) && this.previous.set(n, t.previous.get(n)), this.current.set(n, i);
505
+ for (const [n, i] of t.async_deriveds) {
506
+ const s = this.async_deriveds.get(n);
507
+ s && i.promise.then(s.resolve).catch(s.reject);
508
+ }
509
+ t.async_deriveds.clear(), this.transfer_effects(t.#f, t.#u);
510
+ const r = (n) => {
511
+ var i = n.reactions;
512
+ if (i !== null && !((n.f & 2) !== 0 && (n.f & 6144) === 0))
513
+ for (const a of i) {
514
+ var s = a.f;
515
+ if ((s & 2) !== 0) r(a);
516
+ else {
517
+ var l = a;
518
+ s & 4194320 && !this.async_deriveds.has(l) && (this.#u.delete(l), S(l, B), this.schedule(l));
519
+ }
520
+ }
521
+ };
522
+ for (const n of this.current.keys()) r(n);
523
+ this.oncommit(() => t.discard()), t.#_(), m = this, this.#g();
524
+ }
525
+ #v(t) {
526
+ for (var r = 0; r < t.length; r += 1) kr(t[r], this.#f, this.#u);
527
+ }
528
+ capture(t, r, n = !1) {
529
+ t.v !== I && !this.previous.has(t) && this.previous.set(t, t.v), (t.f & 8388608) === 0 && (this.current.set(t, [r, n]), j?.set(t, r)), this.is_fork || (t.v = r);
530
+ }
531
+ activate() {
532
+ m = this;
533
+ }
534
+ deactivate() {
535
+ m = null, j = null;
536
+ }
537
+ flush() {
538
+ try {
539
+ yt = !0, m = this, this.#g();
540
+ } finally {
541
+ er = 0, xt = null, Ne = null, et = null, yt = !1, m = null, j = null, Z.clear();
542
+ }
543
+ }
544
+ discard() {
545
+ for (const t of this.#i) t(this);
546
+ this.#i.clear();
547
+ for (const t of this.async_deriveds.values()) t.reject(Oe);
548
+ this.#_(), this.#l?.resolve();
549
+ }
550
+ register_created_effect(t) {
551
+ this.#h.push(t);
552
+ }
553
+ #m() {
554
+ for (let u = We; u !== null; u = u.#r) {
555
+ var t = u.id < this.id, r = [];
556
+ for (const [f, [o, d]] of this.current) {
557
+ if (u.current.has(f)) {
558
+ var n = u.current.get(f)[0];
559
+ if (t && o !== n) u.current.set(f, [o, d]);
560
+ else continue;
561
+ }
562
+ r.push(f);
563
+ }
564
+ if (t) for (const [f, o] of this.async_deriveds) {
565
+ const d = u.async_deriveds.get(f);
566
+ d && o.promise.then(d.resolve).catch(d.reject);
567
+ }
568
+ var i = [...u.current.keys()].filter((f) => !u.current.get(f)[1]);
569
+ if (!(!u.#e || i.length === 0)) {
570
+ var s = i.filter((f) => !this.current.has(f));
571
+ if (s.length === 0)
572
+ t && u.discard();
573
+ else if (r.length > 0) {
574
+ if (t) for (const f of this.#p) u.unskip_effect(f, (o) => {
575
+ (o.f & 4194320) !== 0 ? u.schedule(o) : u.#v([o]);
576
+ });
577
+ u.activate();
578
+ var l = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Map();
579
+ for (var c of r) Cr(c, s, l, a);
580
+ a = /* @__PURE__ */ new Map();
581
+ var v = [...u.current].filter(([f, o]) => {
582
+ const d = this.current.get(f);
583
+ return d ? d[0] !== o[0] || d[1] !== o[1] : !0;
584
+ }).map(([f]) => f);
585
+ if (v.length > 0)
586
+ for (const f of this.#h) (f.f & 155648) === 0 && Bt(f, v, a) && ((f.f & 4194320) !== 0 ? (S(f, B), u.schedule(f)) : u.#f.add(f));
587
+ if (u.#s.length > 0 && !u.#c) {
588
+ u.apply();
589
+ for (var h of u.#b()) u.#y(h, [], []);
590
+ }
591
+ u.deactivate();
592
+ }
593
+ }
594
+ }
595
+ }
596
+ increment(t, r) {
597
+ if (this.#a += 1, t) {
598
+ let n = this.#n.get(r) ?? 0;
599
+ this.#n.set(r, n + 1);
600
+ }
601
+ }
602
+ decrement(t, r) {
603
+ if (this.#a -= 1, t) {
604
+ let n = this.#n.get(r) ?? 0;
605
+ n === 1 ? this.#n.delete(r) : this.#n.set(r, n - 1);
606
+ }
607
+ this.#c || (this.#c = !0, ce(() => {
608
+ this.#c = !1, this.linked && this.flush();
609
+ }));
610
+ }
611
+ transfer_effects(t, r) {
612
+ for (const n of t) this.#f.add(n);
613
+ for (const n of r) this.#u.add(n);
614
+ t.clear(), r.clear();
615
+ }
616
+ oncommit(t) {
617
+ this.#o.add(t);
618
+ }
619
+ ondiscard(t) {
620
+ this.#i.add(t);
621
+ }
622
+ settled() {
623
+ return (this.#l ??= _r()).promise;
624
+ }
625
+ static ensure() {
626
+ if (m === null) {
627
+ const t = m = new Ct();
628
+ !yt && !Me && ce(() => {
629
+ t.#e || t.flush();
630
+ });
631
+ }
632
+ return m;
633
+ }
634
+ apply() {
635
+ if (!ae || !this.is_fork && this.#t === null && this.#r === null) {
636
+ j = null;
637
+ return;
638
+ }
639
+ j = /* @__PURE__ */ new Map();
640
+ for (const [r, [n]] of this.current) j.set(r, n);
641
+ for (let r = We; r !== null; r = r.#r)
642
+ if (!(r === this || r.is_fork)) {
643
+ var t = !1;
644
+ if (r.id < this.id) {
645
+ for (const [n, [, i]] of r.current)
646
+ if (!i && this.current.has(n)) {
647
+ t = !0;
648
+ break;
649
+ }
650
+ }
651
+ if (!t)
652
+ for (const [n, i] of r.previous) j.has(n) || j.set(n, i);
653
+ }
654
+ }
655
+ schedule(t) {
656
+ if (xt = t, t.b?.is_pending && (t.f & 16777228) !== 0 && (t.f & 32768) === 0) {
657
+ t.b.defer_effect(t);
658
+ return;
659
+ }
660
+ this.#s.push(t);
661
+ }
662
+ #_() {
663
+ if (this.linked) {
664
+ var t = this.#t, r = this.#r;
665
+ t === null ? We = r : t.#r = r, r === null ? ye = t : r.#t = t, this.linked = !1;
666
+ }
667
+ }
668
+ };
669
+ function L(e) {
670
+ var t = Me;
671
+ Me = !0;
672
+ try {
673
+ var r;
674
+ for (e && (m !== null && !m.is_fork && m.flush(), r = e()); ; ) {
675
+ if (Qn(), m === null) return r;
676
+ m.flush();
677
+ }
678
+ } finally {
679
+ Me = t;
680
+ }
681
+ }
682
+ function oi() {
683
+ if (0) {
684
+ var e;
685
+ for (const r of m.current.keys()) for (const [n, i] of r.updated ?? [])
686
+ var t;
687
+ }
688
+ try {
689
+ Yn();
690
+ } catch (r) {
691
+ X(r, xt);
692
+ }
693
+ }
694
+ var J = null;
695
+ function tr(e) {
696
+ var t = e.length;
697
+ if (t !== 0) {
698
+ for (var r = 0; r < t; ) {
699
+ var n = e[r++];
700
+ if ((n.f & 24576) === 0 && Ue(n) && (J = /* @__PURE__ */ new Set(), Te(n), n.deps === null && n.first === null && n.nodes === null && n.teardown === null && n.ac === null && Hr(n), J?.size > 0)) {
701
+ Z.clear();
702
+ for (const i of J) {
703
+ if ((i.f & 24576) !== 0) continue;
704
+ const s = [i];
705
+ let l = i.parent;
706
+ for (; l !== null; )
707
+ J.has(l) && (J.delete(l), s.push(l)), l = l.parent;
708
+ for (let a = s.length - 1; a >= 0; a--) {
709
+ const c = s[a];
710
+ (c.f & 24576) === 0 && Te(c);
711
+ }
712
+ }
713
+ J.clear();
714
+ }
715
+ }
716
+ J = null;
717
+ }
718
+ }
719
+ function Cr(e, t, r, n) {
720
+ if (!r.has(e) && (r.add(e), e.reactions !== null))
721
+ for (const i of e.reactions) {
722
+ const s = i.f;
723
+ (s & 2) !== 0 ? Cr(i, t, r, n) : (s & 4194320) !== 0 && (s & 2048) === 0 && Bt(i, t, n) && (S(i, B), Ft(i));
724
+ }
725
+ }
726
+ function Bt(e, t, r) {
727
+ const n = r.get(e);
728
+ if (n !== void 0) return n;
729
+ if (e.deps !== null) for (const i of e.deps) {
730
+ if (st.call(t, i)) return !0;
731
+ if ((i.f & 2) !== 0 && Bt(i, t, r))
732
+ return r.set(i, !0), !0;
733
+ }
734
+ return r.set(e, !1), !1;
735
+ }
736
+ function Ft(e) {
737
+ m.schedule(e);
738
+ }
739
+ function Ar(e, t) {
740
+ if (!((e.f & 32) !== 0 && (e.f & 1024) !== 0)) {
741
+ (e.f & 2048) !== 0 ? t.d.push(e) : (e.f & 4096) !== 0 && t.m.push(e), S(e, Y);
742
+ for (var r = e.first; r !== null; )
743
+ Ar(r, t), r = r.next;
744
+ }
745
+ }
746
+ function Or(e) {
747
+ S(e, Y);
748
+ for (var t = e.first; t !== null; )
749
+ Or(t), t = t.next;
750
+ }
751
+ var ft = /* @__PURE__ */ new Set(), Z = /* @__PURE__ */ new Map();
752
+ var Ir = !1;
753
+ function Fe(e, t) {
754
+ var r = {
755
+ f: 0,
756
+ v: e,
757
+ reactions: null,
758
+ equals: wr,
759
+ rv: 0,
760
+ wv: 0
761
+ };
762
+ return r;
763
+ }
764
+ // @__NO_SIDE_EFFECTS__
765
+ function P(e, t) {
766
+ const r = Fe(e, t);
767
+ return Yr(r), r;
768
+ }
769
+ // @__NO_SIDE_EFFECTS__
770
+ function fi(e, t = !1, r = !0) {
771
+ const n = Fe(e);
772
+ return t || (n.equals = br), He && r && k !== null && k.l !== null && (k.l.s ??= []).push(n), n;
773
+ }
774
+ function $(e, t, r = !1) {
775
+ w !== null && (!W || (w.f & 131072) !== 0) && Be() && (w.f & 4325394) !== 0 && (Q === null || !Q.has(e)) && Jn();
776
+ let n = r ? be(t) : t;
777
+ return ut(e, n, et);
778
+ }
779
+ var fe = null, At = 0;
780
+ function ut(e, t, r = null) {
781
+ if (!e.equals(t)) {
782
+ ie ? Z.set(e, t) : Z.has(e) || Z.set(e, e.v);
783
+ var n = xe.ensure();
784
+ if (n.capture(e, t), (e.f & 2) !== 0) {
785
+ const i = e;
786
+ (e.f & 2048) !== 0 && Ht(i), j === null && zt(i);
787
+ }
788
+ e.wv = Gr(), fe = null, At = 0, Rr(e, B, r), fe = null, Be() && y !== null && (y.f & 1024) !== 0 && (y.f & 96) === 0 && (U === null ? Si([e]) : U.push(e)), !n.is_fork && ft.size > 0 && !Ir && ui();
789
+ }
790
+ return t;
791
+ }
792
+ function ui() {
793
+ Ir = !1;
794
+ for (const e of ft) {
795
+ (e.f & 1024) !== 0 && S(e, _e);
796
+ let t;
797
+ try {
798
+ t = Ue(e);
799
+ } catch {
800
+ t = !0;
801
+ }
802
+ t && Te(e);
803
+ }
804
+ ft.clear();
805
+ }
806
+ function je(e) {
807
+ $(e, e.v + 1);
808
+ }
809
+ function Rr(e, t, r) {
810
+ var n = e.reactions;
811
+ if (n !== null) {
812
+ var i = Be(), s = n.length;
813
+ if (At += s, At > 1e5 && fe === null && (fe = /* @__PURE__ */ new Set()), fe !== null) {
814
+ if (fe.has(e)) return;
815
+ fe.add(e);
816
+ }
817
+ for (var l = 0; l < s; l++) {
818
+ var a = n[l], c = a.f;
819
+ if (!(!i && a === y)) {
820
+ var v = (c & B) === 0;
821
+ if (v && S(a, t), (c & 131072) !== 0) ft.add(a);
822
+ else if ((c & 2) !== 0) {
823
+ var h = a;
824
+ j?.delete(h), Rr(h, _e, r);
825
+ } else if (v) {
826
+ var u = a;
827
+ (c & 16) !== 0 && J !== null && J.add(u), r !== null ? r.push(u) : Ft(u);
828
+ }
829
+ }
830
+ }
831
+ }
832
+ }
833
+ var ci = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;
834
+ function be(e) {
835
+ if (typeof e != "object" || e === null || Re in e || pr in e) return e;
836
+ const t = hr(e);
837
+ if (t !== kn && t !== En) return e;
838
+ var r = /* @__PURE__ */ new Map(), n = mn(e), i = /* @__PURE__ */ P(0), s = null, l = he, a = (u) => {
839
+ if (he === l) return u();
840
+ var f = w, o = he;
841
+ V(null), ar(l);
842
+ var d = u();
843
+ return V(f), ar(o), d;
844
+ };
845
+ n && r.set("length", /* @__PURE__ */ P(e.length, s));
846
+ var c = "";
847
+ let v = !1;
848
+ function h(u) {
849
+ if (!v) {
850
+ v = !0, c = u, Qt(i, `${c} version`);
851
+ for (const [f, o] of r) Qt(o, di(c, f));
852
+ v = !1;
853
+ }
854
+ }
855
+ return new Proxy(e, {
856
+ defineProperty(u, f, o) {
857
+ (!("value" in o) || o.configurable === !1 || o.enumerable === !1 || o.writable === !1) && Kn();
858
+ var d = r.get(f);
859
+ return d === void 0 ? a(() => {
860
+ var _ = /* @__PURE__ */ P(o.value, s);
861
+ return r.set(f, _), _;
862
+ }) : $(d, o.value, !0), !0;
863
+ },
864
+ deleteProperty(u, f) {
865
+ var o = r.get(f);
866
+ if (o === void 0) {
867
+ if (f in u) {
868
+ const d = a(() => /* @__PURE__ */ P(I, s));
869
+ r.set(f, d), je(i);
870
+ }
871
+ } else
872
+ $(o, I), je(i);
873
+ return !0;
874
+ },
875
+ get(u, f, o) {
876
+ if (f === Re) return e;
877
+ var d = r.get(f), _ = f in u;
878
+ if (d === void 0 && (!_ || ve(u, f)?.writable) && (d = a(() => {
879
+ var E = be(_ ? u[f] : I), R = /* @__PURE__ */ P(E, s);
880
+ return R;
881
+ }), r.set(f, d)), d !== void 0) {
882
+ var b = p(d);
883
+ return b === I ? void 0 : b;
884
+ }
885
+ return Reflect.get(u, f, o);
886
+ },
887
+ getOwnPropertyDescriptor(u, f) {
888
+ this.has?.(u, f);
889
+ var o = Reflect.getOwnPropertyDescriptor(u, f), d = r.get(f);
890
+ if (d !== void 0) {
891
+ var _ = p(d);
892
+ if (_ === I) return;
893
+ if (o && "value" in o) o.value = _;
894
+ else return {
895
+ enumerable: !0,
896
+ configurable: !0,
897
+ value: _,
898
+ writable: !0
899
+ };
900
+ }
901
+ return o;
902
+ },
903
+ has(u, f) {
904
+ if (f === Re) return !0;
905
+ var o = r.get(f), d = o !== void 0 && o.v !== I || Reflect.has(u, f);
906
+ return (o !== void 0 || y !== null && (!d || ve(u, f)?.writable)) && (o === void 0 && (o = a(() => {
907
+ var _ = d ? be(u[f]) : I, b = /* @__PURE__ */ P(_, s);
908
+ return b;
909
+ }), r.set(f, o)), p(o) === I) ? !1 : d;
910
+ },
911
+ set(u, f, o, d) {
912
+ var _ = r.get(f), b = f in u;
913
+ if (n && f === "length") for (var E = o; E < _.v; E += 1) {
914
+ var R = r.get(E + "");
915
+ R !== void 0 ? $(R, I) : E in u && (R = a(() => /* @__PURE__ */ P(I, s)), r.set(E + "", R));
916
+ }
917
+ if (_ === void 0)
918
+ (!b || ve(u, f)?.writable) && (_ = a(() => /* @__PURE__ */ P(void 0, s)), $(_, be(o)), r.set(f, _));
919
+ else {
920
+ b = _.v !== I;
921
+ var F = a(() => be(o));
922
+ $(_, F);
923
+ }
924
+ var C = Reflect.getOwnPropertyDescriptor(u, f);
925
+ if (C?.set && C.set.call(d, o), !b) {
926
+ if (n && typeof f == "string") {
927
+ var G = r.get("length"), N = Number(f);
928
+ Number.isInteger(N) && N >= G.v && $(G, N + 1);
929
+ }
930
+ je(i);
931
+ }
932
+ return !0;
933
+ },
934
+ ownKeys(u) {
935
+ p(i);
936
+ var f = Reflect.ownKeys(u).filter((_) => {
937
+ var b = r.get(_);
938
+ return b === void 0 || b.v !== I;
939
+ });
940
+ for (var [o, d] of r) d.v !== I && !(o in u) && f.push(o);
941
+ return f;
942
+ },
943
+ setPrototypeOf() {
944
+ Wn();
945
+ }
946
+ });
947
+ }
948
+ function di(e, t) {
949
+ return typeof t == "symbol" ? `${e}[Symbol(${t.description ?? ""})]` : ci.test(t) ? `${e}.${t}` : /^\d+$/.test(t) ? `${e}[${t}]` : `${e}['${t}']`;
950
+ }
951
+ var rr, vi, Mr, Nr, jr;
952
+ function Ot() {
953
+ if (rr === void 0) {
954
+ rr = window, vi = document, Mr = /Firefox/.test(navigator.userAgent);
955
+ var e = Element.prototype, t = Node.prototype, r = Text.prototype;
956
+ Nr = ve(t, "firstChild").get, jr = ve(t, "nextSibling").get, Jt(e) && (e[Rn] = void 0, e[yr] = null, e[Mn] = void 0, e.__e = void 0), Jt(r) && (r[Tt] = void 0);
957
+ }
958
+ }
959
+ function pe(e = "") {
960
+ return document.createTextNode(e);
961
+ }
962
+ // @__NO_SIDE_EFFECTS__
963
+ function Ee(e) {
964
+ return Nr.call(e);
965
+ }
966
+ // @__NO_SIDE_EFFECTS__
967
+ function le(e) {
968
+ return jr.call(e);
969
+ }
970
+ function tt(e, t) {
971
+ if (!O) return /* @__PURE__ */ Ee(e);
972
+ var r = /* @__PURE__ */ Ee(x);
973
+ if (r === null) r = x.appendChild(pe());
974
+ else if (t && r.nodeType !== 3) {
975
+ var n = pe();
976
+ return r?.before(n), ee(n), n;
977
+ }
978
+ return t && Pr(r), ee(r), r;
979
+ }
980
+ function nr(e, t = !1) {
981
+ if (!O) return /* @__PURE__ */ Ee(e);
982
+ var r = tt(e, t);
983
+ return Qe(e), r;
984
+ }
985
+ function mt(e, t = 1, r = !1) {
986
+ let n = O ? x : e;
987
+ for (var i; t--; )
988
+ i = n, n = /* @__PURE__ */ le(n);
989
+ if (!O) return n;
990
+ if (r) {
991
+ if (n?.nodeType !== 3) {
992
+ var s = pe();
993
+ return n === null ? i?.after(s) : n.before(s), ee(s), s;
994
+ }
995
+ Pr(n);
996
+ }
997
+ return ee(n), n;
998
+ }
999
+ function hi(e) {
1000
+ e.textContent = "";
1001
+ }
1002
+ function _i() {
1003
+ return !ae || J !== null ? !1 : (y.f & Nt) !== 0;
1004
+ }
1005
+ function Ut(e, t, r) {
1006
+ return t == null || t === "http://www.w3.org/1999/xhtml" ? r ? document.createElement(e, { is: r }) : document.createElement(e) : r ? document.createElementNS(t, e, { is: r }) : document.createElementNS(t, e);
1007
+ }
1008
+ function Pr(e) {
1009
+ if (e.nodeValue.length < 65536) return;
1010
+ let t = e.nextSibling;
1011
+ for (; t !== null && t.nodeType === 3; )
1012
+ t.remove(), e.nodeValue += t.nodeValue, t = e.nextSibling;
1013
+ }
1014
+ function pi(e) {
1015
+ var t = y;
1016
+ if (t === null)
1017
+ return w.f |= lt, e;
1018
+ if ((t.f & 32768) === 0 && (t.f & 4) === 0)
1019
+ throw e;
1020
+ X(e, t);
1021
+ }
1022
+ function X(e, t) {
1023
+ if (!(t !== null && (t.f & 16384) !== 0)) {
1024
+ for (; t !== null; ) {
1025
+ if ((t.f & 128) !== 0 && (t.f & 33570816) === 0) {
1026
+ if ((t.f & 32768) === 0) throw e;
1027
+ try {
1028
+ t.b.error(e);
1029
+ return;
1030
+ } catch (r) {
1031
+ e = r;
1032
+ }
1033
+ }
1034
+ t = t.parent;
1035
+ }
1036
+ throw e;
1037
+ }
1038
+ }
1039
+ function gi(e) {
1040
+ y === null && (w === null && Un(e), Fn()), ie && Bn(e);
1041
+ }
1042
+ function yi(e, t) {
1043
+ var r = t.last;
1044
+ r === null ? t.last = t.first = e : (r.next = e, e.prev = r, t.last = e);
1045
+ }
1046
+ function re(e, t) {
1047
+ var r = y;
1048
+ r !== null && (r.f & 8192) !== 0 && (e |= Mt);
1049
+ var n = {
1050
+ ctx: k,
1051
+ deps: null,
1052
+ nodes: null,
1053
+ f: e | B | 512,
1054
+ first: null,
1055
+ fn: t,
1056
+ last: null,
1057
+ next: null,
1058
+ parent: r,
1059
+ b: r && r.b,
1060
+ prev: null,
1061
+ teardown: null,
1062
+ wv: 0,
1063
+ ac: null
1064
+ };
1065
+ m?.register_created_effect(n);
1066
+ var i = n;
1067
+ if ((e & 4) !== 0)
1068
+ Ne !== null ? Ne.push(n) : xe.ensure().schedule(n);
1069
+ else if (t !== null) {
1070
+ try {
1071
+ Te(n);
1072
+ } catch (l) {
1073
+ throw z(n), l;
1074
+ }
1075
+ 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 |= jt));
1076
+ }
1077
+ if (i !== null && (i.parent = r, r !== null && yi(i, r), w !== null && (w.f & 2) !== 0 && (e & 64) === 0)) {
1078
+ var s = w;
1079
+ (s.effects ??= []).push(i);
1080
+ }
1081
+ return n;
1082
+ }
1083
+ function Yt() {
1084
+ return w !== null && !W;
1085
+ }
1086
+ function mi(e) {
1087
+ const t = re(8, null);
1088
+ return S(t, Y), t.teardown = e, t;
1089
+ }
1090
+ function It(e) {
1091
+ gi("$effect");
1092
+ var t = y.f;
1093
+ if (!w && (t & 32) !== 0 && k !== null && !k.i) {
1094
+ var r = k;
1095
+ (r.e ??= []).push(e);
1096
+ } else return Lr(e);
1097
+ }
1098
+ function Lr(e) {
1099
+ return re(4 | Cn, e);
1100
+ }
1101
+ function wi(e) {
1102
+ xe.ensure();
1103
+ const t = re(64 | Se, e);
1104
+ return () => {
1105
+ z(t);
1106
+ };
1107
+ }
1108
+ function bi(e) {
1109
+ xe.ensure();
1110
+ const t = re(64 | Se, e);
1111
+ return (r = {}) => new Promise((n) => {
1112
+ r.outro ? Pe(t, () => {
1113
+ z(t), n(void 0);
1114
+ }) : (z(t), n(void 0));
1115
+ });
1116
+ }
1117
+ function qr(e) {
1118
+ return re(4, e);
1119
+ }
1120
+ function $i(e) {
1121
+ return re(An | Se, e);
1122
+ }
1123
+ function Vt(e, t = 0) {
1124
+ return re(8 | t, e);
1125
+ }
1126
+ function wt(e, t = [], r = [], n = []) {
1127
+ ti(n, t, r, (i) => {
1128
+ re(8, () => {
1129
+ e(...i.map(p));
1130
+ });
1131
+ });
1132
+ }
1133
+ function Dr(e, t = 0) {
1134
+ var r = re(16 | t, e);
1135
+ return r;
1136
+ }
1137
+ function ne(e) {
1138
+ return re(32 | Se, e);
1139
+ }
1140
+ function zr(e) {
1141
+ var t = e.teardown;
1142
+ if (t !== null) {
1143
+ const r = ie, n = w;
1144
+ sr(!0), V(null);
1145
+ try {
1146
+ t.call(null);
1147
+ } catch (i) {
1148
+ X(i, e.parent);
1149
+ } finally {
1150
+ sr(r), V(n);
1151
+ }
1152
+ }
1153
+ }
1154
+ function Gt(e, t = !1) {
1155
+ var r = e.first;
1156
+ for (e.first = e.last = null; r !== null; ) {
1157
+ const i = r.ac;
1158
+ i !== null && dt(() => {
1159
+ i.abort(ze);
1160
+ });
1161
+ var n = r.next;
1162
+ (r.f & 64) !== 0 ? r.parent = null : z(r, t), r = n;
1163
+ }
1164
+ }
1165
+ function ki(e) {
1166
+ for (var t = e.first; t !== null; ) {
1167
+ var r = t.next;
1168
+ (t.f & 32) === 0 && z(t), t = r;
1169
+ }
1170
+ }
1171
+ function z(e, t = !0) {
1172
+ var r = !1;
1173
+ (t || (e.f & 262144) !== 0) && e.nodes !== null && e.nodes.end !== null && (Ei(e.nodes.start, e.nodes.end), r = !0), e.f |= Xt, Gt(e, t && !r), De(e, 0);
1174
+ var n = e.nodes && e.nodes.t;
1175
+ if (n !== null) for (const s of n) s.stop();
1176
+ zr(e), e.f ^= Xt, e.f |= xn;
1177
+ var i = e.parent;
1178
+ i !== null && i.first !== null && Hr(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = e.b = null;
1179
+ }
1180
+ function Ei(e, t) {
1181
+ for (; e !== null; ) {
1182
+ var r = e === t ? null : /* @__PURE__ */ le(e);
1183
+ e.remove(), e = r;
1184
+ }
1185
+ }
1186
+ function Hr(e) {
1187
+ var t = e.parent, r = e.prev, n = e.next;
1188
+ r !== null && (r.next = n), n !== null && (n.prev = r), t !== null && (t.first === e && (t.first = n), t.last === e && (t.last = r));
1189
+ }
1190
+ function Pe(e, t, r = !0) {
1191
+ var n = [];
1192
+ e.f |= 256, Br(e, n, !0);
1193
+ var i = () => {
1194
+ r && z(e), t && t();
1195
+ }, s = n.length;
1196
+ if (s > 0) {
1197
+ var l = () => --s || i();
1198
+ for (var a of n) a.out(l);
1199
+ } else i();
1200
+ }
1201
+ function Br(e, t, r) {
1202
+ if ((e.f & 8192) === 0) {
1203
+ e.f ^= Mt;
1204
+ var n = e.nodes && e.nodes.t;
1205
+ if (n !== null)
1206
+ for (const a of n) (a.is_global || r) && t.push(a);
1207
+ for (var i = e.first; i !== null; ) {
1208
+ var s = i.next;
1209
+ if ((i.f & 64) === 0) {
1210
+ var l = (i.f & 65536) !== 0 || (i.f & 32) !== 0 && (e.f & 16) !== 0;
1211
+ Br(i, t, l ? r : !1);
1212
+ }
1213
+ i = s;
1214
+ }
1215
+ }
1216
+ }
1217
+ function ir(e) {
1218
+ e.f &= -257, Fr(e, !0);
1219
+ }
1220
+ function Fr(e, t) {
1221
+ if ((e.f & 256) === 0 && (e.f & 8192) !== 0) {
1222
+ e.f ^= Mt, (e.f & 1024) === 0 && (S(e, B), xe.ensure().schedule(e));
1223
+ for (var r = e.first; r !== null; ) {
1224
+ var n = r.next, i = (r.f & 65536) !== 0 || (r.f & 32) !== 0;
1225
+ Fr(r, i ? t : !1), r = n;
1226
+ }
1227
+ var s = e.nodes && e.nodes.t;
1228
+ if (s !== null)
1229
+ for (const l of s) (l.is_global || t) && l.in();
1230
+ }
1231
+ }
1232
+ function Ur(e, t) {
1233
+ if (e.nodes)
1234
+ for (var r = e.nodes.start, n = e.nodes.end; r !== null; ) {
1235
+ var i = r === n ? null : /* @__PURE__ */ le(r);
1236
+ t.append(r), r = i;
1237
+ }
1238
+ }
1239
+ var Ti = null, rt = !1, ie = !1;
1240
+ function sr(e) {
1241
+ ie = e;
1242
+ }
1243
+ var w = null, W = !1;
1244
+ function V(e) {
1245
+ w = e;
1246
+ }
1247
+ var y = null;
1248
+ function te(e) {
1249
+ y = e;
1250
+ }
1251
+ var Q = null;
1252
+ function Yr(e) {
1253
+ w !== null && (!ae && (w.f & 2097152) !== 0 || (w.f & 2) !== 0) && (Q ??= /* @__PURE__ */ new Set()).add(e);
1254
+ }
1255
+ var D = null, H = 0, U = null;
1256
+ function Si(e) {
1257
+ U = e;
1258
+ }
1259
+ var Vr = 1, de = 0, he = de;
1260
+ function ar(e) {
1261
+ he = e;
1262
+ }
1263
+ function Gr() {
1264
+ return ++Vr;
1265
+ }
1266
+ function Ue(e) {
1267
+ var t = e.f;
1268
+ if ((t & 2048) !== 0) return !0;
1269
+ if ((t & 4096) !== 0) {
1270
+ for (var r = e.deps, n = r.length, i = 0; i < n; i++) {
1271
+ var s = r[i];
1272
+ if (Ue(s) && Sr(s), s.wv > e.wv) return !0;
1273
+ }
1274
+ (t & 512) !== 0 && j === null && S(e, Y);
1275
+ }
1276
+ return !1;
1277
+ }
1278
+ function Kr(e, t, r = !0) {
1279
+ var n = e.reactions;
1280
+ if (n !== null && !(!ae && Q !== null && Q.has(e)))
1281
+ for (var i = 0; i < n.length; i++) {
1282
+ var s = n[i];
1283
+ (s.f & 2) !== 0 ? Kr(s, t, !1) : t === s && (r ? S(s, B) : (s.f & 1024) !== 0 && S(s, _e), Ft(s));
1284
+ }
1285
+ }
1286
+ function Wr(e) {
1287
+ var t = D, r = H, n = U, i = w, s = Q, l = k, a = W, c = he, v = e.f;
1288
+ D = null, H = 0, U = null, w = (v & 96) === 0 ? e : null, Q = null, ke(e.ctx), W = !1, he = ++de, e.ac !== null && (dt(() => {
1289
+ e.ac.abort(ze);
1290
+ }), e.ac = null);
1291
+ try {
1292
+ e.f |= Zt;
1293
+ var h = e.fn, u = h();
1294
+ e.f |= Nt;
1295
+ var f = lr(e);
1296
+ if (Be() && U !== null && !W && f !== null && (e.f & 6146) === 0) for (var o = 0; o < U.length; o++) Kr(U[o], e);
1297
+ if (i !== null && i !== e) {
1298
+ if (de++, i.deps !== null) for (let d = 0; d < r; d += 1) i.deps[d].rv = de;
1299
+ if (t !== null) for (const d of t) d.rv = de;
1300
+ U !== null && (n === null ? n = U : n.push(...U));
1301
+ }
1302
+ return (e.f & 8388608) !== 0 && (e.f ^= lt), u;
1303
+ } catch (d) {
1304
+ return lr(e), pi(d);
1305
+ } finally {
1306
+ e.f ^= Zt, D = t, H = r, U = n, w = i, Q = s, ke(l), W = a, he = c;
1307
+ }
1308
+ }
1309
+ function lr(e) {
1310
+ var t = e.deps, r = m?.is_fork;
1311
+ if (D !== null) {
1312
+ var n;
1313
+ if (r || De(e, H), t !== null && H > 0)
1314
+ for (t.length = H + D.length, n = 0; n < D.length; n++) t[H + n] = D[n];
1315
+ else e.deps = t = D;
1316
+ if (Yt() && (e.f & 512) !== 0) for (n = H; n < t.length; n++) (t[n].reactions ??= []).push(e);
1317
+ } else !r && t !== null && H < t.length && (De(e, H), t.length = H);
1318
+ return t;
1319
+ }
1320
+ function xi(e, t) {
1321
+ let r = t.reactions;
1322
+ if (r !== null) {
1323
+ var n = wn.call(r, e);
1324
+ if (n !== -1) {
1325
+ var i = r.length - 1;
1326
+ i === 0 ? r = t.reactions = null : (r[n] = r[i], r.pop());
1327
+ }
1328
+ }
1329
+ if (r === null && (t.f & 2) !== 0 && (D === null || !st.call(D, t))) {
1330
+ var s = t;
1331
+ (s.f & 512) !== 0 && (s.f ^= 512), s.v !== I && zt(s), s.ac !== null && dt(() => {
1332
+ s.ac.abort(ze), s.ac = null, S(s, B);
1333
+ }), ai(s), De(s, 0);
1334
+ }
1335
+ }
1336
+ function De(e, t) {
1337
+ var r = e.deps;
1338
+ if (r !== null)
1339
+ for (var n = t; n < r.length; n++) xi(e, r[n]);
1340
+ }
1341
+ function Te(e) {
1342
+ var t = e.f;
1343
+ if ((t & 16384) === 0) {
1344
+ S(e, Y);
1345
+ var r = y, n = rt;
1346
+ if (y = e, rt = (t & 96) === 0, 0)
1347
+ var i, s;
1348
+ try {
1349
+ (t & 16777232) !== 0 ? ki(e) : Gt(e), zr(e);
1350
+ var l = Wr(e);
1351
+ if (e.teardown = typeof l == "function" ? l : null, e.wv = Vr, 0)
1352
+ for (var a of e.deps) ;
1353
+ } finally {
1354
+ rt = n, y = r;
1355
+ }
1356
+ }
1357
+ }
1358
+ function p(e) {
1359
+ var t = (e.f & 2) !== 0;
1360
+ if (Ti?.add(e), w !== null && !W && !(y !== null && (y.f & 16384) !== 0) && (Q === null || !Q.has(e))) {
1361
+ var r = w.deps;
1362
+ if ((w.f & 2097152) !== 0)
1363
+ e.rv < de && (e.rv = de, D === null && r !== null && r[H] === e ? H++ : D === null ? D = [e] : D.push(e));
1364
+ else {
1365
+ w.deps ??= [], st.call(w.deps, e) || w.deps.push(e);
1366
+ var n = e.reactions;
1367
+ n === null ? e.reactions = [w] : st.call(n, w) || n.push(w);
1368
+ }
1369
+ }
1370
+ if (0) {
1371
+ if (!W && reactivity_loss_tracker && m === null && St === null && !reactivity_loss_tracker.warned && (reactivity_loss_tracker.effect.f & 2097152) === 0 && !reactivity_loss_tracker.effect_deps.has(e))
1372
+ var i;
1373
+ if (tracing_mode_flag && !W && tracing_expressions !== null && w !== null && tracing_expressions.reaction === w && !e.trace) {
1374
+ if (i)
1375
+ var s, l;
1376
+ }
1377
+ }
1378
+ if (ie && Z.has(e)) return Z.get(e);
1379
+ if (t) {
1380
+ var a = e;
1381
+ if (ie) {
1382
+ var c = a.v;
1383
+ return ((a.f & 1024) === 0 && a.reactions !== null || Xr(a)) && (c = Ht(a)), Z.set(a, c), c;
1384
+ }
1385
+ var v = (a.f & 512) === 0 && !W && w !== null && (rt || (w.f & 512) !== 0), h = (a.f & Nt) === 0;
1386
+ Ue(a) && (v && (a.f |= 512), Sr(a)), v && !h && (xr(a), Jr(a));
1387
+ }
1388
+ if (j?.has(e)) return j.get(e);
1389
+ if ((e.f & 8388608) !== 0) throw e.v;
1390
+ return e.v;
1391
+ }
1392
+ function Jr(e) {
1393
+ if (e.f |= 512, e.deps !== null)
1394
+ for (const t of e.deps)
1395
+ (t.reactions ??= []).push(e), (t.f & 2) !== 0 && (t.f & 512) === 0 && (xr(t), Jr(t));
1396
+ }
1397
+ function Xr(e) {
1398
+ if (e.v === I) return !0;
1399
+ if (e.deps === null) return !1;
1400
+ for (const t of e.deps)
1401
+ if (Z.has(t) || (t.f & 2) !== 0 && Xr(t)) return !0;
1402
+ return !1;
1403
+ }
1404
+ function Ye(e) {
1405
+ var t = W;
1406
+ try {
1407
+ return W = !0, e();
1408
+ } finally {
1409
+ W = t;
1410
+ }
1411
+ }
1412
+ var Je = /* @__PURE__ */ Symbol("events"), Ci = /* @__PURE__ */ new Set(), or = /* @__PURE__ */ new Set(), bt = null, $t = !1;
1413
+ function fr(e) {
1414
+ var t = this, r = t.ownerDocument, n = e.type, i = e.composedPath?.() || [], s = i[0] || e.target;
1415
+ bt = e, $t || ($t = !0, setTimeout(() => {
1416
+ $t = !1, bt = null;
1417
+ }));
1418
+ var l = 0, a = bt === e && e[Je];
1419
+ if (a) {
1420
+ var c = i.indexOf(a);
1421
+ if (c !== -1 && (t === document || t === window)) {
1422
+ e[Je] = t;
1423
+ return;
1424
+ }
1425
+ var v = i.indexOf(t);
1426
+ if (v === -1) return;
1427
+ c <= v && (l = c);
1428
+ }
1429
+ if (s = i[l] || e.target, s !== t) {
1430
+ Le(e, "currentTarget", {
1431
+ configurable: !0,
1432
+ get() {
1433
+ return s || r;
1434
+ }
1435
+ });
1436
+ var h = w, u = y;
1437
+ V(null), te(null);
1438
+ try {
1439
+ for (var f, o = []; s !== null && s !== t; ) {
1440
+ try {
1441
+ var d = s[Je]?.[n];
1442
+ d != null && (!s.disabled || e.target === s) && d.call(s, e);
1443
+ } catch (_) {
1444
+ f ? o.push(_) : f = _;
1445
+ }
1446
+ if (e.cancelBubble) break;
1447
+ l++, s = l < i.length ? i[l] : null;
1448
+ }
1449
+ if (f) {
1450
+ for (let _ of o) queueMicrotask(() => {
1451
+ throw _;
1452
+ });
1453
+ throw f;
1454
+ }
1455
+ } finally {
1456
+ e[Je] = t, delete e.currentTarget, V(h), te(u);
1457
+ }
1458
+ }
1459
+ }
1460
+ var Ai = globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", { createHTML: (e) => e });
1461
+ function Oi(e) {
1462
+ return Ai?.createHTML(e) ?? e;
1463
+ }
1464
+ function Ii(e) {
1465
+ var t = Ut("template");
1466
+ return t.innerHTML = Oi(e.replaceAll("<!>", "<!---->")), t.content;
1467
+ }
1468
+ function nt(e, t) {
1469
+ var r = y;
1470
+ r.nodes === null && (r.nodes = {
1471
+ start: e,
1472
+ end: t,
1473
+ a: null,
1474
+ t: null
1475
+ });
1476
+ }
1477
+ // @__NO_SIDE_EFFECTS__
1478
+ function vt(e, t) {
1479
+ var r = (t & 1) !== 0, n = (t & 2) !== 0, i, s = !e.startsWith("<!>");
1480
+ return () => {
1481
+ if (O)
1482
+ return nt(x, null), x;
1483
+ i === void 0 && (i = Ii(s ? e : "<!>" + e), r || (i = /* @__PURE__ */ Ee(i)));
1484
+ var l = n || Mr ? document.importNode(i, !0) : i.cloneNode(!0);
1485
+ if (r) {
1486
+ var a = /* @__PURE__ */ Ee(l), c = l.lastChild;
1487
+ nt(a, c);
1488
+ } else nt(l, l);
1489
+ return l;
1490
+ };
1491
+ }
1492
+ function Ie(e, t) {
1493
+ if (O) {
1494
+ var r = y;
1495
+ ((r.f & 32768) === 0 || r.nodes.end === null) && (r.nodes.end = x), Pt();
1496
+ return;
1497
+ }
1498
+ e !== null && e.before(t);
1499
+ }
1500
+ var Ri = [
1501
+ "allowfullscreen",
1502
+ "async",
1503
+ "autofocus",
1504
+ "autoplay",
1505
+ "checked",
1506
+ "controls",
1507
+ "default",
1508
+ "disabled",
1509
+ "formnovalidate",
1510
+ "indeterminate",
1511
+ "inert",
1512
+ "ismap",
1513
+ "loop",
1514
+ "multiple",
1515
+ "muted",
1516
+ "nomodule",
1517
+ "novalidate",
1518
+ "open",
1519
+ "playsinline",
1520
+ "readonly",
1521
+ "required",
1522
+ "reversed",
1523
+ "seamless",
1524
+ "selected",
1525
+ "webkitdirectory",
1526
+ "defer",
1527
+ "disablepictureinpicture",
1528
+ "disableremoteplayback"
1529
+ ], gs = [
1530
+ ...Ri,
1531
+ "formNoValidate",
1532
+ "isMap",
1533
+ "noModule",
1534
+ "playsInline",
1535
+ "readOnly",
1536
+ "value",
1537
+ "volume",
1538
+ "defaultValue",
1539
+ "defaultChecked",
1540
+ "srcObject",
1541
+ "noValidate",
1542
+ "allowFullscreen",
1543
+ "disablePictureInPicture",
1544
+ "disableRemotePlayback"
1545
+ ], Mi = ["touchstart", "touchmove"];
1546
+ function Ni(e) {
1547
+ return Mi.includes(e);
1548
+ }
1549
+ var ji = [
1550
+ "$state",
1551
+ "$state.raw",
1552
+ "$derived",
1553
+ "$derived.by"
1554
+ ], ys = [
1555
+ ...ji,
1556
+ "$state.eager",
1557
+ "$state.snapshot",
1558
+ "$props",
1559
+ "$props.id",
1560
+ "$bindable",
1561
+ "$effect",
1562
+ "$effect.pre",
1563
+ "$effect.tracking",
1564
+ "$effect.root",
1565
+ "$effect.pending",
1566
+ "$inspect",
1567
+ "$inspect().with",
1568
+ "$inspect.trace",
1569
+ "$host"
1570
+ ];
1571
+ function Pi(e) {
1572
+ let t = 0, r = Fe(0), n;
1573
+ return () => {
1574
+ Yt() && (p(r), Vt(() => (t === 0 && (n = Ye(() => e(() => je(r)))), t += 1, () => {
1575
+ ce(() => {
1576
+ t -= 1, t === 0 && (n?.(), n = void 0, je(r));
1577
+ });
1578
+ })));
1579
+ };
1580
+ }
1581
+ var Li = jt | Se;
1582
+ function qi(e, t, r, n) {
1583
+ new Di(e, t, r, n);
1584
+ }
1585
+ var Di = class {
1586
+ parent;
1587
+ is_pending = !1;
1588
+ transform_error;
1589
+ #e;
1590
+ #t = O ? x : null;
1591
+ #r;
1592
+ #o;
1593
+ #i;
1594
+ #a = null;
1595
+ #n = null;
1596
+ #l = null;
1597
+ #s = null;
1598
+ #h = 0;
1599
+ #f = 0;
1600
+ #u = !1;
1601
+ #d = /* @__PURE__ */ new Set();
1602
+ #p = /* @__PURE__ */ new Set();
1603
+ #c = null;
1604
+ #w = Pi(() => (this.#c = Fe(this.#h), () => {
1605
+ this.#c = null;
1606
+ }));
1607
+ constructor(e, t, r, n) {
1608
+ this.#e = e, this.#r = t, this.#o = (i) => {
1609
+ var s = y;
1610
+ s.b = this, s.f |= 128, r(i);
1611
+ }, this.parent = y.b, this.transform_error = n ?? this.parent?.transform_error ?? ((i) => i), this.#i = Dr(() => {
1612
+ if (O) {
1613
+ const i = this.#t;
1614
+ Pt();
1615
+ const s = i.data === "[!";
1616
+ if (i.data.startsWith("[?")) {
1617
+ const l = JSON.parse(i.data.slice(2));
1618
+ this.#g(l);
1619
+ } else s ? this.#k() : this.#b();
1620
+ } else this.#$();
1621
+ }, Li), O && (this.#e = x);
1622
+ }
1623
+ #b() {
1624
+ try {
1625
+ this.#a = ne(() => this.#o(this.#e));
1626
+ } catch (e) {
1627
+ this.error(e);
1628
+ }
1629
+ }
1630
+ #g(e) {
1631
+ const t = this.#r.failed, { reset: r, invoke_onerror: n } = this.#y(e);
1632
+ ce(n), t && (this.#l = ne(() => {
1633
+ t(this.#e, () => e, () => r);
1634
+ }));
1635
+ }
1636
+ #y(e) {
1637
+ var t = !1, r = !1;
1638
+ const n = () => {
1639
+ if (t) {
1640
+ Pn();
1641
+ return;
1642
+ }
1643
+ t = !0, r && Xn(), this.#l !== null && Pe(this.#l, () => {
1644
+ this.#l = null;
1645
+ }), this.#m(() => {
1646
+ this.#$();
1647
+ });
1648
+ };
1649
+ return {
1650
+ reset: n,
1651
+ invoke_onerror: () => {
1652
+ try {
1653
+ r = !0, this.#r.onerror?.(e, n), r = !1;
1654
+ } catch (s) {
1655
+ X(s, this.#i && this.#i.parent);
1656
+ }
1657
+ }
1658
+ };
1659
+ }
1660
+ #k() {
1661
+ const e = this.#r.pending;
1662
+ e && (this.is_pending = !0, this.#n = ne(() => e(this.#e)), ce(() => {
1663
+ var t = this.#s = document.createDocumentFragment(), r = pe(), n = !1;
1664
+ if (t.append(r), this.#a = this.#m(() => {
1665
+ try {
1666
+ return ne(() => this.#o(r));
1667
+ } catch (i) {
1668
+ try {
1669
+ this.error(i), n = !0;
1670
+ } catch (s) {
1671
+ X(s, this.#i.parent);
1672
+ }
1673
+ return null;
1674
+ }
1675
+ }), this.#a === null) {
1676
+ this.#s = null, n && this.#v(m);
1677
+ return;
1678
+ }
1679
+ this.#f === 0 && (this.#e.before(t), this.#s = null, Pe(this.#n, () => {
1680
+ this.#n = null;
1681
+ }), this.#v(m));
1682
+ }));
1683
+ }
1684
+ #$() {
1685
+ try {
1686
+ if (this.is_pending = this.has_pending_snippet(), this.#f = 0, this.#h = 0, this.#a = ne(() => {
1687
+ this.#o(this.#e);
1688
+ }), this.#f > 0) {
1689
+ var e = this.#s = document.createDocumentFragment();
1690
+ Ur(this.#a, e);
1691
+ const t = this.#r.pending;
1692
+ this.#n = ne(() => t(this.#e));
1693
+ } else this.#v(m);
1694
+ } catch (t) {
1695
+ this.error(t);
1696
+ }
1697
+ }
1698
+ #v(e) {
1699
+ this.is_pending = !1, e.transfer_effects(this.#d, this.#p);
1700
+ }
1701
+ defer_effect(e) {
1702
+ kr(e, this.#d, this.#p);
1703
+ }
1704
+ is_rendered() {
1705
+ return !this.is_pending && (!this.parent || this.parent.is_rendered());
1706
+ }
1707
+ has_pending_snippet() {
1708
+ return !!this.#r.pending;
1709
+ }
1710
+ #m(e) {
1711
+ var t = y, r = w, n = k;
1712
+ te(this.#i), V(this.#i), ke(this.#i.ctx);
1713
+ try {
1714
+ return xe.ensure(), e();
1715
+ } finally {
1716
+ te(t), V(r), ke(n);
1717
+ }
1718
+ }
1719
+ #_(e, t) {
1720
+ if (!this.has_pending_snippet()) {
1721
+ this.parent && this.parent.#_(e, t);
1722
+ return;
1723
+ }
1724
+ this.#f += e, this.#f === 0 && (this.#v(t), this.#n && Pe(this.#n, () => {
1725
+ this.#n = null;
1726
+ }), this.#s && (this.#e.before(this.#s), this.#s = null));
1727
+ }
1728
+ update_pending_count(e, t) {
1729
+ this.#_(e, t), this.#h += e, !(!this.#c || this.#u) && (this.#u = !0, ce(() => {
1730
+ this.#u = !1, this.#c && ut(this.#c, this.#h);
1731
+ }));
1732
+ }
1733
+ get_effect_pending() {
1734
+ return this.#w(), p(this.#c);
1735
+ }
1736
+ error(e) {
1737
+ if (!this.#r.onerror && !this.#r.failed) throw e;
1738
+ m?.is_fork ? (this.#a && m.skip_effect(this.#a), this.#n && m.skip_effect(this.#n), this.#l && m.skip_effect(this.#l), m.oncommit(() => {
1739
+ this.#E(e);
1740
+ })) : this.#E(e);
1741
+ }
1742
+ #E(e) {
1743
+ this.#a && (z(this.#a), this.#a = null), this.#n && (z(this.#n), this.#n = null), this.#l && (z(this.#l), this.#l = null), O && (ee(this.#t), Ln(), ee(mr()));
1744
+ let t = this.#r.failed;
1745
+ const r = (n) => {
1746
+ const { reset: i, invoke_onerror: s } = this.#y(n);
1747
+ s(), t && (this.#l = this.#m(() => {
1748
+ try {
1749
+ return ne(() => {
1750
+ var l = y;
1751
+ l.b = this, l.f |= 128, t(this.#e, () => n, () => i);
1752
+ });
1753
+ } catch (l) {
1754
+ return X(l, this.#i.parent), null;
1755
+ }
1756
+ }));
1757
+ };
1758
+ ce(() => {
1759
+ var n;
1760
+ try {
1761
+ n = this.transform_error(e);
1762
+ } catch (i) {
1763
+ X(i, this.#i && this.#i.parent);
1764
+ return;
1765
+ }
1766
+ n !== null && typeof n == "object" && typeof n.then == "function" ? n.then(r, (i) => X(i, this.#i && this.#i.parent)) : r(n);
1767
+ });
1768
+ }
1769
+ }, ur = !0;
1770
+ function cr(e, t) {
1771
+ var r = t == null ? "" : typeof t == "object" ? `${t}` : t;
1772
+ r !== (e[Tt] ??= e.nodeValue) && (e[Tt] = r, e.nodeValue = `${r}`);
1773
+ }
1774
+ function Zr(e, t) {
1775
+ return Qr(e, t);
1776
+ }
1777
+ function zi(e, t) {
1778
+ Ot(), t.intro = t.intro ?? !1;
1779
+ const r = t.target, n = O, i = x;
1780
+ try {
1781
+ for (var s = /* @__PURE__ */ Ee(r); s && (s.nodeType !== 8 || s.data !== "["); ) s = /* @__PURE__ */ le(s);
1782
+ if (!s) throw $e;
1783
+ we(!0), ee(s);
1784
+ const l = Qr(e, {
1785
+ ...t,
1786
+ anchor: s
1787
+ });
1788
+ return we(!1), l;
1789
+ } catch (l) {
1790
+ if (l instanceof Error && l.message.split(`
1791
+ `).some((a) => a.startsWith("https://svelte.dev/e/"))) throw l;
1792
+ return l !== $e && console.warn("Failed to hydrate: ", l), t.recover === !1 && Vn(), Ot(), hi(r), we(!1), Zr(e, t);
1793
+ } finally {
1794
+ we(n), ee(i);
1795
+ }
1796
+ }
1797
+ var Xe = /* @__PURE__ */ new Map();
1798
+ function Qr(e, { target: t, anchor: r, props: n = {}, events: i, context: s, intro: l = !0, transformError: a }) {
1799
+ Ot();
1800
+ var c = void 0, v = bi(() => {
1801
+ var h = r ?? t.appendChild(pe());
1802
+ qi(h, { pending: () => {
1803
+ } }, (o) => {
1804
+ Lt({});
1805
+ var d = k;
1806
+ if (s && (d.c = s), i && (n.$$events = i), O && nt(o, null), ur = l, c = e(o, n) || Dt(), ur = !0, O && (y.nodes.end = x, x === null || x.nodeType !== 8 || x.data !== "]"))
1807
+ throw ct(), $e;
1808
+ qt();
1809
+ }, a);
1810
+ var u = /* @__PURE__ */ new Set(), f = (o) => {
1811
+ for (var d = 0; d < o.length; d++) {
1812
+ var _ = o[d];
1813
+ if (!u.has(_)) {
1814
+ u.add(_);
1815
+ var b = Ni(_);
1816
+ for (const F of [t, document]) {
1817
+ var E = Xe.get(F);
1818
+ E === void 0 && (E = /* @__PURE__ */ new Map(), Xe.set(F, E));
1819
+ var R = E.get(_);
1820
+ R === void 0 ? (F.addEventListener(_, fr, { passive: b }), E.set(_, 1)) : E.set(_, R + 1);
1821
+ }
1822
+ }
1823
+ }
1824
+ };
1825
+ return f(bn(Ci)), or.add(f), () => {
1826
+ for (var o of u) for (const b of [t, document]) {
1827
+ var d = Xe.get(b), _ = d.get(o);
1828
+ --_ == 0 ? (b.removeEventListener(o, fr), d.delete(o), d.size === 0 && Xe.delete(b)) : d.set(o, _);
1829
+ }
1830
+ or.delete(f), h !== r && h.parentNode?.removeChild(h);
1831
+ };
1832
+ });
1833
+ return Rt.set(c, v), c;
1834
+ }
1835
+ var Rt = /* @__PURE__ */ new WeakMap();
1836
+ function Hi(e, t) {
1837
+ const r = Rt.get(e);
1838
+ return r ? (Rt.delete(e), r(t)) : Promise.resolve();
1839
+ }
1840
+ var Bi = class {
1841
+ anchor;
1842
+ #e = /* @__PURE__ */ new Map();
1843
+ #t = /* @__PURE__ */ new Map();
1844
+ #r = /* @__PURE__ */ new Map();
1845
+ #o = /* @__PURE__ */ new Set();
1846
+ #i = !0;
1847
+ constructor(e, t = !0) {
1848
+ this.anchor = e, this.#i = t;
1849
+ }
1850
+ #a = (e) => {
1851
+ if (this.#e.has(e)) {
1852
+ var t = this.#e.get(e), r = this.#t.get(t);
1853
+ if (r)
1854
+ ir(r), this.#o.delete(t);
1855
+ else {
1856
+ var n = this.#r.get(t);
1857
+ n && (ir(n.effect), this.#t.set(t, n.effect), this.#r.delete(t), n.fragment.lastChild.remove(), this.anchor.before(n.fragment), r = n.effect);
1858
+ }
1859
+ for (const [i, s] of this.#e) {
1860
+ if (this.#e.delete(i), i === e) break;
1861
+ const l = this.#r.get(s);
1862
+ l && (z(l.effect), this.#r.delete(s));
1863
+ }
1864
+ for (const [i, s] of this.#t) {
1865
+ if (i === t || this.#o.has(i)) continue;
1866
+ const l = () => {
1867
+ if (Array.from(this.#e.values()).includes(i)) {
1868
+ var a = document.createDocumentFragment();
1869
+ Ur(s, a), a.append(pe()), this.#r.set(i, {
1870
+ effect: s,
1871
+ fragment: a
1872
+ });
1873
+ } else z(s);
1874
+ this.#o.delete(i), this.#t.delete(i);
1875
+ };
1876
+ this.#i || !r ? (this.#o.add(i), Pe(s, l, !1)) : l();
1877
+ }
1878
+ }
1879
+ };
1880
+ #n = (e) => {
1881
+ this.#e.delete(e);
1882
+ const t = Array.from(this.#e.values());
1883
+ for (const [r, n] of this.#r) t.includes(r) || (z(n.effect), this.#r.delete(r));
1884
+ };
1885
+ ensure(e, t) {
1886
+ var r = m, n = _i();
1887
+ if (t && !this.#t.has(e) && !this.#r.has(e))
1888
+ if (n) {
1889
+ var i = document.createDocumentFragment(), s = pe();
1890
+ i.append(s), this.#r.set(e, {
1891
+ effect: ne(() => t(s)),
1892
+ fragment: i
1893
+ });
1894
+ } else this.#t.set(e, ne(() => t(this.anchor)));
1895
+ if (this.#e.set(r, e), n) {
1896
+ for (const [l, a] of this.#t) l === e ? r.unskip_effect(a) : r.skip_effect(a);
1897
+ for (const [l, a] of this.#r) l === e ? r.unskip_effect(a.effect) : r.skip_effect(a.effect);
1898
+ r.oncommit(this.#a), r.ondiscard(this.#n);
1899
+ } else
1900
+ O && (this.anchor = x), this.#a(r);
1901
+ }
1902
+ };
1903
+ function Fi(e) {
1904
+ k === null && zn("onMount"), He && k.l !== null ? Ui(k).m.push(e) : It(() => {
1905
+ const t = Ye(e);
1906
+ if (typeof t == "function") return t;
1907
+ });
1908
+ }
1909
+ function Ui(e) {
1910
+ var t = e.l;
1911
+ return t.u ??= {
1912
+ a: [],
1913
+ b: [],
1914
+ m: []
1915
+ };
1916
+ }
1917
+ function kt(e, t, r = !1) {
1918
+ var n;
1919
+ O && (n = x, Pt());
1920
+ var i = new Bi(e), s = r ? jt : 0;
1921
+ function l(a, c) {
1922
+ if (O) {
1923
+ var v = qn(n);
1924
+ if (a !== parseInt(v.substring(1))) {
1925
+ var h = mr();
1926
+ ee(h), i.anchor = h, we(!1), i.ensure(a, c), we(!0);
1927
+ return;
1928
+ }
1929
+ }
1930
+ i.ensure(a, c);
1931
+ }
1932
+ Dr(() => {
1933
+ var a = !1;
1934
+ t((c, v = 0) => {
1935
+ a = !0, l(v, c);
1936
+ }), a || l(-1, null);
1937
+ }, s);
1938
+ }
1939
+ function en(e, t) {
1940
+ qr(() => {
1941
+ e = y?.parent?.nodes?.start ?? e;
1942
+ var r = e.getRootNode(), n = r.host ? r : r.head ?? r.ownerDocument.head;
1943
+ if (!n.querySelector("#" + t.hash)) {
1944
+ const i = Ut("style");
1945
+ i.id = t.hash, i.textContent = t.code, n.appendChild(i);
1946
+ }
1947
+ });
1948
+ }
1949
+ var Yi = /* @__PURE__ */ Symbol("is custom element"), Vi = /* @__PURE__ */ Symbol("is html"), Gi = Nn ? "link" : "LINK";
1950
+ function me(e, t, r, n) {
1951
+ var i = Ki(e);
1952
+ if (O && (i[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === Gi)) {
1953
+ n || void 0;
1954
+ return;
1955
+ }
1956
+ i[t] !== (i[t] = r) && (t === "loading" && (e[On] = r), r == null ? e.removeAttribute(t) : typeof r != "string" && Wi(e).has(t) ? e[t] = r : e.setAttribute(t, r));
1957
+ }
1958
+ function Ki(e) {
1959
+ return e[yr] ??= {
1960
+ [Yi]: e.nodeName.includes("-"),
1961
+ [Vi]: e.namespaceURI === yn
1962
+ };
1963
+ }
1964
+ var dr = /* @__PURE__ */ new Map();
1965
+ function Wi(e) {
1966
+ var t = e.getAttribute("is") || e.nodeName, r = dr.get(t);
1967
+ if (r) return r;
1968
+ dr.set(t, r = /* @__PURE__ */ new Set());
1969
+ for (var n, i = e, s = Element.prototype; s !== i; ) {
1970
+ n = $n(i);
1971
+ for (var l in n) n[l].set && l !== "innerHTML" && l !== "textContent" && l !== "innerText" && r.add(l);
1972
+ i = hr(i);
1973
+ }
1974
+ return r;
1975
+ }
1976
+ function Et(e, t) {
1977
+ return e === t || e?.[Re] === t;
1978
+ }
1979
+ function vr(e = Dt(), t, r, n) {
1980
+ var i = k.r, s = y;
1981
+ return qr(() => {
1982
+ var l, a;
1983
+ return Vt(() => {
1984
+ l = a, a = n?.() || [], Ye(() => {
1985
+ Et(r(...a), e) || (t(e, ...a), l && Et(r(...l), e) && t(null, ...l));
1986
+ });
1987
+ }), () => {
1988
+ let c = s;
1989
+ for (; c !== i && c.parent !== null && c.parent.f & 33554432; ) c = c.parent;
1990
+ const v = () => {
1991
+ a && Et(r(...a), e) && t(null, ...a);
1992
+ }, h = c.teardown;
1993
+ c.teardown = () => {
1994
+ v(), h?.();
1995
+ };
1996
+ };
1997
+ }), e;
1998
+ }
1999
+ var Ze = !1;
2000
+ function Ji(e) {
2001
+ var t = Ze;
2002
+ try {
2003
+ return Ze = !1, [e(), Ze];
2004
+ } finally {
2005
+ Ze = t;
2006
+ }
2007
+ }
2008
+ function q(e, t, r, n) {
2009
+ var i = !He || (r & 2) !== 0, s = (r & 8) !== 0, l = (r & 16) !== 0, a = n, c = !0, v = void 0, h = () => l && i ? (v ??= /* @__PURE__ */ qe(n), p(v)) : (c && (c = !1, a = l ? Ye(n) : n), a);
2010
+ let u;
2011
+ if (s) {
2012
+ var f = Re in e || gr in e;
2013
+ u = ve(e, t)?.set ?? (f && t in e ? (C) => e[t] = C : void 0);
2014
+ }
2015
+ var o, d = !1;
2016
+ s ? [o, d] = Ji(() => e[t]) : o = e[t], o === void 0 && n !== void 0 && (o = h(), u && (i && Gn(t), u(o)));
2017
+ var _;
2018
+ if (i ? _ = () => {
2019
+ var C = e[t];
2020
+ return C === void 0 ? h() : (c = !0, C);
2021
+ } : _ = () => {
2022
+ var C = e[t];
2023
+ return C !== void 0 && (a = void 0), C === void 0 ? a : C;
2024
+ }, i && (r & 4) === 0) return _;
2025
+ if (u) {
2026
+ var b = e.$$legacy;
2027
+ return (function(C, G) {
2028
+ return arguments.length > 0 ? ((!i || !G || b || d) && u(G ? _() : C), C) : _();
2029
+ });
2030
+ }
2031
+ var E = !1, R = ((r & 1) !== 0 ? qe : Tr)(() => (E = !1, _()));
2032
+ s && p(R);
2033
+ var F = y;
2034
+ return (function(C, G) {
2035
+ if (arguments.length > 0) {
2036
+ const N = G ? p(R) : i && s ? be(C) : C;
2037
+ return $(R, N), E = !0, a !== void 0 && (a = N), C;
2038
+ }
2039
+ return ie && E || (F.f & 16384) !== 0 ? R.v : p(R);
2040
+ });
2041
+ }
2042
+ function Xi(e) {
2043
+ return new Zi(e);
2044
+ }
2045
+ var Zi = class {
2046
+ #e;
2047
+ #t;
2048
+ constructor(e) {
2049
+ var t = /* @__PURE__ */ new Map(), r = (i, s) => {
2050
+ var l = /* @__PURE__ */ fi(s, !1, !1);
2051
+ return t.set(i, l), l;
2052
+ };
2053
+ const n = new Proxy({
2054
+ ...e.props || {},
2055
+ $$events: {}
2056
+ }, {
2057
+ get(i, s) {
2058
+ return p(t.get(s) ?? r(s, Reflect.get(i, s)));
2059
+ },
2060
+ has(i, s) {
2061
+ return s === gr ? !0 : (p(t.get(s) ?? r(s, Reflect.get(i, s))), Reflect.has(i, s));
2062
+ },
2063
+ set(i, s, l) {
2064
+ return $(t.get(s) ?? r(s, l), l), Reflect.set(i, s, l);
2065
+ }
2066
+ });
2067
+ this.#t = (e.hydrate ? zi : Zr)(e.component, {
2068
+ target: e.target,
2069
+ anchor: e.anchor,
2070
+ props: n,
2071
+ context: e.context,
2072
+ intro: e.intro ?? !1,
2073
+ recover: e.recover,
2074
+ transformError: e.transformError
2075
+ }), !ae && (!e?.props?.$$host || e.sync === !1) && L(), this.#e = n.$$events;
2076
+ for (const i of Object.keys(this.#t))
2077
+ i === "$set" || i === "$destroy" || i === "$on" || Le(this, i, {
2078
+ get() {
2079
+ return this.#t[i];
2080
+ },
2081
+ set(s) {
2082
+ this.#t[i] = s;
2083
+ },
2084
+ enumerable: !0
2085
+ });
2086
+ this.#t.$set = (i) => {
2087
+ Object.assign(n, i);
2088
+ }, this.#t.$destroy = () => {
2089
+ Hi(this.#t);
2090
+ };
2091
+ }
2092
+ $set(e) {
2093
+ this.#t.$set(e);
2094
+ }
2095
+ $on(e, t) {
2096
+ this.#e[e] = this.#e[e] || [];
2097
+ const r = (...n) => t.call(this, ...n);
2098
+ return this.#e[e].push(r), () => {
2099
+ this.#e[e] = this.#e[e].filter((n) => n !== r);
2100
+ };
2101
+ }
2102
+ $destroy() {
2103
+ this.#t.$destroy();
2104
+ }
2105
+ }, tn;
2106
+ typeof HTMLElement == "function" && (tn = class extends HTMLElement {
2107
+ $$ctor;
2108
+ $$s;
2109
+ $$c;
2110
+ $$cn = !1;
2111
+ $$d = {};
2112
+ $$r = !1;
2113
+ $$p_d = {};
2114
+ $$l = {};
2115
+ $$l_u = /* @__PURE__ */ new Map();
2116
+ $$me;
2117
+ $$shadowRoot = null;
2118
+ constructor(e, t, r) {
2119
+ super(), this.$$ctor = e, this.$$s = t, r && (this.$$shadowRoot = this.attachShadow(r));
2120
+ }
2121
+ addEventListener(e, t, r) {
2122
+ if (this.$$l[e] = this.$$l[e] || [], this.$$l[e].push(t), this.$$c) {
2123
+ const n = this.$$c.$on(e, t);
2124
+ this.$$l_u.set(t, n);
2125
+ }
2126
+ super.addEventListener(e, t, r);
2127
+ }
2128
+ removeEventListener(e, t, r) {
2129
+ if (super.removeEventListener(e, t, r), this.$$c) {
2130
+ const n = this.$$l_u.get(t);
2131
+ n && (n(), this.$$l_u.delete(t));
2132
+ }
2133
+ }
2134
+ async connectedCallback() {
2135
+ if (this.$$cn = !0, !this.$$c) {
2136
+ let e = function(n) {
2137
+ return (i) => {
2138
+ const s = Ut("slot");
2139
+ n !== "default" && (s.name = n), Ie(i, s);
2140
+ };
2141
+ };
2142
+ if (await Promise.resolve(), !this.$$cn || this.$$c) return;
2143
+ const t = {}, r = Qi(this);
2144
+ for (const n of this.$$s) n in r && (n === "default" && !this.$$d.children ? (this.$$d.children = e(n), t.default = !0) : t[n] = e(n));
2145
+ for (const n of this.attributes) {
2146
+ const i = this.$$g_p(n.name);
2147
+ i in this.$$d || (this.$$d[i] = it(i, n.value, this.$$p_d, "toProp"));
2148
+ }
2149
+ for (const n in this.$$p_d) !(n in this.$$d) && this[n] !== void 0 && (this.$$d[n] = this[n], delete this[n]);
2150
+ this.$$c = Xi({
2151
+ component: this.$$ctor,
2152
+ target: this.$$shadowRoot || this,
2153
+ props: {
2154
+ ...this.$$d,
2155
+ $$slots: t,
2156
+ $$host: this
2157
+ }
2158
+ }), this.$$me = wi(() => {
2159
+ Vt(() => {
2160
+ this.$$r = !0;
2161
+ for (const n of at(this.$$c)) {
2162
+ if (!this.$$p_d[n]?.reflect) continue;
2163
+ this.$$d[n] = this.$$c[n];
2164
+ const i = it(n, this.$$d[n], this.$$p_d, "toAttribute");
2165
+ i == null ? this.removeAttribute(this.$$p_d[n].attribute || n) : this.setAttribute(this.$$p_d[n].attribute || n, i);
2166
+ }
2167
+ this.$$r = !1;
2168
+ });
2169
+ });
2170
+ for (const n in this.$$l) for (const i of this.$$l[n]) {
2171
+ const s = this.$$c.$on(n, i);
2172
+ this.$$l_u.set(i, s);
2173
+ }
2174
+ this.$$l = {};
2175
+ }
2176
+ }
2177
+ attributeChangedCallback(e, t, r) {
2178
+ this.$$r || (e = this.$$g_p(e), this.$$d[e] = it(e, r, this.$$p_d, "toProp"), this.$$c?.$set({ [e]: this.$$d[e] }));
2179
+ }
2180
+ disconnectedCallback() {
2181
+ this.$$cn = !1, Promise.resolve().then(() => {
2182
+ !this.$$cn && this.$$c && (this.$$c.$destroy(), this.$$me(), this.$$c = void 0);
2183
+ });
2184
+ }
2185
+ $$g_p(e) {
2186
+ return at(this.$$p_d).find((t) => this.$$p_d[t].attribute === e || !this.$$p_d[t].attribute && t.toLowerCase() === e) || e;
2187
+ }
2188
+ });
2189
+ function it(e, t, r, n) {
2190
+ const i = r[e]?.type;
2191
+ if (t = i === "Boolean" && typeof t != "boolean" ? t != null : t, !n || !r[e]) return t;
2192
+ if (n === "toAttribute") switch (i) {
2193
+ case "Object":
2194
+ case "Array":
2195
+ return t == null ? null : JSON.stringify(t);
2196
+ case "Boolean":
2197
+ return t ? "" : null;
2198
+ case "Number":
2199
+ return t ?? null;
2200
+ default:
2201
+ return t;
2202
+ }
2203
+ else switch (i) {
2204
+ case "Object":
2205
+ case "Array":
2206
+ return t && JSON.parse(t);
2207
+ case "Boolean":
2208
+ return t;
2209
+ case "Number":
2210
+ return t != null ? +t : t;
2211
+ default:
2212
+ return t;
2213
+ }
2214
+ }
2215
+ function Qi(e) {
2216
+ const t = {};
2217
+ return e.childNodes.forEach((r) => {
2218
+ t[r.slot || "default"] = !0;
2219
+ }), t;
2220
+ }
2221
+ function rn(e, t, r, n, i, s) {
2222
+ let l = class extends tn {
2223
+ constructor() {
2224
+ super(e, r, i), this.$$p_d = t;
2225
+ }
2226
+ static get observedAttributes() {
2227
+ return at(t).map((a) => (t[a].attribute || a).toLowerCase());
2228
+ }
2229
+ };
2230
+ return at(t).forEach((a) => {
2231
+ Le(l.prototype, a, {
2232
+ get() {
2233
+ return this.$$c && a in this.$$c ? this.$$c[a] : this.$$d[a];
2234
+ },
2235
+ set(c) {
2236
+ c = it(a, c, t), this.$$d[a] = c;
2237
+ var v = this.$$c;
2238
+ v && (ve(v, a)?.get ? v[a] = c : v.$set({ [a]: c }));
2239
+ }
2240
+ });
2241
+ }), n.forEach((a) => {
2242
+ Le(l.prototype, a, { get() {
2243
+ return this.$$c?.[a];
2244
+ } });
2245
+ }), s && (l = s(l)), e.element = l, l;
2246
+ }
2247
+ function es(e) {
2248
+ const t = /* @__PURE__ */ new Set(), r = (n) => {
2249
+ if (n === void 0) return { $type: "undefined" };
2250
+ if (typeof n == "bigint") return {
2251
+ $type: "bigint",
2252
+ value: n.toString()
2253
+ };
2254
+ if (typeof n == "function") return {
2255
+ $type: "function",
2256
+ value: n.toString()
2257
+ };
2258
+ if (typeof n == "symbol") return {
2259
+ $type: "symbol",
2260
+ value: n.description ?? ""
2261
+ };
2262
+ if (n === null || typeof n != "object") return n;
2263
+ if (t.has(n)) return { $type: "circular-reference" };
2264
+ t.add(n);
2265
+ const i = Array.isArray(n) ? n.map(r) : Object.fromEntries(Object.entries(n).sort(([s], [l]) => s.localeCompare(l)).map(([s, l]) => [s, r(l)]));
2266
+ return t.delete(n), i;
2267
+ };
2268
+ return JSON.stringify(r(e));
2269
+ }
2270
+ var ts = /* @__PURE__ */ vt('<div class="pie-tool-calculator__loading svelte-16ps7c2"> </div>'), rs = /* @__PURE__ */ vt('<div class="pie-tool-calculator__loading pie-tool-calculator__loading--error svelte-16ps7c2">Calculator failed to initialize. <div class="pie-tool-calculator__error-details svelte-16ps7c2"> </div></div>'), ns = /* @__PURE__ */ vt('<div class="pie-tool-calculator notranslate svelte-16ps7c2" role="region" tabindex="-1" translate="no"><div class="pie-tool-calculator__container svelte-16ps7c2"></div> <!> <!></div>'), is = /* @__PURE__ */ vt('<div class="pie-tool-calculator__context-host svelte-16ps7c2"><!></div>'), ss = {
2271
+ hash: "svelte-16ps7c2",
2272
+ code: `.pie-tool-calculator__context-host.svelte-16ps7c2 {display:flex;width:100%;height:100%;min-height:0;}.pie-tool-calculator.svelte-16ps7c2 {position:relative;display:flex;flex:1 1 auto;min-width:100%;min-height:0;background:var(--pie-white, white);overflow:hidden;}.pie-tool-calculator__container.svelte-16ps7c2 {position:relative;width:100%;height:100%;min-width:100%;min-height:100%;
2273
+ /*
2274
+ * \`--pie-white\`, not the literal. The token inverts by design (#ffffff light,
2275
+ * #000000 dark, redefined per colour scheme), so a hardcoded white showed
2276
+ * through as a white plate behind a dark calculator the moment a provider's own
2277
+ * surface stopped being opaque — and under a PNP colour scheme it was simply
2278
+ * the wrong colour.
2279
+ */background:var(--pie-white, white);overflow:hidden;}.pie-tool-calculator__mount {width:100%;height:100%;min-width:100%;min-height:100%;}.pie-tool-calculator__loading.svelte-16ps7c2 {position:absolute;inset:0;z-index:2;display:flex;align-items:center;justify-content:center;background:color-mix(in srgb, var(--pie-white, #fff) 90%, transparent);color:var(--pie-text, #334155);font-size:0.9rem;}.pie-tool-calculator__loading--error.svelte-16ps7c2 {flex-direction:column;gap:0.5rem;padding:0.75rem;color:var(--pie-incorrect, #b91c1c);text-align:center;}.pie-tool-calculator__error-details.svelte-16ps7c2 {max-width:95%;color:var(--pie-incorrect, #7f1d1d);font-size:0.8rem;line-height:1.2;word-break:break-word;}.pie-tool-calculator__mount > * {width:100% !important;height:100% !important;}`
2280
+ };
2281
+ function nn(e, t) {
2282
+ Lt(t, !0), en(e, ss);
2283
+ let r = q(t, "visible", 7, !1), n = q(t, "toolId", 7, "calculator"), i = q(t, "providerId", 7, ""), s = q(t, "calculatorType", 7, "basic"), l = q(t, "availableTypes", 23, () => [
12
2284
  "basic",
13
2285
  "scientific",
14
2286
  "graphing"
15
- ]), u = t.prop(r, "calculatorConfig", 23, () => ({})), n = t.prop(r, "toolkitCoordinator", 7, null);
16
- var d = {
2287
+ ]), a = q(t, "calculatorConfig", 23, () => ({})), c = q(t, "toolkitCoordinator", 7, null), v = /* @__PURE__ */ P(null), h = /* @__PURE__ */ P(null), u = /* @__PURE__ */ P(null), f = /* @__PURE__ */ P(null), o = /* @__PURE__ */ P(!1), d = /* @__PURE__ */ P(null), _ = /* @__PURE__ */ P(!1);
2288
+ const b = /* @__PURE__ */ Ae(() => gn(p(u))), E = /* @__PURE__ */ Ae(() => c() ?? p(u)?.toolkitCoordinator), R = /* @__PURE__ */ Ae(() => (typeof l() == "string" ? l().split(",").map((g) => g.trim()) : l()).filter((g) => g === "basic" || g === "scientific" || g === "graphing")), F = /* @__PURE__ */ Ae(() => p(R).includes(s()) ? s() : p(R)[0] ?? "basic"), C = /* @__PURE__ */ Ae(() => es(a()));
2289
+ let G = null, N = null, oe = 0, ht = !1, Ve = null;
2290
+ const Ge = /* @__PURE__ */ new Set();
2291
+ It(() => {
2292
+ if (p(v))
2293
+ return pn(p(v), (g) => {
2294
+ $(u, g, !0);
2295
+ });
2296
+ });
2297
+ function Kt() {
2298
+ Ve?.disconnect(), Ve = null;
2299
+ for (const g of Ge) clearTimeout(g);
2300
+ Ge.clear();
2301
+ }
2302
+ function _t() {
2303
+ oe += 1, Kt();
2304
+ const g = p(f), A = N;
2305
+ $(f, null), N = null;
2306
+ try {
2307
+ g?.destroy();
2308
+ } catch (T) {
2309
+ console.warn("[CalculatorTool] calculator cleanup failed:", T);
2310
+ }
2311
+ A?.remove(), G = null, $(o, !1), $(_, !1);
2312
+ }
2313
+ function Wt() {
2314
+ requestAnimationFrame(() => {
2315
+ if (!r() || !p(f) || !N?.isConnected) return;
2316
+ const g = document.activeElement;
2317
+ g instanceof Node && N.contains(g) || p(f).focus?.();
2318
+ });
2319
+ }
2320
+ function an(g, A) {
2321
+ Kt(), typeof ResizeObserver < "u" && (Ve = new ResizeObserver(() => {
2322
+ r() && A.isConnected && g.resize?.();
2323
+ }), Ve.observe(A));
2324
+ for (const T of [
2325
+ 60,
2326
+ 250,
2327
+ 1e3
2328
+ ]) {
2329
+ const M = setTimeout(() => {
2330
+ Ge.delete(M), r() && A.isConnected && g.resize?.();
2331
+ }, T);
2332
+ Ge.add(M);
2333
+ }
2334
+ }
2335
+ async function ln(g, A, T) {
2336
+ $(o, !0), $(d, null);
2337
+ try {
2338
+ if (!i()) throw new Error("Calculator provider id is required");
2339
+ const M = p(E)?.toolProviderRegistry;
2340
+ if (!M) throw new Error("Calculator provider registry is unavailable");
2341
+ const pt = await (await M.getProvider(i())).createInstance();
2342
+ if (g !== oe || !r() || !T.isConnected) {
2343
+ T.remove();
2344
+ return;
2345
+ }
2346
+ const ge = await pt.createCalculator(p(F), T, a());
2347
+ if (g !== oe || !r() || !T.isConnected) {
2348
+ ge.destroy(), T.remove();
2349
+ return;
2350
+ }
2351
+ $(f, ge, !0), G = A, $(_, T.childElementCount > 0), an(ge, T), requestAnimationFrame(() => {
2352
+ g === oe && (ge.resize?.(), $(_, T.childElementCount > 0), Wt());
2353
+ });
2354
+ } catch (M) {
2355
+ if (g !== oe) {
2356
+ T.remove();
2357
+ return;
2358
+ }
2359
+ $(d, M instanceof Error ? M.message : String(M), !0), $(f, null), N === T && (N = null), T.remove(), $(_, !1);
2360
+ } finally {
2361
+ g === oe && $(o, !1);
2362
+ }
2363
+ }
2364
+ function on() {
2365
+ ht = !1;
2366
+ const g = p(h), A = p(E);
2367
+ if (!r() || !g || !g.isConnected || !A) {
2368
+ (p(f) || p(o) || N) && _t(), $(d, null);
2369
+ return;
2370
+ }
2371
+ const T = `${i()}:${p(F)}:${p(C)}`;
2372
+ if (p(f) && G === T) {
2373
+ Wt();
2374
+ return;
2375
+ }
2376
+ (p(f) || p(o) || N) && _t();
2377
+ const M = document.createElement("div");
2378
+ M.className = "pie-tool-calculator__mount", g.replaceChildren(M), N = M, ln(++oe, T, M);
2379
+ }
2380
+ function fn() {
2381
+ ht || (ht = !0, queueMicrotask(on));
2382
+ }
2383
+ It(() => {
2384
+ r(), i(), p(F), a(), p(C), p(h), p(E), Ye(fn);
2385
+ }), Fi(() => () => _t());
2386
+ var un = {
17
2387
  get visible() {
18
- return o();
2388
+ return r();
19
2389
  },
20
- set visible(e = !1) {
21
- o(e), t.flush();
2390
+ set visible(g = !1) {
2391
+ r(g), L();
22
2392
  },
23
2393
  get toolId() {
24
- return l();
2394
+ return n();
25
2395
  },
26
- set toolId(e = "calculator") {
27
- l(e), t.flush();
2396
+ set toolId(g = "calculator") {
2397
+ n(g), L();
28
2398
  },
29
2399
  get providerId() {
30
- return a();
2400
+ return i();
31
2401
  },
32
- set providerId(e = "calculator-desmos") {
33
- a(e), t.flush();
2402
+ set providerId(g = "") {
2403
+ i(g), L();
34
2404
  },
35
2405
  get calculatorType() {
36
- return i();
2406
+ return s();
37
2407
  },
38
- set calculatorType(e = "basic") {
39
- i(e), t.flush();
2408
+ set calculatorType(g = "basic") {
2409
+ s(g), L();
40
2410
  },
41
2411
  get availableTypes() {
42
- return c();
2412
+ return l();
43
2413
  },
44
- set availableTypes(e = [
2414
+ set availableTypes(g = [
45
2415
  "basic",
46
2416
  "scientific",
47
2417
  "graphing"
48
2418
  ]) {
49
- c(e), t.flush();
2419
+ l(g), L();
50
2420
  },
51
2421
  get calculatorConfig() {
52
- return u();
2422
+ return a();
53
2423
  },
54
- set calculatorConfig(e = {}) {
55
- u(e), t.flush();
2424
+ set calculatorConfig(g = {}) {
2425
+ a(g), L();
56
2426
  },
57
2427
  get toolkitCoordinator() {
58
- return n();
2428
+ return c();
59
2429
  },
60
- set toolkitCoordinator(e = null) {
61
- n(e), t.flush();
2430
+ set toolkitCoordinator(g = null) {
2431
+ c(g), L();
62
2432
  }
2433
+ }, Ke = is(), cn = tt(Ke), dn = (g) => {
2434
+ var A = ns(), T = tt(A);
2435
+ vr(T, (K) => $(h, K), () => p(h));
2436
+ var M = mt(T, 2), pt = (K) => {
2437
+ var se = ts(), Ce = nr(se, !0);
2438
+ wt((gt) => cr(Ce, gt), [() => p(b).t("tools.calculator.loading")]), Ie(K, se);
2439
+ };
2440
+ kt(M, (K) => {
2441
+ (p(o) || !p(d) && !p(_)) && K(pt);
2442
+ });
2443
+ var ge = mt(M, 2), vn = (K) => {
2444
+ var se = rs(), Ce = mt(tt(se)), gt = nr(Ce, !0);
2445
+ Qe(se), wt(() => cr(gt, p(d))), Ie(K, se);
2446
+ };
2447
+ kt(ge, (K) => {
2448
+ p(d) && K(vn);
2449
+ }), Qe(A), wt((K, se, Ce) => {
2450
+ me(A, "data-tool-id", n()), me(A, "data-provider-id", i()), me(A, "lang", K), me(A, "dir", se), me(A, "aria-label", Ce), me(T, "data-calculator-type", p(F)), A.dir = A.dir;
2451
+ }, [
2452
+ () => p(b).getLocale(),
2453
+ () => p(b).getDirection?.() ?? "ltr",
2454
+ () => p(b).t("tools.calculator.toolA11y")
2455
+ ]), Ie(g, A);
63
2456
  };
64
- return g(s, {
2457
+ return kt(cn, (g) => {
2458
+ r() && g(dn);
2459
+ }), Qe(Ke), vr(Ke, (g) => $(v, g), () => p(v)), Ie(e, Ke), qt(un);
2460
+ }
2461
+ rn(nn, {
2462
+ visible: {},
2463
+ toolId: {},
2464
+ providerId: {},
2465
+ calculatorType: {},
2466
+ availableTypes: {},
2467
+ calculatorConfig: {},
2468
+ toolkitCoordinator: {}
2469
+ }, [], [], { mode: "open" });
2470
+ var as = { tag: "pie-tool-calculator" }, ls = {
2471
+ hash: "svelte-1qpsqi4",
2472
+ code: ".pie-tool-calculator__container .dcg-container {width:100% !important;height:100% !important;}"
2473
+ };
2474
+ function sn(e, t) {
2475
+ Lt(t, !0), en(e, ls);
2476
+ let r = q(t, "visible", 7, !1), n = q(t, "toolId", 7, "calculator"), i = q(t, "providerId", 7, "calculator-desmos"), s = q(t, "calculatorType", 7, "basic"), l = q(t, "availableTypes", 23, () => [
2477
+ "basic",
2478
+ "scientific",
2479
+ "graphing"
2480
+ ]), a = q(t, "calculatorConfig", 23, () => ({})), c = q(t, "toolkitCoordinator", 7, null);
2481
+ var v = {
65
2482
  get visible() {
66
- return o();
2483
+ return r();
2484
+ },
2485
+ set visible(h = !1) {
2486
+ r(h), L();
67
2487
  },
68
2488
  get toolId() {
69
- return l();
2489
+ return n();
2490
+ },
2491
+ set toolId(h = "calculator") {
2492
+ n(h), L();
70
2493
  },
71
2494
  get providerId() {
72
- return a();
2495
+ return i();
2496
+ },
2497
+ set providerId(h = "calculator-desmos") {
2498
+ i(h), L();
73
2499
  },
74
2500
  get calculatorType() {
75
- return i();
2501
+ return s();
2502
+ },
2503
+ set calculatorType(h = "basic") {
2504
+ s(h), L();
76
2505
  },
77
2506
  get availableTypes() {
78
- return c();
2507
+ return l();
2508
+ },
2509
+ set availableTypes(h = [
2510
+ "basic",
2511
+ "scientific",
2512
+ "graphing"
2513
+ ]) {
2514
+ l(h), L();
79
2515
  },
80
2516
  get calculatorConfig() {
81
- return u();
2517
+ return a();
2518
+ },
2519
+ set calculatorConfig(h = {}) {
2520
+ a(h), L();
82
2521
  },
83
2522
  get toolkitCoordinator() {
2523
+ return c();
2524
+ },
2525
+ set toolkitCoordinator(h = null) {
2526
+ c(h), L();
2527
+ }
2528
+ };
2529
+ return nn(e, {
2530
+ get visible() {
2531
+ return r();
2532
+ },
2533
+ get toolId() {
84
2534
  return n();
2535
+ },
2536
+ get providerId() {
2537
+ return i();
2538
+ },
2539
+ get calculatorType() {
2540
+ return s();
2541
+ },
2542
+ get availableTypes() {
2543
+ return l();
2544
+ },
2545
+ get calculatorConfig() {
2546
+ return a();
2547
+ },
2548
+ get toolkitCoordinator() {
2549
+ return c();
85
2550
  }
86
- }), t.pop(d);
2551
+ }), qt(v);
87
2552
  }
88
- t.create_custom_element(p, {
2553
+ rn(sn, {
89
2554
  visible: {
90
2555
  attribute: "visible",
91
2556
  type: "Boolean"
@@ -108,6 +2573,6 @@ t.create_custom_element(p, {
108
2573
  },
109
2574
  calculatorConfig: { type: "Object" },
110
2575
  toolkitCoordinator: { type: "Object" }
111
- }, [], []);
112
- var f = p.element;
113
- v(b.tag, f);
2576
+ }, [], [], void 0, _n);
2577
+ var os = sn.element;
2578
+ hn(as.tag, os);