mainstack-payments 0.2.4 → 0.2.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.
@@ -2013,12 +2013,12 @@ Ss.exports;
2013
2013
  return g(S(k));
2014
2014
  };
2015
2015
  }
2016
- var Xe = Array.prototype, le = Function.prototype, ut = Object.prototype, qt = U["__core-js_shared__"], T = le.toString, I = ut.hasOwnProperty, z = function() {
2016
+ var Je = Array.prototype, le = Function.prototype, ut = Object.prototype, qt = U["__core-js_shared__"], T = le.toString, I = ut.hasOwnProperty, z = function() {
2017
2017
  var g = /[^.]+$/.exec(qt && qt.keys && qt.keys.IE_PROTO || "");
2018
2018
  return g ? "Symbol(src)_1." + g : "";
2019
2019
  }(), H = ut.toString, de = T.call(Object), me = RegExp(
2020
2020
  "^" + T.call(I).replace($, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
2021
- ), Be = q ? U.Buffer : void 0, Je = U.Symbol, L = U.Uint8Array, Sn = Be ? Be.allocUnsafe : void 0, xn = ct(Object.getPrototypeOf, Object), wn = Object.create, En = ut.propertyIsEnumerable, Wr = Xe.splice, yt = Je ? Je.toStringTag : void 0, Ln = function() {
2021
+ ), Be = q ? U.Buffer : void 0, Ze = U.Symbol, L = U.Uint8Array, Sn = Be ? Be.allocUnsafe : void 0, xn = ct(Object.getPrototypeOf, Object), wn = Object.create, En = ut.propertyIsEnumerable, Wr = Je.splice, yt = Ze ? Ze.toStringTag : void 0, Ln = function() {
2022
2022
  try {
2023
2023
  var g = Sl(Object, "defineProperty");
2024
2024
  return g({}, "", {}), g;
@@ -5433,43 +5433,43 @@ var { defineMultiStyleConfig: xE, definePartsStyle: rs } = De(zw.keys), lo = ot(
5433
5433
  variant: "line",
5434
5434
  colorScheme: "blue"
5435
5435
  }
5436
- }), Ze = b1("badge", ["bg", "color", "shadow"]), ZE = {
5436
+ }), Xe = b1("badge", ["bg", "color", "shadow"]), ZE = {
5437
5437
  px: 1,
5438
5438
  textTransform: "uppercase",
5439
5439
  fontSize: "xs",
5440
5440
  borderRadius: "sm",
5441
5441
  fontWeight: "bold",
5442
- bg: Ze.bg.reference,
5443
- color: Ze.color.reference,
5444
- boxShadow: Ze.shadow.reference
5442
+ bg: Xe.bg.reference,
5443
+ color: Xe.color.reference,
5444
+ boxShadow: Xe.shadow.reference
5445
5445
  }, XE = (e) => {
5446
5446
  const { colorScheme: t, theme: n } = e, r = Ta(`${t}.500`, 0.6)(n);
5447
5447
  return {
5448
- [Ze.bg.variable]: `colors.${t}.500`,
5449
- [Ze.color.variable]: "colors.white",
5448
+ [Xe.bg.variable]: `colors.${t}.500`,
5449
+ [Xe.color.variable]: "colors.white",
5450
5450
  _dark: {
5451
- [Ze.bg.variable]: r,
5452
- [Ze.color.variable]: "colors.whiteAlpha.800"
5451
+ [Xe.bg.variable]: r,
5452
+ [Xe.color.variable]: "colors.whiteAlpha.800"
5453
5453
  }
5454
5454
  };
5455
5455
  }, JE = (e) => {
5456
5456
  const { colorScheme: t, theme: n } = e, r = Ta(`${t}.200`, 0.16)(n);
5457
5457
  return {
5458
- [Ze.bg.variable]: `colors.${t}.100`,
5459
- [Ze.color.variable]: `colors.${t}.800`,
5458
+ [Xe.bg.variable]: `colors.${t}.100`,
5459
+ [Xe.color.variable]: `colors.${t}.800`,
5460
5460
  _dark: {
5461
- [Ze.bg.variable]: r,
5462
- [Ze.color.variable]: `colors.${t}.200`
5461
+ [Xe.bg.variable]: r,
5462
+ [Xe.color.variable]: `colors.${t}.200`
5463
5463
  }
5464
5464
  };
5465
5465
  }, QE = (e) => {
5466
5466
  const { colorScheme: t, theme: n } = e, r = Ta(`${t}.200`, 0.8)(n);
5467
5467
  return {
5468
- [Ze.color.variable]: `colors.${t}.500`,
5468
+ [Xe.color.variable]: `colors.${t}.500`,
5469
5469
  _dark: {
5470
- [Ze.color.variable]: r
5470
+ [Xe.color.variable]: r
5471
5471
  },
5472
- [Ze.shadow.variable]: `inset 0 0 0px 1px ${Ze.color.reference}`
5472
+ [Xe.shadow.variable]: `inset 0 0 0px 1px ${Xe.color.reference}`
5473
5473
  };
5474
5474
  }, eC = {
5475
5475
  solid: XE,
@@ -5486,9 +5486,9 @@ var { defineMultiStyleConfig: xE, definePartsStyle: rs } = De(zw.keys), lo = ot(
5486
5486
  fontWeight: "medium",
5487
5487
  lineHeight: 1.2,
5488
5488
  outline: 0,
5489
- [Yf.variable]: Ze.color.reference,
5490
- [qf.variable]: Ze.bg.reference,
5491
- [Fl.variable]: Ze.shadow.reference,
5489
+ [Yf.variable]: Xe.color.reference,
5490
+ [qf.variable]: Xe.bg.reference,
5491
+ [Fl.variable]: Xe.shadow.reference,
5492
5492
  color: Yf.reference,
5493
5493
  bg: qf.reference,
5494
5494
  boxShadow: Fl.reference,
@@ -7151,9 +7151,9 @@ var TT = {
7151
7151
  fontSize: "sm",
7152
7152
  px: "0.2em",
7153
7153
  borderRadius: "sm",
7154
- bg: Ze.bg.reference,
7155
- color: Ze.color.reference,
7156
- boxShadow: Ze.shadow.reference
7154
+ bg: Xe.bg.reference,
7155
+ color: Xe.color.reference,
7156
+ boxShadow: Xe.shadow.reference
7157
7157
  }, Fk = {
7158
7158
  baseStyle: $k,
7159
7159
  variants: _k,
@@ -14233,18 +14233,18 @@ var Ly = xd({}, function(e) {
14233
14233
  ssr: typeof document < "u"
14234
14234
  }), dR = /* @__PURE__ */ Kt(void 0), fR = [], Vy = /* @__PURE__ */ R.forwardRef(function(t, n) {
14235
14235
  var r, a = R.useState(), o = a[0], i = a[1], s = R.useRef(), l = R.useRef(!1), c = R.useRef(null), u = R.useState({}), d = u[1], f = t.children, p = t.disabled, m = p === void 0 ? !1 : p, h = t.noFocusGuards, v = h === void 0 ? !1 : h, y = t.persistentFocus, w = y === void 0 ? !1 : y, E = t.crossFrame, _ = E === void 0 ? !0 : E, C = t.autoFocus, M = C === void 0 ? !0 : C, P = t.allowTextSelection, B = t.group, D = t.className, oe = t.whiteList, K = t.hasPositiveIndices, re = t.shards, pe = re === void 0 ? fR : re, Y = t.as, ce = Y === void 0 ? "div" : Y, ae = t.lockProps, ue = ae === void 0 ? {} : ae, Se = t.sideCar, Pe = t.returnFocus, $ = Pe === void 0 ? !1 : Pe, F = t.focusOptions, V = t.onActivation, O = t.onDeactivation, W = R.useState({}), ee = W[0], U = R.useCallback(function(ct) {
14236
- var Xe = ct.captureFocusRestore;
14236
+ var Je = ct.captureFocusRestore;
14237
14237
  if (!c.current) {
14238
14238
  var le, ut = (le = document) == null ? void 0 : le.activeElement;
14239
- c.current = ut, ut !== document.body && (c.current = Xe(ut));
14239
+ c.current = ut, ut !== document.body && (c.current = Je(ut));
14240
14240
  }
14241
14241
  s.current && V && V(s.current), l.current = !0, d();
14242
14242
  }, [V]), G = R.useCallback(function() {
14243
14243
  l.current = !1, O && O(s.current), d();
14244
14244
  }, [O]), te = R.useCallback(function(ct) {
14245
- var Xe = c.current;
14246
- if (Xe) {
14247
- var le = (typeof Xe == "function" ? Xe() : Xe) || document.body, ut = typeof $ == "function" ? $(le) : $;
14245
+ var Je = c.current;
14246
+ if (Je) {
14247
+ var le = (typeof Je == "function" ? Je() : Je) || document.body, ut = typeof $ == "function" ? $(le) : $;
14248
14248
  if (ut) {
14249
14249
  var qt = typeof ut == "object" ? ut : void 0;
14250
14250
  c.current = null, ct ? Promise.resolve().then(function() {
@@ -17611,8 +17611,8 @@ function Vj(e) {
17611
17611
  return new Promise(function(me, Be) {
17612
17612
  de.then(function() {
17613
17613
  me(fr);
17614
- }, function(Je) {
17615
- Je.name === "ValidationError" ? me(Uj(Je)) : (process.env.NODE_ENV !== "production" && console.warn("Warning: An unhandled error was caught during validation in <Formik validationSchema />", Je), Be(Je));
17614
+ }, function(Ze) {
17615
+ Ze.name === "ValidationError" ? me(Uj(Ze)) : (process.env.NODE_ENV !== "production" && console.warn("Warning: An unhandled error was caught during validation in <Formik validationSchema />", Ze), Be(Ze));
17616
17616
  });
17617
17617
  });
17618
17618
  }, [f.validationSchema]), oe = fe(function(T, I) {
@@ -17789,8 +17789,8 @@ function Vj(e) {
17789
17789
  var z = I, H = T, de;
17790
17790
  if (!Ec(T)) {
17791
17791
  T.persist && T.persist();
17792
- var me = T.target ? T.target : T.currentTarget, Be = me.type, Je = me.name, L = me.id, Sn = me.value, xn = me.checked, wn = me.outerHTML, En = me.options, Wr = me.multiple;
17793
- z = I || Je || L, !z && process.env.NODE_ENV !== "production" && Vm({
17792
+ var me = T.target ? T.target : T.currentTarget, Be = me.type, Ze = me.name, L = me.id, Sn = me.value, xn = me.checked, wn = me.outerHTML, En = me.options, Wr = me.multiple;
17793
+ z = I || Ze || L, !z && process.env.NODE_ENV !== "production" && Vm({
17794
17794
  htmlContent: wn,
17795
17795
  documentationAnchorLink: "handlechange-e-reactchangeeventany--void",
17796
17796
  handlerName: "handleChange"
@@ -17922,7 +17922,7 @@ function Vj(e) {
17922
17922
  return F(T, z);
17923
17923
  }
17924
17924
  };
17925
- }, [V, ee, F]), Xe = fe(function(T) {
17925
+ }, [V, ee, F]), Je = fe(function(T) {
17926
17926
  var I = ul(T), z = I ? T.name : T, H = Ft(M.values, z), de = {
17927
17927
  name: z,
17928
17928
  value: H,
@@ -17930,8 +17930,8 @@ function Vj(e) {
17930
17930
  onBlur: G
17931
17931
  };
17932
17932
  if (I) {
17933
- var me = T.type, Be = T.value, Je = T.as, L = T.multiple;
17934
- me === "checkbox" ? Be === void 0 ? de.checked = !!H : (de.checked = !!(Array.isArray(H) && ~H.indexOf(Be)), de.value = Be) : me === "radio" ? (de.checked = H === Be, de.value = Be) : Je === "select" && L && (de.value = de.value || [], de.multiple = !0);
17933
+ var me = T.type, Be = T.value, Ze = T.as, L = T.multiple;
17934
+ me === "checkbox" ? Be === void 0 ? de.checked = !!H : (de.checked = !!(Array.isArray(H) && ~H.indexOf(Be)), de.value = Be) : me === "radio" ? (de.checked = H === Be, de.value = Be) : Ze === "select" && L && (de.value = de.value || [], de.multiple = !0);
17935
17935
  }
17936
17936
  return de;
17937
17937
  }, [G, W, M.values]), le = at(function() {
@@ -17964,7 +17964,7 @@ function Vj(e) {
17964
17964
  dirty: le,
17965
17965
  unregisterField: ue,
17966
17966
  registerField: ae,
17967
- getFieldProps: Xe,
17967
+ getFieldProps: Je,
17968
17968
  getFieldMeta: Gr,
17969
17969
  getFieldHelpers: ct,
17970
17970
  validateOnBlur: a,
@@ -26102,7 +26102,7 @@ const ez = "Payment Completed", tz = ({
26102
26102
  fullname: zt().required("Please enter your Fullname"),
26103
26103
  currency: zt().required("Please select a currency."),
26104
26104
  ...a
26105
- }), { getAmount: Gr, getCountryCurrency: ct } = QL(d), Xe = typeof window < "u" ? JSON.parse(window.localStorage.getItem("userIp")) : "", { data: le, isLoading: ut } = aD(
26105
+ }), { getAmount: Gr, getCountryCurrency: ct } = QL(d), Je = typeof window < "u" ? JSON.parse(window.localStorage.getItem("userIp")) : "", { data: le, isLoading: ut } = aD(
26106
26106
  {
26107
26107
  account_id: h,
26108
26108
  amount: ce,
@@ -26115,7 +26115,7 @@ const ez = "Payment Completed", tz = ({
26115
26115
  data: H,
26116
26116
  refetch: de,
26117
26117
  isLoading: me
26118
- } = iD(O == null ? void 0 : O.reference, re), [Be, Je] = se(!1), L = Vj({
26118
+ } = iD(O == null ? void 0 : O.reference, re), [Be, Ze] = se(!1), L = Vj({
26119
26119
  initialValues: {
26120
26120
  email: (i == null ? void 0 : i.email) ?? "",
26121
26121
  fullname: (i == null ? void 0 : i.fullname) ?? "",
@@ -26198,7 +26198,7 @@ const ez = "Payment Completed", tz = ({
26198
26198
  L.setFieldValue(ie, tt);
26199
26199
  }
26200
26200
  }));
26201
- const xn = ((ni = le == null ? void 0 : le.payload) == null ? void 0 : ni.local_amount) ?? 0, wn = ((ri = le == null ? void 0 : le.payload) == null ? void 0 : ri.local_transaction_fee) ?? 0, En = ((ai = le == null ? void 0 : le.payload) == null ? void 0 : ai.local_international_card_fee) ?? 0, Wr = ((oi = le == null ? void 0 : le.payload) == null ? void 0 : oi.dollar_international_card_fee) ?? 0, yt = parseFloat(xn) + parseFloat(wn) + (d !== Hn.NGN && (L.values.country !== "" || (Xe == null ? void 0 : Xe.currency) !== d) && ct((An = L == null ? void 0 : L.values) == null ? void 0 : An.country) !== d ? Number(En) : 0), Ln = L.values.country !== "" ? ct((ii = L == null ? void 0 : L.values) == null ? void 0 : ii.country) !== d : (Xe == null ? void 0 : Xe.currency) !== d, Dt = at(() => {
26201
+ const xn = ((ni = le == null ? void 0 : le.payload) == null ? void 0 : ni.local_amount) ?? 0, wn = ((ri = le == null ? void 0 : le.payload) == null ? void 0 : ri.local_transaction_fee) ?? 0, En = ((ai = le == null ? void 0 : le.payload) == null ? void 0 : ai.local_international_card_fee) ?? 0, Wr = ((oi = le == null ? void 0 : le.payload) == null ? void 0 : oi.dollar_international_card_fee) ?? 0, yt = parseFloat(xn) + parseFloat(wn) + (d !== Hn.NGN && (L.values.country !== "" || (Je == null ? void 0 : Je.currency) !== d) && ct((An = L == null ? void 0 : L.values) == null ? void 0 : An.country) !== d ? Number(En) : 0), Ln = L.values.country !== "" ? ct((ii = L == null ? void 0 : L.values) == null ? void 0 : ii.country) !== d : (Je == null ? void 0 : Je.currency) !== d, Dt = at(() => {
26202
26202
  var ie;
26203
26203
  return d === Hn.UGX ? Math.ceil(yt) * 100 : Math.round(
26204
26204
  yt * ((ie = le == null ? void 0 : le.payload) != null && ie.is_zero_decimal_currency ? 1 : 100)
@@ -26264,12 +26264,14 @@ const ez = "Payment Completed", tz = ({
26264
26264
  }, [d]);
26265
26265
  const ml = async () => {
26266
26266
  const ie = Su();
26267
- Y(ie), Je(!0);
26267
+ Y(ie), Ze(!0);
26268
26268
  let tt = {};
26269
26269
  if (l) {
26270
26270
  const ht = await l(L.values);
26271
- if (tt = await L.validateForm(), ht.terminate)
26271
+ if (tt = await L.validateForm(), ht.terminate) {
26272
+ Ze(!1);
26272
26273
  return;
26274
+ }
26273
26275
  }
26274
26276
  if (Object.keys(tt).length <= 0) {
26275
26277
  if (U(!0), Dt === 0) {
@@ -26281,7 +26283,7 @@ const ez = "Payment Completed", tz = ({
26281
26283
  });
26282
26284
  return;
26283
26285
  }
26284
- Je(!1), qt(
26286
+ Ze(!1), qt(
26285
26287
  {
26286
26288
  amount: Dt,
26287
26289
  reference: ie,
@@ -26504,15 +26506,15 @@ const ez = "Payment Completed", tz = ({
26504
26506
  type: "submit",
26505
26507
  isLoading: Sn,
26506
26508
  onClick: async (ie) => {
26507
- if (ie.preventDefault(), Je(!0), l) {
26509
+ if (ie.preventDefault(), Ze(!0), l) {
26508
26510
  const tt = await l(L.values);
26509
26511
  if (await L.validateForm(), tt != null && tt.terminate) {
26510
- Je(!1);
26512
+ Ze(!1), L.setSubmitting(!1);
26511
26513
  return;
26512
26514
  }
26513
- L.submitForm(), Je(!1);
26515
+ L.submitForm(), Ze(!1);
26514
26516
  } else
26515
- L.submitForm(), Je(!1);
26517
+ L.submitForm(), Ze(!1);
26516
26518
  },
26517
26519
  _hover: {
26518
26520
  opacity: 0.8,
@@ -26630,7 +26632,7 @@ const ez = "Payment Completed", tz = ({
26630
26632
  }
26631
26633
  )
26632
26634
  ] }),
26633
- d !== Hn.NGN && (L.values.country !== "" || (Xe == null ? void 0 : Xe.currency) !== d) && ct((Kr = L == null ? void 0 : L.values) == null ? void 0 : Kr.country) !== d && /* @__PURE__ */ J(nt, { width: "100%", justifyContent: "space-between", children: [
26635
+ d !== Hn.NGN && (L.values.country !== "" || (Je == null ? void 0 : Je.currency) !== d) && ct((Kr = L == null ? void 0 : L.values) == null ? void 0 : Kr.country) !== d && /* @__PURE__ */ J(nt, { width: "100%", justifyContent: "space-between", children: [
26634
26636
  /* @__PURE__ */ J(nt, { alignItems: "center", children: [
26635
26637
  /* @__PURE__ */ b(
26636
26638
  rt,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mainstack-payments",
3
3
  "type": "module",
4
- "version": "0.2.4",
4
+ "version": "0.2.6",
5
5
  "main": "build/mainstack-payments.js",
6
6
  "types": "build/src/index.d.ts",
7
7
  "files": [