@faststore/core 2.0.160-alpha.0 → 2.0.163-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/@generated/graphql/index.ts +63 -6
  2. package/@generated/graphql/persisted.json +2 -2
  3. package/CHANGELOG.md +10 -0
  4. package/package.json +4 -4
  5. package/src/sdk/session/index.ts +4 -0
  6. package/src/sdk/shipping/index.ts +6 -0
  7. package/.next/BUILD_ID +0 -1
  8. package/.next/build-manifest.json +0 -132
  9. package/.next/cache/.tsbuildinfo +0 -1
  10. package/.next/cache/config.json +0 -7
  11. package/.next/cache/eslint/.cache_1gneedd +0 -1
  12. package/.next/cache/next-server.js.nft.json +0 -1
  13. package/.next/cache/webpack/client-production/0.pack +0 -0
  14. package/.next/cache/webpack/client-production/index.pack +0 -0
  15. package/.next/cache/webpack/server-production/0.pack +0 -0
  16. package/.next/cache/webpack/server-production/index.pack +0 -0
  17. package/.next/export-marker.json +0 -1
  18. package/.next/images-manifest.json +0 -1
  19. package/.next/next-server.js.nft.json +0 -1
  20. package/.next/package.json +0 -1
  21. package/.next/prerender-manifest.json +0 -1
  22. package/.next/react-loadable-manifest.json +0 -48
  23. package/.next/required-server-files.json +0 -1
  24. package/.next/routes-manifest.json +0 -1
  25. package/.next/server/chunks/123.js +0 -58
  26. package/.next/server/chunks/143.js +0 -106
  27. package/.next/server/chunks/183.js +0 -83
  28. package/.next/server/chunks/205.js +0 -692
  29. package/.next/server/chunks/247.js +0 -61
  30. package/.next/server/chunks/280.js +0 -324
  31. package/.next/server/chunks/287.js +0 -58
  32. package/.next/server/chunks/289.js +0 -229
  33. package/.next/server/chunks/312.js +0 -697
  34. package/.next/server/chunks/336.js +0 -821
  35. package/.next/server/chunks/350.js +0 -143
  36. package/.next/server/chunks/368.js +0 -253
  37. package/.next/server/chunks/401.js +0 -7241
  38. package/.next/server/chunks/431.js +0 -7241
  39. package/.next/server/chunks/502.js +0 -600
  40. package/.next/server/chunks/576.js +0 -83
  41. package/.next/server/chunks/597.js +0 -169
  42. package/.next/server/chunks/608.js +0 -644
  43. package/.next/server/chunks/644.js +0 -235
  44. package/.next/server/chunks/664.js +0 -3401
  45. package/.next/server/chunks/676.js +0 -32
  46. package/.next/server/chunks/701.js +0 -87
  47. package/.next/server/chunks/74.js +0 -2710
  48. package/.next/server/chunks/82.js +0 -371
  49. package/.next/server/chunks/854.js +0 -72
  50. package/.next/server/chunks/859.js +0 -959
  51. package/.next/server/chunks/874.js +0 -487
  52. package/.next/server/chunks/886.js +0 -120
  53. package/.next/server/chunks/907.js +0 -1803
  54. package/.next/server/chunks/970.js +0 -200
  55. package/.next/server/chunks/98.js +0 -124
  56. package/.next/server/chunks/font-manifest.json +0 -1
  57. package/.next/server/font-manifest.json +0 -1
  58. package/.next/server/middleware-build-manifest.js +0 -1
  59. package/.next/server/middleware-manifest.json +0 -6
  60. package/.next/server/middleware-react-loadable-manifest.js +0 -1
  61. package/.next/server/pages/404.js +0 -393
  62. package/.next/server/pages/404.js.nft.json +0 -1
  63. package/.next/server/pages/500.js +0 -395
  64. package/.next/server/pages/500.js.nft.json +0 -1
  65. package/.next/server/pages/[...slug].js +0 -730
  66. package/.next/server/pages/[...slug].js.nft.json +0 -1
  67. package/.next/server/pages/[slug]/p.js +0 -2476
  68. package/.next/server/pages/[slug]/p.js.nft.json +0 -1
  69. package/.next/server/pages/_app.js +0 -368
  70. package/.next/server/pages/_app.js.nft.json +0 -1
  71. package/.next/server/pages/_document.js +0 -304
  72. package/.next/server/pages/_document.js.nft.json +0 -1
  73. package/.next/server/pages/_error.js +0 -164
  74. package/.next/server/pages/_error.js.nft.json +0 -1
  75. package/.next/server/pages/account.js +0 -370
  76. package/.next/server/pages/account.js.nft.json +0 -1
  77. package/.next/server/pages/api/graphql.js +0 -316
  78. package/.next/server/pages/api/graphql.js.nft.json +0 -1
  79. package/.next/server/pages/api/preview.js +0 -118
  80. package/.next/server/pages/api/preview.js.nft.json +0 -1
  81. package/.next/server/pages/checkout.js +0 -370
  82. package/.next/server/pages/checkout.js.nft.json +0 -1
  83. package/.next/server/pages/en-US/404.html +0 -81
  84. package/.next/server/pages/en-US/404.json +0 -1
  85. package/.next/server/pages/en-US/500.html +0 -81
  86. package/.next/server/pages/en-US/500.json +0 -1
  87. package/.next/server/pages/en-US/account.html +0 -81
  88. package/.next/server/pages/en-US/account.json +0 -1
  89. package/.next/server/pages/en-US/checkout.html +0 -81
  90. package/.next/server/pages/en-US/checkout.json +0 -1
  91. package/.next/server/pages/en-US/login.html +0 -81
  92. package/.next/server/pages/en-US/login.json +0 -1
  93. package/.next/server/pages/en-US/s.html +0 -81
  94. package/.next/server/pages/en-US/s.json +0 -1
  95. package/.next/server/pages/en-US.html +0 -81
  96. package/.next/server/pages/en-US.json +0 -1
  97. package/.next/server/pages/index.js +0 -966
  98. package/.next/server/pages/index.js.nft.json +0 -1
  99. package/.next/server/pages/login.js +0 -375
  100. package/.next/server/pages/login.js.nft.json +0 -1
  101. package/.next/server/pages/s.js +0 -473
  102. package/.next/server/pages/s.js.nft.json +0 -1
  103. package/.next/server/pages-manifest.json +0 -16
  104. package/.next/server/webpack-api-runtime.js +0 -229
  105. package/.next/server/webpack-runtime.js +0 -229
  106. package/.next/static/9Z3xVhoJIqh8f9hFyGdI1/_buildManifest.js +0 -1
  107. package/.next/static/9Z3xVhoJIqh8f9hFyGdI1/_ssgManifest.js +0 -1
  108. package/.next/static/chunks/0-82274e07cb857231.js +0 -1
  109. package/.next/static/chunks/143.dd8a556e6957baa1.js +0 -1
  110. package/.next/static/chunks/226.b57e10ad9932f88c.js +0 -1
  111. package/.next/static/chunks/240-8e66b2892f9d8c40.js +0 -1
  112. package/.next/static/chunks/336.0846f48eccce57e4.js +0 -1
  113. package/.next/static/chunks/377-891ff95d759cb061.js +0 -1
  114. package/.next/static/chunks/391-47b923ef44945418.js +0 -1
  115. package/.next/static/chunks/495.0ecd099878b2a36d.js +0 -1
  116. package/.next/static/chunks/502.eeca300cb9a355fb.js +0 -1
  117. package/.next/static/chunks/545-1d3d08edfd2ee4c6.js +0 -1
  118. package/.next/static/chunks/597.57a8984b6a1071ae.js +0 -1
  119. package/.next/static/chunks/64.ebbe1d2b40f980c7.js +0 -1
  120. package/.next/static/chunks/651.7142f31ce1e052b3.js +0 -1
  121. package/.next/static/chunks/741.52f7fb873418346f.js +0 -1
  122. package/.next/static/chunks/98.97381d2021f86cd9.js +0 -1
  123. package/.next/static/chunks/framework-dfd14d7ce6600b03.js +0 -1
  124. package/.next/static/chunks/main-fd466221927468fd.js +0 -1
  125. package/.next/static/chunks/pages/404-459452495a0df278.js +0 -1
  126. package/.next/static/chunks/pages/500-008e30c48eceebed.js +0 -1
  127. package/.next/static/chunks/pages/[...slug]-e9d8386ff5e56d85.js +0 -1
  128. package/.next/static/chunks/pages/[slug]/p-8346514a688bf869.js +0 -1
  129. package/.next/static/chunks/pages/_app-f06fabc4661b3348.js +0 -1
  130. package/.next/static/chunks/pages/_error-a7a0c1d9bfbb4f38.js +0 -1
  131. package/.next/static/chunks/pages/account-46263f0c100c3eae.js +0 -1
  132. package/.next/static/chunks/pages/checkout-20bb3710b24df3b6.js +0 -1
  133. package/.next/static/chunks/pages/index-2006be8f08ad057f.js +0 -1
  134. package/.next/static/chunks/pages/login-f9d316d261fcc062.js +0 -1
  135. package/.next/static/chunks/pages/s-1cbe740b5b781d28.js +0 -1
  136. package/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js +0 -1
  137. package/.next/static/chunks/webpack-e9bf82a67cc08d0f.js +0 -1
  138. package/.next/static/css/13a4da555ff5e3be.css +0 -1
  139. package/.next/static/css/287f5ba239375052.css +0 -1
  140. package/.next/static/css/28d7d73e13e2bc1d.css +0 -1
  141. package/.next/static/css/2e00f7ba49c754b3.css +0 -1
  142. package/.next/static/css/47d82dcec9a7dbc2.css +0 -1
  143. package/.next/static/css/6e41f1b6078c14c1.css +0 -1
  144. package/.next/static/css/7d822a137c54a781.css +0 -1
  145. package/.next/static/css/c6f97f692b2efad9.css +0 -1
  146. package/.next/static/css/d4a0d9df8c6df555.css +0 -1
  147. package/.next/static/css/e02cdad8fc000339.css +0 -1
  148. package/.next/trace +0 -69
  149. package/public/~partytown/debug/partytown-atomics.js +0 -556
  150. package/public/~partytown/debug/partytown-media.js +0 -374
  151. package/public/~partytown/debug/partytown-sandbox-sw.js +0 -543
  152. package/public/~partytown/debug/partytown-sw.js +0 -59
  153. package/public/~partytown/debug/partytown-ww-atomics.js +0 -1789
  154. package/public/~partytown/debug/partytown-ww-sw.js +0 -1781
  155. package/public/~partytown/debug/partytown.js +0 -72
  156. package/public/~partytown/partytown-atomics.js +0 -2
  157. package/public/~partytown/partytown-media.js +0 -2
  158. package/public/~partytown/partytown-sw.js +0 -2
  159. package/public/~partytown/partytown.js +0 -2
@@ -1,2476 +0,0 @@
1
- (() => {
2
- var exports = {};
3
- exports.id = 103;
4
- exports.ids = [103];
5
- exports.modules = {
6
-
7
- /***/ 1672:
8
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
9
-
10
- "use strict";
11
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12
- /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
13
- /* harmony export */ });
14
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
15
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
16
- /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(783);
17
-
18
-
19
- const ProductTitle = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function ProductTitle({ title, label, refTag = 'Ref.: ', refNumber, testId = 'fs-product-title', ratingValue, ...otherProps }, ref) {
20
- return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("header", { ref: ref, "data-fs-product-title": true, "data-testid": testId, ...otherProps },
21
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { "data-fs-product-title-header": true },
22
- title,
23
- !!label && label),
24
- (refNumber || ratingValue) && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", { "data-fs-product-title-addendum": true },
25
- ratingValue && react__WEBPACK_IMPORTED_MODULE_0___default().createElement(___WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, { value: ratingValue }),
26
- refNumber && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null,
27
- refTag,
28
- " ",
29
- refNumber))))));
30
- });
31
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ProductTitle);
32
- //# sourceMappingURL=ProductTitle.js.map
33
-
34
- /***/ }),
35
-
36
- /***/ 4707:
37
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
38
-
39
- "use strict";
40
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
41
- /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
42
- /* harmony export */ });
43
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
44
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
45
-
46
- const Table = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function Table({ children, variant = 'colored', testId = 'fs-table', ...otherProps }, ref) {
47
- return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { "data-fs-table": true },
48
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement("table", { ref: ref, "data-fs-table-content": true, "data-fs-table-variant": variant, "data-testid": testId, ...otherProps }, children)));
49
- });
50
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Table);
51
- //# sourceMappingURL=Table.js.map
52
-
53
- /***/ }),
54
-
55
- /***/ 1566:
56
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
57
-
58
- "use strict";
59
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
60
- /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
61
- /* harmony export */ });
62
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
63
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
64
-
65
- const TableBody = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function TableBody({ children, testId = 'fs-table-body', ...otherProps }, ref) {
66
- return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("tbody", { ref: ref, "data-testid": testId, "data-fs-table-body": true, ...otherProps }, children));
67
- });
68
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TableBody);
69
- //# sourceMappingURL=TableBody.js.map
70
-
71
- /***/ }),
72
-
73
- /***/ 3111:
74
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
75
-
76
- "use strict";
77
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
78
- /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
79
- /* harmony export */ });
80
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
81
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
82
-
83
- const TableCell = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function TableCell({ scope, align, children, variant = 'data', testId = 'fs-table-cell', ...otherProps }, ref) {
84
- const Cell = variant === 'header' ? 'th' : 'td';
85
- return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Cell, { ref: ref, "data-fs-table-cell": variant, "data-fs-table-cell-align": align, "data-testid": testId, scope: scope, ...otherProps }, children));
86
- });
87
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TableCell);
88
- //# sourceMappingURL=TableCell.js.map
89
-
90
- /***/ }),
91
-
92
- /***/ 6037:
93
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
94
-
95
- "use strict";
96
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
97
- /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
98
- /* harmony export */ });
99
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
100
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
101
-
102
- const TableRow = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function TableRow({ children, testId = 'fs-table-row', ...otherProps }, ref) {
103
- return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("tr", { ref: ref, "data-fs-table-row": true, "data-testid": testId, ...otherProps }, children));
104
- });
105
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TableRow);
106
- //# sourceMappingURL=TableRow.js.map
107
-
108
- /***/ }),
109
-
110
- /***/ 492:
111
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
112
-
113
- "use strict";
114
-
115
- // EXPORTS
116
- __webpack_require__.d(__webpack_exports__, {
117
- "Z": () => (/* reexport */ product_OutOfStock_OutOfStock)
118
- });
119
-
120
- // EXTERNAL MODULE: ../components/dist/hooks/UIProvider.js
121
- var UIProvider = __webpack_require__(395);
122
- // EXTERNAL MODULE: ../components/dist/atoms/Icon/Icon.js
123
- var Icon = __webpack_require__(5045);
124
- // EXTERNAL MODULE: external "react"
125
- var external_react_ = __webpack_require__(6689);
126
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
127
- // EXTERNAL MODULE: ../components/dist/molecules/InputField/InputField.js
128
- var InputField = __webpack_require__(8287);
129
- // EXTERNAL MODULE: ../components/dist/atoms/Button/Button.js
130
- var Button = __webpack_require__(7578);
131
- ;// CONCATENATED MODULE: ../components/dist/organisms/OutOfStock/OutOfStock.js
132
-
133
-
134
- const OutOfStock = (0,external_react_.forwardRef)(function OutOfStock({ testId = 'fs-out-of-stock', title, buttonLabel = 'Notify Me', loadingLabel = 'Loading', inputLabel, subtitle, disabled, errorMessage, onSubmit, ...otherProps }, ref) {
135
- return (external_react_default().createElement("form", { "data-fs-out-of-stock": true, ref: ref, "data-testid": testId, onSubmit: onSubmit, ...otherProps },
136
- external_react_default().createElement("h2", { "data-fs-out-of-stock-title": true }, title),
137
- subtitle && (external_react_default().createElement("p", { "data-fs-out-of-stock-message": true },
138
- external_react_default().createElement(Icon/* default */.Z, { name: "BellRinging", width: 16, height: 16 }),
139
- subtitle)),
140
- external_react_default().createElement(InputField/* default */.Z, { id: "out-of-stock-email", name: "out-of-stock-email", label: inputLabel, "aria-label": inputLabel, error: errorMessage, required: true }),
141
- external_react_default().createElement(Button/* default */.Z, { "data-fs-out-of-stock-button": true, type: "submit", loading: disabled, loadingLabel: loadingLabel, disabled: disabled, variant: "primary", icon: external_react_default().createElement(Icon/* default */.Z, { name: "BellRinging" }), iconPosition: "left" }, buttonLabel)));
142
- });
143
- /* harmony default export */ const OutOfStock_OutOfStock = (OutOfStock);
144
- //# sourceMappingURL=OutOfStock.js.map
145
- // EXTERNAL MODULE: ./src/sdk/session/index.ts + 1 modules
146
- var session = __webpack_require__(7295);
147
- // EXTERNAL MODULE: external "react/jsx-runtime"
148
- var jsx_runtime_ = __webpack_require__(997);
149
- ;// CONCATENATED MODULE: ./src/components/product/OutOfStock/OutOfStock.tsx
150
-
151
-
152
-
153
-
154
-
155
- function OutOfStock_OutOfStock_OutOfStock() {
156
- const {
157
- postalCode
158
- } = (0,session/* useSession */.kP)();
159
- const {
160
- 0: isLoading,
161
- 1: setIsLoading
162
- } = (0,external_react_.useState)(false);
163
- const {
164
- 0: error,
165
- 1: setError
166
- } = (0,external_react_.useState)('');
167
- const {
168
- pushToast
169
- } = (0,UIProvider/* useUI */.l)();
170
-
171
- const handleSubmit = event => {
172
- event.preventDefault();
173
- setIsLoading(true); // TODO: Missing integration
174
-
175
- try {
176
- // Return to original state after 2s mockup
177
- setTimeout(() => setIsLoading(false), 2000);
178
- const formElement = event.currentTarget;
179
- formElement.reset();
180
- pushToast({
181
- title: 'Subscribed successfully!',
182
- message: "You'll be notified when this product is back to stock.",
183
- status: 'INFO',
184
- icon: /*#__PURE__*/jsx_runtime_.jsx(Icon/* default */.Z, {
185
- name: "CircleWavyCheck",
186
- width: 30,
187
- height: 30
188
- })
189
- });
190
- } catch (err) {
191
- setError(err.message);
192
- } finally {}
193
- };
194
-
195
- return /*#__PURE__*/jsx_runtime_.jsx(OutOfStock_OutOfStock, {
196
- title: postalCode ? 'Unavailable in Your Location' : 'Out of Stock',
197
- inputLabel: "Email",
198
- subtitle: "Notify me when available",
199
- onSubmit: handleSubmit,
200
- disabled: isLoading,
201
- errorMessage: error
202
- });
203
- }
204
-
205
- /* harmony default export */ const product_OutOfStock_OutOfStock = (OutOfStock_OutOfStock_OutOfStock);
206
- ;// CONCATENATED MODULE: ./src/components/product/OutOfStock/index.ts
207
-
208
-
209
- /***/ }),
210
-
211
- /***/ 2951:
212
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
213
-
214
- "use strict";
215
- __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
216
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
217
- /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
218
- /* harmony export */ });
219
- /* harmony import */ var src_components_ui_BannerText__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6166);
220
- /* harmony import */ var _Newsletter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7191);
221
- /* harmony import */ var _Section__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7067);
222
- /* harmony import */ var _section_module_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5411);
223
- /* harmony import */ var _section_module_scss__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_section_module_scss__WEBPACK_IMPORTED_MODULE_4__);
224
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(997);
225
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
226
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_Newsletter__WEBPACK_IMPORTED_MODULE_1__]);
227
- _Newsletter__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
228
-
229
-
230
-
231
-
232
-
233
-
234
-
235
- function BannerNewsletter() {
236
- return /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx(_Section__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
237
- className: `${(_section_module_scss__WEBPACK_IMPORTED_MODULE_4___default().section)} section-banner-newsletter layout__content`,
238
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
239
- "data-fs-banner-newsletter": true,
240
- children: [/*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx(src_components_ui_BannerText__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z, {
241
- title: "Get to Know Our Next Release",
242
- caption: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam elit nisi, vehicula in turpis sit amet, posuere aliquam nisl. ",
243
- actionLabel: "Shop Now",
244
- actionPath: "/",
245
- variant: "secondary",
246
- colorVariant: "light"
247
- }), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx(_Newsletter__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
248
- title: "Get News and Special Offers!",
249
- description: "Receive our news and promotions in advance. Enjoy and get 10% off your first purchase. For more information click here.",
250
- card: true,
251
- lite: true
252
- })]
253
- })
254
- });
255
- }
256
-
257
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BannerNewsletter);
258
- __webpack_async_result__();
259
- } catch(e) { __webpack_async_result__(e); } });
260
-
261
- /***/ }),
262
-
263
- /***/ 994:
264
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
265
-
266
- "use strict";
267
- __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
268
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
269
- /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
270
- /* harmony export */ });
271
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
272
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
273
- /* harmony import */ var src_components_ui_ProductShelf__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4805);
274
- /* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9785);
275
- /* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_intersection_observer__WEBPACK_IMPORTED_MODULE_2__);
276
- /* harmony import */ var _ProductShelf_section_module_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(6627);
277
- /* harmony import */ var _ProductShelf_section_module_scss__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_ProductShelf_section_module_scss__WEBPACK_IMPORTED_MODULE_5__);
278
- /* harmony import */ var _Section__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7067);
279
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(997);
280
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
281
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([src_components_ui_ProductShelf__WEBPACK_IMPORTED_MODULE_1__]);
282
- src_components_ui_ProductShelf__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
283
-
284
-
285
-
286
-
287
-
288
-
289
-
290
- const CrossSellingShelf = ({
291
- items,
292
- title,
293
- context,
294
- kind
295
- }) => {
296
- const {
297
- ref,
298
- inView
299
- } = (0,react_intersection_observer__WEBPACK_IMPORTED_MODULE_2__.useInView)();
300
- const selectedFacets = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => [{
301
- key: kind,
302
- value: context.isVariantOf.productGroupID
303
- }], [kind, context.isVariantOf.productGroupID]);
304
- return /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx(_Section__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
305
- className: `${(_ProductShelf_section_module_scss__WEBPACK_IMPORTED_MODULE_5___default().section)} section-product-shelf layout__section`,
306
- ref: ref,
307
- children: /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx(src_components_ui_ProductShelf__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
308
- inView: inView,
309
- first: items,
310
- title: title,
311
- selectedFacets: selectedFacets
312
- })
313
- });
314
- };
315
-
316
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CrossSellingShelf);
317
- __webpack_async_result__();
318
- } catch(e) { __webpack_async_result__(e); } });
319
-
320
- /***/ }),
321
-
322
- /***/ 7990:
323
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
324
-
325
- "use strict";
326
- __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
327
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
328
- /* harmony export */ "Z": () => (/* reexport safe */ _CrossSellingShelf__WEBPACK_IMPORTED_MODULE_0__.Z)
329
- /* harmony export */ });
330
- /* harmony import */ var _CrossSellingShelf__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(994);
331
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_CrossSellingShelf__WEBPACK_IMPORTED_MODULE_0__]);
332
- _CrossSellingShelf__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
333
-
334
- __webpack_async_result__();
335
- } catch(e) { __webpack_async_result__(e); } });
336
-
337
- /***/ }),
338
-
339
- /***/ 1644:
340
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
341
-
342
- "use strict";
343
- __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
344
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
345
- /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
346
- /* harmony export */ });
347
- /* unused harmony export fragment */
348
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
349
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
350
- /* harmony import */ var _faststore_sdk__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(1072);
351
- /* harmony import */ var _faststore_ui__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(1672);
352
- /* harmony import */ var _faststore_ui__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(9875);
353
- /* harmony import */ var _faststore_ui__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(7865);
354
- /* harmony import */ var src_sdk_session__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7295);
355
- /* harmony import */ var src_sdk_product_useProduct__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3874);
356
- /* harmony import */ var src_sdk_product_useFormattedPrice__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5346);
357
- /* harmony import */ var _Section__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7067);
358
- /* harmony import */ var src_components_product_OutOfStock__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(492);
359
- /* harmony import */ var src_components_ui_ImageGallery__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5693);
360
- /* harmony import */ var src_components_ui_ShippingSimulation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(104);
361
- /* harmony import */ var src_components_ui_ProductDescription__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(509);
362
- /* harmony import */ var src_components_ui_ProductDetails__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(5218);
363
- /* harmony import */ var _section_module_scss__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(9034);
364
- /* harmony import */ var _section_module_scss__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_section_module_scss__WEBPACK_IMPORTED_MODULE_12__);
365
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(997);
366
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__);
367
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([src_sdk_product_useProduct__WEBPACK_IMPORTED_MODULE_2__]);
368
- src_sdk_product_useProduct__WEBPACK_IMPORTED_MODULE_2__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
369
-
370
-
371
-
372
-
373
-
374
-
375
-
376
-
377
-
378
-
379
-
380
-
381
-
382
-
383
-
384
-
385
- function ProductDetails({
386
- context: staleProduct,
387
- productTitle: {
388
- refNumber: showRefNumber,
389
- discountBadge: {
390
- showDiscountBadge,
391
- size: discountBadgeSize
392
- }
393
- },
394
- buyButton: {
395
- icon: buyButtonIcon,
396
- title: buyButtonTitle
397
- },
398
- shippingSimulator: {
399
- title: shippingSimulatorTitle,
400
- inputLabel: shippingSimulatorInputLabel,
401
- shippingOptionsTableTitle: shippingSimulatorOptionsTableTitle,
402
- link: {
403
- to: shippingSimulatorLinkUrl,
404
- text: shippingSimulatorLinkText
405
- }
406
- },
407
- productDescription: {
408
- title: productDescriptionDetailsTitle,
409
- initiallyExpanded: productDescriptionInitiallyExpanded,
410
- displayDescription: shouldDisplayProductDescription
411
- }
412
- }) {
413
- const {
414
- currency
415
- } = (0,src_sdk_session__WEBPACK_IMPORTED_MODULE_1__/* .useSession */ .kP)();
416
- const {
417
- 0: quantity,
418
- 1: setQuantity
419
- } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(1); // Stale while revalidate the product for fetching the new price etc
420
-
421
- const {
422
- data,
423
- isValidating
424
- } = (0,src_sdk_product_useProduct__WEBPACK_IMPORTED_MODULE_2__/* .useProduct */ .i)(staleProduct.id, {
425
- product: staleProduct
426
- });
427
-
428
- if (!data) {
429
- throw new Error('NotFound');
430
- }
431
-
432
- const {
433
- product: {
434
- id,
435
- sku,
436
- gtin,
437
- name: variantName,
438
- brand,
439
- isVariantOf,
440
- isVariantOf: {
441
- name,
442
- productGroupID: productId
443
- },
444
- image: productImages,
445
- offers: {
446
- offers: [{
447
- availability,
448
- price,
449
- listPrice,
450
- seller
451
- }],
452
- lowPrice
453
- }
454
- }
455
- } = data;
456
- (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
457
- (0,_faststore_sdk__WEBPACK_IMPORTED_MODULE_11__/* .sendAnalyticsEvent */ ._)({
458
- name: 'view_item',
459
- params: {
460
- currency: currency.code,
461
- value: price,
462
- items: [{
463
- item_id: isVariantOf.productGroupID,
464
- item_name: isVariantOf.name,
465
- item_brand: brand.name,
466
- item_variant: sku,
467
- price,
468
- discount: listPrice - price,
469
- currency: currency.code,
470
- item_variant_name: variantName,
471
- product_reference_id: gtin
472
- }]
473
- }
474
- });
475
- }, [isVariantOf.productGroupID, isVariantOf.name, brand.name, sku, price, listPrice, currency.code, variantName, gtin]);
476
- return /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx(_Section__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
477
- className: `${(_section_module_scss__WEBPACK_IMPORTED_MODULE_12___default().section)} section-product-details layout__content layout__section`,
478
- children: /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx("section", {
479
- "data-fs-product-details": true,
480
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("section", {
481
- "data-fs-product-details-body": true,
482
- children: [/*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx("header", {
483
- "data-fs-product-details-title": true,
484
- "data-fs-product-details-section": true,
485
- children: /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx(_faststore_ui__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z, {
486
- title: /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx("h1", {
487
- children: name
488
- }),
489
- label: showDiscountBadge && /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx(_faststore_ui__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z, {
490
- listPrice: listPrice,
491
- spotPrice: lowPrice,
492
- size: discountBadgeSize
493
- }),
494
- refNumber: showRefNumber && productId
495
- })
496
- }), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx(src_components_ui_ImageGallery__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z, {
497
- "data-fs-product-details-gallery": true,
498
- images: productImages
499
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("section", {
500
- "data-fs-product-details-info": true,
501
- children: [/*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx("section", {
502
- "data-fs-product-details-settings": true,
503
- "data-fs-product-details-section": true,
504
- children: availability ? /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx(src_components_ui_ProductDetails__WEBPACK_IMPORTED_MODULE_9__/* .ProductDetailsSettings */ .m, {
505
- product: data.product,
506
- isValidating: isValidating,
507
- buyButtonTitle: buyButtonTitle,
508
- quantity: quantity,
509
- setQuantity: setQuantity,
510
- buyButtonIcon: buyButtonIcon
511
- }) : /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx(src_components_product_OutOfStock__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {})
512
- }), availability && /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx(src_components_ui_ShippingSimulation__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z, {
513
- "data-fs-product-details-section": true,
514
- "data-fs-product-details-shipping": true,
515
- productShippingInfo: {
516
- id,
517
- quantity,
518
- seller: seller.identifier
519
- },
520
- formatter: src_sdk_product_useFormattedPrice__WEBPACK_IMPORTED_MODULE_3__/* .useFormattedPrice */ .P,
521
- title: shippingSimulatorTitle,
522
- inputLabel: shippingSimulatorInputLabel,
523
- idkPostalCodeLinkProps: /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx(_faststore_ui__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, {
524
- href: shippingSimulatorLinkUrl,
525
- children: shippingSimulatorLinkText
526
- }),
527
- optionsLabel: shippingSimulatorOptionsTableTitle
528
- })]
529
- }), shouldDisplayProductDescription && /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx(src_components_ui_ProductDescription__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z, {
530
- labels: {
531
- description: productDescriptionDetailsTitle
532
- },
533
- initiallyExpanded: productDescriptionInitiallyExpanded
534
- })]
535
- })
536
- })
537
- });
538
- }
539
-
540
- const fragment = "unknown";
541
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ProductDetails);
542
- __webpack_async_result__();
543
- } catch(e) { __webpack_async_result__(e); } });
544
-
545
- /***/ }),
546
-
547
- /***/ 3220:
548
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
549
-
550
- "use strict";
551
- __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
552
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
553
- /* harmony export */ "Z": () => (/* reexport safe */ _ProductDetails__WEBPACK_IMPORTED_MODULE_0__.Z)
554
- /* harmony export */ });
555
- /* harmony import */ var _ProductDetails__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1644);
556
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_ProductDetails__WEBPACK_IMPORTED_MODULE_0__]);
557
- _ProductDetails__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
558
-
559
- __webpack_async_result__();
560
- } catch(e) { __webpack_async_result__(e); } });
561
-
562
- /***/ }),
563
-
564
- /***/ 5693:
565
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
566
-
567
- "use strict";
568
-
569
- // EXPORTS
570
- __webpack_require__.d(__webpack_exports__, {
571
- "Z": () => (/* reexport */ ui_ImageGallery_ImageGallery)
572
- });
573
-
574
- // EXTERNAL MODULE: external "react"
575
- var external_react_ = __webpack_require__(6689);
576
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
577
- // EXTERNAL MODULE: external "react-intersection-observer"
578
- var external_react_intersection_observer_ = __webpack_require__(9785);
579
- // EXTERNAL MODULE: ../components/dist/molecules/IconButton/IconButton.js
580
- var IconButton = __webpack_require__(2765);
581
- // EXTERNAL MODULE: ../components/dist/atoms/Icon/Icon.js
582
- var Icon = __webpack_require__(5045);
583
- // EXTERNAL MODULE: ../components/dist/atoms/Button/Button.js
584
- var Button = __webpack_require__(7578);
585
- ;// CONCATENATED MODULE: ../components/dist/organisms/ImageGallery/ImageGallerySelector.js
586
-
587
-
588
-
589
- const SCROLL_MARGIN_VALUE = 400;
590
- const moveScroll = (container, value) => {
591
- if (container) {
592
- if (container.scrollHeight > container.clientHeight) {
593
- // TODO: Temporary workaround for scroll-behavior with scrollTop – Safari 15.4) https://developer.apple.com/forums/thread/703294
594
- container.style.overflow = 'auto';
595
- window.requestAnimationFrame(() => container.scrollTo({ top: value, behavior: 'smooth' }));
596
- setTimeout(() => (container.style.overflow = 'hidden'), 2000);
597
- }
598
- else {
599
- container.scrollLeft += value;
600
- }
601
- }
602
- };
603
- const hasScroll = (container) => {
604
- if (container) {
605
- return (container.scrollHeight > container.clientHeight ||
606
- container.scrollWidth > container.clientWidth);
607
- }
608
- return false;
609
- };
610
- 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', }) {
611
- const elementsRef = (0,external_react_.useRef)(null);
612
- const elementHasScroll = hasScroll(elementsRef.current);
613
- const [firstImageInView, setFirstImageInView] = (0,external_react_.useState)(true);
614
- const [lastImageInView, setLastImageInView] = (0,external_react_.useState)(true);
615
- const inViewChange = (0,external_react_.useCallback)((idx, inView) => {
616
- idx === 0 && setFirstImageInView(inView);
617
- idx === images.length - 1 && setLastImageInView(inView);
618
- }, [images.length]);
619
- return (external_react_default().createElement("section", { "data-fs-image-gallery-selector": true, "data-testid": testId, "aria-label": ariaLabel },
620
- elementHasScroll && !firstImageInView && (external_react_default().createElement("div", { "data-fs-image-gallery-selector-control": true },
621
- 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) }))),
622
- external_react_default().createElement("div", { "data-fs-image-gallery-selector-elements": true, ref: elementsRef }, images.map((image, idx) => {
623
- return (external_react_default().createElement(external_react_intersection_observer_.InView, { key: idx, onChange: (inView) => inViewChange(idx, inView) },
624
- 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' },
625
- external_react_default().createElement(ImageComponent, { url: image.url ?? '', loading: idx === 0 ? 'eager' : 'lazy', alternateName: image.alternateName ?? '' }))));
626
- })),
627
- elementHasScroll && !lastImageInView && (external_react_default().createElement("div", { "data-fs-image-gallery-selector-control": true },
628
- 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) })))));
629
- }
630
- /* harmony default export */ const ImageGallery_ImageGallerySelector = (ImageGallerySelector);
631
- //# sourceMappingURL=ImageGallerySelector.js.map
632
- ;// CONCATENATED MODULE: ../components/dist/organisms/ImageGallery/ImageGallery.js
633
-
634
-
635
- const ImageGallery = (0,external_react_.forwardRef)(function ImageGallery({ images, children, ImageComponent, selectedImageIdx, setSelectedImageIdx, testId = 'fs-image-gallery', ...otherProps }, ref) {
636
- const hasSelector = images.length > 1;
637
- return (external_react_default().createElement("section", { ref: ref, "data-fs-image-gallery": hasSelector ? 'with-selector' : 'without-selector', "data-testid": testId, ...otherProps },
638
- children,
639
- hasSelector && (external_react_default().createElement(ImageGallery_ImageGallerySelector, { images: images, onSelect: setSelectedImageIdx, currentImageIdx: selectedImageIdx, ImageComponent: ImageComponent }))));
640
- });
641
- /* harmony default export */ const ImageGallery_ImageGallery = (ImageGallery);
642
- //# sourceMappingURL=ImageGallery.js.map
643
- ;// CONCATENATED MODULE: ../components/dist/organisms/ImageGallery/ImageZoom.js
644
-
645
- const ImageZoom = ({ children }) => {
646
- return external_react_default().createElement((external_react_default()).Fragment, null, children);
647
- };
648
- /* harmony default export */ const ImageGallery_ImageZoom = (ImageZoom);
649
- //# sourceMappingURL=ImageZoom.js.map
650
- // EXTERNAL MODULE: external "next/router"
651
- var router_ = __webpack_require__(1853);
652
- // EXTERNAL MODULE: ./src/components/ui/Image/index.ts + 2 modules
653
- var Image = __webpack_require__(9266);
654
- // EXTERNAL MODULE: external "react/jsx-runtime"
655
- var jsx_runtime_ = __webpack_require__(997);
656
- ;// CONCATENATED MODULE: ./src/components/ui/ImageGallery/ImageGallery.tsx
657
- const _excluded = ["images"];
658
-
659
- 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; }
660
-
661
- 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; }
662
-
663
- 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; }
664
-
665
- 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; }
666
-
667
- 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; }
668
-
669
-
670
-
671
-
672
-
673
-
674
-
675
- const ImageComponent = ({
676
- url,
677
- alternateName
678
- }) => /*#__PURE__*/jsx_runtime_.jsx(Image/* Image */.E, {
679
- src: url,
680
- alt: alternateName,
681
- width: 68,
682
- height: 68
683
- });
684
-
685
- const ImageGallery_ImageGallery_ImageGallery = _ref => {
686
- let {
687
- images
688
- } = _ref,
689
- otherProps = _objectWithoutProperties(_ref, _excluded);
690
-
691
- const {
692
- 0: selectedImageIdx,
693
- 1: setSelectedImageIdx
694
- } = (0,external_react_.useState)(0);
695
- const currentImage = images[selectedImageIdx] ?? images[0];
696
- const dynamicRoute = (0,router_.useRouter)().asPath;
697
- (0,external_react_.useEffect)(() => setSelectedImageIdx(0), [dynamicRoute]);
698
- return /*#__PURE__*/jsx_runtime_.jsx(ImageGallery_ImageGallery, _objectSpread(_objectSpread({
699
- images: images,
700
- ImageComponent: ImageComponent,
701
- selectedImageIdx: selectedImageIdx,
702
- setSelectedImageIdx: setSelectedImageIdx
703
- }, otherProps), {}, {
704
- children: /*#__PURE__*/jsx_runtime_.jsx(ImageGallery_ImageZoom, {
705
- children: /*#__PURE__*/jsx_runtime_.jsx(Image/* Image */.E, {
706
- src: currentImage.url,
707
- alt: currentImage.alternateName,
708
- sizes: "(max-width: 360px) 50vw, (max-width: 768px) 90vw, 50vw",
709
- width: 691,
710
- height: 691 * (3 / 4),
711
- loading: "eager"
712
- })
713
- })
714
- }));
715
- };
716
-
717
- /* harmony default export */ const ui_ImageGallery_ImageGallery = (ImageGallery_ImageGallery_ImageGallery);
718
- ;// CONCATENATED MODULE: ./src/components/ui/ImageGallery/index.ts
719
-
720
-
721
- /***/ }),
722
-
723
- /***/ 509:
724
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
725
-
726
- "use strict";
727
-
728
- // EXPORTS
729
- __webpack_require__.d(__webpack_exports__, {
730
- "Z": () => (/* reexport */ ProductDescription_ProductDescription)
731
- });
732
-
733
- // EXTERNAL MODULE: ../components/dist/molecules/Accordion/Accordion.js
734
- var Accordion = __webpack_require__(9739);
735
- // EXTERNAL MODULE: ../components/dist/molecules/Accordion/AccordionItem.js
736
- var AccordionItem = __webpack_require__(5705);
737
- // EXTERNAL MODULE: ../components/dist/molecules/Accordion/AccordionButton.js
738
- var AccordionButton = __webpack_require__(7743);
739
- // EXTERNAL MODULE: ../components/dist/molecules/Accordion/AccordionPanel.js
740
- var AccordionPanel = __webpack_require__(331);
741
- // EXTERNAL MODULE: ../components/dist/molecules/Table/Table.js
742
- var Table = __webpack_require__(4707);
743
- // EXTERNAL MODULE: ../components/dist/molecules/Table/TableBody.js
744
- var TableBody = __webpack_require__(1566);
745
- // EXTERNAL MODULE: ../components/dist/molecules/Table/TableRow.js
746
- var TableRow = __webpack_require__(6037);
747
- // EXTERNAL MODULE: ../components/dist/molecules/Table/TableCell.js
748
- var TableCell = __webpack_require__(3111);
749
- // EXTERNAL MODULE: ../components/dist/atoms/Icon/Icon.js
750
- var Icon = __webpack_require__(5045);
751
- // EXTERNAL MODULE: ../components/dist/atoms/List/List.js
752
- var List = __webpack_require__(1329);
753
- // EXTERNAL MODULE: external "react"
754
- var external_react_ = __webpack_require__(6689);
755
- // EXTERNAL MODULE: external "react/jsx-runtime"
756
- var jsx_runtime_ = __webpack_require__(997);
757
- ;// CONCATENATED MODULE: ./src/components/ui/ProductDescription/ProductDescription.tsx
758
- 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; }
759
-
760
- 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; }
761
-
762
- 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; }
763
-
764
-
765
-
766
-
767
-
768
-
769
- /**
770
- * Maps 'initiallyExpanded' prop values to indices
771
- */
772
- const INITIALLY_EXPANDED_MAP = {
773
- first: [0],
774
- all: [0, 1, 2, 3],
775
- none: []
776
- };
777
- /**
778
- * Default article labels
779
- */
780
-
781
- const DEFAULT_LABELS = {
782
- description: 'Description',
783
- about: 'About this product',
784
- highlights: 'Product highlights',
785
- learnMore: 'Learn More'
786
- };
787
-
788
- function ProductDescription({
789
- initiallyExpanded = 'first',
790
- labels: propLabels = {}
791
- }) {
792
- const {
793
- 0: indices,
794
- 1: setIndices
795
- } = (0,external_react_.useState)(new Set(INITIALLY_EXPANDED_MAP[initiallyExpanded]));
796
-
797
- const onChange = index => {
798
- setIndices(currentIndices => {
799
- const newIndices = new Set(currentIndices);
800
-
801
- if (currentIndices.has(index)) {
802
- newIndices.delete(index);
803
- } else {
804
- newIndices.add(index);
805
- }
806
-
807
- return newIndices;
808
- });
809
- };
810
-
811
- const labels = _objectSpread(_objectSpread({}, DEFAULT_LABELS), propLabels);
812
-
813
- return /*#__PURE__*/jsx_runtime_.jsx("section", {
814
- "data-fs-product-description": true,
815
- children: /*#__PURE__*/(0,jsx_runtime_.jsxs)(Accordion/* default */.Z, {
816
- indices: indices,
817
- onChange: onChange,
818
- "aria-label": "Product Details Content",
819
- children: [/*#__PURE__*/(0,jsx_runtime_.jsxs)(AccordionItem/* default */.Z, {
820
- as: "article",
821
- index: 0,
822
- "data-fs-product-details-description": true,
823
- prefixId: "product-description",
824
- children: [/*#__PURE__*/jsx_runtime_.jsx(AccordionButton/* default */.Z, {
825
- children: labels.description
826
- }), /*#__PURE__*/jsx_runtime_.jsx(AccordionPanel/* default */.Z, {
827
- children: /*#__PURE__*/jsx_runtime_.jsx("p", {
828
- className: "text__body",
829
- children: "Sony WH-1000XM4 Wireless Industry Leading Noise Canceling Overhead Headphones with Mic for Phone-Call and Alexa Voice Control, Black."
830
- })
831
- })]
832
- }), /*#__PURE__*/(0,jsx_runtime_.jsxs)(AccordionItem/* default */.Z, {
833
- as: "article",
834
- index: 1,
835
- "data-fs-product-details-about": true,
836
- prefixId: "product-description",
837
- children: [/*#__PURE__*/jsx_runtime_.jsx(AccordionButton/* default */.Z, {
838
- children: labels.about
839
- }), /*#__PURE__*/jsx_runtime_.jsx(AccordionPanel/* default */.Z, {
840
- children: /*#__PURE__*/jsx_runtime_.jsx(Table/* default */.Z, {
841
- cellPadding: 0,
842
- cellSpacing: 0,
843
- className: "text__title-mini-alt",
844
- children: /*#__PURE__*/(0,jsx_runtime_.jsxs)(TableBody/* default */.Z, {
845
- children: [/*#__PURE__*/(0,jsx_runtime_.jsxs)(TableRow/* default */.Z, {
846
- children: [/*#__PURE__*/(0,jsx_runtime_.jsxs)(TableCell/* default */.Z, {
847
- variant: "header",
848
- align: "left",
849
- children: [/*#__PURE__*/jsx_runtime_.jsx(Icon/* default */.Z, {
850
- "data-fs-accordion-item-button-icon": true,
851
- name: "Ruler",
852
- width: 18,
853
- height: 18
854
- }), /*#__PURE__*/jsx_runtime_.jsx("span", {
855
- children: "Width"
856
- })]
857
- }), /*#__PURE__*/jsx_runtime_.jsx(TableCell/* default */.Z, {
858
- align: "right",
859
- children: "1.50m"
860
- })]
861
- }), /*#__PURE__*/(0,jsx_runtime_.jsxs)(TableRow/* default */.Z, {
862
- children: [/*#__PURE__*/(0,jsx_runtime_.jsxs)(TableCell/* default */.Z, {
863
- variant: "header",
864
- align: "left",
865
- children: [/*#__PURE__*/jsx_runtime_.jsx(Icon/* default */.Z, {
866
- "data-fs-accordion-item-button-icon": true,
867
- name: "Ruler",
868
- width: 18,
869
- height: 18
870
- }), "Height"]
871
- }), /*#__PURE__*/jsx_runtime_.jsx(TableCell/* default */.Z, {
872
- align: "right",
873
- children: "1.50m"
874
- })]
875
- }), /*#__PURE__*/(0,jsx_runtime_.jsxs)(TableRow/* default */.Z, {
876
- children: [/*#__PURE__*/(0,jsx_runtime_.jsxs)(TableCell/* default */.Z, {
877
- variant: "header",
878
- align: "left",
879
- children: [/*#__PURE__*/jsx_runtime_.jsx(Icon/* default */.Z, {
880
- "data-fs-accordion-item-button-icon": true,
881
- name: "Ruler",
882
- width: 18,
883
- height: 18
884
- }), "Dimensions"]
885
- }), /*#__PURE__*/jsx_runtime_.jsx(TableCell/* default */.Z, {
886
- align: "right",
887
- children: "7.27 x 3.03 x 9.94 inches"
888
- })]
889
- }), /*#__PURE__*/(0,jsx_runtime_.jsxs)(TableRow/* default */.Z, {
890
- children: [/*#__PURE__*/(0,jsx_runtime_.jsxs)(TableCell/* default */.Z, {
891
- variant: "header",
892
- align: "left",
893
- children: [/*#__PURE__*/jsx_runtime_.jsx(Icon/* default */.Z, {
894
- "data-fs-accordion-item-button-icon": true,
895
- name: "Bag",
896
- width: 18,
897
- height: 18
898
- }), "Weight"]
899
- }), /*#__PURE__*/jsx_runtime_.jsx(TableCell/* default */.Z, {
900
- align: "right",
901
- children: "12oz"
902
- })]
903
- }), /*#__PURE__*/(0,jsx_runtime_.jsxs)(TableRow/* default */.Z, {
904
- children: [/*#__PURE__*/(0,jsx_runtime_.jsxs)(TableCell/* default */.Z, {
905
- variant: "header",
906
- align: "left",
907
- children: [/*#__PURE__*/jsx_runtime_.jsx(Icon/* default */.Z, {
908
- "data-fs-accordion-item-button-icon": true,
909
- name: "RocketLaunch",
910
- width: 18,
911
- height: 18
912
- }), "Days to ship"]
913
- }), /*#__PURE__*/jsx_runtime_.jsx(TableCell/* default */.Z, {
914
- align: "right",
915
- children: "11 Days"
916
- })]
917
- }), /*#__PURE__*/(0,jsx_runtime_.jsxs)(TableRow/* default */.Z, {
918
- children: [/*#__PURE__*/(0,jsx_runtime_.jsxs)(TableCell/* default */.Z, {
919
- variant: "header",
920
- align: "left",
921
- children: [/*#__PURE__*/jsx_runtime_.jsx(Icon/* default */.Z, {
922
- "data-fs-accordion-item-button-icon": true,
923
- name: "CircleWavyCheck",
924
- width: 18,
925
- height: 18
926
- }), "Estimated"]
927
- }), /*#__PURE__*/jsx_runtime_.jsx(TableCell/* default */.Z, {
928
- align: "right",
929
- children: "Nov 10th"
930
- })]
931
- })]
932
- })
933
- })
934
- })]
935
- }), /*#__PURE__*/(0,jsx_runtime_.jsxs)(AccordionItem/* default */.Z, {
936
- as: "article",
937
- className: "text__body",
938
- index: 2,
939
- "data-fs-product-details-highlights": true,
940
- prefixId: "product-description",
941
- children: [/*#__PURE__*/jsx_runtime_.jsx(AccordionButton/* default */.Z, {
942
- children: labels.highlights
943
- }), /*#__PURE__*/jsx_runtime_.jsx(AccordionPanel/* default */.Z, {
944
- children: /*#__PURE__*/(0,jsx_runtime_.jsxs)(List/* default */.Z, {
945
- marker: true,
946
- children: [/*#__PURE__*/jsx_runtime_.jsx("li", {
947
- children: "Industry-leading noise canceling with Dual Noise Sensor technology"
948
- }), /*#__PURE__*/jsx_runtime_.jsx("li", {
949
- children: "Next-level music with Edge-AI, co-developed with Sony Music Studios Tokyo"
950
- }), /*#__PURE__*/jsx_runtime_.jsx("li", {
951
- children: "Up to 30-hour battery life with quick charging (10 min charge for 5 hours of playback)"
952
- }), /*#__PURE__*/jsx_runtime_.jsx("li", {
953
- children: "Touch Sensor controls to pause play skip tracks, control volume, activate your voice assistant, and answer phone calls"
954
- }), /*#__PURE__*/jsx_runtime_.jsx("li", {
955
- children: "Speak-to-chat technology automatically reduces volume during conversations"
956
- }), /*#__PURE__*/jsx_runtime_.jsx("li", {
957
- children: "Superior call quality with precise voice pickup"
958
- }), /*#__PURE__*/jsx_runtime_.jsx("li", {
959
- children: "Wearing detection pauses playback when headphones are removed"
960
- }), /*#__PURE__*/jsx_runtime_.jsx("li", {
961
- children: "Seamless multiple-device pairing"
962
- }), /*#__PURE__*/jsx_runtime_.jsx("li", {
963
- children: "Adaptive Sound Control provides a personalized listening experience"
964
- }), /*#__PURE__*/jsx_runtime_.jsx("li", {
965
- children: "Updated design relieves pressure for long-lasting comfort"
966
- })]
967
- })
968
- })]
969
- }), /*#__PURE__*/(0,jsx_runtime_.jsxs)(AccordionItem/* default */.Z, {
970
- as: "article",
971
- index: 3,
972
- "data-fs-product-details-learn-more": true,
973
- prefixId: "product-description",
974
- children: [/*#__PURE__*/jsx_runtime_.jsx(AccordionButton/* default */.Z, {
975
- children: labels.learnMore
976
- }), /*#__PURE__*/jsx_runtime_.jsx(AccordionPanel/* default */.Z, {
977
- children: /*#__PURE__*/jsx_runtime_.jsx("p", {
978
- className: "text__body",
979
- children: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laboru."
980
- })
981
- })]
982
- })]
983
- })
984
- });
985
- }
986
-
987
- /* harmony default export */ const ProductDescription_ProductDescription = (ProductDescription);
988
- ;// CONCATENATED MODULE: ./src/components/ui/ProductDescription/index.ts
989
-
990
-
991
- /***/ }),
992
-
993
- /***/ 5218:
994
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
995
-
996
- "use strict";
997
-
998
- // EXPORTS
999
- __webpack_require__.d(__webpack_exports__, {
1000
- "m": () => (/* reexport */ ProductDetails_ProductDetailsSettings)
1001
- });
1002
-
1003
- // UNUSED EXPORTS: AddToCartLoadingSkeleton
1004
-
1005
- // EXTERNAL MODULE: ../components/dist/molecules/QuantitySelector/QuantitySelector.js
1006
- var QuantitySelector = __webpack_require__(123);
1007
- // EXTERNAL MODULE: external "react"
1008
- var external_react_ = __webpack_require__(6689);
1009
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
1010
- // EXTERNAL MODULE: ../components/dist/atoms/Button/Button.js
1011
- var Button = __webpack_require__(7578);
1012
- ;// CONCATENATED MODULE: ../components/dist/molecules/BuyButton/BuyButton.js
1013
-
1014
-
1015
- function BuyButton({ testId = 'fs-buy-button', icon, children, ...otherProps }) {
1016
- return (external_react_default().createElement(Button/* default */.Z, { "data-fs-buy-button": true, icon: icon, iconPosition: "left", "data-testid": testId, ...otherProps }, children));
1017
- }
1018
- /* harmony default export */ const BuyButton_BuyButton = (BuyButton);
1019
- //# sourceMappingURL=BuyButton.js.map
1020
- // EXTERNAL MODULE: ../components/dist/atoms/Icon/Icon.js
1021
- var Icon = __webpack_require__(5045);
1022
- // EXTERNAL MODULE: ../sdk/dist/analytics/sendAnalyticsEvent.js
1023
- var sendAnalyticsEvent = __webpack_require__(1072);
1024
- // EXTERNAL MODULE: ./src/sdk/session/index.ts + 1 modules
1025
- var session = __webpack_require__(7295);
1026
- // EXTERNAL MODULE: ../components/dist/hooks/UIProvider.js
1027
- var UIProvider = __webpack_require__(395);
1028
- // EXTERNAL MODULE: ./src/sdk/cart/index.ts + 1 modules
1029
- var cart = __webpack_require__(6073);
1030
- ;// CONCATENATED MODULE: ./src/sdk/cart/useBuyButton.ts
1031
-
1032
-
1033
-
1034
-
1035
-
1036
- const useBuyButton = item => {
1037
- const {
1038
- openCart
1039
- } = (0,UIProvider/* useUI */.l)();
1040
- const {
1041
- currency: {
1042
- code
1043
- }
1044
- } = (0,session/* useSession */.kP)();
1045
- const onClick = (0,external_react_.useCallback)(e => {
1046
- e.preventDefault();
1047
-
1048
- if (!item) {
1049
- return;
1050
- }
1051
-
1052
- (0,sendAnalyticsEvent/* sendAnalyticsEvent */._)({
1053
- name: 'add_to_cart',
1054
- params: {
1055
- currency: code,
1056
- // TODO: In the future, we can explore more robust ways of
1057
- // calculating the value (gift items, discounts, etc.).
1058
- value: item.price * item.quantity,
1059
- items: [{
1060
- item_id: item.itemOffered.isVariantOf.productGroupID,
1061
- item_name: item.itemOffered.isVariantOf.name,
1062
- item_brand: item.itemOffered.brand.name,
1063
- item_variant: item.itemOffered.sku,
1064
- quantity: item.quantity,
1065
- price: item.price,
1066
- discount: item.listPrice - item.price,
1067
- currency: code,
1068
- item_variant_name: item.itemOffered.name,
1069
- product_reference_id: item.itemOffered.gtin
1070
- }]
1071
- }
1072
- });
1073
- cart/* cartStore.addItem */.i8.addItem(item);
1074
- openCart();
1075
- }, [code, item, openCart]);
1076
- return {
1077
- onClick,
1078
- 'data-testid': 'buy-button',
1079
- 'data-sku': item?.itemOffered.sku,
1080
- 'data-seller': item?.seller.identifier
1081
- };
1082
- };
1083
- // EXTERNAL MODULE: ./src/sdk/product/useFormattedPrice.ts
1084
- var useFormattedPrice = __webpack_require__(5346);
1085
- // EXTERNAL MODULE: ../components/dist/atoms/Label/Label.js
1086
- var Label = __webpack_require__(7216);
1087
- // EXTERNAL MODULE: ../components/dist/atoms/Link/Link.js
1088
- var Link = __webpack_require__(7865);
1089
- // EXTERNAL MODULE: ../components/dist/atoms/SROnly/SROnly.js
1090
- var SROnly = __webpack_require__(2691);
1091
- ;// CONCATENATED MODULE: ../components/dist/molecules/SkuSelector/useDefineVariant.js
1092
-
1093
- const getImageName = (src) => {
1094
- const sourcePath = new URL(src).pathname;
1095
- const imageName = sourcePath.split('/').slice(-1)[0];
1096
- return imageName;
1097
- };
1098
- const useDefineVariant = (options, variant) => (0,external_react_.useMemo)(() => {
1099
- if (variant)
1100
- return variant;
1101
- const allOptionsHaveHexColor = options.every((option) => option.hexColor);
1102
- if (allOptionsHaveHexColor) {
1103
- return 'color';
1104
- }
1105
- const firstImageName = options[0]?.src && getImageName(options[0].src);
1106
- const areSourcesEqualsOrNull = options.every((option) => {
1107
- if (!option.src) {
1108
- return true;
1109
- }
1110
- const optionImageName = getImageName(option.src);
1111
- return optionImageName === firstImageName;
1112
- });
1113
- if (!areSourcesEqualsOrNull) {
1114
- return 'image';
1115
- }
1116
- return 'label';
1117
- }, [options, variant]);
1118
- //# sourceMappingURL=useDefineVariant.js.map
1119
- ;// CONCATENATED MODULE: ../components/dist/molecules/SkuSelector/useSkuSlug.js
1120
-
1121
- function getSkuSlug(slugsMap, selectedVariations, dominantVariation) {
1122
- const slugsMapKey = Object.entries(selectedVariations).flat().join('-');
1123
- if (slugsMapKey in slugsMap) {
1124
- return slugsMap[slugsMapKey];
1125
- }
1126
- const possibleVariants = Object.keys(slugsMap);
1127
- const firstVariationForDominantValue = possibleVariants.find((slug) => slug.includes(`${dominantVariation}-${selectedVariations[dominantVariation]}`));
1128
- return slugsMap[firstVariationForDominantValue ?? possibleVariants[0]];
1129
- }
1130
- const useSkuSlug = (activeVariations, slugsMap, skuPropertyName, getItemHrefProp) => {
1131
- const getItemHref = (0,external_react_.useCallback)((option) => {
1132
- if (getItemHrefProp)
1133
- return { getItemHrefProp };
1134
- const currentItemHref = `/${getSkuSlug(slugsMap, {
1135
- ...activeVariations,
1136
- [skuPropertyName]: option.value,
1137
- }, skuPropertyName)}/p`;
1138
- return currentItemHref;
1139
- }, [activeVariations, getItemHrefProp, slugsMap, skuPropertyName]);
1140
- return { getItemHref };
1141
- };
1142
- //# sourceMappingURL=useSkuSlug.js.map
1143
- ;// CONCATENATED MODULE: ../components/dist/molecules/SkuSelector/SkuSelector.js
1144
-
1145
-
1146
-
1147
-
1148
- // TODO: Change by ImageComponent when it be right
1149
- const ImageComponentFallback = ({ src, alt, ...otherProps }) => external_react_default().createElement("img", { src: src, alt: alt, ...otherProps });
1150
- const SkuSelector = (0,external_react_.forwardRef)(function SkuSelector({ availableVariations, skuPropertyName, testId, activeVariations, linkProps, slugsMap, getItemHref: getItemHrefProp, ImageComponent = ImageComponentFallback, variant: variantProp, ...otherProps }, ref) {
1151
- const activeSelectorValue = activeVariations[skuPropertyName];
1152
- const options = availableVariations[skuPropertyName];
1153
- const variant = useDefineVariant(options, variantProp);
1154
- const { getItemHref } = useSkuSlug(activeVariations, slugsMap, skuPropertyName, getItemHrefProp);
1155
- return (external_react_default().createElement("div", { ref: ref, "data-fs-sku-selector": true, "data-testid": testId, "data-fs-sku-selector-variant": variant, ...otherProps },
1156
- skuPropertyName && (external_react_default().createElement(Label/* default */.Z, { "data-fs-sku-selector-title": true },
1157
- skuPropertyName,
1158
- ": ",
1159
- external_react_default().createElement("strong", null, activeSelectorValue))),
1160
- external_react_default().createElement("ul", { "data-fs-sku-selector-list": true }, options.map((option, index) => {
1161
- 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] },
1162
- external_react_default().createElement(Link/* default */.Z, { "data-fs-sku-selector-option-link": true, href: getItemHref(option), ...linkProps },
1163
- external_react_default().createElement(SROnly/* default */.Z, { text: option.label })),
1164
- variant === 'label' && external_react_default().createElement("span", null, option.value),
1165
- variant === 'image' && ImageComponent && (external_react_default().createElement("span", null,
1166
- external_react_default().createElement(ImageComponent, { src: option.src ?? '', alt: option.alt ?? '', "data-fs-sku-selector-option-image": true }))),
1167
- variant === 'color' && (external_react_default().createElement("span", null,
1168
- external_react_default().createElement("div", { "data-fs-sku-selector-option-color": true, title: option.value, style: {
1169
- '--data-fs-sku-selector-option-color-bkg-color': option.hexColor,
1170
- } })))));
1171
- }))));
1172
- });
1173
- /* harmony default export */ const SkuSelector_SkuSelector = (SkuSelector);
1174
- //# sourceMappingURL=SkuSelector.js.map
1175
- // EXTERNAL MODULE: ./node_modules/next/link.js
1176
- var next_link = __webpack_require__(1664);
1177
- var link_default = /*#__PURE__*/__webpack_require__.n(next_link);
1178
- // EXTERNAL MODULE: ./src/components/ui/Image/index.ts + 2 modules
1179
- var Image = __webpack_require__(9266);
1180
- // EXTERNAL MODULE: external "react/jsx-runtime"
1181
- var jsx_runtime_ = __webpack_require__(997);
1182
- ;// CONCATENATED MODULE: ./src/components/ui/SkuSelector/Selectors.tsx
1183
- const _excluded = ["src", "alt"],
1184
- _excluded2 = ["slugsMap", "activeVariations", "availableVariations"];
1185
-
1186
- 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; }
1187
-
1188
- 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; }
1189
-
1190
- 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; }
1191
-
1192
- 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; }
1193
-
1194
- 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; }
1195
-
1196
-
1197
-
1198
-
1199
-
1200
-
1201
- const ImageComponent = _ref => {
1202
- let {
1203
- src,
1204
- alt
1205
- } = _ref,
1206
- otherProps = _objectWithoutProperties(_ref, _excluded);
1207
-
1208
- return /*#__PURE__*/jsx_runtime_.jsx(Image/* Image */.E, _objectSpread({
1209
- src: src,
1210
- alt: alt,
1211
- width: 34,
1212
- height: 34
1213
- }, otherProps));
1214
- };
1215
-
1216
- function Selectors(_ref2) {
1217
- let {
1218
- slugsMap,
1219
- activeVariations,
1220
- availableVariations
1221
- } = _ref2,
1222
- otherProps = _objectWithoutProperties(_ref2, _excluded2);
1223
-
1224
- return /*#__PURE__*/jsx_runtime_.jsx("section", _objectSpread(_objectSpread({}, otherProps), {}, {
1225
- children: availableVariations && Object.keys(availableVariations).map(skuVariant => /*#__PURE__*/jsx_runtime_.jsx(SkuSelector_SkuSelector, {
1226
- skuPropertyName: skuVariant,
1227
- availableVariations: availableVariations,
1228
- ImageComponent: ImageComponent,
1229
- activeVariations: activeVariations,
1230
- slugsMap: slugsMap,
1231
- linkProps: {
1232
- as: (link_default()),
1233
- legacyBehavior: false
1234
- }
1235
- }, skuVariant))
1236
- }));
1237
- }
1238
-
1239
- /* harmony default export */ const SkuSelector_Selectors = (Selectors);
1240
- ;// CONCATENATED MODULE: ./src/components/ui/SkuSelector/index.ts
1241
-
1242
- ;// CONCATENATED MODULE: ./src/components/ui/ProductDetails/AddToCartLoadingSkeleton.tsx
1243
-
1244
-
1245
- function AddToCartLoadingSkeleton() {
1246
- return (
1247
- /*#__PURE__*/
1248
- // Generated via https://skeletonreact.com/.
1249
- (0,jsx_runtime_.jsxs)("svg", {
1250
- role: "img",
1251
- width: "100%",
1252
- height: "48",
1253
- "aria-labelledby": "loading-aria",
1254
- viewBox: "0 0 112 48",
1255
- preserveAspectRatio: "none",
1256
- children: [/*#__PURE__*/jsx_runtime_.jsx("title", {
1257
- id: "loading-aria",
1258
- children: "Loading..."
1259
- }), /*#__PURE__*/jsx_runtime_.jsx("rect", {
1260
- x: "0",
1261
- y: "0",
1262
- width: "100%",
1263
- height: "100%",
1264
- clipPath: "url(#clip-path)",
1265
- style: {
1266
- fill: 'url("#fill")'
1267
- }
1268
- }), /*#__PURE__*/(0,jsx_runtime_.jsxs)("defs", {
1269
- children: [/*#__PURE__*/jsx_runtime_.jsx("clipPath", {
1270
- id: "clip-path",
1271
- children: /*#__PURE__*/jsx_runtime_.jsx("rect", {
1272
- x: "0",
1273
- y: "0",
1274
- rx: "2",
1275
- ry: "2",
1276
- width: "112",
1277
- height: "48"
1278
- })
1279
- }), /*#__PURE__*/(0,jsx_runtime_.jsxs)("linearGradient", {
1280
- id: "fill",
1281
- children: [/*#__PURE__*/jsx_runtime_.jsx("stop", {
1282
- offset: "0.599964",
1283
- stopColor: "#f3f3f3",
1284
- stopOpacity: "1",
1285
- children: /*#__PURE__*/jsx_runtime_.jsx("animate", {
1286
- attributeName: "offset",
1287
- values: "-2; -2; 1",
1288
- keyTimes: "0; 0.25; 1",
1289
- dur: "2s",
1290
- repeatCount: "indefinite"
1291
- })
1292
- }), /*#__PURE__*/jsx_runtime_.jsx("stop", {
1293
- offset: "1.59996",
1294
- stopColor: "#ecebeb",
1295
- stopOpacity: "1",
1296
- children: /*#__PURE__*/jsx_runtime_.jsx("animate", {
1297
- attributeName: "offset",
1298
- values: "-1; -1; 2",
1299
- keyTimes: "0; 0.25; 1",
1300
- dur: "2s",
1301
- repeatCount: "indefinite"
1302
- })
1303
- }), /*#__PURE__*/jsx_runtime_.jsx("stop", {
1304
- offset: "2.59996",
1305
- stopColor: "#f3f3f3",
1306
- stopOpacity: "1",
1307
- children: /*#__PURE__*/jsx_runtime_.jsx("animate", {
1308
- attributeName: "offset",
1309
- values: "0; 0; 3",
1310
- keyTimes: "0; 0.25; 1",
1311
- dur: "2s",
1312
- repeatCount: "indefinite"
1313
- })
1314
- })]
1315
- })]
1316
- })]
1317
- })
1318
- );
1319
- }
1320
- // EXTERNAL MODULE: ../components/dist/atoms/Price/Price.js
1321
- var Price = __webpack_require__(7549);
1322
- // EXTERNAL MODULE: ../components/dist/molecules/DiscountBadge/DiscountBadge.js + 1 modules
1323
- var DiscountBadge = __webpack_require__(9875);
1324
- ;// CONCATENATED MODULE: ./src/customizations/components/overrides/ProductDetails.tsx
1325
- const SECTION = "ProductDetails";
1326
- const overrides = {
1327
- name: SECTION,
1328
- components: {}
1329
- };
1330
- /* harmony default export */ const ProductDetails = (overrides);
1331
- ;// CONCATENATED MODULE: ./src/components/sections/ProductDetails/Overrides.tsx
1332
- function Overrides_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; }
1333
-
1334
- function Overrides_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? Overrides_ownKeys(Object(source), !0).forEach(function (key) { Overrides_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : Overrides_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1335
-
1336
- function Overrides_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; }
1337
-
1338
-
1339
-
1340
-
1341
- const Components = Overrides_objectSpread({
1342
- Price: Price/* default */.Z,
1343
- DiscountBadge: DiscountBadge/* default */.Z
1344
- }, ProductDetails.components);
1345
-
1346
-
1347
- ;// CONCATENATED MODULE: ./src/components/ui/ProductDetails/ProductDetailsSettings.tsx
1348
- 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; }
1349
-
1350
- 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; }
1351
-
1352
- 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; }
1353
-
1354
-
1355
-
1356
-
1357
-
1358
-
1359
-
1360
-
1361
-
1362
-
1363
- const {
1364
- Price: ProductDetailsSettings_Price
1365
- } = Components;
1366
-
1367
- function ProductDetailsSettings({
1368
- product,
1369
- buyButtonTitle,
1370
- isValidating,
1371
- quantity,
1372
- setQuantity,
1373
- buyButtonIcon: {
1374
- icon: buyButtonIconName,
1375
- alt: buyButtonIconAlt
1376
- }
1377
- }) {
1378
- const {
1379
- id,
1380
- sku,
1381
- gtin,
1382
- name: variantName,
1383
- brand,
1384
- isVariantOf,
1385
- isVariantOf: {
1386
- skuVariants
1387
- },
1388
- image: productImages,
1389
- additionalProperty,
1390
- offers: {
1391
- lowPrice,
1392
- offers: [{
1393
- availability,
1394
- price,
1395
- listPrice,
1396
- seller
1397
- }]
1398
- }
1399
- } = product;
1400
- const buyDisabled = availability !== 'https://schema.org/InStock';
1401
- const buyProps = useBuyButton({
1402
- id,
1403
- price,
1404
- listPrice,
1405
- seller,
1406
- quantity,
1407
- itemOffered: {
1408
- sku,
1409
- name: variantName,
1410
- gtin,
1411
- image: productImages,
1412
- brand,
1413
- isVariantOf,
1414
- additionalProperty
1415
- }
1416
- });
1417
- return /*#__PURE__*/(0,jsx_runtime_.jsxs)(jsx_runtime_.Fragment, {
1418
- children: [/*#__PURE__*/(0,jsx_runtime_.jsxs)("section", {
1419
- "data-fs-product-details-values": true,
1420
- children: [/*#__PURE__*/(0,jsx_runtime_.jsxs)("div", {
1421
- "data-fs-product-details-prices": true,
1422
- children: [/*#__PURE__*/jsx_runtime_.jsx(ProductDetailsSettings_Price, {
1423
- value: listPrice,
1424
- formatter: useFormattedPrice/* useFormattedPrice */.P,
1425
- testId: "list-price",
1426
- "data-value": listPrice,
1427
- variant: "listing",
1428
- SRText: "Original price:"
1429
- }), /*#__PURE__*/jsx_runtime_.jsx(ProductDetailsSettings_Price, {
1430
- value: lowPrice,
1431
- formatter: useFormattedPrice/* useFormattedPrice */.P,
1432
- testId: "price",
1433
- "data-value": lowPrice,
1434
- variant: "spot",
1435
- className: "text__lead",
1436
- SRText: "Sale Price:"
1437
- })]
1438
- }), /*#__PURE__*/jsx_runtime_.jsx(QuantitySelector/* default */.Z, {
1439
- min: 1,
1440
- max: 10,
1441
- onChange: setQuantity
1442
- })]
1443
- }), skuVariants && /*#__PURE__*/jsx_runtime_.jsx(SkuSelector_Selectors, {
1444
- slugsMap: skuVariants.slugsMap,
1445
- availableVariations: skuVariants.availableVariations,
1446
- activeVariations: skuVariants.activeVariations,
1447
- "data-fs-product-details-selectors": true
1448
- }),
1449
- /* NOTE: A loading skeleton had to be used to avoid a Lighthouse's
1450
- non-composited animation violation due to the button transitioning its
1451
- background color when changing from its initial disabled to active state.
1452
- See full explanation on commit https://git.io/JyXV5. */
1453
- isValidating ? /*#__PURE__*/jsx_runtime_.jsx(AddToCartLoadingSkeleton, {}) : /*#__PURE__*/jsx_runtime_.jsx(BuyButton_BuyButton, ProductDetailsSettings_objectSpread(ProductDetailsSettings_objectSpread({
1454
- disabled: buyDisabled,
1455
- icon: /*#__PURE__*/jsx_runtime_.jsx(Icon/* default */.Z, {
1456
- "aria-label": buyButtonIconAlt,
1457
- name: buyButtonIconName
1458
- })
1459
- }, buyProps), {}, {
1460
- children: buyButtonTitle
1461
- }))]
1462
- });
1463
- }
1464
-
1465
- /* harmony default export */ const ProductDetails_ProductDetailsSettings = (ProductDetailsSettings);
1466
- ;// CONCATENATED MODULE: ./src/components/ui/ProductDetails/index.ts
1467
-
1468
-
1469
-
1470
- /***/ }),
1471
-
1472
- /***/ 104:
1473
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1474
-
1475
- "use strict";
1476
-
1477
- // EXPORTS
1478
- __webpack_require__.d(__webpack_exports__, {
1479
- "Z": () => (/* reexport */ ShippingSimulation_ShippingSimulation_ShippingSimulation)
1480
- });
1481
-
1482
- // EXTERNAL MODULE: external "react"
1483
- var external_react_ = __webpack_require__(6689);
1484
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
1485
- // EXTERNAL MODULE: ../components/dist/molecules/InputField/InputField.js
1486
- var InputField = __webpack_require__(8287);
1487
- // EXTERNAL MODULE: ../components/dist/atoms/Link/Link.js
1488
- var Link = __webpack_require__(7865);
1489
- // EXTERNAL MODULE: ../components/dist/atoms/Icon/Icon.js
1490
- var Icon = __webpack_require__(5045);
1491
- // EXTERNAL MODULE: ../components/dist/molecules/Table/Table.js
1492
- var Table = __webpack_require__(4707);
1493
- // EXTERNAL MODULE: ../components/dist/molecules/Table/TableBody.js
1494
- var TableBody = __webpack_require__(1566);
1495
- // EXTERNAL MODULE: ../components/dist/molecules/Table/TableRow.js
1496
- var TableRow = __webpack_require__(6037);
1497
- // EXTERNAL MODULE: ../components/dist/molecules/Table/TableCell.js
1498
- var TableCell = __webpack_require__(3111);
1499
- // EXTERNAL MODULE: ../components/dist/atoms/Price/Price.js
1500
- var Price = __webpack_require__(7549);
1501
- ;// CONCATENATED MODULE: ../components/dist/organisms/ShippingSimulation/ShippingSimulation.js
1502
-
1503
-
1504
- 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 }) {
1505
- const hasShippingOptions = !!options && options.length > 0;
1506
- return (external_react_default().createElement("section", { "data-fs-shipping-simulation": true, "data-fs-shipping-simulation-empty": !hasShippingOptions ? 'true' : 'false', "data-testid": testId, ...otherProps },
1507
- external_react_default().createElement("h2", { "data-fs-shipping-simulation-title": true }, title),
1508
- 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 }),
1509
- 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,
1510
- "I don't know my Postal Code",
1511
- external_react_default().createElement(Icon/* default */.Z, { name: "ArrowSquareOut", width: 20, height: 20 })))),
1512
- hasShippingOptions && (external_react_default().createElement((external_react_default()).Fragment, null,
1513
- external_react_default().createElement("header", { "data-fs-shipping-simulation-header": true },
1514
- external_react_default().createElement("h3", { "data-fs-shipping-simulation-subtitle": true }, optionsLabel),
1515
- external_react_default().createElement("p", { "data-fs-shipping-simulation-location": true }, location)),
1516
- external_react_default().createElement(Table/* default */.Z, null,
1517
- external_react_default().createElement(TableBody/* default */.Z, null, options.map((option) => (external_react_default().createElement(TableRow/* default */.Z, { key: option.carrier },
1518
- external_react_default().createElement(TableCell/* default */.Z, { align: "left" }, option.carrier),
1519
- external_react_default().createElement(TableCell/* default */.Z, null, option.localizedEstimates),
1520
- external_react_default().createElement(TableCell/* default */.Z, { align: "right" }, option.price && (external_react_default().createElement(Price/* default */.Z, { formatter: formatter, value: option.price, SRText: "price" }))))))))))));
1521
- }
1522
- /* harmony default export */ const ShippingSimulation_ShippingSimulation = (ShippingSimulation);
1523
- //# sourceMappingURL=ShippingSimulation.js.map
1524
- // EXTERNAL MODULE: ./src/sdk/graphql/request.ts
1525
- var request = __webpack_require__(180);
1526
- ;// CONCATENATED MODULE: ./src/sdk/shipping/index.ts
1527
-
1528
- const query = "ShippingSimulationQuery";
1529
- const getShippingSimulation = async ({
1530
- items,
1531
- postalCode,
1532
- country
1533
- }) => {
1534
- const data = await (0,request/* request */.W)(query, {
1535
- items,
1536
- postalCode,
1537
- country
1538
- });
1539
- return data.shipping;
1540
- };
1541
- /* harmony default export */ const shipping = ((/* unused pure expression or super */ null && (getShippingSimulation)));
1542
- // EXTERNAL MODULE: ./src/sdk/session/index.ts + 1 modules
1543
- var session = __webpack_require__(7295);
1544
- ;// CONCATENATED MODULE: ./src/components/ui/ShippingSimulation/useShippingSimulation.ts
1545
- 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; }
1546
-
1547
- 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; }
1548
-
1549
- 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; }
1550
-
1551
-
1552
-
1553
- const createEmptySimulation = () => ({
1554
- input: {
1555
- postalCode: '',
1556
- displayClearButton: false,
1557
- errorMessage: ''
1558
- },
1559
- shippingSimulation: {
1560
- location: '',
1561
- options: []
1562
- }
1563
- });
1564
-
1565
- const reducer = (state, action) => {
1566
- const {
1567
- type
1568
- } = action;
1569
-
1570
- switch (type) {
1571
- case 'clear':
1572
- {
1573
- return createEmptySimulation();
1574
- }
1575
-
1576
- case 'update':
1577
- {
1578
- const {
1579
- payload
1580
- } = action;
1581
- return {
1582
- input: _objectSpread(_objectSpread({}, state.input), payload.input),
1583
- shippingSimulation: _objectSpread(_objectSpread({}, state.shippingSimulation), payload.shippingSimulation)
1584
- };
1585
- }
1586
-
1587
- case 'onInput':
1588
- {
1589
- const {
1590
- payload
1591
- } = action;
1592
- return _objectSpread(_objectSpread({}, state), {}, {
1593
- input: _objectSpread({}, payload)
1594
- });
1595
- }
1596
-
1597
- case 'onError':
1598
- {
1599
- const {
1600
- payload
1601
- } = action;
1602
- return _objectSpread(_objectSpread({}, state), {}, {
1603
- input: _objectSpread(_objectSpread({}, state.input), payload)
1604
- });
1605
- }
1606
-
1607
- default:
1608
- throw new Error(`Action ${type} not implemented`);
1609
- }
1610
- };
1611
-
1612
- const useShippingSimulation = (shippingItem, fetchShippingSimulationFn, sessionPostalCode, country) => {
1613
- const {
1614
- 0: {
1615
- input,
1616
- shippingSimulation
1617
- },
1618
- 1: dispatch
1619
- } = (0,external_react_.useReducer)(reducer, null, createEmptySimulation);
1620
- const {
1621
- postalCode: shippingPostalCode
1622
- } = input;
1623
- (0,external_react_.useEffect)(() => {
1624
- if (!sessionPostalCode || shippingPostalCode) {
1625
- return;
1626
- } // Use sessionPostalCode if there is no shippingPostalCode
1627
-
1628
-
1629
- async function fetchShipping() {
1630
- const [location, options] = await fetchShippingSimulationFn(shippingItem, country, sessionPostalCode ?? '');
1631
- dispatch({
1632
- type: 'update',
1633
- payload: {
1634
- input: {
1635
- postalCode: sessionPostalCode ?? '',
1636
- displayClearButton: true,
1637
- errorMessage: ''
1638
- },
1639
- shippingSimulation: {
1640
- location,
1641
- options
1642
- }
1643
- }
1644
- });
1645
- }
1646
-
1647
- fetchShipping();
1648
- }, [country, fetchShippingSimulationFn, sessionPostalCode, shippingItem, shippingPostalCode]);
1649
- const handleSubmit = (0,external_react_.useCallback)(async () => {
1650
- try {
1651
- const [location, options] = await fetchShippingSimulationFn(shippingItem, country, shippingPostalCode ?? '');
1652
- dispatch({
1653
- type: 'update',
1654
- payload: {
1655
- input: {
1656
- displayClearButton: true,
1657
- errorMessage: ''
1658
- },
1659
- shippingSimulation: {
1660
- location,
1661
- options
1662
- }
1663
- }
1664
- });
1665
- } catch (error) {
1666
- dispatch({
1667
- type: 'onError',
1668
- payload: {
1669
- displayClearButton: true,
1670
- errorMessage: 'You entered an invalid Postal Code'
1671
- }
1672
- });
1673
- }
1674
- }, [country, fetchShippingSimulationFn, shippingItem, shippingPostalCode]);
1675
- const handleOnInput = (0,external_react_.useCallback)(e => {
1676
- const currentValue = e.currentTarget.value;
1677
-
1678
- if (currentValue) {
1679
- dispatch({
1680
- type: 'onInput',
1681
- payload: {
1682
- postalCode: currentValue,
1683
- displayClearButton: false,
1684
- errorMessage: ''
1685
- }
1686
- });
1687
- } else {
1688
- dispatch({
1689
- type: 'clear'
1690
- });
1691
- }
1692
- }, []);
1693
- return {
1694
- input,
1695
- shippingSimulation,
1696
- handleOnClear: () => {
1697
- dispatch({
1698
- type: 'clear'
1699
- });
1700
- },
1701
- handleSubmit,
1702
- handleOnInput
1703
- };
1704
- };
1705
- // EXTERNAL MODULE: external "react/jsx-runtime"
1706
- var jsx_runtime_ = __webpack_require__(997);
1707
- ;// CONCATENATED MODULE: ./src/components/ui/ShippingSimulation/ShippingSimulation.tsx
1708
- const _excluded = ["productShippingInfo", "formatter", "inputLabel", "title", "idkPostalCodeLinkProps"];
1709
-
1710
- 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; }
1711
-
1712
- 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; }
1713
-
1714
- 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; }
1715
-
1716
- 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; }
1717
-
1718
- 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; }
1719
-
1720
-
1721
-
1722
-
1723
-
1724
-
1725
-
1726
- const fetchShippingSimulation = async (shippingItem, country, postalCode) => {
1727
- const shipping = await getShippingSimulation({
1728
- country,
1729
- postalCode: postalCode,
1730
- items: [shippingItem]
1731
- });
1732
- const location = [shipping?.address?.neighborhood, shipping?.address?.city].filter(Boolean).join(' / ') ?? '';
1733
- const options = shipping?.logisticsInfo?.[0]?.slas ?? [];
1734
- return [location, options];
1735
- };
1736
-
1737
- function ShippingSimulation_ShippingSimulation_ShippingSimulation(_ref) {
1738
- let {
1739
- productShippingInfo,
1740
- formatter,
1741
- inputLabel,
1742
- title,
1743
- idkPostalCodeLinkProps
1744
- } = _ref,
1745
- otherProps = _objectWithoutProperties(_ref, _excluded);
1746
-
1747
- const {
1748
- country,
1749
- postalCode: sessionPostalCode
1750
- } = (0,session/* useSession */.kP)();
1751
- const {
1752
- input,
1753
- shippingSimulation,
1754
- handleSubmit,
1755
- handleOnInput,
1756
- handleOnClear
1757
- } = useShippingSimulation(productShippingInfo, fetchShippingSimulation, sessionPostalCode, country);
1758
- const {
1759
- postalCode,
1760
- displayClearButton,
1761
- errorMessage
1762
- } = input;
1763
- const {
1764
- location,
1765
- options
1766
- } = shippingSimulation;
1767
- return /*#__PURE__*/jsx_runtime_.jsx(ShippingSimulation_ShippingSimulation, ShippingSimulation_objectSpread({
1768
- formatter: formatter,
1769
- onInput: handleOnInput,
1770
- onSubmit: handleSubmit,
1771
- onClear: handleOnClear,
1772
- location: location,
1773
- options: options,
1774
- displayClearButton: displayClearButton,
1775
- errorMessage: errorMessage,
1776
- postalCode: postalCode,
1777
- inputLabel: inputLabel,
1778
- title: title,
1779
- idkPostalCodeLinkProps: idkPostalCodeLinkProps
1780
- }, otherProps));
1781
- }
1782
- ;// CONCATENATED MODULE: ./src/components/ui/ShippingSimulation/index.ts
1783
-
1784
-
1785
- /***/ }),
1786
-
1787
- /***/ 4601:
1788
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
1789
-
1790
- "use strict";
1791
- __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
1792
- __webpack_require__.r(__webpack_exports__);
1793
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1794
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
1795
- /* harmony export */ "getStaticPaths": () => (/* binding */ getStaticPaths),
1796
- /* harmony export */ "getStaticProps": () => (/* binding */ getStaticProps)
1797
- /* harmony export */ });
1798
- /* harmony import */ var _faststore_api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4826);
1799
- /* harmony import */ var next_seo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6641);
1800
- /* harmony import */ var next_seo__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_seo__WEBPACK_IMPORTED_MODULE_1__);
1801
- /* harmony import */ var src_components_cms_RenderSections__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2224);
1802
- /* harmony import */ var src_components_sections_BannerNewsletter_BannerNewsletter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2951);
1803
- /* harmony import */ var src_components_sections_Breadcrumb__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2874);
1804
- /* harmony import */ var src_components_sections_CrossSellingShelf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7990);
1805
- /* harmony import */ var src_components_sections_ProductDetails__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(3220);
1806
- /* harmony import */ var src_customizations_components__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(859);
1807
- /* harmony import */ var src_sdk_session__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(7295);
1808
- /* harmony import */ var src_sdk_tests_mark__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2541);
1809
- /* harmony import */ var src_server__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(9685);
1810
- /* harmony import */ var src_server_cms__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(5764);
1811
- /* harmony import */ var src_components_cms_GlobalSections__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(4074);
1812
- /* harmony import */ var _faststore_config__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(7183);
1813
- /* harmony import */ var _faststore_config__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_faststore_config__WEBPACK_IMPORTED_MODULE_13__);
1814
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(997);
1815
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__);
1816
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([src_components_cms_RenderSections__WEBPACK_IMPORTED_MODULE_2__, src_components_sections_BannerNewsletter_BannerNewsletter__WEBPACK_IMPORTED_MODULE_3__, src_components_sections_CrossSellingShelf__WEBPACK_IMPORTED_MODULE_5__, src_components_sections_ProductDetails__WEBPACK_IMPORTED_MODULE_6__, src_server__WEBPACK_IMPORTED_MODULE_10__, src_components_cms_GlobalSections__WEBPACK_IMPORTED_MODULE_12__]);
1817
- ([src_components_cms_RenderSections__WEBPACK_IMPORTED_MODULE_2__, src_components_sections_BannerNewsletter_BannerNewsletter__WEBPACK_IMPORTED_MODULE_3__, src_components_sections_CrossSellingShelf__WEBPACK_IMPORTED_MODULE_5__, src_components_sections_ProductDetails__WEBPACK_IMPORTED_MODULE_6__, src_server__WEBPACK_IMPORTED_MODULE_10__, src_components_cms_GlobalSections__WEBPACK_IMPORTED_MODULE_12__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
1818
- 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; }
1819
-
1820
- 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; }
1821
-
1822
- 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; }
1823
-
1824
-
1825
-
1826
-
1827
-
1828
-
1829
-
1830
-
1831
-
1832
-
1833
-
1834
-
1835
-
1836
-
1837
-
1838
- /**
1839
- * Sections: Components imported from each store's custom components and '../components/sections' only.
1840
- * Do not import or render components from any other folder in here.
1841
- */
1842
-
1843
-
1844
-
1845
-
1846
- const COMPONENTS = _objectSpread({
1847
- Breadcrumb: src_components_sections_Breadcrumb__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z,
1848
- ProductDetails: src_components_sections_ProductDetails__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z,
1849
- CrossSellingShelf: src_components_sections_CrossSellingShelf__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z,
1850
- BannerNewsletter: src_components_sections_BannerNewsletter_BannerNewsletter__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z
1851
- }, src_customizations_components__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z);
1852
-
1853
- function Page({
1854
- product,
1855
- sections,
1856
- globalSections
1857
- }) {
1858
- const {
1859
- currency
1860
- } = (0,src_sdk_session__WEBPACK_IMPORTED_MODULE_8__/* .useSession */ .kP)();
1861
- const {
1862
- seo
1863
- } = product;
1864
- const title = seo.title || (_faststore_config__WEBPACK_IMPORTED_MODULE_13___default().seo.title);
1865
- const description = seo.description || (_faststore_config__WEBPACK_IMPORTED_MODULE_13___default().seo.description);
1866
- const canonical = `${(_faststore_config__WEBPACK_IMPORTED_MODULE_13___default().storeUrl)}${seo.canonical}`;
1867
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)(src_components_cms_GlobalSections__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .ZP, _objectSpread(_objectSpread({}, globalSections), {}, {
1868
- children: [/*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx(next_seo__WEBPACK_IMPORTED_MODULE_1__.NextSeo, {
1869
- title: title,
1870
- description: description,
1871
- canonical: canonical,
1872
- openGraph: {
1873
- type: 'og:product',
1874
- url: canonical,
1875
- title,
1876
- description,
1877
- images: product.image.map(img => ({
1878
- url: img.url,
1879
- alt: img.alternateName
1880
- }))
1881
- },
1882
- additionalMetaTags: [{
1883
- property: 'product:price:amount',
1884
- content: product.offers.lowPrice?.toString() ?? undefined
1885
- }, {
1886
- property: 'product:price:currency',
1887
- content: currency.code
1888
- }]
1889
- }), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx(next_seo__WEBPACK_IMPORTED_MODULE_1__.BreadcrumbJsonLd, {
1890
- itemListElements: product.breadcrumbList.itemListElement
1891
- }), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx(next_seo__WEBPACK_IMPORTED_MODULE_1__.ProductJsonLd, {
1892
- productName: product.name,
1893
- description: product.description,
1894
- brand: product.brand.name,
1895
- sku: product.sku,
1896
- gtin: product.gtin,
1897
- releaseDate: product.releaseDate,
1898
- images: product.image.map(img => img.url) // Somehow, Google does not understand this valid Schema.org schema, so we need to do conversions
1899
- ,
1900
- offersType: "AggregateOffer",
1901
- offers: _objectSpread(_objectSpread(_objectSpread({}, product.offers), product.offers.offers[0]), {}, {
1902
- url: canonical
1903
- })
1904
- }), /*#__PURE__*/react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx(src_components_cms_RenderSections__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
1905
- context: product,
1906
- sections: sections,
1907
- components: COMPONENTS
1908
- })]
1909
- }));
1910
- }
1911
-
1912
- const query = "ServerProductPageQuery";
1913
- const getStaticProps = async ({
1914
- params,
1915
- previewData
1916
- }) => {
1917
- const slug = params?.slug ?? '';
1918
- const [searchResult, cmsPage, globalSections] = await Promise.all([(0,src_server__WEBPACK_IMPORTED_MODULE_10__/* .execute */ .h)({
1919
- variables: {
1920
- slug
1921
- },
1922
- operationName: query
1923
- }), (0,src_server_cms__WEBPACK_IMPORTED_MODULE_11__/* .getPage */ .f)(_objectSpread(_objectSpread({}, previewData?.contentType === 'pdp' ? previewData : null), {}, {
1924
- contentType: 'pdp'
1925
- })), (0,src_components_cms_GlobalSections__WEBPACK_IMPORTED_MODULE_12__/* .getGlobalSectionsData */ .Tc)(previewData)]);
1926
- const {
1927
- data,
1928
- errors = []
1929
- } = searchResult;
1930
- const notFound = errors.find(_faststore_api__WEBPACK_IMPORTED_MODULE_0__.isNotFoundError);
1931
-
1932
- if (notFound) {
1933
- return {
1934
- notFound: true
1935
- };
1936
- }
1937
-
1938
- if (errors.length > 0) {
1939
- throw errors[0];
1940
- }
1941
-
1942
- return {
1943
- props: _objectSpread(_objectSpread(_objectSpread({}, data), cmsPage), {}, {
1944
- globalSections
1945
- })
1946
- };
1947
- };
1948
- const getStaticPaths = async () => {
1949
- return {
1950
- paths: [],
1951
- fallback: 'blocking'
1952
- };
1953
- };
1954
- Page.displayName = 'Page';
1955
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,src_sdk_tests_mark__WEBPACK_IMPORTED_MODULE_9__/* .mark */ .B)(Page));
1956
- __webpack_async_result__();
1957
- } catch(e) { __webpack_async_result__(e); } });
1958
-
1959
- /***/ }),
1960
-
1961
- /***/ 3874:
1962
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
1963
-
1964
- "use strict";
1965
- __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
1966
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1967
- /* harmony export */ "i": () => (/* binding */ useProduct)
1968
- /* harmony export */ });
1969
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
1970
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1971
- /* harmony import */ var _graphql_useQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7732);
1972
- /* harmony import */ var _session__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7295);
1973
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_graphql_useQuery__WEBPACK_IMPORTED_MODULE_1__]);
1974
- _graphql_useQuery__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
1975
-
1976
-
1977
-
1978
- const query = "BrowserProductQuery";
1979
- const useProduct = (productID, fallbackData) => {
1980
- const {
1981
- channel,
1982
- locale
1983
- } = (0,_session__WEBPACK_IMPORTED_MODULE_2__/* .useSession */ .kP)();
1984
- const variables = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
1985
- if (!channel) {
1986
- throw new Error(`useProduct: 'channel' from session is an empty string.`);
1987
- }
1988
-
1989
- return {
1990
- locator: [{
1991
- key: 'id',
1992
- value: productID
1993
- }, {
1994
- key: 'channel',
1995
- value: channel
1996
- }, {
1997
- key: 'locale',
1998
- value: locale
1999
- }]
2000
- };
2001
- }, [channel, locale, productID]);
2002
- return (0,_graphql_useQuery__WEBPACK_IMPORTED_MODULE_1__/* .useQuery */ .aM)(query, variables, {
2003
- fallbackData,
2004
- revalidateOnMount: true
2005
- });
2006
- };
2007
- __webpack_async_result__();
2008
- } catch(e) { __webpack_async_result__(e); } });
2009
-
2010
- /***/ }),
2011
-
2012
- /***/ 5411:
2013
- /***/ ((module) => {
2014
-
2015
- // Exports
2016
- module.exports = {
2017
- "section": "section_section__pVnFl"
2018
- };
2019
-
2020
-
2021
- /***/ }),
2022
-
2023
- /***/ 9034:
2024
- /***/ ((module) => {
2025
-
2026
- // Exports
2027
- module.exports = {
2028
- "section": "section_section__XsOoR"
2029
- };
2030
-
2031
-
2032
- /***/ }),
2033
-
2034
- /***/ 5490:
2035
- /***/ ((module) => {
2036
-
2037
- "use strict";
2038
- module.exports = require("@faststore/graphql-utils");
2039
-
2040
- /***/ }),
2041
-
2042
- /***/ 6676:
2043
- /***/ ((module) => {
2044
-
2045
- "use strict";
2046
- module.exports = require("@vtex/client-cms");
2047
-
2048
- /***/ }),
2049
-
2050
- /***/ 2404:
2051
- /***/ ((module) => {
2052
-
2053
- "use strict";
2054
- module.exports = require("fast-deep-equal");
2055
-
2056
- /***/ }),
2057
-
2058
- /***/ 7343:
2059
- /***/ ((module) => {
2060
-
2061
- "use strict";
2062
- module.exports = require("graphql");
2063
-
2064
- /***/ }),
2065
-
2066
- /***/ 6548:
2067
- /***/ ((module) => {
2068
-
2069
- "use strict";
2070
- module.exports = require("graphql/language");
2071
-
2072
- /***/ }),
2073
-
2074
- /***/ 3430:
2075
- /***/ ((module) => {
2076
-
2077
- "use strict";
2078
- module.exports = require("idb-keyval");
2079
-
2080
- /***/ }),
2081
-
2082
- /***/ 7881:
2083
- /***/ ((module) => {
2084
-
2085
- "use strict";
2086
- module.exports = require("isomorphic-unfetch");
2087
-
2088
- /***/ }),
2089
-
2090
- /***/ 6641:
2091
- /***/ ((module) => {
2092
-
2093
- "use strict";
2094
- module.exports = require("next-seo");
2095
-
2096
- /***/ }),
2097
-
2098
- /***/ 3280:
2099
- /***/ ((module) => {
2100
-
2101
- "use strict";
2102
- module.exports = require("next/dist/shared/lib/app-router-context.js");
2103
-
2104
- /***/ }),
2105
-
2106
- /***/ 2796:
2107
- /***/ ((module) => {
2108
-
2109
- "use strict";
2110
- module.exports = require("next/dist/shared/lib/head-manager-context.js");
2111
-
2112
- /***/ }),
2113
-
2114
- /***/ 4957:
2115
- /***/ ((module) => {
2116
-
2117
- "use strict";
2118
- module.exports = require("next/dist/shared/lib/head.js");
2119
-
2120
- /***/ }),
2121
-
2122
- /***/ 3539:
2123
- /***/ ((module) => {
2124
-
2125
- "use strict";
2126
- module.exports = require("next/dist/shared/lib/i18n/detect-domain-locale.js");
2127
-
2128
- /***/ }),
2129
-
2130
- /***/ 4014:
2131
- /***/ ((module) => {
2132
-
2133
- "use strict";
2134
- module.exports = require("next/dist/shared/lib/i18n/normalize-locale-path.js");
2135
-
2136
- /***/ }),
2137
-
2138
- /***/ 4486:
2139
- /***/ ((module) => {
2140
-
2141
- "use strict";
2142
- module.exports = require("next/dist/shared/lib/image-blur-svg.js");
2143
-
2144
- /***/ }),
2145
-
2146
- /***/ 744:
2147
- /***/ ((module) => {
2148
-
2149
- "use strict";
2150
- module.exports = require("next/dist/shared/lib/image-config-context.js");
2151
-
2152
- /***/ }),
2153
-
2154
- /***/ 5843:
2155
- /***/ ((module) => {
2156
-
2157
- "use strict";
2158
- module.exports = require("next/dist/shared/lib/image-config.js");
2159
-
2160
- /***/ }),
2161
-
2162
- /***/ 8524:
2163
- /***/ ((module) => {
2164
-
2165
- "use strict";
2166
- module.exports = require("next/dist/shared/lib/is-plain-object.js");
2167
-
2168
- /***/ }),
2169
-
2170
- /***/ 8020:
2171
- /***/ ((module) => {
2172
-
2173
- "use strict";
2174
- module.exports = require("next/dist/shared/lib/mitt.js");
2175
-
2176
- /***/ }),
2177
-
2178
- /***/ 4406:
2179
- /***/ ((module) => {
2180
-
2181
- "use strict";
2182
- module.exports = require("next/dist/shared/lib/page-path/denormalize-page-path.js");
2183
-
2184
- /***/ }),
2185
-
2186
- /***/ 4964:
2187
- /***/ ((module) => {
2188
-
2189
- "use strict";
2190
- module.exports = require("next/dist/shared/lib/router-context.js");
2191
-
2192
- /***/ }),
2193
-
2194
- /***/ 3431:
2195
- /***/ ((module) => {
2196
-
2197
- "use strict";
2198
- module.exports = require("next/dist/shared/lib/router/utils/add-locale.js");
2199
-
2200
- /***/ }),
2201
-
2202
- /***/ 1751:
2203
- /***/ ((module) => {
2204
-
2205
- "use strict";
2206
- module.exports = require("next/dist/shared/lib/router/utils/add-path-prefix.js");
2207
-
2208
- /***/ }),
2209
-
2210
- /***/ 6220:
2211
- /***/ ((module) => {
2212
-
2213
- "use strict";
2214
- module.exports = require("next/dist/shared/lib/router/utils/compare-states.js");
2215
-
2216
- /***/ }),
2217
-
2218
- /***/ 299:
2219
- /***/ ((module) => {
2220
-
2221
- "use strict";
2222
- module.exports = require("next/dist/shared/lib/router/utils/format-next-pathname-info.js");
2223
-
2224
- /***/ }),
2225
-
2226
- /***/ 3938:
2227
- /***/ ((module) => {
2228
-
2229
- "use strict";
2230
- module.exports = require("next/dist/shared/lib/router/utils/format-url.js");
2231
-
2232
- /***/ }),
2233
-
2234
- /***/ 9565:
2235
- /***/ ((module) => {
2236
-
2237
- "use strict";
2238
- module.exports = require("next/dist/shared/lib/router/utils/get-asset-path-from-route.js");
2239
-
2240
- /***/ }),
2241
-
2242
- /***/ 5789:
2243
- /***/ ((module) => {
2244
-
2245
- "use strict";
2246
- module.exports = require("next/dist/shared/lib/router/utils/get-next-pathname-info.js");
2247
-
2248
- /***/ }),
2249
-
2250
- /***/ 1897:
2251
- /***/ ((module) => {
2252
-
2253
- "use strict";
2254
- module.exports = require("next/dist/shared/lib/router/utils/is-bot.js");
2255
-
2256
- /***/ }),
2257
-
2258
- /***/ 1428:
2259
- /***/ ((module) => {
2260
-
2261
- "use strict";
2262
- module.exports = require("next/dist/shared/lib/router/utils/is-dynamic.js");
2263
-
2264
- /***/ }),
2265
-
2266
- /***/ 8854:
2267
- /***/ ((module) => {
2268
-
2269
- "use strict";
2270
- module.exports = require("next/dist/shared/lib/router/utils/parse-path.js");
2271
-
2272
- /***/ }),
2273
-
2274
- /***/ 1292:
2275
- /***/ ((module) => {
2276
-
2277
- "use strict";
2278
- module.exports = require("next/dist/shared/lib/router/utils/parse-relative-url.js");
2279
-
2280
- /***/ }),
2281
-
2282
- /***/ 4567:
2283
- /***/ ((module) => {
2284
-
2285
- "use strict";
2286
- module.exports = require("next/dist/shared/lib/router/utils/path-has-prefix.js");
2287
-
2288
- /***/ }),
2289
-
2290
- /***/ 979:
2291
- /***/ ((module) => {
2292
-
2293
- "use strict";
2294
- module.exports = require("next/dist/shared/lib/router/utils/querystring.js");
2295
-
2296
- /***/ }),
2297
-
2298
- /***/ 3297:
2299
- /***/ ((module) => {
2300
-
2301
- "use strict";
2302
- module.exports = require("next/dist/shared/lib/router/utils/remove-trailing-slash.js");
2303
-
2304
- /***/ }),
2305
-
2306
- /***/ 6052:
2307
- /***/ ((module) => {
2308
-
2309
- "use strict";
2310
- module.exports = require("next/dist/shared/lib/router/utils/resolve-rewrites.js");
2311
-
2312
- /***/ }),
2313
-
2314
- /***/ 4226:
2315
- /***/ ((module) => {
2316
-
2317
- "use strict";
2318
- module.exports = require("next/dist/shared/lib/router/utils/route-matcher.js");
2319
-
2320
- /***/ }),
2321
-
2322
- /***/ 5052:
2323
- /***/ ((module) => {
2324
-
2325
- "use strict";
2326
- module.exports = require("next/dist/shared/lib/router/utils/route-regex.js");
2327
-
2328
- /***/ }),
2329
-
2330
- /***/ 9232:
2331
- /***/ ((module) => {
2332
-
2333
- "use strict";
2334
- module.exports = require("next/dist/shared/lib/utils.js");
2335
-
2336
- /***/ }),
2337
-
2338
- /***/ 1853:
2339
- /***/ ((module) => {
2340
-
2341
- "use strict";
2342
- module.exports = require("next/router");
2343
-
2344
- /***/ }),
2345
-
2346
- /***/ 5471:
2347
- /***/ ((module) => {
2348
-
2349
- "use strict";
2350
- module.exports = require("p-limit");
2351
-
2352
- /***/ }),
2353
-
2354
- /***/ 6689:
2355
- /***/ ((module) => {
2356
-
2357
- "use strict";
2358
- module.exports = require("react");
2359
-
2360
- /***/ }),
2361
-
2362
- /***/ 6405:
2363
- /***/ ((module) => {
2364
-
2365
- "use strict";
2366
- module.exports = require("react-dom");
2367
-
2368
- /***/ }),
2369
-
2370
- /***/ 9785:
2371
- /***/ ((module) => {
2372
-
2373
- "use strict";
2374
- module.exports = require("react-intersection-observer");
2375
-
2376
- /***/ }),
2377
-
2378
- /***/ 3789:
2379
- /***/ ((module) => {
2380
-
2381
- "use strict";
2382
- module.exports = require("react-swipeable");
2383
-
2384
- /***/ }),
2385
-
2386
- /***/ 997:
2387
- /***/ ((module) => {
2388
-
2389
- "use strict";
2390
- module.exports = require("react/jsx-runtime");
2391
-
2392
- /***/ }),
2393
-
2394
- /***/ 3823:
2395
- /***/ ((module) => {
2396
-
2397
- "use strict";
2398
- module.exports = require("tabbable");
2399
-
2400
- /***/ }),
2401
-
2402
- /***/ 752:
2403
- /***/ ((module) => {
2404
-
2405
- "use strict";
2406
- module.exports = require("tslib");
2407
-
2408
- /***/ }),
2409
-
2410
- /***/ 9664:
2411
- /***/ ((module) => {
2412
-
2413
- "use strict";
2414
- module.exports = import("@envelop/core");;
2415
-
2416
- /***/ }),
2417
-
2418
- /***/ 7886:
2419
- /***/ ((module) => {
2420
-
2421
- "use strict";
2422
- module.exports = import("@envelop/graphql-jit");;
2423
-
2424
- /***/ }),
2425
-
2426
- /***/ 4656:
2427
- /***/ ((module) => {
2428
-
2429
- "use strict";
2430
- module.exports = import("@envelop/parser-cache");;
2431
-
2432
- /***/ }),
2433
-
2434
- /***/ 6093:
2435
- /***/ ((module) => {
2436
-
2437
- "use strict";
2438
- module.exports = import("@envelop/validation-cache");;
2439
-
2440
- /***/ }),
2441
-
2442
- /***/ 7564:
2443
- /***/ ((module) => {
2444
-
2445
- "use strict";
2446
- module.exports = import("chalk");;
2447
-
2448
- /***/ }),
2449
-
2450
- /***/ 5941:
2451
- /***/ ((module) => {
2452
-
2453
- "use strict";
2454
- module.exports = import("swr");;
2455
-
2456
- /***/ }),
2457
-
2458
- /***/ 6113:
2459
- /***/ ((module) => {
2460
-
2461
- "use strict";
2462
- module.exports = require("crypto");
2463
-
2464
- /***/ })
2465
-
2466
- };
2467
- ;
2468
-
2469
- // load runtime
2470
- var __webpack_require__ = require("../../webpack-runtime.js");
2471
- __webpack_require__.C(exports);
2472
- var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
2473
- var __webpack_exports__ = __webpack_require__.X(0, [608,676,664,401,336,183,644,886,74,247,287,854,280,368,205,874,350,82,123], () => (__webpack_exec__(4601)));
2474
- module.exports = __webpack_exports__;
2475
-
2476
- })();