mainstack-payments 2.0.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import { jsxs as m, jsx as a } from "react/jsx-runtime";
2
- import { u as I, a as A, v as N, C as S } from "./index-BWm87vgg.js";
2
+ import { u as I, a as A, v as N, C as S } from "./index-Da917IzI.js";
3
3
  import { toast as z, BodyText as B, ChevronRightIcon as E } from "mainstack-design-system";
4
- import { u as H } from "./payments-CjiNVkeO.js";
4
+ import { u as H } from "./payments-B3Hm80pK.js";
5
5
  import { memo as $, useState as b, useCallback as P } from "react";
6
6
  const j = (i) => /* @__PURE__ */ m(
7
7
  "svg",
@@ -1,7 +1,7 @@
1
1
  import { jsxs as l, jsx as a } from "react/jsx-runtime";
2
- import { u as x, a as v, C as I, v as S } from "./index-BWm87vgg.js";
2
+ import { u as x, a as v, C as I, v as S } from "./index-Da917IzI.js";
3
3
  import { BodyText as E, ChevronRightIcon as z, toast as N } from "mainstack-design-system";
4
- import { u as $ } from "./payments-CjiNVkeO.js";
4
+ import { u as $ } from "./payments-B3Hm80pK.js";
5
5
  import { useState as b } from "react";
6
6
  const j = (i) => /* @__PURE__ */ l(
7
7
  "svg",
@@ -1,7 +1,7 @@
1
1
  import { jsx as s, Fragment as Q, jsxs as p } from "react/jsx-runtime";
2
2
  import { ModalRoot as ol, ModalPortal as cl, ModalOverlay as dl, ModalBody as ul, ModalContentSlot as ml, ModalContentHeader as pl, ModalClose as gl, ModalContentMain as fl, HeadlineText as Yt, BodyText as P, ModalContentFooter as hl, Button as Ba, FormItem as Ea, FormLabel as $e, Input as Ia, FormErrorStatus as xt, PhoneNumberInput as zs, Spinner as Vs, ButtonRoot as qt, ButtonLabel as Jt, ButtonIcon as Xt, ChevronRightIcon as ia, useMatchMedia as lt, useDisclosure as Da, KeyboardBackSpaceIcon as Hs, KeyboardArrowDownIcon as It, toast as Ae, MainstackDesignSystemProvider as Zs, Toaster as Ws, TooltipRoot as ur, TooltipTrigger as mr, InfoIcon as pr, TooltipContent as gr, TooltipHeader as fr, TooltipTitle as hr, TooltipBody as yr, CountrySelect as Ys, LockIcon as qs, CancelIcon as vr } from "mainstack-design-system";
3
3
  import { useState as G, useEffect as le, useRef as pe, useCallback as Y, useMemo as st, createContext as Js, useLayoutEffect as Xs, forwardRef as yl, createElement as Qs, useContext as ei, lazy as ca, useImperativeHandle as ai, Suspense as aa, isValidElement as ti, memo as ni } from "react";
4
- import { g as vl, r as ri, l as li, E as si, u as bl, a as Sl, C as br, b as ii, c as oi } from "./payments-CjiNVkeO.js";
4
+ import { g as vl, r as ri, l as li, E as si, u as bl, a as Sl, C as br, b as ii, c as oi } from "./payments-B3Hm80pK.js";
5
5
  import ci from "axios";
6
6
  import './index.css';const Qt = ({
7
7
  queryFn: e,
@@ -878,7 +878,7 @@ function gu(e) {
878
878
  function Wl(e) {
879
879
  return Ka(e) ? Hl(e, pu) : dn(e) ? [e] : Bl(mu(gu(e)));
880
880
  }
881
- var Yl = ri, fu = {
881
+ var Yl = ri(), fu = {
882
882
  $$typeof: !0,
883
883
  render: !0,
884
884
  defaultProps: !0,
@@ -9018,7 +9018,7 @@ const Im = (e) => /* @__PURE__ */ p(
9018
9018
  },
9019
9019
  children: /* @__PURE__ */ s("div", { className: "mpl:overflow-hidden", children: a })
9020
9020
  }
9021
- ), jm = ca(() => Promise.resolve().then(() => Wm)), Rm = ca(() => Promise.resolve().then(() => ap)), Lm = ca(() => import("./CashAppPayment-ByktxjXA.js")), Km = ca(() => import("./CryptoPayments-BkqcfMtz.js")), zm = ca(() => Promise.resolve().then(() => Jm)), Vm = ca(
9021
+ ), jm = ca(() => Promise.resolve().then(() => Wm)), Rm = ca(() => Promise.resolve().then(() => ap)), Lm = ca(() => import("./CashAppPayment-B8Nptk48.js")), Km = ca(() => import("./CryptoPayments-T-b2WqT2.js")), zm = ca(() => Promise.resolve().then(() => Jm)), Vm = ca(
9022
9022
  () => Promise.resolve().then(() => sp)
9023
9023
  ), Hm = ca(
9024
9024
  () => Promise.resolve().then(() => np).then((e) => ({
@@ -1,4 +1,4 @@
1
- import { b as e, c as t, S as n, M as y, d as P, P as m, e as r, f as o, W as c, g as u, h as i, i as k, u as d, a as l, j as M, k as C } from "./index-BWm87vgg.js";
1
+ import { b as e, c as t, S as n, M as y, d as P, P as m, e as r, f as o, W as c, g as u, h as i, i as k, u as d, a as l, j as M, k as C } from "./index-Da917IzI.js";
2
2
  export {
3
3
  e as CheckoutForm,
4
4
  t as ContactForm,
@@ -1,8 +1,8 @@
1
1
  import _ from "react";
2
- function Ke(r) {
2
+ function Ge(r) {
3
3
  return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
4
4
  }
5
- var he = { exports: {} }, Ee = { exports: {} }, R = {};
5
+ var Ee = { exports: {} }, ue = { exports: {} }, R = {};
6
6
  /** @license React v16.13.1
7
7
  * react-is.production.min.js
8
8
  *
@@ -12,7 +12,7 @@ var he = { exports: {} }, Ee = { exports: {} }, R = {};
12
12
  * LICENSE file in the root directory of this source tree.
13
13
  */
14
14
  var Te;
15
- function Ge() {
15
+ function He() {
16
16
  if (Te) return R;
17
17
  Te = 1;
18
18
  var r = typeof Symbol == "function" && Symbol.for, e = r ? Symbol.for("react.element") : 60103, t = r ? Symbol.for("react.portal") : 60106, n = r ? Symbol.for("react.fragment") : 60107, c = r ? Symbol.for("react.strict_mode") : 60108, a = r ? Symbol.for("react.profiler") : 60114, p = r ? Symbol.for("react.provider") : 60109, l = r ? Symbol.for("react.context") : 60110, f = r ? Symbol.for("react.async_mode") : 60111, h = r ? Symbol.for("react.concurrent_mode") : 60111, d = r ? Symbol.for("react.forward_ref") : 60112, y = r ? Symbol.for("react.suspense") : 60113, g = r ? Symbol.for("react.suspense_list") : 60120, A = r ? Symbol.for("react.memo") : 60115, I = r ? Symbol.for("react.lazy") : 60116, O = r ? Symbol.for("react.block") : 60121, k = r ? Symbol.for("react.fundamental") : 60117, Y = r ? Symbol.for("react.responder") : 60118, X = r ? Symbol.for("react.scope") : 60119;
@@ -87,7 +87,7 @@ var x = {};
87
87
  * LICENSE file in the root directory of this source tree.
88
88
  */
89
89
  var Pe;
90
- function He() {
90
+ function Xe() {
91
91
  return Pe || (Pe = 1, process.env.NODE_ENV !== "production" && function() {
92
92
  var r = typeof Symbol == "function" && Symbol.for, e = r ? Symbol.for("react.element") : 60103, t = r ? Symbol.for("react.portal") : 60106, n = r ? Symbol.for("react.fragment") : 60107, c = r ? Symbol.for("react.strict_mode") : 60108, a = r ? Symbol.for("react.profiler") : 60114, p = r ? Symbol.for("react.provider") : 60109, l = r ? Symbol.for("react.context") : 60110, f = r ? Symbol.for("react.async_mode") : 60111, h = r ? Symbol.for("react.concurrent_mode") : 60111, d = r ? Symbol.for("react.forward_ref") : 60112, y = r ? Symbol.for("react.suspense") : 60113, g = r ? Symbol.for("react.suspense_list") : 60120, A = r ? Symbol.for("react.memo") : 60115, I = r ? Symbol.for("react.lazy") : 60116, O = r ? Symbol.for("react.block") : 60121, k = r ? Symbol.for("react.fundamental") : 60117, Y = r ? Symbol.for("react.responder") : 60118, X = r ? Symbol.for("react.scope") : 60119;
93
93
  function $(u) {
@@ -169,17 +169,19 @@ function He() {
169
169
  x.AsyncMode = s, x.ConcurrentMode = z, x.ContextConsumer = ee, x.ContextProvider = re, x.Element = te, x.ForwardRef = K, x.Fragment = V, x.Lazy = G, x.Memo = ne, x.Portal = J, x.Profiler = W, x.StrictMode = F, x.Suspense = D, x.isAsyncMode = Z, x.isConcurrentMode = o, x.isContextConsumer = i, x.isContextProvider = C, x.isElement = E, x.isForwardRef = v, x.isFragment = S, x.isLazy = m, x.isMemo = b, x.isPortal = T, x.isProfiler = w, x.isStrictMode = P, x.isSuspense = U, x.isValidElementType = $, x.typeOf = M;
170
170
  }()), x;
171
171
  }
172
- process.env.NODE_ENV === "production" ? Ee.exports = Ge() : Ee.exports = He();
173
- var qe = Ee.exports;
172
+ var Oe;
173
+ function We() {
174
+ return Oe || (Oe = 1, process.env.NODE_ENV === "production" ? ue.exports = He() : ue.exports = Xe()), ue.exports;
175
+ }
174
176
  /*
175
177
  object-assign
176
178
  (c) Sindre Sorhus
177
179
  @license MIT
178
180
  */
179
- var le, Oe;
180
- function Xe() {
181
- if (Oe) return le;
182
- Oe = 1;
181
+ var pe, Re;
182
+ function Ze() {
183
+ if (Re) return pe;
184
+ Re = 1;
183
185
  var r = Object.getOwnPropertySymbols, e = Object.prototype.hasOwnProperty, t = Object.prototype.propertyIsEnumerable;
184
186
  function n(a) {
185
187
  if (a == null)
@@ -208,7 +210,7 @@ function Xe() {
208
210
  return !1;
209
211
  }
210
212
  }
211
- return le = c() ? Object.assign : function(a, p) {
213
+ return pe = c() ? Object.assign : function(a, p) {
212
214
  for (var l, f = n(a), h, d = 1; d < arguments.length; d++) {
213
215
  l = Object(arguments[d]);
214
216
  for (var y in l)
@@ -220,27 +222,27 @@ function Xe() {
220
222
  }
221
223
  }
222
224
  return f;
223
- }, le;
225
+ }, pe;
224
226
  }
225
- var pe, Re;
227
+ var de, xe;
226
228
  function Ce() {
227
- if (Re) return pe;
228
- Re = 1;
229
+ if (xe) return de;
230
+ xe = 1;
229
231
  var r = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
230
- return pe = r, pe;
231
- }
232
- var de, xe;
233
- function We() {
234
- return xe || (xe = 1, de = Function.call.bind(Object.prototype.hasOwnProperty)), de;
232
+ return de = r, de;
235
233
  }
236
234
  var ve, we;
237
- function Ze() {
238
- if (we) return ve;
239
- we = 1;
235
+ function Ye() {
236
+ return we || (we = 1, ve = Function.call.bind(Object.prototype.hasOwnProperty)), ve;
237
+ }
238
+ var ye, _e;
239
+ function Qe() {
240
+ if (_e) return ye;
241
+ _e = 1;
240
242
  var r = function() {
241
243
  };
242
244
  if (process.env.NODE_ENV !== "production") {
243
- var e = Ce(), t = {}, n = We();
245
+ var e = Ce(), t = {}, n = Ye();
244
246
  r = function(a) {
245
247
  var p = "Warning: " + a;
246
248
  typeof console < "u" && console.error(p);
@@ -280,13 +282,13 @@ function Ze() {
280
282
  }
281
283
  return c.resetWarningCache = function() {
282
284
  process.env.NODE_ENV !== "production" && (t = {});
283
- }, ve = c, ve;
285
+ }, ye = c, ye;
284
286
  }
285
- var ye, _e;
286
- function Qe() {
287
- if (_e) return ye;
288
- _e = 1;
289
- var r = qe, e = Xe(), t = Ce(), n = We(), c = Ze(), a = function() {
287
+ var me, Ae;
288
+ function er() {
289
+ if (Ae) return me;
290
+ Ae = 1;
291
+ var r = We(), e = Ze(), t = Ce(), n = Ye(), c = Qe(), a = function() {
290
292
  };
291
293
  process.env.NODE_ENV !== "production" && (a = function(l) {
292
294
  var f = "Warning: " + l;
@@ -299,7 +301,7 @@ function Qe() {
299
301
  function p() {
300
302
  return null;
301
303
  }
302
- return ye = function(l, f) {
304
+ return me = function(l, f) {
303
305
  var h = typeof Symbol == "function" && Symbol.iterator, d = "@@iterator";
304
306
  function y(o) {
305
307
  var i = o && (h && o[h] || o[d]);
@@ -601,18 +603,18 @@ Valid keys: ` + JSON.stringify(Object.keys(o), null, " ")
601
603
  return !o.constructor || !o.constructor.name ? g : o.constructor.name;
602
604
  }
603
605
  return A.checkPropTypes = c, A.resetWarningCache = c.resetWarningCache, A.PropTypes = A, A;
604
- }, ye;
606
+ }, me;
605
607
  }
606
- var me, Ae;
607
- function er() {
608
- if (Ae) return me;
609
- Ae = 1;
608
+ var he, je;
609
+ function rr() {
610
+ if (je) return he;
611
+ je = 1;
610
612
  var r = Ce();
611
613
  function e() {
612
614
  }
613
615
  function t() {
614
616
  }
615
- return t.resetWarningCache = e, me = function() {
617
+ return t.resetWarningCache = e, he = function() {
616
618
  function n(p, l, f, h, d, y) {
617
619
  if (y !== r) {
618
620
  var g = new Error(
@@ -649,16 +651,16 @@ function er() {
649
651
  resetWarningCache: e
650
652
  };
651
653
  return a.PropTypes = a, a;
652
- }, me;
654
+ }, he;
653
655
  }
654
656
  if (process.env.NODE_ENV !== "production") {
655
- var rr = qe, tr = !0;
656
- he.exports = Qe()(rr.isElement, tr);
657
+ var tr = We(), nr = !0;
658
+ Ee.exports = er()(tr.isElement, nr);
657
659
  } else
658
- he.exports = er()();
659
- var nr = he.exports;
660
- const j = /* @__PURE__ */ Ke(nr);
661
- function je(r, e) {
660
+ Ee.exports = rr()();
661
+ var or = Ee.exports;
662
+ const j = /* @__PURE__ */ Ge(or);
663
+ function ke(r, e) {
662
664
  var t = Object.keys(r);
663
665
  if (Object.getOwnPropertySymbols) {
664
666
  var n = Object.getOwnPropertySymbols(r);
@@ -668,26 +670,26 @@ function je(r, e) {
668
670
  }
669
671
  return t;
670
672
  }
671
- function ke(r) {
673
+ function Ie(r) {
672
674
  for (var e = 1; e < arguments.length; e++) {
673
675
  var t = arguments[e] != null ? arguments[e] : {};
674
- e % 2 ? je(Object(t), !0).forEach(function(n) {
675
- Ye(r, n, t[n]);
676
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(t)) : je(Object(t)).forEach(function(n) {
676
+ e % 2 ? ke(Object(t), !0).forEach(function(n) {
677
+ De(r, n, t[n]);
678
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(t)) : ke(Object(t)).forEach(function(n) {
677
679
  Object.defineProperty(r, n, Object.getOwnPropertyDescriptor(t, n));
678
680
  });
679
681
  }
680
682
  return r;
681
683
  }
682
- function ce(r) {
684
+ function fe(r) {
683
685
  "@babel/helpers - typeof";
684
- return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? ce = function(e) {
686
+ return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? fe = function(e) {
685
687
  return typeof e;
686
- } : ce = function(e) {
688
+ } : fe = function(e) {
687
689
  return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
688
- }, ce(r);
690
+ }, fe(r);
689
691
  }
690
- function Ye(r, e, t) {
692
+ function De(r, e, t) {
691
693
  return e in r ? Object.defineProperty(r, e, {
692
694
  value: t,
693
695
  enumerable: !0,
@@ -695,13 +697,13 @@ function Ye(r, e, t) {
695
697
  writable: !0
696
698
  }) : r[e] = t, r;
697
699
  }
698
- function De(r, e) {
699
- return or(r) || ar(r, e) || ir(r, e) || ur();
700
+ function Ue(r, e) {
701
+ return ar(r) || ir(r, e) || ur(r, e) || sr();
700
702
  }
701
- function or(r) {
703
+ function ar(r) {
702
704
  if (Array.isArray(r)) return r;
703
705
  }
704
- function ar(r, e) {
706
+ function ir(r, e) {
705
707
  var t = r && (typeof Symbol < "u" && r[Symbol.iterator] || r["@@iterator"]);
706
708
  if (t != null) {
707
709
  var n = [], c = !0, a = !1, p, l;
@@ -720,20 +722,20 @@ function ar(r, e) {
720
722
  return n;
721
723
  }
722
724
  }
723
- function ir(r, e) {
725
+ function ur(r, e) {
724
726
  if (r) {
725
- if (typeof r == "string") return Ie(r, e);
727
+ if (typeof r == "string") return Me(r, e);
726
728
  var t = Object.prototype.toString.call(r).slice(8, -1);
727
729
  if (t === "Object" && r.constructor && (t = r.constructor.name), t === "Map" || t === "Set") return Array.from(r);
728
- if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return Ie(r, e);
730
+ if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return Me(r, e);
729
731
  }
730
732
  }
731
- function Ie(r, e) {
733
+ function Me(r, e) {
732
734
  (e == null || e > r.length) && (e = r.length);
733
735
  for (var t = 0, n = new Array(e); t < e; t++) n[t] = r[t];
734
736
  return n;
735
737
  }
736
- function ur() {
738
+ function sr() {
737
739
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
738
740
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
739
741
  }
@@ -758,17 +760,17 @@ var N = function(e, t, n) {
758
760
  t.current = e;
759
761
  }, [e]), t.current;
760
762
  }, Q = function(e) {
761
- return e !== null && ce(e) === "object";
762
- }, sr = function(e) {
763
- return Q(e) && typeof e.then == "function";
763
+ return e !== null && fe(e) === "object";
764
764
  }, cr = function(e) {
765
+ return Q(e) && typeof e.then == "function";
766
+ }, fr = function(e) {
765
767
  return Q(e) && typeof e.elements == "function" && typeof e.createToken == "function" && typeof e.createPaymentMethod == "function" && typeof e.confirmCardPayment == "function";
766
- }, Me = "[object Object]", fr = function r(e, t) {
768
+ }, $e = "[object Object]", lr = function r(e, t) {
767
769
  if (!Q(e) || !Q(t))
768
770
  return e === t;
769
771
  var n = Array.isArray(e), c = Array.isArray(t);
770
772
  if (n !== c) return !1;
771
- var a = Object.prototype.toString.call(e) === Me, p = Object.prototype.toString.call(t) === Me;
773
+ var a = Object.prototype.toString.call(e) === $e, p = Object.prototype.toString.call(t) === $e;
772
774
  if (a !== p) return !1;
773
775
  if (!a && !n) return e === t;
774
776
  var l = Object.keys(e), f = Object.keys(t);
@@ -784,33 +786,33 @@ var N = function(e, t, n) {
784
786
  return r(A[Y], I[Y]);
785
787
  };
786
788
  return g.every(O);
787
- }, Ue = function(e, t, n) {
789
+ }, Ne = function(e, t, n) {
788
790
  return Q(e) ? Object.keys(e).reduce(function(c, a) {
789
- var p = !Q(t) || !fr(e[a], t[a]);
790
- return n.includes(a) ? (p && console.warn("Unsupported prop change: options.".concat(a, " is not a mutable property.")), c) : p ? ke(ke({}, c || {}), {}, Ye({}, a, e[a])) : c;
791
+ var p = !Q(t) || !lr(e[a], t[a]);
792
+ return n.includes(a) ? (p && console.warn("Unsupported prop change: options.".concat(a, " is not a mutable property.")), c) : p ? Ie(Ie({}, c || {}), {}, De({}, a, e[a])) : c;
791
793
  }, null) : null;
792
- }, Ne = "Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.", $e = function(e) {
793
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Ne;
794
- if (e === null || cr(e))
794
+ }, Fe = "Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.", Le = function(e) {
795
+ var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Fe;
796
+ if (e === null || fr(e))
795
797
  return e;
796
798
  throw new Error(t);
797
- }, lr = function(e) {
798
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Ne;
799
- if (sr(e))
799
+ }, pr = function(e) {
800
+ var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Fe;
801
+ if (cr(e))
800
802
  return {
801
803
  tag: "async",
802
804
  stripePromise: Promise.resolve(e).then(function(c) {
803
- return $e(c, t);
805
+ return Le(c, t);
804
806
  })
805
807
  };
806
- var n = $e(e, t);
808
+ var n = Le(e, t);
807
809
  return n === null ? {
808
810
  tag: "empty"
809
811
  } : {
810
812
  tag: "sync",
811
813
  stripe: n
812
814
  };
813
- }, pr = function(e) {
815
+ }, dr = function(e) {
814
816
  !e || !e._registerWrapper || !e.registerAppInfo || (e._registerWrapper({
815
817
  name: "react-stripe-js",
816
818
  version: "2.7.0"
@@ -819,21 +821,21 @@ var N = function(e, t, n) {
819
821
  version: "2.7.0",
820
822
  url: "https://stripe.com/docs/stripe-js/react"
821
823
  }));
822
- }, fe = /* @__PURE__ */ _.createContext(null);
823
- fe.displayName = "ElementsContext";
824
- var Fe = function(e, t) {
824
+ }, le = /* @__PURE__ */ _.createContext(null);
825
+ le.displayName = "ElementsContext";
826
+ var Be = function(e, t) {
825
827
  if (!e)
826
828
  throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(t, " in an <Elements> provider."));
827
829
  return e;
828
- }, dr = function(e) {
830
+ }, vr = function(e) {
829
831
  var t = e.stripe, n = e.options, c = e.children, a = _.useMemo(function() {
830
- return lr(t);
832
+ return pr(t);
831
833
  }, [t]), p = _.useState(function() {
832
834
  return {
833
835
  stripe: a.tag === "sync" ? a.stripe : null,
834
836
  elements: a.tag === "sync" ? a.stripe.elements(n) : null
835
837
  };
836
- }), l = De(p, 2), f = l[0], h = l[1];
838
+ }), l = Ue(p, 2), f = l[0], h = l[1];
837
839
  _.useEffect(function() {
838
840
  var g = !0, A = function(O) {
839
841
  h(function(k) {
@@ -856,49 +858,49 @@ var Fe = function(e, t) {
856
858
  var y = be(n);
857
859
  return _.useEffect(function() {
858
860
  if (f.elements) {
859
- var g = Ue(n, y, ["clientSecret", "fonts"]);
861
+ var g = Ne(n, y, ["clientSecret", "fonts"]);
860
862
  g && f.elements.update(g);
861
863
  }
862
864
  }, [n, y, f.elements]), _.useEffect(function() {
863
- pr(f.stripe);
864
- }, [f.stripe]), /* @__PURE__ */ _.createElement(fe.Provider, {
865
+ dr(f.stripe);
866
+ }, [f.stripe]), /* @__PURE__ */ _.createElement(le.Provider, {
865
867
  value: f
866
868
  }, c);
867
869
  };
868
- dr.propTypes = {
870
+ vr.propTypes = {
869
871
  stripe: j.any,
870
872
  options: j.object
871
873
  };
872
- var vr = function(e) {
873
- var t = _.useContext(fe);
874
- return Fe(t, e);
875
- }, xr = function() {
876
- var e = vr("calls useElements()"), t = e.elements;
874
+ var yr = function(e) {
875
+ var t = _.useContext(le);
876
+ return Be(t, e);
877
+ }, wr = function() {
878
+ var e = yr("calls useElements()"), t = e.elements;
877
879
  return t;
878
880
  };
879
881
  j.func.isRequired;
880
- var Be = /* @__PURE__ */ _.createContext(null);
881
- Be.displayName = "CustomCheckoutSdkContext";
882
- var yr = function(e, t) {
882
+ var ze = /* @__PURE__ */ _.createContext(null);
883
+ ze.displayName = "CustomCheckoutSdkContext";
884
+ var mr = function(e, t) {
883
885
  if (!e)
884
886
  throw new Error("Could not find CustomCheckoutProvider context; You need to wrap the part of your app that ".concat(t, " in an <CustomCheckoutProvider> provider."));
885
887
  return e;
886
- }, mr = /* @__PURE__ */ _.createContext(null);
887
- mr.displayName = "CustomCheckoutContext";
888
+ }, hr = /* @__PURE__ */ _.createContext(null);
889
+ hr.displayName = "CustomCheckoutContext";
888
890
  j.any, j.shape({
889
891
  clientSecret: j.string.isRequired,
890
892
  elementsOptions: j.object
891
893
  }).isRequired;
892
894
  var ge = function(e) {
893
- var t = _.useContext(Be), n = _.useContext(fe);
895
+ var t = _.useContext(ze), n = _.useContext(le);
894
896
  if (t && n)
895
897
  throw new Error("You cannot wrap the part of your app that ".concat(e, " in both <CustomCheckoutProvider> and <Elements> providers."));
896
- return t ? yr(t, e) : Fe(n, e);
897
- }, hr = function(e) {
898
+ return t ? mr(t, e) : Be(n, e);
899
+ }, Er = function(e) {
898
900
  return e.charAt(0).toUpperCase() + e.slice(1);
899
901
  }, L = function(e, t) {
900
- var n = "".concat(hr(e), "Element"), c = function(f) {
901
- var h = f.id, d = f.className, y = f.options, g = y === void 0 ? {} : y, A = f.onBlur, I = f.onFocus, O = f.onReady, k = f.onChange, Y = f.onEscape, X = f.onClick, $ = f.onLoadError, M = f.onLoaderStart, s = f.onNetworksChange, z = f.onConfirm, ee = f.onCancel, re = f.onShippingAddressChange, te = f.onShippingRateChange, K = ge("mounts <".concat(n, ">")), V = "elements" in K ? K.elements : null, G = "customCheckoutSdk" in K ? K.customCheckoutSdk : null, ne = _.useState(null), J = De(ne, 2), W = J[0], F = J[1], D = _.useRef(null), H = _.useRef(null);
902
+ var n = "".concat(Er(e), "Element"), c = function(f) {
903
+ var h = f.id, d = f.className, y = f.options, g = y === void 0 ? {} : y, A = f.onBlur, I = f.onFocus, O = f.onReady, k = f.onChange, Y = f.onEscape, X = f.onClick, $ = f.onLoadError, M = f.onLoaderStart, s = f.onNetworksChange, z = f.onConfirm, ee = f.onCancel, re = f.onShippingAddressChange, te = f.onShippingRateChange, K = ge("mounts <".concat(n, ">")), V = "elements" in K ? K.elements : null, G = "customCheckoutSdk" in K ? K.customCheckoutSdk : null, ne = _.useState(null), J = Ue(ne, 2), W = J[0], F = J[1], D = _.useRef(null), H = _.useRef(null);
902
904
  N(W, "blur", A), N(W, "focus", I), N(W, "escape", Y), N(W, "click", X), N(W, "loaderror", $), N(W, "loaderstart", M), N(W, "networkschange", s), N(W, "confirm", z), N(W, "cancel", ee), N(W, "shippingaddresschange", re), N(W, "shippingratechange", te), N(W, "change", k);
903
905
  var Z;
904
906
  O && (e === "expressCheckout" ? Z = O : Z = function() {
@@ -912,7 +914,7 @@ var ge = function(e) {
912
914
  var o = be(g);
913
915
  return _.useEffect(function() {
914
916
  if (D.current) {
915
- var i = Ue(g, o, ["paymentRequest"]);
917
+ var i = Ne(g, o, ["paymentRequest"]);
916
918
  i && D.current.update(i);
917
919
  }
918
920
  }, [g, o]), _.useLayoutEffect(function() {
@@ -954,15 +956,15 @@ var ge = function(e) {
954
956
  onShippingRateChange: j.func,
955
957
  options: j.object
956
958
  }, p.displayName = n, p.__elementType = e, p;
957
- }, q = typeof window > "u", Er = /* @__PURE__ */ _.createContext(null);
958
- Er.displayName = "EmbeddedCheckoutProviderContext";
959
- var wr = function() {
959
+ }, q = typeof window > "u", br = /* @__PURE__ */ _.createContext(null);
960
+ br.displayName = "EmbeddedCheckoutProviderContext";
961
+ var _r = function() {
960
962
  var e = ge("calls useStripe()"), t = e.stripe;
961
963
  return t;
962
964
  };
963
965
  L("auBankAccount", q);
964
966
  L("card", q);
965
- var _r = L("cardNumber", q), Ar = L("cardExpiry", q), jr = L("cardCvc", q);
967
+ var Ar = L("cardNumber", q), jr = L("cardExpiry", q), kr = L("cardCvc", q);
966
968
  L("fpxBank", q);
967
969
  L("iban", q);
968
970
  L("idealBank", q);
@@ -977,36 +979,36 @@ L("shippingAddress", q);
977
979
  L("paymentMethodMessaging", q);
978
980
  L("affirmMessage", q);
979
981
  L("afterpayClearpayMessage", q);
980
- var ze = "https://js.stripe.com/v3", br = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;
981
- var gr = function() {
982
- for (var e = document.querySelectorAll('script[src^="'.concat(ze, '"]')), t = 0; t < e.length; t++) {
982
+ var Ve = "https://js.stripe.com/v3", gr = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;
983
+ var Cr = function() {
984
+ for (var e = document.querySelectorAll('script[src^="'.concat(Ve, '"]')), t = 0; t < e.length; t++) {
983
985
  var n = e[t];
984
- if (br.test(n.src))
986
+ if (gr.test(n.src))
985
987
  return n;
986
988
  }
987
989
  return null;
988
- }, Le = function(e) {
990
+ }, qe = function(e) {
989
991
  var t = "", n = document.createElement("script");
990
- n.src = "".concat(ze).concat(t);
992
+ n.src = "".concat(Ve).concat(t);
991
993
  var c = document.head || document.body;
992
994
  if (!c)
993
995
  throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");
994
996
  return c.appendChild(n), n;
995
- }, Cr = function(e, t) {
997
+ }, Sr = function(e, t) {
996
998
  !e || !e._registerWrapper || e._registerWrapper({
997
999
  name: "stripe-js",
998
1000
  version: "3.5.0",
999
1001
  startTime: t
1000
1002
  });
1001
- }, oe = null, ue = null, se = null, Sr = function(e) {
1003
+ }, oe = null, se = null, ce = null, Tr = function(e) {
1002
1004
  return function() {
1003
1005
  e(new Error("Failed to load Stripe.js"));
1004
1006
  };
1005
- }, Tr = function(e, t) {
1007
+ }, Pr = function(e, t) {
1006
1008
  return function() {
1007
1009
  window.Stripe ? e(window.Stripe) : t(new Error("Stripe.js not available"));
1008
1010
  };
1009
- }, Pr = function(e) {
1011
+ }, Or = function(e) {
1010
1012
  return oe !== null ? oe : (oe = new Promise(function(t, n) {
1011
1013
  if (typeof window > "u" || typeof document > "u") {
1012
1014
  t(null);
@@ -1017,16 +1019,16 @@ var gr = function() {
1017
1019
  return;
1018
1020
  }
1019
1021
  try {
1020
- var c = gr();
1022
+ var c = Cr();
1021
1023
  if (!(c && e)) {
1022
1024
  if (!c)
1023
- c = Le(e);
1024
- else if (c && se !== null && ue !== null) {
1025
+ c = qe(e);
1026
+ else if (c && ce !== null && se !== null) {
1025
1027
  var a;
1026
- c.removeEventListener("load", se), c.removeEventListener("error", ue), (a = c.parentNode) === null || a === void 0 || a.removeChild(c), c = Le(e);
1028
+ c.removeEventListener("load", ce), c.removeEventListener("error", se), (a = c.parentNode) === null || a === void 0 || a.removeChild(c), c = qe(e);
1027
1029
  }
1028
1030
  }
1029
- se = Tr(t, n), ue = Sr(n), c.addEventListener("load", se), c.addEventListener("error", ue);
1031
+ ce = Pr(t, n), se = Tr(n), c.addEventListener("load", ce), c.addEventListener("error", se);
1030
1032
  } catch (p) {
1031
1033
  n(p);
1032
1034
  return;
@@ -1034,38 +1036,38 @@ var gr = function() {
1034
1036
  }), oe.catch(function(t) {
1035
1037
  return oe = null, Promise.reject(t);
1036
1038
  }));
1037
- }, Or = function(e, t, n) {
1039
+ }, Rr = function(e, t, n) {
1038
1040
  if (e === null)
1039
1041
  return null;
1040
1042
  var c = e.apply(void 0, t);
1041
- return Cr(c, n), c;
1042
- }, ae, Ve = !1, Je = function() {
1043
- return ae || (ae = Pr(null).catch(function(e) {
1043
+ return Sr(c, n), c;
1044
+ }, ae, Je = !1, Ke = function() {
1045
+ return ae || (ae = Or(null).catch(function(e) {
1044
1046
  return ae = null, Promise.reject(e);
1045
1047
  }), ae);
1046
1048
  };
1047
1049
  Promise.resolve().then(function() {
1048
- return Je();
1050
+ return Ke();
1049
1051
  }).catch(function(r) {
1050
- Ve || console.warn(r);
1052
+ Je || console.warn(r);
1051
1053
  });
1052
- var kr = function() {
1054
+ var Ir = function() {
1053
1055
  for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
1054
1056
  t[n] = arguments[n];
1055
- Ve = !0;
1057
+ Je = !0;
1056
1058
  var c = Date.now();
1057
- return Je().then(function(a) {
1058
- return Or(a, t, c);
1059
+ return Ke().then(function(a) {
1060
+ return Rr(a, t, c);
1059
1061
  });
1060
1062
  };
1061
1063
  export {
1062
- _r as C,
1063
- dr as E,
1064
- xr as a,
1065
- Ar as b,
1066
- jr as c,
1067
- Ke as g,
1068
- kr as l,
1069
- qe as r,
1070
- wr as u
1064
+ Ar as C,
1065
+ vr as E,
1066
+ wr as a,
1067
+ jr as b,
1068
+ kr as c,
1069
+ Ge as g,
1070
+ Ir as l,
1071
+ We as r,
1072
+ _r as u
1071
1073
  };
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "mainstack-payments",
3
3
  "type": "module",
4
- "version": "2.0.2",
4
+ "version": "2.0.3",
5
5
  "main": "build/mainstack-payments.js",
6
6
  "types": "build/src/index.d.ts",
7
- "style": "build/style.css",
7
+ "style": "build/index.css",
8
8
  "exports": {
9
9
  ".": {
10
10
  "types": "./build/src/index.d.ts",
11
11
  "import": "./build/mainstack-payments.js"
12
12
  },
13
- "./style.css": "./build/style.css"
13
+ "./style.css": "./build/index.css"
14
14
  },
15
15
  "files": [
16
16
  "build"