@plurix/ecom-components 1.14.2-shlo1555.0 → 1.14.3-com2034

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.
Files changed (67) hide show
  1. package/dist/packages/Carousel/Carousel.js +1 -1
  2. package/dist/packages/CartClubAlert/CartClubAlert.js +1 -1
  3. package/dist/packages/ChangeOrderModal/ChangeOrderModal.d.ts +12 -1
  4. package/dist/packages/ChangeOrderModal/ChangeOrderModal.js +93 -84
  5. package/dist/packages/ChangeOrderModal/api/getOrderForm.js +6 -15
  6. package/dist/packages/ChangeOrderModal/api/getProductsSimilars.d.ts +7 -4
  7. package/dist/packages/ChangeOrderModal/api/getProductsSimilars.js +22 -21
  8. package/dist/packages/ChangeOrderModal/api/postChangeOrder.d.ts +6 -1
  9. package/dist/packages/ChangeOrderModal/api/postChangeOrder.js +11 -17
  10. package/dist/packages/ChangeOrderModal/components/ModalFooter.d.ts +4 -1
  11. package/dist/packages/ChangeOrderModal/components/ModalFooter.js +3 -1
  12. package/dist/packages/ChangeOrderModal/components/SimilarProductList.d.ts +2 -3
  13. package/dist/packages/ChangeOrderModal/components/SimilarProducts.d.ts +4 -5
  14. package/dist/packages/ChangeOrderModal/components/SimilarProducts.js +21 -21
  15. package/dist/packages/ChangeOrderModal/mocks.d.ts +1 -0
  16. package/dist/packages/ChangeOrderModal/mocks.js +1 -0
  17. package/dist/packages/Coupons/Coupons.d.ts +4 -1
  18. package/dist/packages/Coupons/Coupons.js +61 -51
  19. package/dist/packages/Coupons/api/addCoupon.d.ts +1 -1
  20. package/dist/packages/Coupons/api/addCoupon.js +7 -7
  21. package/dist/packages/Coupons/api/getCoupons.d.ts +1 -1
  22. package/dist/packages/Coupons/api/getCoupons.js +4 -4
  23. package/dist/packages/Coupons/api/removeCoupon.d.ts +1 -1
  24. package/dist/packages/Coupons/api/removeCoupon.js +6 -6
  25. package/dist/packages/Coupons/components/CouponCard.d.ts +3 -1
  26. package/dist/packages/Coupons/components/CouponCard.js +86 -76
  27. package/dist/packages/Coupons/views/CouponsView.d.ts +3 -1
  28. package/dist/packages/Coupons/views/CouponsView.js +87 -78
  29. package/dist/packages/Coupons/views/LoadingView.js +6 -6
  30. package/dist/packages/Modal/Modal.js +1 -1
  31. package/dist/packages/Onboarding/Onboarding.js +1 -1
  32. package/dist/packages/ProductCard/ProductCardBadge/ProductCardBadgeKg.d.ts +1 -1
  33. package/dist/packages/ProductCard/ProductCardBadge/ProductCardBadgeKg.js +16 -22
  34. package/dist/packages/ProductCard/ProductCardBadge/ProductCardDiscountBadge.d.ts +3 -2
  35. package/dist/packages/ProductCard/ProductCardBadge/ProductCardDiscountBadge.js +15 -31
  36. package/dist/packages/ProductCard/ProductCardButton/AddToCartButton.js +1 -1
  37. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/Button.d.ts +18 -0
  38. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/Button.js +80 -0
  39. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/IconButton.d.ts +10 -0
  40. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/IconButton.js +61 -0
  41. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/Loader.d.ts +8 -0
  42. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/Loader.js +44 -0
  43. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/index.d.ts +17 -2
  44. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/index.js +1 -1
  45. package/dist/packages/ProductCard/ProductCardButton/QuantitySelector.js +6 -6
  46. package/dist/packages/ProductCard/ProductCardHorizontal/index.js +31 -30
  47. package/dist/packages/ProductCard/ProductCardPrice/index.d.ts +8 -1
  48. package/dist/packages/ProductCard/ProductCardPrice/index.js +27 -31
  49. package/dist/packages/ProductCard/ProductCardVertical/index.js +16 -15
  50. package/dist/packages/ProductCard/index.js +1 -1
  51. package/dist/packages/ProductCardSeeMore/ProductCardSeeMore.js +1 -1
  52. package/dist/packages/Regionalization/Regionalization.d.ts +1 -1
  53. package/dist/packages/Regionalization/Regionalization.js +15 -13
  54. package/dist/packages/Regionalization/context/RegionalizationContext.d.ts +1 -1
  55. package/dist/packages/Regionalization/context/RegionalizationContext.js +31 -29
  56. package/dist/packages/Regionalization/types/RegionalizationProps.d.ts +1 -0
  57. package/dist/packages/Regionalization/views/AllStoresScreen.js +21 -21
  58. package/dist/packages/Tour/Tour.js +1 -1
  59. package/dist/styles/change-order-modal.global.css +1 -1
  60. package/dist/styles/product-card.global.css +1 -1
  61. package/dist/styles/regionalization.global.css +1 -1
  62. package/dist/types/ProductCard.d.ts +13 -12
  63. package/dist/utils/changerOrderModal.js +13 -16
  64. package/package.json +69 -69
  65. package/dist/node_modules/@faststore/components/dist/esm/atoms/Button/Button.js +0 -45
  66. package/dist/node_modules/@faststore/components/dist/esm/atoms/Loader/Loader.js +0 -34
  67. package/dist/node_modules/@faststore/components/dist/esm/molecules/IconButton/IconButton.js +0 -29
@@ -1,110 +1,120 @@
1
- import { jsx as t, jsxs as B } from "react/jsx-runtime";
2
- import { useState as e, useEffect as S } from "react";
3
- import { getCoupons as E } from "./api/getCoupons.js";
4
- import { LoadingView as G } from "./views/LoadingView.js";
5
- import { CouponsView as H } from "./views/CouponsView.js";
6
- import { RulesView as K } from "./views/RulesView.js";
7
- import { OverwriteView as P } from "./views/OverwriteView.js";
8
- import { EmptyCartView as Q } from "./views/EmptyCartView.js";
9
- /* empty css */const I = ({
10
- orderFormId: h,
11
- hasItemsInCart: a,
12
- builder: j,
13
- account: f,
1
+ import { jsx as e, jsxs as P } from "react/jsx-runtime";
2
+ import { useState as t, useEffect as h } from "react";
3
+ import { LoadingView as Q } from "./views/LoadingView.js";
4
+ import { CouponsView as U } from "./views/CouponsView.js";
5
+ import { RulesView as W } from "./views/RulesView.js";
6
+ import { OverwriteView as X } from "./views/OverwriteView.js";
7
+ import { EmptyCartView as Y } from "./views/EmptyCartView.js";
8
+ import { getCoupons as Z } from "./api/getCoupons.js";
9
+ /* empty css */const to = ({
10
+ orderFormId: j,
11
+ hasItemsInCart: f,
12
+ builder: l,
13
+ account: A,
14
14
  isIO: o = !1,
15
15
  closeIOModal: r,
16
16
  activeOrderFormCoupon: n,
17
17
  genericTaggingEvent: s,
18
- disableFirstEmptyModal: A,
19
- couponsList: l,
20
- qtdCouponsView: w
18
+ disableFirstEmptyModal: J,
19
+ couponsList: p,
20
+ qtdCouponsView: w,
21
+ getCouponsMutation: q,
22
+ addCouponMutation: D,
23
+ removeCouponMutation: L
21
24
  }) => {
22
- const [L, C] = e(!0), [q, p] = e([]), [u, c] = e("coupons-view"), [D, y] = e(!1), [N, d] = e(!1), [v, R] = e(""), [m, V] = e(""), [J, x] = e(
23
- !A
24
- ), [b, k] = e();
25
- return S(() => {
25
+ const [k, C] = t(!0), [z, a] = t([]), [u, c] = t("coupons-view"), [B, N] = t(!1), [d, y] = t(!1), [v, R] = t(""), [m, V] = t(""), [E, S] = t(
26
+ !J
27
+ ), [G, H] = t();
28
+ return h(() => {
26
29
  n && R(n);
27
- }, [n]), S(() => {
30
+ }, [n]), h(() => {
28
31
  (async () => {
29
32
  C(!0);
30
33
  try {
31
- const i = await E(f, j, l);
34
+ const i = o ? await Z(l, p) : await q({
35
+ input: {
36
+ builder: l,
37
+ couponsList: p
38
+ }
39
+ }), x = o ? i : JSON.parse(i.getCoupons.data).coupons;
32
40
  if (w) {
33
- const z = i.slice(0, w);
34
- p(z);
41
+ const K = x.slice(0, w);
42
+ a(K);
35
43
  return;
36
44
  }
37
- p(i);
45
+ a(x);
38
46
  return;
39
47
  } catch (i) {
40
- p([]);
48
+ a([]);
41
49
  } finally {
42
50
  C(!1);
43
51
  }
44
52
  })();
45
- }, [JSON.stringify(l)]), L ? /* @__PURE__ */ t("div", { className: "coupons-container", children: /* @__PURE__ */ t(
46
- G,
53
+ }, [JSON.stringify(p)]), k ? /* @__PURE__ */ e("div", { className: "coupons-container", children: /* @__PURE__ */ e(
54
+ Q,
47
55
  {
48
56
  isIO: o,
49
57
  closeIOModal: r,
50
58
  genericTaggingEvent: s
51
59
  }
52
- ) }) : /* @__PURE__ */ B("div", { className: "coupons-container", children: [
53
- (!o || o && u === "coupons-view") && /* @__PURE__ */ t(
54
- H,
60
+ ) }) : /* @__PURE__ */ P("div", { className: "coupons-container", children: [
61
+ (!o || o && u === "coupons-view") && /* @__PURE__ */ e(
62
+ U,
55
63
  {
56
- orderFormId: h,
57
- hasItemsInCart: a,
58
- account: f,
64
+ removeCouponMutation: L,
65
+ addCouponMutation: D,
66
+ orderFormId: j,
67
+ hasItemsInCart: f,
68
+ account: A,
59
69
  isIO: o,
60
70
  closeIOModal: r,
61
- coupons: q,
71
+ coupons: z,
62
72
  firstCouponName: v,
63
73
  secondCouponName: m,
64
- replaceCoupon: N,
74
+ replaceCoupon: d,
65
75
  setView: c,
66
76
  setFirstCouponName: R,
67
77
  setSecondCouponName: V,
68
- setActiveRule: y,
69
- setDataItem: k,
70
- setReplaceCoupon: d,
71
- setIsCloseModalEmpty: x,
78
+ setActiveRule: N,
79
+ setDataItem: H,
80
+ setReplaceCoupon: y,
81
+ setIsCloseModalEmpty: S,
72
82
  genericTaggingEvent: s
73
83
  }
74
84
  ),
75
- (!o || o && u === "rules-view") && D && /* @__PURE__ */ t(
76
- K,
85
+ (!o || o && u === "rules-view") && B && /* @__PURE__ */ e(
86
+ W,
77
87
  {
78
- dataItem: b,
79
- setActiveRule: y,
88
+ dataItem: G,
89
+ setActiveRule: N,
80
90
  setView: c,
81
91
  isIO: o,
82
92
  closeIOModal: r,
83
93
  genericTaggingEvent: s
84
94
  }
85
95
  ),
86
- (!o || o && u === "overwrite-view") && m && !N && /* @__PURE__ */ t(
87
- P,
96
+ (!o || o && u === "overwrite-view") && m && !d && /* @__PURE__ */ e(
97
+ X,
88
98
  {
89
99
  firstCouponName: v,
90
100
  secondCouponName: m,
91
101
  setView: c,
92
- setReplaceCoupon: d,
102
+ setReplaceCoupon: y,
93
103
  setSecondCouponName: V,
94
104
  isIO: o,
95
105
  closeIOModal: r,
96
106
  genericTaggingEvent: s
97
107
  }
98
108
  ),
99
- !a && J && /* @__PURE__ */ t(
100
- Q,
109
+ !f && E && /* @__PURE__ */ e(
110
+ Y,
101
111
  {
102
- setIsCloseModalEmpty: x,
112
+ setIsCloseModalEmpty: S,
103
113
  genericTaggingEvent: s
104
114
  }
105
115
  )
106
116
  ] });
107
117
  };
108
118
  export {
109
- I as Coupons
119
+ to as Coupons
110
120
  };
@@ -1,3 +1,3 @@
1
1
  import { SetOrderFormCouponResponse } from '../types/SetOrderFormCouponResponse';
2
2
 
3
- export declare const addCoupon: (account: string, orderFormId: string, couponId: string) => Promise<SetOrderFormCouponResponse>;
3
+ export declare const addCoupon: (orderFormId: string, couponId: string) => Promise<SetOrderFormCouponResponse>;
@@ -1,14 +1,14 @@
1
1
  import r from "axios";
2
- const s = async (o, t, a) => {
3
- const { data: p } = await r.post(
4
- `https://${o}.vtex.app/api/coupon/order`,
2
+ const n = async (o, t) => {
3
+ const { data: a } = await r.post(
4
+ "/_v/faststoreapi/coupon/order",
5
5
  {
6
- orderFormId: t,
7
- couponId: a
6
+ orderFormId: o,
7
+ couponId: t
8
8
  }
9
9
  );
10
- return p;
10
+ return a;
11
11
  };
12
12
  export {
13
- s as addCoupon
13
+ n as addCoupon
14
14
  };
@@ -1,3 +1,3 @@
1
1
  import { CouponType } from '../types/CouponType';
2
2
 
3
- export declare const getCoupons: (account: string, builder: 'app' | 'faststore', couponsList?: CouponType[]) => Promise<CouponType[]>;
3
+ export declare const getCoupons: (builder: 'app' | 'faststore', couponsList?: CouponType[]) => Promise<CouponType[]>;
@@ -1,8 +1,8 @@
1
- import o from "axios";
2
- const e = async (n, p, t) => {
3
- const a = `https://${n}.vtex.app/api/coupon/list`, s = Math.random(), { data: r } = t ? await o.post(a, { couponsList: t }) : await o.get(a, { params: { builder: p, random: s } });
1
+ import a from "axios";
2
+ const c = async (s, o) => {
3
+ const t = "/_v/faststoreapi/coupon/list", n = Math.random(), { data: r } = o ? await a.post(t, { couponsList: o }) : await a.get(t, { params: { builder: s, random: n } });
4
4
  return r.coupons;
5
5
  };
6
6
  export {
7
- e as getCoupons
7
+ c as getCoupons
8
8
  };
@@ -1,3 +1,3 @@
1
1
  import { SetOrderFormCouponResponse } from '../types/SetOrderFormCouponResponse';
2
2
 
3
- export declare const removeCoupon: (account: string, orderFormId: string) => Promise<SetOrderFormCouponResponse>;
3
+ export declare const removeCoupon: (orderFormId: string) => Promise<SetOrderFormCouponResponse>;
@@ -1,12 +1,12 @@
1
- import e from "axios";
2
- const r = async (o, t) => {
3
- const { data: a } = await e.delete(
4
- `https://${o}.vtex.app/api/coupon/order`,
1
+ import a from "axios";
2
+ const r = async (o) => {
3
+ const { data: t } = await a.delete(
4
+ "/_v/faststoreapi/coupon/order",
5
5
  {
6
- data: { orderFormId: t }
6
+ data: { orderFormId: o }
7
7
  }
8
8
  );
9
- return a;
9
+ return t;
10
10
  };
11
11
  export {
12
12
  r as removeCoupon
@@ -21,5 +21,7 @@ export interface CouponCardProps {
21
21
  setType: (type: AlertType) => void;
22
22
  setIsCloseModalEmpty: (isCloseModalEmpty: boolean) => void;
23
23
  genericTaggingEvent?: (name: string, params: object) => void;
24
+ addCouponMutation?: any;
25
+ removeCouponMutation?: any;
24
26
  }
25
- export declare const CouponCard: ({ account, orderFormId, hasItemsInCart, isIO, item, firstCouponName, secondCouponName, replaceCoupon, setView, setActiveRule, setDataItem, setFirstCouponName, setSecondCouponName, setReplaceCoupon, setAlert, setType, setIsCloseModalEmpty, genericTaggingEvent }: CouponCardProps) => import("react/jsx-runtime").JSX.Element;
27
+ export declare const CouponCard: ({ orderFormId, hasItemsInCart, isIO, item, firstCouponName, secondCouponName, replaceCoupon, setView, setActiveRule, setDataItem, setFirstCouponName, setSecondCouponName, setReplaceCoupon, setAlert, setType, setIsCloseModalEmpty, genericTaggingEvent, addCouponMutation, removeCouponMutation }: CouponCardProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,132 +1,142 @@
1
- import { jsxs as u, jsx as s } from "react/jsx-runtime";
2
- import { useState as z, useEffect as q } from "react";
1
+ import { jsxs as p, jsx as c } from "react/jsx-runtime";
2
+ import { useState as V, useEffect as q } from "react";
3
3
  import { addCoupon as B } from "../api/addCoupon.js";
4
- import { removeCoupon as G } from "../api/removeCoupon.js";
5
- import { CouponIcon as H } from "../../../assets/svgs/CouponIcon.js";
6
- import { SuccessIcon as J } from "../../../assets/svgs/SuccessIcon.js";
7
- const X = ({
8
- account: _,
9
- orderFormId: x,
4
+ import { CouponIcon as G } from "../../../assets/svgs/CouponIcon.js";
5
+ import { SuccessIcon as H } from "../../../assets/svgs/SuccessIcon.js";
6
+ import { removeCoupon as K } from "../api/removeCoupon.js";
7
+ const Z = ({
8
+ orderFormId: t,
10
9
  hasItemsInCart: D,
11
- isIO: j = !1,
12
- item: l,
13
- firstCouponName: c,
10
+ isIO: r = !1,
11
+ item: a,
12
+ firstCouponName: s,
14
13
  secondCouponName: d,
15
- replaceCoupon: f,
16
- setView: y,
17
- setActiveRule: N,
18
- setDataItem: i,
19
- setFirstCouponName: t,
20
- setSecondCouponName: w,
21
- setReplaceCoupon: k,
22
- setAlert: m,
23
- setType: p,
24
- setIsCloseModalEmpty: A,
25
- genericTaggingEvent: o
14
+ replaceCoupon: b,
15
+ setView: R,
16
+ setActiveRule: z,
17
+ setDataItem: J,
18
+ setFirstCouponName: L,
19
+ setSecondCouponName: _,
20
+ setReplaceCoupon: j,
21
+ setAlert: f,
22
+ setType: m,
23
+ setIsCloseModalEmpty: y,
24
+ genericTaggingEvent: o,
25
+ addCouponMutation: S,
26
+ removeCouponMutation: i
26
27
  }) => {
27
- const [b, r] = z(!1), [R, h] = z(!1);
28
+ const [x, u] = V(!1), [k, w] = V(!1);
28
29
  q(() => {
29
- d.toLowerCase() !== l.couponName.toLowerCase() && r(!1), c && !d && c.toLowerCase() === l.couponName.toLowerCase() && r(!0), c && d && f && d.toLowerCase() === l.couponName.toLowerCase() && V(d);
30
- }, [c, d, f]);
31
- const V = async (a) => {
30
+ d.toLowerCase() !== a.couponName.toLowerCase() && u(!1), s && !d && s.toLowerCase() === a.couponName.toLowerCase() && u(!0), s && d && b && d.toLowerCase() === a.couponName.toLowerCase() && A(d);
31
+ }, [s, d, b]);
32
+ const A = async (l) => {
32
33
  if (D)
33
34
  try {
34
- if (!c || c && f) {
35
- h(!0);
36
- const L = await B(_, x, a);
37
- k(!1), t(a), w(""), L.error.length <= 0 ? (o == null || o("discount_coupon", {
35
+ if (!s || s && b) {
36
+ w(!0);
37
+ const h = r ? await B(t, l) : await S({
38
+ input: {
39
+ orderFormId: t,
40
+ couponId: l
41
+ }
42
+ }), N = r ? h : JSON.parse(h.addCoupon.data);
43
+ j(!1), L(l), _(""), N.error.length <= 0 ? (o == null || o("discount_coupon", {
38
44
  name: "cupom aplicado",
39
- cupomName: a
40
- }), p("success"), r(!0), j && window.location.reload()) : (o == null || o("discount_coupon", {
45
+ cupomName: l
46
+ }), m("success"), u(!0), r && window.location.reload()) : (o == null || o("discount_coupon", {
41
47
  name: "cupom aplicando - cupom incorreto ou expirado",
42
- cupomName: a,
43
- objectError: L.error
44
- }), p("error"), r(!1), t("")), m(!0);
48
+ cupomName: l,
49
+ objectError: N.error
50
+ }), m("error"), u(!1), L("")), f(!0);
45
51
  } else
46
- w(a), y("overwrite-view");
47
- } catch (L) {
52
+ _(l), R("overwrite-view");
53
+ } catch (h) {
48
54
  o == null || o("discount_coupon", {
49
55
  name: "problema na api",
50
- cupomName: a
51
- }), r(!1), p("error"), m(!0);
56
+ cupomName: l
57
+ }), u(!1), m("error"), f(!0);
52
58
  } finally {
53
- h(!1);
59
+ w(!1);
54
60
  }
55
61
  else
56
62
  o == null || o("discount_coupon", {
57
63
  name: "Modal de cart vazio acionado"
58
- }), A(!0);
64
+ }), y(!0);
59
65
  }, M = async () => {
60
66
  if (D)
61
67
  try {
62
- h(!0), k(!1);
63
- const a = await G(_, x);
64
- a.error.length <= 0 ? (o == null || o("discount_coupon", {
68
+ w(!0), j(!1);
69
+ const l = r ? await K(t) : await i({
70
+ input: {
71
+ orderFormId: t
72
+ }
73
+ }), h = r ? l : JSON.parse(l.removeCoupon.data);
74
+ h.error.length <= 0 ? (o == null || o("discount_coupon", {
65
75
  name: "cupom removido com sucesso",
66
- cupomName: c
67
- }), p("removed"), r(!1), t(""), w(""), j && window.location.reload()) : (o == null || o("discount_coupon", {
76
+ cupomName: s
77
+ }), m("removed"), u(!1), L(""), _(""), r && window.location.reload()) : (o == null || o("discount_coupon", {
68
78
  name: "algum problema na remoção do cupom",
69
- cupomName: c,
70
- objectError: a.error
71
- }), p("error"), r(!0)), m(!0);
72
- } catch (a) {
79
+ cupomName: s,
80
+ objectError: h.error
81
+ }), m("error"), u(!0)), f(!0);
82
+ } catch (l) {
73
83
  o == null || o("discount_coupon", {
74
84
  name: "problema na api - na remoção do cupom",
75
- cupomName: c
76
- }), p("error"), r(!0), m(!0);
85
+ cupomName: s
86
+ }), m("error"), u(!0), f(!0);
77
87
  } finally {
78
- h(!1);
88
+ w(!1);
79
89
  }
80
90
  else
81
91
  o == null || o("discount_coupon", {
82
92
  name: "Modal de cart vazio acionado"
83
- }), A(!0);
93
+ }), y(!0);
84
94
  }, $ = () => {
85
- N(!0), i(l), y("rules-view");
95
+ z(!0), J(a), R("rules-view");
86
96
  };
87
- return /* @__PURE__ */ u("div", { className: `container-card-coupon ${b ? "active" : ""}`, children: [
88
- /* @__PURE__ */ u("div", { className: "text-container", children: [
89
- /* @__PURE__ */ u("div", { className: "container-title", children: [
90
- /* @__PURE__ */ s(H, { width: 20, height: 16 }),
91
- /* @__PURE__ */ s("h3", { className: "title", children: l.couponName })
97
+ return /* @__PURE__ */ p("div", { className: `container-card-coupon ${x ? "active" : ""}`, children: [
98
+ /* @__PURE__ */ p("div", { className: "text-container", children: [
99
+ /* @__PURE__ */ p("div", { className: "container-title", children: [
100
+ /* @__PURE__ */ c(G, { width: 20, height: 16 }),
101
+ /* @__PURE__ */ c("h3", { className: "title", children: a.couponName })
92
102
  ] }),
93
- l.couponValue && /* @__PURE__ */ u("p", { className: "price-badge", children: [
103
+ a.couponValue && /* @__PURE__ */ p("p", { className: "price-badge", children: [
94
104
  "- ",
95
- l.couponValue
105
+ a.couponValue
96
106
  ] }),
97
- l.couponDescription && /* @__PURE__ */ s("h4", { className: "subtitle", children: l.couponDescription }),
98
- l.couponExpirationDate && /* @__PURE__ */ u("h4", { className: "subtitle", children: [
107
+ a.couponDescription && /* @__PURE__ */ c("h4", { className: "subtitle", children: a.couponDescription }),
108
+ a.couponExpirationDate && /* @__PURE__ */ p("h4", { className: "subtitle", children: [
99
109
  "Válido até ",
100
- l.couponExpirationDate
110
+ a.couponExpirationDate
101
111
  ] })
102
112
  ] }),
103
- /* @__PURE__ */ s("div", { className: "vertical-line" }),
104
- /* @__PURE__ */ u("div", { className: "buttons-container", children: [
105
- b && /* @__PURE__ */ u("button", { className: "applied-coupon", children: [
106
- /* @__PURE__ */ s("span", { className: "applied-coupon-span", children: /* @__PURE__ */ s(J, {}) }),
113
+ /* @__PURE__ */ c("div", { className: "vertical-line" }),
114
+ /* @__PURE__ */ p("div", { className: "buttons-container", children: [
115
+ x && /* @__PURE__ */ p("button", { className: "applied-coupon", children: [
116
+ /* @__PURE__ */ c("span", { className: "applied-coupon-span", children: /* @__PURE__ */ c(H, {}) }),
107
117
  "Aplicado"
108
118
  ] }),
109
- b ? /* @__PURE__ */ s(
119
+ x ? /* @__PURE__ */ c(
110
120
  "button",
111
121
  {
112
122
  onClick: M,
113
123
  className: "remove-coupon",
114
- disabled: R,
124
+ disabled: k,
115
125
  children: "Remover"
116
126
  }
117
- ) : /* @__PURE__ */ s(
127
+ ) : /* @__PURE__ */ c(
118
128
  "button",
119
129
  {
120
- onClick: () => V(l.couponName),
130
+ onClick: () => A(a.couponName),
121
131
  className: "apply-coupon",
122
- disabled: R,
132
+ disabled: k,
123
133
  children: "Aplicar"
124
134
  }
125
135
  ),
126
- l.couponDescription && /* @__PURE__ */ s("a", { onClick: $, children: "Ver Regras" })
136
+ a.couponDescription && /* @__PURE__ */ c("a", { onClick: $, children: "Ver Regras" })
127
137
  ] })
128
138
  ] });
129
139
  };
130
140
  export {
131
- X as CouponCard
141
+ Z as CouponCard
132
142
  };
@@ -8,6 +8,8 @@ interface CouponsViewProps extends Omit<CouponCardProps, OmittedProps> {
8
8
  hasItemsInCart: boolean;
9
9
  closeIOModal?: () => void;
10
10
  coupons: CouponType[];
11
+ addCouponMutation?: any;
12
+ removeCouponMutation?: any;
11
13
  }
12
- export declare const CouponsView: ({ account, orderFormId, hasItemsInCart, isIO, closeIOModal, coupons, firstCouponName, secondCouponName, replaceCoupon, setView, setActiveRule, setDataItem, setFirstCouponName, setSecondCouponName, setReplaceCoupon, setIsCloseModalEmpty, genericTaggingEvent }: CouponsViewProps) => import("react/jsx-runtime").JSX.Element;
14
+ export declare const CouponsView: ({ addCouponMutation, removeCouponMutation, account, orderFormId, hasItemsInCart, isIO, closeIOModal, coupons, firstCouponName, secondCouponName, replaceCoupon, setView, setActiveRule, setDataItem, setFirstCouponName, setSecondCouponName, setReplaceCoupon, setIsCloseModalEmpty, genericTaggingEvent }: CouponsViewProps) => import("react/jsx-runtime").JSX.Element;
13
15
  export {};