@sonic-equipment/ui 0.0.81 → 0.0.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +24 -30
- package/dist/index.js +785 -671
- package/dist/src/badges/badge/badge.d.ts +5 -0
- package/dist/src/badges/badge/badge.stories.d.ts +17 -0
- package/dist/src/badges/badge/icon-with-badge/icon-with-badge.d.ts +6 -0
- package/dist/src/badges/badge/icon-with-badge/icon-with-badge.stories.d.ts +14 -0
- package/dist/src/buttons/button/button.d.ts +3 -4
- package/dist/src/buttons/button/button.stories.d.ts +1 -1
- package/dist/src/buttons/icon-button/icon-button.d.ts +2 -2
- package/dist/src/buttons/icon-button/icon-button.stories.d.ts +1 -1
- package/dist/src/buttons/link/link.d.ts +4 -9
- package/dist/src/buttons/link/link.stories.d.ts +1 -1
- package/dist/src/cards/product-card/{connected-product-cart.d.ts → connected-product-card.d.ts} +1 -2
- package/dist/src/cards/product-card/product-card.d.ts +4 -5
- package/dist/src/carousel/carousel-navigation-button.d.ts +5 -3
- package/dist/src/carousel/pagination/pagination.d.ts +14 -0
- package/dist/src/carousel/pagination/pagination.stories.d.ts +14 -0
- package/dist/src/carousel/pagination/transitions.d.ts +34 -0
- package/dist/src/carousel/usp-carousel/product-usp-carousel.d.ts +12 -0
- package/dist/src/carousel/usp-carousel/product-usp-carousel.stories.d.ts +27 -0
- package/dist/src/carousel/usp-carousel/usp-carousel.d.ts +2 -2
- package/dist/src/intl/translation-id.d.ts +1 -1
- package/dist/src/lists/ul/list-item.stories.d.ts +14 -0
- package/dist/src/lists/ul/list.d.ts +10 -0
- package/dist/src/lists/ul/list.stories.d.ts +13 -0
- package/dist/src/media/image-lightbox/image-lightbox.d.ts +8 -0
- package/dist/src/media/image-lightbox/image-lightbox.stories.d.ts +13 -0
- package/dist/src/modals/dialog/dialog.d.ts +2 -1
- package/dist/src/modals/modal/modal.d.ts +3 -1
- package/dist/src/modals/modal/modal.stories.d.ts +11 -0
- package/dist/src/pages/product-details-page/components/product-details-images/product-detail-images.d.ts +6 -0
- package/dist/src/shared/hooks/use-resize-observer.d.ts +1 -1
- package/dist/src/shared/routing/route-link.d.ts +4 -2
- package/dist/styles.css +459 -185
- package/package.json +3 -3
- /package/dist/src/{usp/product-usp.d.ts → carousel/usp-carousel/product-usp-carousel-slide.d.ts} +0 -0
- /package/dist/src/pages/product-details-page/components/{product-details-panel.d.ts → product-details-panel/product-details-panel.d.ts} +0 -0
package/dist/index.js
CHANGED
|
@@ -3,8 +3,8 @@ import React, { useMemo, useState, useCallback, useEffect, useRef, createContext
|
|
|
3
3
|
import { useQuery, useQueryClient, useMutation, QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
4
4
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
5
5
|
import { deepEqual } from 'fast-equals';
|
|
6
|
-
import { Link as Link$1, Button as Button$1, Breadcrumbs, Breadcrumb as Breadcrumb$1, FieldError as FieldError$1, useContextProps, InputContext, Input as Input$1, Label as Label$1, NumberField as NumberField$1, Checkbox as Checkbox$1, Select as Select$1, SelectValue, Popover, ListBox, Section, Header, ListBoxItem, TextAreaContext, TextArea as TextArea$1, TextField as TextField$1, ModalOverlay, Modal as Modal$1, Dialog as Dialog$1, Form } from 'react-aria-components';
|
|
7
6
|
import clsx from 'clsx';
|
|
7
|
+
import { Breadcrumbs, Breadcrumb as Breadcrumb$1, FieldError as FieldError$1, useContextProps, InputContext, Input as Input$1, Label as Label$1, NumberField as NumberField$1, Button as Button$1, Checkbox as Checkbox$1, Select as Select$1, SelectValue, Popover, ListBox, Section, Header, ListBoxItem, TextAreaContext, TextArea as TextArea$1, TextField as TextField$1, ModalOverlay, Modal as Modal$1, Dialog as Dialog$1, Form } from 'react-aria-components';
|
|
8
8
|
import { usePress } from 'react-aria';
|
|
9
9
|
import { useHierarchicalMenu, useCurrentRefinements, useClearRefinements, useRefinementList, useHits, useDynamicWidgets, usePagination, useInstantSearch, InstantSearch, Configure, useSortBy } from 'react-instantsearch';
|
|
10
10
|
import { history } from 'instantsearch.js/es/lib/routers/index.js';
|
|
@@ -1164,32 +1164,16 @@ function useNavigate() {
|
|
|
1164
1164
|
};
|
|
1165
1165
|
}
|
|
1166
1166
|
|
|
1167
|
-
var styles$
|
|
1167
|
+
var styles$11 = {"link":"link-module-xLqBn","has-underline":"link-module-UuCEp","secondary":"link-module-v31wH","primary":"link-module-bGD6u"};
|
|
1168
1168
|
|
|
1169
|
-
function Link({ children, className, color = 'primary', hasUnderline,
|
|
1170
|
-
|
|
1171
|
-
_onClick?.(e);
|
|
1172
|
-
if (props.href)
|
|
1173
|
-
return;
|
|
1174
|
-
e.preventDefault();
|
|
1175
|
-
}
|
|
1176
|
-
const linkRef = onPress
|
|
1177
|
-
? ref
|
|
1178
|
-
: ref ||
|
|
1179
|
-
(ref =>
|
|
1180
|
-
// Workaround for react/react-aria #1513
|
|
1181
|
-
ref?.addEventListener('touchend', e => e.preventDefault()));
|
|
1182
|
-
return (jsx(Link$1, { ref: linkRef, className: clsx({ [styles$X['has-underline']]: hasUnderline }, styles$X['link'], styles$X[color], className),
|
|
1183
|
-
// Workaround for adobe/react-spectrum #963
|
|
1184
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
1185
|
-
// @ts-ignore
|
|
1186
|
-
onClick: onClick, onPress: onPress, ...props, children: children }));
|
|
1169
|
+
function Link({ children, className, color = 'primary', hasUnderline, isDisabled, onClick, ...props }) {
|
|
1170
|
+
return (jsx("a", { className: clsx({ [styles$11['has-underline']]: hasUnderline }, styles$11['link'], styles$11[color], className), "data-disabled": isDisabled ? true : undefined, onClick: onClick, ...props, children: children }));
|
|
1187
1171
|
}
|
|
1188
1172
|
|
|
1189
|
-
function RouteLink({ children,
|
|
1173
|
+
function RouteLink({ children, ...props }) {
|
|
1190
1174
|
const navigate = useNavigate();
|
|
1191
1175
|
function onClick(e) {
|
|
1192
|
-
|
|
1176
|
+
props.onClick?.(e);
|
|
1193
1177
|
if (!props.href)
|
|
1194
1178
|
return;
|
|
1195
1179
|
e.preventDefault();
|
|
@@ -1203,9 +1187,9 @@ function RouteLink({ children, onClick: _onClick, ...props }) {
|
|
|
1203
1187
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1204
1188
|
function onHoverStart(e) {
|
|
1205
1189
|
// TODO: Implement prefetch
|
|
1206
|
-
props.
|
|
1190
|
+
props.onMouseEnter?.(e);
|
|
1207
1191
|
}
|
|
1208
|
-
return (jsx(Link, { onClick: onClick,
|
|
1192
|
+
return (jsx(Link, { ...props, onClick: onClick, onMouseEnter: onHoverStart, children: children }));
|
|
1209
1193
|
}
|
|
1210
1194
|
|
|
1211
1195
|
function GlyphsArrowBoldCapsRightIcon(props) {
|
|
@@ -1214,23 +1198,16 @@ function GlyphsArrowBoldCapsRightIcon(props) {
|
|
|
1214
1198
|
|
|
1215
1199
|
var buttonStyles = {"button":"button-module-V4meK","icon":"button-module-XaNWz","sm":"button-module-Pbwz7","md":"button-module-GVTEW","condensed":"button-module-GKHQc","lg":"button-module-nyNY8","primary":"button-module-tmyk8","outline":"button-module-vq9GI","solid":"button-module-AjvlY","hover":"button-module-YzPAr","focus":"button-module--xzsY","active":"button-module-XMFzj","ghost":"button-module-f4UVe","right-arrow-icon":"button-module-ydQAo","secondary":"button-module--1bCH"};
|
|
1216
1200
|
|
|
1217
|
-
function Button({ _pseudo = 'none', children, className, color = 'primary', condensed, icon, iconPosition = 'left', isDisabled, onClick: _onClick,
|
|
1201
|
+
function Button({ _pseudo = 'none', children, className, color = 'primary', condensed, icon, iconPosition = 'left', isDisabled, onClick: _onClick, size = 'lg', type = 'button', variant = 'solid', withArrow = false, }) {
|
|
1218
1202
|
const showIconOnLeft = icon && iconPosition === 'left';
|
|
1219
1203
|
const showIconOnRight = icon && iconPosition === 'right';
|
|
1220
1204
|
const onClick = (e) => {
|
|
1221
1205
|
if (_onClick)
|
|
1222
1206
|
_onClick(e);
|
|
1207
|
+
e.stopPropagation();
|
|
1223
1208
|
e.preventDefault();
|
|
1224
1209
|
};
|
|
1225
|
-
return (jsxs(
|
|
1226
|
-
? undefined
|
|
1227
|
-
: ref =>
|
|
1228
|
-
// Workaround for react/react-aria #1513
|
|
1229
|
-
ref?.addEventListener('touchend', e => e.preventDefault()), className: clsx({ [buttonStyles.condensed]: condensed }, { [buttonStyles.icon]: icon }, buttonStyles.button, buttonStyles[variant], buttonStyles[size], buttonStyles[color], buttonStyles[_pseudo], className), isDisabled: isDisabled,
|
|
1230
|
-
// Workaround for adobe/react-spectrum #963
|
|
1231
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
1232
|
-
// @ts-ignore
|
|
1233
|
-
onClick: onClick, onPress: onPress, type: type, children: [jsx(Fragment, { children: showIconOnLeft && jsx("span", { className: buttonStyles.icon, children: icon }) }), children, withArrow && (jsx(GlyphsArrowBoldCapsRightIcon, { className: buttonStyles['right-arrow-icon'] })), showIconOnRight && jsx("span", { className: buttonStyles.icon, children: icon })] }));
|
|
1210
|
+
return (jsxs("button", { className: clsx({ [buttonStyles.condensed]: condensed }, { [buttonStyles.icon]: icon }, buttonStyles.button, buttonStyles[variant], buttonStyles[size], buttonStyles[color], buttonStyles[_pseudo], className), "data-disabled": isDisabled ? true : undefined, disabled: isDisabled, onClick: onClick, type: type, children: [jsx(Fragment, { children: showIconOnLeft && jsx("span", { className: buttonStyles.icon, children: icon }) }), children, withArrow && (jsx(GlyphsArrowBoldCapsRightIcon, { className: buttonStyles['right-arrow-icon'] })), showIconOnRight && jsx("span", { className: buttonStyles.icon, children: icon })] }));
|
|
1234
1211
|
}
|
|
1235
1212
|
|
|
1236
1213
|
function RouteButton({ children, onClick, ...props }) {
|
|
@@ -1283,24 +1260,24 @@ function SolidHomeIcon(props) {
|
|
|
1283
1260
|
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", ...props, fill: "currentColor", height: "24", viewBox: "0 0 24 24", width: "24", children: jsx("path", { d: "M15.039782,22 C14.6690193,22 14.3684378,21.6994185 14.3684378,21.3286559 L14.3684378,15.6029043 L9.34495251,15.6029043 L9.34495251,21.3286559 C9.34495251,21.6994185 9.04437101,22 8.67345678,22 L3.67134415,22 C3.3005815,22 3,21.6994185 3,21.3286559 L3,9.79560307 C3,9.60127857 3.08412644,9.41665514 3.23055192,9.28917706 L11.4158271,2.16495603 C11.6686612,1.94501466 12.0447291,1.94501466 12.2975632,2.16495603 L20.4828384,9.28917706 C20.6292639,9.41665514 20.7133903,9.60127857 20.7133903,9.79560307 L20.7133903,21.3286559 C20.7133903,21.6994185 20.4128088,22 20.0418946,22 L15.039782,22 Z", fillRule: "evenodd" }) }));
|
|
1284
1261
|
}
|
|
1285
1262
|
|
|
1286
|
-
var styles$
|
|
1263
|
+
var styles$10 = {"breadcrumbs":"breadcrumb-module-CQGse","breadcrumb":"breadcrumb-module-hxhDY","link":"breadcrumb-module-fp2Q6","icon":"breadcrumb-module-uIn3w","previous-icon":"breadcrumb-module-K-wMJ"};
|
|
1287
1264
|
|
|
1288
1265
|
function BreadcrumbShort({ links }) {
|
|
1289
1266
|
const homeLink = links[0];
|
|
1290
1267
|
const previousLink = links[links.length - 2];
|
|
1291
1268
|
const isHomeLink = previousLink === undefined || previousLink === homeLink;
|
|
1292
1269
|
const href = previousLink?.href || homeLink?.href;
|
|
1293
|
-
return (jsx(Breadcrumbs, { className: styles$
|
|
1270
|
+
return (jsx(Breadcrumbs, { className: styles$10.breadcrumbs, children: jsx(Breadcrumb$1, { className: styles$10.breadcrumb, children: jsxs(RouteLink, { className: styles$10.link, href: href, isDisabled: false, children: [jsx(GlyphsChevronsSlimLeftIcon, { className: styles$10.icon }), isHomeLink ? (jsx(SolidHomeIcon, { className: styles$10.icon })) : (jsx("span", { children: previousLink.label }))] }) }) }));
|
|
1294
1271
|
}
|
|
1295
1272
|
function BreadcrumbLongItem({ index, isDisabled, link, }) {
|
|
1296
|
-
return (jsx(Breadcrumb$1, { className: styles$
|
|
1273
|
+
return (jsx(Breadcrumb$1, { className: styles$10.breadcrumb, children: jsxs(RouteLink, { className: styles$10.link, color: "secondary", href: link.href, isDisabled: isDisabled, children: [jsx(GlyphsChevronsSlimLeftIcon, { className: clsx(styles$10['previous-icon'], styles$10.icon) }), link.label] }) }, index));
|
|
1297
1274
|
}
|
|
1298
1275
|
function BreadcrumbLong({ links }) {
|
|
1299
1276
|
const linksWithoutFirst = links.slice(1);
|
|
1300
1277
|
const homeLink = links[0];
|
|
1301
1278
|
if (!homeLink)
|
|
1302
1279
|
return null;
|
|
1303
|
-
return (jsxs(Breadcrumbs, { className: styles$
|
|
1280
|
+
return (jsxs(Breadcrumbs, { className: styles$10.breadcrumbs, children: [jsx(Breadcrumb$1, { className: styles$10.breadcrumb, children: jsx(RouteLink, { className: styles$10.link, href: homeLink.href, children: jsx(SolidHomeIcon, { className: clsx(styles$10['home-icon'], styles$10.icon) }) }) }), linksWithoutFirst.map((link, index) => (jsx(BreadcrumbLongItem, { index: index, isDisabled: linksWithoutFirst.length - 1 === index, link: link }, index)))] }));
|
|
1304
1281
|
}
|
|
1305
1282
|
function Breadcrumb({ links }) {
|
|
1306
1283
|
const { lg } = useBreakpoint();
|
|
@@ -1309,15 +1286,14 @@ function Breadcrumb({ links }) {
|
|
|
1309
1286
|
return lg ? BreadcrumbLong({ links }) : BreadcrumbShort({ links });
|
|
1310
1287
|
}
|
|
1311
1288
|
|
|
1312
|
-
var styles
|
|
1289
|
+
var styles$$ = {"icon-button":"icon-button-module-4PDK-","md":"icon-button-module-k3s9J","lg":"icon-button-module-agk6Y","primary":"icon-button-module-fTeP4","secondary":"icon-button-module-dM0eo"};
|
|
1313
1290
|
|
|
1314
|
-
function IconButton({ children, className, color = 'primary', isDisabled,
|
|
1315
|
-
return (jsx(
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
onClick: e => e.preventDefault(), onPress: onPress, type: type, children: children }));
|
|
1291
|
+
function IconButton({ children, className, color = 'primary', isDisabled, onClick, size = 'md', type = 'button', }) {
|
|
1292
|
+
return (jsx("button", { className: clsx(styles$$['icon-button'], styles$$[size], styles$$[color], className), "data-disabled": isDisabled ? true : undefined, disabled: isDisabled, onClick: e => {
|
|
1293
|
+
onClick?.(e);
|
|
1294
|
+
e.preventDefault();
|
|
1295
|
+
e.stopPropagation();
|
|
1296
|
+
}, type: type, children: children }));
|
|
1321
1297
|
}
|
|
1322
1298
|
|
|
1323
1299
|
function SolidFavoriteIcon(props) {
|
|
@@ -1328,21 +1304,21 @@ function StrokeFavoriteIcon(props) {
|
|
|
1328
1304
|
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", ...props, fill: "currentColor", height: "24", viewBox: "0 0 24 24", width: "24", children: jsx("path", { d: "M7.33319295,3.33090958 C5.12714802,3.33090958 3.33232058,5.12348359 3.33232058,7.32679321 C3.33232058,8.18447047 3.64878056,9.03643889 4.29989998,9.93107334 L11.9997744,20.2227497 L19.7053643,9.92401241 C20.351069,9.03643889 20.6673786,8.1846207 20.6673786,7.32679321 C20.6673786,5.12348359 18.8727016,3.33090958 16.6666566,3.33090958 C14.8537801,3.33090958 13.1222748,4.56251549 12.6388611,6.19569283 C12.5552338,6.47843037 12.2951771,6.67253074 11.9999248,6.67253074 C11.7046724,6.67253074 11.4447662,6.47843037 11.3609885,6.19569283 C10.8775748,4.56251549 9.14606944,3.33090958 7.33319295,3.33090958 M11.9997744,22 L11.9997744,22 C11.7898038,22 11.5918659,21.9008466 11.4662746,21.7327364 L3.22718487,10.720545 C2.41106707,9.59905954 2,8.45954615 2,7.32679321 C2,4.3895979 4.39240135,2 7.33319295,2 C9.22488362,2 11.0018124,2.98206975 11.9999248,4.46786903 C12.9978868,2.98206975 14.774966,2 16.6666566,2 C19.6072978,2 22,4.3895979 22,7.32679321 C22,8.45969638 21.5887825,9.59920978 20.777929,10.7136343 L12.5334246,21.7327364 C12.4076829,21.9008466 12.2098954,22 11.9997744,22", fillRule: "evenodd" }) }));
|
|
1329
1305
|
}
|
|
1330
1306
|
|
|
1331
|
-
var styles$
|
|
1307
|
+
var styles$_ = {"favorite-button":"favorite-button-module-tXSS3","is-favorite":"favorite-button-module-l557q","favorite-on":"favorite-button-module-6Tsmy","favorite-off":"favorite-button-module-LQauU"};
|
|
1332
1308
|
|
|
1333
1309
|
function FavoriteButton({ isDisabled, isFavorite, onPress, }) {
|
|
1334
|
-
return (jsx(IconButton, { className: clsx(styles$
|
|
1335
|
-
[styles$
|
|
1336
|
-
}), color: "secondary", isDisabled: isDisabled,
|
|
1310
|
+
return (jsx(IconButton, { className: clsx(styles$_['favorite-button'], {
|
|
1311
|
+
[styles$_['is-favorite']]: isFavorite,
|
|
1312
|
+
}), color: "secondary", isDisabled: isDisabled, onClick: onPress, children: isFavorite ? jsx(SolidFavoriteIcon, {}) : jsx(StrokeFavoriteIcon, {}) }));
|
|
1337
1313
|
}
|
|
1338
1314
|
|
|
1339
|
-
var styles$
|
|
1315
|
+
var styles$Z = {"field-error":"field-error-module-FXnIg"};
|
|
1340
1316
|
|
|
1341
1317
|
function FieldError({ children }) {
|
|
1342
|
-
return (jsx(FieldError$1, { className: styles$
|
|
1318
|
+
return (jsx(FieldError$1, { className: styles$Z['field-error'], children: children }));
|
|
1343
1319
|
}
|
|
1344
1320
|
|
|
1345
|
-
var styles$
|
|
1321
|
+
var styles$Y = {"input-container":"input-module-2woJR","shadow-input":"input-module-pNKEt","lg":"input-module-Dx2qC","md":"input-module-sH6e7","focus":"input-module-hEEuy","growing-input":"input-module-6HwY4"};
|
|
1346
1322
|
|
|
1347
1323
|
/**
|
|
1348
1324
|
* This component is used to create an input that grows as the user types.
|
|
@@ -1358,20 +1334,20 @@ const Input = forwardRef(({ _pseudo = 'none', autoGrow, size = 'lg', ...inputPro
|
|
|
1358
1334
|
? onChange?.(event)
|
|
1359
1335
|
: setUncontrolledValue(event.target.value);
|
|
1360
1336
|
const { pressProps } = usePress({});
|
|
1361
|
-
return (jsx("div", { className: clsx(styles$
|
|
1337
|
+
return (jsx("div", { className: clsx(styles$Y['input-container'], styles$Y[size], styles$Y[_pseudo]), children: jsxs("div", { className: clsx({ [styles$Y['growing-input']]: autoGrow }), children: [jsx(Input$1, { size: autoGrow ? 1 : undefined, ...props, ...pressProps, ref: ref, onChange: handleChange, onClick: e => {
|
|
1362
1338
|
e.preventDefault();
|
|
1363
1339
|
e.stopPropagation();
|
|
1364
1340
|
e.target.focus();
|
|
1365
|
-
} }), autoGrow && jsx("span", { className: styles$
|
|
1341
|
+
} }), autoGrow && jsx("span", { className: styles$Y['shadow-input'], children: value })] }) }));
|
|
1366
1342
|
});
|
|
1367
1343
|
Input.displayName = 'Input';
|
|
1368
1344
|
|
|
1369
|
-
var styles$
|
|
1345
|
+
var styles$X = {"label":"label-module-LGfJt","required":"label-module-oTWaS"};
|
|
1370
1346
|
|
|
1371
1347
|
function Label({ children, isRequired }) {
|
|
1372
1348
|
if (!children)
|
|
1373
1349
|
return null;
|
|
1374
|
-
return (jsxs(Label$1, { className: styles$
|
|
1350
|
+
return (jsxs(Label$1, { className: styles$X.label, children: [children, isRequired && jsx("span", { className: styles$X.required, children: "*" })] }));
|
|
1375
1351
|
}
|
|
1376
1352
|
|
|
1377
1353
|
function StrokeCollapseIcon(props) {
|
|
@@ -1386,7 +1362,7 @@ function StrokeTrashIcon(props) {
|
|
|
1386
1362
|
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", ...props, fill: "currentColor", height: "24", viewBox: "0 0 24 24", width: "24", children: jsx("path", { d: "M7.77273912,6.04398453 L9.07201126,6.04398453 L9.07201126,4.11757519 C9.07201126,3.84748949 9.15880324,3.63104347 9.33238719,3.46823712 C9.50597114,3.30543077 9.73570292,3.22402759 10.0215825,3.22402759 L13.3263825,3.22402759 C13.6186194,3.22402759 13.850313,3.30543077 14.0214633,3.46823712 C14.1926136,3.63104347 14.2781888,3.84748949 14.2781888,4.11757519 L14.2781888,6.04398453 L15.5846129,6.04398453 L15.5846129,4.04352264 C15.5846129,3.40769382 15.3900697,2.90814951 15.0009834,2.5448897 C14.6118971,2.1816299 14.0799703,2 13.405203,2 L9.942762,2 C9.26869007,2 8.73850162,2.1816299 8.35219662,2.5448897 C7.96589162,2.90814951 7.77273912,3.40769382 7.77273912,4.04352264 L7.77273912,6.04398453 Z M3.60955531,6.6940676 L19.7561406,6.6940676 C19.9248076,6.6940676 20.0683931,6.6332263 20.186897,6.51154371 C20.305401,6.38986111 20.3646529,6.242352 20.3646529,6.06901638 C20.3646529,5.9003494 20.3052023,5.75537328 20.186301,5.63408801 C20.0673997,5.51280275 19.9240129,5.45216011 19.7561406,5.45216011 L3.60955531,5.45216011 C3.44734496,5.45216011 3.30519982,5.51300141 3.18311989,5.63468401 C3.06103996,5.75636661 3,5.90114406 3,6.06901638 C3,6.24314666 3.06103996,6.39085444 3.18311989,6.5121397 C3.30519982,6.63342497 3.44734496,6.6940676 3.60955531,6.6940676 Z M7.56920636,22 L15.8049825,22 C16.4210441,22 16.9252074,21.8108208 17.3174724,21.4324624 C17.7097373,21.0541041 17.9209684,20.5545101 17.9511655,19.9336805 L18.6066126,6.5283806 L17.2870766,6.5283806 L16.6578534,19.8059883 C16.6444435,20.0808419 16.5455825,20.3084381 16.3612707,20.4887766 C16.1769588,20.6691152 15.9469787,20.7592845 15.6713303,20.7592845 L7.68497866,20.7592845 C7.41479362,20.7592845 7.18757,20.6677246 7.00330778,20.4846047 C6.81904556,20.3014848 6.72015983,20.0752793 6.70665057,19.8059883 L6.05358753,6.5295726 L4.76996029,6.5295726 L5.41587138,19.9420245 C5.4468632,20.562854 5.65806942,21.0610573 6.04949005,21.4366344 C6.44091068,21.8122115 6.94748278,22 7.56920636,22 Z M9.00213069,19.1375783 C9.15957307,19.1375783 9.2862223,19.0920591 9.38207839,19.0010206 C9.47793448,18.9099822 9.5230812,18.7917017 9.51751857,18.6461793 L9.2314403,8.86811345 C9.22587767,8.72338566 9.17618647,8.60729053 9.0823667,8.51982806 C8.98854694,8.43236558 8.86649184,8.38863435 8.71620142,8.38863435 C8.55945437,8.38863435 8.43436962,8.43395491 8.34094719,8.52459603 C8.24752475,8.61523714 8.20081354,8.73371626 8.20081354,8.88003338 L8.48555081,18.6485633 C8.49121278,18.7988537 8.54055631,18.9179288 8.63358142,19.0057886 C8.72660652,19.0936484 8.84945628,19.1375783 9.00213069,19.1375783 Z M11.6876904,19.1375783 C11.8451328,19.1375783 11.9717821,19.0922578 12.0676381,19.0016166 C12.1634942,18.9109755 12.2114223,18.7924964 12.2114223,18.6461793 L12.2114223,8.88003338 C12.2114223,8.73451092 12.1634942,8.61623047 12.0676381,8.52519202 C11.9717821,8.43415357 11.8451328,8.38863435 11.6876904,8.38863435 C11.5310427,8.38863435 11.4032015,8.43415357 11.3041668,8.52519202 C11.205132,8.61623047 11.1556147,8.73451092 11.1556147,8.88003338 L11.1556147,18.6461793 C11.1556147,18.7924964 11.205132,18.9109755 11.3041668,19.0016166 C11.4032015,19.0922578 11.5310427,19.1375783 11.6876904,19.1375783 Z M14.3635653,19.1387703 C14.516339,19.1387703 14.6392384,19.0948404 14.7322635,19.0069806 C14.8252886,18.9191208 14.8745825,18.802827 14.8801451,18.6580992 L15.1662234,8.88122537 C15.1662234,8.73490825 15.1194873,8.6166278 15.0260152,8.52638402 C14.9325431,8.43614023 14.8070859,8.39101833 14.6496435,8.39101833 C14.4993531,8.39101833 14.3772732,8.4345509 14.2834037,8.52161604 C14.1895343,8.60868118 14.1398183,8.7277563 14.1342556,8.87884138 L13.8483264,18.6485633 C13.8483264,18.7932911 13.8948389,18.9111742 13.987864,19.0022126 C14.0808891,19.0932511 14.2061229,19.1387703 14.3635653,19.1387703 Z" }) }));
|
|
1387
1363
|
}
|
|
1388
1364
|
|
|
1389
|
-
var styles$
|
|
1365
|
+
var styles$W = {"field":"number-field-module-gmnog","button-input-container":"number-field-module-8Lvgh","zoom-in-text":"number-field-module-OlEoa"};
|
|
1390
1366
|
|
|
1391
1367
|
/**
|
|
1392
1368
|
* This component is used to create a number field.
|
|
@@ -1394,7 +1370,7 @@ var styles$Q = {"field":"number-field-module-gmnog","button-input-container":"nu
|
|
|
1394
1370
|
*/
|
|
1395
1371
|
function NumberField({ autoFocus, autoGrow, defaultValue, formatOptions = { style: 'decimal', useGrouping: false }, isDisabled, isInvalid, isReadOnly, isRequired, label, maxLength, maxValue, minValue, name, onChange, onInput, onKeyUp, placeholder, showLabel = false, size = 'lg', value, withButtons, }) {
|
|
1396
1372
|
const inputRef = useRef(null);
|
|
1397
|
-
return (jsxs(NumberField$1, { "aria-label": label, autoFocus: autoFocus, className: clsx(styles$
|
|
1373
|
+
return (jsxs(NumberField$1, { "aria-label": label, autoFocus: autoFocus, className: clsx(styles$W.field, styles$W[size]), defaultValue: defaultValue, formatOptions: formatOptions, isDisabled: isDisabled, isInvalid: isInvalid, isReadOnly: isReadOnly, isRequired: isRequired, maxValue: maxValue, minValue: minValue, name: name, onChange: onChange, onInput: onInput, value: value, children: [showLabel && jsx(Label, { isRequired: isRequired, children: label }), jsxs("div", { className: styles$W['button-input-container'], children: [withButtons && (jsx(Button$1, { isDisabled: isDisabled,
|
|
1398
1374
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
1399
1375
|
// @ts-expect-error
|
|
1400
1376
|
onClick: e => e.preventDefault(), onPressStart: e => e.target.focus(), slot: "decrement", children: (value || 0) <= 1 ? jsx(StrokeTrashIcon, {}) : jsx(StrokeCollapseIcon, {}) })), jsx(Input, { ref: inputRef, autoGrow: autoGrow, maxLength: maxLength, onFocus: e => (e.target.selectionStart = e.target.value.length || 0), onKeyUp: e => onKeyUp?.(e), placeholder: placeholder, size: size }), withButtons && (jsx(Button$1, { isDisabled: isDisabled,
|
|
@@ -1407,7 +1383,7 @@ function SolidCartIcon(props) {
|
|
|
1407
1383
|
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", ...props, fill: "currentColor", height: "24", viewBox: "0 0 24 24", width: "24", children: jsx("path", { d: "M7.89619008,16.6656848 C9.33405626,16.6656848 10.4996925,17.831321 10.4996925,19.2690253 C10.4996925,20.7068915 9.33405626,21.8725278 7.89619008,21.8725278 C6.45832389,21.8725278 5.29268766,20.7068915 5.29268766,19.2690253 C5.29268766,17.831321 6.45832389,16.6656848 7.89619008,16.6656848 Z M16.8207199,16.6656848 C18.2585861,16.6656848 19.4242223,17.831321 19.4242223,19.2690253 C19.4242223,20.7068915 18.2585861,21.8725278 16.8207199,21.8725278 C15.3828537,21.8725278 14.2172175,20.7068915 14.2172175,19.2690253 C14.2172175,17.831321 15.3828537,16.6656848 16.8207199,16.6656848 Z M7.89619008,18.0995047 C7.25122196,18.0995047 6.72650762,18.6242191 6.72650762,19.2690253 C6.72650762,19.9139935 7.25122196,20.4387078 7.89619008,20.4387078 C8.54115819,20.4387078 9.06587253,19.9139935 9.06587253,19.2690253 C9.06587253,18.6242191 8.54115819,18.0995047 7.89619008,18.0995047 Z M16.8207199,18.0995047 C16.1757518,18.0995047 15.6510375,18.6242191 15.6510375,19.2690253 C15.6510375,19.9139935 16.1757518,20.4387078 16.8207199,20.4387078 C17.465688,20.4387078 17.9904024,19.9139935 17.9904024,19.2690253 C17.9904024,18.6242191 17.465688,18.0995047 16.8207199,18.0995047 Z M4.58909785,3 C4.6054446,3 4.6206584,3.00372253 4.63668145,3.00485547 C4.65869291,3.00631211 4.68038067,3.0079306 4.70174473,3.01132943 C4.72958275,3.0158612 4.75628783,3.02233516 4.78299291,3.02994206 C4.8001489,3.03479753 4.81698119,3.03949115 4.83365164,3.04564141 C4.8622989,3.05616159 4.88948953,3.06862396 4.91619461,3.08254297 L4.956495,3.10439258 C4.98287638,3.12025378 5.00763927,3.13789532 5.03175477,3.15699349 L5.06736154,3.18645 C5.08921115,3.20603373 5.10911857,3.22707409 5.1283786,3.2492474 C5.13986987,3.26251902 5.1511993,3.27562878 5.16171948,3.28970964 C5.17806623,3.31155925 5.19230894,3.33421811 5.2060661,3.35768621 C5.21626258,3.37500405 5.22597352,3.39216004 5.23455152,3.41028712 C5.24555725,3.43326967 5.25462079,3.45706147 5.26319878,3.48150066 C5.27032014,3.50205548 5.27711779,3.52244845 5.28245881,3.54381251 C5.28860907,3.56825171 5.29249345,3.59317645 5.29605412,3.61858673 C5.29799631,3.63299129 5.30252808,3.64642476 5.30382287,3.66115301 L5.510504,6.30738355 L21.2869744,6.30772748 C21.3139222,6.30835464 21.3370666,6.31256272 21.3603729,6.3151523 C21.3861069,6.31790373 21.4120027,6.31936037 21.4369275,6.32486324 C21.4591008,6.32923316 21.4726961,6.33603082 21.4875862,6.34056259 C21.5163953,6.34914058 21.5452044,6.35723303 21.5722332,6.36920985 C21.5918169,6.37778785 21.6092966,6.38911728 21.6275855,6.39931376 C21.6497588,6.41145243 21.6722559,6.42278186 21.6928107,6.43718642 C21.711747,6.45029618 21.7280937,6.46583368 21.7455734,6.48072379 C21.763215,6.49577574 21.7815039,6.51001845 21.7976888,6.52668889 C21.8132263,6.54287379 21.8261742,6.56067718 21.8400932,6.57815686 C21.8551452,6.59676949 21.8706827,6.61473473 21.8836306,6.634804 C21.8954456,6.65293108 21.9043473,6.67251481 21.9145437,6.69161299 C21.9258732,6.71330075 21.9381737,6.73434111 21.9473991,6.75716182 C21.9559771,6.77868773 21.9614799,6.80134658 21.9679539,6.82368174 C21.9744279,6.8456932 21.9820348,6.86705726 21.9864047,6.89003981 C21.9915839,6.91658304 21.9925549,6.94393552 21.994659,6.97128799 C21.9959538,6.98909138 22,7.00608552 22,7.0242126 C21.9988671,7.05496391 21.994659,7.07794646 21.9922312,7.10109086 C21.9894798,7.1269867 21.9880232,7.15320623 21.9825203,7.17813097 L20.5915903,13.2322533 L20.587706,13.2487619 C20.5797754,13.2835594 20.5681222,13.3164147 20.555498,13.3486227 C20.5524229,13.3567151 20.5499951,13.3651313 20.5465963,13.3730619 C20.5299259,13.4117438 20.5096948,13.4483216 20.4870359,13.4827955 C20.4797527,13.4938012 20.4710129,13.5031884 20.4632441,13.5137086 C20.445117,13.5381478 20.4265044,13.5619396 20.4056259,13.5836274 C20.3944583,13.5952805 20.3823196,13.605477 20.3705046,13.6163208 C20.3505972,13.6344479 20.3302043,13.6517658 20.3083546,13.6674651 C20.2941119,13.6778235 20.2795455,13.6872107 20.2646554,13.6964361 C20.2424821,13.7101932 20.2198233,13.7223319 20.1963552,13.7334995 L20.148286,13.7550254 C20.1214191,13.7655456 20.0935811,13.7734762 20.0654194,13.7807594 C20.0513385,13.7843201 20.037905,13.7888518 20.0235005,13.7916033 C19.9798012,13.8000194 19.9351309,13.8053604 19.8898132,13.8053604 L6.09623539,13.8051986 L6.20774933,15.2317353 L19.411064,15.2317353 C19.8069466,15.2317353 20.1278931,15.5528437 20.1278931,15.9487262 C20.1278931,16.3446088 19.8069466,16.6657172 19.411064,16.6657172 L5.54384488,16.6657172 C5.49593759,16.6657172 5.44932509,16.660538 5.40384553,16.6514744 C5.38863173,16.6483993 5.37471272,16.6425728 5.35998446,16.6386884 C5.33052795,16.6307578 5.30090959,16.6231509 5.27290972,16.6116596 C5.25543003,16.6043764 5.23940699,16.5945036 5.22257469,16.5859256 C5.19910659,16.5741106 5.17547665,16.5627812 5.15362704,16.5485385 C5.13711844,16.5376946 5.12255203,16.5249086 5.10701453,16.5127699 C5.08694526,16.4972324 5.06687599,16.4821804 5.04874891,16.4647007 C5.03434435,16.4509436 5.02204383,16.4357298 5.00893406,16.4208397 C4.99226362,16.4019033 4.97575503,16.3834526 4.96118862,16.3628977 C4.94937364,16.3463891 4.93966271,16.3285858 4.92930437,16.3111061 C4.91668015,16.2899039 4.90437963,16.2688635 4.8940213,16.2462046 C4.88511961,16.2267828 4.87832195,16.2065516 4.87103875,16.1861587 C4.86310815,16.163338 4.8553394,16.1406791 4.84967468,16.1168873 C4.84433367,16.0950377 4.84109669,16.0728644 4.83785971,16.0502055 L4.82992911,16.0045641 L3.92600265,4.43381996 L2.7169909,4.43381996 C2.32110834,4.43381996 2,4.11287347 2,3.7169909 C2,3.32094649 2.32110834,3 2.7169909,3 Z", fillRule: "evenodd" }) }));
|
|
1408
1384
|
}
|
|
1409
1385
|
|
|
1410
|
-
var styles$
|
|
1386
|
+
var styles$V = {"manual-input-container":"add-to-cart-button-module-AWFvQ","left-button-spacer":"add-to-cart-button-module-SS7WM"};
|
|
1411
1387
|
|
|
1412
1388
|
function AddToCartButton({ initialState = 'initial', isDisabled = false, onChange, quantity, }) {
|
|
1413
1389
|
const [currentState, setState] = useState(initialState);
|
|
@@ -1446,7 +1422,11 @@ function AddToCartButton({ initialState = 'initial', isDisabled = false, onChang
|
|
|
1446
1422
|
}, quantity: manualInputQuantity || '' }));
|
|
1447
1423
|
}
|
|
1448
1424
|
function InitialState({ isDisabled, onAddToCart, }) {
|
|
1449
|
-
return (jsx(Button, { condensed: true, icon: jsx(SolidCartIcon, {}), isDisabled: isDisabled,
|
|
1425
|
+
return (jsx(Button, { condensed: true, icon: jsx(SolidCartIcon, {}), isDisabled: isDisabled, onClick: e => {
|
|
1426
|
+
e.preventDefault();
|
|
1427
|
+
e.stopPropagation();
|
|
1428
|
+
onAddToCart();
|
|
1429
|
+
}, size: "md" }));
|
|
1450
1430
|
}
|
|
1451
1431
|
const ensureNumber = (value) => {
|
|
1452
1432
|
if (typeof value === 'number')
|
|
@@ -1495,11 +1475,15 @@ function ManualInputState({ isDisabled, onCancel, onConfirm, quantity, }) {
|
|
|
1495
1475
|
e.key === 'Enter' && onConfirm(ensureNumber(updatedQuantity));
|
|
1496
1476
|
e.key === 'Escape' && onCancel();
|
|
1497
1477
|
};
|
|
1498
|
-
return (jsxs("div", { className: styles$
|
|
1478
|
+
return (jsxs("div", { className: styles$V['manual-input-container'], children: [jsx("div", { className: styles$V['left-button-spacer'] }), jsx(NumberField, { autoFocus: true, autoGrow: true, defaultValue: quantity ? ensureNumber(quantity) : undefined, formatOptions: {
|
|
1499
1479
|
maximumFractionDigits: 0,
|
|
1500
1480
|
style: 'decimal',
|
|
1501
1481
|
useGrouping: false,
|
|
1502
|
-
}, isDisabled: isDisabled, label: "Quantity", maxLength: 4, maxValue: 9999, minValue: 0, name: "quantity", onChange: value => setQuantity(String(value)), onKeyUp: onKeyUp, showLabel: false, size: "md" }), jsx(Button, { condensed: true, isDisabled: isDisabled,
|
|
1482
|
+
}, isDisabled: isDisabled, label: "Quantity", maxLength: 4, maxValue: 9999, minValue: 0, name: "quantity", onChange: value => setQuantity(String(value)), onKeyUp: onKeyUp, showLabel: false, size: "md" }), jsx(Button, { condensed: true, isDisabled: isDisabled, onClick: e => {
|
|
1483
|
+
e.preventDefault();
|
|
1484
|
+
e.stopPropagation();
|
|
1485
|
+
onConfirm(ensureNumber(updatedQuantity));
|
|
1486
|
+
}, size: "md", children: "OK" })] }));
|
|
1503
1487
|
}
|
|
1504
1488
|
|
|
1505
1489
|
const ConnectedAddToCartButton = ({ onAddToCart, productId }) => {
|
|
@@ -1545,12 +1529,12 @@ const ConnectedAddToCartButton = ({ onAddToCart, productId }) => {
|
|
|
1545
1529
|
return (jsx(AddToCartButton, { isDisabled: isPendingDeleteCartLine || isLoadingCartLines || isPendingAddToCart, onChange: handleChange, quantity: quantity }));
|
|
1546
1530
|
};
|
|
1547
1531
|
|
|
1548
|
-
var styles$
|
|
1532
|
+
var styles$U = {"tag":"tag-module-B7r15","body":"tag-module-4cfCf","shape":"tag-module-c7CRb"};
|
|
1549
1533
|
|
|
1550
1534
|
function Tag({ children }) {
|
|
1551
1535
|
if (!children)
|
|
1552
1536
|
return null;
|
|
1553
|
-
return (jsxs("div", { className: styles$
|
|
1537
|
+
return (jsxs("div", { className: styles$U.tag, children: [jsx("div", { className: styles$U.body, children: children }), jsx("svg", { className: styles$U.shape, height: "16", viewBox: "0 0 9 16", width: "9", xmlns: "http://www.w3.org/2000/svg", children: jsx("path", { d: "M1.92461763,0 L0,0 L0,16 L1.92461763,16 L6.4117887,16 L8.87489381,7.57121588 C9.23711515,6.3325062 8.79482383,4.99454094 7.78060408,4.2560794 L1.92461763,0 Z", fill: "currentColor" }) })] }));
|
|
1554
1538
|
}
|
|
1555
1539
|
|
|
1556
1540
|
const IntlContext = createContext({
|
|
@@ -1586,7 +1570,7 @@ function useFormattedMessage() {
|
|
|
1586
1570
|
|
|
1587
1571
|
const FormattedMessage = ({ fallbackValue, id, optional, replacementValues, }) => useFormattedMessage()(id, { fallbackValue, optional, replacementValues });
|
|
1588
1572
|
|
|
1589
|
-
var styles$
|
|
1573
|
+
var styles$T = {"product-price":"product-price-module-oIU1K","original-price":"product-price-module-til0s","is-hidden":"product-price-module-V1NCf","current-price-wrapper":"product-price-module-FfVhl","current-price":"product-price-module-pvy2w","wholes":"product-price-module-GCw07","dot":"product-price-module-N56iV","decimals":"product-price-module-eWOOF","vat":"product-price-module-96DoG"};
|
|
1590
1574
|
|
|
1591
1575
|
const formatPrice = (price) => new Intl.NumberFormat('en-US', {
|
|
1592
1576
|
maximumFractionDigits: 2,
|
|
@@ -1599,22 +1583,22 @@ function ProductPrice({ className, isVatIncluded, originalPrice, price, }) {
|
|
|
1599
1583
|
const priceWithCurrency = formatPrice(price);
|
|
1600
1584
|
const [wholes, decimals] = priceWithCurrency.split('.');
|
|
1601
1585
|
const showOriginalPrice = priceWithCurrency !== originalPriceWithCurrency;
|
|
1602
|
-
return (jsxs("div", { className: clsx(className, styles$
|
|
1603
|
-
[styles$
|
|
1604
|
-
}), children: originalPriceWithCurrency }), jsxs("div", { className: styles$
|
|
1586
|
+
return (jsxs("div", { className: clsx(className, styles$T['product-price']), children: [jsx("span", { className: clsx(styles$T['original-price'], {
|
|
1587
|
+
[styles$T['is-hidden']]: !showOriginalPrice,
|
|
1588
|
+
}), children: originalPriceWithCurrency }), jsxs("div", { className: styles$T['current-price-wrapper'], children: [jsxs("div", { className: styles$T['current-price'], children: [jsx("span", { className: styles$T.wholes, children: wholes }), jsx("span", { className: styles$T.dot, children: "." }), jsx("span", { className: styles$T.decimals, children: decimals })] }), jsx("span", { className: styles$T.vat, children: isVatIncluded ? (jsx(FormattedMessage, { id: "Incl. VAT" })) : (jsx(FormattedMessage, { id: "Excl. VAT" })) })] })] }));
|
|
1605
1589
|
}
|
|
1606
1590
|
|
|
1607
|
-
var styles$
|
|
1591
|
+
var styles$S = {"product-sku":"product-sku-module-ITb8x"};
|
|
1608
1592
|
|
|
1609
1593
|
function ProductSku({ sku }) {
|
|
1610
|
-
return (jsx("p", { className: styles$
|
|
1594
|
+
return (jsx("p", { className: styles$S['product-sku'], "data-test-selector": "productNumber", children: sku }));
|
|
1611
1595
|
}
|
|
1612
1596
|
|
|
1613
1597
|
function isResponsiveImage(image) {
|
|
1614
1598
|
return Boolean(image?.lg);
|
|
1615
1599
|
}
|
|
1616
1600
|
|
|
1617
|
-
var styles$
|
|
1601
|
+
var styles$R = {"image":"image-module-lg7Kj","contain":"image-module-KFEgG","cover":"image-module-tVKFe","has-error":"image-module-LM93B","picture":"image-module-pNYjR"};
|
|
1618
1602
|
|
|
1619
1603
|
function Image({ className, fallbackSrc = 'https://res.cloudinary.com/dkz9eknwh/image/upload/v1716545808/images/product-card/fallback_p6ngjz.svg', fit = 'cover', height, image, loading = 'eager', title, width, }) {
|
|
1620
1604
|
const [hasError, setHasError] = useState(false);
|
|
@@ -1638,26 +1622,26 @@ function Image({ className, fallbackSrc = 'https://res.cloudinary.com/dkz9eknwh/
|
|
|
1638
1622
|
}
|
|
1639
1623
|
function ImageComponent({ className, fallbackSrc, fit = 'cover', hasError, image, ...rest }) {
|
|
1640
1624
|
if (!image)
|
|
1641
|
-
return (jsx("img", { className: clsx(styles$
|
|
1625
|
+
return (jsx("img", { className: clsx(styles$R.image, className, styles$R[fit], styles$R['has-error']), src: fallbackSrc, ...rest }));
|
|
1642
1626
|
const srcSet = !hasError
|
|
1643
1627
|
? `${image[1]} 1x, ${image[2]} 2x, ${image[3]} 3x`
|
|
1644
1628
|
: undefined;
|
|
1645
|
-
return (jsx("img", { alt: image.altText, className: clsx(styles$
|
|
1646
|
-
[styles$
|
|
1629
|
+
return (jsx("img", { alt: image.altText, className: clsx(styles$R.image, className, styles$R[fit], {
|
|
1630
|
+
[styles$R['has-error']]: hasError,
|
|
1647
1631
|
}), src: !hasError ? image[3] : fallbackSrc, srcSet: srcSet, ...rest }));
|
|
1648
1632
|
}
|
|
1649
1633
|
function PictureComponent({ className, fallbackSrc, fit = 'cover', hasError, image, ...rest }) {
|
|
1650
1634
|
if (!image)
|
|
1651
|
-
return (jsx("picture", { className: clsx(styles$
|
|
1652
|
-
return (jsxs("picture", { className: clsx(styles$
|
|
1653
|
-
[styles$
|
|
1635
|
+
return (jsx("picture", { className: clsx(styles$R.picture, className), children: jsx("img", { className: clsx(styles$R[fit], styles$R['has-error']), src: fallbackSrc, ...rest }) }));
|
|
1636
|
+
return (jsxs("picture", { className: clsx(styles$R.picture, className), children: [jsx("source", { media: "(max-width: 768px)", srcSet: `${image.sm[1]} 1x, ${image.sm[2]} 2x, ${image.sm[3]} 3x` }), jsx("source", { media: "(max-width: 1439px)", srcSet: `${image.md[1]} 1x, ${image.md[2]} 2x, ${image.md[3]} 3x` }), jsx("source", { media: "(min-width: 1440px)", srcSet: `${image.lg[1]} 1x, ${image.lg[2]} 2x, ${image.lg[3]} 3x` }), jsx("img", { className: clsx(styles$R[fit], {
|
|
1637
|
+
[styles$R['has-error']]: hasError,
|
|
1654
1638
|
}), src: !hasError ? image.lg[3] : fallbackSrc, ...rest })] }));
|
|
1655
1639
|
}
|
|
1656
1640
|
|
|
1657
|
-
var styles$
|
|
1641
|
+
var styles$Q = {"product-card-container":"product-card-module-LepTy","product-card":"product-card-module-pLaiB","favorite-button":"product-card-module-tvEdz","content":"product-card-module-e0kMu","top":"product-card-module-Q0VvF","tag":"product-card-module-HkWBE","title":"product-card-module-CStNi","bottom":"product-card-module-kD2tU","image":"product-card-module-p-zoi","price":"product-card-module-irW0D","add-to-cart-button":"product-card-module-SnCvX"};
|
|
1658
1642
|
|
|
1659
|
-
function ProductCard({ addToCartButton: AddToCartButton,
|
|
1660
|
-
return (jsx("div", { className: styles$
|
|
1643
|
+
function ProductCard({ addToCartButton: AddToCartButton, favoriteButton: FavoriteButton, href, id, image, onClick, price, sku, tags, title, }) {
|
|
1644
|
+
return (jsx("div", { className: styles$Q['product-card-container'], children: jsxs(RouteLink, { className: styles$Q['product-card'], "data-product-id": sku, href: href, id: id, onClick: onClick, children: [jsx("div", { className: styles$Q.image, children: jsx(Image, { ...image }) }), jsx("div", { className: styles$Q['favorite-button'], children: FavoriteButton && FavoriteButton }), jsxs("div", { className: styles$Q.content, children: [jsxs("div", { className: styles$Q.top, children: [jsx("div", { className: styles$Q.tag, children: tags?.map(tag => (jsx(Tag, { children: jsx(FormattedMessage, { optional: true, fallbackValue: tag, id: `tag.${tag.toLowerCase()}` }) }, tag))) }), jsx("h2", { className: styles$Q.title, children: title }), jsx(ProductSku, { sku: sku })] }), jsxs("div", { className: styles$Q.bottom, children: [jsx("div", { className: styles$Q.price, children: jsx(ProductPrice, { isVatIncluded: price.isVatIncluded, originalPrice: price.originalPrice, price: price.price }) }), jsx("div", { className: styles$Q['add-to-cart-button'], children: AddToCartButton })] })] })] }) }));
|
|
1661
1645
|
}
|
|
1662
1646
|
|
|
1663
1647
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
@@ -2122,9 +2106,7 @@ function elementParents(el, selector) {
|
|
|
2122
2106
|
const parents = []; // eslint-disable-line
|
|
2123
2107
|
let parent = el.parentElement; // eslint-disable-line
|
|
2124
2108
|
while (parent) {
|
|
2125
|
-
|
|
2126
|
-
if (parent.matches(selector)) parents.push(parent);
|
|
2127
|
-
} else {
|
|
2109
|
+
{
|
|
2128
2110
|
parents.push(parent);
|
|
2129
2111
|
}
|
|
2130
2112
|
parent = parent.parentElement;
|
|
@@ -2169,404 +2151,135 @@ function createElementIfNotDefined(swiper, originalParams, params, checkProps) {
|
|
|
2169
2151
|
return params;
|
|
2170
2152
|
}
|
|
2171
2153
|
|
|
2172
|
-
function
|
|
2173
|
-
if (classes === void 0) {
|
|
2174
|
-
classes = '';
|
|
2175
|
-
}
|
|
2176
|
-
return `.${classes.trim().replace(/([\.:!+\/])/g, '\\$1') // eslint-disable-line
|
|
2177
|
-
.replace(/ /g, '.')}`;
|
|
2178
|
-
}
|
|
2179
|
-
|
|
2180
|
-
function Pagination$1(_ref) {
|
|
2154
|
+
function Navigation(_ref) {
|
|
2181
2155
|
let {
|
|
2182
2156
|
swiper,
|
|
2183
2157
|
extendParams,
|
|
2184
2158
|
on,
|
|
2185
2159
|
emit
|
|
2186
2160
|
} = _ref;
|
|
2187
|
-
const pfx = 'swiper-pagination';
|
|
2188
2161
|
extendParams({
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
clickable: false,
|
|
2162
|
+
navigation: {
|
|
2163
|
+
nextEl: null,
|
|
2164
|
+
prevEl: null,
|
|
2193
2165
|
hideOnClick: false,
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
progressbarOpposite: false,
|
|
2199
|
-
type: 'bullets',
|
|
2200
|
-
// 'bullets' or 'progressbar' or 'fraction' or 'custom'
|
|
2201
|
-
dynamicBullets: false,
|
|
2202
|
-
dynamicMainBullets: 1,
|
|
2203
|
-
formatFractionCurrent: number => number,
|
|
2204
|
-
formatFractionTotal: number => number,
|
|
2205
|
-
bulletClass: `${pfx}-bullet`,
|
|
2206
|
-
bulletActiveClass: `${pfx}-bullet-active`,
|
|
2207
|
-
modifierClass: `${pfx}-`,
|
|
2208
|
-
currentClass: `${pfx}-current`,
|
|
2209
|
-
totalClass: `${pfx}-total`,
|
|
2210
|
-
hiddenClass: `${pfx}-hidden`,
|
|
2211
|
-
progressbarFillClass: `${pfx}-progressbar-fill`,
|
|
2212
|
-
progressbarOppositeClass: `${pfx}-progressbar-opposite`,
|
|
2213
|
-
clickableClass: `${pfx}-clickable`,
|
|
2214
|
-
lockClass: `${pfx}-lock`,
|
|
2215
|
-
horizontalClass: `${pfx}-horizontal`,
|
|
2216
|
-
verticalClass: `${pfx}-vertical`,
|
|
2217
|
-
paginationDisabledClass: `${pfx}-disabled`
|
|
2166
|
+
disabledClass: 'swiper-button-disabled',
|
|
2167
|
+
hiddenClass: 'swiper-button-hidden',
|
|
2168
|
+
lockClass: 'swiper-button-lock',
|
|
2169
|
+
navigationDisabledClass: 'swiper-navigation-disabled'
|
|
2218
2170
|
}
|
|
2219
2171
|
});
|
|
2220
|
-
swiper.
|
|
2221
|
-
|
|
2222
|
-
|
|
2172
|
+
swiper.navigation = {
|
|
2173
|
+
nextEl: null,
|
|
2174
|
+
prevEl: null
|
|
2223
2175
|
};
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
function setSideBullets(bulletEl, position) {
|
|
2230
|
-
const {
|
|
2231
|
-
bulletActiveClass
|
|
2232
|
-
} = swiper.params.pagination;
|
|
2233
|
-
if (!bulletEl) return;
|
|
2234
|
-
bulletEl = bulletEl[`${position === 'prev' ? 'previous' : 'next'}ElementSibling`];
|
|
2235
|
-
if (bulletEl) {
|
|
2236
|
-
bulletEl.classList.add(`${bulletActiveClass}-${position}`);
|
|
2237
|
-
bulletEl = bulletEl[`${position === 'prev' ? 'previous' : 'next'}ElementSibling`];
|
|
2238
|
-
if (bulletEl) {
|
|
2239
|
-
bulletEl.classList.add(`${bulletActiveClass}-${position}-${position}`);
|
|
2240
|
-
}
|
|
2241
|
-
}
|
|
2242
|
-
}
|
|
2243
|
-
function getMoveDirection(prevIndex, nextIndex, length) {
|
|
2244
|
-
prevIndex = prevIndex % length;
|
|
2245
|
-
nextIndex = nextIndex % length;
|
|
2246
|
-
if (nextIndex === prevIndex + 1) {
|
|
2247
|
-
return 'next';
|
|
2248
|
-
} else if (nextIndex === prevIndex - 1) {
|
|
2249
|
-
return 'previous';
|
|
2250
|
-
}
|
|
2251
|
-
return;
|
|
2252
|
-
}
|
|
2253
|
-
function onBulletClick(e) {
|
|
2254
|
-
const bulletEl = e.target.closest(classesToSelector(swiper.params.pagination.bulletClass));
|
|
2255
|
-
if (!bulletEl) {
|
|
2256
|
-
return;
|
|
2176
|
+
function getEl(el) {
|
|
2177
|
+
let res;
|
|
2178
|
+
if (el && typeof el === 'string' && swiper.isElement) {
|
|
2179
|
+
res = swiper.el.querySelector(el) || swiper.hostEl.querySelector(el);
|
|
2180
|
+
if (res) return res;
|
|
2257
2181
|
}
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
swiper.slideNext();
|
|
2265
|
-
} else if (moveDirection === 'previous') {
|
|
2266
|
-
swiper.slidePrev();
|
|
2267
|
-
} else {
|
|
2268
|
-
swiper.slideToLoop(index);
|
|
2182
|
+
if (el) {
|
|
2183
|
+
if (typeof el === 'string') res = [...document.querySelectorAll(el)];
|
|
2184
|
+
if (swiper.params.uniqueNavElements && typeof el === 'string' && res && res.length > 1 && swiper.el.querySelectorAll(el).length === 1) {
|
|
2185
|
+
res = swiper.el.querySelector(el);
|
|
2186
|
+
} else if (res && res.length === 1) {
|
|
2187
|
+
res = res[0];
|
|
2269
2188
|
}
|
|
2270
|
-
} else {
|
|
2271
|
-
swiper.slideTo(index);
|
|
2272
2189
|
}
|
|
2190
|
+
if (el && !res) return el;
|
|
2191
|
+
// if (Array.isArray(res) && res.length === 1) res = res[0];
|
|
2192
|
+
return res;
|
|
2273
2193
|
}
|
|
2274
|
-
function
|
|
2275
|
-
|
|
2276
|
-
const rtl = swiper.rtl;
|
|
2277
|
-
const params = swiper.params.pagination;
|
|
2278
|
-
if (isPaginationDisabled()) return;
|
|
2279
|
-
let el = swiper.pagination.el;
|
|
2194
|
+
function toggleEl(el, disabled) {
|
|
2195
|
+
const params = swiper.params.navigation;
|
|
2280
2196
|
el = makeElementsArray(el);
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
previousIndex = swiper.previousRealIndex || 0;
|
|
2288
|
-
current = swiper.params.slidesPerGroup > 1 ? Math.floor(swiper.realIndex / swiper.params.slidesPerGroup) : swiper.realIndex;
|
|
2289
|
-
} else if (typeof swiper.snapIndex !== 'undefined') {
|
|
2290
|
-
current = swiper.snapIndex;
|
|
2291
|
-
previousIndex = swiper.previousSnapIndex;
|
|
2292
|
-
} else {
|
|
2293
|
-
previousIndex = swiper.previousIndex || 0;
|
|
2294
|
-
current = swiper.activeIndex || 0;
|
|
2295
|
-
}
|
|
2296
|
-
// Types
|
|
2297
|
-
if (params.type === 'bullets' && swiper.pagination.bullets && swiper.pagination.bullets.length > 0) {
|
|
2298
|
-
const bullets = swiper.pagination.bullets;
|
|
2299
|
-
let firstIndex;
|
|
2300
|
-
let lastIndex;
|
|
2301
|
-
let midIndex;
|
|
2302
|
-
if (params.dynamicBullets) {
|
|
2303
|
-
bulletSize = elementOuterSize(bullets[0], swiper.isHorizontal() ? 'width' : 'height');
|
|
2304
|
-
el.forEach(subEl => {
|
|
2305
|
-
subEl.style[swiper.isHorizontal() ? 'width' : 'height'] = `${bulletSize * (params.dynamicMainBullets + 4)}px`;
|
|
2306
|
-
});
|
|
2307
|
-
if (params.dynamicMainBullets > 1 && previousIndex !== undefined) {
|
|
2308
|
-
dynamicBulletIndex += current - (previousIndex || 0);
|
|
2309
|
-
if (dynamicBulletIndex > params.dynamicMainBullets - 1) {
|
|
2310
|
-
dynamicBulletIndex = params.dynamicMainBullets - 1;
|
|
2311
|
-
} else if (dynamicBulletIndex < 0) {
|
|
2312
|
-
dynamicBulletIndex = 0;
|
|
2313
|
-
}
|
|
2314
|
-
}
|
|
2315
|
-
firstIndex = Math.max(current - dynamicBulletIndex, 0);
|
|
2316
|
-
lastIndex = firstIndex + (Math.min(bullets.length, params.dynamicMainBullets) - 1);
|
|
2317
|
-
midIndex = (lastIndex + firstIndex) / 2;
|
|
2318
|
-
}
|
|
2319
|
-
bullets.forEach(bulletEl => {
|
|
2320
|
-
const classesToRemove = [...['', '-next', '-next-next', '-prev', '-prev-prev', '-main'].map(suffix => `${params.bulletActiveClass}${suffix}`)].map(s => typeof s === 'string' && s.includes(' ') ? s.split(' ') : s).flat();
|
|
2321
|
-
bulletEl.classList.remove(...classesToRemove);
|
|
2322
|
-
});
|
|
2323
|
-
if (el.length > 1) {
|
|
2324
|
-
bullets.forEach(bullet => {
|
|
2325
|
-
const bulletIndex = elementIndex(bullet);
|
|
2326
|
-
if (bulletIndex === current) {
|
|
2327
|
-
bullet.classList.add(...params.bulletActiveClass.split(' '));
|
|
2328
|
-
} else if (swiper.isElement) {
|
|
2329
|
-
bullet.setAttribute('part', 'bullet');
|
|
2330
|
-
}
|
|
2331
|
-
if (params.dynamicBullets) {
|
|
2332
|
-
if (bulletIndex >= firstIndex && bulletIndex <= lastIndex) {
|
|
2333
|
-
bullet.classList.add(...`${params.bulletActiveClass}-main`.split(' '));
|
|
2334
|
-
}
|
|
2335
|
-
if (bulletIndex === firstIndex) {
|
|
2336
|
-
setSideBullets(bullet, 'prev');
|
|
2337
|
-
}
|
|
2338
|
-
if (bulletIndex === lastIndex) {
|
|
2339
|
-
setSideBullets(bullet, 'next');
|
|
2340
|
-
}
|
|
2341
|
-
}
|
|
2342
|
-
});
|
|
2343
|
-
} else {
|
|
2344
|
-
const bullet = bullets[current];
|
|
2345
|
-
if (bullet) {
|
|
2346
|
-
bullet.classList.add(...params.bulletActiveClass.split(' '));
|
|
2347
|
-
}
|
|
2348
|
-
if (swiper.isElement) {
|
|
2349
|
-
bullets.forEach((bulletEl, bulletIndex) => {
|
|
2350
|
-
bulletEl.setAttribute('part', bulletIndex === current ? 'bullet-active' : 'bullet');
|
|
2351
|
-
});
|
|
2352
|
-
}
|
|
2353
|
-
if (params.dynamicBullets) {
|
|
2354
|
-
const firstDisplayedBullet = bullets[firstIndex];
|
|
2355
|
-
const lastDisplayedBullet = bullets[lastIndex];
|
|
2356
|
-
for (let i = firstIndex; i <= lastIndex; i += 1) {
|
|
2357
|
-
if (bullets[i]) {
|
|
2358
|
-
bullets[i].classList.add(...`${params.bulletActiveClass}-main`.split(' '));
|
|
2359
|
-
}
|
|
2360
|
-
}
|
|
2361
|
-
setSideBullets(firstDisplayedBullet, 'prev');
|
|
2362
|
-
setSideBullets(lastDisplayedBullet, 'next');
|
|
2363
|
-
}
|
|
2364
|
-
}
|
|
2365
|
-
if (params.dynamicBullets) {
|
|
2366
|
-
const dynamicBulletsLength = Math.min(bullets.length, params.dynamicMainBullets + 4);
|
|
2367
|
-
const bulletsOffset = (bulletSize * dynamicBulletsLength - bulletSize) / 2 - midIndex * bulletSize;
|
|
2368
|
-
const offsetProp = rtl ? 'right' : 'left';
|
|
2369
|
-
bullets.forEach(bullet => {
|
|
2370
|
-
bullet.style[swiper.isHorizontal() ? offsetProp : 'top'] = `${bulletsOffset}px`;
|
|
2371
|
-
});
|
|
2372
|
-
}
|
|
2373
|
-
}
|
|
2374
|
-
el.forEach((subEl, subElIndex) => {
|
|
2375
|
-
if (params.type === 'fraction') {
|
|
2376
|
-
subEl.querySelectorAll(classesToSelector(params.currentClass)).forEach(fractionEl => {
|
|
2377
|
-
fractionEl.textContent = params.formatFractionCurrent(current + 1);
|
|
2378
|
-
});
|
|
2379
|
-
subEl.querySelectorAll(classesToSelector(params.totalClass)).forEach(totalEl => {
|
|
2380
|
-
totalEl.textContent = params.formatFractionTotal(total);
|
|
2381
|
-
});
|
|
2382
|
-
}
|
|
2383
|
-
if (params.type === 'progressbar') {
|
|
2384
|
-
let progressbarDirection;
|
|
2385
|
-
if (params.progressbarOpposite) {
|
|
2386
|
-
progressbarDirection = swiper.isHorizontal() ? 'vertical' : 'horizontal';
|
|
2387
|
-
} else {
|
|
2388
|
-
progressbarDirection = swiper.isHorizontal() ? 'horizontal' : 'vertical';
|
|
2389
|
-
}
|
|
2390
|
-
const scale = (current + 1) / total;
|
|
2391
|
-
let scaleX = 1;
|
|
2392
|
-
let scaleY = 1;
|
|
2393
|
-
if (progressbarDirection === 'horizontal') {
|
|
2394
|
-
scaleX = scale;
|
|
2395
|
-
} else {
|
|
2396
|
-
scaleY = scale;
|
|
2197
|
+
el.forEach(subEl => {
|
|
2198
|
+
if (subEl) {
|
|
2199
|
+
subEl.classList[disabled ? 'add' : 'remove'](...params.disabledClass.split(' '));
|
|
2200
|
+
if (subEl.tagName === 'BUTTON') subEl.disabled = disabled;
|
|
2201
|
+
if (swiper.params.watchOverflow && swiper.enabled) {
|
|
2202
|
+
subEl.classList[swiper.isLocked ? 'add' : 'remove'](params.lockClass);
|
|
2397
2203
|
}
|
|
2398
|
-
subEl.querySelectorAll(classesToSelector(params.progressbarFillClass)).forEach(progressEl => {
|
|
2399
|
-
progressEl.style.transform = `translate3d(0,0,0) scaleX(${scaleX}) scaleY(${scaleY})`;
|
|
2400
|
-
progressEl.style.transitionDuration = `${swiper.params.speed}ms`;
|
|
2401
|
-
});
|
|
2402
|
-
}
|
|
2403
|
-
if (params.type === 'custom' && params.renderCustom) {
|
|
2404
|
-
subEl.innerHTML = params.renderCustom(swiper, current + 1, total);
|
|
2405
|
-
if (subElIndex === 0) emit('paginationRender', subEl);
|
|
2406
|
-
} else {
|
|
2407
|
-
if (subElIndex === 0) emit('paginationRender', subEl);
|
|
2408
|
-
emit('paginationUpdate', subEl);
|
|
2409
|
-
}
|
|
2410
|
-
if (swiper.params.watchOverflow && swiper.enabled) {
|
|
2411
|
-
subEl.classList[swiper.isLocked ? 'add' : 'remove'](params.lockClass);
|
|
2412
2204
|
}
|
|
2413
2205
|
});
|
|
2414
2206
|
}
|
|
2415
|
-
function
|
|
2416
|
-
//
|
|
2417
|
-
const
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
if (swiper.params.freeMode && swiper.params.freeMode.enabled && numberOfBullets > slidesLength) {
|
|
2426
|
-
numberOfBullets = slidesLength;
|
|
2427
|
-
}
|
|
2428
|
-
for (let i = 0; i < numberOfBullets; i += 1) {
|
|
2429
|
-
if (params.renderBullet) {
|
|
2430
|
-
paginationHTML += params.renderBullet.call(swiper, i, params.bulletClass);
|
|
2431
|
-
} else {
|
|
2432
|
-
// prettier-ignore
|
|
2433
|
-
paginationHTML += `<${params.bulletElement} ${swiper.isElement ? 'part="bullet"' : ''} class="${params.bulletClass}"></${params.bulletElement}>`;
|
|
2434
|
-
}
|
|
2435
|
-
}
|
|
2436
|
-
}
|
|
2437
|
-
if (params.type === 'fraction') {
|
|
2438
|
-
if (params.renderFraction) {
|
|
2439
|
-
paginationHTML = params.renderFraction.call(swiper, params.currentClass, params.totalClass);
|
|
2440
|
-
} else {
|
|
2441
|
-
paginationHTML = `<span class="${params.currentClass}"></span>` + ' / ' + `<span class="${params.totalClass}"></span>`;
|
|
2442
|
-
}
|
|
2443
|
-
}
|
|
2444
|
-
if (params.type === 'progressbar') {
|
|
2445
|
-
if (params.renderProgressbar) {
|
|
2446
|
-
paginationHTML = params.renderProgressbar.call(swiper, params.progressbarFillClass);
|
|
2447
|
-
} else {
|
|
2448
|
-
paginationHTML = `<span class="${params.progressbarFillClass}"></span>`;
|
|
2449
|
-
}
|
|
2450
|
-
}
|
|
2451
|
-
swiper.pagination.bullets = [];
|
|
2452
|
-
el.forEach(subEl => {
|
|
2453
|
-
if (params.type !== 'custom') {
|
|
2454
|
-
subEl.innerHTML = paginationHTML || '';
|
|
2455
|
-
}
|
|
2456
|
-
if (params.type === 'bullets') {
|
|
2457
|
-
swiper.pagination.bullets.push(...subEl.querySelectorAll(classesToSelector(params.bulletClass)));
|
|
2458
|
-
}
|
|
2459
|
-
});
|
|
2460
|
-
if (params.type !== 'custom') {
|
|
2461
|
-
emit('paginationRender', el[0]);
|
|
2207
|
+
function update() {
|
|
2208
|
+
// Update Navigation Buttons
|
|
2209
|
+
const {
|
|
2210
|
+
nextEl,
|
|
2211
|
+
prevEl
|
|
2212
|
+
} = swiper.navigation;
|
|
2213
|
+
if (swiper.params.loop) {
|
|
2214
|
+
toggleEl(prevEl, false);
|
|
2215
|
+
toggleEl(nextEl, false);
|
|
2216
|
+
return;
|
|
2462
2217
|
}
|
|
2218
|
+
toggleEl(prevEl, swiper.isBeginning && !swiper.params.rewind);
|
|
2219
|
+
toggleEl(nextEl, swiper.isEnd && !swiper.params.rewind);
|
|
2220
|
+
}
|
|
2221
|
+
function onPrevClick(e) {
|
|
2222
|
+
e.preventDefault();
|
|
2223
|
+
if (swiper.isBeginning && !swiper.params.loop && !swiper.params.rewind) return;
|
|
2224
|
+
swiper.slidePrev();
|
|
2225
|
+
emit('navigationPrev');
|
|
2226
|
+
}
|
|
2227
|
+
function onNextClick(e) {
|
|
2228
|
+
e.preventDefault();
|
|
2229
|
+
if (swiper.isEnd && !swiper.params.loop && !swiper.params.rewind) return;
|
|
2230
|
+
swiper.slideNext();
|
|
2231
|
+
emit('navigationNext');
|
|
2463
2232
|
}
|
|
2464
2233
|
function init() {
|
|
2465
|
-
|
|
2466
|
-
|
|
2234
|
+
const params = swiper.params.navigation;
|
|
2235
|
+
swiper.params.navigation = createElementIfNotDefined(swiper, swiper.originalParams.navigation, swiper.params.navigation, {
|
|
2236
|
+
nextEl: 'swiper-button-next',
|
|
2237
|
+
prevEl: 'swiper-button-prev'
|
|
2467
2238
|
});
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
let
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
if (!el && typeof params.el === 'string') {
|
|
2475
|
-
el = [...document.querySelectorAll(params.el)];
|
|
2476
|
-
}
|
|
2477
|
-
if (!el) {
|
|
2478
|
-
el = params.el;
|
|
2479
|
-
}
|
|
2480
|
-
if (!el || el.length === 0) return;
|
|
2481
|
-
if (swiper.params.uniqueNavElements && typeof params.el === 'string' && Array.isArray(el) && el.length > 1) {
|
|
2482
|
-
el = [...swiper.el.querySelectorAll(params.el)];
|
|
2483
|
-
// check if it belongs to another nested Swiper
|
|
2484
|
-
if (el.length > 1) {
|
|
2485
|
-
el = el.filter(subEl => {
|
|
2486
|
-
if (elementParents(subEl, '.swiper')[0] !== swiper.el) return false;
|
|
2487
|
-
return true;
|
|
2488
|
-
})[0];
|
|
2489
|
-
}
|
|
2490
|
-
}
|
|
2491
|
-
if (Array.isArray(el) && el.length === 1) el = el[0];
|
|
2492
|
-
Object.assign(swiper.pagination, {
|
|
2493
|
-
el
|
|
2239
|
+
if (!(params.nextEl || params.prevEl)) return;
|
|
2240
|
+
let nextEl = getEl(params.nextEl);
|
|
2241
|
+
let prevEl = getEl(params.prevEl);
|
|
2242
|
+
Object.assign(swiper.navigation, {
|
|
2243
|
+
nextEl,
|
|
2244
|
+
prevEl
|
|
2494
2245
|
});
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
subEl.classList.add(params.modifierClass + params.type);
|
|
2501
|
-
subEl.classList.add(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass);
|
|
2502
|
-
if (params.type === 'bullets' && params.dynamicBullets) {
|
|
2503
|
-
subEl.classList.add(`${params.modifierClass}${params.type}-dynamic`);
|
|
2504
|
-
dynamicBulletIndex = 0;
|
|
2505
|
-
if (params.dynamicMainBullets < 1) {
|
|
2506
|
-
params.dynamicMainBullets = 1;
|
|
2507
|
-
}
|
|
2508
|
-
}
|
|
2509
|
-
if (params.type === 'progressbar' && params.progressbarOpposite) {
|
|
2510
|
-
subEl.classList.add(params.progressbarOppositeClass);
|
|
2511
|
-
}
|
|
2512
|
-
if (params.clickable) {
|
|
2513
|
-
subEl.addEventListener('click', onBulletClick);
|
|
2246
|
+
nextEl = makeElementsArray(nextEl);
|
|
2247
|
+
prevEl = makeElementsArray(prevEl);
|
|
2248
|
+
const initButton = (el, dir) => {
|
|
2249
|
+
if (el) {
|
|
2250
|
+
el.addEventListener('click', dir === 'next' ? onNextClick : onPrevClick);
|
|
2514
2251
|
}
|
|
2515
|
-
if (!swiper.enabled) {
|
|
2516
|
-
|
|
2252
|
+
if (!swiper.enabled && el) {
|
|
2253
|
+
el.classList.add(...params.lockClass.split(' '));
|
|
2517
2254
|
}
|
|
2518
|
-
}
|
|
2255
|
+
};
|
|
2256
|
+
nextEl.forEach(el => initButton(el, 'next'));
|
|
2257
|
+
prevEl.forEach(el => initButton(el, 'prev'));
|
|
2519
2258
|
}
|
|
2520
2259
|
function destroy() {
|
|
2521
|
-
const params = swiper.params.pagination;
|
|
2522
|
-
if (isPaginationDisabled()) return;
|
|
2523
|
-
let el = swiper.pagination.el;
|
|
2524
|
-
if (el) {
|
|
2525
|
-
el = makeElementsArray(el);
|
|
2526
|
-
el.forEach(subEl => {
|
|
2527
|
-
subEl.classList.remove(params.hiddenClass);
|
|
2528
|
-
subEl.classList.remove(params.modifierClass + params.type);
|
|
2529
|
-
subEl.classList.remove(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass);
|
|
2530
|
-
if (params.clickable) {
|
|
2531
|
-
subEl.classList.remove(...(params.clickableClass || '').split(' '));
|
|
2532
|
-
subEl.removeEventListener('click', onBulletClick);
|
|
2533
|
-
}
|
|
2534
|
-
});
|
|
2535
|
-
}
|
|
2536
|
-
if (swiper.pagination.bullets) swiper.pagination.bullets.forEach(subEl => subEl.classList.remove(...params.bulletActiveClass.split(' ')));
|
|
2537
|
-
}
|
|
2538
|
-
on('changeDirection', () => {
|
|
2539
|
-
if (!swiper.pagination || !swiper.pagination.el) return;
|
|
2540
|
-
const params = swiper.params.pagination;
|
|
2541
2260
|
let {
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2261
|
+
nextEl,
|
|
2262
|
+
prevEl
|
|
2263
|
+
} = swiper.navigation;
|
|
2264
|
+
nextEl = makeElementsArray(nextEl);
|
|
2265
|
+
prevEl = makeElementsArray(prevEl);
|
|
2266
|
+
const destroyButton = (el, dir) => {
|
|
2267
|
+
el.removeEventListener('click', dir === 'next' ? onNextClick : onPrevClick);
|
|
2268
|
+
el.classList.remove(...swiper.params.navigation.disabledClass.split(' '));
|
|
2269
|
+
};
|
|
2270
|
+
nextEl.forEach(el => destroyButton(el, 'next'));
|
|
2271
|
+
prevEl.forEach(el => destroyButton(el, 'prev'));
|
|
2272
|
+
}
|
|
2550
2273
|
on('init', () => {
|
|
2551
|
-
if (swiper.params.
|
|
2274
|
+
if (swiper.params.navigation.enabled === false) {
|
|
2552
2275
|
// eslint-disable-next-line
|
|
2553
2276
|
disable();
|
|
2554
2277
|
} else {
|
|
2555
2278
|
init();
|
|
2556
|
-
render();
|
|
2557
|
-
update();
|
|
2558
|
-
}
|
|
2559
|
-
});
|
|
2560
|
-
on('activeIndexChange', () => {
|
|
2561
|
-
if (typeof swiper.snapIndex === 'undefined') {
|
|
2562
2279
|
update();
|
|
2563
2280
|
}
|
|
2564
2281
|
});
|
|
2565
|
-
on('
|
|
2566
|
-
update();
|
|
2567
|
-
});
|
|
2568
|
-
on('snapGridLengthChange', () => {
|
|
2569
|
-
render();
|
|
2282
|
+
on('toEdge fromEdge lock unlock', () => {
|
|
2570
2283
|
update();
|
|
2571
2284
|
});
|
|
2572
2285
|
on('destroy', () => {
|
|
@@ -2574,64 +2287,255 @@ function Pagination$1(_ref) {
|
|
|
2574
2287
|
});
|
|
2575
2288
|
on('enable disable', () => {
|
|
2576
2289
|
let {
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2290
|
+
nextEl,
|
|
2291
|
+
prevEl
|
|
2292
|
+
} = swiper.navigation;
|
|
2293
|
+
nextEl = makeElementsArray(nextEl);
|
|
2294
|
+
prevEl = makeElementsArray(prevEl);
|
|
2295
|
+
if (swiper.enabled) {
|
|
2296
|
+
update();
|
|
2297
|
+
return;
|
|
2582
2298
|
}
|
|
2583
|
-
|
|
2584
|
-
on('lock unlock', () => {
|
|
2585
|
-
update();
|
|
2299
|
+
[...nextEl, ...prevEl].filter(el => !!el).forEach(el => el.classList.add(swiper.params.navigation.lockClass));
|
|
2586
2300
|
});
|
|
2587
2301
|
on('click', (_s, e) => {
|
|
2302
|
+
let {
|
|
2303
|
+
nextEl,
|
|
2304
|
+
prevEl
|
|
2305
|
+
} = swiper.navigation;
|
|
2306
|
+
nextEl = makeElementsArray(nextEl);
|
|
2307
|
+
prevEl = makeElementsArray(prevEl);
|
|
2588
2308
|
const targetEl = e.target;
|
|
2589
|
-
|
|
2590
|
-
if (swiper.
|
|
2591
|
-
|
|
2592
|
-
|
|
2309
|
+
let targetIsButton = prevEl.includes(targetEl) || nextEl.includes(targetEl);
|
|
2310
|
+
if (swiper.isElement && !targetIsButton) {
|
|
2311
|
+
const path = e.path || e.composedPath && e.composedPath();
|
|
2312
|
+
if (path) {
|
|
2313
|
+
targetIsButton = path.find(pathEl => nextEl.includes(pathEl) || prevEl.includes(pathEl));
|
|
2314
|
+
}
|
|
2315
|
+
}
|
|
2316
|
+
if (swiper.params.navigation.hideOnClick && !targetIsButton) {
|
|
2317
|
+
if (swiper.pagination && swiper.params.pagination && swiper.params.pagination.clickable && (swiper.pagination.el === targetEl || swiper.pagination.el.contains(targetEl))) return;
|
|
2318
|
+
let isHidden;
|
|
2319
|
+
if (nextEl.length) {
|
|
2320
|
+
isHidden = nextEl[0].classList.contains(swiper.params.navigation.hiddenClass);
|
|
2321
|
+
} else if (prevEl.length) {
|
|
2322
|
+
isHidden = prevEl[0].classList.contains(swiper.params.navigation.hiddenClass);
|
|
2323
|
+
}
|
|
2593
2324
|
if (isHidden === true) {
|
|
2594
|
-
emit('
|
|
2325
|
+
emit('navigationShow');
|
|
2595
2326
|
} else {
|
|
2596
|
-
emit('
|
|
2327
|
+
emit('navigationHide');
|
|
2597
2328
|
}
|
|
2598
|
-
el.forEach(
|
|
2329
|
+
[...nextEl, ...prevEl].filter(el => !!el).forEach(el => el.classList.toggle(swiper.params.navigation.hiddenClass));
|
|
2599
2330
|
}
|
|
2600
2331
|
});
|
|
2601
2332
|
const enable = () => {
|
|
2602
|
-
swiper.el.classList.remove(swiper.params.
|
|
2603
|
-
let {
|
|
2604
|
-
el
|
|
2605
|
-
} = swiper.pagination;
|
|
2606
|
-
if (el) {
|
|
2607
|
-
el = makeElementsArray(el);
|
|
2608
|
-
el.forEach(subEl => subEl.classList.remove(swiper.params.pagination.paginationDisabledClass));
|
|
2609
|
-
}
|
|
2333
|
+
swiper.el.classList.remove(...swiper.params.navigation.navigationDisabledClass.split(' '));
|
|
2610
2334
|
init();
|
|
2611
|
-
render();
|
|
2612
2335
|
update();
|
|
2613
2336
|
};
|
|
2614
2337
|
const disable = () => {
|
|
2615
|
-
swiper.el.classList.add(swiper.params.
|
|
2616
|
-
let {
|
|
2617
|
-
el
|
|
2618
|
-
} = swiper.pagination;
|
|
2619
|
-
if (el) {
|
|
2620
|
-
el = makeElementsArray(el);
|
|
2621
|
-
el.forEach(subEl => subEl.classList.add(swiper.params.pagination.paginationDisabledClass));
|
|
2622
|
-
}
|
|
2338
|
+
swiper.el.classList.add(...swiper.params.navigation.navigationDisabledClass.split(' '));
|
|
2623
2339
|
destroy();
|
|
2624
2340
|
};
|
|
2625
|
-
Object.assign(swiper.
|
|
2341
|
+
Object.assign(swiper.navigation, {
|
|
2626
2342
|
enable,
|
|
2627
2343
|
disable,
|
|
2628
|
-
render,
|
|
2629
2344
|
update,
|
|
2630
2345
|
init,
|
|
2631
2346
|
destroy
|
|
2632
2347
|
});
|
|
2633
2348
|
}
|
|
2634
2349
|
|
|
2350
|
+
function Thumb(_ref) {
|
|
2351
|
+
let {
|
|
2352
|
+
swiper,
|
|
2353
|
+
extendParams,
|
|
2354
|
+
on
|
|
2355
|
+
} = _ref;
|
|
2356
|
+
extendParams({
|
|
2357
|
+
thumbs: {
|
|
2358
|
+
swiper: null,
|
|
2359
|
+
multipleActiveThumbs: true,
|
|
2360
|
+
autoScrollOffset: 0,
|
|
2361
|
+
slideThumbActiveClass: 'swiper-slide-thumb-active',
|
|
2362
|
+
thumbsContainerClass: 'swiper-thumbs'
|
|
2363
|
+
}
|
|
2364
|
+
});
|
|
2365
|
+
let initialized = false;
|
|
2366
|
+
let swiperCreated = false;
|
|
2367
|
+
swiper.thumbs = {
|
|
2368
|
+
swiper: null
|
|
2369
|
+
};
|
|
2370
|
+
function onThumbClick() {
|
|
2371
|
+
const thumbsSwiper = swiper.thumbs.swiper;
|
|
2372
|
+
if (!thumbsSwiper || thumbsSwiper.destroyed) return;
|
|
2373
|
+
const clickedIndex = thumbsSwiper.clickedIndex;
|
|
2374
|
+
const clickedSlide = thumbsSwiper.clickedSlide;
|
|
2375
|
+
if (clickedSlide && clickedSlide.classList.contains(swiper.params.thumbs.slideThumbActiveClass)) return;
|
|
2376
|
+
if (typeof clickedIndex === 'undefined' || clickedIndex === null) return;
|
|
2377
|
+
let slideToIndex;
|
|
2378
|
+
if (thumbsSwiper.params.loop) {
|
|
2379
|
+
slideToIndex = parseInt(thumbsSwiper.clickedSlide.getAttribute('data-swiper-slide-index'), 10);
|
|
2380
|
+
} else {
|
|
2381
|
+
slideToIndex = clickedIndex;
|
|
2382
|
+
}
|
|
2383
|
+
if (swiper.params.loop) {
|
|
2384
|
+
swiper.slideToLoop(slideToIndex);
|
|
2385
|
+
} else {
|
|
2386
|
+
swiper.slideTo(slideToIndex);
|
|
2387
|
+
}
|
|
2388
|
+
}
|
|
2389
|
+
function init() {
|
|
2390
|
+
const {
|
|
2391
|
+
thumbs: thumbsParams
|
|
2392
|
+
} = swiper.params;
|
|
2393
|
+
if (initialized) return false;
|
|
2394
|
+
initialized = true;
|
|
2395
|
+
const SwiperClass = swiper.constructor;
|
|
2396
|
+
if (thumbsParams.swiper instanceof SwiperClass) {
|
|
2397
|
+
swiper.thumbs.swiper = thumbsParams.swiper;
|
|
2398
|
+
Object.assign(swiper.thumbs.swiper.originalParams, {
|
|
2399
|
+
watchSlidesProgress: true,
|
|
2400
|
+
slideToClickedSlide: false
|
|
2401
|
+
});
|
|
2402
|
+
Object.assign(swiper.thumbs.swiper.params, {
|
|
2403
|
+
watchSlidesProgress: true,
|
|
2404
|
+
slideToClickedSlide: false
|
|
2405
|
+
});
|
|
2406
|
+
swiper.thumbs.swiper.update();
|
|
2407
|
+
} else if (isObject$1(thumbsParams.swiper)) {
|
|
2408
|
+
const thumbsSwiperParams = Object.assign({}, thumbsParams.swiper);
|
|
2409
|
+
Object.assign(thumbsSwiperParams, {
|
|
2410
|
+
watchSlidesProgress: true,
|
|
2411
|
+
slideToClickedSlide: false
|
|
2412
|
+
});
|
|
2413
|
+
swiper.thumbs.swiper = new SwiperClass(thumbsSwiperParams);
|
|
2414
|
+
swiperCreated = true;
|
|
2415
|
+
}
|
|
2416
|
+
swiper.thumbs.swiper.el.classList.add(swiper.params.thumbs.thumbsContainerClass);
|
|
2417
|
+
swiper.thumbs.swiper.on('tap', onThumbClick);
|
|
2418
|
+
return true;
|
|
2419
|
+
}
|
|
2420
|
+
function update(initial) {
|
|
2421
|
+
const thumbsSwiper = swiper.thumbs.swiper;
|
|
2422
|
+
if (!thumbsSwiper || thumbsSwiper.destroyed) return;
|
|
2423
|
+
const slidesPerView = thumbsSwiper.params.slidesPerView === 'auto' ? thumbsSwiper.slidesPerViewDynamic() : thumbsSwiper.params.slidesPerView;
|
|
2424
|
+
|
|
2425
|
+
// Activate thumbs
|
|
2426
|
+
let thumbsToActivate = 1;
|
|
2427
|
+
const thumbActiveClass = swiper.params.thumbs.slideThumbActiveClass;
|
|
2428
|
+
if (swiper.params.slidesPerView > 1 && !swiper.params.centeredSlides) {
|
|
2429
|
+
thumbsToActivate = swiper.params.slidesPerView;
|
|
2430
|
+
}
|
|
2431
|
+
if (!swiper.params.thumbs.multipleActiveThumbs) {
|
|
2432
|
+
thumbsToActivate = 1;
|
|
2433
|
+
}
|
|
2434
|
+
thumbsToActivate = Math.floor(thumbsToActivate);
|
|
2435
|
+
thumbsSwiper.slides.forEach(slideEl => slideEl.classList.remove(thumbActiveClass));
|
|
2436
|
+
if (thumbsSwiper.params.loop || thumbsSwiper.params.virtual && thumbsSwiper.params.virtual.enabled) {
|
|
2437
|
+
for (let i = 0; i < thumbsToActivate; i += 1) {
|
|
2438
|
+
elementChildren(thumbsSwiper.slidesEl, `[data-swiper-slide-index="${swiper.realIndex + i}"]`).forEach(slideEl => {
|
|
2439
|
+
slideEl.classList.add(thumbActiveClass);
|
|
2440
|
+
});
|
|
2441
|
+
}
|
|
2442
|
+
} else {
|
|
2443
|
+
for (let i = 0; i < thumbsToActivate; i += 1) {
|
|
2444
|
+
if (thumbsSwiper.slides[swiper.realIndex + i]) {
|
|
2445
|
+
thumbsSwiper.slides[swiper.realIndex + i].classList.add(thumbActiveClass);
|
|
2446
|
+
}
|
|
2447
|
+
}
|
|
2448
|
+
}
|
|
2449
|
+
const autoScrollOffset = swiper.params.thumbs.autoScrollOffset;
|
|
2450
|
+
const useOffset = autoScrollOffset && !thumbsSwiper.params.loop;
|
|
2451
|
+
if (swiper.realIndex !== thumbsSwiper.realIndex || useOffset) {
|
|
2452
|
+
const currentThumbsIndex = thumbsSwiper.activeIndex;
|
|
2453
|
+
let newThumbsIndex;
|
|
2454
|
+
let direction;
|
|
2455
|
+
if (thumbsSwiper.params.loop) {
|
|
2456
|
+
const newThumbsSlide = thumbsSwiper.slides.filter(slideEl => slideEl.getAttribute('data-swiper-slide-index') === `${swiper.realIndex}`)[0];
|
|
2457
|
+
newThumbsIndex = thumbsSwiper.slides.indexOf(newThumbsSlide);
|
|
2458
|
+
direction = swiper.activeIndex > swiper.previousIndex ? 'next' : 'prev';
|
|
2459
|
+
} else {
|
|
2460
|
+
newThumbsIndex = swiper.realIndex;
|
|
2461
|
+
direction = newThumbsIndex > swiper.previousIndex ? 'next' : 'prev';
|
|
2462
|
+
}
|
|
2463
|
+
if (useOffset) {
|
|
2464
|
+
newThumbsIndex += direction === 'next' ? autoScrollOffset : -1 * autoScrollOffset;
|
|
2465
|
+
}
|
|
2466
|
+
if (thumbsSwiper.visibleSlidesIndexes && thumbsSwiper.visibleSlidesIndexes.indexOf(newThumbsIndex) < 0) {
|
|
2467
|
+
if (thumbsSwiper.params.centeredSlides) {
|
|
2468
|
+
if (newThumbsIndex > currentThumbsIndex) {
|
|
2469
|
+
newThumbsIndex = newThumbsIndex - Math.floor(slidesPerView / 2) + 1;
|
|
2470
|
+
} else {
|
|
2471
|
+
newThumbsIndex = newThumbsIndex + Math.floor(slidesPerView / 2) - 1;
|
|
2472
|
+
}
|
|
2473
|
+
} else if (newThumbsIndex > currentThumbsIndex && thumbsSwiper.params.slidesPerGroup === 1) ;
|
|
2474
|
+
thumbsSwiper.slideTo(newThumbsIndex, initial ? 0 : undefined);
|
|
2475
|
+
}
|
|
2476
|
+
}
|
|
2477
|
+
}
|
|
2478
|
+
on('beforeInit', () => {
|
|
2479
|
+
const {
|
|
2480
|
+
thumbs
|
|
2481
|
+
} = swiper.params;
|
|
2482
|
+
if (!thumbs || !thumbs.swiper) return;
|
|
2483
|
+
if (typeof thumbs.swiper === 'string' || thumbs.swiper instanceof HTMLElement) {
|
|
2484
|
+
const document = getDocument();
|
|
2485
|
+
const getThumbsElementAndInit = () => {
|
|
2486
|
+
const thumbsElement = typeof thumbs.swiper === 'string' ? document.querySelector(thumbs.swiper) : thumbs.swiper;
|
|
2487
|
+
if (thumbsElement && thumbsElement.swiper) {
|
|
2488
|
+
thumbs.swiper = thumbsElement.swiper;
|
|
2489
|
+
init();
|
|
2490
|
+
update(true);
|
|
2491
|
+
} else if (thumbsElement) {
|
|
2492
|
+
const eventName = `${swiper.params.eventsPrefix}init`;
|
|
2493
|
+
const onThumbsSwiper = e => {
|
|
2494
|
+
thumbs.swiper = e.detail[0];
|
|
2495
|
+
thumbsElement.removeEventListener(eventName, onThumbsSwiper);
|
|
2496
|
+
init();
|
|
2497
|
+
update(true);
|
|
2498
|
+
thumbs.swiper.update();
|
|
2499
|
+
swiper.update();
|
|
2500
|
+
};
|
|
2501
|
+
thumbsElement.addEventListener(eventName, onThumbsSwiper);
|
|
2502
|
+
}
|
|
2503
|
+
return thumbsElement;
|
|
2504
|
+
};
|
|
2505
|
+
const watchForThumbsToAppear = () => {
|
|
2506
|
+
if (swiper.destroyed) return;
|
|
2507
|
+
const thumbsElement = getThumbsElementAndInit();
|
|
2508
|
+
if (!thumbsElement) {
|
|
2509
|
+
requestAnimationFrame(watchForThumbsToAppear);
|
|
2510
|
+
}
|
|
2511
|
+
};
|
|
2512
|
+
requestAnimationFrame(watchForThumbsToAppear);
|
|
2513
|
+
} else {
|
|
2514
|
+
init();
|
|
2515
|
+
update(true);
|
|
2516
|
+
}
|
|
2517
|
+
});
|
|
2518
|
+
on('slideChange update resize observerUpdate', () => {
|
|
2519
|
+
update();
|
|
2520
|
+
});
|
|
2521
|
+
on('setTransition', (_s, duration) => {
|
|
2522
|
+
const thumbsSwiper = swiper.thumbs.swiper;
|
|
2523
|
+
if (!thumbsSwiper || thumbsSwiper.destroyed) return;
|
|
2524
|
+
thumbsSwiper.setTransition(duration);
|
|
2525
|
+
});
|
|
2526
|
+
on('beforeDestroy', () => {
|
|
2527
|
+
const thumbsSwiper = swiper.thumbs.swiper;
|
|
2528
|
+
if (!thumbsSwiper || thumbsSwiper.destroyed) return;
|
|
2529
|
+
if (swiperCreated) {
|
|
2530
|
+
thumbsSwiper.destroy();
|
|
2531
|
+
}
|
|
2532
|
+
});
|
|
2533
|
+
Object.assign(swiper.thumbs, {
|
|
2534
|
+
init,
|
|
2535
|
+
update
|
|
2536
|
+
});
|
|
2537
|
+
}
|
|
2538
|
+
|
|
2635
2539
|
function freeMode(_ref) {
|
|
2636
2540
|
let {
|
|
2637
2541
|
swiper,
|
|
@@ -7247,9 +7151,6 @@ function useIsomorphicLayoutEffect(callback, deps) {
|
|
|
7247
7151
|
|
|
7248
7152
|
const SwiperSlideContext = /*#__PURE__*/createContext(null);
|
|
7249
7153
|
const SwiperContext = /*#__PURE__*/createContext(null);
|
|
7250
|
-
const useSwiper = () => {
|
|
7251
|
-
return useContext(SwiperContext);
|
|
7252
|
-
};
|
|
7253
7154
|
|
|
7254
7155
|
const Swiper = /*#__PURE__*/forwardRef(function (_temp, externalElRef) {
|
|
7255
7156
|
let {
|
|
@@ -7519,25 +7420,13 @@ function GlyphsArrowBoldCapsLeftIcon(props) {
|
|
|
7519
7420
|
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", ...props, fill: "currentColor", height: "11", viewBox: "0 0 11 11", width: "11", children: jsx("path", { d: "M2.31124163,11 C2.06716529,11 1.91839241,10.7730596 2.04771379,10.5980857 L6.08820761,5.13116556 C6.42092595,4.68081431 6.37243043,4.10595375 5.96732409,3.70073526 L2.70240329,0.432177991 C2.53178078,0.261409485 2.67540212,0 2.93972934,0 L5.48361239,0 C5.57518542,0 5.6619622,0.0340936243 5.72102726,0.0931942463 L8.14882304,2.52367916 C9.1607451,3.53657521 9.28198389,4.9729381 8.45036569,6.09787751 L4.91836426,10.876542 C4.86160851,10.9533653 4.7620417,11 4.65492523,11 L2.31124163,11 Z", fillRule: "evenodd", transform: "matrix(-1 0 0 1 11 0)" }) }));
|
|
7520
7421
|
}
|
|
7521
7422
|
|
|
7522
|
-
var styles$
|
|
7423
|
+
var styles$P = {"carousel-navigation-button":"carousel-navigation-button-module-a1-I4"};
|
|
7523
7424
|
|
|
7524
|
-
|
|
7525
|
-
|
|
7526
|
-
|
|
7527
|
-
|
|
7528
|
-
|
|
7529
|
-
function handleNavigation() {
|
|
7530
|
-
if (direction === 'next') {
|
|
7531
|
-
swiper.slideTo(swiper.activeIndex + slidesPerView);
|
|
7532
|
-
}
|
|
7533
|
-
else {
|
|
7534
|
-
swiper.slideTo(swiper.activeIndex - slidesPerView);
|
|
7535
|
-
}
|
|
7536
|
-
}
|
|
7537
|
-
return (jsx(Button$1, { className: clsx(styles$J['navigation-button'], {
|
|
7538
|
-
[styles$J['is-locked']]: swiper.isLocked,
|
|
7539
|
-
}), isDisabled: isDisabled, onPress: handleNavigation, children: direction === 'previous' ? (jsx(GlyphsArrowBoldCapsLeftIcon, {})) : (jsx(GlyphsArrowBoldCapsRightIcon, {})) }));
|
|
7540
|
-
}
|
|
7425
|
+
const CarouselNavigationButton = forwardRef(function NavigationButton({ className, direction, onClick }, ref) {
|
|
7426
|
+
return (jsx(Button$1, { ref: ref, className: clsx(styles$P['carousel-navigation-button'], className), onPress: () => (onClick ? onClick(direction) : undefined), children: direction === 'previous' ? (jsx(GlyphsArrowBoldCapsLeftIcon, {})) : (jsx(GlyphsArrowBoldCapsRightIcon, {})) }));
|
|
7427
|
+
});
|
|
7428
|
+
|
|
7429
|
+
var styles$O = {"carousel":"carousel-module-ealh-","swiper":"carousel-module-IftbN","is-ready":"carousel-module-RCpfc","has-overflow":"carousel-module-tPg7k","slide":"carousel-module-bUMlb","navigation-button-next":"carousel-module-T7bTr","is-dragging":"carousel-module-34OWD","navigation-button-prev":"carousel-module-984Rr","navigation-buttons":"carousel-module-k7Z4S","navigation-button":"carousel-module-kcqEE","top":"carousel-module-nL-O8","center":"carousel-module-5SGYn"};
|
|
7541
7430
|
|
|
7542
7431
|
function generateSlidesPerViewBreakpoints(slidesPerView) {
|
|
7543
7432
|
return Object.keys(slidesPerView).reduce((result, breakpoint) => ({
|
|
@@ -7548,48 +7437,63 @@ function generateSlidesPerViewBreakpoints(slidesPerView) {
|
|
|
7548
7437
|
}), {});
|
|
7549
7438
|
}
|
|
7550
7439
|
function Carousel({ breakpoints: _breakpoints, className, hasNavigation = true, hasOverflow = true, navigationButtonsPosition = 'top', slideClasses, slides, slidesPerView: _slidesPerView = 'auto', spaceBetween, }) {
|
|
7551
|
-
const [isEnd, setIsEnd] = useState(false);
|
|
7552
|
-
const [isBeginning, setIsBeginning] = useState(true);
|
|
7553
|
-
const [isLocked, setIsLocked] = useState(undefined);
|
|
7554
7440
|
const [isDragging, setIsDragging] = useState(false);
|
|
7555
7441
|
const [isReady, setIsReady] = useState(false);
|
|
7556
|
-
|
|
7557
|
-
|
|
7558
|
-
|
|
7559
|
-
|
|
7560
|
-
}
|
|
7442
|
+
const [amountOfSlides, setAmountOfSlides] = useState(0);
|
|
7443
|
+
const nextEl = useRef(null);
|
|
7444
|
+
const prevEl = useRef(null);
|
|
7445
|
+
const swiperRef = useRef(null);
|
|
7561
7446
|
const slidesPerView = typeof _slidesPerView !== 'object' ? _slidesPerView : undefined;
|
|
7447
|
+
function handleNavigationButtonClick(direction) {
|
|
7448
|
+
if (!swiperRef.current)
|
|
7449
|
+
return;
|
|
7450
|
+
if (direction === 'next') {
|
|
7451
|
+
swiperRef.current.slideTo(swiperRef.current.activeIndex + amountOfSlides - 1);
|
|
7452
|
+
}
|
|
7453
|
+
else {
|
|
7454
|
+
swiperRef.current.slideTo(swiperRef.current.activeIndex - amountOfSlides - 1);
|
|
7455
|
+
}
|
|
7456
|
+
}
|
|
7457
|
+
useEffect(() => {
|
|
7458
|
+
setAmountOfSlides(typeof swiperRef.current?.params.slidesPerView === 'number'
|
|
7459
|
+
? swiperRef.current.params.slidesPerView
|
|
7460
|
+
: swiperRef.current?.slidesPerViewDynamic() || 1);
|
|
7461
|
+
}, [swiperRef]);
|
|
7562
7462
|
if (typeof _slidesPerView === 'object') {
|
|
7563
7463
|
const slidesPerViewBreakpoints = generateSlidesPerViewBreakpoints(_slidesPerView);
|
|
7564
7464
|
_breakpoints = deepMerge(_breakpoints, slidesPerViewBreakpoints);
|
|
7565
7465
|
}
|
|
7566
7466
|
if (slides.length === 0)
|
|
7567
7467
|
return null;
|
|
7568
|
-
return (
|
|
7468
|
+
return (jsxs("div", { className: clsx(styles$O.carousel, className), style: spaceBetween !== undefined
|
|
7569
7469
|
? { '--column-gap': `${spaceBetween}px` }
|
|
7570
|
-
: undefined, children:
|
|
7571
|
-
|
|
7572
|
-
|
|
7573
|
-
|
|
7574
|
-
|
|
7575
|
-
|
|
7576
|
-
|
|
7577
|
-
|
|
7578
|
-
|
|
7579
|
-
|
|
7580
|
-
|
|
7581
|
-
}
|
|
7582
|
-
|
|
7583
|
-
|
|
7470
|
+
: undefined, children: [jsx(Swiper, { breakpoints: _breakpoints, className: clsx(styles$O.swiper, {
|
|
7471
|
+
[styles$O['is-dragging']]: isDragging,
|
|
7472
|
+
[styles$O['has-overflow']]: hasOverflow,
|
|
7473
|
+
[styles$O['is-ready']]: isReady,
|
|
7474
|
+
}), freeMode: {
|
|
7475
|
+
enabled: false,
|
|
7476
|
+
sticky: true,
|
|
7477
|
+
}, modules: [freeMode, Navigation], navigation: {
|
|
7478
|
+
enabled: hasNavigation,
|
|
7479
|
+
nextEl: nextEl.current,
|
|
7480
|
+
prevEl: prevEl.current,
|
|
7481
|
+
}, onBeforeInit: swiper => (swiperRef.current = swiper), onSliderMove: () => setIsDragging(true), onSlidesUpdated: () => {
|
|
7482
|
+
if (!isReady)
|
|
7483
|
+
setIsReady(true);
|
|
7484
|
+
}, onTouchEnd: () => setIsDragging(false), slidesPerGroupAuto: slidesPerView === 'auto', slidesPerView: slidesPerView, spaceBetween: spaceBetween, children: slides.map((slide, index) => (jsx(SwiperSlide, { className: clsx(styles$O.slide, slideClasses), children: slide }, index))) }), hasNavigation && (jsxs("div", { className: clsx(styles$O['navigation-buttons'], styles$O[navigationButtonsPosition]), children: [jsx(CarouselNavigationButton, { ref: prevEl, className: clsx(styles$O['navigation-button'], styles$O['navigation-button-prev']), direction: "previous", onClick: direction => handleNavigationButtonClick(direction) }), jsx(CarouselNavigationButton, { ref: nextEl, className: clsx(styles$O['navigation-button'], styles$O['navigation-button-next']), direction: "next", onClick: direction => handleNavigationButtonClick(direction) })] }))] }));
|
|
7485
|
+
}
|
|
7486
|
+
|
|
7487
|
+
var styles$N = {"slide":"category-carousel-module-muLq-"};
|
|
7584
7488
|
|
|
7585
7489
|
function CategoryCarousel({ categoryCards }) {
|
|
7586
|
-
return jsx(Carousel, { slideClasses: styles$
|
|
7490
|
+
return jsx(Carousel, { slideClasses: styles$N.slide, slides: categoryCards });
|
|
7587
7491
|
}
|
|
7588
7492
|
|
|
7589
|
-
var styles$
|
|
7493
|
+
var styles$M = {"accordion":"accordion-module-9WvAH","indented":"accordion-module-6CcEH","white":"accordion-module-CaVdG","accordion-item":"accordion-module-lf9d-","lg":"accordion-module-0qnae","with-seperators":"accordion-module-yOLrW","button":"accordion-module--Rwpb","icon":"accordion-module-Y50uq","focus":"accordion-module-M4BZs","panel":"accordion-module-KZjMo","content":"accordion-module-ejMH3","border-type-bottom":"accordion-module-oTdZK","border-type-top":"accordion-module-0mrLq","border-type-middle":"accordion-module-aAr-R","is-open":"accordion-module-W0F1z","border-type-middle-accentuated":"accordion-module-OB98a"};
|
|
7590
7494
|
|
|
7591
7495
|
function Accordion({ borderType = 'bottom', children, color = 'black', hasLineSeparator = true, indented, size = 'md', }) {
|
|
7592
|
-
return (jsx("div", { className: clsx({ [styles$
|
|
7496
|
+
return (jsx("div", { className: clsx({ [styles$M.indented]: indented }, styles$M.accordion, styles$M[color], styles$M[size], hasLineSeparator && styles$M['with-seperators']), children: Boolean(children) &&
|
|
7593
7497
|
Children.map(children, child => {
|
|
7594
7498
|
if (!child)
|
|
7595
7499
|
return null;
|
|
@@ -7604,10 +7508,13 @@ function GlyphsChevronsSlimDownIcon(props) {
|
|
|
7604
7508
|
function useResizeObserver(resizeCallback) {
|
|
7605
7509
|
let size;
|
|
7606
7510
|
function onResize(entries, _observer) {
|
|
7607
|
-
|
|
7608
|
-
|
|
7511
|
+
const entry = entries[0];
|
|
7512
|
+
const position = entry?.target.getClientRects()[0];
|
|
7513
|
+
size = entry?.contentRect;
|
|
7514
|
+
const target = entry?.target;
|
|
7515
|
+
if (!size || !target)
|
|
7609
7516
|
return;
|
|
7610
|
-
resizeCallback(size);
|
|
7517
|
+
resizeCallback(target, size, position);
|
|
7611
7518
|
}
|
|
7612
7519
|
const resizeObserver = useRef(new ResizeObserver(onResize));
|
|
7613
7520
|
const ref = useRef(null);
|
|
@@ -7623,7 +7530,7 @@ function useResizeObserver(resizeCallback) {
|
|
|
7623
7530
|
};
|
|
7624
7531
|
}
|
|
7625
7532
|
|
|
7626
|
-
var styles$
|
|
7533
|
+
var styles$L = {"show-all":"show-all-module-BDp21","panel":"show-all-module-bEdda","content":"show-all-module-RF--F","has-transparency":"show-all-module-30y7l","button":"show-all-module-58e7Q","icon":"show-all-module-fqncI","is-open":"show-all-module-hQeGI","content-fits":"show-all-module-OhPfm"};
|
|
7627
7534
|
|
|
7628
7535
|
function ShowAll({ children, hasTransparency = true, initialHeight = 0, initialIsOpen = false, isOpen: isControlledOpen, onToggle, }) {
|
|
7629
7536
|
const isControlled = isControlledOpen !== undefined && onToggle !== undefined;
|
|
@@ -7631,22 +7538,22 @@ function ShowAll({ children, hasTransparency = true, initialHeight = 0, initialI
|
|
|
7631
7538
|
const showAllRef = useRef(null);
|
|
7632
7539
|
const isReallyOpen = isControlled ? isControlledOpen : isOpen;
|
|
7633
7540
|
const [contentFits, setContentFits] = useState(false);
|
|
7634
|
-
const { ref } = useResizeObserver(size => {
|
|
7541
|
+
const { ref } = useResizeObserver((_target, size) => {
|
|
7635
7542
|
setContentFits((size.height || 0) <= initialHeight);
|
|
7636
7543
|
});
|
|
7637
|
-
return (jsxs("div", { ref: showAllRef, className: clsx(styles$
|
|
7638
|
-
[styles$
|
|
7639
|
-
[styles$
|
|
7640
|
-
}), style: contentFits ? undefined : { '--initital-height': `${initialHeight}px` }, children: [jsx("div", { className: styles$
|
|
7641
|
-
[styles$
|
|
7642
|
-
}), children: jsx("div", { ref: ref, children: children }) }) }), !contentFits && (jsxs(RouteLink, { className: styles$
|
|
7544
|
+
return (jsxs("div", { ref: showAllRef, className: clsx(styles$L['show-all'], {
|
|
7545
|
+
[styles$L['content-fits']]: contentFits,
|
|
7546
|
+
[styles$L['is-open']]: isReallyOpen,
|
|
7547
|
+
}), style: contentFits ? undefined : { '--initital-height': `${initialHeight}px` }, children: [jsx("div", { className: styles$L.panel, children: jsx("div", { className: clsx(styles$L.content, {
|
|
7548
|
+
[styles$L['has-transparency']]: !contentFits && hasTransparency,
|
|
7549
|
+
}), children: jsx("div", { ref: ref, children: children }) }) }), !contentFits && (jsxs(RouteLink, { className: styles$L.button, color: "secondary", onClick: () => {
|
|
7643
7550
|
if (isControlled)
|
|
7644
7551
|
return onToggle(!isControlled);
|
|
7645
7552
|
toggle();
|
|
7646
|
-
}, children: [jsx(GlyphsChevronsSlimDownIcon, { className: styles$
|
|
7553
|
+
}, children: [jsx(GlyphsChevronsSlimDownIcon, { className: styles$L.icon }), isReallyOpen ? (jsx(FormattedMessage, { id: "Show less" })) : (jsx(FormattedMessage, { id: "Show all" }))] }))] }));
|
|
7647
7554
|
}
|
|
7648
7555
|
|
|
7649
|
-
var styles$
|
|
7556
|
+
var styles$K = {"multi-select":"multi-select-module-DC7Ix","filter-item":"multi-select-module-OW-NK"};
|
|
7650
7557
|
|
|
7651
7558
|
function MultiSelect({ amountShown = 3, onChange, options, render, }) {
|
|
7652
7559
|
const shownOptions = options.slice(0, amountShown);
|
|
@@ -7657,28 +7564,28 @@ function MultiSelect({ amountShown = 3, onChange, options, render, }) {
|
|
|
7657
7564
|
options.filter(option => option.isSelected).length === 0) {
|
|
7658
7565
|
return null;
|
|
7659
7566
|
}
|
|
7660
|
-
return (jsxs("div", { className: styles$
|
|
7567
|
+
return (jsxs("div", { className: styles$K['multi-select'], children: [jsx("div", { className: styles$K['filter-items'], children: shownOptions
|
|
7661
7568
|
.concat(isOpen ? [] : hiddenSelectedOptions)
|
|
7662
|
-
.map(option => (jsxs("div", { className: styles$
|
|
7569
|
+
.map(option => (jsxs("div", { className: styles$K['filter-item'], children: [render({ onChange: () => onChange(option), option }), jsxs("span", { children: ["(", option.amount, ")"] })] }, option.value))) }), hiddenOptions.length > 0 && (jsx(ShowAll, { hasTransparency: false, isOpen: isOpen, onToggle: toggle, children: jsx("div", { className: clsx(styles$K['filter-items'], styles$K['hidden']), children: hiddenOptions.map(option => (jsxs("div", { className: styles$K['filter-item'], children: [render({ onChange: () => onChange(option), option }), jsxs("span", { children: ["(", option.amount, ")"] })] }, option.value))) }) }))] }));
|
|
7663
7570
|
}
|
|
7664
7571
|
|
|
7665
|
-
var styles$
|
|
7572
|
+
var styles$J = {"checkbox":"checkbox-module-YNVdd","box":"checkbox-module-UKoyf","checkmark":"checkbox-module-pHIwh","focus":"checkbox-module-v23jy","active":"checkbox-module-7UG-b","color-checkbox":"checkbox-module-nEhvW"};
|
|
7666
7573
|
|
|
7667
7574
|
function Checkbox({ _pseudo = 'none', children, className, isDisabled, isSelected, onChange, value, }) {
|
|
7668
|
-
return (jsxs(Checkbox$1, { className: clsx(className, styles$
|
|
7575
|
+
return (jsxs(Checkbox$1, { className: clsx(className, styles$J.checkbox, styles$J[_pseudo]), isDisabled: isDisabled, isSelected: isSelected, onChange: onChange, value: value, children: [jsx("div", { className: styles$J.box, children: jsx("svg", { "aria-hidden": "true", className: styles$J.checkmark, viewBox: "0 0 18 18", children: jsx("polyline", { points: "1 9 7 14 15 4" }) }) }), children] }));
|
|
7669
7576
|
}
|
|
7670
7577
|
|
|
7671
7578
|
function ColorCheckbox({ _pseudo = 'none', children, className, color, isDisabled, isSelected, onChange, value, }) {
|
|
7672
|
-
return (jsxs(Checkbox$1, { className: clsx(className, styles$
|
|
7579
|
+
return (jsxs(Checkbox$1, { className: clsx(className, styles$J.checkbox, styles$J['color-checkbox'], styles$J[_pseudo]), isDisabled: isDisabled, isSelected: isSelected, onChange: onChange, style: {
|
|
7673
7580
|
'--selected-color': color,
|
|
7674
|
-
}, value: value, children: [jsx("div", { className: styles$
|
|
7581
|
+
}, value: value, children: [jsx("div", { className: styles$J.box }), children] }));
|
|
7675
7582
|
}
|
|
7676
7583
|
|
|
7677
7584
|
function StrokeCheckmarkIcon(props) {
|
|
7678
7585
|
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", ...props, fill: "currentColor", height: "24", viewBox: "0 0 24 24", width: "24", children: jsx("path", { d: "M10.8641425,17 C10.6636971,17 10.4855234,16.9548533 10.3296214,16.8645598 C10.1737194,16.7742664 10.0252413,16.6388262 9.88418708,16.4582393 L6.27839644,12.2189616 C6.09279881,11.9857035 6,11.744921 6,11.496614 C6,11.2332581 6.08723088,11.0094056 6.26169265,10.8250564 C6.43615442,10.6407073 6.65330364,10.5485327 6.91314031,10.5485327 C7.06904232,10.5485327 7.21195249,10.5823928 7.34187082,10.6501129 C7.47178916,10.717833 7.59985152,10.8382242 7.72605791,11.0112867 L10.8195991,14.7200903 L16.2405345,6.53047404 C16.4558278,6.17682468 16.7230883,6 17.0423163,6 C17.2873051,6 17.5081663,6.08088789 17.7048998,6.24266366 C17.9016333,6.40443943 18,6.61700527 18,6.88036117 C18,7.00075245 17.9721604,7.12302483 17.9164811,7.24717833 C17.8608018,7.37133183 17.7958426,7.48984199 17.7216036,7.6027088 L11.7884187,16.4469526 C11.5582777,16.8156509 11.2501856,17 10.8641425,17 Z", fillRule: "evenodd" }) }));
|
|
7679
7586
|
}
|
|
7680
7587
|
|
|
7681
|
-
var styles$
|
|
7588
|
+
var styles$I = {"select":"select-module-ui-Wc","sm":"select-module-44a1l","md":"select-module-QUm-8","solid":"select-module-IRd4F","button":"select-module-aMQIQ","chevron":"select-module-00uRU","focus":"select-module-XMc0P","popover":"select-module-z8cWq","listbox":"select-module-S21ba","header":"select-module-4Bm2j","item":"select-module-LgEJO","check":"select-module-lQFw3"};
|
|
7682
7589
|
|
|
7683
7590
|
function Select({ isDisabled = false, label, onChange, options, placeholder, selectedOption, showLabel = true, size = 'md', variant = 'outline', }) {
|
|
7684
7591
|
const selectRef = useRef(null);
|
|
@@ -7695,12 +7602,12 @@ function Select({ isDisabled = false, label, onChange, options, placeholder, sel
|
|
|
7695
7602
|
window.addEventListener('resize', updateWidth);
|
|
7696
7603
|
return () => window.removeEventListener('resize', updateWidth);
|
|
7697
7604
|
}, []);
|
|
7698
|
-
return (jsxs(Select$1, { ref: selectRef, "aria-label": label, className: clsx(styles$
|
|
7605
|
+
return (jsxs(Select$1, { ref: selectRef, "aria-label": label, className: clsx(styles$I.select, styles$I[size], styles$I[variant]), isDisabled: isDisabled, onSelectionChange: selected => onChange(selected), placeholder: placeholder || label, selectedKey: String(selectedOption), children: [showLabel && jsx(Label, { children: label }), jsxs(Button$1, { className: styles$I.button, children: [jsx(SelectValue, {}), jsx(GlyphsChevronsSlimDownIcon, { "aria-hidden": "true", className: styles$I.chevron })] }), jsx(Popover, { ref: ref =>
|
|
7699
7606
|
// Workaround for react/react-aria #1513
|
|
7700
|
-
ref?.addEventListener('touchend', e => e.preventDefault()), className: clsx(styles$
|
|
7607
|
+
ref?.addEventListener('touchend', e => e.preventDefault()), className: clsx(styles$I.popover, styles$I[variant]), placement: "bottom left", triggerRef: selectRef, children: jsx(ListBox, { className: styles$I.listbox, children: jsxs(Section, { children: [jsx(Header, { className: styles$I.header, children: placeholder || label }), Object.entries(options).map(([key, value]) => (jsxs(ListBoxItem, { "aria-label": value, className: styles$I.item, id: key, textValue: value, children: [selectedOption === key && (jsx("span", { slot: "description", children: jsx(StrokeCheckmarkIcon, { className: styles$I.check }) })), jsx("span", { slot: "label", children: value })] }, key)))] }) }) })] }));
|
|
7701
7608
|
}
|
|
7702
7609
|
|
|
7703
|
-
var styles$
|
|
7610
|
+
var styles$H = {"input-container":"textarea-module-C6Xr1","lg":"textarea-module-vksG-","md":"textarea-module-6JrQJ"};
|
|
7704
7611
|
|
|
7705
7612
|
/**
|
|
7706
7613
|
* This component is used to create a textarea that can grow as the user types.
|
|
@@ -7735,7 +7642,7 @@ const TextArea = forwardRef(({ autoGrow, size, ...textAreaProps }, _ref) => {
|
|
|
7735
7642
|
}
|
|
7736
7643
|
updateHeight();
|
|
7737
7644
|
}, [ref, autoGrow, updateHeight, size]);
|
|
7738
|
-
return (jsx("div", { className: styles$
|
|
7645
|
+
return (jsx("div", { className: styles$H['input-container'], children: jsx(TextArea$1, { ...textAreaProps, ref: node => {
|
|
7739
7646
|
ref.current =
|
|
7740
7647
|
node;
|
|
7741
7648
|
textAreaRef.current = node;
|
|
@@ -7746,7 +7653,7 @@ const TextArea = forwardRef(({ autoGrow, size, ...textAreaProps }, _ref) => {
|
|
|
7746
7653
|
});
|
|
7747
7654
|
TextArea.displayName = 'TextArea';
|
|
7748
7655
|
|
|
7749
|
-
var styles$
|
|
7656
|
+
var styles$G = {"field":"text-field-module-JeaK0"};
|
|
7750
7657
|
|
|
7751
7658
|
/**
|
|
7752
7659
|
* This component is used to create a text field.
|
|
@@ -7754,7 +7661,7 @@ var styles$B = {"field":"text-field-module-JeaK0"};
|
|
|
7754
7661
|
* This field can also grow when a user types in text.
|
|
7755
7662
|
*/
|
|
7756
7663
|
function TextField({ autoFocus, autoGrow, defaultValue, isDisabled, isInvalid, isMultiline, isReadOnly, isRequired, label, maxLength, name, onChange, onInput, onKeyUp, placeholder, rows, showLabel = false, size = 'lg', value, }) {
|
|
7757
|
-
return (jsxs(TextField$1, { "aria-label": label, autoFocus: autoFocus, className: clsx(styles$
|
|
7664
|
+
return (jsxs(TextField$1, { "aria-label": label, autoFocus: autoFocus, className: clsx(styles$G.field, styles$G[size]), defaultValue: defaultValue, isDisabled: isDisabled, isInvalid: isInvalid, isReadOnly: isReadOnly, isRequired: isRequired, maxLength: maxLength, name: name, onChange: value => {
|
|
7758
7665
|
onChange?.(value);
|
|
7759
7666
|
}, onInput: onInput, onKeyUp: e => onKeyUp?.(e), value: value, children: [showLabel && jsx(Label, { isRequired: isRequired, children: label }), isMultiline ? (jsx(TextArea, { autoGrow: autoGrow, placeholder: placeholder, rows: rows, size: size })) : (jsx(Input, { autoGrow: autoGrow, placeholder: placeholder, size: size })), jsx(FieldError, {})] }));
|
|
7760
7667
|
}
|
|
@@ -7764,31 +7671,31 @@ function IntlProvider({ children, formatMessage, languageCode: _languageCode, })
|
|
|
7764
7671
|
return (jsx(IntlContext.Provider, { value: { formatMessage, languageCode, updateLanguageCode }, children: children }));
|
|
7765
7672
|
}
|
|
7766
7673
|
|
|
7767
|
-
var styles$
|
|
7674
|
+
var styles$F = {"progress-circle":"progress-circle-module-4nweP","spin":"progress-circle-module-kCf7K"};
|
|
7768
7675
|
|
|
7769
7676
|
function ProgressCircle({ className }) {
|
|
7770
|
-
return (jsxs("svg", { className: clsx(styles$
|
|
7677
|
+
return (jsxs("svg", { className: clsx(styles$F['progress-circle'], className), viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", children: [jsx("title", { children: "Spinner" }), jsxs("defs", { children: [jsx("pattern", { height: "100%", id: "pattern-1", patternUnits: "objectBoundingBox", width: "100%", children: jsx("use", { xlinkHref: "#image-2" }) }), jsx("image", { height: "24", id: "image-2", width: "24", xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAB7UlEQVRIDZ2VSaoCQQyG01rOoBtBr+YZXXsFL+BGEHcqDuCE89SPL480hdpiGYil3an/S1KDUavViq/Xq1wul8RPp5Ocz2dhPB6PiR8OB42RAHO5XE7D4zgW/PF4CM/u97tks1n1TCYjURSpB2hraALglw8BQGXOuQQSKk68y+fzL9lRBQAqAUIlVkUoxBUKBZ3sC1irbrdbUoX/PgTyAqDXmFVBBVRCFfYuGMBk67UvRCUA2FFAfgKUSiWhFTgQA9ESjLVgC7NWwEPNFYtFFUEICJnigAxCFbvd7jcAFVi/gbDoCALmOzCMAzebzUILEFculxVgOwcIDqRSqaiTBDadToMhziYDwBgNRmW0rdFoSLPZ1PeDwUDHbz+iTqejyv5VYHuekbVggavVqkLq9fq32hqnLTJxdgmijPQeYSqs1Woa3G63g8QJ1haZKMJkjDgLjLi/Nbvd7m8ARCxry9x2jyn2ej2ZTCb28+tRK/Azpy3vrN/vy2azeffq4zM9aLTFP1jPM4bDoWbPH06o6WXn9/lZgDMxGo1kuVwG/5uhlfkkTsB4PJb5fC7b7VYPH89C7P9GS5nBLYr4er2W/X6vhy4lNPXxR8BisdDWkD13Ee0KtVQAgqvVSncO2XNlc3WEWirAxLmmgf0K+ANZ6DTlvO5jwwAAAABJRU5ErkJggg==" })] }), jsx("g", { fill: "none", fillRule: "evenodd", id: "Page-1", stroke: "none", strokeWidth: "1", children: jsx("path", { d: "M12,0 C18.627417,0 24,5.372583 24,12 C24,14.7277828 23.0855773,17.3196292 21.4324752,19.4188392 C19.1717866,22.2895997 15.7255176,24 12,24 C11.2636203,24 10.6666667,23.4030463 10.6666667,22.6666667 C10.6666667,21.930287 11.2636203,21.3333333 12,21.3333333 C14.8994206,21.3333333 17.5771113,20.0043823 19.3374325,17.7690188 C20.6234737,16.1359252 21.3333333,14.1238938 21.3333333,12 C21.3333333,6.84534234 17.1546577,2.66666667 12,2.66666667 C6.84534234,2.66666667 2.66666667,6.84534234 2.66666667,12 C2.66666667,14.4546154 3.61656005,16.756214 5.28844833,18.485859 C5.80023235,19.015323 5.78589988,19.8594213 5.25643588,20.3712053 C4.72697187,20.8829893 3.88287357,20.8686569 3.37108955,20.3391928 C1.22326178,18.1171666 0,15.1531945 0,12 C0,5.372583 5.372583,0 12,0 Z", fill: "url(#pattern-1)", fillRule: "nonzero", id: "Spinner" }) })] }));
|
|
7771
7678
|
}
|
|
7772
7679
|
|
|
7773
|
-
var styles$
|
|
7680
|
+
var styles$E = {"product-grid":"product-overview-grid-module-bzys-","loading-panel":"product-overview-grid-module-XikkF","fade-in":"product-overview-grid-module-A6CS7","progress-circle":"product-overview-grid-module-DWnnI","fade-in-spinner":"product-overview-grid-module-r-wvY","grid-item":"product-overview-grid-module-MlUVA"};
|
|
7774
7681
|
|
|
7775
7682
|
function ProductOverviewGrid({ children, isLoading, }) {
|
|
7776
|
-
return (jsxs("div", { className: styles$
|
|
7683
|
+
return (jsxs("div", { className: styles$E['product-grid'], children: [Children.map(children, (child, index) => (jsx("div", { className: styles$E['grid-item'], children: child }, index))), isLoading && (jsx("div", { className: styles$E['loading-panel'], children: jsx(ProgressCircle, { className: styles$E['progress-circle'] }) }))] }));
|
|
7777
7684
|
}
|
|
7778
7685
|
|
|
7779
|
-
var styles$
|
|
7686
|
+
var styles$D = {"loading-overlay":"loading-overlay-module-L67Gy"};
|
|
7780
7687
|
|
|
7781
7688
|
function LoadingOverlay() {
|
|
7782
|
-
return (jsx("div", { className: styles$
|
|
7689
|
+
return (jsx("div", { className: styles$D['loading-overlay'], children: jsx(ProgressCircle, {}) }));
|
|
7783
7690
|
}
|
|
7784
7691
|
|
|
7785
|
-
var styles$
|
|
7692
|
+
var styles$C = {"page-container":"page-container-module-PYmbC","inner-page-container":"page-container-module-uD8GF"};
|
|
7786
7693
|
|
|
7787
7694
|
function PageContainer({ children, className, }) {
|
|
7788
|
-
return (jsx("div", { className: styles$
|
|
7695
|
+
return (jsx("div", { className: styles$C['page-container'], children: jsx("div", { className: clsx(styles$C['inner-page-container'], className), children: children }) }));
|
|
7789
7696
|
}
|
|
7790
7697
|
|
|
7791
|
-
var styles$
|
|
7698
|
+
var styles$B = {"heading":"heading-module-pMC65","uppercase":"heading-module-6spgX","italic":"heading-module-XXMDM","bold":"heading-module-xvrxo","xxl":"heading-module-Kn3ZN","xl":"heading-module--hZs-","l":"heading-module-WrJRY","m":"heading-module-hTexc","s":"heading-module-7W29m","xs":"heading-module-SgaLB","xxs":"heading-module-33en7"};
|
|
7792
7699
|
|
|
7793
7700
|
const sizeToTag = {
|
|
7794
7701
|
l: 'h3',
|
|
@@ -7801,47 +7708,64 @@ const sizeToTag = {
|
|
|
7801
7708
|
};
|
|
7802
7709
|
function Heading({ bold = true, children, className, italic, size = 'xxl', tag, uppercase, }) {
|
|
7803
7710
|
return createElement$1(tag || sizeToTag[size], {
|
|
7804
|
-
className: clsx(className, styles$
|
|
7805
|
-
[styles$
|
|
7806
|
-
[styles$
|
|
7807
|
-
[styles$
|
|
7711
|
+
className: clsx(className, styles$B.heading, styles$B[size], {
|
|
7712
|
+
[styles$B.uppercase]: uppercase,
|
|
7713
|
+
[styles$B.italic]: italic,
|
|
7714
|
+
[styles$B.bold]: bold,
|
|
7808
7715
|
}),
|
|
7809
7716
|
}, children);
|
|
7810
7717
|
}
|
|
7811
7718
|
|
|
7812
|
-
var styles$
|
|
7719
|
+
var styles$A = {"page":"page-module-XtZ9Y","breadcrumb":"page-module-ohh9z","title":"page-module-TEmve"};
|
|
7813
7720
|
|
|
7814
7721
|
function PageTitle({ children }) {
|
|
7815
7722
|
const { lg, xxl } = useBreakpoint();
|
|
7816
|
-
return (jsx(Heading, { italic: true, uppercase: true, className: styles$
|
|
7723
|
+
return (jsx(Heading, { italic: true, uppercase: true, className: styles$A.title, size: xxl ? 'xl' : lg ? 'm' : 's', tag: "h1", children: children }));
|
|
7817
7724
|
}
|
|
7818
7725
|
function Page({ breadCrumb, children, className, title }) {
|
|
7819
|
-
return (jsxs(PageContainer, { className: clsx(styles$
|
|
7726
|
+
return (jsxs(PageContainer, { className: clsx(styles$A.page, className), children: [jsx("div", { className: styles$A.breadcrumb, children: jsx(Breadcrumb, { links: breadCrumb }) }), title && jsx(PageTitle, { children: title }), children] }));
|
|
7727
|
+
}
|
|
7728
|
+
|
|
7729
|
+
function SolidOkayIcon(props) {
|
|
7730
|
+
return (jsx("svg", { fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ...props, height: "24", viewBox: "0 0 24 24", width: "24", children: jsx("path", { d: "M12.0051467,22 C13.3707325,22 14.6574026,21.7375193 15.865157,21.2125579 C17.0729113,20.6875965 18.1365586,19.9653457 19.0560988,19.0458055 C19.975639,18.1262652 20.6961743,17.0643335 21.2177046,15.8600103 C21.7392349,14.6556871 22,13.3673014 22,11.9948533 C22,10.6292675 21.7375193,9.34259736 21.2125579,8.13484303 C20.6875965,6.92708869 19.9653457,5.86172585 19.0458055,4.9387545 C18.1262652,4.01578315 17.0626179,3.2952479 15.8548636,2.77714874 C14.6471093,2.25904958 13.3604392,2 11.9948533,2 C10.6292675,2 9.34431292,2.25904958 8.13998971,2.77714874 C6.9356665,3.2952479 5.87201921,4.01578315 4.94904786,4.9387545 C4.02607651,5.86172585 3.3038257,6.92708869 2.78229542,8.13484303 C2.26076514,9.34259736 2,10.6292675 2,11.9948533 C2,13.3673014 2.2624807,14.6556871 2.7874421,15.8600103 C3.3124035,17.0643335 4.03465431,18.1262652 4.95419454,19.0458055 C5.87373477,19.9653457 6.9356665,20.6875965 8.13998971,21.2125579 C9.34431292,21.7375193 10.6326986,22 12.0051467,22 Z M10.9243438,16.7812661 C10.7390633,16.7812661 10.5743695,16.7400926 10.4302625,16.6577458 C10.2861554,16.5753989 10.1489106,16.4518785 10.018528,16.2871848 L7.60988163,13.3329902 C7.43832561,13.1202608 7.35254761,12.9006691 7.35254761,12.6742151 C7.35254761,12.4340367 7.43317893,12.2298851 7.59444159,12.0617602 C7.75570424,11.8936353 7.95642477,11.8095728 8.19660319,11.8095728 C8.34071024,11.8095728 8.47280837,11.8404529 8.59289758,11.9022131 C8.71298679,11.9639732 8.83136044,12.0737691 8.94801853,12.2316006 L10.8831704,14.7020072 L14.9696346,8.14513639 C15.1686396,7.82261108 15.4156802,7.66134843 15.7107566,7.66134843 C15.9372105,7.66134843 16.1413622,7.73511752 16.3232115,7.88265569 C16.5050609,8.03019386 16.5959856,8.22405215 16.5959856,8.46423057 C16.5959856,8.57402642 16.5702522,8.68553783 16.5187854,8.7987648 C16.4673186,8.91199177 16.407274,9.02007205 16.3386516,9.12300566 L11.7786927,16.2768914 C11.5659633,16.6131412 11.2811803,16.7812661 10.9243438,16.7812661 Z" }) }));
|
|
7731
|
+
}
|
|
7732
|
+
|
|
7733
|
+
var styles$z = {"list":"list-module-7-DFP","list-item":"list-module-YMLVY","icon":"list-module-wTIOA"};
|
|
7734
|
+
|
|
7735
|
+
function List({ children }) {
|
|
7736
|
+
return jsx("ul", { className: styles$z.list, children: children });
|
|
7737
|
+
}
|
|
7738
|
+
function ListItem({ icon, text }) {
|
|
7739
|
+
return (jsxs("li", { className: styles$z['list-item'], children: [icon && jsx("span", { className: styles$z.icon, children: icon }), text] }));
|
|
7820
7740
|
}
|
|
7821
7741
|
|
|
7822
7742
|
function StrokeCloseboxIcon(props) {
|
|
7823
7743
|
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", ...props, height: "24", viewBox: "0 0 24 24", width: "24", children: jsx("path", { d: "M8,8 L16,16 M16,8 L8,16", fill: "currentColor", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.4" }) }));
|
|
7824
7744
|
}
|
|
7825
7745
|
|
|
7826
|
-
var styles$
|
|
7746
|
+
var styles$y = {"modal-overlay":"modal-module-rVFJc","modal-fade":"modal-module-63Uyl","is-full-screen":"modal-module-uwets","modal":"modal-module-6vlFt","modal-zoom":"modal-module-aPJ7X","dialog":"modal-module-7c3-9","close":"modal-module-7zIZE"};
|
|
7827
7747
|
|
|
7828
|
-
function Modal({ children, className, isDismissable, isKeyboardDismissDisabled, isOpen, onOpenChange, }) {
|
|
7829
|
-
return (jsx(ModalOverlay, { className: clsx(styles$
|
|
7748
|
+
function Modal({ children, className, hasCloseButton, isDismissable, isFullScreen, isKeyboardDismissDisabled, isOpen, onOpenChange, }) {
|
|
7749
|
+
return (jsx(ModalOverlay, { className: clsx(styles$y['modal-overlay'], className), isDismissable: isDismissable, isKeyboardDismissDisabled: isKeyboardDismissDisabled, isOpen: isOpen, onOpenChange: onOpenChange, children: jsx(Modal$1, { className: clsx(styles$y.modal, {
|
|
7750
|
+
[styles$y['is-full-screen']]: isFullScreen,
|
|
7751
|
+
}), children: jsxs(Dialog$1, { className: styles$y.dialog, children: [hasCloseButton && (jsx("div", { className: styles$y.close, children: jsx(IconButton, { color: "secondary", onClick: () => onOpenChange(false), children: jsx(StrokeCloseboxIcon, {}) }) })), children] }) }) }));
|
|
7830
7752
|
}
|
|
7831
7753
|
|
|
7832
|
-
var styles$
|
|
7754
|
+
var styles$x = {"dialog":"dialog-module-qKzgy","header":"dialog-module-ZnsAe","close":"dialog-module-Y7Tqg","footer":"dialog-module-y7Axm"};
|
|
7833
7755
|
|
|
7834
7756
|
function Footer({ close }) {
|
|
7835
|
-
return (jsx(Button, {
|
|
7757
|
+
return (jsx(Button, { onClick: close, size: "md", children: "Close" }));
|
|
7836
7758
|
}
|
|
7837
|
-
function Dialog({ allowClose = true, children, className, footer = Footer, hideTitle, isDismissable, isKeyboardDismissDisabled, isOpen, onOpenChange, onSubmit, title, validationErrors, }) {
|
|
7838
|
-
return (jsx(Modal, { className: clsx(styles$
|
|
7759
|
+
function Dialog({ allowClose = true, children, className, dialogClassName, footer = Footer, hideTitle, isDismissable, isKeyboardDismissDisabled, isOpen, onOpenChange, onSubmit, title, validationErrors, }) {
|
|
7760
|
+
return (jsx(Modal, { className: clsx(styles$x['modal-overlay'], className), isDismissable: isDismissable, isKeyboardDismissDisabled: isKeyboardDismissDisabled, isOpen: isOpen, onOpenChange: onOpenChange, children: jsx(Dialog$1, { "aria-label": title, className: clsx(styles$x.dialog, dialogClassName), children: ({ close }) => (jsxs(Form, { onSubmit: onSubmit || (e => e.preventDefault), validationErrors: validationErrors, children: [jsxs("header", { className: styles$x.header, children: [!hideTitle && (jsx(Heading, { className: styles$x.heading, size: "xs", children: title })), jsx("div", { className: styles$x.close, children: jsx(IconButton, { color: "secondary", isDisabled: !allowClose, onClick: close, children: jsx(StrokeCloseboxIcon, {}) }) })] }), jsx("div", { className: styles$x.content, children: children instanceof Function ? children({ close }) : children }), jsx("footer", { className: styles$x.footer, children: footer instanceof Function ? footer({ close }) : footer })] })) }) }));
|
|
7839
7761
|
}
|
|
7840
7762
|
|
|
7763
|
+
var styles$w = {"sign-in-dialog":"sign-in-dialog-module-P-AHV"};
|
|
7764
|
+
|
|
7841
7765
|
function SignInDialog({ isOpen, onOpenChange }) {
|
|
7842
|
-
const t = useFormattedMessage();
|
|
7843
7766
|
const { signInUrl } = useFavorite();
|
|
7844
|
-
|
|
7767
|
+
const t = useFormattedMessage();
|
|
7768
|
+
return (jsx(Dialog, { isDismissable: true, dialogClassName: styles$w['sign-in-dialog'], footer: jsxs(Fragment, { children: [jsx(RouteButton, { color: "primary", href: `${signInUrl}?returnUrl=${encodeURIComponent(window.location.pathname + window.location.search)}`, onClick: () => onOpenChange(false), variant: "solid", children: jsx(FormattedMessage, { id: "sign in" }) }), jsx(RouteButton, { color: "secondary", href: `${signInUrl}?returnUrl=${encodeURIComponent(window.location.pathname + window.location.search)}`, onClick: () => onOpenChange(false), variant: "outline", children: jsx(FormattedMessage, { id: "create account" }) })] }), isOpen: isOpen, onOpenChange: onOpenChange, title: t('Shop more efficiently and quicker with a favorites list'), children: jsxs(List, { children: [jsx(ListItem, { icon: jsx(SolidOkayIcon, { fill: "var(--color-status-available)" }), text: t('Easily add your favorite products') }), jsx(ListItem, { icon: jsx(SolidOkayIcon, { fill: "var(--color-status-available)" }), text: t('Your favorites are available on multiple devices') }), jsx(ListItem, { icon: jsx(SolidOkayIcon, { fill: "var(--color-status-available)" }), text: t('Share your favorite list with others') })] }) }));
|
|
7845
7769
|
}
|
|
7846
7770
|
|
|
7847
7771
|
function ConnectedFavoriteButton({ onFavorited: _onFavorited, onFavoriting: _onFavoriting, productId, }) {
|
|
@@ -7895,11 +7819,11 @@ function ConnectedFavoriteButton({ onFavorited: _onFavorited, onFavoriting: _onF
|
|
|
7895
7819
|
return (jsxs(Fragment, { children: [jsx(FavoriteButton, { isDisabled: isFetching, isFavorite: isFavorite, onPress: onFavorite }), jsx(SignInDialog, { isOpen: showSignInDialog, onOpenChange: setShowSignInDialog })] }));
|
|
7896
7820
|
}
|
|
7897
7821
|
|
|
7898
|
-
function ConnectedProductCard({ onAddToCart, onFavorited, onFavoriting,
|
|
7899
|
-
return (jsx(ProductCard, { ...props, addToCartButton: jsx(ConnectedAddToCartButton, { onAddToCart: onAddToCart, productId:
|
|
7822
|
+
function ConnectedProductCard({ id, onAddToCart, onFavorited, onFavoriting, ...props }) {
|
|
7823
|
+
return (jsx(ProductCard, { id: id, ...props, addToCartButton: jsx(ConnectedAddToCartButton, { onAddToCart: onAddToCart, productId: id }), favoriteButton: jsx(ConnectedFavoriteButton, { onFavorited: onFavorited, onFavoriting: onFavoriting, productId: id }) }));
|
|
7900
7824
|
}
|
|
7901
7825
|
|
|
7902
|
-
var styles$
|
|
7826
|
+
var styles$v = {"carousel-container":"product-carousel-module-DpUaX","button":"product-carousel-module-0ymqZ","slide":"product-carousel-module-XVTB1","width-auto":"product-carousel-module-E2EUK","width-narrow":"product-carousel-module-yrkV9","width-normal":"product-carousel-module-SzVga"};
|
|
7903
7827
|
|
|
7904
7828
|
function ProductCarousel({ allowExpandToGrid = false, cardWidth = 'auto', hasOverflow = false, productCards, productsPerView = {
|
|
7905
7829
|
md: 2,
|
|
@@ -7908,17 +7832,183 @@ function ProductCarousel({ allowExpandToGrid = false, cardWidth = 'auto', hasOve
|
|
|
7908
7832
|
}, }) {
|
|
7909
7833
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
7910
7834
|
if (!isExpanded) {
|
|
7911
|
-
return (jsxs("div", { className: styles$
|
|
7835
|
+
return (jsxs("div", { className: styles$v['carousel-container'], children: [jsx(Carousel, { hasOverflow: hasOverflow, navigationButtonsPosition: "center", slideClasses: clsx(styles$v.slide, styles$v[`width-${cardWidth}`]), slides: productCards, slidesPerView: productsPerView, spaceBetween: 16 }), allowExpandToGrid && (jsx(Button, { withArrow: true, className: styles$v.button, color: "secondary", onClick: () => setIsExpanded(true), variant: "outline", children: jsx(FormattedMessage, { id: "Show all" }) }))] }));
|
|
7912
7836
|
}
|
|
7913
|
-
return (jsxs("div", { className: styles$
|
|
7837
|
+
return (jsxs("div", { className: styles$v['carousel-container'], children: [jsxs(ProductOverviewGrid, { children: [...productCards] }), jsx(Button, { withArrow: true, className: styles$v.button, color: "secondary", onClick: () => setIsExpanded(false), variant: "outline", children: jsx(FormattedMessage, { id: "Show less" }) })] }));
|
|
7914
7838
|
}
|
|
7915
7839
|
|
|
7916
|
-
|
|
7840
|
+
class Animation {
|
|
7841
|
+
constructor(initialPage = -1) {
|
|
7842
|
+
Object.defineProperty(this, "_currentPage", {
|
|
7843
|
+
enumerable: true,
|
|
7844
|
+
configurable: true,
|
|
7845
|
+
writable: true,
|
|
7846
|
+
value: void 0
|
|
7847
|
+
});
|
|
7848
|
+
Object.defineProperty(this, "_buttonElement", {
|
|
7849
|
+
enumerable: true,
|
|
7850
|
+
configurable: true,
|
|
7851
|
+
writable: true,
|
|
7852
|
+
value: null
|
|
7853
|
+
});
|
|
7854
|
+
Object.defineProperty(this, "_circleElement", {
|
|
7855
|
+
enumerable: true,
|
|
7856
|
+
configurable: true,
|
|
7857
|
+
writable: true,
|
|
7858
|
+
value: null
|
|
7859
|
+
});
|
|
7860
|
+
Object.defineProperty(this, "_paginationButtonElements", {
|
|
7861
|
+
enumerable: true,
|
|
7862
|
+
configurable: true,
|
|
7863
|
+
writable: true,
|
|
7864
|
+
value: []
|
|
7865
|
+
});
|
|
7866
|
+
Object.defineProperty(this, "_transitionQueue", {
|
|
7867
|
+
enumerable: true,
|
|
7868
|
+
configurable: true,
|
|
7869
|
+
writable: true,
|
|
7870
|
+
value: []
|
|
7871
|
+
});
|
|
7872
|
+
Object.defineProperty(this, "_currentSize", {
|
|
7873
|
+
enumerable: true,
|
|
7874
|
+
configurable: true,
|
|
7875
|
+
writable: true,
|
|
7876
|
+
value: 1
|
|
7877
|
+
});
|
|
7878
|
+
Object.defineProperty(this, "_currentPosition", {
|
|
7879
|
+
enumerable: true,
|
|
7880
|
+
configurable: true,
|
|
7881
|
+
writable: true,
|
|
7882
|
+
value: 0
|
|
7883
|
+
});
|
|
7884
|
+
this._currentPage = initialPage;
|
|
7885
|
+
this.refButton = this.refButton.bind(this);
|
|
7886
|
+
this.refCircle = this.refCircle.bind(this);
|
|
7887
|
+
}
|
|
7888
|
+
refPaginationButton(index) {
|
|
7889
|
+
return (element) => {
|
|
7890
|
+
this._paginationButtonElements[index] = element;
|
|
7891
|
+
if (index === this._currentPage - 1)
|
|
7892
|
+
element?.classList.add('active');
|
|
7893
|
+
this.onNextTransition();
|
|
7894
|
+
};
|
|
7895
|
+
}
|
|
7896
|
+
refButton(element) {
|
|
7897
|
+
this._buttonElement?.removeEventListener('transitionend', this.onNextTransition.bind(this));
|
|
7898
|
+
this._buttonElement = element;
|
|
7899
|
+
this._buttonElement?.addEventListener('transitionend', e => {
|
|
7900
|
+
e.preventDefault();
|
|
7901
|
+
e.stopPropagation();
|
|
7902
|
+
this.onNextTransition();
|
|
7903
|
+
});
|
|
7904
|
+
this.onNextTransition();
|
|
7905
|
+
}
|
|
7906
|
+
refCircle(element) {
|
|
7907
|
+
this._circleElement?.removeEventListener('transitionend', this.onNextTransition.bind(this));
|
|
7908
|
+
this._circleElement = element;
|
|
7909
|
+
this._circleElement?.addEventListener('transitionend', e => {
|
|
7910
|
+
e.preventDefault();
|
|
7911
|
+
e.stopPropagation();
|
|
7912
|
+
if (e.propertyName !== 'height')
|
|
7913
|
+
return;
|
|
7914
|
+
this.onNextTransition();
|
|
7915
|
+
});
|
|
7916
|
+
this.onNextTransition();
|
|
7917
|
+
}
|
|
7918
|
+
getLeftPositionOfPaginationButtonElement(index) {
|
|
7919
|
+
const fromElement = this._paginationButtonElements[0];
|
|
7920
|
+
const toElement = this._paginationButtonElements[index];
|
|
7921
|
+
if (!toElement || !fromElement)
|
|
7922
|
+
return 0;
|
|
7923
|
+
const from = fromElement.getBoundingClientRect().left;
|
|
7924
|
+
const to = toElement.getBoundingClientRect().left;
|
|
7925
|
+
return to - from;
|
|
7926
|
+
}
|
|
7927
|
+
onNextTransition() {
|
|
7928
|
+
const buttonElement = this._buttonElement;
|
|
7929
|
+
const circleElement = this._circleElement;
|
|
7930
|
+
const paginationButtonElements = this._paginationButtonElements;
|
|
7931
|
+
if (!buttonElement || !circleElement || !paginationButtonElements.length)
|
|
7932
|
+
return this;
|
|
7933
|
+
const nextTransition = this._transitionQueue.shift();
|
|
7934
|
+
if (!nextTransition)
|
|
7935
|
+
return this;
|
|
7936
|
+
switch (nextTransition.type) {
|
|
7937
|
+
case 'slide':
|
|
7938
|
+
if (this._currentPosition === nextTransition.position) {
|
|
7939
|
+
return this.onNextTransition();
|
|
7940
|
+
}
|
|
7941
|
+
this._currentPosition = nextTransition.position;
|
|
7942
|
+
paginationButtonElements.forEach(element => {
|
|
7943
|
+
element?.classList.remove('active');
|
|
7944
|
+
});
|
|
7945
|
+
break;
|
|
7946
|
+
case 'grow':
|
|
7947
|
+
this._currentSize = nextTransition.size;
|
|
7948
|
+
paginationButtonElements[this._currentPage - 1]?.classList.add('active');
|
|
7949
|
+
break;
|
|
7950
|
+
case 'shrink':
|
|
7951
|
+
this._currentSize = nextTransition.size;
|
|
7952
|
+
break;
|
|
7953
|
+
}
|
|
7954
|
+
buttonElement.style.transform = `translateX(${this._currentPosition}px`;
|
|
7955
|
+
circleElement.style.setProperty('--size', `${this._currentSize}px`);
|
|
7956
|
+
return this;
|
|
7957
|
+
}
|
|
7958
|
+
animate(page) {
|
|
7959
|
+
const currentPage = this._currentPage;
|
|
7960
|
+
if (page === currentPage)
|
|
7961
|
+
return this;
|
|
7962
|
+
this._currentPage = page;
|
|
7963
|
+
const currentTransition = this._transitionQueue[0];
|
|
7964
|
+
this._transitionQueue.splice(1);
|
|
7965
|
+
if (!currentTransition || currentTransition.type === 'grow') {
|
|
7966
|
+
this._transitionQueue.push({ size: 1, type: 'shrink' });
|
|
7967
|
+
}
|
|
7968
|
+
this._transitionQueue.push({
|
|
7969
|
+
position: this.getLeftPositionOfPaginationButtonElement(page - 1),
|
|
7970
|
+
type: 'slide',
|
|
7971
|
+
});
|
|
7972
|
+
this._transitionQueue.push({ size: 16, type: 'grow' });
|
|
7973
|
+
return this.onNextTransition();
|
|
7974
|
+
}
|
|
7975
|
+
dispose() {
|
|
7976
|
+
this._buttonElement?.removeEventListener('transitionend', this.onNextTransition);
|
|
7977
|
+
this._circleElement?.removeEventListener('transitionend', this.onNextTransition);
|
|
7978
|
+
}
|
|
7979
|
+
}
|
|
7980
|
+
|
|
7981
|
+
var styles$u = {"pagination-panel":"pagination-module-pQ-Pu","content-container":"pagination-module-EnswA","contained":"pagination-module-4U0M3","page-button":"pagination-module-E-D6l","active-page-button":"pagination-module-rNIvD","circle":"pagination-module-4--ee"};
|
|
7982
|
+
|
|
7983
|
+
function between(min, value, max) {
|
|
7984
|
+
return Math.min(max, Math.max(min, value));
|
|
7985
|
+
}
|
|
7986
|
+
function Pagination$1({ contained, currentPage = 1, numberOfPages, onChange, }) {
|
|
7987
|
+
const animation = useRef(new Animation());
|
|
7988
|
+
useEffect(() => {
|
|
7989
|
+
animation.current.animate(between(1, currentPage, numberOfPages));
|
|
7990
|
+
}, [currentPage, numberOfPages]);
|
|
7991
|
+
if (numberOfPages <= 1)
|
|
7992
|
+
return;
|
|
7993
|
+
return (jsx("div", { className: clsx({
|
|
7994
|
+
[styles$u['contained']]: contained,
|
|
7995
|
+
}, styles$u['pagination-panel']), children: jsxs("div", { className: styles$u['content-container'], children: [jsx("div", { ref: animation.current.refButton, className: clsx(styles$u['active-page-button'], styles$u['page-button']), children: jsx("div", { ref: animation.current.refCircle, className: styles$u['circle'] }) }), Array.from({ length: numberOfPages }, (_, index) => (jsx("div", { ref: animation.current.refPaginationButton(index), className: clsx(styles$u['page-button']), onClick: () => {
|
|
7996
|
+
onChange?.(index + 1);
|
|
7997
|
+
}, onKeyPress: e => {
|
|
7998
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
7999
|
+
onChange?.(index + 1);
|
|
8000
|
+
}
|
|
8001
|
+
}, role: "button", tabIndex: 0 }, index)))] }) }));
|
|
8002
|
+
}
|
|
8003
|
+
|
|
8004
|
+
var styles$t = {"usp-carousel":"usp-carousel-module-UCbpX","pagination":"usp-carousel-module-msaeJ","product-usp":"usp-carousel-module-rtIrb","left":"usp-carousel-module--Vdc3","image":"usp-carousel-module-F-WAS","right":"usp-carousel-module-2fygw","content":"usp-carousel-module-AOJJg","icon":"usp-carousel-module-Diy2d","title":"usp-carousel-module--xcF2","text":"usp-carousel-module-tq8R8","navigation":"usp-carousel-module-L5Kmv"};
|
|
7917
8005
|
|
|
7918
8006
|
const DURATION_IN_MS = 800;
|
|
7919
8007
|
const CONTENT_TRANSLATE_PX = 40;
|
|
7920
|
-
const
|
|
8008
|
+
const USPCarousel = ({ slides }) => {
|
|
7921
8009
|
const swiperRef = useRef(null);
|
|
8010
|
+
const [currentIndex, setCurrentIndex] = useState(0);
|
|
8011
|
+
const swiperElementRef = useRef(null);
|
|
7922
8012
|
let currentTransitionSpeed = 0;
|
|
7923
8013
|
function getTransitionSpeed() {
|
|
7924
8014
|
const transitionSpeed = currentTransitionSpeed;
|
|
@@ -7944,52 +8034,22 @@ const UspCarousel = ({ slides }) => {
|
|
|
7944
8034
|
}
|
|
7945
8035
|
});
|
|
7946
8036
|
}
|
|
7947
|
-
return (jsxs(Swiper, { ref:
|
|
8037
|
+
return (jsxs(Swiper, { ref: swiperElementRef, className: styles$t['usp-carousel'], longSwipes: false, onActiveIndexChange: swiper => setCurrentIndex(swiper.activeIndex), onSetTransition: (_swiper, transitions) => {
|
|
7948
8038
|
currentTransitionSpeed = transitions;
|
|
7949
|
-
}, onSetTranslate: setTranslate, pagination: {
|
|
7950
|
-
clickable: true,
|
|
7951
|
-
el: '#pagination',
|
|
7952
|
-
}, speed: DURATION_IN_MS, virtualTranslate: true, watchSlidesProgress: true, children: [slides.map((slide, index) => (jsx(SwiperSlide, { children: slide }, index))), jsx("div", { className: styles$r.pagination, id: "pagination" })] }));
|
|
8039
|
+
}, onSetTranslate: setTranslate, onSwiper: swiper => (swiperRef.current = swiper), speed: DURATION_IN_MS, virtualTranslate: true, watchSlidesProgress: true, children: [slides.map((slide, index) => (jsx(SwiperSlide, { children: slide }, index))), jsx("div", { className: styles$t.pagination, id: "pagination" }), jsx("div", { className: styles$t.pagination, children: jsx(Pagination$1, { currentPage: currentIndex + 1, numberOfPages: slides.length, onChange: pageNumber => swiperRef.current?.slideTo(pageNumber - 1) }) })] }));
|
|
7953
8040
|
};
|
|
7954
8041
|
|
|
7955
|
-
function
|
|
7956
|
-
|
|
7957
|
-
return languageCode;
|
|
8042
|
+
function ProductUsp({ usp }) {
|
|
8043
|
+
return (jsxs("div", { className: styles$t['product-usp'], children: [jsx("div", { className: styles$t.left, children: jsx(Image, { className: styles$t.image, fit: "cover", image: usp.image, title: usp.image.altText }) }), jsx("div", { className: styles$t.right, children: jsxs("div", { "data-content": true, className: styles$t.content, children: [jsx(Image, { className: styles$t.icon, image: usp.icon, title: usp.icon.altText }), jsx(Heading, { italic: true, uppercase: true, className: styles$t.title, size: "xs", children: usp.heading }), jsx("p", { className: styles$t.text, children: usp.text })] }) })] }));
|
|
7958
8044
|
}
|
|
7959
8045
|
|
|
7960
|
-
|
|
8046
|
+
function ProductUSPCarousel({ usps }) {
|
|
8047
|
+
return (jsx(USPCarousel, { slides: usps.map((usp, index) => (jsx(ProductUsp, { usp: usp }, index))) }));
|
|
8048
|
+
}
|
|
7961
8049
|
|
|
7962
|
-
|
|
7963
|
-
|
|
7964
|
-
|
|
7965
|
-
3: 0,
|
|
7966
|
-
4: 0,
|
|
7967
|
-
5: 2,
|
|
7968
|
-
};
|
|
7969
|
-
function ImagesGrid({ images, onSelectImage }) {
|
|
7970
|
-
const isXl = useIsBreakpoint('xl');
|
|
7971
|
-
if (images.length > 5) {
|
|
7972
|
-
images = images.slice(0, 5);
|
|
7973
|
-
}
|
|
7974
|
-
const positionIndex = mainImagePosition[images.length] || 0;
|
|
7975
|
-
const imageList = [
|
|
7976
|
-
...images.slice(1, positionIndex + 1),
|
|
7977
|
-
images[0],
|
|
7978
|
-
...images.slice(positionIndex + 1),
|
|
7979
|
-
];
|
|
7980
|
-
function handleKeydown(event, image) {
|
|
7981
|
-
if (event.key === 'Enter' || event.key === ' ') {
|
|
7982
|
-
event.preventDefault();
|
|
7983
|
-
onSelectImage?.(image, images.indexOf(image));
|
|
7984
|
-
}
|
|
7985
|
-
}
|
|
7986
|
-
if (!isXl) {
|
|
7987
|
-
// TODO: Implement mobile thumbs swiper
|
|
7988
|
-
return jsx("div", { children: "Mobile thumbs swiper" });
|
|
7989
|
-
}
|
|
7990
|
-
return (jsx("div", { className: styles$q['images-grid'], "data-count": images.length, children: imageList.map((image, index) => image && (jsx("div", { "aria-label": onSelectImage ? `Open image ${index}` : undefined, className: clsx(styles$q['grid-item'], {
|
|
7991
|
-
[styles$q.clickable]: Boolean(onSelectImage),
|
|
7992
|
-
}), onClick: () => onSelectImage?.(image, images.indexOf(image)), onKeyDown: event => handleKeydown(event, image), role: onSelectImage ? 'button' : undefined, tabIndex: onSelectImage ? 0 : undefined, children: jsx(Image, { className: styles$q.image, fit: "contain", image: image, title: image.altText }) }, index))) }));
|
|
8050
|
+
function useLanguageCode() {
|
|
8051
|
+
const { languageCode } = useContext(IntlContext);
|
|
8052
|
+
return languageCode;
|
|
7993
8053
|
}
|
|
7994
8054
|
|
|
7995
8055
|
function ErrorPage({ error }) {
|
|
@@ -8005,16 +8065,16 @@ function ErrorPage({ error }) {
|
|
|
8005
8065
|
], title: "Something went wrong", children: environment !== 'production' && (jsxs(Fragment, { children: [jsx(Heading, { size: "l", children: isRequestError(error) ? (jsxs(Fragment, { children: [error.status, " - ", error.statusText || 'Unknown error'] })) : (jsx(Fragment, { children: error.message })) }), isRequestError(error) && (jsxs(Fragment, { children: [jsx(Heading, { size: "xs", children: "Error details" }), jsx(Heading, { size: "xxs", children: "Body" }), jsx("pre", { children: JSON.stringify(error.body, null, 2) }), jsx(Heading, { size: "xxs", children: "Options" }), jsx("pre", { children: JSON.stringify(error.options, null, 2) })] }))] })) }));
|
|
8006
8066
|
}
|
|
8007
8067
|
|
|
8008
|
-
var styles$
|
|
8068
|
+
var styles$s = {"product-details-page-layout":"product-details-page-layout-module-IQFIn","top":"product-details-page-layout-module--7oUp","image-gallery":"product-details-page-layout-module-Efavu","product-information":"product-details-page-layout-module-Y2490","recently-viewed":"product-details-page-layout-module-EDW8t","included":"product-details-page-layout-module-GSMls","usp":"product-details-page-layout-module-duq6v"};
|
|
8009
8069
|
|
|
8010
8070
|
function ProductDetailsPageLayout({ imageGallery, included, productInformation, recentlyViewed, usp, }) {
|
|
8011
|
-
return (jsxs("div", { className: styles$
|
|
8071
|
+
return (jsxs("div", { className: styles$s['product-details-page-layout'], children: [jsxs("section", { className: styles$s.top, children: [jsx("div", { className: styles$s['image-gallery'], children: imageGallery }), jsx("div", { className: styles$s['product-information'], children: productInformation })] }), jsx("section", { className: styles$s.usp, children: usp }), jsx("section", { className: styles$s.included, children: included }), jsx("section", { className: styles$s['recently-viewed'], children: recentlyViewed })] }));
|
|
8012
8072
|
}
|
|
8013
8073
|
|
|
8014
|
-
var styles$
|
|
8074
|
+
var styles$r = {"blank-page-spacer":"blank-page-spacer-module-lXxle","loading-overlay":"blank-page-spacer-module-hbxDP"};
|
|
8015
8075
|
|
|
8016
8076
|
function BlankPageSpacer({ children }) {
|
|
8017
|
-
return jsx("div", { className: styles$
|
|
8077
|
+
return jsx("div", { className: styles$r['blank-page-spacer'], children: children });
|
|
8018
8078
|
}
|
|
8019
8079
|
|
|
8020
8080
|
function LoadingPage() {
|
|
@@ -8074,7 +8134,7 @@ function useFetchProductDetailsPageData({ languageCode, pageUrl, }) {
|
|
|
8074
8134
|
`,
|
|
8075
8135
|
},
|
|
8076
8136
|
{
|
|
8077
|
-
heading: 'Safety
|
|
8137
|
+
heading: 'Safety third',
|
|
8078
8138
|
icon: {
|
|
8079
8139
|
1: 'https://ui.sonic-equipment.com/images/usps/usp-1-icon.svg',
|
|
8080
8140
|
2: 'https://ui.sonic-equipment.com/images/usps/usp-1-icon.svg',
|
|
@@ -8101,8 +8161,65 @@ function useFetchProductDetailsPageData({ languageCode, pageUrl, }) {
|
|
|
8101
8161
|
});
|
|
8102
8162
|
}
|
|
8103
8163
|
|
|
8104
|
-
|
|
8105
|
-
|
|
8164
|
+
var styles$q = {"images-grid":"images-grid-module-i5868","grid-item":"images-grid-module-nY9-n","image":"images-grid-module-TahRy","clickable":"images-grid-module-Ruktz"};
|
|
8165
|
+
|
|
8166
|
+
const mainImagePosition = {
|
|
8167
|
+
1: 0,
|
|
8168
|
+
2: 0,
|
|
8169
|
+
3: 0,
|
|
8170
|
+
4: 0,
|
|
8171
|
+
5: 2,
|
|
8172
|
+
};
|
|
8173
|
+
function ImagesGrid({ images, onSelectImage }) {
|
|
8174
|
+
const positionIndex = mainImagePosition[images.length] || 0;
|
|
8175
|
+
const imageList = [
|
|
8176
|
+
...images.slice(1, positionIndex + 1),
|
|
8177
|
+
images[0],
|
|
8178
|
+
...images.slice(positionIndex + 1),
|
|
8179
|
+
];
|
|
8180
|
+
function handleKeydown(event, image) {
|
|
8181
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
8182
|
+
event.preventDefault();
|
|
8183
|
+
onSelectImage?.(image, images.indexOf(image));
|
|
8184
|
+
}
|
|
8185
|
+
}
|
|
8186
|
+
return (jsx("div", { className: styles$q['images-grid'], "data-count": images.length, children: imageList.map((image, index) => image && (jsx("div", { "aria-label": `Open image ${index}`, className: clsx(styles$q['grid-item'], {
|
|
8187
|
+
[styles$q.clickable]: Boolean(onSelectImage),
|
|
8188
|
+
}), onClick: () => onSelectImage?.(image, index), onKeyDown: event => handleKeydown(event, image), role: "button", tabIndex: 0, children: jsx(Image, { className: styles$q.image, fit: "contain", image: image, title: image.altText }) }, index))) }));
|
|
8189
|
+
}
|
|
8190
|
+
|
|
8191
|
+
var styles$p = {"image-lightbox":"image-lightbox-module-9k3oJ","slide":"image-lightbox-module-K5Gd0","active-image":"image-lightbox-module-UNPOi","thumb":"image-lightbox-module-PUOMT","image":"image-lightbox-module-4RKLg","main-swiper":"image-lightbox-module-hAy3O","pagination":"image-lightbox-module-nN1Kr","sm":"image-lightbox-module-1idAN","thumbs-swiper":"image-lightbox-module-Xbxcn","lg":"image-lightbox-module--V8Xo","navigation-button":"image-lightbox-module-RP7KS","navigation-button-prev":"image-lightbox-module-wOPYF","navigation-button-next":"image-lightbox-module-knizp"};
|
|
8192
|
+
|
|
8193
|
+
function ImageLightbox({ images, initialSelectedIndex = 0, variant = 'sm', }) {
|
|
8194
|
+
const [thumbsSwiper, setThumbsSwiper] = useState();
|
|
8195
|
+
const [currentIndex, setCurrentIndex] = useState(initialSelectedIndex);
|
|
8196
|
+
const nextEl = useRef(null);
|
|
8197
|
+
const prevEl = useRef(null);
|
|
8198
|
+
const mainSwiperRef = useRef(null);
|
|
8199
|
+
return (jsxs("div", { className: clsx(styles$p['image-lightbox'], styles$p[variant]), children: [jsx(Swiper, { watchSlidesProgress: true, className: styles$p['thumbs-swiper'], direction: variant === 'sm' ? 'horizontal' : 'vertical', modules: [Thumb], onSwiper: swiper => setThumbsSwiper(swiper), slidesPerView: "auto", spaceBetween: 8, children: images.map((image, index) => (jsx(SwiperSlide, { className: styles$p.slide, children: jsx("div", { className: styles$p.thumb, children: jsx(Image, { className: styles$p.image, fit: "contain", height: 80, image: image, title: "Image", width: 80 }) }) }, index))) }), jsxs("div", { className: styles$p['main-swiper'], children: [jsx(Swiper, { initialSlide: initialSelectedIndex, modules: [Thumb, Navigation], navigation: {
|
|
8200
|
+
nextEl: nextEl.current,
|
|
8201
|
+
prevEl: prevEl.current,
|
|
8202
|
+
}, onActiveIndexChange: swiper => setCurrentIndex(swiper.activeIndex), onBeforeInit: swiper => (mainSwiperRef.current = swiper), slidesPerView: 1, thumbs: { swiper: thumbsSwiper }, children: images.map((image, index) => (jsx(SwiperSlide, { className: styles$p.slide, children: jsx("div", { className: styles$p['active-image'], children: jsx(Image, { className: styles$p.image, fit: "contain", image: image, title: "Image" }) }) }, index))) }), jsx("div", { className: styles$p.pagination, children: jsx(Pagination$1, { contained: true, currentPage: currentIndex + 1, numberOfPages: images.length, onChange: pageNumber => mainSwiperRef.current?.slideTo(pageNumber - 1) }) }), variant === 'lg' && (jsxs(Fragment, { children: [jsx(CarouselNavigationButton, { ref: prevEl, className: clsx(styles$p['navigation-button'], styles$p['navigation-button-prev']), direction: "previous" }), jsx(CarouselNavigationButton, { ref: nextEl, className: clsx(styles$p['navigation-button'], styles$p['navigation-button-next']), direction: "next" })] }))] })] }));
|
|
8203
|
+
}
|
|
8204
|
+
|
|
8205
|
+
var styles$o = {"image-lightbox-modal":"product-detail-images-module-N3Ms-"};
|
|
8206
|
+
|
|
8207
|
+
const MAX_IMAGES = 5;
|
|
8208
|
+
function ProductDetailImages({ images }) {
|
|
8209
|
+
const [selectedImageIndex, setSelectedImageIndex] = useState(0);
|
|
8210
|
+
const { isOpen, open, toggle } = useDisclosure();
|
|
8211
|
+
const isXl = useIsBreakpoint('xl');
|
|
8212
|
+
if (images.length > MAX_IMAGES) {
|
|
8213
|
+
images = images.slice(0, MAX_IMAGES);
|
|
8214
|
+
}
|
|
8215
|
+
function handleOpenImage(image) {
|
|
8216
|
+
setSelectedImageIndex(images.indexOf(image));
|
|
8217
|
+
open();
|
|
8218
|
+
}
|
|
8219
|
+
if (!isXl) {
|
|
8220
|
+
return jsx(ImageLightbox, { images: images });
|
|
8221
|
+
}
|
|
8222
|
+
return (jsxs(Fragment, { children: [jsx(ImagesGrid, { images: images, onSelectImage: (image, _index) => handleOpenImage(image) }), jsx(Modal, { hasCloseButton: true, isDismissable: true, isFullScreen: true, isKeyboardDismissDisabled: false, isOpen: isOpen, onOpenChange: toggle, children: jsx("div", { className: styles$o['image-lightbox-modal'], children: jsx(ImageLightbox, { images: images, initialSelectedIndex: selectedImageIndex, variant: "lg" }) }) })] }));
|
|
8106
8223
|
}
|
|
8107
8224
|
|
|
8108
8225
|
function GlyphsChevronsBoldDownIcon(props) {
|
|
@@ -8114,9 +8231,9 @@ function AccordionItem({ _pseudo = 'none', borderType = 'bottom', children, clas
|
|
|
8114
8231
|
const panelId = `panel-${id}`;
|
|
8115
8232
|
return (jsxs("div", { className: clsx(className, ...[]
|
|
8116
8233
|
.concat(borderType)
|
|
8117
|
-
.map(type => styles$
|
|
8118
|
-
[styles$
|
|
8119
|
-
}), children: [jsx("h3", { children: jsxs("button", { "aria-controls": panelId, "aria-expanded": isOpen, className: clsx(styles$
|
|
8234
|
+
.map(type => styles$M[`border-type-${type}`]), styles$M['accordion-item'], {
|
|
8235
|
+
[styles$M['is-open']]: isOpen,
|
|
8236
|
+
}), children: [jsx("h3", { children: jsxs("button", { "aria-controls": panelId, "aria-expanded": isOpen, className: clsx(styles$M.button, styles$M[_pseudo]), disabled: isDisabled, id: id, onClick: toggle, type: "button", children: [title, jsx("span", { className: styles$M.icon, children: size === 'lg' ? (jsx(GlyphsChevronsBoldDownIcon, {})) : (jsx(GlyphsChevronsSlimDownIcon, {})) })] }) }), jsx("div", { "aria-labelledby": id, className: styles$M.panel, id: panelId, role: "region", children: jsx("div", { className: styles$M.content, children: children }) })] }));
|
|
8120
8237
|
}
|
|
8121
8238
|
|
|
8122
8239
|
function StrokeDownloadIcon(props) {
|
|
@@ -8127,10 +8244,6 @@ function SolidCloseIcon(props) {
|
|
|
8127
8244
|
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", ...props, fill: "currentColor", height: "24", viewBox: "0 0 24 24", width: "24", children: jsx("path", { d: "M11.9997748,2 C17.5138784,2 22,6.48597148 22,11.9997748 C22,17.5138784 17.5138784,22 11.9997748,22 C6.48597148,22 2,17.5138784 2,11.9997748 C2,6.48597148 6.48597148,2 11.9997748,2 Z M16.4949747,7.50502525 C16.2216077,7.23165825 15.7783923,7.23165825 15.5050253,7.50502525 L12,11.011 L8.49497475,7.50502525 C8.22160774,7.23165825 7.77839226,7.23165825 7.50502525,7.50502525 L7.43121616,7.59179111 C7.23439192,7.86533687 7.25899495,8.24894444 7.50502525,8.49497475 L11.011,12 L7.50502525,15.5050253 C7.23165825,15.7783923 7.23165825,16.2216077 7.50502525,16.4949747 L7.59179111,16.5687838 C7.86533687,16.7656081 8.24894444,16.7410051 8.49497475,16.4949747 L12,12.988 L15.5050253,16.4949747 C15.7783923,16.7683418 16.2216077,16.7683418 16.4949747,16.4949747 L16.5687838,16.4082089 C16.7656081,16.1346631 16.7410051,15.7510556 16.4949747,15.5050253 L12.988,12 L16.4949747,8.49497475 C16.7683418,8.22160774 16.7683418,7.77839226 16.4949747,7.50502525 Z", fillRule: "evenodd" }) }));
|
|
8128
8245
|
}
|
|
8129
8246
|
|
|
8130
|
-
function SolidOkayIcon(props) {
|
|
8131
|
-
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", ...props, fill: "currentColor", height: "24", viewBox: "0 0 24 24", width: "24", children: jsx("path", { d: "M12.0051467,22 C13.3707325,22 14.6574026,21.7375193 15.865157,21.2125579 C17.0729113,20.6875965 18.1365586,19.9653457 19.0560988,19.0458055 C19.975639,18.1262652 20.6961743,17.0643335 21.2177046,15.8600103 C21.7392349,14.6556871 22,13.3673014 22,11.9948533 C22,10.6292675 21.7375193,9.34259736 21.2125579,8.13484303 C20.6875965,6.92708869 19.9653457,5.86172585 19.0458055,4.9387545 C18.1262652,4.01578315 17.0626179,3.2952479 15.8548636,2.77714874 C14.6471093,2.25904958 13.3604392,2 11.9948533,2 C10.6292675,2 9.34431292,2.25904958 8.13998971,2.77714874 C6.9356665,3.2952479 5.87201921,4.01578315 4.94904786,4.9387545 C4.02607651,5.86172585 3.3038257,6.92708869 2.78229542,8.13484303 C2.26076514,9.34259736 2,10.6292675 2,11.9948533 C2,13.3673014 2.2624807,14.6556871 2.7874421,15.8600103 C3.3124035,17.0643335 4.03465431,18.1262652 4.95419454,19.0458055 C5.87373477,19.9653457 6.9356665,20.6875965 8.13998971,21.2125579 C9.34431292,21.7375193 10.6326986,22 12.0051467,22 Z M10.9243438,16.7812661 C10.7390633,16.7812661 10.5743695,16.7400926 10.4302625,16.6577458 C10.2861554,16.5753989 10.1489106,16.4518785 10.018528,16.2871848 L7.60988163,13.3329902 C7.43832561,13.1202608 7.35254761,12.9006691 7.35254761,12.6742151 C7.35254761,12.4340367 7.43317893,12.2298851 7.59444159,12.0617602 C7.75570424,11.8936353 7.95642477,11.8095728 8.19660319,11.8095728 C8.34071024,11.8095728 8.47280837,11.8404529 8.59289758,11.9022131 C8.71298679,11.9639732 8.83136044,12.0737691 8.94801853,12.2316006 L10.8831704,14.7020072 L14.9696346,8.14513639 C15.1686396,7.82261108 15.4156802,7.66134843 15.7107566,7.66134843 C15.9372105,7.66134843 16.1413622,7.73511752 16.3232115,7.88265569 C16.5050609,8.03019386 16.5959856,8.22405215 16.5959856,8.46423057 C16.5959856,8.57402642 16.5702522,8.68553783 16.5187854,8.7987648 C16.4673186,8.91199177 16.407274,9.02007205 16.3386516,9.12300566 L11.7786927,16.2768914 C11.5659633,16.6131412 11.2811803,16.7812661 10.9243438,16.7812661 Z" }) }));
|
|
8132
|
-
}
|
|
8133
|
-
|
|
8134
8247
|
var styles$n = {"feature-list":"feature-list-module-cxc8U","row":"feature-list-module-tTJ2r","column":"feature-list-module-Tw0KD","column-label":"feature-list-module-J6Xfj","alignment-right":"feature-list-module-deI1-","column-value":"feature-list-module-CqSj1","icon-true":"feature-list-module-ojZvf","icon-false":"feature-list-module-4IjrA"};
|
|
8135
8248
|
|
|
8136
8249
|
function FeatureKey({ label }) {
|
|
@@ -8160,7 +8273,7 @@ function DownloadListItem({ document: { href, name }, }) {
|
|
|
8160
8273
|
return (jsxs("div", { className: styles$m['download-list-item'], children: [jsx(StrokeDownloadIcon, {}), jsx("a", { href: href, rel: "noreferrer", target: "_blank", children: name })] }));
|
|
8161
8274
|
}
|
|
8162
8275
|
|
|
8163
|
-
var styles$l = {"product-details-panel":"product-details-panel-module-
|
|
8276
|
+
var styles$l = {"product-details-panel":"product-details-panel-module-kfhpL","heading":"product-details-panel-module--1ODE","price-action-container":"product-details-panel-module-CCcmA","action-container":"product-details-panel-module-1vyDM","description":"product-details-panel-module-GfTab","feature-list":"product-details-panel-module-ze0my"};
|
|
8164
8277
|
|
|
8165
8278
|
function ProductDetailsPanel({ product }) {
|
|
8166
8279
|
return (jsxs("div", { className: styles$l['product-details-panel'], children: [jsxs("div", { className: styles$l.heading, children: [jsx(Heading, { italic: true, size: "xs", children: product.productTitle }), jsx(ProductSku, { sku: product.productNumber })] }), jsxs("div", { className: styles$l['price-action-container'], children: [jsx(ProductPrice, { isVatIncluded: false, originalPrice: product.unitListPrice, price: product.unitListPrice }), jsxs("div", { className: styles$l['action-container'], children: [product.canAddToCart && (jsx(ConnectedAddToCartButton, { productId: product.storefrontId })), product.canAddToWishlist && (jsx(ConnectedFavoriteButton, { productId: product.storefrontId }))] })] }), jsxs("div", { children: [jsx(Heading, { italic: true, className: styles$l['product-features-heading'], size: "xxs", children: jsx(FormattedMessage, { id: "Product Features" }) }), product.content.htmlContent && (jsx(ShowAll, { initialHeight: 216, children: jsx("div", { className: styles$l.description, dangerouslySetInnerHTML: {
|
|
@@ -8193,17 +8306,17 @@ function ProductDetailsPage({ pageUrl }) {
|
|
|
8193
8306
|
if (!data || isFetching)
|
|
8194
8307
|
return jsx(LoadingPage, {});
|
|
8195
8308
|
const { breadCrumb, included, product, recentlyViewed } = data;
|
|
8196
|
-
return (jsx(Page, { breadCrumb: breadCrumb, children: jsx(ProductDetailsPageLayout, { imageGallery: jsx(
|
|
8197
|
-
Boolean(included.length) && (jsxs(Fragment, { children: [jsx(Heading, { size: "s", tag: "h2", children: jsx(FormattedMessage, { id: "Includes" }) }), jsx(ProductCarousel, { allowExpandToGrid: true, hasOverflow: true, productCards: included.map(product => (jsx(ConnectedProductCard, { href: product.href, image: {
|
|
8309
|
+
return (jsx(Page, { breadCrumb: breadCrumb, children: jsx(ProductDetailsPageLayout, { imageGallery: jsx(ProductDetailImages, { images: product.images }), included: included !== undefined &&
|
|
8310
|
+
Boolean(included.length) && (jsxs(Fragment, { children: [jsx(Heading, { size: "s", tag: "h2", children: jsx(FormattedMessage, { id: "Includes" }) }), jsx(ProductCarousel, { allowExpandToGrid: true, hasOverflow: true, productCards: included.map(product => (jsx(ConnectedProductCard, { href: product.href, id: product.productId, image: {
|
|
8198
8311
|
fit: 'contain',
|
|
8199
8312
|
image: product.image,
|
|
8200
8313
|
title: product.image?.altText || product.title,
|
|
8201
|
-
}, price: product.price,
|
|
8202
|
-
Boolean(recentlyViewed.length) && (jsxs(Fragment, { children: [jsx(Heading, { size: "s", tag: "h2", children: jsx(FormattedMessage, { id: "Recently viewed" }) }), jsx(ProductCarousel, { hasOverflow: true, productCards: recentlyViewed.map(product => (jsx(ConnectedProductCard, { href: product.href, image: {
|
|
8314
|
+
}, price: product.price, sku: product.sku, tags: product.tags, title: product.title }, product.storefrontId))) })] })), productInformation: jsx(ProductDetailsPanel, { product: product }), recentlyViewed: recentlyViewed !== undefined &&
|
|
8315
|
+
Boolean(recentlyViewed.length) && (jsxs(Fragment, { children: [jsx(Heading, { size: "s", tag: "h2", children: jsx(FormattedMessage, { id: "Recently viewed" }) }), jsx(ProductCarousel, { hasOverflow: true, productCards: recentlyViewed.map(product => (jsx(ConnectedProductCard, { href: product.href, id: product.productId, image: {
|
|
8203
8316
|
fit: 'contain',
|
|
8204
8317
|
image: product.image,
|
|
8205
8318
|
title: product.image?.altText || product.title,
|
|
8206
|
-
}, price: product.price,
|
|
8319
|
+
}, price: product.price, sku: product.sku, tags: product.tags, title: product.title }, product.storefrontId))) })] })), usp: data.usps && jsx(ProductUSPCarousel, { usps: data.usps }) }) }));
|
|
8207
8320
|
}
|
|
8208
8321
|
|
|
8209
8322
|
const useSidebar = () => {
|
|
@@ -8303,7 +8416,7 @@ const ActiveFilters = ({ onClearAllFilters, onClearFilter, selectedFilterCategor
|
|
|
8303
8416
|
const t = useFormattedMessage();
|
|
8304
8417
|
if (selectedFilterCategories.length === 0)
|
|
8305
8418
|
return null;
|
|
8306
|
-
return (jsx(FilterSection, { button: jsx(RouteLink, {
|
|
8419
|
+
return (jsx(FilterSection, { button: jsx(RouteLink, { onClick: onClearAllFilters, children: jsx(FormattedMessage, { id: "Clear filters" }) }), title: t('Chosen filters'), variant: "with-action", children: selectedFilterCategories.map(category => category.filters.map(filter => (jsxs("div", { className: clsx(filterSectionStyles['filter-section-item'], styles$j['active-filter-item']), children: [jsxs("span", { children: [jsxs("span", { children: [jsx(FormattedMessage, { id: `facet.${category.label.toLowerCase()}` }), jsx("span", { children: ": " })] }), jsx("span", { className: styles$j['active-filter-value'], children: filter.label })] }), jsx(IconButton, { className: styles$j['clear-filter-button'], color: "secondary", onClick: () => onClearFilter(category.label, filter), children: jsx(StrokeCloseboxIcon, {}) })] }, `${category.label}-${filter.value}`)))) }));
|
|
8307
8420
|
};
|
|
8308
8421
|
|
|
8309
8422
|
function AlgoliaActiveFilters() {
|
|
@@ -8398,7 +8511,7 @@ const MULTISELECT_ATTRIBUTE_IGNORE_LIST = [
|
|
|
8398
8511
|
];
|
|
8399
8512
|
function PanelCloseButton() {
|
|
8400
8513
|
const { close } = useSidebarActions();
|
|
8401
|
-
return (jsx("div", { className: styles$k.button, children: jsxs(Button, { withArrow: true,
|
|
8514
|
+
return (jsx("div", { className: styles$k.button, children: jsxs(Button, { withArrow: true, onClick: close, size: "md", children: [jsx(FormattedMessage, { id: "Show" }), " ", jsx(AlgoliaResultsCount, {})] }) }));
|
|
8402
8515
|
}
|
|
8403
8516
|
function AlgoliaFilterPanel({ showActiveCategories = false, showCategoriesFilters = false, }) {
|
|
8404
8517
|
/*
|
|
@@ -8427,7 +8540,7 @@ function GlyphsChevronsSlimRightIcon(props) {
|
|
|
8427
8540
|
var styles$i = {"pagination":"pagination-module-k4OgY","page-number-container":"pagination-module-oq89A"};
|
|
8428
8541
|
|
|
8429
8542
|
function Pagination({ currentPage, onChange, totalPages, }) {
|
|
8430
|
-
return (jsxs("div", { className: styles$i.pagination, children: [jsx(IconButton, { isDisabled: currentPage === 1,
|
|
8543
|
+
return (jsxs("div", { className: styles$i.pagination, children: [jsx(IconButton, { isDisabled: currentPage === 1, onClick: () => onChange(currentPage - 1), children: jsx(GlyphsChevronsSlimLeftIcon, {}) }), jsxs("div", { className: styles$i['page-number-container'], children: [jsx(NumberField, { autoGrow: true, label: "current-page", maxValue: totalPages, minValue: 1, onChange: onChange, value: currentPage }), jsx(FormattedMessage, { id: "of" }), jsx("div", { children: totalPages })] }), jsx(IconButton, { isDisabled: currentPage >= totalPages, onClick: () => onChange(currentPage + 1), children: jsx(GlyphsChevronsSlimRightIcon, {}) })] }));
|
|
8431
8544
|
}
|
|
8432
8545
|
|
|
8433
8546
|
function AlgoliaPagination({ onChange }) {
|
|
@@ -8785,7 +8898,7 @@ function AlgoliaSortBy() {
|
|
|
8785
8898
|
var styles$h = {"promo-card":"promo-card-module-e2oii","sm":"promo-card-module-1-jT0","lg":"promo-card-module-zIYDh"};
|
|
8786
8899
|
|
|
8787
8900
|
function PromoCard({ href, image, variant }) {
|
|
8788
|
-
return (jsx(RouteLink, { className: clsx(styles$h['promo-card'], styles$h[variant]), href: href, children: jsx(Image, { fit: "cover", image: image, title: image.altText }) }));
|
|
8901
|
+
return (jsx(RouteLink, { className: clsx(styles$h['promo-card'], styles$h[variant]), href: href, tabIndex: 0, children: jsx(Image, { fit: "cover", image: image, title: image.altText }) }));
|
|
8789
8902
|
}
|
|
8790
8903
|
|
|
8791
8904
|
var styles$g = {"promos":"promo-cards-module-Dy4p3"};
|
|
@@ -8863,7 +8976,7 @@ function InnerSidebar({ children }) {
|
|
|
8863
8976
|
[styles$f['is-closed']]: !isOpen,
|
|
8864
8977
|
[styles$f['is-docked']]: isDocked,
|
|
8865
8978
|
[styles$f['is-not-docked']]: !isDocked,
|
|
8866
|
-
}), children: [jsx("div", { className: styles$f.close, children: jsx(IconButton, { color: "secondary",
|
|
8979
|
+
}), children: [jsx("div", { className: styles$f.close, children: jsx(IconButton, { color: "secondary", onClick: toggle, children: jsx(StrokeCloseboxIcon, {}) }) }), children] }));
|
|
8867
8980
|
}
|
|
8868
8981
|
function Sidebar({ children }) {
|
|
8869
8982
|
return jsx(InnerSidebar, { children: children });
|
|
@@ -8875,7 +8988,7 @@ function StrokeFilterIcon(props) {
|
|
|
8875
8988
|
|
|
8876
8989
|
const ToggleSidebarButton = () => {
|
|
8877
8990
|
const { isOpen, toggle } = useSidebar();
|
|
8878
|
-
return (jsx(Button, { color: "secondary", icon: jsx(StrokeFilterIcon, {}),
|
|
8991
|
+
return (jsx(Button, { color: "secondary", icon: jsx(StrokeFilterIcon, {}), onClick: toggle, size: "sm", variant: "outline", children: isOpen ? (jsx(FormattedMessage, { id: "Hide filters" })) : (jsx(FormattedMessage, { id: "Show filters" })) }));
|
|
8879
8992
|
};
|
|
8880
8993
|
|
|
8881
8994
|
var styles$e = {"no-results":"no-results-module-T1cti","title":"no-results-module-mZ8TQ","body":"no-results-module-FQGhC","buttons":"no-results-module-QGZsD"};
|
|
@@ -9151,23 +9264,23 @@ function useAlgoliaInsights() {
|
|
|
9151
9264
|
function ProductListingProductOverview() {
|
|
9152
9265
|
const { isLoading, products } = useAlgoliaProductHits();
|
|
9153
9266
|
const { sendAddToCartFromProductListPageEvent, sendAddToWishListFromProductListPageEvent, sendProductClickFromProductListPageEvent, } = useAlgoliaInsights();
|
|
9154
|
-
return (jsx(ProductOverviewGrid, { isLoading: isLoading, children: products.map(product => (jsx(ConnectedProductCard, { href: product.storefrontSlug, image: {
|
|
9267
|
+
return (jsx(ProductOverviewGrid, { isLoading: isLoading, children: products.map(product => (jsx(ConnectedProductCard, { href: product.storefrontSlug, id: product.storefrontId, image: {
|
|
9155
9268
|
fit: 'contain',
|
|
9156
9269
|
image: product.image,
|
|
9157
9270
|
title: product.name,
|
|
9158
9271
|
}, onAddToCart: () => sendAddToCartFromProductListPageEvent({
|
|
9159
9272
|
objectId: product.objectId,
|
|
9160
|
-
}),
|
|
9273
|
+
}), onClick: () => sendProductClickFromProductListPageEvent({
|
|
9161
9274
|
objectId: product.objectId,
|
|
9162
9275
|
position: product.position,
|
|
9163
|
-
}),
|
|
9276
|
+
}), onFavoriting: () => sendAddToWishListFromProductListPageEvent({
|
|
9164
9277
|
objectId: product.objectId,
|
|
9165
9278
|
position: product.position,
|
|
9166
9279
|
}), price: {
|
|
9167
9280
|
isVatIncluded: product.isVatIncluded,
|
|
9168
9281
|
originalPrice: product.originalPrice,
|
|
9169
9282
|
price: product.price,
|
|
9170
|
-
},
|
|
9283
|
+
}, sku: product.id, tags: product.labels, title: product.name }, product.storefrontId))) }));
|
|
9171
9284
|
}
|
|
9172
9285
|
|
|
9173
9286
|
var styles$c = {"product-listing":"product-listing-page-module-dmIHF","header":"product-listing-page-module-Oz76Z","promos":"product-listing-page-module-iY1yj","action-bar":"product-listing-page-module-XxGrr","sidebar-toggle":"product-listing-page-module-F7bxy","sort":"product-listing-page-module-aQzHr","count":"product-listing-page-module-zx79v","categories":"product-listing-page-module-R4aOl","product-grid-container":"product-listing-page-module-ICkKg","product-grid":"product-listing-page-module-LHE7z","pagination":"product-listing-page-module-xsRaj"};
|
|
@@ -9207,25 +9320,25 @@ function ProductListingPageContent({ currentCategoryPath, promoCards, }) {
|
|
|
9207
9320
|
function SearchResultProductOverview() {
|
|
9208
9321
|
const { isLoading, products } = useAlgoliaProductHits();
|
|
9209
9322
|
const { sendAddToCartFromSearchResultPageEvent, sendAddToWishListFromSearchResultPageEvent, sendProductClickFromSearchResultPageEvent, } = useAlgoliaInsights();
|
|
9210
|
-
return (jsx(ProductOverviewGrid, { isLoading: isLoading, children: products.map(product => (jsx(ConnectedProductCard, { href: product.storefrontSlug, image: {
|
|
9323
|
+
return (jsx(ProductOverviewGrid, { isLoading: isLoading, children: products.map(product => (jsx(ConnectedProductCard, { href: product.storefrontSlug, id: product.storefrontId, image: {
|
|
9211
9324
|
fit: 'contain',
|
|
9212
9325
|
image: product.image,
|
|
9213
9326
|
title: product.name,
|
|
9214
9327
|
}, onAddToCart: () => sendAddToCartFromSearchResultPageEvent({
|
|
9215
9328
|
objectId: product.objectId,
|
|
9216
|
-
}),
|
|
9217
|
-
objectId: product.objectId,
|
|
9218
|
-
position: product.position,
|
|
9219
|
-
}), onPress: () => {
|
|
9329
|
+
}), onClick: () => {
|
|
9220
9330
|
sendProductClickFromSearchResultPageEvent({
|
|
9221
9331
|
objectId: product.objectId,
|
|
9222
9332
|
position: product.position,
|
|
9223
9333
|
});
|
|
9224
|
-
},
|
|
9334
|
+
}, onFavoriting: () => sendAddToWishListFromSearchResultPageEvent({
|
|
9335
|
+
objectId: product.objectId,
|
|
9336
|
+
position: product.position,
|
|
9337
|
+
}), price: {
|
|
9225
9338
|
isVatIncluded: product.isVatIncluded,
|
|
9226
9339
|
originalPrice: product.originalPrice,
|
|
9227
9340
|
price: product.price,
|
|
9228
|
-
},
|
|
9341
|
+
}, sku: product.id, tags: product.labels, title: product.name }, product.storefrontId))) }));
|
|
9229
9342
|
}
|
|
9230
9343
|
|
|
9231
9344
|
function SearchResultsPageCategoryCarousel() {
|
|
@@ -9665,7 +9778,7 @@ function SearchInput({ autocomplete, formRef, inputRef, onCancel, onSubmit, plac
|
|
|
9665
9778
|
return (jsx("form", { ref: formRef, className: styles$7.form, ...formProps, onSubmit: handleSubmit, children: jsxs("div", { className: styles$7['input-container'], children: [jsx("label", { className: styles$7.label, ...labelProps, children: jsx(StrokeSearchIcon, { className: clsx(styles$7['icon-search'], styles$7.icon) }) }), jsx("input", { ref: inputRef, onKeyUp: e => {
|
|
9666
9779
|
if (e.key === 'Escape')
|
|
9667
9780
|
onCancel?.();
|
|
9668
|
-
}, ...inputProps, className: styles$7.input, placeholder: placeholder }), inputProps?.value && (jsx(IconButton, { className: styles$7['reset-btn'], color: "secondary",
|
|
9781
|
+
}, ...inputProps, className: styles$7.input, placeholder: placeholder }), inputProps?.value && (jsx(IconButton, { className: styles$7['reset-btn'], color: "secondary", onClick: () => formRef.current?.reset(), type: "reset", children: jsx(SolidCloseIcon, {}) }))] }) }));
|
|
9669
9782
|
}
|
|
9670
9783
|
|
|
9671
9784
|
function ConnectedSearchInput() {
|
|
@@ -9689,7 +9802,7 @@ function CategoriesGrid({ categories, onItemClick, }) {
|
|
|
9689
9802
|
}, onClick: onItemClick, title: category.title }, category.title) }, category.title))) }));
|
|
9690
9803
|
}
|
|
9691
9804
|
|
|
9692
|
-
var styles$5 = {"search-section":"search-section-module-qaTiw","header":"search-section-module-E--U2","title":"search-section-module-AHlDR"
|
|
9805
|
+
var styles$5 = {"search-section":"search-section-module-qaTiw","header":"search-section-module-E--U2","title":"search-section-module-AHlDR"};
|
|
9693
9806
|
|
|
9694
9807
|
function SearchSection({ button, children, className, title, }) {
|
|
9695
9808
|
return (jsxs("div", { className: clsx(styles$5['search-section'], className), children: [jsxs("div", { className: styles$5.header, children: [title && jsx("h2", { className: styles$5.title, children: title }), button && button] }), jsx("div", { className: styles$5.content, children: children })] }));
|
|
@@ -9737,7 +9850,7 @@ function SearchList({ ariaLabelledby, children, className, id, }) {
|
|
|
9737
9850
|
var styles$2 = {"search-list-item":"search-list-item-module-WXp77","clear-filter-button":"search-list-item-module-YJvJm","content":"search-list-item-module-CPrhz","text":"search-list-item-module--5uqN"};
|
|
9738
9851
|
|
|
9739
9852
|
function SearchListItem({ icon, isRemovable = false, onClick, onRemove, text, }) {
|
|
9740
|
-
return (jsxs("li", { className: styles$2['search-list-item'], onClick: onClick, role: "option", children: [jsxs("div", { className: styles$2.content, children: [icon && icon, text && jsx("span", { className: styles$2.text, children: text })] }), isRemovable && (jsx(IconButton, { className: styles$2['clear-filter-button'], color: "secondary",
|
|
9853
|
+
return (jsxs("li", { className: styles$2['search-list-item'], onClick: onClick, role: "option", children: [jsxs("div", { className: styles$2.content, children: [icon && icon, text && jsx("span", { className: styles$2.text, children: text })] }), isRemovable && (jsx(IconButton, { className: styles$2['clear-filter-button'], color: "secondary", onClick: onRemove, children: jsx(StrokeCloseboxIcon, {}) }))] }));
|
|
9741
9854
|
}
|
|
9742
9855
|
|
|
9743
9856
|
var styles$1 = {"quick-access-section":"no-search-module-87NKV","quick-access-carousel":"no-search-module-beCXI","quick-access-card":"no-search-module-dtT5J"};
|
|
@@ -9765,7 +9878,7 @@ function RecentSearchesSection() {
|
|
|
9765
9878
|
return null;
|
|
9766
9879
|
}
|
|
9767
9880
|
const { items, source } = collection;
|
|
9768
|
-
return (jsx(SearchSection, { button: jsx(RouteLink, { hasUnderline: true,
|
|
9881
|
+
return (jsx(SearchSection, { button: jsx(RouteLink, { hasUnderline: true, onClick: () => items.forEach(item => source.onRemove(item.id)), children: jsx(FormattedMessage, { id: "Clear" }) }), title: t('Recent searches'), children: jsx(SearchList, { ...autocomplete.getListProps({ source }), children: items.map(item => (jsx(SearchListItem, { ...autocomplete.getItemProps({
|
|
9769
9882
|
item,
|
|
9770
9883
|
source: source,
|
|
9771
9884
|
}), icon: jsx(StrokeSearchIcon, {}), isRemovable: true, onRemove: () => source.onRemove(item.id), text: jsx(Highlight, { attribute: "label", hit: item }) }, item.id))) }) }));
|
|
@@ -9777,7 +9890,7 @@ function QuickAccessSection() {
|
|
|
9777
9890
|
if (!collection)
|
|
9778
9891
|
return;
|
|
9779
9892
|
const { items } = collection;
|
|
9780
|
-
return (jsx(SearchSection, { title: t('Quick access'), children: jsx("div", { className: styles$1['quick-access-section'], children: jsx(Carousel, { className: styles$1['quick-access-carousel'], hasNavigation: false, hasOverflow: false, navigationButtonsPosition: "center", slides: items.map((item, index) => (jsx(RouteLink, { className: styles$1['quick-access-card'], href: item.action.url, onClick: close, children: jsx(Image, { height: 343, image: item.image, title: item.image.altText, width: 192 }) }, index))), spaceBetween: 16 }) }) }));
|
|
9893
|
+
return (jsx(SearchSection, { title: t('Quick access'), children: jsx("div", { className: styles$1['quick-access-section'], children: jsx(Carousel, { className: styles$1['quick-access-carousel'], hasNavigation: false, hasOverflow: false, navigationButtonsPosition: "center", slides: items.map((item, index) => (jsx(RouteLink, { className: styles$1['quick-access-card'], href: item.action.url, onClick: close, children: jsx(Image, { height: 343, image: item.image, title: item.image.altText, width: 192 }) }, index))), slidesPerView: "auto", spaceBetween: 16 }) }) }));
|
|
9781
9894
|
}
|
|
9782
9895
|
|
|
9783
9896
|
function StrokeRecentIcon(props) {
|
|
@@ -9825,7 +9938,7 @@ function ProductResultsSection() {
|
|
|
9825
9938
|
return (jsx(SearchSection, { className: styles$4['product-results-section'], title: t('Products'), children: jsx("div", { className: styles$4['product-results'], ...autocomplete.getListProps({ source }), children: jsx(ProductCarousel, { cardWidth: "narrow", productCards: items.map((product, index) => (createElement$1(ConnectedProductCard, { ...autocomplete.getItemProps({
|
|
9826
9939
|
item: product.hit,
|
|
9827
9940
|
source: source,
|
|
9828
|
-
}), key: product.storefrontId, href: product.storefrontSlug, image: {
|
|
9941
|
+
}), key: product.storefrontId, href: product.storefrontSlug, id: product.storefrontId, image: {
|
|
9829
9942
|
fit: 'contain',
|
|
9830
9943
|
image: product.image,
|
|
9831
9944
|
title: product.name,
|
|
@@ -9833,16 +9946,17 @@ function ProductResultsSection() {
|
|
|
9833
9946
|
sendAddToCartFromSearchEvent({
|
|
9834
9947
|
objectId: product.objectId,
|
|
9835
9948
|
queryId: product.queryId,
|
|
9836
|
-
}), onClick: () =>
|
|
9949
|
+
}), onClick: () => {
|
|
9950
|
+
close();
|
|
9837
9951
|
product.queryId &&
|
|
9838
|
-
|
|
9952
|
+
sendProductClickFromSearchEvent({
|
|
9839
9953
|
objectId: product.objectId,
|
|
9840
9954
|
position: product.position || index + 1,
|
|
9841
9955
|
queryId: product.queryId,
|
|
9842
9956
|
});
|
|
9843
|
-
},
|
|
9957
|
+
}, onFavoriting: () => {
|
|
9844
9958
|
product.queryId &&
|
|
9845
|
-
|
|
9959
|
+
sendAddToWishListFromSearchEvent({
|
|
9846
9960
|
objectId: product.objectId,
|
|
9847
9961
|
position: product.position || index + 1,
|
|
9848
9962
|
queryId: product.queryId,
|
|
@@ -9851,7 +9965,7 @@ function ProductResultsSection() {
|
|
|
9851
9965
|
isVatIncluded: product.isVatIncluded,
|
|
9852
9966
|
originalPrice: product.originalPrice,
|
|
9853
9967
|
price: product.price,
|
|
9854
|
-
},
|
|
9968
|
+
}, sku: product.id, tags: product.labels, title: jsx(Highlight, { attribute: "name", hit: product.hit }) }))), productsPerView: "auto" }) }) }));
|
|
9855
9969
|
}
|
|
9856
9970
|
|
|
9857
9971
|
function PanelContent() {
|