@faststore/core 2.2.54 → 2.2.55
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.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +36 -36
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/config.json +3 -3
- package/.next/cache/eslint/.cache_1gneedd +1 -1
- package/.next/cache/next-server.js.nft.json +1 -1
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/react-loadable-manifest.json +1 -1
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/390.js +0 -55
- package/.next/server/chunks/74.js +735 -581
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/[...slug].js.nft.json +1 -1
- package/.next/server/pages/[slug]/p.js +12 -56
- package/.next/server/pages/[slug]/p.js.nft.json +1 -1
- package/.next/server/pages/api/graphql.js.nft.json +1 -1
- package/.next/server/pages/en-US/404.html +2 -2
- package/.next/server/pages/en-US/500.html +2 -2
- package/.next/server/pages/en-US/account.html +2 -2
- package/.next/server/pages/en-US/checkout.html +2 -2
- package/.next/server/pages/en-US/login.html +2 -2
- package/.next/server/pages/en-US/s.html +2 -2
- package/.next/server/pages/en-US.html +2 -2
- package/.next/server/pages-manifest.json +3 -3
- package/.next/static/chunks/158-df35a8644ae9d281.js +1 -0
- package/.next/static/chunks/{497-176c5263d6378afc.js → 497-37c1e4e1d862b354.js} +1 -1
- package/.next/static/chunks/{585.92188327fc30a684.js → 585.4e673e43d8daf336.js} +1 -1
- package/.next/static/chunks/pages/{[...slug]-0765ca2a2572ab9e.js → [...slug]-b82b56ce1651ea4f.js} +1 -1
- package/.next/static/chunks/pages/[slug]/p-39599bd4d6faeeb6.js +1 -0
- package/.next/static/chunks/pages/{index-d0c9985f7dde64ce.js → index-84457d91d9060925.js} +1 -1
- package/.next/static/chunks/{webpack-422f774fb36da0fb.js → webpack-ec84ae4e89cebb1f.js} +1 -1
- package/.next/static/css/{58e1e061ceea2cd8.css → 0cb5d7afb952bb02.css} +1 -1
- package/.next/static/xNdv8Ze2mVN5lf__-4QVM/_buildManifest.js +1 -0
- package/.next/trace +81 -81
- package/.turbo/turbo-build.log +6 -6
- package/.turbo/turbo-test.log +10 -10
- package/package.json +2 -2
- package/src/components/sections/CrossSellingShelf/DefaultComponents.ts +9 -0
- package/src/components/sections/CrossSellingShelf/OverriddenDefaultCrossSellingShelf.ts +5 -0
- package/src/components/ui/ProductShelf/ProductShelf.tsx +1 -1
- package/src/pages/[slug]/p.tsx +1 -1
- package/src/sdk/overrides/sections.tsx +4 -0
- package/src/typings/overrides.ts +12 -1
- package/.next/static/H_kSoqYPjjK2sM3cxP_pS/_buildManifest.js +0 -1
- package/.next/static/chunks/158-02891d5ee60b505c.js +0 -1
- package/.next/static/chunks/pages/[slug]/p-a402fb32d2a6ec95.js +0 -1
- /package/.next/static/{H_kSoqYPjjK2sM3cxP_pS → xNdv8Ze2mVN5lf__-4QVM}/_ssgManifest.js +0 -0
|
@@ -2366,6 +2366,91 @@ const BannerTextDefaultComponents = {
|
|
|
2366
2366
|
|
|
2367
2367
|
/***/ }),
|
|
2368
2368
|
|
|
2369
|
+
/***/ 994:
|
|
2370
|
+
/***/ ((module, __webpack_exports__, __webpack_require__) => {
|
|
2371
|
+
|
|
2372
|
+
"use strict";
|
|
2373
|
+
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
|
2374
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2375
|
+
/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
2376
|
+
/* harmony export */ });
|
|
2377
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
|
|
2378
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
2379
|
+
/* harmony import */ var src_components_ui_ProductShelf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7691);
|
|
2380
|
+
/* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9785);
|
|
2381
|
+
/* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intersection_observer__WEBPACK_IMPORTED_MODULE_1__);
|
|
2382
|
+
/* harmony import */ var src_sdk_overrides_PageProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5953);
|
|
2383
|
+
/* harmony import */ var _ProductShelf_section_module_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(6627);
|
|
2384
|
+
/* harmony import */ var _ProductShelf_section_module_scss__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_ProductShelf_section_module_scss__WEBPACK_IMPORTED_MODULE_5__);
|
|
2385
|
+
/* harmony import */ var _Section__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3271);
|
|
2386
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(997);
|
|
2387
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
|
|
2388
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([src_components_ui_ProductShelf__WEBPACK_IMPORTED_MODULE_6__]);
|
|
2389
|
+
src_components_ui_ProductShelf__WEBPACK_IMPORTED_MODULE_6__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
|
|
2390
|
+
|
|
2391
|
+
|
|
2392
|
+
|
|
2393
|
+
|
|
2394
|
+
|
|
2395
|
+
|
|
2396
|
+
|
|
2397
|
+
|
|
2398
|
+
const CrossSellingShelf = ({
|
|
2399
|
+
numberOfItems,
|
|
2400
|
+
itemsPerPage,
|
|
2401
|
+
title,
|
|
2402
|
+
kind
|
|
2403
|
+
}) => {
|
|
2404
|
+
const {
|
|
2405
|
+
ref,
|
|
2406
|
+
inView
|
|
2407
|
+
} = (0,react_intersection_observer__WEBPACK_IMPORTED_MODULE_1__.useInView)();
|
|
2408
|
+
const context = (0,src_sdk_overrides_PageProvider__WEBPACK_IMPORTED_MODULE_3__/* .usePDP */ .al)();
|
|
2409
|
+
const productGroupID = context?.data?.product?.isVariantOf?.productGroupID;
|
|
2410
|
+
const selectedFacets = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => [{
|
|
2411
|
+
key: kind,
|
|
2412
|
+
value: productGroupID
|
|
2413
|
+
}], [kind, productGroupID]);
|
|
2414
|
+
return /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx(_Section__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
|
|
2415
|
+
className: `${(_ProductShelf_section_module_scss__WEBPACK_IMPORTED_MODULE_5___default().section)} section-product-shelf layout__section`,
|
|
2416
|
+
ref: ref,
|
|
2417
|
+
children: /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx(src_components_ui_ProductShelf__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z, {
|
|
2418
|
+
inView: inView,
|
|
2419
|
+
numberOfItems: numberOfItems,
|
|
2420
|
+
itemsPerPage: itemsPerPage,
|
|
2421
|
+
title: title,
|
|
2422
|
+
selectedFacets: selectedFacets
|
|
2423
|
+
})
|
|
2424
|
+
});
|
|
2425
|
+
};
|
|
2426
|
+
|
|
2427
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CrossSellingShelf);
|
|
2428
|
+
__webpack_async_result__();
|
|
2429
|
+
} catch(e) { __webpack_async_result__(e); } });
|
|
2430
|
+
|
|
2431
|
+
/***/ }),
|
|
2432
|
+
|
|
2433
|
+
/***/ 8435:
|
|
2434
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2435
|
+
|
|
2436
|
+
"use strict";
|
|
2437
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2438
|
+
/* harmony export */ "q": () => (/* binding */ CrossSellingShelfDefaultComponents)
|
|
2439
|
+
/* harmony export */ });
|
|
2440
|
+
/* harmony import */ var _faststore_ui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6737);
|
|
2441
|
+
/* harmony import */ var src_components_product_ProductCard__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8553);
|
|
2442
|
+
/* harmony import */ var src_components_ui_Carousel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8619);
|
|
2443
|
+
|
|
2444
|
+
|
|
2445
|
+
|
|
2446
|
+
const CrossSellingShelfDefaultComponents = {
|
|
2447
|
+
ProductShelf: _faststore_ui__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z,
|
|
2448
|
+
__experimentalCarousel: src_components_ui_Carousel__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z,
|
|
2449
|
+
__experimentalProductCard: src_components_product_ProductCard__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z
|
|
2450
|
+
};
|
|
2451
|
+
|
|
2452
|
+
/***/ }),
|
|
2453
|
+
|
|
2369
2454
|
/***/ 11:
|
|
2370
2455
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2371
2456
|
|
|
@@ -2997,449 +3082,50 @@ const {
|
|
|
2997
3082
|
|
|
2998
3083
|
/***/ }),
|
|
2999
3084
|
|
|
3000
|
-
/***/
|
|
3085
|
+
/***/ 2432:
|
|
3001
3086
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3002
3087
|
|
|
3003
3088
|
"use strict";
|
|
3089
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3090
|
+
/* harmony export */ "B": () => (/* binding */ ProductShelfDefaultComponents)
|
|
3091
|
+
/* harmony export */ });
|
|
3092
|
+
/* harmony import */ var _faststore_ui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6737);
|
|
3093
|
+
/* harmony import */ var src_components_product_ProductCard__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8553);
|
|
3094
|
+
/* harmony import */ var src_components_ui_Carousel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8619);
|
|
3004
3095
|
|
|
3005
|
-
// EXPORTS
|
|
3006
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
3007
|
-
"B": () => (/* binding */ ProductShelfDefaultComponents)
|
|
3008
|
-
});
|
|
3009
|
-
|
|
3010
|
-
// EXTERNAL MODULE: ../components/dist/esm/organisms/ProductShelf/ProductShelf.js
|
|
3011
|
-
var ProductShelf = __webpack_require__(6737);
|
|
3012
|
-
// EXTERNAL MODULE: ./src/components/product/ProductCard/ProductCard.tsx + 3 modules
|
|
3013
|
-
var ProductCard = __webpack_require__(8553);
|
|
3014
|
-
// EXTERNAL MODULE: external "react"
|
|
3015
|
-
var external_react_ = __webpack_require__(6689);
|
|
3016
|
-
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
|
|
3017
|
-
// EXTERNAL MODULE: ../components/dist/esm/molecules/IconButton/IconButton.js
|
|
3018
|
-
var IconButton = __webpack_require__(7041);
|
|
3019
|
-
// EXTERNAL MODULE: ../components/dist/esm/atoms/Icon/Icon.js
|
|
3020
|
-
var Icon = __webpack_require__(2614);
|
|
3021
|
-
// EXTERNAL MODULE: external "react-swipeable"
|
|
3022
|
-
var external_react_swipeable_ = __webpack_require__(3789);
|
|
3023
|
-
;// CONCATENATED MODULE: ../components/dist/esm/hooks/useSlider.js
|
|
3024
3096
|
|
|
3025
3097
|
|
|
3026
|
-
const
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
case 'NEXT_PAGE': {
|
|
3031
|
-
// If `state.infinite` is true, we need to take into account an extra
|
|
3032
|
-
// page in the calculation. This extra page is a clone of the first page.
|
|
3033
|
-
const adjustedTotalPages = state.infinite
|
|
3034
|
-
? state.totalPages + 1
|
|
3035
|
-
: state.totalPages;
|
|
3036
|
-
const nextPageIndex = nextPage(state.currentPage, adjustedTotalPages);
|
|
3037
|
-
const nextItemIndex = (nextPageIndex % adjustedTotalPages) * state.itemsPerPage;
|
|
3038
|
-
return {
|
|
3039
|
-
...state,
|
|
3040
|
-
sliding: true,
|
|
3041
|
-
slideDirection: 'next',
|
|
3042
|
-
currentItem: nextItemIndex,
|
|
3043
|
-
currentPage: nextPageIndex,
|
|
3044
|
-
};
|
|
3045
|
-
}
|
|
3046
|
-
case 'PREVIOUS_PAGE': {
|
|
3047
|
-
// If `state.infinite` is true, we need to take into account an extra
|
|
3048
|
-
// page in the calculation. This extra page is a clone of the first page.
|
|
3049
|
-
const adjustedTotalPages = state.infinite
|
|
3050
|
-
? state.totalPages + 1
|
|
3051
|
-
: state.totalPages;
|
|
3052
|
-
// If `state.infinite` is true and we're currently on page 0, we need to
|
|
3053
|
-
// let the slider go to page -1. This -1 page is a clone of the last page.
|
|
3054
|
-
const shouldGoToClone = state.infinite && state.currentPage === 0;
|
|
3055
|
-
const previousPageIndex = shouldGoToClone
|
|
3056
|
-
? -1
|
|
3057
|
-
: previousPage(state.currentPage, state.totalPages);
|
|
3058
|
-
return {
|
|
3059
|
-
...state,
|
|
3060
|
-
sliding: true,
|
|
3061
|
-
slideDirection: 'previous',
|
|
3062
|
-
currentItem: (previousPageIndex % adjustedTotalPages) * state.itemsPerPage,
|
|
3063
|
-
currentPage: previousPageIndex,
|
|
3064
|
-
};
|
|
3065
|
-
}
|
|
3066
|
-
case 'GO_TO_PAGE': {
|
|
3067
|
-
if (action.payload.pageIndex === state.currentPage) {
|
|
3068
|
-
return state;
|
|
3069
|
-
}
|
|
3070
|
-
return {
|
|
3071
|
-
...state,
|
|
3072
|
-
sliding: action.payload.shouldSlide,
|
|
3073
|
-
slideDirection: action.payload.pageIndex > state.currentPage ? 'next' : 'previous',
|
|
3074
|
-
currentItem: (action.payload.pageIndex % state.totalPages) * state.itemsPerPage,
|
|
3075
|
-
currentPage: action.payload.pageIndex,
|
|
3076
|
-
};
|
|
3077
|
-
}
|
|
3078
|
-
case 'STOP_SLIDE':
|
|
3079
|
-
return { ...state, sliding: false };
|
|
3080
|
-
default:
|
|
3081
|
-
return state;
|
|
3082
|
-
}
|
|
3083
|
-
}
|
|
3084
|
-
const defaultSliderState = (totalItems, itemsPerPage, infinite) => ({
|
|
3085
|
-
currentItem: 0,
|
|
3086
|
-
currentPage: 0,
|
|
3087
|
-
sliding: false,
|
|
3088
|
-
slideDirection: 'next',
|
|
3089
|
-
totalItems,
|
|
3090
|
-
itemsPerPage,
|
|
3091
|
-
totalPages: Math.ceil(totalItems / itemsPerPage),
|
|
3092
|
-
infinite,
|
|
3093
|
-
});
|
|
3094
|
-
const slide = (page, dispatch) => {
|
|
3095
|
-
if (page === 'next') {
|
|
3096
|
-
dispatch({ type: 'NEXT_PAGE' });
|
|
3097
|
-
}
|
|
3098
|
-
if (page === 'previous') {
|
|
3099
|
-
dispatch({ type: 'PREVIOUS_PAGE' });
|
|
3100
|
-
}
|
|
3101
|
-
if (typeof page === 'number') {
|
|
3102
|
-
dispatch({
|
|
3103
|
-
type: 'GO_TO_PAGE',
|
|
3104
|
-
payload: {
|
|
3105
|
-
pageIndex: page,
|
|
3106
|
-
shouldSlide: true,
|
|
3107
|
-
},
|
|
3108
|
-
});
|
|
3109
|
-
}
|
|
3110
|
-
};
|
|
3111
|
-
const useSlider = ({ totalItems, itemsPerPage = 1, infiniteMode = false, shouldSlideOnSwipe = true, ...swipeableConfigOverrides }) => {
|
|
3112
|
-
const [sliderState, sliderDispatch] = (0,external_react_.useReducer)(reducer, undefined, () => defaultSliderState(totalItems, itemsPerPage, infiniteMode));
|
|
3113
|
-
const handlers = (0,external_react_swipeable_.useSwipeable)({
|
|
3114
|
-
onSwipedRight: () => shouldSlideOnSwipe && slide('previous', sliderDispatch),
|
|
3115
|
-
onSwipedLeft: () => shouldSlideOnSwipe && slide('next', sliderDispatch),
|
|
3116
|
-
trackMouse: true,
|
|
3117
|
-
...swipeableConfigOverrides,
|
|
3118
|
-
});
|
|
3119
|
-
return {
|
|
3120
|
-
handlers,
|
|
3121
|
-
slide,
|
|
3122
|
-
sliderState,
|
|
3123
|
-
sliderDispatch,
|
|
3124
|
-
};
|
|
3098
|
+
const ProductShelfDefaultComponents = {
|
|
3099
|
+
ProductShelf: _faststore_ui__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z,
|
|
3100
|
+
__experimentalCarousel: src_components_ui_Carousel__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z,
|
|
3101
|
+
__experimentalProductCard: src_components_product_ProductCard__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z
|
|
3125
3102
|
};
|
|
3126
|
-
//# sourceMappingURL=useSlider.js.map
|
|
3127
|
-
// EXTERNAL MODULE: ../components/dist/esm/atoms/Button/Button.js
|
|
3128
|
-
var Button = __webpack_require__(3339);
|
|
3129
|
-
;// CONCATENATED MODULE: ../components/dist/esm/molecules/Carousel/CarouselBullets.js
|
|
3130
3103
|
|
|
3104
|
+
/***/ }),
|
|
3131
3105
|
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
const bulletIndexes = (0,external_react_.useMemo)(() => Array(totalQuantity).fill(0), [totalQuantity]);
|
|
3135
|
-
return (external_react_default().createElement("div", { ref: ref, "data-fs-carousel-bullets": true, "data-testid": testId, role: "tablist", ...otherProps }, bulletIndexes.map((_, idx) => {
|
|
3136
|
-
const isActive = activeBullet === idx;
|
|
3137
|
-
return (external_react_default().createElement(Button/* default */.Z, { key: `${id}-${idx}`, role: "tab", tabIndex: -1, "data-fs-carousel-bullet": true, testId: `${testId}-bullet`, onClick: (e) => onClick(e, idx), "aria-label": ariaLabelGenerator(id, idx, isActive), "aria-controls": ariaControlsGenerator?.(idx), "aria-selected": isActive, variant: "tertiary" }));
|
|
3138
|
-
})));
|
|
3139
|
-
});
|
|
3140
|
-
/* harmony default export */ const Carousel_CarouselBullets = (CarouselBullets);
|
|
3141
|
-
//# sourceMappingURL=CarouselBullets.js.map
|
|
3142
|
-
;// CONCATENATED MODULE: ../components/dist/esm/hooks/useSlideVisibility.js
|
|
3106
|
+
/***/ 8569:
|
|
3107
|
+
/***/ ((module, __webpack_exports__, __webpack_require__) => {
|
|
3143
3108
|
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
}
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
const isItemVisible = (index) => isSlideVisible({
|
|
3161
|
-
slideIdx: index,
|
|
3162
|
-
currentSlide,
|
|
3163
|
-
itemsPerPage,
|
|
3164
|
-
totalItems,
|
|
3165
|
-
});
|
|
3166
|
-
const shouldRenderItem = (index) => {
|
|
3167
|
-
return visitedSlides.current.has(index) || isItemVisible(index);
|
|
3168
|
-
};
|
|
3169
|
-
return { shouldRenderItem, isItemVisible };
|
|
3170
|
-
};
|
|
3171
|
-
//# sourceMappingURL=useSlideVisibility.js.map
|
|
3172
|
-
;// CONCATENATED MODULE: ../components/dist/esm/molecules/Carousel/CarouselItem.js
|
|
3109
|
+
"use strict";
|
|
3110
|
+
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
|
3111
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3112
|
+
/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
3113
|
+
/* harmony export */ });
|
|
3114
|
+
/* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9785);
|
|
3115
|
+
/* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_intersection_observer__WEBPACK_IMPORTED_MODULE_0__);
|
|
3116
|
+
/* harmony import */ var _Section__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3271);
|
|
3117
|
+
/* harmony import */ var src_components_ui_ProductShelf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7691);
|
|
3118
|
+
/* harmony import */ var _section_module_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6627);
|
|
3119
|
+
/* harmony import */ var _section_module_scss__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_section_module_scss__WEBPACK_IMPORTED_MODULE_3__);
|
|
3120
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(997);
|
|
3121
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
|
|
3122
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([src_components_ui_ProductShelf__WEBPACK_IMPORTED_MODULE_4__]);
|
|
3123
|
+
src_components_ui_ProductShelf__WEBPACK_IMPORTED_MODULE_4__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
|
|
3124
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3173
3125
|
|
|
3126
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3174
3127
|
|
|
3175
|
-
function
|
|
3176
|
-
const { isItemVisible, shouldRenderItem } = useSlideVisibility({
|
|
3177
|
-
totalItems,
|
|
3178
|
-
currentSlide: state.currentItem,
|
|
3179
|
-
itemsPerPage: state.itemsPerPage,
|
|
3180
|
-
});
|
|
3181
|
-
const defaultStyle = { width: '100%' };
|
|
3182
|
-
const scrollCarouselStyle = {
|
|
3183
|
-
width: `calc((100% - ${marginRightValue} * ${state.itemsPerPage - 1}) / ${state.itemsPerPage})`,
|
|
3184
|
-
};
|
|
3185
|
-
const style = isScrollCarousel && state.itemsPerPage > 1
|
|
3186
|
-
? { ...scrollCarouselStyle }
|
|
3187
|
-
: { ...defaultStyle };
|
|
3188
|
-
const shouldDisplayItem = isScrollCarousel || shouldRenderItem(index - Number(infiniteMode));
|
|
3189
|
-
return (external_react_default().createElement("li", { style: style, id: `${id}-carousel-item-${index}`, "data-fs-carousel-item": true, "data-fs-carousel-item-visible": isItemVisible(index - Number(infiniteMode)) || undefined }, shouldDisplayItem ? children : null));
|
|
3190
|
-
}
|
|
3191
|
-
/* harmony default export */ const Carousel_CarouselItem = (CarouselItem);
|
|
3192
|
-
//# sourceMappingURL=CarouselItem.js.map
|
|
3193
|
-
;// CONCATENATED MODULE: ../components/dist/esm/molecules/Carousel/Carousel.js
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
const createTransformValues = (infinite, totalItems) => {
|
|
3200
|
-
const transformMap = {};
|
|
3201
|
-
const slideWidth = 100 / totalItems;
|
|
3202
|
-
for (let idx = 0; idx < totalItems; ++idx) {
|
|
3203
|
-
const currIdx = infinite ? idx - 1 : idx;
|
|
3204
|
-
const transformValue = -(slideWidth * idx);
|
|
3205
|
-
transformMap[currIdx] = transformValue;
|
|
3206
|
-
}
|
|
3207
|
-
return transformMap;
|
|
3208
|
-
};
|
|
3209
|
-
function Carousel({ children, className, 'aria-label': ariaLabel, infiniteMode = false, controls = 'complete', testId = 'fs-carousel', transition = {
|
|
3210
|
-
duration: 400,
|
|
3211
|
-
property: 'transform',
|
|
3212
|
-
}, id = 'fs-carousel', variant = 'scroll', itemsPerPage = 1, navigationIcons = undefined, ...swipeableConfigOverrides }) {
|
|
3213
|
-
if (itemsPerPage < 1) {
|
|
3214
|
-
throw new Error('itemsPerPage must be greater than or equal to 1');
|
|
3215
|
-
}
|
|
3216
|
-
const carouselTrackRef = (0,external_react_.useRef)(null);
|
|
3217
|
-
const isSlideCarousel = variant === 'slide';
|
|
3218
|
-
const isScrollCarousel = variant === 'scroll';
|
|
3219
|
-
const childrenArray = external_react_default().Children.toArray(children);
|
|
3220
|
-
const childrenCount = childrenArray.length;
|
|
3221
|
-
const numberOfSlides = infiniteMode ? childrenCount + 2 : childrenCount;
|
|
3222
|
-
const slidingTransition = `${transition.property} ${transition.duration}ms ${transition.timing ?? ''} ${transition.delay ?? ''}`;
|
|
3223
|
-
const { handlers, slide, sliderState, sliderDispatch } = useSlider({
|
|
3224
|
-
itemsPerPage,
|
|
3225
|
-
infiniteMode,
|
|
3226
|
-
totalItems: childrenCount,
|
|
3227
|
-
shouldSlideOnSwipe: isSlideCarousel,
|
|
3228
|
-
...swipeableConfigOverrides,
|
|
3229
|
-
});
|
|
3230
|
-
const pagesCount = Math.ceil(childrenCount / sliderState.itemsPerPage);
|
|
3231
|
-
const [marginRight, setMarginRight] = (0,external_react_.useState)('16px');
|
|
3232
|
-
const [carouselItemsWidth, setCarouselItemsWidth] = (0,external_react_.useState)(0);
|
|
3233
|
-
(0,external_react_.useEffect)(() => {
|
|
3234
|
-
const item = carouselTrackRef.current?.firstElementChild;
|
|
3235
|
-
if (item) {
|
|
3236
|
-
setMarginRight(getComputedStyle(item).getPropertyValue('margin-right'));
|
|
3237
|
-
setCarouselItemsWidth(Number(item.clientWidth) + parseInt(marginRight, 10) + 1);
|
|
3238
|
-
}
|
|
3239
|
-
}, [carouselItemsWidth]);
|
|
3240
|
-
const showNavigationArrows = pagesCount !== 1 &&
|
|
3241
|
-
(controls === 'complete' || controls === 'navigationArrows');
|
|
3242
|
-
const showPaginationBullets = pagesCount !== 1 &&
|
|
3243
|
-
(controls === 'complete' || controls === 'paginationBullets');
|
|
3244
|
-
const transformValues = (0,external_react_.useMemo)(() => createTransformValues(infiniteMode, numberOfSlides), [numberOfSlides, infiniteMode]);
|
|
3245
|
-
const postRenderedSlides = infiniteMode && children ? childrenArray.slice(0, 1) : [];
|
|
3246
|
-
const preRenderedSlides = infiniteMode && children ? childrenArray.slice(childrenCount - 1) : [];
|
|
3247
|
-
const slides = preRenderedSlides.concat(children ?? [], postRenderedSlides);
|
|
3248
|
-
const slideCarouselTrackStyle = (0,external_react_.useMemo)(() => ({
|
|
3249
|
-
width: `${numberOfSlides * 100}%`,
|
|
3250
|
-
transition: sliderState.sliding ? slidingTransition : undefined,
|
|
3251
|
-
transform: `translate3d(${transformValues[sliderState.currentPage]}%, 0, 0)`,
|
|
3252
|
-
}), [
|
|
3253
|
-
numberOfSlides,
|
|
3254
|
-
transformValues,
|
|
3255
|
-
slidingTransition,
|
|
3256
|
-
sliderState.sliding,
|
|
3257
|
-
sliderState.currentPage,
|
|
3258
|
-
]);
|
|
3259
|
-
const scrollCarouselTrackStyle = (0,external_react_.useMemo)(() => ({
|
|
3260
|
-
width: '100%',
|
|
3261
|
-
overflowX: 'scroll',
|
|
3262
|
-
whiteSpace: 'nowrap',
|
|
3263
|
-
}), []);
|
|
3264
|
-
const carouselTrackStyle = (isSlideCarousel && slideCarouselTrackStyle) ||
|
|
3265
|
-
(isScrollCarousel && scrollCarouselTrackStyle);
|
|
3266
|
-
const slidePrevious = () => {
|
|
3267
|
-
if (sliderState.sliding ||
|
|
3268
|
-
(!infiniteMode && sliderState.currentPage === 0)) {
|
|
3269
|
-
return;
|
|
3270
|
-
}
|
|
3271
|
-
slide('previous', sliderDispatch);
|
|
3272
|
-
};
|
|
3273
|
-
const slideNext = () => {
|
|
3274
|
-
if (sliderState.sliding ||
|
|
3275
|
-
(!infiniteMode && sliderState.currentPage === childrenCount - 1)) {
|
|
3276
|
-
return;
|
|
3277
|
-
}
|
|
3278
|
-
slide('next', sliderDispatch);
|
|
3279
|
-
};
|
|
3280
|
-
const onScrollTrack = (event) => {
|
|
3281
|
-
if (isSlideCarousel || itemsPerPage > 1) {
|
|
3282
|
-
return;
|
|
3283
|
-
}
|
|
3284
|
-
const itemWidth = Number(event.currentTarget.firstElementChild?.scrollWidth);
|
|
3285
|
-
const scrollOffset = event.currentTarget?.scrollLeft;
|
|
3286
|
-
const formatter = scrollOffset > itemWidth / 2 ? Math.round : Math.floor;
|
|
3287
|
-
const page = formatter(scrollOffset / itemWidth);
|
|
3288
|
-
slide(page, sliderDispatch);
|
|
3289
|
-
};
|
|
3290
|
-
const onTransitionTrackEnd = () => {
|
|
3291
|
-
sliderDispatch({
|
|
3292
|
-
type: 'STOP_SLIDE',
|
|
3293
|
-
});
|
|
3294
|
-
if (infiniteMode && sliderState.currentItem >= childrenCount) {
|
|
3295
|
-
sliderDispatch({
|
|
3296
|
-
type: 'GO_TO_PAGE',
|
|
3297
|
-
payload: {
|
|
3298
|
-
pageIndex: 0,
|
|
3299
|
-
shouldSlide: false,
|
|
3300
|
-
},
|
|
3301
|
-
});
|
|
3302
|
-
}
|
|
3303
|
-
if (infiniteMode && sliderState.currentItem < 0) {
|
|
3304
|
-
sliderDispatch({
|
|
3305
|
-
type: 'GO_TO_PAGE',
|
|
3306
|
-
payload: {
|
|
3307
|
-
pageIndex: sliderState.totalPages - 1,
|
|
3308
|
-
shouldSlide: false,
|
|
3309
|
-
},
|
|
3310
|
-
});
|
|
3311
|
-
}
|
|
3312
|
-
};
|
|
3313
|
-
const onScrollPagination = async (index, slideDirection) => {
|
|
3314
|
-
if (slideDirection === 'previous' && sliderState.currentPage === 0) {
|
|
3315
|
-
return;
|
|
3316
|
-
}
|
|
3317
|
-
if (slideDirection === 'next' &&
|
|
3318
|
-
sliderState.currentPage === sliderState.totalPages - 1) {
|
|
3319
|
-
return;
|
|
3320
|
-
}
|
|
3321
|
-
let scrollOffset = index * carouselItemsWidth * itemsPerPage;
|
|
3322
|
-
carouselTrackRef.current?.scrollTo({
|
|
3323
|
-
left: scrollOffset,
|
|
3324
|
-
behavior: 'smooth',
|
|
3325
|
-
});
|
|
3326
|
-
slide(index, sliderDispatch);
|
|
3327
|
-
};
|
|
3328
|
-
// accessible behavior for tablist
|
|
3329
|
-
const handleBulletsKeyDown = (event) => {
|
|
3330
|
-
switch (event.key) {
|
|
3331
|
-
case 'ArrowLeft': {
|
|
3332
|
-
isSlideCarousel && slidePrevious();
|
|
3333
|
-
isScrollCarousel &&
|
|
3334
|
-
onScrollPagination(sliderState.currentPage - 1, 'previous');
|
|
3335
|
-
break;
|
|
3336
|
-
}
|
|
3337
|
-
case 'ArrowRight': {
|
|
3338
|
-
isSlideCarousel && slideNext();
|
|
3339
|
-
isScrollCarousel &&
|
|
3340
|
-
onScrollPagination(sliderState.currentPage + 1, 'next');
|
|
3341
|
-
break;
|
|
3342
|
-
}
|
|
3343
|
-
case 'Home': {
|
|
3344
|
-
slide(0, sliderDispatch);
|
|
3345
|
-
break;
|
|
3346
|
-
}
|
|
3347
|
-
case 'End': {
|
|
3348
|
-
slide(childrenCount - 1, sliderDispatch);
|
|
3349
|
-
break;
|
|
3350
|
-
}
|
|
3351
|
-
default:
|
|
3352
|
-
}
|
|
3353
|
-
};
|
|
3354
|
-
return (external_react_default().createElement("section", { id: id, "data-fs-carousel": true, "data-fs-carousel-variant": variant, className: className, "data-testid": testId, "aria-label": ariaLabel },
|
|
3355
|
-
external_react_default().createElement("div", { "data-fs-carousel-track-container": true, style: {
|
|
3356
|
-
width: '100%',
|
|
3357
|
-
overflow: 'hidden',
|
|
3358
|
-
display: isScrollCarousel ? 'block' : undefined,
|
|
3359
|
-
}, ...handlers },
|
|
3360
|
-
external_react_default().createElement("ul", { "aria-live": "polite", ref: carouselTrackRef, style: carouselTrackStyle, "data-fs-carousel-track": true, onScroll: onScrollTrack, onTransitionEnd: onTransitionTrackEnd }, slides.map((currentSlide, idx) => (external_react_default().createElement(Carousel_CarouselItem, { id: id, index: idx, key: String(idx), state: sliderState, totalItems: childrenCount, infiniteMode: infiniteMode, isScrollCarousel: isScrollCarousel, marginRightValue: marginRight }, currentSlide))))),
|
|
3361
|
-
showNavigationArrows && (external_react_default().createElement("div", { "data-fs-carousel-controls": true },
|
|
3362
|
-
external_react_default().createElement(IconButton/* default */.Z, { "data-fs-carousel-control": "left", "aria-controls": id, disabled: !infiniteMode && sliderState.currentPage === 0, "aria-label": "previous", icon: navigationIcons?.left ?? (external_react_default().createElement(Icon/* default */.Z, { name: "ArrowLeft", width: 20, height: 20, weight: "bold" })), onClick: () => {
|
|
3363
|
-
isSlideCarousel && slidePrevious();
|
|
3364
|
-
isScrollCarousel &&
|
|
3365
|
-
onScrollPagination(sliderState.currentPage - 1, 'previous');
|
|
3366
|
-
} }),
|
|
3367
|
-
external_react_default().createElement(IconButton/* default */.Z, { "data-fs-carousel-control": "right", "aria-controls": id, disabled: !infiniteMode &&
|
|
3368
|
-
sliderState.currentPage === sliderState.totalPages - 1, "aria-label": "next", icon: navigationIcons?.right ?? (external_react_default().createElement(Icon/* default */.Z, { name: "ArrowRight", width: 20, height: 20, weight: "bold" })), onClick: () => {
|
|
3369
|
-
isSlideCarousel && slideNext();
|
|
3370
|
-
isScrollCarousel &&
|
|
3371
|
-
onScrollPagination(sliderState.currentPage + 1, 'next');
|
|
3372
|
-
} }))),
|
|
3373
|
-
showPaginationBullets && (external_react_default().createElement(Carousel_CarouselBullets, { id: id, tabIndex: 0, activeBullet: sliderState.currentPage, totalQuantity: pagesCount, onKeyDown: handleBulletsKeyDown, onClick: async (_, idx) => {
|
|
3374
|
-
isSlideCarousel &&
|
|
3375
|
-
!sliderState.sliding &&
|
|
3376
|
-
slide(idx, sliderDispatch);
|
|
3377
|
-
isScrollCarousel && onScrollPagination(idx);
|
|
3378
|
-
}, onFocus: (event) => event.currentTarget.focus(), ariaControlsGenerator: (idx) => `${id}-carousel-item-${idx}` }))));
|
|
3379
|
-
}
|
|
3380
|
-
/* harmony default export */ const Carousel_Carousel = (Carousel);
|
|
3381
|
-
//# sourceMappingURL=Carousel.js.map
|
|
3382
|
-
// EXTERNAL MODULE: external "react/jsx-runtime"
|
|
3383
|
-
var jsx_runtime_ = __webpack_require__(997);
|
|
3384
|
-
;// CONCATENATED MODULE: ./src/components/ui/Carousel/Carousel.tsx
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
function Carousel_Carousel_Carousel({
|
|
3389
|
-
id,
|
|
3390
|
-
testId,
|
|
3391
|
-
children,
|
|
3392
|
-
itemsPerPage,
|
|
3393
|
-
variant = 'scroll',
|
|
3394
|
-
infiniteMode = false
|
|
3395
|
-
}) {
|
|
3396
|
-
const isMobile = window.innerWidth <= 768;
|
|
3397
|
-
return /*#__PURE__*/jsx_runtime_.jsx(Carousel_Carousel, {
|
|
3398
|
-
id: id,
|
|
3399
|
-
testId: testId,
|
|
3400
|
-
variant: variant,
|
|
3401
|
-
infiniteMode: infiniteMode,
|
|
3402
|
-
itemsPerPage: isMobile ? 1.6 : itemsPerPage,
|
|
3403
|
-
children: children
|
|
3404
|
-
});
|
|
3405
|
-
}
|
|
3406
|
-
|
|
3407
|
-
/* harmony default export */ const ui_Carousel_Carousel = (Carousel_Carousel_Carousel);
|
|
3408
|
-
;// CONCATENATED MODULE: ./src/components/sections/ProductShelf/DefaultComponents.ts
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
const ProductShelfDefaultComponents = {
|
|
3413
|
-
ProductShelf: ProductShelf/* default */.Z,
|
|
3414
|
-
__experimentalCarousel: ui_Carousel_Carousel,
|
|
3415
|
-
__experimentalProductCard: ProductCard/* default */.Z
|
|
3416
|
-
};
|
|
3417
|
-
|
|
3418
|
-
/***/ }),
|
|
3419
|
-
|
|
3420
|
-
/***/ 8569:
|
|
3421
|
-
/***/ ((module, __webpack_exports__, __webpack_require__) => {
|
|
3422
|
-
|
|
3423
|
-
"use strict";
|
|
3424
|
-
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
|
3425
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3426
|
-
/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
3427
|
-
/* harmony export */ });
|
|
3428
|
-
/* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9785);
|
|
3429
|
-
/* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_intersection_observer__WEBPACK_IMPORTED_MODULE_0__);
|
|
3430
|
-
/* harmony import */ var _Section__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3271);
|
|
3431
|
-
/* harmony import */ var src_components_ui_ProductShelf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7691);
|
|
3432
|
-
/* harmony import */ var _section_module_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6627);
|
|
3433
|
-
/* harmony import */ var _section_module_scss__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_section_module_scss__WEBPACK_IMPORTED_MODULE_3__);
|
|
3434
|
-
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(997);
|
|
3435
|
-
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
|
|
3436
|
-
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([src_components_ui_ProductShelf__WEBPACK_IMPORTED_MODULE_4__]);
|
|
3437
|
-
src_components_ui_ProductShelf__WEBPACK_IMPORTED_MODULE_4__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
|
|
3438
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3439
|
-
|
|
3440
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3441
|
-
|
|
3442
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3128
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3443
3129
|
|
|
3444
3130
|
|
|
3445
3131
|
|
|
@@ -3706,158 +3392,565 @@ function ProductCardSkeleton({
|
|
|
3706
3392
|
width: '100%',
|
|
3707
3393
|
height: '100%'
|
|
3708
3394
|
}
|
|
3709
|
-
})
|
|
3710
|
-
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
|
|
3711
|
-
"data-fs-product-card-skeleton-content": true,
|
|
3712
|
-
children: [/*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_faststore_ui__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
|
|
3713
|
-
"data-fs-product-card-skeleton-text": true,
|
|
3714
|
-
size: {
|
|
3715
|
-
width: '90%',
|
|
3716
|
-
height: '1.5rem'
|
|
3395
|
+
})
|
|
3396
|
+
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
|
|
3397
|
+
"data-fs-product-card-skeleton-content": true,
|
|
3398
|
+
children: [/*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_faststore_ui__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
|
|
3399
|
+
"data-fs-product-card-skeleton-text": true,
|
|
3400
|
+
size: {
|
|
3401
|
+
width: '90%',
|
|
3402
|
+
height: '1.5rem'
|
|
3403
|
+
}
|
|
3404
|
+
}), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_faststore_ui__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
|
|
3405
|
+
"data-fs-product-card-skeleton-text": true,
|
|
3406
|
+
size: {
|
|
3407
|
+
width: '70%',
|
|
3408
|
+
height: '1.5rem'
|
|
3409
|
+
}
|
|
3410
|
+
}), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_faststore_ui__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
|
|
3411
|
+
"data-fs-product-card-skeleton-badge": true,
|
|
3412
|
+
size: {
|
|
3413
|
+
width: '6rem',
|
|
3414
|
+
height: '2rem'
|
|
3415
|
+
},
|
|
3416
|
+
border: "pill"
|
|
3417
|
+
}), displayButton && /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_faststore_ui__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
|
|
3418
|
+
"data-fs-product-card-skeleton-button": true,
|
|
3419
|
+
size: {
|
|
3420
|
+
width: '6rem',
|
|
3421
|
+
height: '2rem'
|
|
3422
|
+
},
|
|
3423
|
+
style: {
|
|
3424
|
+
columnGap: '.75rem'
|
|
3425
|
+
}
|
|
3426
|
+
})]
|
|
3427
|
+
})]
|
|
3428
|
+
});
|
|
3429
|
+
}
|
|
3430
|
+
|
|
3431
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ProductCardSkeleton);
|
|
3432
|
+
|
|
3433
|
+
/***/ }),
|
|
3434
|
+
|
|
3435
|
+
/***/ 6523:
|
|
3436
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3437
|
+
|
|
3438
|
+
"use strict";
|
|
3439
|
+
|
|
3440
|
+
// EXPORTS
|
|
3441
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
3442
|
+
"Z": () => (/* binding */ ProductShelfSkeleton_ProductShelfSkeleton)
|
|
3443
|
+
});
|
|
3444
|
+
|
|
3445
|
+
// EXTERNAL MODULE: ../components/dist/esm/organisms/ProductShelf/ProductShelf.js
|
|
3446
|
+
var ProductShelf = __webpack_require__(6737);
|
|
3447
|
+
// EXTERNAL MODULE: external "react"
|
|
3448
|
+
var external_react_ = __webpack_require__(6689);
|
|
3449
|
+
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
|
|
3450
|
+
;// CONCATENATED MODULE: ../components/dist/esm/organisms/ProductShelf/ProductShelfItems.js
|
|
3451
|
+
|
|
3452
|
+
const ProductShelfItems = (0,external_react_.forwardRef)(function ProductShelfItems({ testId = 'fs-product-shelf-items', children, ...otherProps }, ref) {
|
|
3453
|
+
return (external_react_default().createElement("ul", { role: "list", ref: ref, "data-fs-product-shelf-items": true, "data-fs-content": "product-shelf", "data-testid": testId, ...otherProps }, children));
|
|
3454
|
+
});
|
|
3455
|
+
/* harmony default export */ const ProductShelf_ProductShelfItems = (ProductShelfItems);
|
|
3456
|
+
//# sourceMappingURL=ProductShelfItems.js.map
|
|
3457
|
+
;// CONCATENATED MODULE: ../components/dist/esm/organisms/ProductShelf/ProductShelfItem.js
|
|
3458
|
+
|
|
3459
|
+
const ProductShelfItem = (0,external_react_.forwardRef)(function ProductShelfItem({ testId = 'fs-product-shelf-item', children, ...otherProps }, ref) {
|
|
3460
|
+
return (external_react_default().createElement("li", { role: "listitem", ref: ref, "data-fs-product-shelf-item": true, "data-testid": testId, ...otherProps }, children));
|
|
3461
|
+
});
|
|
3462
|
+
/* harmony default export */ const ProductShelf_ProductShelfItem = (ProductShelfItem);
|
|
3463
|
+
//# sourceMappingURL=ProductShelfItem.js.map
|
|
3464
|
+
// EXTERNAL MODULE: ./src/components/skeletons/ProductCardSkeleton/ProductCardSkeleton.tsx
|
|
3465
|
+
var ProductCardSkeleton = __webpack_require__(6531);
|
|
3466
|
+
// EXTERNAL MODULE: external "react/jsx-runtime"
|
|
3467
|
+
var jsx_runtime_ = __webpack_require__(997);
|
|
3468
|
+
;// CONCATENATED MODULE: ./src/components/skeletons/ProductShelfSkeleton/ProductShelfSkeleton.tsx
|
|
3469
|
+
|
|
3470
|
+
|
|
3471
|
+
|
|
3472
|
+
|
|
3473
|
+
|
|
3474
|
+
function ProductShelfSkeleton({
|
|
3475
|
+
children,
|
|
3476
|
+
aspectRatio,
|
|
3477
|
+
itemsPerPage,
|
|
3478
|
+
loading = true
|
|
3479
|
+
}) {
|
|
3480
|
+
return loading ? /*#__PURE__*/jsx_runtime_.jsx(ProductShelf/* default */.Z, {
|
|
3481
|
+
"data-fs-product-shelf-skeleton": true,
|
|
3482
|
+
children: /*#__PURE__*/jsx_runtime_.jsx(ProductShelf_ProductShelfItems, {
|
|
3483
|
+
children: Array.from({
|
|
3484
|
+
length: itemsPerPage
|
|
3485
|
+
}, (_, index) => /*#__PURE__*/jsx_runtime_.jsx(ProductShelf_ProductShelfItem, {
|
|
3486
|
+
children: /*#__PURE__*/jsx_runtime_.jsx(ProductCardSkeleton/* default */.Z, {
|
|
3487
|
+
aspectRatio: aspectRatio,
|
|
3488
|
+
sectioned: true,
|
|
3489
|
+
bordered: true
|
|
3490
|
+
})
|
|
3491
|
+
}, String(index)))
|
|
3492
|
+
})
|
|
3493
|
+
}) : /*#__PURE__*/jsx_runtime_.jsx(jsx_runtime_.Fragment, {
|
|
3494
|
+
children: children
|
|
3495
|
+
});
|
|
3496
|
+
}
|
|
3497
|
+
|
|
3498
|
+
/* harmony default export */ const ProductShelfSkeleton_ProductShelfSkeleton = (ProductShelfSkeleton);
|
|
3499
|
+
|
|
3500
|
+
/***/ }),
|
|
3501
|
+
|
|
3502
|
+
/***/ 2016:
|
|
3503
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3504
|
+
|
|
3505
|
+
"use strict";
|
|
3506
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3507
|
+
/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
3508
|
+
/* harmony export */ });
|
|
3509
|
+
/* harmony import */ var _faststore_ui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3922);
|
|
3510
|
+
/* harmony import */ var _faststore_ui__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2614);
|
|
3511
|
+
/* harmony import */ var src_sdk_session__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7295);
|
|
3512
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
|
|
3513
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
|
|
3514
|
+
|
|
3515
|
+
|
|
3516
|
+
|
|
3517
|
+
|
|
3518
|
+
const ButtonSignIn = ({
|
|
3519
|
+
label,
|
|
3520
|
+
myAccountLabel,
|
|
3521
|
+
icon: {
|
|
3522
|
+
alt,
|
|
3523
|
+
icon
|
|
3524
|
+
}
|
|
3525
|
+
}) => {
|
|
3526
|
+
const {
|
|
3527
|
+
person
|
|
3528
|
+
} = (0,src_sdk_session__WEBPACK_IMPORTED_MODULE_1__/* .useSession */ .kP)();
|
|
3529
|
+
return /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_faststore_ui__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
|
|
3530
|
+
"data-fs-button-signin-link": true,
|
|
3531
|
+
href: person?.id ? `/account` : `/login`,
|
|
3532
|
+
className: "text__title-mini",
|
|
3533
|
+
"aria-label": alt,
|
|
3534
|
+
variant: "tertiary",
|
|
3535
|
+
icon: /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_faststore_ui__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
|
|
3536
|
+
name: icon,
|
|
3537
|
+
width: 18,
|
|
3538
|
+
height: 18,
|
|
3539
|
+
weight: "bold"
|
|
3540
|
+
}),
|
|
3541
|
+
iconPosition: "left",
|
|
3542
|
+
children: person?.id ? myAccountLabel : label
|
|
3543
|
+
});
|
|
3544
|
+
};
|
|
3545
|
+
|
|
3546
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ButtonSignIn);
|
|
3547
|
+
|
|
3548
|
+
/***/ }),
|
|
3549
|
+
|
|
3550
|
+
/***/ 8619:
|
|
3551
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3552
|
+
|
|
3553
|
+
"use strict";
|
|
3554
|
+
|
|
3555
|
+
// EXPORTS
|
|
3556
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
3557
|
+
"Z": () => (/* binding */ ui_Carousel_Carousel)
|
|
3558
|
+
});
|
|
3559
|
+
|
|
3560
|
+
// EXTERNAL MODULE: external "react"
|
|
3561
|
+
var external_react_ = __webpack_require__(6689);
|
|
3562
|
+
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
|
|
3563
|
+
// EXTERNAL MODULE: ../components/dist/esm/molecules/IconButton/IconButton.js
|
|
3564
|
+
var IconButton = __webpack_require__(7041);
|
|
3565
|
+
// EXTERNAL MODULE: ../components/dist/esm/atoms/Icon/Icon.js
|
|
3566
|
+
var Icon = __webpack_require__(2614);
|
|
3567
|
+
// EXTERNAL MODULE: external "react-swipeable"
|
|
3568
|
+
var external_react_swipeable_ = __webpack_require__(3789);
|
|
3569
|
+
;// CONCATENATED MODULE: ../components/dist/esm/hooks/useSlider.js
|
|
3570
|
+
|
|
3571
|
+
|
|
3572
|
+
const nextPage = (current, total) => (current + 1) % total;
|
|
3573
|
+
const previousPage = (current, total) => (total - ((total - current + 1) % total)) % total;
|
|
3574
|
+
function reducer(state, action) {
|
|
3575
|
+
switch (action.type) {
|
|
3576
|
+
case 'NEXT_PAGE': {
|
|
3577
|
+
// If `state.infinite` is true, we need to take into account an extra
|
|
3578
|
+
// page in the calculation. This extra page is a clone of the first page.
|
|
3579
|
+
const adjustedTotalPages = state.infinite
|
|
3580
|
+
? state.totalPages + 1
|
|
3581
|
+
: state.totalPages;
|
|
3582
|
+
const nextPageIndex = nextPage(state.currentPage, adjustedTotalPages);
|
|
3583
|
+
const nextItemIndex = (nextPageIndex % adjustedTotalPages) * state.itemsPerPage;
|
|
3584
|
+
return {
|
|
3585
|
+
...state,
|
|
3586
|
+
sliding: true,
|
|
3587
|
+
slideDirection: 'next',
|
|
3588
|
+
currentItem: nextItemIndex,
|
|
3589
|
+
currentPage: nextPageIndex,
|
|
3590
|
+
};
|
|
3591
|
+
}
|
|
3592
|
+
case 'PREVIOUS_PAGE': {
|
|
3593
|
+
// If `state.infinite` is true, we need to take into account an extra
|
|
3594
|
+
// page in the calculation. This extra page is a clone of the first page.
|
|
3595
|
+
const adjustedTotalPages = state.infinite
|
|
3596
|
+
? state.totalPages + 1
|
|
3597
|
+
: state.totalPages;
|
|
3598
|
+
// If `state.infinite` is true and we're currently on page 0, we need to
|
|
3599
|
+
// let the slider go to page -1. This -1 page is a clone of the last page.
|
|
3600
|
+
const shouldGoToClone = state.infinite && state.currentPage === 0;
|
|
3601
|
+
const previousPageIndex = shouldGoToClone
|
|
3602
|
+
? -1
|
|
3603
|
+
: previousPage(state.currentPage, state.totalPages);
|
|
3604
|
+
return {
|
|
3605
|
+
...state,
|
|
3606
|
+
sliding: true,
|
|
3607
|
+
slideDirection: 'previous',
|
|
3608
|
+
currentItem: (previousPageIndex % adjustedTotalPages) * state.itemsPerPage,
|
|
3609
|
+
currentPage: previousPageIndex,
|
|
3610
|
+
};
|
|
3611
|
+
}
|
|
3612
|
+
case 'GO_TO_PAGE': {
|
|
3613
|
+
if (action.payload.pageIndex === state.currentPage) {
|
|
3614
|
+
return state;
|
|
3615
|
+
}
|
|
3616
|
+
return {
|
|
3617
|
+
...state,
|
|
3618
|
+
sliding: action.payload.shouldSlide,
|
|
3619
|
+
slideDirection: action.payload.pageIndex > state.currentPage ? 'next' : 'previous',
|
|
3620
|
+
currentItem: (action.payload.pageIndex % state.totalPages) * state.itemsPerPage,
|
|
3621
|
+
currentPage: action.payload.pageIndex,
|
|
3622
|
+
};
|
|
3623
|
+
}
|
|
3624
|
+
case 'STOP_SLIDE':
|
|
3625
|
+
return { ...state, sliding: false };
|
|
3626
|
+
default:
|
|
3627
|
+
return state;
|
|
3628
|
+
}
|
|
3629
|
+
}
|
|
3630
|
+
const defaultSliderState = (totalItems, itemsPerPage, infinite) => ({
|
|
3631
|
+
currentItem: 0,
|
|
3632
|
+
currentPage: 0,
|
|
3633
|
+
sliding: false,
|
|
3634
|
+
slideDirection: 'next',
|
|
3635
|
+
totalItems,
|
|
3636
|
+
itemsPerPage,
|
|
3637
|
+
totalPages: Math.ceil(totalItems / itemsPerPage),
|
|
3638
|
+
infinite,
|
|
3639
|
+
});
|
|
3640
|
+
const slide = (page, dispatch) => {
|
|
3641
|
+
if (page === 'next') {
|
|
3642
|
+
dispatch({ type: 'NEXT_PAGE' });
|
|
3643
|
+
}
|
|
3644
|
+
if (page === 'previous') {
|
|
3645
|
+
dispatch({ type: 'PREVIOUS_PAGE' });
|
|
3646
|
+
}
|
|
3647
|
+
if (typeof page === 'number') {
|
|
3648
|
+
dispatch({
|
|
3649
|
+
type: 'GO_TO_PAGE',
|
|
3650
|
+
payload: {
|
|
3651
|
+
pageIndex: page,
|
|
3652
|
+
shouldSlide: true,
|
|
3653
|
+
},
|
|
3654
|
+
});
|
|
3655
|
+
}
|
|
3656
|
+
};
|
|
3657
|
+
const useSlider = ({ totalItems, itemsPerPage = 1, infiniteMode = false, shouldSlideOnSwipe = true, ...swipeableConfigOverrides }) => {
|
|
3658
|
+
const [sliderState, sliderDispatch] = (0,external_react_.useReducer)(reducer, undefined, () => defaultSliderState(totalItems, itemsPerPage, infiniteMode));
|
|
3659
|
+
const handlers = (0,external_react_swipeable_.useSwipeable)({
|
|
3660
|
+
onSwipedRight: () => shouldSlideOnSwipe && slide('previous', sliderDispatch),
|
|
3661
|
+
onSwipedLeft: () => shouldSlideOnSwipe && slide('next', sliderDispatch),
|
|
3662
|
+
trackMouse: true,
|
|
3663
|
+
...swipeableConfigOverrides,
|
|
3664
|
+
});
|
|
3665
|
+
return {
|
|
3666
|
+
handlers,
|
|
3667
|
+
slide,
|
|
3668
|
+
sliderState,
|
|
3669
|
+
sliderDispatch,
|
|
3670
|
+
};
|
|
3671
|
+
};
|
|
3672
|
+
//# sourceMappingURL=useSlider.js.map
|
|
3673
|
+
// EXTERNAL MODULE: ../components/dist/esm/atoms/Button/Button.js
|
|
3674
|
+
var Button = __webpack_require__(3339);
|
|
3675
|
+
;// CONCATENATED MODULE: ../components/dist/esm/molecules/Carousel/CarouselBullets.js
|
|
3676
|
+
|
|
3677
|
+
|
|
3678
|
+
const defaultAriaLabel = (id, idx, isActive) => isActive ? `Current page from ${id}` : `Go to page ${idx + 1} from ${id}`;
|
|
3679
|
+
const CarouselBullets = (0,external_react_.forwardRef)(function Bullets({ id, totalQuantity, activeBullet, onClick, testId = 'fs-carousel-bullets', ariaLabelGenerator = defaultAriaLabel, ariaControlsGenerator, ...otherProps }, ref) {
|
|
3680
|
+
const bulletIndexes = (0,external_react_.useMemo)(() => Array(totalQuantity).fill(0), [totalQuantity]);
|
|
3681
|
+
return (external_react_default().createElement("div", { ref: ref, "data-fs-carousel-bullets": true, "data-testid": testId, role: "tablist", ...otherProps }, bulletIndexes.map((_, idx) => {
|
|
3682
|
+
const isActive = activeBullet === idx;
|
|
3683
|
+
return (external_react_default().createElement(Button/* default */.Z, { key: `${id}-${idx}`, role: "tab", tabIndex: -1, "data-fs-carousel-bullet": true, testId: `${testId}-bullet`, onClick: (e) => onClick(e, idx), "aria-label": ariaLabelGenerator(id, idx, isActive), "aria-controls": ariaControlsGenerator?.(idx), "aria-selected": isActive, variant: "tertiary" }));
|
|
3684
|
+
})));
|
|
3685
|
+
});
|
|
3686
|
+
/* harmony default export */ const Carousel_CarouselBullets = (CarouselBullets);
|
|
3687
|
+
//# sourceMappingURL=CarouselBullets.js.map
|
|
3688
|
+
;// CONCATENATED MODULE: ../components/dist/esm/hooks/useSlideVisibility.js
|
|
3689
|
+
|
|
3690
|
+
function isSlideVisible({ itemsPerPage, currentSlide, slideIdx, totalItems, }) {
|
|
3691
|
+
const isClonedSlide = currentSlide < 0 || currentSlide >= totalItems;
|
|
3692
|
+
const isVisible = slideIdx >= currentSlide && slideIdx < currentSlide + itemsPerPage;
|
|
3693
|
+
return isClonedSlide || isVisible;
|
|
3694
|
+
}
|
|
3695
|
+
const useSlideVisibility = ({ currentSlide, itemsPerPage, totalItems, }) => {
|
|
3696
|
+
/** Keeps track of slides that have been visualized before.
|
|
3697
|
+
* We want to keep rendering them because the issue is mostly rendering
|
|
3698
|
+
* slides that might never be viewed; On the other hand, hiding slides
|
|
3699
|
+
* that were visible causes visual glitches */
|
|
3700
|
+
const visitedSlides = (0,external_react_.useRef)(new Set());
|
|
3701
|
+
(0,external_react_.useEffect)(() => {
|
|
3702
|
+
for (let i = 0; i < itemsPerPage; i++) {
|
|
3703
|
+
visitedSlides.current.add(currentSlide + i);
|
|
3704
|
+
}
|
|
3705
|
+
}, [currentSlide, itemsPerPage]);
|
|
3706
|
+
const isItemVisible = (index) => isSlideVisible({
|
|
3707
|
+
slideIdx: index,
|
|
3708
|
+
currentSlide,
|
|
3709
|
+
itemsPerPage,
|
|
3710
|
+
totalItems,
|
|
3711
|
+
});
|
|
3712
|
+
const shouldRenderItem = (index) => {
|
|
3713
|
+
return visitedSlides.current.has(index) || isItemVisible(index);
|
|
3714
|
+
};
|
|
3715
|
+
return { shouldRenderItem, isItemVisible };
|
|
3716
|
+
};
|
|
3717
|
+
//# sourceMappingURL=useSlideVisibility.js.map
|
|
3718
|
+
;// CONCATENATED MODULE: ../components/dist/esm/molecules/Carousel/CarouselItem.js
|
|
3719
|
+
|
|
3720
|
+
|
|
3721
|
+
function CarouselItem({ id, index, state, children, totalItems, infiniteMode, isScrollCarousel, marginRightValue, }) {
|
|
3722
|
+
const { isItemVisible, shouldRenderItem } = useSlideVisibility({
|
|
3723
|
+
totalItems,
|
|
3724
|
+
currentSlide: state.currentItem,
|
|
3725
|
+
itemsPerPage: state.itemsPerPage,
|
|
3726
|
+
});
|
|
3727
|
+
const defaultStyle = { width: '100%' };
|
|
3728
|
+
const scrollCarouselStyle = {
|
|
3729
|
+
width: `calc((100% - ${marginRightValue} * ${state.itemsPerPage - 1}) / ${state.itemsPerPage})`,
|
|
3730
|
+
};
|
|
3731
|
+
const style = isScrollCarousel && state.itemsPerPage > 1
|
|
3732
|
+
? { ...scrollCarouselStyle }
|
|
3733
|
+
: { ...defaultStyle };
|
|
3734
|
+
const shouldDisplayItem = isScrollCarousel || shouldRenderItem(index - Number(infiniteMode));
|
|
3735
|
+
return (external_react_default().createElement("li", { style: style, id: `${id}-carousel-item-${index}`, "data-fs-carousel-item": true, "data-fs-carousel-item-visible": isItemVisible(index - Number(infiniteMode)) || undefined }, shouldDisplayItem ? children : null));
|
|
3736
|
+
}
|
|
3737
|
+
/* harmony default export */ const Carousel_CarouselItem = (CarouselItem);
|
|
3738
|
+
//# sourceMappingURL=CarouselItem.js.map
|
|
3739
|
+
;// CONCATENATED MODULE: ../components/dist/esm/molecules/Carousel/Carousel.js
|
|
3740
|
+
|
|
3741
|
+
|
|
3742
|
+
|
|
3743
|
+
|
|
3744
|
+
|
|
3745
|
+
const createTransformValues = (infinite, totalItems) => {
|
|
3746
|
+
const transformMap = {};
|
|
3747
|
+
const slideWidth = 100 / totalItems;
|
|
3748
|
+
for (let idx = 0; idx < totalItems; ++idx) {
|
|
3749
|
+
const currIdx = infinite ? idx - 1 : idx;
|
|
3750
|
+
const transformValue = -(slideWidth * idx);
|
|
3751
|
+
transformMap[currIdx] = transformValue;
|
|
3752
|
+
}
|
|
3753
|
+
return transformMap;
|
|
3754
|
+
};
|
|
3755
|
+
function Carousel({ children, className, 'aria-label': ariaLabel, infiniteMode = false, controls = 'complete', testId = 'fs-carousel', transition = {
|
|
3756
|
+
duration: 400,
|
|
3757
|
+
property: 'transform',
|
|
3758
|
+
}, id = 'fs-carousel', variant = 'scroll', itemsPerPage = 1, navigationIcons = undefined, ...swipeableConfigOverrides }) {
|
|
3759
|
+
if (itemsPerPage < 1) {
|
|
3760
|
+
throw new Error('itemsPerPage must be greater than or equal to 1');
|
|
3761
|
+
}
|
|
3762
|
+
const carouselTrackRef = (0,external_react_.useRef)(null);
|
|
3763
|
+
const isSlideCarousel = variant === 'slide';
|
|
3764
|
+
const isScrollCarousel = variant === 'scroll';
|
|
3765
|
+
const childrenArray = external_react_default().Children.toArray(children);
|
|
3766
|
+
const childrenCount = childrenArray.length;
|
|
3767
|
+
const numberOfSlides = infiniteMode ? childrenCount + 2 : childrenCount;
|
|
3768
|
+
const slidingTransition = `${transition.property} ${transition.duration}ms ${transition.timing ?? ''} ${transition.delay ?? ''}`;
|
|
3769
|
+
const { handlers, slide, sliderState, sliderDispatch } = useSlider({
|
|
3770
|
+
itemsPerPage,
|
|
3771
|
+
infiniteMode,
|
|
3772
|
+
totalItems: childrenCount,
|
|
3773
|
+
shouldSlideOnSwipe: isSlideCarousel,
|
|
3774
|
+
...swipeableConfigOverrides,
|
|
3775
|
+
});
|
|
3776
|
+
const pagesCount = Math.ceil(childrenCount / sliderState.itemsPerPage);
|
|
3777
|
+
const [marginRight, setMarginRight] = (0,external_react_.useState)('16px');
|
|
3778
|
+
const [carouselItemsWidth, setCarouselItemsWidth] = (0,external_react_.useState)(0);
|
|
3779
|
+
(0,external_react_.useEffect)(() => {
|
|
3780
|
+
const item = carouselTrackRef.current?.firstElementChild;
|
|
3781
|
+
if (item) {
|
|
3782
|
+
setMarginRight(getComputedStyle(item).getPropertyValue('margin-right'));
|
|
3783
|
+
setCarouselItemsWidth(Number(item.clientWidth) + parseInt(marginRight, 10) + 1);
|
|
3784
|
+
}
|
|
3785
|
+
}, [carouselItemsWidth]);
|
|
3786
|
+
const showNavigationArrows = pagesCount !== 1 &&
|
|
3787
|
+
(controls === 'complete' || controls === 'navigationArrows');
|
|
3788
|
+
const showPaginationBullets = pagesCount !== 1 &&
|
|
3789
|
+
(controls === 'complete' || controls === 'paginationBullets');
|
|
3790
|
+
const transformValues = (0,external_react_.useMemo)(() => createTransformValues(infiniteMode, numberOfSlides), [numberOfSlides, infiniteMode]);
|
|
3791
|
+
const postRenderedSlides = infiniteMode && children ? childrenArray.slice(0, 1) : [];
|
|
3792
|
+
const preRenderedSlides = infiniteMode && children ? childrenArray.slice(childrenCount - 1) : [];
|
|
3793
|
+
const slides = preRenderedSlides.concat(children ?? [], postRenderedSlides);
|
|
3794
|
+
const slideCarouselTrackStyle = (0,external_react_.useMemo)(() => ({
|
|
3795
|
+
width: `${numberOfSlides * 100}%`,
|
|
3796
|
+
transition: sliderState.sliding ? slidingTransition : undefined,
|
|
3797
|
+
transform: `translate3d(${transformValues[sliderState.currentPage]}%, 0, 0)`,
|
|
3798
|
+
}), [
|
|
3799
|
+
numberOfSlides,
|
|
3800
|
+
transformValues,
|
|
3801
|
+
slidingTransition,
|
|
3802
|
+
sliderState.sliding,
|
|
3803
|
+
sliderState.currentPage,
|
|
3804
|
+
]);
|
|
3805
|
+
const scrollCarouselTrackStyle = (0,external_react_.useMemo)(() => ({
|
|
3806
|
+
width: '100%',
|
|
3807
|
+
overflowX: 'scroll',
|
|
3808
|
+
whiteSpace: 'nowrap',
|
|
3809
|
+
}), []);
|
|
3810
|
+
const carouselTrackStyle = (isSlideCarousel && slideCarouselTrackStyle) ||
|
|
3811
|
+
(isScrollCarousel && scrollCarouselTrackStyle);
|
|
3812
|
+
const slidePrevious = () => {
|
|
3813
|
+
if (sliderState.sliding ||
|
|
3814
|
+
(!infiniteMode && sliderState.currentPage === 0)) {
|
|
3815
|
+
return;
|
|
3816
|
+
}
|
|
3817
|
+
slide('previous', sliderDispatch);
|
|
3818
|
+
};
|
|
3819
|
+
const slideNext = () => {
|
|
3820
|
+
if (sliderState.sliding ||
|
|
3821
|
+
(!infiniteMode && sliderState.currentPage === childrenCount - 1)) {
|
|
3822
|
+
return;
|
|
3823
|
+
}
|
|
3824
|
+
slide('next', sliderDispatch);
|
|
3825
|
+
};
|
|
3826
|
+
const onScrollTrack = (event) => {
|
|
3827
|
+
if (isSlideCarousel || itemsPerPage > 1) {
|
|
3828
|
+
return;
|
|
3829
|
+
}
|
|
3830
|
+
const itemWidth = Number(event.currentTarget.firstElementChild?.scrollWidth);
|
|
3831
|
+
const scrollOffset = event.currentTarget?.scrollLeft;
|
|
3832
|
+
const formatter = scrollOffset > itemWidth / 2 ? Math.round : Math.floor;
|
|
3833
|
+
const page = formatter(scrollOffset / itemWidth);
|
|
3834
|
+
slide(page, sliderDispatch);
|
|
3835
|
+
};
|
|
3836
|
+
const onTransitionTrackEnd = () => {
|
|
3837
|
+
sliderDispatch({
|
|
3838
|
+
type: 'STOP_SLIDE',
|
|
3839
|
+
});
|
|
3840
|
+
if (infiniteMode && sliderState.currentItem >= childrenCount) {
|
|
3841
|
+
sliderDispatch({
|
|
3842
|
+
type: 'GO_TO_PAGE',
|
|
3843
|
+
payload: {
|
|
3844
|
+
pageIndex: 0,
|
|
3845
|
+
shouldSlide: false,
|
|
3846
|
+
},
|
|
3847
|
+
});
|
|
3848
|
+
}
|
|
3849
|
+
if (infiniteMode && sliderState.currentItem < 0) {
|
|
3850
|
+
sliderDispatch({
|
|
3851
|
+
type: 'GO_TO_PAGE',
|
|
3852
|
+
payload: {
|
|
3853
|
+
pageIndex: sliderState.totalPages - 1,
|
|
3854
|
+
shouldSlide: false,
|
|
3855
|
+
},
|
|
3856
|
+
});
|
|
3717
3857
|
}
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
height: '1.5rem'
|
|
3858
|
+
};
|
|
3859
|
+
const onScrollPagination = async (index, slideDirection) => {
|
|
3860
|
+
if (slideDirection === 'previous' && sliderState.currentPage === 0) {
|
|
3861
|
+
return;
|
|
3723
3862
|
}
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
width: '6rem',
|
|
3728
|
-
height: '2rem'
|
|
3729
|
-
},
|
|
3730
|
-
border: "pill"
|
|
3731
|
-
}), displayButton && /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_faststore_ui__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
|
|
3732
|
-
"data-fs-product-card-skeleton-button": true,
|
|
3733
|
-
size: {
|
|
3734
|
-
width: '6rem',
|
|
3735
|
-
height: '2rem'
|
|
3736
|
-
},
|
|
3737
|
-
style: {
|
|
3738
|
-
columnGap: '.75rem'
|
|
3863
|
+
if (slideDirection === 'next' &&
|
|
3864
|
+
sliderState.currentPage === sliderState.totalPages - 1) {
|
|
3865
|
+
return;
|
|
3739
3866
|
}
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3867
|
+
let scrollOffset = index * carouselItemsWidth * itemsPerPage;
|
|
3868
|
+
carouselTrackRef.current?.scrollTo({
|
|
3869
|
+
left: scrollOffset,
|
|
3870
|
+
behavior: 'smooth',
|
|
3871
|
+
});
|
|
3872
|
+
slide(index, sliderDispatch);
|
|
3873
|
+
};
|
|
3874
|
+
// accessible behavior for tablist
|
|
3875
|
+
const handleBulletsKeyDown = (event) => {
|
|
3876
|
+
switch (event.key) {
|
|
3877
|
+
case 'ArrowLeft': {
|
|
3878
|
+
isSlideCarousel && slidePrevious();
|
|
3879
|
+
isScrollCarousel &&
|
|
3880
|
+
onScrollPagination(sliderState.currentPage - 1, 'previous');
|
|
3881
|
+
break;
|
|
3882
|
+
}
|
|
3883
|
+
case 'ArrowRight': {
|
|
3884
|
+
isSlideCarousel && slideNext();
|
|
3885
|
+
isScrollCarousel &&
|
|
3886
|
+
onScrollPagination(sliderState.currentPage + 1, 'next');
|
|
3887
|
+
break;
|
|
3888
|
+
}
|
|
3889
|
+
case 'Home': {
|
|
3890
|
+
slide(0, sliderDispatch);
|
|
3891
|
+
break;
|
|
3892
|
+
}
|
|
3893
|
+
case 'End': {
|
|
3894
|
+
slide(childrenCount - 1, sliderDispatch);
|
|
3895
|
+
break;
|
|
3896
|
+
}
|
|
3897
|
+
default:
|
|
3898
|
+
}
|
|
3899
|
+
};
|
|
3900
|
+
return (external_react_default().createElement("section", { id: id, "data-fs-carousel": true, "data-fs-carousel-variant": variant, className: className, "data-testid": testId, "aria-label": ariaLabel },
|
|
3901
|
+
external_react_default().createElement("div", { "data-fs-carousel-track-container": true, style: {
|
|
3902
|
+
width: '100%',
|
|
3903
|
+
overflow: 'hidden',
|
|
3904
|
+
display: isScrollCarousel ? 'block' : undefined,
|
|
3905
|
+
}, ...handlers },
|
|
3906
|
+
external_react_default().createElement("ul", { "aria-live": "polite", ref: carouselTrackRef, style: carouselTrackStyle, "data-fs-carousel-track": true, onScroll: onScrollTrack, onTransitionEnd: onTransitionTrackEnd }, slides.map((currentSlide, idx) => (external_react_default().createElement(Carousel_CarouselItem, { id: id, index: idx, key: String(idx), state: sliderState, totalItems: childrenCount, infiniteMode: infiniteMode, isScrollCarousel: isScrollCarousel, marginRightValue: marginRight }, currentSlide))))),
|
|
3907
|
+
showNavigationArrows && (external_react_default().createElement("div", { "data-fs-carousel-controls": true },
|
|
3908
|
+
external_react_default().createElement(IconButton/* default */.Z, { "data-fs-carousel-control": "left", "aria-controls": id, disabled: !infiniteMode && sliderState.currentPage === 0, "aria-label": "previous", icon: navigationIcons?.left ?? (external_react_default().createElement(Icon/* default */.Z, { name: "ArrowLeft", width: 20, height: 20, weight: "bold" })), onClick: () => {
|
|
3909
|
+
isSlideCarousel && slidePrevious();
|
|
3910
|
+
isScrollCarousel &&
|
|
3911
|
+
onScrollPagination(sliderState.currentPage - 1, 'previous');
|
|
3912
|
+
} }),
|
|
3913
|
+
external_react_default().createElement(IconButton/* default */.Z, { "data-fs-carousel-control": "right", "aria-controls": id, disabled: !infiniteMode &&
|
|
3914
|
+
sliderState.currentPage === sliderState.totalPages - 1, "aria-label": "next", icon: navigationIcons?.right ?? (external_react_default().createElement(Icon/* default */.Z, { name: "ArrowRight", width: 20, height: 20, weight: "bold" })), onClick: () => {
|
|
3915
|
+
isSlideCarousel && slideNext();
|
|
3916
|
+
isScrollCarousel &&
|
|
3917
|
+
onScrollPagination(sliderState.currentPage + 1, 'next');
|
|
3918
|
+
} }))),
|
|
3919
|
+
showPaginationBullets && (external_react_default().createElement(Carousel_CarouselBullets, { id: id, tabIndex: 0, activeBullet: sliderState.currentPage, totalQuantity: pagesCount, onKeyDown: handleBulletsKeyDown, onClick: async (_, idx) => {
|
|
3920
|
+
isSlideCarousel &&
|
|
3921
|
+
!sliderState.sliding &&
|
|
3922
|
+
slide(idx, sliderDispatch);
|
|
3923
|
+
isScrollCarousel && onScrollPagination(idx);
|
|
3924
|
+
}, onFocus: (event) => event.currentTarget.focus(), ariaControlsGenerator: (idx) => `${id}-carousel-item-${idx}` }))));
|
|
3743
3925
|
}
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
/***/ }),
|
|
3748
|
-
|
|
3749
|
-
/***/ 6523:
|
|
3750
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3751
|
-
|
|
3752
|
-
"use strict";
|
|
3753
|
-
|
|
3754
|
-
// EXPORTS
|
|
3755
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
3756
|
-
"Z": () => (/* binding */ ProductShelfSkeleton_ProductShelfSkeleton)
|
|
3757
|
-
});
|
|
3758
|
-
|
|
3759
|
-
// EXTERNAL MODULE: ../components/dist/esm/organisms/ProductShelf/ProductShelf.js
|
|
3760
|
-
var ProductShelf = __webpack_require__(6737);
|
|
3761
|
-
// EXTERNAL MODULE: external "react"
|
|
3762
|
-
var external_react_ = __webpack_require__(6689);
|
|
3763
|
-
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
|
|
3764
|
-
;// CONCATENATED MODULE: ../components/dist/esm/organisms/ProductShelf/ProductShelfItems.js
|
|
3765
|
-
|
|
3766
|
-
const ProductShelfItems = (0,external_react_.forwardRef)(function ProductShelfItems({ testId = 'fs-product-shelf-items', children, ...otherProps }, ref) {
|
|
3767
|
-
return (external_react_default().createElement("ul", { role: "list", ref: ref, "data-fs-product-shelf-items": true, "data-fs-content": "product-shelf", "data-testid": testId, ...otherProps }, children));
|
|
3768
|
-
});
|
|
3769
|
-
/* harmony default export */ const ProductShelf_ProductShelfItems = (ProductShelfItems);
|
|
3770
|
-
//# sourceMappingURL=ProductShelfItems.js.map
|
|
3771
|
-
;// CONCATENATED MODULE: ../components/dist/esm/organisms/ProductShelf/ProductShelfItem.js
|
|
3772
|
-
|
|
3773
|
-
const ProductShelfItem = (0,external_react_.forwardRef)(function ProductShelfItem({ testId = 'fs-product-shelf-item', children, ...otherProps }, ref) {
|
|
3774
|
-
return (external_react_default().createElement("li", { role: "listitem", ref: ref, "data-fs-product-shelf-item": true, "data-testid": testId, ...otherProps }, children));
|
|
3775
|
-
});
|
|
3776
|
-
/* harmony default export */ const ProductShelf_ProductShelfItem = (ProductShelfItem);
|
|
3777
|
-
//# sourceMappingURL=ProductShelfItem.js.map
|
|
3778
|
-
// EXTERNAL MODULE: ./src/components/skeletons/ProductCardSkeleton/ProductCardSkeleton.tsx
|
|
3779
|
-
var ProductCardSkeleton = __webpack_require__(6531);
|
|
3926
|
+
/* harmony default export */ const Carousel_Carousel = (Carousel);
|
|
3927
|
+
//# sourceMappingURL=Carousel.js.map
|
|
3780
3928
|
// EXTERNAL MODULE: external "react/jsx-runtime"
|
|
3781
3929
|
var jsx_runtime_ = __webpack_require__(997);
|
|
3782
|
-
;// CONCATENATED MODULE: ./src/components/
|
|
3783
|
-
|
|
3784
|
-
|
|
3930
|
+
;// CONCATENATED MODULE: ./src/components/ui/Carousel/Carousel.tsx
|
|
3785
3931
|
|
|
3786
3932
|
|
|
3787
3933
|
|
|
3788
|
-
function
|
|
3934
|
+
function Carousel_Carousel_Carousel({
|
|
3935
|
+
id,
|
|
3936
|
+
testId,
|
|
3789
3937
|
children,
|
|
3790
|
-
aspectRatio,
|
|
3791
3938
|
itemsPerPage,
|
|
3792
|
-
|
|
3939
|
+
variant = 'scroll',
|
|
3940
|
+
infiniteMode = false
|
|
3793
3941
|
}) {
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
aspectRatio: aspectRatio,
|
|
3802
|
-
sectioned: true,
|
|
3803
|
-
bordered: true
|
|
3804
|
-
})
|
|
3805
|
-
}, String(index)))
|
|
3806
|
-
})
|
|
3807
|
-
}) : /*#__PURE__*/jsx_runtime_.jsx(jsx_runtime_.Fragment, {
|
|
3942
|
+
const isMobile = window.innerWidth <= 768;
|
|
3943
|
+
return /*#__PURE__*/jsx_runtime_.jsx(Carousel_Carousel, {
|
|
3944
|
+
id: id,
|
|
3945
|
+
testId: testId,
|
|
3946
|
+
variant: variant,
|
|
3947
|
+
infiniteMode: infiniteMode,
|
|
3948
|
+
itemsPerPage: isMobile ? 1.6 : itemsPerPage,
|
|
3808
3949
|
children: children
|
|
3809
3950
|
});
|
|
3810
3951
|
}
|
|
3811
3952
|
|
|
3812
|
-
/* harmony default export */ const
|
|
3813
|
-
|
|
3814
|
-
/***/ }),
|
|
3815
|
-
|
|
3816
|
-
/***/ 2016:
|
|
3817
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3818
|
-
|
|
3819
|
-
"use strict";
|
|
3820
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3821
|
-
/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
3822
|
-
/* harmony export */ });
|
|
3823
|
-
/* harmony import */ var _faststore_ui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3922);
|
|
3824
|
-
/* harmony import */ var _faststore_ui__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2614);
|
|
3825
|
-
/* harmony import */ var src_sdk_session__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7295);
|
|
3826
|
-
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
|
|
3827
|
-
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
const ButtonSignIn = ({
|
|
3833
|
-
label,
|
|
3834
|
-
myAccountLabel,
|
|
3835
|
-
icon: {
|
|
3836
|
-
alt,
|
|
3837
|
-
icon
|
|
3838
|
-
}
|
|
3839
|
-
}) => {
|
|
3840
|
-
const {
|
|
3841
|
-
person
|
|
3842
|
-
} = (0,src_sdk_session__WEBPACK_IMPORTED_MODULE_1__/* .useSession */ .kP)();
|
|
3843
|
-
return /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_faststore_ui__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
|
|
3844
|
-
"data-fs-button-signin-link": true,
|
|
3845
|
-
href: person?.id ? `/account` : `/login`,
|
|
3846
|
-
className: "text__title-mini",
|
|
3847
|
-
"aria-label": alt,
|
|
3848
|
-
variant: "tertiary",
|
|
3849
|
-
icon: /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_faststore_ui__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
|
|
3850
|
-
name: icon,
|
|
3851
|
-
width: 18,
|
|
3852
|
-
height: 18,
|
|
3853
|
-
weight: "bold"
|
|
3854
|
-
}),
|
|
3855
|
-
iconPosition: "left",
|
|
3856
|
-
children: person?.id ? myAccountLabel : label
|
|
3857
|
-
});
|
|
3858
|
-
};
|
|
3859
|
-
|
|
3860
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ButtonSignIn);
|
|
3953
|
+
/* harmony default export */ const ui_Carousel_Carousel = (Carousel_Carousel_Carousel);
|
|
3861
3954
|
|
|
3862
3955
|
/***/ }),
|
|
3863
3956
|
|
|
@@ -4644,6 +4737,61 @@ const useOverrideClassName = () => (0,react__WEBPACK_IMPORTED_MODULE_0__.useCont
|
|
|
4644
4737
|
|
|
4645
4738
|
/***/ }),
|
|
4646
4739
|
|
|
4740
|
+
/***/ 5953:
|
|
4741
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
4742
|
+
|
|
4743
|
+
"use strict";
|
|
4744
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4745
|
+
/* harmony export */ "En": () => (/* binding */ isSearchPage),
|
|
4746
|
+
/* harmony export */ "OJ": () => (/* binding */ isPLP),
|
|
4747
|
+
/* harmony export */ "ZP": () => (__WEBPACK_DEFAULT_EXPORT__),
|
|
4748
|
+
/* harmony export */ "al": () => (/* binding */ usePDP),
|
|
4749
|
+
/* harmony export */ "qt": () => (/* binding */ usePage),
|
|
4750
|
+
/* harmony export */ "tS": () => (/* binding */ isPDP)
|
|
4751
|
+
/* harmony export */ });
|
|
4752
|
+
/* unused harmony exports usePLP, useSearchPage */
|
|
4753
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
|
|
4754
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
4755
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(997);
|
|
4756
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
|
|
4757
|
+
|
|
4758
|
+
|
|
4759
|
+
const isPDP = x => x?.data?.product?.sku != undefined && x?.data?.product?.sku != null;
|
|
4760
|
+
const isPLP = x => x?.data?.collection?.seo != undefined && x?.data?.collection?.seo != null && x?.data?.collection?.sku == undefined;
|
|
4761
|
+
const isSearchPage = x => x === undefined || x?.data?.title != undefined || x?.data?.searchTerm != undefined;
|
|
4762
|
+
const PageContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);
|
|
4763
|
+
|
|
4764
|
+
function PageProvider({
|
|
4765
|
+
context,
|
|
4766
|
+
children
|
|
4767
|
+
}) {
|
|
4768
|
+
const value = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({
|
|
4769
|
+
context
|
|
4770
|
+
}), [context]);
|
|
4771
|
+
return /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx(PageContext.Provider, {
|
|
4772
|
+
value: value,
|
|
4773
|
+
children: children
|
|
4774
|
+
});
|
|
4775
|
+
}
|
|
4776
|
+
|
|
4777
|
+
function usePage() {
|
|
4778
|
+
const {
|
|
4779
|
+
context
|
|
4780
|
+
} = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(PageContext);
|
|
4781
|
+
|
|
4782
|
+
if (context == null) {
|
|
4783
|
+
throw new Error('Missing Overrides context on React tree');
|
|
4784
|
+
}
|
|
4785
|
+
|
|
4786
|
+
return context;
|
|
4787
|
+
}
|
|
4788
|
+
const usePDP = () => usePage();
|
|
4789
|
+
const usePLP = () => usePage();
|
|
4790
|
+
const useSearchPage = () => usePage();
|
|
4791
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PageProvider);
|
|
4792
|
+
|
|
4793
|
+
/***/ }),
|
|
4794
|
+
|
|
4647
4795
|
/***/ 8788:
|
|
4648
4796
|
/***/ ((module, __webpack_exports__, __webpack_require__) => {
|
|
4649
4797
|
|
|
@@ -4773,14 +4921,18 @@ __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __we
|
|
|
4773
4921
|
/* harmony export */ });
|
|
4774
4922
|
/* harmony import */ var _components_sections_Alert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6893);
|
|
4775
4923
|
/* harmony import */ var _components_sections_BannerText__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9315);
|
|
4776
|
-
/* harmony import */ var
|
|
4777
|
-
/* harmony import */ var
|
|
4778
|
-
/* harmony import */ var
|
|
4779
|
-
/* harmony import */ var
|
|
4780
|
-
/* harmony import */ var
|
|
4781
|
-
/* harmony import */ var
|
|
4782
|
-
var
|
|
4783
|
-
|
|
4924
|
+
/* harmony import */ var _components_sections_Hero__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2849);
|
|
4925
|
+
/* harmony import */ var _components_sections_ProductShelf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8569);
|
|
4926
|
+
/* harmony import */ var _components_sections_CrossSellingShelf__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(994);
|
|
4927
|
+
/* harmony import */ var _components_sections_Alert_DefaultComponents__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(6948);
|
|
4928
|
+
/* harmony import */ var _components_sections_BannerText_DefaultComponents__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(719);
|
|
4929
|
+
/* harmony import */ var src_components_sections_CrossSellingShelf_DefaultComponents__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(8435);
|
|
4930
|
+
/* harmony import */ var _components_sections_Hero_DefaultComponents__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(9569);
|
|
4931
|
+
/* harmony import */ var _components_sections_ProductShelf_DefaultComponents__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(2432);
|
|
4932
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_components_sections_CrossSellingShelf__WEBPACK_IMPORTED_MODULE_2__, _components_sections_ProductShelf__WEBPACK_IMPORTED_MODULE_4__]);
|
|
4933
|
+
([_components_sections_CrossSellingShelf__WEBPACK_IMPORTED_MODULE_2__, _components_sections_ProductShelf__WEBPACK_IMPORTED_MODULE_4__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
|
4934
|
+
|
|
4935
|
+
|
|
4784
4936
|
|
|
4785
4937
|
|
|
4786
4938
|
|
|
@@ -4792,14 +4944,16 @@ _components_sections_ProductShelf__WEBPACK_IMPORTED_MODULE_3__ = (__webpack_asyn
|
|
|
4792
4944
|
const Sections = {
|
|
4793
4945
|
Alert: _components_sections_Alert__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z,
|
|
4794
4946
|
BannerText: _components_sections_BannerText__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z,
|
|
4795
|
-
|
|
4796
|
-
|
|
4947
|
+
CrossSellingShelf: _components_sections_CrossSellingShelf__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z,
|
|
4948
|
+
Hero: _components_sections_Hero__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z,
|
|
4949
|
+
ProductShelf: _components_sections_ProductShelf__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z
|
|
4797
4950
|
};
|
|
4798
4951
|
const DefaultComponents = {
|
|
4799
|
-
Alert:
|
|
4800
|
-
BannerText:
|
|
4801
|
-
Hero:
|
|
4802
|
-
ProductShelf:
|
|
4952
|
+
Alert: _components_sections_Alert_DefaultComponents__WEBPACK_IMPORTED_MODULE_5__/* .AlertDefaultComponents */ .p,
|
|
4953
|
+
BannerText: _components_sections_BannerText_DefaultComponents__WEBPACK_IMPORTED_MODULE_6__/* .BannerTextDefaultComponents */ .b,
|
|
4954
|
+
Hero: _components_sections_Hero_DefaultComponents__WEBPACK_IMPORTED_MODULE_7__/* .HeroDefaultComponents */ .O,
|
|
4955
|
+
ProductShelf: _components_sections_ProductShelf_DefaultComponents__WEBPACK_IMPORTED_MODULE_8__/* .ProductShelfDefaultComponents */ .B,
|
|
4956
|
+
CrossSellingShelf: src_components_sections_CrossSellingShelf_DefaultComponents__WEBPACK_IMPORTED_MODULE_9__/* .CrossSellingShelfDefaultComponents */ .q
|
|
4803
4957
|
};
|
|
4804
4958
|
__webpack_async_result__();
|
|
4805
4959
|
} catch(e) { __webpack_async_result__(e); } });
|