@plurix/ecom-components 1.14.1-COM-1442.2 → 1.14.1-bugfix-1891.0

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 (53) hide show
  1. package/dist/node_modules/@faststore/components/dist/esm/atoms/Button/Button.js +45 -0
  2. package/dist/node_modules/@faststore/components/dist/esm/atoms/Loader/Loader.js +34 -0
  3. package/dist/node_modules/@faststore/components/dist/esm/molecules/IconButton/IconButton.js +29 -0
  4. package/dist/packages/Carousel/Carousel.js +1 -1
  5. package/dist/packages/CartClubAlert/CartClubAlert.js +1 -1
  6. package/dist/packages/ChangeOrderModal/ChangeOrderModal.d.ts +1 -12
  7. package/dist/packages/ChangeOrderModal/ChangeOrderModal.js +67 -78
  8. package/dist/packages/ChangeOrderModal/api/getOrderForm.js +15 -6
  9. package/dist/packages/ChangeOrderModal/api/getProductsSimilars.d.ts +4 -7
  10. package/dist/packages/ChangeOrderModal/api/getProductsSimilars.js +21 -22
  11. package/dist/packages/ChangeOrderModal/api/postChangeOrder.d.ts +1 -6
  12. package/dist/packages/ChangeOrderModal/api/postChangeOrder.js +17 -11
  13. package/dist/packages/Coupons/Coupons.d.ts +1 -4
  14. package/dist/packages/Coupons/Coupons.js +57 -67
  15. package/dist/packages/Coupons/components/CouponCard.d.ts +1 -3
  16. package/dist/packages/Coupons/components/CouponCard.js +83 -94
  17. package/dist/packages/Coupons/views/CouponsView.d.ts +1 -3
  18. package/dist/packages/Coupons/views/CouponsView.js +78 -87
  19. package/dist/packages/Coupons/views/LoadingView.js +6 -6
  20. package/dist/packages/Modal/Modal.js +1 -1
  21. package/dist/packages/Onboarding/Onboarding.js +1 -1
  22. package/dist/packages/ProductCard/ProductCardBadge/ProductCardBadgeKg.js +10 -13
  23. package/dist/packages/ProductCard/ProductCardBadge/ProductCardDiscountBadge.d.ts +2 -3
  24. package/dist/packages/ProductCard/ProductCardBadge/ProductCardDiscountBadge.js +31 -15
  25. package/dist/packages/ProductCard/ProductCardButton/AddToCartButton.js +1 -1
  26. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/index.d.ts +2 -17
  27. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/index.js +1 -1
  28. package/dist/packages/ProductCard/ProductCardButton/QuantitySelector.js +6 -6
  29. package/dist/packages/ProductCard/ProductCardHorizontal/index.js +30 -31
  30. package/dist/packages/ProductCard/ProductCardPrice/index.d.ts +1 -8
  31. package/dist/packages/ProductCard/ProductCardPrice/index.js +31 -27
  32. package/dist/packages/ProductCard/ProductCardVertical/index.js +15 -16
  33. package/dist/packages/ProductCard/index.js +1 -1
  34. package/dist/packages/ProductCardSeeMore/ProductCardSeeMore.js +1 -1
  35. package/dist/packages/Regionalization/Regionalization.d.ts +1 -1
  36. package/dist/packages/Regionalization/Regionalization.js +13 -15
  37. package/dist/packages/Regionalization/context/RegionalizationContext.d.ts +1 -1
  38. package/dist/packages/Regionalization/context/RegionalizationContext.js +29 -31
  39. package/dist/packages/Regionalization/types/RegionalizationProps.d.ts +0 -1
  40. package/dist/packages/Regionalization/views/AllStoresScreen.js +21 -21
  41. package/dist/packages/Regionalization/views/InitialView.js +26 -24
  42. package/dist/packages/Tour/Tour.js +1 -1
  43. package/dist/styles/product-card.global.css +1 -1
  44. package/dist/styles/regionalization.global.css +1 -1
  45. package/dist/types/ProductCard.d.ts +12 -13
  46. package/dist/utils/changerOrderModal.js +16 -13
  47. package/package.json +71 -69
  48. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/Button.d.ts +0 -18
  49. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/Button.js +0 -80
  50. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/IconButton.d.ts +0 -10
  51. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/IconButton.js +0 -61
  52. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/Loader.d.ts +0 -8
  53. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/Loader.js +0 -44
@@ -1,14 +1,14 @@
1
1
  import { jsxs as a, Fragment as n, jsx as r } from "react/jsx-runtime";
2
- import { ModalHeader as i } from "../components/ModalHeader.js";
3
- import { ModalFooter as m } from "../components/ModalFooter.js";
4
- import { Skeleton as u } from "../../Skeleton/index.js";
2
+ import { Skeleton as i } from "@acctglobal/skeleton";
3
+ import { ModalHeader as m } from "../components/ModalHeader.js";
4
+ import { ModalFooter as u } from "../components/ModalFooter.js";
5
5
  const f = ({
6
6
  isIO: t = !1,
7
7
  closeIOModal: o,
8
8
  genericTaggingEvent: e
9
9
  }) => /* @__PURE__ */ a(n, { children: [
10
10
  t && o && /* @__PURE__ */ r(
11
- i,
11
+ m,
12
12
  {
13
13
  closeModal: o,
14
14
  title: "Meus Cupons",
@@ -16,7 +16,7 @@ const f = ({
16
16
  }
17
17
  ),
18
18
  /* @__PURE__ */ r(
19
- u,
19
+ i,
20
20
  {
21
21
  width: t ? "100%" : "90%",
22
22
  height: t ? 600 : 425,
@@ -26,7 +26,7 @@ const f = ({
26
26
  }
27
27
  ),
28
28
  t && o && /* @__PURE__ */ r(
29
- m,
29
+ u,
30
30
  {
31
31
  isFloating: !0,
32
32
  cancelButtonAction: o,
@@ -3,7 +3,7 @@ import { useRef as s, useEffect as p } from "react";
3
3
  import { ArrowIcon as g } from "../../assets/svgs/ArrowIcon.js";
4
4
  import { CloseIcon as k } from "../../assets/svgs/CloseIcon.js";
5
5
  import { HAS_WINDOW as v } from "../../constants/index.js";
6
- /* empty css */const R = (w) => {
6
+ /* empty css */const R = (w) => {
7
7
  const {
8
8
  isOpen: r,
9
9
  setIsOpen: C,
@@ -4,7 +4,7 @@ import { Header as x } from "./components/Header.js";
4
4
  import { Content as S } from "./components/Content.js";
5
5
  import { Footer as c } from "./components/Footer.js";
6
6
  import { TIPS_LENGTH as h } from "./constants/tips.js";
7
- /* empty css */const w = ({
7
+ /* empty css */const w = ({
8
8
  socialMediaLinks: a,
9
9
  handleCloseAction: r,
10
10
  handleFinishAction: n,
@@ -1,18 +1,15 @@
1
- import { jsx as a, jsxs as g } from "react/jsx-runtime";
2
- import { useEffect as o } from "react";
3
- const f = ({
4
- measurementUnit: c,
5
- setIsShowProductBadge: r,
6
- unitMultiplier: d
7
- }) => (o(() => {
8
- c !== "un" && (d < 1 || d >= 1) && r(!0);
9
- }, [c, d, r]), c === "un" ? null : d < 1 ? /* @__PURE__ */ a("div", { className: "product-card-badge", children: /* @__PURE__ */ g("p", { className: "product-card-badge-kg", children: [
10
- d * 1e3,
1
+ import { jsx as a, jsxs as c } from "react/jsx-runtime";
2
+ const g = ({
3
+ measurementUnit: e,
4
+ setIsShowProductBadge: d,
5
+ unitMultiplier: r
6
+ }) => e === "un" ? null : r < 1 ? (d(!0), /* @__PURE__ */ a("div", { className: "product-card-badge", children: /* @__PURE__ */ c("p", { className: "product-card-badge-kg", children: [
7
+ r * 1e3,
11
8
  "g"
12
- ] }) }) : /* @__PURE__ */ a("div", { className: "product-card-badge", children: /* @__PURE__ */ g("p", { className: "product-card-badge-kg", children: [
13
- d,
9
+ ] }) })) : (r >= 1 && d(!0), /* @__PURE__ */ a("div", { className: "product-card-badge", children: /* @__PURE__ */ c("p", { className: "product-card-badge-kg", children: [
10
+ r,
14
11
  "kg"
15
12
  ] }) }));
16
13
  export {
17
- f as ProductCardBadgeKg
14
+ g as ProductCardBadgeKg
18
15
  };
@@ -1,4 +1,4 @@
1
- import { SkuSpecificationsProps, ProductCardProps, offers } from '../../../types/ProductCard';
1
+ import { SkuSpecificationsProps, ProductCardProps } from '../../../types/ProductCard';
2
2
 
3
3
  interface ProductCardDiscountBadge {
4
4
  skuSpecifications: SkuSpecificationsProps[];
@@ -8,7 +8,6 @@ interface ProductCardDiscountBadge {
8
8
  hasPromotionalPrice: ProductCardProps['hasPromotionalPrice'];
9
9
  defaultScListPrice?: number;
10
10
  setIsShowProductBadge: React.Dispatch<React.SetStateAction<boolean>>;
11
- offers: offers;
12
11
  }
13
- export declare const ProductCardDiscountBadge: ({ offers, setIsShowProductBadge }: ProductCardDiscountBadge) => import("react/jsx-runtime").JSX.Element | null;
12
+ export declare const ProductCardDiscountBadge: ({ nativeListPrice, nativeSpotPrice, skuSpecifications, unitMultiplier, hasPromotionalPrice, defaultScListPrice, setIsShowProductBadge }: ProductCardDiscountBadge) => import("react/jsx-runtime").JSX.Element | null;
14
13
  export {};
@@ -1,26 +1,42 @@
1
- import { jsx as d, jsxs as i } from "react/jsx-runtime";
2
- import { useEffect as a, useMemo as m } from "react";
3
- const h = ({
4
- offers: n,
5
- setIsShowProductBadge: c
1
+ import { jsx as b, jsxs as x } from "react/jsx-runtime";
2
+ import { useMemo as l, useEffect as D } from "react";
3
+ const E = ({
4
+ nativeListPrice: c,
5
+ nativeSpotPrice: s,
6
+ skuSpecifications: n,
7
+ unitMultiplier: a,
8
+ hasPromotionalPrice: i,
9
+ defaultScListPrice: P,
10
+ setIsShowProductBadge: d
6
11
  }) => {
7
- const { listPrice: u, price: o } = n == null ? void 0 : n.offers[0], t = Math.round(
8
- Number(((r, e) => m(() => {
9
- const s = (r - e) * 100 / r;
10
- return Math.round(s);
11
- }, [e, r]))(u, o))
12
+ const { listPrice: u, spotPrice: o } = i || {}, f = (r, e) => l(() => {
13
+ const g = (r - e) * 100 / r;
14
+ return Math.round(g);
15
+ }, [e, r]), { listPriceCustom: m, spotPriceCustom: p } = l(() => u && o && o !== s ? {
16
+ listPriceCustom: u,
17
+ spotPriceCustom: o
18
+ } : {
19
+ listPriceCustom: c,
20
+ spotPriceCustom: s
21
+ }, [
22
+ u,
23
+ o,
24
+ s,
25
+ c
26
+ ]), C = "Venda por unidade", N = n == null ? void 0 : n.some((r) => r.field.originalName === C && r.values.some((e) => e.originalName === "true")), h = P || (N ? m : ((r) => Number(r.toString().match(/^\d+(?:\.\d{0,2})?/)))(m * a)), t = Math.round(
27
+ Number(f(h, p))
12
28
  );
13
- return a(() => {
29
+ return D(() => {
14
30
  if (!t || t <= 0) {
15
- c(!1);
31
+ d(!1);
16
32
  return;
17
33
  }
18
- c(!0);
19
- }, [t]), !t || t <= 0 ? null : /* @__PURE__ */ d("div", { className: "product-card-discount-badge", children: /* @__PURE__ */ i("p", { className: "product-card-discount-badge-value", children: [
34
+ d(!0);
35
+ }, [t]), !t || t <= 0 ? null : /* @__PURE__ */ b("div", { className: "product-card-discount-badge", children: /* @__PURE__ */ x("p", { className: "product-card-discount-badge-value", children: [
20
36
  t,
21
37
  "%"
22
38
  ] }) });
23
39
  };
24
40
  export {
25
- h as ProductCardDiscountBadge
41
+ E as ProductCardDiscountBadge
26
42
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
- import o from "./CustomQuantitySelector/Button.js";
2
+ import o from "../../../node_modules/@faststore/components/dist/esm/atoms/Button/Button.js";
3
3
  const n = ({ handleAddToCart: t }) => /* @__PURE__ */ a(
4
4
  o,
5
5
  {
@@ -1,21 +1,6 @@
1
- import { AriaAttributes, ButtonHTMLAttributes, InputHTMLAttributes, ReactNode } from 'react';
1
+ import { IconButtonProps } from '@faststore/ui';
2
+ import { InputHTMLAttributes } from 'react';
2
3
 
3
- interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
4
- testId?: string;
5
- variant?: 'primary' | 'secondary' | 'tertiary';
6
- size?: 'small' | 'regular';
7
- inverse?: boolean;
8
- disabled?: boolean;
9
- icon?: ReactNode;
10
- loading?: boolean;
11
- loadingLabel?: string;
12
- iconPosition?: 'left' | 'right';
13
- }
14
- export interface IconButtonProps extends Omit<ButtonProps, 'aria-label'> {
15
- testId?: string;
16
- icon: ReactNode;
17
- 'aria-label': AriaAttributes['aria-label'];
18
- }
19
4
  export interface QuantitySelectorProps extends InputHTMLAttributes<HTMLDivElement> {
20
5
  quantity: number | string;
21
6
  leftButtonProps: Omit<IconButtonProps, 'aria-label'>;
@@ -21,7 +21,7 @@ var m = (t, a) => {
21
21
  };
22
22
  import { jsxs as q, jsx as n } from "react/jsx-runtime";
23
23
  import { forwardRef as Q } from "react";
24
- import p from "./IconButton.js";
24
+ import p from "../../../../node_modules/@faststore/components/dist/esm/molecules/IconButton/IconButton.js";
25
25
  const A = Q(function(j, h) {
26
26
  var s = j, {
27
27
  quantity: a,
@@ -1,7 +1,7 @@
1
1
  import { jsx as t, jsxs as d, Fragment as c } from "react/jsx-runtime";
2
- import { memo as s } from "react";
3
- import h from "./CustomQuantitySelector/index.js";
4
- import { Skeleton as m } from "../../Skeleton/index.js";
2
+ import { Skeleton as s } from "@acctglobal/skeleton";
3
+ import { memo as h } from "react";
4
+ import m from "./CustomQuantitySelector/index.js";
5
5
  const p = ({
6
6
  hasUndQtd: i,
7
7
  decrease: r,
@@ -13,7 +13,7 @@ const p = ({
13
13
  }) => /* @__PURE__ */ t("div", { className: "input-add", "data-testid": "quantity-selector-container", children: o ? /* @__PURE__ */ d(c, { children: [
14
14
  !a && /* @__PURE__ */ t("div", { className: "product-add-text", children: /* @__PURE__ */ t("p", { children: "Produto adicionado" }) }),
15
15
  /* @__PURE__ */ t(
16
- h,
16
+ m,
17
17
  {
18
18
  measureUnit: o,
19
19
  quantity: i,
@@ -62,13 +62,13 @@ const p = ({
62
62
  }
63
63
  )
64
64
  ] }) : /* @__PURE__ */ t(
65
- m,
65
+ s,
66
66
  {
67
67
  width: 100,
68
68
  height: 40,
69
69
  backgroundColor: "var(--color-grayScale-faded)"
70
70
  }
71
- ) }), v = s(p);
71
+ ) }), v = h(p);
72
72
  export {
73
73
  v as default
74
74
  };
@@ -1,4 +1,4 @@
1
- import { jsx as r, jsxs as s } from "react/jsx-runtime";
1
+ import { jsx as t, jsxs as r } from "react/jsx-runtime";
2
2
  import { useState as v } from "react";
3
3
  import { ProductCardUnavailable as x } from "../ProducCardUnavailable/index.js";
4
4
  import { ProductCardBadgeKg as y } from "../ProductCardBadge/ProductCardBadgeKg.js";
@@ -7,7 +7,7 @@ import { ProductCardButton as b } from "../ProductCardButton/index.js";
7
7
  import { ProductCardImage as M } from "../ProductCardImage/index.js";
8
8
  import { ProductCardName as N } from "../ProductCardName/index.js";
9
9
  import { ProductCardPrice as O } from "../ProductCardPrice/index.js";
10
- import { ProductCardPromotionFlag as B } from "../ProductCardPromotionFlag/index.js";
10
+ import { ProductCardPromotionFlag as p } from "../ProductCardPromotionFlag/index.js";
11
11
  const G = ({
12
12
  hasPlusFriendBadge: a,
13
13
  promotion: i,
@@ -15,7 +15,7 @@ const G = ({
15
15
  hasPromotionalPrice: c,
16
16
  clubPrice: C,
17
17
  outOfStock: o,
18
- variant: t,
18
+ variant: s,
19
19
  defaultScListPrice: l,
20
20
  isClubClient: u,
21
21
  addToCartAction: P,
@@ -23,19 +23,19 @@ const G = ({
23
23
  productInCart: h,
24
24
  openModal: S
25
25
  }) => {
26
- var f, d;
27
- const [k, n] = v(!1);
26
+ var d, f;
27
+ const [k, m] = v(!1);
28
28
  if (o)
29
- return /* @__PURE__ */ r(
29
+ return /* @__PURE__ */ t(
30
30
  x,
31
31
  {
32
- image: (f = e.image) == null ? void 0 : f[0],
32
+ image: (d = e.image) == null ? void 0 : d[0],
33
33
  name: e.name,
34
34
  variant: "horizontal"
35
35
  }
36
36
  );
37
- const m = u && e.hasClubPrice;
38
- return /* @__PURE__ */ s(
37
+ const n = u && e.hasClubPrice;
38
+ return /* @__PURE__ */ r(
39
39
  "div",
40
40
  {
41
41
  className: "product-card-horizontal",
@@ -43,68 +43,67 @@ const G = ({
43
43
  backgroundColor: o ? "var(--color-grayScale-faded" : "#fff"
44
44
  },
45
45
  children: [
46
- /* @__PURE__ */ s(
46
+ /* @__PURE__ */ r(
47
47
  "div",
48
48
  {
49
49
  onClick: S,
50
50
  className: "product-card-section-product-horizontal",
51
51
  children: [
52
- /* @__PURE__ */ r(
52
+ /* @__PURE__ */ t(
53
53
  M,
54
54
  {
55
- isProductClubAndClient: m,
56
- variant: t,
55
+ isProductClubAndClient: n,
56
+ variant: s,
57
57
  hasPlusFriendBadge: a,
58
58
  promotion: i,
59
- image: (d = e.image) == null ? void 0 : d[0]
59
+ image: (f = e.image) == null ? void 0 : f[0]
60
60
  }
61
61
  ),
62
- /* @__PURE__ */ s(
62
+ /* @__PURE__ */ r(
63
63
  "div",
64
64
  {
65
65
  className: "product-card-horizontal-description",
66
66
  style: {
67
- backgroundColor: m ? "#FDF3DE" : "var(--color-grayScale-faded)"
67
+ backgroundColor: n ? "#FDF3DE" : "var(--color-grayScale-faded)"
68
68
  },
69
69
  children: [
70
- /* @__PURE__ */ s("div", { className: "product-card-section-name", children: [
71
- /* @__PURE__ */ r(N, { name: e.name }),
72
- /* @__PURE__ */ s(
70
+ /* @__PURE__ */ r("div", { className: "product-card-section-name", children: [
71
+ /* @__PURE__ */ t(N, { name: e.name }),
72
+ /* @__PURE__ */ r(
73
73
  "div",
74
74
  {
75
75
  className: "product-card-section-badge-horizontal",
76
76
  style: { display: k ? "" : "none" },
77
77
  children: [
78
- /* @__PURE__ */ r(
78
+ /* @__PURE__ */ t(
79
79
  y,
80
80
  {
81
81
  unitMultiplier: e.unitMultiplier,
82
82
  skuSpecifications: e.skuSpecifications,
83
83
  measurementUnit: e.measurementUnit,
84
- setIsShowProductBadge: n
84
+ setIsShowProductBadge: m
85
85
  }
86
86
  ),
87
- /* @__PURE__ */ r(
87
+ /* @__PURE__ */ t(
88
88
  z,
89
89
  {
90
- offers: e.offers,
91
90
  defaultScListPrice: l,
92
91
  nativeListPrice: e.customOffers.listPriceCustom,
93
92
  nativeSpotPrice: e.customOffers.spotPriceCustom,
94
93
  skuSpecifications: e.skuSpecifications,
95
94
  unitMultiplier: e.unitMultiplier,
96
95
  hasPromotionalPrice: c,
97
- setIsShowProductBadge: n
96
+ setIsShowProductBadge: m
98
97
  }
99
98
  )
100
99
  ]
101
100
  }
102
101
  )
103
102
  ] }),
104
- t === "horizontal" && /* @__PURE__ */ r(
105
- B,
103
+ s === "horizontal" && /* @__PURE__ */ t(
104
+ p,
106
105
  {
107
- variant: t,
106
+ variant: s,
108
107
  productSectionBadge: {
109
108
  text: i == null ? void 0 : i.flagText,
110
109
  color: {
@@ -114,7 +113,7 @@ const G = ({
114
113
  }
115
114
  }
116
115
  ),
117
- /* @__PURE__ */ r(
116
+ /* @__PURE__ */ t(
118
117
  O,
119
118
  {
120
119
  isClubClient: u,
@@ -126,7 +125,7 @@ const G = ({
126
125
  listPriceCustom: e.customOffers.listPriceCustom,
127
126
  hasDiscount: e.customOffers.hasDiscount,
128
127
  spotPriceCustom: e.customOffers.spotPriceCustom,
129
- spotPriceKg: e.customOffers.spotPriceKg
128
+ spotPriceKg: e.customOffers.spotPriceCustom
130
129
  },
131
130
  defaultScListPrice: l,
132
131
  clubPrice: C,
@@ -139,13 +138,13 @@ const G = ({
139
138
  ]
140
139
  }
141
140
  ),
142
- /* @__PURE__ */ r(
141
+ /* @__PURE__ */ t(
143
142
  b,
144
143
  {
145
144
  addToCartAction: P,
146
145
  quantitySelectorAction: g,
147
146
  productInCart: h,
148
- layout: t
147
+ layout: s
149
148
  }
150
149
  )
151
150
  ]
@@ -20,12 +20,5 @@ interface ProductCardPricesProps {
20
20
  unitMultiplier: number;
21
21
  hasPlusFriendBadge?: boolean;
22
22
  }
23
- export declare const ProductCardPrice: ({ clubPrice, unitMultiplier, customOffers, measurementUnit, isClubClient, hasPlusFriendBadge }: ProductCardPricesProps) => import("react/jsx-runtime").JSX.Element;
24
- interface getPriceToShowParams {
25
- spotPriceKg: number | undefined | null;
26
- unitMultiplier: number;
27
- measurementUnit?: string;
28
- spotPriceCustom: number;
29
- }
30
- export declare const getPriceToShow: ({ spotPriceKg, unitMultiplier, measurementUnit, spotPriceCustom }: getPriceToShowParams) => number | null | undefined;
23
+ export declare const ProductCardPrice: ({ skuSpecifications, hasPromotionalPrice, clubPrice, unitMultiplier, defaultScListPrice, customOffers, measurementUnit, isClubClient, hasPlusFriendBadge }: ProductCardPricesProps) => import("react/jsx-runtime").JSX.Element;
31
24
  export {};
@@ -1,35 +1,39 @@
1
- import { jsx as e, Fragment as g, jsxs as a } from "react/jsx-runtime";
2
- const m = ({
3
- clubPrice: c,
4
- unitMultiplier: t,
1
+ import { jsx as e, Fragment as j, jsxs as p } from "react/jsx-runtime";
2
+ import { useMemo as I } from "react";
3
+ const U = ({
4
+ skuSpecifications: t,
5
+ hasPromotionalPrice: C,
6
+ clubPrice: i,
7
+ unitMultiplier: h,
8
+ defaultScListPrice: n,
5
9
  customOffers: r,
6
- measurementUnit: n,
7
- isClubClient: d,
8
- hasPlusFriendBadge: p
10
+ measurementUnit: N,
11
+ isClubClient: g,
12
+ hasPlusFriendBadge: v
9
13
  }) => {
10
- const l = !!(c && c !== r.spotPriceCustom), o = (u) => u.toLocaleString("pt-br", { style: "currency", currency: "BRL" }), i = h({
11
- measurementUnit: n,
12
- spotPriceCustom: r.spotPriceCustom,
13
- spotPriceKg: r == null ? void 0 : r.spotPriceKg,
14
- unitMultiplier: t
15
- }), s = p ? "no + Amigo" : "no clube";
16
- return /* @__PURE__ */ e(g, { children: /* @__PURE__ */ a("div", { className: "product-card-price", children: [
17
- !d && l && c !== i && /* @__PURE__ */ e("div", { className: "product-card-club-price-container", children: /* @__PURE__ */ e("p", { className: "product-card-club-price", children: `${o(c || 0)} ${s}` }) }),
18
- /* @__PURE__ */ a("div", { className: "product-card-price-container", children: [
19
- r.listPriceCustom !== i && /* @__PURE__ */ e("p", { className: "product-card-old-price", children: /* @__PURE__ */ a("span", { children: [
14
+ const { listPrice: s, spotPrice: c } = C || {}, { listPriceCustom: m, spotPriceCustom: P } = I(() => s && c && c !== r.spotPriceCustom ? {
15
+ listPriceCustom: s,
16
+ spotPriceCustom: c
17
+ } : {
18
+ listPriceCustom: r.listPriceCustom,
19
+ spotPriceCustom: r.spotPriceCustom
20
+ }, [
21
+ s,
22
+ c,
23
+ r.spotPriceCustom,
24
+ r.listPriceCustom
25
+ ]), b = !!(i && i !== r.spotPriceCustom), B = !!(n && n !== P), l = (o) => o.toLocaleString("pt-br", { style: "currency", currency: "BRL" }), w = "Venda por unidade", u = t == null ? void 0 : t.some((o) => o.field.originalName === w && o.values.some((F) => F.originalName === "true")), x = N !== "un", a = n || (u ? m : ((o) => Number(o.toString().match(/^\d+(?:\.\d{0,2})?/)))(m * h)), y = v ? "no + Amigo" : "no clube", d = x && r.spotPriceKg && u ? r.spotPriceKg : P, D = (a > d || B) && a && d;
26
+ return /* @__PURE__ */ e(j, { children: /* @__PURE__ */ p("div", { className: "product-card-price", children: [
27
+ !g && b && /* @__PURE__ */ e("div", { className: "product-card-club-price-container", children: /* @__PURE__ */ e("p", { className: "product-card-club-price", children: `${l(i || 0)} ${y}` }) }),
28
+ /* @__PURE__ */ p("div", { className: "product-card-price-container", children: [
29
+ D && /* @__PURE__ */ e("p", { className: "product-card-old-price", children: /* @__PURE__ */ p("span", { children: [
20
30
  " ",
21
- o(r.listPriceCustom)
31
+ l(a)
22
32
  ] }) }),
23
- /* @__PURE__ */ e("p", { className: "product-card-new-price", children: o(i != null ? i : 0) })
33
+ /* @__PURE__ */ e("p", { className: "product-card-new-price", children: l(d) })
24
34
  ] })
25
35
  ] }) });
26
- }, h = ({
27
- spotPriceKg: c,
28
- unitMultiplier: t,
29
- measurementUnit: r,
30
- spotPriceCustom: n
31
- }) => r === "kg" && t < 1 ? n : r === "kg" ? c : n;
36
+ };
32
37
  export {
33
- m as ProductCardPrice,
34
- h as getPriceToShow
38
+ U as ProductCardPrice
35
39
  };
@@ -1,4 +1,4 @@
1
- import { jsx as e, jsxs as s } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
2
  import { useState as v } from "react";
3
3
  import { ProductCardUnavailable as O } from "../ProducCardUnavailable/index.js";
4
4
  import { ProductCardBadgeKg as M } from "../ProductCardBadge/ProductCardBadgeKg.js";
@@ -9,12 +9,12 @@ import { ProductCardName as U } from "../ProductCardName/index.js";
9
9
  import { ProductCardPrice as b } from "../ProductCardPrice/index.js";
10
10
  const V = ({
11
11
  hasPlusFriendBadge: r,
12
- promotion: f,
12
+ promotion: d,
13
13
  product: i,
14
14
  hasPromotionalPrice: o,
15
- clubPrice: d,
15
+ clubPrice: f,
16
16
  outOfStock: P,
17
- variant: t,
17
+ variant: s,
18
18
  defaultScListPrice: a,
19
19
  isClubClient: c,
20
20
  hasClub: p,
@@ -31,23 +31,23 @@ const V = ({
31
31
  {
32
32
  image: (u = i.image) == null ? void 0 : u[0],
33
33
  name: i.name,
34
- variant: t
34
+ variant: s
35
35
  }
36
36
  );
37
37
  const n = c && i.hasClubPrice;
38
- return /* @__PURE__ */ s("div", { id: "product-card", children: [
39
- /* @__PURE__ */ e("div", { className: "product-card", children: /* @__PURE__ */ s("div", { className: "product-card-container", onClick: C, children: [
38
+ return /* @__PURE__ */ t("div", { id: "product-card", children: [
39
+ /* @__PURE__ */ e("div", { className: "product-card", children: /* @__PURE__ */ t("div", { className: "product-card-container", onClick: C, children: [
40
40
  /* @__PURE__ */ e(
41
41
  D,
42
42
  {
43
43
  isProductClubAndClient: n,
44
- variant: t,
44
+ variant: s,
45
45
  hasPlusFriendBadge: r,
46
- promotion: f,
46
+ promotion: d,
47
47
  image: (l = i.image) == null ? void 0 : l[0]
48
48
  }
49
49
  ),
50
- /* @__PURE__ */ s(
50
+ /* @__PURE__ */ t(
51
51
  "div",
52
52
  {
53
53
  className: "product-card-description",
@@ -55,9 +55,9 @@ const V = ({
55
55
  backgroundColor: n ? "#FDF3DE" : "var(--color-grayScale-faded)"
56
56
  },
57
57
  children: [
58
- /* @__PURE__ */ s("div", { className: "product-card-section-name", children: [
58
+ /* @__PURE__ */ t("div", { className: "product-card-section-name", children: [
59
59
  /* @__PURE__ */ e(U, { name: i.name }),
60
- /* @__PURE__ */ s(
60
+ /* @__PURE__ */ t(
61
61
  "div",
62
62
  {
63
63
  className: "product-card-section-badge",
@@ -75,7 +75,6 @@ const V = ({
75
75
  /* @__PURE__ */ e(
76
76
  N,
77
77
  {
78
- offers: i.offers,
79
78
  defaultScListPrice: a,
80
79
  nativeListPrice: i.customOffers.listPriceCustom,
81
80
  nativeSpotPrice: i.customOffers.spotPriceCustom,
@@ -102,10 +101,10 @@ const V = ({
102
101
  listPriceCustom: i.customOffers.listPriceCustom,
103
102
  hasDiscount: i.customOffers.hasDiscount,
104
103
  spotPriceCustom: i.customOffers.spotPriceCustom,
105
- spotPriceKg: i.customOffers.spotPriceKg
104
+ spotPriceKg: i.customOffers.spotPriceCustom
106
105
  },
107
106
  defaultScListPrice: a,
108
- clubPrice: d,
107
+ clubPrice: f,
109
108
  hasPlusFriendBadge: r
110
109
  }
111
110
  )
@@ -119,7 +118,7 @@ const V = ({
119
118
  addToCartAction: g,
120
119
  quantitySelectorAction: S,
121
120
  productInCart: h,
122
- layout: t
121
+ layout: s
123
122
  }
124
123
  )
125
124
  ] });
@@ -1,7 +1,7 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
2
  import { ProductCardHorizontal as b } from "./ProductCardHorizontal/index.js";
3
3
  import { ProductCardVertical as g } from "./ProductCardVertical/index.js";
4
- /* empty css */const E = ({
4
+ /* empty css */const E = ({
5
5
  product: l,
6
6
  variant: r,
7
7
  hasPlusFriendBadge: C = !1,
@@ -1,6 +1,6 @@
1
1
  import { jsx as r, jsxs as a } from "react/jsx-runtime";
2
2
  import { ProductCardSeeMoreHorizontal as s } from "./ProductCardSeeMoreHorizontal.js";
3
- /* empty css */const l = ({
3
+ /* empty css */const l = ({
4
4
  text: e,
5
5
  link: o,
6
6
  taggingEvent: c,
@@ -1,3 +1,3 @@
1
1
  import { RegionalizationProps } from './types/RegionalizationProps';
2
2
 
3
- export declare const Regionalization: ({ setMethod, setPickupName, setCity, deliveryPrice, setUf, setPickupTimes, pricesAndHours, setModalOpen, inputPostalCode, setInputPostalCode, sendPostalCode, status, setStatus, pickupPoints, pickupConfirmScreenText, regionalizeCatalog, titleText, priceStockInformation, moreInfosText, textBackButton, confirmButton, editAddress, delivery, pickup, disabledSearch }: RegionalizationProps) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const Regionalization: ({ setMethod, setPickupName, setCity, deliveryPrice, setUf, setPickupTimes, pricesAndHours, setModalOpen, inputPostalCode, setInputPostalCode, sendPostalCode, status, setStatus, pickupPoints, pickupConfirmScreenText, regionalizeCatalog, titleText, priceStockInformation, moreInfosText, textBackButton, confirmButton, editAddress, delivery, pickup }: RegionalizationProps) => import("react/jsx-runtime").JSX.Element;