@reevit/svelte 0.1.0 → 0.2.2

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,6 +1,6 @@
1
1
  import { createEventDispatcher as $t, onMount as br, onDestroy as wr } from "svelte";
2
- import { createInitialState as gr, ReevitAPIClient as Er, generateReference as Sr, detectCountryFromCurrency as Pr, reevitReducer as kr, formatAmount as mn, cn as ge, validatePhone as qt, detectNetwork as Rr, createThemeVariables as Ir } from "@reevit/core";
3
- import { ReevitAPIClient as Li, cn as ji, createInitialState as Ui, createReevitClient as qi, detectCountryFromCurrency as zi, detectNetwork as Ki, formatAmount as Bi, formatPhone as Vi, reevitReducer as Hi, validatePhone as Yi } from "@reevit/core";
2
+ import { createInitialState as gr, ReevitAPIClient as Er, generateReference as Sr, detectCountryFromCurrency as Pr, reevitReducer as kr, formatAmount as mn, cn as ge, validatePhone as zt, detectNetwork as Rr, createThemeVariables as Ir } from "@reevit/core";
3
+ import { ReevitAPIClient as Li, cn as ji, createInitialState as Ui, createReevitClient as zi, detectCountryFromCurrency as qi, detectNetwork as Ki, formatAmount as Bi, formatPhone as Vi, reevitReducer as Hi, validatePhone as Yi } from "@reevit/core";
4
4
  const Cr = "5";
5
5
  typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add(Cr);
6
6
  let st = !1, Tr = !1;
@@ -8,8 +8,8 @@ function Mr() {
8
8
  st = !0;
9
9
  }
10
10
  Mr();
11
- const xr = 1, Ar = 2, Nr = 16, Or = 1, Dr = 2, Fr = 4, Lr = 8, jr = 16, Ur = 1, qr = 2, H = /* @__PURE__ */ Symbol(), Vt = !1;
12
- var Tn = Array.isArray, zr = Array.prototype.indexOf, en = Array.from, Mn = Object.defineProperty, pt = Object.getOwnPropertyDescriptor, Kr = Object.getOwnPropertyDescriptors, Br = Object.prototype, Vr = Array.prototype, xn = Object.getPrototypeOf;
11
+ const xr = 1, Ar = 2, Nr = 16, Or = 1, Dr = 2, Fr = 4, Lr = 8, jr = 16, Ur = 1, zr = 2, H = /* @__PURE__ */ Symbol(), Vt = !1;
12
+ var Tn = Array.isArray, qr = Array.prototype.indexOf, en = Array.from, Mn = Object.defineProperty, pt = Object.getOwnPropertyDescriptor, Kr = Object.getOwnPropertyDescriptors, Br = Object.prototype, Vr = Array.prototype, xn = Object.getPrototypeOf;
13
13
  const Ht = () => {
14
14
  };
15
15
  function Hr(e) {
@@ -25,7 +25,7 @@ function An() {
25
25
  });
26
26
  return { promise: n, resolve: e, reject: t };
27
27
  }
28
- const K = 2, Nn = 4, It = 8, Yr = 1 << 24, pe = 16, he = 32, Ve = 64, tn = 128, ae = 512, q = 1024, J = 2048, ie = 4096, Q = 8192, de = 16384, nn = 32768, et = 65536, yn = 1 << 17, On = 1 << 18, Ct = 1 << 19, Dn = 1 << 20, Ee = 1 << 25, Ne = 32768, Gt = 1 << 21, rn = 1 << 22, Se = 1 << 23, Ke = /* @__PURE__ */ Symbol("$state"), Gr = /* @__PURE__ */ Symbol("legacy props"), qe = new class extends Error {
28
+ const K = 2, Nn = 4, It = 8, Yr = 1 << 24, pe = 16, he = 32, Ve = 64, tn = 128, ae = 512, z = 1024, J = 2048, ie = 4096, Q = 8192, de = 16384, nn = 32768, et = 65536, yn = 1 << 17, On = 1 << 18, Ct = 1 << 19, Dn = 1 << 20, Ee = 1 << 25, Ne = 32768, Gt = 1 << 21, rn = 1 << 22, Se = 1 << 23, Ke = /* @__PURE__ */ Symbol("$state"), Gr = /* @__PURE__ */ Symbol("legacy props"), ze = new class extends Error {
29
29
  name = "StaleReactionError";
30
30
  message = "The reaction that called `getAbortSignal()` was re-run or destroyed";
31
31
  }();
@@ -222,16 +222,16 @@ class tt {
222
222
  * @param {EffectTarget} target
223
223
  */
224
224
  #l(t, n) {
225
- t.f ^= q;
225
+ t.f ^= z;
226
226
  for (var r = t.first; r !== null; ) {
227
- var i = r.f, a = (i & (he | Ve)) !== 0, l = a && (i & q) !== 0, s = l || (i & Q) !== 0 || this.skipped_effects.has(r);
227
+ var i = r.f, a = (i & (he | Ve)) !== 0, l = a && (i & z) !== 0, s = l || (i & Q) !== 0 || this.skipped_effects.has(r);
228
228
  if ((r.f & tn) !== 0 && r.b?.is_pending() && (n = {
229
229
  parent: n,
230
230
  effect: r,
231
231
  effects: [],
232
232
  render_effects: []
233
233
  }), !s && r.fn !== null) {
234
- a ? r.f ^= q : (i & Nn) !== 0 ? n.effects.push(r) : He(r) && ((r.f & pe) !== 0 && this.#a.add(r), Be(r));
234
+ a ? r.f ^= z : (i & Nn) !== 0 ? n.effects.push(r) : He(r) && ((r.f & pe) !== 0 && this.#a.add(r), Be(r));
235
235
  var u = r.first;
236
236
  if (u !== null) {
237
237
  r = u;
@@ -249,7 +249,7 @@ class tt {
249
249
  */
250
250
  #o(t) {
251
251
  for (const n of t)
252
- (n.f & J) !== 0 ? this.#a.add(n) : (n.f & ie) !== 0 && this.#s.add(n), this.#u(n.deps), z(n, q);
252
+ (n.f & J) !== 0 ? this.#a.add(n) : (n.f & ie) !== 0 && this.#s.add(n), this.#u(n.deps), q(n, z);
253
253
  }
254
254
  /**
255
255
  * @param {Value[] | null} deps
@@ -279,7 +279,7 @@ class tt {
279
279
  }
280
280
  flush() {
281
281
  if (this.activate(), te.length > 0) {
282
- if (qn(), P !== null && P !== this)
282
+ if (zn(), P !== null && P !== this)
283
283
  return;
284
284
  } else this.#e === 0 && this.process([]);
285
285
  this.deactivate();
@@ -326,7 +326,7 @@ class tt {
326
326
  te = [];
327
327
  const u = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
328
328
  for (const d of l)
329
- zn(d, s, u, o);
329
+ qn(d, s, u, o);
330
330
  if (te.length > 0) {
331
331
  P = a, a.apply();
332
332
  for (const d of te)
@@ -356,9 +356,9 @@ class tt {
356
356
  }
357
357
  revive() {
358
358
  for (const t of this.#a)
359
- this.#s.delete(t), z(t, J), Oe(t);
359
+ this.#s.delete(t), q(t, J), Oe(t);
360
360
  for (const t of this.#s)
361
- z(t, ie), Oe(t);
361
+ q(t, ie), Oe(t);
362
362
  this.flush();
363
363
  }
364
364
  /** @param {() => void} fn */
@@ -396,13 +396,13 @@ function sa(e) {
396
396
  if (aa(), te.length === 0 && (P?.flush(), te.length === 0))
397
397
  return Tt = null, /** @type {T} */
398
398
  n;
399
- qn();
399
+ zn();
400
400
  }
401
401
  } finally {
402
402
  Qe = t;
403
403
  }
404
404
  }
405
- function qn() {
405
+ function zn() {
406
406
  var e = xe;
407
407
  Wt = !0;
408
408
  var t = null;
@@ -452,17 +452,17 @@ function bn(e) {
452
452
  ce = null;
453
453
  }
454
454
  }
455
- function zn(e, t, n, r) {
455
+ function qn(e, t, n, r) {
456
456
  if (!n.has(e) && (n.add(e), e.reactions !== null))
457
457
  for (const i of e.reactions) {
458
458
  const a = i.f;
459
- (a & K) !== 0 ? zn(
459
+ (a & K) !== 0 ? qn(
460
460
  /** @type {Derived} */
461
461
  i,
462
462
  t,
463
463
  n,
464
464
  r
465
- ) : (a & (rn | pe)) !== 0 && (a & J) === 0 && Kn(i, t, r) && (z(i, J), Oe(
465
+ ) : (a & (rn | pe)) !== 0 && (a & J) === 0 && Kn(i, t, r) && (q(i, J), Oe(
466
466
  /** @type {Effect} */
467
467
  i
468
468
  ));
@@ -496,8 +496,8 @@ function Oe(e) {
496
496
  if (Wt && t === R && (n & pe) !== 0 && (n & On) === 0)
497
497
  return;
498
498
  if ((n & (Ve | he)) !== 0) {
499
- if ((n & q) === 0) return;
500
- t.f ^= q;
499
+ if ((n & z) === 0) return;
500
+ t.f ^= z;
501
501
  }
502
502
  }
503
503
  te.push(t);
@@ -601,16 +601,16 @@ function fa(e, t) {
601
601
  );
602
602
  if (l) {
603
603
  var d = !r.is_pending();
604
- r.update_pending_count(1), o.increment(d), s.get(o)?.reject(qe), s.delete(o), s.set(o, u);
604
+ r.update_pending_count(1), o.increment(d), s.get(o)?.reject(ze), s.delete(o), s.set(o, u);
605
605
  }
606
606
  const v = (_, p = void 0) => {
607
607
  if (o.activate(), p)
608
- p !== qe && (a.f |= Se, rt(a, p));
608
+ p !== ze && (a.f |= Se, rt(a, p));
609
609
  else {
610
610
  (a.f & Se) !== 0 && (a.f ^= Se), rt(a, _);
611
611
  for (const [c, b] of s) {
612
612
  if (s.delete(c), c === o) break;
613
- b.reject(qe);
613
+ b.reject(ze);
614
614
  }
615
615
  }
616
616
  l && (r.update_pending_count(-1), o.decrement(d));
@@ -618,7 +618,7 @@ function fa(e, t) {
618
618
  u.promise.then(v, (_) => v(null, _ || "unknown"));
619
619
  }), ln(() => {
620
620
  for (const u of s.values())
621
- u.reject(qe);
621
+ u.reject(ze);
622
622
  }), new Promise((u) => {
623
623
  function o(d) {
624
624
  function v() {
@@ -672,8 +672,8 @@ function Vn(e) {
672
672
  if (ne !== null)
673
673
  (gt() || P?.is_fork) && ne.set(e, t);
674
674
  else {
675
- var n = (e.f & ae) === 0 ? ie : q;
676
- z(e, n);
675
+ var n = (e.f & ae) === 0 ? ie : z;
676
+ q(e, n);
677
677
  }
678
678
  }
679
679
  let Zt = /* @__PURE__ */ new Set();
@@ -705,7 +705,7 @@ function j(e, t, n = !1) {
705
705
  g !== 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
707
  (!le || (g.f & yn) !== 0) && ot() && (g.f & (K | pe | rn | yn)) !== 0 && !_e?.includes(e) && na();
708
- let r = n ? ze(t) : t;
708
+ let r = n ? qe(t) : t;
709
709
  return rt(e, r);
710
710
  }
711
711
  function rt(e, t) {
@@ -716,7 +716,7 @@ function rt(e, t) {
716
716
  r.capture(e, n), (e.f & K) !== 0 && ((e.f & J) !== 0 && on(
717
717
  /** @type {Derived} */
718
718
  e
719
- ), z(e, (e.f & ae) !== 0 ? q : ie)), e.wv = rr(), Yn(e, J), ot() && R !== null && (R.f & q) !== 0 && (R.f & (he | Ve)) === 0 && ($ === null ? Ra([e]) : $.push(e)), !r.is_fork && Zt.size > 0 && !Hn && da();
719
+ ), q(e, (e.f & ae) !== 0 ? z : ie)), e.wv = rr(), Yn(e, J), ot() && R !== null && (R.f & z) !== 0 && (R.f & (he | Ve)) === 0 && ($ === null ? Ra([e]) : $.push(e)), !r.is_fork && Zt.size > 0 && !Hn && da();
720
720
  }
721
721
  return t;
722
722
  }
@@ -727,13 +727,13 @@ function da() {
727
727
  const t = Array.from(Zt);
728
728
  try {
729
729
  for (const n of t)
730
- (n.f & q) !== 0 && z(n, ie), He(n) && Be(n);
730
+ (n.f & z) !== 0 && q(n, ie), He(n) && Be(n);
731
731
  } finally {
732
732
  Et(e);
733
733
  }
734
734
  Zt.clear();
735
735
  }
736
- function zt(e) {
736
+ function qt(e) {
737
737
  j(e, e.v + 1);
738
738
  }
739
739
  function Yn(e, t) {
@@ -743,7 +743,7 @@ function Yn(e, t) {
743
743
  var l = n[a], s = l.f;
744
744
  if (!(!r && l === R)) {
745
745
  var u = (s & J) === 0;
746
- if (u && z(l, t), (s & K) !== 0) {
746
+ if (u && q(l, t), (s & K) !== 0) {
747
747
  var o = (
748
748
  /** @type {Derived} */
749
749
  l
@@ -759,7 +759,7 @@ function Yn(e, t) {
759
759
  }
760
760
  }
761
761
  }
762
- function ze(e) {
762
+ function qe(e) {
763
763
  if (typeof e != "object" || e === null || Ke in e)
764
764
  return e;
765
765
  const t = xn(e);
@@ -793,10 +793,10 @@ function ze(e) {
793
793
  if (o === void 0) {
794
794
  if (u in s) {
795
795
  const d = l(() => /* @__PURE__ */ be(H));
796
- n.set(u, d), zt(i);
796
+ n.set(u, d), qt(i);
797
797
  }
798
798
  } else
799
- j(o, H), zt(i);
799
+ j(o, H), qt(i);
800
800
  return !0;
801
801
  },
802
802
  get(s, u, o) {
@@ -804,7 +804,7 @@ function ze(e) {
804
804
  return e;
805
805
  var d = n.get(u), v = u in s;
806
806
  if (d === void 0 && (!v || pt(s, u)?.writable) && (d = l(() => {
807
- var p = ze(v ? s[u] : H), c = /* @__PURE__ */ be(p);
807
+ var p = qe(v ? s[u] : H), c = /* @__PURE__ */ be(p);
808
808
  return c;
809
809
  }), n.set(u, d)), d !== void 0) {
810
810
  var _ = f(d);
@@ -835,7 +835,7 @@ function ze(e) {
835
835
  var o = n.get(u), d = o !== void 0 && o.v !== H || Reflect.has(s, u);
836
836
  if (o !== void 0 || R !== null && (!d || pt(s, u)?.writable)) {
837
837
  o === void 0 && (o = l(() => {
838
- var _ = d ? ze(s[u]) : H, p = /* @__PURE__ */ be(_);
838
+ var _ = d ? qe(s[u]) : H, p = /* @__PURE__ */ be(_);
839
839
  return p;
840
840
  }), n.set(u, o));
841
841
  var v = f(o);
@@ -853,10 +853,10 @@ function ze(e) {
853
853
  c !== void 0 ? j(c, H) : p in s && (c = l(() => /* @__PURE__ */ be(H)), n.set(p + "", c));
854
854
  }
855
855
  if (v === void 0)
856
- (!_ || pt(s, u)?.writable) && (v = l(() => /* @__PURE__ */ be(void 0)), j(v, ze(o)), n.set(u, v));
856
+ (!_ || pt(s, u)?.writable) && (v = l(() => /* @__PURE__ */ be(void 0)), j(v, qe(o)), n.set(u, v));
857
857
  else {
858
858
  _ = v.v !== H;
859
- var b = l(() => ze(o));
859
+ var b = l(() => qe(o));
860
860
  j(v, b);
861
861
  }
862
862
  var y = Reflect.getOwnPropertyDescriptor(s, u);
@@ -868,7 +868,7 @@ function ze(e) {
868
868
  ), m = Number(u);
869
869
  Number.isInteger(m) && m >= E.v && j(E, m + 1);
870
870
  }
871
- zt(i);
871
+ qt(i);
872
872
  }
873
873
  return !0;
874
874
  },
@@ -1012,7 +1012,7 @@ function gt() {
1012
1012
  }
1013
1013
  function ln(e) {
1014
1014
  const t = Ie(It, null, !1);
1015
- return z(t, q), t.teardown = e, t;
1015
+ return q(t, z), t.teardown = e, t;
1016
1016
  }
1017
1017
  function gn(e) {
1018
1018
  Wn();
@@ -1053,7 +1053,7 @@ function un() {
1053
1053
  for (var t of e.l.$) {
1054
1054
  t.deps();
1055
1055
  var n = t.effect;
1056
- (n.f & q) !== 0 && z(n, ie), He(n) && Be(n), t.ran = !1;
1056
+ (n.f & z) !== 0 && q(n, ie), He(n) && Be(n), t.ran = !1;
1057
1057
  }
1058
1058
  });
1059
1059
  }
@@ -1092,7 +1092,7 @@ function Qn(e, t = !1) {
1092
1092
  for (e.first = e.last = null; n !== null; ) {
1093
1093
  const i = n.ac;
1094
1094
  i !== null && At(() => {
1095
- i.abort(qe);
1095
+ i.abort(ze);
1096
1096
  });
1097
1097
  var r = n.next;
1098
1098
  (n.f & Ve) !== 0 ? n.parent = null : ve(n, t), n = r;
@@ -1110,7 +1110,7 @@ function ve(e, t = !0) {
1110
1110
  e.nodes.start,
1111
1111
  /** @type {TemplateNode} */
1112
1112
  e.nodes.end
1113
- ), n = !0), Qn(e, t && !n), St(e, 0), z(e, de);
1113
+ ), n = !0), Qn(e, t && !n), St(e, 0), q(e, de);
1114
1114
  var r = e.nodes && e.nodes.t;
1115
1115
  if (r !== null)
1116
1116
  for (const a of r)
@@ -1163,7 +1163,7 @@ function dn(e) {
1163
1163
  }
1164
1164
  function tr(e, t) {
1165
1165
  if ((e.f & Q) !== 0) {
1166
- e.f ^= Q, (e.f & q) === 0 && (z(e, J), Oe(e));
1166
+ e.f ^= Q, (e.f & z) === 0 && (q(e, J), Oe(e));
1167
1167
  for (var n = e.first; n !== null; ) {
1168
1168
  var r = n.next, i = (n.f & et) !== 0 || (n.f & he) !== 0;
1169
1169
  tr(n, i ? t : !1), n = r;
@@ -1232,7 +1232,7 @@ function He(e) {
1232
1232
  }
1233
1233
  (t & ae) !== 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 && z(e, q);
1235
+ ne === null && q(e, z);
1236
1236
  }
1237
1237
  return !1;
1238
1238
  }
@@ -1246,7 +1246,7 @@ function ar(e, t, n = !0) {
1246
1246
  a,
1247
1247
  t,
1248
1248
  !1
1249
- ) : t === a && (n ? z(a, J) : (a.f & q) !== 0 && z(a, ie), Oe(
1249
+ ) : t === a && (n ? q(a, J) : (a.f & z) !== 0 && q(a, ie), Oe(
1250
1250
  /** @type {Effect} */
1251
1251
  a
1252
1252
  ));
@@ -1256,7 +1256,7 @@ function ir(e) {
1256
1256
  var t = G, n = X, r = $, i = g, a = _e, l = U, s = le, u = Ae, o = e.f;
1257
1257
  G = /** @type {null | Value[]} */
1258
1258
  null, X = 0, $ = null, g = (o & (he | Ve)) === 0 ? e : null, _e = null, mt(e.ctx), le = !1, Ae = ++it, e.ac !== null && (At(() => {
1259
- e.ac.abort(qe);
1259
+ e.ac.abort(ze);
1260
1260
  }), e.ac = null);
1261
1261
  try {
1262
1262
  e.f |= Gt;
@@ -1294,7 +1294,7 @@ function ir(e) {
1294
1294
  function Ia(e, t) {
1295
1295
  let n = t.reactions;
1296
1296
  if (n !== null) {
1297
- var r = zr.call(n, e);
1297
+ var r = qr.call(n, e);
1298
1298
  if (r !== -1) {
1299
1299
  var i = n.length - 1;
1300
1300
  i === 0 ? n = t.reactions = null : (n[r] = n[i], n.pop());
@@ -1303,7 +1303,7 @@ function Ia(e, t) {
1303
1303
  n === null && (t.f & K) !== 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
- (G === null || !G.includes(t)) && (z(t, ie), (t.f & ae) !== 0 && (t.f ^= ae, t.f &= ~Ne), Bn(
1306
+ (G === null || !G.includes(t)) && (q(t, ie), (t.f & ae) !== 0 && (t.f ^= ae, t.f &= ~Ne), Bn(
1307
1307
  /** @type {Derived} **/
1308
1308
  t
1309
1309
  ), St(
@@ -1321,7 +1321,7 @@ function St(e, t) {
1321
1321
  function Be(e) {
1322
1322
  var t = e.f;
1323
1323
  if ((t & de) === 0) {
1324
- z(e, q);
1324
+ q(e, z);
1325
1325
  var n = R, r = xe;
1326
1326
  R = e, xe = !0;
1327
1327
  try {
@@ -1361,7 +1361,7 @@ function f(e) {
1361
1361
  /** @type {Derived} */
1362
1362
  e
1363
1363
  ), s = l.v;
1364
- return ((l.f & q) === 0 && l.reactions !== null || or(l)) && (s = on(l)), Pe.set(l, s), s;
1364
+ return ((l.f & z) === 0 && l.reactions !== null || or(l)) && (s = on(l)), Pe.set(l, s), s;
1365
1365
  }
1366
1366
  } else n && (!ne?.has(e) || P?.is_fork && !gt()) && (l = /** @type {Derived} */
1367
1367
  e, He(l) && Vn(l), xe && gt() && (l.f & ae) === 0 && sr(l));
@@ -1401,7 +1401,7 @@ function w(e) {
1401
1401
  }
1402
1402
  }
1403
1403
  const Ta = -7169;
1404
- function z(e, t) {
1404
+ function q(e, t) {
1405
1405
  e.f = e.f & Ta | t;
1406
1406
  }
1407
1407
  function W(e) {
@@ -1531,7 +1531,7 @@ function Pt(e, t) {
1531
1531
  }
1532
1532
  // @__NO_SIDE_EFFECTS__
1533
1533
  function O(e, t) {
1534
- var n = (t & Ur) !== 0, r = (t & qr) !== 0, i, a = !e.startsWith("<!>");
1534
+ var n = (t & Ur) !== 0, r = (t & zr) !== 0, i, a = !e.startsWith("<!>");
1535
1535
  return () => {
1536
1536
  i === void 0 && (i = Aa(a ? e : "<!>" + e), n || (i = /** @type {TemplateNode} */
1537
1537
  /* @__PURE__ */ wt(i)));
@@ -1906,7 +1906,7 @@ function Ua(e, t, n) {
1906
1906
  var r = e == null ? "" : "" + e;
1907
1907
  return r === "" ? null : r;
1908
1908
  }
1909
- function qa(e, t) {
1909
+ function za(e, t) {
1910
1910
  return e == null ? null : String(e);
1911
1911
  }
1912
1912
  function Rt(e, t, n, r, i, a) {
@@ -1920,12 +1920,12 @@ function Rt(e, t, n, r, i, a) {
1920
1920
  function fr(e, t, n, r) {
1921
1921
  var i = e.__style;
1922
1922
  if (i !== t) {
1923
- var a = qa(t);
1923
+ var a = za(t);
1924
1924
  a == null ? e.removeAttribute("style") : e.style.cssText = a, e.__style = t;
1925
1925
  }
1926
1926
  return r;
1927
1927
  }
1928
- function za(e, t, n = t) {
1928
+ function qa(e, t, n = t) {
1929
1929
  var r = /* @__PURE__ */ new WeakSet();
1930
1930
  ya(e, "input", async (i) => {
1931
1931
  var a = i ? e.defaultValue : e.value;
@@ -2128,7 +2128,7 @@ function Y(e, t, n, r) {
2128
2128
  /** @type {() => V} */
2129
2129
  (function(S, I) {
2130
2130
  if (arguments.length > 0) {
2131
- const h = I ? f(E) : i && a ? ze(S) : S;
2131
+ const h = I ? f(E) : i && a ? qe(S) : S;
2132
2132
  return j(E, h), y = !0, s !== void 0 && (s = h), S;
2133
2133
  }
2134
2134
  return De && y || (m.f & de) !== 0 ? E.v : f(E);
@@ -2331,7 +2331,7 @@ function si(e, t) {
2331
2331
  const i = $t();
2332
2332
  let a = /* @__PURE__ */ ke(n()), l = /* @__PURE__ */ ke(null), s = /* @__PURE__ */ ke(null);
2333
2333
  function u() {
2334
- if (!qt(f(a))) {
2334
+ if (!zt(f(a))) {
2335
2335
  j(s, "Please enter a valid phone number");
2336
2336
  return;
2337
2337
  }
@@ -2390,9 +2390,9 @@ function si(e, t) {
2390
2390
  Rt(_, 1, h), _.disabled = r(), E.disabled = r() || !f(a);
2391
2391
  },
2392
2392
  [
2393
- () => kt((W(ge), f(s), W(qt), f(a), w(() => ge("reevit-input", f(s) && !qt(f(a)) && "reevit-input--error"))))
2393
+ () => kt((W(ge), f(s), W(zt), f(a), w(() => ge("reevit-input", f(s) && !zt(f(a)) && "reevit-input--error"))))
2394
2394
  ]
2395
- ), za(_, () => f(a), (h) => j(a, h)), se("submit", d, Ba(u)), x(e, d), sn();
2395
+ ), qa(_, () => f(a), (h) => j(a, h)), se("submit", d, Ba(u)), x(e, d), sn();
2396
2396
  }
2397
2397
  const Cn = /* @__PURE__ */ new Map();
2398
2398
  function ut(e, t) {
@@ -2535,7 +2535,7 @@ async function Ni(e, t) {
2535
2535
  return e.onError({ message: r }), { status: "failed", message: r };
2536
2536
  }
2537
2537
  }
2538
- var hi = /* @__PURE__ */ O('<span class="reevit-spinner"></span>'), mi = /* @__PURE__ */ O('<button type="button" class="reevit-pay-button"><!></button>'), yi = /* @__PURE__ */ O('<div class="reevit-loading-state"><div class="reevit-spinner reevit-spinner--large"></div> <p>Initializing payment...</p></div>'), bi = /* @__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>'), wi = /* @__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>'), gi = /* @__PURE__ */ O('<div class="reevit-method-form-container"><!></div>'), Ei = /* @__PURE__ */ O('<span class="reevit-spinner"></span>'), Si = /* @__PURE__ */ O("<span>Proceed to Card Payment</span>"), Pi = /* @__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>'), ki = /* @__PURE__ */ O("<!> <!> <!>", 1), Ri = /* @__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"><h2 class="reevit-modal-title">Reevit Checkout</h2> <p class="reevit-modal-subtitle">Secure payment powered by Reevit</p></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>'), Ii = /* @__PURE__ */ O('<div class="reevit-sdk-container"><!> <!></div>');
2538
+ var hi = /* @__PURE__ */ O('<span class="reevit-spinner"></span>'), mi = /* @__PURE__ */ O('<button type="button" class="reevit-pay-button"><!></button>'), yi = /* @__PURE__ */ O('<div class="reevit-loading-state"><div class="reevit-spinner reevit-spinner--large"></div> <p>Initializing payment...</p></div>'), bi = /* @__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>'), wi = /* @__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>'), gi = /* @__PURE__ */ O('<div class="reevit-method-form-container"><!></div>'), Ei = /* @__PURE__ */ O('<span class="reevit-spinner"></span>'), Si = /* @__PURE__ */ O("<span>Proceed to Card Payment</span>"), Pi = /* @__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>'), ki = /* @__PURE__ */ O("<!> <!> <!>", 1), Ri = /* @__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>'), Ii = /* @__PURE__ */ O('<div class="reevit-sdk-container"><!> <!></div>');
2539
2539
  function Oi(e, t) {
2540
2540
  an(t, !1);
2541
2541
  const n = () => Ha(m, "$store", r), [r, i] = Ya(), a = /* @__PURE__ */ ke(), l = /* @__PURE__ */ ke(), s = $t();
@@ -2784,10 +2784,10 @@ export {
2784
2784
  ji as cn,
2785
2785
  xi as confirmStripePayment,
2786
2786
  Ui as createInitialState,
2787
- qi as createReevitClient,
2787
+ zi as createReevitClient,
2788
2788
  Ja as createReevitStore,
2789
2789
  pi as createStripeInstance,
2790
- zi as detectCountryFromCurrency,
2790
+ qi as detectCountryFromCurrency,
2791
2791
  Ki as detectNetwork,
2792
2792
  Bi as formatAmount,
2793
2793
  Vi as formatPhone,
@@ -0,0 +1,2 @@
1
+ export { createReevitStore, type ReevitStore } from './reevit';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stores/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { ReevitCheckoutConfig, CheckoutState, PaymentMethod, PaymentResult, PaymentError, ReevitState } from '../../../core/dist/index.d.ts';
2
+ interface CreateReevitStoreOptions {
3
+ config: ReevitCheckoutConfig;
4
+ onSuccess?: (result: PaymentResult) => void;
5
+ onError?: (error: PaymentError) => void;
6
+ onClose?: () => void;
7
+ onStateChange?: (state: CheckoutState) => void;
8
+ apiBaseUrl?: string;
9
+ }
10
+ type Subscriber<T> = (value: T) => void;
11
+ type Unsubscriber = () => void;
12
+ /**
13
+ * Creates a Svelte-compatible store for managing Reevit checkout state
14
+ */
15
+ export declare function createReevitStore(options: CreateReevitStoreOptions): {
16
+ subscribe: (subscriber: Subscriber<ReevitState>) => Unsubscriber;
17
+ initialize: (method?: PaymentMethod) => Promise<void>;
18
+ selectMethod: (method: PaymentMethod) => void;
19
+ processPayment: (paymentData: Record<string, unknown>) => Promise<void>;
20
+ handlePspSuccess: (pspData: Record<string, unknown>) => Promise<void>;
21
+ handlePspError: (error: PaymentError) => void;
22
+ reset: () => void;
23
+ close: () => Promise<void>;
24
+ getStatus: () => any;
25
+ getPaymentIntent: () => any;
26
+ getSelectedMethod: () => any;
27
+ getError: () => any;
28
+ getResult: () => any;
29
+ isLoading: () => boolean;
30
+ isReady: () => boolean;
31
+ isComplete: () => boolean;
32
+ canRetry: () => any;
33
+ };
34
+ export type ReevitStore = ReturnType<typeof createReevitStore>;
35
+ export {};
36
+ //# sourceMappingURL=reevit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reevit.d.ts","sourceRoot":"","sources":["../../src/stores/reevit.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAML,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,YAAY,EAEjB,KAAK,WAAW,EAIjB,MAAM,cAAc,CAAC;AAEtB,UAAU,wBAAwB;IAChC,MAAM,EAAE,oBAAoB,CAAC;IAC7B,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;IAC5C,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IACxC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,KAAK,UAAU,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;AACxC,KAAK,YAAY,GAAG,MAAM,IAAI,CAAC;AAqC/B;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB;4BA8BlC,UAAU,CAAC,WAAW,CAAC,KAAG,YAAY;0BAOlC,aAAa;2BA8ClB,aAAa;kCAKA,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;gCA6CzB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;4BAKjC,YAAY;;;;;;;;;;;;EA2D5C;AAED,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
package/dist/styles.css CHANGED
@@ -0,0 +1 @@
1
+ @import"https://fonts.googleapis.com/css2?family=Geist+Mono:wght@400;500;600;700&display=swap";:root{--reevit-primary: oklch(.922 0 0);--reevit-primary-hover: oklch(.85 0 0);--reevit-primary-foreground: oklch(.145 0 0);--reevit-background: oklch(1 0 0);--reevit-surface: oklch(.97 0 0);--reevit-border: oklch(.922 0 0);--reevit-text: oklch(.145 0 0);--reevit-text-secondary: oklch(.556 0 0);--reevit-muted: oklch(.708 0 0);--reevit-success: oklch(.696 .17 162.48);--reevit-error: oklch(.577 .245 27.325);--reevit-warning: oklch(.828 .189 84.429);--reevit-radius: .625rem;--reevit-radius-sm: .5rem;--reevit-radius-lg: .75rem;--reevit-font: "Geist Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;--reevit-shadow: 0 25px 50px -12px rgba(0, 0, 0, .15);--reevit-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, .1)}@media(prefers-color-scheme:dark){:root{--reevit-primary: oklch(.922 0 0);--reevit-primary-hover: oklch(.85 0 0);--reevit-primary-foreground: oklch(.145 0 0);--reevit-background: oklch(.145 0 0);--reevit-surface: oklch(.205 0 0);--reevit-border: oklch(1 0 0 / 10%);--reevit-text: oklch(.985 0 0);--reevit-text-secondary: oklch(.708 0 0);--reevit-muted: oklch(.556 0 0);--reevit-success: oklch(.696 .17 162.48);--reevit-error: oklch(.704 .191 22.216);--reevit-warning: oklch(.828 .189 84.429)}}.reevit-overlay{position:fixed;inset:0;background:#000000b3;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);display:flex;align-items:center;justify-content:center;z-index:9999;padding:16px;animation:reevit-fade-in .2s ease-out}@keyframes reevit-fade-in{0%{opacity:0}to{opacity:1}}.reevit-modal{background:var(--reevit-background);border-radius:var(--reevit-radius-lg);border:1px solid var(--reevit-border);box-shadow:var(--reevit-shadow);width:100%;max-width:400px;max-height:90vh;overflow:hidden;display:flex;flex-direction:column;font-family:var(--reevit-font);animation:reevit-slide-up .25s cubic-bezier(.22,1,.36,1)}@keyframes reevit-slide-up{0%{opacity:0;transform:translateY(16px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.reevit-modal--success{border-color:var(--reevit-success)}.reevit-modal__header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid var(--reevit-border)}.reevit-modal__branding{display:flex;align-items:center;gap:8px}.reevit-modal__logo{height:18px;width:auto;object-fit:contain}.reevit-modal__close{width:28px;height:28px;border-radius:var(--reevit-radius-sm);border:1px solid var(--reevit-border);background:transparent;color:var(--reevit-text-secondary);font-size:14px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .15s ease}.reevit-modal__close:hover{background:var(--reevit-surface);color:var(--reevit-text);border-color:var(--reevit-text-secondary)}.reevit-modal__amount{padding:32px 20px;text-align:center;background:var(--reevit-surface);border-bottom:1px solid var(--reevit-border)}.reevit-modal__amount-label{display:block;font-size:11px;font-weight:500;text-transform:uppercase;letter-spacing:.1em;color:var(--reevit-text-secondary);margin-bottom:8px}.reevit-modal__amount-value{display:block;font-size:36px;font-weight:700;letter-spacing:-.03em;color:var(--reevit-text)}.reevit-modal__content{flex:1;overflow-y:auto;padding:20px}.reevit-modal__footer{padding:14px 20px;border-top:1px solid var(--reevit-border);text-align:center;background:var(--reevit-surface)}.reevit-modal__secured{font-size:11px;font-weight:500;color:var(--reevit-text-secondary);letter-spacing:.02em}.reevit-method-selector{margin-bottom:20px}.reevit-method-selector__label{font-size:12px;font-weight:500;color:var(--reevit-text);margin-bottom:12px;letter-spacing:.02em}.reevit-method-selector__options{display:flex;flex-direction:column;gap:8px}.reevit-method-option{display:flex;align-items:center;gap:12px;padding:14px 16px;background:transparent;border:1px solid var(--reevit-border);border-radius:var(--reevit-radius);cursor:pointer;transition:all .15s ease;text-align:left;width:100%}.reevit-method-option:hover{border-color:var(--reevit-text-secondary);background:var(--reevit-surface)}.reevit-method-option--selected{border-color:var(--reevit-text);background:var(--reevit-surface)}.reevit-method-option--disabled{opacity:.5;cursor:not-allowed}.reevit-method-option__icon{font-size:20px;flex-shrink:0;opacity:.8}.reevit-method-option__content{flex:1;min-width:0}.reevit-method-option__label{display:block;font-size:13px;font-weight:600;color:var(--reevit-text);letter-spacing:-.01em}.reevit-method-option__description{display:block;font-size:11px;color:var(--reevit-text-secondary);margin-top:2px;letter-spacing:.01em}.reevit-method-option__check{color:var(--reevit-text);flex-shrink:0;font-size:14px}.reevit-momo-form{display:flex;flex-direction:column;gap:16px}.reevit-momo-form__field{display:flex;flex-direction:column;gap:6px}.reevit-momo-form__label{font-size:12px;font-weight:500;color:var(--reevit-text);letter-spacing:.02em}.reevit-momo-form__input{padding:10px 14px;font-size:14px;border:1px solid var(--reevit-border);border-radius:var(--reevit-radius);background:transparent;color:var(--reevit-text);transition:all .15s ease;font-family:var(--reevit-font)}.reevit-momo-form__input:focus{outline:none;border-color:var(--reevit-text-secondary);background:var(--reevit-surface)}.reevit-momo-form__input--error{border-color:var(--reevit-error)}.reevit-momo-form__input--error:focus{border-color:var(--reevit-error)}.reevit-momo-form__formatted{font-size:11px;color:var(--reevit-text-secondary)}.reevit-momo-form__error{font-size:11px;color:var(--reevit-error)}.reevit-momo-form__networks{display:flex;gap:8px}.reevit-network-btn{flex:1;padding:10px 14px;font-size:12px;font-weight:600;border:1px solid var(--reevit-border);border-radius:var(--reevit-radius);background:transparent;color:var(--reevit-text);cursor:pointer;transition:all .15s ease;font-family:var(--reevit-font)}.reevit-network-btn:hover{border-color:var(--reevit-text);background:transparent}.reevit-network-btn:focus{outline:none;border-color:var(--reevit-text);box-shadow:0 0 0 2px var(--reevit-border)}.reevit-network-btn--selected{border-color:var(--reevit-text);background:var(--reevit-text);color:var(--reevit-background)}.reevit-network-btn--selected:hover{background:var(--reevit-text-secondary);border-color:var(--reevit-text-secondary)}.reevit-momo-form__actions{display:flex;gap:10px;margin-top:8px}.reevit-momo-form__hint{font-size:11px;color:var(--reevit-text-secondary);text-align:center;margin-top:4px}.reevit-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:10px 18px;font-size:13px;font-weight:600;border-radius:var(--reevit-radius);cursor:pointer;transition:all .15s ease;font-family:var(--reevit-font);border:none;min-height:42px;letter-spacing:-.01em}.reevit-btn--primary{flex:1;background:#fff;color:#0a0a0a;border:1px solid var(--reevit-border)}.reevit-btn--primary:hover:not(:disabled){background:#f5f5f5;border-color:var(--reevit-text-secondary)}.reevit-btn--primary:focus:not(:disabled){outline:none;border-color:var(--reevit-text);box-shadow:0 0 0 2px var(--reevit-border)}.reevit-btn--primary:active:not(:disabled){background:#eee;transform:scale(.98)}.reevit-btn--primary:disabled{opacity:.5;cursor:not-allowed}.reevit-btn--secondary{background:transparent;color:var(--reevit-text);border:1px solid var(--reevit-border)}.reevit-btn--secondary:hover:not(:disabled){background:transparent;border-color:var(--reevit-text)}.reevit-btn--secondary:focus:not(:disabled){outline:none;border-color:var(--reevit-text);box-shadow:0 0 0 2px var(--reevit-border)}.reevit-trigger-btn{padding:10px 18px;font-size:13px;font-weight:600;background:#fff;color:#0a0a0a;border:1px solid var(--reevit-border);border-radius:var(--reevit-radius);cursor:pointer;font-family:var(--reevit-font);transition:all .15s ease;letter-spacing:-.01em}.reevit-trigger-btn:hover{background:#f5f5f5;border-color:var(--reevit-text-secondary)}.reevit-trigger-btn:focus{outline:none;border-color:var(--reevit-text);box-shadow:0 0 0 2px var(--reevit-border)}@media(prefers-color-scheme:dark){.reevit-btn--primary{background:#fafafa;color:#0a0a0a}.reevit-btn--primary:hover:not(:disabled){background:#dedede}.reevit-btn--primary:active:not(:disabled){background:#cecece}.reevit-trigger-btn{background:#fafafa;color:#0a0a0a}.reevit-trigger-btn:hover{background:#dedede}}.reevit-loading,.reevit-success,.reevit-error{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px 20px;text-align:center;gap:12px}.reevit-success__icon{width:48px;height:48px;border-radius:50%;background:var(--reevit-success);color:#fff;font-size:24px;display:flex;align-items:center;justify-content:center;animation:reevit-pop .3s ease-out}.reevit-error__icon{width:48px;height:48px;border-radius:50%;background:var(--reevit-error);color:#fff;font-size:24px;display:flex;align-items:center;justify-content:center}@keyframes reevit-pop{0%{transform:scale(0)}50%{transform:scale(1.1)}to{transform:scale(1)}}.reevit-success h3,.reevit-error h3{font-size:14px;font-weight:600;color:var(--reevit-text);margin:0;letter-spacing:-.01em}.reevit-success p,.reevit-error p{font-size:12px;color:var(--reevit-text-secondary);margin:0}.reevit-spinner{width:20px;height:20px;border:2px solid var(--reevit-border);border-top-color:var(--reevit-text);border-radius:50%;animation:reevit-spin .7s linear infinite}@keyframes reevit-spin{to{transform:rotate(360deg)}}.reevit-loading .reevit-spinner{width:32px;height:32px;border-width:2px}.reevit-loading p{font-size:12px;color:var(--reevit-text-secondary);margin:0}.reevit-psp-bridge{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px 20px;text-align:center;gap:12px}.reevit-psp-bridge__loading p{font-size:12px;color:var(--reevit-text-secondary);margin:0}.reevit-method-step__actions{margin-top:16px}@media(max-width:480px){.reevit-modal{max-width:100%;max-height:100%;border-radius:var(--reevit-radius-lg) var(--reevit-radius-lg) 0 0;margin-top:auto}.reevit-modal__amount-value{font-size:28px}.reevit-momo-form__networks{flex-direction:column}.reevit-momo-form__actions{flex-direction:column-reverse}.reevit-btn--secondary{flex:none}}
package/dist/svelte.css CHANGED
@@ -0,0 +1 @@
1
+ @import"https://fonts.googleapis.com/css2?family=Geist+Mono:wght@400;500;600;700&display=swap";:root{--reevit-primary: oklch(.922 0 0);--reevit-primary-hover: oklch(.85 0 0);--reevit-primary-foreground: oklch(.145 0 0);--reevit-background: oklch(1 0 0);--reevit-surface: oklch(.97 0 0);--reevit-border: oklch(.922 0 0);--reevit-text: oklch(.145 0 0);--reevit-text-secondary: oklch(.556 0 0);--reevit-muted: oklch(.708 0 0);--reevit-success: oklch(.696 .17 162.48);--reevit-error: oklch(.577 .245 27.325);--reevit-warning: oklch(.828 .189 84.429);--reevit-radius: .625rem;--reevit-radius-sm: .5rem;--reevit-radius-lg: .75rem;--reevit-font: "Geist Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;--reevit-shadow: 0 25px 50px -12px rgba(0, 0, 0, .15);--reevit-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, .1)}@media(prefers-color-scheme:dark){:root{--reevit-primary: oklch(.922 0 0);--reevit-primary-hover: oklch(.85 0 0);--reevit-primary-foreground: oklch(.145 0 0);--reevit-background: oklch(.145 0 0);--reevit-surface: oklch(.205 0 0);--reevit-border: oklch(1 0 0 / 10%);--reevit-text: oklch(.985 0 0);--reevit-text-secondary: oklch(.708 0 0);--reevit-muted: oklch(.556 0 0);--reevit-success: oklch(.696 .17 162.48);--reevit-error: oklch(.704 .191 22.216);--reevit-warning: oklch(.828 .189 84.429)}}.reevit-overlay{position:fixed;inset:0;background:#000000b3;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);display:flex;align-items:center;justify-content:center;z-index:9999;padding:16px;animation:reevit-fade-in .2s ease-out}@keyframes reevit-fade-in{0%{opacity:0}to{opacity:1}}.reevit-modal{background:var(--reevit-background);border-radius:var(--reevit-radius-lg);border:1px solid var(--reevit-border);box-shadow:var(--reevit-shadow);width:100%;max-width:400px;max-height:90vh;overflow:hidden;display:flex;flex-direction:column;font-family:var(--reevit-font);animation:reevit-slide-up .25s cubic-bezier(.22,1,.36,1)}@keyframes reevit-slide-up{0%{opacity:0;transform:translateY(16px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.reevit-modal--success{border-color:var(--reevit-success)}.reevit-modal__header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid var(--reevit-border)}.reevit-modal__branding{display:flex;align-items:center;gap:8px}.reevit-modal__logo{height:18px;width:auto;object-fit:contain}.reevit-modal__close{width:28px;height:28px;border-radius:var(--reevit-radius-sm);border:1px solid var(--reevit-border);background:transparent;color:var(--reevit-text-secondary);font-size:14px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .15s ease}.reevit-modal__close:hover{background:var(--reevit-surface);color:var(--reevit-text);border-color:var(--reevit-text-secondary)}.reevit-modal__amount{padding:32px 20px;text-align:center;background:var(--reevit-surface);border-bottom:1px solid var(--reevit-border)}.reevit-modal__amount-label{display:block;font-size:11px;font-weight:500;text-transform:uppercase;letter-spacing:.1em;color:var(--reevit-text-secondary);margin-bottom:8px}.reevit-modal__amount-value{display:block;font-size:36px;font-weight:700;letter-spacing:-.03em;color:var(--reevit-text)}.reevit-modal__content{flex:1;overflow-y:auto;padding:20px}.reevit-modal__footer{padding:14px 20px;border-top:1px solid var(--reevit-border);text-align:center;background:var(--reevit-surface)}.reevit-modal__secured{font-size:11px;font-weight:500;color:var(--reevit-text-secondary);letter-spacing:.02em}.reevit-method-selector{margin-bottom:20px}.reevit-method-selector__label{font-size:12px;font-weight:500;color:var(--reevit-text);margin-bottom:12px;letter-spacing:.02em}.reevit-method-selector__options{display:flex;flex-direction:column;gap:8px}.reevit-method-option{display:flex;align-items:center;gap:12px;padding:14px 16px;background:transparent;border:1px solid var(--reevit-border);border-radius:var(--reevit-radius);cursor:pointer;transition:all .15s ease;text-align:left;width:100%}.reevit-method-option:hover{border-color:var(--reevit-text-secondary);background:var(--reevit-surface)}.reevit-method-option--selected{border-color:var(--reevit-text);background:var(--reevit-surface)}.reevit-method-option--disabled{opacity:.5;cursor:not-allowed}.reevit-method-option__icon{font-size:20px;flex-shrink:0;opacity:.8}.reevit-method-option__content{flex:1;min-width:0}.reevit-method-option__label{display:block;font-size:13px;font-weight:600;color:var(--reevit-text);letter-spacing:-.01em}.reevit-method-option__description{display:block;font-size:11px;color:var(--reevit-text-secondary);margin-top:2px;letter-spacing:.01em}.reevit-method-option__check{color:var(--reevit-text);flex-shrink:0;font-size:14px}.reevit-momo-form{display:flex;flex-direction:column;gap:16px}.reevit-momo-form__field{display:flex;flex-direction:column;gap:6px}.reevit-momo-form__label{font-size:12px;font-weight:500;color:var(--reevit-text);letter-spacing:.02em}.reevit-momo-form__input{padding:10px 14px;font-size:14px;border:1px solid var(--reevit-border);border-radius:var(--reevit-radius);background:transparent;color:var(--reevit-text);transition:all .15s ease;font-family:var(--reevit-font)}.reevit-momo-form__input:focus{outline:none;border-color:var(--reevit-text-secondary);background:var(--reevit-surface)}.reevit-momo-form__input--error{border-color:var(--reevit-error)}.reevit-momo-form__input--error:focus{border-color:var(--reevit-error)}.reevit-momo-form__formatted{font-size:11px;color:var(--reevit-text-secondary)}.reevit-momo-form__error{font-size:11px;color:var(--reevit-error)}.reevit-momo-form__networks{display:flex;gap:8px}.reevit-network-btn{flex:1;padding:10px 14px;font-size:12px;font-weight:600;border:1px solid var(--reevit-border);border-radius:var(--reevit-radius);background:transparent;color:var(--reevit-text);cursor:pointer;transition:all .15s ease;font-family:var(--reevit-font)}.reevit-network-btn:hover{border-color:var(--reevit-text);background:transparent}.reevit-network-btn:focus{outline:none;border-color:var(--reevit-text);box-shadow:0 0 0 2px var(--reevit-border)}.reevit-network-btn--selected{border-color:var(--reevit-text);background:var(--reevit-text);color:var(--reevit-background)}.reevit-network-btn--selected:hover{background:var(--reevit-text-secondary);border-color:var(--reevit-text-secondary)}.reevit-momo-form__actions{display:flex;gap:10px;margin-top:8px}.reevit-momo-form__hint{font-size:11px;color:var(--reevit-text-secondary);text-align:center;margin-top:4px}.reevit-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:10px 18px;font-size:13px;font-weight:600;border-radius:var(--reevit-radius);cursor:pointer;transition:all .15s ease;font-family:var(--reevit-font);border:none;min-height:42px;letter-spacing:-.01em}.reevit-btn--primary{flex:1;background:#fff;color:#0a0a0a;border:1px solid var(--reevit-border)}.reevit-btn--primary:hover:not(:disabled){background:#f5f5f5;border-color:var(--reevit-text-secondary)}.reevit-btn--primary:focus:not(:disabled){outline:none;border-color:var(--reevit-text);box-shadow:0 0 0 2px var(--reevit-border)}.reevit-btn--primary:active:not(:disabled){background:#eee;transform:scale(.98)}.reevit-btn--primary:disabled{opacity:.5;cursor:not-allowed}.reevit-btn--secondary{background:transparent;color:var(--reevit-text);border:1px solid var(--reevit-border)}.reevit-btn--secondary:hover:not(:disabled){background:transparent;border-color:var(--reevit-text)}.reevit-btn--secondary:focus:not(:disabled){outline:none;border-color:var(--reevit-text);box-shadow:0 0 0 2px var(--reevit-border)}.reevit-trigger-btn{padding:10px 18px;font-size:13px;font-weight:600;background:#fff;color:#0a0a0a;border:1px solid var(--reevit-border);border-radius:var(--reevit-radius);cursor:pointer;font-family:var(--reevit-font);transition:all .15s ease;letter-spacing:-.01em}.reevit-trigger-btn:hover{background:#f5f5f5;border-color:var(--reevit-text-secondary)}.reevit-trigger-btn:focus{outline:none;border-color:var(--reevit-text);box-shadow:0 0 0 2px var(--reevit-border)}@media(prefers-color-scheme:dark){.reevit-btn--primary{background:#fafafa;color:#0a0a0a}.reevit-btn--primary:hover:not(:disabled){background:#dedede}.reevit-btn--primary:active:not(:disabled){background:#cecece}.reevit-trigger-btn{background:#fafafa;color:#0a0a0a}.reevit-trigger-btn:hover{background:#dedede}}.reevit-loading,.reevit-success,.reevit-error{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px 20px;text-align:center;gap:12px}.reevit-success__icon{width:48px;height:48px;border-radius:50%;background:var(--reevit-success);color:#fff;font-size:24px;display:flex;align-items:center;justify-content:center;animation:reevit-pop .3s ease-out}.reevit-error__icon{width:48px;height:48px;border-radius:50%;background:var(--reevit-error);color:#fff;font-size:24px;display:flex;align-items:center;justify-content:center}@keyframes reevit-pop{0%{transform:scale(0)}50%{transform:scale(1.1)}to{transform:scale(1)}}.reevit-success h3,.reevit-error h3{font-size:14px;font-weight:600;color:var(--reevit-text);margin:0;letter-spacing:-.01em}.reevit-success p,.reevit-error p{font-size:12px;color:var(--reevit-text-secondary);margin:0}.reevit-spinner{width:20px;height:20px;border:2px solid var(--reevit-border);border-top-color:var(--reevit-text);border-radius:50%;animation:reevit-spin .7s linear infinite}@keyframes reevit-spin{to{transform:rotate(360deg)}}.reevit-loading .reevit-spinner{width:32px;height:32px;border-width:2px}.reevit-loading p{font-size:12px;color:var(--reevit-text-secondary);margin:0}.reevit-psp-bridge{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px 20px;text-align:center;gap:12px}.reevit-psp-bridge__loading p{font-size:12px;color:var(--reevit-text-secondary);margin:0}.reevit-method-step__actions{margin-top:16px}@media(max-width:480px){.reevit-modal{max-width:100%;max-height:100%;border-radius:var(--reevit-radius-lg) var(--reevit-radius-lg) 0 0;margin-top:auto}.reevit-modal__amount-value{font-size:28px}.reevit-momo-form__networks{flex-direction:column}.reevit-momo-form__actions{flex-direction:column-reverse}.reevit-btn--secondary{flex:none}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reevit/svelte",
3
- "version": "0.1.0",
3
+ "version": "0.2.2",
4
4
  "description": "Unified Payment Widget for Svelte Applications",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -46,7 +46,7 @@
46
46
  "svelte": "^4.0.0 || ^5.0.0"
47
47
  },
48
48
  "dependencies": {
49
- "@reevit/core": "^0.1.0"
49
+ "@reevit/core": "^0.2.2"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@sveltejs/vite-plugin-svelte": "^6.2.1",