@pie-qti/player-elements 0.1.13 → 0.1.15

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