@papu1337/builder 0.0.3

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 (81) hide show
  1. package/README.md +65 -0
  2. package/dist/elements/auth/authElement.svelte +115 -0
  3. package/dist/elements/auth/authElement.svelte.d.ts +7 -0
  4. package/dist/elements/auth/settings.d.ts +25 -0
  5. package/dist/elements/auth/settings.js +63 -0
  6. package/dist/elements/badge/badgeElement.svelte +48 -0
  7. package/dist/elements/badge/badgeElement.svelte.d.ts +7 -0
  8. package/dist/elements/badge/settings.d.ts +13 -0
  9. package/dist/elements/badge/settings.js +57 -0
  10. package/dist/elements/banner/bannerElement.svelte +46 -0
  11. package/dist/elements/banner/bannerElement.svelte.d.ts +7 -0
  12. package/dist/elements/banner/settings.d.ts +6 -0
  13. package/dist/elements/banner/settings.js +15 -0
  14. package/dist/elements/button/buttonElement.svelte +42 -0
  15. package/dist/elements/button/buttonElement.svelte.d.ts +7 -0
  16. package/dist/elements/button/settings.d.ts +16 -0
  17. package/dist/elements/button/settings.js +43 -0
  18. package/dist/elements/cards/cardsElement.svelte +136 -0
  19. package/dist/elements/cards/cardsElement.svelte.d.ts +7 -0
  20. package/dist/elements/cards/settings.d.ts +14 -0
  21. package/dist/elements/cards/settings.js +52 -0
  22. package/dist/elements/divider/dividerElement.svelte +34 -0
  23. package/dist/elements/divider/dividerElement.svelte.d.ts +7 -0
  24. package/dist/elements/divider/settings.d.ts +7 -0
  25. package/dist/elements/divider/settings.js +15 -0
  26. package/dist/elements/globalSettings.d.ts +8 -0
  27. package/dist/elements/globalSettings.js +39 -0
  28. package/dist/elements/products/productsElement.svelte +283 -0
  29. package/dist/elements/products/productsElement.svelte.d.ts +7 -0
  30. package/dist/elements/products/settings.d.ts +16 -0
  31. package/dist/elements/products/settings.js +56 -0
  32. package/dist/elements/terms/settings.d.ts +11 -0
  33. package/dist/elements/terms/settings.js +39 -0
  34. package/dist/elements/terms/termsElement.svelte +124 -0
  35. package/dist/elements/terms/termsElement.svelte.d.ts +7 -0
  36. package/dist/elements/text/settings.d.ts +11 -0
  37. package/dist/elements/text/settings.js +12 -0
  38. package/dist/elements/text/textElement.svelte +33 -0
  39. package/dist/elements/text/textElement.svelte.d.ts +7 -0
  40. package/dist/index.d.ts +3 -0
  41. package/dist/index.js +3 -0
  42. package/dist/renderer/BuilderRenderer.svelte +38 -0
  43. package/dist/renderer/BuilderRenderer.svelte.d.ts +4 -0
  44. package/dist/renderer/index.d.ts +4 -0
  45. package/dist/renderer/index.js +3 -0
  46. package/dist/renderer/registry.d.ts +4 -0
  47. package/dist/renderer/registry.js +20 -0
  48. package/dist/renderer/renderer.vanilla.es.js +2835 -0
  49. package/dist/renderer/renderer.vanilla.umd.js +31 -0
  50. package/dist/renderer/resolve.d.ts +1 -0
  51. package/dist/renderer/resolve.js +30 -0
  52. package/dist/renderer/types.d.ts +19 -0
  53. package/dist/renderer/types.js +1 -0
  54. package/dist/renderer/vanilla.svelte.d.ts +2 -0
  55. package/dist/renderer/vanilla.svelte.js +28 -0
  56. package/dist/settings/base.svelte.d.ts +30 -0
  57. package/dist/settings/base.svelte.js +91 -0
  58. package/dist/settings/components/ColorSettings.svelte +141 -0
  59. package/dist/settings/components/ColorSettings.svelte.d.ts +4 -0
  60. package/dist/settings/components/ListSettings.svelte +167 -0
  61. package/dist/settings/components/ListSettings.svelte.d.ts +14 -0
  62. package/dist/settings/components/NumberSettings.svelte +67 -0
  63. package/dist/settings/components/NumberSettings.svelte.d.ts +5 -0
  64. package/dist/settings/components/SelectSettings.svelte +64 -0
  65. package/dist/settings/components/SelectSettings.svelte.d.ts +5 -0
  66. package/dist/settings/components/SettingsGroup.svelte +94 -0
  67. package/dist/settings/components/SettingsGroup.svelte.d.ts +9 -0
  68. package/dist/settings/components/TextSettings.svelte +8 -0
  69. package/dist/settings/components/TextSettings.svelte.d.ts +4 -0
  70. package/dist/settings/components/TranslatableSettings.svelte +208 -0
  71. package/dist/settings/components/TranslatableSettings.svelte.d.ts +8 -0
  72. package/dist/settings/components/UploadSettings.svelte +185 -0
  73. package/dist/settings/components/UploadSettings.svelte.d.ts +4 -0
  74. package/dist/settings/groups.d.ts +14 -0
  75. package/dist/settings/groups.js +35 -0
  76. package/dist/settings/implementation.svelte.js +41 -0
  77. package/dist/settings/index.d.ts +4 -0
  78. package/dist/settings/index.js +4 -0
  79. package/dist/settings/types.d.ts +51 -0
  80. package/dist/settings/types.js +1 -0
  81. package/package.json +86 -0
@@ -0,0 +1,2835 @@
1
+ const L = /* @__PURE__ */ Symbol(), $t = "http://www.w3.org/1999/xhtml", Zn = !1;
2
+ var en = Array.isArray, Qn = Array.prototype.indexOf, je = Array.prototype.includes, ot = Array.from, $n = Object.defineProperty, Xe = Object.getOwnPropertyDescriptor, er = Object.getOwnPropertyDescriptors, tr = Object.prototype, nr = Array.prototype, tn = Object.getPrototypeOf, Lt = Object.isExtensible;
3
+ const rr = () => {
4
+ };
5
+ function ir(e) {
6
+ for (var t = 0; t < e.length; t++)
7
+ e[t]();
8
+ }
9
+ function nn() {
10
+ var e, t, n = new Promise((r, i) => {
11
+ e = r, t = i;
12
+ });
13
+ return { promise: n, resolve: e, reject: t };
14
+ }
15
+ const j = 2, Le = 4, ft = 8, rn = 1 << 24, ke = 16, re = 32, Ne = 64, mt = 128, X = 512, F = 1024, q = 2048, oe = 4096, G = 8192, ne = 16384, Ie = 32768, Bt = 1 << 25, Re = 65536, qt = 1 << 17, sr = 1 << 18, Ue = 1 << 19, lr = 1 << 20, ae = 1 << 25, Oe = 65536, wt = 1 << 21, At = 1 << 22, we = 1 << 23, gt = /* @__PURE__ */ Symbol("$state"), ar = /* @__PURE__ */ Symbol(""), ve = new class extends Error {
16
+ name = "StaleReactionError";
17
+ message = "The reaction that called `getAbortSignal()` was re-run or destroyed";
18
+ }();
19
+ function or() {
20
+ throw new Error("https://svelte.dev/e/async_derived_orphan");
21
+ }
22
+ function fr(e, t, n) {
23
+ throw new Error("https://svelte.dev/e/each_key_duplicate");
24
+ }
25
+ function ur(e) {
26
+ throw new Error("https://svelte.dev/e/effect_in_teardown");
27
+ }
28
+ function cr() {
29
+ throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
30
+ }
31
+ function dr(e) {
32
+ throw new Error("https://svelte.dev/e/effect_orphan");
33
+ }
34
+ function vr() {
35
+ throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
36
+ }
37
+ function hr() {
38
+ throw new Error("https://svelte.dev/e/state_descriptors_fixed");
39
+ }
40
+ function pr() {
41
+ throw new Error("https://svelte.dev/e/state_prototype_fixed");
42
+ }
43
+ function gr() {
44
+ throw new Error("https://svelte.dev/e/state_unsafe_mutation");
45
+ }
46
+ function _r() {
47
+ throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror");
48
+ }
49
+ function xr() {
50
+ console.warn("https://svelte.dev/e/svelte_boundary_reset_noop");
51
+ }
52
+ function sn(e) {
53
+ return e === this.v;
54
+ }
55
+ function mr(e, t) {
56
+ return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function";
57
+ }
58
+ function ln(e) {
59
+ return !mr(e, this.v);
60
+ }
61
+ let wr = !1, Z = null;
62
+ function Be(e) {
63
+ Z = e;
64
+ }
65
+ function ie(e, t = !1, n) {
66
+ Z = {
67
+ p: Z,
68
+ i: !1,
69
+ c: null,
70
+ e: null,
71
+ s: e,
72
+ x: null,
73
+ r: (
74
+ /** @type {Effect} */
75
+ k
76
+ ),
77
+ l: null
78
+ };
79
+ }
80
+ function se(e) {
81
+ var t = (
82
+ /** @type {ComponentContext} */
83
+ Z
84
+ ), n = t.e;
85
+ if (n !== null) {
86
+ t.e = null;
87
+ for (var r of n)
88
+ Cn(r);
89
+ }
90
+ return t.i = !0, Z = t.p, /** @type {T} */
91
+ {};
92
+ }
93
+ function an() {
94
+ return !0;
95
+ }
96
+ let Fe = [];
97
+ function br() {
98
+ var e = Fe;
99
+ Fe = [], ir(e);
100
+ }
101
+ function Ce(e) {
102
+ if (Fe.length === 0) {
103
+ var t = Fe;
104
+ queueMicrotask(() => {
105
+ t === Fe && br();
106
+ });
107
+ }
108
+ Fe.push(e);
109
+ }
110
+ function on(e) {
111
+ var t = k;
112
+ if (t === null)
113
+ return b.f |= we, e;
114
+ if ((t.f & Ie) === 0 && (t.f & Le) === 0)
115
+ throw e;
116
+ me(e, t);
117
+ }
118
+ function me(e, t) {
119
+ for (; t !== null; ) {
120
+ if ((t.f & mt) !== 0) {
121
+ if ((t.f & Ie) === 0)
122
+ throw e;
123
+ try {
124
+ t.b.error(e);
125
+ return;
126
+ } catch (n) {
127
+ e = n;
128
+ }
129
+ }
130
+ t = t.parent;
131
+ }
132
+ throw e;
133
+ }
134
+ const yr = -7169;
135
+ function R(e, t) {
136
+ e.f = e.f & yr | t;
137
+ }
138
+ function Mt(e) {
139
+ (e.f & X) !== 0 || e.deps === null ? R(e, F) : R(e, oe);
140
+ }
141
+ function fn(e) {
142
+ if (e !== null)
143
+ for (const t of e)
144
+ (t.f & j) === 0 || (t.f & Oe) === 0 || (t.f ^= Oe, fn(
145
+ /** @type {Derived} */
146
+ t.deps
147
+ ));
148
+ }
149
+ function un(e, t, n) {
150
+ (e.f & q) !== 0 ? t.add(e) : (e.f & oe) !== 0 && n.add(e), fn(e.deps), R(e, F);
151
+ }
152
+ const _e = /* @__PURE__ */ new Set();
153
+ let S = null, ee = null, bt = null, _t = !1, Pe = null, rt = null;
154
+ var Ht = 0;
155
+ let Er = 1;
156
+ class Ee {
157
+ id = Er++;
158
+ /**
159
+ * The current values of any signals that are updated in this batch.
160
+ * Tuple format: [value, is_derived] (note: is_derived is false for deriveds, too, if they were overridden via assignment)
161
+ * They keys of this map are identical to `this.#previous`
162
+ * @type {Map<Value, [any, boolean]>}
163
+ */
164
+ current = /* @__PURE__ */ new Map();
165
+ /**
166
+ * The values of any signals (sources and deriveds) that are updated in this batch _before_ those updates took place.
167
+ * They keys of this map are identical to `this.#current`
168
+ * @type {Map<Value, any>}
169
+ */
170
+ previous = /* @__PURE__ */ new Map();
171
+ /**
172
+ * When the batch is committed (and the DOM is updated), we need to remove old branches
173
+ * and append new ones by calling the functions added inside (if/each/key/etc) blocks
174
+ * @type {Set<(batch: Batch) => void>}
175
+ */
176
+ #t = /* @__PURE__ */ new Set();
177
+ /**
178
+ * If a fork is discarded, we need to destroy any effects that are no longer needed
179
+ * @type {Set<(batch: Batch) => void>}
180
+ */
181
+ #o = /* @__PURE__ */ new Set();
182
+ /**
183
+ * Async effects that are currently in flight
184
+ * @type {Map<Effect, number>}
185
+ */
186
+ #e = /* @__PURE__ */ new Map();
187
+ /**
188
+ * Async effects that are currently in flight, _not_ inside a pending boundary
189
+ * @type {Map<Effect, number>}
190
+ */
191
+ #r = /* @__PURE__ */ new Map();
192
+ /**
193
+ * A deferred that resolves when the batch is committed, used with `settled()`
194
+ * TODO replace with Promise.withResolvers once supported widely enough
195
+ * @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
196
+ */
197
+ #i = null;
198
+ /**
199
+ * The root effects that need to be flushed
200
+ * @type {Effect[]}
201
+ */
202
+ #n = [];
203
+ /**
204
+ * Deferred effects (which run after async work has completed) that are DIRTY
205
+ * @type {Set<Effect>}
206
+ */
207
+ #s = /* @__PURE__ */ new Set();
208
+ /**
209
+ * Deferred effects that are MAYBE_DIRTY
210
+ * @type {Set<Effect>}
211
+ */
212
+ #l = /* @__PURE__ */ new Set();
213
+ /**
214
+ * A map of branches that still exist, but will be destroyed when this batch
215
+ * is committed — we skip over these during `process`.
216
+ * The value contains child effects that were dirty/maybe_dirty before being reset,
217
+ * so they can be rescheduled if the branch survives.
218
+ * @type {Map<Effect, { d: Effect[], m: Effect[] }>}
219
+ */
220
+ #a = /* @__PURE__ */ new Map();
221
+ is_fork = !1;
222
+ #c = !1;
223
+ /** @type {Set<Batch>} */
224
+ #f = /* @__PURE__ */ new Set();
225
+ #d() {
226
+ return this.is_fork || this.#r.size > 0;
227
+ }
228
+ #h() {
229
+ for (const r of this.#f)
230
+ for (const i of r.#r.keys()) {
231
+ for (var t = !1, n = i; n.parent !== null; ) {
232
+ if (this.#a.has(n)) {
233
+ t = !0;
234
+ break;
235
+ }
236
+ n = n.parent;
237
+ }
238
+ if (!t)
239
+ return !0;
240
+ }
241
+ return !1;
242
+ }
243
+ /**
244
+ * Add an effect to the #skipped_branches map and reset its children
245
+ * @param {Effect} effect
246
+ */
247
+ skip_effect(t) {
248
+ this.#a.has(t) || this.#a.set(t, { d: [], m: [] });
249
+ }
250
+ /**
251
+ * Remove an effect from the #skipped_branches map and reschedule
252
+ * any tracked dirty/maybe_dirty child effects
253
+ * @param {Effect} effect
254
+ */
255
+ unskip_effect(t) {
256
+ var n = this.#a.get(t);
257
+ if (n) {
258
+ this.#a.delete(t);
259
+ for (var r of n.d)
260
+ R(r, q), this.schedule(r);
261
+ for (r of n.m)
262
+ R(r, oe), this.schedule(r);
263
+ }
264
+ }
265
+ #v() {
266
+ if (Ht++ > 1e3 && (_e.delete(this), kr()), !this.#d()) {
267
+ for (const a of this.#s)
268
+ this.#l.delete(a), R(a, q), this.schedule(a);
269
+ for (const a of this.#l)
270
+ R(a, oe), this.schedule(a);
271
+ }
272
+ const t = this.#n;
273
+ this.#n = [], this.apply();
274
+ var n = Pe = [], r = [], i = rt = [];
275
+ for (const a of t)
276
+ try {
277
+ this.#u(a, n, r);
278
+ } catch (l) {
279
+ throw hn(a), l;
280
+ }
281
+ if (S = null, i.length > 0) {
282
+ var s = Ee.ensure();
283
+ for (const a of i)
284
+ s.schedule(a);
285
+ }
286
+ if (Pe = null, rt = null, this.#d() || this.#h()) {
287
+ this.#p(r), this.#p(n);
288
+ for (const [a, l] of this.#a)
289
+ vn(a, l);
290
+ } else {
291
+ this.#e.size === 0 && _e.delete(this), this.#s.clear(), this.#l.clear();
292
+ for (const a of this.#t) a(this);
293
+ this.#t.clear(), Ut(r), Ut(n), this.#i?.resolve();
294
+ }
295
+ var o = (
296
+ /** @type {Batch | null} */
297
+ /** @type {unknown} */
298
+ S
299
+ );
300
+ if (this.#n.length > 0) {
301
+ const a = o ??= this;
302
+ a.#n.push(...this.#n.filter((l) => !a.#n.includes(l)));
303
+ }
304
+ o !== null && (_e.add(o), o.#v()), _e.has(this) || this.#x();
305
+ }
306
+ /**
307
+ * Traverse the effect tree, executing effects or stashing
308
+ * them for later execution as appropriate
309
+ * @param {Effect} root
310
+ * @param {Effect[]} effects
311
+ * @param {Effect[]} render_effects
312
+ */
313
+ #u(t, n, r) {
314
+ t.f ^= F;
315
+ for (var i = t.first; i !== null; ) {
316
+ var s = i.f, o = (s & (re | Ne)) !== 0, a = o && (s & F) !== 0, l = a || (s & G) !== 0 || this.#a.has(i);
317
+ if (!l && i.fn !== null) {
318
+ o ? i.f ^= F : (s & Le) !== 0 ? n.push(i) : tt(i) && ((s & ke) !== 0 && this.#l.add(i), He(i));
319
+ var f = i.first;
320
+ if (f !== null) {
321
+ i = f;
322
+ continue;
323
+ }
324
+ }
325
+ for (; i !== null; ) {
326
+ var u = i.next;
327
+ if (u !== null) {
328
+ i = u;
329
+ break;
330
+ }
331
+ i = i.parent;
332
+ }
333
+ }
334
+ }
335
+ /**
336
+ * @param {Effect[]} effects
337
+ */
338
+ #p(t) {
339
+ for (var n = 0; n < t.length; n += 1)
340
+ un(t[n], this.#s, this.#l);
341
+ }
342
+ /**
343
+ * Associate a change to a given source with the current
344
+ * batch, noting its previous and current values
345
+ * @param {Value} source
346
+ * @param {any} old_value
347
+ * @param {boolean} [is_derived]
348
+ */
349
+ capture(t, n, r = !1) {
350
+ n !== L && !this.previous.has(t) && this.previous.set(t, n), (t.f & we) === 0 && (this.current.set(t, [t.v, r]), ee?.set(t, t.v));
351
+ }
352
+ activate() {
353
+ S = this;
354
+ }
355
+ deactivate() {
356
+ S = null, ee = null;
357
+ }
358
+ flush() {
359
+ try {
360
+ _t = !0, S = this, this.#v();
361
+ } finally {
362
+ Ht = 0, bt = null, Pe = null, rt = null, _t = !1, S = null, ee = null, be.clear();
363
+ }
364
+ }
365
+ discard() {
366
+ for (const t of this.#o) t(this);
367
+ this.#o.clear(), _e.delete(this);
368
+ }
369
+ #x() {
370
+ for (const f of _e) {
371
+ var t = f.id < this.id, n = [];
372
+ for (const [u, [h, d]] of this.current) {
373
+ if (f.current.has(u)) {
374
+ var r = (
375
+ /** @type {[any, boolean]} */
376
+ f.current.get(u)[0]
377
+ );
378
+ if (t && h !== r)
379
+ f.current.set(u, [h, d]);
380
+ else
381
+ continue;
382
+ }
383
+ n.push(u);
384
+ }
385
+ var i = [...f.current.keys()].filter((u) => !this.current.has(u));
386
+ if (i.length === 0)
387
+ t && f.discard();
388
+ else if (n.length > 0) {
389
+ f.activate();
390
+ var s = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
391
+ for (var a of n)
392
+ cn(a, i, s, o);
393
+ if (f.#n.length > 0) {
394
+ f.apply();
395
+ for (var l of f.#n)
396
+ f.#u(l, [], []);
397
+ f.#n = [];
398
+ }
399
+ f.deactivate();
400
+ }
401
+ }
402
+ for (const f of _e)
403
+ f.#f.has(this) && (f.#f.delete(this), f.#f.size === 0 && !f.#d() && (f.activate(), f.#v()));
404
+ }
405
+ /**
406
+ * @param {boolean} blocking
407
+ * @param {Effect} effect
408
+ */
409
+ increment(t, n) {
410
+ let r = this.#e.get(n) ?? 0;
411
+ if (this.#e.set(n, r + 1), t) {
412
+ let i = this.#r.get(n) ?? 0;
413
+ this.#r.set(n, i + 1);
414
+ }
415
+ }
416
+ /**
417
+ * @param {boolean} blocking
418
+ * @param {Effect} effect
419
+ * @param {boolean} skip - whether to skip updates (because this is triggered by a stale reaction)
420
+ */
421
+ decrement(t, n, r) {
422
+ let i = this.#e.get(n) ?? 0;
423
+ if (i === 1 ? this.#e.delete(n) : this.#e.set(n, i - 1), t) {
424
+ let s = this.#r.get(n) ?? 0;
425
+ s === 1 ? this.#r.delete(n) : this.#r.set(n, s - 1);
426
+ }
427
+ this.#c || r || (this.#c = !0, Ce(() => {
428
+ this.#c = !1, this.flush();
429
+ }));
430
+ }
431
+ /**
432
+ * @param {Set<Effect>} dirty_effects
433
+ * @param {Set<Effect>} maybe_dirty_effects
434
+ */
435
+ transfer_effects(t, n) {
436
+ for (const r of t)
437
+ this.#s.add(r);
438
+ for (const r of n)
439
+ this.#l.add(r);
440
+ t.clear(), n.clear();
441
+ }
442
+ /** @param {(batch: Batch) => void} fn */
443
+ oncommit(t) {
444
+ this.#t.add(t);
445
+ }
446
+ /** @param {(batch: Batch) => void} fn */
447
+ ondiscard(t) {
448
+ this.#o.add(t);
449
+ }
450
+ settled() {
451
+ return (this.#i ??= nn()).promise;
452
+ }
453
+ static ensure() {
454
+ if (S === null) {
455
+ const t = S = new Ee();
456
+ _t || (_e.add(S), Ce(() => {
457
+ S === t && t.flush();
458
+ }));
459
+ }
460
+ return S;
461
+ }
462
+ apply() {
463
+ {
464
+ ee = null;
465
+ return;
466
+ }
467
+ }
468
+ /**
469
+ *
470
+ * @param {Effect} effect
471
+ */
472
+ schedule(t) {
473
+ if (bt = t, t.b?.is_pending && (t.f & (Le | ft | rn)) !== 0 && (t.f & Ie) === 0) {
474
+ t.b.defer_effect(t);
475
+ return;
476
+ }
477
+ for (var n = t; n.parent !== null; ) {
478
+ n = n.parent;
479
+ var r = n.f;
480
+ if (Pe !== null && n === k && (b === null || (b.f & j) === 0))
481
+ return;
482
+ if ((r & (Ne | re)) !== 0) {
483
+ if ((r & F) === 0)
484
+ return;
485
+ n.f ^= F;
486
+ }
487
+ }
488
+ this.#n.push(n);
489
+ }
490
+ }
491
+ function kr() {
492
+ try {
493
+ vr();
494
+ } catch (e) {
495
+ me(e, bt);
496
+ }
497
+ }
498
+ let de = null;
499
+ function Ut(e) {
500
+ var t = e.length;
501
+ if (t !== 0) {
502
+ for (var n = 0; n < t; ) {
503
+ var r = e[n++];
504
+ if ((r.f & (ne | G)) === 0 && tt(r) && (de = /* @__PURE__ */ new Set(), He(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && An(r), de?.size > 0)) {
505
+ be.clear();
506
+ for (const i of de) {
507
+ if ((i.f & (ne | G)) !== 0) continue;
508
+ const s = [i];
509
+ let o = i.parent;
510
+ for (; o !== null; )
511
+ de.has(o) && (de.delete(o), s.push(o)), o = o.parent;
512
+ for (let a = s.length - 1; a >= 0; a--) {
513
+ const l = s[a];
514
+ (l.f & (ne | G)) === 0 && He(l);
515
+ }
516
+ }
517
+ de.clear();
518
+ }
519
+ }
520
+ de = null;
521
+ }
522
+ }
523
+ function cn(e, t, n, r) {
524
+ if (!n.has(e) && (n.add(e), e.reactions !== null))
525
+ for (const i of e.reactions) {
526
+ const s = i.f;
527
+ (s & j) !== 0 ? cn(
528
+ /** @type {Derived} */
529
+ i,
530
+ t,
531
+ n,
532
+ r
533
+ ) : (s & (At | ke)) !== 0 && (s & q) === 0 && dn(i, t, r) && (R(i, q), Nt(
534
+ /** @type {Effect} */
535
+ i
536
+ ));
537
+ }
538
+ }
539
+ function dn(e, t, n) {
540
+ const r = n.get(e);
541
+ if (r !== void 0) return r;
542
+ if (e.deps !== null)
543
+ for (const i of e.deps) {
544
+ if (je.call(t, i))
545
+ return !0;
546
+ if ((i.f & j) !== 0 && dn(
547
+ /** @type {Derived} */
548
+ i,
549
+ t,
550
+ n
551
+ ))
552
+ return n.set(
553
+ /** @type {Derived} */
554
+ i,
555
+ !0
556
+ ), !0;
557
+ }
558
+ return n.set(e, !1), !1;
559
+ }
560
+ function Nt(e) {
561
+ S.schedule(e);
562
+ }
563
+ function vn(e, t) {
564
+ if (!((e.f & re) !== 0 && (e.f & F) !== 0)) {
565
+ (e.f & q) !== 0 ? t.d.push(e) : (e.f & oe) !== 0 && t.m.push(e), R(e, F);
566
+ for (var n = e.first; n !== null; )
567
+ vn(n, t), n = n.next;
568
+ }
569
+ }
570
+ function hn(e) {
571
+ R(e, F);
572
+ for (var t = e.first; t !== null; )
573
+ hn(t), t = t.next;
574
+ }
575
+ function Tr(e) {
576
+ let t = 0, n = De(0), r;
577
+ return () => {
578
+ zt() && (_(n), Kr(() => (t === 0 && (r = Qr(() => e(() => Ze(n)))), t += 1, () => {
579
+ Ce(() => {
580
+ t -= 1, t === 0 && (r?.(), r = void 0, Ze(n));
581
+ });
582
+ })));
583
+ };
584
+ }
585
+ var Cr = Re | Ue;
586
+ function Sr(e, t, n, r) {
587
+ new Ar(e, t, n, r);
588
+ }
589
+ class Ar {
590
+ /** @type {Boundary | null} */
591
+ parent;
592
+ is_pending = !1;
593
+ /**
594
+ * API-level transformError transform function. Transforms errors before they reach the `failed` snippet.
595
+ * Inherited from parent boundary, or defaults to identity.
596
+ * @type {(error: unknown) => unknown}
597
+ */
598
+ transform_error;
599
+ /** @type {TemplateNode} */
600
+ #t;
601
+ /** @type {TemplateNode | null} */
602
+ #o = null;
603
+ /** @type {BoundaryProps} */
604
+ #e;
605
+ /** @type {((anchor: Node) => void)} */
606
+ #r;
607
+ /** @type {Effect} */
608
+ #i;
609
+ /** @type {Effect | null} */
610
+ #n = null;
611
+ /** @type {Effect | null} */
612
+ #s = null;
613
+ /** @type {Effect | null} */
614
+ #l = null;
615
+ /** @type {DocumentFragment | null} */
616
+ #a = null;
617
+ #c = 0;
618
+ #f = 0;
619
+ #d = !1;
620
+ /** @type {Set<Effect>} */
621
+ #h = /* @__PURE__ */ new Set();
622
+ /** @type {Set<Effect>} */
623
+ #v = /* @__PURE__ */ new Set();
624
+ /**
625
+ * A source containing the number of pending async deriveds/expressions.
626
+ * Only created if `$effect.pending()` is used inside the boundary,
627
+ * otherwise updating the source results in needless `Batch.ensure()`
628
+ * calls followed by no-op flushes
629
+ * @type {Source<number> | null}
630
+ */
631
+ #u = null;
632
+ #p = Tr(() => (this.#u = De(this.#c), () => {
633
+ this.#u = null;
634
+ }));
635
+ /**
636
+ * @param {TemplateNode} node
637
+ * @param {BoundaryProps} props
638
+ * @param {((anchor: Node) => void)} children
639
+ * @param {((error: unknown) => unknown) | undefined} [transform_error]
640
+ */
641
+ constructor(t, n, r, i) {
642
+ this.#t = t, this.#e = n, this.#r = (s) => {
643
+ var o = (
644
+ /** @type {Effect} */
645
+ k
646
+ );
647
+ o.b = this, o.f |= mt, r(s);
648
+ }, this.parent = /** @type {Effect} */
649
+ k.b, this.transform_error = i ?? this.parent?.transform_error ?? ((s) => s), this.#i = ut(() => {
650
+ this.#m();
651
+ }, Cr);
652
+ }
653
+ #x() {
654
+ try {
655
+ this.#n = W(() => this.#r(this.#t));
656
+ } catch (t) {
657
+ this.error(t);
658
+ }
659
+ }
660
+ /**
661
+ * @param {unknown} error The deserialized error from the server's hydration comment
662
+ */
663
+ #b(t) {
664
+ const n = this.#e.failed;
665
+ n && (this.#l = W(() => {
666
+ n(
667
+ this.#t,
668
+ () => t,
669
+ () => () => {
670
+ }
671
+ );
672
+ }));
673
+ }
674
+ #y() {
675
+ const t = this.#e.pending;
676
+ t && (this.is_pending = !0, this.#s = W(() => t(this.#t)), Ce(() => {
677
+ var n = this.#a = document.createDocumentFragment(), r = ye();
678
+ n.append(r), this.#n = this.#_(() => W(() => this.#r(r))), this.#f === 0 && (this.#t.before(n), this.#a = null, Se(
679
+ /** @type {Effect} */
680
+ this.#s,
681
+ () => {
682
+ this.#s = null;
683
+ }
684
+ ), this.#g(
685
+ /** @type {Batch} */
686
+ S
687
+ ));
688
+ }));
689
+ }
690
+ #m() {
691
+ try {
692
+ if (this.is_pending = this.has_pending_snippet(), this.#f = 0, this.#c = 0, this.#n = W(() => {
693
+ this.#r(this.#t);
694
+ }), this.#f > 0) {
695
+ var t = this.#a = document.createDocumentFragment();
696
+ Pt(this.#n, t);
697
+ const n = (
698
+ /** @type {(anchor: Node) => void} */
699
+ this.#e.pending
700
+ );
701
+ this.#s = W(() => n(this.#t));
702
+ } else
703
+ this.#g(
704
+ /** @type {Batch} */
705
+ S
706
+ );
707
+ } catch (n) {
708
+ this.error(n);
709
+ }
710
+ }
711
+ /**
712
+ * @param {Batch} batch
713
+ */
714
+ #g(t) {
715
+ this.is_pending = !1, t.transfer_effects(this.#h, this.#v);
716
+ }
717
+ /**
718
+ * Defer an effect inside a pending boundary until the boundary resolves
719
+ * @param {Effect} effect
720
+ */
721
+ defer_effect(t) {
722
+ un(t, this.#h, this.#v);
723
+ }
724
+ /**
725
+ * Returns `false` if the effect exists inside a boundary whose pending snippet is shown
726
+ * @returns {boolean}
727
+ */
728
+ is_rendered() {
729
+ return !this.is_pending && (!this.parent || this.parent.is_rendered());
730
+ }
731
+ has_pending_snippet() {
732
+ return !!this.#e.pending;
733
+ }
734
+ /**
735
+ * @template T
736
+ * @param {() => T} fn
737
+ */
738
+ #_(t) {
739
+ var n = k, r = b, i = Z;
740
+ fe(this.#i), Q(this.#i), Be(this.#i.ctx);
741
+ try {
742
+ return Ee.ensure(), t();
743
+ } catch (s) {
744
+ return on(s), null;
745
+ } finally {
746
+ fe(n), Q(r), Be(i);
747
+ }
748
+ }
749
+ /**
750
+ * Updates the pending count associated with the currently visible pending snippet,
751
+ * if any, such that we can replace the snippet with content once work is done
752
+ * @param {1 | -1} d
753
+ * @param {Batch} batch
754
+ */
755
+ #w(t, n) {
756
+ if (!this.has_pending_snippet()) {
757
+ this.parent && this.parent.#w(t, n);
758
+ return;
759
+ }
760
+ this.#f += t, this.#f === 0 && (this.#g(n), this.#s && Se(this.#s, () => {
761
+ this.#s = null;
762
+ }), this.#a && (this.#t.before(this.#a), this.#a = null));
763
+ }
764
+ /**
765
+ * Update the source that powers `$effect.pending()` inside this boundary,
766
+ * and controls when the current `pending` snippet (if any) is removed.
767
+ * Do not call from inside the class
768
+ * @param {1 | -1} d
769
+ * @param {Batch} batch
770
+ */
771
+ update_pending_count(t, n) {
772
+ this.#w(t, n), this.#c += t, !(!this.#u || this.#d) && (this.#d = !0, Ce(() => {
773
+ this.#d = !1, this.#u && qe(this.#u, this.#c);
774
+ }));
775
+ }
776
+ get_effect_pending() {
777
+ return this.#p(), _(
778
+ /** @type {Source<number>} */
779
+ this.#u
780
+ );
781
+ }
782
+ /** @param {unknown} error */
783
+ error(t) {
784
+ var n = this.#e.onerror;
785
+ let r = this.#e.failed;
786
+ if (!n && !r)
787
+ throw t;
788
+ this.#n && (V(this.#n), this.#n = null), this.#s && (V(this.#s), this.#s = null), this.#l && (V(this.#l), this.#l = null);
789
+ var i = !1, s = !1;
790
+ const o = () => {
791
+ if (i) {
792
+ xr();
793
+ return;
794
+ }
795
+ i = !0, s && _r(), this.#l !== null && Se(this.#l, () => {
796
+ this.#l = null;
797
+ }), this.#_(() => {
798
+ this.#m();
799
+ });
800
+ }, a = (l) => {
801
+ try {
802
+ s = !0, n?.(l, o), s = !1;
803
+ } catch (f) {
804
+ me(f, this.#i && this.#i.parent);
805
+ }
806
+ r && (this.#l = this.#_(() => {
807
+ try {
808
+ return W(() => {
809
+ var f = (
810
+ /** @type {Effect} */
811
+ k
812
+ );
813
+ f.b = this, f.f |= mt, r(
814
+ this.#t,
815
+ () => l,
816
+ () => o
817
+ );
818
+ });
819
+ } catch (f) {
820
+ return me(
821
+ f,
822
+ /** @type {Effect} */
823
+ this.#i.parent
824
+ ), null;
825
+ }
826
+ }));
827
+ };
828
+ Ce(() => {
829
+ var l;
830
+ try {
831
+ l = this.transform_error(t);
832
+ } catch (f) {
833
+ me(f, this.#i && this.#i.parent);
834
+ return;
835
+ }
836
+ l !== null && typeof l == "object" && typeof /** @type {any} */
837
+ l.then == "function" ? l.then(
838
+ a,
839
+ /** @param {unknown} e */
840
+ (f) => me(f, this.#i && this.#i.parent)
841
+ ) : a(l);
842
+ });
843
+ }
844
+ }
845
+ function Mr(e, t, n, r) {
846
+ const i = Rt;
847
+ var s = e.filter((d) => !d.settled);
848
+ if (n.length === 0 && s.length === 0) {
849
+ r(t.map(i));
850
+ return;
851
+ }
852
+ var o = (
853
+ /** @type {Effect} */
854
+ k
855
+ ), a = Nr(), l = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((d) => d.promise)) : null;
856
+ function f(d) {
857
+ a();
858
+ try {
859
+ r(d);
860
+ } catch (g) {
861
+ (o.f & ne) === 0 && me(g, o);
862
+ }
863
+ st();
864
+ }
865
+ if (n.length === 0) {
866
+ l.then(() => f(t.map(i)));
867
+ return;
868
+ }
869
+ var u = pn();
870
+ function h() {
871
+ Promise.all(n.map((d) => /* @__PURE__ */ Rr(d))).then((d) => f([...t.map(i), ...d])).catch((d) => me(d, o)).finally(() => u());
872
+ }
873
+ l ? l.then(() => {
874
+ a(), h(), st();
875
+ }) : h();
876
+ }
877
+ function Nr() {
878
+ var e = (
879
+ /** @type {Effect} */
880
+ k
881
+ ), t = b, n = Z, r = (
882
+ /** @type {Batch} */
883
+ S
884
+ );
885
+ return function(s = !0) {
886
+ fe(e), Q(t), Be(n), s && (e.f & ne) === 0 && (r?.activate(), r?.apply());
887
+ };
888
+ }
889
+ function st(e = !0) {
890
+ fe(null), Q(null), Be(null), e && S?.deactivate();
891
+ }
892
+ function pn() {
893
+ var e = (
894
+ /** @type {Effect} */
895
+ k
896
+ ), t = (
897
+ /** @type {Boundary} */
898
+ e.b
899
+ ), n = (
900
+ /** @type {Batch} */
901
+ S
902
+ ), r = t.is_rendered();
903
+ return t.update_pending_count(1, n), n.increment(r, e), (i = !1) => {
904
+ t.update_pending_count(-1, n), n.decrement(r, e, i);
905
+ };
906
+ }
907
+ // @__NO_SIDE_EFFECTS__
908
+ function Rt(e) {
909
+ var t = j | q, n = b !== null && (b.f & j) !== 0 ? (
910
+ /** @type {Derived} */
911
+ b
912
+ ) : null;
913
+ return k !== null && (k.f |= Ue), {
914
+ ctx: Z,
915
+ deps: null,
916
+ effects: null,
917
+ equals: sn,
918
+ f: t,
919
+ fn: e,
920
+ reactions: null,
921
+ rv: 0,
922
+ v: (
923
+ /** @type {V} */
924
+ L
925
+ ),
926
+ wv: 0,
927
+ parent: n ?? k,
928
+ ac: null
929
+ };
930
+ }
931
+ // @__NO_SIDE_EFFECTS__
932
+ function Rr(e, t, n) {
933
+ let r = (
934
+ /** @type {Effect | null} */
935
+ k
936
+ );
937
+ r === null && or();
938
+ var i = (
939
+ /** @type {Promise<V>} */
940
+ /** @type {unknown} */
941
+ void 0
942
+ ), s = De(
943
+ /** @type {V} */
944
+ L
945
+ ), o = !b, a = /* @__PURE__ */ new Map();
946
+ return Gr(() => {
947
+ var l = (
948
+ /** @type {Effect} */
949
+ k
950
+ ), f = nn();
951
+ i = f.promise;
952
+ try {
953
+ Promise.resolve(e()).then(f.resolve, f.reject).finally(st);
954
+ } catch (g) {
955
+ f.reject(g), st();
956
+ }
957
+ var u = (
958
+ /** @type {Batch} */
959
+ S
960
+ );
961
+ if (o) {
962
+ if ((l.f & Ie) !== 0)
963
+ var h = pn();
964
+ if (
965
+ /** @type {Boundary} */
966
+ r.b.is_rendered()
967
+ )
968
+ a.get(u)?.reject(ve), a.delete(u);
969
+ else {
970
+ for (const g of a.values())
971
+ g.reject(ve);
972
+ a.clear();
973
+ }
974
+ a.set(u, f);
975
+ }
976
+ const d = (g, p = void 0) => {
977
+ if (h) {
978
+ var w = p === ve;
979
+ h(w);
980
+ }
981
+ if (!(p === ve || (l.f & ne) !== 0)) {
982
+ if (u.activate(), p)
983
+ s.f |= we, qe(s, p);
984
+ else {
985
+ (s.f & we) !== 0 && (s.f ^= we), qe(s, g);
986
+ for (const [c, v] of a) {
987
+ if (a.delete(c), c === u) break;
988
+ v.reject(ve);
989
+ }
990
+ }
991
+ u.deactivate();
992
+ }
993
+ };
994
+ f.promise.then(d, (g) => d(null, g || "unknown"));
995
+ }), Hr(() => {
996
+ for (const l of a.values())
997
+ l.reject(ve);
998
+ }), new Promise((l) => {
999
+ function f(u) {
1000
+ function h() {
1001
+ u === i ? l(s) : f(i);
1002
+ }
1003
+ u.then(h, h);
1004
+ }
1005
+ f(i);
1006
+ });
1007
+ }
1008
+ // @__NO_SIDE_EFFECTS__
1009
+ function Je(e) {
1010
+ const t = /* @__PURE__ */ Rt(e);
1011
+ return Rn(t), t;
1012
+ }
1013
+ // @__NO_SIDE_EFFECTS__
1014
+ function Or(e) {
1015
+ const t = /* @__PURE__ */ Rt(e);
1016
+ return t.equals = ln, t;
1017
+ }
1018
+ function Dr(e) {
1019
+ var t = e.effects;
1020
+ if (t !== null) {
1021
+ e.effects = null;
1022
+ for (var n = 0; n < t.length; n += 1)
1023
+ V(
1024
+ /** @type {Effect} */
1025
+ t[n]
1026
+ );
1027
+ }
1028
+ }
1029
+ function zr(e) {
1030
+ for (var t = e.parent; t !== null; ) {
1031
+ if ((t.f & j) === 0)
1032
+ return (t.f & ne) === 0 ? (
1033
+ /** @type {Effect} */
1034
+ t
1035
+ ) : null;
1036
+ t = t.parent;
1037
+ }
1038
+ return null;
1039
+ }
1040
+ function Ot(e) {
1041
+ var t, n = k;
1042
+ fe(zr(e));
1043
+ try {
1044
+ e.f &= ~Oe, Dr(e), t = In(e);
1045
+ } finally {
1046
+ fe(n);
1047
+ }
1048
+ return t;
1049
+ }
1050
+ function gn(e) {
1051
+ var t = e.v, n = Ot(e);
1052
+ if (!e.equals(n) && (e.wv = Dn(), (!S?.is_fork || e.deps === null) && (e.v = n, S?.capture(e, t, !0), e.deps === null))) {
1053
+ R(e, F);
1054
+ return;
1055
+ }
1056
+ ze || (ee !== null ? (zt() || S?.is_fork) && ee.set(e, n) : Mt(e));
1057
+ }
1058
+ function Ir(e) {
1059
+ if (e.effects !== null)
1060
+ for (const t of e.effects)
1061
+ (t.teardown || t.ac) && (t.teardown?.(), t.ac?.abort(ve), t.teardown = rr, t.ac = null, Qe(t, 0), It(t));
1062
+ }
1063
+ function _n(e) {
1064
+ if (e.effects !== null)
1065
+ for (const t of e.effects)
1066
+ t.teardown && He(t);
1067
+ }
1068
+ let yt = /* @__PURE__ */ new Set();
1069
+ const be = /* @__PURE__ */ new Map();
1070
+ let xn = !1;
1071
+ function De(e, t) {
1072
+ var n = {
1073
+ f: 0,
1074
+ // TODO ideally we could skip this altogether, but it causes type errors
1075
+ v: e,
1076
+ reactions: null,
1077
+ equals: sn,
1078
+ rv: 0,
1079
+ wv: 0
1080
+ };
1081
+ return n;
1082
+ }
1083
+ // @__NO_SIDE_EFFECTS__
1084
+ function H(e, t) {
1085
+ const n = De(e);
1086
+ return Rn(n), n;
1087
+ }
1088
+ // @__NO_SIDE_EFFECTS__
1089
+ function Fr(e, t = !1, n = !0) {
1090
+ const r = De(e);
1091
+ return t || (r.equals = ln), r;
1092
+ }
1093
+ function B(e, t, n = !1) {
1094
+ b !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
1095
+ // to ensure we error if state is set inside an inspect effect
1096
+ (!te || (b.f & qt) !== 0) && an() && (b.f & (j | ke | At | qt)) !== 0 && (J === null || !je.call(J, e)) && gr();
1097
+ let r = n ? he(t) : t;
1098
+ return qe(e, r, rt);
1099
+ }
1100
+ function qe(e, t, n = null) {
1101
+ if (!e.equals(t)) {
1102
+ var r = e.v;
1103
+ ze ? be.set(e, t) : be.set(e, r), e.v = t;
1104
+ var i = Ee.ensure();
1105
+ if (i.capture(e, r), (e.f & j) !== 0) {
1106
+ const s = (
1107
+ /** @type {Derived} */
1108
+ e
1109
+ );
1110
+ (e.f & q) !== 0 && Ot(s), ee === null && Mt(s);
1111
+ }
1112
+ e.wv = Dn(), mn(e, q, n), k !== null && (k.f & F) !== 0 && (k.f & (re | Ne)) === 0 && (K === null ? Jr([e]) : K.push(e)), !i.is_fork && yt.size > 0 && !xn && Pr();
1113
+ }
1114
+ return t;
1115
+ }
1116
+ function Pr() {
1117
+ xn = !1;
1118
+ for (const e of yt)
1119
+ (e.f & F) !== 0 && R(e, oe), tt(e) && He(e);
1120
+ yt.clear();
1121
+ }
1122
+ function Ze(e) {
1123
+ B(e, e.v + 1);
1124
+ }
1125
+ function mn(e, t, n) {
1126
+ var r = e.reactions;
1127
+ if (r !== null)
1128
+ for (var i = r.length, s = 0; s < i; s++) {
1129
+ var o = r[s], a = o.f, l = (a & q) === 0;
1130
+ if (l && R(o, t), (a & j) !== 0) {
1131
+ var f = (
1132
+ /** @type {Derived} */
1133
+ o
1134
+ );
1135
+ ee?.delete(f), (a & Oe) === 0 && (a & X && (o.f |= Oe), mn(f, oe, n));
1136
+ } else if (l) {
1137
+ var u = (
1138
+ /** @type {Effect} */
1139
+ o
1140
+ );
1141
+ (a & ke) !== 0 && de !== null && de.add(u), n !== null ? n.push(u) : Nt(u);
1142
+ }
1143
+ }
1144
+ }
1145
+ function he(e) {
1146
+ if (typeof e != "object" || e === null || gt in e)
1147
+ return e;
1148
+ const t = tn(e);
1149
+ if (t !== tr && t !== nr)
1150
+ return e;
1151
+ var n = /* @__PURE__ */ new Map(), r = en(e), i = /* @__PURE__ */ H(0), s = Ae, o = (a) => {
1152
+ if (Ae === s)
1153
+ return a();
1154
+ var l = b, f = Ae;
1155
+ Q(null), Gt(s);
1156
+ var u = a();
1157
+ return Q(l), Gt(f), u;
1158
+ };
1159
+ return r && n.set("length", /* @__PURE__ */ H(
1160
+ /** @type {any[]} */
1161
+ e.length
1162
+ )), new Proxy(
1163
+ /** @type {any} */
1164
+ e,
1165
+ {
1166
+ defineProperty(a, l, f) {
1167
+ (!("value" in f) || f.configurable === !1 || f.enumerable === !1 || f.writable === !1) && hr();
1168
+ var u = n.get(l);
1169
+ return u === void 0 ? o(() => {
1170
+ var h = /* @__PURE__ */ H(f.value);
1171
+ return n.set(l, h), h;
1172
+ }) : B(u, f.value, !0), !0;
1173
+ },
1174
+ deleteProperty(a, l) {
1175
+ var f = n.get(l);
1176
+ if (f === void 0) {
1177
+ if (l in a) {
1178
+ const u = o(() => /* @__PURE__ */ H(L));
1179
+ n.set(l, u), Ze(i);
1180
+ }
1181
+ } else
1182
+ B(f, L), Ze(i);
1183
+ return !0;
1184
+ },
1185
+ get(a, l, f) {
1186
+ if (l === gt)
1187
+ return e;
1188
+ var u = n.get(l), h = l in a;
1189
+ if (u === void 0 && (!h || Xe(a, l)?.writable) && (u = o(() => {
1190
+ var g = he(h ? a[l] : L), p = /* @__PURE__ */ H(g);
1191
+ return p;
1192
+ }), n.set(l, u)), u !== void 0) {
1193
+ var d = _(u);
1194
+ return d === L ? void 0 : d;
1195
+ }
1196
+ return Reflect.get(a, l, f);
1197
+ },
1198
+ getOwnPropertyDescriptor(a, l) {
1199
+ var f = Reflect.getOwnPropertyDescriptor(a, l);
1200
+ if (f && "value" in f) {
1201
+ var u = n.get(l);
1202
+ u && (f.value = _(u));
1203
+ } else if (f === void 0) {
1204
+ var h = n.get(l), d = h?.v;
1205
+ if (h !== void 0 && d !== L)
1206
+ return {
1207
+ enumerable: !0,
1208
+ configurable: !0,
1209
+ value: d,
1210
+ writable: !0
1211
+ };
1212
+ }
1213
+ return f;
1214
+ },
1215
+ has(a, l) {
1216
+ if (l === gt)
1217
+ return !0;
1218
+ var f = n.get(l), u = f !== void 0 && f.v !== L || Reflect.has(a, l);
1219
+ if (f !== void 0 || k !== null && (!u || Xe(a, l)?.writable)) {
1220
+ f === void 0 && (f = o(() => {
1221
+ var d = u ? he(a[l]) : L, g = /* @__PURE__ */ H(d);
1222
+ return g;
1223
+ }), n.set(l, f));
1224
+ var h = _(f);
1225
+ if (h === L)
1226
+ return !1;
1227
+ }
1228
+ return u;
1229
+ },
1230
+ set(a, l, f, u) {
1231
+ var h = n.get(l), d = l in a;
1232
+ if (r && l === "length")
1233
+ for (var g = f; g < /** @type {Source<number>} */
1234
+ h.v; g += 1) {
1235
+ var p = n.get(g + "");
1236
+ p !== void 0 ? B(p, L) : g in a && (p = o(() => /* @__PURE__ */ H(L)), n.set(g + "", p));
1237
+ }
1238
+ if (h === void 0)
1239
+ (!d || Xe(a, l)?.writable) && (h = o(() => /* @__PURE__ */ H(void 0)), B(h, he(f)), n.set(l, h));
1240
+ else {
1241
+ d = h.v !== L;
1242
+ var w = o(() => he(f));
1243
+ B(h, w);
1244
+ }
1245
+ var c = Reflect.getOwnPropertyDescriptor(a, l);
1246
+ if (c?.set && c.set.call(u, f), !d) {
1247
+ if (r && typeof l == "string") {
1248
+ var v = (
1249
+ /** @type {Source<number>} */
1250
+ n.get("length")
1251
+ ), E = Number(l);
1252
+ Number.isInteger(E) && E >= v.v && B(v, E + 1);
1253
+ }
1254
+ Ze(i);
1255
+ }
1256
+ return !0;
1257
+ },
1258
+ ownKeys(a) {
1259
+ _(i);
1260
+ var l = Reflect.ownKeys(a).filter((h) => {
1261
+ var d = n.get(h);
1262
+ return d === void 0 || d.v !== L;
1263
+ });
1264
+ for (var [f, u] of n)
1265
+ u.v !== L && !(f in a) && l.push(f);
1266
+ return l;
1267
+ },
1268
+ setPrototypeOf() {
1269
+ pr();
1270
+ }
1271
+ }
1272
+ );
1273
+ }
1274
+ var Vt, wn, bn, yn;
1275
+ function jr() {
1276
+ if (Vt === void 0) {
1277
+ Vt = window, wn = /Firefox/.test(navigator.userAgent);
1278
+ var e = Element.prototype, t = Node.prototype, n = Text.prototype;
1279
+ bn = Xe(t, "firstChild").get, yn = Xe(t, "nextSibling").get, Lt(e) && (e.__click = void 0, e.__className = void 0, e.__attributes = null, e.__style = void 0, e.__e = void 0), Lt(n) && (n.__t = void 0);
1280
+ }
1281
+ }
1282
+ function ye(e = "") {
1283
+ return document.createTextNode(e);
1284
+ }
1285
+ // @__NO_SIDE_EFFECTS__
1286
+ function lt(e) {
1287
+ return (
1288
+ /** @type {TemplateNode | null} */
1289
+ bn.call(e)
1290
+ );
1291
+ }
1292
+ // @__NO_SIDE_EFFECTS__
1293
+ function et(e) {
1294
+ return (
1295
+ /** @type {TemplateNode | null} */
1296
+ yn.call(e)
1297
+ );
1298
+ }
1299
+ function m(e, t) {
1300
+ return /* @__PURE__ */ lt(e);
1301
+ }
1302
+ function Dt(e, t = !1) {
1303
+ {
1304
+ var n = /* @__PURE__ */ lt(e);
1305
+ return n instanceof Comment && n.data === "" ? /* @__PURE__ */ et(n) : n;
1306
+ }
1307
+ }
1308
+ function I(e, t = 1, n = !1) {
1309
+ let r = e;
1310
+ for (; t--; )
1311
+ r = /** @type {TemplateNode} */
1312
+ /* @__PURE__ */ et(r);
1313
+ return r;
1314
+ }
1315
+ function Lr(e) {
1316
+ e.textContent = "";
1317
+ }
1318
+ function En() {
1319
+ return !1;
1320
+ }
1321
+ function kn(e, t, n) {
1322
+ return (
1323
+ /** @type {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element} */
1324
+ document.createElementNS($t, e, void 0)
1325
+ );
1326
+ }
1327
+ function Tn(e) {
1328
+ var t = b, n = k;
1329
+ Q(null), fe(null);
1330
+ try {
1331
+ return e();
1332
+ } finally {
1333
+ Q(t), fe(n);
1334
+ }
1335
+ }
1336
+ function Br(e) {
1337
+ k === null && (b === null && dr(), cr()), ze && ur();
1338
+ }
1339
+ function qr(e, t) {
1340
+ var n = t.last;
1341
+ n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e);
1342
+ }
1343
+ function pe(e, t) {
1344
+ var n = k;
1345
+ n !== null && (n.f & G) !== 0 && (e |= G);
1346
+ var r = {
1347
+ ctx: Z,
1348
+ deps: null,
1349
+ nodes: null,
1350
+ f: e | q | X,
1351
+ first: null,
1352
+ fn: t,
1353
+ last: null,
1354
+ next: null,
1355
+ parent: n,
1356
+ b: n && n.b,
1357
+ prev: null,
1358
+ teardown: null,
1359
+ wv: 0,
1360
+ ac: null
1361
+ }, i = r;
1362
+ if ((e & Le) !== 0)
1363
+ Pe !== null ? Pe.push(r) : Ee.ensure().schedule(r);
1364
+ else if (t !== null) {
1365
+ try {
1366
+ He(r);
1367
+ } catch (o) {
1368
+ throw V(r), o;
1369
+ }
1370
+ i.deps === null && i.teardown === null && i.nodes === null && i.first === i.last && // either `null`, or a singular child
1371
+ (i.f & Ue) === 0 && (i = i.first, (e & ke) !== 0 && (e & Re) !== 0 && i !== null && (i.f |= Re));
1372
+ }
1373
+ if (i !== null && (i.parent = n, n !== null && qr(i, n), b !== null && (b.f & j) !== 0 && (e & Ne) === 0)) {
1374
+ var s = (
1375
+ /** @type {Derived} */
1376
+ b
1377
+ );
1378
+ (s.effects ??= []).push(i);
1379
+ }
1380
+ return r;
1381
+ }
1382
+ function zt() {
1383
+ return b !== null && !te;
1384
+ }
1385
+ function Hr(e) {
1386
+ const t = pe(ft, null);
1387
+ return R(t, F), t.teardown = e, t;
1388
+ }
1389
+ function Ur(e) {
1390
+ Br();
1391
+ var t = (
1392
+ /** @type {Effect} */
1393
+ k.f
1394
+ ), n = !b && (t & re) !== 0 && (t & Ie) === 0;
1395
+ if (n) {
1396
+ var r = (
1397
+ /** @type {ComponentContext} */
1398
+ Z
1399
+ );
1400
+ (r.e ??= []).push(e);
1401
+ } else
1402
+ return Cn(e);
1403
+ }
1404
+ function Cn(e) {
1405
+ return pe(Le | lr, e);
1406
+ }
1407
+ function Vr(e) {
1408
+ Ee.ensure();
1409
+ const t = pe(Ne | Ue, e);
1410
+ return (n = {}) => new Promise((r) => {
1411
+ n.outro ? Se(t, () => {
1412
+ V(t), r(void 0);
1413
+ }) : (V(t), r(void 0));
1414
+ });
1415
+ }
1416
+ function Yr(e) {
1417
+ return pe(Le, e);
1418
+ }
1419
+ function Gr(e) {
1420
+ return pe(At | Ue, e);
1421
+ }
1422
+ function Kr(e, t = 0) {
1423
+ return pe(ft | t, e);
1424
+ }
1425
+ function N(e, t = [], n = [], r = []) {
1426
+ Mr(r, t, n, (i) => {
1427
+ pe(ft, () => e(...i.map(_)));
1428
+ });
1429
+ }
1430
+ function ut(e, t = 0) {
1431
+ var n = pe(ke | t, e);
1432
+ return n;
1433
+ }
1434
+ function W(e) {
1435
+ return pe(re | Ue, e);
1436
+ }
1437
+ function Sn(e) {
1438
+ var t = e.teardown;
1439
+ if (t !== null) {
1440
+ const n = ze, r = b;
1441
+ Yt(!0), Q(null);
1442
+ try {
1443
+ t.call(null);
1444
+ } finally {
1445
+ Yt(n), Q(r);
1446
+ }
1447
+ }
1448
+ }
1449
+ function It(e, t = !1) {
1450
+ var n = e.first;
1451
+ for (e.first = e.last = null; n !== null; ) {
1452
+ const i = n.ac;
1453
+ i !== null && Tn(() => {
1454
+ i.abort(ve);
1455
+ });
1456
+ var r = n.next;
1457
+ (n.f & Ne) !== 0 ? n.parent = null : V(n, t), n = r;
1458
+ }
1459
+ }
1460
+ function Wr(e) {
1461
+ for (var t = e.first; t !== null; ) {
1462
+ var n = t.next;
1463
+ (t.f & re) === 0 && V(t), t = n;
1464
+ }
1465
+ }
1466
+ function V(e, t = !0) {
1467
+ var n = !1;
1468
+ (t || (e.f & sr) !== 0) && e.nodes !== null && e.nodes.end !== null && (Xr(
1469
+ e.nodes.start,
1470
+ /** @type {TemplateNode} */
1471
+ e.nodes.end
1472
+ ), n = !0), R(e, Bt), It(e, t && !n), Qe(e, 0);
1473
+ var r = e.nodes && e.nodes.t;
1474
+ if (r !== null)
1475
+ for (const s of r)
1476
+ s.stop();
1477
+ Sn(e), e.f ^= Bt, e.f |= ne;
1478
+ var i = e.parent;
1479
+ i !== null && i.first !== null && An(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = e.b = null;
1480
+ }
1481
+ function Xr(e, t) {
1482
+ for (; e !== null; ) {
1483
+ var n = e === t ? null : /* @__PURE__ */ et(e);
1484
+ e.remove(), e = n;
1485
+ }
1486
+ }
1487
+ function An(e) {
1488
+ var t = e.parent, n = e.prev, r = e.next;
1489
+ n !== null && (n.next = r), r !== null && (r.prev = n), t !== null && (t.first === e && (t.first = r), t.last === e && (t.last = n));
1490
+ }
1491
+ function Se(e, t, n = !0) {
1492
+ var r = [];
1493
+ Mn(e, r, !0);
1494
+ var i = () => {
1495
+ n && V(e), t && t();
1496
+ }, s = r.length;
1497
+ if (s > 0) {
1498
+ var o = () => --s || i();
1499
+ for (var a of r)
1500
+ a.out(o);
1501
+ } else
1502
+ i();
1503
+ }
1504
+ function Mn(e, t, n) {
1505
+ if ((e.f & G) === 0) {
1506
+ e.f ^= G;
1507
+ var r = e.nodes && e.nodes.t;
1508
+ if (r !== null)
1509
+ for (const a of r)
1510
+ (a.is_global || n) && t.push(a);
1511
+ for (var i = e.first; i !== null; ) {
1512
+ var s = i.next, o = (i.f & Re) !== 0 || // If this is a branch effect without a block effect parent,
1513
+ // it means the parent block effect was pruned. In that case,
1514
+ // transparency information was transferred to the branch effect.
1515
+ (i.f & re) !== 0 && (e.f & ke) !== 0;
1516
+ Mn(i, t, o ? n : !1), i = s;
1517
+ }
1518
+ }
1519
+ }
1520
+ function Ft(e) {
1521
+ Nn(e, !0);
1522
+ }
1523
+ function Nn(e, t) {
1524
+ if ((e.f & G) !== 0) {
1525
+ e.f ^= G, (e.f & F) === 0 && (R(e, q), Ee.ensure().schedule(e));
1526
+ for (var n = e.first; n !== null; ) {
1527
+ var r = n.next, i = (n.f & Re) !== 0 || (n.f & re) !== 0;
1528
+ Nn(n, i ? t : !1), n = r;
1529
+ }
1530
+ var s = e.nodes && e.nodes.t;
1531
+ if (s !== null)
1532
+ for (const o of s)
1533
+ (o.is_global || t) && o.in();
1534
+ }
1535
+ }
1536
+ function Pt(e, t) {
1537
+ if (e.nodes)
1538
+ for (var n = e.nodes.start, r = e.nodes.end; n !== null; ) {
1539
+ var i = n === r ? null : /* @__PURE__ */ et(n);
1540
+ t.append(n), n = i;
1541
+ }
1542
+ }
1543
+ let it = !1, ze = !1;
1544
+ function Yt(e) {
1545
+ ze = e;
1546
+ }
1547
+ let b = null, te = !1;
1548
+ function Q(e) {
1549
+ b = e;
1550
+ }
1551
+ let k = null;
1552
+ function fe(e) {
1553
+ k = e;
1554
+ }
1555
+ let J = null;
1556
+ function Rn(e) {
1557
+ b !== null && (J === null ? J = [e] : J.push(e));
1558
+ }
1559
+ let U = null, Y = 0, K = null;
1560
+ function Jr(e) {
1561
+ K = e;
1562
+ }
1563
+ let On = 1, Te = 0, Ae = Te;
1564
+ function Gt(e) {
1565
+ Ae = e;
1566
+ }
1567
+ function Dn() {
1568
+ return ++On;
1569
+ }
1570
+ function tt(e) {
1571
+ var t = e.f;
1572
+ if ((t & q) !== 0)
1573
+ return !0;
1574
+ if (t & j && (e.f &= ~Oe), (t & oe) !== 0) {
1575
+ for (var n = (
1576
+ /** @type {Value[]} */
1577
+ e.deps
1578
+ ), r = n.length, i = 0; i < r; i++) {
1579
+ var s = n[i];
1580
+ if (tt(
1581
+ /** @type {Derived} */
1582
+ s
1583
+ ) && gn(
1584
+ /** @type {Derived} */
1585
+ s
1586
+ ), s.wv > e.wv)
1587
+ return !0;
1588
+ }
1589
+ (t & X) !== 0 && // During time traveling we don't want to reset the status so that
1590
+ // traversal of the graph in the other batches still happens
1591
+ ee === null && R(e, F);
1592
+ }
1593
+ return !1;
1594
+ }
1595
+ function zn(e, t, n = !0) {
1596
+ var r = e.reactions;
1597
+ if (r !== null && !(J !== null && je.call(J, e)))
1598
+ for (var i = 0; i < r.length; i++) {
1599
+ var s = r[i];
1600
+ (s.f & j) !== 0 ? zn(
1601
+ /** @type {Derived} */
1602
+ s,
1603
+ t,
1604
+ !1
1605
+ ) : t === s && (n ? R(s, q) : (s.f & F) !== 0 && R(s, oe), Nt(
1606
+ /** @type {Effect} */
1607
+ s
1608
+ ));
1609
+ }
1610
+ }
1611
+ function In(e) {
1612
+ var t = U, n = Y, r = K, i = b, s = J, o = Z, a = te, l = Ae, f = e.f;
1613
+ U = /** @type {null | Value[]} */
1614
+ null, Y = 0, K = null, b = (f & (re | Ne)) === 0 ? e : null, J = null, Be(e.ctx), te = !1, Ae = ++Te, e.ac !== null && (Tn(() => {
1615
+ e.ac.abort(ve);
1616
+ }), e.ac = null);
1617
+ try {
1618
+ e.f |= wt;
1619
+ var u = (
1620
+ /** @type {Function} */
1621
+ e.fn
1622
+ ), h = u();
1623
+ e.f |= Ie;
1624
+ var d = e.deps, g = S?.is_fork;
1625
+ if (U !== null) {
1626
+ var p;
1627
+ if (g || Qe(e, Y), d !== null && Y > 0)
1628
+ for (d.length = Y + U.length, p = 0; p < U.length; p++)
1629
+ d[Y + p] = U[p];
1630
+ else
1631
+ e.deps = d = U;
1632
+ if (zt() && (e.f & X) !== 0)
1633
+ for (p = Y; p < d.length; p++)
1634
+ (d[p].reactions ??= []).push(e);
1635
+ } else !g && d !== null && Y < d.length && (Qe(e, Y), d.length = Y);
1636
+ if (an() && K !== null && !te && d !== null && (e.f & (j | oe | q)) === 0)
1637
+ for (p = 0; p < /** @type {Source[]} */
1638
+ K.length; p++)
1639
+ zn(
1640
+ K[p],
1641
+ /** @type {Effect} */
1642
+ e
1643
+ );
1644
+ if (i !== null && i !== e) {
1645
+ if (Te++, i.deps !== null)
1646
+ for (let w = 0; w < n; w += 1)
1647
+ i.deps[w].rv = Te;
1648
+ if (t !== null)
1649
+ for (const w of t)
1650
+ w.rv = Te;
1651
+ K !== null && (r === null ? r = K : r.push(.../** @type {Source[]} */
1652
+ K));
1653
+ }
1654
+ return (e.f & we) !== 0 && (e.f ^= we), h;
1655
+ } catch (w) {
1656
+ return on(w);
1657
+ } finally {
1658
+ e.f ^= wt, U = t, Y = n, K = r, b = i, J = s, Be(o), te = a, Ae = l;
1659
+ }
1660
+ }
1661
+ function Zr(e, t) {
1662
+ let n = t.reactions;
1663
+ if (n !== null) {
1664
+ var r = Qn.call(n, e);
1665
+ if (r !== -1) {
1666
+ var i = n.length - 1;
1667
+ i === 0 ? n = t.reactions = null : (n[r] = n[i], n.pop());
1668
+ }
1669
+ }
1670
+ if (n === null && (t.f & j) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
1671
+ // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
1672
+ // allows us to skip the expensive work of disconnecting and immediately reconnecting it
1673
+ (U === null || !je.call(U, t))) {
1674
+ var s = (
1675
+ /** @type {Derived} */
1676
+ t
1677
+ );
1678
+ (s.f & X) !== 0 && (s.f ^= X, s.f &= ~Oe), Mt(s), Ir(s), Qe(s, 0);
1679
+ }
1680
+ }
1681
+ function Qe(e, t) {
1682
+ var n = e.deps;
1683
+ if (n !== null)
1684
+ for (var r = t; r < n.length; r++)
1685
+ Zr(e, n[r]);
1686
+ }
1687
+ function He(e) {
1688
+ var t = e.f;
1689
+ if ((t & ne) === 0) {
1690
+ R(e, F);
1691
+ var n = k, r = it;
1692
+ k = e, it = !0;
1693
+ try {
1694
+ (t & (ke | rn)) !== 0 ? Wr(e) : It(e), Sn(e);
1695
+ var i = In(e);
1696
+ e.teardown = typeof i == "function" ? i : null, e.wv = On;
1697
+ var s;
1698
+ Zn && wr && (e.f & q) !== 0 && e.deps;
1699
+ } finally {
1700
+ it = r, k = n;
1701
+ }
1702
+ }
1703
+ }
1704
+ function _(e) {
1705
+ var t = e.f, n = (t & j) !== 0;
1706
+ if (b !== null && !te) {
1707
+ var r = k !== null && (k.f & ne) !== 0;
1708
+ if (!r && (J === null || !je.call(J, e))) {
1709
+ var i = b.deps;
1710
+ if ((b.f & wt) !== 0)
1711
+ e.rv < Te && (e.rv = Te, U === null && i !== null && i[Y] === e ? Y++ : U === null ? U = [e] : U.push(e));
1712
+ else {
1713
+ (b.deps ??= []).push(e);
1714
+ var s = e.reactions;
1715
+ s === null ? e.reactions = [b] : je.call(s, b) || s.push(b);
1716
+ }
1717
+ }
1718
+ }
1719
+ if (ze && be.has(e))
1720
+ return be.get(e);
1721
+ if (n) {
1722
+ var o = (
1723
+ /** @type {Derived} */
1724
+ e
1725
+ );
1726
+ if (ze) {
1727
+ var a = o.v;
1728
+ return ((o.f & F) === 0 && o.reactions !== null || Pn(o)) && (a = Ot(o)), be.set(o, a), a;
1729
+ }
1730
+ var l = (o.f & X) === 0 && !te && b !== null && (it || (b.f & X) !== 0), f = (o.f & Ie) === 0;
1731
+ tt(o) && (l && (o.f |= X), gn(o)), l && !f && (_n(o), Fn(o));
1732
+ }
1733
+ if (ee?.has(e))
1734
+ return ee.get(e);
1735
+ if ((e.f & we) !== 0)
1736
+ throw e.v;
1737
+ return e.v;
1738
+ }
1739
+ function Fn(e) {
1740
+ if (e.f |= X, e.deps !== null)
1741
+ for (const t of e.deps)
1742
+ (t.reactions ??= []).push(e), (t.f & j) !== 0 && (t.f & X) === 0 && (_n(
1743
+ /** @type {Derived} */
1744
+ t
1745
+ ), Fn(
1746
+ /** @type {Derived} */
1747
+ t
1748
+ ));
1749
+ }
1750
+ function Pn(e) {
1751
+ if (e.v === L) return !0;
1752
+ if (e.deps === null) return !1;
1753
+ for (const t of e.deps)
1754
+ if (be.has(t) || (t.f & j) !== 0 && Pn(
1755
+ /** @type {Derived} */
1756
+ t
1757
+ ))
1758
+ return !0;
1759
+ return !1;
1760
+ }
1761
+ function Qr(e) {
1762
+ var t = te;
1763
+ try {
1764
+ return te = !0, e();
1765
+ } finally {
1766
+ te = t;
1767
+ }
1768
+ }
1769
+ const Ke = /* @__PURE__ */ Symbol("events"), jn = /* @__PURE__ */ new Set(), Et = /* @__PURE__ */ new Set();
1770
+ function $r(e, t, n) {
1771
+ (t[Ke] ??= {})[e] = n;
1772
+ }
1773
+ function ei(e) {
1774
+ for (var t = 0; t < e.length; t++)
1775
+ jn.add(e[t]);
1776
+ for (var n of Et)
1777
+ n(e);
1778
+ }
1779
+ let Kt = null;
1780
+ function Wt(e) {
1781
+ var t = this, n = (
1782
+ /** @type {Node} */
1783
+ t.ownerDocument
1784
+ ), r = e.type, i = e.composedPath?.() || [], s = (
1785
+ /** @type {null | Element} */
1786
+ i[0] || e.target
1787
+ );
1788
+ Kt = e;
1789
+ var o = 0, a = Kt === e && e[Ke];
1790
+ if (a) {
1791
+ var l = i.indexOf(a);
1792
+ if (l !== -1 && (t === document || t === /** @type {any} */
1793
+ window)) {
1794
+ e[Ke] = t;
1795
+ return;
1796
+ }
1797
+ var f = i.indexOf(t);
1798
+ if (f === -1)
1799
+ return;
1800
+ l <= f && (o = l);
1801
+ }
1802
+ if (s = /** @type {Element} */
1803
+ i[o] || e.target, s !== t) {
1804
+ $n(e, "currentTarget", {
1805
+ configurable: !0,
1806
+ get() {
1807
+ return s || n;
1808
+ }
1809
+ });
1810
+ var u = b, h = k;
1811
+ Q(null), fe(null);
1812
+ try {
1813
+ for (var d, g = []; s !== null; ) {
1814
+ var p = s.assignedSlot || s.parentNode || /** @type {any} */
1815
+ s.host || null;
1816
+ try {
1817
+ var w = s[Ke]?.[r];
1818
+ w != null && (!/** @type {any} */
1819
+ s.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
1820
+ // -> the target could not have been disabled because it emits the event in the first place
1821
+ e.target === s) && w.call(s, e);
1822
+ } catch (c) {
1823
+ d ? g.push(c) : d = c;
1824
+ }
1825
+ if (e.cancelBubble || p === t || p === null)
1826
+ break;
1827
+ s = p;
1828
+ }
1829
+ if (d) {
1830
+ for (let c of g)
1831
+ queueMicrotask(() => {
1832
+ throw c;
1833
+ });
1834
+ throw d;
1835
+ }
1836
+ } finally {
1837
+ e[Ke] = t, delete e.currentTarget, Q(u), fe(h);
1838
+ }
1839
+ }
1840
+ }
1841
+ const ti = (
1842
+ // We gotta write it like this because after downleveling the pure comment may end up in the wrong location
1843
+ globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", {
1844
+ /** @param {string} html */
1845
+ createHTML: (e) => e
1846
+ })
1847
+ );
1848
+ function ni(e) {
1849
+ return (
1850
+ /** @type {string} */
1851
+ ti?.createHTML(e) ?? e
1852
+ );
1853
+ }
1854
+ function ri(e) {
1855
+ var t = kn("template");
1856
+ return t.innerHTML = ni(e.replaceAll("<!>", "<!---->")), t.content;
1857
+ }
1858
+ function kt(e, t) {
1859
+ var n = (
1860
+ /** @type {Effect} */
1861
+ k
1862
+ );
1863
+ n.nodes === null && (n.nodes = { start: e, end: t, a: null, t: null });
1864
+ }
1865
+ // @__NO_SIDE_EFFECTS__
1866
+ function C(e, t) {
1867
+ var n = (t & 1) !== 0, r = (t & 2) !== 0, i, s = !e.startsWith("<!>");
1868
+ return () => {
1869
+ i === void 0 && (i = ri(s ? e : "<!>" + e), n || (i = /** @type {TemplateNode} */
1870
+ /* @__PURE__ */ lt(i)));
1871
+ var o = (
1872
+ /** @type {TemplateNode} */
1873
+ r || wn ? document.importNode(i, !0) : i.cloneNode(!0)
1874
+ );
1875
+ if (n) {
1876
+ var a = (
1877
+ /** @type {TemplateNode} */
1878
+ /* @__PURE__ */ lt(o)
1879
+ ), l = (
1880
+ /** @type {TemplateNode} */
1881
+ o.lastChild
1882
+ );
1883
+ kt(a, l);
1884
+ } else
1885
+ kt(o, o);
1886
+ return o;
1887
+ };
1888
+ }
1889
+ function Ln() {
1890
+ var e = document.createDocumentFragment(), t = document.createComment(""), n = ye();
1891
+ return e.append(t, n), kt(t, n), e;
1892
+ }
1893
+ function T(e, t) {
1894
+ e !== null && e.before(
1895
+ /** @type {Node} */
1896
+ t
1897
+ );
1898
+ }
1899
+ const ii = ["touchstart", "touchmove"];
1900
+ function si(e) {
1901
+ return ii.includes(e);
1902
+ }
1903
+ function A(e, t) {
1904
+ var n = t == null ? "" : typeof t == "object" ? `${t}` : t;
1905
+ n !== (e.__t ??= e.nodeValue) && (e.__t = n, e.nodeValue = `${n}`);
1906
+ }
1907
+ function li(e, t) {
1908
+ return ai(e, t);
1909
+ }
1910
+ const nt = /* @__PURE__ */ new Map();
1911
+ function ai(e, { target: t, anchor: n, props: r = {}, events: i, context: s, intro: o = !0, transformError: a }) {
1912
+ jr();
1913
+ var l = void 0, f = Vr(() => {
1914
+ var u = n ?? t.appendChild(ye());
1915
+ Sr(
1916
+ /** @type {TemplateNode} */
1917
+ u,
1918
+ {
1919
+ pending: () => {
1920
+ }
1921
+ },
1922
+ (g) => {
1923
+ ie({});
1924
+ var p = (
1925
+ /** @type {ComponentContext} */
1926
+ Z
1927
+ );
1928
+ s && (p.c = s), i && (r.$$events = i), l = e(g, r) || {}, se();
1929
+ },
1930
+ a
1931
+ );
1932
+ var h = /* @__PURE__ */ new Set(), d = (g) => {
1933
+ for (var p = 0; p < g.length; p++) {
1934
+ var w = g[p];
1935
+ if (!h.has(w)) {
1936
+ h.add(w);
1937
+ var c = si(w);
1938
+ for (const x of [t, document]) {
1939
+ var v = nt.get(x);
1940
+ v === void 0 && (v = /* @__PURE__ */ new Map(), nt.set(x, v));
1941
+ var E = v.get(w);
1942
+ E === void 0 ? (x.addEventListener(w, Wt, { passive: c }), v.set(w, 1)) : v.set(w, E + 1);
1943
+ }
1944
+ }
1945
+ }
1946
+ };
1947
+ return d(ot(jn)), Et.add(d), () => {
1948
+ for (var g of h)
1949
+ for (const c of [t, document]) {
1950
+ var p = (
1951
+ /** @type {Map<string, number>} */
1952
+ nt.get(c)
1953
+ ), w = (
1954
+ /** @type {number} */
1955
+ p.get(g)
1956
+ );
1957
+ --w == 0 ? (c.removeEventListener(g, Wt), p.delete(g), p.size === 0 && nt.delete(c)) : p.set(g, w);
1958
+ }
1959
+ Et.delete(d), u !== n && u.parentNode?.removeChild(u);
1960
+ };
1961
+ });
1962
+ return Tt.set(l, f), l;
1963
+ }
1964
+ let Tt = /* @__PURE__ */ new WeakMap();
1965
+ function oi(e, t) {
1966
+ const n = Tt.get(e);
1967
+ return n ? (Tt.delete(e), n(t)) : Promise.resolve();
1968
+ }
1969
+ class Bn {
1970
+ /** @type {TemplateNode} */
1971
+ anchor;
1972
+ /** @type {Map<Batch, Key>} */
1973
+ #t = /* @__PURE__ */ new Map();
1974
+ /**
1975
+ * Map of keys to effects that are currently rendered in the DOM.
1976
+ * These effects are visible and actively part of the document tree.
1977
+ * Example:
1978
+ * ```
1979
+ * {#if condition}
1980
+ * foo
1981
+ * {:else}
1982
+ * bar
1983
+ * {/if}
1984
+ * ```
1985
+ * Can result in the entries `true->Effect` and `false->Effect`
1986
+ * @type {Map<Key, Effect>}
1987
+ */
1988
+ #o = /* @__PURE__ */ new Map();
1989
+ /**
1990
+ * Similar to #onscreen with respect to the keys, but contains branches that are not yet
1991
+ * in the DOM, because their insertion is deferred.
1992
+ * @type {Map<Key, Branch>}
1993
+ */
1994
+ #e = /* @__PURE__ */ new Map();
1995
+ /**
1996
+ * Keys of effects that are currently outroing
1997
+ * @type {Set<Key>}
1998
+ */
1999
+ #r = /* @__PURE__ */ new Set();
2000
+ /**
2001
+ * Whether to pause (i.e. outro) on change, or destroy immediately.
2002
+ * This is necessary for `<svelte:element>`
2003
+ */
2004
+ #i = !0;
2005
+ /**
2006
+ * @param {TemplateNode} anchor
2007
+ * @param {boolean} transition
2008
+ */
2009
+ constructor(t, n = !0) {
2010
+ this.anchor = t, this.#i = n;
2011
+ }
2012
+ /**
2013
+ * @param {Batch} batch
2014
+ */
2015
+ #n = (t) => {
2016
+ if (this.#t.has(t)) {
2017
+ var n = (
2018
+ /** @type {Key} */
2019
+ this.#t.get(t)
2020
+ ), r = this.#o.get(n);
2021
+ if (r)
2022
+ Ft(r), this.#r.delete(n);
2023
+ else {
2024
+ var i = this.#e.get(n);
2025
+ i && (this.#o.set(n, i.effect), this.#e.delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect);
2026
+ }
2027
+ for (const [s, o] of this.#t) {
2028
+ if (this.#t.delete(s), s === t)
2029
+ break;
2030
+ const a = this.#e.get(o);
2031
+ a && (V(a.effect), this.#e.delete(o));
2032
+ }
2033
+ for (const [s, o] of this.#o) {
2034
+ if (s === n || this.#r.has(s)) continue;
2035
+ const a = () => {
2036
+ if (Array.from(this.#t.values()).includes(s)) {
2037
+ var f = document.createDocumentFragment();
2038
+ Pt(o, f), f.append(ye()), this.#e.set(s, { effect: o, fragment: f });
2039
+ } else
2040
+ V(o);
2041
+ this.#r.delete(s), this.#o.delete(s);
2042
+ };
2043
+ this.#i || !r ? (this.#r.add(s), Se(o, a, !1)) : a();
2044
+ }
2045
+ }
2046
+ };
2047
+ /**
2048
+ * @param {Batch} batch
2049
+ */
2050
+ #s = (t) => {
2051
+ this.#t.delete(t);
2052
+ const n = Array.from(this.#t.values());
2053
+ for (const [r, i] of this.#e)
2054
+ n.includes(r) || (V(i.effect), this.#e.delete(r));
2055
+ };
2056
+ /**
2057
+ *
2058
+ * @param {any} key
2059
+ * @param {null | ((target: TemplateNode) => void)} fn
2060
+ */
2061
+ ensure(t, n) {
2062
+ var r = (
2063
+ /** @type {Batch} */
2064
+ S
2065
+ ), i = En();
2066
+ if (n && !this.#o.has(t) && !this.#e.has(t))
2067
+ if (i) {
2068
+ var s = document.createDocumentFragment(), o = ye();
2069
+ s.append(o), this.#e.set(t, {
2070
+ effect: W(() => n(o)),
2071
+ fragment: s
2072
+ });
2073
+ } else
2074
+ this.#o.set(
2075
+ t,
2076
+ W(() => n(this.anchor))
2077
+ );
2078
+ if (this.#t.set(r, t), i) {
2079
+ for (const [a, l] of this.#o)
2080
+ a === t ? r.unskip_effect(l) : r.skip_effect(l);
2081
+ for (const [a, l] of this.#e)
2082
+ a === t ? r.unskip_effect(l.effect) : r.skip_effect(l.effect);
2083
+ r.oncommit(this.#n), r.ondiscard(this.#s);
2084
+ } else
2085
+ this.#n(r);
2086
+ }
2087
+ }
2088
+ function Me(e, t, n = !1) {
2089
+ var r = new Bn(e), i = n ? Re : 0;
2090
+ function s(o, a) {
2091
+ r.ensure(o, a);
2092
+ }
2093
+ ut(() => {
2094
+ var o = !1;
2095
+ t((a, l = 0) => {
2096
+ o = !0, s(l, a);
2097
+ }), o || s(-1, null);
2098
+ }, i);
2099
+ }
2100
+ function Ct(e, t) {
2101
+ return t;
2102
+ }
2103
+ function fi(e, t, n) {
2104
+ for (var r = [], i = t.length, s, o = t.length, a = 0; a < i; a++) {
2105
+ let h = t[a];
2106
+ Se(
2107
+ h,
2108
+ () => {
2109
+ if (s) {
2110
+ if (s.pending.delete(h), s.done.add(h), s.pending.size === 0) {
2111
+ var d = (
2112
+ /** @type {Set<EachOutroGroup>} */
2113
+ e.outrogroups
2114
+ );
2115
+ St(e, ot(s.done)), d.delete(s), d.size === 0 && (e.outrogroups = null);
2116
+ }
2117
+ } else
2118
+ o -= 1;
2119
+ },
2120
+ !1
2121
+ );
2122
+ }
2123
+ if (o === 0) {
2124
+ var l = r.length === 0 && n !== null;
2125
+ if (l) {
2126
+ var f = (
2127
+ /** @type {Element} */
2128
+ n
2129
+ ), u = (
2130
+ /** @type {Element} */
2131
+ f.parentNode
2132
+ );
2133
+ Lr(u), u.append(f), e.items.clear();
2134
+ }
2135
+ St(e, t, !l);
2136
+ } else
2137
+ s = {
2138
+ pending: new Set(t),
2139
+ done: /* @__PURE__ */ new Set()
2140
+ }, (e.outrogroups ??= /* @__PURE__ */ new Set()).add(s);
2141
+ }
2142
+ function St(e, t, n = !0) {
2143
+ var r;
2144
+ if (e.pending.size > 0) {
2145
+ r = /* @__PURE__ */ new Set();
2146
+ for (const o of e.pending.values())
2147
+ for (const a of o)
2148
+ r.add(
2149
+ /** @type {EachItem} */
2150
+ e.items.get(a).e
2151
+ );
2152
+ }
2153
+ for (var i = 0; i < t.length; i++) {
2154
+ var s = t[i];
2155
+ if (r?.has(s)) {
2156
+ s.f |= ae;
2157
+ const o = document.createDocumentFragment();
2158
+ Pt(s, o);
2159
+ } else
2160
+ V(t[i], n);
2161
+ }
2162
+ }
2163
+ var Xt;
2164
+ function $e(e, t, n, r, i, s = null) {
2165
+ var o = e, a = /* @__PURE__ */ new Map(), l = (t & 4) !== 0;
2166
+ if (l) {
2167
+ var f = (
2168
+ /** @type {Element} */
2169
+ e
2170
+ );
2171
+ o = f.appendChild(ye());
2172
+ }
2173
+ var u = null, h = /* @__PURE__ */ Or(() => {
2174
+ var x = n();
2175
+ return en(x) ? x : x == null ? [] : ot(x);
2176
+ }), d, g = /* @__PURE__ */ new Map(), p = !0;
2177
+ function w(x) {
2178
+ (E.effect.f & ne) === 0 && (E.pending.delete(x), E.fallback = u, ui(E, d, o, t, r), u !== null && (d.length === 0 ? (u.f & ae) === 0 ? Ft(u) : (u.f ^= ae, We(u, null, o)) : Se(u, () => {
2179
+ u = null;
2180
+ })));
2181
+ }
2182
+ function c(x) {
2183
+ E.pending.delete(x);
2184
+ }
2185
+ var v = ut(() => {
2186
+ d = /** @type {V[]} */
2187
+ _(h);
2188
+ for (var x = d.length, M = /* @__PURE__ */ new Set(), P = (
2189
+ /** @type {Batch} */
2190
+ S
2191
+ ), O = En(), D = 0; D < x; D += 1) {
2192
+ var $ = d[D], le = r($, D), z = p ? null : a.get(le);
2193
+ z ? (z.v && qe(z.v, $), z.i && qe(z.i, D), O && P.unskip_effect(z.e)) : (z = ci(
2194
+ a,
2195
+ p ? o : Xt ??= ye(),
2196
+ $,
2197
+ le,
2198
+ D,
2199
+ i,
2200
+ t,
2201
+ n
2202
+ ), p || (z.e.f |= ae), a.set(le, z)), M.add(le);
2203
+ }
2204
+ if (x === 0 && s && !u && (p ? u = W(() => s(o)) : (u = W(() => s(Xt ??= ye())), u.f |= ae)), x > M.size && fr(), !p)
2205
+ if (g.set(P, M), O) {
2206
+ for (const [ct, Ve] of a)
2207
+ M.has(ct) || P.skip_effect(Ve.e);
2208
+ P.oncommit(w), P.ondiscard(c);
2209
+ } else
2210
+ w(P);
2211
+ _(h);
2212
+ }), E = { effect: v, items: a, pending: g, outrogroups: null, fallback: u };
2213
+ p = !1;
2214
+ }
2215
+ function Ge(e) {
2216
+ for (; e !== null && (e.f & re) === 0; )
2217
+ e = e.next;
2218
+ return e;
2219
+ }
2220
+ function ui(e, t, n, r, i) {
2221
+ var s = (r & 8) !== 0, o = t.length, a = e.items, l = Ge(e.effect.first), f, u = null, h, d = [], g = [], p, w, c, v;
2222
+ if (s)
2223
+ for (v = 0; v < o; v += 1)
2224
+ p = t[v], w = i(p, v), c = /** @type {EachItem} */
2225
+ a.get(w).e, (c.f & ae) === 0 && (c.nodes?.a?.measure(), (h ??= /* @__PURE__ */ new Set()).add(c));
2226
+ for (v = 0; v < o; v += 1) {
2227
+ if (p = t[v], w = i(p, v), c = /** @type {EachItem} */
2228
+ a.get(w).e, e.outrogroups !== null)
2229
+ for (const z of e.outrogroups)
2230
+ z.pending.delete(c), z.done.delete(c);
2231
+ if ((c.f & G) !== 0 && (Ft(c), s && (c.nodes?.a?.unfix(), (h ??= /* @__PURE__ */ new Set()).delete(c))), (c.f & ae) !== 0)
2232
+ if (c.f ^= ae, c === l)
2233
+ We(c, null, n);
2234
+ else {
2235
+ var E = u ? u.next : l;
2236
+ c === e.effect.last && (e.effect.last = c.prev), c.prev && (c.prev.next = c.next), c.next && (c.next.prev = c.prev), xe(e, u, c), xe(e, c, E), We(c, E, n), u = c, d = [], g = [], l = Ge(u.next);
2237
+ continue;
2238
+ }
2239
+ if (c !== l) {
2240
+ if (f !== void 0 && f.has(c)) {
2241
+ if (d.length < g.length) {
2242
+ var x = g[0], M;
2243
+ u = x.prev;
2244
+ var P = d[0], O = d[d.length - 1];
2245
+ for (M = 0; M < d.length; M += 1)
2246
+ We(d[M], x, n);
2247
+ for (M = 0; M < g.length; M += 1)
2248
+ f.delete(g[M]);
2249
+ xe(e, P.prev, O.next), xe(e, u, P), xe(e, O, x), l = x, u = O, v -= 1, d = [], g = [];
2250
+ } else
2251
+ f.delete(c), We(c, l, n), xe(e, c.prev, c.next), xe(e, c, u === null ? e.effect.first : u.next), xe(e, u, c), u = c;
2252
+ continue;
2253
+ }
2254
+ for (d = [], g = []; l !== null && l !== c; )
2255
+ (f ??= /* @__PURE__ */ new Set()).add(l), g.push(l), l = Ge(l.next);
2256
+ if (l === null)
2257
+ continue;
2258
+ }
2259
+ (c.f & ae) === 0 && d.push(c), u = c, l = Ge(c.next);
2260
+ }
2261
+ if (e.outrogroups !== null) {
2262
+ for (const z of e.outrogroups)
2263
+ z.pending.size === 0 && (St(e, ot(z.done)), e.outrogroups?.delete(z));
2264
+ e.outrogroups.size === 0 && (e.outrogroups = null);
2265
+ }
2266
+ if (l !== null || f !== void 0) {
2267
+ var D = [];
2268
+ if (f !== void 0)
2269
+ for (c of f)
2270
+ (c.f & G) === 0 && D.push(c);
2271
+ for (; l !== null; )
2272
+ (l.f & G) === 0 && l !== e.fallback && D.push(l), l = Ge(l.next);
2273
+ var $ = D.length;
2274
+ if ($ > 0) {
2275
+ var le = (r & 4) !== 0 && o === 0 ? n : null;
2276
+ if (s) {
2277
+ for (v = 0; v < $; v += 1)
2278
+ D[v].nodes?.a?.measure();
2279
+ for (v = 0; v < $; v += 1)
2280
+ D[v].nodes?.a?.fix();
2281
+ }
2282
+ fi(e, D, le);
2283
+ }
2284
+ }
2285
+ s && Ce(() => {
2286
+ if (h !== void 0)
2287
+ for (c of h)
2288
+ c.nodes?.a?.apply();
2289
+ });
2290
+ }
2291
+ function ci(e, t, n, r, i, s, o, a) {
2292
+ var l = (o & 1) !== 0 ? (o & 16) === 0 ? /* @__PURE__ */ Fr(n, !1, !1) : De(n) : null, f = (o & 2) !== 0 ? De(i) : null;
2293
+ return {
2294
+ v: l,
2295
+ i: f,
2296
+ e: W(() => (s(t, l ?? n, f ?? i, a), () => {
2297
+ e.delete(r);
2298
+ }))
2299
+ };
2300
+ }
2301
+ function We(e, t, n) {
2302
+ if (e.nodes)
2303
+ for (var r = e.nodes.start, i = e.nodes.end, s = t && (t.f & ae) === 0 ? (
2304
+ /** @type {EffectNodes} */
2305
+ t.nodes.start
2306
+ ) : n; r !== null; ) {
2307
+ var o = (
2308
+ /** @type {TemplateNode} */
2309
+ /* @__PURE__ */ et(r)
2310
+ );
2311
+ if (s.before(r), r === i)
2312
+ return;
2313
+ r = o;
2314
+ }
2315
+ }
2316
+ function xe(e, t, n) {
2317
+ t === null ? e.effect.first = n : t.next = n, n === null ? e.effect.last = t : n.prev = t;
2318
+ }
2319
+ function di(e, t, n) {
2320
+ var r = new Bn(e);
2321
+ ut(() => {
2322
+ var i = t() ?? null;
2323
+ r.ensure(i, i && ((s) => n(s, i)));
2324
+ }, Re);
2325
+ }
2326
+ function ge(e, t) {
2327
+ Yr(() => {
2328
+ var n = e.getRootNode(), r = (
2329
+ /** @type {ShadowRoot} */
2330
+ n.host ? (
2331
+ /** @type {ShadowRoot} */
2332
+ n
2333
+ ) : (
2334
+ /** @type {Document} */
2335
+ n.head ?? /** @type {Document} */
2336
+ n.ownerDocument.head
2337
+ )
2338
+ );
2339
+ if (!r.querySelector("#" + t.hash)) {
2340
+ const i = kn("style");
2341
+ i.id = t.hash, i.textContent = t.code, r.appendChild(i);
2342
+ }
2343
+ });
2344
+ }
2345
+ function qn(e) {
2346
+ var t, n, r = "";
2347
+ if (typeof e == "string" || typeof e == "number") r += e;
2348
+ else if (typeof e == "object") if (Array.isArray(e)) {
2349
+ var i = e.length;
2350
+ for (t = 0; t < i; t++) e[t] && (n = qn(e[t])) && (r && (r += " "), r += n);
2351
+ } else for (n in e) e[n] && (r && (r += " "), r += n);
2352
+ return r;
2353
+ }
2354
+ function vi() {
2355
+ for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = qn(e)) && (r && (r += " "), r += t);
2356
+ return r;
2357
+ }
2358
+ function hi(e) {
2359
+ return typeof e == "object" ? vi(e) : e ?? "";
2360
+ }
2361
+ const Jt = [...`
2362
+ \r\f \v\uFEFF`];
2363
+ function pi(e, t, n) {
2364
+ var r = e == null ? "" : "" + e;
2365
+ if (t && (r = r ? r + " " + t : t), n) {
2366
+ for (var i of Object.keys(n))
2367
+ if (n[i])
2368
+ r = r ? r + " " + i : i;
2369
+ else if (r.length)
2370
+ for (var s = i.length, o = 0; (o = r.indexOf(i, o)) >= 0; ) {
2371
+ var a = o + s;
2372
+ (o === 0 || Jt.includes(r[o - 1])) && (a === r.length || Jt.includes(r[a])) ? r = (o === 0 ? "" : r.substring(0, o)) + r.substring(a + 1) : o = a;
2373
+ }
2374
+ }
2375
+ return r === "" ? null : r;
2376
+ }
2377
+ function gi(e, t) {
2378
+ return e == null ? null : String(e);
2379
+ }
2380
+ function Hn(e, t, n, r, i, s) {
2381
+ var o = e.__className;
2382
+ if (o !== n || o === void 0) {
2383
+ var a = pi(n, r, s);
2384
+ a == null ? e.removeAttribute("class") : e.className = a, e.__className = n;
2385
+ } else if (s && i !== s)
2386
+ for (var l in s) {
2387
+ var f = !!s[l];
2388
+ (i == null || f !== !!i[l]) && e.classList.toggle(l, f);
2389
+ }
2390
+ return s;
2391
+ }
2392
+ function y(e, t, n, r) {
2393
+ var i = e.__style;
2394
+ if (i !== t) {
2395
+ var s = gi(t);
2396
+ s == null ? e.removeAttribute("style") : e.style.cssText = s, e.__style = t;
2397
+ }
2398
+ return r;
2399
+ }
2400
+ const _i = /* @__PURE__ */ Symbol("is custom element"), xi = /* @__PURE__ */ Symbol("is html");
2401
+ function at(e, t, n, r) {
2402
+ var i = mi(e);
2403
+ i[t] !== (i[t] = n) && (t === "loading" && (e[ar] = n), n == null ? e.removeAttribute(t) : typeof n != "string" && wi(e).includes(t) ? e[t] = n : e.setAttribute(t, n));
2404
+ }
2405
+ function mi(e) {
2406
+ return (
2407
+ /** @type {Record<string | symbol, unknown>} **/
2408
+ // @ts-expect-error
2409
+ e.__attributes ??= {
2410
+ [_i]: e.nodeName.includes("-"),
2411
+ [xi]: e.namespaceURI === $t
2412
+ }
2413
+ );
2414
+ }
2415
+ var Zt = /* @__PURE__ */ new Map();
2416
+ function wi(e) {
2417
+ var t = e.getAttribute("is") || e.nodeName, n = Zt.get(t);
2418
+ if (n) return n;
2419
+ Zt.set(t, n = []);
2420
+ for (var r, i = e, s = Element.prototype; s !== i; ) {
2421
+ r = er(i);
2422
+ for (var o in r)
2423
+ r[o].set && n.push(o);
2424
+ i = tn(i);
2425
+ }
2426
+ return n;
2427
+ }
2428
+ function xt(e, t, n, r) {
2429
+ var i = (
2430
+ /** @type {V} */
2431
+ r
2432
+ ), s = !0, o = () => (s && (s = !1, i = /** @type {V} */
2433
+ r), i), a;
2434
+ a = /** @type {V} */
2435
+ e[t], a === void 0 && r !== void 0 && (a = o());
2436
+ var l;
2437
+ return l = () => {
2438
+ var f = (
2439
+ /** @type {V} */
2440
+ e[t]
2441
+ );
2442
+ return f === void 0 ? o() : (s = !0, f);
2443
+ }, l;
2444
+ }
2445
+ const bi = "5";
2446
+ typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add(bi);
2447
+ var yi = /* @__PURE__ */ C('<div class="text-wrapper svelte-qvulfy"><p class="text-element svelte-qvulfy"> </p></div>');
2448
+ const Ei = {
2449
+ hash: "svelte-qvulfy",
2450
+ code: ".text-wrapper.svelte-qvulfy {width:100%;margin-left:auto;margin-right:auto;}.text-element.svelte-qvulfy {margin:0;word-wrap:break-word;white-space:pre-wrap;}"
2451
+ };
2452
+ function ki(e, t) {
2453
+ ie(t, !0), ge(e, Ei);
2454
+ var n = yi(), r = m(n), i = m(r);
2455
+ N(() => {
2456
+ y(r, `
2457
+ font-size: ${t.settings.fontSize ?? ""}px;
2458
+ font-weight: ${t.settings.fontWeight ?? ""};
2459
+ line-height: ${t.settings.lineHeight ?? ""};
2460
+ letter-spacing: ${t.settings.letterSpacing ?? ""}px;
2461
+ `), A(i, t.settings.text);
2462
+ }), T(e, n), se();
2463
+ }
2464
+ var Ti = /* @__PURE__ */ C('<div class="button-wrapper svelte-1xlikgk"><button class="cta-button svelte-1xlikgk"> </button></div>');
2465
+ const Ci = {
2466
+ hash: "svelte-1xlikgk",
2467
+ code: ".button-wrapper.svelte-1xlikgk {display:flex;justify-content:center;width:100%;max-width:750px;margin:0 auto;}.cta-button.svelte-1xlikgk {font-weight:700;border:none;cursor:pointer;letter-spacing:0.02em;transition:opacity 0.2s ease;}.cta-button.svelte-1xlikgk:hover {opacity:0.9;}"
2468
+ };
2469
+ function Si(e, t) {
2470
+ ie(t, !0), ge(e, Ci);
2471
+ var n = Ti(), r = m(n), i = m(r);
2472
+ N(() => {
2473
+ y(n, `margin-top: ${t.settings.marginTop ?? ""}px;`), y(r, `
2474
+ background: ${t.settings.backgroundColor ?? ""};
2475
+ color: ${t.settings.textColor ?? ""};
2476
+ border-radius: ${t.settings.borderRadius ?? ""}px;
2477
+ padding: ${t.settings.paddingY ?? ""}px ${t.settings.paddingX ?? ""}px;
2478
+ font-size: ${t.settings.fontSize ?? ""}px;
2479
+ `), A(i, t.settings.text);
2480
+ }), T(e, n), se();
2481
+ }
2482
+ var Ai = /* @__PURE__ */ C('<div class="auth-banner svelte-l4l5xk"><div class="auth-left svelte-l4l5xk"><div class="auth-icon svelte-l4l5xk"><svg width="18" height="18" viewBox="0 0 24 24" fill="none"><path d="M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z"></path></svg></div> <p class="auth-prompt svelte-l4l5xk"> </p></div> <div class="auth-buttons svelte-l4l5xk"><button class="auth-btn login-btn svelte-l4l5xk"> </button> <button class="auth-btn signup-btn svelte-l4l5xk"> </button></div></div>');
2483
+ const Mi = {
2484
+ hash: "svelte-l4l5xk",
2485
+ code: `.auth-banner.svelte-l4l5xk {display:flex;align-items:center;justify-content:space-between;gap:20px;border-radius:10px;border:1.5px solid;max-width:750px;width:100%;margin:0 auto;}.auth-left.svelte-l4l5xk {display:flex;align-items:center;gap:16px;flex:1;}.auth-icon.svelte-l4l5xk {display:flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:50%;border:2px solid;flex-shrink:0;}.auth-prompt.svelte-l4l5xk {font-size:0.95rem;line-height:1.4;margin:0;}.auth-buttons.svelte-l4l5xk {display:flex;gap:12px;flex-shrink:0;}.auth-btn.svelte-l4l5xk {height:48px;border-radius:8px;padding:13px 32px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:600;border:none;cursor:pointer;white-space:nowrap;}
2486
+
2487
+ @media (max-width: 640px) {.auth-banner.svelte-l4l5xk {flex-direction:column;text-align:center;}.auth-left.svelte-l4l5xk {flex-direction:column;}.auth-buttons.svelte-l4l5xk {width:100%;}.auth-btn.svelte-l4l5xk {flex:1;}
2488
+ }`
2489
+ };
2490
+ function Ni(e, t) {
2491
+ ie(t, !0), ge(e, Mi);
2492
+ var n = Ai(), r = m(n), i = m(r), s = m(i), o = m(s), a = I(i, 2), l = m(a), f = I(r, 2), u = m(f), h = m(u), d = I(u, 2), g = m(d);
2493
+ N(() => {
2494
+ y(n, `border-color: ${t.settings.borderColor ?? ""}; background: ${t.settings.backgroundColor ?? ""}; margin-top: ${t.settings.marginTop ?? ""}px; padding: ${t.settings.padding ?? ""}px;`), y(i, `border-color: ${t.settings.iconColor ?? ""};`), at(o, "fill", t.settings.iconColor), y(a, `color: ${t.settings.textColor ?? ""};`), A(l, t.settings.promptText), y(u, `background: ${t.settings.loginButtonBackground ?? ""}; color: ${t.settings.loginButtonColor ?? ""};`), A(h, t.settings.loginButtonText), y(d, `background: ${t.settings.signupButtonBackground ?? ""}; color: ${t.settings.signupButtonColor ?? ""};`), A(g, t.settings.signupButtonText);
2495
+ }), T(e, n), se();
2496
+ }
2497
+ var Ri = /* @__PURE__ */ C('<img alt="Banner" class="banner-image svelte-pvxr6w"/>'), Oi = /* @__PURE__ */ C('<div class="banner-placeholder svelte-pvxr6w"><span class="placeholder-icon svelte-pvxr6w">&#128444;</span> <span class="placeholder-text svelte-pvxr6w">No image — select this element and upload one</span></div>');
2498
+ const Di = {
2499
+ hash: "svelte-pvxr6w",
2500
+ code: ".banner-image.svelte-pvxr6w {display:block;width:100%;height:auto;max-height:480px;object-fit:cover;}.banner-placeholder.svelte-pvxr6w {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:48px 24px;border:1.5px dashed rgba(255, 255, 255, 0.12);background:rgba(255, 255, 255, 0.03);}.placeholder-icon.svelte-pvxr6w {font-size:2rem;opacity:0.3;}.placeholder-text.svelte-pvxr6w {font-size:0.8rem;color:rgba(255, 255, 255, 0.3);text-align:center;}"
2501
+ };
2502
+ function zi(e, t) {
2503
+ ie(t, !0), ge(e, Di);
2504
+ var n = Ln(), r = Dt(n);
2505
+ {
2506
+ var i = (o) => {
2507
+ var a = Ri();
2508
+ N(() => at(a, "src", t.settings.image)), T(o, a);
2509
+ }, s = (o) => {
2510
+ var a = Oi();
2511
+ T(o, a);
2512
+ };
2513
+ Me(r, (o) => {
2514
+ t.settings.image ? o(i) : o(s, -1);
2515
+ });
2516
+ }
2517
+ T(e, n), se();
2518
+ }
2519
+ var Ii = /* @__PURE__ */ C('<div class="badge-wrapper svelte-1ym3cq2"><span class="badge svelte-1ym3cq2"> </span></div>');
2520
+ const Fi = {
2521
+ hash: "svelte-1ym3cq2",
2522
+ code: ".badge-wrapper.svelte-1ym3cq2 {display:flex;max-width:750px;width:100%;margin:0 auto;}.badge.svelte-1ym3cq2 {display:inline-block;font-weight:700;text-transform:uppercase;letter-spacing:0.06em;line-height:1;white-space:nowrap;}"
2523
+ };
2524
+ function Pi(e, t) {
2525
+ ie(t, !0), ge(e, Fi);
2526
+ const n = { left: "flex-start", center: "center", right: "flex-end" };
2527
+ var r = Ii(), i = m(r), s = m(i);
2528
+ N(() => {
2529
+ y(r, `justify-content: ${n[t.settings.align] ?? "center" ?? ""}; margin-top: ${t.settings.marginTop ?? ""}px;`), y(i, `
2530
+ background: ${t.settings.backgroundColor ?? ""};
2531
+ color: ${t.settings.textColor ?? ""};
2532
+ border-radius: ${t.settings.borderRadius ?? ""}px;
2533
+ padding: ${t.settings.paddingY ?? ""}px ${t.settings.paddingX ?? ""}px;
2534
+ font-size: ${t.settings.fontSize ?? ""}px;
2535
+ `), A(s, t.settings.text);
2536
+ }), T(e, r), se();
2537
+ }
2538
+ var ji = /* @__PURE__ */ C('<div class="arrow svelte-ixrd3u"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M9 6l6 6-6 6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg></div>'), Li = /* @__PURE__ */ C('<!> <div class="card svelte-ixrd3u"><h3 class="card-title svelte-ixrd3u"> </h3> <p class="card-content svelte-ixrd3u"> </p></div>', 1), Bi = /* @__PURE__ */ C('<div class="cards-row svelte-ixrd3u"></div>'), qi = /* @__PURE__ */ C('<div class="cards-footer svelte-ixrd3u"><p class="svelte-ixrd3u"> </p></div>'), Hi = /* @__PURE__ */ C('<div class="cards-wrapper svelte-ixrd3u"><!> <!></div>');
2539
+ const Ui = {
2540
+ hash: "svelte-ixrd3u",
2541
+ code: `.cards-wrapper.svelte-ixrd3u {display:flex;flex-direction:column;gap:12px;max-width:750px;width:100%;margin:0 auto;}.cards-row.svelte-ixrd3u {display:flex;align-items:stretch;gap:0;}.arrow.svelte-ixrd3u {display:flex;align-items:center;justify-content:center;flex-shrink:0;padding:0 6px;}.card.svelte-ixrd3u {flex:1;max-width:calc(33.333% - 12px);border-radius:10px;padding:24px 20px;display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px;}.card-title.svelte-ixrd3u {margin:0;font-size:0.95rem;font-weight:800;text-transform:uppercase;letter-spacing:0.03em;}.card-content.svelte-ixrd3u {margin:0;font-size:0.85rem;line-height:1.5;}.cards-footer.svelte-ixrd3u {border-radius:8px;padding:14px 20px;text-align:center;}.cards-footer.svelte-ixrd3u p:where(.svelte-ixrd3u) {margin:0;font-size:0.85rem;line-height:1.5;font-style:italic;}
2542
+
2543
+ @media (max-width: 640px) {.cards-row.svelte-ixrd3u {flex-direction:column;gap:12px;}.card.svelte-ixrd3u {max-width:100%;}.arrow.svelte-ixrd3u {transform:rotate(90deg);padding:4px 0;}
2544
+ }`
2545
+ };
2546
+ function Vi(e, t) {
2547
+ ie(t, !0), ge(e, Ui);
2548
+ const n = /* @__PURE__ */ Je(() => () => {
2549
+ const a = t.settings.cards, l = [];
2550
+ for (let f = 0; f < a.length; f += 3)
2551
+ l.push(a.slice(f, f + 3));
2552
+ return l;
2553
+ });
2554
+ var r = Hi(), i = m(r);
2555
+ $e(i, 17, () => _(n)(), Ct, (a, l) => {
2556
+ var f = Bi();
2557
+ $e(f, 21, () => _(l), Ct, (u, h, d) => {
2558
+ var g = Li(), p = Dt(g);
2559
+ {
2560
+ var w = (P) => {
2561
+ var O = ji();
2562
+ N(() => y(O, `color: ${t.settings.arrowColor ?? ""};`)), T(P, O);
2563
+ };
2564
+ Me(p, (P) => {
2565
+ d > 0 && P(w);
2566
+ });
2567
+ }
2568
+ var c = I(p, 2), v = m(c), E = m(v), x = I(v, 2), M = m(x);
2569
+ N(() => {
2570
+ y(c, `background: ${t.settings.backgroundColor ?? ""}; border: 1px solid ${t.settings.borderColor ?? ""};`), y(v, `color: ${t.settings.titleColor ?? ""};`), A(E, _(h).title), y(x, `color: ${t.settings.contentColor ?? ""};`), A(M, _(h).content);
2571
+ }), T(u, g);
2572
+ }), T(a, f);
2573
+ });
2574
+ var s = I(i, 2);
2575
+ {
2576
+ var o = (a) => {
2577
+ var l = qi(), f = m(l), u = m(f);
2578
+ N(() => {
2579
+ y(l, `background: ${t.settings.footerBackground ?? ""}; color: ${t.settings.footerTextColor ?? ""};`), A(u, t.settings.footerText);
2580
+ }), T(a, l);
2581
+ };
2582
+ Me(s, (a) => {
2583
+ t.settings.footerText && a(o);
2584
+ });
2585
+ }
2586
+ N(() => y(r, `margin-top: ${t.settings.marginTop ?? ""}px;`)), T(e, r), se();
2587
+ }
2588
+ var Yi = /* @__PURE__ */ C('<div class="divider svelte-16e49gq"><div class="divider-line svelte-16e49gq"></div> <span class="divider-text svelte-16e49gq"> </span> <div class="divider-line svelte-16e49gq"></div></div>');
2589
+ const Gi = {
2590
+ hash: "svelte-16e49gq",
2591
+ code: ".divider.svelte-16e49gq {display:flex;align-items:center;justify-content:center;gap:20px;max-width:750px;width:100%;margin:0 auto;}.divider-line.svelte-16e49gq {flex:1;height:1px;}.divider-text.svelte-16e49gq {font-size:14px;font-weight:800;white-space:nowrap;}"
2592
+ };
2593
+ function Ki(e, t) {
2594
+ ie(t, !0), ge(e, Gi);
2595
+ var n = Yi(), r = m(n), i = I(r, 2), s = m(i), o = I(i, 2);
2596
+ N(() => {
2597
+ y(n, `color: ${t.settings.textColor ?? ""};`), y(r, `background: ${t.settings.lineColor ?? ""};`), A(s, t.settings.text), y(o, `background: ${t.settings.lineColor ?? ""};`);
2598
+ }), T(e, n), se();
2599
+ }
2600
+ var Wi = /* @__PURE__ */ C('<div class="terms-content svelte-1t3p06a"><p class="svelte-1t3p06a"> </p></div>'), Xi = /* @__PURE__ */ C('<div class="terms-section svelte-1t3p06a"><button class="terms-header svelte-1t3p06a"><span class="terms-title svelte-1t3p06a"> </span> <div><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M8 11L3 5.5h10L8 11z" fill="currentColor"></path></svg></div></button> <!></div>'), Ji = /* @__PURE__ */ C('<div class="terms-wrapper svelte-1t3p06a"><div class="terms-container svelte-1t3p06a"><div class="terms-main-header svelte-1t3p06a"><span class="terms-main-title svelte-1t3p06a"> </span></div> <!></div></div>');
2601
+ const Zi = {
2602
+ hash: "svelte-1t3p06a",
2603
+ code: ".terms-wrapper.svelte-1t3p06a {max-width:750px;width:100%;margin:0 auto;}.terms-container.svelte-1t3p06a {border-radius:8px;overflow:hidden;}.terms-main-header.svelte-1t3p06a {padding:18px 20px;border-bottom:1px solid rgba(177, 202, 223, 0.1);}.terms-main-title.svelte-1t3p06a {font-size:1.15rem;font-weight:600;}.terms-section.svelte-1t3p06a {border-top:1px solid;}.terms-section.svelte-1t3p06a:first-of-type {border-top:none;}.terms-header.svelte-1t3p06a {display:flex;width:100%;align-items:center;justify-content:space-between;padding:16px 20px;background:none;border:none;cursor:pointer;}.terms-title.svelte-1t3p06a {font-size:1rem;font-weight:500;text-align:start;}.terms-arrow.svelte-1t3p06a {display:flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:50%;padding:4px;transition:transform 0.2s ease;flex-shrink:0;}.terms-arrow.rotated.svelte-1t3p06a {transform:rotate(180deg);}.terms-content.svelte-1t3p06a {padding:0 20px 20px;font-size:0.875rem;line-height:1.6;opacity:0.8;}.terms-content.svelte-1t3p06a p:where(.svelte-1t3p06a) {margin:0;}"
2604
+ };
2605
+ function Qi(e, t) {
2606
+ ie(t, !0), ge(e, Zi);
2607
+ let n = /* @__PURE__ */ H(he(/* @__PURE__ */ new Set()));
2608
+ function r(u) {
2609
+ _(n).has(u) ? _(n).delete(u) : _(n).add(u), B(n, new Set(_(n)), !0);
2610
+ }
2611
+ var i = Ji(), s = m(i), o = m(s), a = m(o), l = m(a), f = I(o, 2);
2612
+ $e(f, 17, () => t.settings.sections, Ct, (u, h, d) => {
2613
+ var g = Xi(), p = m(g), w = m(p), c = m(w), v = I(w, 2);
2614
+ let E;
2615
+ var x = I(p, 2);
2616
+ {
2617
+ var M = (O) => {
2618
+ var D = Wi(), $ = m(D), le = m($);
2619
+ N(() => {
2620
+ y(D, `color: ${t.settings.textColor ?? ""};`), A(le, _(h).content);
2621
+ }), T(O, D);
2622
+ }, P = /* @__PURE__ */ Je(() => _(n).has(d));
2623
+ Me(x, (O) => {
2624
+ _(P) && O(M);
2625
+ });
2626
+ }
2627
+ N(
2628
+ (O) => {
2629
+ y(g, `border-color: ${t.settings.borderColor ?? ""};`), y(p, `color: ${t.settings.textColor ?? ""};`), A(c, _(h).title), E = Hn(v, 1, "terms-arrow svelte-1t3p06a", null, E, O), y(v, `background: ${t.settings.arrowBackground ?? ""};`);
2630
+ },
2631
+ [() => ({ rotated: _(n).has(d) })]
2632
+ ), $r("click", p, () => r(d)), T(u, g);
2633
+ }), N(() => {
2634
+ y(i, `margin-top: ${t.settings.marginTop ?? ""}px;`), y(s, `background-color: ${t.settings.backgroundColor ?? ""}; border: 1px solid ${t.settings.borderColor ?? ""};`), y(o, `color: ${t.settings.textColor ?? ""};`), A(l, t.settings.title);
2635
+ }), T(e, i), se();
2636
+ }
2637
+ ei(["click"]);
2638
+ var $i = /* @__PURE__ */ C('<div class="placeholder svelte-1x15dd8"><span class="placeholder-icon svelte-1x15dd8">&#128722;</span> <span class="placeholder-text svelte-1x15dd8">Enter an API URL in settings to load products</span></div>'), es = /* @__PURE__ */ C('<div class="placeholder svelte-1x15dd8"><span class="placeholder-text svelte-1x15dd8">Loading products...</span></div>'), ts = /* @__PURE__ */ C('<div class="placeholder error svelte-1x15dd8"><span class="placeholder-text svelte-1x15dd8"> </span></div>'), ns = /* @__PURE__ */ C('<div class="placeholder svelte-1x15dd8"><span class="placeholder-text svelte-1x15dd8">No products found</span></div>'), rs = /* @__PURE__ */ C('<span class="discount-badge svelte-1x15dd8"> </span>'), is = /* @__PURE__ */ C('<span class="old-price svelte-1x15dd8"> </span>'), ss = /* @__PURE__ */ C('<div class="product-card svelte-1x15dd8"><div class="product-image-wrap svelte-1x15dd8"><img class="product-image svelte-1x15dd8"/> <!></div> <div class="product-info svelte-1x15dd8"><span class="product-brand svelte-1x15dd8"> </span> <h4 class="product-title svelte-1x15dd8"> </h4> <p class="product-desc svelte-1x15dd8"> </p> <div class="product-rating svelte-1x15dd8"> <span class="rating-num svelte-1x15dd8"> </span></div> <div class="product-price svelte-1x15dd8"><span class="current-price svelte-1x15dd8"> </span> <!></div></div></div>'), ls = /* @__PURE__ */ C('<div class="products-grid svelte-1x15dd8"></div>'), as = /* @__PURE__ */ C('<div class="products-wrapper svelte-1x15dd8"><!></div>');
2639
+ const os = {
2640
+ hash: "svelte-1x15dd8",
2641
+ code: `.products-wrapper.svelte-1x15dd8 {max-width:750px;width:100%;margin:0 auto;}.placeholder.svelte-1x15dd8 {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:48px 24px;border:1.5px dashed rgba(255, 255, 255, 0.12);border-radius:8px;background:rgba(255, 255, 255, 0.03);}.placeholder.error.svelte-1x15dd8 {border-color:rgba(239, 68, 68, 0.3);}.placeholder-icon.svelte-1x15dd8 {font-size:2rem;opacity:0.3;}.placeholder-text.svelte-1x15dd8 {font-size:0.8rem;color:rgba(255, 255, 255, 0.3);text-align:center;}.products-grid.svelte-1x15dd8 {display:grid;gap:14px;}.product-card.svelte-1x15dd8 {border-radius:10px;overflow:hidden;display:flex;flex-direction:column;}.product-image-wrap.svelte-1x15dd8 {position:relative;width:100%;aspect-ratio:4/3;overflow:hidden;background:rgba(0, 0, 0, 0.2);}.product-image.svelte-1x15dd8 {width:100%;height:100%;object-fit:cover;}.discount-badge.svelte-1x15dd8 {position:absolute;top:8px;right:8px;padding:3px 8px;border-radius:6px;font-size:0.7rem;font-weight:700;}.product-info.svelte-1x15dd8 {padding:14px;display:flex;flex-direction:column;gap:6px;flex:1;}.product-brand.svelte-1x15dd8 {font-size:0.65rem;text-transform:uppercase;letter-spacing:0.08em;color:rgba(255, 255, 255, 0.35);font-weight:600;}.product-title.svelte-1x15dd8 {margin:0;font-size:0.85rem;font-weight:600;line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}.product-desc.svelte-1x15dd8 {margin:0;font-size:0.75rem;line-height:1.4;}.product-rating.svelte-1x15dd8 {font-size:0.75rem;display:flex;align-items:center;gap:4px;}.rating-num.svelte-1x15dd8 {font-size:0.7rem;opacity:0.6;color:rgba(255, 255, 255, 0.5);}.product-price.svelte-1x15dd8 {display:flex;align-items:baseline;gap:8px;margin-top:auto;padding-top:6px;}.current-price.svelte-1x15dd8 {font-size:1rem;font-weight:700;}.old-price.svelte-1x15dd8 {font-size:0.8rem;text-decoration:line-through;}
2642
+
2643
+ @media (max-width: 640px) {.products-grid.svelte-1x15dd8 {grid-template-columns:repeat(2, 1fr) !important;}
2644
+ }
2645
+
2646
+ @media (max-width: 400px) {.products-grid.svelte-1x15dd8 {grid-template-columns:1fr !important;}
2647
+ }`
2648
+ };
2649
+ function fs(e, t) {
2650
+ ie(t, !0), ge(e, os);
2651
+ let n = /* @__PURE__ */ H(he([])), r = /* @__PURE__ */ H(!1), i = /* @__PURE__ */ H(""), s = /* @__PURE__ */ H("");
2652
+ Ur(() => {
2653
+ const c = t.settings.apiUrl;
2654
+ !c || c === _(s) || (B(s, c, !0), o(c));
2655
+ });
2656
+ async function o(c) {
2657
+ B(r, !0), B(i, "");
2658
+ try {
2659
+ const v = await fetch(c);
2660
+ if (!v.ok) throw new Error(`HTTP ${v.status}`);
2661
+ const E = await v.json();
2662
+ B(n, E.products ?? E.data ?? (Array.isArray(E) ? E : []), !0);
2663
+ } catch (v) {
2664
+ B(i, v instanceof Error ? v.message : "Failed to fetch", !0), B(n, [], !0);
2665
+ } finally {
2666
+ B(r, !1);
2667
+ }
2668
+ }
2669
+ function a(c, v) {
2670
+ return `${v === "USD" ? "$" : v} ${c}`;
2671
+ }
2672
+ function l(c) {
2673
+ const v = Math.floor(c), E = c - v >= 0.5 ? 1 : 0, x = 5 - v - E;
2674
+ return "★".repeat(v) + (E ? "½" : "") + "☆".repeat(x);
2675
+ }
2676
+ var f = as(), u = m(f);
2677
+ {
2678
+ var h = (c) => {
2679
+ var v = $i();
2680
+ T(c, v);
2681
+ }, d = (c) => {
2682
+ var v = es();
2683
+ T(c, v);
2684
+ }, g = (c) => {
2685
+ var v = ts(), E = m(v), x = m(E);
2686
+ N(() => A(x, `Error: ${_(i) ?? ""}`)), T(c, v);
2687
+ }, p = (c) => {
2688
+ var v = ns();
2689
+ T(c, v);
2690
+ }, w = (c) => {
2691
+ var v = ls();
2692
+ $e(v, 21, () => _(n), (E) => E._id, (E, x) => {
2693
+ var M = ss(), P = m(M), O = m(P), D = I(O, 2);
2694
+ {
2695
+ var $ = (ue) => {
2696
+ var ce = rs(), Ye = m(ce);
2697
+ N(() => {
2698
+ y(ce, `background: ${t.settings.discountBadgeBackground ?? ""}; color: ${t.settings.discountBadgeColor ?? ""};`), A(Ye, `-${_(x).price.discountPercentage ?? ""}%`);
2699
+ }), T(ue, ce);
2700
+ };
2701
+ Me(D, (ue) => {
2702
+ _(x).price.discountPercentage > 0 && ue($);
2703
+ });
2704
+ }
2705
+ var le = I(P, 2), z = m(le), ct = m(z), Ve = I(z, 2), Un = m(Ve), dt = I(Ve, 2), Vn = m(dt), vt = I(dt, 2), jt = m(vt), Yn = I(jt), Gn = m(Yn), Kn = I(vt, 2), ht = m(Kn), Wn = m(ht), Xn = I(ht, 2);
2706
+ {
2707
+ var Jn = (ue) => {
2708
+ var ce = is(), Ye = m(ce);
2709
+ N(
2710
+ (pt) => {
2711
+ y(ce, `color: ${t.settings.oldPriceColor ?? ""};`), A(Ye, pt);
2712
+ },
2713
+ [
2714
+ () => a(_(x).price.beforeDiscount, _(x).price.currency)
2715
+ ]
2716
+ ), T(ue, ce);
2717
+ };
2718
+ Me(Xn, (ue) => {
2719
+ _(x).price.beforeDiscount > _(x).price.current && ue(Jn);
2720
+ });
2721
+ }
2722
+ N(
2723
+ (ue, ce, Ye, pt) => {
2724
+ y(M, `background: ${t.settings.cardBackground ?? ""}; border: 1px solid ${t.settings.cardBorder ?? ""};`), at(O, "src", _(x).thumbnail), at(O, "alt", _(x).title), A(ct, _(x).brand), y(Ve, `color: ${t.settings.titleColor ?? ""};`), A(Un, _(x).title), y(dt, `color: ${t.settings.descriptionColor ?? ""};`), A(Vn, ue), y(vt, `color: ${t.settings.ratingColor ?? ""};`), A(jt, `${ce ?? ""} `), A(Gn, Ye), y(ht, `color: ${t.settings.priceColor ?? ""};`), A(Wn, pt);
2725
+ },
2726
+ [
2727
+ () => _(x).description.length > 80 ? _(x).description.slice(0, 80) + "..." : _(x).description,
2728
+ () => l(_(x).rating),
2729
+ () => _(x).rating.toFixed(1),
2730
+ () => a(_(x).price.current, _(x).price.currency)
2731
+ ]
2732
+ ), T(E, M);
2733
+ }), N(() => y(v, `grid-template-columns: repeat(${t.settings.columns ?? ""}, 1fr);`)), T(c, v);
2734
+ };
2735
+ Me(u, (c) => {
2736
+ t.settings.apiUrl ? _(r) ? c(d, 1) : _(i) ? c(g, 2) : _(n).length === 0 ? c(p, 3) : c(w, -1) : c(h);
2737
+ });
2738
+ }
2739
+ N(() => y(f, `margin-top: ${t.settings.marginTop ?? ""}px;`)), T(e, f), se();
2740
+ }
2741
+ const us = {
2742
+ text: ki,
2743
+ button: Si,
2744
+ auth: Ni,
2745
+ banner: zi,
2746
+ badge: Pi,
2747
+ cards: Vi,
2748
+ divider: Ki,
2749
+ terms: Qi,
2750
+ products: fs
2751
+ };
2752
+ function Qt(e) {
2753
+ return e === null || typeof e != "object" || Array.isArray(e) ? !1 : typeof e.en == "string";
2754
+ }
2755
+ function cs(e, t) {
2756
+ return Qt(e) ? e[t] ?? e.en ?? "" : Array.isArray(e) ? e.map((n) => {
2757
+ if (n === null || typeof n != "object") return n;
2758
+ const r = {};
2759
+ for (const [i, s] of Object.entries(n))
2760
+ r[i] = Qt(s) ? s[t] ?? s.en ?? "" : s;
2761
+ return r;
2762
+ }) : e;
2763
+ }
2764
+ function ds(e, t) {
2765
+ const n = {};
2766
+ for (const [r, i] of Object.entries(e))
2767
+ n[r] = cs(i, t);
2768
+ return n;
2769
+ }
2770
+ var vs = /* @__PURE__ */ C("<div></div>");
2771
+ function hs(e, t) {
2772
+ ie(t, !0);
2773
+ let n = xt(t, "locale", 3, "en"), r = xt(t, "containerClass", 3, ""), i = xt(t, "containerStyle", 3, "");
2774
+ const s = /* @__PURE__ */ Je(() => () => {
2775
+ const l = t.data.global;
2776
+ return [
2777
+ `background: ${l.background ?? "#ffffff"}`,
2778
+ `padding-top: ${l.paddingTop ?? 0}px`,
2779
+ `padding-bottom: ${l.paddingBottom ?? 0}px`,
2780
+ `padding-left: ${l.paddingLeft ?? 0}px`,
2781
+ `padding-right: ${l.paddingRight ?? 0}px`,
2782
+ i()
2783
+ ].filter(Boolean).join("; ");
2784
+ }), o = /* @__PURE__ */ Je(() => t.data.components.map((l) => ({
2785
+ component: us[l.name],
2786
+ settings: ds(l.settings, n()),
2787
+ name: l.name
2788
+ })).filter((l) => l.component !== void 0));
2789
+ var a = vs();
2790
+ $e(a, 21, () => _(o), ({ component: l, settings: f, name: u }) => u + JSON.stringify(f), (l, f) => {
2791
+ let u = () => _(f).component, h = () => _(f).settings;
2792
+ const d = /* @__PURE__ */ Je(u);
2793
+ var g = Ln(), p = Dt(g);
2794
+ di(p, () => _(d), (w, c) => {
2795
+ c(w, {
2796
+ get settings() {
2797
+ return h();
2798
+ }
2799
+ });
2800
+ }), T(l, g);
2801
+ }), N(
2802
+ (l) => {
2803
+ Hn(a, 1, hi(r())), y(a, l);
2804
+ },
2805
+ [() => _(s)()]
2806
+ ), T(e, a), se();
2807
+ }
2808
+ function gs(e, t, n = "en") {
2809
+ let r = /* @__PURE__ */ H(he(t)), i = /* @__PURE__ */ H(he(n));
2810
+ const s = li(hs, {
2811
+ target: e,
2812
+ props: {
2813
+ get data() {
2814
+ return _(r);
2815
+ },
2816
+ get locale() {
2817
+ return _(i);
2818
+ }
2819
+ }
2820
+ });
2821
+ return {
2822
+ update(o) {
2823
+ B(r, o, !0);
2824
+ },
2825
+ setLocale(o) {
2826
+ B(i, o, !0);
2827
+ },
2828
+ destroy() {
2829
+ oi(s);
2830
+ }
2831
+ };
2832
+ }
2833
+ export {
2834
+ gs as createRenderer
2835
+ };