@faststore/core 2.2.26 → 2.2.31

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 (156) hide show
  1. package/.turbo/turbo-build.log +1 -2
  2. package/.turbo/turbo-test.log +6 -6
  3. package/package.json +9 -9
  4. package/.next/BUILD_ID +0 -1
  5. package/.next/build-manifest.json +0 -126
  6. package/.next/cache/.tsbuildinfo +0 -1
  7. package/.next/cache/config.json +0 -7
  8. package/.next/cache/eslint/.cache_1gneedd +0 -1
  9. package/.next/cache/next-server.js.nft.json +0 -1
  10. package/.next/cache/webpack/client-production/0.pack +0 -0
  11. package/.next/cache/webpack/client-production/index.pack +0 -0
  12. package/.next/cache/webpack/server-production/0.pack +0 -0
  13. package/.next/cache/webpack/server-production/index.pack +0 -0
  14. package/.next/export-marker.json +0 -1
  15. package/.next/images-manifest.json +0 -1
  16. package/.next/next-server.js.nft.json +0 -1
  17. package/.next/package.json +0 -1
  18. package/.next/prerender-manifest.json +0 -1
  19. package/.next/react-loadable-manifest.json +0 -47
  20. package/.next/required-server-files.json +0 -1
  21. package/.next/routes-manifest.json +0 -1
  22. package/.next/server/chunks/117.js +0 -430
  23. package/.next/server/chunks/177.js +0 -120
  24. package/.next/server/chunks/183.js +0 -121
  25. package/.next/server/chunks/184.js +0 -61
  26. package/.next/server/chunks/289.js +0 -240
  27. package/.next/server/chunks/312.js +0 -678
  28. package/.next/server/chunks/350.js +0 -200
  29. package/.next/server/chunks/386.js +0 -200
  30. package/.next/server/chunks/390.js +0 -550
  31. package/.next/server/chunks/398.js +0 -610
  32. package/.next/server/chunks/52.js +0 -4007
  33. package/.next/server/chunks/53.js +0 -61
  34. package/.next/server/chunks/574.js +0 -145
  35. package/.next/server/chunks/576.js +0 -121
  36. package/.next/server/chunks/585.js +0 -640
  37. package/.next/server/chunks/676.js +0 -32
  38. package/.next/server/chunks/693.js +0 -58
  39. package/.next/server/chunks/732.js +0 -1880
  40. package/.next/server/chunks/74.js +0 -4066
  41. package/.next/server/chunks/779.js +0 -58
  42. package/.next/server/chunks/817.js +0 -4007
  43. package/.next/server/chunks/825.js +0 -4074
  44. package/.next/server/chunks/854.js +0 -72
  45. package/.next/server/chunks/859.js +0 -959
  46. package/.next/server/chunks/863.js +0 -111
  47. package/.next/server/chunks/979.js +0 -1303
  48. package/.next/server/chunks/98.js +0 -163
  49. package/.next/server/chunks/988.js +0 -211
  50. package/.next/server/chunks/font-manifest.json +0 -1
  51. package/.next/server/font-manifest.json +0 -1
  52. package/.next/server/middleware-build-manifest.js +0 -1
  53. package/.next/server/middleware-manifest.json +0 -6
  54. package/.next/server/middleware-react-loadable-manifest.js +0 -1
  55. package/.next/server/pages/404.js +0 -391
  56. package/.next/server/pages/404.js.nft.json +0 -1
  57. package/.next/server/pages/500.js +0 -395
  58. package/.next/server/pages/500.js.nft.json +0 -1
  59. package/.next/server/pages/[...slug].js +0 -1084
  60. package/.next/server/pages/[...slug].js.nft.json +0 -1
  61. package/.next/server/pages/[slug]/p.js +0 -2271
  62. package/.next/server/pages/[slug]/p.js.nft.json +0 -1
  63. package/.next/server/pages/_app.js +0 -287
  64. package/.next/server/pages/_app.js.nft.json +0 -1
  65. package/.next/server/pages/_document.js +0 -365
  66. package/.next/server/pages/_document.js.nft.json +0 -1
  67. package/.next/server/pages/_error.js +0 -164
  68. package/.next/server/pages/_error.js.nft.json +0 -1
  69. package/.next/server/pages/account.js +0 -370
  70. package/.next/server/pages/account.js.nft.json +0 -1
  71. package/.next/server/pages/api/graphql.js +0 -464
  72. package/.next/server/pages/api/graphql.js.nft.json +0 -1
  73. package/.next/server/pages/api/health/live.js +0 -31
  74. package/.next/server/pages/api/health/live.js.nft.json +0 -1
  75. package/.next/server/pages/api/health/ready.js +0 -31
  76. package/.next/server/pages/api/health/ready.js.nft.json +0 -1
  77. package/.next/server/pages/api/preview.js +0 -137
  78. package/.next/server/pages/api/preview.js.nft.json +0 -1
  79. package/.next/server/pages/checkout.js +0 -370
  80. package/.next/server/pages/checkout.js.nft.json +0 -1
  81. package/.next/server/pages/en-US/404.html +0 -81
  82. package/.next/server/pages/en-US/404.json +0 -1
  83. package/.next/server/pages/en-US/500.html +0 -81
  84. package/.next/server/pages/en-US/500.json +0 -1
  85. package/.next/server/pages/en-US/account.html +0 -81
  86. package/.next/server/pages/en-US/account.json +0 -1
  87. package/.next/server/pages/en-US/checkout.html +0 -81
  88. package/.next/server/pages/en-US/checkout.json +0 -1
  89. package/.next/server/pages/en-US/login.html +0 -81
  90. package/.next/server/pages/en-US/login.json +0 -1
  91. package/.next/server/pages/en-US/s.html +0 -81
  92. package/.next/server/pages/en-US/s.json +0 -1
  93. package/.next/server/pages/en-US.html +0 -90
  94. package/.next/server/pages/en-US.json +0 -1
  95. package/.next/server/pages/index.js +0 -439
  96. package/.next/server/pages/index.js.nft.json +0 -1
  97. package/.next/server/pages/login.js +0 -382
  98. package/.next/server/pages/login.js.nft.json +0 -1
  99. package/.next/server/pages/s.js +0 -554
  100. package/.next/server/pages/s.js.nft.json +0 -1
  101. package/.next/server/pages-manifest.json +0 -18
  102. package/.next/server/webpack-api-runtime.js +0 -229
  103. package/.next/server/webpack-runtime.js +0 -229
  104. package/.next/static/chunks/251.1c79f06f2a2814b1.js +0 -1
  105. package/.next/static/chunks/386.d01e0db26c523f0f.js +0 -1
  106. package/.next/static/chunks/400-a09ccc622ec96daa.js +0 -1
  107. package/.next/static/chunks/469-7259b855711d4ad3.js +0 -1
  108. package/.next/static/chunks/574.70612be06fd1365f.js +0 -1
  109. package/.next/static/chunks/585.4c5d40fc6a72a611.js +0 -1
  110. package/.next/static/chunks/651.7142f31ce1e052b3.js +0 -1
  111. package/.next/static/chunks/741.52f7fb873418346f.js +0 -1
  112. package/.next/static/chunks/742-e32d18d91fe6f08b.js +0 -1
  113. package/.next/static/chunks/783-a67df4e98c1ac27b.js +0 -1
  114. package/.next/static/chunks/800.ee4f8b9622001e8c.js +0 -1
  115. package/.next/static/chunks/98.40c7e17d9de4eb8f.js +0 -1
  116. package/.next/static/chunks/988.afda042dd9ba11d1.js +0 -1
  117. package/.next/static/chunks/framework-dfd14d7ce6600b03.js +0 -1
  118. package/.next/static/chunks/main-e4e873ee741162eb.js +0 -1
  119. package/.next/static/chunks/pages/404-6763ce07878a1456.js +0 -1
  120. package/.next/static/chunks/pages/500-0f4374f30595d27c.js +0 -1
  121. package/.next/static/chunks/pages/[...slug]-111f89162eff5029.js +0 -1
  122. package/.next/static/chunks/pages/[slug]/p-46e7cb105136dc7a.js +0 -1
  123. package/.next/static/chunks/pages/_app-48d56037a2534a44.js +0 -1
  124. package/.next/static/chunks/pages/_error-a7a0c1d9bfbb4f38.js +0 -1
  125. package/.next/static/chunks/pages/account-9eb6fab139286c66.js +0 -1
  126. package/.next/static/chunks/pages/checkout-7cd7b110c7cf2f10.js +0 -1
  127. package/.next/static/chunks/pages/index-3d5c756be5ce8fc7.js +0 -1
  128. package/.next/static/chunks/pages/login-5fd09e6402f47896.js +0 -1
  129. package/.next/static/chunks/pages/s-8e32a9b170819fa9.js +0 -1
  130. package/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js +0 -1
  131. package/.next/static/chunks/webpack-4ccaf6613cbd7224.js +0 -1
  132. package/.next/static/css/29868543c76bc6fd.css +0 -1
  133. package/.next/static/css/527e334fa69cf40a.css +0 -1
  134. package/.next/static/css/5d1f64b61ea581f4.css +0 -1
  135. package/.next/static/css/6a7fdc5a21fbead5.css +0 -1
  136. package/.next/static/css/723835bce380750d.css +0 -1
  137. package/.next/static/css/a2eefb25a4608343.css +0 -1
  138. package/.next/static/css/cb7d1fcea42fab9c.css +0 -1
  139. package/.next/static/css/d7bbfbd552f407e9.css +0 -1
  140. package/.next/static/css/df588bb98c0b0ca6.css +0 -1
  141. package/.next/static/css/dfbdb0f27fd64782.css +0 -1
  142. package/.next/static/css/e84fc497732ea596.css +0 -1
  143. package/.next/static/oRKHdgCYWF-pLgZNA_XsI/_buildManifest.js +0 -1
  144. package/.next/static/oRKHdgCYWF-pLgZNA_XsI/_ssgManifest.js +0 -1
  145. package/.next/trace +0 -78
  146. package/public/~partytown/debug/partytown-atomics.js +0 -556
  147. package/public/~partytown/debug/partytown-media.js +0 -374
  148. package/public/~partytown/debug/partytown-sandbox-sw.js +0 -543
  149. package/public/~partytown/debug/partytown-sw.js +0 -59
  150. package/public/~partytown/debug/partytown-ww-atomics.js +0 -1789
  151. package/public/~partytown/debug/partytown-ww-sw.js +0 -1781
  152. package/public/~partytown/debug/partytown.js +0 -72
  153. package/public/~partytown/partytown-atomics.js +0 -2
  154. package/public/~partytown/partytown-media.js +0 -2
  155. package/public/~partytown/partytown-sw.js +0 -2
  156. package/public/~partytown/partytown.js +0 -2
@@ -1,2271 +0,0 @@
1
- (() => {
2
- var exports = {};
3
- exports.id = 103;
4
- exports.ids = [103];
5
- exports.modules = {
6
-
7
- /***/ 2951:
8
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
9
-
10
- "use strict";
11
- __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
12
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13
- /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
14
- /* harmony export */ });
15
- /* harmony import */ var src_components_sections_BannerText__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7599);
16
- /* harmony import */ var src_components_sections_Newsletter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8170);
17
- /* harmony import */ var _Section__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3271);
18
- /* harmony import */ var _section_module_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5411);
19
- /* harmony import */ var _section_module_scss__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_section_module_scss__WEBPACK_IMPORTED_MODULE_2__);
20
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
21
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
22
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([src_components_sections_Newsletter__WEBPACK_IMPORTED_MODULE_4__]);
23
- src_components_sections_Newsletter__WEBPACK_IMPORTED_MODULE_4__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
24
-
25
-
26
-
27
-
28
-
29
-
30
-
31
- function BannerNewsletter({
32
- banner,
33
- newsletter
34
- }) {
35
- return /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_Section__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
36
- className: `${(_section_module_scss__WEBPACK_IMPORTED_MODULE_2___default().section)} section-banner-newsletter`,
37
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
38
- "data-fs-banner-text-newsletter": true,
39
- "data-fs-content": "banner-newsletter",
40
- children: [/*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(src_components_sections_BannerText__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
41
- title: banner.title,
42
- caption: banner.caption,
43
- link: banner?.link,
44
- variant: banner.variant,
45
- colorVariant: banner.colorVariant
46
- }), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(src_components_sections_Newsletter__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
47
- title: newsletter.title,
48
- description: newsletter.description,
49
- icon: newsletter.icon,
50
- privacyPolicy: newsletter.privacyPolicy,
51
- emailInputLabel: newsletter.emailInputLabel,
52
- displayNameInput: newsletter.displayNameInput,
53
- nameInputLabel: newsletter.nameInputLabel,
54
- subscribeButtonLabel: newsletter.subscribeButtonLabel,
55
- toastSubscribe: newsletter.toastSubscribe,
56
- toastSubscribeError: newsletter.toastSubscribeError,
57
- card: newsletter.card
58
- })]
59
- })
60
- });
61
- }
62
-
63
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BannerNewsletter);
64
- __webpack_async_result__();
65
- } catch(e) { __webpack_async_result__(e); } });
66
-
67
- /***/ }),
68
-
69
- /***/ 994:
70
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
71
-
72
- "use strict";
73
- __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
74
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
75
- /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
76
- /* harmony export */ });
77
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
78
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
79
- /* harmony import */ var src_components_ui_ProductShelf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7691);
80
- /* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9785);
81
- /* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_intersection_observer__WEBPACK_IMPORTED_MODULE_1__);
82
- /* harmony import */ var src_sdk_overrides_PageProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5953);
83
- /* harmony import */ var _ProductShelf_section_module_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(6627);
84
- /* harmony import */ var _ProductShelf_section_module_scss__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_ProductShelf_section_module_scss__WEBPACK_IMPORTED_MODULE_5__);
85
- /* harmony import */ var _Section__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3271);
86
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(997);
87
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
88
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([src_components_ui_ProductShelf__WEBPACK_IMPORTED_MODULE_6__]);
89
- src_components_ui_ProductShelf__WEBPACK_IMPORTED_MODULE_6__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
-
98
- const CrossSellingShelf = ({
99
- numberOfItems,
100
- title,
101
- kind
102
- }) => {
103
- const {
104
- ref,
105
- inView
106
- } = (0,react_intersection_observer__WEBPACK_IMPORTED_MODULE_1__.useInView)();
107
- const context = (0,src_sdk_overrides_PageProvider__WEBPACK_IMPORTED_MODULE_3__/* .usePDP */ .al)();
108
- const productGroupID = context?.data?.product?.isVariantOf?.productGroupID;
109
- const selectedFacets = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => [{
110
- key: kind,
111
- value: productGroupID
112
- }], [kind, productGroupID]);
113
- return /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx(_Section__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
114
- className: `${(_ProductShelf_section_module_scss__WEBPACK_IMPORTED_MODULE_5___default().section)} section-product-shelf layout__section`,
115
- ref: ref,
116
- children: /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx(src_components_ui_ProductShelf__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z, {
117
- inView: inView,
118
- numberOfItems: numberOfItems,
119
- title: title,
120
- selectedFacets: selectedFacets
121
- })
122
- });
123
- };
124
-
125
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CrossSellingShelf);
126
- __webpack_async_result__();
127
- } catch(e) { __webpack_async_result__(e); } });
128
-
129
- /***/ }),
130
-
131
- /***/ 2694:
132
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
133
-
134
- "use strict";
135
-
136
- // EXPORTS
137
- __webpack_require__.d(__webpack_exports__, {
138
- "Z": () => (/* binding */ ProductDetails_ProductDetails)
139
- });
140
-
141
- // UNUSED EXPORTS: fragment
142
-
143
- // EXTERNAL MODULE: external "react"
144
- var external_react_ = __webpack_require__(6689);
145
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
146
- // EXTERNAL MODULE: ../sdk/dist/analytics/sendAnalyticsEvent.js
147
- var sendAnalyticsEvent = __webpack_require__(1072);
148
- // EXTERNAL MODULE: ./src/sdk/product/useFormattedPrice.ts
149
- var useFormattedPrice = __webpack_require__(5346);
150
- // EXTERNAL MODULE: ./src/sdk/session/index.ts + 1 modules
151
- var session = __webpack_require__(7295);
152
- // EXTERNAL MODULE: ./src/components/sections/Section/Section.tsx
153
- var Section = __webpack_require__(3271);
154
- // EXTERNAL MODULE: ../components/dist/esm/molecules/Accordion/Accordion.js
155
- var Accordion = __webpack_require__(1516);
156
- // EXTERNAL MODULE: ../components/dist/esm/molecules/Accordion/AccordionItem.js
157
- var AccordionItem = __webpack_require__(783);
158
- // EXTERNAL MODULE: ../components/dist/esm/molecules/Accordion/AccordionButton.js
159
- var AccordionButton = __webpack_require__(7734);
160
- // EXTERNAL MODULE: ../components/dist/esm/molecules/Accordion/AccordionPanel.js
161
- var AccordionPanel = __webpack_require__(5208);
162
- // EXTERNAL MODULE: external "react/jsx-runtime"
163
- var jsx_runtime_ = __webpack_require__(997);
164
- ;// CONCATENATED MODULE: ./src/components/ui/ProductDescription/ProductDescription.tsx
165
-
166
-
167
-
168
-
169
-
170
- function ProductDescription({
171
- descriptionData,
172
- initiallyExpanded = 'first'
173
- }) {
174
- /**
175
- * Maps 'initiallyExpanded' prop values to indices
176
- */
177
- const INITIALLY_EXPANDED_MAP = (0,external_react_.useMemo)(() => ({
178
- none: [],
179
- first: [0],
180
- all: [0, 1, 2, 3]
181
- }), []);
182
- const {
183
- 0: indices,
184
- 1: setIndices
185
- } = (0,external_react_.useState)(new Set(INITIALLY_EXPANDED_MAP[initiallyExpanded]));
186
-
187
- const onChange = index => {
188
- setIndices(currentIndices => {
189
- const newIndices = new Set(currentIndices);
190
-
191
- if (currentIndices.has(index)) {
192
- newIndices.delete(index);
193
- } else {
194
- newIndices.add(index);
195
- }
196
-
197
- return newIndices;
198
- });
199
- };
200
-
201
- return /*#__PURE__*/jsx_runtime_.jsx("section", {
202
- "data-fs-product-description": true,
203
- children: /*#__PURE__*/jsx_runtime_.jsx(Accordion/* default */.Z, {
204
- indices: indices,
205
- onChange: onChange,
206
- "aria-label": "Product Details Content",
207
- children: descriptionData.map(({
208
- title,
209
- content
210
- }, index) => /*#__PURE__*/(0,jsx_runtime_.jsxs)(AccordionItem/* default */.Z, {
211
- as: "article",
212
- index: index,
213
- prefixId: "product-description",
214
- "data-fs-product-details-description": true,
215
- children: [/*#__PURE__*/jsx_runtime_.jsx(AccordionButton/* default */.Z, {
216
- children: title
217
- }), /*#__PURE__*/jsx_runtime_.jsx(AccordionPanel/* default */.Z, {
218
- children: /*#__PURE__*/jsx_runtime_.jsx("div", {
219
- // Applies display: contents through FastStore UI
220
- "data-fs-product-details-description-content": true // The content is already sanitized by FastStore API
221
- ,
222
- dangerouslySetInnerHTML: {
223
- __html: content
224
- }
225
- })
226
- })]
227
- }, String(index)))
228
- })
229
- });
230
- }
231
-
232
- /* harmony default export */ const ProductDescription_ProductDescription = (ProductDescription);
233
- // EXTERNAL MODULE: ../components/dist/esm/hooks/UIProvider.js
234
- var UIProvider = __webpack_require__(6652);
235
- // EXTERNAL MODULE: ./src/sdk/cart/index.ts + 1 modules
236
- var cart = __webpack_require__(6073);
237
- ;// CONCATENATED MODULE: ./src/sdk/cart/useBuyButton.ts
238
-
239
-
240
-
241
-
242
-
243
- const useBuyButton = item => {
244
- const {
245
- openCart
246
- } = (0,UIProvider/* useUI */.l)();
247
- const {
248
- currency: {
249
- code
250
- }
251
- } = (0,session/* useSession */.kP)();
252
- const onClick = (0,external_react_.useCallback)(e => {
253
- e.preventDefault();
254
-
255
- if (!item) {
256
- return;
257
- }
258
-
259
- (0,sendAnalyticsEvent/* sendAnalyticsEvent */._)({
260
- name: 'add_to_cart',
261
- params: {
262
- currency: code,
263
- // TODO: In the future, we can explore more robust ways of
264
- // calculating the value (gift items, discounts, etc.).
265
- value: item.price * item.quantity,
266
- items: [{
267
- item_id: item.itemOffered.isVariantOf.productGroupID,
268
- item_name: item.itemOffered.isVariantOf.name,
269
- item_brand: item.itemOffered.brand.name,
270
- item_variant: item.itemOffered.sku,
271
- quantity: item.quantity,
272
- price: item.price,
273
- discount: item.listPrice - item.price,
274
- currency: code,
275
- item_variant_name: item.itemOffered.name,
276
- product_reference_id: item.itemOffered.gtin
277
- }]
278
- }
279
- });
280
- cart/* cartStore.addItem */.i8.addItem(item);
281
- openCart();
282
- }, [code, item, openCart]);
283
- return {
284
- onClick,
285
- 'data-testid': 'buy-button',
286
- 'data-sku': item?.itemOffered.sku,
287
- 'data-seller': item?.seller.identifier
288
- };
289
- };
290
- // EXTERNAL MODULE: ./node_modules/next/link.js
291
- var next_link = __webpack_require__(1664);
292
- var link_default = /*#__PURE__*/__webpack_require__.n(next_link);
293
- // EXTERNAL MODULE: ./src/components/ui/Image/Image.tsx + 1 modules
294
- var Image = __webpack_require__(5731);
295
- // EXTERNAL MODULE: ../components/dist/esm/molecules/Rating/Rating.js
296
- var Rating = __webpack_require__(3024);
297
- ;// CONCATENATED MODULE: ../components/dist/esm/molecules/ProductTitle/ProductTitle.js
298
-
299
-
300
- const ProductTitle = (0,external_react_.forwardRef)(function ProductTitle({ title, label, refTag = 'Ref.: ', refNumber, testId = 'fs-product-title', ratingValue, ...otherProps }, ref) {
301
- return (external_react_default().createElement("header", { ref: ref, "data-fs-product-title": true, "data-testid": testId, ...otherProps },
302
- external_react_default().createElement("div", { "data-fs-product-title-header": true },
303
- title,
304
- !!label && label),
305
- (refNumber || ratingValue) && (external_react_default().createElement("div", { "data-fs-product-title-addendum": true },
306
- ratingValue && external_react_default().createElement(Rating/* default */.Z, { value: ratingValue }),
307
- refNumber && (external_react_default().createElement((external_react_default()).Fragment, null,
308
- refTag,
309
- " ",
310
- refNumber))))));
311
- });
312
- /* harmony default export */ const ProductTitle_ProductTitle = (ProductTitle);
313
- //# sourceMappingURL=ProductTitle.js.map
314
- // EXTERNAL MODULE: ../components/dist/esm/molecules/DiscountBadge/DiscountBadge.js + 1 modules
315
- var DiscountBadge = __webpack_require__(2946);
316
- // EXTERNAL MODULE: ../components/dist/esm/atoms/Button/Button.js
317
- var Button = __webpack_require__(3339);
318
- ;// CONCATENATED MODULE: ../components/dist/esm/molecules/BuyButton/BuyButton.js
319
-
320
-
321
- function BuyButton({ testId = 'fs-buy-button', icon, children, ...otherProps }) {
322
- return (external_react_default().createElement(Button/* default */.Z, { "data-fs-buy-button": true, icon: icon, iconPosition: "left", "data-testid": testId, ...otherProps }, children));
323
- }
324
- /* harmony default export */ const BuyButton_BuyButton = (BuyButton);
325
- //# sourceMappingURL=BuyButton.js.map
326
- // EXTERNAL MODULE: ../components/dist/esm/atoms/Icon/Icon.js
327
- var Icon = __webpack_require__(2614);
328
- // EXTERNAL MODULE: ../components/dist/esm/atoms/Price/Price.js
329
- var Price = __webpack_require__(9767);
330
- // EXTERNAL MODULE: ../components/dist/esm/molecules/QuantitySelector/QuantitySelector.js
331
- var QuantitySelector = __webpack_require__(6693);
332
- // EXTERNAL MODULE: ../components/dist/esm/atoms/Label/Label.js
333
- var Label = __webpack_require__(1953);
334
- // EXTERNAL MODULE: ../components/dist/esm/atoms/Link/Link.js
335
- var Link = __webpack_require__(4272);
336
- // EXTERNAL MODULE: ../components/dist/esm/atoms/SROnly/SROnly.js
337
- var SROnly = __webpack_require__(5450);
338
- ;// CONCATENATED MODULE: ../components/dist/esm/molecules/SkuSelector/useDefineVariant.js
339
-
340
- const getImageName = (src) => {
341
- const sourcePath = new URL(src).pathname;
342
- const imageName = sourcePath.split('/').slice(-1)[0];
343
- return imageName;
344
- };
345
- const useDefineVariant = (options, variant) => (0,external_react_.useMemo)(() => {
346
- if (variant)
347
- return variant;
348
- const allOptionsHaveHexColor = options.every((option) => option.hexColor);
349
- if (allOptionsHaveHexColor) {
350
- return 'color';
351
- }
352
- const firstImageName = options[0]?.src && getImageName(options[0].src);
353
- const areSourcesEqualsOrNull = options.every((option) => {
354
- if (!option.src) {
355
- return true;
356
- }
357
- const optionImageName = getImageName(option.src);
358
- return optionImageName === firstImageName;
359
- });
360
- if (!areSourcesEqualsOrNull) {
361
- return 'image';
362
- }
363
- return 'label';
364
- }, [options, variant]);
365
- //# sourceMappingURL=useDefineVariant.js.map
366
- ;// CONCATENATED MODULE: ../components/dist/esm/molecules/SkuSelector/useSkuSlug.js
367
-
368
- function getSkuSlug(slugsMap, selectedVariations, dominantVariation) {
369
- const slugsMapKey = Object.entries(selectedVariations).flat().join('-');
370
- if (slugsMapKey in slugsMap) {
371
- return slugsMap[slugsMapKey];
372
- }
373
- const possibleVariants = Object.keys(slugsMap);
374
- const firstVariationForDominantValue = possibleVariants.find((slug) => slug.includes(`${dominantVariation}-${selectedVariations[dominantVariation]}`));
375
- return slugsMap[firstVariationForDominantValue ?? possibleVariants[0]];
376
- }
377
- const useSkuSlug = (activeVariations, slugsMap, skuPropertyName, getItemHrefProp) => {
378
- const getItemHref = (0,external_react_.useCallback)((option) => {
379
- if (getItemHrefProp)
380
- return { getItemHrefProp };
381
- const currentItemHref = `/${getSkuSlug(slugsMap, {
382
- ...activeVariations,
383
- [skuPropertyName]: option.value,
384
- }, skuPropertyName)}/p`;
385
- return currentItemHref;
386
- }, [activeVariations, getItemHrefProp, slugsMap, skuPropertyName]);
387
- return { getItemHref };
388
- };
389
- //# sourceMappingURL=useSkuSlug.js.map
390
- ;// CONCATENATED MODULE: ../components/dist/esm/molecules/SkuSelector/SkuSelector.js
391
-
392
-
393
-
394
-
395
- // TODO: Change by ImageComponent when it be right
396
- const ImageComponentFallback = ({ src, alt, ...otherProps }) => external_react_default().createElement("img", { src: src, alt: alt, ...otherProps });
397
- const SkuSelector = (0,external_react_.forwardRef)(function SkuSelector({ availableVariations, skuPropertyName, testId, activeVariations, linkProps, slugsMap, getItemHref: getItemHrefProp, ImageComponent = ImageComponentFallback, variant: variantProp, ...otherProps }, ref) {
398
- const activeSelectorValue = activeVariations[skuPropertyName];
399
- const options = availableVariations[skuPropertyName];
400
- const variant = useDefineVariant(options, variantProp);
401
- const { getItemHref } = useSkuSlug(activeVariations, slugsMap, skuPropertyName, getItemHrefProp);
402
- return (external_react_default().createElement("div", { ref: ref, "data-fs-sku-selector": true, "data-testid": testId, "data-fs-sku-selector-variant": variant, ...otherProps },
403
- skuPropertyName && (external_react_default().createElement(Label/* default */.Z, { "data-fs-sku-selector-title": true },
404
- skuPropertyName,
405
- ": ",
406
- external_react_default().createElement("strong", null, activeSelectorValue))),
407
- external_react_default().createElement("ul", { "data-fs-sku-selector-list": true }, options.map((option, index) => {
408
- return (external_react_default().createElement("li", { key: String(index), title: option.label, "data-fs-sku-selector-option": true, "data-fs-sku-selector-disabled": option.disabled, "data-fs-sku-selector-checked": option.value === activeVariations[skuPropertyName] },
409
- external_react_default().createElement(Link/* default */.Z, { "data-fs-sku-selector-option-link": true, href: getItemHref(option), ...linkProps },
410
- external_react_default().createElement(SROnly/* default */.Z, { text: option.label })),
411
- variant === 'label' && external_react_default().createElement("span", null, option.value),
412
- variant === 'image' && ImageComponent && (external_react_default().createElement("span", null,
413
- external_react_default().createElement(ImageComponent, { src: option.src ?? '', alt: option.alt ?? '', "data-fs-sku-selector-option-image": true }))),
414
- variant === 'color' && (external_react_default().createElement("span", null,
415
- external_react_default().createElement("div", { "data-fs-sku-selector-option-color": true, title: option.value, style: {
416
- '--data-fs-sku-selector-option-color-bkg-color': option.hexColor,
417
- } })))));
418
- }))));
419
- });
420
- /* harmony default export */ const SkuSelector_SkuSelector = (SkuSelector);
421
- //# sourceMappingURL=SkuSelector.js.map
422
- // EXTERNAL MODULE: ../components/dist/esm/molecules/InputField/InputField.js
423
- var InputField = __webpack_require__(3779);
424
- ;// CONCATENATED MODULE: ../components/dist/esm/molecules/Table/Table.js
425
-
426
- const Table = (0,external_react_.forwardRef)(function Table({ children, variant = 'colored', testId = 'fs-table', ...otherProps }, ref) {
427
- return (external_react_default().createElement("div", { "data-fs-table": true },
428
- external_react_default().createElement("table", { ref: ref, "data-fs-table-content": true, "data-fs-table-variant": variant, "data-testid": testId, ...otherProps }, children)));
429
- });
430
- /* harmony default export */ const Table_Table = (Table);
431
- //# sourceMappingURL=Table.js.map
432
- ;// CONCATENATED MODULE: ../components/dist/esm/molecules/Table/TableBody.js
433
-
434
- const TableBody = (0,external_react_.forwardRef)(function TableBody({ children, testId = 'fs-table-body', ...otherProps }, ref) {
435
- return (external_react_default().createElement("tbody", { ref: ref, "data-testid": testId, "data-fs-table-body": true, ...otherProps }, children));
436
- });
437
- /* harmony default export */ const Table_TableBody = (TableBody);
438
- //# sourceMappingURL=TableBody.js.map
439
- ;// CONCATENATED MODULE: ../components/dist/esm/molecules/Table/TableRow.js
440
-
441
- const TableRow = (0,external_react_.forwardRef)(function TableRow({ children, testId = 'fs-table-row', ...otherProps }, ref) {
442
- return (external_react_default().createElement("tr", { ref: ref, "data-fs-table-row": true, "data-testid": testId, ...otherProps }, children));
443
- });
444
- /* harmony default export */ const Table_TableRow = (TableRow);
445
- //# sourceMappingURL=TableRow.js.map
446
- ;// CONCATENATED MODULE: ../components/dist/esm/molecules/Table/TableCell.js
447
-
448
- const TableCell = (0,external_react_.forwardRef)(function TableCell({ scope, align, children, variant = 'data', testId = 'fs-table-cell', ...otherProps }, ref) {
449
- const Cell = variant === 'header' ? 'th' : 'td';
450
- return (external_react_default().createElement(Cell, { ref: ref, "data-fs-table-cell": variant, "data-fs-table-cell-align": align, "data-testid": testId, scope: scope, ...otherProps }, children));
451
- });
452
- /* harmony default export */ const Table_TableCell = (TableCell);
453
- //# sourceMappingURL=TableCell.js.map
454
- ;// CONCATENATED MODULE: ../components/dist/esm/organisms/ShippingSimulation/ShippingSimulation.js
455
-
456
-
457
- function ShippingSimulation({ testId = 'fs-shipping-simulation', formatter, title = 'Shipping', inputLabel = 'Postal Code', optionsLabel = 'Shipping options', idkPostalCodeLinkProps, onInput, onSubmit, onClear, location, options = [], displayClearButton = false, errorMessage, postalCode, ...otherProps }) {
458
- const hasShippingOptions = !!options && options.length > 0;
459
- return (external_react_default().createElement("section", { "data-fs-shipping-simulation": true, "data-fs-shipping-simulation-empty": !hasShippingOptions ? 'true' : 'false', "data-testid": testId, ...otherProps },
460
- external_react_default().createElement("h2", { "data-fs-shipping-simulation-title": true }, title),
461
- external_react_default().createElement(InputField/* default */.Z, { actionable: true, error: errorMessage, id: `${testId}-input-field`, label: inputLabel, value: postalCode, onInput: (event) => onInput?.(event), onSubmit: () => onSubmit?.(), onClear: () => onClear?.(), displayClearButton: displayClearButton }),
462
- external_react_default().createElement(Link/* default */.Z, { href: "/", "data-fs-shipping-simulation-link": true, size: "small", ...idkPostalCodeLinkProps }, idkPostalCodeLinkProps?.children ?? (external_react_default().createElement((external_react_default()).Fragment, null,
463
- "I don't know my Postal Code",
464
- external_react_default().createElement(Icon/* default */.Z, { name: "ArrowSquareOut", width: 20, height: 20 })))),
465
- hasShippingOptions && (external_react_default().createElement((external_react_default()).Fragment, null,
466
- external_react_default().createElement("header", { "data-fs-shipping-simulation-header": true },
467
- external_react_default().createElement("h3", { "data-fs-shipping-simulation-subtitle": true }, optionsLabel),
468
- external_react_default().createElement("p", { "data-fs-shipping-simulation-location": true }, location)),
469
- external_react_default().createElement(Table_Table, null,
470
- external_react_default().createElement(Table_TableBody, null, options.map((option) => (external_react_default().createElement(Table_TableRow, { key: option.carrier },
471
- external_react_default().createElement(Table_TableCell, { align: "left" }, option.carrier),
472
- external_react_default().createElement(Table_TableCell, null, option.localizedEstimates),
473
- external_react_default().createElement(Table_TableCell, { align: "right" }, option.price && (external_react_default().createElement(Price/* default */.Z, { formatter: formatter, value: option.price, SRText: "price" }))))))))))));
474
- }
475
- /* harmony default export */ const ShippingSimulation_ShippingSimulation = (ShippingSimulation);
476
- //# sourceMappingURL=ShippingSimulation.js.map
477
- // EXTERNAL MODULE: external "react-intersection-observer"
478
- var external_react_intersection_observer_ = __webpack_require__(9785);
479
- // EXTERNAL MODULE: ../components/dist/esm/molecules/IconButton/IconButton.js
480
- var IconButton = __webpack_require__(7041);
481
- ;// CONCATENATED MODULE: ../components/dist/esm/organisms/ImageGallery/ImageGallerySelector.js
482
-
483
-
484
-
485
- const SCROLL_MARGIN_VALUE = 400;
486
- const moveScroll = (container, value) => {
487
- if (container) {
488
- if (container.scrollHeight > container.clientHeight) {
489
- // TODO: Temporary workaround for scroll-behavior with scrollTop – Safari 15.4) https://developer.apple.com/forums/thread/703294
490
- container.style.overflow = 'auto';
491
- window.requestAnimationFrame(() => container.scrollTo({ top: value, behavior: 'smooth' }));
492
- setTimeout(() => (container.style.overflow = 'hidden'), 2000);
493
- }
494
- else {
495
- container.scrollLeft += value;
496
- }
497
- }
498
- };
499
- const hasScroll = (container) => {
500
- if (container) {
501
- return (container.scrollHeight > container.clientHeight ||
502
- container.scrollWidth > container.clientWidth);
503
- }
504
- return false;
505
- };
506
- function ImageGallerySelector({ images, onSelect, ImageComponent, currentImageIdx, testId = 'fs-image-gallery-selector', 'aria-label': ariaLabel = 'Product Images', navigationButtonLeftAriaLabel = 'Backward slide image selector', navigationButtonRightAriaLabel = 'Forward slide image selector', }) {
507
- const elementsRef = (0,external_react_.useRef)(null);
508
- const elementHasScroll = hasScroll(elementsRef.current);
509
- const [firstImageInView, setFirstImageInView] = (0,external_react_.useState)(true);
510
- const [lastImageInView, setLastImageInView] = (0,external_react_.useState)(true);
511
- const inViewChange = (0,external_react_.useCallback)((idx, inView) => {
512
- idx === 0 && setFirstImageInView(inView);
513
- idx === images.length - 1 && setLastImageInView(inView);
514
- }, [images.length]);
515
- return (external_react_default().createElement("section", { "data-fs-image-gallery-selector": true, "data-testid": testId, "aria-label": ariaLabel },
516
- elementHasScroll && !firstImageInView && (external_react_default().createElement("div", { "data-fs-image-gallery-selector-control": true },
517
- external_react_default().createElement(IconButton/* default */.Z, { "data-fs-image-gallery-selector-control-button": true, "aria-label": navigationButtonLeftAriaLabel, icon: external_react_default().createElement(Icon/* default */.Z, { name: "ArrowLeft" }), onClick: () => moveScroll(elementsRef.current, -SCROLL_MARGIN_VALUE) }))),
518
- external_react_default().createElement("div", { "data-fs-image-gallery-selector-elements": true, ref: elementsRef }, images.map((image, idx) => {
519
- return (external_react_default().createElement(external_react_intersection_observer_.InView, { key: idx, onChange: (inView) => inViewChange(idx, inView) },
520
- external_react_default().createElement(Button/* default */.Z, { key: idx, "aria-label": `${image.alternateName} - Image ${idx + 1} of ${images.length}`, onClick: () => onSelect(idx), "data-fs-image-gallery-selector-thumbnail": idx === currentImageIdx ? 'selected' : 'true' },
521
- external_react_default().createElement(ImageComponent, { url: image.url ?? '', loading: idx === 0 ? 'eager' : 'lazy', alternateName: image.alternateName ?? '' }))));
522
- })),
523
- elementHasScroll && !lastImageInView && (external_react_default().createElement("div", { "data-fs-image-gallery-selector-control": true },
524
- external_react_default().createElement(IconButton/* default */.Z, { "data-fs-image-gallery-selector-control-button": true, "aria-label": navigationButtonRightAriaLabel, icon: external_react_default().createElement(Icon/* default */.Z, { name: "ArrowLeft" }), onClick: () => moveScroll(elementsRef.current, +SCROLL_MARGIN_VALUE) })))));
525
- }
526
- /* harmony default export */ const ImageGallery_ImageGallerySelector = (ImageGallerySelector);
527
- //# sourceMappingURL=ImageGallerySelector.js.map
528
- ;// CONCATENATED MODULE: ../components/dist/esm/organisms/ImageGallery/ImageGallery.js
529
-
530
-
531
- const ImageGallery = (0,external_react_.forwardRef)(function ImageGallery({ images, children, ImageComponent, selectedImageIdx, setSelectedImageIdx, testId = 'fs-image-gallery', ...otherProps }, ref) {
532
- const hasSelector = images.length > 1;
533
- return (external_react_default().createElement("section", { ref: ref, "data-fs-image-gallery": hasSelector ? 'with-selector' : 'without-selector', "data-testid": testId, ...otherProps },
534
- children,
535
- hasSelector && (external_react_default().createElement(ImageGallery_ImageGallerySelector, { images: images, onSelect: setSelectedImageIdx, currentImageIdx: selectedImageIdx, ImageComponent: ImageComponent }))));
536
- });
537
- /* harmony default export */ const ImageGallery_ImageGallery = (ImageGallery);
538
- //# sourceMappingURL=ImageGallery.js.map
539
- ;// CONCATENATED MODULE: ../components/dist/esm/organisms/ImageGallery/ImageGalleryViewer.js
540
-
541
- const ImageGalleryViewer = ({ children, }) => {
542
- return external_react_default().createElement((external_react_default()).Fragment, null, children);
543
- };
544
- /* harmony default export */ const ImageGallery_ImageGalleryViewer = (ImageGalleryViewer);
545
- //# sourceMappingURL=ImageGalleryViewer.js.map
546
- // EXTERNAL MODULE: external "next/router"
547
- var router_ = __webpack_require__(1853);
548
- ;// CONCATENATED MODULE: ./src/components/ui/ImageGallery/ImageGallery.tsx
549
- const _excluded = ["images"];
550
-
551
- 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; }
552
-
553
- 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; }
554
-
555
- 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; }
556
-
557
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
558
-
559
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
560
-
561
-
562
-
563
-
564
-
565
-
566
- const ImageComponent = ({
567
- url,
568
- alternateName
569
- }) => {
570
- return /*#__PURE__*/jsx_runtime_.jsx(__experimentalImageGalleryImage.Component, {
571
- src: url,
572
- alt: alternateName,
573
- width: 68,
574
- height: 68
575
- });
576
- };
577
-
578
- const ImageGallery_ImageGallery_ImageGallery = _ref => {
579
- let {
580
- images
581
- } = _ref,
582
- otherProps = _objectWithoutProperties(_ref, _excluded);
583
-
584
- const {
585
- 0: selectedImageIdx,
586
- 1: setSelectedImageIdx
587
- } = (0,external_react_.useState)(0);
588
- const currentImage = images[selectedImageIdx] ?? images[0];
589
- const dynamicRoute = (0,router_.useRouter)().asPath;
590
- (0,external_react_.useEffect)(() => setSelectedImageIdx(0), [dynamicRoute]);
591
- return /*#__PURE__*/jsx_runtime_.jsx(Overrides_ImageGallery.Component, _objectSpread(_objectSpread(_objectSpread({}, Overrides_ImageGallery.props), {}, {
592
- images: images,
593
- ImageComponent: ImageComponent,
594
- selectedImageIdx: selectedImageIdx,
595
- setSelectedImageIdx: setSelectedImageIdx
596
- }, otherProps), {}, {
597
- children: /*#__PURE__*/jsx_runtime_.jsx(Overrides_ImageGalleryViewer.Component, _objectSpread(_objectSpread({}, Overrides_ImageGalleryViewer.props), {}, {
598
- children: /*#__PURE__*/jsx_runtime_.jsx(__experimentalImageGalleryImage.Component, _objectSpread(_objectSpread({
599
- sizes: "(max-width: 360px) 50vw, (max-width: 768px) 90vw, 50vw",
600
- width: 691,
601
- height: 691 * (3 / 4),
602
- loading: "eager"
603
- }, __experimentalImageGalleryImage.props), {}, {
604
- src: currentImage.url,
605
- alt: currentImage.alternateName
606
- }))
607
- }))
608
- }));
609
- };
610
-
611
- /* harmony default export */ const ui_ImageGallery_ImageGallery = (ImageGallery_ImageGallery_ImageGallery);
612
- // EXTERNAL MODULE: ./src/sdk/graphql/request.ts
613
- var request = __webpack_require__(180);
614
- ;// CONCATENATED MODULE: ./src/sdk/shipping/index.ts
615
-
616
- const query = "ClientShippingSimulationQuery";
617
- const getShippingSimulation = async ({
618
- items,
619
- postalCode,
620
- country
621
- }) => {
622
- const data = await (0,request/* request */.W)(query, {
623
- items,
624
- postalCode,
625
- country
626
- });
627
- return data;
628
- };
629
- /* harmony default export */ const shipping = (getShippingSimulation);
630
- ;// CONCATENATED MODULE: ./src/sdk/shipping/useShippingSimulation.ts
631
- function useShippingSimulation_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; }
632
-
633
- function useShippingSimulation_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? useShippingSimulation_ownKeys(Object(source), !0).forEach(function (key) { useShippingSimulation_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : useShippingSimulation_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
634
-
635
- function useShippingSimulation_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; }
636
-
637
-
638
-
639
-
640
-
641
- const createEmptySimulation = () => ({
642
- input: {
643
- postalCode: '',
644
- displayClearButton: false,
645
- errorMessage: ''
646
- },
647
- shippingSimulation: undefined
648
- });
649
-
650
- const reducer = (state, action) => {
651
- const {
652
- type
653
- } = action;
654
-
655
- switch (type) {
656
- case 'clear':
657
- {
658
- return createEmptySimulation();
659
- }
660
-
661
- case 'update':
662
- {
663
- const {
664
- payload
665
- } = action;
666
- return {
667
- input: useShippingSimulation_objectSpread(useShippingSimulation_objectSpread({}, state.input), payload.input),
668
- shippingSimulation: useShippingSimulation_objectSpread(useShippingSimulation_objectSpread({}, state.shippingSimulation), payload.shippingSimulation)
669
- };
670
- }
671
-
672
- case 'onInput':
673
- {
674
- const {
675
- payload
676
- } = action;
677
- return useShippingSimulation_objectSpread(useShippingSimulation_objectSpread({}, state), {}, {
678
- input: useShippingSimulation_objectSpread({}, payload)
679
- });
680
- }
681
-
682
- case 'onError':
683
- {
684
- const {
685
- payload
686
- } = action;
687
- return useShippingSimulation_objectSpread(useShippingSimulation_objectSpread({}, state), {}, {
688
- input: useShippingSimulation_objectSpread(useShippingSimulation_objectSpread({}, state.input), payload)
689
- });
690
- }
691
-
692
- default:
693
- throw new Error(`Action ${type} not implemented`);
694
- }
695
- };
696
-
697
- const useShippingSimulation = shippingItem => {
698
- const {
699
- 0: {
700
- input,
701
- shippingSimulation
702
- },
703
- 1: dispatch
704
- } = (0,external_react_.useReducer)(reducer, null, createEmptySimulation);
705
- const {
706
- country,
707
- postalCode: sessionPostalCode
708
- } = (0,session/* useSession */.kP)();
709
- const {
710
- postalCode: shippingPostalCode
711
- } = input;
712
- const shippingPostalCodeRef = (0,external_react_.useRef)(shippingPostalCode);
713
- (0,external_react_.useEffect)(() => {
714
- const shouldFetch = sessionPostalCode && !shippingPostalCodeRef.current;
715
-
716
- if (!shouldFetch) {
717
- return;
718
- } // Use sessionPostalCode if there is no shippingPostalCode
719
-
720
-
721
- async function fetchShipping() {
722
- const data = await shipping({
723
- country,
724
- postalCode: sessionPostalCode ?? '',
725
- items: [shippingItem]
726
- });
727
- const shippingSimulation = data.shipping;
728
- dispatch({
729
- type: 'update',
730
- payload: {
731
- input: {
732
- postalCode: sessionPostalCode ?? '',
733
- displayClearButton: true,
734
- errorMessage: ''
735
- },
736
- shippingSimulation
737
- }
738
- });
739
- }
740
-
741
- fetchShipping();
742
- }, [country, sessionPostalCode, shippingItem]);
743
- const handleSubmit = (0,external_react_.useCallback)(async () => {
744
- try {
745
- const data = await shipping({
746
- country,
747
- postalCode: shippingPostalCode ?? '',
748
- items: [shippingItem]
749
- });
750
- const shippingSimulation = data.shipping;
751
- dispatch({
752
- type: 'update',
753
- payload: {
754
- input: {
755
- displayClearButton: true,
756
- errorMessage: ''
757
- },
758
- shippingSimulation
759
- }
760
- });
761
- } catch (error) {
762
- dispatch({
763
- type: 'onError',
764
- payload: {
765
- displayClearButton: true,
766
- errorMessage: 'You entered an invalid Postal Code'
767
- }
768
- });
769
- }
770
- }, [country, shippingItem, shippingPostalCode]);
771
- const handleOnInput = (0,external_react_.useCallback)(e => {
772
- const currentValue = e.currentTarget.value;
773
-
774
- if (currentValue) {
775
- dispatch({
776
- type: 'onInput',
777
- payload: {
778
- postalCode: currentValue,
779
- displayClearButton: false,
780
- errorMessage: ''
781
- }
782
- });
783
- } else {
784
- dispatch({
785
- type: 'clear'
786
- });
787
- }
788
- }, []);
789
- return {
790
- input,
791
- shippingSimulation,
792
- handleOnClear: () => {
793
- dispatch({
794
- type: 'clear'
795
- });
796
- },
797
- handleSubmit,
798
- handleOnInput
799
- };
800
- };
801
- ;// CONCATENATED MODULE: ./src/components/ui/ShippingSimulation/ShippingSimulation.tsx
802
- const ShippingSimulation_excluded = ["productShippingInfo", "formatter", "inputLabel", "title", "idkPostalCodeLinkProps"];
803
-
804
- function ShippingSimulation_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; }
805
-
806
- function ShippingSimulation_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ShippingSimulation_ownKeys(Object(source), !0).forEach(function (key) { ShippingSimulation_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ShippingSimulation_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
807
-
808
- function ShippingSimulation_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; }
809
-
810
- function ShippingSimulation_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = ShippingSimulation_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
811
-
812
- function ShippingSimulation_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
813
-
814
-
815
-
816
-
817
- function ShippingSimulation_ShippingSimulation_ShippingSimulation(_ref) {
818
- let {
819
- productShippingInfo,
820
- formatter,
821
- inputLabel,
822
- title,
823
- idkPostalCodeLinkProps
824
- } = _ref,
825
- otherProps = ShippingSimulation_objectWithoutProperties(_ref, ShippingSimulation_excluded);
826
-
827
- const {
828
- input,
829
- shippingSimulation,
830
- handleSubmit,
831
- handleOnInput,
832
- handleOnClear
833
- } = useShippingSimulation(productShippingInfo);
834
- const {
835
- postalCode,
836
- displayClearButton,
837
- errorMessage
838
- } = input;
839
- const location = [shippingSimulation?.address?.neighborhood, shippingSimulation?.address?.city].filter(Boolean).join(' / ') ?? '';
840
- const options = shippingSimulation?.logisticsInfo?.[0]?.slas ?? [];
841
- return /*#__PURE__*/jsx_runtime_.jsx(Overrides_ShippingSimulation.Component, ShippingSimulation_objectSpread({
842
- formatter: formatter,
843
- onInput: handleOnInput,
844
- onSubmit: handleSubmit,
845
- onClear: handleOnClear,
846
- location: location,
847
- options: options,
848
- address: shippingSimulation?.address,
849
- displayClearButton: displayClearButton,
850
- errorMessage: errorMessage,
851
- postalCode: postalCode,
852
- inputLabel: inputLabel,
853
- title: title,
854
- idkPostalCodeLinkProps: idkPostalCodeLinkProps
855
- }, otherProps));
856
- }
857
- ;// CONCATENATED MODULE: ./src/components/product/NotAvailableButton/NotAvailableButton.tsx
858
- // TODO: Remove this component when <OutOfStock /> is ready to use
859
-
860
-
861
-
862
- function NotAvailableButton({
863
- children
864
- }) {
865
- return /*#__PURE__*/jsx_runtime_.jsx(Button/* default */.Z, {
866
- variant: "primary",
867
- disabled: true,
868
- "data-fs-buy-button": true,
869
- children: children
870
- });
871
- }
872
-
873
- /* harmony default export */ const NotAvailableButton_NotAvailableButton = (NotAvailableButton);
874
- // EXTERNAL MODULE: ./src/sdk/overrides/overrides.ts
875
- var overrides = __webpack_require__(7506);
876
- ;// CONCATENATED MODULE: ./src/customizations/src/components/overrides/ProductDetails.tsx
877
- // This is an example of how it can be used on the starter.
878
- const SECTION = 'ProductDetails';
879
- const override = {
880
- section: SECTION
881
- };
882
-
883
- ;// CONCATENATED MODULE: ./src/components/sections/ProductDetails/Overrides.tsx
884
-
885
-
886
-
887
-
888
-
889
-
890
-
891
- const {
892
- ProductTitle: Overrides_ProductTitle,
893
- DiscountBadge: Overrides_DiscountBadge,
894
- BuyButton: Overrides_BuyButton,
895
- Icon: Overrides_Icon,
896
- Price: Overrides_Price,
897
- QuantitySelector: Overrides_QuantitySelector,
898
- SkuSelector: Overrides_SkuSelector,
899
- ShippingSimulation: Overrides_ShippingSimulation,
900
- ImageGallery: Overrides_ImageGallery,
901
- ImageGalleryViewer: Overrides_ImageGalleryViewer,
902
- __experimentalImageGalleryImage,
903
- __experimentalImageGallery,
904
- __experimentalShippingSimulation,
905
- __experimentalNotAvailableButton
906
- } = (0,overrides/* getSectionOverrides */.f)({
907
- ProductTitle: ProductTitle_ProductTitle,
908
- DiscountBadge: DiscountBadge/* default */.Z,
909
- BuyButton: BuyButton_BuyButton,
910
- Icon: Icon/* default */.Z,
911
- Price: Price/* default */.Z,
912
- QuantitySelector: QuantitySelector/* default */.Z,
913
- SkuSelector: SkuSelector_SkuSelector,
914
- ShippingSimulation: ShippingSimulation_ShippingSimulation,
915
- ImageGallery: ImageGallery_ImageGallery,
916
- ImageGalleryViewer: ImageGallery_ImageGalleryViewer,
917
- __experimentalImageGalleryImage: Image/* default */.Z,
918
- __experimentalImageGallery: ui_ImageGallery_ImageGallery,
919
- __experimentalShippingSimulation: ShippingSimulation_ShippingSimulation_ShippingSimulation,
920
- __experimentalNotAvailableButton: NotAvailableButton_NotAvailableButton
921
- }, override);
922
-
923
- ;// CONCATENATED MODULE: ./src/components/ui/SkuSelector/Selectors.tsx
924
- const Selectors_excluded = ["src", "alt"],
925
- _excluded2 = ["slugsMap", "activeVariations", "availableVariations"];
926
-
927
- function Selectors_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; }
928
-
929
- function Selectors_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? Selectors_ownKeys(Object(source), !0).forEach(function (key) { Selectors_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : Selectors_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
930
-
931
- function Selectors_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; }
932
-
933
- function Selectors_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Selectors_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
934
-
935
- function Selectors_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
936
-
937
-
938
-
939
-
940
-
941
-
942
-
943
- const Selectors_ImageComponent = _ref => {
944
- let {
945
- src,
946
- alt
947
- } = _ref,
948
- otherProps = Selectors_objectWithoutProperties(_ref, Selectors_excluded);
949
-
950
- return /*#__PURE__*/jsx_runtime_.jsx(Image/* default */.Z, Selectors_objectSpread({
951
- src: src,
952
- alt: alt,
953
- width: 34,
954
- height: 34
955
- }, otherProps));
956
- };
957
-
958
- function Selectors(_ref2) {
959
- let {
960
- slugsMap,
961
- activeVariations,
962
- availableVariations
963
- } = _ref2,
964
- otherProps = Selectors_objectWithoutProperties(_ref2, _excluded2);
965
-
966
- return /*#__PURE__*/jsx_runtime_.jsx("section", Selectors_objectSpread(Selectors_objectSpread({}, otherProps), {}, {
967
- children: availableVariations && Object.keys(availableVariations).map(skuVariant => /*#__PURE__*/(0,external_react_.createElement)(Overrides_SkuSelector.Component, Selectors_objectSpread(Selectors_objectSpread({
968
- ImageComponent: Selectors_ImageComponent
969
- }, Overrides_SkuSelector.props), {}, {
970
- key: skuVariant,
971
- skuPropertyName: skuVariant,
972
- availableVariations: availableVariations,
973
- activeVariations: activeVariations,
974
- slugsMap: slugsMap,
975
- linkProps: Selectors_objectSpread(Selectors_objectSpread({}, Overrides_SkuSelector.props.linkProps ?? {}), {}, {
976
- as: Overrides_SkuSelector.props.linkProps?.as ?? (link_default()),
977
- legacyBehavior: Overrides_SkuSelector.props.linkProps?.legacyBehavior ?? false
978
- })
979
- })))
980
- }));
981
- }
982
-
983
- /* harmony default export */ const SkuSelector_Selectors = (Selectors);
984
- ;// CONCATENATED MODULE: ./src/components/ui/ProductDetails/AddToCartLoadingSkeleton.tsx
985
-
986
-
987
- function AddToCartLoadingSkeleton() {
988
- return (
989
- /*#__PURE__*/
990
- // Generated via https://skeletonreact.com/.
991
- (0,jsx_runtime_.jsxs)("svg", {
992
- role: "img",
993
- width: "100%",
994
- height: "48",
995
- "aria-labelledby": "loading-aria",
996
- viewBox: "0 0 112 48",
997
- preserveAspectRatio: "none",
998
- children: [/*#__PURE__*/jsx_runtime_.jsx("title", {
999
- id: "loading-aria",
1000
- children: "Loading..."
1001
- }), /*#__PURE__*/jsx_runtime_.jsx("rect", {
1002
- x: "0",
1003
- y: "0",
1004
- width: "100%",
1005
- height: "100%",
1006
- clipPath: "url(#clip-path)",
1007
- style: {
1008
- fill: 'url("#fill")'
1009
- }
1010
- }), /*#__PURE__*/(0,jsx_runtime_.jsxs)("defs", {
1011
- children: [/*#__PURE__*/jsx_runtime_.jsx("clipPath", {
1012
- id: "clip-path",
1013
- children: /*#__PURE__*/jsx_runtime_.jsx("rect", {
1014
- x: "0",
1015
- y: "0",
1016
- rx: "2",
1017
- ry: "2",
1018
- width: "112",
1019
- height: "48"
1020
- })
1021
- }), /*#__PURE__*/(0,jsx_runtime_.jsxs)("linearGradient", {
1022
- id: "fill",
1023
- children: [/*#__PURE__*/jsx_runtime_.jsx("stop", {
1024
- offset: "0.599964",
1025
- stopColor: "#f3f3f3",
1026
- stopOpacity: "1",
1027
- children: /*#__PURE__*/jsx_runtime_.jsx("animate", {
1028
- attributeName: "offset",
1029
- values: "-2; -2; 1",
1030
- keyTimes: "0; 0.25; 1",
1031
- dur: "2s",
1032
- repeatCount: "indefinite"
1033
- })
1034
- }), /*#__PURE__*/jsx_runtime_.jsx("stop", {
1035
- offset: "1.59996",
1036
- stopColor: "#ecebeb",
1037
- stopOpacity: "1",
1038
- children: /*#__PURE__*/jsx_runtime_.jsx("animate", {
1039
- attributeName: "offset",
1040
- values: "-1; -1; 2",
1041
- keyTimes: "0; 0.25; 1",
1042
- dur: "2s",
1043
- repeatCount: "indefinite"
1044
- })
1045
- }), /*#__PURE__*/jsx_runtime_.jsx("stop", {
1046
- offset: "2.59996",
1047
- stopColor: "#f3f3f3",
1048
- stopOpacity: "1",
1049
- children: /*#__PURE__*/jsx_runtime_.jsx("animate", {
1050
- attributeName: "offset",
1051
- values: "0; 0; 3",
1052
- keyTimes: "0; 0.25; 1",
1053
- dur: "2s",
1054
- repeatCount: "indefinite"
1055
- })
1056
- })]
1057
- })]
1058
- })]
1059
- })
1060
- );
1061
- }
1062
- ;// CONCATENATED MODULE: ./src/components/ui/ProductDetails/ProductDetailsSettings.tsx
1063
- function ProductDetailsSettings_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; }
1064
-
1065
- function ProductDetailsSettings_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ProductDetailsSettings_ownKeys(Object(source), !0).forEach(function (key) { ProductDetailsSettings_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ProductDetailsSettings_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1066
-
1067
- function ProductDetailsSettings_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; }
1068
-
1069
-
1070
-
1071
-
1072
-
1073
-
1074
-
1075
-
1076
-
1077
-
1078
-
1079
- function ProductDetailsSettings({
1080
- product,
1081
- buyButtonTitle,
1082
- isValidating,
1083
- quantity,
1084
- setQuantity,
1085
- buyButtonIcon: {
1086
- icon: buyButtonIconName = Overrides_Icon.props.name,
1087
- alt: buyButtonIconAlt = Overrides_Icon.props["aria-label"]
1088
- },
1089
- notAvailableButtonTitle
1090
- }) {
1091
- const {
1092
- id,
1093
- sku,
1094
- gtin,
1095
- name: variantName,
1096
- brand,
1097
- isVariantOf,
1098
- isVariantOf: {
1099
- skuVariants
1100
- },
1101
- image: productImages,
1102
- additionalProperty,
1103
- offers: {
1104
- lowPrice,
1105
- offers: [{
1106
- availability,
1107
- price,
1108
- listPrice,
1109
- seller
1110
- }]
1111
- }
1112
- } = product;
1113
- const buyProps = useBuyButton({
1114
- id,
1115
- price,
1116
- listPrice,
1117
- seller,
1118
- quantity,
1119
- itemOffered: {
1120
- sku,
1121
- name: variantName,
1122
- gtin,
1123
- image: productImages,
1124
- brand,
1125
- isVariantOf,
1126
- additionalProperty
1127
- }
1128
- });
1129
- const outOfStock = (0,external_react_.useMemo)(() => availability === 'https://schema.org/OutOfStock', [availability]);
1130
- const shouldShowDiscountedPrice = (0,external_react_.useMemo)(() => lowPrice !== listPrice, [lowPrice, listPrice]);
1131
-
1132
- const AddToCartButton = () => {
1133
- return outOfStock ?
1134
- /*#__PURE__*/
1135
- // TODO: Adds <OutOfStock /> when component is ready to use
1136
- jsx_runtime_.jsx(__experimentalNotAvailableButton.Component, {
1137
- children: notAvailableButtonTitle
1138
- }) : /*#__PURE__*/jsx_runtime_.jsx(Overrides_BuyButton.Component, ProductDetailsSettings_objectSpread(ProductDetailsSettings_objectSpread(ProductDetailsSettings_objectSpread({}, Overrides_BuyButton.props), {}, {
1139
- icon: /*#__PURE__*/jsx_runtime_.jsx(Overrides_Icon.Component, ProductDetailsSettings_objectSpread(ProductDetailsSettings_objectSpread({}, Overrides_Icon.props), {}, {
1140
- name: buyButtonIconName,
1141
- "aria-label": buyButtonIconAlt
1142
- }))
1143
- }, buyProps), {}, {
1144
- children: buyButtonTitle || 'Add to Cart'
1145
- }));
1146
- };
1147
-
1148
- return /*#__PURE__*/(0,jsx_runtime_.jsxs)(jsx_runtime_.Fragment, {
1149
- children: [!outOfStock && /*#__PURE__*/(0,jsx_runtime_.jsxs)("section", {
1150
- "data-fs-product-details-values": true,
1151
- children: [/*#__PURE__*/jsx_runtime_.jsx("div", {
1152
- "data-fs-product-details-prices": true,
1153
- children: shouldShowDiscountedPrice ? /*#__PURE__*/(0,jsx_runtime_.jsxs)(jsx_runtime_.Fragment, {
1154
- children: [/*#__PURE__*/jsx_runtime_.jsx(Overrides_Price.Component, ProductDetailsSettings_objectSpread(ProductDetailsSettings_objectSpread({
1155
- formatter: useFormattedPrice/* useFormattedPrice */.P,
1156
- testId: "list-price",
1157
- variant: "listing",
1158
- SRText: "Original price:"
1159
- }, Overrides_Price.props), {}, {
1160
- // Dynamic props shouldn't be overridable
1161
- // This decision can be reviewed later if needed
1162
- value: listPrice,
1163
- "data-value": listPrice
1164
- })), /*#__PURE__*/jsx_runtime_.jsx(Overrides_Price.Component, ProductDetailsSettings_objectSpread(ProductDetailsSettings_objectSpread({
1165
- formatter: useFormattedPrice/* useFormattedPrice */.P,
1166
- testId: "price",
1167
- variant: "spot",
1168
- className: "text__lead",
1169
- SRText: "Sale Price:"
1170
- }, Overrides_Price.props), {}, {
1171
- // Dynamic props shouldn't be overridable
1172
- // This decision can be reviewed later if needed
1173
- value: lowPrice,
1174
- "data-value": lowPrice
1175
- }))]
1176
- }) : /*#__PURE__*/jsx_runtime_.jsx(Overrides_Price.Component, ProductDetailsSettings_objectSpread(ProductDetailsSettings_objectSpread({
1177
- formatter: useFormattedPrice/* useFormattedPrice */.P,
1178
- testId: "list-price",
1179
- variant: "spot",
1180
- className: "text__lead",
1181
- SRText: "Original price:"
1182
- }, Overrides_Price.props), {}, {
1183
- // Dynamic props shouldn't be overridable
1184
- // This decision can be reviewed later if needed
1185
- value: lowPrice,
1186
- "data-value": lowPrice
1187
- }))
1188
- }), /*#__PURE__*/jsx_runtime_.jsx(Overrides_QuantitySelector.Component, ProductDetailsSettings_objectSpread(ProductDetailsSettings_objectSpread({
1189
- min: 1,
1190
- max: 10
1191
- }, Overrides_QuantitySelector.props), {}, {
1192
- // Dynamic props shouldn't be overridable
1193
- // This decision can be reviewed later if needed
1194
- onChange: setQuantity
1195
- }))]
1196
- }), skuVariants && /*#__PURE__*/jsx_runtime_.jsx(SkuSelector_Selectors, {
1197
- slugsMap: skuVariants.slugsMap,
1198
- availableVariations: skuVariants.availableVariations,
1199
- activeVariations: skuVariants.activeVariations,
1200
- "data-fs-product-details-selectors": true
1201
- }), isValidating ?
1202
- /*#__PURE__*/
1203
-
1204
- /* NOTE:
1205
- A loading skeleton had to be used to avoid a Lighthouse's
1206
- non-composited animation violation due to the button transitioning its
1207
- background color when changing from its initial disabled to active state.
1208
- See full explanation on commit https://git.io/JyXV5. */
1209
- jsx_runtime_.jsx(AddToCartLoadingSkeleton, {}) : /*#__PURE__*/jsx_runtime_.jsx(AddToCartButton, {})]
1210
- });
1211
- }
1212
-
1213
- /* harmony default export */ const ProductDetails_ProductDetailsSettings = (ProductDetailsSettings);
1214
- // EXTERNAL MODULE: ./src/components/sections/ProductDetails/section.module.scss
1215
- var section_module = __webpack_require__(9034);
1216
- var section_module_default = /*#__PURE__*/__webpack_require__.n(section_module);
1217
- // EXTERNAL MODULE: ./src/sdk/overrides/PageProvider.tsx
1218
- var PageProvider = __webpack_require__(5953);
1219
- ;// CONCATENATED MODULE: ./src/components/sections/ProductDetails/ProductDetails.tsx
1220
- function ProductDetails_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; }
1221
-
1222
- function ProductDetails_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ProductDetails_ownKeys(Object(source), !0).forEach(function (key) { ProductDetails_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ProductDetails_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1223
-
1224
- function ProductDetails_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; }
1225
-
1226
-
1227
-
1228
-
1229
-
1230
-
1231
-
1232
-
1233
-
1234
-
1235
-
1236
-
1237
-
1238
-
1239
- function ProductDetails({
1240
- productTitle: {
1241
- refNumber: showRefNumber,
1242
- discountBadge: {
1243
- showDiscountBadge,
1244
- size: discountBadgeSize = Overrides_DiscountBadge.props.size
1245
- }
1246
- },
1247
- buyButton: {
1248
- icon: buyButtonIcon,
1249
- title: buyButtonTitle
1250
- },
1251
- shippingSimulator: {
1252
- title: shippingSimulatorTitle = __experimentalShippingSimulation.props.title,
1253
- inputLabel: shippingSimulatorInputLabel = __experimentalShippingSimulation.props.inputLabel,
1254
- shippingOptionsTableTitle: shippingSimulatorOptionsTableTitle = __experimentalShippingSimulation.props.optionsLabel,
1255
- link: {
1256
- to: shippingSimulatorLinkUrl = __experimentalShippingSimulation.props.idkPostalCodeLinkProps?.href,
1257
- text: shippingSimulatorLinkText = __experimentalShippingSimulation.props.idkPostalCodeLinkProps?.children
1258
- }
1259
- },
1260
- productDescription: {
1261
- title: productDescriptionDetailsTitle,
1262
- initiallyExpanded: productDescriptionInitiallyExpanded,
1263
- displayDescription: shouldDisplayProductDescription
1264
- },
1265
- notAvailableButton: {
1266
- title: notAvailableButtonTitle = __experimentalNotAvailableButton.props.title
1267
- }
1268
- }) {
1269
- const {
1270
- currency
1271
- } = (0,session/* useSession */.kP)();
1272
- const {
1273
- 0: quantity,
1274
- 1: setQuantity
1275
- } = (0,external_react_.useState)(1);
1276
- const context = (0,PageProvider/* usePDP */.al)();
1277
- const {
1278
- product,
1279
- isValidating
1280
- } = context?.data;
1281
-
1282
- if (!product) {
1283
- throw new Error('NotFound');
1284
- }
1285
-
1286
- const {
1287
- id,
1288
- sku,
1289
- gtin,
1290
- name: variantName,
1291
- brand,
1292
- isVariantOf,
1293
- description,
1294
- isVariantOf: {
1295
- name,
1296
- productGroupID: productId
1297
- },
1298
- image: productImages,
1299
- offers: {
1300
- offers: [{
1301
- availability,
1302
- price,
1303
- listPrice,
1304
- seller
1305
- }],
1306
- lowPrice
1307
- }
1308
- } = product;
1309
- (0,external_react_.useEffect)(() => {
1310
- (0,sendAnalyticsEvent/* sendAnalyticsEvent */._)({
1311
- name: 'view_item',
1312
- params: {
1313
- currency: currency.code,
1314
- value: price,
1315
- items: [{
1316
- item_id: isVariantOf.productGroupID,
1317
- item_name: isVariantOf.name,
1318
- item_brand: brand.name,
1319
- item_variant: sku,
1320
- price,
1321
- discount: listPrice - price,
1322
- currency: currency.code,
1323
- item_variant_name: variantName,
1324
- product_reference_id: gtin
1325
- }]
1326
- }
1327
- });
1328
- }, [isVariantOf.productGroupID, isVariantOf.name, brand.name, sku, price, listPrice, currency.code, variantName, gtin]);
1329
- const outOfStock = (0,external_react_.useMemo)(() => availability === 'https://schema.org/OutOfStock', [availability]);
1330
- return /*#__PURE__*/jsx_runtime_.jsx(Section/* default */.Z, {
1331
- className: `${(section_module_default()).section} section-product-details`,
1332
- children: /*#__PURE__*/jsx_runtime_.jsx("section", {
1333
- "data-fs-product-details": true,
1334
- children: /*#__PURE__*/(0,jsx_runtime_.jsxs)("section", {
1335
- "data-fs-product-details-body": true,
1336
- "data-fs-content": "product-details",
1337
- children: [/*#__PURE__*/jsx_runtime_.jsx("header", {
1338
- "data-fs-product-details-title": true,
1339
- "data-fs-product-details-section": true,
1340
- children: /*#__PURE__*/jsx_runtime_.jsx(Overrides_ProductTitle.Component, ProductDetails_objectSpread(ProductDetails_objectSpread({
1341
- // TODO: We should review this prop. There's now way to override the title and use the dynamic name value.
1342
- // Maybe passing a ProductTitleHeader component as a prop would be better, as it would be overridable.
1343
- // Maybe now it's worth to make title always a h1 and receive only the name, as it would be easier for users to override.
1344
- title: /*#__PURE__*/jsx_runtime_.jsx("h1", {
1345
- children: name
1346
- })
1347
- }, Overrides_ProductTitle.props), {}, {
1348
- label: showDiscountBadge && /*#__PURE__*/jsx_runtime_.jsx(Overrides_DiscountBadge.Component, ProductDetails_objectSpread(ProductDetails_objectSpread({}, Overrides_DiscountBadge.props), {}, {
1349
- size: discountBadgeSize // Dynamic props shouldn't be overridable
1350
- // This decision can be reviewed later if needed
1351
- ,
1352
- listPrice: listPrice,
1353
- spotPrice: lowPrice
1354
- })),
1355
- refNumber: showRefNumber && productId
1356
- }))
1357
- }), /*#__PURE__*/jsx_runtime_.jsx(__experimentalImageGallery.Component, ProductDetails_objectSpread(ProductDetails_objectSpread({
1358
- "data-fs-product-details-gallery": true
1359
- }, __experimentalImageGallery.props), {}, {
1360
- images: productImages
1361
- })), /*#__PURE__*/(0,jsx_runtime_.jsxs)("section", {
1362
- "data-fs-product-details-info": true,
1363
- children: [/*#__PURE__*/jsx_runtime_.jsx("section", {
1364
- "data-fs-product-details-settings": true,
1365
- "data-fs-product-details-section": true,
1366
- children: /*#__PURE__*/jsx_runtime_.jsx(ProductDetails_ProductDetailsSettings, {
1367
- product: product,
1368
- isValidating: isValidating,
1369
- buyButtonTitle: buyButtonTitle,
1370
- quantity: quantity,
1371
- setQuantity: setQuantity,
1372
- buyButtonIcon: buyButtonIcon,
1373
- notAvailableButtonTitle: notAvailableButtonTitle
1374
- })
1375
- }), !outOfStock && /*#__PURE__*/jsx_runtime_.jsx(__experimentalShippingSimulation.Component, ProductDetails_objectSpread(ProductDetails_objectSpread({
1376
- "data-fs-product-details-section": true,
1377
- "data-fs-product-details-shipping": true,
1378
- formatter: useFormattedPrice/* useFormattedPrice */.P
1379
- }, __experimentalShippingSimulation.props), {}, {
1380
- idkPostalCodeLinkProps: ProductDetails_objectSpread(ProductDetails_objectSpread({}, __experimentalShippingSimulation.props.idkPostalCodeLinkProps), {}, {
1381
- href: shippingSimulatorLinkUrl,
1382
- children: shippingSimulatorLinkText
1383
- }),
1384
- productShippingInfo: {
1385
- id,
1386
- quantity,
1387
- seller: seller.identifier
1388
- },
1389
- title: shippingSimulatorTitle,
1390
- inputLabel: shippingSimulatorInputLabel,
1391
- optionsLabel: shippingSimulatorOptionsTableTitle
1392
- }))]
1393
- }), shouldDisplayProductDescription && /*#__PURE__*/jsx_runtime_.jsx(ProductDescription_ProductDescription, {
1394
- initiallyExpanded: productDescriptionInitiallyExpanded,
1395
- descriptionData: [{
1396
- title: productDescriptionDetailsTitle,
1397
- content: description
1398
- }]
1399
- })]
1400
- })
1401
- })
1402
- });
1403
- }
1404
-
1405
- const fragment = "unknown";
1406
- /* harmony default export */ const ProductDetails_ProductDetails = (ProductDetails);
1407
-
1408
- /***/ }),
1409
-
1410
- /***/ 5779:
1411
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
1412
-
1413
- "use strict";
1414
- __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
1415
- __webpack_require__.r(__webpack_exports__);
1416
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1417
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
1418
- /* harmony export */ "getStaticPaths": () => (/* binding */ getStaticPaths),
1419
- /* harmony export */ "getStaticProps": () => (/* binding */ getStaticProps)
1420
- /* harmony export */ });
1421
- /* harmony import */ var _faststore_api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4826);
1422
- /* harmony import */ var next_seo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6641);
1423
- /* harmony import */ var next_seo__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_seo__WEBPACK_IMPORTED_MODULE_1__);
1424
- /* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6330);
1425
- /* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(deepmerge__WEBPACK_IMPORTED_MODULE_2__);
1426
- /* harmony import */ var src_components_cms_RenderSections__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(2224);
1427
- /* harmony import */ var src_components_sections_BannerNewsletter_BannerNewsletter__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2951);
1428
- /* harmony import */ var src_components_sections_BannerText__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(7599);
1429
- /* harmony import */ var src_components_sections_Breadcrumb__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2390);
1430
- /* harmony import */ var src_components_sections_CrossSellingShelf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(994);
1431
- /* harmony import */ var src_components_sections_ProductDetails__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2694);
1432
- /* harmony import */ var src_customizations_src_components__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(3276);
1433
- /* harmony import */ var src_sdk_session__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(7295);
1434
- /* harmony import */ var src_sdk_tests_mark__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(2541);
1435
- /* harmony import */ var src_server__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(9685);
1436
- /* harmony import */ var src_server_cms__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(9497);
1437
- /* harmony import */ var src_components_cms_GlobalSections__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(4074);
1438
- /* harmony import */ var _faststore_config__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(7183);
1439
- /* harmony import */ var _faststore_config__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(_faststore_config__WEBPACK_IMPORTED_MODULE_17__);
1440
- /* harmony import */ var src_sdk_product_useProductQuery__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(7853);
1441
- /* harmony import */ var src_sdk_overrides_PageProvider__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(5953);
1442
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(997);
1443
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
1444
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([src_components_sections_CrossSellingShelf__WEBPACK_IMPORTED_MODULE_6__, src_components_sections_BannerNewsletter_BannerNewsletter__WEBPACK_IMPORTED_MODULE_7__, src_sdk_product_useProductQuery__WEBPACK_IMPORTED_MODULE_11__, src_components_cms_GlobalSections__WEBPACK_IMPORTED_MODULE_12__, src_components_cms_RenderSections__WEBPACK_IMPORTED_MODULE_14__, src_server__WEBPACK_IMPORTED_MODULE_15__]);
1445
- ([src_components_sections_CrossSellingShelf__WEBPACK_IMPORTED_MODULE_6__, src_components_sections_BannerNewsletter_BannerNewsletter__WEBPACK_IMPORTED_MODULE_7__, src_sdk_product_useProductQuery__WEBPACK_IMPORTED_MODULE_11__, src_components_cms_GlobalSections__WEBPACK_IMPORTED_MODULE_12__, src_components_cms_RenderSections__WEBPACK_IMPORTED_MODULE_14__, src_server__WEBPACK_IMPORTED_MODULE_15__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
1446
- const _excluded = ["listPrice"];
1447
-
1448
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
1449
-
1450
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
1451
-
1452
- 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; }
1453
-
1454
- 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; }
1455
-
1456
- 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; }
1457
-
1458
-
1459
-
1460
-
1461
-
1462
-
1463
-
1464
-
1465
-
1466
-
1467
-
1468
-
1469
-
1470
-
1471
-
1472
-
1473
-
1474
-
1475
-
1476
- /**
1477
- * Sections: Components imported from each store's custom components and '../components/sections' only.
1478
- * Do not import or render components from any other folder in here.
1479
- */
1480
-
1481
-
1482
-
1483
-
1484
- const COMPONENTS = _objectSpread({
1485
- Breadcrumb: src_components_sections_Breadcrumb__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z,
1486
- ProductDetails: src_components_sections_ProductDetails__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z,
1487
- CrossSellingShelf: src_components_sections_CrossSellingShelf__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z,
1488
- BannerNewsletter: src_components_sections_BannerNewsletter_BannerNewsletter__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z,
1489
- BannerText: src_components_sections_BannerText__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z
1490
- }, src_customizations_src_components__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z);
1491
-
1492
- // Array merging strategy from deepmerge that makes client arrays overwrite server array
1493
- // https://www.npmjs.com/package/deepmerge
1494
- const overwriteMerge = (_, sourceArray) => sourceArray;
1495
-
1496
- function Page({
1497
- data: server,
1498
- sections,
1499
- globalSections,
1500
- offers,
1501
- meta
1502
- }) {
1503
- const {
1504
- product
1505
- } = server;
1506
- const {
1507
- currency
1508
- } = (0,src_sdk_session__WEBPACK_IMPORTED_MODULE_10__/* .useSession */ .kP)(); // Stale while revalidate the product for fetching the new price etc
1509
-
1510
- const {
1511
- data: client,
1512
- isValidating
1513
- } = (0,src_sdk_product_useProductQuery__WEBPACK_IMPORTED_MODULE_11__/* .useProductQuery */ .F)(product.id, {
1514
- product: product
1515
- });
1516
- const context = {
1517
- data: _objectSpread(_objectSpread({}, deepmerge__WEBPACK_IMPORTED_MODULE_2___default()(server, client, {
1518
- arrayMerge: overwriteMerge
1519
- })), {}, {
1520
- isValidating
1521
- })
1522
- };
1523
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(src_components_cms_GlobalSections__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .ZP, _objectSpread(_objectSpread({}, globalSections), {}, {
1524
- children: [/*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx(next_seo__WEBPACK_IMPORTED_MODULE_1__.NextSeo, {
1525
- title: meta.title,
1526
- description: meta.description,
1527
- canonical: meta.canonical,
1528
- openGraph: {
1529
- type: 'og:product',
1530
- url: meta.canonical,
1531
- title: meta.title,
1532
- description: meta.description,
1533
- images: product.image.map(img => ({
1534
- url: img.url,
1535
- alt: img.alternateName
1536
- }))
1537
- },
1538
- additionalMetaTags: [{
1539
- property: 'product:price:amount',
1540
- content: product.offers.lowPrice?.toString() ?? undefined
1541
- }, {
1542
- property: 'product:price:currency',
1543
- content: currency.code
1544
- }]
1545
- }), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx(next_seo__WEBPACK_IMPORTED_MODULE_1__.BreadcrumbJsonLd, {
1546
- itemListElements: product.breadcrumbList.itemListElement
1547
- }), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx(next_seo__WEBPACK_IMPORTED_MODULE_1__.ProductJsonLd, {
1548
- productName: product.name,
1549
- description: product.description,
1550
- brand: product.brand.name,
1551
- sku: product.sku,
1552
- gtin: product.gtin,
1553
- releaseDate: product.releaseDate,
1554
- images: product.image.map(img => img.url) // Somehow, Google does not understand this valid Schema.org schema, so we need to do conversions
1555
- ,
1556
- offers: offers
1557
- }), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx(src_sdk_overrides_PageProvider__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .ZP, {
1558
- context: context,
1559
- children: /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx(src_components_cms_RenderSections__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z, {
1560
- sections: sections,
1561
- components: COMPONENTS
1562
- })
1563
- })]
1564
- }));
1565
- }
1566
-
1567
- const query = "ServerProductQuery";
1568
- const getStaticProps = async ({
1569
- params,
1570
- previewData
1571
- }) => {
1572
- const slug = params?.slug ?? '';
1573
- const [searchResult, cmsPage, globalSections] = await Promise.all([(0,src_server__WEBPACK_IMPORTED_MODULE_15__/* .execute */ .h)({
1574
- variables: {
1575
- locator: [{
1576
- key: 'slug',
1577
- value: slug
1578
- }]
1579
- },
1580
- operationName: query
1581
- }), (0,src_server_cms__WEBPACK_IMPORTED_MODULE_16__/* .getPage */ .f)(_objectSpread(_objectSpread({}, previewData?.contentType === 'pdp' ? previewData : null), {}, {
1582
- contentType: 'pdp'
1583
- })), (0,src_components_cms_GlobalSections__WEBPACK_IMPORTED_MODULE_12__/* .getGlobalSectionsData */ .Tc)(previewData)]);
1584
- const {
1585
- data,
1586
- errors = []
1587
- } = searchResult;
1588
- const notFound = errors.find(_faststore_api__WEBPACK_IMPORTED_MODULE_0__.isNotFoundError);
1589
-
1590
- if (notFound) {
1591
- return {
1592
- notFound: true
1593
- };
1594
- }
1595
-
1596
- if (errors.length > 0) {
1597
- throw errors[0];
1598
- }
1599
-
1600
- const {
1601
- seo
1602
- } = data.product;
1603
- const title = seo.title || (_faststore_config__WEBPACK_IMPORTED_MODULE_17___default().seo.title);
1604
- const description = seo.description || (_faststore_config__WEBPACK_IMPORTED_MODULE_17___default().seo.description);
1605
- const canonical = `${(_faststore_config__WEBPACK_IMPORTED_MODULE_17___default().storeUrl)}${seo.canonical}`;
1606
- const meta = {
1607
- title,
1608
- description,
1609
- canonical
1610
- };
1611
- let offer = {};
1612
-
1613
- if (data.product.offers.offers.length > 0) {
1614
- const _data$product$offers$ = data.product.offers.offers[0],
1615
- {
1616
- listPrice
1617
- } = _data$product$offers$,
1618
- offerData = _objectWithoutProperties(_data$product$offers$, _excluded);
1619
-
1620
- offer = offerData;
1621
- }
1622
-
1623
- const offers = _objectSpread(_objectSpread({}, offer), {}, {
1624
- priceCurrency: data.product.offers.priceCurrency,
1625
- url: canonical
1626
- });
1627
-
1628
- return {
1629
- props: _objectSpread(_objectSpread({
1630
- data
1631
- }, cmsPage), {}, {
1632
- meta,
1633
- offers,
1634
- globalSections,
1635
- key: seo.canonical
1636
- })
1637
- };
1638
- };
1639
- const getStaticPaths = async () => {
1640
- return {
1641
- paths: [],
1642
- fallback: 'blocking'
1643
- };
1644
- };
1645
- Page.displayName = 'Page';
1646
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,src_sdk_tests_mark__WEBPACK_IMPORTED_MODULE_18__/* .mark */ .B)(Page));
1647
- __webpack_async_result__();
1648
- } catch(e) { __webpack_async_result__(e); } });
1649
-
1650
- /***/ }),
1651
-
1652
- /***/ 7853:
1653
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
1654
-
1655
- "use strict";
1656
- __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
1657
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1658
- /* harmony export */ "F": () => (/* binding */ useProductQuery)
1659
- /* harmony export */ });
1660
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
1661
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1662
- /* harmony import */ var _graphql_useQuery__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7732);
1663
- /* harmony import */ var _session__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7295);
1664
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_graphql_useQuery__WEBPACK_IMPORTED_MODULE_2__]);
1665
- _graphql_useQuery__WEBPACK_IMPORTED_MODULE_2__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
1666
-
1667
-
1668
-
1669
- const query = "ClientProductQuery";
1670
- const useProductQuery = (productID, fallbackData) => {
1671
- const {
1672
- channel,
1673
- locale
1674
- } = (0,_session__WEBPACK_IMPORTED_MODULE_1__/* .useSession */ .kP)();
1675
- const variables = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
1676
- if (!channel) {
1677
- throw new Error(`useProductQuery: 'channel' from session is an empty string.`);
1678
- }
1679
-
1680
- return {
1681
- locator: [{
1682
- key: 'id',
1683
- value: productID
1684
- }, {
1685
- key: 'channel',
1686
- value: channel
1687
- }, {
1688
- key: 'locale',
1689
- value: locale
1690
- }]
1691
- };
1692
- }, [channel, locale, productID]);
1693
- return (0,_graphql_useQuery__WEBPACK_IMPORTED_MODULE_2__/* .useQuery */ .aM)(query, variables, {
1694
- fallbackData,
1695
- revalidateOnMount: true
1696
- });
1697
- };
1698
- __webpack_async_result__();
1699
- } catch(e) { __webpack_async_result__(e); } });
1700
-
1701
- /***/ }),
1702
-
1703
- /***/ 5411:
1704
- /***/ ((module) => {
1705
-
1706
- // Exports
1707
- module.exports = {
1708
- "section": "section_section__pVnFl"
1709
- };
1710
-
1711
-
1712
- /***/ }),
1713
-
1714
- /***/ 9034:
1715
- /***/ ((module) => {
1716
-
1717
- // Exports
1718
- module.exports = {
1719
- "section": "section_section__XsOoR"
1720
- };
1721
-
1722
-
1723
- /***/ }),
1724
-
1725
- /***/ 1718:
1726
- /***/ ((module) => {
1727
-
1728
- "use strict";
1729
- module.exports = require("@graphql-tools/utils");
1730
-
1731
- /***/ }),
1732
-
1733
- /***/ 4691:
1734
- /***/ ((module) => {
1735
-
1736
- "use strict";
1737
- module.exports = require("@opentelemetry/api");
1738
-
1739
- /***/ }),
1740
-
1741
- /***/ 8973:
1742
- /***/ ((module) => {
1743
-
1744
- "use strict";
1745
- module.exports = require("@opentelemetry/api-logs");
1746
-
1747
- /***/ }),
1748
-
1749
- /***/ 6969:
1750
- /***/ ((module) => {
1751
-
1752
- "use strict";
1753
- module.exports = require("@opentelemetry/exporter-logs-otlp-grpc");
1754
-
1755
- /***/ }),
1756
-
1757
- /***/ 5196:
1758
- /***/ ((module) => {
1759
-
1760
- "use strict";
1761
- module.exports = require("@opentelemetry/exporter-trace-otlp-grpc");
1762
-
1763
- /***/ }),
1764
-
1765
- /***/ 4161:
1766
- /***/ ((module) => {
1767
-
1768
- "use strict";
1769
- module.exports = require("@opentelemetry/resources");
1770
-
1771
- /***/ }),
1772
-
1773
- /***/ 2793:
1774
- /***/ ((module) => {
1775
-
1776
- "use strict";
1777
- module.exports = require("@opentelemetry/sdk-logs");
1778
-
1779
- /***/ }),
1780
-
1781
- /***/ 1283:
1782
- /***/ ((module) => {
1783
-
1784
- "use strict";
1785
- module.exports = require("@opentelemetry/sdk-trace-base");
1786
-
1787
- /***/ }),
1788
-
1789
- /***/ 6676:
1790
- /***/ ((module) => {
1791
-
1792
- "use strict";
1793
- module.exports = require("@vtex/client-cms");
1794
-
1795
- /***/ }),
1796
-
1797
- /***/ 6330:
1798
- /***/ ((module) => {
1799
-
1800
- "use strict";
1801
- module.exports = require("deepmerge");
1802
-
1803
- /***/ }),
1804
-
1805
- /***/ 8641:
1806
- /***/ ((module) => {
1807
-
1808
- "use strict";
1809
- module.exports = require("draftjs-to-html");
1810
-
1811
- /***/ }),
1812
-
1813
- /***/ 2404:
1814
- /***/ ((module) => {
1815
-
1816
- "use strict";
1817
- module.exports = require("fast-deep-equal");
1818
-
1819
- /***/ }),
1820
-
1821
- /***/ 7343:
1822
- /***/ ((module) => {
1823
-
1824
- "use strict";
1825
- module.exports = require("graphql");
1826
-
1827
- /***/ }),
1828
-
1829
- /***/ 6548:
1830
- /***/ ((module) => {
1831
-
1832
- "use strict";
1833
- module.exports = require("graphql/language");
1834
-
1835
- /***/ }),
1836
-
1837
- /***/ 3430:
1838
- /***/ ((module) => {
1839
-
1840
- "use strict";
1841
- module.exports = require("idb-keyval");
1842
-
1843
- /***/ }),
1844
-
1845
- /***/ 7881:
1846
- /***/ ((module) => {
1847
-
1848
- "use strict";
1849
- module.exports = require("isomorphic-unfetch");
1850
-
1851
- /***/ }),
1852
-
1853
- /***/ 6641:
1854
- /***/ ((module) => {
1855
-
1856
- "use strict";
1857
- module.exports = require("next-seo");
1858
-
1859
- /***/ }),
1860
-
1861
- /***/ 3280:
1862
- /***/ ((module) => {
1863
-
1864
- "use strict";
1865
- module.exports = require("next/dist/shared/lib/app-router-context.js");
1866
-
1867
- /***/ }),
1868
-
1869
- /***/ 2796:
1870
- /***/ ((module) => {
1871
-
1872
- "use strict";
1873
- module.exports = require("next/dist/shared/lib/head-manager-context.js");
1874
-
1875
- /***/ }),
1876
-
1877
- /***/ 4957:
1878
- /***/ ((module) => {
1879
-
1880
- "use strict";
1881
- module.exports = require("next/dist/shared/lib/head.js");
1882
-
1883
- /***/ }),
1884
-
1885
- /***/ 3539:
1886
- /***/ ((module) => {
1887
-
1888
- "use strict";
1889
- module.exports = require("next/dist/shared/lib/i18n/detect-domain-locale.js");
1890
-
1891
- /***/ }),
1892
-
1893
- /***/ 4014:
1894
- /***/ ((module) => {
1895
-
1896
- "use strict";
1897
- module.exports = require("next/dist/shared/lib/i18n/normalize-locale-path.js");
1898
-
1899
- /***/ }),
1900
-
1901
- /***/ 4486:
1902
- /***/ ((module) => {
1903
-
1904
- "use strict";
1905
- module.exports = require("next/dist/shared/lib/image-blur-svg.js");
1906
-
1907
- /***/ }),
1908
-
1909
- /***/ 744:
1910
- /***/ ((module) => {
1911
-
1912
- "use strict";
1913
- module.exports = require("next/dist/shared/lib/image-config-context.js");
1914
-
1915
- /***/ }),
1916
-
1917
- /***/ 5843:
1918
- /***/ ((module) => {
1919
-
1920
- "use strict";
1921
- module.exports = require("next/dist/shared/lib/image-config.js");
1922
-
1923
- /***/ }),
1924
-
1925
- /***/ 8524:
1926
- /***/ ((module) => {
1927
-
1928
- "use strict";
1929
- module.exports = require("next/dist/shared/lib/is-plain-object.js");
1930
-
1931
- /***/ }),
1932
-
1933
- /***/ 8020:
1934
- /***/ ((module) => {
1935
-
1936
- "use strict";
1937
- module.exports = require("next/dist/shared/lib/mitt.js");
1938
-
1939
- /***/ }),
1940
-
1941
- /***/ 4406:
1942
- /***/ ((module) => {
1943
-
1944
- "use strict";
1945
- module.exports = require("next/dist/shared/lib/page-path/denormalize-page-path.js");
1946
-
1947
- /***/ }),
1948
-
1949
- /***/ 4964:
1950
- /***/ ((module) => {
1951
-
1952
- "use strict";
1953
- module.exports = require("next/dist/shared/lib/router-context.js");
1954
-
1955
- /***/ }),
1956
-
1957
- /***/ 3431:
1958
- /***/ ((module) => {
1959
-
1960
- "use strict";
1961
- module.exports = require("next/dist/shared/lib/router/utils/add-locale.js");
1962
-
1963
- /***/ }),
1964
-
1965
- /***/ 1751:
1966
- /***/ ((module) => {
1967
-
1968
- "use strict";
1969
- module.exports = require("next/dist/shared/lib/router/utils/add-path-prefix.js");
1970
-
1971
- /***/ }),
1972
-
1973
- /***/ 6220:
1974
- /***/ ((module) => {
1975
-
1976
- "use strict";
1977
- module.exports = require("next/dist/shared/lib/router/utils/compare-states.js");
1978
-
1979
- /***/ }),
1980
-
1981
- /***/ 299:
1982
- /***/ ((module) => {
1983
-
1984
- "use strict";
1985
- module.exports = require("next/dist/shared/lib/router/utils/format-next-pathname-info.js");
1986
-
1987
- /***/ }),
1988
-
1989
- /***/ 3938:
1990
- /***/ ((module) => {
1991
-
1992
- "use strict";
1993
- module.exports = require("next/dist/shared/lib/router/utils/format-url.js");
1994
-
1995
- /***/ }),
1996
-
1997
- /***/ 9565:
1998
- /***/ ((module) => {
1999
-
2000
- "use strict";
2001
- module.exports = require("next/dist/shared/lib/router/utils/get-asset-path-from-route.js");
2002
-
2003
- /***/ }),
2004
-
2005
- /***/ 5789:
2006
- /***/ ((module) => {
2007
-
2008
- "use strict";
2009
- module.exports = require("next/dist/shared/lib/router/utils/get-next-pathname-info.js");
2010
-
2011
- /***/ }),
2012
-
2013
- /***/ 1897:
2014
- /***/ ((module) => {
2015
-
2016
- "use strict";
2017
- module.exports = require("next/dist/shared/lib/router/utils/is-bot.js");
2018
-
2019
- /***/ }),
2020
-
2021
- /***/ 1428:
2022
- /***/ ((module) => {
2023
-
2024
- "use strict";
2025
- module.exports = require("next/dist/shared/lib/router/utils/is-dynamic.js");
2026
-
2027
- /***/ }),
2028
-
2029
- /***/ 8854:
2030
- /***/ ((module) => {
2031
-
2032
- "use strict";
2033
- module.exports = require("next/dist/shared/lib/router/utils/parse-path.js");
2034
-
2035
- /***/ }),
2036
-
2037
- /***/ 1292:
2038
- /***/ ((module) => {
2039
-
2040
- "use strict";
2041
- module.exports = require("next/dist/shared/lib/router/utils/parse-relative-url.js");
2042
-
2043
- /***/ }),
2044
-
2045
- /***/ 4567:
2046
- /***/ ((module) => {
2047
-
2048
- "use strict";
2049
- module.exports = require("next/dist/shared/lib/router/utils/path-has-prefix.js");
2050
-
2051
- /***/ }),
2052
-
2053
- /***/ 979:
2054
- /***/ ((module) => {
2055
-
2056
- "use strict";
2057
- module.exports = require("next/dist/shared/lib/router/utils/querystring.js");
2058
-
2059
- /***/ }),
2060
-
2061
- /***/ 3297:
2062
- /***/ ((module) => {
2063
-
2064
- "use strict";
2065
- module.exports = require("next/dist/shared/lib/router/utils/remove-trailing-slash.js");
2066
-
2067
- /***/ }),
2068
-
2069
- /***/ 6052:
2070
- /***/ ((module) => {
2071
-
2072
- "use strict";
2073
- module.exports = require("next/dist/shared/lib/router/utils/resolve-rewrites.js");
2074
-
2075
- /***/ }),
2076
-
2077
- /***/ 4226:
2078
- /***/ ((module) => {
2079
-
2080
- "use strict";
2081
- module.exports = require("next/dist/shared/lib/router/utils/route-matcher.js");
2082
-
2083
- /***/ }),
2084
-
2085
- /***/ 5052:
2086
- /***/ ((module) => {
2087
-
2088
- "use strict";
2089
- module.exports = require("next/dist/shared/lib/router/utils/route-regex.js");
2090
-
2091
- /***/ }),
2092
-
2093
- /***/ 9232:
2094
- /***/ ((module) => {
2095
-
2096
- "use strict";
2097
- module.exports = require("next/dist/shared/lib/utils.js");
2098
-
2099
- /***/ }),
2100
-
2101
- /***/ 1853:
2102
- /***/ ((module) => {
2103
-
2104
- "use strict";
2105
- module.exports = require("next/router");
2106
-
2107
- /***/ }),
2108
-
2109
- /***/ 5471:
2110
- /***/ ((module) => {
2111
-
2112
- "use strict";
2113
- module.exports = require("p-limit");
2114
-
2115
- /***/ }),
2116
-
2117
- /***/ 1423:
2118
- /***/ ((module) => {
2119
-
2120
- "use strict";
2121
- module.exports = require("path");
2122
-
2123
- /***/ }),
2124
-
2125
- /***/ 6689:
2126
- /***/ ((module) => {
2127
-
2128
- "use strict";
2129
- module.exports = require("react");
2130
-
2131
- /***/ }),
2132
-
2133
- /***/ 6405:
2134
- /***/ ((module) => {
2135
-
2136
- "use strict";
2137
- module.exports = require("react-dom");
2138
-
2139
- /***/ }),
2140
-
2141
- /***/ 9785:
2142
- /***/ ((module) => {
2143
-
2144
- "use strict";
2145
- module.exports = require("react-intersection-observer");
2146
-
2147
- /***/ }),
2148
-
2149
- /***/ 3789:
2150
- /***/ ((module) => {
2151
-
2152
- "use strict";
2153
- module.exports = require("react-swipeable");
2154
-
2155
- /***/ }),
2156
-
2157
- /***/ 997:
2158
- /***/ ((module) => {
2159
-
2160
- "use strict";
2161
- module.exports = require("react/jsx-runtime");
2162
-
2163
- /***/ }),
2164
-
2165
- /***/ 6109:
2166
- /***/ ((module) => {
2167
-
2168
- "use strict";
2169
- module.exports = require("sanitize-html");
2170
-
2171
- /***/ }),
2172
-
2173
- /***/ 3823:
2174
- /***/ ((module) => {
2175
-
2176
- "use strict";
2177
- module.exports = require("tabbable");
2178
-
2179
- /***/ }),
2180
-
2181
- /***/ 752:
2182
- /***/ ((module) => {
2183
-
2184
- "use strict";
2185
- module.exports = require("tslib");
2186
-
2187
- /***/ }),
2188
-
2189
- /***/ 9664:
2190
- /***/ ((module) => {
2191
-
2192
- "use strict";
2193
- module.exports = import("@envelop/core");;
2194
-
2195
- /***/ }),
2196
-
2197
- /***/ 7886:
2198
- /***/ ((module) => {
2199
-
2200
- "use strict";
2201
- module.exports = import("@envelop/graphql-jit");;
2202
-
2203
- /***/ }),
2204
-
2205
- /***/ 4656:
2206
- /***/ ((module) => {
2207
-
2208
- "use strict";
2209
- module.exports = import("@envelop/parser-cache");;
2210
-
2211
- /***/ }),
2212
-
2213
- /***/ 6093:
2214
- /***/ ((module) => {
2215
-
2216
- "use strict";
2217
- module.exports = import("@envelop/validation-cache");;
2218
-
2219
- /***/ }),
2220
-
2221
- /***/ 5774:
2222
- /***/ ((module) => {
2223
-
2224
- "use strict";
2225
- module.exports = import("@graphql-tools/load-files");;
2226
-
2227
- /***/ }),
2228
-
2229
- /***/ 6550:
2230
- /***/ ((module) => {
2231
-
2232
- "use strict";
2233
- module.exports = import("@graphql-tools/schema");;
2234
-
2235
- /***/ }),
2236
-
2237
- /***/ 7564:
2238
- /***/ ((module) => {
2239
-
2240
- "use strict";
2241
- module.exports = import("chalk");;
2242
-
2243
- /***/ }),
2244
-
2245
- /***/ 5941:
2246
- /***/ ((module) => {
2247
-
2248
- "use strict";
2249
- module.exports = import("swr");;
2250
-
2251
- /***/ }),
2252
-
2253
- /***/ 6113:
2254
- /***/ ((module) => {
2255
-
2256
- "use strict";
2257
- module.exports = require("crypto");
2258
-
2259
- /***/ })
2260
-
2261
- };
2262
- ;
2263
-
2264
- // load runtime
2265
- var __webpack_require__ = require("../../webpack-runtime.js");
2266
- __webpack_require__.C(exports);
2267
- var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
2268
- var __webpack_exports__ = __webpack_require__.X(0, [676,825,52,183,177,74,53,779,854,117,184,979,390,350,693], () => (__webpack_exec__(5779)));
2269
- module.exports = __webpack_exports__;
2270
-
2271
- })();