@plurix/ecom-components 1.14.2-commerce.8 → 1.14.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.
Files changed (33) hide show
  1. package/dist/packages/ChangeOrderModal/ChangeOrderModal.d.ts +12 -2
  2. package/dist/packages/ChangeOrderModal/ChangeOrderModal.js +79 -71
  3. package/dist/packages/ChangeOrderModal/api/getOrderForm.d.ts +1 -1
  4. package/dist/packages/ChangeOrderModal/api/getOrderForm.js +7 -9
  5. package/dist/packages/ChangeOrderModal/api/getProductsSimilars.d.ts +7 -5
  6. package/dist/packages/ChangeOrderModal/api/getProductsSimilars.js +18 -11
  7. package/dist/packages/ChangeOrderModal/api/postChangeOrder.d.ts +6 -1
  8. package/dist/packages/ChangeOrderModal/api/postChangeOrder.js +11 -11
  9. package/dist/packages/Coupons/Coupons.d.ts +4 -1
  10. package/dist/packages/Coupons/Coupons.js +67 -57
  11. package/dist/packages/Coupons/api/addCoupon.js +6 -6
  12. package/dist/packages/Coupons/api/getCoupons.js +5 -5
  13. package/dist/packages/Coupons/components/CouponCard.d.ts +3 -1
  14. package/dist/packages/Coupons/components/CouponCard.js +94 -83
  15. package/dist/packages/Coupons/views/CouponsView.d.ts +3 -1
  16. package/dist/packages/Coupons/views/CouponsView.js +87 -78
  17. package/dist/packages/ProductCard/ProductCardBadge/ProductCardBadgeKg.js +13 -10
  18. package/dist/packages/ProductCard/ProductCardBadge/ProductCardDiscountBadge.d.ts +3 -2
  19. package/dist/packages/ProductCard/ProductCardBadge/ProductCardDiscountBadge.js +15 -31
  20. package/dist/packages/ProductCard/ProductCardHorizontal/index.js +31 -30
  21. package/dist/packages/ProductCard/ProductCardPrice/index.d.ts +8 -1
  22. package/dist/packages/ProductCard/ProductCardPrice/index.js +27 -31
  23. package/dist/packages/ProductCard/ProductCardVertical/index.js +16 -15
  24. package/dist/packages/Regionalization/Regionalization.d.ts +1 -1
  25. package/dist/packages/Regionalization/Regionalization.js +15 -13
  26. package/dist/packages/Regionalization/context/RegionalizationContext.d.ts +1 -1
  27. package/dist/packages/Regionalization/context/RegionalizationContext.js +31 -29
  28. package/dist/packages/Regionalization/types/RegionalizationProps.d.ts +1 -0
  29. package/dist/packages/Regionalization/views/AllStoresScreen.js +21 -21
  30. package/dist/styles/regionalization.global.css +1 -1
  31. package/dist/types/ProductCard.d.ts +13 -12
  32. package/dist/utils/changerOrderModal.js +13 -16
  33. package/package.json +1 -1
@@ -1,6 +1,8 @@
1
1
  import { Dispatch, SetStateAction } from 'react';
2
2
  import { SelectedItemProps } from './components/ProductSelected';
3
3
  import { SimilarProducts as SimilarProductsProps } from '../../types/ChangeOrderModal';
4
+ import { GetProductsSimilarsResponse } from './api/getProductsSimilars';
5
+ import { PostChangeOrderMutationResponse } from './api/postChangeOrder';
4
6
 
5
7
  export interface ChangeOrderModalProps {
6
8
  postalCode: string;
@@ -11,9 +13,17 @@ export interface ChangeOrderModalProps {
11
13
  isClubClient?: boolean;
12
14
  orderFormId: string;
13
15
  saveSelectedSimilarProduct?: (similarProduct: SimilarProductsProps | undefined) => void;
14
- account: string;
16
+ getOrderFormMutation?: (variables: {}) => Promise<CustomDataMutationResponse>;
17
+ getProductsSimilarsMutation?: (variables: {}) => Promise<GetProductsSimilarsResponse>;
18
+ postChangeOrderMutation?: (variables: {}) => Promise<PostChangeOrderMutationResponse>;
19
+ }
20
+ interface CustomDataMutationResponse {
21
+ getOrderForm: {
22
+ data: string;
23
+ };
15
24
  }
16
25
  export interface idSubstitutionCriteriasProps {
17
26
  [key: string]: string;
18
27
  }
19
- export declare const ChangeOrderModal: ({ selectedItem, postalCode, orderFormId, isClubClient, isOpen, environment, setIsOpen, saveSelectedSimilarProduct, account }: ChangeOrderModalProps) => import("react/jsx-runtime").JSX.Element;
28
+ export declare const ChangeOrderModal: ({ selectedItem, postalCode, orderFormId, isClubClient, isOpen, environment, setIsOpen, saveSelectedSimilarProduct, getOrderFormMutation, getProductsSimilarsMutation, postChangeOrderMutation }: ChangeOrderModalProps) => import("react/jsx-runtime").JSX.Element;
29
+ export {};
@@ -1,108 +1,116 @@
1
- import { jsx as n, jsxs as q, Fragment as w } from "react/jsx-runtime";
2
- import { useState as l, useEffect as M } from "react";
3
- import { Modal as N } from "../Modal/Modal.js";
4
- import { ProductSelected as k } from "./components/ProductSelected.js";
5
- import { SimilarProducts as v } from "./components/SimilarProducts.js";
6
- import { ModalFooter as A } from "./components/ModalFooter.js";
7
- /* empty css */import { getProductsSimilars as E } from "./api/getProductsSimilars.js";
8
- import _ from "../../hooks/useAnalitcsEvents.js";
9
- import { NoSimilarProduct as J } from "./components/NoSimilarProduct.js";
10
- import { getOrderForm as L } from "./api/getOrderForm.js";
11
- import { postChangeOrder as T } from "./api/postChangeOrder.js";
12
- import { Skeleton as $ } from "../Skeleton/index.js";
13
- const or = ({
14
- selectedItem: r,
15
- postalCode: h,
16
- orderFormId: c,
17
- isClubClient: y,
18
- isOpen: O,
1
+ import { jsx as a, jsxs as E, Fragment as J } from "react/jsx-runtime";
2
+ import { useState as f, useEffect as M } from "react";
3
+ import { Modal as _ } from "../Modal/Modal.js";
4
+ import { ProductSelected as v } from "./components/ProductSelected.js";
5
+ import { SimilarProducts as L } from "./components/SimilarProducts.js";
6
+ import { ModalFooter as T } from "./components/ModalFooter.js";
7
+ /* empty css */import { getProductsSimilars as $ } from "./api/getProductsSimilars.js";
8
+ import z from "../../hooks/useAnalitcsEvents.js";
9
+ import { NoSimilarProduct as B } from "./components/NoSimilarProduct.js";
10
+ import { getOrderForm as G } from "./api/getOrderForm.js";
11
+ import { postChangeOrder as H } from "./api/postChangeOrder.js";
12
+ import { Skeleton as K } from "../Skeleton/index.js";
13
+ const ao = ({
14
+ selectedItem: o,
15
+ postalCode: S,
16
+ orderFormId: d,
17
+ isClubClient: O,
18
+ isOpen: y,
19
19
  environment: b,
20
20
  setIsOpen: p,
21
- saveSelectedSimilarProduct: m,
22
- account: u
21
+ saveSelectedSimilarProduct: c,
22
+ getOrderFormMutation: l,
23
+ getProductsSimilarsMutation: C,
24
+ postChangeOrderMutation: F
23
25
  }) => {
24
- const [e, P] = l(), [C, s] = l(!1), a = b === "io", { genericTaggingEvent: F } = _(), [o, g] = l({ itemId: "" });
25
- return M(() => {
26
+ const [s, P] = f(), [x, m] = f(!1), r = b === "io", { genericTaggingEvent: N } = z(), [t, g] = f({ itemId: "" });
27
+ M(() => {
26
28
  (async () => {
27
- s(!0);
29
+ m(!0);
28
30
  try {
29
- const i = await E({
30
- postalCode: h,
31
- selectedItem: r,
32
- isIO: a,
33
- account: u
34
- }), d = (i == null ? void 0 : i.products) || [];
35
- P(d);
31
+ const i = await $({
32
+ postalCode: S,
33
+ selectedItem: o,
34
+ isIO: r,
35
+ getProductsSimilarsMutation: C
36
+ }), u = (i == null ? void 0 : i.products) || [];
37
+ P(u);
36
38
  } finally {
37
- s(!1);
39
+ m(!1);
38
40
  }
39
41
  })(), (async () => {
40
- var i, d;
41
- s(!0);
42
+ var i, u;
43
+ m(!0);
42
44
  try {
43
- const f = await L(c, a, u), t = ((d = (i = f == null ? void 0 : f.customData) == null ? void 0 : i.customApps) == null ? void 0 : d.find(
44
- (j) => j.id === "janis"
45
+ const q = r && G(d, r), w = l && await l({
46
+ input: {
47
+ orderFormId: d
48
+ }
49
+ }) || { getOrderForm: { data: "" } }, e = r ? q : JSON.parse(w.getOrderForm.data), n = ((u = (i = e == null ? void 0 : e.customData) == null ? void 0 : i.customApps) == null ? void 0 : u.find(
50
+ (A) => A.id === "janis"
45
51
  )) || null;
46
- let S = {};
47
- t != null && t.fields.idSubstitutionCriterias && (S = JSON.parse(
48
- t == null ? void 0 : t.fields.idSubstitutionCriterias
52
+ let h = {};
53
+ n != null && n.fields.idSubstitutionCriterias && (h = JSON.parse(
54
+ n == null ? void 0 : n.fields.idSubstitutionCriterias
49
55
  ));
50
- const x = r == null ? void 0 : r.productOriginId;
56
+ const k = o == null ? void 0 : o.productOriginId;
51
57
  g({
52
- itemId: `${S[x]}`
58
+ itemId: `${h[k]}`
53
59
  });
54
60
  } finally {
55
- s(!1);
61
+ m(!1);
56
62
  }
57
63
  })();
58
- }, []), /* @__PURE__ */ n(
59
- N,
64
+ }, []);
65
+ const j = () => {
66
+ H(
67
+ d,
68
+ r,
69
+ o.productOriginId,
70
+ t.itemId,
71
+ F
72
+ ), t && (c == null || c(t), N("salvar_substituto", {
73
+ name: o.name,
74
+ replacement_item: t == null ? void 0 : t.name
75
+ })), p(!1);
76
+ };
77
+ return /* @__PURE__ */ a(
78
+ _,
60
79
  {
61
- isOpen: O,
80
+ isOpen: y,
62
81
  setIsOpen: p,
63
82
  className: "change-order-modal",
64
83
  title: "Produto com estoque baixo",
65
- Footer: /* @__PURE__ */ n(
66
- A,
84
+ Footer: s && s.length > 0 && /* @__PURE__ */ a(
85
+ T,
67
86
  {
68
- saveSelectedSimilarProduct: () => {
69
- T(
70
- c,
71
- a,
72
- r.productOriginId,
73
- o.itemId,
74
- u
75
- ), o && (m == null || m(o), F("salvar_substituto", {
76
- name: r.name,
77
- replacement_item: o == null ? void 0 : o.name
78
- })), p(!1);
79
- }
87
+ saveSelectedSimilarProduct: j
80
88
  }
81
89
  ),
82
- children: C ? /* @__PURE__ */ n(
83
- $,
90
+ children: x ? /* @__PURE__ */ a(
91
+ K,
84
92
  {
85
- width: a ? "100%" : "90%",
86
- height: a ? 600 : 425,
93
+ width: r ? "100%" : "90%",
94
+ height: r ? 600 : 425,
87
95
  backgroundColor: "var(--color-grayScale-faded)",
88
96
  margin: "auto",
89
97
  animation: !0
90
98
  }
91
- ) : /* @__PURE__ */ q(w, { children: [
92
- r && /* @__PURE__ */ n(k, { selectedItem: r }),
93
- e && e.length > 0 ? /* @__PURE__ */ n(
94
- v,
99
+ ) : /* @__PURE__ */ E(J, { children: [
100
+ o && /* @__PURE__ */ a(v, { selectedItem: o }),
101
+ s && s.length > 0 ? /* @__PURE__ */ a(
102
+ L,
95
103
  {
96
- isClubClient: y,
97
- similarProductSelect: o,
104
+ isClubClient: O,
105
+ similarProductSelect: t,
98
106
  setSimilarProductSelect: g,
99
- products: e
107
+ products: s
100
108
  }
101
- ) : /* @__PURE__ */ n(J, {})
109
+ ) : /* @__PURE__ */ a(B, {})
102
110
  ] })
103
111
  }
104
112
  );
105
113
  };
106
114
  export {
107
- or as ChangeOrderModal
115
+ ao as ChangeOrderModal
108
116
  };
@@ -1 +1 @@
1
- export declare const getOrderForm: (orderFormId: string, isIO: boolean, account: string) => Promise<any>;
1
+ export declare const getOrderForm: (orderFormId: string, isIO: boolean) => Promise<any>;
@@ -1,18 +1,16 @@
1
- import o from "axios";
2
- const i = async (t, a, e) => {
1
+ import e from "axios";
2
+ const c = async (o, t) => {
3
3
  try {
4
- if (a) {
5
- const { data: c } = await o.post(
6
- `/api/checkout/pub/orderForm/${t}`
4
+ if (t) {
5
+ const { data: r } = await e.post(
6
+ `/api/checkout/pub/orderForm/${o}`
7
7
  );
8
- return c;
8
+ return r;
9
9
  }
10
- const { data: r } = await o.get(`https://${e}.myvtex.com/api/checkout/pub/orderForm/${t}`);
11
- return r;
12
10
  } catch (r) {
13
11
  console.error("Error in Change Order Modal", r);
14
12
  }
15
13
  };
16
14
  export {
17
- i as getOrderForm
15
+ c as getOrderForm
18
16
  };
@@ -4,10 +4,12 @@ interface GetProductsSimilarsProps {
4
4
  postalCode: string;
5
5
  isIO: boolean;
6
6
  selectedItem: SelectedItemProps;
7
- account: string;
7
+ getProductsSimilarsMutation?: (variables: {}) => Promise<GetProductsSimilarsResponse>;
8
8
  }
9
- export declare const getProductsSimilars: ({ postalCode, isIO, selectedItem, account }: GetProductsSimilarsProps) => Promise<{
10
- productOrigin: string;
11
- products: import('../../../main').SimilarProducts[];
12
- } | undefined>;
9
+ export interface GetProductsSimilarsResponse {
10
+ getProductsSimilars: {
11
+ data: string;
12
+ };
13
+ }
14
+ export declare const getProductsSimilars: ({ postalCode, isIO, selectedItem, getProductsSimilarsMutation }: GetProductsSimilarsProps) => Promise<any>;
13
15
  export {};
@@ -1,27 +1,34 @@
1
- import n from "axios";
2
- const f = async ({
3
- postalCode: a,
1
+ import c from "axios";
2
+ const P = async ({
3
+ postalCode: n,
4
4
  isIO: u,
5
5
  selectedItem: r,
6
- account: s
6
+ getProductsSimilarsMutation: a
7
7
  }) => {
8
8
  try {
9
9
  if (u) {
10
- const { data: o } = await n.get(
11
- `/_v/commerce/products/productsSimilar?postalCode=${a}&skus=${r == null ? void 0 : r.productOriginId}&field=sku`
10
+ const { data: o } = await c.get(
11
+ `/_v/commerce/products/productsSimilar?postalCode=${n}&skus=${r == null ? void 0 : r.productOriginId}&field=sku`
12
12
  ), { similarProducts: p } = o;
13
13
  return p.find(
14
- (d) => d.productOrigin === (r == null ? void 0 : r.productOriginId)
14
+ (s) => s.productOrigin === (r == null ? void 0 : r.productOriginId)
15
15
  );
16
16
  }
17
- const { data: i } = await n.get(`https://${s}.myvtex.com/_v/commerce/products/productsSimilar?postalCode=${a}&skus=${r == null ? void 0 : r.productOriginId}&field=sku`), { similarProducts: c } = i;
18
- return c.find(
17
+ const i = a && await a({
18
+ input: {
19
+ postalCode: n,
20
+ productOriginId: r == null ? void 0 : r.productOriginId
21
+ }
22
+ });
23
+ return i ? JSON.parse(
24
+ i == null ? void 0 : i.getProductsSimilars.data
25
+ ).similarProducts.find(
19
26
  (o) => o.productOrigin === r.productOriginId
20
- );
27
+ ) : void 0;
21
28
  } catch (i) {
22
29
  console.error("Error in Change Order Modal", i);
23
30
  }
24
31
  };
25
32
  export {
26
- f as getProductsSimilars
33
+ P as getProductsSimilars
27
34
  };
@@ -1 +1,6 @@
1
- export declare const postChangeOrder: (orderFormId: string, isIO: boolean, skuId: string, substitutionId: string, account: string) => Promise<any>;
1
+ export interface PostChangeOrderMutationResponse {
2
+ postChangeOrder: {
3
+ data: string;
4
+ };
5
+ }
6
+ export declare const postChangeOrder: (orderFormId: string, isIO: boolean, skuId: string, substitutionId: string, postChangeOrderMutation?: (variables: {}) => Promise<PostChangeOrderMutationResponse>) => Promise<any>;
@@ -1,26 +1,26 @@
1
- import o from "axios";
2
- const h = async (e, t, a, c, n) => {
1
+ import s from "axios";
2
+ const p = async (o, e, n, c, t) => {
3
3
  try {
4
4
  const r = {
5
- orderFormId: e,
6
- skuId: a,
5
+ orderFormId: o,
6
+ skuId: n,
7
7
  substitutionId: c
8
8
  };
9
- if (t) {
10
- const { data: s } = await o.post(
9
+ if (e) {
10
+ const { data: d } = await s.post(
11
11
  "/_v/commerce/orderform/changeOrder",
12
12
  r
13
13
  );
14
- return s;
14
+ return d;
15
15
  }
16
- const { data: d } = await o.post(`https://${n}.myvtex.com/_v/commerce/orderform/changeOrder`, {
17
- body: r
16
+ const a = t && await t({
17
+ input: r
18
18
  });
19
- return d;
19
+ return a ? JSON.parse(a == null ? void 0 : a.postChangeOrder.data) : void 0;
20
20
  } catch (r) {
21
21
  console.error("Error in Change Order Modal", r);
22
22
  }
23
23
  };
24
24
  export {
25
- h as postChangeOrder
25
+ p as postChangeOrder
26
26
  };
@@ -12,6 +12,9 @@ interface CouponsProps {
12
12
  disableFirstEmptyModal?: boolean;
13
13
  couponsList?: CouponType[];
14
14
  qtdCouponsView?: number;
15
+ getCouponsMutation?: any;
16
+ addCouponMutation?: any;
17
+ removeCouponMutation?: any;
15
18
  }
16
- export declare const Coupons: ({ orderFormId, hasItemsInCart, builder, account, isIO, closeIOModal, activeOrderFormCoupon, genericTaggingEvent, disableFirstEmptyModal, couponsList, qtdCouponsView }: CouponsProps) => import("react/jsx-runtime").JSX.Element;
19
+ export declare const Coupons: ({ orderFormId, hasItemsInCart, builder, account, isIO, closeIOModal, activeOrderFormCoupon, genericTaggingEvent, disableFirstEmptyModal, couponsList, qtdCouponsView, getCouponsMutation, addCouponMutation, removeCouponMutation }: CouponsProps) => import("react/jsx-runtime").JSX.Element;
17
20
  export {};
@@ -1,103 +1,113 @@
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 t, jsxs as P } from "react/jsx-runtime";
2
+ import { useState as e, useEffect as j } 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 eo = ({
10
+ orderFormId: A,
11
+ hasItemsInCart: f,
12
+ builder: l,
13
+ account: w,
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: C,
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(() => {
26
- n && R(n);
27
- }, [n]), S(() => {
25
+ const [k, N] = e(!0), [z, a] = e([]), [u, c] = e("coupons-view"), [B, d] = e(!1), [y, v] = e(!1), [R, V] = e(""), [m, S] = e(""), [E, x] = e(
26
+ !J
27
+ ), [G, H] = e();
28
+ return j(() => {
29
+ n && V(n);
30
+ }, [n]), j(() => {
28
31
  (async () => {
29
- C(!0);
32
+ N(!0);
30
33
  try {
31
- const i = await E(f, j, l);
32
- if (w) {
33
- const z = i.slice(0, w);
34
- p(z);
34
+ const i = o ? await Z(w, l, p) : await q({
35
+ input: {
36
+ builder: l,
37
+ couponsList: p
38
+ }
39
+ }), h = o ? i : JSON.parse(i.getCoupons.data).coupons;
40
+ if (C) {
41
+ const K = h.slice(0, C);
42
+ a(K);
35
43
  return;
36
44
  }
37
- p(i);
45
+ a(h);
38
46
  return;
39
47
  } catch (i) {
40
- p([]);
48
+ a([]);
41
49
  } finally {
42
- C(!1);
50
+ N(!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__ */ t("div", { className: "coupons-container", children: /* @__PURE__ */ t(
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: [
60
+ ) }) : /* @__PURE__ */ P("div", { className: "coupons-container", children: [
53
61
  (!o || o && u === "coupons-view") && /* @__PURE__ */ t(
54
- H,
62
+ U,
55
63
  {
56
- orderFormId: h,
57
- hasItemsInCart: a,
58
- account: f,
64
+ removeCouponMutation: L,
65
+ addCouponMutation: D,
66
+ orderFormId: A,
67
+ hasItemsInCart: f,
68
+ account: w,
59
69
  isIO: o,
60
70
  closeIOModal: r,
61
- coupons: q,
62
- firstCouponName: v,
71
+ coupons: z,
72
+ firstCouponName: R,
63
73
  secondCouponName: m,
64
- replaceCoupon: N,
74
+ replaceCoupon: y,
65
75
  setView: c,
66
- setFirstCouponName: R,
67
- setSecondCouponName: V,
68
- setActiveRule: y,
69
- setDataItem: k,
70
- setReplaceCoupon: d,
76
+ setFirstCouponName: V,
77
+ setSecondCouponName: S,
78
+ setActiveRule: d,
79
+ setDataItem: H,
80
+ setReplaceCoupon: v,
71
81
  setIsCloseModalEmpty: x,
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__ */ t(
86
+ W,
77
87
  {
78
- dataItem: b,
79
- setActiveRule: y,
88
+ dataItem: G,
89
+ setActiveRule: d,
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 && !y && /* @__PURE__ */ t(
97
+ X,
88
98
  {
89
- firstCouponName: v,
99
+ firstCouponName: R,
90
100
  secondCouponName: m,
91
101
  setView: c,
92
- setReplaceCoupon: d,
93
- setSecondCouponName: V,
102
+ setReplaceCoupon: v,
103
+ setSecondCouponName: S,
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__ */ t(
110
+ Y,
101
111
  {
102
112
  setIsCloseModalEmpty: x,
103
113
  genericTaggingEvent: s
@@ -106,5 +116,5 @@ import { EmptyCartView as Q } from "./views/EmptyCartView.js";
106
116
  ] });
107
117
  };
108
118
  export {
109
- I as Coupons
119
+ eo as Coupons
110
120
  };
@@ -1,14 +1,14 @@
1
- import s from "axios";
2
- const n = async (o, t, a) => {
3
- const { data: r } = await s.post(
4
- `https://${o}.myvtex.com/_v/faststoreapi/coupon/order`,
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`,
5
5
  {
6
6
  orderFormId: t,
7
7
  couponId: a
8
8
  }
9
9
  );
10
- return r;
10
+ return p;
11
11
  };
12
12
  export {
13
- n as addCoupon
13
+ s as addCoupon
14
14
  };
@@ -1,8 +1,8 @@
1
- import a from "axios";
2
- const m = async (s, n, t) => {
3
- const o = `https://${s}.myvtex.com/_v/faststoreapi/coupon/list`, r = Math.random(), { data: p } = t ? await a.post(o, { couponsList: t }) : await a.get(o, { params: { builder: n, random: r } });
4
- return p.coupons;
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 } });
4
+ return r.coupons;
5
5
  };
6
6
  export {
7
- m as getCoupons
7
+ e as getCoupons
8
8
  };
@@ -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: ({ account, 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;