@reevit/svelte 0.4.0 → 0.4.6

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.
package/dist/index.mjs CHANGED
@@ -1,133 +1,133 @@
1
- import { createEventDispatcher as tn, onMount as Er, onDestroy as Pr } from "svelte";
2
- import { createInitialState as Sr, ReevitAPIClient as Ir, generateReference as kr, detectCountryFromCurrency as Cr, reevitReducer as Rr, formatAmount as bn, cn as ge, validatePhone as qt, detectNetwork as xr, createThemeVariables as Mr } from "@reevit/core";
3
- import { ReevitAPIClient as Ha, cn as qa, createInitialState as Ka, createReevitClient as Va, detectCountryFromCurrency as Ba, detectNetwork as Ya, formatAmount as Wa, formatPhone as Ga, reevitReducer as Za, validatePhone as Ja } from "@reevit/core";
4
- const Tr = "5";
5
- typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add(Tr);
6
- let ot = !1, Ar = !1;
7
- function Nr() {
8
- ot = !0;
9
- }
10
- Nr();
11
- const Or = 1, Dr = 2, Fr = 16, Lr = 1, Ur = 2, jr = 4, zr = 8, Hr = 16, qr = 1, Kr = 2, K = /* @__PURE__ */ Symbol(), Yt = !1;
12
- var Tn = Array.isArray, Vr = Array.prototype.indexOf, nn = Array.from, An = Object.defineProperty, mt = Object.getOwnPropertyDescriptor, Br = Object.getOwnPropertyDescriptors, Yr = Object.prototype, Wr = Array.prototype, Nn = Object.getPrototypeOf;
13
- const Wt = () => {
1
+ import { createEventDispatcher as Xt, onMount as ni, onDestroy as ri } from "svelte";
2
+ import { createInitialState as ii, ReevitAPIClient as si, generateReference as ai, detectCountryFromCurrency as oi, reevitReducer as li, cn as ue, validatePhone as wn, detectNetwork as ci, createThemeVariables as ui, createReevitClient as fi } from "@reevit/core";
3
+ import { ReevitAPIClient as Ba, cn as Va, createInitialState as Ya, createReevitClient as Ga, detectCountryFromCurrency as Wa, detectNetwork as Ja, formatAmount as Za, formatPhone as Qa, reevitReducer as Xa, validatePhone as $a } from "@reevit/core";
4
+ const di = "5";
5
+ typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add(di);
6
+ let Nt = !1, vi = !1;
7
+ function pi() {
8
+ Nt = !0;
9
+ }
10
+ pi();
11
+ const hi = 1, mi = 2, cr = 4, _i = 8, yi = 16, bi = 1, gi = 2, wi = 4, Ei = 8, Pi = 16, Si = 1, ki = 2, se = /* @__PURE__ */ Symbol(), Ii = "http://www.w3.org/1999/xhtml", kn = !1;
12
+ var ur = Array.isArray, Mi = Array.prototype.indexOf, Fn = Array.from, fr = Object.defineProperty, Kt = Object.getOwnPropertyDescriptor, dr = Object.getOwnPropertyDescriptors, Ci = Object.prototype, xi = Array.prototype, Dn = Object.getPrototypeOf;
13
+ const In = () => {
14
14
  };
15
- function Gr(e) {
15
+ function Ri(e) {
16
16
  return e();
17
17
  }
18
- function Gt(e) {
18
+ function Mn(e) {
19
19
  for (var t = 0; t < e.length; t++)
20
20
  e[t]();
21
21
  }
22
- function On() {
23
- var e, t, n = new Promise((r, a) => {
24
- e = r, t = a;
22
+ function vr() {
23
+ var e, t, n = new Promise((r, s) => {
24
+ e = r, t = s;
25
25
  });
26
26
  return { promise: n, resolve: e, reject: t };
27
27
  }
28
- const q = 2, Dn = 4, Rt = 8, Zr = 1 << 24, me = 16, _e = 32, Ye = 64, rn = 128, re = 512, z = 1024, G = 2048, ie = 4096, J = 8192, de = 16384, an = 32768, tt = 65536, wn = 1 << 17, Fn = 1 << 18, xt = 1 << 19, Ln = 1 << 20, Ee = 1 << 25, Oe = 32768, Zt = 1 << 21, sn = 1 << 22, Pe = 1 << 23, Ve = /* @__PURE__ */ Symbol("$state"), Jr = /* @__PURE__ */ Symbol("legacy props"), qe = new class extends Error {
28
+ const re = 2, pr = 4, $t = 8, Ti = 1 << 24, Ne = 16, Le = 32, ht = 64, Un = 128, Pe = 512, te = 1024, fe = 2048, Se = 4096, _e = 8192, Re = 16384, jn = 32768, It = 65536, Qn = 1 << 17, hr = 1 << 18, en = 1 << 19, mr = 1 << 20, xe = 1 << 25, tt = 32768, Cn = 1 << 21, zn = 1 << 22, qe = 1 << 23, vt = /* @__PURE__ */ Symbol("$state"), Ai = /* @__PURE__ */ Symbol("legacy props"), Ni = /* @__PURE__ */ Symbol(""), ft = new class extends Error {
29
29
  name = "StaleReactionError";
30
30
  message = "The reaction that called `getAbortSignal()` was re-run or destroyed";
31
31
  }();
32
- function Qr() {
32
+ function Li() {
33
33
  throw new Error("https://svelte.dev/e/async_derived_orphan");
34
34
  }
35
- function Xr(e) {
35
+ function Oi(e) {
36
36
  throw new Error("https://svelte.dev/e/effect_in_teardown");
37
37
  }
38
- function $r() {
38
+ function Fi() {
39
39
  throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
40
40
  }
41
- function ei(e) {
41
+ function Di(e) {
42
42
  throw new Error("https://svelte.dev/e/effect_orphan");
43
43
  }
44
- function ti() {
44
+ function Ui() {
45
45
  throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
46
46
  }
47
- function ni(e) {
47
+ function ji(e) {
48
48
  throw new Error("https://svelte.dev/e/props_invalid_value");
49
49
  }
50
- function ri() {
50
+ function zi() {
51
51
  throw new Error("https://svelte.dev/e/state_descriptors_fixed");
52
52
  }
53
- function ii() {
53
+ function Hi() {
54
54
  throw new Error("https://svelte.dev/e/state_prototype_fixed");
55
55
  }
56
- function ai() {
56
+ function Ki() {
57
57
  throw new Error("https://svelte.dev/e/state_unsafe_mutation");
58
58
  }
59
- function Un(e) {
59
+ function _r(e) {
60
60
  return e === this.v;
61
61
  }
62
- function si(e, t) {
62
+ function qi(e, t) {
63
63
  return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function";
64
64
  }
65
- function jn(e) {
66
- return !si(e, this.v);
65
+ function yr(e) {
66
+ return !qi(e, this.v);
67
67
  }
68
- let j = null;
69
- function yt(e) {
70
- j = e;
68
+ let $ = null;
69
+ function Bt(e) {
70
+ $ = e;
71
71
  }
72
- function on(e, t = !1, n) {
73
- j = {
74
- p: j,
72
+ function tn(e, t = !1, n) {
73
+ $ = {
74
+ p: $,
75
75
  i: !1,
76
76
  c: null,
77
77
  e: null,
78
78
  s: e,
79
79
  x: null,
80
- l: ot && !t ? { s: null, u: null, $: [] } : null
80
+ l: Nt && !t ? { s: null, u: null, $: [] } : null
81
81
  };
82
82
  }
83
- function ln(e) {
83
+ function nn(e) {
84
84
  var t = (
85
85
  /** @type {ComponentContext} */
86
- j
86
+ $
87
87
  ), n = t.e;
88
88
  if (n !== null) {
89
89
  t.e = null;
90
90
  for (var r of n)
91
- Qn(r);
91
+ xr(r);
92
92
  }
93
- return t.i = !0, j = t.p, /** @type {T} */
93
+ return t.i = !0, $ = t.p, /** @type {T} */
94
94
  {};
95
95
  }
96
- function lt() {
97
- return !ot || j !== null && j.l === null;
96
+ function Lt() {
97
+ return !Nt || $ !== null && $.l === null;
98
98
  }
99
- let xe = [];
100
- function zn() {
101
- var e = xe;
102
- xe = [], Gt(e);
99
+ let Je = [];
100
+ function br() {
101
+ var e = Je;
102
+ Je = [], Mn(e);
103
103
  }
104
104
  function Hn(e) {
105
- if (xe.length === 0 && !et) {
106
- var t = xe;
105
+ if (Je.length === 0 && !kt) {
106
+ var t = Je;
107
107
  queueMicrotask(() => {
108
- t === xe && zn();
108
+ t === Je && br();
109
109
  });
110
110
  }
111
- xe.push(e);
111
+ Je.push(e);
112
112
  }
113
- function oi() {
114
- for (; xe.length > 0; )
115
- zn();
113
+ function Bi() {
114
+ for (; Je.length > 0; )
115
+ br();
116
116
  }
117
- function li(e) {
118
- var t = M;
117
+ function Vi(e) {
118
+ var t = j;
119
119
  if (t === null)
120
- return S.f |= Pe, e;
121
- if ((t.f & an) === 0) {
122
- if ((t.f & rn) === 0)
120
+ return N.f |= qe, e;
121
+ if ((t.f & jn) === 0) {
122
+ if ((t.f & Un) === 0)
123
123
  throw e;
124
124
  t.b.error(e);
125
125
  } else
126
- bt(e, t);
126
+ Vt(e, t);
127
127
  }
128
- function bt(e, t) {
128
+ function Vt(e, t) {
129
129
  for (; t !== null; ) {
130
- if ((t.f & rn) !== 0)
130
+ if ((t.f & Un) !== 0)
131
131
  try {
132
132
  t.b.error(e);
133
133
  return;
@@ -138,9 +138,9 @@ function bt(e, t) {
138
138
  }
139
139
  throw e;
140
140
  }
141
- const vt = /* @__PURE__ */ new Set();
142
- let C = null, _t = null, ne = null, te = [], Mt = null, Jt = !1, et = !1;
143
- class nt {
141
+ const zt = /* @__PURE__ */ new Set();
142
+ let L = null, qt = null, ge = null, be = [], rn = null, xn = !1, kt = !1;
143
+ class Mt {
144
144
  committed = !1;
145
145
  /**
146
146
  * The current values of any sources that are updated in this batch
@@ -178,7 +178,7 @@ class nt {
178
178
  * TODO replace with Promise.withResolvers once supported widely enough
179
179
  * @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
180
180
  */
181
- #a = null;
181
+ #s = null;
182
182
  /**
183
183
  * Deferred effects (which run after async work has completed) that are DIRTY
184
184
  * @type {Set<Effect>}
@@ -188,7 +188,7 @@ class nt {
188
188
  * Deferred effects that are MAYBE_DIRTY
189
189
  * @type {Set<Effect>}
190
190
  */
191
- #s = /* @__PURE__ */ new Set();
191
+ #a = /* @__PURE__ */ new Set();
192
192
  /**
193
193
  * A set of branches that still exist, but will be destroyed when this batch
194
194
  * is committed — we skip over these during `process`
@@ -204,7 +204,7 @@ class nt {
204
204
  * @param {Effect[]} root_effects
205
205
  */
206
206
  process(t) {
207
- te = [], _t = null, this.apply();
207
+ be = [], qt = null, this.apply();
208
208
  var n = {
209
209
  parent: null,
210
210
  effect: null,
@@ -213,7 +213,7 @@ class nt {
213
213
  };
214
214
  for (const r of t)
215
215
  this.#l(r, n);
216
- this.is_fork || this.#c(), this.is_deferred() ? (this.#o(n.effects), this.#o(n.render_effects)) : (_t = this, C = null, gn(n.render_effects), gn(n.effects), _t = null, this.#a?.resolve()), ne = null;
216
+ this.is_fork || this.#u(), this.is_deferred() ? (this.#o(n.effects), this.#o(n.render_effects)) : (qt = this, L = null, Xn(n.render_effects), Xn(n.effects), qt = null, this.#s?.resolve()), ge = null;
217
217
  }
218
218
  /**
219
219
  * Traverse the effect tree, executing effects or stashing
@@ -222,26 +222,26 @@ class nt {
222
222
  * @param {EffectTarget} target
223
223
  */
224
224
  #l(t, n) {
225
- t.f ^= z;
225
+ t.f ^= te;
226
226
  for (var r = t.first; r !== null; ) {
227
- var a = r.f, i = (a & (_e | Ye)) !== 0, l = i && (a & z) !== 0, s = l || (a & J) !== 0 || this.skipped_effects.has(r);
228
- if ((r.f & rn) !== 0 && r.b?.is_pending() && (n = {
227
+ var s = r.f, i = (s & (Le | ht)) !== 0, l = i && (s & te) !== 0, o = l || (s & _e) !== 0 || this.skipped_effects.has(r);
228
+ if ((r.f & Un) !== 0 && r.b?.is_pending() && (n = {
229
229
  parent: n,
230
230
  effect: r,
231
231
  effects: [],
232
232
  render_effects: []
233
- }), !s && r.fn !== null) {
234
- i ? r.f ^= z : (a & Dn) !== 0 ? n.effects.push(r) : We(r) && ((r.f & me) !== 0 && this.#i.add(r), Be(r));
235
- var u = r.first;
236
- if (u !== null) {
237
- r = u;
233
+ }), !o && r.fn !== null) {
234
+ i ? r.f ^= te : (s & pr) !== 0 ? n.effects.push(r) : mt(r) && ((r.f & Ne) !== 0 && this.#i.add(r), pt(r));
235
+ var c = r.first;
236
+ if (c !== null) {
237
+ r = c;
238
238
  continue;
239
239
  }
240
240
  }
241
- var o = r.parent;
242
- for (r = r.next; r === null && o !== null; )
243
- o === n.effect && (this.#o(n.effects), this.#o(n.render_effects), n = /** @type {EffectTarget} */
244
- n.parent), r = o.next, o = o.parent;
241
+ var u = r.parent;
242
+ for (r = r.next; r === null && u !== null; )
243
+ u === n.effect && (this.#o(n.effects), this.#o(n.render_effects), n = /** @type {EffectTarget} */
244
+ n.parent), r = u.next, u = u.parent;
245
245
  }
246
246
  }
247
247
  /**
@@ -249,15 +249,15 @@ class nt {
249
249
  */
250
250
  #o(t) {
251
251
  for (const n of t)
252
- (n.f & G) !== 0 ? this.#i.add(n) : (n.f & ie) !== 0 && this.#s.add(n), this.#u(n.deps), H(n, z);
252
+ (n.f & fe) !== 0 ? this.#i.add(n) : (n.f & Se) !== 0 && this.#a.add(n), this.#c(n.deps), ne(n, te);
253
253
  }
254
254
  /**
255
255
  * @param {Value[] | null} deps
256
256
  */
257
- #u(t) {
257
+ #c(t) {
258
258
  if (t !== null)
259
259
  for (const n of t)
260
- (n.f & q) === 0 || (n.f & Oe) === 0 || (n.f ^= Oe, this.#u(
260
+ (n.f & re) === 0 || (n.f & tt) === 0 || (n.f ^= tt, this.#c(
261
261
  /** @type {Derived} */
262
262
  n.deps
263
263
  ));
@@ -269,17 +269,17 @@ class nt {
269
269
  * @param {any} value
270
270
  */
271
271
  capture(t, n) {
272
- this.previous.has(t) || this.previous.set(t, n), (t.f & Pe) === 0 && (this.current.set(t, t.v), ne?.set(t, t.v));
272
+ this.previous.has(t) || this.previous.set(t, n), (t.f & qe) === 0 && (this.current.set(t, t.v), ge?.set(t, t.v));
273
273
  }
274
274
  activate() {
275
- C = this, this.apply();
275
+ L = this, this.apply();
276
276
  }
277
277
  deactivate() {
278
- C === this && (C = null, ne = null);
278
+ L === this && (L = null, ge = null);
279
279
  }
280
280
  flush() {
281
- if (this.activate(), te.length > 0) {
282
- if (qn(), C !== null && C !== this)
281
+ if (this.activate(), be.length > 0) {
282
+ if (gr(), L !== null && L !== this)
283
283
  return;
284
284
  } else this.#e === 0 && this.process([]);
285
285
  this.deactivate();
@@ -288,7 +288,7 @@ class nt {
288
288
  for (const t of this.#n) t(this);
289
289
  this.#n.clear();
290
290
  }
291
- #c() {
291
+ #u() {
292
292
  if (this.#r === 0) {
293
293
  for (const t of this.#t) t();
294
294
  this.#t.clear();
@@ -296,49 +296,49 @@ class nt {
296
296
  this.#e === 0 && this.#f();
297
297
  }
298
298
  #f() {
299
- if (vt.size > 1) {
299
+ if (zt.size > 1) {
300
300
  this.previous.clear();
301
- var t = ne, n = !0, r = {
301
+ var t = ge, n = !0, r = {
302
302
  parent: null,
303
303
  effect: null,
304
304
  effects: [],
305
305
  render_effects: []
306
306
  };
307
- for (const i of vt) {
307
+ for (const i of zt) {
308
308
  if (i === this) {
309
309
  n = !1;
310
310
  continue;
311
311
  }
312
312
  const l = [];
313
- for (const [u, o] of this.current) {
314
- if (i.current.has(u))
315
- if (n && o !== i.current.get(u))
316
- i.current.set(u, o);
313
+ for (const [c, u] of this.current) {
314
+ if (i.current.has(c))
315
+ if (n && u !== i.current.get(c))
316
+ i.current.set(c, u);
317
317
  else
318
318
  continue;
319
- l.push(u);
319
+ l.push(c);
320
320
  }
321
321
  if (l.length === 0)
322
322
  continue;
323
- const s = [...i.current.keys()].filter((u) => !this.current.has(u));
324
- if (s.length > 0) {
325
- var a = te;
326
- te = [];
327
- const u = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
328
- for (const c of l)
329
- Kn(c, s, u, o);
330
- if (te.length > 0) {
331
- C = i, i.apply();
332
- for (const c of te)
333
- i.#l(c, r);
323
+ const o = [...i.current.keys()].filter((c) => !this.current.has(c));
324
+ if (o.length > 0) {
325
+ var s = be;
326
+ be = [];
327
+ const c = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map();
328
+ for (const f of l)
329
+ wr(f, o, c, u);
330
+ if (be.length > 0) {
331
+ L = i, i.apply();
332
+ for (const f of be)
333
+ i.#l(f, r);
334
334
  i.deactivate();
335
335
  }
336
- te = a;
336
+ be = s;
337
337
  }
338
338
  }
339
- C = null, ne = t;
339
+ L = null, ge = t;
340
340
  }
341
- this.committed = !0, vt.delete(this);
341
+ this.committed = !0, zt.delete(this);
342
342
  }
343
343
  /**
344
344
  *
@@ -356,9 +356,9 @@ class nt {
356
356
  }
357
357
  revive() {
358
358
  for (const t of this.#i)
359
- this.#s.delete(t), H(t, G), De(t);
360
- for (const t of this.#s)
361
- H(t, ie), De(t);
359
+ this.#a.delete(t), ne(t, fe), nt(t);
360
+ for (const t of this.#a)
361
+ ne(t, Se), nt(t);
362
362
  this.flush();
363
363
  }
364
364
  /** @param {() => void} fn */
@@ -370,16 +370,16 @@ class nt {
370
370
  this.#n.add(t);
371
371
  }
372
372
  settled() {
373
- return (this.#a ??= On()).promise;
373
+ return (this.#s ??= vr()).promise;
374
374
  }
375
375
  static ensure() {
376
- if (C === null) {
377
- const t = C = new nt();
378
- vt.add(C), et || nt.enqueue(() => {
379
- C === t && t.flush();
376
+ if (L === null) {
377
+ const t = L = new Mt();
378
+ zt.add(L), kt || Mt.enqueue(() => {
379
+ L === t && t.flush();
380
380
  });
381
381
  }
382
- return C;
382
+ return L;
383
383
  }
384
384
  /** @param {() => void} task */
385
385
  static enqueue(t) {
@@ -388,267 +388,267 @@ class nt {
388
388
  apply() {
389
389
  }
390
390
  }
391
- function ui(e) {
392
- var t = et;
393
- et = !0;
391
+ function Yi(e) {
392
+ var t = kt;
393
+ kt = !0;
394
394
  try {
395
395
  for (var n; ; ) {
396
- if (oi(), te.length === 0 && (C?.flush(), te.length === 0))
397
- return Mt = null, /** @type {T} */
396
+ if (Bi(), be.length === 0 && (L?.flush(), be.length === 0))
397
+ return rn = null, /** @type {T} */
398
398
  n;
399
- qn();
399
+ gr();
400
400
  }
401
401
  } finally {
402
- et = t;
402
+ kt = t;
403
403
  }
404
404
  }
405
- function qn() {
406
- var e = Ae;
407
- Jt = !0;
405
+ function gr() {
406
+ var e = Qe;
407
+ xn = !0;
408
408
  var t = null;
409
409
  try {
410
410
  var n = 0;
411
- for (Pt(!0); te.length > 0; ) {
412
- var r = nt.ensure();
411
+ for (Jt(!0); be.length > 0; ) {
412
+ var r = Mt.ensure();
413
413
  if (n++ > 1e3) {
414
- var a, i;
415
- ci();
414
+ var s, i;
415
+ Gi();
416
416
  }
417
- r.process(te), Se.clear();
417
+ r.process(be), Be.clear();
418
418
  }
419
419
  } finally {
420
- Jt = !1, Pt(e), Mt = null;
420
+ xn = !1, Jt(e), rn = null;
421
421
  }
422
422
  }
423
- function ci() {
423
+ function Gi() {
424
424
  try {
425
- ti();
425
+ Ui();
426
426
  } catch (e) {
427
- bt(e, Mt);
427
+ Vt(e, rn);
428
428
  }
429
429
  }
430
- let fe = null;
431
- function gn(e) {
430
+ let Ce = null;
431
+ function Xn(e) {
432
432
  var t = e.length;
433
433
  if (t !== 0) {
434
434
  for (var n = 0; n < t; ) {
435
435
  var r = e[n++];
436
- if ((r.f & (de | J)) === 0 && We(r) && (fe = /* @__PURE__ */ new Set(), Be(r), r.deps === null && r.first === null && r.nodes === null && (r.teardown === null && r.ac === null ? tr(r) : r.fn = null), fe?.size > 0)) {
437
- Se.clear();
438
- for (const a of fe) {
439
- if ((a.f & (de | J)) !== 0) continue;
440
- const i = [a];
441
- let l = a.parent;
436
+ if ((r.f & (Re | _e)) === 0 && mt(r) && (Ce = /* @__PURE__ */ new Set(), pt(r), r.deps === null && r.first === null && r.nodes === null && (r.teardown === null && r.ac === null ? Nr(r) : r.fn = null), Ce?.size > 0)) {
437
+ Be.clear();
438
+ for (const s of Ce) {
439
+ if ((s.f & (Re | _e)) !== 0) continue;
440
+ const i = [s];
441
+ let l = s.parent;
442
442
  for (; l !== null; )
443
- fe.has(l) && (fe.delete(l), i.push(l)), l = l.parent;
444
- for (let s = i.length - 1; s >= 0; s--) {
445
- const u = i[s];
446
- (u.f & (de | J)) === 0 && Be(u);
443
+ Ce.has(l) && (Ce.delete(l), i.push(l)), l = l.parent;
444
+ for (let o = i.length - 1; o >= 0; o--) {
445
+ const c = i[o];
446
+ (c.f & (Re | _e)) === 0 && pt(c);
447
447
  }
448
448
  }
449
- fe.clear();
449
+ Ce.clear();
450
450
  }
451
451
  }
452
- fe = null;
452
+ Ce = null;
453
453
  }
454
454
  }
455
- function Kn(e, t, n, r) {
455
+ function wr(e, t, n, r) {
456
456
  if (!n.has(e) && (n.add(e), e.reactions !== null))
457
- for (const a of e.reactions) {
458
- const i = a.f;
459
- (i & q) !== 0 ? Kn(
457
+ for (const s of e.reactions) {
458
+ const i = s.f;
459
+ (i & re) !== 0 ? wr(
460
460
  /** @type {Derived} */
461
- a,
461
+ s,
462
462
  t,
463
463
  n,
464
464
  r
465
- ) : (i & (sn | me)) !== 0 && (i & G) === 0 && Vn(a, t, r) && (H(a, G), De(
465
+ ) : (i & (zn | Ne)) !== 0 && (i & fe) === 0 && Er(s, t, r) && (ne(s, fe), nt(
466
466
  /** @type {Effect} */
467
- a
467
+ s
468
468
  ));
469
469
  }
470
470
  }
471
- function Vn(e, t, n) {
471
+ function Er(e, t, n) {
472
472
  const r = n.get(e);
473
473
  if (r !== void 0) return r;
474
474
  if (e.deps !== null)
475
- for (const a of e.deps) {
476
- if (t.includes(a))
475
+ for (const s of e.deps) {
476
+ if (t.includes(s))
477
477
  return !0;
478
- if ((a.f & q) !== 0 && Vn(
478
+ if ((s.f & re) !== 0 && Er(
479
479
  /** @type {Derived} */
480
- a,
480
+ s,
481
481
  t,
482
482
  n
483
483
  ))
484
484
  return n.set(
485
485
  /** @type {Derived} */
486
- a,
486
+ s,
487
487
  !0
488
488
  ), !0;
489
489
  }
490
490
  return n.set(e, !1), !1;
491
491
  }
492
- function De(e) {
493
- for (var t = Mt = e; t.parent !== null; ) {
492
+ function nt(e) {
493
+ for (var t = rn = e; t.parent !== null; ) {
494
494
  t = t.parent;
495
495
  var n = t.f;
496
- if (Jt && t === M && (n & me) !== 0 && (n & Fn) === 0)
496
+ if (xn && t === j && (n & Ne) !== 0 && (n & hr) === 0)
497
497
  return;
498
- if ((n & (Ye | _e)) !== 0) {
499
- if ((n & z) === 0) return;
500
- t.f ^= z;
498
+ if ((n & (ht | Le)) !== 0) {
499
+ if ((n & te) === 0) return;
500
+ t.f ^= te;
501
501
  }
502
502
  }
503
- te.push(t);
503
+ be.push(t);
504
504
  }
505
- function fi(e, t, n, r) {
506
- const a = lt() ? Tt : At;
505
+ function Wi(e, t, n, r) {
506
+ const s = Lt() ? sn : Ct;
507
507
  if (n.length === 0 && e.length === 0) {
508
- r(t.map(a));
508
+ r(t.map(s));
509
509
  return;
510
510
  }
511
- var i = C, l = (
511
+ var i = L, l = (
512
512
  /** @type {Effect} */
513
- M
514
- ), s = di();
515
- function u() {
516
- Promise.all(n.map((o) => /* @__PURE__ */ vi(o))).then((o) => {
517
- s();
513
+ j
514
+ ), o = Ji();
515
+ function c() {
516
+ Promise.all(n.map((u) => /* @__PURE__ */ Zi(u))).then((u) => {
517
+ o();
518
518
  try {
519
- r([...t.map(a), ...o]);
520
- } catch (c) {
521
- (l.f & de) === 0 && bt(c, l);
519
+ r([...t.map(s), ...u]);
520
+ } catch (f) {
521
+ (l.f & Re) === 0 && Vt(f, l);
522
522
  }
523
- i?.deactivate(), wt();
524
- }).catch((o) => {
525
- bt(o, l);
523
+ i?.deactivate(), Yt();
524
+ }).catch((u) => {
525
+ Vt(u, l);
526
526
  });
527
527
  }
528
528
  e.length > 0 ? Promise.all(e).then(() => {
529
- s();
529
+ o();
530
530
  try {
531
- return u();
531
+ return c();
532
532
  } finally {
533
- i?.deactivate(), wt();
533
+ i?.deactivate(), Yt();
534
534
  }
535
- }) : u();
535
+ }) : c();
536
536
  }
537
- function di() {
538
- var e = M, t = S, n = j, r = C;
537
+ function Ji() {
538
+ var e = j, t = N, n = $, r = L;
539
539
  return function(i = !0) {
540
- Ie(e), ue(t), yt(n), i && r?.activate();
540
+ Ve(e), Me(t), Bt(n), i && r?.activate();
541
541
  };
542
542
  }
543
- function wt() {
544
- Ie(null), ue(null), yt(null);
543
+ function Yt() {
544
+ Ve(null), Me(null), Bt(null);
545
545
  }
546
546
  // @__NO_SIDE_EFFECTS__
547
- function Tt(e) {
548
- var t = q | G, n = S !== null && (S.f & q) !== 0 ? (
547
+ function sn(e) {
548
+ var t = re | fe, n = N !== null && (N.f & re) !== 0 ? (
549
549
  /** @type {Derived} */
550
- S
550
+ N
551
551
  ) : null;
552
- return M !== null && (M.f |= xt), {
553
- ctx: j,
552
+ return j !== null && (j.f |= en), {
553
+ ctx: $,
554
554
  deps: null,
555
555
  effects: null,
556
- equals: Un,
556
+ equals: _r,
557
557
  f: t,
558
558
  fn: e,
559
559
  reactions: null,
560
560
  rv: 0,
561
561
  v: (
562
562
  /** @type {V} */
563
- K
563
+ se
564
564
  ),
565
565
  wv: 0,
566
- parent: n ?? M,
566
+ parent: n ?? j,
567
567
  ac: null
568
568
  };
569
569
  }
570
570
  // @__NO_SIDE_EFFECTS__
571
- function vi(e, t) {
571
+ function Zi(e, t) {
572
572
  let n = (
573
573
  /** @type {Effect | null} */
574
- M
574
+ j
575
575
  );
576
- n === null && Qr();
576
+ n === null && Li();
577
577
  var r = (
578
578
  /** @type {Boundary} */
579
579
  n.b
580
- ), a = (
580
+ ), s = (
581
581
  /** @type {Promise<V>} */
582
582
  /** @type {unknown} */
583
583
  void 0
584
- ), i = rt(
584
+ ), i = xt(
585
585
  /** @type {V} */
586
- K
587
- ), l = !S, s = /* @__PURE__ */ new Map();
588
- return Si(() => {
589
- var u = On();
590
- a = u.promise;
586
+ se
587
+ ), l = !N, o = /* @__PURE__ */ new Map();
588
+ return os(() => {
589
+ var c = vr();
590
+ s = c.promise;
591
591
  try {
592
- Promise.resolve(e()).then(u.resolve, u.reject).then(() => {
593
- o === C && o.committed && o.deactivate(), wt();
592
+ Promise.resolve(e()).then(c.resolve, c.reject).then(() => {
593
+ u === L && u.committed && u.deactivate(), Yt();
594
594
  });
595
- } catch (p) {
596
- u.reject(p), wt();
595
+ } catch (v) {
596
+ c.reject(v), Yt();
597
597
  }
598
- var o = (
598
+ var u = (
599
599
  /** @type {Batch} */
600
- C
600
+ L
601
601
  );
602
602
  if (l) {
603
- var c = !r.is_pending();
604
- r.update_pending_count(1), o.increment(c), s.get(o)?.reject(qe), s.delete(o), s.set(o, u);
603
+ var f = !r.is_pending();
604
+ r.update_pending_count(1), u.increment(f), o.get(u)?.reject(ft), o.delete(u), o.set(u, c);
605
605
  }
606
- const d = (p, h = void 0) => {
607
- if (o.activate(), h)
608
- h !== qe && (i.f |= Pe, it(i, h));
606
+ const d = (v, m = void 0) => {
607
+ if (u.activate(), m)
608
+ m !== ft && (i.f |= qe, Rt(i, m));
609
609
  else {
610
- (i.f & Pe) !== 0 && (i.f ^= Pe), it(i, p);
611
- for (const [v, E] of s) {
612
- if (s.delete(v), v === o) break;
613
- E.reject(qe);
610
+ (i.f & qe) !== 0 && (i.f ^= qe), Rt(i, v);
611
+ for (const [_, h] of o) {
612
+ if (o.delete(_), _ === u) break;
613
+ h.reject(ft);
614
614
  }
615
615
  }
616
- l && (r.update_pending_count(-1), o.decrement(c));
616
+ l && (r.update_pending_count(-1), u.decrement(f));
617
617
  };
618
- u.promise.then(d, (p) => d(null, p || "unknown"));
619
- }), cn(() => {
620
- for (const u of s.values())
621
- u.reject(qe);
622
- }), new Promise((u) => {
623
- function o(c) {
618
+ c.promise.then(d, (v) => d(null, v || "unknown"));
619
+ }), qn(() => {
620
+ for (const c of o.values())
621
+ c.reject(ft);
622
+ }), new Promise((c) => {
623
+ function u(f) {
624
624
  function d() {
625
- c === a ? u(i) : o(a);
625
+ f === s ? c(i) : u(s);
626
626
  }
627
- c.then(d, d);
627
+ f.then(d, d);
628
628
  }
629
- o(a);
629
+ u(s);
630
630
  });
631
631
  }
632
632
  // @__NO_SIDE_EFFECTS__
633
- function At(e) {
634
- const t = /* @__PURE__ */ Tt(e);
635
- return t.equals = jn, t;
633
+ function Ct(e) {
634
+ const t = /* @__PURE__ */ sn(e);
635
+ return t.equals = yr, t;
636
636
  }
637
- function Bn(e) {
637
+ function Pr(e) {
638
638
  var t = e.effects;
639
639
  if (t !== null) {
640
640
  e.effects = null;
641
641
  for (var n = 0; n < t.length; n += 1)
642
- pe(
642
+ Te(
643
643
  /** @type {Effect} */
644
644
  t[n]
645
645
  );
646
646
  }
647
647
  }
648
- function pi(e) {
648
+ function Qi(e) {
649
649
  for (var t = e.parent; t !== null; ) {
650
- if ((t.f & q) === 0)
651
- return (t.f & de) === 0 ? (
650
+ if ((t.f & re) === 0)
651
+ return (t.f & Re) === 0 ? (
652
652
  /** @type {Effect} */
653
653
  t
654
654
  ) : null;
@@ -656,281 +656,281 @@ function pi(e) {
656
656
  }
657
657
  return null;
658
658
  }
659
- function un(e) {
660
- var t, n = M;
661
- Ie(pi(e));
659
+ function Kn(e) {
660
+ var t, n = j;
661
+ Ve(Qi(e));
662
662
  try {
663
- e.f &= ~Oe, Bn(e), t = or(e);
663
+ e.f &= ~tt, Pr(e), t = jr(e);
664
664
  } finally {
665
- Ie(n);
665
+ Ve(n);
666
666
  }
667
667
  return t;
668
668
  }
669
- function Yn(e) {
670
- var t = un(e);
671
- if (e.equals(t) || (C?.is_fork || (e.v = t), e.wv = ar()), !Fe)
672
- if (ne !== null)
673
- (Et() || C?.is_fork) && ne.set(e, t);
669
+ function Sr(e) {
670
+ var t = Kn(e);
671
+ if (e.equals(t) || (L?.is_fork || (e.v = t), e.wv = Dr()), !rt)
672
+ if (ge !== null)
673
+ (Wt() || L?.is_fork) && ge.set(e, t);
674
674
  else {
675
- var n = (e.f & re) === 0 ? ie : z;
676
- H(e, n);
675
+ var n = (e.f & Pe) === 0 ? Se : te;
676
+ ne(e, n);
677
677
  }
678
678
  }
679
- let Qt = /* @__PURE__ */ new Set();
680
- const Se = /* @__PURE__ */ new Map();
681
- let Wn = !1;
682
- function rt(e, t) {
679
+ let Rn = /* @__PURE__ */ new Set();
680
+ const Be = /* @__PURE__ */ new Map();
681
+ let kr = !1;
682
+ function xt(e, t) {
683
683
  var n = {
684
684
  f: 0,
685
685
  // TODO ideally we could skip this altogether, but it causes type errors
686
686
  v: e,
687
687
  reactions: null,
688
- equals: Un,
688
+ equals: _r,
689
689
  rv: 0,
690
690
  wv: 0
691
691
  };
692
692
  return n;
693
693
  }
694
694
  // @__NO_SIDE_EFFECTS__
695
- function be(e, t) {
696
- const n = rt(e);
697
- return Ri(n), n;
695
+ function ze(e, t) {
696
+ const n = xt(e);
697
+ return fs(n), n;
698
698
  }
699
699
  // @__NO_SIDE_EFFECTS__
700
- function ve(e, t = !1, n = !0) {
701
- const r = rt(e);
702
- return t || (r.equals = jn), ot && n && j !== null && j.l !== null && (j.l.s ??= []).push(r), r;
700
+ function Q(e, t = !1, n = !0) {
701
+ const r = xt(e);
702
+ return t || (r.equals = yr), Nt && n && $ !== null && $.l !== null && ($.l.s ??= []).push(r), r;
703
703
  }
704
- function L(e, t, n = !1) {
705
- S !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
704
+ function A(e, t, n = !1) {
705
+ N !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
706
706
  // to ensure we error if state is set inside an inspect effect
707
- (!le || (S.f & wn) !== 0) && lt() && (S.f & (q | me | sn | wn)) !== 0 && !he?.includes(e) && ai();
708
- let r = n ? Ke(t) : t;
709
- return it(e, r);
707
+ (!Ie || (N.f & Qn) !== 0) && Lt() && (N.f & (re | Ne | zn | Qn)) !== 0 && !Ae?.includes(e) && Ki();
708
+ let r = n ? dt(t) : t;
709
+ return Rt(e, r);
710
710
  }
711
- function it(e, t) {
711
+ function Rt(e, t) {
712
712
  if (!e.equals(t)) {
713
713
  var n = e.v;
714
- Fe ? Se.set(e, t) : Se.set(e, n), e.v = t;
715
- var r = nt.ensure();
716
- r.capture(e, n), (e.f & q) !== 0 && ((e.f & G) !== 0 && un(
714
+ rt ? Be.set(e, t) : Be.set(e, n), e.v = t;
715
+ var r = Mt.ensure();
716
+ r.capture(e, n), (e.f & re) !== 0 && ((e.f & fe) !== 0 && Kn(
717
717
  /** @type {Derived} */
718
718
  e
719
- ), H(e, (e.f & re) !== 0 ? z : ie)), e.wv = ar(), Gn(e, G), lt() && M !== null && (M.f & z) !== 0 && (M.f & (_e | Ye)) === 0 && ($ === null ? xi([e]) : $.push(e)), !r.is_fork && Qt.size > 0 && !Wn && hi();
719
+ ), ne(e, (e.f & Pe) !== 0 ? te : Se)), e.wv = Dr(), Ir(e, fe), Lt() && j !== null && (j.f & te) !== 0 && (j.f & (Le | ht)) === 0 && (ye === null ? ds([e]) : ye.push(e)), !r.is_fork && Rn.size > 0 && !kr && Xi();
720
720
  }
721
721
  return t;
722
722
  }
723
- function hi() {
724
- Wn = !1;
725
- var e = Ae;
726
- Pt(!0);
727
- const t = Array.from(Qt);
723
+ function Xi() {
724
+ kr = !1;
725
+ var e = Qe;
726
+ Jt(!0);
727
+ const t = Array.from(Rn);
728
728
  try {
729
729
  for (const n of t)
730
- (n.f & z) !== 0 && H(n, ie), We(n) && Be(n);
730
+ (n.f & te) !== 0 && ne(n, Se), mt(n) && pt(n);
731
731
  } finally {
732
- Pt(e);
732
+ Jt(e);
733
733
  }
734
- Qt.clear();
734
+ Rn.clear();
735
735
  }
736
- function Kt(e) {
737
- L(e, e.v + 1);
736
+ function En(e) {
737
+ A(e, e.v + 1);
738
738
  }
739
- function Gn(e, t) {
739
+ function Ir(e, t) {
740
740
  var n = e.reactions;
741
741
  if (n !== null)
742
- for (var r = lt(), a = n.length, i = 0; i < a; i++) {
743
- var l = n[i], s = l.f;
744
- if (!(!r && l === M)) {
745
- var u = (s & G) === 0;
746
- if (u && H(l, t), (s & q) !== 0) {
747
- var o = (
742
+ for (var r = Lt(), s = n.length, i = 0; i < s; i++) {
743
+ var l = n[i], o = l.f;
744
+ if (!(!r && l === j)) {
745
+ var c = (o & fe) === 0;
746
+ if (c && ne(l, t), (o & re) !== 0) {
747
+ var u = (
748
748
  /** @type {Derived} */
749
749
  l
750
750
  );
751
- ne?.delete(o), (s & Oe) === 0 && (s & re && (l.f |= Oe), Gn(o, ie));
752
- } else u && ((s & me) !== 0 && fe !== null && fe.add(
751
+ ge?.delete(u), (o & tt) === 0 && (o & Pe && (l.f |= tt), Ir(u, Se));
752
+ } else c && ((o & Ne) !== 0 && Ce !== null && Ce.add(
753
753
  /** @type {Effect} */
754
754
  l
755
- ), De(
755
+ ), nt(
756
756
  /** @type {Effect} */
757
757
  l
758
758
  ));
759
759
  }
760
760
  }
761
761
  }
762
- function Ke(e) {
763
- if (typeof e != "object" || e === null || Ve in e)
762
+ function dt(e) {
763
+ if (typeof e != "object" || e === null || vt in e)
764
764
  return e;
765
- const t = Nn(e);
766
- if (t !== Yr && t !== Wr)
765
+ const t = Dn(e);
766
+ if (t !== Ci && t !== xi)
767
767
  return e;
768
- var n = /* @__PURE__ */ new Map(), r = Tn(e), a = /* @__PURE__ */ be(0), i = Ne, l = (s) => {
769
- if (Ne === i)
770
- return s();
771
- var u = S, o = Ne;
772
- ue(null), In(i);
773
- var c = s();
774
- return ue(u), In(o), c;
768
+ var n = /* @__PURE__ */ new Map(), r = ur(e), s = /* @__PURE__ */ ze(0), i = Xe, l = (o) => {
769
+ if (Xe === i)
770
+ return o();
771
+ var c = N, u = Xe;
772
+ Me(null), nr(i);
773
+ var f = o();
774
+ return Me(c), nr(u), f;
775
775
  };
776
- return r && n.set("length", /* @__PURE__ */ be(
776
+ return r && n.set("length", /* @__PURE__ */ ze(
777
777
  /** @type {any[]} */
778
778
  e.length
779
779
  )), new Proxy(
780
780
  /** @type {any} */
781
781
  e,
782
782
  {
783
- defineProperty(s, u, o) {
784
- (!("value" in o) || o.configurable === !1 || o.enumerable === !1 || o.writable === !1) && ri();
785
- var c = n.get(u);
786
- return c === void 0 ? c = l(() => {
787
- var d = /* @__PURE__ */ be(o.value);
788
- return n.set(u, d), d;
789
- }) : L(c, o.value, !0), !0;
783
+ defineProperty(o, c, u) {
784
+ (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && zi();
785
+ var f = n.get(c);
786
+ return f === void 0 ? f = l(() => {
787
+ var d = /* @__PURE__ */ ze(u.value);
788
+ return n.set(c, d), d;
789
+ }) : A(f, u.value, !0), !0;
790
790
  },
791
- deleteProperty(s, u) {
792
- var o = n.get(u);
793
- if (o === void 0) {
794
- if (u in s) {
795
- const c = l(() => /* @__PURE__ */ be(K));
796
- n.set(u, c), Kt(a);
791
+ deleteProperty(o, c) {
792
+ var u = n.get(c);
793
+ if (u === void 0) {
794
+ if (c in o) {
795
+ const f = l(() => /* @__PURE__ */ ze(se));
796
+ n.set(c, f), En(s);
797
797
  }
798
798
  } else
799
- L(o, K), Kt(a);
799
+ A(u, se), En(s);
800
800
  return !0;
801
801
  },
802
- get(s, u, o) {
803
- if (u === Ve)
802
+ get(o, c, u) {
803
+ if (c === vt)
804
804
  return e;
805
- var c = n.get(u), d = u in s;
806
- if (c === void 0 && (!d || mt(s, u)?.writable) && (c = l(() => {
807
- var h = Ke(d ? s[u] : K), v = /* @__PURE__ */ be(h);
808
- return v;
809
- }), n.set(u, c)), c !== void 0) {
810
- var p = f(c);
811
- return p === K ? void 0 : p;
805
+ var f = n.get(c), d = c in o;
806
+ if (f === void 0 && (!d || Kt(o, c)?.writable) && (f = l(() => {
807
+ var m = dt(d ? o[c] : se), _ = /* @__PURE__ */ ze(m);
808
+ return _;
809
+ }), n.set(c, f)), f !== void 0) {
810
+ var v = a(f);
811
+ return v === se ? void 0 : v;
812
812
  }
813
- return Reflect.get(s, u, o);
813
+ return Reflect.get(o, c, u);
814
814
  },
815
- getOwnPropertyDescriptor(s, u) {
816
- var o = Reflect.getOwnPropertyDescriptor(s, u);
817
- if (o && "value" in o) {
818
- var c = n.get(u);
819
- c && (o.value = f(c));
820
- } else if (o === void 0) {
821
- var d = n.get(u), p = d?.v;
822
- if (d !== void 0 && p !== K)
815
+ getOwnPropertyDescriptor(o, c) {
816
+ var u = Reflect.getOwnPropertyDescriptor(o, c);
817
+ if (u && "value" in u) {
818
+ var f = n.get(c);
819
+ f && (u.value = a(f));
820
+ } else if (u === void 0) {
821
+ var d = n.get(c), v = d?.v;
822
+ if (d !== void 0 && v !== se)
823
823
  return {
824
824
  enumerable: !0,
825
825
  configurable: !0,
826
- value: p,
826
+ value: v,
827
827
  writable: !0
828
828
  };
829
829
  }
830
- return o;
830
+ return u;
831
831
  },
832
- has(s, u) {
833
- if (u === Ve)
832
+ has(o, c) {
833
+ if (c === vt)
834
834
  return !0;
835
- var o = n.get(u), c = o !== void 0 && o.v !== K || Reflect.has(s, u);
836
- if (o !== void 0 || M !== null && (!c || mt(s, u)?.writable)) {
837
- o === void 0 && (o = l(() => {
838
- var p = c ? Ke(s[u]) : K, h = /* @__PURE__ */ be(p);
839
- return h;
840
- }), n.set(u, o));
841
- var d = f(o);
842
- if (d === K)
835
+ var u = n.get(c), f = u !== void 0 && u.v !== se || Reflect.has(o, c);
836
+ if (u !== void 0 || j !== null && (!f || Kt(o, c)?.writable)) {
837
+ u === void 0 && (u = l(() => {
838
+ var v = f ? dt(o[c]) : se, m = /* @__PURE__ */ ze(v);
839
+ return m;
840
+ }), n.set(c, u));
841
+ var d = a(u);
842
+ if (d === se)
843
843
  return !1;
844
844
  }
845
- return c;
845
+ return f;
846
846
  },
847
- set(s, u, o, c) {
848
- var d = n.get(u), p = u in s;
849
- if (r && u === "length")
850
- for (var h = o; h < /** @type {Source<number>} */
851
- d.v; h += 1) {
852
- var v = n.get(h + "");
853
- v !== void 0 ? L(v, K) : h in s && (v = l(() => /* @__PURE__ */ be(K)), n.set(h + "", v));
847
+ set(o, c, u, f) {
848
+ var d = n.get(c), v = c in o;
849
+ if (r && c === "length")
850
+ for (var m = u; m < /** @type {Source<number>} */
851
+ d.v; m += 1) {
852
+ var _ = n.get(m + "");
853
+ _ !== void 0 ? A(_, se) : m in o && (_ = l(() => /* @__PURE__ */ ze(se)), n.set(m + "", _));
854
854
  }
855
855
  if (d === void 0)
856
- (!p || mt(s, u)?.writable) && (d = l(() => /* @__PURE__ */ be(void 0)), L(d, Ke(o)), n.set(u, d));
856
+ (!v || Kt(o, c)?.writable) && (d = l(() => /* @__PURE__ */ ze(void 0)), A(d, dt(u)), n.set(c, d));
857
857
  else {
858
- p = d.v !== K;
859
- var E = l(() => Ke(o));
860
- L(d, E);
858
+ v = d.v !== se;
859
+ var h = l(() => dt(u));
860
+ A(d, h);
861
861
  }
862
- var I = Reflect.getOwnPropertyDescriptor(s, u);
863
- if (I?.set && I.set.call(c, o), !p) {
864
- if (r && typeof u == "string") {
865
- var w = (
862
+ var p = Reflect.getOwnPropertyDescriptor(o, c);
863
+ if (p?.set && p.set.call(f, u), !v) {
864
+ if (r && typeof c == "string") {
865
+ var y = (
866
866
  /** @type {Source<number>} */
867
867
  n.get("length")
868
- ), _ = Number(u);
869
- Number.isInteger(_) && _ >= w.v && L(w, _ + 1);
868
+ ), B = Number(c);
869
+ Number.isInteger(B) && B >= y.v && A(y, B + 1);
870
870
  }
871
- Kt(a);
871
+ En(s);
872
872
  }
873
873
  return !0;
874
874
  },
875
- ownKeys(s) {
876
- f(a);
877
- var u = Reflect.ownKeys(s).filter((d) => {
878
- var p = n.get(d);
879
- return p === void 0 || p.v !== K;
875
+ ownKeys(o) {
876
+ a(s);
877
+ var c = Reflect.ownKeys(o).filter((d) => {
878
+ var v = n.get(d);
879
+ return v === void 0 || v.v !== se;
880
880
  });
881
- for (var [o, c] of n)
882
- c.v !== K && !(o in s) && u.push(o);
883
- return u;
881
+ for (var [u, f] of n)
882
+ f.v !== se && !(u in o) && c.push(u);
883
+ return c;
884
884
  },
885
885
  setPrototypeOf() {
886
- ii();
886
+ Hi();
887
887
  }
888
888
  }
889
889
  );
890
890
  }
891
- var mi, _i, yi;
892
- function Te(e = "") {
891
+ var $i, es, ts;
892
+ function Ze(e = "") {
893
893
  return document.createTextNode(e);
894
894
  }
895
895
  // @__NO_SIDE_EFFECTS__
896
- function gt(e) {
896
+ function Gt(e) {
897
897
  return (
898
898
  /** @type {TemplateNode | null} */
899
- _i.call(e)
899
+ es.call(e)
900
900
  );
901
901
  }
902
902
  // @__NO_SIDE_EFFECTS__
903
- function ut(e) {
903
+ function Ot(e) {
904
904
  return (
905
905
  /** @type {TemplateNode | null} */
906
- yi.call(e)
906
+ ts.call(e)
907
907
  );
908
908
  }
909
- function A(e, t) {
910
- return /* @__PURE__ */ gt(e);
909
+ function g(e, t) {
910
+ return /* @__PURE__ */ Gt(e);
911
911
  }
912
- function Xe(e, t = !1) {
912
+ function Ke(e, t = !1) {
913
913
  {
914
- var n = /* @__PURE__ */ gt(e);
915
- return n instanceof Comment && n.data === "" ? /* @__PURE__ */ ut(n) : n;
914
+ var n = /* @__PURE__ */ Gt(e);
915
+ return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Ot(n) : n;
916
916
  }
917
917
  }
918
- function F(e, t = 1, n = !1) {
918
+ function q(e, t = 1, n = !1) {
919
919
  let r = e;
920
920
  for (; t--; )
921
921
  r = /** @type {TemplateNode} */
922
- /* @__PURE__ */ ut(r);
922
+ /* @__PURE__ */ Ot(r);
923
923
  return r;
924
924
  }
925
- function bi(e) {
925
+ function ns(e) {
926
926
  e.textContent = "";
927
927
  }
928
- function Zn() {
928
+ function Mr() {
929
929
  return !1;
930
930
  }
931
- let En = !1;
932
- function wi() {
933
- En || (En = !0, document.addEventListener(
931
+ let $n = !1;
932
+ function rs() {
933
+ $n || ($n = !0, document.addEventListener(
934
934
  "reset",
935
935
  (e) => {
936
936
  Promise.resolve().then(() => {
@@ -947,37 +947,37 @@ function wi() {
947
947
  { capture: !0 }
948
948
  ));
949
949
  }
950
- function Nt(e) {
951
- var t = S, n = M;
952
- ue(null), Ie(null);
950
+ function an(e) {
951
+ var t = N, n = j;
952
+ Me(null), Ve(null);
953
953
  try {
954
954
  return e();
955
955
  } finally {
956
- ue(t), Ie(n);
956
+ Me(t), Ve(n);
957
957
  }
958
958
  }
959
- function gi(e, t, n, r = n) {
960
- e.addEventListener(t, () => Nt(n));
961
- const a = e.__on_r;
962
- a ? e.__on_r = () => {
963
- a(), r(!0);
964
- } : e.__on_r = () => r(!0), wi();
959
+ function is(e, t, n, r = n) {
960
+ e.addEventListener(t, () => an(n));
961
+ const s = e.__on_r;
962
+ s ? e.__on_r = () => {
963
+ s(), r(!0);
964
+ } : e.__on_r = () => r(!0), rs();
965
965
  }
966
- function Jn(e) {
967
- M === null && (S === null && ei(), $r()), Fe && Xr();
966
+ function Cr(e) {
967
+ j === null && (N === null && Di(), Fi()), rt && Oi();
968
968
  }
969
- function Ei(e, t) {
969
+ function ss(e, t) {
970
970
  var n = t.last;
971
971
  n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e);
972
972
  }
973
- function ke(e, t, n) {
974
- var r = M;
975
- r !== null && (r.f & J) !== 0 && (e |= J);
976
- var a = {
977
- ctx: j,
973
+ function Ye(e, t, n) {
974
+ var r = j;
975
+ r !== null && (r.f & _e) !== 0 && (e |= _e);
976
+ var s = {
977
+ ctx: $,
978
978
  deps: null,
979
979
  nodes: null,
980
- f: e | G | re,
980
+ f: e | fe | Pe,
981
981
  first: null,
982
982
  fn: t,
983
983
  last: null,
@@ -991,182 +991,182 @@ function ke(e, t, n) {
991
991
  };
992
992
  if (n)
993
993
  try {
994
- Be(a), a.f |= an;
995
- } catch (s) {
996
- throw pe(a), s;
994
+ pt(s), s.f |= jn;
995
+ } catch (o) {
996
+ throw Te(s), o;
997
997
  }
998
- else t !== null && De(a);
999
- var i = a;
998
+ else t !== null && nt(s);
999
+ var i = s;
1000
1000
  if (n && i.deps === null && i.teardown === null && i.nodes === null && i.first === i.last && // either `null`, or a singular child
1001
- (i.f & xt) === 0 && (i = i.first, (e & me) !== 0 && (e & tt) !== 0 && i !== null && (i.f |= tt)), i !== null && (i.parent = r, r !== null && Ei(i, r), S !== null && (S.f & q) !== 0 && (e & Ye) === 0)) {
1001
+ (i.f & en) === 0 && (i = i.first, (e & Ne) !== 0 && (e & It) !== 0 && i !== null && (i.f |= It)), i !== null && (i.parent = r, r !== null && ss(i, r), N !== null && (N.f & re) !== 0 && (e & ht) === 0)) {
1002
1002
  var l = (
1003
1003
  /** @type {Derived} */
1004
- S
1004
+ N
1005
1005
  );
1006
1006
  (l.effects ??= []).push(i);
1007
1007
  }
1008
- return a;
1008
+ return s;
1009
1009
  }
1010
- function Et() {
1011
- return S !== null && !le;
1010
+ function Wt() {
1011
+ return N !== null && !Ie;
1012
1012
  }
1013
- function cn(e) {
1014
- const t = ke(Rt, null, !1);
1015
- return H(t, z), t.teardown = e, t;
1013
+ function qn(e) {
1014
+ const t = Ye($t, null, !1);
1015
+ return ne(t, te), t.teardown = e, t;
1016
1016
  }
1017
- function Pn(e) {
1018
- Jn();
1017
+ function er(e) {
1018
+ Cr();
1019
1019
  var t = (
1020
1020
  /** @type {Effect} */
1021
- M.f
1022
- ), n = !S && (t & _e) !== 0 && (t & an) === 0;
1021
+ j.f
1022
+ ), n = !N && (t & Le) !== 0 && (t & jn) === 0;
1023
1023
  if (n) {
1024
1024
  var r = (
1025
1025
  /** @type {ComponentContext} */
1026
- j
1026
+ $
1027
1027
  );
1028
1028
  (r.e ??= []).push(e);
1029
1029
  } else
1030
- return Qn(e);
1030
+ return xr(e);
1031
1031
  }
1032
- function Qn(e) {
1033
- return ke(Dn | Ln, e, !1);
1032
+ function xr(e) {
1033
+ return Ye(pr | mr, e, !1);
1034
1034
  }
1035
- function Pi(e) {
1036
- return Jn(), ke(Rt | Ln, e, !0);
1035
+ function as(e) {
1036
+ return Cr(), Ye($t | mr, e, !0);
1037
1037
  }
1038
- function Re(e, t) {
1038
+ function ee(e, t) {
1039
1039
  var n = (
1040
1040
  /** @type {ComponentContextLegacy} */
1041
- j
1041
+ $
1042
1042
  ), r = { effect: null, ran: !1, deps: e };
1043
- n.l.$.push(r), r.effect = dn(() => {
1044
- e(), !r.ran && (r.ran = !0, P(t));
1043
+ n.l.$.push(r), r.effect = Vn(() => {
1044
+ e(), !r.ran && (r.ran = !0, w(t));
1045
1045
  });
1046
1046
  }
1047
- function fn() {
1047
+ function Bn() {
1048
1048
  var e = (
1049
1049
  /** @type {ComponentContextLegacy} */
1050
- j
1050
+ $
1051
1051
  );
1052
- dn(() => {
1052
+ Vn(() => {
1053
1053
  for (var t of e.l.$) {
1054
1054
  t.deps();
1055
1055
  var n = t.effect;
1056
- (n.f & z) !== 0 && H(n, ie), We(n) && Be(n), t.ran = !1;
1056
+ (n.f & te) !== 0 && ne(n, Se), mt(n) && pt(n), t.ran = !1;
1057
1057
  }
1058
1058
  });
1059
1059
  }
1060
- function Si(e) {
1061
- return ke(sn | xt, e, !0);
1060
+ function os(e) {
1061
+ return Ye(zn | en, e, !0);
1062
1062
  }
1063
- function dn(e, t = 0) {
1064
- return ke(Rt | t, e, !0);
1063
+ function Vn(e, t = 0) {
1064
+ return Ye($t | t, e, !0);
1065
1065
  }
1066
- function oe(e, t = [], n = [], r = []) {
1067
- fi(r, t, n, (a) => {
1068
- ke(Rt, () => e(...a.map(f)), !0);
1066
+ function X(e, t = [], n = [], r = []) {
1067
+ Wi(r, t, n, (s) => {
1068
+ Ye($t, () => e(...s.map(a)), !0);
1069
1069
  });
1070
1070
  }
1071
- function Xn(e, t = 0) {
1072
- var n = ke(me | t, e, !0);
1071
+ function Rr(e, t = 0) {
1072
+ var n = Ye(Ne | t, e, !0);
1073
1073
  return n;
1074
1074
  }
1075
- function at(e) {
1076
- return ke(_e | xt, e, !0);
1075
+ function Tt(e) {
1076
+ return Ye(Le | en, e, !0);
1077
1077
  }
1078
- function $n(e) {
1078
+ function Tr(e) {
1079
1079
  var t = e.teardown;
1080
1080
  if (t !== null) {
1081
- const n = Fe, r = S;
1082
- Sn(!0), ue(null);
1081
+ const n = rt, r = N;
1082
+ tr(!0), Me(null);
1083
1083
  try {
1084
1084
  t.call(null);
1085
1085
  } finally {
1086
- Sn(n), ue(r);
1086
+ tr(n), Me(r);
1087
1087
  }
1088
1088
  }
1089
1089
  }
1090
- function er(e, t = !1) {
1090
+ function Ar(e, t = !1) {
1091
1091
  var n = e.first;
1092
1092
  for (e.first = e.last = null; n !== null; ) {
1093
- const a = n.ac;
1094
- a !== null && Nt(() => {
1095
- a.abort(qe);
1093
+ const s = n.ac;
1094
+ s !== null && an(() => {
1095
+ s.abort(ft);
1096
1096
  });
1097
1097
  var r = n.next;
1098
- (n.f & Ye) !== 0 ? n.parent = null : pe(n, t), n = r;
1098
+ (n.f & ht) !== 0 ? n.parent = null : Te(n, t), n = r;
1099
1099
  }
1100
1100
  }
1101
- function Ii(e) {
1101
+ function ls(e) {
1102
1102
  for (var t = e.first; t !== null; ) {
1103
1103
  var n = t.next;
1104
- (t.f & _e) === 0 && pe(t), t = n;
1104
+ (t.f & Le) === 0 && Te(t), t = n;
1105
1105
  }
1106
1106
  }
1107
- function pe(e, t = !0) {
1107
+ function Te(e, t = !0) {
1108
1108
  var n = !1;
1109
- (t || (e.f & Fn) !== 0) && e.nodes !== null && e.nodes.end !== null && (ki(
1109
+ (t || (e.f & hr) !== 0) && e.nodes !== null && e.nodes.end !== null && (cs(
1110
1110
  e.nodes.start,
1111
1111
  /** @type {TemplateNode} */
1112
1112
  e.nodes.end
1113
- ), n = !0), er(e, t && !n), St(e, 0), H(e, de);
1113
+ ), n = !0), Ar(e, t && !n), Zt(e, 0), ne(e, Re);
1114
1114
  var r = e.nodes && e.nodes.t;
1115
1115
  if (r !== null)
1116
1116
  for (const i of r)
1117
1117
  i.stop();
1118
- $n(e);
1119
- var a = e.parent;
1120
- a !== null && a.first !== null && tr(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = null;
1118
+ Tr(e);
1119
+ var s = e.parent;
1120
+ s !== null && s.first !== null && Nr(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = null;
1121
1121
  }
1122
- function ki(e, t) {
1122
+ function cs(e, t) {
1123
1123
  for (; e !== null; ) {
1124
- var n = e === t ? null : /* @__PURE__ */ ut(e);
1124
+ var n = e === t ? null : /* @__PURE__ */ Ot(e);
1125
1125
  e.remove(), e = n;
1126
1126
  }
1127
1127
  }
1128
- function tr(e) {
1128
+ function Nr(e) {
1129
1129
  var t = e.parent, n = e.prev, r = e.next;
1130
1130
  n !== null && (n.next = r), r !== null && (r.prev = n), t !== null && (t.first === e && (t.first = r), t.last === e && (t.last = n));
1131
1131
  }
1132
- function vn(e, t, n = !0) {
1132
+ function Yn(e, t, n = !0) {
1133
1133
  var r = [];
1134
- nr(e, r, !0);
1135
- var a = () => {
1136
- n && pe(e), t && t();
1134
+ Lr(e, r, !0);
1135
+ var s = () => {
1136
+ n && Te(e), t && t();
1137
1137
  }, i = r.length;
1138
1138
  if (i > 0) {
1139
- var l = () => --i || a();
1140
- for (var s of r)
1141
- s.out(l);
1139
+ var l = () => --i || s();
1140
+ for (var o of r)
1141
+ o.out(l);
1142
1142
  } else
1143
- a();
1143
+ s();
1144
1144
  }
1145
- function nr(e, t, n) {
1146
- if ((e.f & J) === 0) {
1147
- e.f ^= J;
1145
+ function Lr(e, t, n) {
1146
+ if ((e.f & _e) === 0) {
1147
+ e.f ^= _e;
1148
1148
  var r = e.nodes && e.nodes.t;
1149
1149
  if (r !== null)
1150
- for (const s of r)
1151
- (s.is_global || n) && t.push(s);
1152
- for (var a = e.first; a !== null; ) {
1153
- var i = a.next, l = (a.f & tt) !== 0 || // If this is a branch effect without a block effect parent,
1150
+ for (const o of r)
1151
+ (o.is_global || n) && t.push(o);
1152
+ for (var s = e.first; s !== null; ) {
1153
+ var i = s.next, l = (s.f & It) !== 0 || // If this is a branch effect without a block effect parent,
1154
1154
  // it means the parent block effect was pruned. In that case,
1155
1155
  // transparency information was transferred to the branch effect.
1156
- (a.f & _e) !== 0 && (e.f & me) !== 0;
1157
- nr(a, t, l ? n : !1), a = i;
1156
+ (s.f & Le) !== 0 && (e.f & Ne) !== 0;
1157
+ Lr(s, t, l ? n : !1), s = i;
1158
1158
  }
1159
1159
  }
1160
1160
  }
1161
- function pn(e) {
1162
- rr(e, !0);
1161
+ function Gn(e) {
1162
+ Or(e, !0);
1163
1163
  }
1164
- function rr(e, t) {
1165
- if ((e.f & J) !== 0) {
1166
- e.f ^= J, (e.f & z) === 0 && (H(e, G), De(e));
1164
+ function Or(e, t) {
1165
+ if ((e.f & _e) !== 0) {
1166
+ e.f ^= _e, (e.f & te) === 0 && (ne(e, fe), nt(e));
1167
1167
  for (var n = e.first; n !== null; ) {
1168
- var r = n.next, a = (n.f & tt) !== 0 || (n.f & _e) !== 0;
1169
- rr(n, a ? t : !1), n = r;
1168
+ var r = n.next, s = (n.f & It) !== 0 || (n.f & Le) !== 0;
1169
+ Or(n, s ? t : !1), n = r;
1170
1170
  }
1171
1171
  var i = e.nodes && e.nodes.t;
1172
1172
  if (i !== null)
@@ -1174,261 +1174,261 @@ function rr(e, t) {
1174
1174
  (l.is_global || t) && l.in();
1175
1175
  }
1176
1176
  }
1177
- function Ci(e, t) {
1177
+ function us(e, t) {
1178
1178
  if (e.nodes)
1179
1179
  for (var n = e.nodes.start, r = e.nodes.end; n !== null; ) {
1180
- var a = n === r ? null : /* @__PURE__ */ ut(n);
1181
- t.append(n), n = a;
1180
+ var s = n === r ? null : /* @__PURE__ */ Ot(n);
1181
+ t.append(n), n = s;
1182
1182
  }
1183
1183
  }
1184
- let Ae = !1;
1185
- function Pt(e) {
1186
- Ae = e;
1184
+ let Qe = !1;
1185
+ function Jt(e) {
1186
+ Qe = e;
1187
1187
  }
1188
- let Fe = !1;
1189
- function Sn(e) {
1190
- Fe = e;
1188
+ let rt = !1;
1189
+ function tr(e) {
1190
+ rt = e;
1191
1191
  }
1192
- let S = null, le = !1;
1193
- function ue(e) {
1194
- S = e;
1192
+ let N = null, Ie = !1;
1193
+ function Me(e) {
1194
+ N = e;
1195
1195
  }
1196
- let M = null;
1197
- function Ie(e) {
1198
- M = e;
1196
+ let j = null;
1197
+ function Ve(e) {
1198
+ j = e;
1199
1199
  }
1200
- let he = null;
1201
- function Ri(e) {
1202
- S !== null && (he === null ? he = [e] : he.push(e));
1200
+ let Ae = null;
1201
+ function fs(e) {
1202
+ N !== null && (Ae === null ? Ae = [e] : Ae.push(e));
1203
1203
  }
1204
- let B = null, Z = 0, $ = null;
1205
- function xi(e) {
1206
- $ = e;
1204
+ let le = null, he = 0, ye = null;
1205
+ function ds(e) {
1206
+ ye = e;
1207
1207
  }
1208
- let ir = 1, st = 0, Ne = st;
1209
- function In(e) {
1210
- Ne = e;
1208
+ let Fr = 1, At = 0, Xe = At;
1209
+ function nr(e) {
1210
+ Xe = e;
1211
1211
  }
1212
- function ar() {
1213
- return ++ir;
1212
+ function Dr() {
1213
+ return ++Fr;
1214
1214
  }
1215
- function We(e) {
1215
+ function mt(e) {
1216
1216
  var t = e.f;
1217
- if ((t & G) !== 0)
1217
+ if ((t & fe) !== 0)
1218
1218
  return !0;
1219
- if (t & q && (e.f &= ~Oe), (t & ie) !== 0) {
1219
+ if (t & re && (e.f &= ~tt), (t & Se) !== 0) {
1220
1220
  var n = e.deps;
1221
1221
  if (n !== null)
1222
- for (var r = n.length, a = 0; a < r; a++) {
1223
- var i = n[a];
1224
- if (We(
1222
+ for (var r = n.length, s = 0; s < r; s++) {
1223
+ var i = n[s];
1224
+ if (mt(
1225
1225
  /** @type {Derived} */
1226
1226
  i
1227
- ) && Yn(
1227
+ ) && Sr(
1228
1228
  /** @type {Derived} */
1229
1229
  i
1230
1230
  ), i.wv > e.wv)
1231
1231
  return !0;
1232
1232
  }
1233
- (t & re) !== 0 && // During time traveling we don't want to reset the status so that
1233
+ (t & Pe) !== 0 && // During time traveling we don't want to reset the status so that
1234
1234
  // traversal of the graph in the other batches still happens
1235
- ne === null && H(e, z);
1235
+ ge === null && ne(e, te);
1236
1236
  }
1237
1237
  return !1;
1238
1238
  }
1239
- function sr(e, t, n = !0) {
1239
+ function Ur(e, t, n = !0) {
1240
1240
  var r = e.reactions;
1241
- if (r !== null && !he?.includes(e))
1242
- for (var a = 0; a < r.length; a++) {
1243
- var i = r[a];
1244
- (i.f & q) !== 0 ? sr(
1241
+ if (r !== null && !Ae?.includes(e))
1242
+ for (var s = 0; s < r.length; s++) {
1243
+ var i = r[s];
1244
+ (i.f & re) !== 0 ? Ur(
1245
1245
  /** @type {Derived} */
1246
1246
  i,
1247
1247
  t,
1248
1248
  !1
1249
- ) : t === i && (n ? H(i, G) : (i.f & z) !== 0 && H(i, ie), De(
1249
+ ) : t === i && (n ? ne(i, fe) : (i.f & te) !== 0 && ne(i, Se), nt(
1250
1250
  /** @type {Effect} */
1251
1251
  i
1252
1252
  ));
1253
1253
  }
1254
1254
  }
1255
- function or(e) {
1256
- var t = B, n = Z, r = $, a = S, i = he, l = j, s = le, u = Ne, o = e.f;
1257
- B = /** @type {null | Value[]} */
1258
- null, Z = 0, $ = null, S = (o & (_e | Ye)) === 0 ? e : null, he = null, yt(e.ctx), le = !1, Ne = ++st, e.ac !== null && (Nt(() => {
1259
- e.ac.abort(qe);
1255
+ function jr(e) {
1256
+ var t = le, n = he, r = ye, s = N, i = Ae, l = $, o = Ie, c = Xe, u = e.f;
1257
+ le = /** @type {null | Value[]} */
1258
+ null, he = 0, ye = null, N = (u & (Le | ht)) === 0 ? e : null, Ae = null, Bt(e.ctx), Ie = !1, Xe = ++At, e.ac !== null && (an(() => {
1259
+ e.ac.abort(ft);
1260
1260
  }), e.ac = null);
1261
1261
  try {
1262
- e.f |= Zt;
1263
- var c = (
1262
+ e.f |= Cn;
1263
+ var f = (
1264
1264
  /** @type {Function} */
1265
1265
  e.fn
1266
- ), d = c(), p = e.deps;
1267
- if (B !== null) {
1268
- var h;
1269
- if (St(e, Z), p !== null && Z > 0)
1270
- for (p.length = Z + B.length, h = 0; h < B.length; h++)
1271
- p[Z + h] = B[h];
1266
+ ), d = f(), v = e.deps;
1267
+ if (le !== null) {
1268
+ var m;
1269
+ if (Zt(e, he), v !== null && he > 0)
1270
+ for (v.length = he + le.length, m = 0; m < le.length; m++)
1271
+ v[he + m] = le[m];
1272
1272
  else
1273
- e.deps = p = B;
1274
- if (Et() && (e.f & re) !== 0)
1275
- for (h = Z; h < p.length; h++)
1276
- (p[h].reactions ??= []).push(e);
1277
- } else p !== null && Z < p.length && (St(e, Z), p.length = Z);
1278
- if (lt() && $ !== null && !le && p !== null && (e.f & (q | ie | G)) === 0)
1279
- for (h = 0; h < /** @type {Source[]} */
1280
- $.length; h++)
1281
- sr(
1282
- $[h],
1273
+ e.deps = v = le;
1274
+ if (Wt() && (e.f & Pe) !== 0)
1275
+ for (m = he; m < v.length; m++)
1276
+ (v[m].reactions ??= []).push(e);
1277
+ } else v !== null && he < v.length && (Zt(e, he), v.length = he);
1278
+ if (Lt() && ye !== null && !Ie && v !== null && (e.f & (re | Se | fe)) === 0)
1279
+ for (m = 0; m < /** @type {Source[]} */
1280
+ ye.length; m++)
1281
+ Ur(
1282
+ ye[m],
1283
1283
  /** @type {Effect} */
1284
1284
  e
1285
1285
  );
1286
- return a !== null && a !== e && (st++, $ !== null && (r === null ? r = $ : r.push(.../** @type {Source[]} */
1287
- $))), (e.f & Pe) !== 0 && (e.f ^= Pe), d;
1288
- } catch (v) {
1289
- return li(v);
1286
+ return s !== null && s !== e && (At++, ye !== null && (r === null ? r = ye : r.push(.../** @type {Source[]} */
1287
+ ye))), (e.f & qe) !== 0 && (e.f ^= qe), d;
1288
+ } catch (_) {
1289
+ return Vi(_);
1290
1290
  } finally {
1291
- e.f ^= Zt, B = t, Z = n, $ = r, S = a, he = i, yt(l), le = s, Ne = u;
1291
+ e.f ^= Cn, le = t, he = n, ye = r, N = s, Ae = i, Bt(l), Ie = o, Xe = c;
1292
1292
  }
1293
1293
  }
1294
- function Mi(e, t) {
1294
+ function vs(e, t) {
1295
1295
  let n = t.reactions;
1296
1296
  if (n !== null) {
1297
- var r = Vr.call(n, e);
1297
+ var r = Mi.call(n, e);
1298
1298
  if (r !== -1) {
1299
- var a = n.length - 1;
1300
- a === 0 ? n = t.reactions = null : (n[r] = n[a], n.pop());
1299
+ var s = n.length - 1;
1300
+ s === 0 ? n = t.reactions = null : (n[r] = n[s], n.pop());
1301
1301
  }
1302
1302
  }
1303
- n === null && (t.f & q) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
1303
+ n === null && (t.f & re) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
1304
1304
  // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
1305
1305
  // allows us to skip the expensive work of disconnecting and immediately reconnecting it
1306
- (B === null || !B.includes(t)) && (H(t, ie), (t.f & re) !== 0 && (t.f ^= re, t.f &= ~Oe), Bn(
1306
+ (le === null || !le.includes(t)) && (ne(t, Se), (t.f & Pe) !== 0 && (t.f ^= Pe, t.f &= ~tt), Pr(
1307
1307
  /** @type {Derived} **/
1308
1308
  t
1309
- ), St(
1309
+ ), Zt(
1310
1310
  /** @type {Derived} **/
1311
1311
  t,
1312
1312
  0
1313
1313
  ));
1314
1314
  }
1315
- function St(e, t) {
1315
+ function Zt(e, t) {
1316
1316
  var n = e.deps;
1317
1317
  if (n !== null)
1318
1318
  for (var r = t; r < n.length; r++)
1319
- Mi(e, n[r]);
1319
+ vs(e, n[r]);
1320
1320
  }
1321
- function Be(e) {
1321
+ function pt(e) {
1322
1322
  var t = e.f;
1323
- if ((t & de) === 0) {
1324
- H(e, z);
1325
- var n = M, r = Ae;
1326
- M = e, Ae = !0;
1323
+ if ((t & Re) === 0) {
1324
+ ne(e, te);
1325
+ var n = j, r = Qe;
1326
+ j = e, Qe = !0;
1327
1327
  try {
1328
- (t & (me | Zr)) !== 0 ? Ii(e) : er(e), $n(e);
1329
- var a = or(e);
1330
- e.teardown = typeof a == "function" ? a : null, e.wv = ir;
1328
+ (t & (Ne | Ti)) !== 0 ? ls(e) : Ar(e), Tr(e);
1329
+ var s = jr(e);
1330
+ e.teardown = typeof s == "function" ? s : null, e.wv = Fr;
1331
1331
  var i;
1332
- Yt && Ar && (e.f & G) !== 0 && e.deps;
1332
+ kn && vi && (e.f & fe) !== 0 && e.deps;
1333
1333
  } finally {
1334
- Ae = r, M = n;
1334
+ Qe = r, j = n;
1335
1335
  }
1336
1336
  }
1337
1337
  }
1338
- async function Ti() {
1339
- await Promise.resolve(), ui();
1338
+ async function ps() {
1339
+ await Promise.resolve(), Yi();
1340
1340
  }
1341
- function f(e) {
1342
- var t = e.f, n = (t & q) !== 0;
1343
- if (S !== null && !le) {
1344
- var r = M !== null && (M.f & de) !== 0;
1345
- if (!r && !he?.includes(e)) {
1346
- var a = S.deps;
1347
- if ((S.f & Zt) !== 0)
1348
- e.rv < st && (e.rv = st, B === null && a !== null && a[Z] === e ? Z++ : B === null ? B = [e] : B.includes(e) || B.push(e));
1341
+ function a(e) {
1342
+ var t = e.f, n = (t & re) !== 0;
1343
+ if (N !== null && !Ie) {
1344
+ var r = j !== null && (j.f & Re) !== 0;
1345
+ if (!r && !Ae?.includes(e)) {
1346
+ var s = N.deps;
1347
+ if ((N.f & Cn) !== 0)
1348
+ e.rv < At && (e.rv = At, le === null && s !== null && s[he] === e ? he++ : le === null ? le = [e] : le.includes(e) || le.push(e));
1349
1349
  else {
1350
- (S.deps ??= []).push(e);
1350
+ (N.deps ??= []).push(e);
1351
1351
  var i = e.reactions;
1352
- i === null ? e.reactions = [S] : i.includes(S) || i.push(S);
1352
+ i === null ? e.reactions = [N] : i.includes(N) || i.push(N);
1353
1353
  }
1354
1354
  }
1355
1355
  }
1356
- if (Fe) {
1357
- if (Se.has(e))
1358
- return Se.get(e);
1356
+ if (rt) {
1357
+ if (Be.has(e))
1358
+ return Be.get(e);
1359
1359
  if (n) {
1360
1360
  var l = (
1361
1361
  /** @type {Derived} */
1362
1362
  e
1363
- ), s = l.v;
1364
- return ((l.f & z) === 0 && l.reactions !== null || ur(l)) && (s = un(l)), Se.set(l, s), s;
1363
+ ), o = l.v;
1364
+ return ((l.f & te) === 0 && l.reactions !== null || Hr(l)) && (o = Kn(l)), Be.set(l, o), o;
1365
1365
  }
1366
- } else n && (!ne?.has(e) || C?.is_fork && !Et()) && (l = /** @type {Derived} */
1367
- e, We(l) && Yn(l), Ae && Et() && (l.f & re) === 0 && lr(l));
1368
- if (ne?.has(e))
1369
- return ne.get(e);
1370
- if ((e.f & Pe) !== 0)
1366
+ } else n && (!ge?.has(e) || L?.is_fork && !Wt()) && (l = /** @type {Derived} */
1367
+ e, mt(l) && Sr(l), Qe && Wt() && (l.f & Pe) === 0 && zr(l));
1368
+ if (ge?.has(e))
1369
+ return ge.get(e);
1370
+ if ((e.f & qe) !== 0)
1371
1371
  throw e.v;
1372
1372
  return e.v;
1373
1373
  }
1374
- function lr(e) {
1374
+ function zr(e) {
1375
1375
  if (e.deps !== null) {
1376
- e.f ^= re;
1376
+ e.f ^= Pe;
1377
1377
  for (const t of e.deps)
1378
- (t.reactions ??= []).push(e), (t.f & q) !== 0 && (t.f & re) === 0 && lr(
1378
+ (t.reactions ??= []).push(e), (t.f & re) !== 0 && (t.f & Pe) === 0 && zr(
1379
1379
  /** @type {Derived} */
1380
1380
  t
1381
1381
  );
1382
1382
  }
1383
1383
  }
1384
- function ur(e) {
1385
- if (e.v === K) return !0;
1384
+ function Hr(e) {
1385
+ if (e.v === se) return !0;
1386
1386
  if (e.deps === null) return !1;
1387
1387
  for (const t of e.deps)
1388
- if (Se.has(t) || (t.f & q) !== 0 && ur(
1388
+ if (Be.has(t) || (t.f & re) !== 0 && Hr(
1389
1389
  /** @type {Derived} */
1390
1390
  t
1391
1391
  ))
1392
1392
  return !0;
1393
1393
  return !1;
1394
1394
  }
1395
- function P(e) {
1396
- var t = le;
1395
+ function w(e) {
1396
+ var t = Ie;
1397
1397
  try {
1398
- return le = !0, e();
1398
+ return Ie = !0, e();
1399
1399
  } finally {
1400
- le = t;
1400
+ Ie = t;
1401
1401
  }
1402
1402
  }
1403
- const Ai = -7169;
1404
- function H(e, t) {
1405
- e.f = e.f & Ai | t;
1403
+ const hs = -7169;
1404
+ function ne(e, t) {
1405
+ e.f = e.f & hs | t;
1406
1406
  }
1407
- function V(e) {
1407
+ function G(e) {
1408
1408
  if (!(typeof e != "object" || !e || e instanceof EventTarget)) {
1409
- if (Ve in e)
1410
- Xt(e);
1409
+ if (vt in e)
1410
+ Tn(e);
1411
1411
  else if (!Array.isArray(e))
1412
1412
  for (let t in e) {
1413
1413
  const n = e[t];
1414
- typeof n == "object" && n && Ve in n && Xt(n);
1414
+ typeof n == "object" && n && vt in n && Tn(n);
1415
1415
  }
1416
1416
  }
1417
1417
  }
1418
- function Xt(e, t = /* @__PURE__ */ new Set()) {
1418
+ function Tn(e, t = /* @__PURE__ */ new Set()) {
1419
1419
  if (typeof e == "object" && e !== null && // We don't want to traverse DOM elements
1420
1420
  !(e instanceof EventTarget) && !t.has(e)) {
1421
1421
  t.add(e), e instanceof Date && e.getTime();
1422
1422
  for (let r in e)
1423
1423
  try {
1424
- Xt(e[r], t);
1424
+ Tn(e[r], t);
1425
1425
  } catch {
1426
1426
  }
1427
- const n = Nn(e);
1427
+ const n = Dn(e);
1428
1428
  if (n !== Object.prototype && n !== Array.prototype && n !== Map.prototype && n !== Set.prototype && n !== Date.prototype) {
1429
- const r = Br(n);
1430
- for (let a in r) {
1431
- const i = r[a].get;
1429
+ const r = dr(n);
1430
+ for (let s in r) {
1431
+ const i = r[s].get;
1432
1432
  if (i)
1433
1433
  try {
1434
1434
  i.call(e);
@@ -1438,142 +1438,142 @@ function Xt(e, t = /* @__PURE__ */ new Set()) {
1438
1438
  }
1439
1439
  }
1440
1440
  }
1441
- function Ni(e, t, n, r = {}) {
1442
- function a(i) {
1443
- if (r.capture || Oi.call(t, i), !i.cancelBubble)
1444
- return Nt(() => n?.call(this, i));
1441
+ function ms(e, t, n, r = {}) {
1442
+ function s(i) {
1443
+ if (r.capture || _s.call(t, i), !i.cancelBubble)
1444
+ return an(() => n?.call(this, i));
1445
1445
  }
1446
1446
  return e.startsWith("pointer") || e.startsWith("touch") || e === "wheel" ? Hn(() => {
1447
- t.addEventListener(e, a, r);
1448
- }) : t.addEventListener(e, a, r), a;
1447
+ t.addEventListener(e, s, r);
1448
+ }) : t.addEventListener(e, s, r), s;
1449
1449
  }
1450
- function se(e, t, n, r, a) {
1451
- var i = { capture: r, passive: a }, l = Ni(e, t, n, i);
1450
+ function ce(e, t, n, r, s) {
1451
+ var i = { capture: r, passive: s }, l = ms(e, t, n, i);
1452
1452
  (t === document.body || // @ts-ignore
1453
1453
  t === window || // @ts-ignore
1454
1454
  t === document || // Firefox has quirky behavior, it can happen that we still get "canplay" events when the element is already removed
1455
- t instanceof HTMLMediaElement) && cn(() => {
1455
+ t instanceof HTMLMediaElement) && qn(() => {
1456
1456
  t.removeEventListener(e, l, i);
1457
1457
  });
1458
1458
  }
1459
- let kn = null;
1460
- function Oi(e) {
1459
+ let rr = null;
1460
+ function _s(e) {
1461
1461
  var t = this, n = (
1462
1462
  /** @type {Node} */
1463
1463
  t.ownerDocument
1464
- ), r = e.type, a = e.composedPath?.() || [], i = (
1464
+ ), r = e.type, s = e.composedPath?.() || [], i = (
1465
1465
  /** @type {null | Element} */
1466
- a[0] || e.target
1466
+ s[0] || e.target
1467
1467
  );
1468
- kn = e;
1469
- var l = 0, s = kn === e && e.__root;
1470
- if (s) {
1471
- var u = a.indexOf(s);
1472
- if (u !== -1 && (t === document || t === /** @type {any} */
1468
+ rr = e;
1469
+ var l = 0, o = rr === e && e.__root;
1470
+ if (o) {
1471
+ var c = s.indexOf(o);
1472
+ if (c !== -1 && (t === document || t === /** @type {any} */
1473
1473
  window)) {
1474
1474
  e.__root = t;
1475
1475
  return;
1476
1476
  }
1477
- var o = a.indexOf(t);
1478
- if (o === -1)
1477
+ var u = s.indexOf(t);
1478
+ if (u === -1)
1479
1479
  return;
1480
- u <= o && (l = u);
1480
+ c <= u && (l = c);
1481
1481
  }
1482
1482
  if (i = /** @type {Element} */
1483
- a[l] || e.target, i !== t) {
1484
- An(e, "currentTarget", {
1483
+ s[l] || e.target, i !== t) {
1484
+ fr(e, "currentTarget", {
1485
1485
  configurable: !0,
1486
1486
  get() {
1487
1487
  return i || n;
1488
1488
  }
1489
1489
  });
1490
- var c = S, d = M;
1491
- ue(null), Ie(null);
1490
+ var f = N, d = j;
1491
+ Me(null), Ve(null);
1492
1492
  try {
1493
- for (var p, h = []; i !== null; ) {
1494
- var v = i.assignedSlot || i.parentNode || /** @type {any} */
1493
+ for (var v, m = []; i !== null; ) {
1494
+ var _ = i.assignedSlot || i.parentNode || /** @type {any} */
1495
1495
  i.host || null;
1496
1496
  try {
1497
- var E = i["__" + r];
1498
- E != null && (!/** @type {any} */
1497
+ var h = i["__" + r];
1498
+ h != null && (!/** @type {any} */
1499
1499
  i.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
1500
1500
  // -> the target could not have been disabled because it emits the event in the first place
1501
- e.target === i) && E.call(i, e);
1502
- } catch (I) {
1503
- p ? h.push(I) : p = I;
1501
+ e.target === i) && h.call(i, e);
1502
+ } catch (p) {
1503
+ v ? m.push(p) : v = p;
1504
1504
  }
1505
- if (e.cancelBubble || v === t || v === null)
1505
+ if (e.cancelBubble || _ === t || _ === null)
1506
1506
  break;
1507
- i = v;
1507
+ i = _;
1508
1508
  }
1509
- if (p) {
1510
- for (let I of h)
1509
+ if (v) {
1510
+ for (let p of m)
1511
1511
  queueMicrotask(() => {
1512
- throw I;
1512
+ throw p;
1513
1513
  });
1514
- throw p;
1514
+ throw v;
1515
1515
  }
1516
1516
  } finally {
1517
- e.__root = t, delete e.currentTarget, ue(c), Ie(d);
1517
+ e.__root = t, delete e.currentTarget, Me(f), Ve(d);
1518
1518
  }
1519
1519
  }
1520
1520
  }
1521
- function Di(e) {
1521
+ function ys(e) {
1522
1522
  var t = document.createElement("template");
1523
1523
  return t.innerHTML = e.replaceAll("<!>", "<!---->"), t.content;
1524
1524
  }
1525
- function It(e, t) {
1525
+ function Qt(e, t) {
1526
1526
  var n = (
1527
1527
  /** @type {Effect} */
1528
- M
1528
+ j
1529
1529
  );
1530
1530
  n.nodes === null && (n.nodes = { start: e, end: t, a: null, t: null });
1531
1531
  }
1532
1532
  // @__NO_SIDE_EFFECTS__
1533
- function O(e, t) {
1534
- var n = (t & qr) !== 0, r = (t & Kr) !== 0, a, i = !e.startsWith("<!>");
1533
+ function T(e, t) {
1534
+ var n = (t & Si) !== 0, r = (t & ki) !== 0, s, i = !e.startsWith("<!>");
1535
1535
  return () => {
1536
- a === void 0 && (a = Di(i ? e : "<!>" + e), n || (a = /** @type {TemplateNode} */
1537
- /* @__PURE__ */ gt(a)));
1536
+ s === void 0 && (s = ys(i ? e : "<!>" + e), n || (s = /** @type {TemplateNode} */
1537
+ /* @__PURE__ */ Gt(s)));
1538
1538
  var l = (
1539
1539
  /** @type {TemplateNode} */
1540
- r || mi ? document.importNode(a, !0) : a.cloneNode(!0)
1540
+ r || $i ? document.importNode(s, !0) : s.cloneNode(!0)
1541
1541
  );
1542
1542
  if (n) {
1543
- var s = (
1543
+ var o = (
1544
1544
  /** @type {TemplateNode} */
1545
- /* @__PURE__ */ gt(l)
1546
- ), u = (
1545
+ /* @__PURE__ */ Gt(l)
1546
+ ), c = (
1547
1547
  /** @type {TemplateNode} */
1548
1548
  l.lastChild
1549
1549
  );
1550
- It(s, u);
1550
+ Qt(o, c);
1551
1551
  } else
1552
- It(l, l);
1552
+ Qt(l, l);
1553
1553
  return l;
1554
1554
  };
1555
1555
  }
1556
- function Fi(e = "") {
1556
+ function bs(e = "") {
1557
1557
  {
1558
- var t = Te(e + "");
1559
- return It(t, t), t;
1558
+ var t = Ze(e + "");
1559
+ return Qt(t, t), t;
1560
1560
  }
1561
1561
  }
1562
- function pt() {
1563
- var e = document.createDocumentFragment(), t = document.createComment(""), n = Te();
1564
- return e.append(t, n), It(t, n), e;
1562
+ function ut() {
1563
+ var e = document.createDocumentFragment(), t = document.createComment(""), n = Ze();
1564
+ return e.append(t, n), Qt(t, n), e;
1565
1565
  }
1566
- function T(e, t) {
1566
+ function P(e, t) {
1567
1567
  e !== null && e.before(
1568
1568
  /** @type {Node} */
1569
1569
  t
1570
1570
  );
1571
1571
  }
1572
- function Me(e, t) {
1572
+ function me(e, t) {
1573
1573
  var n = t == null ? "" : typeof t == "object" ? t + "" : t;
1574
1574
  n !== (e.__t ??= e.nodeValue) && (e.__t = n, e.nodeValue = n + "");
1575
1575
  }
1576
- class Li {
1576
+ class gs {
1577
1577
  /** @type {TemplateNode} */
1578
1578
  anchor;
1579
1579
  /** @type {Map<Batch, Key>} */
@@ -1608,18 +1608,18 @@ class Li {
1608
1608
  * Whether to pause (i.e. outro) on change, or destroy immediately.
1609
1609
  * This is necessary for `<svelte:element>`
1610
1610
  */
1611
- #a = !0;
1611
+ #s = !0;
1612
1612
  /**
1613
1613
  * @param {TemplateNode} anchor
1614
1614
  * @param {boolean} transition
1615
1615
  */
1616
1616
  constructor(t, n = !0) {
1617
- this.anchor = t, this.#a = n;
1617
+ this.anchor = t, this.#s = n;
1618
1618
  }
1619
1619
  #i = () => {
1620
1620
  var t = (
1621
1621
  /** @type {Batch} */
1622
- C
1622
+ L
1623
1623
  );
1624
1624
  if (this.#t.has(t)) {
1625
1625
  var n = (
@@ -1627,39 +1627,39 @@ class Li {
1627
1627
  this.#t.get(t)
1628
1628
  ), r = this.#n.get(n);
1629
1629
  if (r)
1630
- pn(r), this.#r.delete(n);
1630
+ Gn(r), this.#r.delete(n);
1631
1631
  else {
1632
- var a = this.#e.get(n);
1633
- a && (this.#n.set(n, a.effect), this.#e.delete(n), a.fragment.lastChild.remove(), this.anchor.before(a.fragment), r = a.effect);
1632
+ var s = this.#e.get(n);
1633
+ s && (this.#n.set(n, s.effect), this.#e.delete(n), s.fragment.lastChild.remove(), this.anchor.before(s.fragment), r = s.effect);
1634
1634
  }
1635
1635
  for (const [i, l] of this.#t) {
1636
1636
  if (this.#t.delete(i), i === t)
1637
1637
  break;
1638
- const s = this.#e.get(l);
1639
- s && (pe(s.effect), this.#e.delete(l));
1638
+ const o = this.#e.get(l);
1639
+ o && (Te(o.effect), this.#e.delete(l));
1640
1640
  }
1641
1641
  for (const [i, l] of this.#n) {
1642
1642
  if (i === n || this.#r.has(i)) continue;
1643
- const s = () => {
1643
+ const o = () => {
1644
1644
  if (Array.from(this.#t.values()).includes(i)) {
1645
- var o = document.createDocumentFragment();
1646
- Ci(l, o), o.append(Te()), this.#e.set(i, { effect: l, fragment: o });
1645
+ var u = document.createDocumentFragment();
1646
+ us(l, u), u.append(Ze()), this.#e.set(i, { effect: l, fragment: u });
1647
1647
  } else
1648
- pe(l);
1648
+ Te(l);
1649
1649
  this.#r.delete(i), this.#n.delete(i);
1650
1650
  };
1651
- this.#a || !r ? (this.#r.add(i), vn(l, s, !1)) : s();
1651
+ this.#s || !r ? (this.#r.add(i), Yn(l, o, !1)) : o();
1652
1652
  }
1653
1653
  }
1654
1654
  };
1655
1655
  /**
1656
1656
  * @param {Batch} batch
1657
1657
  */
1658
- #s = (t) => {
1658
+ #a = (t) => {
1659
1659
  this.#t.delete(t);
1660
1660
  const n = Array.from(this.#t.values());
1661
- for (const [r, a] of this.#e)
1662
- n.includes(r) || (pe(a.effect), this.#e.delete(r));
1661
+ for (const [r, s] of this.#e)
1662
+ n.includes(r) || (Te(s.effect), this.#e.delete(r));
1663
1663
  };
1664
1664
  /**
1665
1665
  *
@@ -1669,55 +1669,55 @@ class Li {
1669
1669
  ensure(t, n) {
1670
1670
  var r = (
1671
1671
  /** @type {Batch} */
1672
- C
1673
- ), a = Zn();
1672
+ L
1673
+ ), s = Mr();
1674
1674
  if (n && !this.#n.has(t) && !this.#e.has(t))
1675
- if (a) {
1676
- var i = document.createDocumentFragment(), l = Te();
1675
+ if (s) {
1676
+ var i = document.createDocumentFragment(), l = Ze();
1677
1677
  i.append(l), this.#e.set(t, {
1678
- effect: at(() => n(l)),
1678
+ effect: Tt(() => n(l)),
1679
1679
  fragment: i
1680
1680
  });
1681
1681
  } else
1682
1682
  this.#n.set(
1683
1683
  t,
1684
- at(() => n(this.anchor))
1684
+ Tt(() => n(this.anchor))
1685
1685
  );
1686
- if (this.#t.set(r, t), a) {
1687
- for (const [s, u] of this.#n)
1688
- s === t ? r.skipped_effects.delete(u) : r.skipped_effects.add(u);
1689
- for (const [s, u] of this.#e)
1690
- s === t ? r.skipped_effects.delete(u.effect) : r.skipped_effects.add(u.effect);
1691
- r.oncommit(this.#i), r.ondiscard(this.#s);
1686
+ if (this.#t.set(r, t), s) {
1687
+ for (const [o, c] of this.#n)
1688
+ o === t ? r.skipped_effects.delete(c) : r.skipped_effects.add(c);
1689
+ for (const [o, c] of this.#e)
1690
+ o === t ? r.skipped_effects.delete(c.effect) : r.skipped_effects.add(c.effect);
1691
+ r.oncommit(this.#i), r.ondiscard(this.#a);
1692
1692
  } else
1693
1693
  this.#i();
1694
1694
  }
1695
1695
  }
1696
- function ee(e, t, n = !1) {
1697
- var r = new Li(e), a = n ? tt : 0;
1698
- function i(l, s) {
1699
- r.ensure(l, s);
1696
+ function J(e, t, n = !1) {
1697
+ var r = new gs(e), s = n ? It : 0;
1698
+ function i(l, o) {
1699
+ r.ensure(l, o);
1700
1700
  }
1701
- Xn(() => {
1701
+ Rr(() => {
1702
1702
  var l = !1;
1703
- t((s, u = !0) => {
1704
- l = !0, i(u, s);
1703
+ t((o, c = !0) => {
1704
+ l = !0, i(c, o);
1705
1705
  }), l || i(!1, null);
1706
- }, a);
1706
+ }, s);
1707
1707
  }
1708
- function Ui(e, t, n) {
1709
- for (var r = [], a = t.length, i, l = t.length, s = 0; s < a; s++) {
1710
- let d = t[s];
1711
- vn(
1708
+ function ws(e, t, n) {
1709
+ for (var r = [], s = t.length, i, l = t.length, o = 0; o < s; o++) {
1710
+ let d = t[o];
1711
+ Yn(
1712
1712
  d,
1713
1713
  () => {
1714
1714
  if (i) {
1715
1715
  if (i.pending.delete(d), i.done.add(d), i.pending.size === 0) {
1716
- var p = (
1716
+ var v = (
1717
1717
  /** @type {Set<EachOutroGroup>} */
1718
1718
  e.outrogroups
1719
1719
  );
1720
- $t(nn(i.done)), p.delete(i), p.size === 0 && (e.outrogroups = null);
1720
+ An(Fn(i.done)), v.delete(i), v.size === 0 && (e.outrogroups = null);
1721
1721
  }
1722
1722
  } else
1723
1723
  l -= 1;
@@ -1726,250 +1726,284 @@ function Ui(e, t, n) {
1726
1726
  );
1727
1727
  }
1728
1728
  if (l === 0) {
1729
- var u = r.length === 0 && n !== null;
1730
- if (u) {
1731
- var o = (
1729
+ var c = r.length === 0 && n !== null;
1730
+ if (c) {
1731
+ var u = (
1732
1732
  /** @type {Element} */
1733
1733
  n
1734
- ), c = (
1734
+ ), f = (
1735
1735
  /** @type {Element} */
1736
- o.parentNode
1736
+ u.parentNode
1737
1737
  );
1738
- bi(c), c.append(o), e.items.clear();
1738
+ ns(f), f.append(u), e.items.clear();
1739
1739
  }
1740
- $t(t, !u);
1740
+ An(t, !c);
1741
1741
  } else
1742
1742
  i = {
1743
1743
  pending: new Set(t),
1744
1744
  done: /* @__PURE__ */ new Set()
1745
1745
  }, (e.outrogroups ??= /* @__PURE__ */ new Set()).add(i);
1746
1746
  }
1747
- function $t(e, t = !0) {
1747
+ function An(e, t = !0) {
1748
1748
  for (var n = 0; n < e.length; n++)
1749
- pe(e[n], t);
1749
+ Te(e[n], t);
1750
1750
  }
1751
- var Cn;
1752
- function cr(e, t, n, r, a, i = null) {
1753
- var l = e, s = /* @__PURE__ */ new Map();
1754
- {
1751
+ var ir;
1752
+ function Wn(e, t, n, r, s, i = null) {
1753
+ var l = e, o = /* @__PURE__ */ new Map(), c = (t & cr) !== 0;
1754
+ if (c) {
1755
1755
  var u = (
1756
1756
  /** @type {Element} */
1757
1757
  e
1758
1758
  );
1759
- l = u.appendChild(Te());
1760
- }
1761
- var o = null, c = /* @__PURE__ */ At(() => {
1762
- var I = n();
1763
- return Tn(I) ? I : I == null ? [] : nn(I);
1764
- }), d, p = !0;
1765
- function h() {
1766
- E.fallback = o, ji(E, d, l, t, r), o !== null && (d.length === 0 ? (o.f & Ee) === 0 ? pn(o) : (o.f ^= Ee, $e(o, null, l)) : vn(o, () => {
1767
- o = null;
1759
+ l = u.appendChild(Ze());
1760
+ }
1761
+ var f = null, d = /* @__PURE__ */ Ct(() => {
1762
+ var y = n();
1763
+ return ur(y) ? y : y == null ? [] : Fn(y);
1764
+ }), v, m = !0;
1765
+ function _() {
1766
+ p.fallback = f, Es(p, v, l, t, r), f !== null && (v.length === 0 ? (f.f & xe) === 0 ? Gn(f) : (f.f ^= xe, St(f, null, l)) : Yn(f, () => {
1767
+ f = null;
1768
1768
  }));
1769
1769
  }
1770
- var v = Xn(() => {
1771
- d = /** @type {V[]} */
1772
- f(c);
1773
- for (var I = d.length, w = /* @__PURE__ */ new Set(), _ = (
1770
+ var h = Rr(() => {
1771
+ v = /** @type {V[]} */
1772
+ a(d);
1773
+ for (var y = v.length, B = /* @__PURE__ */ new Set(), S = (
1774
1774
  /** @type {Batch} */
1775
- C
1776
- ), g = Zn(), N = 0; N < I; N += 1) {
1777
- var m = d[N], R = r(m, N), x = p ? null : s.get(R);
1778
- x ? (x.v && it(x.v, m), x.i && it(x.i, N), g && _.skipped_effects.delete(x.e)) : (x = zi(
1775
+ L
1776
+ ), z = Mr(), H = 0; H < y; H += 1) {
1777
+ var Z = v[H], O = r(Z, H), V = m ? null : o.get(O);
1778
+ V ? (V.v && Rt(V.v, Z), V.i && Rt(V.i, H), z && S.skipped_effects.delete(V.e)) : (V = Ps(
1779
+ o,
1780
+ m ? l : ir ??= Ze(),
1781
+ Z,
1782
+ O,
1783
+ H,
1779
1784
  s,
1780
- p ? l : Cn ??= Te(),
1781
- m,
1782
- R,
1783
- N,
1784
- a,
1785
1785
  t,
1786
1786
  n
1787
- ), p || (x.e.f |= Ee), s.set(R, x)), w.add(R);
1787
+ ), m || (V.e.f |= xe), o.set(O, V)), B.add(O);
1788
1788
  }
1789
- if (I === 0 && i && !o && (p ? o = at(() => i(l)) : (o = at(() => i(Cn ??= Te())), o.f |= Ee)), !p)
1790
- if (g) {
1791
- for (const [U, ae] of s)
1792
- w.has(U) || _.skipped_effects.add(ae.e);
1793
- _.oncommit(h), _.ondiscard(() => {
1789
+ if (y === 0 && i && !f && (m ? f = Tt(() => i(l)) : (f = Tt(() => i(ir ??= Ze())), f.f |= xe)), !m)
1790
+ if (z) {
1791
+ for (const [I, E] of o)
1792
+ B.has(I) || S.skipped_effects.add(E.e);
1793
+ S.oncommit(_), S.ondiscard(() => {
1794
1794
  });
1795
1795
  } else
1796
- h();
1797
- f(c);
1798
- }), E = { effect: v, items: s, outrogroups: null, fallback: o };
1799
- p = !1;
1800
- }
1801
- function ji(e, t, n, r, a) {
1802
- var i = t.length, l = e.items, s = e.effect.first, u, o = null, c = [], d = [], p, h, v, E;
1803
- for (E = 0; E < i; E += 1) {
1804
- if (p = t[E], h = a(p, E), v = /** @type {EachItem} */
1805
- l.get(h).e, e.outrogroups !== null)
1806
- for (const U of e.outrogroups)
1807
- U.pending.delete(v), U.done.delete(v);
1808
- if ((v.f & Ee) !== 0)
1809
- if (v.f ^= Ee, v === s)
1810
- $e(v, null, n);
1796
+ _();
1797
+ a(d);
1798
+ }), p = { effect: h, items: o, outrogroups: null, fallback: f };
1799
+ m = !1;
1800
+ }
1801
+ function Es(e, t, n, r, s) {
1802
+ var i = (r & _i) !== 0, l = t.length, o = e.items, c = e.effect.first, u, f = null, d, v = [], m = [], _, h, p, y;
1803
+ if (i)
1804
+ for (y = 0; y < l; y += 1)
1805
+ _ = t[y], h = s(_, y), p = /** @type {EachItem} */
1806
+ o.get(h).e, (p.f & xe) === 0 && (p.nodes?.a?.measure(), (d ??= /* @__PURE__ */ new Set()).add(p));
1807
+ for (y = 0; y < l; y += 1) {
1808
+ if (_ = t[y], h = s(_, y), p = /** @type {EachItem} */
1809
+ o.get(h).e, e.outrogroups !== null)
1810
+ for (const E of e.outrogroups)
1811
+ E.pending.delete(p), E.done.delete(p);
1812
+ if ((p.f & xe) !== 0)
1813
+ if (p.f ^= xe, p === c)
1814
+ St(p, null, n);
1811
1815
  else {
1812
- var I = o ? o.next : s;
1813
- v === e.effect.last && (e.effect.last = v.prev), v.prev && (v.prev.next = v.next), v.next && (v.next.prev = v.prev), we(e, o, v), we(e, v, I), $e(v, I, n), o = v, c = [], d = [], s = o.next;
1816
+ var B = f ? f.next : c;
1817
+ p === e.effect.last && (e.effect.last = p.prev), p.prev && (p.prev.next = p.next), p.next && (p.next.prev = p.prev), He(e, f, p), He(e, p, B), St(p, B, n), f = p, v = [], m = [], c = f.next;
1814
1818
  continue;
1815
1819
  }
1816
- if ((v.f & J) !== 0 && pn(v), v !== s) {
1817
- if (u !== void 0 && u.has(v)) {
1818
- if (c.length < d.length) {
1819
- var w = d[0], _;
1820
- o = w.prev;
1821
- var g = c[0], N = c[c.length - 1];
1822
- for (_ = 0; _ < c.length; _ += 1)
1823
- $e(c[_], w, n);
1824
- for (_ = 0; _ < d.length; _ += 1)
1825
- u.delete(d[_]);
1826
- we(e, g.prev, N.next), we(e, o, g), we(e, N, w), s = w, o = N, E -= 1, c = [], d = [];
1820
+ if ((p.f & _e) !== 0 && (Gn(p), i && (p.nodes?.a?.unfix(), (d ??= /* @__PURE__ */ new Set()).delete(p))), p !== c) {
1821
+ if (u !== void 0 && u.has(p)) {
1822
+ if (v.length < m.length) {
1823
+ var S = m[0], z;
1824
+ f = S.prev;
1825
+ var H = v[0], Z = v[v.length - 1];
1826
+ for (z = 0; z < v.length; z += 1)
1827
+ St(v[z], S, n);
1828
+ for (z = 0; z < m.length; z += 1)
1829
+ u.delete(m[z]);
1830
+ He(e, H.prev, Z.next), He(e, f, H), He(e, Z, S), c = S, f = Z, y -= 1, v = [], m = [];
1827
1831
  } else
1828
- u.delete(v), $e(v, s, n), we(e, v.prev, v.next), we(e, v, o === null ? e.effect.first : o.next), we(e, o, v), o = v;
1832
+ u.delete(p), St(p, c, n), He(e, p.prev, p.next), He(e, p, f === null ? e.effect.first : f.next), He(e, f, p), f = p;
1829
1833
  continue;
1830
1834
  }
1831
- for (c = [], d = []; s !== null && s !== v; )
1832
- (u ??= /* @__PURE__ */ new Set()).add(s), d.push(s), s = s.next;
1833
- if (s === null)
1835
+ for (v = [], m = []; c !== null && c !== p; )
1836
+ (u ??= /* @__PURE__ */ new Set()).add(c), m.push(c), c = c.next;
1837
+ if (c === null)
1834
1838
  continue;
1835
1839
  }
1836
- (v.f & Ee) === 0 && c.push(v), o = v, s = v.next;
1840
+ (p.f & xe) === 0 && v.push(p), f = p, c = p.next;
1837
1841
  }
1838
1842
  if (e.outrogroups !== null) {
1839
- for (const U of e.outrogroups)
1840
- U.pending.size === 0 && ($t(nn(U.done)), e.outrogroups?.delete(U));
1843
+ for (const E of e.outrogroups)
1844
+ E.pending.size === 0 && (An(Fn(E.done)), e.outrogroups?.delete(E));
1841
1845
  e.outrogroups.size === 0 && (e.outrogroups = null);
1842
1846
  }
1843
- if (s !== null || u !== void 0) {
1844
- var m = [];
1847
+ if (c !== null || u !== void 0) {
1848
+ var O = [];
1845
1849
  if (u !== void 0)
1846
- for (v of u)
1847
- (v.f & J) === 0 && m.push(v);
1848
- for (; s !== null; )
1849
- (s.f & J) === 0 && s !== e.fallback && m.push(s), s = s.next;
1850
- var R = m.length;
1851
- if (R > 0) {
1852
- var x = i === 0 ? n : null;
1853
- Ui(e, m, x);
1850
+ for (p of u)
1851
+ (p.f & _e) === 0 && O.push(p);
1852
+ for (; c !== null; )
1853
+ (c.f & _e) === 0 && c !== e.fallback && O.push(c), c = c.next;
1854
+ var V = O.length;
1855
+ if (V > 0) {
1856
+ var I = (r & cr) !== 0 && l === 0 ? n : null;
1857
+ if (i) {
1858
+ for (y = 0; y < V; y += 1)
1859
+ O[y].nodes?.a?.measure();
1860
+ for (y = 0; y < V; y += 1)
1861
+ O[y].nodes?.a?.fix();
1862
+ }
1863
+ ws(e, O, I);
1854
1864
  }
1855
1865
  }
1866
+ i && Hn(() => {
1867
+ if (d !== void 0)
1868
+ for (p of d)
1869
+ p.nodes?.a?.apply();
1870
+ });
1856
1871
  }
1857
- function zi(e, t, n, r, a, i, l, s) {
1858
- var u = (l & Or) !== 0 ? (l & Fr) === 0 ? /* @__PURE__ */ ve(n, !1, !1) : rt(n) : null, o = (l & Dr) !== 0 ? rt(a) : null;
1872
+ function Ps(e, t, n, r, s, i, l, o) {
1873
+ var c = (l & hi) !== 0 ? (l & yi) === 0 ? /* @__PURE__ */ Q(n, !1, !1) : xt(n) : null, u = (l & mi) !== 0 ? xt(s) : null;
1859
1874
  return {
1860
- v: u,
1861
- i: o,
1862
- e: at(() => (i(t, u ?? n, o ?? a, s), () => {
1875
+ v: c,
1876
+ i: u,
1877
+ e: Tt(() => (i(t, c ?? n, u ?? s, o), () => {
1863
1878
  e.delete(r);
1864
1879
  }))
1865
1880
  };
1866
1881
  }
1867
- function $e(e, t, n) {
1882
+ function St(e, t, n) {
1868
1883
  if (e.nodes)
1869
- for (var r = e.nodes.start, a = e.nodes.end, i = t && (t.f & Ee) === 0 ? (
1884
+ for (var r = e.nodes.start, s = e.nodes.end, i = t && (t.f & xe) === 0 ? (
1870
1885
  /** @type {EffectNodes} */
1871
1886
  t.nodes.start
1872
1887
  ) : n; r !== null; ) {
1873
1888
  var l = (
1874
1889
  /** @type {TemplateNode} */
1875
- /* @__PURE__ */ ut(r)
1890
+ /* @__PURE__ */ Ot(r)
1876
1891
  );
1877
- if (i.before(r), r === a)
1892
+ if (i.before(r), r === s)
1878
1893
  return;
1879
1894
  r = l;
1880
1895
  }
1881
1896
  }
1882
- function we(e, t, n) {
1897
+ function He(e, t, n) {
1883
1898
  t === null ? e.effect.first = n : t.next = n, n === null ? e.effect.last = t : n.prev = t;
1884
1899
  }
1885
- function Rn(e, t, n, r, a) {
1900
+ function Nn(e, t, n, r, s) {
1886
1901
  var i = t.$$slots?.[n], l = !1;
1887
- i === !0 && (i = t[n === "default" ? "children" : n], l = !0), i === void 0 ? a !== null && a(e) : i(e, l ? () => r : r);
1902
+ i === !0 && (i = t[n === "default" ? "children" : n], l = !0), i === void 0 ? s !== null && s(e) : i(e, l ? () => r : r);
1888
1903
  }
1889
- function fr(e) {
1904
+ function Kr(e) {
1890
1905
  var t, n, r = "";
1891
1906
  if (typeof e == "string" || typeof e == "number") r += e;
1892
1907
  else if (typeof e == "object") if (Array.isArray(e)) {
1893
- var a = e.length;
1894
- for (t = 0; t < a; t++) e[t] && (n = fr(e[t])) && (r && (r += " "), r += n);
1908
+ var s = e.length;
1909
+ for (t = 0; t < s; t++) e[t] && (n = Kr(e[t])) && (r && (r += " "), r += n);
1895
1910
  } else for (n in e) e[n] && (r && (r += " "), r += n);
1896
1911
  return r;
1897
1912
  }
1898
- function Hi() {
1899
- for (var e, t, n = 0, r = "", a = arguments.length; n < a; n++) (e = arguments[n]) && (t = fr(e)) && (r && (r += " "), r += t);
1913
+ function Ss() {
1914
+ for (var e, t, n = 0, r = "", s = arguments.length; n < s; n++) (e = arguments[n]) && (t = Kr(e)) && (r && (r += " "), r += t);
1900
1915
  return r;
1901
1916
  }
1902
- function kt(e) {
1903
- return typeof e == "object" ? Hi(e) : e ?? "";
1917
+ function $e(e) {
1918
+ return typeof e == "object" ? Ss(e) : e ?? "";
1904
1919
  }
1905
- function qi(e, t, n) {
1920
+ function ks(e, t, n) {
1906
1921
  var r = e == null ? "" : "" + e;
1907
1922
  return r === "" ? null : r;
1908
1923
  }
1909
- function Ki(e, t) {
1924
+ function Is(e, t) {
1910
1925
  return e == null ? null : String(e);
1911
1926
  }
1912
- function Ct(e, t, n, r, a, i) {
1927
+ function et(e, t, n, r, s, i) {
1913
1928
  var l = e.__className;
1914
1929
  if (l !== n || l === void 0) {
1915
- var s = qi(n);
1916
- s == null ? e.removeAttribute("class") : e.className = s, e.__className = n;
1930
+ var o = ks(n);
1931
+ o == null ? e.removeAttribute("class") : e.className = o, e.__className = n;
1917
1932
  }
1918
1933
  return i;
1919
1934
  }
1920
- function dr(e, t, n, r) {
1921
- var a = e.__style;
1922
- if (a !== t) {
1923
- var i = Ki(t);
1935
+ function Jn(e, t, n, r) {
1936
+ var s = e.__style;
1937
+ if (s !== t) {
1938
+ var i = Is(t);
1924
1939
  i == null ? e.removeAttribute("style") : e.style.cssText = i, e.__style = t;
1925
1940
  }
1926
1941
  return r;
1927
1942
  }
1928
- function Vi(e, t, n = t) {
1943
+ const Ms = /* @__PURE__ */ Symbol("is custom element"), Cs = /* @__PURE__ */ Symbol("is html");
1944
+ function Ln(e, t, n, r) {
1945
+ var s = xs(e);
1946
+ s[t] !== (s[t] = n) && (t === "loading" && (e[Ni] = n), n == null ? e.removeAttribute(t) : typeof n != "string" && Rs(e).includes(t) ? e[t] = n : e.setAttribute(t, n));
1947
+ }
1948
+ function xs(e) {
1949
+ return (
1950
+ /** @type {Record<string | symbol, unknown>} **/
1951
+ // @ts-expect-error
1952
+ e.__attributes ??= {
1953
+ [Ms]: e.nodeName.includes("-"),
1954
+ [Cs]: e.namespaceURI === Ii
1955
+ }
1956
+ );
1957
+ }
1958
+ var sr = /* @__PURE__ */ new Map();
1959
+ function Rs(e) {
1960
+ var t = e.getAttribute("is") || e.nodeName, n = sr.get(t);
1961
+ if (n) return n;
1962
+ sr.set(t, n = []);
1963
+ for (var r, s = e, i = Element.prototype; i !== s; ) {
1964
+ r = dr(s);
1965
+ for (var l in r)
1966
+ r[l].set && n.push(l);
1967
+ s = Dn(s);
1968
+ }
1969
+ return n;
1970
+ }
1971
+ function Ts(e, t, n = t) {
1929
1972
  var r = /* @__PURE__ */ new WeakSet();
1930
- gi(e, "input", async (a) => {
1931
- var i = a ? e.defaultValue : e.value;
1932
- if (i = Vt(e) ? Bt(i) : i, n(i), C !== null && r.add(C), await Ti(), i !== (i = t())) {
1933
- var l = e.selectionStart, s = e.selectionEnd, u = e.value.length;
1934
- if (e.value = i ?? "", s !== null) {
1935
- var o = e.value.length;
1936
- l === s && s === u && o > u ? (e.selectionStart = o, e.selectionEnd = o) : (e.selectionStart = l, e.selectionEnd = Math.min(s, o));
1973
+ is(e, "input", async (s) => {
1974
+ var i = s ? e.defaultValue : e.value;
1975
+ if (i = Pn(e) ? Sn(i) : i, n(i), L !== null && r.add(L), await ps(), i !== (i = t())) {
1976
+ var l = e.selectionStart, o = e.selectionEnd, c = e.value.length;
1977
+ if (e.value = i ?? "", o !== null) {
1978
+ var u = e.value.length;
1979
+ l === o && o === c && u > c ? (e.selectionStart = u, e.selectionEnd = u) : (e.selectionStart = l, e.selectionEnd = Math.min(o, u));
1937
1980
  }
1938
1981
  }
1939
1982
  }), // If we are hydrating and the value has since changed,
1940
1983
  // then use the updated value from the input instead.
1941
1984
  // If defaultValue is set, then value == defaultValue
1942
1985
  // TODO Svelte 6: remove input.value check and set to empty string?
1943
- P(t) == null && e.value && (n(Vt(e) ? Bt(e.value) : e.value), C !== null && r.add(C)), dn(() => {
1944
- var a = t();
1986
+ w(t) == null && e.value && (n(Pn(e) ? Sn(e.value) : e.value), L !== null && r.add(L)), Vn(() => {
1987
+ var s = t();
1945
1988
  if (e === document.activeElement) {
1946
1989
  var i = (
1947
1990
  /** @type {Batch} */
1948
- _t ?? C
1991
+ qt ?? L
1949
1992
  );
1950
1993
  if (r.has(i))
1951
1994
  return;
1952
1995
  }
1953
- Vt(e) && a === Bt(e.value) || e.type === "date" && !a && !e.value || a !== e.value && (e.value = a ?? "");
1996
+ Pn(e) && s === Sn(e.value) || e.type === "date" && !s && !e.value || s !== e.value && (e.value = s ?? "");
1954
1997
  });
1955
1998
  }
1956
- function Vt(e) {
1999
+ function Pn(e) {
1957
2000
  var t = e.type;
1958
2001
  return t === "number" || t === "range";
1959
2002
  }
1960
- function Bt(e) {
2003
+ function Sn(e) {
1961
2004
  return e === "" ? null : +e;
1962
2005
  }
1963
- function Bi(e) {
1964
- return function(...t) {
1965
- var n = (
1966
- /** @type {Event} */
1967
- t[0]
1968
- );
1969
- n.target === this && e?.apply(this, t);
1970
- };
1971
- }
1972
- function Yi(e) {
2006
+ function As(e) {
1973
2007
  return function(...t) {
1974
2008
  var n = (
1975
2009
  /** @type {Event} */
@@ -1978,48 +2012,48 @@ function Yi(e) {
1978
2012
  return n.preventDefault(), e?.apply(this, t);
1979
2013
  };
1980
2014
  }
1981
- function hn(e = !1) {
2015
+ function on(e = !1) {
1982
2016
  const t = (
1983
2017
  /** @type {ComponentContextLegacy} */
1984
- j
2018
+ $
1985
2019
  ), n = t.l.u;
1986
2020
  if (!n) return;
1987
- let r = () => V(t.s);
2021
+ let r = () => G(t.s);
1988
2022
  if (e) {
1989
- let a = 0, i = (
2023
+ let s = 0, i = (
1990
2024
  /** @type {Record<string, any>} */
1991
2025
  {}
1992
2026
  );
1993
- const l = /* @__PURE__ */ Tt(() => {
1994
- let s = !1;
1995
- const u = t.s;
1996
- for (const o in u)
1997
- u[o] !== i[o] && (i[o] = u[o], s = !0);
1998
- return s && a++, a;
2027
+ const l = /* @__PURE__ */ sn(() => {
2028
+ let o = !1;
2029
+ const c = t.s;
2030
+ for (const u in c)
2031
+ c[u] !== i[u] && (i[u] = c[u], o = !0);
2032
+ return o && s++, s;
1999
2033
  });
2000
- r = () => f(l);
2034
+ r = () => a(l);
2001
2035
  }
2002
- n.b.length && Pi(() => {
2003
- xn(t, r), Gt(n.b);
2004
- }), Pn(() => {
2005
- const a = P(() => n.m.map(Gr));
2036
+ n.b.length && as(() => {
2037
+ ar(t, r), Mn(n.b);
2038
+ }), er(() => {
2039
+ const s = w(() => n.m.map(Ri));
2006
2040
  return () => {
2007
- for (const i of a)
2041
+ for (const i of s)
2008
2042
  typeof i == "function" && i();
2009
2043
  };
2010
- }), n.a.length && Pn(() => {
2011
- xn(t, r), Gt(n.a);
2044
+ }), n.a.length && er(() => {
2045
+ ar(t, r), Mn(n.a);
2012
2046
  });
2013
2047
  }
2014
- function xn(e, t) {
2048
+ function ar(e, t) {
2015
2049
  if (e.l.s)
2016
- for (const n of e.l.s) f(n);
2050
+ for (const n of e.l.s) a(n);
2017
2051
  t();
2018
2052
  }
2019
- function vr(e, t, n) {
2053
+ function qr(e, t, n) {
2020
2054
  if (e == null)
2021
- return t(void 0), Wt;
2022
- const r = P(
2055
+ return t(void 0), In;
2056
+ const r = w(
2023
2057
  () => e.subscribe(
2024
2058
  t,
2025
2059
  // @ts-expect-error
@@ -2028,35 +2062,35 @@ function vr(e, t, n) {
2028
2062
  );
2029
2063
  return r.unsubscribe ? () => r.unsubscribe() : r;
2030
2064
  }
2031
- function Wi(e) {
2065
+ function Ns(e) {
2032
2066
  let t;
2033
- return vr(e, (n) => t = n)(), t;
2067
+ return qr(e, (n) => t = n)(), t;
2034
2068
  }
2035
- let ht = !1, en = /* @__PURE__ */ Symbol();
2036
- function Gi(e, t, n) {
2069
+ let Ht = !1, On = /* @__PURE__ */ Symbol();
2070
+ function Ls(e, t, n) {
2037
2071
  const r = n[t] ??= {
2038
2072
  store: null,
2039
- source: /* @__PURE__ */ ve(void 0),
2040
- unsubscribe: Wt
2073
+ source: /* @__PURE__ */ Q(void 0),
2074
+ unsubscribe: In
2041
2075
  };
2042
- if (r.store !== e && !(en in n))
2076
+ if (r.store !== e && !(On in n))
2043
2077
  if (r.unsubscribe(), r.store = e ?? null, e == null)
2044
- r.source.v = void 0, r.unsubscribe = Wt;
2078
+ r.source.v = void 0, r.unsubscribe = In;
2045
2079
  else {
2046
- var a = !0;
2047
- r.unsubscribe = vr(e, (i) => {
2048
- a ? r.source.v = i : L(r.source, i);
2049
- }), a = !1;
2080
+ var s = !0;
2081
+ r.unsubscribe = qr(e, (i) => {
2082
+ s ? r.source.v = i : A(r.source, i);
2083
+ }), s = !1;
2050
2084
  }
2051
- return e && en in n ? Wi(e) : f(r.source);
2085
+ return e && On in n ? Ns(e) : a(r.source);
2052
2086
  }
2053
- function Zi() {
2087
+ function Os() {
2054
2088
  const e = {};
2055
2089
  function t() {
2056
- cn(() => {
2090
+ qn(() => {
2057
2091
  for (var n in e)
2058
2092
  e[n].unsubscribe();
2059
- An(e, en, {
2093
+ fr(e, On, {
2060
2094
  enumerable: !1,
2061
2095
  value: !0
2062
2096
  });
@@ -2064,82 +2098,110 @@ function Zi() {
2064
2098
  }
2065
2099
  return [e, t];
2066
2100
  }
2067
- function Ji(e) {
2068
- var t = ht;
2101
+ function Fs(e) {
2102
+ var t = Ht;
2069
2103
  try {
2070
- return ht = !1, [e(), ht];
2104
+ return Ht = !1, [e(), Ht];
2071
2105
  } finally {
2072
- ht = t;
2106
+ Ht = t;
2073
2107
  }
2074
2108
  }
2075
2109
  function D(e, t, n, r) {
2076
- var a = !ot || (n & Ur) !== 0, i = (n & zr) !== 0, l = (n & Hr) !== 0, s = (
2110
+ var s = !Nt || (n & gi) !== 0, i = (n & Ei) !== 0, l = (n & Pi) !== 0, o = (
2077
2111
  /** @type {V} */
2078
2112
  r
2079
- ), u = !0, o = () => (u && (u = !1, s = l ? P(
2113
+ ), c = !0, u = () => (c && (c = !1, o = l ? w(
2080
2114
  /** @type {() => V} */
2081
2115
  r
2082
2116
  ) : (
2083
2117
  /** @type {V} */
2084
2118
  r
2085
- )), s), c;
2119
+ )), o), f;
2086
2120
  if (i) {
2087
- var d = Ve in e || Jr in e;
2088
- c = mt(e, t)?.set ?? (d && t in e ? (g) => e[t] = g : void 0);
2121
+ var d = vt in e || Ai in e;
2122
+ f = Kt(e, t)?.set ?? (d && t in e ? (S) => e[t] = S : void 0);
2089
2123
  }
2090
- var p, h = !1;
2091
- i ? [p, h] = Ji(() => (
2124
+ var v, m = !1;
2125
+ i ? [v, m] = Fs(() => (
2092
2126
  /** @type {V} */
2093
2127
  e[t]
2094
- )) : p = /** @type {V} */
2095
- e[t], p === void 0 && r !== void 0 && (p = o(), c && (a && ni(), c(p)));
2096
- var v;
2097
- if (a ? v = () => {
2098
- var g = (
2128
+ )) : v = /** @type {V} */
2129
+ e[t], v === void 0 && r !== void 0 && (v = u(), f && (s && ji(), f(v)));
2130
+ var _;
2131
+ if (s ? _ = () => {
2132
+ var S = (
2099
2133
  /** @type {V} */
2100
2134
  e[t]
2101
2135
  );
2102
- return g === void 0 ? o() : (u = !0, g);
2103
- } : v = () => {
2104
- var g = (
2136
+ return S === void 0 ? u() : (c = !0, S);
2137
+ } : _ = () => {
2138
+ var S = (
2105
2139
  /** @type {V} */
2106
2140
  e[t]
2107
2141
  );
2108
- return g !== void 0 && (s = /** @type {V} */
2109
- void 0), g === void 0 ? s : g;
2110
- }, a && (n & jr) === 0)
2111
- return v;
2112
- if (c) {
2113
- var E = e.$$legacy;
2142
+ return S !== void 0 && (o = /** @type {V} */
2143
+ void 0), S === void 0 ? o : S;
2144
+ }, s && (n & wi) === 0)
2145
+ return _;
2146
+ if (f) {
2147
+ var h = e.$$legacy;
2114
2148
  return (
2115
2149
  /** @type {() => V} */
2116
- (function(g, N) {
2117
- return arguments.length > 0 ? ((!a || !N || E || h) && c(N ? v() : g), g) : v();
2150
+ (function(S, z) {
2151
+ return arguments.length > 0 ? ((!s || !z || h || m) && f(z ? _() : S), S) : _();
2118
2152
  })
2119
2153
  );
2120
2154
  }
2121
- var I = !1, w = ((n & Lr) !== 0 ? Tt : At)(() => (I = !1, v()));
2122
- i && f(w);
2123
- var _ = (
2155
+ var p = !1, y = ((n & bi) !== 0 ? sn : Ct)(() => (p = !1, _()));
2156
+ i && a(y);
2157
+ var B = (
2124
2158
  /** @type {Effect} */
2125
- M
2159
+ j
2126
2160
  );
2127
2161
  return (
2128
2162
  /** @type {() => V} */
2129
- (function(g, N) {
2163
+ (function(S, z) {
2130
2164
  if (arguments.length > 0) {
2131
- const m = N ? f(w) : a && i ? Ke(g) : g;
2132
- return L(w, m), I = !0, s !== void 0 && (s = m), g;
2165
+ const H = z ? a(y) : s && i ? dt(S) : S;
2166
+ return A(y, H), p = !0, o !== void 0 && (o = H), S;
2133
2167
  }
2134
- return Fe && I || (_.f & de) !== 0 ? w.v : f(w);
2168
+ return rt && p || (B.f & Re) !== 0 ? y.v : a(y);
2135
2169
  })
2136
2170
  );
2137
2171
  }
2138
- function Qi(e) {
2172
+ const Ds = "https://api.reevit.io";
2173
+ function Us(e, t) {
2174
+ return {
2175
+ code: t?.code || "payment_link_error",
2176
+ message: t?.message || "Payment link request failed",
2177
+ recoverable: !0,
2178
+ details: {
2179
+ httpStatus: e.status,
2180
+ ...t?.details || {}
2181
+ }
2182
+ };
2183
+ }
2184
+ function js(e) {
2139
2185
  const t = e.toLowerCase();
2140
2186
  return t.includes("paystack") ? "paystack" : t.includes("hubtel") ? "hubtel" : t.includes("flutterwave") ? "flutterwave" : t.includes("stripe") ? "stripe" : t.includes("monnify") ? "monnify" : t.includes("mpesa") || t.includes("m-pesa") ? "mpesa" : "paystack";
2141
2187
  }
2142
- function Xi(e, t) {
2188
+ function zs(e) {
2189
+ const t = e.toLowerCase().trim();
2190
+ return t === "card" ? "card" : t === "mobile_money" || t === "momo" || t === "mobilemoney" ? "mobile_money" : t === "bank" || t === "bank_transfer" || t === "transfer" ? "bank_transfer" : null;
2191
+ }
2192
+ function Hs(e) {
2193
+ if (!(!e || e.length === 0))
2194
+ return e.map((t) => {
2195
+ const n = t.methods.map((r) => zs(r)).filter(Boolean);
2196
+ return {
2197
+ provider: t.provider,
2198
+ name: t.name,
2199
+ methods: n,
2200
+ countries: t.countries
2201
+ };
2202
+ }).filter((t) => t.methods.length > 0);
2203
+ }
2204
+ function Ks(e, t) {
2143
2205
  return {
2144
2206
  id: e.id,
2145
2207
  clientSecret: e.client_secret,
@@ -2148,7 +2210,7 @@ function Xi(e, t) {
2148
2210
  amount: e.amount,
2149
2211
  currency: e.currency,
2150
2212
  status: e.status,
2151
- recommendedPsp: Qi(e.provider),
2213
+ recommendedPsp: js(e.provider),
2152
2214
  availableMethods: t.paymentMethods || ["card", "mobile_money"],
2153
2215
  reference: e.reference || t.reference,
2154
2216
  connectionId: e.connection_id,
@@ -2156,289 +2218,433 @@ function Xi(e, t) {
2156
2218
  feeAmount: e.fee_amount,
2157
2219
  feeCurrency: e.fee_currency,
2158
2220
  netAmount: e.net_amount,
2159
- metadata: t.metadata
2221
+ metadata: t.metadata,
2222
+ availableProviders: Hs(e.available_psps),
2223
+ branding: e.branding
2160
2224
  };
2161
2225
  }
2162
- function $i(e) {
2163
- const { config: t, onSuccess: n, onError: r, onClose: a, onStateChange: i, apiBaseUrl: l } = e;
2164
- let s = Sr();
2165
- t.initialPaymentIntent && (s = {
2166
- ...s,
2226
+ function qs(e) {
2227
+ const { config: t, onSuccess: n, onError: r, onClose: s, onStateChange: i, apiBaseUrl: l } = e;
2228
+ let o = ii();
2229
+ t.initialPaymentIntent && (o = {
2230
+ ...o,
2167
2231
  status: "ready",
2168
2232
  paymentIntent: t.initialPaymentIntent,
2169
2233
  selectedMethod: t.initialPaymentIntent.availableMethods?.length === 1 ? t.initialPaymentIntent.availableMethods[0] : null
2170
2234
  });
2171
- const u = /* @__PURE__ */ new Set(), o = new Ir({
2235
+ const c = /* @__PURE__ */ new Set(), u = new si({
2172
2236
  publicKey: t.publicKey,
2173
2237
  baseUrl: l
2174
- }), c = () => {
2175
- u.forEach((b) => b(s));
2176
- }, d = (b) => {
2177
- const y = s.status;
2178
- s = Rr(s, b), c(), s.status !== y && i?.(s.status);
2179
- }, p = (b) => (u.add(b), b(s), () => u.delete(b)), h = async (b) => {
2238
+ }), f = () => {
2239
+ c.forEach((k) => k(o));
2240
+ }, d = (k) => {
2241
+ const x = o.status;
2242
+ o = li(o, k), f(), o.status !== x && i?.(o.status);
2243
+ }, v = (k) => (c.add(k), k(o), () => c.delete(k)), m = async (k, x) => {
2180
2244
  d({ type: "INIT_START" });
2181
2245
  try {
2182
- const y = t.reference || kr(), k = Cr(t.currency), Y = b || t.paymentMethods?.[0] || "card", { data: W, error: Q } = await o.createPaymentIntent(
2183
- { ...t, reference: y },
2184
- Y,
2185
- k
2186
- );
2187
- if (Q) {
2188
- d({ type: "INIT_ERROR", payload: Q }), r?.(Q);
2246
+ const R = t.reference || ai(), K = oi(t.currency), b = t.paymentMethods && t.paymentMethods.length === 1 ? t.paymentMethods[0] : void 0, de = k ?? b;
2247
+ let we, ae;
2248
+ if (t.paymentLinkCode) {
2249
+ const ve = await fetch(
2250
+ `${l || Ds}/v1/pay/${t.paymentLinkCode}/pay`,
2251
+ {
2252
+ method: "POST",
2253
+ headers: {
2254
+ "Content-Type": "application/json",
2255
+ "Idempotency-Key": `${Date.now()}-${Math.random().toString(36).substring(2, 15)}`
2256
+ },
2257
+ body: JSON.stringify({
2258
+ amount: t.amount,
2259
+ email: t.email || "",
2260
+ name: t.customerName || "",
2261
+ phone: t.phone || "",
2262
+ method: de,
2263
+ country: K,
2264
+ provider: x?.preferredProvider || x?.allowedProviders?.[0],
2265
+ custom_fields: t.customFields
2266
+ })
2267
+ }
2268
+ ), _t = await ve.json().catch(() => ({}));
2269
+ ve.ok ? we = _t : ae = Us(ve, _t);
2270
+ } else {
2271
+ const ve = await u.createPaymentIntent(
2272
+ { ...t, reference: R },
2273
+ de,
2274
+ K,
2275
+ {
2276
+ preferredProviders: x?.preferredProvider ? [x.preferredProvider] : void 0,
2277
+ allowedProviders: x?.allowedProviders
2278
+ }
2279
+ );
2280
+ we = ve.data, ae = ve.error;
2281
+ }
2282
+ if (ae) {
2283
+ d({ type: "INIT_ERROR", payload: ae }), r?.(ae);
2189
2284
  return;
2190
2285
  }
2191
- if (!W) {
2192
- const Le = {
2286
+ if (!we) {
2287
+ const ve = {
2193
2288
  code: "INIT_FAILED",
2194
2289
  message: "No data received from API",
2195
2290
  recoverable: !0
2196
2291
  };
2197
- d({ type: "INIT_ERROR", payload: Le }), r?.(Le);
2292
+ d({ type: "INIT_ERROR", payload: ve }), r?.(ve);
2198
2293
  return;
2199
2294
  }
2200
- const ye = Xi(W, { ...t, reference: y });
2201
- d({ type: "INIT_SUCCESS", payload: ye });
2202
- } catch (y) {
2203
- const k = {
2295
+ const cn = Ks(we, { ...t, reference: R });
2296
+ d({ type: "INIT_SUCCESS", payload: cn });
2297
+ } catch (R) {
2298
+ const K = {
2204
2299
  code: "INIT_FAILED",
2205
- message: y instanceof Error ? y.message : "Failed to initialize checkout",
2300
+ message: R instanceof Error ? R.message : "Failed to initialize checkout",
2206
2301
  recoverable: !0,
2207
- originalError: y
2302
+ originalError: R
2208
2303
  };
2209
- d({ type: "INIT_ERROR", payload: k }), r?.(k);
2304
+ d({ type: "INIT_ERROR", payload: K }), r?.(K);
2210
2305
  }
2211
- }, v = (b) => {
2212
- d({ type: "SELECT_METHOD", payload: b });
2213
- }, E = async (b) => {
2214
- if (!(!s.paymentIntent || !s.selectedMethod)) {
2306
+ }, _ = (k) => {
2307
+ d({ type: "SELECT_METHOD", payload: k });
2308
+ }, h = async (k) => {
2309
+ if (!(!o.paymentIntent || !o.selectedMethod)) {
2215
2310
  d({ type: "PROCESS_START" });
2216
2311
  try {
2217
- let y;
2218
- if (s.paymentIntent.clientSecret) {
2219
- const { data: Y, error: W } = await o.confirmPaymentIntent(
2220
- s.paymentIntent.id,
2221
- s.paymentIntent.clientSecret
2312
+ let x;
2313
+ if (o.paymentIntent.clientSecret) {
2314
+ const { data: K, error: b } = await u.confirmPaymentIntent(
2315
+ o.paymentIntent.id,
2316
+ o.paymentIntent.clientSecret
2222
2317
  );
2223
- if (W) {
2224
- d({ type: "PROCESS_ERROR", payload: W }), r?.(W);
2318
+ if (b) {
2319
+ d({ type: "PROCESS_ERROR", payload: b }), r?.(b);
2225
2320
  return;
2226
2321
  }
2227
- y = Y;
2322
+ x = K;
2228
2323
  } else {
2229
- const { data: Y, error: W } = await o.confirmPayment(s.paymentIntent.id);
2230
- if (W) {
2231
- d({ type: "PROCESS_ERROR", payload: W }), r?.(W);
2324
+ const { data: K, error: b } = await u.confirmPayment(o.paymentIntent.id);
2325
+ if (b) {
2326
+ d({ type: "PROCESS_ERROR", payload: b }), r?.(b);
2232
2327
  return;
2233
2328
  }
2234
- y = Y;
2329
+ x = K;
2235
2330
  }
2236
- const k = {
2237
- paymentId: s.paymentIntent.id,
2238
- reference: b.reference || s.paymentIntent.reference || s.paymentIntent.metadata?.reference || "",
2239
- amount: s.paymentIntent.amount,
2240
- currency: s.paymentIntent.currency,
2241
- paymentMethod: s.selectedMethod,
2242
- psp: s.paymentIntent.recommendedPsp,
2243
- pspReference: b.pspReference || y?.provider_ref_id || "",
2331
+ const R = {
2332
+ paymentId: o.paymentIntent.id,
2333
+ reference: k.reference || o.paymentIntent.reference || o.paymentIntent.metadata?.reference || "",
2334
+ amount: o.paymentIntent.amount,
2335
+ currency: o.paymentIntent.currency,
2336
+ paymentMethod: o.selectedMethod,
2337
+ psp: o.paymentIntent.recommendedPsp,
2338
+ pspReference: k.pspReference || x?.provider_ref_id || "",
2244
2339
  status: "success",
2245
- metadata: b
2340
+ metadata: k
2246
2341
  };
2247
- d({ type: "PROCESS_SUCCESS", payload: k }), n?.(k);
2248
- } catch (y) {
2249
- const k = {
2342
+ d({ type: "PROCESS_SUCCESS", payload: R }), n?.(R);
2343
+ } catch (x) {
2344
+ const R = {
2250
2345
  code: "PAYMENT_FAILED",
2251
- message: y instanceof Error ? y.message : "Payment failed",
2346
+ message: x instanceof Error ? x.message : "Payment failed",
2252
2347
  recoverable: !0,
2253
- originalError: y
2348
+ originalError: x
2254
2349
  };
2255
- d({ type: "PROCESS_ERROR", payload: k }), r?.(k);
2350
+ d({ type: "PROCESS_ERROR", payload: R }), r?.(R);
2256
2351
  }
2257
2352
  }
2258
2353
  };
2259
2354
  return {
2260
2355
  // Svelte store contract
2261
- subscribe: p,
2356
+ subscribe: v,
2262
2357
  // Actions
2263
- initialize: h,
2264
- selectMethod: v,
2265
- processPayment: E,
2266
- handlePspSuccess: async (b) => {
2267
- await E(b);
2358
+ initialize: m,
2359
+ selectMethod: _,
2360
+ processPayment: h,
2361
+ handlePspSuccess: async (k) => {
2362
+ await h(k);
2268
2363
  },
2269
- handlePspError: (b) => {
2270
- d({ type: "PROCESS_ERROR", payload: b }), r?.(b);
2364
+ handlePspError: (k) => {
2365
+ d({ type: "PROCESS_ERROR", payload: k }), r?.(k);
2271
2366
  },
2272
2367
  reset: () => {
2273
2368
  d({ type: "RESET" });
2274
2369
  },
2275
2370
  close: async () => {
2276
- if (s.paymentIntent && s.status !== "success")
2371
+ if (o.paymentIntent && o.status !== "success")
2277
2372
  try {
2278
- await o.cancelPaymentIntent(s.paymentIntent.id);
2373
+ await u.cancelPaymentIntent(o.paymentIntent.id);
2279
2374
  } catch {
2280
2375
  }
2281
- d({ type: "CLOSE" }), a?.();
2376
+ d({ type: "CLOSE" }), s?.();
2282
2377
  },
2283
2378
  // Getters
2284
- getStatus: () => s.status,
2285
- getPaymentIntent: () => s.paymentIntent,
2286
- getSelectedMethod: () => s.selectedMethod,
2287
- getError: () => s.error,
2288
- getResult: () => s.result,
2289
- isLoading: () => s.status === "loading" || s.status === "processing",
2290
- isReady: () => s.status === "ready" || s.status === "method_selected",
2291
- isComplete: () => s.status === "success",
2292
- canRetry: () => s.error?.recoverable ?? !1
2379
+ getStatus: () => o.status,
2380
+ getPaymentIntent: () => o.paymentIntent,
2381
+ getSelectedMethod: () => o.selectedMethod,
2382
+ getError: () => o.error,
2383
+ getResult: () => o.result,
2384
+ isLoading: () => o.status === "loading" || o.status === "processing",
2385
+ isReady: () => o.status === "ready" || o.status === "method_selected",
2386
+ isComplete: () => o.status === "success",
2387
+ canRetry: () => o.error?.recoverable ?? !1
2293
2388
  };
2294
2389
  }
2295
- var ea = /* @__PURE__ */ O('<div class="reevit-radio-inner"></div>'), ta = /* @__PURE__ */ O('<button type="button"><span class="reevit-method-icon"> </span> <div class="reevit-method-info"><span class="reevit-method-name"> </span> <span class="reevit-method-description"> </span></div> <div class="reevit-method-radio"><!></div></button>'), na = /* @__PURE__ */ O('<div class="reevit-method-selector"><h3 class="reevit-section-title">Select Payment Method</h3> <p class="reevit-amount-display"> </p> <div class="reevit-methods-grid"></div></div>');
2296
- function ra(e, t) {
2297
- on(t, !1);
2298
- const n = /* @__PURE__ */ ve();
2299
- let r = D(t, "methods", 8), a = D(t, "selected", 8), i = D(t, "amount", 8), l = D(t, "currency", 8), s = D(t, "provider", 8, void 0);
2300
- const u = tn(), o = {
2301
- hubtel: "Hubtel",
2302
- paystack: "Paystack",
2303
- flutterwave: "Flutterwave",
2304
- monnify: "Monnify",
2305
- mpesa: "M-Pesa",
2306
- stripe: "Stripe"
2307
- };
2308
- function c(w) {
2309
- return s()?.toLowerCase().includes("hubtel") && w === "mobile_money" ? `Pay with ${o[s().toLowerCase()] || "Hubtel"}` : {
2310
- card: "Card",
2311
- mobile_money: "Mobile Money",
2312
- bank_transfer: "Bank Transfer"
2313
- }[w];
2314
- }
2315
- function d(w) {
2316
- return s()?.toLowerCase().includes("hubtel") ? "Card, Mobile Money, and Bank Transfer" : {
2317
- card: "Visa, Mastercard, Maestro",
2318
- mobile_money: "MTN, Vodafone, AirtelTigo",
2319
- bank_transfer: "Transfer directly from your bank"
2320
- }[w];
2321
- }
2322
- function p(w) {
2323
- u("select", w);
2324
- }
2325
- Re(() => V(r()), () => {
2326
- L(n, [
2390
+ var Bs = /* @__PURE__ */ T('<div class="reevit-method-selector__label">Select payment method</div>'), Vs = /* @__PURE__ */ T('<span class="reevit-method-option__description"> </span>'), Ys = /* @__PURE__ */ T('<span class="reevit-method-option__check"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg></span>'), Gs = /* @__PURE__ */ T('<span class="reevit-method-option__chevron"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg></span>'), Ws = /* @__PURE__ */ T('<button type="button"><span class="reevit-method-option__icon-wrapper"><span class="reevit-method-option__icon"> </span></span> <div class="reevit-method-option__content"><span class="reevit-method-option__label"> </span> <!></div> <!></button>'), Js = /* @__PURE__ */ T("<div><!> <div></div></div>");
2391
+ function Br(e, t) {
2392
+ tn(t, !1);
2393
+ const n = /* @__PURE__ */ Q(), r = /* @__PURE__ */ Q();
2394
+ let s = D(t, "methods", 8), i = D(t, "selected", 8);
2395
+ D(t, "provider", 8, void 0);
2396
+ let l = D(t, "layout", 8, "list"), o = D(t, "showLabel", 8, !0);
2397
+ const c = Xt();
2398
+ function u(_) {
2399
+ c("select", _);
2400
+ }
2401
+ ee(() => G(l()), () => {
2402
+ A(n, l() === "grid");
2403
+ }), ee(() => G(s()), () => {
2404
+ A(r, [
2327
2405
  {
2328
2406
  id: "card",
2329
- name: c("card"),
2330
- description: d("card"),
2331
- icon: "💳"
2407
+ name: "Card",
2408
+ icon: "💳",
2409
+ description: "Pay with Visa, Mastercard, or other cards"
2332
2410
  },
2333
2411
  {
2334
2412
  id: "mobile_money",
2335
- name: c("mobile_money"),
2336
- description: d("mobile_money"),
2337
- icon: "📱"
2413
+ name: "Mobile Money",
2414
+ icon: "📱",
2415
+ description: "MTN, Vodafone Cash, AirtelTigo Money"
2338
2416
  },
2339
2417
  {
2340
2418
  id: "bank_transfer",
2341
- name: c("bank_transfer"),
2342
- description: d("bank_transfer"),
2343
- icon: "🏦"
2419
+ name: "Bank Transfer",
2420
+ icon: "🏦",
2421
+ description: "Pay directly from your bank account"
2344
2422
  }
2345
- ].filter((w) => r().includes(w.id)));
2346
- }), fn(), hn();
2347
- var h = na(), v = F(A(h), 2), E = A(v), I = F(v, 2);
2348
- cr(I, 5, () => f(n), (w) => w.id, (w, _) => {
2349
- var g = ta(), N = A(g), m = A(N), R = F(N, 2), x = A(R), U = A(x), ae = F(x, 2), Ce = A(ae), ct = F(R, 2), ft = A(ct);
2423
+ ].filter((_) => s().includes(_.id)));
2424
+ }), Bn(), on();
2425
+ var f = Js(), d = g(f);
2426
+ {
2427
+ var v = (_) => {
2428
+ var h = Bs();
2429
+ P(_, h);
2430
+ };
2431
+ J(d, (_) => {
2432
+ o() && _(v);
2433
+ });
2434
+ }
2435
+ var m = q(d, 2);
2436
+ Wn(m, 7, () => a(r), (_) => _.id, (_, h, p) => {
2437
+ var y = Ws(), B = g(y), S = g(B), z = g(S), H = q(B, 2), Z = g(H), O = g(Z), V = q(Z, 2);
2350
2438
  {
2351
- var b = (y) => {
2352
- var k = ea();
2353
- T(y, k);
2439
+ var I = (M) => {
2440
+ var k = Vs(), x = g(k);
2441
+ X(() => me(x, (a(h), w(() => a(h).description)))), P(M, k);
2354
2442
  };
2355
- ee(ft, (y) => {
2356
- V(a()), f(_), P(() => a() === f(_).id) && y(b);
2443
+ J(V, (M) => {
2444
+ a(n) || M(I);
2357
2445
  });
2358
2446
  }
2359
- oe(
2360
- (y) => {
2361
- Ct(g, 1, y), Me(m, (f(_), P(() => f(_).icon))), Me(U, (f(_), P(() => f(_).name))), Me(Ce, (f(_), P(() => f(_).description)));
2447
+ var E = q(H, 2);
2448
+ {
2449
+ var F = (M) => {
2450
+ var k = ut(), x = Ke(k);
2451
+ {
2452
+ var R = (b) => {
2453
+ var de = Ys();
2454
+ P(b, de);
2455
+ }, K = (b) => {
2456
+ var de = Gs();
2457
+ P(b, de);
2458
+ };
2459
+ J(x, (b) => {
2460
+ G(i()), a(h), w(() => i() === a(h).id) ? b(R) : b(K, !1);
2461
+ });
2462
+ }
2463
+ P(M, k);
2464
+ };
2465
+ J(E, (M) => {
2466
+ a(n) || M(F);
2467
+ });
2468
+ }
2469
+ X(
2470
+ (M) => {
2471
+ et(y, 1, M), Jn(y, `animation-delay: ${a(p) * 0.05}s`), me(z, (a(h), w(() => a(h).icon))), me(O, (a(h), w(() => a(h).name)));
2362
2472
  },
2363
2473
  [
2364
- () => kt((V(ge), V(a()), f(_), P(() => ge("reevit-method-card", a() === f(_).id && "reevit-method-card--selected"))))
2474
+ () => $e((G(ue), a(n), G(i()), a(h), w(() => ue(
2475
+ "reevit-method-option",
2476
+ a(n) ? "reevit-method-option--grid" : "reevit-method-option--list",
2477
+ i() === a(h).id && "reevit-method-option--selected"
2478
+ ))))
2365
2479
  ]
2366
- ), se("click", g, () => p(f(_).id)), T(w, g);
2367
- }), oe((w) => Me(E, `Pay ${w ?? ""}`), [
2368
- () => (V(bn), V(i()), V(l()), P(() => bn(i(), l())))
2369
- ]), T(e, h), ln();
2370
- }
2371
- var ia = /* @__PURE__ */ O('<button type="button"><div class="reevit-network-dot"></div> </button>'), aa = /* @__PURE__ */ O('<p class="reevit-error-message"> </p>'), sa = /* @__PURE__ */ O('<span class="reevit-spinner"></span>'), oa = /* @__PURE__ */ O("<span>Continue</span>"), la = /* @__PURE__ */ O('<form class="reevit-momo-form"><div class="reevit-form-group"><label class="reevit-label" for="reevit-phone">Phone Number</label> <input id="reevit-phone" type="tel" placeholder="e.g. 024 123 4567" autocomplete="tel"/></div> <div class="reevit-network-selector"><label class="reevit-label" for="reevit-network-grid">Select Network</label> <div id="reevit-network-grid" class="reevit-networks-grid"></div></div> <!> <button type="submit" class="reevit-submit-btn"><!></button> <p class="reevit-secure-text">🔒 Secure mobile money payment via Reevit</p></form>');
2372
- function ua(e, t) {
2373
- on(t, !1);
2374
- let n = D(t, "initialPhone", 8, ""), r = D(t, "loading", 8, !1);
2375
- const a = tn();
2376
- let i = /* @__PURE__ */ ve(n()), l = /* @__PURE__ */ ve(null), s = /* @__PURE__ */ ve(null);
2480
+ ), ce("click", y, () => u(a(h).id)), P(_, y);
2481
+ }), X(
2482
+ (_, h) => {
2483
+ et(f, 1, _), et(m, 1, h);
2484
+ },
2485
+ [
2486
+ () => $e((G(ue), a(n), w(() => ue("reevit-method-selector", a(n) && "reevit-method-selector--grid")))),
2487
+ () => $e((G(ue), a(n), w(() => ue("reevit-method-selector__options", a(n) ? "reevit-method-selector__options--grid" : "reevit-method-selector__options--list"))))
2488
+ ]
2489
+ ), P(e, f), nn();
2490
+ }
2491
+ var Zs = /* @__PURE__ */ T('<img alt="" class="reevit-psp-option__logo-img" loading="lazy"/>'), Qs = /* @__PURE__ */ T('<span class="reevit-psp-option__logo-fallback"> </span>'), Xs = /* @__PURE__ */ T('<div class="reevit-psp-accordion__content reevit-animate-fade-in"><div class="reevit-psp-methods"><!></div> <!></div>'), $s = /* @__PURE__ */ T('<div class="reevit-psp-accordion"><button type="button"><span class="reevit-psp-option__logo" aria-hidden="true"><!></span> <div class="reevit-psp-option__content"><span class="reevit-psp-option__name"> </span> <span class="reevit-psp-option__methods"> </span></div></button> <!></div>'), ea = /* @__PURE__ */ T('<div class="reevit-psp-selector"><div class="reevit-psp-selector__label">Select payment provider</div> <div class="reevit-psp-selector__options"></div></div>');
2492
+ function ta(e, t) {
2493
+ tn(t, !1);
2494
+ let n = D(t, "providers", 24, () => []), r = D(t, "selectedProvider", 8, null), s = D(t, "disabled", 8, !1);
2495
+ D(t, "theme", 8, void 0);
2496
+ let i = D(t, "selectedMethod", 8, null);
2497
+ const l = Xt(), o = {
2498
+ paystack: "https://reevit.io/images/providers/paystack.png",
2499
+ stripe: "https://reevit.io/images/providers/stripe.png",
2500
+ flutterwave: "https://reevit.io/images/providers/flutterwave.png",
2501
+ hubtel: "https://reevit.io/images/providers/hubtel.png",
2502
+ monnify: "https://reevit.io/images/providers/monnify.png",
2503
+ mpesa: "https://reevit.io/images/providers/mpesa.png"
2504
+ }, c = {
2505
+ card: "Card",
2506
+ mobile_money: "Mobile Money",
2507
+ bank_transfer: "Bank Transfer"
2508
+ }, u = (_) => _.length ? _.map((h) => c[h]).join(", ") : "Payment methods", f = (_, h) => _.toLowerCase().includes("hubtel") ? h.filter((p) => p === "card" || p === "mobile_money") : h;
2509
+ function d(_) {
2510
+ l("select", _);
2511
+ }
2512
+ on();
2513
+ var v = ea(), m = q(g(v), 2);
2514
+ Wn(m, 5, n, (_) => _.provider, (_, h) => {
2515
+ const p = /* @__PURE__ */ Ct(() => (G(r()), a(h), w(() => r() === a(h).provider))), y = /* @__PURE__ */ Ct(() => (a(h), w(() => f(a(h).provider, a(h).methods))));
2516
+ var B = $s(), S = g(B), z = g(S), H = g(z);
2517
+ {
2518
+ var Z = (R) => {
2519
+ var K = Zs();
2520
+ X(() => Ln(K, "src", (a(h), w(() => o[a(h).provider])))), P(R, K);
2521
+ }, O = (R) => {
2522
+ var K = Qs(), b = g(K);
2523
+ X((de) => me(b, de), [
2524
+ () => (a(h), w(() => a(h).name.slice(0, 1).toUpperCase()))
2525
+ ]), P(R, K);
2526
+ };
2527
+ J(H, (R) => {
2528
+ a(h), w(() => o[a(h).provider]) ? R(Z) : R(O, !1);
2529
+ });
2530
+ }
2531
+ var V = q(z, 2), I = g(V), E = g(I), F = q(I, 2), M = g(F), k = q(S, 2);
2532
+ {
2533
+ var x = (R) => {
2534
+ var K = Xs(), b = g(K), de = g(b);
2535
+ Br(de, {
2536
+ get methods() {
2537
+ return a(y);
2538
+ },
2539
+ get selected() {
2540
+ return i();
2541
+ },
2542
+ get provider() {
2543
+ return a(h), w(() => a(h).provider);
2544
+ },
2545
+ layout: "list",
2546
+ showLabel: !1,
2547
+ $$events: { select: (ae) => l("methodSelect", ae.detail) }
2548
+ });
2549
+ var we = q(b, 2);
2550
+ Nn(we, t, "method-content", {}, null), P(R, K);
2551
+ };
2552
+ J(k, (R) => {
2553
+ a(p) && R(x);
2554
+ });
2555
+ }
2556
+ X(
2557
+ (R, K) => {
2558
+ et(S, 1, R), S.disabled = s(), Ln(S, "aria-expanded", a(p)), me(E, (a(h), w(() => a(h).name))), me(M, K);
2559
+ },
2560
+ [
2561
+ () => $e((G(ue), G(a(p)), G(s()), w(() => ue("reevit-psp-option", a(p) && "reevit-psp-option--selected", s() && "reevit-psp-option--disabled")))),
2562
+ () => (G(a(y)), w(() => u(a(y))))
2563
+ ]
2564
+ ), ce("click", S, () => d(a(h).provider)), P(_, B);
2565
+ }), P(e, v), nn();
2566
+ }
2567
+ var na = /* @__PURE__ */ T('<button type="button"><div class="reevit-network-dot"></div> </button>'), ra = /* @__PURE__ */ T('<p class="reevit-error-message"> </p>'), ia = /* @__PURE__ */ T('<button type="button" class="reevit-btn reevit-btn--secondary">Back</button>'), sa = /* @__PURE__ */ T('<span class="reevit-spinner"></span>'), aa = /* @__PURE__ */ T("<span>Continue</span>"), oa = /* @__PURE__ */ T('<form class="reevit-momo-form"><div class="reevit-form-group"><label class="reevit-label" for="reevit-phone">Phone Number</label> <input id="reevit-phone" type="tel" placeholder="e.g. 024 123 4567" autocomplete="tel"/></div> <div class="reevit-network-selector"><label class="reevit-label" for="reevit-network-grid">Select Network</label> <div id="reevit-network-grid" class="reevit-networks-grid"></div></div> <!> <div class="reevit-momo-form__actions"><!> <button type="submit" class="reevit-btn reevit-btn--primary"><!></button></div> <p class="reevit-secure-text">🔒 Secure mobile money payment via Reevit</p></form>');
2568
+ function or(e, t) {
2569
+ tn(t, !1);
2570
+ let n = D(t, "initialPhone", 8, ""), r = D(t, "loading", 8, !1), s = D(t, "hideCancel", 8, !1);
2571
+ const i = Xt();
2572
+ let l = /* @__PURE__ */ Q(n()), o = /* @__PURE__ */ Q(null), c = /* @__PURE__ */ Q(null);
2377
2573
  function u() {
2378
- if (!qt(f(i))) {
2379
- L(s, "Please enter a valid phone number");
2574
+ if (!wn(a(l))) {
2575
+ A(c, "Please enter a valid phone number");
2380
2576
  return;
2381
2577
  }
2382
- if (!f(l)) {
2383
- L(s, "Please select your mobile network");
2578
+ if (!a(o)) {
2579
+ A(c, "Please select your mobile network");
2384
2580
  return;
2385
2581
  }
2386
- a("submit", { phone: f(i), network: f(l) });
2582
+ i("submit", { phone: a(l), network: a(o) });
2387
2583
  }
2388
- const o = [
2584
+ const f = [
2389
2585
  { id: "mtn", name: "MTN", color: "#FFCC00" },
2390
2586
  { id: "vodafone", name: "Vodafone", color: "#E60000" },
2391
2587
  { id: "airteltigo", name: "AirtelTigo", color: "#005596" }
2392
2588
  ];
2393
- Re(() => (f(i), f(s)), () => {
2394
- const m = xr(f(i));
2395
- m && L(l, m), f(s) && L(s, null);
2396
- }), fn(), hn();
2397
- var c = la(), d = A(c), p = F(A(d), 2), h = F(d, 2), v = F(A(h), 2);
2398
- cr(v, 5, () => o, (m) => m.id, (m, R) => {
2399
- var x = ia(), U = A(x), ae = F(U);
2400
- oe(
2401
- (Ce) => {
2402
- Ct(x, 1, Ce), x.disabled = r(), dr(U, `background-color: ${f(R), P(() => f(R).color) ?? ""}`), Me(ae, ` ${f(R), P(() => f(R).name) ?? ""}`);
2589
+ ee(() => (a(l), a(c)), () => {
2590
+ const I = ci(a(l));
2591
+ I && A(o, I), a(c) && A(c, null);
2592
+ }), Bn(), on();
2593
+ var d = oa(), v = g(d), m = q(g(v), 2), _ = q(v, 2), h = q(g(_), 2);
2594
+ Wn(h, 5, () => f, (I) => I.id, (I, E) => {
2595
+ var F = na(), M = g(F), k = q(M);
2596
+ X(
2597
+ (x) => {
2598
+ et(F, 1, x), F.disabled = r(), Jn(M, `background-color: ${a(E), w(() => a(E).color) ?? ""}`), me(k, ` ${a(E), w(() => a(E).name) ?? ""}`);
2403
2599
  },
2404
2600
  [
2405
- () => kt((V(ge), f(l), f(R), P(() => ge("reevit-network-btn", f(l) === f(R).id && "reevit-network-btn--selected"))))
2601
+ () => $e((G(ue), a(o), a(E), w(() => ue("reevit-network-btn", a(o) === a(E).id && "reevit-network-btn--selected"))))
2406
2602
  ]
2407
- ), se("click", x, () => L(l, f(R).id)), T(m, x);
2603
+ ), ce("click", F, () => A(o, a(E).id)), P(I, F);
2408
2604
  });
2409
- var E = F(h, 2);
2605
+ var p = q(_, 2);
2606
+ {
2607
+ var y = (I) => {
2608
+ var E = ra(), F = g(E);
2609
+ X(() => me(F, a(c))), P(I, E);
2610
+ };
2611
+ J(p, (I) => {
2612
+ a(c) && I(y);
2613
+ });
2614
+ }
2615
+ var B = q(p, 2), S = g(B);
2410
2616
  {
2411
- var I = (m) => {
2412
- var R = aa(), x = A(R);
2413
- oe(() => Me(x, f(s))), T(m, R);
2617
+ var z = (I) => {
2618
+ var E = ia();
2619
+ X(() => E.disabled = r()), ce("click", E, () => i("cancel")), P(I, E);
2414
2620
  };
2415
- ee(E, (m) => {
2416
- f(s) && m(I);
2621
+ J(S, (I) => {
2622
+ s() || I(z);
2417
2623
  });
2418
2624
  }
2419
- var w = F(E, 2), _ = A(w);
2625
+ var H = q(S, 2), Z = g(H);
2420
2626
  {
2421
- var g = (m) => {
2422
- var R = sa();
2423
- T(m, R);
2424
- }, N = (m) => {
2425
- var R = oa();
2426
- T(m, R);
2627
+ var O = (I) => {
2628
+ var E = sa();
2629
+ P(I, E);
2630
+ }, V = (I) => {
2631
+ var E = aa();
2632
+ P(I, E);
2427
2633
  };
2428
- ee(_, (m) => {
2429
- r() ? m(g) : m(N, !1);
2634
+ J(Z, (I) => {
2635
+ r() ? I(O) : I(V, !1);
2430
2636
  });
2431
2637
  }
2432
- oe(
2433
- (m) => {
2434
- Ct(p, 1, m), p.disabled = r(), w.disabled = r() || !f(i);
2638
+ X(
2639
+ (I) => {
2640
+ et(m, 1, I), m.disabled = r(), H.disabled = r() || !a(l);
2435
2641
  },
2436
2642
  [
2437
- () => kt((V(ge), f(s), V(qt), f(i), P(() => ge("reevit-input", f(s) && !qt(f(i)) && "reevit-input--error"))))
2643
+ () => $e((G(ue), a(c), G(wn), a(l), w(() => ue("reevit-input", a(c) && !wn(a(l)) && "reevit-input--error"))))
2438
2644
  ]
2439
- ), Vi(p, () => f(i), (m) => L(i, m)), se("submit", c, Yi(u)), T(e, c), ln();
2645
+ ), Ts(m, () => a(l), (I) => A(l, I)), ce("submit", d, As(u)), P(e, d), nn();
2440
2646
  }
2441
- class ca {
2647
+ class la {
2442
2648
  constructor(t) {
2443
2649
  this.baseUrl = "https://unified-pay.hubtel.com", this.messageHandler = null, this.stylesInjected = !1, t && (this.baseUrl = t);
2444
2650
  }
@@ -2449,8 +2655,8 @@ class ca {
2449
2655
  * @throws {Error} If the popup is blocked by the browser.
2450
2656
  */
2451
2657
  redirect({ purchaseInfo: t, config: n }) {
2452
- const r = this.createCheckoutUrl(t, n), a = window.open(r);
2453
- if (!a || a.closed || typeof a.closed > "u")
2658
+ const r = this.createCheckoutUrl(t, n), s = window.open(r);
2659
+ if (!s || s.closed || typeof s.closed > "u")
2454
2660
  throw new Error("Popup was blocked by the browser. Please allow popups for this site.");
2455
2661
  }
2456
2662
  /**
@@ -2462,27 +2668,27 @@ class ca {
2462
2668
  * @param iframeStyle - The style options for the iframe (optional).
2463
2669
  * @throws {Error} If the container element with id "hubtel-checkout-iframe" is not found.
2464
2670
  */
2465
- initIframe({ purchaseInfo: t, callBacks: n, config: r, iframeStyle: a }) {
2466
- var i, l, s;
2671
+ initIframe({ purchaseInfo: t, callBacks: n, config: r, iframeStyle: s }) {
2672
+ var i, l, o;
2467
2673
  this.registerEvents(n);
2468
- const u = document.getElementById("hubtel-checkout-iframe");
2469
- if (!u)
2674
+ const c = document.getElementById("hubtel-checkout-iframe");
2675
+ if (!c)
2470
2676
  throw new Error('Container element with id "hubtel-checkout-iframe" not found in the DOM.');
2471
- u.innerHTML = "";
2472
- const o = document.createElement("div");
2473
- o.textContent = "Loading...", u.appendChild(o);
2474
- const c = document.createElement("iframe");
2475
- c.setAttribute("id", "hubtel-iframe-element"), c.src = this.createCheckoutUrl(t, r), c.style.display = "none", c.style.width = (i = a?.width) !== null && i !== void 0 ? i : "100%", c.style.height = (l = a?.height) !== null && l !== void 0 ? l : "100%", c.style.minHeight = a?.minHeight || "400px", c.style.border = (s = a?.border) !== null && s !== void 0 ? s : "none", c.onload = () => {
2677
+ c.innerHTML = "";
2678
+ const u = document.createElement("div");
2679
+ u.textContent = "Loading...", c.appendChild(u);
2680
+ const f = document.createElement("iframe");
2681
+ f.setAttribute("id", "hubtel-iframe-element"), f.src = this.createCheckoutUrl(t, r), f.style.display = "none", f.style.width = (i = s?.width) !== null && i !== void 0 ? i : "100%", f.style.height = (l = s?.height) !== null && l !== void 0 ? l : "100%", f.style.minHeight = s?.minHeight || "400px", f.style.border = (o = s?.border) !== null && o !== void 0 ? o : "none", f.onload = () => {
2476
2682
  var d;
2477
- u.removeChild(o), c.style.display = "block", (d = n.onLoad) === null || d === void 0 || d.call(n);
2478
- }, u.appendChild(c);
2683
+ c.removeChild(u), f.style.display = "block", (d = n.onLoad) === null || d === void 0 || d.call(n);
2684
+ }, c.appendChild(f);
2479
2685
  }
2480
2686
  openModal({ purchaseInfo: t, callBacks: n, config: r }) {
2481
2687
  this.injectStyles(), this.createIframe(), this.handleBackButton(), this.registerEvents(n), this.renderWebpageInPopup(this.createCheckoutUrl(t, r), n.onClose, n.onLoad);
2482
2688
  }
2483
2689
  createCheckoutUrl(t, n) {
2484
- const r = Object.assign(Object.assign({}, t), n), a = Object.keys(r).reduce((o, c) => (r[c] !== null && r[c] !== void 0 && (o[c] = r[c]), o), {}), i = Object.keys(a).map((o) => `${o}=${encodeURIComponent(a[o])}`).join("&"), l = this.encodeBase64(i), s = encodeURIComponent(l);
2485
- return `${a?.branding === "disabled" ? `${this.baseUrl}/pay/direct` : `${this.baseUrl}/pay`}?p=${s}`;
2690
+ const r = Object.assign(Object.assign({}, t), n), s = Object.keys(r).reduce((u, f) => (r[f] !== null && r[f] !== void 0 && (u[f] = r[f]), u), {}), i = Object.keys(s).map((u) => `${u}=${encodeURIComponent(s[u])}`).join("&"), l = this.encodeBase64(i), o = encodeURIComponent(l);
2691
+ return `${s?.branding === "disabled" ? `${this.baseUrl}/pay/direct` : `${this.baseUrl}/pay`}?p=${o}`;
2486
2692
  }
2487
2693
  encodeBase64(t) {
2488
2694
  return btoa(unescape(encodeURIComponent(t)));
@@ -2501,21 +2707,21 @@ class ca {
2501
2707
  registerEvents(t) {
2502
2708
  this.messageHandler && window.removeEventListener("message", this.messageHandler, !1);
2503
2709
  const n = (r) => {
2504
- var a, i, l, s, u, o;
2710
+ var s, i, l, o, c, u;
2505
2711
  if (r.origin !== this.baseUrl)
2506
2712
  return;
2507
- const { data: c } = r;
2508
- if (c.success === !0)
2509
- (a = t.onPaymentSuccess) === null || a === void 0 || a.call(t, c);
2510
- else if (c.success === !1)
2511
- (i = t.onPaymentFailure) === null || i === void 0 || i.call(t, c);
2512
- else if (c.initialized)
2513
- (l = t.init) === null || l === void 0 || l.call(t, c), (s = t.onInit) === null || s === void 0 || s.call(t, c);
2514
- else if (c.feesChanged)
2515
- (u = t.onFeesChanged) === null || u === void 0 || u.call(t, c.fees);
2516
- else if (c.resize) {
2713
+ const { data: f } = r;
2714
+ if (f.success === !0)
2715
+ (s = t.onPaymentSuccess) === null || s === void 0 || s.call(t, f);
2716
+ else if (f.success === !1)
2717
+ (i = t.onPaymentFailure) === null || i === void 0 || i.call(t, f);
2718
+ else if (f.initialized)
2719
+ (l = t.init) === null || l === void 0 || l.call(t, f), (o = t.onInit) === null || o === void 0 || o.call(t, f);
2720
+ else if (f.feesChanged)
2721
+ (c = t.onFeesChanged) === null || c === void 0 || c.call(t, f.fees);
2722
+ else if (f.resize) {
2517
2723
  const d = document.getElementById("hubtel-iframe-element");
2518
- d && (d.style.height = c.height + "px"), (o = t?.onResize) === null || o === void 0 || o.call(t, c);
2724
+ d && (d.style.height = f.height + "px"), (u = t?.onResize) === null || u === void 0 || u.call(t, f);
2519
2725
  }
2520
2726
  };
2521
2727
  this.messageHandler = n, window.addEventListener("message", n, !1);
@@ -2528,15 +2734,15 @@ class ca {
2528
2734
  this.messageHandler && (window.removeEventListener("message", this.messageHandler, !1), this.messageHandler = null);
2529
2735
  }
2530
2736
  renderWebpageInPopup(t, n, r) {
2531
- const a = document.createElement("div");
2532
- a.classList.add("checkout-modal");
2737
+ const s = document.createElement("div");
2738
+ s.classList.add("checkout-modal");
2533
2739
  const i = document.createElement("div");
2534
2740
  i.setAttribute("id", "checkout-close-icon"), i.innerHTML = "&times;", i.classList.add("close-icon"), i.addEventListener("click", () => {
2535
2741
  this.closePopUp(), n?.();
2536
- }), a.appendChild(i);
2742
+ }), s.appendChild(i);
2537
2743
  const l = document.createElement("iframe");
2538
- l.src = t, history.pushState({ modalOpen: !0 }, ""), l.classList.add("iframe"), a.appendChild(l), document.body.appendChild(a), a.style.opacity = "0", l.addEventListener("load", () => {
2539
- a.style.opacity = "1", r?.();
2744
+ l.src = t, history.pushState({ modalOpen: !0 }, ""), l.classList.add("iframe"), s.appendChild(l), document.body.appendChild(s), s.style.opacity = "0", l.addEventListener("load", () => {
2745
+ s.style.opacity = "1", r?.();
2540
2746
  });
2541
2747
  }
2542
2748
  closePopUp() {
@@ -2650,37 +2856,37 @@ class ca {
2650
2856
  `, document.head.appendChild(t), this.stylesInjected = !0;
2651
2857
  }
2652
2858
  }
2653
- const Mn = /* @__PURE__ */ new Map();
2654
- function Ot(e, t) {
2655
- const n = Mn.get(t);
2859
+ const lr = /* @__PURE__ */ new Map();
2860
+ function ln(e, t) {
2861
+ const n = lr.get(t);
2656
2862
  if (n) return n;
2657
- const r = new Promise((a, i) => {
2863
+ const r = new Promise((s, i) => {
2658
2864
  if (document.getElementById(t)) {
2659
- a();
2865
+ s();
2660
2866
  return;
2661
2867
  }
2662
2868
  const l = document.createElement("script");
2663
- l.id = t, l.src = e, l.async = !0, l.onload = () => a(), l.onerror = () => i(new Error(`Failed to load ${t} script`)), document.head.appendChild(l);
2869
+ l.id = t, l.src = e, l.async = !0, l.onload = () => s(), l.onerror = () => i(new Error(`Failed to load ${t} script`)), document.head.appendChild(l);
2664
2870
  });
2665
- return Mn.set(t, r), r;
2871
+ return lr.set(t, r), r;
2666
2872
  }
2667
- function fa() {
2668
- return Ot("https://js.paystack.co/v1/inline.js", "paystack-script");
2873
+ function ca() {
2874
+ return ln("https://js.paystack.co/v1/inline.js", "paystack-script");
2669
2875
  }
2670
- function Fa() {
2876
+ function ja() {
2671
2877
  return Promise.resolve();
2672
2878
  }
2673
- function da() {
2674
- return Ot("https://checkout.flutterwave.com/v3.js", "flutterwave-script");
2879
+ function ua() {
2880
+ return ln("https://checkout.flutterwave.com/v3.js", "flutterwave-script");
2675
2881
  }
2676
- function va() {
2677
- return Ot("https://js.stripe.com/v3/", "stripe-script");
2882
+ function fa() {
2883
+ return ln("https://js.stripe.com/v3/", "stripe-script");
2678
2884
  }
2679
- function pa() {
2680
- return Ot("https://sdk.monnify.com/plugin/monnify.js", "monnify-script");
2885
+ function da() {
2886
+ return ln("https://sdk.monnify.com/plugin/monnify.js", "monnify-script");
2681
2887
  }
2682
- async function ha(e) {
2683
- if (await fa(), !window.PaystackPop)
2888
+ async function va(e) {
2889
+ if (await ca(), !window.PaystackPop)
2684
2890
  throw new Error("Paystack script not loaded");
2685
2891
  window.PaystackPop.setup({
2686
2892
  key: e.key,
@@ -2693,24 +2899,26 @@ async function ha(e) {
2693
2899
  onClose: e.onClose
2694
2900
  }).openIframe();
2695
2901
  }
2696
- async function ma(e) {
2697
- const t = new ca(), n = {
2902
+ async function pa(e) {
2903
+ const t = new la(), n = e.preferredMethod === "mobile_money" ? "momo" : e.preferredMethod === "card" ? "card" : void 0, r = {
2698
2904
  amount: e.amount,
2699
2905
  purchaseDescription: e.purchaseDescription,
2700
2906
  customerPhoneNumber: e.customerPhone || "",
2701
- clientReference: `hubtel_${Date.now()}`
2702
- }, r = {
2907
+ clientReference: `hubtel_${Date.now()}`,
2908
+ ...n ? { paymentMethod: n } : {}
2909
+ }, s = e.hubtelSessionToken || e.basicAuth || "", i = {
2703
2910
  branding: "enabled",
2704
2911
  callbackUrl: e.callbackUrl || (typeof window < "u" ? window.location.href : ""),
2705
2912
  merchantAccount: typeof e.clientId == "string" ? parseInt(e.clientId, 10) : e.clientId,
2706
- basicAuth: e.basicAuth || ""
2913
+ basicAuth: s,
2914
+ ...n ? { paymentMethod: n } : {}
2707
2915
  };
2708
2916
  t.openModal({
2709
- purchaseInfo: n,
2710
- config: r,
2917
+ purchaseInfo: r,
2918
+ config: i,
2711
2919
  callBacks: {
2712
- onPaymentSuccess: (a) => {
2713
- e.onSuccess(a), t.closePopUp();
2920
+ onPaymentSuccess: (l) => {
2921
+ e.onSuccess(l), t.closePopUp();
2714
2922
  },
2715
2923
  onPaymentFailure: () => {
2716
2924
  e.onClose();
@@ -2721,8 +2929,8 @@ async function ma(e) {
2721
2929
  }
2722
2930
  });
2723
2931
  }
2724
- async function _a(e) {
2725
- if (await da(), !window.FlutterwaveCheckout)
2932
+ async function ha(e) {
2933
+ if (await ua(), !window.FlutterwaveCheckout)
2726
2934
  throw new Error("Flutterwave script not loaded");
2727
2935
  window.FlutterwaveCheckout({
2728
2936
  public_key: e.public_key,
@@ -2736,13 +2944,13 @@ async function _a(e) {
2736
2944
  onclose: e.onclose
2737
2945
  });
2738
2946
  }
2739
- async function ya(e) {
2740
- if (await va(), !window.Stripe)
2947
+ async function ma(e) {
2948
+ if (await fa(), !window.Stripe)
2741
2949
  throw new Error("Stripe.js not loaded");
2742
2950
  return window.Stripe(e);
2743
2951
  }
2744
- async function La(e) {
2745
- const n = await (await ya(e.publishableKey)).confirmPayment({
2952
+ async function za(e) {
2953
+ const n = await (await ma(e.publishableKey)).confirmPayment({
2746
2954
  elements: e.elements,
2747
2955
  clientSecret: e.clientSecret,
2748
2956
  redirect: "if_required"
@@ -2752,8 +2960,8 @@ async function La(e) {
2752
2960
  status: n.paymentIntent.status
2753
2961
  });
2754
2962
  }
2755
- async function ba(e) {
2756
- if (await pa(), !window.MonnifySDK)
2963
+ async function _a(e) {
2964
+ if (await da(), !window.MonnifySDK)
2757
2965
  throw new Error("Monnify SDK not loaded");
2758
2966
  window.MonnifySDK.initialize({
2759
2967
  amount: e.amount,
@@ -2777,7 +2985,7 @@ async function ba(e) {
2777
2985
  onClose: e.onClose
2778
2986
  });
2779
2987
  }
2780
- async function wa(e, t) {
2988
+ async function ya(e, t) {
2781
2989
  e.onInitiated();
2782
2990
  try {
2783
2991
  const n = await fetch(t, {
@@ -2805,324 +3013,542 @@ async function wa(e, t) {
2805
3013
  return e.onError({ message: r }), { status: "failed", message: r };
2806
3014
  }
2807
3015
  }
2808
- var ga = /* @__PURE__ */ O('<span class="reevit-spinner"></span>'), Ea = /* @__PURE__ */ O('<button type="button" class="reevit-pay-button"><!></button>'), Pa = /* @__PURE__ */ O('<div class="reevit-loading-state"><div class="reevit-spinner reevit-spinner--large"></div> <p>Initializing payment...</p></div>'), Sa = /* @__PURE__ */ O('<div class="reevit-error-state"><div class="reevit-error-icon">⚠️</div> <h3>Payment Failed</h3> <p> </p> <button class="reevit-retry-btn">Retry</button></div>'), Ia = /* @__PURE__ */ O('<div class="reevit-success-state"><div class="reevit-success-icon">✅</div> <h3>Payment Successful</h3> <p>Thank you for your payment.</p> <button class="reevit-done-btn">Done</button></div>'), ka = /* @__PURE__ */ O('<div class="reevit-method-form-container"><!></div>'), Ca = /* @__PURE__ */ O('<span class="reevit-spinner"></span>'), Ra = /* @__PURE__ */ O("<span>Proceed to Card Payment</span>"), xa = /* @__PURE__ */ O('<div class="reevit-card-info"><p class="reevit-info-text">You will be redirected to our secure payment partner to complete your card payment.</p> <button class="reevit-submit-btn"><!></button></div>'), Ma = /* @__PURE__ */ O("<!> <!> <!>", 1), Ta = /* @__PURE__ */ O('<div class="reevit-modal-overlay" role="button" tabindex="0"><div><button class="reevit-modal-close" aria-label="Close">&times;</button> <div class="reevit-modal-header"><img src="https://i.imgur.com/bzUR5Lm.png" alt="Reevit" class="reevit-modal__logo"/></div> <div class="reevit-modal-body"><!></div> <div class="reevit-modal-footer"><div class="reevit-trust-badges"><span>PCI DSS Compliant</span> <span>•</span> <span>SSL Secure</span></div></div></div></div>'), Aa = /* @__PURE__ */ O('<div class="reevit-sdk-container"><!> <!></div>');
2809
- function Ua(e, t) {
2810
- on(t, !1);
2811
- const n = () => Gi(m, "$store", r), [r, a] = Zi(), i = /* @__PURE__ */ ve(), l = /* @__PURE__ */ ve(), s = /* @__PURE__ */ ve(), u = tn();
2812
- let o = D(t, "publicKey", 8), c = D(t, "amount", 8), d = D(t, "currency", 8), p = D(t, "email", 8, void 0), h = D(t, "phone", 8, void 0), v = D(t, "reference", 8, void 0), E = D(t, "metadata", 8, void 0), I = D(t, "paymentMethods", 24, () => ["card", "mobile_money"]), w = D(t, "theme", 24, () => ({})), _ = D(t, "isOpen", 12, !1), g = D(t, "apiBaseUrl", 8, void 0), N = D(t, "initialPaymentIntent", 8, void 0);
2813
- const m = $i({
3016
+ var ba = /* @__PURE__ */ T('<span class="reevit-spinner"></span>'), ga = /* @__PURE__ */ T('<button type="button" class="reevit-pay-button"><!></button>'), wa = /* @__PURE__ */ T('<div class="reevit-loading-state"><div class="reevit-spinner reevit-spinner--large"></div> <p>Initializing payment...</p></div>'), Ea = /* @__PURE__ */ T('<div class="reevit-error-state"><div class="reevit-error-icon">⚠️</div> <h3>Payment Failed</h3> <p> </p> <button class="reevit-retry-btn">Retry</button></div>'), Pa = /* @__PURE__ */ T('<div class="reevit-success-state"><div class="reevit-success-icon">✅</div> <h3>Payment Successful</h3> <p>Thank you for your payment.</p> <button class="reevit-done-btn">Done</button></div>'), Sa = /* @__PURE__ */ T(`<div class="reevit-inline-action"><p class="reevit-inline-action__hint">You'll be redirected to complete your card payment securely.</p> <button class="reevit-btn reevit-btn--primary">Pay with Card</button></div>`), ka = /* @__PURE__ */ T('<p class="reevit-inline-action__hint"> </p> <button class="reevit-btn reevit-btn--primary"> </button>', 1), Ia = /* @__PURE__ */ T('<div class="reevit-inline-action"><!></div>'), Ma = /* @__PURE__ */ T('<div slot="method-content" class="reevit-animate-fade-in"><!></div>'), Ca = /* @__PURE__ */ T('<span class="reevit-spinner"></span>'), xa = /* @__PURE__ */ T("<span> </span>"), Ra = /* @__PURE__ */ T('<div class="reevit-card-info reevit-animate-fade-in"><p class="reevit-info-text"> </p> <button class="reevit-submit-btn"><!></button></div>'), Ta = /* @__PURE__ */ T('<div class="reevit-method-step__actions reevit-animate-slide-up"><!></div>'), Aa = /* @__PURE__ */ T("<!> <!>", 1), Na = /* @__PURE__ */ T('<div class="reevit-method-step reevit-animate-slide-up"><!></div>'), La = /* @__PURE__ */ T('<div class="reevit-modal-overlay" role="button" tabindex="0"><div><button class="reevit-modal-close" aria-label="Close">&times;</button> <div class="reevit-modal-header"><img alt="Checkout" class="reevit-modal__logo"/></div> <div class="reevit-modal-body"><!></div> <div class="reevit-modal-footer"><div class="reevit-trust-badges"><span>PCI DSS Compliant</span> <span>•</span> <span>SSL Secure</span></div></div></div></div>'), Oa = /* @__PURE__ */ T('<div class="reevit-sdk-container"><!> <!></div>');
3017
+ function Ha(e, t) {
3018
+ tn(t, !1);
3019
+ const n = () => Ls(b, "$store", r), [r, s] = Os(), i = /* @__PURE__ */ Q(), l = /* @__PURE__ */ Q(), o = /* @__PURE__ */ Q(), c = /* @__PURE__ */ Q(), u = /* @__PURE__ */ Q(), f = Xt();
3020
+ let d = D(t, "publicKey", 8, void 0), v = D(t, "amount", 8), m = D(t, "currency", 8), _ = D(t, "email", 8, void 0), h = D(t, "phone", 8, void 0), p = D(t, "customerName", 8, void 0), y = D(t, "reference", 8, void 0), B = D(t, "metadata", 8, void 0), S = D(t, "customFields", 8, void 0), z = D(t, "paymentLinkCode", 8, void 0), H = D(t, "paymentMethods", 24, () => ["card", "mobile_money"]), Z = D(t, "theme", 24, () => ({})), O = D(t, "isOpen", 12, !1), V = D(t, "apiBaseUrl", 8, void 0), I = D(t, "initialPaymentIntent", 8, void 0), E = /* @__PURE__ */ Q({}), F = /* @__PURE__ */ Q(null), M = /* @__PURE__ */ Q("paystack"), k = /* @__PURE__ */ Q(["card", "mobile_money"]), x = /* @__PURE__ */ Q([]), R = /* @__PURE__ */ Q(a(k));
3021
+ const K = {
3022
+ hubtel: "Hubtel",
3023
+ paystack: "Paystack",
3024
+ flutterwave: "Flutterwave",
3025
+ monnify: "Monnify",
3026
+ mpesa: "M-Pesa",
3027
+ stripe: "Stripe"
3028
+ }, b = qs({
2814
3029
  config: {
2815
- publicKey: o(),
2816
- amount: c(),
2817
- currency: d(),
2818
- email: p(),
3030
+ publicKey: d(),
3031
+ amount: v(),
3032
+ currency: m(),
3033
+ email: _(),
2819
3034
  phone: h(),
2820
- reference: v(),
2821
- metadata: E(),
2822
- paymentMethods: I(),
2823
- initialPaymentIntent: N()
3035
+ customerName: p(),
3036
+ reference: y(),
3037
+ metadata: B(),
3038
+ customFields: S(),
3039
+ paymentLinkCode: z(),
3040
+ paymentMethods: H(),
3041
+ initialPaymentIntent: I()
2824
3042
  },
2825
- apiBaseUrl: g(),
2826
- onSuccess: (b) => u("success", b),
2827
- onError: (b) => u("error", b),
3043
+ apiBaseUrl: V(),
3044
+ onSuccess: (C) => f("success", C),
3045
+ onError: (C) => f("error", C),
2828
3046
  onClose: () => {
2829
- _(!1), u("close");
3047
+ O(!1), f("close");
2830
3048
  }
2831
3049
  });
2832
- function R() {
2833
- _(!0);
3050
+ function de() {
3051
+ O(!0), A(F, null);
2834
3052
  }
2835
- function x() {
2836
- _(!1), m.close();
3053
+ function we() {
3054
+ O(!1), A(F, null), b.close();
2837
3055
  }
2838
- async function U(b) {
2839
- if (!f(i).paymentIntent) return;
2840
- const y = f(i).paymentIntent.recommendedPsp;
3056
+ async function ae(C) {
3057
+ if (!a(i).paymentIntent) return;
3058
+ const W = a(M);
2841
3059
  try {
2842
- if (y === "paystack")
2843
- await ha({
2844
- key: o(),
2845
- email: p() || "",
2846
- amount: c(),
2847
- currency: d(),
2848
- ref: f(i).paymentIntent.id,
2849
- onSuccess: (k) => m.handlePspSuccess(k),
2850
- onClose: () => {
2851
- }
2852
- });
2853
- else if (y === "hubtel")
2854
- await ma({
2855
- clientId: f(i).paymentIntent.pspCredentials?.merchantAccount || o(),
2856
- purchaseDescription: `Payment for ${c()} ${d()}`,
2857
- amount: c(),
2858
- customerPhone: b?.phone || h(),
2859
- customerEmail: p(),
2860
- basicAuth: f(i).paymentIntent.pspCredentials?.basicAuth,
2861
- onSuccess: (k) => m.handlePspSuccess(k),
2862
- onClose: () => {
2863
- }
2864
- });
2865
- else if (y === "flutterwave")
2866
- await _a({
2867
- public_key: o(),
2868
- tx_ref: f(i).paymentIntent.id,
2869
- amount: c(),
2870
- currency: d(),
2871
- customer: { email: p() || "", phone_number: b?.phone || h() },
2872
- callback: (k) => m.handlePspSuccess(k),
2873
- onclose: () => {
3060
+ switch (W) {
3061
+ case "paystack": {
3062
+ await va({
3063
+ key: a(i).paymentIntent.pspPublicKey ?? d() ?? "",
3064
+ email: _() ?? "",
3065
+ amount: v(),
3066
+ currency: m(),
3067
+ ref: a(i).paymentIntent.id,
3068
+ onSuccess: (Y) => b.handlePspSuccess(Y),
3069
+ onClose: () => {
3070
+ }
3071
+ });
3072
+ break;
3073
+ }
3074
+ case "hubtel": {
3075
+ const Y = a(i).paymentIntent.pspCredentials?.merchantAccount, oe = fi({ publicKey: d(), baseUrl: V() }), { data: U, error: ie } = await oe.createHubtelSession(a(i).paymentIntent.id, a(i).paymentIntent.clientSecret);
3076
+ if (ie || !U?.basicAuth) {
3077
+ f("error", {
3078
+ code: ie?.code || "hubtel_session_error",
3079
+ message: ie?.message || "Failed to create Hubtel session"
3080
+ });
3081
+ return;
2874
3082
  }
2875
- });
2876
- else if (y === "monnify")
2877
- await ba({
2878
- apiKey: f(i).paymentIntent.pspPublicKey || o(),
2879
- contractCode: E()?.contract_code || o(),
2880
- amount: c(),
2881
- currency: d(),
2882
- reference: f(i).paymentIntent.reference || f(i).paymentIntent.id,
2883
- customerName: E()?.customer_name || p() || "",
2884
- customerEmail: p() || "",
2885
- customerPhone: b?.phone || h(),
2886
- metadata: E(),
2887
- onSuccess: (k) => m.handlePspSuccess(k),
2888
- onClose: () => {
3083
+ const pe = a(i).selectedMethod === "card" || a(i).selectedMethod === "mobile_money" ? a(i).selectedMethod : void 0;
3084
+ await pa({
3085
+ clientId: U.merchantAccount || (typeof Y == "string" ? Y : d() ?? ""),
3086
+ purchaseDescription: `Payment for ${v()} ${m()}`,
3087
+ amount: v(),
3088
+ customerPhone: C?.phone ?? h() ?? "",
3089
+ customerEmail: _() ?? "",
3090
+ basicAuth: U.basicAuth,
3091
+ preferredMethod: pe,
3092
+ onSuccess: (yt) => b.handlePspSuccess(yt),
3093
+ onClose: () => {
3094
+ }
3095
+ });
3096
+ break;
3097
+ }
3098
+ case "flutterwave": {
3099
+ await ha({
3100
+ public_key: a(i).paymentIntent.pspPublicKey ?? d() ?? "",
3101
+ tx_ref: a(i).paymentIntent.id,
3102
+ amount: v(),
3103
+ currency: m(),
3104
+ customer: {
3105
+ email: _() ?? "",
3106
+ phone_number: C?.phone ?? h() ?? ""
3107
+ },
3108
+ callback: (Y) => b.handlePspSuccess(Y),
3109
+ onclose: () => {
3110
+ }
3111
+ });
3112
+ break;
3113
+ }
3114
+ case "monnify": {
3115
+ const Y = B()?.contract_code, oe = a(i).paymentIntent.pspPublicKey ?? d() ?? "", U = typeof Y == "string" ? Y : d() ?? "";
3116
+ if (!oe || !U) {
3117
+ b.handlePspError({
3118
+ code: "MONNIFY_CONFIG_MISSING",
3119
+ message: "Monnify configuration is missing. Please check your API key and contract code."
3120
+ });
3121
+ return;
2889
3122
  }
2890
- });
2891
- else if (y === "mpesa") {
2892
- const k = `${g() || "https://api.reevit.io"}/v1/payments/${f(i).paymentIntent.id}/mpesa`;
2893
- await wa(
2894
- {
2895
- phoneNumber: b?.phone || h() || "",
2896
- amount: c(),
2897
- reference: f(i).paymentIntent.reference || f(i).paymentIntent.id,
2898
- description: `Payment ${f(i).paymentIntent.reference || ""}`,
2899
- onInitiated: () => {
3123
+ await _a({
3124
+ apiKey: oe,
3125
+ contractCode: U,
3126
+ amount: v(),
3127
+ currency: m(),
3128
+ reference: a(i).paymentIntent.reference ?? a(i).paymentIntent.id,
3129
+ customerName: B()?.customer_name ?? _() ?? "",
3130
+ customerEmail: _() ?? "",
3131
+ customerPhone: C?.phone ?? h() ?? "",
3132
+ metadata: B(),
3133
+ onSuccess: (ie) => b.handlePspSuccess(ie),
3134
+ onClose: () => {
3135
+ }
3136
+ });
3137
+ break;
3138
+ }
3139
+ case "mpesa": {
3140
+ const oe = `${V() ?? "https://api.reevit.io"}/v1/payments/${a(i).paymentIntent.id}/mpesa`;
3141
+ await ya(
3142
+ {
3143
+ phoneNumber: C?.phone ?? h() ?? "",
3144
+ amount: v(),
3145
+ reference: a(i).paymentIntent.reference ?? a(i).paymentIntent.id,
3146
+ description: `Payment ${a(i).paymentIntent.reference ?? ""}`,
3147
+ onInitiated: () => {
3148
+ },
3149
+ onSuccess: (U) => b.handlePspSuccess(U),
3150
+ onError: (U) => b.handlePspError({ code: "MPESA_ERROR", message: U.message })
2900
3151
  },
2901
- onSuccess: (Y) => m.handlePspSuccess(Y),
2902
- onError: (Y) => m.handlePspError({ code: "MPESA_ERROR", message: Y.message })
2903
- },
2904
- k
2905
- );
2906
- } else y === "stripe" ? m.handlePspError({
2907
- code: "STRIPE_NOT_IMPLEMENTED",
2908
- message: "Stripe integration requires custom Elements setup. Please use the React SDK or implement custom Stripe Elements."
2909
- }) : m.handlePspError({
2910
- code: "UNSUPPORTED_PSP",
2911
- message: `Payment provider "${y}" is not supported in this checkout.`
2912
- });
2913
- } catch (k) {
2914
- m.handlePspError({
3152
+ oe
3153
+ );
3154
+ break;
3155
+ }
3156
+ case "stripe": {
3157
+ b.handlePspError({
3158
+ code: "STRIPE_NOT_IMPLEMENTED",
3159
+ message: "Stripe integration requires custom Elements setup. Please use the React SDK or implement custom Stripe Elements."
3160
+ });
3161
+ break;
3162
+ }
3163
+ default:
3164
+ b.handlePspError({
3165
+ code: "UNSUPPORTED_PSP",
3166
+ message: `Payment provider "${W}" is not supported in this checkout.`
3167
+ });
3168
+ }
3169
+ } catch (Y) {
3170
+ b.handlePspError({
2915
3171
  code: "BRIDGE_ERROR",
2916
- message: k instanceof Error ? k.message : "Failed to open payment gateway"
3172
+ message: Y instanceof Error ? Y.message : "Failed to open payment gateway"
2917
3173
  });
2918
3174
  }
2919
3175
  }
2920
- Er(() => {
2921
- _() && m.initialize();
2922
- }), Pr(() => {
3176
+ function cn(C) {
3177
+ if (C === a(F)) {
3178
+ A(F, null), b.reset();
3179
+ return;
3180
+ }
3181
+ const W = a(x).find((U) => U.provider === C), Y = W?.methods?.length ? W.methods : a(k), oe = a(i).selectedMethod && Y.includes(a(i).selectedMethod) ? a(i).selectedMethod : Y[0];
3182
+ A(F, C), b.reset(), b.initialize(oe, { preferredProvider: C, allowedProviders: [C] });
3183
+ }
3184
+ ni(() => {
3185
+ O() && b.initialize();
3186
+ }), ri(() => {
2923
3187
  typeof document < "u" && (document.body.style.overflow = "");
2924
- }), Re(() => n(), () => {
2925
- L(i, n());
2926
- }), Re(() => V(w()), () => {
2927
- L(l, Mr(w()));
2928
- }), Re(() => f(i), () => {
2929
- L(s, f(i).paymentIntent?.recommendedPsp || "paystack");
2930
- }), Re(() => (V(_()), f(i)), () => {
2931
- _() && f(i).paymentIntent && f(i).selectedMethod && f(i).selectedMethod === "card" && U(null);
2932
- }), Re(() => (V(_()), f(i)), () => {
2933
- _() ? (document.body.style.overflow = "hidden", !f(i).paymentIntent && f(i).status === "idle" && m.initialize()) : typeof document < "u" && (document.body.style.overflow = "");
2934
- }), fn(), hn();
2935
- var ae = Aa(), Ce = A(ae);
2936
- Rn(
2937
- Ce,
3188
+ }), ee(() => n(), () => {
3189
+ A(i, n());
3190
+ }), ee(() => (a(i), G(Z())), () => {
3191
+ A(E, {
3192
+ ...a(i).paymentIntent?.branding || {},
3193
+ ...Z() || {}
3194
+ });
3195
+ }), ee(() => a(E), () => {
3196
+ A(l, ui(a(E)));
3197
+ }), ee(() => G(H()), () => {
3198
+ A(k, H()?.length ? H() : ["card", "mobile_money"]);
3199
+ }), ee(() => (a(i), a(k)), () => {
3200
+ A(x, (() => {
3201
+ const C = a(i).paymentIntent;
3202
+ if (!C) return [];
3203
+ const W = new Set(a(k)), Y = (C.availableProviders || []).map((U) => {
3204
+ const ie = U.provider.toLowerCase().includes("hubtel") ? U.methods.filter((pe) => pe === "card" || pe === "mobile_money") : U.methods;
3205
+ return {
3206
+ ...U,
3207
+ methods: ie.filter((pe) => W.has(pe))
3208
+ };
3209
+ }).filter((U) => U.methods.length > 0);
3210
+ if (Y.length > 0) return Y;
3211
+ const oe = C.recommendedPsp.toLowerCase().includes("hubtel") ? a(k).filter((U) => U === "card" || U === "mobile_money") : a(k);
3212
+ return [
3213
+ {
3214
+ provider: C.recommendedPsp,
3215
+ name: K[C.recommendedPsp] || C.recommendedPsp,
3216
+ methods: oe
3217
+ }
3218
+ ];
3219
+ })());
3220
+ }), ee(() => (a(x), a(F)), () => {
3221
+ a(x).length > 0 && (a(F) && a(x).some((C) => C.provider === a(F)) || (a(x).length === 1 ? A(F, a(x)[0].provider) : A(F, null)));
3222
+ }), ee(() => (a(F), a(i)), () => {
3223
+ A(M, a(F) || a(i).paymentIntent?.recommendedPsp || "paystack");
3224
+ }), ee(
3225
+ () => (a(x), a(M), a(k)),
3226
+ () => {
3227
+ A(R, (() => {
3228
+ const C = a(x).find((W) => W.provider === a(M));
3229
+ return C?.methods.length ? C.methods : a(k);
3230
+ })());
3231
+ }
3232
+ ), ee(() => (a(i), a(R)), () => {
3233
+ a(i).selectedMethod && a(R).length > 0 && !a(R).includes(a(i).selectedMethod) && b.selectMethod(a(R)[0]);
3234
+ }), ee(() => {
3235
+ }, () => {
3236
+ A(o, b.isLoading());
3237
+ }), ee(() => {
3238
+ }, () => {
3239
+ A(c, b.getStatus() === "processing");
3240
+ }), ee(() => {
3241
+ }, () => {
3242
+ A(u, b.getStatus() === "method_selected");
3243
+ }), ee(
3244
+ () => (G(O()), a(i), a(F), G(h())),
3245
+ () => {
3246
+ if (O() && a(i).paymentIntent && a(i).selectedMethod) {
3247
+ const W = (a(F) || a(i).paymentIntent.recommendedPsp || "paystack").toLowerCase().includes("mpesa");
3248
+ (a(i).selectedMethod === "card" || a(i).selectedMethod === "mobile_money" && (!W || h())) && ae(null);
3249
+ }
3250
+ }
3251
+ ), ee(() => (G(O()), a(i)), () => {
3252
+ O() ? (document.body.style.overflow = "hidden", !a(i).paymentIntent && a(i).status === "idle" && b.initialize()) : typeof document < "u" && (document.body.style.overflow = "");
3253
+ }), Bn(), on();
3254
+ var ve = Oa(), _t = g(ve);
3255
+ Nn(
3256
+ _t,
2938
3257
  t,
2939
3258
  "default",
2940
3259
  {
2941
- handleOpen: R,
3260
+ handleOpen: de,
2942
3261
  get isLoading() {
2943
- return f(i), P(() => f(i).status === "loading");
3262
+ return a(o);
2944
3263
  }
2945
3264
  },
2946
- (b) => {
2947
- var y = Ea(), k = A(y);
3265
+ (C) => {
3266
+ var W = ga(), Y = g(W);
2948
3267
  {
2949
- var Y = (Q) => {
2950
- var ye = ga();
2951
- T(Q, ye);
2952
- }, W = (Q) => {
2953
- var ye = pt(), Le = Xe(ye);
2954
- Rn(Le, t, "button-text", {}, (X) => {
2955
- var Ue = Fi("Pay Now");
2956
- T(X, Ue);
2957
- }), T(Q, ye);
3268
+ var oe = (ie) => {
3269
+ var pe = ba();
3270
+ P(ie, pe);
3271
+ }, U = (ie) => {
3272
+ var pe = ut(), yt = Ke(pe);
3273
+ Nn(yt, t, "button-text", {}, (un) => {
3274
+ var fn = bs("Pay Now");
3275
+ P(un, fn);
3276
+ }), P(ie, pe);
2958
3277
  };
2959
- ee(k, (Q) => {
2960
- f(i), P(() => f(i).status === "loading") ? Q(Y) : Q(W, !1);
3278
+ J(Y, (ie) => {
3279
+ a(o) ? ie(oe) : ie(U, !1);
2961
3280
  });
2962
3281
  }
2963
- oe(() => y.disabled = (f(i), P(() => f(i).status === "loading"))), se("click", y, R), T(b, y);
3282
+ X(() => W.disabled = a(o)), ce("click", W, de), P(C, W);
2964
3283
  }
2965
3284
  );
2966
- var ct = F(Ce, 2);
3285
+ var Vr = q(_t, 2);
2967
3286
  {
2968
- var ft = (b) => {
2969
- var y = Ta(), k = A(y), Y = A(k), W = F(Y, 4), Q = A(W);
3287
+ var Yr = (C) => {
3288
+ var W = La(), Y = g(W), oe = g(Y), U = q(oe, 2), ie = g(U), pe = q(U, 2), yt = g(pe);
2970
3289
  {
2971
- var ye = (X) => {
2972
- var Ue = Pa();
2973
- T(X, Ue);
2974
- }, Le = (X) => {
2975
- var Ue = pt(), pr = Xe(Ue);
3290
+ var un = (ke) => {
3291
+ var Ft = wa();
3292
+ P(ke, Ft);
3293
+ }, fn = (ke) => {
3294
+ var Ft = ut(), Gr = Ke(Ft);
2976
3295
  {
2977
- var hr = (je) => {
2978
- var Ge = Sa(), dt = F(A(Ge), 4), Dt = A(dt), Ft = F(dt, 2);
2979
- oe(() => Me(Dt, (f(i), P(() => f(i).error.message)))), se("click", Ft, () => m.initialize()), T(je, Ge);
2980
- }, mr = (je) => {
2981
- var Ge = pt(), dt = Xe(Ge);
3296
+ var Wr = (it) => {
3297
+ var bt = Ea(), Dt = q(g(bt), 4), dn = g(Dt), vn = q(Dt, 2);
3298
+ X(() => me(dn, (a(i), w(() => a(i).error.message)))), ce("click", vn, () => b.initialize()), P(it, bt);
3299
+ }, Jr = (it) => {
3300
+ var bt = ut(), Dt = Ke(bt);
2982
3301
  {
2983
- var Dt = (ze) => {
2984
- var Ze = Ia(), Lt = F(A(Ze), 6);
2985
- se("click", Lt, x), T(ze, Ze);
2986
- }, Ft = (ze) => {
2987
- var Ze = pt(), Lt = Xe(Ze);
3302
+ var dn = (st) => {
3303
+ var gt = Pa(), pn = q(g(gt), 6);
3304
+ ce("click", pn, we), P(st, gt);
3305
+ }, vn = (st) => {
3306
+ var gt = ut(), pn = Ke(gt);
2988
3307
  {
2989
- var _r = (Ut) => {
2990
- var mn = Ma(), _n = Xe(mn);
2991
- ra(_n, {
2992
- get methods() {
2993
- return I();
2994
- },
2995
- get selected() {
2996
- return f(i), P(() => f(i).selectedMethod);
2997
- },
2998
- get amount() {
2999
- return c();
3000
- },
3001
- get currency() {
3002
- return d();
3003
- },
3004
- get provider() {
3005
- return f(s);
3006
- },
3007
- $$events: { select: (ce) => m.selectMethod(ce.detail) }
3008
- });
3009
- var yn = F(_n, 2);
3010
- {
3011
- var yr = (ce) => {
3012
- var Je = ka(), Qe = A(Je);
3013
- {
3014
- let jt = /* @__PURE__ */ At(() => (f(i), P(() => f(i).status === "processing")));
3015
- ua(Qe, {
3016
- get initialPhone() {
3017
- return h();
3018
- },
3019
- get loading() {
3020
- return f(jt);
3021
- },
3022
- $$events: { submit: (zt) => U(zt.detail) }
3023
- });
3024
- }
3025
- T(ce, Je);
3026
- };
3027
- ee(yn, (ce) => {
3028
- f(i), P(() => f(i).status === "method_selected" && f(i).selectedMethod === "mobile_money") && ce(yr);
3029
- });
3030
- }
3031
- var br = F(yn, 2);
3308
+ var Zr = (hn) => {
3309
+ var Zn = Na(), Qr = g(Zn);
3032
3310
  {
3033
- var wr = (ce) => {
3034
- var Je = xa(), Qe = F(A(Je), 2), jt = A(Qe);
3311
+ var Xr = (at) => {
3312
+ ta(at, {
3313
+ get providers() {
3314
+ return a(x);
3315
+ },
3316
+ get selectedProvider() {
3317
+ return a(F);
3318
+ },
3319
+ get disabled() {
3320
+ return a(o);
3321
+ },
3322
+ get theme() {
3323
+ return a(E);
3324
+ },
3325
+ get selectedMethod() {
3326
+ return a(i), w(() => a(i).selectedMethod);
3327
+ },
3328
+ $$events: {
3329
+ select: (Oe) => cn(Oe.detail),
3330
+ methodSelect: (Oe) => b.selectMethod(Oe.detail)
3331
+ },
3332
+ $$slots: {
3333
+ "method-content": (Oe, mn) => {
3334
+ var Ut = Ma(), _n = g(Ut);
3335
+ {
3336
+ var Ge = (Fe) => {
3337
+ var We = Sa(), ot = q(g(We), 2);
3338
+ X(() => ot.disabled = a(c)), ce("click", ot, () => ae(null)), P(Fe, We);
3339
+ }, jt = (Fe) => {
3340
+ var We = ut(), ot = Ke(We);
3341
+ {
3342
+ var De = (Ue) => {
3343
+ var wt = Ia(), yn = g(wt);
3344
+ {
3345
+ var Et = (je) => {
3346
+ or(je, {
3347
+ get initialPhone() {
3348
+ return h();
3349
+ },
3350
+ get loading() {
3351
+ return a(c);
3352
+ },
3353
+ hideCancel: !0,
3354
+ $$events: { submit: (lt) => ae(lt.detail) }
3355
+ });
3356
+ }, bn = (je) => {
3357
+ var lt = ka(), Ee = Ke(lt), ct = g(Ee), Pt = q(Ee, 2), gn = g(Pt);
3358
+ X(
3359
+ (ei, ti) => {
3360
+ me(ct, ei), Pt.disabled = a(c), me(gn, ti);
3361
+ },
3362
+ [
3363
+ () => (a(M), w(() => a(M).includes("hubtel") ? "Opens the Hubtel checkout with Mobile Money selected." : `Continue to pay securely with Mobile Money via ${K[a(M)] || a(M)}.`)),
3364
+ () => (a(M), w(() => a(M).includes("hubtel") ? "Continue with Hubtel" : "Pay with Mobile Money"))
3365
+ ]
3366
+ ), ce("click", Pt, () => ae(null)), P(je, lt);
3367
+ };
3368
+ J(yn, (je) => {
3369
+ a(M), G(h()), w(() => a(M).includes("mpesa") && !h()) ? je(Et) : je(bn, !1);
3370
+ });
3371
+ }
3372
+ P(Ue, wt);
3373
+ };
3374
+ J(
3375
+ ot,
3376
+ (Ue) => {
3377
+ a(i), w(() => a(i).selectedMethod === "mobile_money") && Ue(De);
3378
+ },
3379
+ !0
3380
+ );
3381
+ }
3382
+ P(Fe, We);
3383
+ };
3384
+ J(_n, (Fe) => {
3385
+ a(i), w(() => a(i).selectedMethod === "card") ? Fe(Ge) : Fe(jt, !1);
3386
+ });
3387
+ }
3388
+ P(Oe, Ut);
3389
+ }
3390
+ }
3391
+ });
3392
+ }, $r = (at) => {
3393
+ var Oe = Aa(), mn = Ke(Oe);
3394
+ Br(mn, {
3395
+ get methods() {
3396
+ return a(R);
3397
+ },
3398
+ get selected() {
3399
+ return a(i), w(() => a(i).selectedMethod);
3400
+ },
3401
+ get amount() {
3402
+ return v();
3403
+ },
3404
+ get currency() {
3405
+ return m();
3406
+ },
3407
+ get provider() {
3408
+ return a(M);
3409
+ },
3410
+ layout: "grid",
3411
+ showLabel: !1,
3412
+ $$events: { select: (Ge) => b.selectMethod(Ge.detail) }
3413
+ });
3414
+ var Ut = q(mn, 2);
3035
3415
  {
3036
- var zt = (He) => {
3037
- var Ht = Ca();
3038
- T(He, Ht);
3039
- }, gr = (He) => {
3040
- var Ht = Ra();
3041
- T(He, Ht);
3416
+ var _n = (Ge) => {
3417
+ var jt = Ta(), Fe = g(jt);
3418
+ {
3419
+ var We = (De) => {
3420
+ or(De, {
3421
+ get initialPhone() {
3422
+ return h();
3423
+ },
3424
+ get loading() {
3425
+ return a(c);
3426
+ },
3427
+ $$events: {
3428
+ submit: (Ue) => ae(Ue.detail),
3429
+ cancel: () => b.selectMethod(null)
3430
+ }
3431
+ });
3432
+ }, ot = (De) => {
3433
+ var Ue = Ra(), wt = g(Ue), yn = g(wt), Et = q(wt, 2), bn = g(Et);
3434
+ {
3435
+ var je = (Ee) => {
3436
+ var ct = Ca();
3437
+ P(Ee, ct);
3438
+ }, lt = (Ee) => {
3439
+ var ct = xa(), Pt = g(ct);
3440
+ X((gn) => me(Pt, gn), [
3441
+ () => (a(i), a(M), w(() => a(i).selectedMethod === "card" ? "Pay with Card" : a(M).includes("hubtel") ? "Continue with Hubtel" : "Pay with Mobile Money"))
3442
+ ]), P(Ee, ct);
3443
+ };
3444
+ J(bn, (Ee) => {
3445
+ a(c) ? Ee(je) : Ee(lt, !1);
3446
+ });
3447
+ }
3448
+ X(
3449
+ (Ee) => {
3450
+ me(yn, Ee), Et.disabled = a(c);
3451
+ },
3452
+ [
3453
+ () => (a(i), a(M), w(() => a(i).selectedMethod === "card" ? "You will be redirected to complete your card payment securely." : a(M).includes("hubtel") ? "Opens the Hubtel checkout with Mobile Money selected." : `Continue to pay securely via ${K[a(M)] || a(M)}.`))
3454
+ ]
3455
+ ), ce("click", Et, () => ae(null)), P(De, Ue);
3456
+ };
3457
+ J(Fe, (De) => {
3458
+ a(i), a(M), G(h()), w(() => a(i).selectedMethod === "mobile_money" && a(M).includes("mpesa") && !h()) ? De(We) : De(ot, !1);
3459
+ });
3460
+ }
3461
+ P(Ge, jt);
3042
3462
  };
3043
- ee(jt, (He) => {
3044
- f(i), P(() => f(i).status === "processing") ? He(zt) : He(gr, !1);
3463
+ J(Ut, (Ge) => {
3464
+ a(u) && Ge(_n);
3045
3465
  });
3046
3466
  }
3047
- oe(() => Qe.disabled = (f(i), P(() => f(i).status === "processing"))), se("click", Qe, () => U(null)), T(ce, Je);
3467
+ P(at, Oe);
3048
3468
  };
3049
- ee(br, (ce) => {
3050
- f(i), P(() => f(i).status === "method_selected" && f(i).selectedMethod === "card") && ce(wr);
3469
+ J(Qr, (at) => {
3470
+ a(x), w(() => a(x).length > 1) ? at(Xr) : at($r, !1);
3051
3471
  });
3052
3472
  }
3053
- T(Ut, mn);
3473
+ P(hn, Zn);
3054
3474
  };
3055
- ee(
3056
- Lt,
3057
- (Ut) => {
3058
- f(i), P(() => f(i).status === "ready" || f(i).status === "method_selected") && Ut(_r);
3475
+ J(
3476
+ pn,
3477
+ (hn) => {
3478
+ a(i), a(u), w(() => a(i).status === "ready" || a(u)) && hn(Zr);
3059
3479
  },
3060
3480
  !0
3061
3481
  );
3062
3482
  }
3063
- T(ze, Ze);
3483
+ P(st, gt);
3064
3484
  };
3065
- ee(
3066
- dt,
3067
- (ze) => {
3068
- f(i), P(() => f(i).status === "success") ? ze(Dt) : ze(Ft, !1);
3485
+ J(
3486
+ Dt,
3487
+ (st) => {
3488
+ a(i), w(() => a(i).status === "success") ? st(dn) : st(vn, !1);
3069
3489
  },
3070
3490
  !0
3071
3491
  );
3072
3492
  }
3073
- T(je, Ge);
3493
+ P(it, bt);
3074
3494
  };
3075
- ee(
3076
- pr,
3077
- (je) => {
3078
- f(i), P(() => f(i).status === "failed" && f(i).error) ? je(hr) : je(mr, !1);
3495
+ J(
3496
+ Gr,
3497
+ (it) => {
3498
+ a(i), w(() => a(i).status === "failed" && a(i).error) ? it(Wr) : it(Jr, !1);
3079
3499
  },
3080
3500
  !0
3081
3501
  );
3082
3502
  }
3083
- T(X, Ue);
3503
+ P(ke, Ft);
3084
3504
  };
3085
- ee(Q, (X) => {
3086
- f(i), P(() => f(i).status === "loading") ? X(ye) : X(Le, !1);
3505
+ J(yt, (ke) => {
3506
+ a(i), w(() => a(i).status === "loading") ? ke(un) : ke(fn, !1);
3087
3507
  });
3088
3508
  }
3089
- oe((X) => Ct(k, 1, X), [
3090
- () => kt((V(ge), V(w()), P(() => ge("reevit-modal-content", w().darkMode && "reevit-modal--dark"))))
3091
- ]), se("click", Y, x), se("click", y, Bi(x)), se("keydown", y, (X) => X.key === "Escape" && x()), T(b, y);
3509
+ X(
3510
+ (ke) => {
3511
+ et(Y, 1, ke), Ln(ie, "src", (a(E), w(() => a(E).logoUrl || "https://i.imgur.com/bzUR5Lm.png")));
3512
+ },
3513
+ [
3514
+ () => $e((G(ue), a(E), w(() => ue("reevit-modal-content", a(E).darkMode && "reevit-modal--dark"))))
3515
+ ]
3516
+ ), ce("click", oe, we), ce("click", W, we), ce("keydown", W, (ke) => ke.key === "Escape" && we()), P(C, W);
3092
3517
  };
3093
- ee(ct, (b) => {
3094
- _() && b(ft);
3518
+ J(Vr, (C) => {
3519
+ O() && C(Yr);
3095
3520
  });
3096
3521
  }
3097
- oe((b) => dr(ae, b), [
3098
- () => (f(l), P(() => Object.entries(f(l)).map(([b, y]) => `${b}:${y}`).join(";")))
3099
- ]), T(e, ae), ln(), a();
3522
+ X((C) => Jn(ve, C), [
3523
+ () => (a(l), w(() => Object.entries(a(l)).map(([C, W]) => `${C}:${W}`).join(";")))
3524
+ ]), P(e, ve), nn(), s();
3100
3525
  }
3101
3526
  export {
3102
- ua as MobileMoneyForm,
3103
- ra as PaymentMethodSelector,
3104
- Ha as ReevitAPIClient,
3105
- Ua as ReevitCheckout,
3106
- qa as cn,
3107
- La as confirmStripePayment,
3108
- Ka as createInitialState,
3109
- Va as createReevitClient,
3110
- $i as createReevitStore,
3111
- ya as createStripeInstance,
3112
- Ba as detectCountryFromCurrency,
3113
- Ya as detectNetwork,
3114
- Wa as formatAmount,
3115
- Ga as formatPhone,
3116
- wa as initiateMPesaSTKPush,
3117
- da as loadFlutterwaveScript,
3118
- Fa as loadHubtelScript,
3119
- pa as loadMonnifyScript,
3120
- fa as loadPaystackScript,
3121
- va as loadStripeScript,
3122
- _a as openFlutterwaveModal,
3123
- ma as openHubtelPopup,
3124
- ba as openMonnifyModal,
3125
- ha as openPaystackPopup,
3126
- Za as reevitReducer,
3127
- Ja as validatePhone
3527
+ or as MobileMoneyForm,
3528
+ Br as PaymentMethodSelector,
3529
+ ta as ProviderSelector,
3530
+ Ba as ReevitAPIClient,
3531
+ Ha as ReevitCheckout,
3532
+ Va as cn,
3533
+ za as confirmStripePayment,
3534
+ Ya as createInitialState,
3535
+ Ga as createReevitClient,
3536
+ qs as createReevitStore,
3537
+ ma as createStripeInstance,
3538
+ Wa as detectCountryFromCurrency,
3539
+ Ja as detectNetwork,
3540
+ Za as formatAmount,
3541
+ Qa as formatPhone,
3542
+ ya as initiateMPesaSTKPush,
3543
+ ua as loadFlutterwaveScript,
3544
+ ja as loadHubtelScript,
3545
+ da as loadMonnifyScript,
3546
+ ca as loadPaystackScript,
3547
+ fa as loadStripeScript,
3548
+ ha as openFlutterwaveModal,
3549
+ pa as openHubtelPopup,
3550
+ _a as openMonnifyModal,
3551
+ va as openPaystackPopup,
3552
+ Xa as reevitReducer,
3553
+ $a as validatePhone
3128
3554
  };