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