everest-npm-features 0.0.45 → 0.0.46

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,5 +1,5 @@
1
- import { jsxs as a, Fragment as f, jsx as r } from "react/jsx-runtime";
2
- import { useRef as u, useState as g, useEffect as C } from "react";
1
+ import { jsxs as a, Fragment as g, jsx as r } from "react/jsx-runtime";
2
+ import { useRef as u, useState as C, useEffect as h } from "react";
3
3
  import x from "../backBtn.js";
4
4
  import { VISA_ICON as y } from "../../../../util/constants.js";
5
5
  import "../../../../index-DlQqWbXG.js";
@@ -19,50 +19,59 @@ import "../../../../index.esm-BsMAMhYW.js";
19
19
  import "../../../../web3-u4qDZYpo.js";
20
20
  import "../../../../index-ceeCtFuh.js";
21
21
  import "../../../../context/dialogContext.js";
22
- import { T as h } from "../../../../Typography-pAaje37G.js";
22
+ import { T as n } from "../../../../Typography-pAaje37G.js";
23
23
  import { B } from "../../../../Box-B0YSYLco.js";
24
- import { C as w } from "../../../../CircularProgress-xZA3lvba.js";
24
+ import { C as v } from "../../../../CircularProgress-xZA3lvba.js";
25
25
  const J = ({
26
26
  checkoutId: o,
27
27
  integrity: i,
28
28
  srcUrl: m,
29
- onResultUrl: n,
30
- backBtnFunc: s,
31
- brands: p = ["VISA", "MASTER"]
29
+ onResultUrl: s,
30
+ backBtnFunc: p,
31
+ brands: c = ["VISA", "MASTER"]
32
32
  }) => {
33
- const { showAlertMessage: c } = b(), e = u(null), [d, l] = g(!0);
34
- return C(() => {
33
+ const { showAlertMessage: l } = b(), e = u(null), [d, f] = C(!0);
34
+ return h(() => {
35
35
  if (!o) return;
36
36
  const t = document.createElement("script");
37
37
  return t.src = `${m}paymentWidgets.js?checkoutId=${o}`, i && (t.integrity = i), t.crossOrigin = "anonymous", t.onload = () => {
38
- console.log("CardCorp payment widget script loaded"), l(!1);
38
+ console.log("CardCorp payment widget script loaded"), f(!1);
39
39
  }, t.onerror = () => {
40
- c({
40
+ l({
41
41
  message: "Failed to load CardCorp payment widget script"
42
42
  });
43
43
  }, e.current && e.current.appendChild(t), () => {
44
44
  e.current && (e.current.innerHTML = "");
45
45
  };
46
- }, [o, i]), /* @__PURE__ */ a(f, { children: [
46
+ }, [o, i]), /* @__PURE__ */ a(g, { children: [
47
47
  /* @__PURE__ */ r(
48
48
  x,
49
49
  {
50
- onClickHandler: s,
50
+ onClickHandler: p,
51
51
  backBtnText: "Payment Information"
52
52
  }
53
53
  ),
54
- /* @__PURE__ */ a(h, { className: "text-center", variant: "subtitle1", mt: 2, children: [
54
+ /* @__PURE__ */ a(n, { className: "text-center", variant: "subtitle1", mt: 2, children: [
55
55
  /* @__PURE__ */ r("img", { src: y, width: 140, alt: "Debit Card" }),
56
56
  /* @__PURE__ */ r("br", {}),
57
57
  /* @__PURE__ */ r("b", { children: "Debit Card" })
58
58
  ] }),
59
- d && /* @__PURE__ */ r(B, { className: "text-center", mt: 8, children: /* @__PURE__ */ r(w, {}) }),
59
+ d && /* @__PURE__ */ r(B, { className: "text-center", mt: 8, children: /* @__PURE__ */ r(v, {}) }),
60
60
  /* @__PURE__ */ r("div", { ref: e, children: o && /* @__PURE__ */ r(
61
61
  "form",
62
62
  {
63
- action: n,
63
+ action: s,
64
64
  className: "paymentWidgets",
65
- "data-brands": p.join(" ")
65
+ "data-brands": c.join(" ")
66
+ }
67
+ ) }),
68
+ /* @__PURE__ */ r(n, { className: "flex-center", variant: "caption", mt: 1, children: /* @__PURE__ */ r(
69
+ "a",
70
+ {
71
+ href: "https://everest.org/terms-of-use",
72
+ target: "_blank",
73
+ rel: "noopener noreferrer",
74
+ children: "Legal & Privacy"
66
75
  }
67
76
  ) })
68
77
  ] });
@@ -1,15 +1,15 @@
1
- import { jsxs as n, Fragment as C, jsx as r } from "react/jsx-runtime";
1
+ import { jsxs as n, Fragment as x, jsx as r } from "react/jsx-runtime";
2
2
  import { useState as t, useEffect as c } from "react";
3
3
  import { E as D } from "../../../../ErrorOutline-CPQcnl2b.js";
4
- import { s as x, p as W, h as $, v as H } from "../../../../index-ceeCtFuh.js";
4
+ import { s as y, p as W, h as $, v as H } from "../../../../index-ceeCtFuh.js";
5
5
  import K from "../backBtn.js";
6
6
  import { removeExtraSpace as R } from "../../../../util/functions.js";
7
7
  import { CARD_PAYMENT_DECLINE as q, VISA_ICON as G } from "../../../../util/constants.js";
8
8
  import J from "../Input/index.js";
9
9
  import Q from "../appButton.js";
10
10
  import { useSnackBarContext as U } from "../../../../context/snackBarContext.js";
11
- import { T as y } from "../../../../Typography-pAaje37G.js";
12
- import { B as m } from "../../../../Box-B0YSYLco.js";
11
+ import { T as m } from "../../../../Typography-pAaje37G.js";
12
+ import { B as p } from "../../../../Box-B0YSYLco.js";
13
13
  import { C as k } from "../../../../CircularProgress-xZA3lvba.js";
14
14
  const me = ({
15
15
  checkoutKey: v,
@@ -17,27 +17,27 @@ const me = ({
17
17
  backBtnFunc: N,
18
18
  initPaymentRequest: P
19
19
  }) => {
20
- const { showAlertMessage: p } = U(), a = E.payment, [V, I] = t(!0), [i, B] = t(""), [L, O] = t(!1), [S, A] = t({
20
+ const { showAlertMessage: h } = U(), a = E.payment, [V, I] = t(!0), [i, B] = t(""), [L, O] = t(!1), [S, _] = t({
21
21
  name: "",
22
22
  billingAddress: {
23
23
  addressLine1: ""
24
24
  }
25
- }), [M, h] = t(!1), [l, f] = t(!0), [u, T] = t(!0), [g, _] = t(!0), [b, w] = t(!0);
25
+ }), [A, f] = t(!1), [l, u] = t(!0), [g, M] = t(!0), [b, T] = t(!0), [C, w] = t(!0);
26
26
  c(() => {
27
27
  var e, o, s, d;
28
- (o = (e = a == null ? void 0 : a._links) == null ? void 0 : e.redirect) != null && o.href && window.location.replace((d = (s = a == null ? void 0 : a._links) == null ? void 0 : s.redirect) == null ? void 0 : d.href), a.status === q && p({
28
+ (o = (e = a == null ? void 0 : a._links) == null ? void 0 : e.redirect) != null && o.href && window.location.replace((d = (s = a == null ? void 0 : a._links) == null ? void 0 : s.redirect) == null ? void 0 : d.href), a.status === q && h({
29
29
  message: `Error processing card: (${a.response_code})${a.response_summary}`
30
30
  });
31
31
  }, [a]), c(() => {
32
- A({
32
+ _({
33
33
  name: i,
34
34
  billingAddress: {
35
35
  addressLine1: ""
36
36
  }
37
37
  });
38
38
  }, [i]), c(() => {
39
- !u && !g && !b && i !== "" ? l && f(!1) : l || f(!0);
40
- }, [i, u, g, b]);
39
+ !g && !b && !C && i !== "" ? l && u(!1) : l || u(!0);
40
+ }, [i, g, b, C]);
41
41
  const z = (e, o, s, d = /./) => {
42
42
  if (e !== "" && !d.test(e))
43
43
  return !1;
@@ -48,10 +48,10 @@ const me = ({
48
48
  if (e && e.element)
49
49
  switch (e.element) {
50
50
  case "card-number":
51
- T(e.isEmpty || !e.isValid);
51
+ M(e.isEmpty || !e.isValid);
52
52
  break;
53
53
  case "expiry-date":
54
- _(e.isEmpty || !e.isValid);
54
+ T(e.isEmpty || !e.isValid);
55
55
  break;
56
56
  case "cvv":
57
57
  w(e.isEmpty || !e.isValid);
@@ -62,12 +62,12 @@ const me = ({
62
62
  }
63
63
  }, F = (e) => {
64
64
  if (e === "") {
65
- p({ message: "Error processing card" }), h(!1);
65
+ h({ message: "Error processing card" }), f(!1);
66
66
  return;
67
67
  }
68
68
  P(e);
69
69
  };
70
- return /* @__PURE__ */ n(C, { children: [
70
+ return /* @__PURE__ */ n(x, { children: [
71
71
  /* @__PURE__ */ r(
72
72
  K,
73
73
  {
@@ -75,27 +75,14 @@ const me = ({
75
75
  backBtnText: "Payment Information"
76
76
  }
77
77
  ),
78
- /* @__PURE__ */ n(y, { className: "text-center", variant: "subtitle1", mt: 2, children: [
78
+ /* @__PURE__ */ n(m, { className: "text-center", variant: "subtitle1", mt: 2, children: [
79
79
  /* @__PURE__ */ r("img", { src: G, width: 140, alt: "Debit Card" }),
80
80
  /* @__PURE__ */ r("br", {}),
81
81
  /* @__PURE__ */ r("b", { children: "Debit Card" })
82
82
  ] }),
83
- /* @__PURE__ */ n(
83
+ V && /* @__PURE__ */ r(p, { className: "text-center", mt: 8, children: /* @__PURE__ */ r(k, {}) }),
84
+ /* @__PURE__ */ r(p, { mt: 2, children: /* @__PURE__ */ n(
84
85
  y,
85
- {
86
- className: "text-center d-flex items-center",
87
- variant: "caption",
88
- mt: 2,
89
- children: [
90
- /* @__PURE__ */ r(D, {}),
91
- "   ",
92
- /* @__PURE__ */ r("b", { style: { marginTop: "3px" }, children: "Fiat purchasing is not available for users with Chase and Citi bank accounts" })
93
- ]
94
- }
95
- ),
96
- V && /* @__PURE__ */ r(m, { className: "text-center", mt: 8, children: /* @__PURE__ */ r(k, {}) }),
97
- /* @__PURE__ */ r(m, { mt: 2, children: /* @__PURE__ */ n(
98
- x,
99
86
  {
100
87
  config: {
101
88
  debug: !1,
@@ -143,7 +130,7 @@ const me = ({
143
130
  Y(e);
144
131
  },
145
132
  cardSubmitted: () => {
146
- h(!0);
133
+ f(!0);
147
134
  },
148
135
  cardTokenized: (e) => {
149
136
  F(e.token);
@@ -198,20 +185,34 @@ const me = ({
198
185
  Q,
199
186
  {
200
187
  onClick: () => {
201
- x.submitCard();
188
+ y.submitCard();
202
189
  },
203
190
  fullWidth: !0,
204
191
  disabled: l,
205
- children: /* @__PURE__ */ r("strong", { children: M ? /* @__PURE__ */ n(C, { children: [
192
+ children: /* @__PURE__ */ r("strong", { children: A ? /* @__PURE__ */ n(x, { children: [
206
193
  /* @__PURE__ */ r(k, { size: 15, color: "inherit" }),
207
194
  " Processing..."
208
195
  ] }) : "Pay" })
209
196
  }
210
- )
197
+ ),
198
+ /* @__PURE__ */ r(m, { className: "flex-center", variant: "caption", mt: 1, children: /* @__PURE__ */ r(
199
+ "a",
200
+ {
201
+ href: "https://everest.org/terms-of-use",
202
+ target: "_blank",
203
+ rel: "noopener noreferrer",
204
+ children: "Legal & Privacy"
205
+ }
206
+ ) }),
207
+ /* @__PURE__ */ n(m, { className: "flex-center", variant: "caption", mt: 1, children: [
208
+ /* @__PURE__ */ r(D, {}),
209
+ "   ",
210
+ /* @__PURE__ */ r("b", { style: { marginTop: "3px" }, children: "Fiat purchasing is not available for users with Chase and Citi bank accounts" })
211
+ ] })
211
212
  ]
212
213
  }
213
214
  ) }),
214
- /* @__PURE__ */ r(m, { mt: 8, children: /* @__PURE__ */ r("div", { id: "st-animated-card" }) })
215
+ /* @__PURE__ */ r(p, { mt: 8, children: /* @__PURE__ */ r("div", { id: "st-animated-card" }) })
215
216
  ] });
216
217
  };
217
218
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "everest-npm-features",
3
- "version": "0.0.45",
3
+ "version": "0.0.46",
4
4
  "description": "Everest frontend features library.",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",