@plurix/ecom-components 1.14.2-commerce.8 → 1.14.2-shlo1445.1

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 (75) hide show
  1. package/dist/assets/svgs/ErrorIconV2.d.ts +1 -0
  2. package/dist/assets/svgs/ErrorIconV2.js +33 -0
  3. package/dist/assets/svgs/SuccessIconV2.d.ts +1 -0
  4. package/dist/assets/svgs/SuccessIconV2.js +30 -0
  5. package/dist/assets/svgs/WarningIconV2.d.ts +1 -0
  6. package/dist/assets/svgs/WarningIconV2.js +40 -0
  7. package/dist/hooks/useVerticalShelfCarouselProps.d.ts +4 -0
  8. package/dist/hooks/useVerticalShelfCarouselProps.js +14 -0
  9. package/dist/hooks/useWindowDimensions.d.ts +5 -0
  10. package/dist/hooks/useWindowDimensions.js +38 -0
  11. package/dist/main.d.ts +1 -0
  12. package/dist/main.js +19 -17
  13. package/dist/packages/AdaptiveCarousel/AdaptiveCarousel.d.ts +14 -0
  14. package/dist/packages/AdaptiveCarousel/AdaptiveCarousel.js +69 -0
  15. package/dist/packages/ChangeOrderModal/ChangeOrderModal.d.ts +12 -2
  16. package/dist/packages/ChangeOrderModal/ChangeOrderModal.js +79 -71
  17. package/dist/packages/ChangeOrderModal/api/getOrderForm.d.ts +1 -1
  18. package/dist/packages/ChangeOrderModal/api/getOrderForm.js +7 -9
  19. package/dist/packages/ChangeOrderModal/api/getProductsSimilars.d.ts +7 -5
  20. package/dist/packages/ChangeOrderModal/api/getProductsSimilars.js +18 -11
  21. package/dist/packages/ChangeOrderModal/api/postChangeOrder.d.ts +6 -1
  22. package/dist/packages/ChangeOrderModal/api/postChangeOrder.js +11 -11
  23. package/dist/packages/Coupons/Coupons.d.ts +4 -1
  24. package/dist/packages/Coupons/Coupons.js +67 -57
  25. package/dist/packages/Coupons/api/addCoupon.js +6 -6
  26. package/dist/packages/Coupons/api/getCoupons.js +5 -5
  27. package/dist/packages/Coupons/components/CouponCard.d.ts +3 -1
  28. package/dist/packages/Coupons/components/CouponCard.js +94 -83
  29. package/dist/packages/Coupons/views/CouponsView.d.ts +3 -1
  30. package/dist/packages/Coupons/views/CouponsView.js +87 -78
  31. package/dist/packages/ProductCard/ProductCardBadge/ProductCardBadgeKg.js +13 -10
  32. package/dist/packages/ProductCard/ProductCardBadge/ProductCardDiscountBadge.d.ts +3 -2
  33. package/dist/packages/ProductCard/ProductCardBadge/ProductCardDiscountBadge.js +15 -31
  34. package/dist/packages/ProductCard/ProductCardHorizontal/index.js +31 -30
  35. package/dist/packages/ProductCard/ProductCardPrice/index.d.ts +8 -1
  36. package/dist/packages/ProductCard/ProductCardPrice/index.js +27 -31
  37. package/dist/packages/ProductCard/ProductCardVertical/index.js +16 -15
  38. package/dist/packages/Regionalization/Regionalization.d.ts +1 -1
  39. package/dist/packages/Regionalization/Regionalization.js +15 -13
  40. package/dist/packages/Regionalization/context/RegionalizationContext.d.ts +1 -1
  41. package/dist/packages/Regionalization/context/RegionalizationContext.js +31 -29
  42. package/dist/packages/Regionalization/types/RegionalizationProps.d.ts +1 -0
  43. package/dist/packages/Regionalization/views/AllStoresScreen.js +21 -21
  44. package/dist/packages/VouchersRedeemed/VouchersRedeemed.d.ts +22 -0
  45. package/dist/packages/VouchersRedeemed/VouchersRedeemed.js +121 -0
  46. package/dist/packages/VouchersRedeemed/api/getCouponsCartonistByUser.d.ts +1 -0
  47. package/dist/packages/VouchersRedeemed/api/getCouponsCartonistByUser.js +20 -0
  48. package/dist/packages/VouchersRedeemed/components/StatusMessageTryApply/StatusMessageTryApply.d.ts +12 -0
  49. package/dist/packages/VouchersRedeemed/components/StatusMessageTryApply/StatusMessageTryApply.js +27 -0
  50. package/dist/packages/VouchersRedeemed/components/StatusMessageTryApply/index.d.ts +1 -0
  51. package/dist/packages/VouchersRedeemed/components/StatusMessageTryApply/index.js +4 -0
  52. package/dist/packages/VouchersRedeemed/components/VoucherRedeemedCard/VoucherRedeemedCard.d.ts +17 -0
  53. package/dist/packages/VouchersRedeemed/components/VoucherRedeemedCard/VoucherRedeemedCard.js +37 -0
  54. package/dist/packages/VouchersRedeemed/components/VoucherRedeemedCard/index.d.ts +1 -0
  55. package/dist/packages/VouchersRedeemed/components/VoucherRedeemedCard/index.js +4 -0
  56. package/dist/packages/VouchersRedeemed/components/VouchersRedeemedSkeleton/VouchersRedeemedSkeleton.d.ts +14 -0
  57. package/dist/packages/VouchersRedeemed/components/VouchersRedeemedSkeleton/VouchersRedeemedSkeleton.js +48 -0
  58. package/dist/packages/VouchersRedeemed/components/VouchersRedeemedSkeleton/index.d.ts +1 -0
  59. package/dist/packages/VouchersRedeemed/components/VouchersRedeemedSkeleton/index.js +4 -0
  60. package/dist/packages/VouchersRedeemed/data/validVouchers.d.ts +1 -0
  61. package/dist/packages/VouchersRedeemed/data/validVouchers.js +20 -0
  62. package/dist/packages/VouchersRedeemed/utils/getCouponPrice.d.ts +1 -0
  63. package/dist/packages/VouchersRedeemed/utils/getCouponPrice.js +8 -0
  64. package/dist/styles/adaptive-carousel.global.css +1 -0
  65. package/dist/styles/regionalization.global.css +1 -1
  66. package/dist/styles/vouchers-redeemed.global.css +1 -0
  67. package/dist/types/ProductCard.d.ts +13 -12
  68. package/dist/utils/carousel/carouselProps.d.ts +33 -0
  69. package/dist/utils/carousel/carouselProps.js +59 -0
  70. package/dist/utils/changerOrderModal.js +13 -16
  71. package/dist/utils/scroll/isScrollToEnd.d.ts +1 -0
  72. package/dist/utils/scroll/isScrollToEnd.js +4 -0
  73. package/dist/utils/setBoldTextParts.d.ts +1 -0
  74. package/dist/utils/setBoldTextParts.js +7 -0
  75. package/package.json +69 -69
@@ -0,0 +1 @@
1
+ export declare const ErrorIconV2: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,33 @@
1
+ import { jsxs as i, jsx as C } from "react/jsx-runtime";
2
+ const t = () => /* @__PURE__ */ i(
3
+ "svg",
4
+ {
5
+ width: "32",
6
+ height: "32",
7
+ viewBox: "0 0 32 32",
8
+ fill: "none",
9
+ xmlns: "http://www.w3.org/2000/svg",
10
+ children: [
11
+ /* @__PURE__ */ i("g", { clipPath: "url(#clip0_535_5347)", children: [
12
+ /* @__PURE__ */ C(
13
+ "path",
14
+ {
15
+ d: "M16.0547 2C8.40413 2 2 8.18127 2 15.9453C2 23.6421 8.34424 30 16.0547 30C23.8274 30 30 23.5875 30 15.9453C30 8.23771 23.7629 2 16.0547 2ZM16.0547 28.3703C9.20956 28.3703 3.62969 22.7904 3.62969 15.9453C3.62969 9.16051 9.20956 3.62969 16.0547 3.62969C22.8395 3.62969 28.3703 9.16051 28.3703 15.9453C28.3703 22.7904 22.8395 28.3703 16.0547 28.3703Z",
16
+ fill: "#B2000B"
17
+ }
18
+ ),
19
+ /* @__PURE__ */ C(
20
+ "path",
21
+ {
22
+ d: "M22.4401 18.96L19.526 15.9543L22.4351 13.0452C23.3947 12.0856 23.3947 10.5244 22.4351 9.5649C21.4756 8.6053 19.9142 8.60541 18.9548 9.5649L16.0457 12.4741L13.04 9.55993C12.08 8.6053 10.5225 8.607 9.56464 9.5649C8.60509 10.5244 8.60509 12.0857 9.56464 13.0452L12.4737 15.9543L9.55966 18.96C8.60509 19.9199 8.60673 21.4775 9.56464 22.4353C10.5225 23.3932 12.08 23.3949 13.04 22.4403L16.0457 19.5262L18.9548 22.4353C19.9142 23.3948 21.4756 23.3949 22.4351 22.4353C23.393 21.4775 23.3947 19.9199 22.4401 18.96ZM21.275 21.2752C20.9544 21.5959 20.4355 21.5959 20.1149 21.2752L16.6346 17.7949C16.3177 17.4781 15.8052 17.4741 15.4835 17.786L11.8938 21.2663C11.8908 21.2693 11.8878 21.2722 11.8848 21.2752C11.5642 21.5959 11.0453 21.5959 10.7247 21.2752C10.404 20.9546 10.4041 20.4358 10.7247 20.1152C10.7277 20.1122 10.7306 20.1091 10.7336 20.1061L14.2139 16.5164C14.5258 16.1947 14.5218 15.6822 14.205 15.3654L10.7247 11.8851C10.404 11.5644 10.404 11.0456 10.7247 10.725C11.0453 10.4044 11.5642 10.4044 11.8848 10.725C11.8878 10.728 11.8908 10.731 11.8938 10.7339L15.4835 14.2142C15.8054 14.5262 16.3178 14.5222 16.6346 14.2053L20.1149 10.725C20.4355 10.4044 20.9544 10.4044 21.275 10.725C21.5957 11.0457 21.5956 11.5644 21.275 11.8851L17.7947 15.3654C17.4779 15.6822 17.4739 16.1947 17.7858 16.5164L21.2661 20.1061C21.2691 20.1091 21.272 20.1122 21.275 20.1152C21.5957 20.4359 21.5957 20.9546 21.275 21.2752Z",
23
+ fill: "#B2000B"
24
+ }
25
+ )
26
+ ] }),
27
+ /* @__PURE__ */ C("defs", { children: /* @__PURE__ */ C("clipPath", { id: "clip0_535_5347", children: /* @__PURE__ */ C("rect", { width: "28", height: "28", fill: "white", transform: "translate(2 2)" }) }) })
28
+ ]
29
+ }
30
+ );
31
+ export {
32
+ t as ErrorIconV2
33
+ };
@@ -0,0 +1 @@
1
+ export declare const SuccessIconV2: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,30 @@
1
+ import { jsxs as s, jsx as C } from "react/jsx-runtime";
2
+ const i = () => /* @__PURE__ */ s(
3
+ "svg",
4
+ {
5
+ width: "32",
6
+ height: "32",
7
+ viewBox: "0 0 32 32",
8
+ fill: "none",
9
+ xmlns: "http://www.w3.org/2000/svg",
10
+ children: [
11
+ /* @__PURE__ */ C(
12
+ "path",
13
+ {
14
+ d: "M29.5869 5.26648C29.0362 4.71573 28.1435 4.71592 27.5933 5.26667L14.9419 17.9202L9.11396 12.092C8.56321 11.5414 7.67054 11.5413 7.12036 12.0918C6.56961 12.6424 6.56961 13.535 7.12017 14.0854L13.9451 20.9107C14.2096 21.1752 14.5681 21.3237 14.9421 21.3237C15.316 21.3237 15.6746 21.1752 15.9391 20.9107L29.5873 7.26008C30.1375 6.70971 30.1375 5.81704 29.5869 5.26648Z",
15
+ fill: "#177336"
16
+ }
17
+ ),
18
+ /* @__PURE__ */ C(
19
+ "path",
20
+ {
21
+ d: "M26.5431 14.3016C25.7645 14.3016 25.1333 14.9326 25.1333 15.7113V26.1567H4.81953V5.84297H20.904C21.6828 5.84297 22.3138 5.21196 22.3138 4.4332C22.3138 3.65464 21.6828 3.02344 20.904 3.02344H3.40976C2.6312 3.02344 2 3.65445 2 4.4332V27.5665C2 28.3453 2.6312 28.9763 3.40976 28.9763H26.5431C27.3218 28.9763 27.9528 28.3453 27.9528 27.5665V15.7113C27.9528 14.9328 27.3218 14.3016 26.5431 14.3016Z",
22
+ fill: "#177336"
23
+ }
24
+ )
25
+ ]
26
+ }
27
+ );
28
+ export {
29
+ i as SuccessIconV2
30
+ };
@@ -0,0 +1 @@
1
+ export declare const WarningIconV2: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,40 @@
1
+ import { jsxs as i, jsx as C } from "react/jsx-runtime";
2
+ const t = () => /* @__PURE__ */ i(
3
+ "svg",
4
+ {
5
+ width: "32",
6
+ height: "32",
7
+ viewBox: "0 0 32 32",
8
+ fill: "none",
9
+ xmlns: "http://www.w3.org/2000/svg",
10
+ children: [
11
+ /* @__PURE__ */ i("g", { clipPath: "url(#clip0_471_4351)", children: [
12
+ /* @__PURE__ */ C(
13
+ "path",
14
+ {
15
+ d: "M29.4265 22.6539C29.4265 22.6539 19.5314 4.469 19.5261 4.46024C17.9376 1.78483 14.064 1.78205 12.4736 4.46024C12.4684 4.469 12.4633 4.47797 12.4584 4.48694L2.57341 22.6539C0.96419 25.3874 2.93251 28.8346 6.10802 28.8346H25.8918C29.0648 28.8346 31.037 25.3897 29.4265 22.6539ZM25.8918 27.1944H6.10802C4.19994 27.1944 3.01732 25.1193 3.99208 23.4776C3.99742 23.4686 4.00255 23.4599 4.00746 23.4507L13.8914 5.28546C14.848 3.69461 17.153 3.69654 18.1083 5.28546C18.1083 5.28546 28.0024 23.4686 28.0076 23.4774C28.9817 25.118 27.8012 27.1944 25.8918 27.1944Z",
16
+ fill: "#B28100"
17
+ }
18
+ ),
19
+ /* @__PURE__ */ C(
20
+ "path",
21
+ {
22
+ d: "M15.9998 9.51758C14.6431 9.51758 13.5393 10.6216 13.5393 11.9783V16.8995C13.5393 18.2562 14.6431 19.36 15.9998 19.36C17.3567 19.36 18.4605 18.2562 18.4605 16.8995V11.9783C18.4605 10.6216 17.3567 9.51758 15.9998 9.51758ZM16.8201 16.8995C16.8201 17.3518 16.4523 17.7196 15.9998 17.7196C15.5476 17.7196 15.1797 17.3518 15.1797 16.8995V11.9783C15.1797 11.5261 15.5476 11.158 15.9998 11.158C16.4523 11.158 16.8201 11.5261 16.8201 11.9783V16.8995Z",
23
+ fill: "#B28100"
24
+ }
25
+ ),
26
+ /* @__PURE__ */ C(
27
+ "path",
28
+ {
29
+ d: "M15.9998 21.0005C14.6431 21.0005 13.5393 22.1043 13.5393 23.461C13.5393 24.8177 14.6431 25.9217 15.9998 25.9217C17.3567 25.9217 18.4605 24.8177 18.4605 23.461C18.4605 22.1043 17.3567 21.0005 15.9998 21.0005ZM15.9998 24.2813C15.5476 24.2813 15.1797 23.9132 15.1797 23.461C15.1797 23.0088 15.5476 22.6409 15.9998 22.6409C16.4523 22.6409 16.8201 23.0088 16.8201 23.461C16.8201 23.9132 16.4523 24.2813 15.9998 24.2813Z",
30
+ fill: "#B28100"
31
+ }
32
+ )
33
+ ] }),
34
+ /* @__PURE__ */ C("defs", { children: /* @__PURE__ */ C("clipPath", { id: "clip0_471_4351", children: /* @__PURE__ */ C("rect", { width: "28", height: "28", fill: "white", transform: "translate(2 2)" }) }) })
35
+ ]
36
+ }
37
+ );
38
+ export {
39
+ t as WarningIconV2
40
+ };
@@ -0,0 +1,4 @@
1
+ import { CarouselProps } from '../packages/Carousel/Carousel';
2
+
3
+ export type CarouselPropsWithoutChildren = Omit<CarouselProps, 'children'>;
4
+ export declare function useVerticalShelfCarouselProps(): CarouselPropsWithoutChildren;
@@ -0,0 +1,14 @@
1
+ import i from "./useWindowDimensions.js";
2
+ function o() {
3
+ const { isMobile: e } = i();
4
+ return {
5
+ arrow: { isVisible: !1 },
6
+ gapItems: 8,
7
+ itemWidthProp: 290,
8
+ bullet: { isVisible: !1 },
9
+ isMobile: e
10
+ };
11
+ }
12
+ export {
13
+ o as useVerticalShelfCarouselProps
14
+ };
@@ -0,0 +1,5 @@
1
+ export default function useWindowDimensions(): {
2
+ width: number | null;
3
+ height: number | null;
4
+ isMobile: boolean;
5
+ };
@@ -0,0 +1,38 @@
1
+ import { useState as u, useCallback as l, useEffect as w } from "react";
2
+ function a() {
3
+ const [o, s] = u({
4
+ width: null,
5
+ height: null,
6
+ isMobile: !1
7
+ }), n = l(() => {
8
+ var t;
9
+ if (typeof window == "undefined")
10
+ return {
11
+ width: null,
12
+ height: null,
13
+ isMobile: !1
14
+ };
15
+ const e = parseInt(
16
+ (t = getComputedStyle(document.documentElement).getPropertyValue(
17
+ "--breakpoint-notebook"
18
+ )) != null ? t : 1280,
19
+ 10
20
+ ), i = window.innerWidth, d = window.innerHeight, r = i < e;
21
+ return {
22
+ width: i,
23
+ height: d,
24
+ isMobile: r
25
+ };
26
+ }, []);
27
+ return w(() => {
28
+ if (typeof window == "undefined")
29
+ return;
30
+ function e() {
31
+ s(n());
32
+ }
33
+ return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
34
+ }, [n]), o;
35
+ }
36
+ export {
37
+ a as default
38
+ };
package/dist/main.d.ts CHANGED
@@ -17,3 +17,4 @@ export type { SearchSuggestionsProps } from './packages/SearchSugestions/types/S
17
17
  export type { SearchSuggestionsApiResponse, Searches } from './packages/SearchSugestions/types/ResponseApi';
18
18
  export { ProductCard } from './packages/ProductCard';
19
19
  export { ProductCardSeeMore } from './packages/ProductCardSeeMore/ProductCardSeeMore';
20
+ export { VouchersRedeemed } from './packages/VouchersRedeemed/VouchersRedeemed';
package/dist/main.js CHANGED
@@ -1,28 +1,30 @@
1
1
  import { CartClubAlert as e } from "./packages/CartClubAlert/CartClubAlert.js";
2
- import { Carousel as p } from "./packages/Carousel/Carousel.js";
2
+ import { Carousel as m } from "./packages/Carousel/Carousel.js";
3
3
  import { Coupons as f } from "./packages/Coupons/Coupons.js";
4
- import { Onboarding as x } from "./packages/Onboarding/Onboarding.js";
4
+ import { Onboarding as a } from "./packages/Onboarding/Onboarding.js";
5
5
  import { Tour as n } from "./packages/Tour/Tour.js";
6
- import { Regionalization as l } from "./packages/Regionalization/Regionalization.js";
7
- import { Modal as g } from "./packages/Modal/Modal.js";
8
- import { ContactCard as c } from "./packages/ContactCard/ContactCard.js";
6
+ import { Regionalization as u } from "./packages/Regionalization/Regionalization.js";
7
+ import { Modal as c } from "./packages/Modal/Modal.js";
8
+ import { ContactCard as i } from "./packages/ContactCard/ContactCard.js";
9
9
  import { ChangeOrderModal as S } from "./packages/ChangeOrderModal/ChangeOrderModal.js";
10
- import { Skeleton as b } from "./packages/Skeleton/index.js";
10
+ import { Skeleton as M } from "./packages/Skeleton/index.js";
11
11
  import { SearchSuggestions as O } from "./packages/SearchSugestions/components/SearchSuggestions/index.js";
12
- import { ProductCard as k } from "./packages/ProductCard/index.js";
13
- import { ProductCardSeeMore as A } from "./packages/ProductCardSeeMore/ProductCardSeeMore.js";
12
+ import { ProductCard as R } from "./packages/ProductCard/index.js";
13
+ import { ProductCardSeeMore as z } from "./packages/ProductCardSeeMore/ProductCardSeeMore.js";
14
+ import { VouchersRedeemed as T } from "./packages/VouchersRedeemed/VouchersRedeemed.js";
14
15
  export {
15
- p as Carousel,
16
+ m as Carousel,
16
17
  e as CartClubAlert,
17
18
  S as ChangeOrderModal,
18
- c as ContactCard,
19
+ i as ContactCard,
19
20
  f as Coupons,
20
- g as Modal,
21
- x as Onboarding,
22
- k as ProductCard,
23
- A as ProductCardSeeMore,
24
- l as Regionalization,
21
+ c as Modal,
22
+ a as Onboarding,
23
+ R as ProductCard,
24
+ z as ProductCardSeeMore,
25
+ u as Regionalization,
25
26
  O as SearchSuggestions,
26
- b as Skeleton,
27
- n as Tour
27
+ M as Skeleton,
28
+ n as Tour,
29
+ T as VouchersRedeemed
28
30
  };
@@ -0,0 +1,14 @@
1
+ import { default as React } from 'react';
2
+ import { CarouselPropsWithoutChildren } from '../../hooks/useVerticalShelfCarouselProps';
3
+
4
+ interface AdaptiveCarouselProps {
5
+ quantity: number;
6
+ children: React.ReactNode;
7
+ quantityToCarousel?: number;
8
+ propsCarousel?: CarouselPropsWithoutChildren;
9
+ activeBlur?: boolean;
10
+ forceCarousel?: boolean;
11
+ isNewDots?: boolean;
12
+ }
13
+ export declare const AdaptiveCarousel: ({ quantity, children, quantityToCarousel, propsCarousel, activeBlur, forceCarousel, isNewDots }: AdaptiveCarouselProps) => import("react/jsx-runtime").JSX.Element | null;
14
+ export {};
@@ -0,0 +1,69 @@
1
+ var D = Object.defineProperty, P = Object.defineProperties;
2
+ var T = Object.getOwnPropertyDescriptors;
3
+ var g = Object.getOwnPropertySymbols;
4
+ var $ = Object.prototype.hasOwnProperty, q = Object.prototype.propertyIsEnumerable;
5
+ var b = (o, s, r) => s in o ? D(o, s, { enumerable: !0, configurable: !0, writable: !0, value: r }) : o[s] = r, n = (o, s) => {
6
+ for (var r in s || (s = {}))
7
+ $.call(s, r) && b(o, r, s[r]);
8
+ if (g)
9
+ for (var r of g(s))
10
+ q.call(s, r) && b(o, r, s[r]);
11
+ return o;
12
+ }, h = (o, s) => P(o, T(s));
13
+ import { jsx as f, jsxs as w, Fragment as y } from "react/jsx-runtime";
14
+ /* empty css */import { useRef as z, useState as v, useEffect as E } from "react";
15
+ import { isScrollToEnd as F } from "../../utils/scroll/isScrollToEnd.js";
16
+ import I from "../../hooks/useWindowDimensions.js";
17
+ import { Carousel as R } from "../Carousel/Carousel.js";
18
+ import { carouselProps as W } from "../../utils/carousel/carouselProps.js";
19
+ const U = ({
20
+ quantity: o,
21
+ children: s,
22
+ quantityToCarousel: r = 6,
23
+ propsCarousel: N,
24
+ activeBlur: l = !0,
25
+ forceCarousel: x,
26
+ isNewDots: L
27
+ }) => {
28
+ const c = z(null), [m, S] = v(!1), [e, j] = v({
29
+ left: !1,
30
+ right: !1
31
+ }), { width: u } = I(), i = x || o >= r, k = n(n({}, W(u != null ? u : 0)), N);
32
+ return E(() => {
33
+ S(!0);
34
+ }, []), E(() => {
35
+ var p, d;
36
+ if (i && l) {
37
+ const t = (d = (p = c == null ? void 0 : c.current) == null ? void 0 : p.querySelector(".carousel-container")) != null ? d : null, a = () => {
38
+ j({
39
+ left: !!(t != null && t.scrollLeft),
40
+ right: !F(t)
41
+ });
42
+ };
43
+ return a(), t == null || t.addEventListener(
44
+ "scroll",
45
+ a,
46
+ {
47
+ passive: !1
48
+ }
49
+ ), () => t == null ? void 0 : t.removeEventListener(
50
+ "scroll",
51
+ a
52
+ );
53
+ }
54
+ }, [m, i, l]), m ? /* @__PURE__ */ f(
55
+ "div",
56
+ {
57
+ className: `adaptiveCarousel-container ${i ? "isCarousel" : "notCarousel"} ${L ? "isNewDots" : ""}`,
58
+ ref: c,
59
+ children: i ? /* @__PURE__ */ w(y, { children: [
60
+ l && (e == null ? void 0 : e.left) && /* @__PURE__ */ f("div", { className: "background-blur-left" }),
61
+ /* @__PURE__ */ f(R, h(n({}, k), { children: s })),
62
+ l && (e == null ? void 0 : e.right) && /* @__PURE__ */ f("div", { className: "background-blur-right" })
63
+ ] }) : s
64
+ }
65
+ ) : null;
66
+ };
67
+ export {
68
+ U as AdaptiveCarousel
69
+ };
@@ -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>;