@faststore/core 2.0.97-alpha.0 → 2.0.99-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/.storybook/components/SectionItem.tsx +1 -3
  2. package/.turbo/turbo-build.log +16 -16
  3. package/CHANGELOG.md +12 -0
  4. package/package.json +5 -5
  5. package/public/icons.svg +60 -56
  6. package/src/Layout.tsx +1 -2
  7. package/src/components/cart/CartSidebar/CartSidebar.tsx +6 -8
  8. package/src/components/cart/CartToggle/CartToggle.tsx +5 -2
  9. package/src/components/cart/EmptyCart/EmptyCart.tsx +1 -2
  10. package/src/components/common/Alert/Alert.tsx +1 -2
  11. package/src/components/common/Footer/Footer.tsx +3 -3
  12. package/src/components/common/Footer/FooterFlags.tsx +21 -18
  13. package/src/components/common/Navbar/Navbar.tsx +2 -4
  14. package/src/components/product/OutOfStock/OutOfStock.tsx +2 -3
  15. package/src/components/region/RegionButton/RegionButton.tsx +1 -2
  16. package/src/components/region/RegionModal/RegionalizationModalContent.tsx +1 -1
  17. package/src/components/search/SearchInput/SearchInput.tsx +17 -17
  18. package/src/components/sections/Incentives/Incentives.tsx +1 -3
  19. package/src/components/sections/Newsletter/Newsletter.tsx +1 -2
  20. package/src/components/sections/ProducDetailsContent/ProductDetailsContent.tsx +24 -18
  21. package/src/components/sections/ProductGallery/EmptyGallery.tsx +1 -2
  22. package/src/components/sections/ProductGallery/ProductGallery.tsx +4 -5
  23. package/src/components/sections/ScrollToTopButton/ScrollToTopButton.tsx +1 -3
  24. package/src/components/ui/Breadcrumb/Breadcrumb.tsx +1 -2
  25. package/src/components/ui/Button/ButtonSignIn/ButtonSignIn.tsx +1 -2
  26. package/src/components/ui/Button/ButtonSignIn/ButtonSignInFallback/ButtonSignInFallback.tsx +1 -3
  27. package/src/components/ui/Carousel/Carousel.tsx +2 -4
  28. package/src/components/ui/Gift/Gift.tsx +6 -3
  29. package/src/components/ui/ImageGallery/ImageGallerySelector.tsx +5 -2
  30. package/src/pages/[...slug].tsx +1 -1
  31. package/.next/BUILD_ID +0 -1
  32. package/.next/build-manifest.json +0 -101
  33. package/.next/cache/.tsbuildinfo +0 -1
  34. package/.next/cache/config.json +0 -7
  35. package/.next/cache/eslint/.cache_1gneedd +0 -1
  36. package/.next/cache/next-server.js.nft.json +0 -1
  37. package/.next/cache/webpack/client-production/0.pack +0 -0
  38. package/.next/cache/webpack/client-production/index.pack +0 -0
  39. package/.next/cache/webpack/server-production/0.pack +0 -0
  40. package/.next/cache/webpack/server-production/index.pack +0 -0
  41. package/.next/export-marker.json +0 -1
  42. package/.next/images-manifest.json +0 -1
  43. package/.next/next-server.js.nft.json +0 -1
  44. package/.next/package.json +0 -1
  45. package/.next/prerender-manifest.json +0 -1
  46. package/.next/react-loadable-manifest.json +0 -44
  47. package/.next/required-server-files.json +0 -1
  48. package/.next/routes-manifest.json +0 -1
  49. package/.next/server/chunks/104.js +0 -196
  50. package/.next/server/chunks/143.js +0 -106
  51. package/.next/server/chunks/152.js +0 -216
  52. package/.next/server/chunks/154.js +0 -206
  53. package/.next/server/chunks/183.js +0 -72
  54. package/.next/server/chunks/247.js +0 -61
  55. package/.next/server/chunks/264.js +0 -67
  56. package/.next/server/chunks/280.js +0 -417
  57. package/.next/server/chunks/287.js +0 -79
  58. package/.next/server/chunks/312.js +0 -684
  59. package/.next/server/chunks/317.js +0 -125
  60. package/.next/server/chunks/350.js +0 -120
  61. package/.next/server/chunks/371.js +0 -1484
  62. package/.next/server/chunks/377.js +0 -82
  63. package/.next/server/chunks/394.js +0 -3801
  64. package/.next/server/chunks/439.js +0 -175
  65. package/.next/server/chunks/444.js +0 -464
  66. package/.next/server/chunks/465.js +0 -91
  67. package/.next/server/chunks/576.js +0 -72
  68. package/.next/server/chunks/608.js +0 -515
  69. package/.next/server/chunks/664.js +0 -124
  70. package/.next/server/chunks/676.js +0 -32
  71. package/.next/server/chunks/746.js +0 -237
  72. package/.next/server/chunks/777.js +0 -708
  73. package/.next/server/chunks/854.js +0 -72
  74. package/.next/server/chunks/859.js +0 -959
  75. package/.next/server/chunks/872.js +0 -378
  76. package/.next/server/chunks/881.js +0 -320
  77. package/.next/server/chunks/898.js +0 -240
  78. package/.next/server/chunks/914.js +0 -96
  79. package/.next/server/chunks/953.js +0 -674
  80. package/.next/server/chunks/98.js +0 -266
  81. package/.next/server/chunks/992.js +0 -570
  82. package/.next/server/chunks/font-manifest.json +0 -1
  83. package/.next/server/font-manifest.json +0 -1
  84. package/.next/server/middleware-build-manifest.js +0 -1
  85. package/.next/server/middleware-manifest.json +0 -6
  86. package/.next/server/middleware-react-loadable-manifest.js +0 -1
  87. package/.next/server/pages/404.js.nft.json +0 -1
  88. package/.next/server/pages/500.js.nft.json +0 -1
  89. package/.next/server/pages/[...slug].js +0 -633
  90. package/.next/server/pages/[...slug].js.nft.json +0 -1
  91. package/.next/server/pages/[slug]/p.js +0 -2390
  92. package/.next/server/pages/[slug]/p.js.nft.json +0 -1
  93. package/.next/server/pages/_app.js +0 -2467
  94. package/.next/server/pages/_app.js.nft.json +0 -1
  95. package/.next/server/pages/_document.js +0 -304
  96. package/.next/server/pages/_document.js.nft.json +0 -1
  97. package/.next/server/pages/_error.js +0 -164
  98. package/.next/server/pages/_error.js.nft.json +0 -1
  99. package/.next/server/pages/account.js.nft.json +0 -1
  100. package/.next/server/pages/api/graphql.js +0 -259
  101. package/.next/server/pages/api/graphql.js.nft.json +0 -1
  102. package/.next/server/pages/api/preview.js +0 -118
  103. package/.next/server/pages/api/preview.js.nft.json +0 -1
  104. package/.next/server/pages/checkout.js.nft.json +0 -1
  105. package/.next/server/pages/en-US/404.html +0 -81
  106. package/.next/server/pages/en-US/500.html +0 -81
  107. package/.next/server/pages/en-US/account.html +0 -81
  108. package/.next/server/pages/en-US/checkout.html +0 -81
  109. package/.next/server/pages/en-US/login.html +0 -81
  110. package/.next/server/pages/en-US/s.html +0 -81
  111. package/.next/server/pages/en-US.html +0 -81
  112. package/.next/server/pages/en-US.json +0 -1
  113. package/.next/server/pages/index.js +0 -428
  114. package/.next/server/pages/index.js.nft.json +0 -1
  115. package/.next/server/pages/login.js.nft.json +0 -1
  116. package/.next/server/pages/s.js.nft.json +0 -1
  117. package/.next/server/pages-manifest.json +0 -16
  118. package/.next/server/webpack-api-runtime.js +0 -229
  119. package/.next/server/webpack-runtime.js +0 -229
  120. package/.next/static/chunks/143.dd8a556e6957baa1.js +0 -1
  121. package/.next/static/chunks/152.d44c4f8d83e68e26.js +0 -1
  122. package/.next/static/chunks/251-5059c71d8e624b60.js +0 -1
  123. package/.next/static/chunks/291.1b3f1a62d6e853d1.js +0 -1
  124. package/.next/static/chunks/351-a4e28d64f48c5269.js +0 -1
  125. package/.next/static/chunks/608.59e69b83f35d9c44.js +0 -1
  126. package/.next/static/chunks/626-d631f2cb747ef569.js +0 -1
  127. package/.next/static/chunks/651.7142f31ce1e052b3.js +0 -1
  128. package/.next/static/chunks/686.41582b9e75eaba89.js +0 -1
  129. package/.next/static/chunks/741.52f7fb873418346f.js +0 -1
  130. package/.next/static/chunks/781-7df372b5b56e3f96.js +0 -1
  131. package/.next/static/chunks/843.f55ad79a8fd4f87c.js +0 -1
  132. package/.next/static/chunks/98.97381d2021f86cd9.js +0 -1
  133. package/.next/static/chunks/framework-dfd14d7ce6600b03.js +0 -1
  134. package/.next/static/chunks/main-9746772201fe3ac1.js +0 -1
  135. package/.next/static/chunks/pages/404-ba608a2a9f0c420a.js +0 -1
  136. package/.next/static/chunks/pages/500-910883c20541d9ce.js +0 -1
  137. package/.next/static/chunks/pages/[...slug]-4b2bea89ec5c8fbe.js +0 -1
  138. package/.next/static/chunks/pages/[slug]/p-912fe4b532f4fdce.js +0 -1
  139. package/.next/static/chunks/pages/_app-c30dfc55a86c1363.js +0 -1
  140. package/.next/static/chunks/pages/_error-a7a0c1d9bfbb4f38.js +0 -1
  141. package/.next/static/chunks/pages/account-b8fc5222ffe89b60.js +0 -1
  142. package/.next/static/chunks/pages/checkout-f8cb7cb22225ef9d.js +0 -1
  143. package/.next/static/chunks/pages/index-eabe9d42a172b52b.js +0 -1
  144. package/.next/static/chunks/pages/login-33954810b200eca8.js +0 -1
  145. package/.next/static/chunks/pages/s-b49bdf6af37376b6.js +0 -1
  146. package/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js +0 -1
  147. package/.next/static/chunks/webpack-f1a1b4bcfa6b66bb.js +0 -1
  148. package/.next/static/css/10db3bc7ecdf0556.css +0 -1
  149. package/.next/static/css/43d61b402f41569b.css +0 -1
  150. package/.next/static/css/4899c3cc356704f9.css +0 -1
  151. package/.next/static/css/5f1958d8dece68c7.css +0 -1
  152. package/.next/static/css/6507cb48401e73a4.css +0 -1
  153. package/.next/static/css/8ea129ea90e49e98.css +0 -1
  154. package/.next/static/css/b2f16bd4b93e0aca.css +0 -1
  155. package/.next/static/css/db63ea05e98cb7e8.css +0 -1
  156. package/.next/static/m9qPYxeN9bMid06fpEhbE/_buildManifest.js +0 -1
  157. package/.next/static/m9qPYxeN9bMid06fpEhbE/_ssgManifest.js +0 -1
  158. package/.next/static/media/brandless-neutral.76ddf63a.png +0 -0
  159. package/.next/trace +0 -64
  160. package/public/~partytown/debug/partytown-atomics.js +0 -556
  161. package/public/~partytown/debug/partytown-media.js +0 -374
  162. package/public/~partytown/debug/partytown-sandbox-sw.js +0 -543
  163. package/public/~partytown/debug/partytown-sw.js +0 -59
  164. package/public/~partytown/debug/partytown-ww-atomics.js +0 -1789
  165. package/public/~partytown/debug/partytown-ww-sw.js +0 -1781
  166. package/public/~partytown/debug/partytown.js +0 -72
  167. package/public/~partytown/partytown-atomics.js +0 -2
  168. package/public/~partytown/partytown-media.js +0 -2
  169. package/public/~partytown/partytown-sw.js +0 -2
  170. package/public/~partytown/partytown.js +0 -2
  171. package/src/components/ui/Icon/Icon.tsx +0 -35
  172. package/src/components/ui/Icon/index.ts +0 -1
@@ -1,124 +0,0 @@
1
- "use strict";
2
- exports.id = 664;
3
- exports.ids = [664,143];
4
- exports.modules = {
5
-
6
- /***/ 3664:
7
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8
-
9
- __webpack_require__.r(__webpack_exports__);
10
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11
- /* harmony export */ "default": () => (/* binding */ sendEvent)
12
- /* harmony export */ });
13
- /* harmony import */ var _search__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9143);
14
-
15
- function sendEvent(event) {
16
- // VTEX RC
17
- window?.sendrc?.(event.name, event.params); // VTEX Intelligent Search
18
-
19
- (0,_search__WEBPACK_IMPORTED_MODULE_0__["default"])(event);
20
- }
21
-
22
- /***/ }),
23
-
24
- /***/ 9143:
25
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
26
-
27
- __webpack_require__.r(__webpack_exports__);
28
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
29
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
30
- /* harmony export */ });
31
- /* harmony import */ var _faststore_config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7183);
32
- /* harmony import */ var _faststore_config__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_faststore_config__WEBPACK_IMPORTED_MODULE_0__);
33
- 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; }
34
-
35
- 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; }
36
-
37
- 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; }
38
-
39
- /**
40
- * More info at: https://www.notion.so/vtexhandbook/Event-API-Documentation-48eee26730cf4d7f80f8fd7262231f84
41
- */
42
-
43
- const THIRTY_MINUTES_S = 30 * 60;
44
- const ONE_YEAR_S = 365 * 24 * 3600;
45
-
46
- const randomUUID = () => typeof crypto.randomUUID === 'function' ? crypto.randomUUID() : (Math.random() * 1e6).toFixed(0);
47
-
48
- const createStorage = (key, expiresSecond) => {
49
- const timelapsed = past => (Date.now() - past) / 1e3;
50
-
51
- return () => {
52
- const item = JSON.parse(localStorage.getItem(key) ?? 'null');
53
- const isExpired = !item || timelapsed(item.createdAt) > expiresSecond;
54
- const payload = isExpired ? randomUUID() : item.payload;
55
-
56
- if (isExpired) {
57
- const data = {
58
- payload,
59
- createdAt: Date.now()
60
- };
61
- localStorage.setItem(key, JSON.stringify(data));
62
- }
63
-
64
- return payload;
65
- };
66
- };
67
-
68
- const user = {
69
- anonymous: createStorage('vtex.search.anonymous', ONE_YEAR_S),
70
- session: createStorage('vtex.search.session', THIRTY_MINUTES_S)
71
- };
72
-
73
- const sendEvent = options => fetch(`https://sp.vtex.com/event-api/v1/${(_faststore_config__WEBPACK_IMPORTED_MODULE_0___default().api.storeId)}/event`, {
74
- method: 'POST',
75
- body: JSON.stringify(_objectSpread(_objectSpread({}, options), {}, {
76
- userAgent: navigator.userAgent,
77
- anonymous: user.anonymous(),
78
- session: user.session()
79
- })),
80
- headers: {
81
- 'content-type': 'application/json'
82
- }
83
- });
84
-
85
- const isFullTextSearch = url => typeof url.searchParams.get('q') === 'string' && /^\/s(\/)?$/g.test(url.pathname);
86
-
87
- const handleEvent = event => {
88
- if (event.name !== 'search_select_item') {
89
- return;
90
- }
91
-
92
- const url = new URL(event.params.url);
93
-
94
- if (!isFullTextSearch(url)) {
95
- return;
96
- }
97
-
98
- for (const item of event.params.items ?? []) {
99
- const productId = item.item_id ?? item.item_variant;
100
- const position = item.index;
101
-
102
- if (productId && position) {
103
- sendEvent({
104
- type: 'search.click',
105
- productId,
106
- position,
107
- url: url.href,
108
- text: url.searchParams.get('q') ?? '<empty>'
109
- });
110
- }
111
- }
112
- };
113
-
114
- setInterval(() => sendEvent({
115
- type: 'session.ping'
116
- }), 60 * 1e3
117
- /* One minute */
118
- );
119
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (handleEvent);
120
-
121
- /***/ })
122
-
123
- };
124
- ;
@@ -1,32 +0,0 @@
1
- "use strict";
2
- exports.id = 676;
3
- exports.ids = [676];
4
- exports.modules = {
5
-
6
- /***/ 676:
7
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8
-
9
-
10
- Object.defineProperty(exports, "__esModule", ({
11
- value: true
12
- }));
13
- exports["default"] = isError;
14
- exports.getProperError = getProperError;
15
- var _isPlainObject = __webpack_require__(8524);
16
- function isError(err) {
17
- return typeof err === "object" && err !== null && "name" in err && "message" in err;
18
- }
19
- function getProperError(err) {
20
- if (isError(err)) {
21
- return err;
22
- }
23
- if (false) {}
24
- return new Error((0, _isPlainObject).isPlainObject(err) ? JSON.stringify(err) : err + "");
25
- }
26
-
27
- //# sourceMappingURL=is-error.js.map
28
-
29
- /***/ })
30
-
31
- };
32
- ;
@@ -1,237 +0,0 @@
1
- "use strict";
2
- exports.id = 746;
3
- exports.ids = [746];
4
- exports.modules = {
5
-
6
- /***/ 4875:
7
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8
-
9
-
10
- // EXPORTS
11
- __webpack_require__.d(__webpack_exports__, {
12
- "Z": () => (/* reexport */ ProductGrid_ProductGrid)
13
- });
14
-
15
- // EXTERNAL MODULE: ./src/components/skeletons/ProductGridSkeleton/index.ts + 1 modules
16
- var ProductGridSkeleton = __webpack_require__(9913);
17
- // EXTERNAL MODULE: ./src/components/product/ProductGrid/product-grid.module.scss
18
- var product_grid_module = __webpack_require__(4920);
19
- var product_grid_module_default = /*#__PURE__*/__webpack_require__.n(product_grid_module);
20
- // EXTERNAL MODULE: ./src/components/product/ProductCard/index.ts + 4 modules
21
- var ProductCard = __webpack_require__(6475);
22
- // EXTERNAL MODULE: external "react/jsx-runtime"
23
- var jsx_runtime_ = __webpack_require__(997);
24
- ;// CONCATENATED MODULE: ./src/components/product/ProductGrid/ProductGrid.tsx
25
-
26
-
27
-
28
-
29
-
30
- function ProductGrid({
31
- products,
32
- page,
33
- pageSize
34
- }) {
35
- const aspectRatio = 1;
36
- return /*#__PURE__*/jsx_runtime_.jsx(ProductGridSkeleton/* default */.Z, {
37
- aspectRatio: aspectRatio,
38
- loading: products.length === 0,
39
- children: /*#__PURE__*/jsx_runtime_.jsx("ul", {
40
- "data-fs-product-grid": true,
41
- className: (product_grid_module_default()).fsProductGrid,
42
- children: products.map(({
43
- node: product
44
- }, idx) => /*#__PURE__*/jsx_runtime_.jsx("li", {
45
- children: /*#__PURE__*/jsx_runtime_.jsx(ProductCard/* default */.Z, {
46
- product: product,
47
- index: pageSize * page + idx + 1,
48
- bordered: true,
49
- aspectRatio: aspectRatio
50
- })
51
- }, `${product.id}`))
52
- })
53
- });
54
- }
55
-
56
- /* harmony default export */ const ProductGrid_ProductGrid = (ProductGrid);
57
- ;// CONCATENATED MODULE: ./src/components/product/ProductGrid/index.ts
58
-
59
-
60
- /***/ }),
61
-
62
- /***/ 3746:
63
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
64
-
65
- __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
66
- __webpack_require__.r(__webpack_exports__);
67
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
68
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
69
- /* harmony export */ });
70
- /* harmony import */ var _faststore_sdk__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7794);
71
- /* harmony import */ var src_components_product_ProductGrid__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4875);
72
- /* harmony import */ var src_sdk_search_Sentinel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(713);
73
- /* harmony import */ var _ProductTiles__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8872);
74
- /* harmony import */ var _usePageProducts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(763);
75
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(997);
76
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
77
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_ProductTiles__WEBPACK_IMPORTED_MODULE_2__, _usePageProducts__WEBPACK_IMPORTED_MODULE_3__]);
78
- ([_ProductTiles__WEBPACK_IMPORTED_MODULE_2__, _usePageProducts__WEBPACK_IMPORTED_MODULE_3__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
79
-
80
-
81
-
82
-
83
-
84
- /* If showSponsoredProducts is true, a ProductTiles will be displayed in between two blocks of ProductGrid on the page 0 */
85
-
86
-
87
-
88
-
89
-
90
- function GalleryPage({
91
- page,
92
- title,
93
- showSponsoredProducts = true
94
- }) {
95
- const products = (0,_usePageProducts__WEBPACK_IMPORTED_MODULE_3__/* .useProducts */ .r)(page) ?? [];
96
- const {
97
- itemsPerPage
98
- } = (0,_faststore_sdk__WEBPACK_IMPORTED_MODULE_5__/* .useSearch */ .R)();
99
- const productsSponsored = showSponsoredProducts ? products.slice(0, 2) : undefined;
100
- const middleItemIndex = Math.ceil(itemsPerPage / 2);
101
- const shouldDisplaySponsoredProducts = page === 0 && productsSponsored && productsSponsored.length > 1;
102
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment, {
103
- children: [/*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx(src_sdk_search_Sentinel__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
104
- products: products,
105
- page: page,
106
- pageSize: itemsPerPage,
107
- title: title
108
- }), shouldDisplaySponsoredProducts ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment, {
109
- children: [/*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx(src_components_product_ProductGrid__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z, {
110
- products: products.slice(0, middleItemIndex),
111
- page: page,
112
- pageSize: middleItemIndex
113
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
114
- "data-fs-product-listing-sponsored": true,
115
- children: [/*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx("h3", {
116
- children: "Sponsored"
117
- }), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx(_ProductTiles__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
118
- selectedFacets: [{
119
- key: 'productClusterIds',
120
- value: '141'
121
- }],
122
- title: ""
123
- })]
124
- }), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx(src_components_product_ProductGrid__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z, {
125
- products: products.slice(middleItemIndex, itemsPerPage),
126
- page: page,
127
- pageSize: middleItemIndex
128
- })]
129
- }) : /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx(src_components_product_ProductGrid__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z, {
130
- products: products,
131
- page: page,
132
- pageSize: itemsPerPage
133
- })]
134
- });
135
- }
136
-
137
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (GalleryPage);
138
- __webpack_async_result__();
139
- } catch(e) { __webpack_async_result__(e); } });
140
-
141
- /***/ }),
142
-
143
- /***/ 713:
144
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
145
-
146
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
147
- /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
148
- /* harmony export */ });
149
- /* harmony import */ var _faststore_sdk__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7794);
150
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
151
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
152
- /* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9785);
153
- /* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intersection_observer__WEBPACK_IMPORTED_MODULE_1__);
154
- /* harmony import */ var next_router__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1853);
155
- /* harmony import */ var next_router__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_router__WEBPACK_IMPORTED_MODULE_2__);
156
- /* harmony import */ var _analytics_hooks_useViewItemListEvent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5184);
157
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(997);
158
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
159
-
160
-
161
-
162
-
163
-
164
-
165
-
166
- // Adds/Replaces ?page= to the querystring of the page
167
- const replacePagination = (page, router) => {
168
- const url = new URL(window.location.href); // In case the page argument already matches the target page
169
-
170
- if (url.searchParams.get('page') === page) {
171
- return;
172
- } // Set ?page= parameter and replace route
173
-
174
-
175
- url.searchParams.set('page', page);
176
- router.replace(url, undefined, {
177
- shallow: true,
178
- scroll: false
179
- });
180
- };
181
- /**
182
- * Use this component to add a boundary between pages so we can
183
- * change the current page being viewed on infinite pagination.
184
- *
185
- * For more info: https://developers.google.com/search/blog/2014/02/infinite-scroll-search-friendly
186
- *
187
- * Also, this component's name is kind of curious. Wikipedia calls is Page Break(https://en.wikipedia.org/wiki/Page_break)
188
- * however all codes I've seen online use Sentinel
189
- */
190
-
191
-
192
- function Sentinel({
193
- page,
194
- pageSize,
195
- products,
196
- title
197
- }) {
198
- const viewedRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false);
199
- const {
200
- ref,
201
- inView
202
- } = (0,react_intersection_observer__WEBPACK_IMPORTED_MODULE_1__.useInView)();
203
- const {
204
- pages
205
- } = (0,_faststore_sdk__WEBPACK_IMPORTED_MODULE_5__/* .useSearch */ .R)();
206
- const router = (0,next_router__WEBPACK_IMPORTED_MODULE_2__.useRouter)();
207
- const {
208
- sendViewItemListEvent
209
- } = (0,_analytics_hooks_useViewItemListEvent__WEBPACK_IMPORTED_MODULE_3__/* .useViewItemListEvent */ .m)({
210
- products,
211
- title,
212
- page,
213
- pageSize
214
- });
215
- (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
216
- // Only replace pagination state when infinite scroll
217
- // state has more than one page being rendered to the screen
218
- if (inView && pages.length > 1) {
219
- replacePagination(page.toString(), router);
220
- }
221
-
222
- if (inView && !viewedRef.current && products.length) {
223
- sendViewItemListEvent();
224
- viewedRef.current = true;
225
- }
226
- }, [pages.length, inView, page, router, sendViewItemListEvent, products.length]);
227
- return /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx("div", {
228
- ref: ref
229
- });
230
- }
231
-
232
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Sentinel);
233
-
234
- /***/ })
235
-
236
- };
237
- ;