@reddb-io/ui 0.2.0 → 0.3.1

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 (96) hide show
  1. package/build/_app/immutable/assets/0.DgbuWrJy.css +1 -0
  2. package/build/_app/immutable/assets/AnalyticsView.BLAJezw4.css +1 -0
  3. package/build/_app/immutable/assets/{Workspace.CvP5De7i.css → Workspace.DM2E1WiF.css} +1 -1
  4. package/build/_app/immutable/chunks/85-Fh5Zp.js +404 -0
  5. package/build/_app/immutable/chunks/{BHBXmd1Y.js → 8zg2gJwV.js} +1 -1
  6. package/build/_app/immutable/chunks/B5euRbKa.js +1 -0
  7. package/build/_app/immutable/chunks/BRIMmWzq.js +1 -0
  8. package/build/_app/immutable/chunks/BgOTHNR5.js +1 -0
  9. package/build/_app/immutable/chunks/Bq4DTWK2.js +2 -0
  10. package/build/_app/immutable/chunks/Btd6PFkC.js +1 -0
  11. package/build/_app/immutable/chunks/CGFL56WJ.js +1 -0
  12. package/build/_app/immutable/chunks/CJFJ501n.js +18 -0
  13. package/build/_app/immutable/chunks/CLBx21Hz.js +2 -0
  14. package/build/_app/immutable/chunks/CnD4hwxC.js +1106 -0
  15. package/build/_app/immutable/chunks/DCJ0QyYH.js +1 -0
  16. package/build/_app/immutable/chunks/DQCYUNtS.js +1 -0
  17. package/build/_app/immutable/chunks/DRlh90Cv.js +1 -0
  18. package/build/_app/immutable/chunks/{C278awGv.js → DV9PDoM3.js} +1 -1
  19. package/build/_app/immutable/entry/app.BDog2y0J.js +2 -0
  20. package/build/_app/immutable/entry/start.D1J45dq5.js +1 -0
  21. package/build/_app/immutable/nodes/0.BTrC4th2.js +1 -0
  22. package/build/_app/immutable/nodes/1.Ds1Tbjsm.js +1 -0
  23. package/build/_app/immutable/nodes/10.D_FCLs0Z.js +96 -0
  24. package/build/_app/immutable/nodes/12.DPE6v6Zf.js +3 -0
  25. package/build/_app/immutable/nodes/14.CAG5_cGP.js +1 -0
  26. package/build/_app/immutable/nodes/15.CcJlZGxa.js +60 -0
  27. package/build/_app/immutable/nodes/8.CAG5_cGP.js +1 -0
  28. package/build/_app/version.json +1 -1
  29. package/build/index.html +18 -15
  30. package/dist/embed/AnalyticsView-D8z1Nsed.js +23337 -0
  31. package/dist/embed/AnalyticsView-D8z1Nsed.js.map +1 -0
  32. package/dist/embed/RedUiEmbedRoot-CtqTd_FG.js +31302 -0
  33. package/dist/embed/RedUiEmbedRoot-CtqTd_FG.js.map +1 -0
  34. package/dist/embed/index-0hA141D2.js +85 -0
  35. package/dist/embed/index-0hA141D2.js.map +1 -0
  36. package/dist/embed/index-client-BeiP-va5.js +3303 -0
  37. package/dist/embed/index-client-BeiP-va5.js.map +1 -0
  38. package/dist/embed/index-w1Qo_uW0.js +677 -0
  39. package/dist/embed/index-w1Qo_uW0.js.map +1 -0
  40. package/dist/embed/index.js +1 -1
  41. package/dist/embed/{sigma.esm-C2pqg5JH.js → sigma.esm-qqKBpvin.js} +2 -2
  42. package/dist/embed/{sigma.esm-C2pqg5JH.js.map → sigma.esm-qqKBpvin.js.map} +1 -1
  43. package/package.json +5 -3
  44. package/src/app.css +86 -20
  45. package/src/lib/AnalyticsView.svelte +209 -0
  46. package/src/lib/AskView.svelte +255 -0
  47. package/src/lib/ClusterView.svelte +415 -95
  48. package/src/lib/CommandPalette.svelte +2 -0
  49. package/src/lib/GlobalProgressBar.svelte +9 -0
  50. package/src/lib/MetricChart.svelte +85 -0
  51. package/src/lib/QueryEditor.svelte +48 -7
  52. package/src/lib/ResultsPane.svelte +76 -8
  53. package/src/lib/SchemaTree.svelte +25 -1
  54. package/src/lib/SecurityView.svelte +176 -65
  55. package/src/lib/SettingsView.svelte +1137 -226
  56. package/src/lib/Topbar.svelte +29 -1
  57. package/src/lib/Workspace.svelte +18 -3
  58. package/src/lib/activity.svelte.ts +44 -35
  59. package/src/lib/collection-preview.ts +14 -0
  60. package/src/lib/connections.svelte.ts +73 -4
  61. package/src/lib/index.ts +3 -0
  62. package/src/lib/permission-gate.ts +120 -0
  63. package/src/lib/policies.ts +136 -0
  64. package/src/lib/query-tabs.svelte.ts +132 -53
  65. package/src/lib/reddb/analytics.ts +208 -0
  66. package/src/lib/reddb/ask.ts +123 -0
  67. package/src/lib/reddb/client.ts +159 -58
  68. package/src/lib/reddb/cluster-status.ts +306 -0
  69. package/src/lib/reddb/index.ts +3 -0
  70. package/src/lib/reddb/local-url-provider.ts +32 -1
  71. package/src/lib/reddb/redwire-ws-spike.ts +590 -0
  72. package/src/lib/router.svelte.ts +12 -0
  73. package/src/lib/settings-authoring-client.ts +336 -0
  74. package/src/lib/settings-sections.ts +294 -180
  75. package/build/_app/immutable/assets/0.DQDLkSdR.css +0 -1
  76. package/build/_app/immutable/chunks/65XjEwaF.js +0 -367
  77. package/build/_app/immutable/chunks/BGcIe2ep.js +0 -2
  78. package/build/_app/immutable/chunks/BMc_qoms.js +0 -973
  79. package/build/_app/immutable/chunks/BrvvOVaJ.js +0 -1
  80. package/build/_app/immutable/chunks/CwxFwvow.js +0 -1
  81. package/build/_app/immutable/chunks/D9CTkMjK.js +0 -1
  82. package/build/_app/immutable/chunks/oiO4RLqp.js +0 -1
  83. package/build/_app/immutable/entry/app.CGfmRH-N.js +0 -2
  84. package/build/_app/immutable/entry/start._LhFJimm.js +0 -1
  85. package/build/_app/immutable/nodes/0.BYhY6O5-.js +0 -1
  86. package/build/_app/immutable/nodes/1.4XYGRMul.js +0 -1
  87. package/build/_app/immutable/nodes/12.DXZfNPNK.js +0 -60
  88. package/build/_app/immutable/nodes/8.C7OOsMOJ.js +0 -134
  89. package/dist/embed/RedUiEmbedRoot-Dia9lxfb.js +0 -28570
  90. package/dist/embed/RedUiEmbedRoot-Dia9lxfb.js.map +0 -1
  91. package/dist/embed/index-Bq0TT7Ao.js +0 -577
  92. package/dist/embed/index-Bq0TT7Ao.js.map +0 -1
  93. package/dist/embed/index-client-ItCEU64C.js +0 -3087
  94. package/dist/embed/index-client-ItCEU64C.js.map +0 -1
  95. /package/build/_app/immutable/assets/{12.Dblyk0Kr.css → 15.Dblyk0Kr.css} +0 -0
  96. /package/build/_app/immutable/nodes/{10.CAG5_cGP.js → 13.CAG5_cGP.js} +0 -0
@@ -1,3087 +0,0 @@
1
- var Qr = Object.defineProperty;
2
- var Ln = (e) => {
3
- throw TypeError(e);
4
- };
5
- var es = (e, t, n) => t in e ? Qr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
6
- var F = (e, t, n) => es(e, typeof t != "symbol" ? t + "" : t, n), fn = (e, t, n) => t.has(e) || Ln("Cannot " + n);
7
- var i = (e, t, n) => (fn(e, t, "read from private field"), n ? n.call(e) : t.get(e)), m = (e, t, n) => t.has(e) ? Ln("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), g = (e, t, n, r) => (fn(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), E = (e, t, n) => (fn(e, t, "access private method"), n);
8
- var Xn = Array.isArray, ts = Array.prototype.indexOf, qe = Array.prototype.includes, ns = Array.from, rs = Object.defineProperty, vt = Object.getOwnPropertyDescriptor, ss = Object.getOwnPropertyDescriptors, is = Object.prototype, as = Array.prototype, Zn = Object.getPrototypeOf, Fn = Object.isExtensible;
9
- function Fi(e) {
10
- return typeof e == "function";
11
- }
12
- const fs = () => {
13
- };
14
- function ji(e) {
15
- return e();
16
- }
17
- function ls(e) {
18
- for (var t = 0; t < e.length; t++)
19
- e[t]();
20
- }
21
- function Jn() {
22
- var e, t, n = new Promise((r, s) => {
23
- e = r, t = s;
24
- });
25
- return { promise: n, resolve: e, reject: t };
26
- }
27
- function Hi(e, t, n = !1) {
28
- return e === void 0 ? n ? (
29
- /** @type {() => V} */
30
- t()
31
- ) : (
32
- /** @type {V} */
33
- t
34
- ) : e;
35
- }
36
- function Vi(e, t) {
37
- if (Array.isArray(e))
38
- return e;
39
- if (t === void 0 || !(Symbol.iterator in e))
40
- return Array.from(e);
41
- const n = [];
42
- for (const r of e)
43
- if (n.push(r), n.length === t) break;
44
- return n;
45
- }
46
- function Yi(e, t) {
47
- var n = {};
48
- for (var r in e)
49
- t.includes(r) || (n[r] = e[r]);
50
- for (var s of Object.getOwnPropertySymbols(e))
51
- Object.propertyIsEnumerable.call(e, s) && !t.includes(s) && (n[s] = e[s]);
52
- return n;
53
- }
54
- const P = 2, at = 4, Ct = 8, kn = 1 << 24, ie = 16, de = 32, Ee = 64, cn = 128, X = 512, M = 1024, D = 2048, _e = 4096, Z = 8192, he = 16384, De = 32768, jn = 1 << 25, ft = 65536, yt = 1 << 17, os = 1 << 18, Ge = 1 << 19, Qn = 1 << 20, Bi = 1 << 25, ze = 65536, $t = 1 << 21, Qe = 1 << 22, Ce = 1 << 23, Ue = Symbol("$state"), qi = Symbol("legacy props"), Ui = Symbol(""), us = Symbol("attributes"), cs = Symbol("class"), hs = Symbol("style"), ht = Symbol("text"), Ht = Symbol("form reset"), Qt = new class extends Error {
55
- constructor() {
56
- super(...arguments);
57
- F(this, "name", "StaleReactionError");
58
- F(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed");
59
- }
60
- }();
61
- var Gn;
62
- const Wi = (
63
- // We gotta write it like this because after downleveling the pure comment may end up in the wrong location
64
- !!((Gn = globalThis.document) != null && Gn.contentType) && /* @__PURE__ */ globalThis.document.contentType.includes("xml")
65
- ), zi = 1, Mt = 3, en = 8;
66
- function er(e) {
67
- throw new Error("https://svelte.dev/e/experimental_async_required");
68
- }
69
- function ct(e) {
70
- throw new Error("https://svelte.dev/e/lifecycle_outside_component");
71
- }
72
- function ds() {
73
- throw new Error("https://svelte.dev/e/missing_context");
74
- }
75
- function _s() {
76
- throw new Error("https://svelte.dev/e/async_derived_orphan");
77
- }
78
- function Gi(e, t, n) {
79
- throw new Error("https://svelte.dev/e/each_key_duplicate");
80
- }
81
- function vs(e) {
82
- throw new Error("https://svelte.dev/e/effect_in_teardown");
83
- }
84
- function ps() {
85
- throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
86
- }
87
- function gs(e) {
88
- throw new Error("https://svelte.dev/e/effect_orphan");
89
- }
90
- function ms() {
91
- throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
92
- }
93
- function ws() {
94
- throw new Error("https://svelte.dev/e/fork_discarded");
95
- }
96
- function ys() {
97
- throw new Error("https://svelte.dev/e/fork_timing");
98
- }
99
- function Es() {
100
- throw new Error("https://svelte.dev/e/get_abort_signal_outside_reaction");
101
- }
102
- function bs() {
103
- throw new Error("https://svelte.dev/e/hydration_failed");
104
- }
105
- function tr(e) {
106
- throw new Error("https://svelte.dev/e/lifecycle_legacy_only");
107
- }
108
- function Ki(e) {
109
- throw new Error("https://svelte.dev/e/props_invalid_value");
110
- }
111
- function Ts() {
112
- throw new Error("https://svelte.dev/e/state_descriptors_fixed");
113
- }
114
- function ks() {
115
- throw new Error("https://svelte.dev/e/state_prototype_fixed");
116
- }
117
- function Ss() {
118
- throw new Error("https://svelte.dev/e/state_unsafe_mutation");
119
- }
120
- function As() {
121
- throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror");
122
- }
123
- const Xi = 1, Zi = 2, Ji = 4, Qi = 8, ea = 16, ta = 1, na = 2, ra = 4, sa = 8, ia = 16, nr = 1, xs = 2, rr = "[", sr = "[!", Hn = "[?", ir = "]", lt = {}, C = Symbol("uninitialized"), Rs = "http://www.w3.org/1999/xhtml", aa = "http://www.w3.org/2000/svg", fa = "http://www.w3.org/1998/Math/MathML", la = "@attach";
124
- function Os() {
125
- console.warn("https://svelte.dev/e/derived_inert");
126
- }
127
- function Cs(e) {
128
- console.warn("https://svelte.dev/e/hydratable_missing_but_expected");
129
- }
130
- function tn(e) {
131
- console.warn("https://svelte.dev/e/hydration_mismatch");
132
- }
133
- function oa() {
134
- console.warn("https://svelte.dev/e/select_multiple_invalid_value");
135
- }
136
- function Ms() {
137
- console.warn("https://svelte.dev/e/svelte_boundary_reset_noop");
138
- }
139
- let R = !1;
140
- function Lt(e) {
141
- R = e;
142
- }
143
- let b;
144
- function fe(e) {
145
- if (e === null)
146
- throw tn(), lt;
147
- return b = e;
148
- }
149
- function Sn() {
150
- return fe(/* @__PURE__ */ be(b));
151
- }
152
- function ua(e) {
153
- if (R) {
154
- if (/* @__PURE__ */ be(b) !== null)
155
- throw tn(), lt;
156
- b = e;
157
- }
158
- }
159
- function Ns(e = 1) {
160
- if (R) {
161
- for (var t = e, n = b; t--; )
162
- n = /** @type {TemplateNode} */
163
- /* @__PURE__ */ be(n);
164
- b = n;
165
- }
166
- }
167
- function Ds(e = !0) {
168
- for (var t = 0, n = b; ; ) {
169
- if (n.nodeType === en) {
170
- var r = (
171
- /** @type {Comment} */
172
- n.data
173
- );
174
- if (r === ir) {
175
- if (t === 0) return n;
176
- t -= 1;
177
- } else (r === rr || r === sr || // "[1", "[2", etc. for if blocks
178
- r[0] === "[" && !isNaN(Number(r.slice(1)))) && (t += 1);
179
- }
180
- var s = (
181
- /** @type {TemplateNode} */
182
- /* @__PURE__ */ be(n)
183
- );
184
- e && n.remove(), n = s;
185
- }
186
- }
187
- function ca(e) {
188
- if (!e || e.nodeType !== en)
189
- throw tn(), lt;
190
- return (
191
- /** @type {Comment} */
192
- e.data
193
- );
194
- }
195
- function ar(e) {
196
- return e === this.v;
197
- }
198
- function Ps(e, t) {
199
- return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function";
200
- }
201
- function fr(e) {
202
- return !Ps(e, this.v);
203
- }
204
- let Nt = !1;
205
- function ha() {
206
- Nt = !0;
207
- }
208
- let T = null;
209
- function ot(e) {
210
- T = e;
211
- }
212
- function Is() {
213
- const e = {};
214
- return [
215
- () => (ur(e) || ds(), lr(e)),
216
- (t) => or(e, t)
217
- ];
218
- }
219
- function lr(e) {
220
- return (
221
- /** @type {T} */
222
- nn().get(e)
223
- );
224
- }
225
- function or(e, t) {
226
- return nn().set(e, t), t;
227
- }
228
- function ur(e) {
229
- return nn().has(e);
230
- }
231
- function Ls() {
232
- return nn();
233
- }
234
- function Fs(e, t = !1, n) {
235
- T = {
236
- p: T,
237
- i: !1,
238
- c: null,
239
- e: null,
240
- s: e,
241
- x: null,
242
- r: (
243
- /** @type {Effect} */
244
- y
245
- ),
246
- l: Nt && !t ? { s: null, u: null, $: [] } : null
247
- };
248
- }
249
- function js(e) {
250
- var t = (
251
- /** @type {ComponentContext} */
252
- T
253
- ), n = t.e;
254
- if (n !== null) {
255
- t.e = null;
256
- for (var r of n)
257
- Ir(r);
258
- }
259
- return t.i = !0, T = t.p, /** @type {T} */
260
- {};
261
- }
262
- function Dt() {
263
- return !Nt || T !== null && T.l === null;
264
- }
265
- function nn(e) {
266
- return T === null && ct(), T.c ?? (T.c = new Map(Hs(T) || void 0));
267
- }
268
- function Hs(e) {
269
- let t = e.p;
270
- for (; t !== null; ) {
271
- const n = t.c;
272
- if (n !== null)
273
- return n;
274
- t = t.p;
275
- }
276
- return null;
277
- }
278
- let Pe = [];
279
- function cr() {
280
- var e = Pe;
281
- Pe = [], ls(e);
282
- }
283
- function Me(e) {
284
- if (Pe.length === 0 && !gt) {
285
- var t = Pe;
286
- queueMicrotask(() => {
287
- t === Pe && cr();
288
- });
289
- }
290
- Pe.push(e);
291
- }
292
- function Vs() {
293
- for (; Pe.length > 0; )
294
- cr();
295
- }
296
- function hr(e) {
297
- var t = y;
298
- if (t === null)
299
- return w.f |= Ce, e;
300
- if ((t.f & De) === 0 && (t.f & at) === 0)
301
- throw e;
302
- Re(e, t);
303
- }
304
- function Re(e, t) {
305
- for (; t !== null; ) {
306
- if ((t.f & cn) !== 0) {
307
- if ((t.f & De) === 0)
308
- throw e;
309
- try {
310
- t.b.error(e);
311
- return;
312
- } catch (n) {
313
- e = n;
314
- }
315
- }
316
- t = t.parent;
317
- }
318
- throw e;
319
- }
320
- const Ys = -7169;
321
- function x(e, t) {
322
- e.f = e.f & Ys | t;
323
- }
324
- function An(e) {
325
- (e.f & X) !== 0 || e.deps === null ? x(e, M) : x(e, _e);
326
- }
327
- function dr(e) {
328
- if (e !== null)
329
- for (const t of e)
330
- (t.f & P) === 0 || (t.f & ze) === 0 || (t.f ^= ze, dr(
331
- /** @type {Derived} */
332
- t.deps
333
- ));
334
- }
335
- function _r(e, t, n) {
336
- (e.f & D) !== 0 ? t.add(e) : (e.f & _e) !== 0 && n.add(e), dr(e.deps), x(e, M);
337
- }
338
- let ln = null, Xe = null, v = null, pt = null, N = null, hn = null, gt = !1, on = !1, Je = null, Vt = null;
339
- var Vn = 0;
340
- let Bs = 1;
341
- var et, Se, Fe, tt, nt, je, rt, me, Tt, B, kt, Ae, oe, ue, st, He, k, dn, dt, _n, vr, pr, Yt, qs, vn, Ze;
342
- const Xt = class Xt {
343
- constructor() {
344
- m(this, k);
345
- F(this, "id", Bs++);
346
- /** True as soon as `#process` was called */
347
- m(this, et, !1);
348
- F(this, "linked", !0);
349
- /** @type {Batch | null} */
350
- m(this, Se, null);
351
- /** @type {Batch | null} */
352
- m(this, Fe, null);
353
- /** @type {Map<Effect, ReturnType<typeof deferred<any>>>} */
354
- F(this, "async_deriveds", /* @__PURE__ */ new Map());
355
- /**
356
- * The current values of any signals that are updated in this batch.
357
- * Tuple format: [value, is_derived] (note: is_derived is false for deriveds, too, if they were overridden via assignment)
358
- * They keys of this map are identical to `this.#previous`
359
- * @type {Map<Value, [any, boolean]>}
360
- */
361
- F(this, "current", /* @__PURE__ */ new Map());
362
- /**
363
- * The values of any signals (sources and deriveds) that are updated in this batch _before_ those updates took place.
364
- * They keys of this map are identical to `this.#current`
365
- * @type {Map<Value, any>}
366
- */
367
- F(this, "previous", /* @__PURE__ */ new Map());
368
- /**
369
- * Async effects which this batch doesn't take into account anymore when calculating blockers,
370
- * as it has a value for it already.
371
- * @type {Set<Effect>}
372
- */
373
- F(this, "unblocked", /* @__PURE__ */ new Set());
374
- /**
375
- * When the batch is committed (and the DOM is updated), we need to remove old branches
376
- * and append new ones by calling the functions added inside (if/each/key/etc) blocks
377
- * @type {Set<(batch: Batch) => void>}
378
- */
379
- m(this, tt, /* @__PURE__ */ new Set());
380
- /**
381
- * If a fork is discarded, we need to destroy any effects that are no longer needed
382
- * @type {Set<(batch: Batch) => void>}
383
- */
384
- m(this, nt, /* @__PURE__ */ new Set());
385
- /**
386
- * Callbacks that should run only when a fork is committed.
387
- * @type {Set<(batch: Batch) => void>}
388
- */
389
- m(this, je, /* @__PURE__ */ new Set());
390
- /**
391
- * The number of async effects that are currently in flight
392
- */
393
- m(this, rt, 0);
394
- /**
395
- * Async effects that are currently in flight, _not_ inside a pending boundary
396
- * @type {Map<Effect, number>}
397
- */
398
- m(this, me, /* @__PURE__ */ new Map());
399
- /**
400
- * A deferred that resolves when the batch is committed, used with `settled()`
401
- * TODO replace with Promise.withResolvers once supported widely enough
402
- * @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
403
- */
404
- m(this, Tt, null);
405
- /**
406
- * The root effects that need to be flushed
407
- * @type {Effect[]}
408
- */
409
- m(this, B, []);
410
- /**
411
- * Effects created while this batch was active.
412
- * @type {Effect[]}
413
- */
414
- m(this, kt, []);
415
- /**
416
- * Deferred effects (which run after async work has completed) that are DIRTY
417
- * @type {Set<Effect>}
418
- */
419
- m(this, Ae, /* @__PURE__ */ new Set());
420
- /**
421
- * Deferred effects that are MAYBE_DIRTY
422
- * @type {Set<Effect>}
423
- */
424
- m(this, oe, /* @__PURE__ */ new Set());
425
- /**
426
- * A map of branches that still exist, but will be destroyed when this batch
427
- * is committed — we skip over these during `process`.
428
- * The value contains child effects that were dirty/maybe_dirty before being reset,
429
- * so they can be rescheduled if the branch survives.
430
- * @type {Map<Effect, { d: Effect[], m: Effect[] }>}
431
- */
432
- m(this, ue, /* @__PURE__ */ new Map());
433
- /**
434
- * Inverse of #skipped_branches which we need to tell prior batches to unskip them when committing
435
- * @type {Set<Effect>}
436
- */
437
- m(this, st, /* @__PURE__ */ new Set());
438
- F(this, "is_fork", !1);
439
- m(this, He, !1);
440
- }
441
- /**
442
- * Add an effect to the #skipped_branches map and reset its children
443
- * @param {Effect} effect
444
- */
445
- skip_effect(t) {
446
- i(this, ue).has(t) || i(this, ue).set(t, { d: [], m: [] }), i(this, st).delete(t);
447
- }
448
- /**
449
- * Remove an effect from the #skipped_branches map and reschedule
450
- * any tracked dirty/maybe_dirty child effects
451
- * @param {Effect} effect
452
- * @param {(e: Effect) => void} callback
453
- */
454
- unskip_effect(t, n = (r) => this.schedule(r)) {
455
- var r = i(this, ue).get(t);
456
- if (r) {
457
- i(this, ue).delete(t);
458
- for (var s of r.d)
459
- x(s, D), n(s);
460
- for (s of r.m)
461
- x(s, _e), n(s);
462
- }
463
- i(this, st).add(t);
464
- }
465
- /**
466
- * Associate a change to a given source with the current
467
- * batch, noting its previous and current values
468
- * @param {Value} source
469
- * @param {any} value
470
- * @param {boolean} [is_derived]
471
- */
472
- capture(t, n, r = !1) {
473
- t.v !== C && !this.previous.has(t) && this.previous.set(t, t.v), (t.f & Ce) === 0 && (this.current.set(t, [n, r]), N == null || N.set(t, n)), this.is_fork || (t.v = n);
474
- }
475
- activate() {
476
- v = this;
477
- }
478
- deactivate() {
479
- v = null, N = null;
480
- }
481
- flush() {
482
- try {
483
- on = !0, v = this, E(this, k, dt).call(this);
484
- } finally {
485
- Vn = 0, hn = null, Je = null, Vt = null, on = !1, v = null, N = null, $e.clear();
486
- }
487
- }
488
- discard() {
489
- for (const t of i(this, nt)) t(this);
490
- i(this, nt).clear(), i(this, je).clear(), E(this, k, Ze).call(this);
491
- }
492
- /**
493
- * @param {Effect} effect
494
- */
495
- register_created_effect(t) {
496
- i(this, kt).push(t);
497
- }
498
- /**
499
- * @param {boolean} blocking
500
- * @param {Effect} effect
501
- */
502
- increment(t, n) {
503
- if (g(this, rt, i(this, rt) + 1), t) {
504
- let r = i(this, me).get(n) ?? 0;
505
- i(this, me).set(n, r + 1);
506
- }
507
- }
508
- /**
509
- * @param {boolean} blocking
510
- * @param {Effect} effect
511
- */
512
- decrement(t, n) {
513
- if (g(this, rt, i(this, rt) - 1), t) {
514
- let r = i(this, me).get(n) ?? 0;
515
- r === 1 ? i(this, me).delete(n) : i(this, me).set(n, r - 1);
516
- }
517
- i(this, He) || (g(this, He, !0), Me(() => {
518
- g(this, He, !1), this.linked && this.flush();
519
- }));
520
- }
521
- /**
522
- * @param {Set<Effect>} dirty_effects
523
- * @param {Set<Effect>} maybe_dirty_effects
524
- */
525
- transfer_effects(t, n) {
526
- for (const r of t)
527
- i(this, Ae).add(r);
528
- for (const r of n)
529
- i(this, oe).add(r);
530
- t.clear(), n.clear();
531
- }
532
- /** @param {(batch: Batch) => void} fn */
533
- oncommit(t) {
534
- i(this, tt).add(t);
535
- }
536
- /** @param {(batch: Batch) => void} fn */
537
- ondiscard(t) {
538
- i(this, nt).add(t);
539
- }
540
- /** @param {(batch: Batch) => void} fn */
541
- on_fork_commit(t) {
542
- i(this, je).add(t);
543
- }
544
- run_fork_commit_callbacks() {
545
- for (const t of i(this, je)) t(this);
546
- i(this, je).clear();
547
- }
548
- settled() {
549
- return (i(this, Tt) ?? g(this, Tt, Jn())).promise;
550
- }
551
- static ensure() {
552
- var t;
553
- if (v === null) {
554
- const n = v = new Xt();
555
- E(t = n, k, vn).call(t), !on && !gt && Me(() => {
556
- i(n, et) || n.flush();
557
- });
558
- }
559
- return v;
560
- }
561
- apply() {
562
- {
563
- N = null;
564
- return;
565
- }
566
- }
567
- /**
568
- *
569
- * @param {Effect} effect
570
- */
571
- schedule(t) {
572
- var s;
573
- if (hn = t, (s = t.b) != null && s.is_pending && (t.f & (at | Ct | kn)) !== 0 && (t.f & De) === 0) {
574
- t.b.defer_effect(t);
575
- return;
576
- }
577
- for (var n = t; n.parent !== null; ) {
578
- n = n.parent;
579
- var r = n.f;
580
- if (Je !== null && n === y && (w === null || (w.f & P) === 0))
581
- return;
582
- if ((r & (Ee | de)) !== 0) {
583
- if ((r & M) === 0)
584
- return;
585
- n.f ^= M;
586
- }
587
- }
588
- i(this, B).push(n);
589
- }
590
- };
591
- et = new WeakMap(), Se = new WeakMap(), Fe = new WeakMap(), tt = new WeakMap(), nt = new WeakMap(), je = new WeakMap(), rt = new WeakMap(), me = new WeakMap(), Tt = new WeakMap(), B = new WeakMap(), kt = new WeakMap(), Ae = new WeakMap(), oe = new WeakMap(), ue = new WeakMap(), st = new WeakMap(), He = new WeakMap(), k = new WeakSet(), dn = function() {
592
- if (this.is_fork) return !0;
593
- for (const r of i(this, me).keys()) {
594
- for (var t = r, n = !1; t.parent !== null; ) {
595
- if (i(this, ue).has(t)) {
596
- n = !0;
597
- break;
598
- }
599
- t = t.parent;
600
- }
601
- if (!n)
602
- return !0;
603
- }
604
- return !1;
605
- }, dt = function() {
606
- var l, u, d, h;
607
- if (g(this, et, !0), Vn++ > 1e3 && (E(this, k, Ze).call(this), Us()), !E(this, k, dn).call(this)) {
608
- for (const c of i(this, Ae))
609
- i(this, oe).delete(c), x(c, D), this.schedule(c);
610
- for (const c of i(this, oe))
611
- x(c, _e), this.schedule(c);
612
- }
613
- const t = i(this, B);
614
- g(this, B, []), this.apply();
615
- var n = Je = [], r = [], s = Vt = [];
616
- for (const c of t)
617
- try {
618
- E(this, k, _n).call(this, c, n, r);
619
- } catch (p) {
620
- throw yr(c), p;
621
- }
622
- if (v = null, s.length > 0) {
623
- var a = Xt.ensure();
624
- for (const c of s)
625
- a.schedule(c);
626
- }
627
- if (Je = null, Vt = null, E(this, k, dn).call(this)) {
628
- E(this, k, Yt).call(this, r), E(this, k, Yt).call(this, n);
629
- for (const [c, p] of i(this, ue))
630
- wr(c, p);
631
- s.length > 0 && /** @type {unknown} */
632
- E(l = v, k, dt).call(l);
633
- return;
634
- }
635
- const f = E(this, k, vr).call(this);
636
- if (f) {
637
- E(u = f, k, pr).call(u, this);
638
- return;
639
- }
640
- i(this, Ae).clear(), i(this, oe).clear();
641
- for (const c of i(this, tt)) c(this);
642
- i(this, tt).clear(), pt = this, Yn(r), Yn(n), pt = null, (d = i(this, Tt)) == null || d.resolve();
643
- var o = (
644
- /** @type {Batch | null} */
645
- /** @type {unknown} */
646
- v
647
- );
648
- if (this.linked && i(this, rt) === 0 && E(this, k, Ze).call(this), i(this, B).length > 0) {
649
- o === null && (o = this, E(this, k, vn).call(this));
650
- const c = o;
651
- i(c, B).push(...i(this, B).filter((p) => !i(c, B).includes(p)));
652
- }
653
- o !== null && E(h = o, k, dt).call(h);
654
- }, /**
655
- * Traverse the effect tree, executing effects or stashing
656
- * them for later execution as appropriate
657
- * @param {Effect} root
658
- * @param {Effect[]} effects
659
- * @param {Effect[]} render_effects
660
- */
661
- _n = function(t, n, r) {
662
- t.f ^= M;
663
- for (var s = t.first; s !== null; ) {
664
- var a = s.f, f = (a & (de | Ee)) !== 0, o = f && (a & M) !== 0, l = o || (a & Z) !== 0 || i(this, ue).has(s);
665
- if (!l && s.fn !== null) {
666
- f ? s.f ^= M : (a & at) !== 0 ? n.push(s) : It(s) && ((a & ie) !== 0 && i(this, oe).add(s), ut(s));
667
- var u = s.first;
668
- if (u !== null) {
669
- s = u;
670
- continue;
671
- }
672
- }
673
- for (; s !== null; ) {
674
- var d = s.next;
675
- if (d !== null) {
676
- s = d;
677
- break;
678
- }
679
- s = s.parent;
680
- }
681
- }
682
- }, vr = function() {
683
- for (var t = i(this, Se); t !== null; ) {
684
- if (!t.is_fork) {
685
- for (const [n, [, r]] of this.current)
686
- if (t.current.has(n) && !r)
687
- return t;
688
- }
689
- t = i(t, Se);
690
- }
691
- return null;
692
- }, /**
693
- * @param {Batch} batch
694
- */
695
- pr = function(t) {
696
- var r;
697
- for (const [s, a] of t.current)
698
- !this.previous.has(s) && t.previous.has(s) && this.previous.set(s, t.previous.get(s)), this.current.set(s, a);
699
- for (const [s, a] of t.async_deriveds) {
700
- const f = this.async_deriveds.get(s);
701
- f && a.promise.then(f.resolve);
702
- }
703
- const n = (s) => {
704
- var a = s.reactions;
705
- if (a !== null)
706
- for (const l of a) {
707
- var f = l.f;
708
- if ((f & P) !== 0)
709
- n(
710
- /** @type {Derived} */
711
- l
712
- );
713
- else {
714
- var o = (
715
- /** @type {Effect} */
716
- l
717
- );
718
- f & (Qe | ie) && !this.async_deriveds.has(o) && (i(this, oe).delete(o), x(o, D), this.schedule(o));
719
- }
720
- }
721
- };
722
- for (const s of this.current.keys())
723
- n(s);
724
- this.oncommit(() => t.discard()), E(r = t, k, Ze).call(r), v = this, E(this, k, dt).call(this);
725
- }, /**
726
- * @param {Effect[]} effects
727
- */
728
- Yt = function(t) {
729
- for (var n = 0; n < t.length; n += 1)
730
- _r(t[n], i(this, Ae), i(this, oe));
731
- }, qs = function() {
732
- var d;
733
- E(this, k, Ze).call(this);
734
- for (let h = ln; h !== null; h = i(h, Fe)) {
735
- var t = h.id < this.id, n = [];
736
- for (const [c, [p, _]] of this.current) {
737
- if (h.current.has(c)) {
738
- var r = (
739
- /** @type {[any, boolean]} */
740
- h.current.get(c)[0]
741
- );
742
- if (t && p !== r)
743
- h.current.set(c, [p, _]);
744
- else
745
- continue;
746
- }
747
- n.push(c);
748
- }
749
- if (t)
750
- for (const [c, p] of this.async_deriveds) {
751
- const _ = h.async_deriveds.get(c);
752
- _ && p.promise.then(_.resolve);
753
- }
754
- if (i(h, et)) {
755
- var s = [...h.current.keys()].filter((c) => !this.current.has(c));
756
- if (s.length === 0)
757
- t && h.discard();
758
- else if (n.length > 0) {
759
- if (t)
760
- for (const c of i(this, st))
761
- h.unskip_effect(c, (p) => {
762
- var _;
763
- (p.f & (ie | Qe)) !== 0 ? h.schedule(p) : E(_ = h, k, Yt).call(_, [p]);
764
- });
765
- h.activate();
766
- var a = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Map();
767
- for (var o of n)
768
- gr(o, s, a, f);
769
- f = /* @__PURE__ */ new Map();
770
- var l = [...h.current.keys()].filter(
771
- (c) => this.current.has(c) ? (
772
- /** @type {[any, boolean]} */
773
- this.current.get(c)[0] !== c.v
774
- ) : !0
775
- );
776
- if (l.length > 0)
777
- for (const c of i(this, kt))
778
- (c.f & (he | Z | yt)) === 0 && xn(c, l, f) && ((c.f & (Qe | ie)) !== 0 ? (x(c, D), h.schedule(c)) : i(h, Ae).add(c));
779
- if (i(h, B).length > 0 && !i(h, He)) {
780
- h.apply();
781
- for (var u of i(h, B))
782
- E(d = h, k, _n).call(d, u, [], []);
783
- g(h, B, []);
784
- }
785
- h.deactivate();
786
- }
787
- }
788
- }
789
- }, vn = function() {
790
- Xe === null ? ln = Xe = this : (g(Xe, Fe, this), g(this, Se, Xe)), Xe = this;
791
- }, Ze = function() {
792
- var t = i(this, Se), n = i(this, Fe);
793
- t === null ? ln = n : g(t, Fe, n), n === null ? Xe = t : g(n, Se, t), this.linked = !1;
794
- };
795
- let ve = Xt;
796
- function Wt(e) {
797
- var t = gt;
798
- gt = !0;
799
- try {
800
- var n;
801
- for (e && (v !== null && !v.is_fork && v.flush(), n = e()); ; ) {
802
- if (Vs(), v === null)
803
- return (
804
- /** @type {T} */
805
- n
806
- );
807
- v.flush();
808
- }
809
- } finally {
810
- gt = t;
811
- }
812
- }
813
- function Us() {
814
- try {
815
- ms();
816
- } catch (e) {
817
- Re(e, hn);
818
- }
819
- }
820
- let re = null;
821
- function Yn(e) {
822
- var t = e.length;
823
- if (t !== 0) {
824
- for (var n = 0; n < t; ) {
825
- var r = e[n++];
826
- if ((r.f & (he | Z)) === 0 && It(r) && (re = /* @__PURE__ */ new Set(), ut(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && jr(r), (re == null ? void 0 : re.size) > 0)) {
827
- $e.clear();
828
- for (const s of re) {
829
- if ((s.f & (he | Z)) !== 0) continue;
830
- const a = [s];
831
- let f = s.parent;
832
- for (; f !== null; )
833
- re.has(f) && (re.delete(f), a.push(f)), f = f.parent;
834
- for (let o = a.length - 1; o >= 0; o--) {
835
- const l = a[o];
836
- (l.f & (he | Z)) === 0 && ut(l);
837
- }
838
- }
839
- re.clear();
840
- }
841
- }
842
- re = null;
843
- }
844
- }
845
- function gr(e, t, n, r) {
846
- if (!n.has(e) && (n.add(e), e.reactions !== null))
847
- for (const s of e.reactions) {
848
- const a = s.f;
849
- (a & P) !== 0 ? gr(
850
- /** @type {Derived} */
851
- s,
852
- t,
853
- n,
854
- r
855
- ) : (a & (Qe | ie)) !== 0 && (a & D) === 0 && xn(s, t, r) && (x(s, D), Rn(
856
- /** @type {Effect} */
857
- s
858
- ));
859
- }
860
- }
861
- function mr(e, t) {
862
- if (e.reactions !== null)
863
- for (const n of e.reactions) {
864
- const r = n.f;
865
- (r & P) !== 0 ? mr(
866
- /** @type {Derived} */
867
- n,
868
- t
869
- ) : (r & yt) !== 0 && (x(n, D), t.add(
870
- /** @type {Effect} */
871
- n
872
- ));
873
- }
874
- }
875
- function xn(e, t, n) {
876
- const r = n.get(e);
877
- if (r !== void 0) return r;
878
- if (e.deps !== null)
879
- for (const s of e.deps) {
880
- if (qe.call(t, s))
881
- return !0;
882
- if ((s.f & P) !== 0 && xn(
883
- /** @type {Derived} */
884
- s,
885
- t,
886
- n
887
- ))
888
- return n.set(
889
- /** @type {Derived} */
890
- s,
891
- !0
892
- ), !0;
893
- }
894
- return n.set(e, !1), !1;
895
- }
896
- function Rn(e) {
897
- v.schedule(e);
898
- }
899
- function wr(e, t) {
900
- if (!((e.f & de) !== 0 && (e.f & M) !== 0)) {
901
- (e.f & D) !== 0 ? t.d.push(e) : (e.f & _e) !== 0 && t.m.push(e), x(e, M);
902
- for (var n = e.first; n !== null; )
903
- wr(n, t), n = n.next;
904
- }
905
- }
906
- function yr(e) {
907
- x(e, M);
908
- for (var t = e.first; t !== null; )
909
- yr(t), t = t.next;
910
- }
911
- function $s(e) {
912
- er(), v !== null && ys();
913
- var t = ve.ensure();
914
- t.is_fork = !0, N = /* @__PURE__ */ new Map();
915
- var n = !1, r = t.settled();
916
- return Wt(e), {
917
- commit: async () => {
918
- if (n) {
919
- await r;
920
- return;
921
- }
922
- t.linked || ws(), n = !0, t.is_fork = !1;
923
- for (var [s, [a]] of t.current)
924
- s.v = a, s.wv = Kt();
925
- t.activate(), t.run_fork_commit_callbacks(), t.deactivate(), Wt(() => {
926
- var f = /* @__PURE__ */ new Set();
927
- for (var o of t.current.keys())
928
- mr(o, f);
929
- ni(f), Rr();
930
- }), t.flush(), await r;
931
- },
932
- discard: () => {
933
- for (var s of t.current.keys())
934
- s.wv = Kt();
935
- !n && t.linked && t.discard();
936
- }
937
- };
938
- }
939
- function Ws(e) {
940
- let t = 0, n = Pt(0), r;
941
- return () => {
942
- Mn() && (Oe(n), ui(() => (t === 0 && (r = an(() => e(() => mt(n)))), t += 1, () => {
943
- Me(() => {
944
- t -= 1, t === 0 && (r == null || r(), r = void 0, mt(n));
945
- });
946
- })));
947
- };
948
- }
949
- var zs = ft | Ge;
950
- function Gs(e, t, n, r) {
951
- new Ks(e, t, n, r);
952
- }
953
- var q, St, G, Ve, j, K, L, U, we, Ye, xe, it, At, xt, ye, Zt, S, Er, br, Tr, pn, Bt, qt, gn, mn;
954
- class Ks {
955
- /**
956
- * @param {TemplateNode} node
957
- * @param {BoundaryProps} props
958
- * @param {((anchor: Node) => void)} children
959
- * @param {((error: unknown) => unknown) | undefined} [transform_error]
960
- */
961
- constructor(t, n, r, s) {
962
- m(this, S);
963
- /** @type {Boundary | null} */
964
- F(this, "parent");
965
- F(this, "is_pending", !1);
966
- /**
967
- * API-level transformError transform function. Transforms errors before they reach the `failed` snippet.
968
- * Inherited from parent boundary, or defaults to identity.
969
- * @type {(error: unknown) => unknown}
970
- */
971
- F(this, "transform_error");
972
- /** @type {TemplateNode} */
973
- m(this, q);
974
- /** @type {TemplateNode | null} */
975
- m(this, St, R ? b : null);
976
- /** @type {BoundaryProps} */
977
- m(this, G);
978
- /** @type {((anchor: Node) => void)} */
979
- m(this, Ve);
980
- /** @type {Effect} */
981
- m(this, j);
982
- /** @type {Effect | null} */
983
- m(this, K, null);
984
- /** @type {Effect | null} */
985
- m(this, L, null);
986
- /** @type {Effect | null} */
987
- m(this, U, null);
988
- /** @type {DocumentFragment | null} */
989
- m(this, we, null);
990
- m(this, Ye, 0);
991
- m(this, xe, 0);
992
- m(this, it, !1);
993
- /** @type {Set<Effect>} */
994
- m(this, At, /* @__PURE__ */ new Set());
995
- /** @type {Set<Effect>} */
996
- m(this, xt, /* @__PURE__ */ new Set());
997
- /**
998
- * A source containing the number of pending async deriveds/expressions.
999
- * Only created if `$effect.pending()` is used inside the boundary,
1000
- * otherwise updating the source results in needless `Batch.ensure()`
1001
- * calls followed by no-op flushes
1002
- * @type {Source<number> | null}
1003
- */
1004
- m(this, ye, null);
1005
- m(this, Zt, Ws(() => (g(this, ye, Pt(i(this, Ye))), () => {
1006
- g(this, ye, null);
1007
- })));
1008
- var a;
1009
- g(this, q, t), g(this, G, n), g(this, Ve, (f) => {
1010
- var o = (
1011
- /** @type {Effect} */
1012
- y
1013
- );
1014
- o.b = this, o.f |= cn, r(f);
1015
- }), this.parent = /** @type {Effect} */
1016
- y.b, this.transform_error = s ?? ((a = this.parent) == null ? void 0 : a.transform_error) ?? ((f) => f), g(this, j, Lr(() => {
1017
- if (R) {
1018
- const f = (
1019
- /** @type {Comment} */
1020
- i(this, St)
1021
- );
1022
- Sn();
1023
- const o = f.data === sr;
1024
- if (f.data.startsWith(Hn)) {
1025
- const u = JSON.parse(f.data.slice(Hn.length));
1026
- E(this, S, br).call(this, u);
1027
- } else o ? E(this, S, Tr).call(this) : E(this, S, Er).call(this);
1028
- } else
1029
- E(this, S, pn).call(this);
1030
- }, zs)), R && g(this, q, b);
1031
- }
1032
- /**
1033
- * Defer an effect inside a pending boundary until the boundary resolves
1034
- * @param {Effect} effect
1035
- */
1036
- defer_effect(t) {
1037
- _r(t, i(this, At), i(this, xt));
1038
- }
1039
- /**
1040
- * Returns `false` if the effect exists inside a boundary whose pending snippet is shown
1041
- * @returns {boolean}
1042
- */
1043
- is_rendered() {
1044
- return !this.is_pending && (!this.parent || this.parent.is_rendered());
1045
- }
1046
- has_pending_snippet() {
1047
- return !!i(this, G).pending;
1048
- }
1049
- /**
1050
- * Update the source that powers `$effect.pending()` inside this boundary,
1051
- * and controls when the current `pending` snippet (if any) is removed.
1052
- * Do not call from inside the class
1053
- * @param {1 | -1} d
1054
- * @param {Batch} batch
1055
- */
1056
- update_pending_count(t, n) {
1057
- E(this, S, gn).call(this, t, n), g(this, Ye, i(this, Ye) + t), !(!i(this, ye) || i(this, it)) && (g(this, it, !0), Me(() => {
1058
- g(this, it, !1), i(this, ye) && Gt(i(this, ye), i(this, Ye));
1059
- }));
1060
- }
1061
- get_effect_pending() {
1062
- return i(this, Zt).call(this), Oe(
1063
- /** @type {Source<number>} */
1064
- i(this, ye)
1065
- );
1066
- }
1067
- /** @param {unknown} error */
1068
- error(t) {
1069
- if (!i(this, G).onerror && !i(this, G).failed)
1070
- throw t;
1071
- v != null && v.is_fork ? (i(this, K) && v.skip_effect(i(this, K)), i(this, L) && v.skip_effect(i(this, L)), i(this, U) && v.skip_effect(i(this, U)), v.on_fork_commit(() => {
1072
- E(this, S, mn).call(this, t);
1073
- })) : E(this, S, mn).call(this, t);
1074
- }
1075
- }
1076
- q = new WeakMap(), St = new WeakMap(), G = new WeakMap(), Ve = new WeakMap(), j = new WeakMap(), K = new WeakMap(), L = new WeakMap(), U = new WeakMap(), we = new WeakMap(), Ye = new WeakMap(), xe = new WeakMap(), it = new WeakMap(), At = new WeakMap(), xt = new WeakMap(), ye = new WeakMap(), Zt = new WeakMap(), S = new WeakSet(), Er = function() {
1077
- try {
1078
- g(this, K, ge(() => i(this, Ve).call(this, i(this, q))));
1079
- } catch (t) {
1080
- this.error(t);
1081
- }
1082
- }, /**
1083
- * @param {unknown} error The deserialized error from the server's hydration comment
1084
- */
1085
- br = function(t) {
1086
- const n = i(this, G).failed;
1087
- n && g(this, U, ge(() => {
1088
- n(
1089
- i(this, q),
1090
- () => t,
1091
- () => () => {
1092
- }
1093
- );
1094
- }));
1095
- }, Tr = function() {
1096
- const t = i(this, G).pending;
1097
- t && (this.is_pending = !0, g(this, L, ge(() => t(i(this, q)))), Me(() => {
1098
- var n = g(this, we, document.createDocumentFragment()), r = le();
1099
- n.append(r), g(this, K, E(this, S, qt).call(this, () => ge(() => i(this, Ve).call(this, r)))), i(this, xe) === 0 && (i(this, q).before(n), g(this, we, null), wt(
1100
- /** @type {Effect} */
1101
- i(this, L),
1102
- () => {
1103
- g(this, L, null);
1104
- }
1105
- ), E(this, S, Bt).call(
1106
- this,
1107
- /** @type {Batch} */
1108
- v
1109
- ));
1110
- }));
1111
- }, pn = function() {
1112
- try {
1113
- if (this.is_pending = this.has_pending_snippet(), g(this, xe, 0), g(this, Ye, 0), g(this, K, ge(() => {
1114
- i(this, Ve).call(this, i(this, q));
1115
- })), i(this, xe) > 0) {
1116
- var t = g(this, we, document.createDocumentFragment());
1117
- Yr(i(this, K), t);
1118
- const n = (
1119
- /** @type {(anchor: Node) => void} */
1120
- i(this, G).pending
1121
- );
1122
- g(this, L, ge(() => n(i(this, q))));
1123
- } else
1124
- E(this, S, Bt).call(
1125
- this,
1126
- /** @type {Batch} */
1127
- v
1128
- );
1129
- } catch (n) {
1130
- this.error(n);
1131
- }
1132
- }, /**
1133
- * @param {Batch} batch
1134
- */
1135
- Bt = function(t) {
1136
- this.is_pending = !1, t.transfer_effects(i(this, At), i(this, xt));
1137
- }, /**
1138
- * @template T
1139
- * @param {() => T} fn
1140
- */
1141
- qt = function(t) {
1142
- var n = y, r = w, s = T;
1143
- pe(i(this, j)), ee(i(this, j)), ot(i(this, j).ctx);
1144
- try {
1145
- return ve.ensure(), t();
1146
- } catch (a) {
1147
- return hr(a), null;
1148
- } finally {
1149
- pe(n), ee(r), ot(s);
1150
- }
1151
- }, /**
1152
- * Updates the pending count associated with the currently visible pending snippet,
1153
- * if any, such that we can replace the snippet with content once work is done
1154
- * @param {1 | -1} d
1155
- * @param {Batch} batch
1156
- */
1157
- gn = function(t, n) {
1158
- var r;
1159
- if (!this.has_pending_snippet()) {
1160
- this.parent && E(r = this.parent, S, gn).call(r, t, n);
1161
- return;
1162
- }
1163
- g(this, xe, i(this, xe) + t), i(this, xe) === 0 && (E(this, S, Bt).call(this, n), i(this, L) && wt(i(this, L), () => {
1164
- g(this, L, null);
1165
- }), i(this, we) && (i(this, q).before(i(this, we)), g(this, we, null)));
1166
- }, /**
1167
- * @param {unknown} error
1168
- */
1169
- mn = function(t) {
1170
- i(this, K) && (V(i(this, K)), g(this, K, null)), i(this, L) && (V(i(this, L)), g(this, L, null)), i(this, U) && (V(i(this, U)), g(this, U, null)), R && (fe(
1171
- /** @type {TemplateNode} */
1172
- i(this, St)
1173
- ), Ns(), fe(Ds()));
1174
- var n = i(this, G).onerror;
1175
- let r = i(this, G).failed;
1176
- var s = !1, a = !1;
1177
- const f = () => {
1178
- if (s) {
1179
- Ms();
1180
- return;
1181
- }
1182
- s = !0, a && As(), i(this, U) !== null && wt(i(this, U), () => {
1183
- g(this, U, null);
1184
- }), E(this, S, qt).call(this, () => {
1185
- E(this, S, pn).call(this);
1186
- });
1187
- }, o = (l) => {
1188
- try {
1189
- a = !0, n == null || n(l, f), a = !1;
1190
- } catch (u) {
1191
- Re(u, i(this, j) && i(this, j).parent);
1192
- }
1193
- r && g(this, U, E(this, S, qt).call(this, () => {
1194
- try {
1195
- return ge(() => {
1196
- var u = (
1197
- /** @type {Effect} */
1198
- y
1199
- );
1200
- u.b = this, u.f |= cn, r(
1201
- i(this, q),
1202
- () => l,
1203
- () => f
1204
- );
1205
- });
1206
- } catch (u) {
1207
- return Re(
1208
- u,
1209
- /** @type {Effect} */
1210
- i(this, j).parent
1211
- ), null;
1212
- }
1213
- }));
1214
- };
1215
- Me(() => {
1216
- var l;
1217
- try {
1218
- l = this.transform_error(t);
1219
- } catch (u) {
1220
- Re(u, i(this, j) && i(this, j).parent);
1221
- return;
1222
- }
1223
- l !== null && typeof l == "object" && typeof /** @type {any} */
1224
- l.then == "function" ? l.then(
1225
- o,
1226
- /** @param {unknown} e */
1227
- (u) => Re(u, i(this, j) && i(this, j).parent)
1228
- ) : o(l);
1229
- });
1230
- };
1231
- function Xs(e, t, n, r) {
1232
- const s = Dt() ? On : Qs;
1233
- var a = e.filter((c) => !c.settled);
1234
- if (n.length === 0 && a.length === 0) {
1235
- r(t.map(s));
1236
- return;
1237
- }
1238
- var f = (
1239
- /** @type {Effect} */
1240
- y
1241
- ), o = Zs(), l = a.length === 1 ? a[0].promise : a.length > 1 ? Promise.all(a.map((c) => c.promise)) : null;
1242
- function u(c) {
1243
- if ((f.f & he) === 0) {
1244
- o();
1245
- try {
1246
- r(c);
1247
- } catch (p) {
1248
- Re(p, f);
1249
- }
1250
- zt();
1251
- }
1252
- }
1253
- var d = kr();
1254
- if (n.length === 0) {
1255
- l.then(() => u(t.map(s))).finally(d);
1256
- return;
1257
- }
1258
- function h() {
1259
- Promise.all(n.map((c) => /* @__PURE__ */ Js(c))).then((c) => u([...t.map(s), ...c])).catch((c) => Re(c, f)).finally(d);
1260
- }
1261
- l ? l.then(() => {
1262
- o(), h(), zt();
1263
- }) : h();
1264
- }
1265
- function Zs() {
1266
- var e = (
1267
- /** @type {Effect} */
1268
- y
1269
- ), t = w, n = T, r = (
1270
- /** @type {Batch} */
1271
- v
1272
- );
1273
- return function(a = !0) {
1274
- pe(e), ee(t), ot(n), a && (e.f & he) === 0 && (r == null || r.activate(), r == null || r.apply());
1275
- };
1276
- }
1277
- function zt(e = !0) {
1278
- pe(null), ee(null), ot(null), e && (v == null || v.deactivate());
1279
- }
1280
- function kr() {
1281
- var e = (
1282
- /** @type {Effect} */
1283
- y
1284
- ), t = (
1285
- /** @type {Boundary} */
1286
- e.b
1287
- ), n = (
1288
- /** @type {Batch} */
1289
- v
1290
- ), r = t.is_rendered();
1291
- return t.update_pending_count(1, n), n.increment(r, e), () => {
1292
- t.update_pending_count(-1, n), n.decrement(r, e);
1293
- };
1294
- }
1295
- // @__NO_SIDE_EFFECTS__
1296
- function On(e) {
1297
- var t = P | D;
1298
- return y !== null && (y.f |= Ge), {
1299
- ctx: T,
1300
- deps: null,
1301
- effects: null,
1302
- equals: ar,
1303
- f: t,
1304
- fn: e,
1305
- reactions: null,
1306
- rv: 0,
1307
- v: (
1308
- /** @type {V} */
1309
- C
1310
- ),
1311
- wv: 0,
1312
- parent: y,
1313
- ac: null
1314
- };
1315
- }
1316
- const Ft = Symbol("obsolete");
1317
- // @__NO_SIDE_EFFECTS__
1318
- function Js(e, t, n) {
1319
- let r = (
1320
- /** @type {Effect | null} */
1321
- y
1322
- );
1323
- r === null && _s();
1324
- var s = (
1325
- /** @type {Promise<V>} */
1326
- /** @type {unknown} */
1327
- void 0
1328
- ), a = Pt(
1329
- /** @type {V} */
1330
- C
1331
- ), f = !w, o = /* @__PURE__ */ new Set();
1332
- return oi(() => {
1333
- var p;
1334
- var l = (
1335
- /** @type {Effect} */
1336
- y
1337
- ), u = Jn();
1338
- s = u.promise;
1339
- try {
1340
- Promise.resolve(e()).then(u.resolve, (_) => {
1341
- _ !== Qt && u.reject(_);
1342
- }).finally(zt);
1343
- } catch (_) {
1344
- u.reject(_), zt();
1345
- }
1346
- var d = (
1347
- /** @type {Batch} */
1348
- v
1349
- );
1350
- if (f) {
1351
- if ((l.f & De) !== 0)
1352
- var h = kr();
1353
- if (
1354
- /** @type {Boundary} */
1355
- r.b.is_rendered()
1356
- )
1357
- (p = d.async_deriveds.get(l)) == null || p.reject(Ft);
1358
- else
1359
- for (const _ of o.values())
1360
- _.reject(Ft);
1361
- o.add(u), d.async_deriveds.set(l, u);
1362
- }
1363
- const c = (_, A = void 0) => {
1364
- h == null || h(), o.delete(u), A !== Ft && (d.activate(), A ? (a.f |= Ce, Gt(a, A)) : ((a.f & Ce) !== 0 && (a.f ^= Ce), Gt(a, _)), d.deactivate());
1365
- };
1366
- u.promise.then(c, (_) => c(null, _ || "unknown"));
1367
- }), Nn(() => {
1368
- for (const l of o)
1369
- l.reject(Ft);
1370
- }), new Promise((l) => {
1371
- function u(d) {
1372
- function h() {
1373
- d === s ? l(a) : u(s);
1374
- }
1375
- d.then(h, h);
1376
- }
1377
- u(s);
1378
- });
1379
- }
1380
- // @__NO_SIDE_EFFECTS__
1381
- function da(e) {
1382
- const t = /* @__PURE__ */ On(e);
1383
- return Br(t), t;
1384
- }
1385
- // @__NO_SIDE_EFFECTS__
1386
- function Qs(e) {
1387
- const t = /* @__PURE__ */ On(e);
1388
- return t.equals = fr, t;
1389
- }
1390
- function ei(e) {
1391
- var t = e.effects;
1392
- if (t !== null) {
1393
- e.effects = null;
1394
- for (var n = 0; n < t.length; n += 1)
1395
- V(
1396
- /** @type {Effect} */
1397
- t[n]
1398
- );
1399
- }
1400
- }
1401
- function Cn(e) {
1402
- var t, n = y, r = e.parent;
1403
- if (!Ne && r !== null && e.v !== C && // if it was never evaluated before, it's guaranteed to fail downstream, so we try to execute instead
1404
- (r.f & (he | Z)) !== 0)
1405
- return Os(), e.v;
1406
- pe(r);
1407
- try {
1408
- e.f &= ~ze, ei(e), t = $r(e);
1409
- } finally {
1410
- pe(n);
1411
- }
1412
- return t;
1413
- }
1414
- function Sr(e) {
1415
- var t = Cn(e);
1416
- if (!e.equals(t) && (e.wv = Kt(), (!(v != null && v.is_fork) || e.deps === null) && (v !== null ? (v.capture(e, t, !0), pt == null || pt.capture(e, t, !0)) : e.v = t, e.deps === null))) {
1417
- x(e, M);
1418
- return;
1419
- }
1420
- Ne || (N !== null ? (Mn() || v != null && v.is_fork) && N.set(e, t) : An(e));
1421
- }
1422
- function ti(e) {
1423
- var t, n;
1424
- if (e.effects !== null)
1425
- for (const r of e.effects)
1426
- (r.teardown || r.ac) && ((t = r.teardown) == null || t.call(r), (n = r.ac) == null || n.abort(Qt), r.fn !== null && (r.teardown = fs), r.ac = null, bt(r, 0), Dn(r));
1427
- }
1428
- function Ar(e) {
1429
- if (e.effects !== null)
1430
- for (const t of e.effects)
1431
- t.teardown && t.fn !== null && ut(t);
1432
- }
1433
- let Et = /* @__PURE__ */ new Set();
1434
- const $e = /* @__PURE__ */ new Map();
1435
- function ni(e) {
1436
- Et = e;
1437
- }
1438
- let xr = !1;
1439
- function Pt(e, t) {
1440
- var n = {
1441
- f: 0,
1442
- // TODO ideally we could skip this altogether, but it causes type errors
1443
- v: e,
1444
- reactions: null,
1445
- equals: ar,
1446
- rv: 0,
1447
- wv: 0
1448
- };
1449
- return n;
1450
- }
1451
- // @__NO_SIDE_EFFECTS__
1452
- function Te(e, t) {
1453
- const n = Pt(e);
1454
- return Br(n), n;
1455
- }
1456
- // @__NO_SIDE_EFFECTS__
1457
- function _a(e, t = !1, n = !0) {
1458
- var s;
1459
- const r = Pt(e);
1460
- return t || (r.equals = fr), Nt && n && T !== null && T.l !== null && ((s = T.l).s ?? (s.s = [])).push(r), r;
1461
- }
1462
- function ke(e, t, n = !1) {
1463
- w !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
1464
- // to ensure we error if state is set inside an inspect effect
1465
- (!ae || (w.f & yt) !== 0) && Dt() && (w.f & (P | ie | Qe | yt)) !== 0 && (J === null || !qe.call(J, e)) && Ss();
1466
- let r = n ? _t(t) : t;
1467
- return Gt(e, r, Vt);
1468
- }
1469
- function Gt(e, t, n = null) {
1470
- if (!e.equals(t)) {
1471
- $e.set(e, Ne ? t : e.v);
1472
- var r = ve.ensure();
1473
- if (r.capture(e, t), (e.f & P) !== 0) {
1474
- const s = (
1475
- /** @type {Derived} */
1476
- e
1477
- );
1478
- (e.f & D) !== 0 && Cn(s), N === null && An(s);
1479
- }
1480
- e.wv = Kt(), Or(e, D, n), Dt() && y !== null && (y.f & M) !== 0 && (y.f & (de | Ee)) === 0 && (z === null ? _i([e]) : z.push(e)), !r.is_fork && Et.size > 0 && !xr && Rr();
1481
- }
1482
- return t;
1483
- }
1484
- function Rr() {
1485
- xr = !1;
1486
- for (const e of Et) {
1487
- (e.f & M) !== 0 && x(e, _e);
1488
- let t;
1489
- try {
1490
- t = It(e);
1491
- } catch {
1492
- t = !0;
1493
- }
1494
- t && ut(e);
1495
- }
1496
- Et.clear();
1497
- }
1498
- function va(e, t = 1) {
1499
- var n = Oe(e), r = t === 1 ? n++ : n--;
1500
- return ke(e, n), r;
1501
- }
1502
- function mt(e) {
1503
- ke(e, e.v + 1);
1504
- }
1505
- function Or(e, t, n) {
1506
- var r = e.reactions;
1507
- if (r !== null)
1508
- for (var s = Dt(), a = r.length, f = 0; f < a; f++) {
1509
- var o = r[f], l = o.f;
1510
- if (!(!s && o === y)) {
1511
- var u = (l & D) === 0;
1512
- if (u && x(o, t), (l & yt) !== 0)
1513
- Et.add(
1514
- /** @type {Effect} */
1515
- o
1516
- );
1517
- else if ((l & P) !== 0) {
1518
- var d = (
1519
- /** @type {Derived} */
1520
- o
1521
- );
1522
- N == null || N.delete(d), (l & ze) === 0 && (l & X && (y === null || (y.f & $t) === 0) && (o.f |= ze), Or(d, _e, n));
1523
- } else if (u) {
1524
- var h = (
1525
- /** @type {Effect} */
1526
- o
1527
- );
1528
- (l & ie) !== 0 && re !== null && re.add(h), n !== null ? n.push(h) : Rn(h);
1529
- }
1530
- }
1531
- }
1532
- }
1533
- function _t(e) {
1534
- if (typeof e != "object" || e === null || Ue in e)
1535
- return e;
1536
- const t = Zn(e);
1537
- if (t !== is && t !== as)
1538
- return e;
1539
- var n = /* @__PURE__ */ new Map(), r = Xn(e), s = /* @__PURE__ */ Te(0), a = We, f = (o) => {
1540
- if (We === a)
1541
- return o();
1542
- var l = w, u = We;
1543
- ee(null), Wn(a);
1544
- var d = o();
1545
- return ee(l), Wn(u), d;
1546
- };
1547
- return r && n.set("length", /* @__PURE__ */ Te(
1548
- /** @type {any[]} */
1549
- e.length
1550
- )), new Proxy(
1551
- /** @type {any} */
1552
- e,
1553
- {
1554
- defineProperty(o, l, u) {
1555
- (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && Ts();
1556
- var d = n.get(l);
1557
- return d === void 0 ? f(() => {
1558
- var h = /* @__PURE__ */ Te(u.value);
1559
- return n.set(l, h), h;
1560
- }) : ke(d, u.value, !0), !0;
1561
- },
1562
- deleteProperty(o, l) {
1563
- var u = n.get(l);
1564
- if (u === void 0) {
1565
- if (l in o) {
1566
- const d = f(() => /* @__PURE__ */ Te(C));
1567
- n.set(l, d), mt(s);
1568
- }
1569
- } else
1570
- ke(u, C), mt(s);
1571
- return !0;
1572
- },
1573
- get(o, l, u) {
1574
- var p;
1575
- if (l === Ue)
1576
- return e;
1577
- var d = n.get(l), h = l in o;
1578
- if (d === void 0 && (!h || (p = vt(o, l)) != null && p.writable) && (d = f(() => {
1579
- var _ = _t(h ? o[l] : C), A = /* @__PURE__ */ Te(_);
1580
- return A;
1581
- }), n.set(l, d)), d !== void 0) {
1582
- var c = Oe(d);
1583
- return c === C ? void 0 : c;
1584
- }
1585
- return Reflect.get(o, l, u);
1586
- },
1587
- getOwnPropertyDescriptor(o, l) {
1588
- var u = Reflect.getOwnPropertyDescriptor(o, l);
1589
- if (u && "value" in u) {
1590
- var d = n.get(l);
1591
- d && (u.value = Oe(d));
1592
- } else if (u === void 0) {
1593
- var h = n.get(l), c = h == null ? void 0 : h.v;
1594
- if (h !== void 0 && c !== C)
1595
- return {
1596
- enumerable: !0,
1597
- configurable: !0,
1598
- value: c,
1599
- writable: !0
1600
- };
1601
- }
1602
- return u;
1603
- },
1604
- has(o, l) {
1605
- var c;
1606
- if (l === Ue)
1607
- return !0;
1608
- var u = n.get(l), d = u !== void 0 && u.v !== C || Reflect.has(o, l);
1609
- if (u !== void 0 || y !== null && (!d || (c = vt(o, l)) != null && c.writable)) {
1610
- u === void 0 && (u = f(() => {
1611
- var p = d ? _t(o[l]) : C, _ = /* @__PURE__ */ Te(p);
1612
- return _;
1613
- }), n.set(l, u));
1614
- var h = Oe(u);
1615
- if (h === C)
1616
- return !1;
1617
- }
1618
- return d;
1619
- },
1620
- set(o, l, u, d) {
1621
- var Ke;
1622
- var h = n.get(l), c = l in o;
1623
- if (r && l === "length")
1624
- for (var p = u; p < /** @type {Source<number>} */
1625
- h.v; p += 1) {
1626
- var _ = n.get(p + "");
1627
- _ !== void 0 ? ke(_, C) : p in o && (_ = f(() => /* @__PURE__ */ Te(C)), n.set(p + "", _));
1628
- }
1629
- if (h === void 0)
1630
- (!c || (Ke = vt(o, l)) != null && Ke.writable) && (h = f(() => /* @__PURE__ */ Te(void 0)), ke(h, _t(u)), n.set(l, h));
1631
- else {
1632
- c = h.v !== C;
1633
- var A = f(() => _t(u));
1634
- ke(h, A);
1635
- }
1636
- var O = Reflect.getOwnPropertyDescriptor(o, l);
1637
- if (O != null && O.set && O.set.call(d, u), !c) {
1638
- if (r && typeof l == "string") {
1639
- var I = (
1640
- /** @type {Source<number>} */
1641
- n.get("length")
1642
- ), ne = Number(l);
1643
- Number.isInteger(ne) && ne >= I.v && ke(I, ne + 1);
1644
- }
1645
- mt(s);
1646
- }
1647
- return !0;
1648
- },
1649
- ownKeys(o) {
1650
- Oe(s);
1651
- var l = Reflect.ownKeys(o).filter((h) => {
1652
- var c = n.get(h);
1653
- return c === void 0 || c.v !== C;
1654
- });
1655
- for (var [u, d] of n)
1656
- d.v !== C && !(u in o) && l.push(u);
1657
- return l;
1658
- },
1659
- setPrototypeOf() {
1660
- ks();
1661
- }
1662
- }
1663
- );
1664
- }
1665
- function Bn(e) {
1666
- try {
1667
- if (e !== null && typeof e == "object" && Ue in e)
1668
- return e[Ue];
1669
- } catch {
1670
- }
1671
- return e;
1672
- }
1673
- function pa(e, t) {
1674
- return Object.is(Bn(e), Bn(t));
1675
- }
1676
- var qn, Cr, Mr, Nr;
1677
- function wn() {
1678
- if (qn === void 0) {
1679
- qn = window, Cr = /Firefox/.test(navigator.userAgent);
1680
- var e = Element.prototype, t = Node.prototype, n = Text.prototype;
1681
- Mr = vt(t, "firstChild").get, Nr = vt(t, "nextSibling").get, Fn(e) && (e[cs] = void 0, e[us] = null, e[hs] = void 0, e.__e = void 0), Fn(n) && (n[ht] = void 0);
1682
- }
1683
- }
1684
- function le(e = "") {
1685
- return document.createTextNode(e);
1686
- }
1687
- // @__NO_SIDE_EFFECTS__
1688
- function W(e) {
1689
- return (
1690
- /** @type {TemplateNode | null} */
1691
- Mr.call(e)
1692
- );
1693
- }
1694
- // @__NO_SIDE_EFFECTS__
1695
- function be(e) {
1696
- return (
1697
- /** @type {TemplateNode | null} */
1698
- Nr.call(e)
1699
- );
1700
- }
1701
- function ga(e, t) {
1702
- if (!R)
1703
- return /* @__PURE__ */ W(e);
1704
- var n = /* @__PURE__ */ W(b);
1705
- if (n === null)
1706
- n = b.appendChild(le());
1707
- else if (t && n.nodeType !== Mt) {
1708
- var r = le();
1709
- return n == null || n.before(r), fe(r), r;
1710
- }
1711
- return t && rn(
1712
- /** @type {Text} */
1713
- n
1714
- ), fe(n), n;
1715
- }
1716
- function ma(e, t = !1) {
1717
- if (!R) {
1718
- var n = /* @__PURE__ */ W(e);
1719
- return n instanceof Comment && n.data === "" ? /* @__PURE__ */ be(n) : n;
1720
- }
1721
- if (t) {
1722
- if ((b == null ? void 0 : b.nodeType) !== Mt) {
1723
- var r = le();
1724
- return b == null || b.before(r), fe(r), r;
1725
- }
1726
- rn(
1727
- /** @type {Text} */
1728
- b
1729
- );
1730
- }
1731
- return b;
1732
- }
1733
- function wa(e, t = 1, n = !1) {
1734
- let r = R ? b : e;
1735
- for (var s; t--; )
1736
- s = r, r = /** @type {TemplateNode} */
1737
- /* @__PURE__ */ be(r);
1738
- if (!R)
1739
- return r;
1740
- if (n) {
1741
- if ((r == null ? void 0 : r.nodeType) !== Mt) {
1742
- var a = le();
1743
- return r === null ? s == null || s.after(a) : r.before(a), fe(a), a;
1744
- }
1745
- rn(
1746
- /** @type {Text} */
1747
- r
1748
- );
1749
- }
1750
- return fe(r), r;
1751
- }
1752
- function Dr(e) {
1753
- e.textContent = "";
1754
- }
1755
- function ri() {
1756
- return !1;
1757
- }
1758
- function si(e, t, n) {
1759
- return (
1760
- /** @type {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element} */
1761
- document.createElementNS(t ?? Rs, e, void 0)
1762
- );
1763
- }
1764
- function rn(e) {
1765
- if (
1766
- /** @type {string} */
1767
- e.nodeValue.length < 65536
1768
- )
1769
- return;
1770
- let t = e.nextSibling;
1771
- for (; t !== null && t.nodeType === Mt; )
1772
- t.remove(), e.nodeValue += /** @type {string} */
1773
- t.nodeValue, t = e.nextSibling;
1774
- }
1775
- function ya(e, t) {
1776
- if (t) {
1777
- const n = document.body;
1778
- e.autofocus = !0, Me(() => {
1779
- document.activeElement === n && e.focus();
1780
- });
1781
- }
1782
- }
1783
- function Ea(e) {
1784
- R && /* @__PURE__ */ W(e) !== null && Dr(e);
1785
- }
1786
- let Un = !1;
1787
- function ii() {
1788
- Un || (Un = !0, document.addEventListener(
1789
- "reset",
1790
- (e) => {
1791
- Promise.resolve().then(() => {
1792
- var t;
1793
- if (!e.defaultPrevented)
1794
- for (
1795
- const n of
1796
- /**@type {HTMLFormElement} */
1797
- e.target.elements
1798
- )
1799
- (t = n[Ht]) == null || t.call(n);
1800
- });
1801
- },
1802
- // In the capture phase to guarantee we get noticed of it (no possibility of stopPropagation)
1803
- { capture: !0 }
1804
- ));
1805
- }
1806
- function sn(e) {
1807
- var t = w, n = y;
1808
- ee(null), pe(null);
1809
- try {
1810
- return e();
1811
- } finally {
1812
- ee(t), pe(n);
1813
- }
1814
- }
1815
- function ba(e, t, n, r = n) {
1816
- e.addEventListener(t, () => sn(n));
1817
- const s = (
1818
- /** @type {any} */
1819
- e[Ht]
1820
- );
1821
- s ? e[Ht] = () => {
1822
- s(), r(!0);
1823
- } : e[Ht] = () => r(!0), ii();
1824
- }
1825
- function Pr(e) {
1826
- y === null && (w === null && gs(), ps()), Ne && vs();
1827
- }
1828
- function ai(e, t) {
1829
- var n = t.last;
1830
- n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e);
1831
- }
1832
- function te(e, t) {
1833
- var n = y;
1834
- n !== null && (n.f & Z) !== 0 && (e |= Z);
1835
- var r = {
1836
- ctx: T,
1837
- deps: null,
1838
- nodes: null,
1839
- f: e | D | X,
1840
- first: null,
1841
- fn: t,
1842
- last: null,
1843
- next: null,
1844
- parent: n,
1845
- b: n && n.b,
1846
- prev: null,
1847
- teardown: null,
1848
- wv: 0,
1849
- ac: null
1850
- };
1851
- v == null || v.register_created_effect(r);
1852
- var s = r;
1853
- if ((e & at) !== 0)
1854
- Je !== null ? Je.push(r) : ve.ensure().schedule(r);
1855
- else if (t !== null) {
1856
- try {
1857
- ut(r);
1858
- } catch (f) {
1859
- throw V(r), f;
1860
- }
1861
- s.deps === null && s.teardown === null && s.nodes === null && s.first === s.last && // either `null`, or a singular child
1862
- (s.f & Ge) === 0 && (s = s.first, (e & ie) !== 0 && (e & ft) !== 0 && s !== null && (s.f |= ft));
1863
- }
1864
- if (s !== null && (s.parent = n, n !== null && ai(s, n), w !== null && (w.f & P) !== 0 && (e & Ee) === 0)) {
1865
- var a = (
1866
- /** @type {Derived} */
1867
- w
1868
- );
1869
- (a.effects ?? (a.effects = [])).push(s);
1870
- }
1871
- return r;
1872
- }
1873
- function Mn() {
1874
- return w !== null && !ae;
1875
- }
1876
- function Nn(e) {
1877
- const t = te(Ct, null);
1878
- return x(t, M), t.teardown = e, t;
1879
- }
1880
- function fi(e) {
1881
- Pr();
1882
- var t = (
1883
- /** @type {Effect} */
1884
- y.f
1885
- ), n = !w && (t & de) !== 0 && (t & De) === 0;
1886
- if (n) {
1887
- var r = (
1888
- /** @type {ComponentContext} */
1889
- T
1890
- );
1891
- (r.e ?? (r.e = [])).push(e);
1892
- } else
1893
- return Ir(e);
1894
- }
1895
- function Ir(e) {
1896
- return te(at | Qn, e);
1897
- }
1898
- function Ta(e) {
1899
- return Pr(), te(Ct | Qn, e);
1900
- }
1901
- function ka(e) {
1902
- ve.ensure();
1903
- const t = te(Ee | Ge, e);
1904
- return () => {
1905
- V(t);
1906
- };
1907
- }
1908
- function li(e) {
1909
- ve.ensure();
1910
- const t = te(Ee | Ge, e);
1911
- return (n = {}) => new Promise((r) => {
1912
- n.outro ? wt(t, () => {
1913
- V(t), r(void 0);
1914
- }) : (V(t), r(void 0));
1915
- });
1916
- }
1917
- function Sa(e) {
1918
- return te(at, e);
1919
- }
1920
- function oi(e) {
1921
- return te(Qe | Ge, e);
1922
- }
1923
- function ui(e, t = 0) {
1924
- return te(Ct | t, e);
1925
- }
1926
- function Aa(e, t = [], n = [], r = []) {
1927
- Xs(r, t, n, (s) => {
1928
- te(Ct, () => e(...s.map(Oe)));
1929
- });
1930
- }
1931
- function Lr(e, t = 0) {
1932
- var n = te(ie | t, e);
1933
- return n;
1934
- }
1935
- function xa(e, t = 0) {
1936
- var n = te(kn | t, e);
1937
- return n;
1938
- }
1939
- function ge(e) {
1940
- return te(de | Ge, e);
1941
- }
1942
- function Fr(e) {
1943
- var t = e.teardown;
1944
- if (t !== null) {
1945
- const n = Ne, r = w;
1946
- $n(!0), ee(null);
1947
- try {
1948
- t.call(null);
1949
- } finally {
1950
- $n(n), ee(r);
1951
- }
1952
- }
1953
- }
1954
- function Dn(e, t = !1) {
1955
- var n = e.first;
1956
- for (e.first = e.last = null; n !== null; ) {
1957
- const s = n.ac;
1958
- s !== null && sn(() => {
1959
- s.abort(Qt);
1960
- });
1961
- var r = n.next;
1962
- (n.f & Ee) !== 0 ? n.parent = null : V(n, t), n = r;
1963
- }
1964
- }
1965
- function ci(e) {
1966
- for (var t = e.first; t !== null; ) {
1967
- var n = t.next;
1968
- (t.f & de) === 0 && V(t), t = n;
1969
- }
1970
- }
1971
- function V(e, t = !0) {
1972
- var n = !1;
1973
- (t || (e.f & os) !== 0) && e.nodes !== null && e.nodes.end !== null && (hi(
1974
- e.nodes.start,
1975
- /** @type {TemplateNode} */
1976
- e.nodes.end
1977
- ), n = !0), x(e, jn), Dn(e, t && !n), bt(e, 0);
1978
- var r = e.nodes && e.nodes.t;
1979
- if (r !== null)
1980
- for (const a of r)
1981
- a.stop();
1982
- Fr(e), e.f ^= jn, e.f |= he;
1983
- var s = e.parent;
1984
- s !== null && s.first !== null && jr(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = e.b = null;
1985
- }
1986
- function hi(e, t) {
1987
- for (; e !== null; ) {
1988
- var n = e === t ? null : /* @__PURE__ */ be(e);
1989
- e.remove(), e = n;
1990
- }
1991
- }
1992
- function jr(e) {
1993
- var t = e.parent, n = e.prev, r = e.next;
1994
- n !== null && (n.next = r), r !== null && (r.prev = n), t !== null && (t.first === e && (t.first = r), t.last === e && (t.last = n));
1995
- }
1996
- function wt(e, t, n = !0) {
1997
- var r = [];
1998
- Hr(e, r, !0);
1999
- var s = () => {
2000
- n && V(e), t && t();
2001
- }, a = r.length;
2002
- if (a > 0) {
2003
- var f = () => --a || s();
2004
- for (var o of r)
2005
- o.out(f);
2006
- } else
2007
- s();
2008
- }
2009
- function Hr(e, t, n) {
2010
- if ((e.f & Z) === 0) {
2011
- e.f ^= Z;
2012
- var r = e.nodes && e.nodes.t;
2013
- if (r !== null)
2014
- for (const o of r)
2015
- (o.is_global || n) && t.push(o);
2016
- for (var s = e.first; s !== null; ) {
2017
- var a = s.next;
2018
- if ((s.f & Ee) === 0) {
2019
- var f = (s.f & ft) !== 0 || // If this is a branch effect without a block effect parent,
2020
- // it means the parent block effect was pruned. In that case,
2021
- // transparency information was transferred to the branch effect.
2022
- (s.f & de) !== 0 && (e.f & ie) !== 0;
2023
- Hr(s, t, f ? n : !1);
2024
- }
2025
- s = a;
2026
- }
2027
- }
2028
- }
2029
- function di(e) {
2030
- Vr(e, !0);
2031
- }
2032
- function Vr(e, t) {
2033
- if ((e.f & Z) !== 0) {
2034
- e.f ^= Z, (e.f & M) === 0 && (x(e, D), ve.ensure().schedule(e));
2035
- for (var n = e.first; n !== null; ) {
2036
- var r = n.next, s = (n.f & ft) !== 0 || (n.f & de) !== 0;
2037
- Vr(n, s ? t : !1), n = r;
2038
- }
2039
- var a = e.nodes && e.nodes.t;
2040
- if (a !== null)
2041
- for (const f of a)
2042
- (f.is_global || t) && f.in();
2043
- }
2044
- }
2045
- function Yr(e, t) {
2046
- if (e.nodes)
2047
- for (var n = e.nodes.start, r = e.nodes.end; n !== null; ) {
2048
- var s = n === r ? null : /* @__PURE__ */ be(n);
2049
- t.append(n), n = s;
2050
- }
2051
- }
2052
- let Ut = !1, Ne = !1;
2053
- function $n(e) {
2054
- Ne = e;
2055
- }
2056
- let w = null, ae = !1;
2057
- function ee(e) {
2058
- w = e;
2059
- }
2060
- let y = null;
2061
- function pe(e) {
2062
- y = e;
2063
- }
2064
- let J = null;
2065
- function Br(e) {
2066
- w !== null && (J === null ? J = [e] : J.push(e));
2067
- }
2068
- let H = null, Y = 0, z = null;
2069
- function _i(e) {
2070
- z = e;
2071
- }
2072
- let qr = 1, Ie = 0, We = Ie;
2073
- function Wn(e) {
2074
- We = e;
2075
- }
2076
- function Kt() {
2077
- return ++qr;
2078
- }
2079
- function It(e) {
2080
- var t = e.f;
2081
- if ((t & D) !== 0)
2082
- return !0;
2083
- if (t & P && (e.f &= ~ze), (t & _e) !== 0) {
2084
- for (var n = (
2085
- /** @type {Value[]} */
2086
- e.deps
2087
- ), r = n.length, s = 0; s < r; s++) {
2088
- var a = n[s];
2089
- if (It(
2090
- /** @type {Derived} */
2091
- a
2092
- ) && Sr(
2093
- /** @type {Derived} */
2094
- a
2095
- ), a.wv > e.wv)
2096
- return !0;
2097
- }
2098
- (t & X) !== 0 && // During time traveling we don't want to reset the status so that
2099
- // traversal of the graph in the other batches still happens
2100
- N === null && x(e, M);
2101
- }
2102
- return !1;
2103
- }
2104
- function Ur(e, t, n = !0) {
2105
- var r = e.reactions;
2106
- if (r !== null && !(J !== null && qe.call(J, e)))
2107
- for (var s = 0; s < r.length; s++) {
2108
- var a = r[s];
2109
- (a.f & P) !== 0 ? Ur(
2110
- /** @type {Derived} */
2111
- a,
2112
- t,
2113
- !1
2114
- ) : t === a && (n ? x(a, D) : (a.f & M) !== 0 && x(a, _e), Rn(
2115
- /** @type {Effect} */
2116
- a
2117
- ));
2118
- }
2119
- }
2120
- function $r(e) {
2121
- var A;
2122
- var t = H, n = Y, r = z, s = w, a = J, f = T, o = ae, l = We, u = e.f;
2123
- H = /** @type {null | Value[]} */
2124
- null, Y = 0, z = null, w = (u & (de | Ee)) === 0 ? e : null, J = null, ot(e.ctx), ae = !1, We = ++Ie, e.ac !== null && (sn(() => {
2125
- e.ac.abort(Qt);
2126
- }), e.ac = null);
2127
- try {
2128
- e.f |= $t;
2129
- var d = (
2130
- /** @type {Function} */
2131
- e.fn
2132
- ), h = d();
2133
- e.f |= De;
2134
- var c = e.deps, p = v == null ? void 0 : v.is_fork;
2135
- if (H !== null) {
2136
- var _;
2137
- if (p || bt(e, Y), c !== null && Y > 0)
2138
- for (c.length = Y + H.length, _ = 0; _ < H.length; _++)
2139
- c[Y + _] = H[_];
2140
- else
2141
- e.deps = c = H;
2142
- if (Mn() && (e.f & X) !== 0)
2143
- for (_ = Y; _ < c.length; _++)
2144
- ((A = c[_]).reactions ?? (A.reactions = [])).push(e);
2145
- } else !p && c !== null && Y < c.length && (bt(e, Y), c.length = Y);
2146
- if (Dt() && z !== null && !ae && c !== null && (e.f & (P | _e | D)) === 0)
2147
- for (_ = 0; _ < /** @type {Source[]} */
2148
- z.length; _++)
2149
- Ur(
2150
- z[_],
2151
- /** @type {Effect} */
2152
- e
2153
- );
2154
- if (s !== null && s !== e) {
2155
- if (Ie++, s.deps !== null)
2156
- for (let O = 0; O < n; O += 1)
2157
- s.deps[O].rv = Ie;
2158
- if (t !== null)
2159
- for (const O of t)
2160
- O.rv = Ie;
2161
- z !== null && (r === null ? r = z : r.push(.../** @type {Source[]} */
2162
- z));
2163
- }
2164
- return (e.f & Ce) !== 0 && (e.f ^= Ce), h;
2165
- } catch (O) {
2166
- return hr(O);
2167
- } finally {
2168
- e.f ^= $t, H = t, Y = n, z = r, w = s, J = a, ot(f), ae = o, We = l;
2169
- }
2170
- }
2171
- function vi(e, t) {
2172
- let n = t.reactions;
2173
- if (n !== null) {
2174
- var r = ts.call(n, e);
2175
- if (r !== -1) {
2176
- var s = n.length - 1;
2177
- s === 0 ? n = t.reactions = null : (n[r] = n[s], n.pop());
2178
- }
2179
- }
2180
- if (n === null && (t.f & P) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
2181
- // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
2182
- // allows us to skip the expensive work of disconnecting and immediately reconnecting it
2183
- (H === null || !qe.call(H, t))) {
2184
- var a = (
2185
- /** @type {Derived} */
2186
- t
2187
- );
2188
- (a.f & X) !== 0 && (a.f ^= X, a.f &= ~ze), a.v !== C && An(a), ti(a), bt(a, 0);
2189
- }
2190
- }
2191
- function bt(e, t) {
2192
- var n = e.deps;
2193
- if (n !== null)
2194
- for (var r = t; r < n.length; r++)
2195
- vi(e, n[r]);
2196
- }
2197
- function ut(e) {
2198
- var t = e.f;
2199
- if ((t & he) === 0) {
2200
- x(e, M);
2201
- var n = y, r = Ut;
2202
- y = e, Ut = !0;
2203
- try {
2204
- (t & (ie | kn)) !== 0 ? ci(e) : Dn(e), Fr(e);
2205
- var s = $r(e);
2206
- e.teardown = typeof s == "function" ? s : null, e.wv = qr;
2207
- var a;
2208
- } finally {
2209
- Ut = r, y = n;
2210
- }
2211
- }
2212
- }
2213
- async function pi() {
2214
- await Promise.resolve(), Wt();
2215
- }
2216
- function gi() {
2217
- return ve.ensure().settled();
2218
- }
2219
- function Oe(e) {
2220
- var t = e.f, n = (t & P) !== 0;
2221
- if (w !== null && !ae) {
2222
- var r = y !== null && (y.f & he) !== 0;
2223
- if (!r && (J === null || !qe.call(J, e))) {
2224
- var s = w.deps;
2225
- if ((w.f & $t) !== 0)
2226
- e.rv < Ie && (e.rv = Ie, H === null && s !== null && s[Y] === e ? Y++ : H === null ? H = [e] : H.push(e));
2227
- else {
2228
- w.deps ?? (w.deps = []), qe.call(w.deps, e) || w.deps.push(e);
2229
- var a = e.reactions;
2230
- a === null ? e.reactions = [w] : qe.call(a, w) || a.push(w);
2231
- }
2232
- }
2233
- }
2234
- if (Ne && $e.has(e))
2235
- return $e.get(e);
2236
- if (n) {
2237
- var f = (
2238
- /** @type {Derived} */
2239
- e
2240
- );
2241
- if (Ne) {
2242
- var o = f.v;
2243
- return ((f.f & M) === 0 && f.reactions !== null || zr(f)) && (o = Cn(f)), $e.set(f, o), o;
2244
- }
2245
- var l = (f.f & X) === 0 && !ae && w !== null && (Ut || (w.f & X) !== 0), u = (f.f & De) === 0;
2246
- It(f) && (l && (f.f |= X), Sr(f)), l && !u && (Ar(f), Wr(f));
2247
- }
2248
- if (N != null && N.has(e))
2249
- return N.get(e);
2250
- if ((e.f & Ce) !== 0)
2251
- throw e.v;
2252
- return e.v;
2253
- }
2254
- function Wr(e) {
2255
- if (e.f |= X, e.deps !== null)
2256
- for (const t of e.deps)
2257
- (t.reactions ?? (t.reactions = [])).push(e), (t.f & P) !== 0 && (t.f & X) === 0 && (Ar(
2258
- /** @type {Derived} */
2259
- t
2260
- ), Wr(
2261
- /** @type {Derived} */
2262
- t
2263
- ));
2264
- }
2265
- function zr(e) {
2266
- if (e.v === C) return !0;
2267
- if (e.deps === null) return !1;
2268
- for (const t of e.deps)
2269
- if ($e.has(t) || (t.f & P) !== 0 && zr(
2270
- /** @type {Derived} */
2271
- t
2272
- ))
2273
- return !0;
2274
- return !1;
2275
- }
2276
- function an(e) {
2277
- var t = ae;
2278
- try {
2279
- return ae = !0, e();
2280
- } finally {
2281
- ae = t;
2282
- }
2283
- }
2284
- function Ra(e) {
2285
- if (!(typeof e != "object" || !e || e instanceof EventTarget)) {
2286
- if (Ue in e)
2287
- yn(e);
2288
- else if (!Array.isArray(e))
2289
- for (let t in e) {
2290
- const n = e[t];
2291
- typeof n == "object" && n && Ue in n && yn(n);
2292
- }
2293
- }
2294
- }
2295
- function yn(e, t = /* @__PURE__ */ new Set()) {
2296
- if (typeof e == "object" && e !== null && // We don't want to traverse DOM elements
2297
- !(e instanceof EventTarget) && !t.has(e)) {
2298
- t.add(e), e instanceof Date && e.getTime();
2299
- for (let r in e)
2300
- try {
2301
- yn(e[r], t);
2302
- } catch {
2303
- }
2304
- const n = Zn(e);
2305
- if (n !== Object.prototype && n !== Array.prototype && n !== Map.prototype && n !== Set.prototype && n !== Date.prototype) {
2306
- const r = ss(n);
2307
- for (let s in r) {
2308
- const a = r[s].get;
2309
- if (a)
2310
- try {
2311
- a.call(e);
2312
- } catch {
2313
- }
2314
- }
2315
- }
2316
- }
2317
- }
2318
- function Oa(e) {
2319
- return e.endsWith("capture") && e !== "gotpointercapture" && e !== "lostpointercapture";
2320
- }
2321
- const mi = [
2322
- "beforeinput",
2323
- "click",
2324
- "change",
2325
- "dblclick",
2326
- "contextmenu",
2327
- "focusin",
2328
- "focusout",
2329
- "input",
2330
- "keydown",
2331
- "keyup",
2332
- "mousedown",
2333
- "mousemove",
2334
- "mouseout",
2335
- "mouseover",
2336
- "mouseup",
2337
- "pointerdown",
2338
- "pointermove",
2339
- "pointerout",
2340
- "pointerover",
2341
- "pointerup",
2342
- "touchend",
2343
- "touchmove",
2344
- "touchstart"
2345
- ];
2346
- function Ca(e) {
2347
- return mi.includes(e);
2348
- }
2349
- const wi = {
2350
- // no `class: 'className'` because we handle that separately
2351
- formnovalidate: "formNoValidate",
2352
- ismap: "isMap",
2353
- nomodule: "noModule",
2354
- playsinline: "playsInline",
2355
- readonly: "readOnly",
2356
- defaultvalue: "defaultValue",
2357
- defaultchecked: "defaultChecked",
2358
- srcobject: "srcObject",
2359
- novalidate: "noValidate",
2360
- allowfullscreen: "allowFullscreen",
2361
- disablepictureinpicture: "disablePictureInPicture",
2362
- disableremoteplayback: "disableRemotePlayback"
2363
- };
2364
- function Ma(e) {
2365
- return e = e.toLowerCase(), wi[e] ?? e;
2366
- }
2367
- const yi = ["touchstart", "touchmove"];
2368
- function Ei(e) {
2369
- return yi.includes(e);
2370
- }
2371
- const bi = (
2372
- /** @type {const} */
2373
- ["textarea", "script", "style", "title"]
2374
- );
2375
- function Na(e) {
2376
- return bi.includes(
2377
- /** @type {typeof RAW_TEXT_ELEMENTS[number]} */
2378
- e
2379
- );
2380
- }
2381
- const Le = Symbol("events"), Gr = /* @__PURE__ */ new Set(), En = /* @__PURE__ */ new Set();
2382
- function Kr(e, t, n, r = {}) {
2383
- function s(a) {
2384
- if (r.capture || bn.call(t, a), !a.cancelBubble)
2385
- return sn(() => n == null ? void 0 : n.call(this, a));
2386
- }
2387
- return e.startsWith("pointer") || e.startsWith("touch") || e === "wheel" ? Me(() => {
2388
- t.addEventListener(e, s, r);
2389
- }) : t.addEventListener(e, s, r), s;
2390
- }
2391
- function Da(e, t, n, r = {}) {
2392
- var s = Kr(t, e, n, r);
2393
- return () => {
2394
- e.removeEventListener(t, s, r);
2395
- };
2396
- }
2397
- function Pa(e, t, n, r, s) {
2398
- var a = { capture: r, passive: s }, f = Kr(e, t, n, a);
2399
- (t === document.body || // @ts-ignore
2400
- t === window || // @ts-ignore
2401
- t === document || // Firefox has quirky behavior, it can happen that we still get "canplay" events when the element is already removed
2402
- t instanceof HTMLMediaElement) && Nn(() => {
2403
- t.removeEventListener(e, f, a);
2404
- });
2405
- }
2406
- function Ia(e, t, n) {
2407
- (t[Le] ?? (t[Le] = {}))[e] = n;
2408
- }
2409
- function La(e) {
2410
- for (var t = 0; t < e.length; t++)
2411
- Gr.add(e[t]);
2412
- for (var n of En)
2413
- n(e);
2414
- }
2415
- let zn = null;
2416
- function bn(e) {
2417
- var O, I;
2418
- var t = this, n = (
2419
- /** @type {Node} */
2420
- t.ownerDocument
2421
- ), r = e.type, s = ((O = e.composedPath) == null ? void 0 : O.call(e)) || [], a = (
2422
- /** @type {null | Element} */
2423
- s[0] || e.target
2424
- );
2425
- zn = e;
2426
- var f = 0, o = zn === e && e[Le];
2427
- if (o) {
2428
- var l = s.indexOf(o);
2429
- if (l !== -1 && (t === document || t === /** @type {any} */
2430
- window)) {
2431
- e[Le] = t;
2432
- return;
2433
- }
2434
- var u = s.indexOf(t);
2435
- if (u === -1)
2436
- return;
2437
- l <= u && (f = l);
2438
- }
2439
- if (a = /** @type {Element} */
2440
- s[f] || e.target, a !== t) {
2441
- rs(e, "currentTarget", {
2442
- configurable: !0,
2443
- get() {
2444
- return a || n;
2445
- }
2446
- });
2447
- var d = w, h = y;
2448
- ee(null), pe(null);
2449
- try {
2450
- for (var c, p = []; a !== null; ) {
2451
- var _ = a.assignedSlot || a.parentNode || /** @type {any} */
2452
- a.host || null;
2453
- try {
2454
- var A = (I = a[Le]) == null ? void 0 : I[r];
2455
- A != null && (!/** @type {any} */
2456
- a.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
2457
- // -> the target could not have been disabled because it emits the event in the first place
2458
- e.target === a) && A.call(a, e);
2459
- } catch (ne) {
2460
- c ? p.push(ne) : c = ne;
2461
- }
2462
- if (e.cancelBubble || _ === t || _ === null)
2463
- break;
2464
- a = _;
2465
- }
2466
- if (c) {
2467
- for (let ne of p)
2468
- queueMicrotask(() => {
2469
- throw ne;
2470
- });
2471
- throw c;
2472
- }
2473
- } finally {
2474
- e[Le] = t, delete e.currentTarget, ee(d), pe(h);
2475
- }
2476
- }
2477
- }
2478
- var Kn;
2479
- const un = (
2480
- // We gotta write it like this because after downleveling the pure comment may end up in the wrong location
2481
- ((Kn = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : Kn.trustedTypes) && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", {
2482
- /** @param {string} html */
2483
- createHTML: (e) => e
2484
- })
2485
- );
2486
- function Ti(e) {
2487
- return (
2488
- /** @type {string} */
2489
- (un == null ? void 0 : un.createHTML(e)) ?? e
2490
- );
2491
- }
2492
- function Pn(e) {
2493
- var t = si("template");
2494
- return t.innerHTML = Ti(e.replaceAll("<!>", "<!---->")), t.content;
2495
- }
2496
- function Q(e, t) {
2497
- var n = (
2498
- /** @type {Effect} */
2499
- y
2500
- );
2501
- n.nodes === null && (n.nodes = { start: e, end: t, a: null, t: null });
2502
- }
2503
- // @__NO_SIDE_EFFECTS__
2504
- function Fa(e, t) {
2505
- var n = (t & nr) !== 0, r = (t & xs) !== 0, s, a = !e.startsWith("<!>");
2506
- return () => {
2507
- if (R)
2508
- return Q(b, null), b;
2509
- s === void 0 && (s = Pn(a ? e : "<!>" + e), n || (s = /** @type {TemplateNode} */
2510
- /* @__PURE__ */ W(s)));
2511
- var f = (
2512
- /** @type {TemplateNode} */
2513
- r || Cr ? document.importNode(s, !0) : s.cloneNode(!0)
2514
- );
2515
- if (n) {
2516
- var o = (
2517
- /** @type {TemplateNode} */
2518
- /* @__PURE__ */ W(f)
2519
- ), l = (
2520
- /** @type {TemplateNode} */
2521
- f.lastChild
2522
- );
2523
- Q(o, l);
2524
- } else
2525
- Q(f, f);
2526
- return f;
2527
- };
2528
- }
2529
- // @__NO_SIDE_EFFECTS__
2530
- function ki(e, t, n = "svg") {
2531
- var r = !e.startsWith("<!>"), s = (t & nr) !== 0, a = `<${n}>${r ? e : "<!>" + e}</${n}>`, f;
2532
- return () => {
2533
- if (R)
2534
- return Q(b, null), b;
2535
- if (!f) {
2536
- var o = (
2537
- /** @type {DocumentFragment} */
2538
- Pn(a)
2539
- ), l = (
2540
- /** @type {Element} */
2541
- /* @__PURE__ */ W(o)
2542
- );
2543
- if (s)
2544
- for (f = document.createDocumentFragment(); /* @__PURE__ */ W(l); )
2545
- f.appendChild(
2546
- /** @type {TemplateNode} */
2547
- /* @__PURE__ */ W(l)
2548
- );
2549
- else
2550
- f = /** @type {Element} */
2551
- /* @__PURE__ */ W(l);
2552
- }
2553
- var u = (
2554
- /** @type {TemplateNode} */
2555
- f.cloneNode(!0)
2556
- );
2557
- if (s) {
2558
- var d = (
2559
- /** @type {TemplateNode} */
2560
- /* @__PURE__ */ W(u)
2561
- ), h = (
2562
- /** @type {TemplateNode} */
2563
- u.lastChild
2564
- );
2565
- Q(d, h);
2566
- } else
2567
- Q(u, u);
2568
- return u;
2569
- };
2570
- }
2571
- // @__NO_SIDE_EFFECTS__
2572
- function ja(e, t) {
2573
- return /* @__PURE__ */ ki(e, t, "svg");
2574
- }
2575
- function Ha(e = "") {
2576
- if (!R) {
2577
- var t = le(e + "");
2578
- return Q(t, t), t;
2579
- }
2580
- var n = b;
2581
- return n.nodeType !== Mt ? (n.before(n = le()), fe(n)) : rn(
2582
- /** @type {Text} */
2583
- n
2584
- ), Q(n, n), n;
2585
- }
2586
- function Va() {
2587
- if (R)
2588
- return Q(b, null), b;
2589
- var e = document.createDocumentFragment(), t = document.createComment(""), n = le();
2590
- return e.append(t, n), Q(t, n), e;
2591
- }
2592
- function Ya(e, t) {
2593
- if (R) {
2594
- var n = (
2595
- /** @type {Effect & { nodes: EffectNodes }} */
2596
- y
2597
- );
2598
- ((n.f & De) === 0 || n.nodes.end === null) && (n.nodes.end = b), Sn();
2599
- return;
2600
- }
2601
- e !== null && e.before(
2602
- /** @type {Node} */
2603
- t
2604
- );
2605
- }
2606
- function Ba(e, t) {
2607
- var n = t == null ? "" : typeof t == "object" ? `${t}` : t;
2608
- n !== /** @type {any} */
2609
- (e[ht] ?? (e[ht] = e.nodeValue)) && (e[ht] = n, e.nodeValue = `${n}`);
2610
- }
2611
- function Xr(e, t) {
2612
- return Zr(e, t);
2613
- }
2614
- function Si(e, t) {
2615
- wn(), t.intro = t.intro ?? !1;
2616
- const n = t.target, r = R, s = b;
2617
- try {
2618
- for (var a = /* @__PURE__ */ W(n); a && (a.nodeType !== en || /** @type {Comment} */
2619
- a.data !== rr); )
2620
- a = /* @__PURE__ */ be(a);
2621
- if (!a)
2622
- throw lt;
2623
- Lt(!0), fe(
2624
- /** @type {Comment} */
2625
- a
2626
- );
2627
- const f = Zr(e, { ...t, anchor: a });
2628
- return Lt(!1), /** @type {Exports} */
2629
- f;
2630
- } catch (f) {
2631
- if (f instanceof Error && f.message.split(`
2632
- `).some((o) => o.startsWith("https://svelte.dev/e/")))
2633
- throw f;
2634
- return f !== lt && console.warn("Failed to hydrate: ", f), t.recover === !1 && bs(), wn(), Dr(n), Lt(!1), Xr(e, t);
2635
- } finally {
2636
- Lt(r), fe(s);
2637
- }
2638
- }
2639
- const jt = /* @__PURE__ */ new Map();
2640
- function Zr(e, { target: t, anchor: n, props: r = {}, events: s, context: a, intro: f = !0, transformError: o }) {
2641
- wn();
2642
- var l = void 0, u = li(() => {
2643
- var d = n ?? t.appendChild(le());
2644
- Gs(
2645
- /** @type {TemplateNode} */
2646
- d,
2647
- {
2648
- pending: () => {
2649
- }
2650
- },
2651
- (p) => {
2652
- Fs({});
2653
- var _ = (
2654
- /** @type {ComponentContext} */
2655
- T
2656
- );
2657
- if (a && (_.c = a), s && (r.$$events = s), R && Q(
2658
- /** @type {TemplateNode} */
2659
- p,
2660
- null
2661
- ), l = e(p, r) || {}, R && (y.nodes.end = b, b === null || b.nodeType !== en || /** @type {Comment} */
2662
- b.data !== ir))
2663
- throw tn(), lt;
2664
- js();
2665
- },
2666
- o
2667
- );
2668
- var h = /* @__PURE__ */ new Set(), c = (p) => {
2669
- for (var _ = 0; _ < p.length; _++) {
2670
- var A = p[_];
2671
- if (!h.has(A)) {
2672
- h.add(A);
2673
- var O = Ei(A);
2674
- for (const Ke of [t, document]) {
2675
- var I = jt.get(Ke);
2676
- I === void 0 && (I = /* @__PURE__ */ new Map(), jt.set(Ke, I));
2677
- var ne = I.get(A);
2678
- ne === void 0 ? (Ke.addEventListener(A, bn, { passive: O }), I.set(A, 1)) : I.set(A, ne + 1);
2679
- }
2680
- }
2681
- }
2682
- };
2683
- return c(ns(Gr)), En.add(c), () => {
2684
- var O;
2685
- for (var p of h)
2686
- for (const I of [t, document]) {
2687
- var _ = (
2688
- /** @type {Map<string, number>} */
2689
- jt.get(I)
2690
- ), A = (
2691
- /** @type {number} */
2692
- _.get(p)
2693
- );
2694
- --A == 0 ? (I.removeEventListener(p, bn), _.delete(p), _.size === 0 && jt.delete(I)) : _.set(p, A);
2695
- }
2696
- En.delete(c), d !== n && ((O = d.parentNode) == null || O.removeChild(d));
2697
- };
2698
- });
2699
- return Tn.set(l, u), l;
2700
- }
2701
- let Tn = /* @__PURE__ */ new WeakMap();
2702
- function Ai(e, t) {
2703
- const n = Tn.get(e);
2704
- return n ? (Tn.delete(e), n(t)) : Promise.resolve();
2705
- }
2706
- var se, ce, $, Be, Rt, Ot, Jt;
2707
- class xi {
2708
- /**
2709
- * @param {TemplateNode} anchor
2710
- * @param {boolean} transition
2711
- */
2712
- constructor(t, n = !0) {
2713
- /** @type {TemplateNode} */
2714
- F(this, "anchor");
2715
- /** @type {Map<Batch, Key>} */
2716
- m(this, se, /* @__PURE__ */ new Map());
2717
- /**
2718
- * Map of keys to effects that are currently rendered in the DOM.
2719
- * These effects are visible and actively part of the document tree.
2720
- * Example:
2721
- * ```
2722
- * {#if condition}
2723
- * foo
2724
- * {:else}
2725
- * bar
2726
- * {/if}
2727
- * ```
2728
- * Can result in the entries `true->Effect` and `false->Effect`
2729
- * @type {Map<Key, Effect>}
2730
- */
2731
- m(this, ce, /* @__PURE__ */ new Map());
2732
- /**
2733
- * Similar to #onscreen with respect to the keys, but contains branches that are not yet
2734
- * in the DOM, because their insertion is deferred.
2735
- * @type {Map<Key, Branch>}
2736
- */
2737
- m(this, $, /* @__PURE__ */ new Map());
2738
- /**
2739
- * Keys of effects that are currently outroing
2740
- * @type {Set<Key>}
2741
- */
2742
- m(this, Be, /* @__PURE__ */ new Set());
2743
- /**
2744
- * Whether to pause (i.e. outro) on change, or destroy immediately.
2745
- * This is necessary for `<svelte:element>`
2746
- */
2747
- m(this, Rt, !0);
2748
- /**
2749
- * @param {Batch} batch
2750
- */
2751
- m(this, Ot, (t) => {
2752
- if (i(this, se).has(t)) {
2753
- var n = (
2754
- /** @type {Key} */
2755
- i(this, se).get(t)
2756
- ), r = i(this, ce).get(n);
2757
- if (r)
2758
- di(r), i(this, Be).delete(n);
2759
- else {
2760
- var s = i(this, $).get(n);
2761
- s && (i(this, ce).set(n, s.effect), i(this, $).delete(n), s.fragment.lastChild.remove(), this.anchor.before(s.fragment), r = s.effect);
2762
- }
2763
- for (const [a, f] of i(this, se)) {
2764
- if (i(this, se).delete(a), a === t)
2765
- break;
2766
- const o = i(this, $).get(f);
2767
- o && (V(o.effect), i(this, $).delete(f));
2768
- }
2769
- for (const [a, f] of i(this, ce)) {
2770
- if (a === n || i(this, Be).has(a)) continue;
2771
- const o = () => {
2772
- if (Array.from(i(this, se).values()).includes(a)) {
2773
- var u = document.createDocumentFragment();
2774
- Yr(f, u), u.append(le()), i(this, $).set(a, { effect: f, fragment: u });
2775
- } else
2776
- V(f);
2777
- i(this, Be).delete(a), i(this, ce).delete(a);
2778
- };
2779
- i(this, Rt) || !r ? (i(this, Be).add(a), wt(f, o, !1)) : o();
2780
- }
2781
- }
2782
- });
2783
- /**
2784
- * @param {Batch} batch
2785
- */
2786
- m(this, Jt, (t) => {
2787
- i(this, se).delete(t);
2788
- const n = Array.from(i(this, se).values());
2789
- for (const [r, s] of i(this, $))
2790
- n.includes(r) || (V(s.effect), i(this, $).delete(r));
2791
- });
2792
- this.anchor = t, g(this, Rt, n);
2793
- }
2794
- /**
2795
- *
2796
- * @param {any} key
2797
- * @param {null | ((target: TemplateNode) => void)} fn
2798
- */
2799
- ensure(t, n) {
2800
- var r = (
2801
- /** @type {Batch} */
2802
- v
2803
- ), s = ri();
2804
- if (n && !i(this, ce).has(t) && !i(this, $).has(t))
2805
- if (s) {
2806
- var a = document.createDocumentFragment(), f = le();
2807
- a.append(f), i(this, $).set(t, {
2808
- effect: ge(() => n(f)),
2809
- fragment: a
2810
- });
2811
- } else
2812
- i(this, ce).set(
2813
- t,
2814
- ge(() => n(this.anchor))
2815
- );
2816
- if (i(this, se).set(r, t), s) {
2817
- for (const [o, l] of i(this, ce))
2818
- o === t ? r.unskip_effect(l) : r.skip_effect(l);
2819
- for (const [o, l] of i(this, $))
2820
- o === t ? r.unskip_effect(l.effect) : r.skip_effect(l.effect);
2821
- r.oncommit(i(this, Ot)), r.ondiscard(i(this, Jt));
2822
- } else
2823
- R && (this.anchor = b), i(this, Ot).call(this, r);
2824
- }
2825
- }
2826
- se = new WeakMap(), ce = new WeakMap(), $ = new WeakMap(), Be = new WeakMap(), Rt = new WeakMap(), Ot = new WeakMap(), Jt = new WeakMap();
2827
- function qa(e, t, ...n) {
2828
- var r = new xi(e);
2829
- Lr(() => {
2830
- const s = t() ?? null;
2831
- r.ensure(s, s && ((a) => s(a, ...n)));
2832
- }, ft);
2833
- }
2834
- function Ri(e) {
2835
- return (t, ...n) => {
2836
- var l;
2837
- var r = e(...n), s;
2838
- if (R)
2839
- s = /** @type {Element} */
2840
- b, Sn();
2841
- else {
2842
- var a = r.render().trim(), f = Pn(a);
2843
- s = /** @type {Element} */
2844
- /* @__PURE__ */ W(f), t.before(s);
2845
- }
2846
- const o = (l = r.setup) == null ? void 0 : l.call(r, s);
2847
- Q(s, s), typeof o == "function" && Nn(o);
2848
- };
2849
- }
2850
- function Oi(e, t) {
2851
- var n;
2852
- if (er(), R) {
2853
- const r = (n = window.__svelte) == null ? void 0 : n.h;
2854
- if (r != null && r.has(e))
2855
- return (
2856
- /** @type {T} */
2857
- r.get(e)
2858
- );
2859
- Cs();
2860
- }
2861
- return t();
2862
- }
2863
- function Ci() {
2864
- return w === null && Es(), (w.ac ?? (w.ac = new AbortController())).signal;
2865
- }
2866
- function Jr(e) {
2867
- T === null && ct(), Nt && T.l !== null ? In(T).m.push(e) : fi(() => {
2868
- const t = an(e);
2869
- if (typeof t == "function") return (
2870
- /** @type {() => void} */
2871
- t
2872
- );
2873
- });
2874
- }
2875
- function Mi(e) {
2876
- T === null && ct(), Jr(() => () => an(e));
2877
- }
2878
- function Ni(e, t, { bubbles: n = !1, cancelable: r = !1 } = {}) {
2879
- return new CustomEvent(e, { detail: t, bubbles: n, cancelable: r });
2880
- }
2881
- function Di() {
2882
- const e = T;
2883
- return e === null && ct(), (t, n, r) => {
2884
- var a;
2885
- const s = (
2886
- /** @type {Record<string, Function | Function[]>} */
2887
- (a = e.s.$$events) == null ? void 0 : a[
2888
- /** @type {string} */
2889
- t
2890
- ]
2891
- );
2892
- if (s) {
2893
- const f = Xn(s) ? s.slice() : [s], o = Ni(
2894
- /** @type {string} */
2895
- t,
2896
- n,
2897
- r
2898
- );
2899
- for (const l of f)
2900
- l.call(e.x, o);
2901
- return !o.defaultPrevented;
2902
- }
2903
- return !0;
2904
- };
2905
- }
2906
- function Pi(e) {
2907
- T === null && ct(), T.l === null && tr(), In(T).b.push(e);
2908
- }
2909
- function Ii(e) {
2910
- T === null && ct(), T.l === null && tr(), In(T).a.push(e);
2911
- }
2912
- function In(e) {
2913
- var t = (
2914
- /** @type {ComponentContextLegacy} */
2915
- e.l
2916
- );
2917
- return t.u ?? (t.u = { a: [], b: [], m: [] });
2918
- }
2919
- const Ua = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2920
- __proto__: null,
2921
- afterUpdate: Ii,
2922
- beforeUpdate: Pi,
2923
- createContext: Is,
2924
- createEventDispatcher: Di,
2925
- createRawSnippet: Ri,
2926
- flushSync: Wt,
2927
- fork: $s,
2928
- getAbortSignal: Ci,
2929
- getAllContexts: Ls,
2930
- getContext: lr,
2931
- hasContext: ur,
2932
- hydratable: Oi,
2933
- hydrate: Si,
2934
- mount: Xr,
2935
- onDestroy: Mi,
2936
- onMount: Jr,
2937
- setContext: or,
2938
- settled: gi,
2939
- tick: pi,
2940
- unmount: Ai,
2941
- untrack: an
2942
- }, Symbol.toStringTag, { value: "Module" }));
2943
- export {
2944
- qn as $,
2945
- la as A,
2946
- de as B,
2947
- cs as C,
2948
- he as D,
2949
- Zi as E,
2950
- Ht as F,
2951
- ns as G,
2952
- ir as H,
2953
- Z as I,
2954
- Q as J,
2955
- ya as K,
2956
- qi as L,
2957
- Lr as M,
2958
- Rs as N,
2959
- ge as O,
2960
- sa as P,
2961
- Ca as Q,
2962
- ga as R,
2963
- Ue as S,
2964
- Dr as T,
2965
- C as U,
2966
- Va as V,
2967
- T as W,
2968
- Ws as X,
2969
- si as Y,
2970
- Kr as Z,
2971
- le as _,
2972
- us as a,
2973
- ls as a$,
2974
- v as a0,
2975
- Ra as a1,
2976
- La as a2,
2977
- Ia as a3,
2978
- On as a4,
2979
- Qs as a5,
2980
- V as a6,
2981
- Gi as a7,
2982
- Sa as a8,
2983
- ka as a9,
2984
- Fi as aA,
2985
- Na as aB,
2986
- Nt as aC,
2987
- ba as aD,
2988
- xa as aE,
2989
- Yr as aF,
2990
- _a as aG,
2991
- Ns as aH,
2992
- fs as aI,
2993
- Ma as aJ,
2994
- is as aK,
2995
- Da as aL,
2996
- Mi as aM,
2997
- Jr as aN,
2998
- wt as aO,
2999
- js as aP,
3000
- Ki as aQ,
3001
- _t as aR,
3002
- Fs as aS,
3003
- Me as aT,
3004
- ca as aU,
3005
- hi as aV,
3006
- Ea as aW,
3007
- ui as aX,
3008
- ua as aY,
3009
- di as aZ,
3010
- ji as a_,
3011
- ha as aa,
3012
- Pa as ab,
3013
- Yi as ac,
3014
- Hi as ad,
3015
- ma as ae,
3016
- Xs as af,
3017
- Fa as ag,
3018
- ja as ah,
3019
- Oe as ai,
3020
- lr as aj,
3021
- vt as ak,
3022
- ss as al,
3023
- W as am,
3024
- be as an,
3025
- Zn as ao,
3026
- ur as ap,
3027
- Sn as aq,
3028
- b as ar,
3029
- R as as,
3030
- tn as at,
3031
- Ua as au,
3032
- Gt as av,
3033
- pa as aw,
3034
- Xn as ax,
3035
- Oa as ay,
3036
- Ne as az,
3037
- xi as b,
3038
- Ps as b0,
3039
- oa as b1,
3040
- ke as b2,
3041
- or as b3,
3042
- pe as b4,
3043
- fe as b5,
3044
- Lt as b6,
3045
- Ba as b7,
3046
- ri as b8,
3047
- wa as b9,
3048
- Ds as ba,
3049
- qa as bb,
3050
- Pt as bc,
3051
- Te as bd,
3052
- Nn as be,
3053
- Aa as bf,
3054
- Ha as bg,
3055
- pi as bh,
3056
- Vi as bi,
3057
- an as bj,
3058
- va as bk,
3059
- da as bl,
3060
- fi as bm,
3061
- Ta as bn,
3062
- en as c,
3063
- jn as d,
3064
- Qi as e,
3065
- Ji as f,
3066
- ea as g,
3067
- Xi as h,
3068
- Bi as i,
3069
- ft as j,
3070
- zi as k,
3071
- lt as l,
3072
- rr as m,
3073
- sr as n,
3074
- Wi as o,
3075
- Ui as p,
3076
- fa as q,
3077
- aa as r,
3078
- ta as s,
3079
- ia as t,
3080
- na as u,
3081
- ra as v,
3082
- hs as w,
3083
- y as x,
3084
- ii as y,
3085
- Ya as z
3086
- };
3087
- //# sourceMappingURL=index-client-ItCEU64C.js.map