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AAK5C,EAAE,KAAKf,EAAE,KAAKoY,EAAE,KAAK3W,EAAE,KAAKD,EAAE,OAAOjI,EAAE,QAAQ,OAAO0G,GAAG,KAAKiB,EAAE,OAAOjB,EAAE,CAAC,CADkM7V,EAAE8tB,OAAOC,IAAI,2CCNtd","sources":["webpack://oricheckoutclientapp/../../node_modules/@mui/material/Switch/Switch.js","webpack://oricheckoutclientapp/../../node_modules/@mui/material/internal/switchBaseClasses.js","webpack://oricheckoutclientapp/../../node_modules/@mui/material/internal/SwitchBase.js","webpack://oricheckoutclientapp/../../node_modules/@ori-events/subscription-saved/dist/esm/index.js","webpack://oricheckoutclientapp/../../node_modules/@ori-ui/components/dist/esm/useSuspenseImage/readImage.js","webpack://oricheckoutclientapp/../../node_modules/@ori-ui/components/dist/esm/useSuspenseImage/useSuspenseImage.js","webpack://oricheckoutclientapp/../../node_modules/@ori-ui/components/dist/esm/SuspenseImage/suspenseImageClasses.js","webpack://oricheckoutclientapp/../../node_modules/@ori-ui/components/dist/esm/SuspenseImage/SuspenseImage.js","webpack://oricheckoutclientapp/../../node_modules/@ori-ui/components/dist/esm/LazyImage/LazyImage.js","webpack://oricheckoutclientapp/../../node_modules/@ori-ui/components/dist/esm/useIntersectionObserver/useIntersectionObserver.js","webpack://oricheckoutclientapp/../../node_modules/@ori-ui/components/dist/esm/LazyImage/lazyImageClasses.js","webpack://oricheckoutclientapp/../../node_modules/@ori-ui/icons/dist/esm/HelpCircle/index.js","webpack://oricheckoutclientapp/../../node_modules/@ori/basket-item/dist/esm/constants/defaultTranslations.js","webpack://oricheckoutclientapp/../../node_modules/@ori/basket-item/dist/esm/constants/sizes.js","webpack://oricheckoutclientapp/../../node_modules/@ori/basket-item/dist/esm/constants-generated.js","webpack://oricheckoutclientapp/../../node_modules/@ori/basket-item/dist/esm/logger.js","webpack://oricheckoutclientapp/../../node_modules/@ori/basket-item/dist/esm/context/itemContext.js","webpack://oricheckoutclientapp/../../node_modules/@ori/basket-item/dist/esm/components/ItemImage.js","webpack://oricheckoutclientapp/../../node_modules/@ori/basket-item/dist/esm/components/Description/ItemLabel.js","webpack://oricheckoutclientapp/../../node_modules/@ori/basket-item/dist/esm/components/Description/ItemAdditionalInfo.js","webpack://oricheckoutclientapp/../../node_modules/@ori/basket-item/dist/esm/components/Description/ItemShade.js","webpack://oricheckoutclientapp/../../node_modules/@ori/basket-item/dist/esm/components/ItemDescription.js","webpack://oricheckoutclientapp/../../node_modules/@ori/basket-item/dist/esm/components/internal/FormattedMessage.js","webpack://oricheckoutclientapp/../../node_modules/@ori/basket-item/dist/esm/components/CostBenefit/style.js","webpack://oricheckoutclientapp/../../node_modules/@ori/basket-item/dist/esm/components/CostBenefit/ItemBpBv.js","webpack://oricheckoutclientapp/../../node_modules/@ori/basket-item/dist/esm/components/CostBenefit/FormattedPoints.js","webpack://oricheckoutclientapp/../../node_modules/@ori/basket-item/dist/esm/components/CostBenefit/ItemPrice.js","webpack://oricheckoutclientapp/../../node_modules/@ori/basket-item/dist/esm/hooks/internal/useTranslations.js","webpack://oricheckoutclientapp/../../node_modules/@ori/basket-item/dist/esm/components/CostBenefit/ItemUnitPrice.js","webpack://oricheckoutclientapp/../../node_modules/@ori/basket-item/dist/esm/components/CostBenefit/usePriceLogic.js","webpack://oricheckoutclientapp/../../node_modules/@ori/basket-item/dist/esm/components/CostBenefit/ItemCataloguePrice.js","webpack://oricheckoutclientapp/../../node_modules/@ori/basket-item/dist/esm/components/ItemCostBenefit.js","webpack://oricheckoutclientapp/../../node_modules/@ori/basket-item/dist/esm/components/Actions/ItemButtons.js","webpack://oricheckoutclientapp/../../node_modules/@ori/basket-item/dist/esm/components/Actions/ItemQuantity.js","webpack://oricheckoutclientapp/../../node_modules/@ori/basket-item/dist/esm/components/ItemActions.js","webpack://oricheckoutclientapp/../../node_modules/@ori/basket-item/dist/esm/constants/index.js","webpack://oricheckoutclientapp/../../node_modules/@ori/basket-item/dist/esm/containers/BasketItemRoot.js","webpack://oricheckoutclientapp/../../node_modules/@ori/basket-item/dist/esm/containers/styles.js","webpack://oricheckoutclientapp/../../node_modules/@ori/basket-item/dist/esm/containers/InnerBasketItemBundle.js","webpack://oricheckoutclientapp/../../node_modules/@ori/basket-item/dist/esm/containers/InnerBasketItem.js","webpack://oricheckoutclientapp/../../node_modules/@ori/basket-item/dist/esm/containers/BasketItem.js","webpack://oricheckoutclientapp/../../node_modules/@ori/basket-item/dist/esm/containers/BasketSection.js","webpack://oricheckoutclientapp/../../node_modules/@ori/checkout-ui/dist/esm/ActionBanner/actionBannerClasses.js","webpack://oricheckoutclientapp/../../node_modules/@ori/checkout-ui/dist/esm/ActionBanner/ActionBanner.js","webpack://oricheckoutclientapp/../../node_modules/@ori/checkout-ui/dist/esm/CheckoutImage/constants.js","webpack://oricheckoutclientapp/../../node_modules/@ori/checkout-ui/dist/esm/CheckoutImage/checkoutImageTypes.js","webpack://oricheckoutclientapp/../../node_modules/@ori/checkout-ui/dist/esm/CheckoutImage/useCheckoutImage.js","webpack://oricheckoutclientapp/../../node_modules/@ori/checkout-ui/dist/esm/CheckoutImage/CheckoutImage.js","webpack://oricheckoutclientapp/../../node_modules/@ori/checkout-ui/dist/esm/InfoBanner/infoBannerClasses.js","webpack://oricheckoutclientapp/../../node_modules/@ori/checkout-ui/dist/esm/InfoBanner/InfoBanner.js","webpack://oricheckoutclientapp/../../node_modules/@ori/checkout-ui/dist/esm/InfoIcon/infoIconClasses.js","webpack://oricheckoutclientapp/../../node_modules/@ori/checkout-ui/dist/esm/InfoIcon/InfoIcon.js","webpack://oricheckoutclientapp/../../node_modules/@ori/checkout-utils/dist/esm/utils/stringAsNumber.js","webpack://oricheckoutclientapp/../../node_modules/@ori/checkout-utils/dist/esm/utils/stringEmptyToUndefined.js","webpack://oricheckoutclientapp/../../node_modules/@ori/product-box-carousel/dist/esm/components/ProductBoxCarousel/ProductBoxCarousel.js","webpack://oricheckoutclientapp/../../node_modules/@ori/presentation-hooks/dist/esm/useAreFavoritesEnabled.js","webpack://oricheckoutclientapp/../../node_modules/@ori/product-box-carousel/dist/esm/utils/sortProductBoxesByAvailability.js","webpack://oricheckoutclientapp/../../node_modules/@ori/presentation-utils/dist/esm/constants/swrConfig.js","webpack://oricheckoutclientapp/../../node_modules/@ori/product-box/dist/esm/utils/resolveHideRating.js","webpack://oricheckoutclientapp/../../node_modules/@ori/product-box/dist/esm/hooks/useHideRating.js","webpack://oricheckoutclientapp/../../node_modules/@ori/product-box/dist/esm/mappers/mapProductBoxesFromStaticApi.js","webpack://oricheckoutclientapp/../../packages/checkout-quick-order-form/node_modules/compute-scroll-into-view/dist/index.js","webpack://oricheckoutclientapp/../../packages/checkout-quick-order-form/node_modules/downshift/dist/downshift.esm.js","webpack://oricheckoutclientapp/../../packages/checkout-quick-order-form/node_modules/react-is/cjs/react-is.production.min.js","webpack://oricheckoutclientapp/../../packages/checkout-quick-order-form/node_modules/react-is/index.js"],"sourcesContent":["'use client';\n\n// @inheritedComponent IconButton\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"className\", \"color\", \"edge\", \"size\", \"sx\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport refType from '@mui/utils/refType';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { alpha, darken, lighten } from '@mui/system/colorManipulator';\nimport capitalize from '../utils/capitalize';\nimport SwitchBase from '../internal/SwitchBase';\nimport { styled } from '../zero-styled';\nimport { useDefaultProps } from '../DefaultPropsProvider';\nimport switchClasses, { getSwitchUtilityClass } from './switchClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes,\n edge,\n size,\n color,\n checked,\n disabled\n } = ownerState;\n const slots = {\n root: ['root', edge && `edge${capitalize(edge)}`, `size${capitalize(size)}`],\n switchBase: ['switchBase', `color${capitalize(color)}`, checked && 'checked', disabled && 'disabled'],\n thumb: ['thumb'],\n track: ['track'],\n input: ['input']\n };\n const composedClasses = composeClasses(slots, getSwitchUtilityClass, classes);\n return _extends({}, classes, composedClasses);\n};\nconst SwitchRoot = styled('span', {\n name: 'MuiSwitch',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, ownerState.edge && styles[`edge${capitalize(ownerState.edge)}`], styles[`size${capitalize(ownerState.size)}`]];\n }\n})({\n display: 'inline-flex',\n width: 34 + 12 * 2,\n height: 14 + 12 * 2,\n overflow: 'hidden',\n padding: 12,\n boxSizing: 'border-box',\n position: 'relative',\n flexShrink: 0,\n zIndex: 0,\n // Reset the stacking context.\n verticalAlign: 'middle',\n // For correct alignment with the text.\n '@media print': {\n colorAdjust: 'exact'\n },\n variants: [{\n props: {\n edge: 'start'\n },\n style: {\n marginLeft: -8\n }\n }, {\n props: {\n edge: 'end'\n },\n style: {\n marginRight: -8\n }\n }, {\n props: {\n size: 'small'\n },\n style: {\n width: 40,\n height: 24,\n padding: 7,\n [`& .${switchClasses.thumb}`]: {\n width: 16,\n height: 16\n },\n [`& .${switchClasses.switchBase}`]: {\n padding: 4,\n [`&.${switchClasses.checked}`]: {\n transform: 'translateX(16px)'\n }\n }\n }\n }]\n});\nconst SwitchSwitchBase = styled(SwitchBase, {\n name: 'MuiSwitch',\n slot: 'SwitchBase',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.switchBase, {\n [`& .${switchClasses.input}`]: styles.input\n }, ownerState.color !== 'default' && styles[`color${capitalize(ownerState.color)}`]];\n }\n})(({\n theme\n}) => ({\n position: 'absolute',\n top: 0,\n left: 0,\n zIndex: 1,\n // Render above the focus ripple.\n color: theme.vars ? theme.vars.palette.Switch.defaultColor : `${theme.palette.mode === 'light' ? theme.palette.common.white : theme.palette.grey[300]}`,\n transition: theme.transitions.create(['left', 'transform'], {\n duration: theme.transitions.duration.shortest\n }),\n [`&.${switchClasses.checked}`]: {\n transform: 'translateX(20px)'\n },\n [`&.${switchClasses.disabled}`]: {\n color: theme.vars ? theme.vars.palette.Switch.defaultDisabledColor : `${theme.palette.mode === 'light' ? theme.palette.grey[100] : theme.palette.grey[600]}`\n },\n [`&.${switchClasses.checked} + .${switchClasses.track}`]: {\n opacity: 0.5\n },\n [`&.${switchClasses.disabled} + .${switchClasses.track}`]: {\n opacity: theme.vars ? theme.vars.opacity.switchTrackDisabled : `${theme.palette.mode === 'light' ? 0.12 : 0.2}`\n },\n [`& .${switchClasses.input}`]: {\n left: '-100%',\n width: '300%'\n }\n}), ({\n theme\n}) => ({\n '&:hover': {\n backgroundColor: theme.vars ? `rgba(${theme.vars.palette.action.activeChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette.action.active, theme.palette.action.hoverOpacity),\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n backgroundColor: 'transparent'\n }\n },\n variants: [...Object.entries(theme.palette).filter(([, value]) => value.main && value.light) // check all the used fields in the style below\n .map(([color]) => ({\n props: {\n color\n },\n style: {\n [`&.${switchClasses.checked}`]: {\n color: (theme.vars || theme).palette[color].main,\n '&:hover': {\n backgroundColor: theme.vars ? `rgba(${theme.vars.palette[color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette[color].main, theme.palette.action.hoverOpacity),\n '@media (hover: none)': {\n backgroundColor: 'transparent'\n }\n },\n [`&.${switchClasses.disabled}`]: {\n color: theme.vars ? theme.vars.palette.Switch[`${color}DisabledColor`] : `${theme.palette.mode === 'light' ? lighten(theme.palette[color].main, 0.62) : darken(theme.palette[color].main, 0.55)}`\n }\n },\n [`&.${switchClasses.checked} + .${switchClasses.track}`]: {\n backgroundColor: (theme.vars || theme).palette[color].main\n }\n }\n }))]\n}));\nconst SwitchTrack = styled('span', {\n name: 'MuiSwitch',\n slot: 'Track',\n overridesResolver: (props, styles) => styles.track\n})(({\n theme\n}) => ({\n height: '100%',\n width: '100%',\n borderRadius: 14 / 2,\n zIndex: -1,\n transition: theme.transitions.create(['opacity', 'background-color'], {\n duration: theme.transitions.duration.shortest\n }),\n backgroundColor: theme.vars ? theme.vars.palette.common.onBackground : `${theme.palette.mode === 'light' ? theme.palette.common.black : theme.palette.common.white}`,\n opacity: theme.vars ? theme.vars.opacity.switchTrack : `${theme.palette.mode === 'light' ? 0.38 : 0.3}`\n}));\nconst SwitchThumb = styled('span', {\n name: 'MuiSwitch',\n slot: 'Thumb',\n overridesResolver: (props, styles) => styles.thumb\n})(({\n theme\n}) => ({\n boxShadow: (theme.vars || theme).shadows[1],\n backgroundColor: 'currentColor',\n width: 20,\n height: 20,\n borderRadius: '50%'\n}));\nconst Switch = /*#__PURE__*/React.forwardRef(function Switch(inProps, ref) {\n const props = useDefaultProps({\n props: inProps,\n name: 'MuiSwitch'\n });\n const {\n className,\n color = 'primary',\n edge = false,\n size = 'medium',\n sx\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const ownerState = _extends({}, props, {\n color,\n edge,\n size\n });\n const classes = useUtilityClasses(ownerState);\n const icon = /*#__PURE__*/_jsx(SwitchThumb, {\n className: classes.thumb,\n ownerState: ownerState\n });\n return /*#__PURE__*/_jsxs(SwitchRoot, {\n className: clsx(classes.root, className),\n sx: sx,\n ownerState: ownerState,\n children: [/*#__PURE__*/_jsx(SwitchSwitchBase, _extends({\n type: \"checkbox\",\n icon: icon,\n checkedIcon: icon,\n ref: ref,\n ownerState: ownerState\n }, other, {\n classes: _extends({}, classes, {\n root: classes.switchBase\n })\n })), /*#__PURE__*/_jsx(SwitchTrack, {\n className: classes.track,\n ownerState: ownerState\n })]\n });\n});\nprocess.env.NODE_ENV !== \"production\" ? Switch.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * If `true`, the component is checked.\n */\n checked: PropTypes.bool,\n /**\n * The icon to display when the component is checked.\n */\n checkedIcon: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * The color of the component.\n * It supports both default and custom theme colors, which can be added as shown in the\n * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).\n * @default 'primary'\n */\n color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['default', 'primary', 'secondary', 'error', 'info', 'success', 'warning']), PropTypes.string]),\n /**\n * The default checked state. Use when the component is not controlled.\n */\n defaultChecked: PropTypes.bool,\n /**\n * If `true`, the component is disabled.\n */\n disabled: PropTypes.bool,\n /**\n * If `true`, the ripple effect is disabled.\n * @default false\n */\n disableRipple: PropTypes.bool,\n /**\n * If given, uses a negative margin to counteract the padding on one\n * side (this is often helpful for aligning the left or right\n * side of the icon with content above or below, without ruining the border\n * size and shape).\n * @default false\n */\n edge: PropTypes.oneOf(['end', 'start', false]),\n /**\n * The icon to display when the component is unchecked.\n */\n icon: PropTypes.node,\n /**\n * The id of the `input` element.\n */\n id: PropTypes.string,\n /**\n * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.\n */\n inputProps: PropTypes.object,\n /**\n * Pass a ref to the `input` element.\n */\n inputRef: refType,\n /**\n * Callback fired when the state is changed.\n *\n * @param {React.ChangeEvent} event The event source of the callback.\n * You can pull out the new value by accessing `event.target.value` (string).\n * You can pull out the new checked state by accessing `event.target.checked` (boolean).\n */\n onChange: PropTypes.func,\n /**\n * If `true`, the `input` element is required.\n * @default false\n */\n required: PropTypes.bool,\n /**\n * The size of the component.\n * `small` is equivalent to the dense switch styling.\n * @default 'medium'\n */\n size: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['medium', 'small']), PropTypes.string]),\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * The value of the component. The DOM API casts this to a string.\n * The browser uses \"on\" as the default value.\n */\n value: PropTypes.any\n} : void 0;\nexport default Switch;","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getSwitchBaseUtilityClass(slot) {\n return generateUtilityClass('PrivateSwitchBase', slot);\n}\nconst switchBaseClasses = generateUtilityClasses('PrivateSwitchBase', ['root', 'checked', 'disabled', 'input', 'edgeStart', 'edgeEnd']);\nexport default switchBaseClasses;","'use client';\n\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"autoFocus\", \"checked\", \"checkedIcon\", \"className\", \"defaultChecked\", \"disabled\", \"disableFocusRipple\", \"edge\", \"icon\", \"id\", \"inputProps\", \"inputRef\", \"name\", \"onBlur\", \"onChange\", \"onFocus\", \"readOnly\", \"required\", \"tabIndex\", \"type\", \"value\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport refType from '@mui/utils/refType';\nimport composeClasses from '@mui/utils/composeClasses';\nimport capitalize from '../utils/capitalize';\nimport styled, { rootShouldForwardProp } from '../styles/styled';\nimport useControlled from '../utils/useControlled';\nimport useFormControl from '../FormControl/useFormControl';\nimport ButtonBase from '../ButtonBase';\nimport { getSwitchBaseUtilityClass } from './switchBaseClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes,\n checked,\n disabled,\n edge\n } = ownerState;\n const slots = {\n root: ['root', checked && 'checked', disabled && 'disabled', edge && `edge${capitalize(edge)}`],\n input: ['input']\n };\n return composeClasses(slots, getSwitchBaseUtilityClass, classes);\n};\nconst SwitchBaseRoot = styled(ButtonBase)(({\n ownerState\n}) => _extends({\n padding: 9,\n borderRadius: '50%'\n}, ownerState.edge === 'start' && {\n marginLeft: ownerState.size === 'small' ? -3 : -12\n}, ownerState.edge === 'end' && {\n marginRight: ownerState.size === 'small' ? -3 : -12\n}));\nconst SwitchBaseInput = styled('input', {\n shouldForwardProp: rootShouldForwardProp\n})({\n cursor: 'inherit',\n position: 'absolute',\n opacity: 0,\n width: '100%',\n height: '100%',\n top: 0,\n left: 0,\n margin: 0,\n padding: 0,\n zIndex: 1\n});\n\n/**\n * @ignore - internal component.\n */\nconst SwitchBase = /*#__PURE__*/React.forwardRef(function SwitchBase(props, ref) {\n const {\n autoFocus,\n checked: checkedProp,\n checkedIcon,\n className,\n defaultChecked,\n disabled: disabledProp,\n disableFocusRipple = false,\n edge = false,\n icon,\n id,\n inputProps,\n inputRef,\n name,\n onBlur,\n onChange,\n onFocus,\n readOnly,\n required = false,\n tabIndex,\n type,\n value\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const [checked, setCheckedState] = useControlled({\n controlled: checkedProp,\n default: Boolean(defaultChecked),\n name: 'SwitchBase',\n state: 'checked'\n });\n const muiFormControl = useFormControl();\n const handleFocus = event => {\n if (onFocus) {\n onFocus(event);\n }\n if (muiFormControl && muiFormControl.onFocus) {\n muiFormControl.onFocus(event);\n }\n };\n const handleBlur = event => {\n if (onBlur) {\n onBlur(event);\n }\n if (muiFormControl && muiFormControl.onBlur) {\n muiFormControl.onBlur(event);\n }\n };\n const handleInputChange = event => {\n // Workaround for https://github.com/facebook/react/issues/9023\n if (event.nativeEvent.defaultPrevented) {\n return;\n }\n const newChecked = event.target.checked;\n setCheckedState(newChecked);\n if (onChange) {\n // TODO v6: remove the second argument.\n onChange(event, newChecked);\n }\n };\n let disabled = disabledProp;\n if (muiFormControl) {\n if (typeof disabled === 'undefined') {\n disabled = muiFormControl.disabled;\n }\n }\n const hasLabelFor = type === 'checkbox' || type === 'radio';\n const ownerState = _extends({}, props, {\n checked,\n disabled,\n disableFocusRipple,\n edge\n });\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsxs(SwitchBaseRoot, _extends({\n component: \"span\",\n className: clsx(classes.root, className),\n centerRipple: true,\n focusRipple: !disableFocusRipple,\n disabled: disabled,\n tabIndex: null,\n role: undefined,\n onFocus: handleFocus,\n onBlur: handleBlur,\n ownerState: ownerState,\n ref: ref\n }, other, {\n children: [/*#__PURE__*/_jsx(SwitchBaseInput, _extends({\n autoFocus: autoFocus,\n checked: checkedProp,\n defaultChecked: defaultChecked,\n className: classes.input,\n disabled: disabled,\n id: hasLabelFor ? id : undefined,\n name: name,\n onChange: handleInputChange,\n readOnly: readOnly,\n ref: inputRef,\n required: required,\n ownerState: ownerState,\n tabIndex: tabIndex,\n type: type\n }, type === 'checkbox' && value === undefined ? {} : {\n value\n }, inputProps)), checked ? checkedIcon : icon]\n }));\n});\n\n// NB: If changed, please update Checkbox, Switch and Radio\n// so that the API documentation is updated.\nprocess.env.NODE_ENV !== \"production\" ? SwitchBase.propTypes = {\n /**\n * If `true`, the `input` element is focused during the first mount.\n */\n autoFocus: PropTypes.bool,\n /**\n * If `true`, the component is checked.\n */\n checked: PropTypes.bool,\n /**\n * The icon to display when the component is checked.\n */\n checkedIcon: PropTypes.node.isRequired,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * @ignore\n */\n defaultChecked: PropTypes.bool,\n /**\n * If `true`, the component is disabled.\n */\n disabled: PropTypes.bool,\n /**\n * If `true`, the keyboard focus ripple is disabled.\n * @default false\n */\n disableFocusRipple: PropTypes.bool,\n /**\n * If given, uses a negative margin to counteract the padding on one\n * side (this is often helpful for aligning the left or right\n * side of the icon with content above or below, without ruining the border\n * size and shape).\n * @default false\n */\n edge: PropTypes.oneOf(['end', 'start', false]),\n /**\n * The icon to display when the component is unchecked.\n */\n icon: PropTypes.node.isRequired,\n /**\n * The id of the `input` element.\n */\n id: PropTypes.string,\n /**\n * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.\n */\n inputProps: PropTypes.object,\n /**\n * Pass a ref to the `input` element.\n */\n inputRef: refType,\n /*\n * @ignore\n */\n name: PropTypes.string,\n /**\n * @ignore\n */\n onBlur: PropTypes.func,\n /**\n * Callback fired when the state is changed.\n *\n * @param {object} event The event source of the callback.\n * You can pull out the new checked state by accessing `event.target.checked` (boolean).\n */\n onChange: PropTypes.func,\n /**\n * @ignore\n */\n onFocus: PropTypes.func,\n /**\n * It prevents the user from changing the value of the field\n * (not from interacting with the field).\n */\n readOnly: PropTypes.bool,\n /**\n * If `true`, the `input` element is required.\n */\n required: PropTypes.bool,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.object,\n /**\n * @ignore\n */\n tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n /**\n * The input component prop `type`.\n */\n type: PropTypes.string.isRequired,\n /**\n * The value of the component.\n */\n value: PropTypes.any\n} : void 0;\nexport default SwitchBase;","export const eventName = 'subscription-saved';\nexport const subscriptionSaved = eventName;\n/**\n * Dispatch event when subscription is saved\n *\n * @param {CustomEventInit} data data which will be passed to event\n * @fires globalThis#subscription-saved:subscription-saved\n */\nexport function dispatch(data) {\n const event = new CustomEvent(eventName, data);\n globalThis.dispatchEvent(event);\n}\n\n/**\n * Listen callback for our event\n *\n * @callback listenCallback\n * @param {CustomEvent} event - Event data\n * @returns {void}\n */\n\n/**\n * Helper function which wraps event so we never miss.\n * @param {listenCallback} callback - That handles response\n * @param {(boolean | AddEventListenerOptions)} [options] - options of event\n */\nexport function listen(callback, options) {\n globalThis.addEventListener(eventName, callback, options);\n}\n\n/**\n * Clean event when you don't need to listen anymore.\n * @param {listenCallback} callback - that should be cleaned.\n */\nexport function clean(callback) {\n globalThis.removeEventListener(eventName, callback);\n}\nexport default {\n dispatch,\n listen,\n clean,\n eventName,\n subscriptionSaved\n};\n//# sourceMappingURL=index.js.map","/* eslint-disable @typescript-eslint/no-throw-literal -- TODO Add comment */\n/* istanbul ignore file */\n/**\n * Internal Cache for images\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention -- TODO Add comment\nexport const __imgCache = new Map();\n\n/**\n * readImage function that allows to use react suspense\n * @internal\n * @param {string} src src attribute\n * @param {string} [srcSet] srtSet Attribute\n * @throws { Promise } Throws promise when image is still loading\n * @returns { true | ErrorEvent } Returns true when image was loaded and error when image filed to load\n */\nexport function readImage(src, srcSet) {\n if (!__imgCache.has(src)) {\n __imgCache.set(src, new Promise((resolve, reject) => {\n const img = new Image();\n img.addEventListener('load', event => {\n __imgCache.set(src, true);\n resolve(event);\n });\n img.addEventListener('error', error => {\n reject(error);\n });\n img.src = src;\n if (srcSet) {\n img.srcset = srcSet;\n }\n }).then(() => {\n __imgCache.set(src, true);\n }).catch(error => {\n __imgCache.set(src, error);\n }));\n }\n if (__imgCache.get(src) instanceof Promise) {\n throw __imgCache.get(src);\n }\n return __imgCache.get(src);\n}\n//# sourceMappingURL=readImage.js.map","/* eslint-disable @typescript-eslint/no-throw-literal -- TODO Add comment */\n\nimport { readImage } from './readImage';\n/**\n * @typedef {Object} SuspendedImg\n * @property {boolean} isLoaded - true when image is loaded or load failed\n * @property {ErrorEvent} [error] - Error is only present when image failed to load\n */\n\n/**\n * Hook that must be used with react suspense and can be used for preloading images or custom loading indicator.\n *\n * @example Basic example.\n * // This component has to be used inside suspense\n * function Img() {\n * const src = src = 'https://url.to/my-image';\n * const { error } = useSuspenseImage({ src });\n *\n * if (error) return 'Error occurred';\n * return ;\n * }\n * @param {UseSuspenseImageProps} props\n * @throws {ErrorEvent} throws error when image fails to load and `shouldThrowError={true}`\n * @returns {SuspendedImg} suspense image object\n */\nexport default function useSuspenseImage(props) {\n const {\n src,\n srcSet,\n shouldThrowError = false,\n onerror,\n onload\n } = props;\n if (src === undefined) {\n return {\n isLoaded: true\n };\n }\n const result = readImage(src, srcSet);\n if (typeof result === 'boolean') {\n onload?.();\n return {\n isLoaded: true\n };\n }\n onerror?.(result);\n if (shouldThrowError) {\n throw result;\n }\n return {\n isLoaded: true,\n error: result\n };\n}\n//# sourceMappingURL=useSuspenseImage.js.map","import { generateUtilityClass, generateUtilityClasses } from '@ori-ui/mui-bundle/base';\nexport function getSuspenseImageUtilityClass(slot) {\n return generateUtilityClass('MuiOriSuspenseImage', slot);\n}\nconst suspenseImageClasses = generateUtilityClasses('MuiOriSuspenseImage', ['root']);\nexport default suspenseImageClasses;\n//# sourceMappingURL=suspenseImageClasses.js.map","import { unstable_composeClasses as composeClasses } from '@ori-ui/mui-bundle/base';\nimport { styled, useThemeProps } from '@ori-ui/mui-bundle/material';\nimport clsx from 'clsx';\nimport { forwardRef } from 'react';\nimport useSuspenseImage from '../useSuspenseImage';\nimport { getSuspenseImageUtilityClass } from './suspenseImageClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const getSuspenseImageSlots = _ => ({\n root: ['root']\n});\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = getSuspenseImageSlots(ownerState);\n return composeClasses(slots, getSuspenseImageUtilityClass, classes);\n};\nconst SuspenseImageRoot = styled('img', {\n name: 'MuiOriSuspenseImage',\n slot: 'Root',\n overridesResolver: (_, styles) => [styles.root]\n})({});\nexport const SuspenseImage = /*#__PURE__*/forwardRef((inProps, ref) => {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiOriSuspenseImage'\n });\n const {\n component,\n src,\n srcSet,\n className,\n shouldThrowError,\n errorFallback = null,\n onerror,\n onload,\n ...otherProps\n } = props;\n const {\n isLoaded,\n error\n } = useSuspenseImage({\n shouldThrowError,\n src,\n srcSet,\n onerror,\n onload\n });\n const ownerState = {\n ...props,\n isLoaded,\n error,\n shouldThrowError\n };\n const classes = useUtilityClasses(ownerState);\n if (error !== undefined) {\n return errorFallback;\n }\n return /*#__PURE__*/_jsx(SuspenseImageRoot, {\n ref: ref,\n as: component,\n ownerState: ownerState,\n className: clsx(classes.root, className),\n src: src,\n srcSet: srcSet,\n ...otherProps\n });\n});\nexport default SuspenseImage;\n//# sourceMappingURL=SuspenseImage.js.map","import { unstable_composeClasses as composeClasses } from '@ori-ui/mui-bundle/base';\nimport { styled, useThemeProps, useForkRef, Skeleton } from '@ori-ui/mui-bundle/material';\nimport clsx from 'clsx';\nimport { forwardRef, useEffect, useRef, useState } from 'react';\nimport SuspenseImage from '../SuspenseImage';\nimport useIntersectionObserver from '../useIntersectionObserver';\nimport { getLazyImageUtilityClass } from './lazyImageClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const getLazyImageSlots = _ => ({\n root: ['root'],\n skeleton: ['skeleton'],\n image: ['image']\n});\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = getLazyImageSlots(ownerState);\n const composedClasses = composeClasses(slots, getLazyImageUtilityClass, classes);\n return {\n ...classes,\n ...composedClasses\n };\n};\nconst LazyImageRoot = styled('span', {\n name: 'MuiOriLazyImage',\n slot: 'Root',\n overridesResolver: (_, styles) => [styles.root]\n})(({\n ownerState: {\n width,\n height\n }\n}) => ({\n display: 'inline-block',\n height,\n width\n}));\nconst LazyImageSkeleton = styled(Skeleton, {\n name: 'MuiOriLazyImage',\n slot: 'Skeleton',\n overridesResolver: (_, styles) => [styles.skeleton]\n})({\n display: 'inline-block',\n height: '100%',\n width: '100%'\n});\nconst LazyImageImg = styled('img', {\n name: 'MuiOriLazyImage',\n slot: 'Image',\n overridesResolver: (_, styles) => [styles.image]\n})({\n display: 'inline-block',\n height: '100%',\n width: '100%'\n});\nconst InnerSuspendedImage = /*#__PURE__*/forwardRef((props, ref) => {\n const {\n loading,\n didIntersect,\n classes,\n src,\n srcSet,\n imgProps,\n SuspenseImageProps,\n errorFallback,\n alt\n } = props;\n const imageProps = {\n errorFallback,\n alt\n };\n if (loading === 'eager' || didIntersect) {\n return /*#__PURE__*/_jsx(LazyImageImg, {\n as: SuspenseImage,\n ...imageProps,\n ref: ref,\n className: classes?.image,\n src: src,\n srcSet: srcSet,\n ...imgProps,\n ...SuspenseImageProps\n });\n }\n\n // Do not mount suspended image\n return null;\n});\nconst InnerLazyImage = /*#__PURE__*/forwardRef((props, ref) => {\n const {\n loading,\n didIntersect,\n errorFallback,\n classes,\n fallback = /*#__PURE__*/_jsx(LazyImageSkeleton, {\n animation: \"wave\",\n className: classes?.skeleton,\n variant: \"rectangular\"\n }),\n src,\n srcSet,\n imgProps,\n alt\n } = props;\n const imageProps = {\n alt\n };\n const [isLoaded, setIsLoaded] = useState(loading === 'eager');\n const [error, setError] = useState();\n useEffect(() => {\n if (loading === 'eager' || loading === 'lazy' && !didIntersect) {\n return () => {};\n }\n const onLoad = () => setIsLoaded(true);\n const onError = event => setError(event);\n const image = new Image();\n image.addEventListener('load', onLoad);\n image.addEventListener('error', onError);\n if (srcSet) {\n image.srcset = srcSet;\n }\n image.src = src;\n image.alt = alt ?? '';\n return () => {\n image.removeEventListener('load', onLoad);\n image.removeEventListener('error', onError);\n };\n }, [loading, didIntersect, src, srcSet, alt]);\n if (isLoaded) {\n return /*#__PURE__*/_jsx(LazyImageImg, {\n ...imageProps,\n ref: ref,\n src: src,\n srcSet: srcSet,\n className: classes?.image,\n ...imgProps\n });\n }\n if (error !== undefined) {\n return errorFallback;\n }\n return fallback;\n});\nexport const LazyImage = /*#__PURE__*/forwardRef((inProps, inRef) => {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiOriLazyImage'\n });\n const wrapperRef = useRef();\n const ref = useForkRef(inRef, wrapperRef);\n const {\n className,\n sx,\n component,\n loading = 'lazy',\n shouldThrowError = false,\n enableSuspense = false,\n errorFallback = null,\n fallback,\n imgRef,\n width,\n height,\n src,\n srcSet,\n SuspenseImageProps,\n imgProps,\n ...otherProps\n } = props;\n const {\n didIntersect\n } = useIntersectionObserver({\n ref: wrapperRef,\n disabled: loading === 'eager',\n unmountAfterIntersection: true\n });\n const ownerState = {\n ...props,\n SuspenseImageProps,\n imgProps,\n src,\n srcSet,\n width,\n height,\n loading,\n shouldThrowError,\n errorFallback,\n didIntersect\n };\n const classes = useUtilityClasses(ownerState);\n const InnerComponent = enableSuspense ? InnerSuspendedImage : InnerLazyImage;\n return /*#__PURE__*/_jsx(LazyImageRoot, {\n ref: ref,\n ownerState: ownerState,\n sx: sx,\n as: component,\n className: clsx(classes.root, className),\n ...otherProps,\n children: /*#__PURE__*/_jsx(InnerComponent, {\n ...ownerState,\n ref: imgRef,\n classes: classes\n })\n });\n});\nexport default LazyImage;\n//# sourceMappingURL=LazyImage.js.map","import { useState, useEffect } from 'react';\nexport default function useIntersectionObserver({\n ref,\n unmountAfterIntersection = false,\n disabled = false,\n options\n}) {\n const [didIntersect, setDidIntersect] = useState(false);\n const [isIntersecting, setIsIntersecting] = useState(false);\n const [mounted, setMounted] = useState(false);\n useEffect(() => {\n setMounted(true);\n return () => {\n setMounted(false);\n };\n }, []);\n useEffect(() => {\n if (!ref.current || disabled || !mounted) {\n return () => {};\n }\n const observer = new IntersectionObserver(entries => {\n entries.forEach(entry => {\n if (entry.target === ref.current && entry.isIntersecting) {\n setIsIntersecting(true);\n setDidIntersect(true);\n if (unmountAfterIntersection) {\n observer.unobserve(ref.current);\n }\n }\n if (entry.target === ref.current && !entry.isIntersecting) {\n setIsIntersecting(false);\n }\n });\n }, options);\n observer.observe(ref.current);\n return () => {\n observer.disconnect();\n };\n }, [ref, unmountAfterIntersection, disabled, mounted, options]);\n return {\n isIntersecting,\n didIntersect\n };\n}\n//# sourceMappingURL=useIntersectionObserver.js.map","import { generateUtilityClass, generateUtilityClasses } from '@ori-ui/mui-bundle/base';\nexport function getLazyImageUtilityClass(slot) {\n return generateUtilityClass('MuiOriLazyImage', slot);\n}\nconst lazyImageClasses = generateUtilityClasses('MuiOriLazyImage', ['root', 'skeleton', 'image']);\nexport default lazyImageClasses;\n//# sourceMappingURL=lazyImageClasses.js.map","import { createSvgIcon } from '@ori-ui/mui-bundle/material/utils';\nimport { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsxs(_Fragment, {\n children: [/*#__PURE__*/_jsx(\"path\", {\n d: \"M12 8.5c-.88 0-1.5.63-1.5 1.3a.5.5 0 0 1-1 0c0-1.318 1.17-2.3 2.5-2.3s2.5.982 2.5 2.3c0 1.15-.89 2.044-2 2.253V13.5a.5.5 0 0 1-1 0v-1.9a.5.5 0 0 1 .5-.5c.88 0 1.5-.63 1.5-1.3s-.62-1.3-1.5-1.3m.5 7a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0\"\n }), /*#__PURE__*/_jsx(\"path\", {\n d: \"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16m7-8a7 7 0 1 1-14 0 7 7 0 0 1 14 0\"\n })]\n}), 'HelpCircle');\n//# sourceMappingURL=index.js.map","/* istanbul ignore file */\n\nexport const defaultTranslations = {\n bpCount: '{0} BP',\n bvCount: '{0} BV',\n cataloguePrice: 'Catalogue price',\n qty: 'Qty',\n quantity: 'Quantity',\n regularPrice: 'Regular price',\n unitPrice: 'Unit price',\n whatsInside: 'What`s inside'\n};\n//# sourceMappingURL=defaultTranslations.js.map","export const SMALL_SECTION_WIDTH = 600;\nexport const XS_IMAGE_SIZE = 120;\nexport const XS_COLUMN_GAP = 10;\nexport const XS_OUTER_PADDING = 15;\nexport const SM_IMAGE_SIZE = 120;\nexport const SM_COLUMN_GAP = 10;\nexport const SM_OUTER_PADDING = 30;\nexport const MD_IMAGE_SIZE = 150;\nexport const MD_COLUMN_GAP = 15;\nexport const MD_OUTER_PADDING = 30;\n\n// temp fix until the ori-ui is updated (next major version)\nexport const BODY2_FONT_SIZE = '1.6rem';\n//# sourceMappingURL=sizes.js.map","/* istanbul ignore file */\n//\n// DO NOT EDIT!\n// This file was autogenerated by Eddie.\n// Changes may cause incorrect behavior and will be lost when the file is regenerated.\n//\n// Run `npx eddie update workspace` to regenerate.\n//\n\nexport const APP_NAME = 'basket-item';\nexport const PACKAGE_NAME = '@ori/basket-item';\nexport const TEAM_NAME = 'Checkout';\nexport const EMOTION_CACHE_KEY = `${APP_NAME}-emotion-cache-key`;\nexport const APP_ROOT_ELEMENT_ID = `${APP_NAME}-root`;\n//# sourceMappingURL=constants-generated.js.map","import { getDebugLogger } from '@ori/checkout-utils';\nimport { Logger } from '@ori/logger';\nimport { APP_NAME, PACKAGE_NAME, TEAM_NAME } from './constants-generated';\nexport const mainLogger = new Logger(PACKAGE_NAME, {\n teamName: TEAM_NAME\n});\nexport const logDebug = getDebugLogger(APP_NAME);\n//# sourceMappingURL=logger.js.map","import { createContext, useContext } from 'react';\nconst context = /*#__PURE__*/createContext({\n bp: '0',\n code: '0',\n isAvailable: false,\n isBundle: false,\n isBundleItem: false,\n itemTestId: 'Checkout-checkout-basket-item',\n lineNumber: 0,\n maxQuantity: 0,\n name: 'item',\n priceName: 'regularPrice',\n quantity: 0,\n testId: 'test',\n totalPrice: '0',\n type: null,\n url: '/products/product?code=0'\n});\nexport const ItemProvider = context.Provider;\nexport const useItemContext = () => useContext(context);\n//# sourceMappingURL=itemContext.js.map","import { styled, useTheme } from '@ori-ui/mui';\nimport { CheckoutImage } from '@ori/checkout-ui';\nimport { MD_IMAGE_SIZE, XS_IMAGE_SIZE } from '../constants';\nimport { useItemContext } from '../context';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst ImageHolder = styled('span')(({\n ownerState: {\n isSmall\n },\n theme\n}) => ({\n display: 'block',\n boxSizing: 'border-box',\n gridArea: 'image',\n width: XS_IMAGE_SIZE,\n height: XS_IMAGE_SIZE,\n borderRadius: theme.shape.borderRadius,\n overflow: 'hidden',\n ...(!isSmall && {\n [theme.breakpoints.up('md')]: {\n width: MD_IMAGE_SIZE,\n height: MD_IMAGE_SIZE\n }\n })\n}));\nconst ImageHolderLink = styled('a')(({\n ownerState: {\n isSmall\n },\n theme\n}) => ({\n display: 'block',\n boxSizing: 'border-box',\n gridArea: 'image',\n width: XS_IMAGE_SIZE,\n height: XS_IMAGE_SIZE,\n borderRadius: theme.shape.borderRadius,\n overflow: 'hidden',\n ...(!isSmall && {\n [theme.breakpoints.up('md')]: {\n width: MD_IMAGE_SIZE,\n height: MD_IMAGE_SIZE\n }\n })\n}));\nexport const ItemImage = () => {\n const {\n image,\n isAvailable,\n itemTestId,\n name,\n url,\n isSmall\n } = useItemContext();\n const theme = useTheme();\n const testId = `${itemTestId}-image`;\n const theImage = /*#__PURE__*/_jsx(CheckoutImage, {\n src: image ?? 'noImage',\n \"data-testid\": testId,\n alt: name,\n opacity: isAvailable ? 1 : 0.5,\n background: theme.palette.grey[100],\n size: isSmall ? 'basketItemSmall' : 'basketItem'\n });\n if (url === undefined) {\n return /*#__PURE__*/_jsx(ImageHolder, {\n \"data-testid\": `${testId}-wrapper`,\n ownerState: {\n isSmall: isSmall ?? false\n },\n children: theImage\n });\n }\n return /*#__PURE__*/_jsx(ImageHolderLink, {\n \"data-testid\": `${testId}-wrapper`,\n href: url,\n ownerState: {\n isSmall: isSmall ?? false\n },\n \"aria-label\": name,\n children: theImage\n });\n};\n//# sourceMappingURL=ItemImage.js.map","/* eslint-disable react/no-danger -- should be ok ;) */\nimport { Chip, Tooltip } from '@ori-ui/mui';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst defaultType = new Set(['back-in-stock', 'free-sample', 'last-chance', 'loyalty', 'new', 'until-stock-lasts', 'value-set']);\nconst offerType = new Set(['catalogue-offer']);\nconst infoType = new Set(['claim', 'replacement', 'reserved-product']);\nconst visibility = new Set(['replacement']);\nconst croppedClassName = fullClassLabel => fullClassLabel.split(' ')[1];\nexport const ItemLabel = ({\n label,\n labelClass,\n tooltip,\n testId\n}) => {\n if (!label || !labelClass) {\n return null;\n }\n const croppedClass = croppedClassName(labelClass);\n const isVisible = !visibility.has(croppedClass);\n const type = defaultType.has(croppedClass) ? 'default' : infoType.has(croppedClass) ? 'info' : offerType.has(croppedClass) ? 'offer' : 'default';\n if (!isVisible) {\n return null;\n }\n if (tooltip) {\n return /*#__PURE__*/_jsx(Tooltip, {\n arrow: true,\n placement: \"top-start\",\n title: tooltip ? /*#__PURE__*/_jsx(\"div\", {\n dangerouslySetInnerHTML: {\n __html: tooltip\n }\n }) : '',\n children: /*#__PURE__*/_jsx(Chip, {\n \"data-testid\": testId,\n color: type,\n variant: \"tag\",\n label: label\n })\n });\n }\n return /*#__PURE__*/_jsx(Chip, {\n \"data-testid\": testId,\n color: type,\n variant: \"tag\",\n label: label\n });\n};\n//# sourceMappingURL=ItemLabel.js.map","import { styled, Typography, useTheme } from '@ori-ui/mui';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst AdditionalInfo = styled('span')(({\n theme\n}) => ({\n display: 'inline-grid',\n paddingLeft: theme.spacing(1),\n gridTemplateColumns: 'auto auto',\n gap: theme.spacing(1),\n alignItems: 'center'\n}));\nconst Separator = styled('span')(() => ({\n fontSize: '2rem',\n lineHeight: 0.5\n}));\nexport const ItemAdditionalInfo = ({\n infoText,\n itemTestId\n}) => {\n const theme = useTheme();\n return /*#__PURE__*/_jsxs(AdditionalInfo, {\n \"data-testid\": `${itemTestId}-info-addon`,\n children: [/*#__PURE__*/_jsx(Separator, {\n children: \"\\xB7\"\n }), /*#__PURE__*/_jsx(Typography, {\n variant: \"caption\",\n color: theme.palette.text.secondary,\n children: infoText\n })]\n });\n};\n//# sourceMappingURL=ItemAdditionalInfo.js.map","import { styled, Typography, useTheme } from '@ori-ui/mui';\nimport { Shade, ShadeSize } from '@ori/presentation-components';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst ColorInfo = styled('div')(({\n theme\n}) => ({\n display: 'inline-grid',\n paddingLeft: theme.spacing(2),\n gridTemplateColumns: '10px 1fr',\n gap: theme.spacing(1),\n alignItems: 'center'\n}));\nconst ColorVisual = styled(Shade)(() => ({\n display: 'inline-block',\n width: 10,\n height: 10,\n overflow: 'hidden'\n}));\nexport const ItemShade = ({\n code,\n itemTestId,\n shade\n}) => {\n const theme = useTheme();\n const {\n hexColors,\n imageUrl,\n shadeName\n } = shade ?? {};\n if (!shadeName) {\n return null;\n }\n return /*#__PURE__*/_jsxs(ColorInfo, {\n \"data-testid\": `${itemTestId}-shade`,\n children: [/*#__PURE__*/_jsx(ColorVisual, {\n shade: {\n canBeSold: true,\n hexColors,\n imageUrl,\n productCode: code,\n name: shadeName\n },\n size: ShadeSize.Small,\n testId: `${itemTestId}-shade-visual`\n }), /*#__PURE__*/_jsx(Typography, {\n variant: \"caption\",\n color: theme.palette.text.secondary,\n children: shadeName\n })]\n });\n};\n//# sourceMappingURL=ItemShade.js.map","import { styled, Typography, useTheme } from '@ori-ui/mui';\nimport { useMemo } from 'react';\nimport { SM_COLUMN_GAP, SM_IMAGE_SIZE, SM_OUTER_PADDING } from '../constants';\nimport { useItemContext } from '../context';\nimport { ItemLabel, ItemShade, ItemAdditionalInfo } from './Description';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst Root = styled('div')(({\n ownerState: {\n isSmall\n },\n theme\n}) => ({\n gridArea: 'product',\n alignSelf: 'start',\n boxSizing: 'border-box',\n overflow: 'hidden',\n display: 'grid',\n gridTemplateColumns: 'auto',\n gridTemplateRows: 'auto auto auto',\n width: '100%',\n alignItems: 'start',\n gap: theme.spacing(1),\n ...(!isSmall && {\n [theme.breakpoints.up('sm')]: {\n maxWidth: `${theme.breakpoints.values.md - 1 - SM_IMAGE_SIZE + SM_COLUMN_GAP + 2 * SM_OUTER_PADDING}px`\n },\n [theme.breakpoints.up('md')]: {\n width: 'auto'\n }\n })\n}));\nconst Name = styled('div')(({\n ownerState: {\n isSmall\n },\n theme\n}) => ({\n fontSize: theme.typography.body1.fontSize,\n width: '100%',\n overflow: 'hidden',\n display: '-webkit-box',\n WebkitLineClamp: '2',\n WebkitBoxOrient: 'vertical',\n textWrap: 'balance',\n ...(!isSmall && {\n [theme.breakpoints.up('md')]: {\n display: 'block',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis'\n }\n })\n}));\nconst NameInner = styled('span')(({\n theme\n}) => ({\n fontSize: theme.typography.body1.fontSize,\n display: 'inline'\n}));\nconst NameLink = styled('a')(({\n theme\n}) => ({\n fontSize: theme.typography.body1.fontSize,\n display: 'inline'\n}));\nconst InfoSection = styled('div')(({\n theme\n}) => ({\n display: 'grid',\n gridTemplateColumns: 'auto auto',\n justifyContent: 'start',\n alignContent: 'center',\n justifyItems: 'start',\n alignItems: 'center'\n}));\nexport const ItemDescription = () => {\n const {\n brand,\n code,\n flags,\n infoAddon,\n itemTestId,\n name,\n shade,\n url,\n isSmall\n } = useItemContext();\n const theme = useTheme();\n // at the moment we use only the first flag\n const flag = flags && flags.length > 0 ? flags[0] : undefined;\n const showInfo = useMemo(() => typeof infoAddon === 'string' && infoAddon.length > 0, [infoAddon]);\n const showShade = useMemo(() => !showInfo && Boolean(shade), [showInfo, shade]);\n return /*#__PURE__*/_jsxs(Root, {\n ownerState: {\n isSmall: isSmall ?? false\n },\n children: [flag ? /*#__PURE__*/_jsx(\"div\", {\n children: /*#__PURE__*/_jsx(ItemLabel, {\n testId: `${itemTestId}-flags`,\n ...flag\n })\n }) : null, brand ? /*#__PURE__*/_jsx(Typography, {\n variant: \"overline\",\n component: url === undefined ? 'span' : 'a',\n color: theme.palette.text.secondary,\n href: url,\n \"data-testid\": `${itemTestId}-brand`,\n style: {\n letterSpacing: 2,\n textTransform: 'uppercase'\n },\n children: brand\n }) : null, /*#__PURE__*/_jsx(Name, {\n \"data-testid\": `${itemTestId}-description`,\n ownerState: {\n isSmall: isSmall ?? false\n },\n children: url === undefined ? /*#__PURE__*/_jsx(NameInner, {\n children: name\n }) : /*#__PURE__*/_jsx(NameLink, {\n href: url,\n children: name\n })\n }), /*#__PURE__*/_jsxs(InfoSection, {\n children: [/*#__PURE__*/_jsx(Typography, {\n variant: \"caption\",\n color: theme.palette.text.secondary,\n \"data-testid\": `${itemTestId}-code`,\n children: code\n }), showInfo ? /*#__PURE__*/_jsx(ItemAdditionalInfo, {\n infoText: infoAddon ?? '',\n itemTestId: itemTestId\n }) : null, showShade ? /*#__PURE__*/_jsx(ItemShade, {\n code: code,\n itemTestId: itemTestId,\n shade: shade\n }) : null]\n })]\n });\n};\n//# sourceMappingURL=ItemDescription.js.map","/* istanbul ignore file */\nimport { FormattedMessage as NotTypedFormattedMessage } from '@ori/i18n';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * Renders a formatted internationalized message using the provided translation data.\n *\n * @returns The FormattedMessage typed with keys within the specified namespace.\n */\nexport const FormattedMessage = props => /*#__PURE__*/_jsx(NotTypedFormattedMessage, {\n ...props\n});\n//# sourceMappingURL=FormattedMessage.js.map","import { styled, Typography } from '@ori-ui/mui';\nexport const NumberInner = styled('div')(({\n theme\n}) => ({\n display: 'flex',\n justifyContent: 'flex-end',\n overflow: 'hidden',\n flexFlow: 'row wrap',\n gap: theme.spacing(1),\n width: '100%'\n}));\nexport const NumberInnerValue = styled(Typography)(() => ({\n display: 'flex',\n whiteSpace: 'nowrap'\n}));\n//# sourceMappingURL=style.js.map","import { useTheme } from '@ori-ui/mui';\nimport { isNonNullable } from '@ori/ts-utils';\nimport { useItemContext } from '../../context';\nimport { FormattedMessage } from '../internal/FormattedMessage';\nimport { NumberInner, NumberInnerValue } from './style';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const ItemBpBv = () => {\n const {\n bp,\n bv,\n itemTestId,\n showBp\n } = useItemContext();\n const theme = useTheme();\n if (showBp && (bp !== '' || isNonNullable(bv))) {\n return /*#__PURE__*/_jsxs(NumberInner, {\n children: [bp === '' ? null : /*#__PURE__*/_jsx(NumberInnerValue, {\n variant: \"caption\",\n color: theme.palette.text.secondary,\n \"data-testid\": `${itemTestId}-bp`,\n children: /*#__PURE__*/_jsx(FormattedMessage, {\n id: \"bpCount\",\n defaultMessage: \"{0} BP\",\n values: {\n 0: bp\n }\n })\n }), isNonNullable(bv) ? /*#__PURE__*/_jsx(NumberInnerValue, {\n variant: \"caption\",\n \"data-testid\": `${itemTestId}-bv`,\n color: theme.palette.text.secondary,\n children: /*#__PURE__*/_jsx(FormattedMessage, {\n id: \"bvCount\",\n defaultMessage: \"{0} BV\",\n values: {\n 0: bv\n }\n })\n }) : null]\n });\n }\n return null;\n};\n//# sourceMappingURL=ItemBpBv.js.map","import { RewardsHeartsFilled } from '@ori-ui/icons';\nimport { styled, Typography } from '@ori-ui/mui';\nimport { PointsCurrency, useCulture } from '@ori/culture';\nimport { BODY2_FONT_SIZE } from '../../constants';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst Points = styled('span')(({\n theme\n}) => ({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '2.5rem',\n height: '2.5rem',\n borderRadius: '50%',\n background: theme.palette.offer.main,\n color: theme.palette.offer.contrastText,\n fontSize: theme.typography.overline.fontSize,\n lineHeight: 2,\n fontWeight: 'bold'\n}));\nconst BeautyPoints = styled(Typography)(({\n theme\n}) => ({\n fontSize: BODY2_FONT_SIZE,\n color: theme.palette.offer.main,\n fontWeight: 'bold',\n display: 'flex',\n alignItems: 'center'\n}));\nexport const FormattedPoints = ({\n children\n}) => {\n const {\n culture: {\n pointsFormat\n } = {}\n } = useCulture();\n if (!pointsFormat) {\n return /*#__PURE__*/_jsx(Points, {\n children: children\n });\n }\n const {\n currency\n } = pointsFormat;\n if (currency === PointsCurrency.Hearts) {\n return /*#__PURE__*/_jsxs(BeautyPoints, {\n children: [children, \" \", /*#__PURE__*/_jsx(RewardsHeartsFilled, {\n fontSize: \"inherit\"\n })]\n });\n }\n return /*#__PURE__*/_jsx(Points, {\n children: children\n });\n};\n//# sourceMappingURL=FormattedPoints.js.map","import { styled, Typography } from '@ori-ui/mui';\nimport { BODY2_FONT_SIZE } from '../../constants';\nimport { useItemContext } from '../../context';\nimport { FormattedPoints } from './FormattedPoints';\nimport { NumberInner } from './style';\nimport { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst Price = styled(Typography)(({\n ownerState: {\n arePointsShown,\n isOfferColor,\n isAvailable\n },\n theme\n}) => ({\n fontSize: BODY2_FONT_SIZE,\n color: theme.palette.text.primary,\n ...((Boolean(isOfferColor) || arePointsShown) && {\n color: theme.palette.offer.main\n }),\n ...(!isAvailable && {\n color: theme.palette.text.secondary\n }),\n fontWeight: 'bold',\n display: 'flex'\n}));\nconst Plus = styled('span')(({\n theme\n}) => ({\n color: theme.palette.offer.main,\n fontSize: BODY2_FONT_SIZE,\n fontWeight: 'bold',\n '&:after': {\n content: '\"+\"'\n }\n}));\nexport const ItemPrice = () => {\n const {\n isAvailable,\n isOfferColor,\n itemTestId,\n points,\n totalPrice\n } = useItemContext();\n const arePointsShown = Boolean(points && points !== '');\n return /*#__PURE__*/_jsxs(NumberInner, {\n \"data-testid\": itemTestId,\n children: [arePointsShown ? /*#__PURE__*/_jsxs(_Fragment, {\n children: [/*#__PURE__*/_jsx(FormattedPoints, {\n children: points\n }), /*#__PURE__*/_jsx(Plus, {})]\n }) : null, /*#__PURE__*/_jsx(Price, {\n ownerState: {\n arePointsShown,\n isOfferColor,\n isAvailable\n },\n children: totalPrice\n })]\n });\n};\n//# sourceMappingURL=ItemPrice.js.map","/* istanbul ignore file */\nimport { useTranslationsFromNamespace } from '@ori/i18n';\n/**\n * A hook for accessing translations within a specific namespace along with a formatting function.\n *\n * @returns The translations within the specified namespace and a formatting function.\n */\nexport const useTranslations = () => useTranslationsFromNamespace();\n//# sourceMappingURL=useTranslations.js.map","import { styled, useMediaQuery, useTheme } from '@ori-ui/mui';\nimport { useItemContext } from '../../context';\nimport { useTranslations } from '../../hooks';\nimport { NumberInnerValue } from './style';\nimport { jsxs as _jsxs, jsx as _jsx } from \"react/jsx-runtime\";\nconst NumberInnerUnit = styled('div')(({\n theme\n}) => ({\n display: 'flex',\n justifyContent: 'flex-end',\n overflow: 'hidden',\n flexFlow: 'row wrap',\n gap: theme.spacing(1),\n width: '100%'\n}));\nexport const ItemUnitPrice = () => {\n const {\n isSmall,\n itemTestId,\n quantity,\n unitPrice\n } = useItemContext();\n const {\n translations\n } = useTranslations();\n const theme = useTheme();\n const matches = useMediaQuery(theme.breakpoints.up('sm'));\n if (unitPrice && quantity > 1 && !isSmall && matches) {\n return /*#__PURE__*/_jsxs(NumberInnerUnit, {\n \"data-testid\": `${itemTestId}-unitPrice`,\n children: [/*#__PURE__*/_jsxs(NumberInnerValue, {\n variant: \"caption\",\n color: theme.palette.text.secondary,\n children: [translations.unitPrice, \":\"]\n }), /*#__PURE__*/_jsx(NumberInnerValue, {\n variant: \"caption\",\n color: theme.palette.text.secondary,\n children: unitPrice\n })]\n });\n }\n return null;\n};\n//# sourceMappingURL=ItemUnitPrice.js.map","import { isNullableStringAGreaterThanB, parseNumberFromString } from '@ori/checkout-utils';\nimport { useMemo } from 'react';\nimport { useItemContext } from '../../context';\nexport const usePriceLogic = () => {\n const {\n basicCataloguePrice,\n cataloguePrice,\n isAvailable,\n priceName,\n unitPrice\n } = useItemContext();\n const priceLogic = useMemo(() => {\n const isBrandPartner = priceName === 'cataloguePrice';\n const cataloguePriceNumber = parseNumberFromString(cataloguePrice);\n const basicCataloguePriceNumber = parseNumberFromString(basicCataloguePrice);\n const unitPriceNumber = parseNumberFromString(unitPrice);\n if (!isAvailable) {\n return {\n regularPrice: '',\n showCataloguePrice: false,\n showBasicCataloguePrice: false\n };\n }\n\n // there is different logic for brand partners and for other customers\n if (isBrandPartner) {\n const regularPrice = cataloguePrice;\n const showCataloguePrice = cataloguePriceNumber > 0;\n const showBasicCataloguePrice = isNullableStringAGreaterThanB(basicCataloguePrice, cataloguePrice);\n return {\n regularPrice,\n showCataloguePrice,\n showBasicCataloguePrice\n };\n }\n\n // 1. When BasicCataloguePrice <> CataloguePrice AND CataloguePrice = UnitPrice --> Display BasicCataloguePrice as regular price\n // 2. When BasicCataloguePrice <> CataloguePrice AND CataloguePrice <> UnitPrice --> Display CataloguePrice as regular price\n // 3. When BasicCataloguePrice = CataloguePrice --> Do not display regular price\n const showBasicCataloguePrice = false;\n const regularPrice = cataloguePriceNumber === unitPriceNumber ? basicCataloguePrice : cataloguePrice;\n const showCataloguePrice = parseNumberFromString(regularPrice) > 0 && basicCataloguePriceNumber !== cataloguePriceNumber;\n return {\n regularPrice,\n showCataloguePrice,\n showBasicCataloguePrice\n };\n }, [basicCataloguePrice, cataloguePrice, isAvailable, priceName, unitPrice]);\n return {\n priceLogic\n };\n};\n//# sourceMappingURL=usePriceLogic.js.map","import { styled, Typography, useTheme } from '@ori-ui/mui';\nimport { useItemContext } from '../../context';\nimport { useTranslations } from '../../hooks';\nimport { NumberInner, NumberInnerValue } from './style';\nimport { usePriceLogic } from './usePriceLogic';\nimport { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from \"react/jsx-runtime\";\nconst BasicCataloguePrice = styled(Typography)(({\n theme\n}) => ({\n textDecoration: 'line-through',\n whiteSpace: 'nowrap',\n display: 'flex'\n}));\nexport const ItemCataloguePrice = () => {\n const {\n basicCataloguePrice,\n itemTestId,\n priceName\n } = useItemContext();\n const {\n translations\n } = useTranslations();\n const {\n priceLogic\n } = usePriceLogic();\n const {\n regularPrice,\n showCataloguePrice,\n showBasicCataloguePrice\n } = priceLogic;\n const theme = useTheme();\n if (showCataloguePrice) {\n return /*#__PURE__*/_jsxs(NumberInner, {\n \"data-testid\": `${itemTestId}-cataloguePrice`,\n children: [/*#__PURE__*/_jsxs(_Fragment, {\n children: [/*#__PURE__*/_jsxs(NumberInnerValue, {\n variant: \"caption\",\n color: theme.palette.text.secondary,\n children: [priceName ? translations[priceName] : translations.regularPrice, \":\"]\n }), /*#__PURE__*/_jsx(NumberInnerValue, {\n variant: \"caption\",\n color: theme.palette.text.secondary,\n children: regularPrice\n })]\n }), showBasicCataloguePrice ? /*#__PURE__*/_jsx(BasicCataloguePrice, {\n variant: \"caption\",\n color: theme.palette.text.secondary,\n children: basicCataloguePrice\n }) : null]\n });\n }\n return null;\n};\n//# sourceMappingURL=ItemCataloguePrice.js.map","import { styled } from '@ori-ui/mui';\nimport { SM_COLUMN_GAP, SM_IMAGE_SIZE, SM_OUTER_PADDING } from '../constants';\nimport { useItemContext } from '../context';\nimport { ItemBpBv, ItemCataloguePrice, ItemPrice, ItemUnitPrice } from './CostBenefit';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst Numbers = styled('div')(({\n ownerState: {\n isSmall\n },\n theme\n}) => ({\n alignSelf: 'end',\n justifySelf: 'end',\n display: 'grid',\n gridTemplateColumns: 'auto',\n alignItems: 'end',\n justifyItems: 'end',\n gap: theme.spacing(1),\n width: '100%',\n ...(!isSmall && {\n [theme.breakpoints.up('sm')]: {\n maxWidth: `${theme.breakpoints.values.md - 1 - SM_IMAGE_SIZE + SM_COLUMN_GAP + 2 * SM_OUTER_PADDING}px`\n },\n [theme.breakpoints.up('md')]: {\n width: 'fit-content',\n maxWidth: 230\n }\n })\n}));\nexport const ItemCostBenefit = () => {\n const {\n isSmall\n } = useItemContext();\n return /*#__PURE__*/_jsxs(Numbers, {\n ownerState: {\n isSmall: isSmall ?? false\n },\n children: [/*#__PURE__*/_jsx(ItemBpBv, {}), /*#__PURE__*/_jsx(ItemPrice, {}), /*#__PURE__*/_jsx(ItemUnitPrice, {}), /*#__PURE__*/_jsx(ItemCataloguePrice, {})]\n });\n};\n//# sourceMappingURL=ItemCostBenefit.js.map","/* eslint-disable complexity -- many options :( */\nimport { IconButton } from '@ori-ui/components';\nimport { AddToBag, AddToBagFilled, Notification, NotificationFilled, Trashcan, TrashcanFilled } from '@ori-ui/icons';\nimport { Button, Tooltip } from '@ori-ui/mui';\nimport { FavoritesHeartIconButton } from '@ori/favorites-heart';\nimport { useItemContext } from '../../context';\nimport { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const ItemButtons = () => {\n const {\n buttons,\n code,\n itemTestId\n } = useItemContext();\n const {\n delayBackorder,\n favorites,\n notifyMe,\n postpone,\n remove,\n replace,\n repurchase,\n reserve,\n subscribe,\n unreserve\n } = buttons ?? {};\n const buttonList = [replace ? {\n ...replace,\n key: 'replace'\n } : undefined, reserve ? {\n ...reserve,\n key: 'reserve'\n } : undefined, unreserve ? {\n ...unreserve,\n key: 'unreserve'\n } : undefined, delayBackorder ? {\n ...delayBackorder,\n key: 'delayBackorder'\n } : undefined, subscribe ? {\n ...subscribe,\n key: 'subscribe'\n } : undefined, postpone ? {\n ...postpone,\n key: 'postpone'\n } : undefined];\n return /*#__PURE__*/_jsxs(_Fragment, {\n children: [remove?.visible ? /*#__PURE__*/_jsx(IconButton, {\n disabled: remove.disabled ?? false,\n \"data-testid\": `${itemTestId}-remove`,\n variant: \"contained\",\n color: \"default\",\n hoverIcon: /*#__PURE__*/_jsx(TrashcanFilled, {}),\n \"aria-label\": remove.title,\n onClick: remove.onClick ?? undefined,\n children: /*#__PURE__*/_jsx(Trashcan, {})\n }) : null, repurchase?.visible ? /*#__PURE__*/_jsx(IconButton, {\n disabled: repurchase.disabled ?? false,\n \"data-testid\": `${itemTestId}-repurchase`,\n variant: \"contained\",\n color: \"default\",\n hoverIcon: /*#__PURE__*/_jsx(AddToBagFilled, {}),\n \"aria-label\": repurchase.title,\n onClick: repurchase.onClick ?? undefined,\n children: /*#__PURE__*/_jsx(AddToBag, {})\n }) : null, favorites?.visible ? /*#__PURE__*/_jsx(FavoritesHeartIconButton, {\n disabled: favorites.disabled ?? false,\n code: code,\n size: \"medium\",\n \"aria-label\": favorites.title,\n \"data-testid\": `${itemTestId}-favorites`\n }) : null, notifyMe?.visible ? /*#__PURE__*/_jsx(IconButton, {\n disabled: notifyMe.disabled ?? false,\n \"data-testid\": `${itemTestId}-notify`,\n variant: \"contained\",\n color: \"default\",\n hoverIcon: /*#__PURE__*/_jsx(NotificationFilled, {}),\n \"aria-label\": notifyMe.title,\n onClick: notifyMe.onClick ?? undefined,\n children: /*#__PURE__*/_jsx(Notification, {})\n }) : null, buttonList.map(button => button?.visible ? button.disabled ? /*#__PURE__*/_jsx(Tooltip, {\n disableFocusListener: true,\n title: button.title,\n children: /*#__PURE__*/_jsx(\"span\", {\n children: /*#__PURE__*/_jsx(Button, {\n disabled: true,\n \"data-testid\": `${itemTestId}-${button.key}`,\n variant: \"contained\",\n color: \"primary\",\n size: \"small\",\n \"aria-label\": button.title,\n onClick: undefined,\n children: button.text\n })\n })\n }, button.key) : /*#__PURE__*/_jsx(Button, {\n \"data-testid\": `${itemTestId}-${button.key}`,\n variant: \"contained\",\n color: \"default\",\n size: \"small\",\n \"aria-label\": button.title,\n onClick: button.onClick ?? undefined,\n children: button.text\n }, button.key) : null)]\n });\n};\n//# sourceMappingURL=ItemButtons.js.map","import { QuantityPicker } from '@ori-ui/components';\nimport { styled } from '@ori-ui/mui';\nimport { useCallback, useEffect, useMemo, useState } from 'react';\nimport { BODY2_FONT_SIZE } from '../../constants';\nimport { useItemContext } from '../../context';\nimport { useTranslations } from '../../hooks';\nimport { logDebug } from '../../logger';\nimport { jsxs as _jsxs, jsx as _jsx } from \"react/jsx-runtime\";\nconst QuantityText = styled('div')(({\n theme\n}) => ({\n fontSize: BODY2_FONT_SIZE,\n alignSelf: 'center'\n}));\nexport const ItemQuantity = () => {\n const {\n code,\n isAvailable,\n isBundleItem,\n itemTestId,\n lineNumber,\n maxQuantity,\n minQuantity,\n quantity,\n quantityPickerDisabled,\n quantityPickerDelayTimer,\n onQuantityChange\n } = useItemContext();\n const {\n translations\n } = useTranslations();\n const [value, setValue] = useState(quantity);\n const [changeOrigin, setChangeOrigin] = useState(undefined);\n const [ready, setReady] = useState(false);\n const debounceTimer = useMemo(() => quantityPickerDelayTimer ?? 300, [quantityPickerDelayTimer]);\n const pickerId = `${lineNumber}`;\n const testId = `${itemTestId}-quantity`;\n const minValue = useMemo(() => typeof minQuantity === 'number' ? minQuantity < 0 ? 0 : minQuantity : 0, [minQuantity]);\n logDebug(`${lineNumber}-${code} -> ItemQuantity q:${quantity} value:${value}`);\n const handleChange = useCallback((inputValue, id, source) => {\n setValue(inputValue);\n setChangeOrigin(source);\n\n // do not trigger onQuantityChange if the input value is not a number and equal or greater than 0\n if (typeof inputValue !== 'number') {\n return;\n }\n\n // check min and max (that also checks canReduce and canDelete by inheritance)\n let currentValue = inputValue;\n if (currentValue < minValue) {\n currentValue = minValue;\n }\n if (currentValue > maxQuantity) {\n currentValue = maxQuantity;\n }\n\n // if there was no allowed change in quantity just return\n if (currentValue === quantity) {\n setValue(currentValue);\n return;\n }\n\n // there was valid update so trigger onQuantityChange with a bit of delay\n setValue(currentValue);\n setReady(true);\n }, [maxQuantity, minValue, quantity]);\n const triggerOnQuantityChange = useCallback(() => {\n if (changeOrigin && ready) {\n onQuantityChange?.(value, pickerId, changeOrigin);\n setReady(false);\n }\n }, [changeOrigin, onQuantityChange, pickerId, ready, value]);\n const handleClickAway = useCallback(event => {\n setValue(prev => typeof prev === 'number' && prev >= 0 ? prev : quantity);\n }, [quantity]);\n useEffect(() => {\n const timeoutId = setTimeout(() => {\n triggerOnQuantityChange();\n }, debounceTimer);\n return () => clearTimeout(timeoutId);\n }, [debounceTimer, ready, triggerOnQuantityChange]);\n useEffect(() => {\n logDebug(`${lineNumber}-${code} -> quantity changed: ${quantity}`);\n setValue(quantity);\n }, [code, lineNumber, quantity]);\n if (!isAvailable || isBundleItem || quantityPickerDisabled) {\n return /*#__PURE__*/_jsxs(QuantityText, {\n \"data-testid\": testId,\n children: [translations.qty, \": \", quantity]\n });\n }\n return /*#__PURE__*/_jsx(QuantityPicker, {\n id: pickerId,\n value: value,\n minValue: minValue,\n maxValue: maxQuantity,\n height: 3.6,\n DecreaseIconButtonProps: {\n 'data-testid': `${testId}-decrease`,\n 'aria-label': `- ${translations.quantity} ${code}`\n },\n IncreaseIconButtonProps: {\n 'data-testid': `${testId}-increase`,\n 'aria-label': `+ ${translations.quantity} ${code}`\n },\n InputProps: {\n inputProps: {\n 'data-testid': `${testId}-input`,\n 'aria-label': `${translations.quantity} ${code}`\n },\n type: 'tel'\n },\n onChange: handleChange,\n onClickAway: handleClickAway\n });\n};\n//# sourceMappingURL=ItemQuantity.js.map","import { styled } from '@ori-ui/mui';\nimport { useItemContext } from '../context';\nimport { logDebug } from '../logger';\nimport { ItemButtons, ItemQuantity } from './Actions';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst Actions = styled('div')(({\n ownerState: {\n isSmall\n },\n theme\n}) => ({\n gridArea: 'actions',\n boxSizing: 'content-box',\n width: '100%',\n overflow: 'hidden',\n display: 'grid',\n gridTemplateColumns: '1fr 115px',\n columnGap: theme.spacing(3),\n padding: '4px 4px 10px 5px',\n margin: '-4px -4px -10px -5px',\n ...(!isSmall && {\n [theme.breakpoints.up('md')]: {\n alignSelf: 'end'\n }\n })\n}));\nconst FirstPart = styled('div')(({\n theme\n}) => ({\n display: 'flex',\n alignItems: 'flex-start',\n alignContent: 'flex-start',\n gap: theme.spacing(3),\n flexFlow: 'row wrap'\n}));\nconst SecondPart = styled('div')(({\n theme\n}) => ({\n display: 'flex',\n justifyContent: 'flex-end'\n}));\nexport const ItemActions = () => {\n const {\n code,\n hideActionSection,\n hideQuantity,\n isBundleItem,\n isSmall,\n lineNumber,\n quantity\n } = useItemContext();\n logDebug(`${lineNumber}-${code} -> ItemActions quantity: ${quantity}`);\n if (hideActionSection) {\n return null;\n }\n return /*#__PURE__*/_jsxs(Actions, {\n ownerState: {\n isSmall: isSmall ?? false\n },\n children: [/*#__PURE__*/_jsx(FirstPart, {\n children: isBundleItem ? null : /*#__PURE__*/_jsx(ItemButtons, {})\n }), /*#__PURE__*/_jsx(SecondPart, {\n children: hideQuantity ? null : /*#__PURE__*/_jsx(ItemQuantity, {})\n })]\n });\n};\n//# sourceMappingURL=ItemActions.js.map","export * from './defaultTranslations';\nexport * from './sizes';\nexport const BASKET_ITEM_IDENTIFIER = 'basket-item-identifier';\n//# sourceMappingURL=index.js.map","import { styled } from '@ori-ui/mui';\nimport { BASKET_ITEM_IDENTIFIER, MD_COLUMN_GAP, MD_IMAGE_SIZE, XS_COLUMN_GAP, XS_IMAGE_SIZE } from '../constants';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst Root = styled('div')(({\n ownerState: {\n isBundle,\n isBundleItem,\n isSmall\n },\n theme\n}) => ({\n boxSizing: 'content-box',\n width: '100%',\n overflow: 'hidden',\n display: 'grid',\n gridTemplateColumns: `${XS_IMAGE_SIZE}px auto`,\n padding: theme.spacing(4, 1),\n margin: theme.spacing(0, -1),\n gridTemplateRows: 'auto auto auto',\n gridTemplateAreas: `\n 'image product'\n 'image numbers'\n 'actions actions'`,\n ...(isBundleItem && {\n gridTemplateRows: 'auto auto',\n gridTemplateAreas: `\n 'image product'\n 'image actions'`\n }),\n ...(isBundle && {\n gridTemplateRows: 'auto auto auto auto',\n gridTemplateAreas: `\n 'image product'\n 'image numbers'\n 'actions actions'\n 'bundle bundle'`\n }),\n columnGap: XS_COLUMN_GAP,\n rowGap: theme.spacing(3),\n ...(!isSmall && {\n [theme.breakpoints.up('sm')]: {\n maxWidth: '100%'\n },\n [theme.breakpoints.up('md')]: {\n maxWidth: '100%',\n gridTemplateColumns: `${MD_IMAGE_SIZE}px auto minmax(200px, max-content)`,\n gridTemplateRows: 'auto auto',\n gridTemplateAreas: `\n 'image product numbers'\n 'image actions actions'`,\n ...(isBundle && {\n gridTemplateRows: 'auto auto auto',\n gridTemplateAreas: `\n 'image product numbers'\n 'image actions actions'\n 'bundle bundle bundle'`\n }),\n columnGap: MD_COLUMN_GAP\n }\n })\n}));\nexport const BasketItemRoot = ({\n children,\n isBundle,\n isBundleItem,\n itemTestId,\n isSmall\n}) => /*#__PURE__*/_jsx(Root, {\n \"data-testid\": itemTestId,\n ownerState: {\n isBundle,\n isBundleItem,\n isSmall: isSmall ?? false\n },\n className: BASKET_ITEM_IDENTIFIER,\n children: children\n});\n//# sourceMappingURL=BasketItemRoot.js.map","import { styled } from '@ori-ui/mui';\nimport { BASKET_ITEM_IDENTIFIER } from '../constants';\nexport const Separator = styled('div')(({\n theme\n}) => ({\n display: 'none',\n boxSizing: 'border-box',\n overflow: 'hidden',\n height: 1,\n width: '100%',\n background: theme.palette.grey[200],\n [`&:has(+ .${BASKET_ITEM_IDENTIFIER})`]: {\n display: 'block'\n }\n}));\n//# sourceMappingURL=styles.js.map","import { ArrowDownThin, ArrowUpThin } from '@ori-ui/icons';\nimport { Collapse, styled } from '@ori-ui/mui';\nimport { useCallback, useState } from 'react';\nimport { ItemActions, ItemDescription, ItemImage } from '../components';\nimport { ItemProvider, useItemContext } from '../context';\nimport { useTranslations } from '../hooks';\nimport { BasketItemRoot } from './BasketItemRoot';\nimport { Separator } from './styles';\nimport { jsxs as _jsxs, jsx as _jsx } from \"react/jsx-runtime\";\nconst BundleWrapper = styled('div')(({\n theme\n}) => ({\n gridArea: 'bundle',\n padding: 0,\n width: '100%'\n}));\nconst CollapseTrigger = styled('div')(({\n theme\n}) => ({\n display: 'inline-grid',\n gridTemplateColumns: 'auto 24px',\n gap: theme.spacing(1),\n alignItems: 'center',\n padding: theme.spacing(1, 0),\n width: 'max-content',\n textAlign: 'left',\n border: 'none',\n background: 'none',\n cursor: 'pointer',\n color: theme.palette.text.primary,\n fontSize: theme.typography.body1.fontSize,\n lineHeight: theme.typography.body1.lineHeight,\n '&:focus': {\n outline: 'none'\n }\n}));\nexport const InnerBasketItemBundle = () => {\n const {\n bundleItems,\n isSmall\n } = useItemContext();\n const {\n translations\n } = useTranslations();\n const [expanded, setExpanded] = useState(false);\n const handleExpandClick = useCallback(() => {\n setExpanded(!expanded);\n }, [expanded]);\n const bundleData = bundleItems?.map(data => ({\n ...data,\n itemTestId: `${data.testId}-item-${data.code}-${data.type}`,\n basicCataloguePrice: undefined,\n cataloguePrice: undefined,\n points: undefined,\n showBp: false,\n totalPrice: '',\n unitPrice: undefined,\n quantityPickerDisabled: true,\n isBundle: false,\n isBundleItem: true,\n isSmall\n }));\n return /*#__PURE__*/_jsxs(BundleWrapper, {\n children: [/*#__PURE__*/_jsxs(CollapseTrigger, {\n role: \"button\",\n tabIndex: 0,\n \"aria-expanded\": expanded,\n \"aria-label\": translations.whatsInside,\n onClick: handleExpandClick,\n children: [/*#__PURE__*/_jsxs(\"span\", {\n children: [translations.whatsInside, \" (\", bundleItems?.length, \")\"]\n }), expanded ? /*#__PURE__*/_jsx(ArrowUpThin, {\n fontSize: \"medium\"\n }) : /*#__PURE__*/_jsx(ArrowDownThin, {\n fontSize: \"medium\"\n })]\n }), /*#__PURE__*/_jsx(Collapse, {\n unmountOnExit: true,\n in: expanded,\n timeout: \"auto\",\n children: bundleData?.map(itemData => /*#__PURE__*/_jsxs(ItemProvider, {\n value: itemData,\n children: [/*#__PURE__*/_jsxs(BasketItemRoot, {\n itemTestId: itemData.itemTestId,\n isBundle: false,\n isBundleItem: itemData.isBundleItem,\n isSmall: itemData.isSmall,\n children: [/*#__PURE__*/_jsx(ItemImage, {}), /*#__PURE__*/_jsx(ItemDescription, {}), /*#__PURE__*/_jsx(ItemActions, {})]\n }), /*#__PURE__*/_jsx(Separator, {})]\n }, itemData.itemTestId))\n })]\n });\n};\n//# sourceMappingURL=InnerBasketItemBundle.js.map","import { ItemActions, ItemCostBenefit, ItemDescription, ItemImage } from '../components';\nimport { ItemProvider } from '../context';\nimport { BasketItemRoot } from './BasketItemRoot';\nimport { InnerBasketItemBundle } from './InnerBasketItemBundle';\nimport { Separator } from './styles';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const InnerBasketItem = ({\n data\n}) => {\n const {\n itemTestId,\n isBundle,\n isSmall\n } = data;\n return /*#__PURE__*/_jsxs(ItemProvider, {\n value: data,\n children: [/*#__PURE__*/_jsxs(BasketItemRoot, {\n itemTestId: itemTestId,\n isBundle: isBundle,\n isBundleItem: false,\n isSmall: isSmall,\n children: [/*#__PURE__*/_jsx(ItemImage, {}), /*#__PURE__*/_jsx(ItemDescription, {}), /*#__PURE__*/_jsx(ItemCostBenefit, {}), /*#__PURE__*/_jsx(ItemActions, {}), isBundle ? /*#__PURE__*/_jsx(InnerBasketItemBundle, {}) : null]\n }), /*#__PURE__*/_jsx(Separator, {})]\n });\n};\n//# sourceMappingURL=InnerBasketItem.js.map","import { TranslationsNamespaceProvider, TranslationsProvider, useLanguage } from '@ori/i18n';\nimport { ErrorBoundary, LoggerProvider } from '@ori/logger';\nimport { useMemo } from 'react';\nimport { defaultTranslations } from '../constants';\nimport { APP_NAME } from '../constants-generated';\nimport { logDebug, mainLogger } from '../logger';\nimport { InnerBasketItem } from './InnerBasketItem';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst BasketItem = ({\n translations,\n translationsNamespace,\n ...props\n}) => {\n const {\n language\n } = useLanguage();\n const mergedTranslations = useMemo(() => ({\n ...defaultTranslations,\n ...translations\n }), [translations]);\n const {\n code,\n bundleItems,\n lineNumber,\n testId,\n type\n } = props;\n const isBundle = Boolean(bundleItems && bundleItems.length > 0);\n const renderedItemType = isBundle ? 'bundle' : 'item';\n const itemTestId = `${testId}-${renderedItemType}-${code}-${type}`;\n const contextData = {\n ...props,\n itemTestId,\n isBundle,\n isBundleItem: false\n };\n logDebug(`${lineNumber}-${code} context: `, contextData);\n return /*#__PURE__*/_jsx(LoggerProvider, {\n logger: mainLogger,\n children: /*#__PURE__*/_jsx(ErrorBoundary, {\n areaName: `${APP_NAME}-boundary`,\n children: /*#__PURE__*/_jsx(TranslationsProvider, {\n defaultTranslationsWithNamespaces: {\n [translationsNamespace]: defaultTranslations\n },\n language: language || 'en-GB',\n translationsWithNamespaces: {\n [translationsNamespace]: mergedTranslations\n },\n children: /*#__PURE__*/_jsx(TranslationsNamespaceProvider, {\n namespace: translationsNamespace,\n children: /*#__PURE__*/_jsx(InnerBasketItem, {\n data: contextData\n })\n })\n })\n })\n });\n};\nexport default BasketItem;\n//# sourceMappingURL=BasketItem.js.map","import { styled, Typography } from '@ori-ui/mui';\nimport { isNonNullable } from '@ori/ts-utils';\nimport { MD_OUTER_PADDING, SM_OUTER_PADDING, SMALL_SECTION_WIDTH, XS_OUTER_PADDING } from '../constants';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst Section = styled('div')(({\n ownerState: {\n isSmall,\n mdMaxWidth\n },\n theme\n}) => ({\n boxSizing: 'border-box',\n overflow: 'hidden',\n width: '100%',\n margin: 0,\n padding: `0 ${XS_OUTER_PADDING}px`,\n background: theme.palette.background.paper,\n ...(isSmall && {\n maxWidth: SMALL_SECTION_WIDTH\n }),\n ...(!isSmall && {\n [theme.breakpoints.up('sm')]: {\n padding: `0 ${SM_OUTER_PADDING}px`,\n margin: '0 auto',\n borderRadius: theme.shape.largeComponentRadius,\n maxWidth: `${theme.breakpoints.values.md - 1 - 2 * SM_OUTER_PADDING}px`\n },\n [theme.breakpoints.up('md')]: {\n padding: `0 ${MD_OUTER_PADDING}px`,\n maxWidth: mdMaxWidth\n }\n })\n}));\nconst SectionHeader = styled(Typography)(({\n theme\n}) => ({\n padding: theme.spacing(7, 0, 0, 0)\n}));\nexport const SubSectionHeader = styled(Typography)(({\n theme\n}) => ({\n padding: theme.spacing(3, 0, 0, 0),\n fontWeight: 'bold'\n}));\nexport const BasketSection = ({\n children,\n isSmall,\n overrideMdMaxWidth,\n testId,\n title\n}) => /*#__PURE__*/_jsxs(Section, {\n \"data-testid\": testId ?? 'basket-section',\n ownerState: {\n isSmall: isSmall ?? false,\n mdMaxWidth: overrideMdMaxWidth ?? '100%'\n },\n children: [isNonNullable(title) ? /*#__PURE__*/_jsx(SectionHeader, {\n variant: \"h6\",\n children: title\n }) : null, children]\n});\n//# sourceMappingURL=BasketSection.js.map","import { generateUtilityClass, generateUtilityClasses } from '@ori-ui/mui';\nexport function getActionBannerUtilityClass(slot) {\n return generateUtilityClass('ActionBanner', slot);\n}\nconst actionBannerClasses = generateUtilityClasses('ActionBanner', ['root', 'content', 'contentHover', 'focusVisible', 'disabled']);\nexport default actionBannerClasses;\n//# sourceMappingURL=actionBannerClasses.js.map","import { rootShouldForwardProp } from '@ori-ui/components';\nimport { ArrowRightThin, DiscountTagFilled } from '@ori-ui/icons';\nimport * as Icons from '@ori-ui/icons';\nimport { styled, useThemeProps, unstable_composeClasses as composeClasses, ButtonBase, alpha } from '@ori-ui/mui';\nimport clsx from 'clsx';\nimport { forwardRef, useCallback, useMemo, useState } from 'react';\nimport InfoIcon from '../InfoIcon';\nimport actionBannerClasses, { getActionBannerUtilityClass } from './actionBannerClasses';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const getActionBannerSlots = ownerState => {\n const {\n disabled,\n isHovering\n } = ownerState;\n return {\n root: ['root', disabled && 'disabled'],\n content: ['content', isHovering && 'contentHover']\n };\n};\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = getActionBannerSlots(ownerState);\n const composedClasses = composeClasses(slots, getActionBannerUtilityClass, classes);\n return {\n ...classes,\n ...composedClasses\n };\n};\nconst ActionBannerRoot = styled(ButtonBase, {\n name: 'ActionBanner',\n slot: 'Root',\n overridesResolver: ({\n ownerState\n }, styles) => [styles.root, ownerState.disabled && styles.disabled],\n shouldForwardProp: prop => rootShouldForwardProp(prop) || prop === 'classes'\n})(({\n theme,\n ownerState\n}) => ({\n display: 'grid',\n gridTemplateColumns: '35px 1fr 24px',\n gap: 10,\n alignItems: 'center',\n padding: theme.spacing(4, 3),\n borderRadius: theme.shape.largeComponentRadius,\n background: theme.palette.common.white,\n color: theme.palette.text.primary,\n fontSize: theme.typography.body1.fontSize,\n border: '1px solid transparent',\n transition: theme.transitions.create(['background-color', 'box-shadow', 'border-color', 'color'], {\n duration: theme.transitions.duration.short\n }),\n [theme.breakpoints.up('sm')]: {\n padding: theme.spacing(4, 6)\n },\n ...(ownerState.showBorder && {\n border: `1px solid ${theme.palette.grey[200]}`\n }),\n '&:hover': {\n backgroundColor: alpha(theme.palette.default.main, theme.palette.action.hoverOpacity),\n color: theme.palette.text.primary,\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n backgroundColor: 'transparent'\n }\n },\n '&:active': {\n boxShadow: 'none'\n },\n [`&.${actionBannerClasses.disabled}`]: {\n color: theme.palette.action.disabled\n },\n [`&.${actionBannerClasses.focusVisible}`]: {\n borderRadius: theme.shape.largeComponentRadius,\n outline: `2px solid ${theme.palette.default.dark}`,\n outlineOffset: -2\n }\n}));\nconst ActionBannerContent = styled('span', {\n name: 'ActionBanner',\n slot: 'Content',\n overridesResolver: ({\n ownerState\n }, styles) => [styles.content, ownerState.isHovering && styles.contentHover]\n})(({\n theme,\n ownerState\n}) => ({\n display: 'block',\n overflow: 'hidden',\n textAlign: 'left',\n color: theme.palette.text.primary,\n transition: theme.transitions.create(['background-color', 'box-shadow', 'border-color', 'color'], {\n duration: theme.transitions.duration.short\n }),\n ...(ownerState.disabled && {\n color: theme.palette.action.disabled\n }),\n ...(ownerState.isHovering && {\n color: theme.palette.text.primary,\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n backgroundColor: 'transparent'\n }\n })\n}));\nexport const ActionBanner = /*#__PURE__*/forwardRef((inProps, ref) => {\n const props = useThemeProps({\n props: inProps,\n name: 'ActionBanner'\n });\n const {\n children,\n className,\n disabled = false,\n disableFocusRipple = false,\n iconName,\n showBorder = false,\n ...other\n } = props;\n const [isHovering, setIsHovering] = useState(false);\n const handleMouseOver = useCallback(() => {\n setIsHovering(true);\n }, []);\n const handleMouseOut = useCallback(() => {\n setIsHovering(false);\n }, []);\n const ownerState = {\n ...props,\n disabled,\n isHovering,\n showBorder\n };\n const infoIcon = useMemo(() => {\n if (typeof iconName === 'string') {\n const IconComponent = Icons[iconName];\n if (IconComponent) {\n return /*#__PURE__*/_jsx(IconComponent, {\n fontSize: \"inherit\"\n });\n }\n }\n return /*#__PURE__*/_jsx(DiscountTagFilled, {\n fontSize: \"inherit\"\n });\n }, [iconName]);\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsxs(ActionBannerRoot, {\n ref: ref,\n centerRipple: true,\n className: clsx(classes.root, className),\n focusRipple: !disableFocusRipple,\n disabled: disabled,\n ownerState: ownerState,\n onMouseOver: handleMouseOver,\n onMouseOut: handleMouseOut,\n ...other,\n children: [/*#__PURE__*/_jsx(InfoIcon, {\n children: infoIcon\n }), /*#__PURE__*/_jsx(ActionBannerContent, {\n ownerState: ownerState,\n className: clsx(classes.content, isHovering && classes.contentHover),\n children: children\n }), /*#__PURE__*/_jsx(ArrowRightThin, {\n fontSize: \"medium\"\n })]\n });\n});\nexport default ActionBanner;\n//# sourceMappingURL=ActionBanner.js.map","// default values\nexport const SIZE = 'medium';\nexport const BACKGROUND = undefined;\nexport const OPACITY = 1;\nexport const LOADING = 'lazy';\nexport const COMPONENT = 'span';\n// sizes\nexport const SMALL = {\n sm: 38,\n md: 38\n};\nexport const SMALL_FONT_SIZE = {\n sm: '2.8',\n md: '2.8'\n};\nexport const MEDIUM = {\n sm: 90,\n md: 90\n};\nexport const MEDIUM_FONT_SIZE = {\n sm: '5.5',\n md: '5.5'\n};\nexport const LARGE = {\n sm: 160,\n md: 160\n};\nexport const LARGE_FONT_SIZE = {\n sm: '10.5',\n md: '10.5'\n};\nexport const BASKETITEM = {\n sm: 120,\n md: 150\n};\nexport const BASKETITEM_FONT_SIZE = {\n sm: '7.5',\n md: '9.5'\n};\nexport const WIDTH = '100%';\nexport const HEIGHT = '100%';\n// surprise stuff\nexport const SURPRISE_LINK = 'https://media-we-cdn.oriflame.com/contentImage?externalMediaId=1ad93e51-63b6-47e0-a74a-4f0c222faf2a&name=surprise_gift&inputFormat=png';\nexport const SURPRISE_LINK_SNIPPET = '/images/surprise.jpg';\n//# sourceMappingURL=constants.js.map","export let CheckoutSrcOptions = /*#__PURE__*/function (CheckoutSrcOptions) {\n CheckoutSrcOptions[\"noImage\"] = \"noImage\";\n CheckoutSrcOptions[\"surprise\"] = \"surprise\";\n return CheckoutSrcOptions;\n}({});\n//# sourceMappingURL=checkoutImageTypes.js.map","import { useMemo } from 'react';\nimport { CheckoutSrcOptions } from './checkoutImageTypes';\nimport { BACKGROUND, SIZE, SURPRISE_LINK, SURPRISE_LINK_SNIPPET, SMALL_FONT_SIZE, LARGE_FONT_SIZE, MEDIUM_FONT_SIZE, LARGE, MEDIUM, SMALL, BASKETITEM, BASKETITEM_FONT_SIZE } from './constants';\nfunction getSizeConstants(size) {\n switch (size) {\n case 'small':\n return {\n sizeValue: SMALL,\n fontSizeValue: SMALL_FONT_SIZE\n };\n case 'large':\n return {\n sizeValue: LARGE,\n fontSizeValue: LARGE_FONT_SIZE\n };\n case 'basketItem':\n return {\n sizeValue: BASKETITEM,\n fontSizeValue: BASKETITEM_FONT_SIZE\n };\n case 'basketItemSmall':\n return {\n sizeValue: BASKETITEM,\n fontSizeValue: BASKETITEM_FONT_SIZE\n };\n default:\n return {\n sizeValue: MEDIUM,\n fontSizeValue: MEDIUM_FONT_SIZE\n };\n }\n}\nexport const useCheckoutImage = data => {\n const {\n src,\n background = BACKGROUND,\n size = SIZE\n } = data;\n const sizeObject = useMemo(() => getSizeConstants(size), [size]);\n const sizeValue = useMemo(() => sizeObject.sizeValue, [sizeObject]);\n const fontSizeValue = useMemo(() => sizeObject.fontSizeValue, [sizeObject]);\n const backgroundColor = background;\n let urlSrc = src;\n if (src === CheckoutSrcOptions.noImage) {\n return {\n imageSrc: 'missing',\n sizeValue,\n backgroundColor,\n fontSizeValue\n };\n }\n // sorting up the surprise image\n if (src === CheckoutSrcOptions.surprise || src.toLocaleLowerCase().includes(SURPRISE_LINK_SNIPPET)) {\n urlSrc = SURPRISE_LINK;\n }\n const sizeParams = `&w=${sizeValue.md * 3}&h=${sizeValue.md * 3}`;\n const url = new URL(urlSrc);\n const params = url.searchParams;\n const baseParams = params.get('externalMediaId');\n // additional params\n const paramNames = ['version', 'name', 'id'];\n let additionalParams = '';\n paramNames.forEach(paramName => {\n const paramValue = params.get(paramName);\n if (paramValue) {\n additionalParams += `&${paramName}=${paramValue}`;\n }\n });\n additionalParams += '&q=90&inputFormat=WebP';\n const baseImageSrc = `${url.origin}${url.pathname}?externalMediaId=${baseParams}${additionalParams}${sizeParams}`;\n const imageSrc = backgroundColor ? encodeURI(`${baseImageSrc}&ib=${encodeURIComponent(backgroundColor)}`) : encodeURI(baseImageSrc);\n return {\n imageSrc,\n sizeValue,\n backgroundColor,\n fontSizeValue\n };\n};\n//# sourceMappingURL=useCheckoutImage.js.map","import { LazyImage, lazyImageClasses } from '@ori-ui/components';\nimport { Products } from '@ori-ui/icons';\nimport { Skeleton, styled, useThemeProps } from '@ori-ui/mui';\nimport { forwardRef } from 'react';\nimport { BACKGROUND, COMPONENT, HEIGHT, LOADING, OPACITY, SIZE, WIDTH } from './constants';\nimport { useCheckoutImage } from './useCheckoutImage';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst CheckoutImageRoot = styled(LazyImage)(({\n ownerState,\n theme\n}) => ({\n display: 'inline-grid',\n justifyItems: 'center',\n alignItems: 'center',\n backgroundColor: ownerState.background,\n color: theme.palette.grey[300],\n opacity: ownerState.opacity,\n fontSize: `${ownerState.fontSize.sm}rem`,\n height: ownerState.ignoreContainerSize ? ownerState.size.sm : ownerState.height,\n width: ownerState.ignoreContainerSize ? ownerState.size.sm : ownerState.width,\n [`& .${lazyImageClasses.image}`]: {\n maxHeight: ownerState.size.sm,\n maxWidth: ownerState.size.sm\n },\n ...(!ownerState.isBasketItemSmall && {\n [theme.breakpoints.up('md')]: {\n fontSize: `${ownerState.fontSize.md}rem`,\n height: ownerState.ignoreContainerSize ? ownerState.size.md : ownerState.height,\n width: ownerState.ignoreContainerSize ? ownerState.size.md : ownerState.width,\n [`& .${lazyImageClasses.image}`]: {\n maxHeight: ownerState.size.md,\n maxWidth: ownerState.size.md\n }\n }\n })\n}));\nconst NoImageRoot = styled('span')(({\n ownerState,\n theme\n}) => ({\n display: 'inline-grid',\n justifyItems: 'center',\n alignItems: 'center',\n backgroundColor: ownerState.background,\n color: theme.palette.grey[300],\n opacity: ownerState.opacity,\n fontSize: `${ownerState.fontSize.sm}rem`,\n height: ownerState.ignoreContainerSize ? ownerState.size.sm : ownerState.height,\n width: ownerState.ignoreContainerSize ? ownerState.size.sm : ownerState.width,\n ...(!ownerState.isBasketItemSmall && {\n [theme.breakpoints.up('md')]: {\n fontSize: `${ownerState.fontSize.md}rem`,\n height: ownerState.ignoreContainerSize ? ownerState.size.md : ownerState.height,\n width: ownerState.ignoreContainerSize ? ownerState.size.md : ownerState.width\n }\n })\n}));\nconst SkeletonRoot = styled(Skeleton)(({\n ownerState,\n theme\n}) => ({\n height: ownerState.ignoreContainerSize ? ownerState.size.sm : ownerState.height,\n width: ownerState.ignoreContainerSize ? ownerState.size.sm : ownerState.width,\n ...(!ownerState.isBasketItemSmall && {\n [theme.breakpoints.up('md')]: {\n height: ownerState.ignoreContainerSize ? ownerState.size.md : ownerState.height,\n width: ownerState.ignoreContainerSize ? ownerState.size.md : ownerState.width\n }\n })\n}));\nexport const CheckoutImage = /*#__PURE__*/forwardRef((inProps, ref) => {\n const props = useThemeProps({\n props: inProps,\n name: 'CheckoutImage'\n });\n const {\n alt,\n testId,\n component = COMPONENT,\n loading = LOADING,\n src,\n size = SIZE,\n background = BACKGROUND,\n opacity = OPACITY,\n width = WIDTH,\n height = HEIGHT,\n ...otherProps\n } = props;\n const {\n imageSrc,\n sizeValue,\n backgroundColor,\n fontSizeValue\n } = useCheckoutImage({\n src,\n size,\n background\n });\n const ownerState = {\n size: sizeValue,\n background: backgroundColor,\n opacity,\n fontSize: fontSizeValue,\n width,\n height,\n ignoreContainerSize: size === 'basketItem' || size === 'basketItemSmall',\n isBasketItemSmall: size === 'basketItemSmall'\n };\n const testIdValue = testId ? imageSrc === 'missing' ? `${testId}-missing` : testId : undefined;\n const fallbackComponent = /*#__PURE__*/_jsx(SkeletonRoot, {\n variant: \"rectangular\",\n animation: \"wave\",\n ownerState: ownerState\n });\n if (imageSrc === 'missing') {\n return /*#__PURE__*/_jsx(NoImageRoot, {\n as: component,\n ownerState: ownerState,\n \"data-testid\": testIdValue,\n ...otherProps,\n children: /*#__PURE__*/_jsx(Products, {\n fontSize: \"inherit\"\n })\n });\n }\n return /*#__PURE__*/_jsx(CheckoutImageRoot, {\n component: component,\n loading: loading,\n ownerState: ownerState,\n src: decodeURI(imageSrc),\n alt: alt,\n \"data-testid\": testIdValue,\n errorFallback: /*#__PURE__*/_jsx(Products, {\n fontSize: \"inherit\"\n }),\n fallback: fallbackComponent,\n ...otherProps\n });\n});\nexport default CheckoutImage;\n//# sourceMappingURL=CheckoutImage.js.map","import { generateUtilityClass, generateUtilityClasses } from '@ori-ui/mui';\nexport function getInfoBannerUtilityClass(slot) {\n return generateUtilityClass('InfoBanner', slot);\n}\nconst infoBannerClasses = generateUtilityClasses('InfoBanner', ['root', 'content']);\nexport default infoBannerClasses;\n//# sourceMappingURL=infoBannerClasses.js.map","import { rootShouldForwardProp } from '@ori-ui/components';\nimport { DiscountTagFilled } from '@ori-ui/icons';\nimport * as Icons from '@ori-ui/icons';\nimport { styled, useThemeProps, unstable_composeClasses as composeClasses } from '@ori-ui/mui';\nimport clsx from 'clsx';\nimport { forwardRef, useMemo } from 'react';\nimport InfoIcon from '../InfoIcon';\nimport { getInfoBannerUtilityClass } from './infoBannerClasses';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const getInfoBannerSlots = ownerState => ({\n root: ['root'],\n content: ['content']\n});\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = getInfoBannerSlots(ownerState);\n const composedClasses = composeClasses(slots, getInfoBannerUtilityClass, classes);\n return {\n ...classes,\n ...composedClasses\n };\n};\nconst InfoBannerRoot = styled('div', {\n name: 'InfoBanner',\n slot: 'Root',\n overridesResolver: ({\n ownerState\n }, styles) => [styles.root],\n shouldForwardProp: prop => rootShouldForwardProp(prop) || prop === 'classes'\n})(({\n theme,\n ownerState\n}) => ({\n display: 'grid',\n gridTemplateColumns: '35px 1fr',\n gap: 10,\n alignItems: 'start',\n padding: theme.spacing(4, 3),\n borderRadius: theme.shape.largeComponentRadius,\n background: theme.palette.common.white,\n color: theme.palette.text.primary,\n border: '1px solid transparent',\n fontSize: theme.typography.body1.fontSize,\n [theme.breakpoints.up('sm')]: {\n padding: theme.spacing(4, 6)\n },\n ...(ownerState.showBorder && {\n border: `1px solid ${theme.palette.grey[200]}`\n })\n}));\nconst InfoBannerContent = styled('span', {\n name: 'InfoBanner',\n slot: 'Content',\n overridesResolver: ({\n ownerState\n }, styles) => [styles.content]\n})(({\n theme,\n ownerState\n}) => ({\n display: 'block',\n overflow: 'hidden',\n textAlign: 'left',\n color: theme.palette.text.primary\n}));\nexport const InfoBanner = /*#__PURE__*/forwardRef((inProps, ref) => {\n const props = useThemeProps({\n props: inProps,\n name: 'InfoBanner'\n });\n const {\n children,\n className,\n iconName,\n component = 'div',\n showBorder = false,\n ...other\n } = props;\n const ownerState = {\n ...props,\n showBorder\n };\n const infoIcon = useMemo(() => {\n if (typeof iconName === 'string') {\n const IconComponent = Icons[iconName];\n if (IconComponent) {\n return /*#__PURE__*/_jsx(IconComponent, {\n fontSize: \"inherit\"\n });\n }\n }\n return /*#__PURE__*/_jsx(DiscountTagFilled, {\n fontSize: \"inherit\"\n });\n }, [iconName]);\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsxs(InfoBannerRoot, {\n ref: ref,\n className: clsx(classes.root, className),\n ownerState: ownerState,\n as: component,\n ...other,\n children: [/*#__PURE__*/_jsx(InfoIcon, {\n children: infoIcon\n }), /*#__PURE__*/_jsx(InfoBannerContent, {\n ownerState: ownerState,\n className: classes.content,\n children: children\n })]\n });\n});\nexport default InfoBanner;\n//# sourceMappingURL=InfoBanner.js.map","import { generateUtilityClass, generateUtilityClasses } from '@ori-ui/mui';\nexport function getInfoIconUtilityClass(slot) {\n return generateUtilityClass('InfoIcon', slot);\n}\nconst infoIconClasses = generateUtilityClasses('InfoIcon', ['root', 'autoResize', 'contentIcon', 'contentText', 'contentAutoResize']);\nexport default infoIconClasses;\n//# sourceMappingURL=infoIconClasses.js.map","import { styled, useThemeProps, unstable_composeClasses as composeClasses } from '@ori-ui/mui';\nimport clsx from 'clsx';\nimport { forwardRef } from 'react';\nimport { getInfoIconUtilityClass } from './infoIconClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const getInfoIconSlots = ownerState => {\n const {\n autoResize,\n isText\n } = ownerState;\n return {\n root: ['root', autoResize && 'autoResize'],\n content: ['content', isText ? 'contentText' : 'contentIcon', autoResize && 'contentAutoResize']\n };\n};\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = getInfoIconSlots(ownerState);\n const composedClasses = composeClasses(slots, getInfoIconUtilityClass, classes);\n return composedClasses;\n};\nconst InfoIconRoot = styled('span', {\n name: 'InfoIcon',\n slot: 'Root',\n overridesResolver: ({\n ownerState\n }, styles) => [styles.root, ownerState.autoResize && styles.autoResize]\n})(({\n theme,\n ownerState\n}) => ({\n display: 'grid',\n boxSizing: 'border-box',\n alignContent: 'center',\n alignItems: 'center',\n justifyContent: 'center',\n justifyItems: 'center',\n overflow: 'hidden',\n borderRadius: '50%',\n textDecoration: 'none',\n fontWeight: 'normal',\n width: '3.5rem',\n height: '3.5rem',\n background: theme.palette.offer.light,\n color: theme.palette.offer.main,\n ...(ownerState.autoResize && {\n [theme.breakpoints.up('sm')]: {\n width: '4.5rem',\n height: '4.5rem'\n }\n })\n}));\nconst InfoIconContent = styled('span', {\n name: 'InfoIcon',\n slot: 'Content',\n overridesResolver: ({\n ownerState\n }, styles) => [styles.content, ownerState.isText ? styles.contentText : styles.contentIcon, ownerState.autoResize && styles.contentAutoResize]\n})(({\n theme,\n ownerState\n}) => ({\n display: 'block',\n overflow: 'hidden',\n lineHeight: 1,\n color: theme.palette.offer.main,\n fontSize: '2.4rem',\n ...(ownerState.isText && {\n textAlign: 'center',\n fontSize: '1rem',\n lineHeight: 1.4\n }),\n ...(ownerState.autoResize && {\n [theme.breakpoints.up('sm')]: {\n fontSize: '3.4rem',\n ...(ownerState.isText && {\n fontSize: '1.2rem'\n })\n }\n })\n}));\nexport const InfoIcon = /*#__PURE__*/forwardRef((inProps, ref) => {\n const props = useThemeProps({\n props: inProps,\n name: 'InfoIcon'\n });\n const {\n autoResize = false,\n children,\n className,\n isText = false,\n ...other\n } = props;\n const ownerState = {\n ...props,\n autoResize,\n isText\n };\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsx(InfoIconRoot, {\n ref: ref,\n ownerState: ownerState,\n className: clsx(classes.root, className),\n ...other,\n children: /*#__PURE__*/_jsx(InfoIconContent, {\n ownerState: ownerState,\n className: classes.content,\n children: children\n })\n });\n});\nexport default InfoIcon;\n//# sourceMappingURL=InfoIcon.js.map","import { stringEmptyToUndefined } from './stringEmptyToUndefined';\n\n/**\n * Takes only number chars from string and convert it to number. If there is no number in string, it will return 0.\n * It will return only positive number.\n * @param value string | null | undefined\n * @returns number\n */\nexport function parseNumberFromString(value) {\n const checkedValue = stringEmptyToUndefined(value);\n if (checkedValue === undefined) {\n return 0;\n }\n const numberValue = Number.parseFloat(checkedValue.replaceAll(/\\D/g, ''));\n return Number.isNaN(numberValue) ? 0 : numberValue;\n}\n\n/**\n * Convert strings to numbers and compare them.\n * It will compare only if both numbers are 0 or greater than 0.\n * @param a string | null | undefined\n * @param b string | null | undefined\n * @returns boolean\n */\nexport function isNullableStringAGreaterThanB(a, b) {\n const first = parseNumberFromString(a);\n const second = parseNumberFromString(b);\n if (first >= 0 && second >= 0) {\n return first > second;\n }\n\n // if any of strings result in 0, we consider it as false because there is no data to compare\n return false;\n}\n//# sourceMappingURL=stringAsNumber.js.map","export function stringEmptyToUndefined(value) {\n if (value === undefined || value === null) {\n return undefined;\n }\n if (value === '' || value.trim() === '') {\n return undefined;\n }\n return value;\n}\n//# sourceMappingURL=stringEmptyToUndefined.js.map","import { CarouselSlide, Carousel } from '@ori/presentation-components';\nimport { useAreFavoritesEnabled, useIsMobile } from '@ori/presentation-hooks';\nimport { ProductBox, ProductBoxMode, ProductBoxSkeleton } from '@ori/product-box';\nimport useTestId from '@ori/testid-generator';\nimport times from 'lodash.times';\nimport { DEFAULT_PRODUCT_BOX_SKELETON_COUNT, PRODUCT_BOX_CAROUSEL } from '../../constants';\nimport { getSliderOptions, sortProductBoxesByAvailability } from '../../utils';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const ProductBoxCarousel = ({\n analyticsPlacement,\n classNames,\n customerId,\n data,\n hideRating,\n id,\n loading,\n mrpStatementEnabled,\n showSkeletonIfEmpty,\n slider,\n tenant,\n translations,\n withTranslationsProvider,\n mode = ProductBoxMode.Concept\n}) => {\n const {\n getTestId\n } = useTestId();\n const areFavoritesEnabled = useAreFavoritesEnabled({\n customerId\n });\n const isMobile = useIsMobile();\n if (data.length < 1 && !loading && !showSkeletonIfEmpty) {\n return null;\n }\n const sortedData = sortProductBoxesByAvailability(data);\n return /*#__PURE__*/_jsx(\"div\", {\n className: classNames?.root,\n \"data-testid\": getTestId(PRODUCT_BOX_CAROUSEL),\n children: /*#__PURE__*/_jsx(Carousel, {\n hasFocusableSlides: true,\n className: classNames?.carousel,\n id: id,\n slider: getSliderOptions({\n slider\n }),\n pagination: {\n show: false\n },\n navigation: {\n position: 'outside',\n showArrows: !isMobile\n },\n children: !!loading || data.length < 1 && showSkeletonIfEmpty ? times(DEFAULT_PRODUCT_BOX_SKELETON_COUNT).map(index => /*#__PURE__*/_jsx(CarouselSlide, {\n minWidth: 175,\n children: /*#__PURE__*/_jsx(ProductBoxSkeleton, {\n animation: loading ? 'pulse' : false\n })\n }, index)) : sortedData.map((product, index) => /*#__PURE__*/_jsx(CarouselSlide, {\n minWidth: 175,\n children: /*#__PURE__*/_jsx(ProductBox, {\n ...product,\n mode: mode,\n analyticsData: {\n placement: analyticsPlacement,\n position: index\n },\n buttons: {\n ...product.buttons,\n favorites: {\n ...product.buttons?.favorites,\n visible: areFavoritesEnabled\n }\n },\n tenant: tenant,\n hideRating: hideRating,\n mrpStatementEnabled: mrpStatementEnabled,\n translations: translations,\n withTranslationsProvider: withTranslationsProvider\n })\n }, product.code))\n })\n });\n};\n//# sourceMappingURL=ProductBoxCarousel.js.map","import * as FavoritesUpdatedEvent from '@ori-events/favorites-updated';\nimport * as RequestFavoritesEvent from '@ori-events/request-favorites';\nimport { isAuthenticatedCustomer } from '@ori/auth';\nimport { useCallback, useEffect, useState } from 'react';\nexport const useAreFavoritesEnabled = ({\n customerId\n} = {}) => {\n const isAuthenticated = isAuthenticatedCustomer(customerId);\n const [areFavoritesEnabled, setAreFavoritesEnabled] = useState(false);\n const dispatchRequestFavoritesEvent = useCallback(() => {\n if (isAuthenticated) {\n window.dispatchEvent(new CustomEvent(RequestFavoritesEvent.Name));\n }\n }, [isAuthenticated]);\n useEffect(() => {\n const onLoad = () => setAreFavoritesEnabled(true);\n window.addEventListener(FavoritesUpdatedEvent.Name, onLoad);\n const timeout = setTimeout(dispatchRequestFavoritesEvent);\n return () => {\n window.removeEventListener(FavoritesUpdatedEvent.Name, onLoad);\n clearTimeout(timeout);\n };\n }, [dispatchRequestFavoritesEvent]);\n return areFavoritesEnabled;\n};\n//# sourceMappingURL=useAreFavoritesEnabled.js.map","/**\n * Sorts product boxes by availability.\n * Products with quickBuy visible are always first.\n *\n * @param data ProductBoxProps[]\n */\nexport const sortProductBoxesByAvailability = data => data.sort((a, b) => {\n if (a.buttons?.quickBuy?.visible && !b.buttons?.quickBuy?.visible) {\n return -1;\n }\n if (!a.buttons?.quickBuy?.visible && b.buttons?.quickBuy?.visible) {\n return 1;\n }\n return 0;\n});\n//# sourceMappingURL=sortProductBoxesByAvailability.js.map","/* istanbul ignore file -- config */\nimport { HttpStatusCode } from '@ori/axios';\nexport const basicSwrOptions = {\n revalidateIfStale: false,\n revalidateOnFocus: false,\n revalidateOnReconnect: false\n};\nconst ERROR_RETRY_COUNT = 3;\nconst ERROR_RETRY_INTERVAL = 2000;\nexport const getRetryErrorSwrOptions = ({\n retryCount: retryCountParam = ERROR_RETRY_COUNT,\n retryInterval = ERROR_RETRY_INTERVAL\n} = {}) => ({\n ...basicSwrOptions,\n shouldRetryOnError: true,\n errorRetryCount: retryCountParam,\n errorRetryInterval: retryInterval,\n // eslint-disable-next-line max-params -- library requires too many parameters\n onErrorRetry: (error, _, config, revalidate, {\n retryCount\n }) => {\n const statusCode = error.response?.status ?? HttpStatusCode.GatewayTimeout;\n if (statusCode >= HttpStatusCode.BadRequest && statusCode < HttpStatusCode.InternalServerError) {\n return;\n }\n if (retryCount >= (config.errorRetryCount ?? 0)) {\n return;\n }\n setTimeout(() => void revalidate({\n retryCount\n }), config.errorRetryInterval);\n }\n});\nexport const getRetryErrorSwrInfiniteOptions = ({\n retryCount: retryCountParam = ERROR_RETRY_COUNT,\n retryInterval = ERROR_RETRY_INTERVAL\n} = {}) => ({\n ...basicSwrOptions,\n shouldRetryOnError: true,\n errorRetryCount: retryCountParam,\n errorRetryInterval: retryInterval,\n // eslint-disable-next-line max-params -- library requires too many parameters\n onErrorRetry: (error, _, config, revalidate, {\n retryCount\n }) => {\n const statusCode = error.response?.status ?? HttpStatusCode.GatewayTimeout;\n if (statusCode >= HttpStatusCode.BadRequest && statusCode < HttpStatusCode.InternalServerError) {\n return;\n }\n if (retryCount >= (config.errorRetryCount ?? 0)) {\n return;\n }\n setTimeout(() => void revalidate({\n retryCount\n }), config.errorRetryInterval);\n }\n});\n//# sourceMappingURL=swrConfig.js.map","import { ApiClient, getTenantBazaarvoiceConfiguration, getTenantTestfreaksConfiguration } from '@ori/static-api-client-react';\nexport const resolveHideRating = async ({\n staticApiUrl,\n tenant,\n logger\n}) => {\n const client = new ApiClient({\n baseUrl: staticApiUrl\n });\n try {\n const [bazaarvoiceConfig, testfreaksConfig] = await Promise.all([getTenantBazaarvoiceConfiguration(client, tenant), getTenantTestfreaksConfiguration(client, tenant)]);\n const {\n ratingsAndReviewsEnabled\n } = bazaarvoiceConfig.data;\n const {\n scriptUrl\n } = testfreaksConfig.data;\n return !ratingsAndReviewsEnabled && !scriptUrl;\n } catch (error) {\n if (logger) {\n logger.error(new Error('Failed getTenantBazaarvoiceConfiguration in resolveHideRating', {\n cause: error\n }));\n }\n return true;\n }\n};\n//# sourceMappingURL=resolveHideRating.js.map","/* istanbul ignore file */\nimport { useSWR } from '@ori/fetching';\nimport { getRetryErrorSwrOptions } from '@ori/presentation-utils';\nimport { useMemo } from 'react';\nimport { resolveHideRating } from '../utils';\nexport const useHideRating = ({\n staticApiUrl,\n tenant,\n logger,\n enabled = true\n}) => {\n const fetchKey = useMemo(() => [staticApiUrl, tenant].join('-'), [staticApiUrl, tenant]);\n const {\n data: hideRating = true\n } = useSWR(enabled ? fetchKey : null, async () => resolveHideRating({\n staticApiUrl,\n tenant,\n logger\n }), {\n ...getRetryErrorSwrOptions()\n });\n return hideRating;\n};\n//# sourceMappingURL=useHideRating.js.map","import { mapProductBoxPropsFromStaticApi } from './mapProductBoxPropsFromStaticApi';\nexport const mapProductBoxesFromStaticApi = (products, overrides, mode) => products.filter(product => product !== null).map(product => mapProductBoxPropsFromStaticApi(product, overrides, mode)).filter(product => product !== null);\n//# sourceMappingURL=mapProductBoxesFromStaticApi.js.map","const t=t=>\"object\"==typeof t&&null!=t&&1===t.nodeType,e=(t,e)=>(!e||\"hidden\"!==t)&&(\"visible\"!==t&&\"clip\"!==t),n=(t,n)=>{if(t.clientHeight{const e=(t=>{if(!t.ownerDocument||!t.ownerDocument.defaultView)return null;try{return t.ownerDocument.defaultView.frameElement}catch(t){return null}})(t);return!!e&&(e.clientHeightre||r>t&&i=e&&s>=n?r-t-o:i>e&&sn?i-e+l:0,l=t=>{const e=t.parentElement;return null==e?t.getRootNode().host||null:e},r=(e,r)=>{var i,s,d,h;if(\"undefined\"==typeof document)return[];const{scrollMode:c,block:f,inline:u,boundary:a,skipOverflowHiddenElements:g}=r,p=\"function\"==typeof a?a:t=>t!==a;if(!t(e))throw new TypeError(\"Invalid target\");const m=document.scrollingElement||document.documentElement,w=[];let W=e;for(;t(W)&&p(W);){if(W=l(W),W===m){w.push(W);break}null!=W&&W===document.body&&n(W)&&!n(document.documentElement)||null!=W&&n(W,g)&&w.push(W)}const b=null!=(s=null==(i=window.visualViewport)?void 0:i.width)?s:innerWidth,H=null!=(h=null==(d=window.visualViewport)?void 0:d.height)?h:innerHeight,{scrollX:y,scrollY:M}=window,{height:v,width:E,top:x,right:C,bottom:I,left:R}=e.getBoundingClientRect(),{top:T,right:B,bottom:F,left:V}=(t=>{const e=window.getComputedStyle(t);return{top:parseFloat(e.scrollMarginTop)||0,right:parseFloat(e.scrollMarginRight)||0,bottom:parseFloat(e.scrollMarginBottom)||0,left:parseFloat(e.scrollMarginLeft)||0}})(e);let k=\"start\"===f||\"nearest\"===f?x-T:\"end\"===f?I+F:x+v/2-T+F,D=\"center\"===u?R+E/2-V+B:\"end\"===u?C+B:R-V;const L=[];for(let t=0;t=0&&R>=0&&I<=H&&C<=b&&(e===m&&!n(e)||x>=i&&I<=d&&R>=h&&C<=s))return L;const a=getComputedStyle(e),g=parseInt(a.borderLeftWidth,10),p=parseInt(a.borderTopWidth,10),W=parseInt(a.borderRightWidth,10),T=parseInt(a.borderBottomWidth,10);let B=0,F=0;const V=\"offsetWidth\"in e?e.offsetWidth-e.clientWidth-g-W:0,S=\"offsetHeight\"in e?e.offsetHeight-e.clientHeight-p-T:0,X=\"offsetWidth\"in e?0===e.offsetWidth?0:r/e.offsetWidth:0,Y=\"offsetHeight\"in e?0===e.offsetHeight?0:l/e.offsetHeight:0;if(m===e)B=\"start\"===f?k:\"end\"===f?k-H:\"nearest\"===f?o(M,M+H,H,p,T,M+k,M+k+v,v):k-H/2,F=\"start\"===u?D:\"center\"===u?D-b/2:\"end\"===u?D-b:o(y,y+b,b,g,W,y+D,y+D+E,E),B=Math.max(0,B+M),F=Math.max(0,F+y);else{B=\"start\"===f?k-i-p:\"end\"===f?k-d+T+S:\"nearest\"===f?o(i,d,l,p,T+S,k,k+v,v):k-(i+l/2)+S/2,F=\"start\"===u?D-h-g:\"center\"===u?D-(h+r/2)+V/2:\"end\"===u?D-s+W+V:o(h,s,r,g,W+V,D,D+E,E);const{scrollLeft:t,scrollTop:n}=e;B=0===Y?0:Math.max(0,Math.min(n+B/Y,e.scrollHeight-l/Y+S)),F=0===X?0:Math.max(0,Math.min(t+F/X,e.scrollWidth-r/X+V)),k+=n-B,D+=t-F}L.push({el:e,top:B,left:F})}return L};export{r as compute};//# sourceMappingURL=index.js.map\n","import _objectWithoutPropertiesLoose from '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';\nimport _extends from '@babel/runtime/helpers/esm/extends';\nimport _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';\nimport PropTypes from 'prop-types';\nimport React, { cloneElement, Component, useRef, useEffect, useLayoutEffect, useCallback, useReducer, useMemo } from 'react';\nimport { isForwardRef } from 'react-is';\nimport { compute } from 'compute-scroll-into-view';\nimport { __assign } from 'tslib';\n\nvar idCounter = 0;\n\n/**\n * Accepts a parameter and returns it if it's a function\n * or a noop function if it's not. This allows us to\n * accept a callback, but not worry about it if it's not\n * passed.\n * @param {Function} cb the callback\n * @return {Function} a function\n */\nfunction cbToCb(cb) {\n return typeof cb === 'function' ? cb : noop;\n}\nfunction noop() {}\n\n/**\n * Scroll node into view if necessary\n * @param {HTMLElement} node the element that should scroll into view\n * @param {HTMLElement} menuNode the menu element of the component\n */\nfunction scrollIntoView(node, menuNode) {\n if (!node) {\n return;\n }\n var actions = compute(node, {\n boundary: menuNode,\n block: 'nearest',\n scrollMode: 'if-needed'\n });\n actions.forEach(function (_ref) {\n var el = _ref.el,\n top = _ref.top,\n left = _ref.left;\n el.scrollTop = top;\n el.scrollLeft = left;\n });\n}\n\n/**\n * @param {HTMLElement} parent the parent node\n * @param {HTMLElement} child the child node\n * @param {Window} environment The window context where downshift renders.\n * @return {Boolean} whether the parent is the child or the child is in the parent\n */\nfunction isOrContainsNode(parent, child, environment) {\n var result = parent === child || child instanceof environment.Node && parent.contains && parent.contains(child);\n return result;\n}\n\n/**\n * Simple debounce implementation. Will call the given\n * function once after the time given has passed since\n * it was last called.\n * @param {Function} fn the function to call after the time\n * @param {Number} time the time to wait\n * @return {Function} the debounced function\n */\nfunction debounce(fn, time) {\n var timeoutId;\n function cancel() {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n }\n function wrapper() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n cancel();\n timeoutId = setTimeout(function () {\n timeoutId = null;\n fn.apply(void 0, args);\n }, time);\n }\n wrapper.cancel = cancel;\n return wrapper;\n}\n\n/**\n * This is intended to be used to compose event handlers.\n * They are executed in order until one of them sets\n * `event.preventDownshiftDefault = true`.\n * @param {...Function} fns the event handler functions\n * @return {Function} the event handler to add to an element\n */\nfunction callAllEventHandlers() {\n for (var _len2 = arguments.length, fns = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n fns[_key2] = arguments[_key2];\n }\n return function (event) {\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n args[_key3 - 1] = arguments[_key3];\n }\n return fns.some(function (fn) {\n if (fn) {\n fn.apply(void 0, [event].concat(args));\n }\n return event.preventDownshiftDefault || event.hasOwnProperty('nativeEvent') && event.nativeEvent.preventDownshiftDefault;\n });\n };\n}\nfunction handleRefs() {\n for (var _len4 = arguments.length, refs = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n refs[_key4] = arguments[_key4];\n }\n return function (node) {\n refs.forEach(function (ref) {\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n });\n };\n}\n\n/**\n * This generates a unique ID for an instance of Downshift\n * @return {String} the unique ID\n */\nfunction generateId() {\n return String(idCounter++);\n}\n\n/**\n * Resets idCounter to 0. Used for SSR.\n */\nfunction resetIdCounter() {\n // istanbul ignore next\n if ('useId' in React) {\n console.warn(\"It is not necessary to call resetIdCounter when using React 18+\");\n return;\n }\n idCounter = 0;\n}\n\n/**\n * Default implementation for status message. Only added when menu is open.\n * Will specify if there are results in the list, and if so, how many,\n * and what keys are relevant.\n *\n * @param {Object} param the downshift state and other relevant properties\n * @return {String} the a11y status message\n */\nfunction getA11yStatusMessage(_ref2) {\n var isOpen = _ref2.isOpen,\n resultCount = _ref2.resultCount,\n previousResultCount = _ref2.previousResultCount;\n if (!isOpen) {\n return '';\n }\n if (!resultCount) {\n return 'No results are available.';\n }\n if (resultCount !== previousResultCount) {\n return resultCount + \" result\" + (resultCount === 1 ? ' is' : 's are') + \" available, use up and down arrow keys to navigate. Press Enter key to select.\";\n }\n return '';\n}\n\n/**\n * Takes an argument and if it's an array, returns the first item in the array\n * otherwise returns the argument\n * @param {*} arg the maybe-array\n * @param {*} defaultValue the value if arg is falsey not defined\n * @return {*} the arg or it's first item\n */\nfunction unwrapArray(arg, defaultValue) {\n arg = Array.isArray(arg) ? /* istanbul ignore next (preact) */arg[0] : arg;\n if (!arg && defaultValue) {\n return defaultValue;\n } else {\n return arg;\n }\n}\n\n/**\n * @param {Object} element (P)react element\n * @return {Boolean} whether it's a DOM element\n */\nfunction isDOMElement(element) {\n\n // then we assume this is react\n return typeof element.type === 'string';\n}\n\n/**\n * @param {Object} element (P)react element\n * @return {Object} the props\n */\nfunction getElementProps(element) {\n return element.props;\n}\n\n/**\n * Throws a helpful error message for required properties. Useful\n * to be used as a default in destructuring or object params.\n * @param {String} fnName the function name\n * @param {String} propName the prop name\n */\nfunction requiredProp(fnName, propName) {\n // eslint-disable-next-line no-console\n console.error(\"The property \\\"\" + propName + \"\\\" is required in \\\"\" + fnName + \"\\\"\");\n}\nvar stateKeys = ['highlightedIndex', 'inputValue', 'isOpen', 'selectedItem', 'type'];\n/**\n * @param {Object} state the state object\n * @return {Object} state that is relevant to downshift\n */\nfunction pickState(state) {\n if (state === void 0) {\n state = {};\n }\n var result = {};\n stateKeys.forEach(function (k) {\n if (state.hasOwnProperty(k)) {\n result[k] = state[k];\n }\n });\n return result;\n}\n\n/**\n * This will perform a shallow merge of the given state object\n * with the state coming from props\n * (for the controlled component scenario)\n * This is used in state updater functions so they're referencing\n * the right state regardless of where it comes from.\n *\n * @param {Object} state The state of the component/hook.\n * @param {Object} props The props that may contain controlled values.\n * @returns {Object} The merged controlled state.\n */\nfunction getState(state, props) {\n if (!state || !props) {\n return state;\n }\n return Object.keys(state).reduce(function (prevState, key) {\n prevState[key] = isControlledProp(props, key) ? props[key] : state[key];\n return prevState;\n }, {});\n}\n\n/**\n * This determines whether a prop is a \"controlled prop\" meaning it is\n * state which is controlled by the outside of this component rather\n * than within this component.\n *\n * @param {Object} props The props that may contain controlled values.\n * @param {String} key the key to check\n * @return {Boolean} whether it is a controlled controlled prop\n */\nfunction isControlledProp(props, key) {\n return props[key] !== undefined;\n}\n\n/**\n * Normalizes the 'key' property of a KeyboardEvent in IE/Edge\n * @param {Object} event a keyboardEvent object\n * @return {String} keyboard key\n */\nfunction normalizeArrowKey(event) {\n var key = event.key,\n keyCode = event.keyCode;\n /* istanbul ignore next (ie) */\n if (keyCode >= 37 && keyCode <= 40 && key.indexOf('Arrow') !== 0) {\n return \"Arrow\" + key;\n }\n return key;\n}\n\n/**\n * Simple check if the value passed is object literal\n * @param {*} obj any things\n * @return {Boolean} whether it's object literal\n */\nfunction isPlainObject(obj) {\n return Object.prototype.toString.call(obj) === '[object Object]';\n}\n\n/**\n * Returns the next non-disabled highlightedIndex value.\n *\n * @param {number} start The current highlightedIndex.\n * @param {number} offset The offset from the current highlightedIndex to start searching.\n * @param {unknown[]} items The items array.\n * @param {(item: unknown, index: number) => boolean} isItemDisabled Function that tells if an item is disabled or not.\n * @param {boolean?} circular If the search reaches the end, if it can search again starting from the other end.\n * @returns {number} The next highlightedIndex.\n */\nfunction getHighlightedIndex(start, offset, items, isItemDisabled, circular) {\n if (circular === void 0) {\n circular = false;\n }\n var count = items.length;\n if (count === 0) {\n return -1;\n }\n var itemsLastIndex = count - 1;\n if (typeof start !== 'number' || start < 0 || start > itemsLastIndex) {\n start = offset > 0 ? -1 : itemsLastIndex + 1;\n }\n var current = start + offset;\n if (current < 0) {\n current = circular ? itemsLastIndex : 0;\n } else if (current > itemsLastIndex) {\n current = circular ? 0 : itemsLastIndex;\n }\n var highlightedIndex = getNonDisabledIndex(current, offset < 0, items, isItemDisabled, circular);\n if (highlightedIndex === -1) {\n return start >= count ? -1 : start;\n }\n return highlightedIndex;\n}\n\n/**\n * Returns the next non-disabled highlightedIndex value.\n *\n * @param {number} start The current highlightedIndex.\n * @param {boolean} backwards If true, it will search backwards from the start.\n * @param {unknown[]} items The items array.\n * @param {(item: unknown, index: number) => boolean} isItemDisabled Function that tells if an item is disabled or not.\n * @param {boolean} circular If the search reaches the end, if it can search again starting from the other end.\n * @returns {number} The next non-disabled index.\n */\nfunction getNonDisabledIndex(start, backwards, items, isItemDisabled, circular) {\n if (circular === void 0) {\n circular = false;\n }\n var count = items.length;\n if (backwards) {\n for (var index = start; index >= 0; index--) {\n if (!isItemDisabled(items[index], index)) {\n return index;\n }\n }\n } else {\n for (var _index = start; _index < count; _index++) {\n if (!isItemDisabled(items[_index], _index)) {\n return _index;\n }\n }\n }\n if (circular) {\n return getNonDisabledIndex(backwards ? count - 1 : 0, backwards, items, isItemDisabled);\n }\n return -1;\n}\n\n/**\n * Checks if event target is within the downshift elements.\n *\n * @param {EventTarget} target Target to check.\n * @param {HTMLElement[]} downshiftElements The elements that form downshift (list, toggle button etc).\n * @param {Window} environment The window context where downshift renders.\n * @param {boolean} checkActiveElement Whether to also check activeElement.\n *\n * @returns {boolean} Whether or not the target is within downshift elements.\n */\nfunction targetWithinDownshift(target, downshiftElements, environment, checkActiveElement) {\n if (checkActiveElement === void 0) {\n checkActiveElement = true;\n }\n return environment && downshiftElements.some(function (contextNode) {\n return contextNode && (isOrContainsNode(contextNode, target, environment) || checkActiveElement && isOrContainsNode(contextNode, environment.document.activeElement, environment));\n });\n}\n\n// eslint-disable-next-line import/no-mutable-exports\nvar validateControlledUnchanged = noop;\n/* istanbul ignore next */\nif (process.env.NODE_ENV !== 'production') {\n validateControlledUnchanged = function validateControlledUnchanged(state, prevProps, nextProps) {\n var warningDescription = \"This prop should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled Downshift element for the lifetime of the component. More info: https://github.com/downshift-js/downshift#control-props\";\n Object.keys(state).forEach(function (propKey) {\n if (prevProps[propKey] !== undefined && nextProps[propKey] === undefined) {\n // eslint-disable-next-line no-console\n console.error(\"downshift: A component has changed the controlled prop \\\"\" + propKey + \"\\\" to be uncontrolled. \" + warningDescription);\n } else if (prevProps[propKey] === undefined && nextProps[propKey] !== undefined) {\n // eslint-disable-next-line no-console\n console.error(\"downshift: A component has changed the uncontrolled prop \\\"\" + propKey + \"\\\" to be controlled. \" + warningDescription);\n }\n });\n };\n}\n\nvar cleanupStatus = debounce(function (documentProp) {\n getStatusDiv(documentProp).textContent = '';\n}, 500);\n\n/**\n * Get the status node or create it if it does not already exist.\n * @param {Object} documentProp document passed by the user.\n * @return {HTMLElement} the status node.\n */\nfunction getStatusDiv(documentProp) {\n var statusDiv = documentProp.getElementById('a11y-status-message');\n if (statusDiv) {\n return statusDiv;\n }\n statusDiv = documentProp.createElement('div');\n statusDiv.setAttribute('id', 'a11y-status-message');\n statusDiv.setAttribute('role', 'status');\n statusDiv.setAttribute('aria-live', 'polite');\n statusDiv.setAttribute('aria-relevant', 'additions text');\n Object.assign(statusDiv.style, {\n border: '0',\n clip: 'rect(0 0 0 0)',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: '0',\n position: 'absolute',\n width: '1px'\n });\n documentProp.body.appendChild(statusDiv);\n return statusDiv;\n}\n\n/**\n * @param {String} status the status message\n * @param {Object} documentProp document passed by the user.\n */\nfunction setStatus(status, documentProp) {\n if (!status || !documentProp) {\n return;\n }\n var div = getStatusDiv(documentProp);\n div.textContent = status;\n cleanupStatus(documentProp);\n}\n\n/**\n * Removes the status element from the DOM\n * @param {Document} documentProp \n */\nfunction cleanupStatusDiv(documentProp) {\n var statusDiv = documentProp == null ? void 0 : documentProp.getElementById('a11y-status-message');\n if (statusDiv) {\n statusDiv.remove();\n }\n}\n\nvar unknown = process.env.NODE_ENV !== \"production\" ? '__autocomplete_unknown__' : 0;\nvar mouseUp = process.env.NODE_ENV !== \"production\" ? '__autocomplete_mouseup__' : 1;\nvar itemMouseEnter = process.env.NODE_ENV !== \"production\" ? '__autocomplete_item_mouseenter__' : 2;\nvar keyDownArrowUp = process.env.NODE_ENV !== \"production\" ? '__autocomplete_keydown_arrow_up__' : 3;\nvar keyDownArrowDown = process.env.NODE_ENV !== \"production\" ? '__autocomplete_keydown_arrow_down__' : 4;\nvar keyDownEscape = process.env.NODE_ENV !== \"production\" ? '__autocomplete_keydown_escape__' : 5;\nvar keyDownEnter = process.env.NODE_ENV !== \"production\" ? '__autocomplete_keydown_enter__' : 6;\nvar keyDownHome = process.env.NODE_ENV !== \"production\" ? '__autocomplete_keydown_home__' : 7;\nvar keyDownEnd = process.env.NODE_ENV !== \"production\" ? '__autocomplete_keydown_end__' : 8;\nvar clickItem = process.env.NODE_ENV !== \"production\" ? '__autocomplete_click_item__' : 9;\nvar blurInput = process.env.NODE_ENV !== \"production\" ? '__autocomplete_blur_input__' : 10;\nvar changeInput = process.env.NODE_ENV !== \"production\" ? '__autocomplete_change_input__' : 11;\nvar keyDownSpaceButton = process.env.NODE_ENV !== \"production\" ? '__autocomplete_keydown_space_button__' : 12;\nvar clickButton = process.env.NODE_ENV !== \"production\" ? '__autocomplete_click_button__' : 13;\nvar blurButton = process.env.NODE_ENV !== \"production\" ? '__autocomplete_blur_button__' : 14;\nvar controlledPropUpdatedSelectedItem = process.env.NODE_ENV !== \"production\" ? '__autocomplete_controlled_prop_updated_selected_item__' : 15;\nvar touchEnd = process.env.NODE_ENV !== \"production\" ? '__autocomplete_touchend__' : 16;\n\nvar stateChangeTypes$3 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n blurButton: blurButton,\n blurInput: blurInput,\n changeInput: changeInput,\n clickButton: clickButton,\n clickItem: clickItem,\n controlledPropUpdatedSelectedItem: controlledPropUpdatedSelectedItem,\n itemMouseEnter: itemMouseEnter,\n keyDownArrowDown: keyDownArrowDown,\n keyDownArrowUp: keyDownArrowUp,\n keyDownEnd: keyDownEnd,\n keyDownEnter: keyDownEnter,\n keyDownEscape: keyDownEscape,\n keyDownHome: keyDownHome,\n keyDownSpaceButton: keyDownSpaceButton,\n mouseUp: mouseUp,\n touchEnd: touchEnd,\n unknown: unknown\n});\n\nvar _excluded$3 = [\"refKey\", \"ref\"],\n _excluded2$3 = [\"onClick\", \"onPress\", \"onKeyDown\", \"onKeyUp\", \"onBlur\"],\n _excluded3$2 = [\"onKeyDown\", \"onBlur\", \"onChange\", \"onInput\", \"onChangeText\"],\n _excluded4$2 = [\"refKey\", \"ref\"],\n _excluded5 = [\"onMouseMove\", \"onMouseDown\", \"onClick\", \"onPress\", \"index\", \"item\"];\nvar Downshift = /*#__PURE__*/function () {\n var Downshift = /*#__PURE__*/function (_Component) {\n function Downshift(_props) {\n var _this;\n _this = _Component.call(this, _props) || this;\n // fancy destructuring + defaults + aliases\n // this basically says each value of state should either be set to\n // the initial value or the default value if the initial value is not provided\n _this.id = _this.props.id || \"downshift-\" + generateId();\n _this.menuId = _this.props.menuId || _this.id + \"-menu\";\n _this.labelId = _this.props.labelId || _this.id + \"-label\";\n _this.inputId = _this.props.inputId || _this.id + \"-input\";\n _this.getItemId = _this.props.getItemId || function (index) {\n return _this.id + \"-item-\" + index;\n };\n _this.items = [];\n // itemCount can be changed asynchronously\n // from within downshift (so it can't come from a prop)\n // this is why we store it as an instance and use\n // getItemCount rather than just use items.length\n // (to support windowing + async)\n _this.itemCount = null;\n _this.previousResultCount = 0;\n _this.timeoutIds = [];\n /**\n * @param {Function} fn the function to call after the time\n * @param {Number} time the time to wait\n */\n _this.internalSetTimeout = function (fn, time) {\n var id = setTimeout(function () {\n _this.timeoutIds = _this.timeoutIds.filter(function (i) {\n return i !== id;\n });\n fn();\n }, time);\n _this.timeoutIds.push(id);\n };\n _this.setItemCount = function (count) {\n _this.itemCount = count;\n };\n _this.unsetItemCount = function () {\n _this.itemCount = null;\n };\n _this.isItemDisabled = function (_item, index) {\n var currentElementNode = _this.getItemNodeFromIndex(index);\n return currentElementNode && currentElementNode.hasAttribute('disabled');\n };\n _this.setHighlightedIndex = function (highlightedIndex, otherStateToSet) {\n if (highlightedIndex === void 0) {\n highlightedIndex = _this.props.defaultHighlightedIndex;\n }\n if (otherStateToSet === void 0) {\n otherStateToSet = {};\n }\n otherStateToSet = pickState(otherStateToSet);\n _this.internalSetState(_extends({\n highlightedIndex: highlightedIndex\n }, otherStateToSet));\n };\n _this.clearSelection = function (cb) {\n _this.internalSetState({\n selectedItem: null,\n inputValue: '',\n highlightedIndex: _this.props.defaultHighlightedIndex,\n isOpen: _this.props.defaultIsOpen\n }, cb);\n };\n _this.selectItem = function (item, otherStateToSet, cb) {\n otherStateToSet = pickState(otherStateToSet);\n _this.internalSetState(_extends({\n isOpen: _this.props.defaultIsOpen,\n highlightedIndex: _this.props.defaultHighlightedIndex,\n selectedItem: item,\n inputValue: _this.props.itemToString(item)\n }, otherStateToSet), cb);\n };\n _this.selectItemAtIndex = function (itemIndex, otherStateToSet, cb) {\n var item = _this.items[itemIndex];\n if (item == null) {\n return;\n }\n _this.selectItem(item, otherStateToSet, cb);\n };\n _this.selectHighlightedItem = function (otherStateToSet, cb) {\n return _this.selectItemAtIndex(_this.getState().highlightedIndex, otherStateToSet, cb);\n };\n // any piece of our state can live in two places:\n // 1. Uncontrolled: it's internal (this.state)\n // We will call this.setState to update that state\n // 2. Controlled: it's external (this.props)\n // We will call this.props.onStateChange to update that state\n //\n // In addition, we'll call this.props.onChange if the\n // selectedItem is changed.\n _this.internalSetState = function (stateToSet, cb) {\n var isItemSelected, onChangeArg;\n var onStateChangeArg = {};\n var isStateToSetFunction = typeof stateToSet === 'function';\n\n // we want to call `onInputValueChange` before the `setState` call\n // so someone controlling the `inputValue` state gets notified of\n // the input change as soon as possible. This avoids issues with\n // preserving the cursor position.\n // See https://github.com/downshift-js/downshift/issues/217 for more info.\n if (!isStateToSetFunction && stateToSet.hasOwnProperty('inputValue')) {\n _this.props.onInputValueChange(stateToSet.inputValue, _extends({}, _this.getStateAndHelpers(), stateToSet));\n }\n return _this.setState(function (state) {\n var _newStateToSet;\n state = _this.getState(state);\n var newStateToSet = isStateToSetFunction ? stateToSet(state) : stateToSet;\n\n // Your own function that could modify the state that will be set.\n newStateToSet = _this.props.stateReducer(state, newStateToSet);\n\n // checks if an item is selected, regardless of if it's different from\n // what was selected before\n // used to determine if onSelect and onChange callbacks should be called\n isItemSelected = newStateToSet.hasOwnProperty('selectedItem');\n // this keeps track of the object we want to call with setState\n var nextState = {};\n // we need to call on change if the outside world is controlling any of our state\n // and we're trying to update that state. OR if the selection has changed and we're\n // trying to update the selection\n if (isItemSelected && newStateToSet.selectedItem !== state.selectedItem) {\n onChangeArg = newStateToSet.selectedItem;\n }\n (_newStateToSet = newStateToSet).type || (_newStateToSet.type = unknown);\n Object.keys(newStateToSet).forEach(function (key) {\n // onStateChangeArg should only have the state that is\n // actually changing\n if (state[key] !== newStateToSet[key]) {\n onStateChangeArg[key] = newStateToSet[key];\n }\n // the type is useful for the onStateChangeArg\n // but we don't actually want to set it in internal state.\n // this is an undocumented feature for now... Not all internalSetState\n // calls support it and I'm not certain we want them to yet.\n // But it enables users controlling the isOpen state to know when\n // the isOpen state changes due to mouseup events which is quite handy.\n if (key === 'type') {\n return;\n }\n newStateToSet[key];\n // if it's coming from props, then we don't care to set it internally\n if (!isControlledProp(_this.props, key)) {\n nextState[key] = newStateToSet[key];\n }\n });\n\n // if stateToSet is a function, then we weren't able to call onInputValueChange\n // earlier, so we'll call it now that we know what the inputValue state will be.\n if (isStateToSetFunction && newStateToSet.hasOwnProperty('inputValue')) {\n _this.props.onInputValueChange(newStateToSet.inputValue, _extends({}, _this.getStateAndHelpers(), newStateToSet));\n }\n return nextState;\n }, function () {\n // call the provided callback if it's a function\n cbToCb(cb)();\n\n // only call the onStateChange and onChange callbacks if\n // we have relevant information to pass them.\n var hasMoreStateThanType = Object.keys(onStateChangeArg).length > 1;\n if (hasMoreStateThanType) {\n _this.props.onStateChange(onStateChangeArg, _this.getStateAndHelpers());\n }\n if (isItemSelected) {\n _this.props.onSelect(stateToSet.selectedItem, _this.getStateAndHelpers());\n }\n if (onChangeArg !== undefined) {\n _this.props.onChange(onChangeArg, _this.getStateAndHelpers());\n }\n // this is currently undocumented and therefore subject to change\n // We'll try to not break it, but just be warned.\n _this.props.onUserAction(onStateChangeArg, _this.getStateAndHelpers());\n });\n };\n //////////////////////////// ROOT\n _this.rootRef = function (node) {\n return _this._rootNode = node;\n };\n _this.getRootProps = function (_temp, _temp2) {\n var _extends2;\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$refKey = _ref.refKey,\n refKey = _ref$refKey === void 0 ? 'ref' : _ref$refKey,\n ref = _ref.ref,\n rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);\n var _ref2 = _temp2 === void 0 ? {} : _temp2,\n _ref2$suppressRefErro = _ref2.suppressRefError,\n suppressRefError = _ref2$suppressRefErro === void 0 ? false : _ref2$suppressRefErro;\n // this is used in the render to know whether the user has called getRootProps.\n // It uses that to know whether to apply the props automatically\n _this.getRootProps.called = true;\n _this.getRootProps.refKey = refKey;\n _this.getRootProps.suppressRefError = suppressRefError;\n var _this$getState = _this.getState(),\n isOpen = _this$getState.isOpen;\n return _extends((_extends2 = {}, _extends2[refKey] = handleRefs(ref, _this.rootRef), _extends2.role = 'combobox', _extends2['aria-expanded'] = isOpen, _extends2['aria-haspopup'] = 'listbox', _extends2['aria-owns'] = isOpen ? _this.menuId : undefined, _extends2['aria-labelledby'] = _this.labelId, _extends2), rest);\n };\n //\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ROOT\n _this.keyDownHandlers = {\n ArrowDown: function ArrowDown(event) {\n var _this2 = this;\n event.preventDefault();\n if (this.getState().isOpen) {\n var amount = event.shiftKey ? 5 : 1;\n this.moveHighlightedIndex(amount, {\n type: keyDownArrowDown\n });\n } else {\n this.internalSetState({\n isOpen: true,\n type: keyDownArrowDown\n }, function () {\n var itemCount = _this2.getItemCount();\n if (itemCount > 0) {\n var _this2$getState = _this2.getState(),\n highlightedIndex = _this2$getState.highlightedIndex;\n var nextHighlightedIndex = getHighlightedIndex(highlightedIndex, 1, {\n length: itemCount\n }, _this2.isItemDisabled, true);\n _this2.setHighlightedIndex(nextHighlightedIndex, {\n type: keyDownArrowDown\n });\n }\n });\n }\n },\n ArrowUp: function ArrowUp(event) {\n var _this3 = this;\n event.preventDefault();\n if (this.getState().isOpen) {\n var amount = event.shiftKey ? -5 : -1;\n this.moveHighlightedIndex(amount, {\n type: keyDownArrowUp\n });\n } else {\n this.internalSetState({\n isOpen: true,\n type: keyDownArrowUp\n }, function () {\n var itemCount = _this3.getItemCount();\n if (itemCount > 0) {\n var _this3$getState = _this3.getState(),\n highlightedIndex = _this3$getState.highlightedIndex;\n var nextHighlightedIndex = getHighlightedIndex(highlightedIndex, -1, {\n length: itemCount\n }, _this3.isItemDisabled, true);\n _this3.setHighlightedIndex(nextHighlightedIndex, {\n type: keyDownArrowUp\n });\n }\n });\n }\n },\n Enter: function Enter(event) {\n if (event.which === 229) {\n return;\n }\n var _this$getState2 = this.getState(),\n isOpen = _this$getState2.isOpen,\n highlightedIndex = _this$getState2.highlightedIndex;\n if (isOpen && highlightedIndex != null) {\n event.preventDefault();\n var item = this.items[highlightedIndex];\n var itemNode = this.getItemNodeFromIndex(highlightedIndex);\n if (item == null || itemNode && itemNode.hasAttribute('disabled')) {\n return;\n }\n this.selectHighlightedItem({\n type: keyDownEnter\n });\n }\n },\n Escape: function Escape(event) {\n event.preventDefault();\n this.reset(_extends({\n type: keyDownEscape\n }, !this.state.isOpen && {\n selectedItem: null,\n inputValue: ''\n }));\n }\n };\n //////////////////////////// BUTTON\n _this.buttonKeyDownHandlers = _extends({}, _this.keyDownHandlers, {\n ' ': function _(event) {\n event.preventDefault();\n this.toggleMenu({\n type: keyDownSpaceButton\n });\n }\n });\n _this.inputKeyDownHandlers = _extends({}, _this.keyDownHandlers, {\n Home: function Home(event) {\n var _this$getState3 = this.getState(),\n isOpen = _this$getState3.isOpen;\n if (!isOpen) {\n return;\n }\n event.preventDefault();\n var itemCount = this.getItemCount();\n if (itemCount <= 0 || !isOpen) {\n return;\n }\n\n // get next non-disabled starting downwards from 0 if that's disabled.\n var newHighlightedIndex = getNonDisabledIndex(0, false, {\n length: itemCount\n }, this.isItemDisabled);\n this.setHighlightedIndex(newHighlightedIndex, {\n type: keyDownHome\n });\n },\n End: function End(event) {\n var _this$getState4 = this.getState(),\n isOpen = _this$getState4.isOpen;\n if (!isOpen) {\n return;\n }\n event.preventDefault();\n var itemCount = this.getItemCount();\n if (itemCount <= 0 || !isOpen) {\n return;\n }\n\n // get next non-disabled starting upwards from last index if that's disabled.\n var newHighlightedIndex = getNonDisabledIndex(itemCount - 1, true, {\n length: itemCount\n }, this.isItemDisabled);\n this.setHighlightedIndex(newHighlightedIndex, {\n type: keyDownEnd\n });\n }\n });\n _this.getToggleButtonProps = function (_temp3) {\n var _ref3 = _temp3 === void 0 ? {} : _temp3,\n onClick = _ref3.onClick;\n _ref3.onPress;\n var onKeyDown = _ref3.onKeyDown,\n onKeyUp = _ref3.onKeyUp,\n onBlur = _ref3.onBlur,\n rest = _objectWithoutPropertiesLoose(_ref3, _excluded2$3);\n var _this$getState5 = _this.getState(),\n isOpen = _this$getState5.isOpen;\n var enabledEventHandlers = {\n onClick: callAllEventHandlers(onClick, _this.buttonHandleClick),\n onKeyDown: callAllEventHandlers(onKeyDown, _this.buttonHandleKeyDown),\n onKeyUp: callAllEventHandlers(onKeyUp, _this.buttonHandleKeyUp),\n onBlur: callAllEventHandlers(onBlur, _this.buttonHandleBlur)\n };\n var eventHandlers = rest.disabled ? {} : enabledEventHandlers;\n return _extends({\n type: 'button',\n role: 'button',\n 'aria-label': isOpen ? 'close menu' : 'open menu',\n 'aria-haspopup': true,\n 'data-toggle': true\n }, eventHandlers, rest);\n };\n _this.buttonHandleKeyUp = function (event) {\n // Prevent click event from emitting in Firefox\n event.preventDefault();\n };\n _this.buttonHandleKeyDown = function (event) {\n var key = normalizeArrowKey(event);\n if (_this.buttonKeyDownHandlers[key]) {\n _this.buttonKeyDownHandlers[key].call(_this, event);\n }\n };\n _this.buttonHandleClick = function (event) {\n event.preventDefault();\n // handle odd case for Safari and Firefox which\n // don't give the button the focus properly.\n /* istanbul ignore if (can't reasonably test this) */\n if (_this.props.environment) {\n var _this$props$environme = _this.props.environment.document,\n body = _this$props$environme.body,\n activeElement = _this$props$environme.activeElement;\n if (body && body === activeElement) {\n event.target.focus();\n }\n }\n // to simplify testing components that use downshift, we'll not wrap this in a setTimeout\n // if the NODE_ENV is test. With the proper build system, this should be dead code eliminated\n // when building for production and should therefore have no impact on production code.\n if (process.env.NODE_ENV === 'test') {\n _this.toggleMenu({\n type: clickButton\n });\n } else {\n // Ensure that toggle of menu occurs after the potential blur event in iOS\n _this.internalSetTimeout(function () {\n return _this.toggleMenu({\n type: clickButton\n });\n });\n }\n };\n _this.buttonHandleBlur = function (event) {\n var blurTarget = event.target; // Save blur target for comparison with activeElement later\n // Need setTimeout, so that when the user presses Tab, the activeElement is the next focused element, not body element\n _this.internalSetTimeout(function () {\n if (_this.isMouseDown || !_this.props.environment) {\n return;\n }\n var activeElement = _this.props.environment.document.activeElement;\n if ((activeElement == null || activeElement.id !== _this.inputId) && activeElement !== blurTarget // Do nothing if we refocus the same element again (to solve issue in Safari on iOS)\n ) {\n _this.reset({\n type: blurButton\n });\n }\n });\n };\n //\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ BUTTON\n /////////////////////////////// LABEL\n _this.getLabelProps = function (props) {\n return _extends({\n htmlFor: _this.inputId,\n id: _this.labelId\n }, props);\n };\n //\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ LABEL\n /////////////////////////////// INPUT\n _this.getInputProps = function (_temp4) {\n var _ref4 = _temp4 === void 0 ? {} : _temp4,\n onKeyDown = _ref4.onKeyDown,\n onBlur = _ref4.onBlur,\n onChange = _ref4.onChange,\n onInput = _ref4.onInput;\n _ref4.onChangeText;\n var rest = _objectWithoutPropertiesLoose(_ref4, _excluded3$2);\n var onChangeKey;\n var eventHandlers = {};\n\n /* istanbul ignore next (preact) */\n {\n onChangeKey = 'onChange';\n }\n var _this$getState6 = _this.getState(),\n inputValue = _this$getState6.inputValue,\n isOpen = _this$getState6.isOpen,\n highlightedIndex = _this$getState6.highlightedIndex;\n if (!rest.disabled) {\n var _eventHandlers;\n eventHandlers = (_eventHandlers = {}, _eventHandlers[onChangeKey] = callAllEventHandlers(onChange, onInput, _this.inputHandleChange), _eventHandlers.onKeyDown = callAllEventHandlers(onKeyDown, _this.inputHandleKeyDown), _eventHandlers.onBlur = callAllEventHandlers(onBlur, _this.inputHandleBlur), _eventHandlers);\n }\n return _extends({\n 'aria-autocomplete': 'list',\n 'aria-activedescendant': isOpen && typeof highlightedIndex === 'number' && highlightedIndex >= 0 ? _this.getItemId(highlightedIndex) : undefined,\n 'aria-controls': isOpen ? _this.menuId : undefined,\n 'aria-labelledby': rest && rest['aria-label'] ? undefined : _this.labelId,\n // https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion\n // revert back since autocomplete=\"nope\" is ignored on latest Chrome and Opera\n autoComplete: 'off',\n value: inputValue,\n id: _this.inputId\n }, eventHandlers, rest);\n };\n _this.inputHandleKeyDown = function (event) {\n var key = normalizeArrowKey(event);\n if (key && _this.inputKeyDownHandlers[key]) {\n _this.inputKeyDownHandlers[key].call(_this, event);\n }\n };\n _this.inputHandleChange = function (event) {\n _this.internalSetState({\n type: changeInput,\n isOpen: true,\n inputValue: event.target.value,\n highlightedIndex: _this.props.defaultHighlightedIndex\n });\n };\n _this.inputHandleBlur = function () {\n // Need setTimeout, so that when the user presses Tab, the activeElement is the next focused element, not the body element\n _this.internalSetTimeout(function () {\n var _activeElement$datase;\n if (_this.isMouseDown || !_this.props.environment) {\n return;\n }\n var activeElement = _this.props.environment.document.activeElement;\n var downshiftButtonIsActive = (activeElement == null || (_activeElement$datase = activeElement.dataset) == null ? void 0 : _activeElement$datase.toggle) && _this._rootNode && _this._rootNode.contains(activeElement);\n if (!downshiftButtonIsActive) {\n _this.reset({\n type: blurInput\n });\n }\n });\n };\n //\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ INPUT\n /////////////////////////////// MENU\n _this.menuRef = function (node) {\n _this._menuNode = node;\n };\n _this.getMenuProps = function (_temp5, _temp6) {\n var _extends3;\n var _ref5 = _temp5 === void 0 ? {} : _temp5,\n _ref5$refKey = _ref5.refKey,\n refKey = _ref5$refKey === void 0 ? 'ref' : _ref5$refKey,\n ref = _ref5.ref,\n props = _objectWithoutPropertiesLoose(_ref5, _excluded4$2);\n var _ref6 = _temp6 === void 0 ? {} : _temp6,\n _ref6$suppressRefErro = _ref6.suppressRefError,\n suppressRefError = _ref6$suppressRefErro === void 0 ? false : _ref6$suppressRefErro;\n _this.getMenuProps.called = true;\n _this.getMenuProps.refKey = refKey;\n _this.getMenuProps.suppressRefError = suppressRefError;\n return _extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, _this.menuRef), _extends3.role = 'listbox', _extends3['aria-labelledby'] = props && props['aria-label'] ? undefined : _this.labelId, _extends3.id = _this.menuId, _extends3), props);\n };\n //\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ MENU\n /////////////////////////////// ITEM\n _this.getItemProps = function (_temp7) {\n var _enabledEventHandlers;\n var _ref7 = _temp7 === void 0 ? {} : _temp7,\n onMouseMove = _ref7.onMouseMove,\n onMouseDown = _ref7.onMouseDown,\n onClick = _ref7.onClick;\n _ref7.onPress;\n var index = _ref7.index,\n _ref7$item = _ref7.item,\n item = _ref7$item === void 0 ? process.env.NODE_ENV === 'production' ? /* istanbul ignore next */undefined : requiredProp('getItemProps', 'item') : _ref7$item,\n rest = _objectWithoutPropertiesLoose(_ref7, _excluded5);\n if (index === undefined) {\n _this.items.push(item);\n index = _this.items.indexOf(item);\n } else {\n _this.items[index] = item;\n }\n var onSelectKey = 'onClick';\n var customClickHandler = onClick;\n var enabledEventHandlers = (_enabledEventHandlers = {\n // onMouseMove is used over onMouseEnter here. onMouseMove\n // is only triggered on actual mouse movement while onMouseEnter\n // can fire on DOM changes, interrupting keyboard navigation\n onMouseMove: callAllEventHandlers(onMouseMove, function () {\n if (index === _this.getState().highlightedIndex) {\n return;\n }\n _this.setHighlightedIndex(index, {\n type: itemMouseEnter\n });\n\n // We never want to manually scroll when changing state based\n // on `onMouseMove` because we will be moving the element out\n // from under the user which is currently scrolling/moving the\n // cursor\n _this.avoidScrolling = true;\n _this.internalSetTimeout(function () {\n return _this.avoidScrolling = false;\n }, 250);\n }),\n onMouseDown: callAllEventHandlers(onMouseDown, function (event) {\n // This prevents the activeElement from being changed\n // to the item so it can remain with the current activeElement\n // which is a more common use case.\n event.preventDefault();\n })\n }, _enabledEventHandlers[onSelectKey] = callAllEventHandlers(customClickHandler, function () {\n _this.selectItemAtIndex(index, {\n type: clickItem\n });\n }), _enabledEventHandlers);\n\n // Passing down the onMouseDown handler to prevent redirect\n // of the activeElement if clicking on disabled items\n var eventHandlers = rest.disabled ? {\n onMouseDown: enabledEventHandlers.onMouseDown\n } : enabledEventHandlers;\n return _extends({\n id: _this.getItemId(index),\n role: 'option',\n 'aria-selected': _this.getState().highlightedIndex === index\n }, eventHandlers, rest);\n };\n //\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ITEM\n _this.clearItems = function () {\n _this.items = [];\n };\n _this.reset = function (otherStateToSet, cb) {\n if (otherStateToSet === void 0) {\n otherStateToSet = {};\n }\n otherStateToSet = pickState(otherStateToSet);\n _this.internalSetState(function (_ref8) {\n var selectedItem = _ref8.selectedItem;\n return _extends({\n isOpen: _this.props.defaultIsOpen,\n highlightedIndex: _this.props.defaultHighlightedIndex,\n inputValue: _this.props.itemToString(selectedItem)\n }, otherStateToSet);\n }, cb);\n };\n _this.toggleMenu = function (otherStateToSet, cb) {\n if (otherStateToSet === void 0) {\n otherStateToSet = {};\n }\n otherStateToSet = pickState(otherStateToSet);\n _this.internalSetState(function (_ref9) {\n var isOpen = _ref9.isOpen;\n return _extends({\n isOpen: !isOpen\n }, isOpen && {\n highlightedIndex: _this.props.defaultHighlightedIndex\n }, otherStateToSet);\n }, function () {\n var _this$getState7 = _this.getState(),\n isOpen = _this$getState7.isOpen,\n highlightedIndex = _this$getState7.highlightedIndex;\n if (isOpen) {\n if (_this.getItemCount() > 0 && typeof highlightedIndex === 'number') {\n _this.setHighlightedIndex(highlightedIndex, otherStateToSet);\n }\n }\n cbToCb(cb)();\n });\n };\n _this.openMenu = function (cb) {\n _this.internalSetState({\n isOpen: true\n }, cb);\n };\n _this.closeMenu = function (cb) {\n _this.internalSetState({\n isOpen: false\n }, cb);\n };\n _this.updateStatus = debounce(function () {\n var _this$props;\n if (!((_this$props = _this.props) != null && (_this$props = _this$props.environment) != null && _this$props.document)) {\n return;\n }\n var state = _this.getState();\n var item = _this.items[state.highlightedIndex];\n var resultCount = _this.getItemCount();\n var status = _this.props.getA11yStatusMessage(_extends({\n itemToString: _this.props.itemToString,\n previousResultCount: _this.previousResultCount,\n resultCount: resultCount,\n highlightedItem: item\n }, state));\n _this.previousResultCount = resultCount;\n setStatus(status, _this.props.environment.document);\n }, 200);\n var _this$props2 = _this.props,\n defaultHighlightedIndex = _this$props2.defaultHighlightedIndex,\n _this$props2$initialH = _this$props2.initialHighlightedIndex,\n _highlightedIndex = _this$props2$initialH === void 0 ? defaultHighlightedIndex : _this$props2$initialH,\n defaultIsOpen = _this$props2.defaultIsOpen,\n _this$props2$initialI = _this$props2.initialIsOpen,\n _isOpen = _this$props2$initialI === void 0 ? defaultIsOpen : _this$props2$initialI,\n _this$props2$initialI2 = _this$props2.initialInputValue,\n _inputValue = _this$props2$initialI2 === void 0 ? '' : _this$props2$initialI2,\n _this$props2$initialS = _this$props2.initialSelectedItem,\n _selectedItem = _this$props2$initialS === void 0 ? null : _this$props2$initialS;\n var _state = _this.getState({\n highlightedIndex: _highlightedIndex,\n isOpen: _isOpen,\n inputValue: _inputValue,\n selectedItem: _selectedItem\n });\n if (_state.selectedItem != null && _this.props.initialInputValue === undefined) {\n _state.inputValue = _this.props.itemToString(_state.selectedItem);\n }\n _this.state = _state;\n return _this;\n }\n _inheritsLoose(Downshift, _Component);\n var _proto = Downshift.prototype;\n /**\n * Clear all running timeouts\n */\n _proto.internalClearTimeouts = function internalClearTimeouts() {\n this.timeoutIds.forEach(function (id) {\n clearTimeout(id);\n });\n this.timeoutIds = [];\n }\n\n /**\n * Gets the state based on internal state or props\n * If a state value is passed via props, then that\n * is the value given, otherwise it's retrieved from\n * stateToMerge\n *\n * @param {Object} stateToMerge defaults to this.state\n * @return {Object} the state\n */;\n _proto.getState = function getState$1(stateToMerge) {\n if (stateToMerge === void 0) {\n stateToMerge = this.state;\n }\n return getState(stateToMerge, this.props);\n };\n _proto.getItemCount = function getItemCount() {\n // things read better this way. They're in priority order:\n // 1. `this.itemCount`\n // 2. `this.props.itemCount`\n // 3. `this.items.length`\n var itemCount = this.items.length;\n if (this.itemCount != null) {\n itemCount = this.itemCount;\n } else if (this.props.itemCount !== undefined) {\n itemCount = this.props.itemCount;\n }\n return itemCount;\n };\n _proto.getItemNodeFromIndex = function getItemNodeFromIndex(index) {\n return this.props.environment ? this.props.environment.document.getElementById(this.getItemId(index)) : null;\n };\n _proto.scrollHighlightedItemIntoView = function scrollHighlightedItemIntoView() {\n /* istanbul ignore else (react-native) */\n {\n var node = this.getItemNodeFromIndex(this.getState().highlightedIndex);\n this.props.scrollIntoView(node, this._menuNode);\n }\n };\n _proto.moveHighlightedIndex = function moveHighlightedIndex(amount, otherStateToSet) {\n var itemCount = this.getItemCount();\n var _this$getState8 = this.getState(),\n highlightedIndex = _this$getState8.highlightedIndex;\n if (itemCount > 0) {\n var nextHighlightedIndex = getHighlightedIndex(highlightedIndex, amount, {\n length: itemCount\n }, this.isItemDisabled, true);\n this.setHighlightedIndex(nextHighlightedIndex, otherStateToSet);\n }\n };\n _proto.getStateAndHelpers = function getStateAndHelpers() {\n var _this$getState9 = this.getState(),\n highlightedIndex = _this$getState9.highlightedIndex,\n inputValue = _this$getState9.inputValue,\n selectedItem = _this$getState9.selectedItem,\n isOpen = _this$getState9.isOpen;\n var itemToString = this.props.itemToString;\n var id = this.id;\n var getRootProps = this.getRootProps,\n getToggleButtonProps = this.getToggleButtonProps,\n getLabelProps = this.getLabelProps,\n getMenuProps = this.getMenuProps,\n getInputProps = this.getInputProps,\n getItemProps = this.getItemProps,\n openMenu = this.openMenu,\n closeMenu = this.closeMenu,\n toggleMenu = this.toggleMenu,\n selectItem = this.selectItem,\n selectItemAtIndex = this.selectItemAtIndex,\n selectHighlightedItem = this.selectHighlightedItem,\n setHighlightedIndex = this.setHighlightedIndex,\n clearSelection = this.clearSelection,\n clearItems = this.clearItems,\n reset = this.reset,\n setItemCount = this.setItemCount,\n unsetItemCount = this.unsetItemCount,\n setState = this.internalSetState;\n return {\n // prop getters\n getRootProps: getRootProps,\n getToggleButtonProps: getToggleButtonProps,\n getLabelProps: getLabelProps,\n getMenuProps: getMenuProps,\n getInputProps: getInputProps,\n getItemProps: getItemProps,\n // actions\n reset: reset,\n openMenu: openMenu,\n closeMenu: closeMenu,\n toggleMenu: toggleMenu,\n selectItem: selectItem,\n selectItemAtIndex: selectItemAtIndex,\n selectHighlightedItem: selectHighlightedItem,\n setHighlightedIndex: setHighlightedIndex,\n clearSelection: clearSelection,\n clearItems: clearItems,\n setItemCount: setItemCount,\n unsetItemCount: unsetItemCount,\n setState: setState,\n // props\n itemToString: itemToString,\n // derived\n id: id,\n // state\n highlightedIndex: highlightedIndex,\n inputValue: inputValue,\n isOpen: isOpen,\n selectedItem: selectedItem\n };\n };\n _proto.componentDidMount = function componentDidMount() {\n var _this4 = this;\n /* istanbul ignore if (react-native) */\n if (process.env.NODE_ENV !== 'production' && !false && this.getMenuProps.called && !this.getMenuProps.suppressRefError) {\n validateGetMenuPropsCalledCorrectly(this._menuNode, this.getMenuProps);\n }\n\n /* istanbul ignore if (react-native or SSR) */\n if (!this.props.environment) {\n this.cleanup = function () {\n _this4.internalClearTimeouts();\n };\n } else {\n // this.isMouseDown helps us track whether the mouse is currently held down.\n // This is useful when the user clicks on an item in the list, but holds the mouse\n // down long enough for the list to disappear (because the blur event fires on the input)\n // this.isMouseDown is used in the blur handler on the input to determine whether the blur event should\n // trigger hiding the menu.\n var onMouseDown = function onMouseDown() {\n _this4.isMouseDown = true;\n };\n var onMouseUp = function onMouseUp(event) {\n _this4.isMouseDown = false;\n // if the target element or the activeElement is within a downshift node\n // then we don't want to reset downshift\n var contextWithinDownshift = targetWithinDownshift(event.target, [_this4._rootNode, _this4._menuNode], _this4.props.environment);\n if (!contextWithinDownshift && _this4.getState().isOpen) {\n _this4.reset({\n type: mouseUp\n }, function () {\n return _this4.props.onOuterClick(_this4.getStateAndHelpers());\n });\n }\n };\n // Touching an element in iOS gives focus and hover states, but touching out of\n // the element will remove hover, and persist the focus state, resulting in the\n // blur event not being triggered.\n // this.isTouchMove helps us track whether the user is tapping or swiping on a touch screen.\n // If the user taps outside of Downshift, the component should be reset,\n // but not if the user is swiping\n var onTouchStart = function onTouchStart() {\n _this4.isTouchMove = false;\n };\n var onTouchMove = function onTouchMove() {\n _this4.isTouchMove = true;\n };\n var onTouchEnd = function onTouchEnd(event) {\n var contextWithinDownshift = targetWithinDownshift(event.target, [_this4._rootNode, _this4._menuNode], _this4.props.environment, false);\n if (!_this4.isTouchMove && !contextWithinDownshift && _this4.getState().isOpen) {\n _this4.reset({\n type: touchEnd\n }, function () {\n return _this4.props.onOuterClick(_this4.getStateAndHelpers());\n });\n }\n };\n var environment = this.props.environment;\n environment.addEventListener('mousedown', onMouseDown);\n environment.addEventListener('mouseup', onMouseUp);\n environment.addEventListener('touchstart', onTouchStart);\n environment.addEventListener('touchmove', onTouchMove);\n environment.addEventListener('touchend', onTouchEnd);\n this.cleanup = function () {\n _this4.internalClearTimeouts();\n _this4.updateStatus.cancel();\n environment.removeEventListener('mousedown', onMouseDown);\n environment.removeEventListener('mouseup', onMouseUp);\n environment.removeEventListener('touchstart', onTouchStart);\n environment.removeEventListener('touchmove', onTouchMove);\n environment.removeEventListener('touchend', onTouchEnd);\n };\n }\n };\n _proto.shouldScroll = function shouldScroll(prevState, prevProps) {\n var _ref10 = this.props.highlightedIndex === undefined ? this.getState() : this.props,\n currentHighlightedIndex = _ref10.highlightedIndex;\n var _ref11 = prevProps.highlightedIndex === undefined ? prevState : prevProps,\n prevHighlightedIndex = _ref11.highlightedIndex;\n var scrollWhenOpen = currentHighlightedIndex && this.getState().isOpen && !prevState.isOpen;\n var scrollWhenNavigating = currentHighlightedIndex !== prevHighlightedIndex;\n return scrollWhenOpen || scrollWhenNavigating;\n };\n _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {\n if (process.env.NODE_ENV !== 'production') {\n validateControlledUnchanged(this.state, prevProps, this.props);\n /* istanbul ignore if (react-native) */\n if (this.getMenuProps.called && !this.getMenuProps.suppressRefError) {\n validateGetMenuPropsCalledCorrectly(this._menuNode, this.getMenuProps);\n }\n }\n if (isControlledProp(this.props, 'selectedItem') && this.props.selectedItemChanged(prevProps.selectedItem, this.props.selectedItem)) {\n this.internalSetState({\n type: controlledPropUpdatedSelectedItem,\n inputValue: this.props.itemToString(this.props.selectedItem)\n });\n }\n if (!this.avoidScrolling && this.shouldScroll(prevState, prevProps)) {\n this.scrollHighlightedItemIntoView();\n }\n\n /* istanbul ignore else (react-native) */\n {\n this.updateStatus();\n }\n };\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.cleanup(); // avoids memory leak\n };\n _proto.render = function render() {\n var children = unwrapArray(this.props.children, noop);\n // because the items are rerendered every time we call the children\n // we clear this out each render and it will be populated again as\n // getItemProps is called.\n this.clearItems();\n // we reset this so we know whether the user calls getRootProps during\n // this render. If they do then we don't need to do anything,\n // if they don't then we need to clone the element they return and\n // apply the props for them.\n this.getRootProps.called = false;\n this.getRootProps.refKey = undefined;\n this.getRootProps.suppressRefError = undefined;\n // we do something similar for getMenuProps\n this.getMenuProps.called = false;\n this.getMenuProps.refKey = undefined;\n this.getMenuProps.suppressRefError = undefined;\n // we do something similar for getLabelProps\n this.getLabelProps.called = false;\n // and something similar for getInputProps\n this.getInputProps.called = false;\n var element = unwrapArray(children(this.getStateAndHelpers()));\n if (!element) {\n return null;\n }\n if (this.getRootProps.called || this.props.suppressRefError) {\n if (process.env.NODE_ENV !== 'production' && !this.getRootProps.suppressRefError && !this.props.suppressRefError) {\n validateGetRootPropsCalledCorrectly(element, this.getRootProps);\n }\n return element;\n } else if (isDOMElement(element)) {\n // they didn't apply the root props, but we can clone\n // this and apply the props ourselves\n return /*#__PURE__*/cloneElement(element, this.getRootProps(getElementProps(element)));\n }\n\n /* istanbul ignore else */\n if (process.env.NODE_ENV !== 'production') {\n // they didn't apply the root props, but they need to\n // otherwise we can't query around the autocomplete\n\n throw new Error('downshift: If you return a non-DOM element, you must apply the getRootProps function');\n }\n\n /* istanbul ignore next */\n return undefined;\n };\n return Downshift;\n }(Component);\n Downshift.defaultProps = {\n defaultHighlightedIndex: null,\n defaultIsOpen: false,\n getA11yStatusMessage: getA11yStatusMessage,\n itemToString: function itemToString(i) {\n if (i == null) {\n return '';\n }\n if (process.env.NODE_ENV !== 'production' && isPlainObject(i) && !i.hasOwnProperty('toString')) {\n // eslint-disable-next-line no-console\n console.warn('downshift: An object was passed to the default implementation of `itemToString`. You should probably provide your own `itemToString` implementation. Please refer to the `itemToString` API documentation.', 'The object that was passed:', i);\n }\n return String(i);\n },\n onStateChange: noop,\n onInputValueChange: noop,\n onUserAction: noop,\n onChange: noop,\n onSelect: noop,\n onOuterClick: noop,\n selectedItemChanged: function selectedItemChanged(prevItem, item) {\n return prevItem !== item;\n },\n environment: /* istanbul ignore next (ssr) */\n typeof window === 'undefined' || false ? undefined : window,\n stateReducer: function stateReducer(state, stateToSet) {\n return stateToSet;\n },\n suppressRefError: false,\n scrollIntoView: scrollIntoView\n };\n Downshift.stateChangeTypes = stateChangeTypes$3;\n return Downshift;\n}();\nprocess.env.NODE_ENV !== \"production\" ? Downshift.propTypes = {\n children: PropTypes.func,\n defaultHighlightedIndex: PropTypes.number,\n defaultIsOpen: PropTypes.bool,\n initialHighlightedIndex: PropTypes.number,\n initialSelectedItem: PropTypes.any,\n initialInputValue: PropTypes.string,\n initialIsOpen: PropTypes.bool,\n getA11yStatusMessage: PropTypes.func,\n itemToString: PropTypes.func,\n onChange: PropTypes.func,\n onSelect: PropTypes.func,\n onStateChange: PropTypes.func,\n onInputValueChange: PropTypes.func,\n onUserAction: PropTypes.func,\n onOuterClick: PropTypes.func,\n selectedItemChanged: PropTypes.func,\n stateReducer: PropTypes.func,\n itemCount: PropTypes.number,\n id: PropTypes.string,\n environment: PropTypes.shape({\n addEventListener: PropTypes.func.isRequired,\n removeEventListener: PropTypes.func.isRequired,\n document: PropTypes.shape({\n createElement: PropTypes.func.isRequired,\n getElementById: PropTypes.func.isRequired,\n activeElement: PropTypes.any.isRequired,\n body: PropTypes.any.isRequired\n }).isRequired,\n Node: PropTypes.func.isRequired\n }),\n suppressRefError: PropTypes.bool,\n scrollIntoView: PropTypes.func,\n // things we keep in state for uncontrolled components\n // but can accept as props for controlled components\n /* eslint-disable react/no-unused-prop-types */\n selectedItem: PropTypes.any,\n isOpen: PropTypes.bool,\n inputValue: PropTypes.string,\n highlightedIndex: PropTypes.number,\n labelId: PropTypes.string,\n inputId: PropTypes.string,\n menuId: PropTypes.string,\n getItemId: PropTypes.func\n /* eslint-enable react/no-unused-prop-types */\n} : void 0;\nvar Downshift$1 = Downshift;\nfunction validateGetMenuPropsCalledCorrectly(node, _ref12) {\n var refKey = _ref12.refKey;\n if (!node) {\n // eslint-disable-next-line no-console\n console.error(\"downshift: The ref prop \\\"\" + refKey + \"\\\" from getMenuProps was not applied correctly on your menu element.\");\n }\n}\nfunction validateGetRootPropsCalledCorrectly(element, _ref13) {\n var refKey = _ref13.refKey;\n var refKeySpecified = refKey !== 'ref';\n var isComposite = !isDOMElement(element);\n if (isComposite && !refKeySpecified && !isForwardRef(element)) {\n // eslint-disable-next-line no-console\n console.error('downshift: You returned a non-DOM element. You must specify a refKey in getRootProps');\n } else if (!isComposite && refKeySpecified) {\n // eslint-disable-next-line no-console\n console.error(\"downshift: You returned a DOM element. You should not specify a refKey in getRootProps. You specified \\\"\" + refKey + \"\\\"\");\n }\n if (!isForwardRef(element) && !getElementProps(element)[refKey]) {\n // eslint-disable-next-line no-console\n console.error(\"downshift: You must apply the ref prop \\\"\" + refKey + \"\\\" from getRootProps onto your root element.\");\n }\n}\n\nvar dropdownDefaultStateValues = {\n highlightedIndex: -1,\n isOpen: false,\n selectedItem: null,\n inputValue: ''\n};\nfunction callOnChangeProps(action, state, newState) {\n var props = action.props,\n type = action.type;\n var changes = {};\n Object.keys(state).forEach(function (key) {\n invokeOnChangeHandler(key, action, state, newState);\n if (newState[key] !== state[key]) {\n changes[key] = newState[key];\n }\n });\n if (props.onStateChange && Object.keys(changes).length) {\n props.onStateChange(_extends({\n type: type\n }, changes));\n }\n}\nfunction invokeOnChangeHandler(key, action, state, newState) {\n var props = action.props,\n type = action.type;\n var handler = \"on\" + capitalizeString(key) + \"Change\";\n if (props[handler] && newState[key] !== undefined && newState[key] !== state[key]) {\n props[handler](_extends({\n type: type\n }, newState));\n }\n}\n\n/**\n * Default state reducer that returns the changes.\n *\n * @param {Object} s state.\n * @param {Object} a action with changes.\n * @returns {Object} changes.\n */\nfunction stateReducer(s, a) {\n return a.changes;\n}\n\n/**\n * Debounced call for updating the a11y message.\n */\nvar updateA11yStatus = debounce(function (status, document) {\n setStatus(status, document);\n}, 200);\n\n// istanbul ignore next\nvar useIsomorphicLayoutEffect = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined' ? useLayoutEffect : useEffect;\n\n// istanbul ignore next\nvar useElementIds = 'useId' in React // Avoid conditional useId call\n? function useElementIds(_ref) {\n var id = _ref.id,\n labelId = _ref.labelId,\n menuId = _ref.menuId,\n getItemId = _ref.getItemId,\n toggleButtonId = _ref.toggleButtonId,\n inputId = _ref.inputId;\n // Avoid conditional useId call\n var reactId = \"downshift-\" + React.useId();\n if (!id) {\n id = reactId;\n }\n var elementIdsRef = useRef({\n labelId: labelId || id + \"-label\",\n menuId: menuId || id + \"-menu\",\n getItemId: getItemId || function (index) {\n return id + \"-item-\" + index;\n },\n toggleButtonId: toggleButtonId || id + \"-toggle-button\",\n inputId: inputId || id + \"-input\"\n });\n return elementIdsRef.current;\n} : function useElementIds(_ref2) {\n var _ref2$id = _ref2.id,\n id = _ref2$id === void 0 ? \"downshift-\" + generateId() : _ref2$id,\n labelId = _ref2.labelId,\n menuId = _ref2.menuId,\n getItemId = _ref2.getItemId,\n toggleButtonId = _ref2.toggleButtonId,\n inputId = _ref2.inputId;\n var elementIdsRef = useRef({\n labelId: labelId || id + \"-label\",\n menuId: menuId || id + \"-menu\",\n getItemId: getItemId || function (index) {\n return id + \"-item-\" + index;\n },\n toggleButtonId: toggleButtonId || id + \"-toggle-button\",\n inputId: inputId || id + \"-input\"\n });\n return elementIdsRef.current;\n};\nfunction getItemAndIndex(itemProp, indexProp, items, errorMessage) {\n var item, index;\n if (itemProp === undefined) {\n if (indexProp === undefined) {\n throw new Error(errorMessage);\n }\n item = items[indexProp];\n index = indexProp;\n } else {\n index = indexProp === undefined ? items.indexOf(itemProp) : indexProp;\n item = itemProp;\n }\n return [item, index];\n}\nfunction isAcceptedCharacterKey(key) {\n return /^\\S{1}$/.test(key);\n}\nfunction capitalizeString(string) {\n return \"\" + string.slice(0, 1).toUpperCase() + string.slice(1);\n}\nfunction useLatestRef(val) {\n var ref = useRef(val);\n // technically this is not \"concurrent mode safe\" because we're manipulating\n // the value during render (so it's not idempotent). However, the places this\n // hook is used is to support memoizing callbacks which will be called\n // *during* render, so we need the latest values *during* render.\n // If not for this, then we'd probably want to use useLayoutEffect instead.\n ref.current = val;\n return ref;\n}\n\n/**\n * Computes the controlled state using a the previous state, props,\n * two reducers, one from downshift and an optional one from the user.\n * Also calls the onChange handlers for state values that have changed.\n *\n * @param {Function} reducer Reducer function from downshift.\n * @param {Object} props The hook props, also passed to createInitialState.\n * @param {Function} createInitialState Function that returns the initial state.\n * @param {Function} isStateEqual Function that checks if a previous state is equal to the next.\n * @returns {Array} An array with the state and an action dispatcher.\n */\nfunction useEnhancedReducer(reducer, props, createInitialState, isStateEqual) {\n var prevStateRef = useRef();\n var actionRef = useRef();\n var enhancedReducer = useCallback(function (state, action) {\n actionRef.current = action;\n state = getState(state, action.props);\n var changes = reducer(state, action);\n var newState = action.props.stateReducer(state, _extends({}, action, {\n changes: changes\n }));\n return newState;\n }, [reducer]);\n var _useReducer = useReducer(enhancedReducer, props, createInitialState),\n state = _useReducer[0],\n dispatch = _useReducer[1];\n var propsRef = useLatestRef(props);\n var dispatchWithProps = useCallback(function (action) {\n return dispatch(_extends({\n props: propsRef.current\n }, action));\n }, [propsRef]);\n var action = actionRef.current;\n useEffect(function () {\n var prevState = getState(prevStateRef.current, action == null ? void 0 : action.props);\n var shouldCallOnChangeProps = action && prevStateRef.current && !isStateEqual(prevState, state);\n if (shouldCallOnChangeProps) {\n callOnChangeProps(action, prevState, state);\n }\n prevStateRef.current = state;\n }, [state, action, isStateEqual]);\n return [state, dispatchWithProps];\n}\n\n/**\n * Wraps the useEnhancedReducer and applies the controlled prop values before\n * returning the new state.\n *\n * @param {Function} reducer Reducer function from downshift.\n * @param {Object} props The hook props, also passed to createInitialState.\n * @param {Function} createInitialState Function that returns the initial state.\n * @param {Function} isStateEqual Function that checks if a previous state is equal to the next.\n * @returns {Array} An array with the state and an action dispatcher.\n */\nfunction useControlledReducer$1(reducer, props, createInitialState, isStateEqual) {\n var _useEnhancedReducer = useEnhancedReducer(reducer, props, createInitialState, isStateEqual),\n state = _useEnhancedReducer[0],\n dispatch = _useEnhancedReducer[1];\n return [getState(state, props), dispatch];\n}\nvar defaultProps$3 = {\n itemToString: function itemToString(item) {\n return item ? String(item) : '';\n },\n itemToKey: function itemToKey(item) {\n return item;\n },\n stateReducer: stateReducer,\n scrollIntoView: scrollIntoView,\n environment: /* istanbul ignore next (ssr) */\n typeof window === 'undefined' || false ? undefined : window\n};\nfunction getDefaultValue$1(props, propKey, defaultStateValues) {\n if (defaultStateValues === void 0) {\n defaultStateValues = dropdownDefaultStateValues;\n }\n var defaultValue = props[\"default\" + capitalizeString(propKey)];\n if (defaultValue !== undefined) {\n return defaultValue;\n }\n return defaultStateValues[propKey];\n}\nfunction getInitialValue$1(props, propKey, defaultStateValues) {\n if (defaultStateValues === void 0) {\n defaultStateValues = dropdownDefaultStateValues;\n }\n var value = props[propKey];\n if (value !== undefined) {\n return value;\n }\n var initialValue = props[\"initial\" + capitalizeString(propKey)];\n if (initialValue !== undefined) {\n return initialValue;\n }\n return getDefaultValue$1(props, propKey, defaultStateValues);\n}\nfunction getInitialState$2(props) {\n var selectedItem = getInitialValue$1(props, 'selectedItem');\n var isOpen = getInitialValue$1(props, 'isOpen');\n var highlightedIndex = getInitialHighlightedIndex(props);\n var inputValue = getInitialValue$1(props, 'inputValue');\n return {\n highlightedIndex: highlightedIndex < 0 && selectedItem && isOpen ? props.items.findIndex(function (item) {\n return props.itemToKey(item) === props.itemToKey(selectedItem);\n }) : highlightedIndex,\n isOpen: isOpen,\n selectedItem: selectedItem,\n inputValue: inputValue\n };\n}\nfunction getHighlightedIndexOnOpen(props, state, offset) {\n var items = props.items,\n initialHighlightedIndex = props.initialHighlightedIndex,\n defaultHighlightedIndex = props.defaultHighlightedIndex,\n isItemDisabled = props.isItemDisabled,\n itemToKey = props.itemToKey;\n var selectedItem = state.selectedItem,\n highlightedIndex = state.highlightedIndex;\n if (items.length === 0) {\n return -1;\n }\n\n // initialHighlightedIndex will give value to highlightedIndex on initial state only.\n if (initialHighlightedIndex !== undefined && highlightedIndex === initialHighlightedIndex && !isItemDisabled(items[initialHighlightedIndex], initialHighlightedIndex)) {\n return initialHighlightedIndex;\n }\n if (defaultHighlightedIndex !== undefined && !isItemDisabled(items[defaultHighlightedIndex], defaultHighlightedIndex)) {\n return defaultHighlightedIndex;\n }\n if (selectedItem) {\n return items.findIndex(function (item) {\n return itemToKey(selectedItem) === itemToKey(item);\n });\n }\n if (offset < 0 && !isItemDisabled(items[items.length - 1], items.length - 1)) {\n return items.length - 1;\n }\n if (offset > 0 && !isItemDisabled(items[0], 0)) {\n return 0;\n }\n return -1;\n}\n/**\n * Tracks mouse and touch events, such as mouseDown, touchMove and touchEnd.\n *\n * @param {Window} environment The environment to add the event listeners to, for instance window.\n * @param {() => void} handleBlur The function that is called if mouseDown or touchEnd occured outside the downshiftElements.\n * @param {Array<{current: HTMLElement}>} downshiftElementsRefs The refs for the elements that should not trigger a blur action from mouseDown or touchEnd.\n * @returns {{isMouseDown: boolean, isTouchMove: boolean, isTouchEnd: boolean}} The mouse and touch events information, if any of are happening.\n */\nfunction useMouseAndTouchTracker(environment, handleBlur, downshiftElementsRefs) {\n var mouseAndTouchTrackersRef = useRef({\n isMouseDown: false,\n isTouchMove: false,\n isTouchEnd: false\n });\n useEffect(function () {\n if (!environment) {\n return noop;\n }\n var downshiftElements = downshiftElementsRefs.map(function (ref) {\n return ref.current;\n });\n function onMouseDown() {\n mouseAndTouchTrackersRef.current.isTouchEnd = false; // reset this one.\n mouseAndTouchTrackersRef.current.isMouseDown = true;\n }\n function onMouseUp(event) {\n mouseAndTouchTrackersRef.current.isMouseDown = false;\n if (!targetWithinDownshift(event.target, downshiftElements, environment)) {\n handleBlur();\n }\n }\n function onTouchStart() {\n mouseAndTouchTrackersRef.current.isTouchEnd = false;\n mouseAndTouchTrackersRef.current.isTouchMove = false;\n }\n function onTouchMove() {\n mouseAndTouchTrackersRef.current.isTouchMove = true;\n }\n function onTouchEnd(event) {\n mouseAndTouchTrackersRef.current.isTouchEnd = true;\n if (!mouseAndTouchTrackersRef.current.isTouchMove && !targetWithinDownshift(event.target, downshiftElements, environment, false)) {\n handleBlur();\n }\n }\n environment.addEventListener('mousedown', onMouseDown);\n environment.addEventListener('mouseup', onMouseUp);\n environment.addEventListener('touchstart', onTouchStart);\n environment.addEventListener('touchmove', onTouchMove);\n environment.addEventListener('touchend', onTouchEnd);\n return function cleanup() {\n environment.removeEventListener('mousedown', onMouseDown);\n environment.removeEventListener('mouseup', onMouseUp);\n environment.removeEventListener('touchstart', onTouchStart);\n environment.removeEventListener('touchmove', onTouchMove);\n environment.removeEventListener('touchend', onTouchEnd);\n };\n }, [downshiftElementsRefs, environment, handleBlur]);\n return mouseAndTouchTrackersRef.current;\n}\n\n/* istanbul ignore next */\n// eslint-disable-next-line import/no-mutable-exports\nvar useGetterPropsCalledChecker = function useGetterPropsCalledChecker() {\n return noop;\n};\n/**\n * Custom hook that checks if getter props are called correctly.\n *\n * @param {...any} propKeys Getter prop names to be handled.\n * @returns {Function} Setter function called inside getter props to set call information.\n */\n/* istanbul ignore next */\nif (process.env.NODE_ENV !== 'production') {\n useGetterPropsCalledChecker = function useGetterPropsCalledChecker() {\n for (var _len = arguments.length, propKeys = new Array(_len), _key = 0; _key < _len; _key++) {\n propKeys[_key] = arguments[_key];\n }\n var getterPropsCalledRef = useRef(propKeys.reduce(function (acc, propKey) {\n acc[propKey] = {};\n return acc;\n }, {}));\n useEffect(function () {\n Object.keys(getterPropsCalledRef.current).forEach(function (propKey) {\n var propCallInfo = getterPropsCalledRef.current[propKey];\n if (!Object.keys(propCallInfo).length) {\n // eslint-disable-next-line no-console\n console.error(\"downshift: You forgot to call the \" + propKey + \" getter function on your component / element.\");\n return;\n }\n var suppressRefError = propCallInfo.suppressRefError,\n refKey = propCallInfo.refKey,\n elementRef = propCallInfo.elementRef;\n if (suppressRefError) {\n return;\n }\n if (!(elementRef != null && elementRef.current)) {\n // eslint-disable-next-line no-console\n console.error(\"downshift: The ref prop \\\"\" + refKey + \"\\\" from \" + propKey + \" was not applied correctly on your element.\");\n }\n });\n }, []);\n var setGetterPropCallInfo = useCallback(function (propKey, suppressRefError, refKey, elementRef) {\n getterPropsCalledRef.current[propKey] = {\n suppressRefError: suppressRefError,\n refKey: refKey,\n elementRef: elementRef\n };\n }, []);\n return setGetterPropCallInfo;\n };\n}\n\n/**\n * Adds an a11y aria live status message if getA11yStatusMessage is passed.\n * @param {(options: Object) => string} getA11yStatusMessage The function that builds the status message.\n * @param {Object} options The options to be passed to getA11yStatusMessage if called.\n * @param {Array} dependencyArray The dependency array that triggers the status message setter via useEffect.\n * @param {{document: Document}} environment The environment object containing the document.\n */\nfunction useA11yMessageStatus(getA11yStatusMessage, options, dependencyArray, environment) {\n if (environment === void 0) {\n environment = {};\n }\n var document = environment.document;\n var isInitialMount = useIsInitialMount();\n\n // Adds an a11y aria live status message if getA11yStatusMessage is passed.\n useEffect(function () {\n if (!getA11yStatusMessage || isInitialMount || false || !document) {\n return;\n }\n var status = getA11yStatusMessage(options);\n updateA11yStatus(status, document);\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencyArray);\n\n // Cleanup the status message container.\n useEffect(function () {\n return function () {\n updateA11yStatus.cancel();\n cleanupStatusDiv(document);\n };\n }, [document]);\n}\nfunction useScrollIntoView(_ref3) {\n var highlightedIndex = _ref3.highlightedIndex,\n isOpen = _ref3.isOpen,\n itemRefs = _ref3.itemRefs,\n getItemNodeFromIndex = _ref3.getItemNodeFromIndex,\n menuElement = _ref3.menuElement,\n scrollIntoViewProp = _ref3.scrollIntoView;\n // used not to scroll on highlight by mouse.\n var shouldScrollRef = useRef(true);\n // Scroll on highlighted item if change comes from keyboard.\n useIsomorphicLayoutEffect(function () {\n if (highlightedIndex < 0 || !isOpen || !Object.keys(itemRefs.current).length) {\n return;\n }\n if (shouldScrollRef.current === false) {\n shouldScrollRef.current = true;\n } else {\n scrollIntoViewProp(getItemNodeFromIndex(highlightedIndex), menuElement);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [highlightedIndex]);\n return shouldScrollRef;\n}\n\n// eslint-disable-next-line import/no-mutable-exports\nvar useControlPropsValidator = noop;\n/* istanbul ignore next */\nif (process.env.NODE_ENV !== 'production') {\n useControlPropsValidator = function useControlPropsValidator(_ref4) {\n var props = _ref4.props,\n state = _ref4.state;\n // used for checking when props are moving from controlled to uncontrolled.\n var prevPropsRef = useRef(props);\n var isInitialMount = useIsInitialMount();\n useEffect(function () {\n if (isInitialMount) {\n return;\n }\n validateControlledUnchanged(state, prevPropsRef.current, props);\n prevPropsRef.current = props;\n }, [state, props, isInitialMount]);\n };\n}\n\n/**\n * Handles selection on Enter / Alt + ArrowUp. Closes the menu and resets the highlighted index, unless there is a highlighted.\n * In that case, selects the item and resets to defaults for open state and highlighted idex.\n * @param {Object} props The useCombobox props.\n * @param {number} highlightedIndex The index from the state.\n * @param {boolean} inputValue Also return the input value for state.\n * @returns The changes for the state.\n */\nfunction getChangesOnSelection(props, highlightedIndex, inputValue) {\n var _props$items;\n if (inputValue === void 0) {\n inputValue = true;\n }\n var shouldSelect = ((_props$items = props.items) == null ? void 0 : _props$items.length) && highlightedIndex >= 0;\n return _extends({\n isOpen: false,\n highlightedIndex: -1\n }, shouldSelect && _extends({\n selectedItem: props.items[highlightedIndex],\n isOpen: getDefaultValue$1(props, 'isOpen'),\n highlightedIndex: getDefaultValue$1(props, 'highlightedIndex')\n }, inputValue && {\n inputValue: props.itemToString(props.items[highlightedIndex])\n }));\n}\n\n/**\n * Check if a state is equal for dropdowns, by comparing isOpen, inputValue, highlightedIndex and selected item.\n * Used by useSelect and useCombobox.\n *\n * @param {Object} prevState\n * @param {Object} newState\n * @returns {boolean} Wheather the states are deeply equal.\n */\nfunction isDropdownsStateEqual(prevState, newState) {\n return prevState.isOpen === newState.isOpen && prevState.inputValue === newState.inputValue && prevState.highlightedIndex === newState.highlightedIndex && prevState.selectedItem === newState.selectedItem;\n}\n\n/**\n * Tracks if it's the first render.\n */\nfunction useIsInitialMount() {\n var isInitialMountRef = React.useRef(true);\n React.useEffect(function () {\n isInitialMountRef.current = false;\n return function () {\n isInitialMountRef.current = true;\n };\n }, []);\n return isInitialMountRef.current;\n}\n\n/**\n * Returns the new highlightedIndex based on the defaultHighlightedIndex prop, if it's not disabled.\n *\n * @param {Object} props Props from useCombobox or useSelect.\n * @returns {number} The highlighted index.\n */\nfunction getDefaultHighlightedIndex(props) {\n var highlightedIndex = getDefaultValue$1(props, 'highlightedIndex');\n if (highlightedIndex > -1 && props.isItemDisabled(props.items[highlightedIndex], highlightedIndex)) {\n return -1;\n }\n return highlightedIndex;\n}\n\n/**\n * Returns the new highlightedIndex based on the initialHighlightedIndex prop, if not disabled.\n *\n * @param {Object} props Props from useCombobox or useSelect.\n * @returns {number} The highlighted index.\n */\nfunction getInitialHighlightedIndex(props) {\n var highlightedIndex = getInitialValue$1(props, 'highlightedIndex');\n if (highlightedIndex > -1 && props.isItemDisabled(props.items[highlightedIndex], highlightedIndex)) {\n return -1;\n }\n return highlightedIndex;\n}\n\n// Shared between all exports.\nvar commonPropTypes = {\n environment: PropTypes.shape({\n addEventListener: PropTypes.func.isRequired,\n removeEventListener: PropTypes.func.isRequired,\n document: PropTypes.shape({\n createElement: PropTypes.func.isRequired,\n getElementById: PropTypes.func.isRequired,\n activeElement: PropTypes.any.isRequired,\n body: PropTypes.any.isRequired\n }).isRequired,\n Node: PropTypes.func.isRequired\n }),\n itemToString: PropTypes.func,\n itemToKey: PropTypes.func,\n stateReducer: PropTypes.func\n};\n\n// Shared between useSelect, useCombobox, Downshift.\nvar commonDropdownPropTypes = _extends({}, commonPropTypes, {\n getA11yStatusMessage: PropTypes.func,\n highlightedIndex: PropTypes.number,\n defaultHighlightedIndex: PropTypes.number,\n initialHighlightedIndex: PropTypes.number,\n isOpen: PropTypes.bool,\n defaultIsOpen: PropTypes.bool,\n initialIsOpen: PropTypes.bool,\n selectedItem: PropTypes.any,\n initialSelectedItem: PropTypes.any,\n defaultSelectedItem: PropTypes.any,\n id: PropTypes.string,\n labelId: PropTypes.string,\n menuId: PropTypes.string,\n getItemId: PropTypes.func,\n toggleButtonId: PropTypes.string,\n onSelectedItemChange: PropTypes.func,\n onHighlightedIndexChange: PropTypes.func,\n onStateChange: PropTypes.func,\n onIsOpenChange: PropTypes.func,\n scrollIntoView: PropTypes.func\n});\n\nfunction downshiftCommonReducer(state, action, stateChangeTypes) {\n var type = action.type,\n props = action.props;\n var changes;\n switch (type) {\n case stateChangeTypes.ItemMouseMove:\n changes = {\n highlightedIndex: action.disabled ? -1 : action.index\n };\n break;\n case stateChangeTypes.MenuMouseLeave:\n changes = {\n highlightedIndex: -1\n };\n break;\n case stateChangeTypes.ToggleButtonClick:\n case stateChangeTypes.FunctionToggleMenu:\n changes = {\n isOpen: !state.isOpen,\n highlightedIndex: state.isOpen ? -1 : getHighlightedIndexOnOpen(props, state, 0)\n };\n break;\n case stateChangeTypes.FunctionOpenMenu:\n changes = {\n isOpen: true,\n highlightedIndex: getHighlightedIndexOnOpen(props, state, 0)\n };\n break;\n case stateChangeTypes.FunctionCloseMenu:\n changes = {\n isOpen: false\n };\n break;\n case stateChangeTypes.FunctionSetHighlightedIndex:\n changes = {\n highlightedIndex: props.isItemDisabled(props.items[action.highlightedIndex], action.highlightedIndex) ? -1 : action.highlightedIndex\n };\n break;\n case stateChangeTypes.FunctionSetInputValue:\n changes = {\n inputValue: action.inputValue\n };\n break;\n case stateChangeTypes.FunctionReset:\n changes = {\n highlightedIndex: getDefaultHighlightedIndex(props),\n isOpen: getDefaultValue$1(props, 'isOpen'),\n selectedItem: getDefaultValue$1(props, 'selectedItem'),\n inputValue: getDefaultValue$1(props, 'inputValue')\n };\n break;\n default:\n throw new Error('Reducer called without proper action type.');\n }\n return _extends({}, state, changes);\n}\n/* eslint-enable complexity */\n\nfunction getItemIndexByCharacterKey(_a) {\n var keysSoFar = _a.keysSoFar, highlightedIndex = _a.highlightedIndex, items = _a.items, itemToString = _a.itemToString, isItemDisabled = _a.isItemDisabled;\n var lowerCasedKeysSoFar = keysSoFar.toLowerCase();\n for (var index = 0; index < items.length; index++) {\n // if we already have a search query in progress, we also consider the current highlighted item.\n var offsetIndex = (index + highlightedIndex + (keysSoFar.length < 2 ? 1 : 0)) % items.length;\n var item = items[offsetIndex];\n if (item !== undefined &&\n itemToString(item).toLowerCase().startsWith(lowerCasedKeysSoFar) &&\n !isItemDisabled(item, offsetIndex)) {\n return offsetIndex;\n }\n }\n return highlightedIndex;\n}\nvar propTypes$2 = __assign(__assign({}, commonDropdownPropTypes), { items: PropTypes.array.isRequired, isItemDisabled: PropTypes.func });\nvar defaultProps$2 = __assign(__assign({}, defaultProps$3), { isItemDisabled: function () {\n return false;\n } });\n// eslint-disable-next-line import/no-mutable-exports\nvar validatePropTypes$2 = noop;\n/* istanbul ignore next */\nif (process.env.NODE_ENV !== 'production') {\n validatePropTypes$2 = function (options, caller) {\n PropTypes.checkPropTypes(propTypes$2, options, 'prop', caller.name);\n };\n}\n\nvar ToggleButtonClick$1 = process.env.NODE_ENV !== \"production\" ? '__togglebutton_click__' : 0;\nvar ToggleButtonKeyDownArrowDown = process.env.NODE_ENV !== \"production\" ? '__togglebutton_keydown_arrow_down__' : 1;\nvar ToggleButtonKeyDownArrowUp = process.env.NODE_ENV !== \"production\" ? '__togglebutton_keydown_arrow_up__' : 2;\nvar ToggleButtonKeyDownCharacter = process.env.NODE_ENV !== \"production\" ? '__togglebutton_keydown_character__' : 3;\nvar ToggleButtonKeyDownEscape = process.env.NODE_ENV !== \"production\" ? '__togglebutton_keydown_escape__' : 4;\nvar ToggleButtonKeyDownHome = process.env.NODE_ENV !== \"production\" ? '__togglebutton_keydown_home__' : 5;\nvar ToggleButtonKeyDownEnd = process.env.NODE_ENV !== \"production\" ? '__togglebutton_keydown_end__' : 6;\nvar ToggleButtonKeyDownEnter = process.env.NODE_ENV !== \"production\" ? '__togglebutton_keydown_enter__' : 7;\nvar ToggleButtonKeyDownSpaceButton = process.env.NODE_ENV !== \"production\" ? '__togglebutton_keydown_space_button__' : 8;\nvar ToggleButtonKeyDownPageUp = process.env.NODE_ENV !== \"production\" ? '__togglebutton_keydown_page_up__' : 9;\nvar ToggleButtonKeyDownPageDown = process.env.NODE_ENV !== \"production\" ? '__togglebutton_keydown_page_down__' : 10;\nvar ToggleButtonBlur = process.env.NODE_ENV !== \"production\" ? '__togglebutton_blur__' : 11;\nvar MenuMouseLeave$1 = process.env.NODE_ENV !== \"production\" ? '__menu_mouse_leave__' : 12;\nvar ItemMouseMove$1 = process.env.NODE_ENV !== \"production\" ? '__item_mouse_move__' : 13;\nvar ItemClick$1 = process.env.NODE_ENV !== \"production\" ? '__item_click__' : 14;\nvar FunctionToggleMenu$1 = process.env.NODE_ENV !== \"production\" ? '__function_toggle_menu__' : 15;\nvar FunctionOpenMenu$1 = process.env.NODE_ENV !== \"production\" ? '__function_open_menu__' : 16;\nvar FunctionCloseMenu$1 = process.env.NODE_ENV !== \"production\" ? '__function_close_menu__' : 17;\nvar FunctionSetHighlightedIndex$1 = process.env.NODE_ENV !== \"production\" ? '__function_set_highlighted_index__' : 18;\nvar FunctionSelectItem$1 = process.env.NODE_ENV !== \"production\" ? '__function_select_item__' : 19;\nvar FunctionSetInputValue$1 = process.env.NODE_ENV !== \"production\" ? '__function_set_input_value__' : 20;\nvar FunctionReset$2 = process.env.NODE_ENV !== \"production\" ? '__function_reset__' : 21;\n\nvar stateChangeTypes$2 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n FunctionCloseMenu: FunctionCloseMenu$1,\n FunctionOpenMenu: FunctionOpenMenu$1,\n FunctionReset: FunctionReset$2,\n FunctionSelectItem: FunctionSelectItem$1,\n FunctionSetHighlightedIndex: FunctionSetHighlightedIndex$1,\n FunctionSetInputValue: FunctionSetInputValue$1,\n FunctionToggleMenu: FunctionToggleMenu$1,\n ItemClick: ItemClick$1,\n ItemMouseMove: ItemMouseMove$1,\n MenuMouseLeave: MenuMouseLeave$1,\n ToggleButtonBlur: ToggleButtonBlur,\n ToggleButtonClick: ToggleButtonClick$1,\n ToggleButtonKeyDownArrowDown: ToggleButtonKeyDownArrowDown,\n ToggleButtonKeyDownArrowUp: ToggleButtonKeyDownArrowUp,\n ToggleButtonKeyDownCharacter: ToggleButtonKeyDownCharacter,\n ToggleButtonKeyDownEnd: ToggleButtonKeyDownEnd,\n ToggleButtonKeyDownEnter: ToggleButtonKeyDownEnter,\n ToggleButtonKeyDownEscape: ToggleButtonKeyDownEscape,\n ToggleButtonKeyDownHome: ToggleButtonKeyDownHome,\n ToggleButtonKeyDownPageDown: ToggleButtonKeyDownPageDown,\n ToggleButtonKeyDownPageUp: ToggleButtonKeyDownPageUp,\n ToggleButtonKeyDownSpaceButton: ToggleButtonKeyDownSpaceButton\n});\n\n/* eslint-disable complexity */\nfunction downshiftSelectReducer(state, action) {\n var _props$items;\n var type = action.type,\n props = action.props,\n altKey = action.altKey;\n var changes;\n switch (type) {\n case ItemClick$1:\n changes = {\n isOpen: getDefaultValue$1(props, 'isOpen'),\n highlightedIndex: getDefaultHighlightedIndex(props),\n selectedItem: props.items[action.index]\n };\n break;\n case ToggleButtonKeyDownCharacter:\n {\n var lowercasedKey = action.key;\n var inputValue = \"\" + state.inputValue + lowercasedKey;\n var prevHighlightedIndex = !state.isOpen && state.selectedItem ? props.items.findIndex(function (item) {\n return props.itemToKey(item) === props.itemToKey(state.selectedItem);\n }) : state.highlightedIndex;\n var highlightedIndex = getItemIndexByCharacterKey({\n keysSoFar: inputValue,\n highlightedIndex: prevHighlightedIndex,\n items: props.items,\n itemToString: props.itemToString,\n isItemDisabled: props.isItemDisabled\n });\n changes = {\n inputValue: inputValue,\n highlightedIndex: highlightedIndex,\n isOpen: true\n };\n }\n break;\n case ToggleButtonKeyDownArrowDown:\n {\n var _highlightedIndex = state.isOpen ? getHighlightedIndex(state.highlightedIndex, 1, props.items, props.isItemDisabled) : altKey && state.selectedItem == null ? -1 : getHighlightedIndexOnOpen(props, state, 1);\n changes = {\n highlightedIndex: _highlightedIndex,\n isOpen: true\n };\n }\n break;\n case ToggleButtonKeyDownArrowUp:\n if (state.isOpen && altKey) {\n changes = getChangesOnSelection(props, state.highlightedIndex, false);\n } else {\n var _highlightedIndex2 = state.isOpen ? getHighlightedIndex(state.highlightedIndex, -1, props.items, props.isItemDisabled) : getHighlightedIndexOnOpen(props, state, -1);\n changes = {\n highlightedIndex: _highlightedIndex2,\n isOpen: true\n };\n }\n break;\n // only triggered when menu is open.\n case ToggleButtonKeyDownEnter:\n case ToggleButtonKeyDownSpaceButton:\n changes = getChangesOnSelection(props, state.highlightedIndex, false);\n break;\n case ToggleButtonKeyDownHome:\n changes = {\n highlightedIndex: getNonDisabledIndex(0, false, props.items, props.isItemDisabled),\n isOpen: true\n };\n break;\n case ToggleButtonKeyDownEnd:\n changes = {\n highlightedIndex: getNonDisabledIndex(props.items.length - 1, true, props.items, props.isItemDisabled),\n isOpen: true\n };\n break;\n case ToggleButtonKeyDownPageUp:\n changes = {\n highlightedIndex: getHighlightedIndex(state.highlightedIndex, -10, props.items, props.isItemDisabled)\n };\n break;\n case ToggleButtonKeyDownPageDown:\n changes = {\n highlightedIndex: getHighlightedIndex(state.highlightedIndex, 10, props.items, props.isItemDisabled)\n };\n break;\n case ToggleButtonKeyDownEscape:\n changes = {\n isOpen: false,\n highlightedIndex: -1\n };\n break;\n case ToggleButtonBlur:\n changes = _extends({\n isOpen: false,\n highlightedIndex: -1\n }, state.highlightedIndex >= 0 && ((_props$items = props.items) == null ? void 0 : _props$items.length) && {\n selectedItem: props.items[state.highlightedIndex]\n });\n break;\n case FunctionSelectItem$1:\n changes = {\n selectedItem: action.selectedItem\n };\n break;\n default:\n return downshiftCommonReducer(state, action, stateChangeTypes$2);\n }\n return _extends({}, state, changes);\n}\n/* eslint-enable complexity */\n\nvar _excluded$2 = [\"onClick\"],\n _excluded2$2 = [\"onMouseLeave\", \"refKey\", \"ref\"],\n _excluded3$1 = [\"onBlur\", \"onClick\", \"onPress\", \"onKeyDown\", \"refKey\", \"ref\"],\n _excluded4$1 = [\"item\", \"index\", \"onMouseMove\", \"onClick\", \"onMouseDown\", \"onPress\", \"refKey\", \"disabled\", \"ref\"];\nuseSelect.stateChangeTypes = stateChangeTypes$2;\nfunction useSelect(userProps) {\n if (userProps === void 0) {\n userProps = {};\n }\n validatePropTypes$2(userProps, useSelect);\n // Props defaults and destructuring.\n var props = _extends({}, defaultProps$2, userProps);\n var scrollIntoView = props.scrollIntoView,\n environment = props.environment,\n getA11yStatusMessage = props.getA11yStatusMessage;\n // Initial state depending on controlled props.\n var _useControlledReducer = useControlledReducer$1(downshiftSelectReducer, props, getInitialState$2, isDropdownsStateEqual),\n state = _useControlledReducer[0],\n dispatch = _useControlledReducer[1];\n var isOpen = state.isOpen,\n highlightedIndex = state.highlightedIndex,\n selectedItem = state.selectedItem,\n inputValue = state.inputValue;\n // Element efs.\n var toggleButtonRef = useRef(null);\n var menuRef = useRef(null);\n var itemRefs = useRef({});\n\n // used to keep the inputValue clearTimeout object between renders.\n var clearTimeoutRef = useRef(null);\n // prevent id re-generation between renders.\n var elementIds = useElementIds(props);\n // utility callback to get item element.\n var latest = useLatestRef({\n state: state,\n props: props\n });\n\n // Some utils.\n var getItemNodeFromIndex = useCallback(function (index) {\n return itemRefs.current[elementIds.getItemId(index)];\n }, [elementIds]);\n\n // Effects.\n // Adds an a11y aria live status message if getA11yStatusMessage is passed.\n useA11yMessageStatus(getA11yStatusMessage, state, [isOpen, highlightedIndex, selectedItem, inputValue], environment);\n // Scroll on highlighted item if change comes from keyboard.\n var shouldScrollRef = useScrollIntoView({\n menuElement: menuRef.current,\n highlightedIndex: highlightedIndex,\n isOpen: isOpen,\n itemRefs: itemRefs,\n scrollIntoView: scrollIntoView,\n getItemNodeFromIndex: getItemNodeFromIndex\n });\n // Sets cleanup for the keysSoFar callback, debounded after 500ms.\n useEffect(function () {\n // init the clean function here as we need access to dispatch.\n clearTimeoutRef.current = debounce(function (outerDispatch) {\n outerDispatch({\n type: FunctionSetInputValue$1,\n inputValue: ''\n });\n }, 500);\n\n // Cancel any pending debounced calls on mount\n return function () {\n clearTimeoutRef.current.cancel();\n };\n }, []);\n // Invokes the keysSoFar callback set up above.\n useEffect(function () {\n if (!inputValue) {\n return;\n }\n clearTimeoutRef.current(dispatch);\n }, [dispatch, inputValue]);\n useControlPropsValidator({\n props: props,\n state: state\n });\n // Focus the toggle button on first render if required.\n useEffect(function () {\n var focusOnOpen = getInitialValue$1(props, 'isOpen');\n if (focusOnOpen && toggleButtonRef.current) {\n toggleButtonRef.current.focus();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n var mouseAndTouchTrackers = useMouseAndTouchTracker(environment, useCallback(function handleBlur() {\n if (latest.current.state.isOpen) {\n dispatch({\n type: ToggleButtonBlur\n });\n }\n }, [dispatch, latest]), useMemo(function () {\n return [menuRef, toggleButtonRef];\n }, [menuRef.current, toggleButtonRef.current]));\n var setGetterPropCallInfo = useGetterPropsCalledChecker('getMenuProps', 'getToggleButtonProps');\n // Reset itemRefs on close.\n useEffect(function () {\n if (!isOpen) {\n itemRefs.current = {};\n }\n }, [isOpen]);\n\n // Event handler functions.\n var toggleButtonKeyDownHandlers = useMemo(function () {\n return {\n ArrowDown: function ArrowDown(event) {\n event.preventDefault();\n dispatch({\n type: ToggleButtonKeyDownArrowDown,\n altKey: event.altKey\n });\n },\n ArrowUp: function ArrowUp(event) {\n event.preventDefault();\n dispatch({\n type: ToggleButtonKeyDownArrowUp,\n altKey: event.altKey\n });\n },\n Home: function Home(event) {\n event.preventDefault();\n dispatch({\n type: ToggleButtonKeyDownHome\n });\n },\n End: function End(event) {\n event.preventDefault();\n dispatch({\n type: ToggleButtonKeyDownEnd\n });\n },\n Escape: function Escape() {\n if (latest.current.state.isOpen) {\n dispatch({\n type: ToggleButtonKeyDownEscape\n });\n }\n },\n Enter: function Enter(event) {\n event.preventDefault();\n dispatch({\n type: latest.current.state.isOpen ? ToggleButtonKeyDownEnter : ToggleButtonClick$1\n });\n },\n PageUp: function PageUp(event) {\n if (latest.current.state.isOpen) {\n event.preventDefault();\n dispatch({\n type: ToggleButtonKeyDownPageUp\n });\n }\n },\n PageDown: function PageDown(event) {\n if (latest.current.state.isOpen) {\n event.preventDefault();\n dispatch({\n type: ToggleButtonKeyDownPageDown\n });\n }\n },\n ' ': function _(event) {\n event.preventDefault();\n var currentState = latest.current.state;\n if (!currentState.isOpen) {\n dispatch({\n type: ToggleButtonClick$1\n });\n return;\n }\n if (currentState.inputValue) {\n dispatch({\n type: ToggleButtonKeyDownCharacter,\n key: ' '\n });\n } else {\n dispatch({\n type: ToggleButtonKeyDownSpaceButton\n });\n }\n }\n };\n }, [dispatch, latest]);\n\n // Action functions.\n var toggleMenu = useCallback(function () {\n dispatch({\n type: FunctionToggleMenu$1\n });\n }, [dispatch]);\n var closeMenu = useCallback(function () {\n dispatch({\n type: FunctionCloseMenu$1\n });\n }, [dispatch]);\n var openMenu = useCallback(function () {\n dispatch({\n type: FunctionOpenMenu$1\n });\n }, [dispatch]);\n var setHighlightedIndex = useCallback(function (newHighlightedIndex) {\n dispatch({\n type: FunctionSetHighlightedIndex$1,\n highlightedIndex: newHighlightedIndex\n });\n }, [dispatch]);\n var selectItem = useCallback(function (newSelectedItem) {\n dispatch({\n type: FunctionSelectItem$1,\n selectedItem: newSelectedItem\n });\n }, [dispatch]);\n var reset = useCallback(function () {\n dispatch({\n type: FunctionReset$2\n });\n }, [dispatch]);\n var setInputValue = useCallback(function (newInputValue) {\n dispatch({\n type: FunctionSetInputValue$1,\n inputValue: newInputValue\n });\n }, [dispatch]);\n // Getter functions.\n var getLabelProps = useCallback(function (_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n onClick = _ref.onClick,\n labelProps = _objectWithoutPropertiesLoose(_ref, _excluded$2);\n var labelHandleClick = function labelHandleClick() {\n var _toggleButtonRef$curr;\n (_toggleButtonRef$curr = toggleButtonRef.current) == null || _toggleButtonRef$curr.focus();\n };\n return _extends({\n id: elementIds.labelId,\n htmlFor: elementIds.toggleButtonId,\n onClick: callAllEventHandlers(onClick, labelHandleClick)\n }, labelProps);\n }, [elementIds]);\n var getMenuProps = useCallback(function (_temp2, _temp3) {\n var _extends2;\n var _ref2 = _temp2 === void 0 ? {} : _temp2,\n onMouseLeave = _ref2.onMouseLeave,\n _ref2$refKey = _ref2.refKey,\n refKey = _ref2$refKey === void 0 ? 'ref' : _ref2$refKey,\n ref = _ref2.ref,\n rest = _objectWithoutPropertiesLoose(_ref2, _excluded2$2);\n var _ref3 = _temp3 === void 0 ? {} : _temp3,\n _ref3$suppressRefErro = _ref3.suppressRefError,\n suppressRefError = _ref3$suppressRefErro === void 0 ? false : _ref3$suppressRefErro;\n var menuHandleMouseLeave = function menuHandleMouseLeave() {\n dispatch({\n type: MenuMouseLeave$1\n });\n };\n setGetterPropCallInfo('getMenuProps', suppressRefError, refKey, menuRef);\n return _extends((_extends2 = {}, _extends2[refKey] = handleRefs(ref, function (menuNode) {\n menuRef.current = menuNode;\n }), _extends2.id = elementIds.menuId, _extends2.role = 'listbox', _extends2['aria-labelledby'] = rest && rest['aria-label'] ? undefined : \"\" + elementIds.labelId, _extends2.onMouseLeave = callAllEventHandlers(onMouseLeave, menuHandleMouseLeave), _extends2), rest);\n }, [dispatch, setGetterPropCallInfo, elementIds]);\n var getToggleButtonProps = useCallback(function (_temp4, _temp5) {\n var _extends3;\n var _ref4 = _temp4 === void 0 ? {} : _temp4,\n onBlur = _ref4.onBlur,\n onClick = _ref4.onClick;\n _ref4.onPress;\n var onKeyDown = _ref4.onKeyDown,\n _ref4$refKey = _ref4.refKey,\n refKey = _ref4$refKey === void 0 ? 'ref' : _ref4$refKey,\n ref = _ref4.ref,\n rest = _objectWithoutPropertiesLoose(_ref4, _excluded3$1);\n var _ref5 = _temp5 === void 0 ? {} : _temp5,\n _ref5$suppressRefErro = _ref5.suppressRefError,\n suppressRefError = _ref5$suppressRefErro === void 0 ? false : _ref5$suppressRefErro;\n var latestState = latest.current.state;\n var toggleButtonHandleClick = function toggleButtonHandleClick() {\n dispatch({\n type: ToggleButtonClick$1\n });\n };\n var toggleButtonHandleBlur = function toggleButtonHandleBlur() {\n if (latestState.isOpen && !mouseAndTouchTrackers.isMouseDown) {\n dispatch({\n type: ToggleButtonBlur\n });\n }\n };\n var toggleButtonHandleKeyDown = function toggleButtonHandleKeyDown(event) {\n var key = normalizeArrowKey(event);\n if (key && toggleButtonKeyDownHandlers[key]) {\n toggleButtonKeyDownHandlers[key](event);\n } else if (isAcceptedCharacterKey(key)) {\n dispatch({\n type: ToggleButtonKeyDownCharacter,\n key: key\n });\n }\n };\n var toggleProps = _extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, function (toggleButtonNode) {\n toggleButtonRef.current = toggleButtonNode;\n }), _extends3['aria-activedescendant'] = latestState.isOpen && latestState.highlightedIndex > -1 ? elementIds.getItemId(latestState.highlightedIndex) : '', _extends3['aria-controls'] = elementIds.menuId, _extends3['aria-expanded'] = latest.current.state.isOpen, _extends3['aria-haspopup'] = 'listbox', _extends3['aria-labelledby'] = rest && rest['aria-label'] ? undefined : \"\" + elementIds.labelId, _extends3.id = elementIds.toggleButtonId, _extends3.role = 'combobox', _extends3.tabIndex = 0, _extends3.onBlur = callAllEventHandlers(onBlur, toggleButtonHandleBlur), _extends3), rest);\n if (!rest.disabled) {\n /* istanbul ignore if (react-native) */\n {\n toggleProps.onClick = callAllEventHandlers(onClick, toggleButtonHandleClick);\n toggleProps.onKeyDown = callAllEventHandlers(onKeyDown, toggleButtonHandleKeyDown);\n }\n }\n setGetterPropCallInfo('getToggleButtonProps', suppressRefError, refKey, toggleButtonRef);\n return toggleProps;\n }, [dispatch, elementIds, latest, mouseAndTouchTrackers, setGetterPropCallInfo, toggleButtonKeyDownHandlers]);\n var getItemProps = useCallback(function (_temp6) {\n var _extends4;\n var _ref6 = _temp6 === void 0 ? {} : _temp6,\n itemProp = _ref6.item,\n indexProp = _ref6.index,\n onMouseMove = _ref6.onMouseMove,\n onClick = _ref6.onClick,\n onMouseDown = _ref6.onMouseDown;\n _ref6.onPress;\n var _ref6$refKey = _ref6.refKey,\n refKey = _ref6$refKey === void 0 ? 'ref' : _ref6$refKey,\n disabledProp = _ref6.disabled,\n ref = _ref6.ref,\n rest = _objectWithoutPropertiesLoose(_ref6, _excluded4$1);\n if (disabledProp !== undefined) {\n console.warn('Passing \"disabled\" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.');\n }\n var _latest$current = latest.current,\n latestState = _latest$current.state,\n latestProps = _latest$current.props;\n var _getItemAndIndex = getItemAndIndex(itemProp, indexProp, latestProps.items, 'Pass either item or index to getItemProps!'),\n item = _getItemAndIndex[0],\n index = _getItemAndIndex[1];\n var disabled = latestProps.isItemDisabled(item, index);\n var itemHandleMouseMove = function itemHandleMouseMove() {\n if (mouseAndTouchTrackers.isTouchEnd || index === latestState.highlightedIndex) {\n return;\n }\n shouldScrollRef.current = false;\n dispatch({\n type: ItemMouseMove$1,\n index: index,\n disabled: disabled\n });\n };\n var itemHandleClick = function itemHandleClick() {\n dispatch({\n type: ItemClick$1,\n index: index\n });\n };\n var itemHandleMouseDown = function itemHandleMouseDown(e) {\n return e.preventDefault();\n }; // keep focus on the toggle after item click select.\n\n var itemProps = _extends((_extends4 = {}, _extends4[refKey] = handleRefs(ref, function (itemNode) {\n if (itemNode) {\n itemRefs.current[elementIds.getItemId(index)] = itemNode;\n }\n }), _extends4['aria-disabled'] = disabled, _extends4['aria-selected'] = item === latestState.selectedItem, _extends4.id = elementIds.getItemId(index), _extends4.role = 'option', _extends4), rest);\n if (!disabled) {\n /* istanbul ignore next (react-native) */\n {\n itemProps.onClick = callAllEventHandlers(onClick, itemHandleClick);\n }\n }\n itemProps.onMouseMove = callAllEventHandlers(onMouseMove, itemHandleMouseMove);\n itemProps.onMouseDown = callAllEventHandlers(onMouseDown, itemHandleMouseDown);\n return itemProps;\n }, [latest, elementIds, mouseAndTouchTrackers, shouldScrollRef, dispatch]);\n return {\n // prop getters.\n getToggleButtonProps: getToggleButtonProps,\n getLabelProps: getLabelProps,\n getMenuProps: getMenuProps,\n getItemProps: getItemProps,\n // actions.\n toggleMenu: toggleMenu,\n openMenu: openMenu,\n closeMenu: closeMenu,\n setHighlightedIndex: setHighlightedIndex,\n selectItem: selectItem,\n reset: reset,\n setInputValue: setInputValue,\n // state.\n highlightedIndex: highlightedIndex,\n isOpen: isOpen,\n selectedItem: selectedItem,\n inputValue: inputValue\n };\n}\n\nvar InputKeyDownArrowDown = process.env.NODE_ENV !== \"production\" ? '__input_keydown_arrow_down__' : 0;\nvar InputKeyDownArrowUp = process.env.NODE_ENV !== \"production\" ? '__input_keydown_arrow_up__' : 1;\nvar InputKeyDownEscape = process.env.NODE_ENV !== \"production\" ? '__input_keydown_escape__' : 2;\nvar InputKeyDownHome = process.env.NODE_ENV !== \"production\" ? '__input_keydown_home__' : 3;\nvar InputKeyDownEnd = process.env.NODE_ENV !== \"production\" ? '__input_keydown_end__' : 4;\nvar InputKeyDownPageUp = process.env.NODE_ENV !== \"production\" ? '__input_keydown_page_up__' : 5;\nvar InputKeyDownPageDown = process.env.NODE_ENV !== \"production\" ? '__input_keydown_page_down__' : 6;\nvar InputKeyDownEnter = process.env.NODE_ENV !== \"production\" ? '__input_keydown_enter__' : 7;\nvar InputChange = process.env.NODE_ENV !== \"production\" ? '__input_change__' : 8;\nvar InputBlur = process.env.NODE_ENV !== \"production\" ? '__input_blur__' : 9;\nvar InputClick = process.env.NODE_ENV !== \"production\" ? '__input_click__' : 10;\nvar MenuMouseLeave = process.env.NODE_ENV !== \"production\" ? '__menu_mouse_leave__' : 11;\nvar ItemMouseMove = process.env.NODE_ENV !== \"production\" ? '__item_mouse_move__' : 12;\nvar ItemClick = process.env.NODE_ENV !== \"production\" ? '__item_click__' : 13;\nvar ToggleButtonClick = process.env.NODE_ENV !== \"production\" ? '__togglebutton_click__' : 14;\nvar FunctionToggleMenu = process.env.NODE_ENV !== \"production\" ? '__function_toggle_menu__' : 15;\nvar FunctionOpenMenu = process.env.NODE_ENV !== \"production\" ? '__function_open_menu__' : 16;\nvar FunctionCloseMenu = process.env.NODE_ENV !== \"production\" ? '__function_close_menu__' : 17;\nvar FunctionSetHighlightedIndex = process.env.NODE_ENV !== \"production\" ? '__function_set_highlighted_index__' : 18;\nvar FunctionSelectItem = process.env.NODE_ENV !== \"production\" ? '__function_select_item__' : 19;\nvar FunctionSetInputValue = process.env.NODE_ENV !== \"production\" ? '__function_set_input_value__' : 20;\nvar FunctionReset$1 = process.env.NODE_ENV !== \"production\" ? '__function_reset__' : 21;\nvar ControlledPropUpdatedSelectedItem = process.env.NODE_ENV !== \"production\" ? '__controlled_prop_updated_selected_item__' : 22;\n\nvar stateChangeTypes$1 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n ControlledPropUpdatedSelectedItem: ControlledPropUpdatedSelectedItem,\n FunctionCloseMenu: FunctionCloseMenu,\n FunctionOpenMenu: FunctionOpenMenu,\n FunctionReset: FunctionReset$1,\n FunctionSelectItem: FunctionSelectItem,\n FunctionSetHighlightedIndex: FunctionSetHighlightedIndex,\n FunctionSetInputValue: FunctionSetInputValue,\n FunctionToggleMenu: FunctionToggleMenu,\n InputBlur: InputBlur,\n InputChange: InputChange,\n InputClick: InputClick,\n InputKeyDownArrowDown: InputKeyDownArrowDown,\n InputKeyDownArrowUp: InputKeyDownArrowUp,\n InputKeyDownEnd: InputKeyDownEnd,\n InputKeyDownEnter: InputKeyDownEnter,\n InputKeyDownEscape: InputKeyDownEscape,\n InputKeyDownHome: InputKeyDownHome,\n InputKeyDownPageDown: InputKeyDownPageDown,\n InputKeyDownPageUp: InputKeyDownPageUp,\n ItemClick: ItemClick,\n ItemMouseMove: ItemMouseMove,\n MenuMouseLeave: MenuMouseLeave,\n ToggleButtonClick: ToggleButtonClick\n});\n\nfunction getInitialState$1(props) {\n var initialState = getInitialState$2(props);\n var selectedItem = initialState.selectedItem;\n var inputValue = initialState.inputValue;\n if (inputValue === '' && selectedItem && props.defaultInputValue === undefined && props.initialInputValue === undefined && props.inputValue === undefined) {\n inputValue = props.itemToString(selectedItem);\n }\n return _extends({}, initialState, {\n inputValue: inputValue\n });\n}\nvar propTypes$1 = _extends({}, commonDropdownPropTypes, {\n items: PropTypes.array.isRequired,\n isItemDisabled: PropTypes.func,\n inputValue: PropTypes.string,\n defaultInputValue: PropTypes.string,\n initialInputValue: PropTypes.string,\n inputId: PropTypes.string,\n onInputValueChange: PropTypes.func\n});\n\n/**\n * The useCombobox version of useControlledReducer, which also\n * checks if the controlled prop selectedItem changed between\n * renders. If so, it will also update inputValue with its\n * string equivalent. It uses the common useEnhancedReducer to\n * compute the rest of the state.\n *\n * @param {Function} reducer Reducer function from downshift.\n * @param {Object} props The hook props, also passed to createInitialState.\n * @param {Function} createInitialState Function that returns the initial state.\n * @param {Function} isStateEqual Function that checks if a previous state is equal to the next.\n * @returns {Array} An array with the state and an action dispatcher.\n */\nfunction useControlledReducer(reducer, props, createInitialState, isStateEqual) {\n var previousSelectedItemRef = useRef();\n var _useEnhancedReducer = useEnhancedReducer(reducer, props, createInitialState, isStateEqual),\n state = _useEnhancedReducer[0],\n dispatch = _useEnhancedReducer[1];\n var isInitialMount = useIsInitialMount();\n useEffect(function () {\n if (!isControlledProp(props, 'selectedItem')) {\n return;\n }\n if (!isInitialMount // on first mount we already have the proper inputValue for a initial selected item.\n ) {\n var shouldCallDispatch = props.itemToKey(props.selectedItem) !== props.itemToKey(previousSelectedItemRef.current);\n if (shouldCallDispatch) {\n dispatch({\n type: ControlledPropUpdatedSelectedItem,\n inputValue: props.itemToString(props.selectedItem)\n });\n }\n }\n previousSelectedItemRef.current = state.selectedItem === previousSelectedItemRef.current ? props.selectedItem : state.selectedItem;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [state.selectedItem, props.selectedItem]);\n return [getState(state, props), dispatch];\n}\n\n// eslint-disable-next-line import/no-mutable-exports\nvar validatePropTypes$1 = noop;\n/* istanbul ignore next */\nif (process.env.NODE_ENV !== 'production') {\n validatePropTypes$1 = function validatePropTypes(options, caller) {\n PropTypes.checkPropTypes(propTypes$1, options, 'prop', caller.name);\n };\n}\nvar defaultProps$1 = _extends({}, defaultProps$3, {\n isItemDisabled: function isItemDisabled() {\n return false;\n }\n});\n\n/* eslint-disable complexity */\nfunction downshiftUseComboboxReducer(state, action) {\n var _props$items;\n var type = action.type,\n props = action.props,\n altKey = action.altKey;\n var changes;\n switch (type) {\n case ItemClick:\n changes = {\n isOpen: getDefaultValue$1(props, 'isOpen'),\n highlightedIndex: getDefaultHighlightedIndex(props),\n selectedItem: props.items[action.index],\n inputValue: props.itemToString(props.items[action.index])\n };\n break;\n case InputKeyDownArrowDown:\n if (state.isOpen) {\n changes = {\n highlightedIndex: getHighlightedIndex(state.highlightedIndex, 1, props.items, props.isItemDisabled, true)\n };\n } else {\n changes = {\n highlightedIndex: altKey && state.selectedItem == null ? -1 : getHighlightedIndexOnOpen(props, state, 1),\n isOpen: props.items.length >= 0\n };\n }\n break;\n case InputKeyDownArrowUp:\n if (state.isOpen) {\n if (altKey) {\n changes = getChangesOnSelection(props, state.highlightedIndex);\n } else {\n changes = {\n highlightedIndex: getHighlightedIndex(state.highlightedIndex, -1, props.items, props.isItemDisabled, true)\n };\n }\n } else {\n changes = {\n highlightedIndex: getHighlightedIndexOnOpen(props, state, -1),\n isOpen: props.items.length >= 0\n };\n }\n break;\n case InputKeyDownEnter:\n changes = getChangesOnSelection(props, state.highlightedIndex);\n break;\n case InputKeyDownEscape:\n changes = _extends({\n isOpen: false,\n highlightedIndex: -1\n }, !state.isOpen && {\n selectedItem: null,\n inputValue: ''\n });\n break;\n case InputKeyDownPageUp:\n changes = {\n highlightedIndex: getHighlightedIndex(state.highlightedIndex, -10, props.items, props.isItemDisabled, true)\n };\n break;\n case InputKeyDownPageDown:\n changes = {\n highlightedIndex: getHighlightedIndex(state.highlightedIndex, 10, props.items, props.isItemDisabled, true)\n };\n break;\n case InputKeyDownHome:\n changes = {\n highlightedIndex: getNonDisabledIndex(0, false, props.items, props.isItemDisabled)\n };\n break;\n case InputKeyDownEnd:\n changes = {\n highlightedIndex: getNonDisabledIndex(props.items.length - 1, true, props.items, props.isItemDisabled)\n };\n break;\n case InputBlur:\n changes = _extends({\n isOpen: false,\n highlightedIndex: -1\n }, state.highlightedIndex >= 0 && ((_props$items = props.items) == null ? void 0 : _props$items.length) && action.selectItem && {\n selectedItem: props.items[state.highlightedIndex],\n inputValue: props.itemToString(props.items[state.highlightedIndex])\n });\n break;\n case InputChange:\n changes = {\n isOpen: true,\n highlightedIndex: getDefaultHighlightedIndex(props),\n inputValue: action.inputValue\n };\n break;\n case InputClick:\n changes = {\n isOpen: !state.isOpen,\n highlightedIndex: state.isOpen ? -1 : getHighlightedIndexOnOpen(props, state, 0)\n };\n break;\n case FunctionSelectItem:\n changes = {\n selectedItem: action.selectedItem,\n inputValue: props.itemToString(action.selectedItem)\n };\n break;\n case ControlledPropUpdatedSelectedItem:\n changes = {\n inputValue: action.inputValue\n };\n break;\n default:\n return downshiftCommonReducer(state, action, stateChangeTypes$1);\n }\n return _extends({}, state, changes);\n}\n/* eslint-enable complexity */\n\nvar _excluded$1 = [\"onMouseLeave\", \"refKey\", \"ref\"],\n _excluded2$1 = [\"item\", \"index\", \"refKey\", \"ref\", \"onMouseMove\", \"onMouseDown\", \"onClick\", \"onPress\", \"disabled\"],\n _excluded3 = [\"onClick\", \"onPress\", \"refKey\", \"ref\"],\n _excluded4 = [\"onKeyDown\", \"onChange\", \"onInput\", \"onBlur\", \"onChangeText\", \"onClick\", \"refKey\", \"ref\"];\nuseCombobox.stateChangeTypes = stateChangeTypes$1;\nfunction useCombobox(userProps) {\n if (userProps === void 0) {\n userProps = {};\n }\n validatePropTypes$1(userProps, useCombobox);\n // Props defaults and destructuring.\n var props = _extends({}, defaultProps$1, userProps);\n var items = props.items,\n scrollIntoView = props.scrollIntoView,\n environment = props.environment,\n getA11yStatusMessage = props.getA11yStatusMessage;\n // Initial state depending on controlled props.\n var _useControlledReducer = useControlledReducer(downshiftUseComboboxReducer, props, getInitialState$1, isDropdownsStateEqual),\n state = _useControlledReducer[0],\n dispatch = _useControlledReducer[1];\n var isOpen = state.isOpen,\n highlightedIndex = state.highlightedIndex,\n selectedItem = state.selectedItem,\n inputValue = state.inputValue;\n\n // Element refs.\n var menuRef = useRef(null);\n var itemRefs = useRef({});\n var inputRef = useRef(null);\n var toggleButtonRef = useRef(null);\n var isInitialMount = useIsInitialMount();\n\n // prevent id re-generation between renders.\n var elementIds = useElementIds(props);\n // used to keep track of how many items we had on previous cycle.\n var previousResultCountRef = useRef();\n // utility callback to get item element.\n var latest = useLatestRef({\n state: state,\n props: props\n });\n var getItemNodeFromIndex = useCallback(function (index) {\n return itemRefs.current[elementIds.getItemId(index)];\n }, [elementIds]);\n\n // Effects.\n // Adds an a11y aria live status message if getA11yStatusMessage is passed.\n useA11yMessageStatus(getA11yStatusMessage, state, [isOpen, highlightedIndex, selectedItem, inputValue], environment);\n // Scroll on highlighted item if change comes from keyboard.\n var shouldScrollRef = useScrollIntoView({\n menuElement: menuRef.current,\n highlightedIndex: highlightedIndex,\n isOpen: isOpen,\n itemRefs: itemRefs,\n scrollIntoView: scrollIntoView,\n getItemNodeFromIndex: getItemNodeFromIndex\n });\n useControlPropsValidator({\n props: props,\n state: state\n });\n // Focus the input on first render if required.\n useEffect(function () {\n var focusOnOpen = getInitialValue$1(props, 'isOpen');\n if (focusOnOpen && inputRef.current) {\n inputRef.current.focus();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n useEffect(function () {\n if (!isInitialMount) {\n previousResultCountRef.current = items.length;\n }\n });\n var mouseAndTouchTrackers = useMouseAndTouchTracker(environment, useCallback(function handleBlur() {\n if (latest.current.state.isOpen) {\n dispatch({\n type: InputBlur,\n selectItem: false\n });\n }\n }, [dispatch, latest]), useMemo(function () {\n return [menuRef, toggleButtonRef, inputRef];\n }, [menuRef.current, toggleButtonRef.current, inputRef.current]));\n var setGetterPropCallInfo = useGetterPropsCalledChecker('getInputProps', 'getMenuProps');\n // Reset itemRefs on close.\n useEffect(function () {\n if (!isOpen) {\n itemRefs.current = {};\n }\n }, [isOpen]);\n // Reset itemRefs on close.\n useEffect(function () {\n var _inputRef$current;\n if (!isOpen || !(environment != null && environment.document) || !(inputRef != null && (_inputRef$current = inputRef.current) != null && _inputRef$current.focus)) {\n return;\n }\n if (environment.document.activeElement !== inputRef.current) {\n inputRef.current.focus();\n }\n }, [isOpen, environment]);\n\n /* Event handler functions */\n var inputKeyDownHandlers = useMemo(function () {\n return {\n ArrowDown: function ArrowDown(event) {\n event.preventDefault();\n dispatch({\n type: InputKeyDownArrowDown,\n altKey: event.altKey\n });\n },\n ArrowUp: function ArrowUp(event) {\n event.preventDefault();\n dispatch({\n type: InputKeyDownArrowUp,\n altKey: event.altKey\n });\n },\n Home: function Home(event) {\n if (!latest.current.state.isOpen) {\n return;\n }\n event.preventDefault();\n dispatch({\n type: InputKeyDownHome\n });\n },\n End: function End(event) {\n if (!latest.current.state.isOpen) {\n return;\n }\n event.preventDefault();\n dispatch({\n type: InputKeyDownEnd\n });\n },\n Escape: function Escape(event) {\n var latestState = latest.current.state;\n if (latestState.isOpen || latestState.inputValue || latestState.selectedItem || latestState.highlightedIndex > -1) {\n event.preventDefault();\n dispatch({\n type: InputKeyDownEscape\n });\n }\n },\n Enter: function Enter(event) {\n var latestState = latest.current.state;\n // if closed or no highlighted index, do nothing.\n if (!latestState.isOpen || event.which === 229 // if IME composing, wait for next Enter keydown event.\n ) {\n return;\n }\n event.preventDefault();\n dispatch({\n type: InputKeyDownEnter\n });\n },\n PageUp: function PageUp(event) {\n if (latest.current.state.isOpen) {\n event.preventDefault();\n dispatch({\n type: InputKeyDownPageUp\n });\n }\n },\n PageDown: function PageDown(event) {\n if (latest.current.state.isOpen) {\n event.preventDefault();\n dispatch({\n type: InputKeyDownPageDown\n });\n }\n }\n };\n }, [dispatch, latest]);\n\n // Getter props.\n var getLabelProps = useCallback(function (labelProps) {\n return _extends({\n id: elementIds.labelId,\n htmlFor: elementIds.inputId\n }, labelProps);\n }, [elementIds]);\n var getMenuProps = useCallback(function (_temp, _temp2) {\n var _extends2;\n var _ref = _temp === void 0 ? {} : _temp,\n onMouseLeave = _ref.onMouseLeave,\n _ref$refKey = _ref.refKey,\n refKey = _ref$refKey === void 0 ? 'ref' : _ref$refKey,\n ref = _ref.ref,\n rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);\n var _ref2 = _temp2 === void 0 ? {} : _temp2,\n _ref2$suppressRefErro = _ref2.suppressRefError,\n suppressRefError = _ref2$suppressRefErro === void 0 ? false : _ref2$suppressRefErro;\n setGetterPropCallInfo('getMenuProps', suppressRefError, refKey, menuRef);\n return _extends((_extends2 = {}, _extends2[refKey] = handleRefs(ref, function (menuNode) {\n menuRef.current = menuNode;\n }), _extends2.id = elementIds.menuId, _extends2.role = 'listbox', _extends2['aria-labelledby'] = rest && rest['aria-label'] ? undefined : \"\" + elementIds.labelId, _extends2.onMouseLeave = callAllEventHandlers(onMouseLeave, function () {\n dispatch({\n type: MenuMouseLeave\n });\n }), _extends2), rest);\n }, [dispatch, setGetterPropCallInfo, elementIds]);\n var getItemProps = useCallback(function (_temp3) {\n var _extends3, _ref4;\n var _ref3 = _temp3 === void 0 ? {} : _temp3,\n itemProp = _ref3.item,\n indexProp = _ref3.index,\n _ref3$refKey = _ref3.refKey,\n refKey = _ref3$refKey === void 0 ? 'ref' : _ref3$refKey,\n ref = _ref3.ref,\n onMouseMove = _ref3.onMouseMove,\n onMouseDown = _ref3.onMouseDown,\n onClick = _ref3.onClick;\n _ref3.onPress;\n var disabledProp = _ref3.disabled,\n rest = _objectWithoutPropertiesLoose(_ref3, _excluded2$1);\n if (disabledProp !== undefined) {\n console.warn('Passing \"disabled\" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.');\n }\n var _latest$current = latest.current,\n latestProps = _latest$current.props,\n latestState = _latest$current.state;\n var _getItemAndIndex = getItemAndIndex(itemProp, indexProp, latestProps.items, 'Pass either item or index to getItemProps!'),\n item = _getItemAndIndex[0],\n index = _getItemAndIndex[1];\n var disabled = latestProps.isItemDisabled(item, index);\n var onSelectKey = 'onClick';\n var customClickHandler = onClick;\n var itemHandleMouseMove = function itemHandleMouseMove() {\n if (mouseAndTouchTrackers.isTouchEnd || index === latestState.highlightedIndex) {\n return;\n }\n shouldScrollRef.current = false;\n dispatch({\n type: ItemMouseMove,\n index: index,\n disabled: disabled\n });\n };\n var itemHandleClick = function itemHandleClick() {\n dispatch({\n type: ItemClick,\n index: index\n });\n };\n var itemHandleMouseDown = function itemHandleMouseDown(e) {\n return e.preventDefault();\n }; // keep focus on the input after item click select.\n\n return _extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, function (itemNode) {\n if (itemNode) {\n itemRefs.current[elementIds.getItemId(index)] = itemNode;\n }\n }), _extends3['aria-disabled'] = disabled, _extends3['aria-selected'] = index === latestState.highlightedIndex, _extends3.id = elementIds.getItemId(index), _extends3.role = 'option', _extends3), !disabled && (_ref4 = {}, _ref4[onSelectKey] = callAllEventHandlers(customClickHandler, itemHandleClick), _ref4), {\n onMouseMove: callAllEventHandlers(onMouseMove, itemHandleMouseMove),\n onMouseDown: callAllEventHandlers(onMouseDown, itemHandleMouseDown)\n }, rest);\n }, [dispatch, elementIds, latest, mouseAndTouchTrackers, shouldScrollRef]);\n var getToggleButtonProps = useCallback(function (_temp4) {\n var _extends4;\n var _ref5 = _temp4 === void 0 ? {} : _temp4,\n onClick = _ref5.onClick;\n _ref5.onPress;\n var _ref5$refKey = _ref5.refKey,\n refKey = _ref5$refKey === void 0 ? 'ref' : _ref5$refKey,\n ref = _ref5.ref,\n rest = _objectWithoutPropertiesLoose(_ref5, _excluded3);\n var latestState = latest.current.state;\n var toggleButtonHandleClick = function toggleButtonHandleClick() {\n dispatch({\n type: ToggleButtonClick\n });\n };\n return _extends((_extends4 = {}, _extends4[refKey] = handleRefs(ref, function (toggleButtonNode) {\n toggleButtonRef.current = toggleButtonNode;\n }), _extends4['aria-controls'] = elementIds.menuId, _extends4['aria-expanded'] = latestState.isOpen, _extends4.id = elementIds.toggleButtonId, _extends4.tabIndex = -1, _extends4), !rest.disabled && _extends({}, {\n onClick: callAllEventHandlers(onClick, toggleButtonHandleClick)\n }), rest);\n }, [dispatch, latest, elementIds]);\n var getInputProps = useCallback(function (_temp5, _temp6) {\n var _extends5;\n var _ref6 = _temp5 === void 0 ? {} : _temp5,\n onKeyDown = _ref6.onKeyDown,\n onChange = _ref6.onChange,\n onInput = _ref6.onInput,\n onBlur = _ref6.onBlur;\n _ref6.onChangeText;\n var onClick = _ref6.onClick,\n _ref6$refKey = _ref6.refKey,\n refKey = _ref6$refKey === void 0 ? 'ref' : _ref6$refKey,\n ref = _ref6.ref,\n rest = _objectWithoutPropertiesLoose(_ref6, _excluded4);\n var _ref7 = _temp6 === void 0 ? {} : _temp6,\n _ref7$suppressRefErro = _ref7.suppressRefError,\n suppressRefError = _ref7$suppressRefErro === void 0 ? false : _ref7$suppressRefErro;\n setGetterPropCallInfo('getInputProps', suppressRefError, refKey, inputRef);\n var latestState = latest.current.state;\n var inputHandleKeyDown = function inputHandleKeyDown(event) {\n var key = normalizeArrowKey(event);\n if (key && inputKeyDownHandlers[key]) {\n inputKeyDownHandlers[key](event);\n }\n };\n var inputHandleChange = function inputHandleChange(event) {\n dispatch({\n type: InputChange,\n inputValue: event.target.value\n });\n };\n var inputHandleBlur = function inputHandleBlur(event) {\n /* istanbul ignore else */\n if (environment != null && environment.document && latestState.isOpen && !mouseAndTouchTrackers.isMouseDown) {\n var isBlurByTabChange = event.relatedTarget === null && environment.document.activeElement !== environment.document.body;\n dispatch({\n type: InputBlur,\n selectItem: !isBlurByTabChange\n });\n }\n };\n var inputHandleClick = function inputHandleClick() {\n dispatch({\n type: InputClick\n });\n };\n\n /* istanbul ignore next (preact) */\n var onChangeKey = 'onChange';\n var eventHandlers = {};\n if (!rest.disabled) {\n var _eventHandlers;\n eventHandlers = (_eventHandlers = {}, _eventHandlers[onChangeKey] = callAllEventHandlers(onChange, onInput, inputHandleChange), _eventHandlers.onKeyDown = callAllEventHandlers(onKeyDown, inputHandleKeyDown), _eventHandlers.onBlur = callAllEventHandlers(onBlur, inputHandleBlur), _eventHandlers.onClick = callAllEventHandlers(onClick, inputHandleClick), _eventHandlers);\n }\n return _extends((_extends5 = {}, _extends5[refKey] = handleRefs(ref, function (inputNode) {\n inputRef.current = inputNode;\n }), _extends5['aria-activedescendant'] = latestState.isOpen && latestState.highlightedIndex > -1 ? elementIds.getItemId(latestState.highlightedIndex) : '', _extends5['aria-autocomplete'] = 'list', _extends5['aria-controls'] = elementIds.menuId, _extends5['aria-expanded'] = latestState.isOpen, _extends5['aria-labelledby'] = rest && rest['aria-label'] ? undefined : elementIds.labelId, _extends5.autoComplete = 'off', _extends5.id = elementIds.inputId, _extends5.role = 'combobox', _extends5.value = latestState.inputValue, _extends5), eventHandlers, rest);\n }, [dispatch, elementIds, environment, inputKeyDownHandlers, latest, mouseAndTouchTrackers, setGetterPropCallInfo]);\n\n // returns\n var toggleMenu = useCallback(function () {\n dispatch({\n type: FunctionToggleMenu\n });\n }, [dispatch]);\n var closeMenu = useCallback(function () {\n dispatch({\n type: FunctionCloseMenu\n });\n }, [dispatch]);\n var openMenu = useCallback(function () {\n dispatch({\n type: FunctionOpenMenu\n });\n }, [dispatch]);\n var setHighlightedIndex = useCallback(function (newHighlightedIndex) {\n dispatch({\n type: FunctionSetHighlightedIndex,\n highlightedIndex: newHighlightedIndex\n });\n }, [dispatch]);\n var selectItem = useCallback(function (newSelectedItem) {\n dispatch({\n type: FunctionSelectItem,\n selectedItem: newSelectedItem\n });\n }, [dispatch]);\n var setInputValue = useCallback(function (newInputValue) {\n dispatch({\n type: FunctionSetInputValue,\n inputValue: newInputValue\n });\n }, [dispatch]);\n var reset = useCallback(function () {\n dispatch({\n type: FunctionReset$1\n });\n }, [dispatch]);\n return {\n // prop getters.\n getItemProps: getItemProps,\n getLabelProps: getLabelProps,\n getMenuProps: getMenuProps,\n getInputProps: getInputProps,\n getToggleButtonProps: getToggleButtonProps,\n // actions.\n toggleMenu: toggleMenu,\n openMenu: openMenu,\n closeMenu: closeMenu,\n setHighlightedIndex: setHighlightedIndex,\n setInputValue: setInputValue,\n selectItem: selectItem,\n reset: reset,\n // state.\n highlightedIndex: highlightedIndex,\n isOpen: isOpen,\n selectedItem: selectedItem,\n inputValue: inputValue\n };\n}\n\nvar defaultStateValues = {\n activeIndex: -1,\n selectedItems: []\n};\n\n/**\n * Returns the initial value for a state key in the following order:\n * 1. controlled prop, 2. initial prop, 3. default prop, 4. default\n * value from Downshift.\n *\n * @param {Object} props Props passed to the hook.\n * @param {string} propKey Props key to generate the value for.\n * @returns {any} The initial value for that prop.\n */\nfunction getInitialValue(props, propKey) {\n return getInitialValue$1(props, propKey, defaultStateValues);\n}\n\n/**\n * Returns the default value for a state key in the following order:\n * 1. controlled prop, 2. default prop, 3. default value from Downshift.\n *\n * @param {Object} props Props passed to the hook.\n * @param {string} propKey Props key to generate the value for.\n * @returns {any} The initial value for that prop.\n */\nfunction getDefaultValue(props, propKey) {\n return getDefaultValue$1(props, propKey, defaultStateValues);\n}\n\n/**\n * Gets the initial state based on the provided props. It uses initial, default\n * and controlled props related to state in order to compute the initial value.\n *\n * @param {Object} props Props passed to the hook.\n * @returns {Object} The initial state.\n */\nfunction getInitialState(props) {\n var activeIndex = getInitialValue(props, 'activeIndex');\n var selectedItems = getInitialValue(props, 'selectedItems');\n return {\n activeIndex: activeIndex,\n selectedItems: selectedItems\n };\n}\n\n/**\n * Returns true if dropdown keydown operation is permitted. Should not be\n * allowed on keydown with modifier keys (ctrl, alt, shift, meta), on\n * input element with text content that is either highlighted or selection\n * cursor is not at the starting position.\n *\n * @param {KeyboardEvent} event The event from keydown.\n * @returns {boolean} Whether the operation is allowed.\n */\nfunction isKeyDownOperationPermitted(event) {\n if (event.shiftKey || event.metaKey || event.ctrlKey || event.altKey) {\n return false;\n }\n var element = event.target;\n if (element instanceof HTMLInputElement &&\n // if element is a text input\n element.value !== '' && (\n // and we have text in it\n // and cursor is either not at the start or is currently highlighting text.\n element.selectionStart !== 0 || element.selectionEnd !== 0)) {\n return false;\n }\n return true;\n}\n\n/**\n * Check if a state is equal for taglist, by comparing active index and selected items.\n * Used by useSelect and useCombobox.\n *\n * @param {Object} prevState\n * @param {Object} newState\n * @returns {boolean} Wheather the states are deeply equal.\n */\nfunction isStateEqual(prevState, newState) {\n return prevState.selectedItems === newState.selectedItems && prevState.activeIndex === newState.activeIndex;\n}\nvar propTypes = {\n stateReducer: commonPropTypes.stateReducer,\n itemToKey: commonPropTypes.itemToKey,\n environment: commonPropTypes.environment,\n selectedItems: PropTypes.array,\n initialSelectedItems: PropTypes.array,\n defaultSelectedItems: PropTypes.array,\n getA11yStatusMessage: PropTypes.func,\n activeIndex: PropTypes.number,\n initialActiveIndex: PropTypes.number,\n defaultActiveIndex: PropTypes.number,\n onActiveIndexChange: PropTypes.func,\n onSelectedItemsChange: PropTypes.func,\n keyNavigationNext: PropTypes.string,\n keyNavigationPrevious: PropTypes.string\n};\nvar defaultProps = {\n itemToKey: defaultProps$3.itemToKey,\n stateReducer: defaultProps$3.stateReducer,\n environment: defaultProps$3.environment,\n keyNavigationNext: 'ArrowRight',\n keyNavigationPrevious: 'ArrowLeft'\n};\n\n// eslint-disable-next-line import/no-mutable-exports\nvar validatePropTypes = noop;\n/* istanbul ignore next */\nif (process.env.NODE_ENV !== 'production') {\n validatePropTypes = function validatePropTypes(options, caller) {\n PropTypes.checkPropTypes(propTypes, options, 'prop', caller.name);\n };\n}\n\nvar SelectedItemClick = process.env.NODE_ENV !== \"production\" ? '__selected_item_click__' : 0;\nvar SelectedItemKeyDownDelete = process.env.NODE_ENV !== \"production\" ? '__selected_item_keydown_delete__' : 1;\nvar SelectedItemKeyDownBackspace = process.env.NODE_ENV !== \"production\" ? '__selected_item_keydown_backspace__' : 2;\nvar SelectedItemKeyDownNavigationNext = process.env.NODE_ENV !== \"production\" ? '__selected_item_keydown_navigation_next__' : 3;\nvar SelectedItemKeyDownNavigationPrevious = process.env.NODE_ENV !== \"production\" ? '__selected_item_keydown_navigation_previous__' : 4;\nvar DropdownKeyDownNavigationPrevious = process.env.NODE_ENV !== \"production\" ? '__dropdown_keydown_navigation_previous__' : 5;\nvar DropdownKeyDownBackspace = process.env.NODE_ENV !== \"production\" ? '__dropdown_keydown_backspace__' : 6;\nvar DropdownClick = process.env.NODE_ENV !== \"production\" ? '__dropdown_click__' : 7;\nvar FunctionAddSelectedItem = process.env.NODE_ENV !== \"production\" ? '__function_add_selected_item__' : 8;\nvar FunctionRemoveSelectedItem = process.env.NODE_ENV !== \"production\" ? '__function_remove_selected_item__' : 9;\nvar FunctionSetSelectedItems = process.env.NODE_ENV !== \"production\" ? '__function_set_selected_items__' : 10;\nvar FunctionSetActiveIndex = process.env.NODE_ENV !== \"production\" ? '__function_set_active_index__' : 11;\nvar FunctionReset = process.env.NODE_ENV !== \"production\" ? '__function_reset__' : 12;\n\nvar stateChangeTypes = /*#__PURE__*/Object.freeze({\n __proto__: null,\n DropdownClick: DropdownClick,\n DropdownKeyDownBackspace: DropdownKeyDownBackspace,\n DropdownKeyDownNavigationPrevious: DropdownKeyDownNavigationPrevious,\n FunctionAddSelectedItem: FunctionAddSelectedItem,\n FunctionRemoveSelectedItem: FunctionRemoveSelectedItem,\n FunctionReset: FunctionReset,\n FunctionSetActiveIndex: FunctionSetActiveIndex,\n FunctionSetSelectedItems: FunctionSetSelectedItems,\n SelectedItemClick: SelectedItemClick,\n SelectedItemKeyDownBackspace: SelectedItemKeyDownBackspace,\n SelectedItemKeyDownDelete: SelectedItemKeyDownDelete,\n SelectedItemKeyDownNavigationNext: SelectedItemKeyDownNavigationNext,\n SelectedItemKeyDownNavigationPrevious: SelectedItemKeyDownNavigationPrevious\n});\n\n/* eslint-disable complexity */\nfunction downshiftMultipleSelectionReducer(state, action) {\n var type = action.type,\n index = action.index,\n props = action.props,\n selectedItem = action.selectedItem;\n var activeIndex = state.activeIndex,\n selectedItems = state.selectedItems;\n var changes;\n switch (type) {\n case SelectedItemClick:\n changes = {\n activeIndex: index\n };\n break;\n case SelectedItemKeyDownNavigationPrevious:\n changes = {\n activeIndex: activeIndex - 1 < 0 ? 0 : activeIndex - 1\n };\n break;\n case SelectedItemKeyDownNavigationNext:\n changes = {\n activeIndex: activeIndex + 1 >= selectedItems.length ? -1 : activeIndex + 1\n };\n break;\n case SelectedItemKeyDownBackspace:\n case SelectedItemKeyDownDelete:\n {\n if (activeIndex < 0) {\n break;\n }\n var newActiveIndex = activeIndex;\n if (selectedItems.length === 1) {\n newActiveIndex = -1;\n } else if (activeIndex === selectedItems.length - 1) {\n newActiveIndex = selectedItems.length - 2;\n }\n changes = _extends({\n selectedItems: [].concat(selectedItems.slice(0, activeIndex), selectedItems.slice(activeIndex + 1))\n }, {\n activeIndex: newActiveIndex\n });\n break;\n }\n case DropdownKeyDownNavigationPrevious:\n changes = {\n activeIndex: selectedItems.length - 1\n };\n break;\n case DropdownKeyDownBackspace:\n changes = {\n selectedItems: selectedItems.slice(0, selectedItems.length - 1)\n };\n break;\n case FunctionAddSelectedItem:\n changes = {\n selectedItems: [].concat(selectedItems, [selectedItem])\n };\n break;\n case DropdownClick:\n changes = {\n activeIndex: -1\n };\n break;\n case FunctionRemoveSelectedItem:\n {\n var _newActiveIndex = activeIndex;\n var selectedItemIndex = selectedItems.findIndex(function (item) {\n return props.itemToKey(item) === props.itemToKey(selectedItem);\n });\n if (selectedItemIndex < 0) {\n break;\n }\n if (selectedItems.length === 1) {\n _newActiveIndex = -1;\n } else if (selectedItemIndex === selectedItems.length - 1) {\n _newActiveIndex = selectedItems.length - 2;\n }\n changes = {\n selectedItems: [].concat(selectedItems.slice(0, selectedItemIndex), selectedItems.slice(selectedItemIndex + 1)),\n activeIndex: _newActiveIndex\n };\n break;\n }\n case FunctionSetSelectedItems:\n {\n var newSelectedItems = action.selectedItems;\n changes = {\n selectedItems: newSelectedItems\n };\n break;\n }\n case FunctionSetActiveIndex:\n {\n var _newActiveIndex2 = action.activeIndex;\n changes = {\n activeIndex: _newActiveIndex2\n };\n break;\n }\n case FunctionReset:\n changes = {\n activeIndex: getDefaultValue(props, 'activeIndex'),\n selectedItems: getDefaultValue(props, 'selectedItems')\n };\n break;\n default:\n throw new Error('Reducer called without proper action type.');\n }\n return _extends({}, state, changes);\n}\n\nvar _excluded = [\"refKey\", \"ref\", \"onClick\", \"onKeyDown\", \"selectedItem\", \"index\"],\n _excluded2 = [\"refKey\", \"ref\", \"onKeyDown\", \"onClick\", \"preventKeyAction\"];\nuseMultipleSelection.stateChangeTypes = stateChangeTypes;\nfunction useMultipleSelection(userProps) {\n if (userProps === void 0) {\n userProps = {};\n }\n validatePropTypes(userProps, useMultipleSelection);\n // Props defaults and destructuring.\n var props = _extends({}, defaultProps, userProps);\n var getA11yStatusMessage = props.getA11yStatusMessage,\n environment = props.environment,\n keyNavigationNext = props.keyNavigationNext,\n keyNavigationPrevious = props.keyNavigationPrevious;\n\n // Reducer init.\n var _useControlledReducer = useControlledReducer$1(downshiftMultipleSelectionReducer, props, getInitialState, isStateEqual),\n state = _useControlledReducer[0],\n dispatch = _useControlledReducer[1];\n var activeIndex = state.activeIndex,\n selectedItems = state.selectedItems;\n\n // Refs.\n var isInitialMount = useIsInitialMount();\n var dropdownRef = useRef(null);\n var selectedItemRefs = useRef();\n selectedItemRefs.current = [];\n var latest = useLatestRef({\n state: state,\n props: props\n });\n\n // Effects.\n // Adds an a11y aria live status message if getA11yStatusMessage is passed.\n useA11yMessageStatus(getA11yStatusMessage, state, [activeIndex, selectedItems], environment);\n // Sets focus on active item.\n useEffect(function () {\n if (isInitialMount) {\n return;\n }\n if (activeIndex === -1 && dropdownRef.current) {\n dropdownRef.current.focus();\n } else if (selectedItemRefs.current[activeIndex]) {\n selectedItemRefs.current[activeIndex].focus();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [activeIndex]);\n useControlPropsValidator({\n props: props,\n state: state\n });\n var setGetterPropCallInfo = useGetterPropsCalledChecker('getDropdownProps');\n\n // Event handler functions.\n var selectedItemKeyDownHandlers = useMemo(function () {\n var _ref;\n return _ref = {}, _ref[keyNavigationPrevious] = function () {\n dispatch({\n type: SelectedItemKeyDownNavigationPrevious\n });\n }, _ref[keyNavigationNext] = function () {\n dispatch({\n type: SelectedItemKeyDownNavigationNext\n });\n }, _ref.Delete = function Delete() {\n dispatch({\n type: SelectedItemKeyDownDelete\n });\n }, _ref.Backspace = function Backspace() {\n dispatch({\n type: SelectedItemKeyDownBackspace\n });\n }, _ref;\n }, [dispatch, keyNavigationNext, keyNavigationPrevious]);\n var dropdownKeyDownHandlers = useMemo(function () {\n var _ref2;\n return _ref2 = {}, _ref2[keyNavigationPrevious] = function (event) {\n if (isKeyDownOperationPermitted(event)) {\n dispatch({\n type: DropdownKeyDownNavigationPrevious\n });\n }\n }, _ref2.Backspace = function Backspace(event) {\n if (isKeyDownOperationPermitted(event)) {\n dispatch({\n type: DropdownKeyDownBackspace\n });\n }\n }, _ref2;\n }, [dispatch, keyNavigationPrevious]);\n\n // Getter props.\n var getSelectedItemProps = useCallback(function (_temp) {\n var _extends2;\n var _ref3 = _temp === void 0 ? {} : _temp,\n _ref3$refKey = _ref3.refKey,\n refKey = _ref3$refKey === void 0 ? 'ref' : _ref3$refKey,\n ref = _ref3.ref,\n onClick = _ref3.onClick,\n onKeyDown = _ref3.onKeyDown,\n selectedItemProp = _ref3.selectedItem,\n indexProp = _ref3.index,\n rest = _objectWithoutPropertiesLoose(_ref3, _excluded);\n var latestState = latest.current.state;\n var _getItemAndIndex = getItemAndIndex(selectedItemProp, indexProp, latestState.selectedItems, 'Pass either item or index to getSelectedItemProps!'),\n index = _getItemAndIndex[1];\n var isFocusable = index > -1 && index === latestState.activeIndex;\n var selectedItemHandleClick = function selectedItemHandleClick() {\n dispatch({\n type: SelectedItemClick,\n index: index\n });\n };\n var selectedItemHandleKeyDown = function selectedItemHandleKeyDown(event) {\n var key = normalizeArrowKey(event);\n if (key && selectedItemKeyDownHandlers[key]) {\n selectedItemKeyDownHandlers[key](event);\n }\n };\n return _extends((_extends2 = {}, _extends2[refKey] = handleRefs(ref, function (selectedItemNode) {\n if (selectedItemNode) {\n selectedItemRefs.current.push(selectedItemNode);\n }\n }), _extends2.tabIndex = isFocusable ? 0 : -1, _extends2.onClick = callAllEventHandlers(onClick, selectedItemHandleClick), _extends2.onKeyDown = callAllEventHandlers(onKeyDown, selectedItemHandleKeyDown), _extends2), rest);\n }, [dispatch, latest, selectedItemKeyDownHandlers]);\n var getDropdownProps = useCallback(function (_temp2, _temp3) {\n var _extends3;\n var _ref4 = _temp2 === void 0 ? {} : _temp2,\n _ref4$refKey = _ref4.refKey,\n refKey = _ref4$refKey === void 0 ? 'ref' : _ref4$refKey,\n ref = _ref4.ref,\n onKeyDown = _ref4.onKeyDown,\n onClick = _ref4.onClick,\n _ref4$preventKeyActio = _ref4.preventKeyAction,\n preventKeyAction = _ref4$preventKeyActio === void 0 ? false : _ref4$preventKeyActio,\n rest = _objectWithoutPropertiesLoose(_ref4, _excluded2);\n var _ref5 = _temp3 === void 0 ? {} : _temp3,\n _ref5$suppressRefErro = _ref5.suppressRefError,\n suppressRefError = _ref5$suppressRefErro === void 0 ? false : _ref5$suppressRefErro;\n setGetterPropCallInfo('getDropdownProps', suppressRefError, refKey, dropdownRef);\n var dropdownHandleKeyDown = function dropdownHandleKeyDown(event) {\n var key = normalizeArrowKey(event);\n if (key && dropdownKeyDownHandlers[key]) {\n dropdownKeyDownHandlers[key](event);\n }\n };\n var dropdownHandleClick = function dropdownHandleClick() {\n dispatch({\n type: DropdownClick\n });\n };\n return _extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, function (dropdownNode) {\n if (dropdownNode) {\n dropdownRef.current = dropdownNode;\n }\n }), _extends3), !preventKeyAction && {\n onKeyDown: callAllEventHandlers(onKeyDown, dropdownHandleKeyDown),\n onClick: callAllEventHandlers(onClick, dropdownHandleClick)\n }, rest);\n }, [dispatch, dropdownKeyDownHandlers, setGetterPropCallInfo]);\n\n // returns\n var addSelectedItem = useCallback(function (selectedItem) {\n dispatch({\n type: FunctionAddSelectedItem,\n selectedItem: selectedItem\n });\n }, [dispatch]);\n var removeSelectedItem = useCallback(function (selectedItem) {\n dispatch({\n type: FunctionRemoveSelectedItem,\n selectedItem: selectedItem\n });\n }, [dispatch]);\n var setSelectedItems = useCallback(function (newSelectedItems) {\n dispatch({\n type: FunctionSetSelectedItems,\n selectedItems: newSelectedItems\n });\n }, [dispatch]);\n var setActiveIndex = useCallback(function (newActiveIndex) {\n dispatch({\n type: FunctionSetActiveIndex,\n activeIndex: newActiveIndex\n });\n }, [dispatch]);\n var reset = useCallback(function () {\n dispatch({\n type: FunctionReset\n });\n }, [dispatch]);\n return {\n getSelectedItemProps: getSelectedItemProps,\n getDropdownProps: getDropdownProps,\n addSelectedItem: addSelectedItem,\n removeSelectedItem: removeSelectedItem,\n setSelectedItems: setSelectedItems,\n setActiveIndex: setActiveIndex,\n reset: reset,\n selectedItems: selectedItems,\n activeIndex: activeIndex\n };\n}\n\nexport { Downshift$1 as default, resetIdCounter, useCombobox, useMultipleSelection, useSelect };\n","/**\n * @license React\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var b=Symbol.for(\"react.element\"),c=Symbol.for(\"react.portal\"),d=Symbol.for(\"react.fragment\"),e=Symbol.for(\"react.strict_mode\"),f=Symbol.for(\"react.profiler\"),g=Symbol.for(\"react.provider\"),h=Symbol.for(\"react.context\"),k=Symbol.for(\"react.server_context\"),l=Symbol.for(\"react.forward_ref\"),m=Symbol.for(\"react.suspense\"),n=Symbol.for(\"react.suspense_list\"),p=Symbol.for(\"react.memo\"),q=Symbol.for(\"react.lazy\"),t=Symbol.for(\"react.offscreen\"),u;u=Symbol.for(\"react.module.reference\");\nfunction v(a){if(\"object\"===typeof a&&null!==a){var r=a.$$typeof;switch(r){case b:switch(a=a.type,a){case d:case f:case e:case m:case n:return a;default:switch(a=a&&a.$$typeof,a){case k:case h:case l:case q:case p:case g:return a;default:return r}}case c:return r}}}exports.ContextConsumer=h;exports.ContextProvider=g;exports.Element=b;exports.ForwardRef=l;exports.Fragment=d;exports.Lazy=q;exports.Memo=p;exports.Portal=c;exports.Profiler=f;exports.StrictMode=e;exports.Suspense=m;\nexports.SuspenseList=n;exports.isAsyncMode=function(){return!1};exports.isConcurrentMode=function(){return!1};exports.isContextConsumer=function(a){return v(a)===h};exports.isContextProvider=function(a){return v(a)===g};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===b};exports.isForwardRef=function(a){return v(a)===l};exports.isFragment=function(a){return v(a)===d};exports.isLazy=function(a){return v(a)===q};exports.isMemo=function(a){return v(a)===p};\nexports.isPortal=function(a){return v(a)===c};exports.isProfiler=function(a){return v(a)===f};exports.isStrictMode=function(a){return v(a)===e};exports.isSuspense=function(a){return v(a)===m};exports.isSuspenseList=function(a){return v(a)===n};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===d||a===f||a===e||a===m||a===n||a===t||\"object\"===typeof a&&null!==a&&(a.$$typeof===q||a.$$typeof===p||a.$$typeof===g||a.$$typeof===h||a.$$typeof===l||a.$$typeof===u||void 0!==a.getModuleId)?!0:!1};exports.typeOf=v;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n"],"names":["_excluded","SwitchRoot","name","slot","overridesResolver","props","styles","ownerState","root","edge","size","display","width","height","overflow","padding","boxSizing","position","flexShrink","zIndex","verticalAlign","colorAdjust","variants","style","marginLeft","marginRight","thumb","switchBase","checked","transform","SwitchSwitchBase","input","color","theme","top","left","vars","palette","Switch","defaultColor","mode","common","white","grey","transition","transitions","create","duration","shortest","disabled","defaultDisabledColor","track","opacity","switchTrackDisabled","backgroundColor","action","activeChannel","hoverOpacity","active","Object","entries","filter","value","main","light","map","mainChannel","SwitchTrack","borderRadius","onBackground","black","switchTrack","SwitchThumb","boxShadow","shadows","inProps","ref","className","sx","other","classes","slots","composedClasses","useUtilityClasses","icon","children","type","checkedIcon","getSwitchBaseUtilityClass","generateUtilityClass","generateUtilityClasses","SwitchBaseRoot","styled","ButtonBase","SwitchBaseInput","shouldForwardProp","rootShouldForwardProp","cursor","margin","autoFocus","checkedProp","defaultChecked","disabledProp","disableFocusRipple","id","inputProps","inputRef","onBlur","onChange","onFocus","readOnly","required","tabIndex","setCheckedState","useControlled","controlled","default","Boolean","state","muiFormControl","useFormControl","hasLabelFor","capitalize","composeClasses","component","clsx","centerRipple","focusRipple","role","undefined","event","nativeEvent","defaultPrevented","newChecked","target","eventName","__imgCache","Map","useSuspenseImage","src","srcSet","shouldThrowError","onerror","onload","isLoaded","result","has","set","Promise","resolve","reject","img","Image","addEventListener","error","srcset","then","catch","get","readImage","getSuspenseImageUtilityClass","SuspenseImageRoot","_","forwardRef","useThemeProps","errorFallback","otherProps","as","LazyImageRoot","LazyImageSkeleton","Skeleton","skeleton","LazyImageImg","image","InnerSuspendedImage","loading","didIntersect","imgProps","SuspenseImageProps","alt","imageProps","InnerLazyImage","fallback","animation","variant","setIsLoaded","useState","setError","useEffect","onLoad","onError","removeEventListener","inRef","wrapperRef","useRef","useForkRef","enableSuspense","imgRef","unmountAfterIntersection","options","setDidIntersect","isIntersecting","setIsIntersecting","mounted","setMounted","current","observer","IntersectionObserver","forEach","entry","unobserve","observe","disconnect","useIntersectionObserver","InnerComponent","getLazyImageUtilityClass","d","defaultTranslations","bpCount","bvCount","cataloguePrice","qty","quantity","regularPrice","unitPrice","whatsInside","SMALL_SECTION_WIDTH","XS_IMAGE_SIZE","XS_COLUMN_GAP","XS_OUTER_PADDING","SM_IMAGE_SIZE","SM_COLUMN_GAP","SM_OUTER_PADDING","MD_IMAGE_SIZE","MD_COLUMN_GAP","MD_OUTER_PADDING","BODY2_FONT_SIZE","APP_NAME","mainLogger","teamName","logDebug","context","createContext","bp","code","isAvailable","isBundle","isBundleItem","itemTestId","lineNumber","maxQuantity","priceName","testId","totalPrice","url","ItemProvider","Provider","useItemContext","useContext","ImageHolder","isSmall","gridArea","shape","breakpoints","up","ImageHolderLink","ItemImage","useTheme","theImage","CheckoutImage","background","href","defaultType","Set","offerType","infoType","visibility","ItemLabel","label","labelClass","tooltip","croppedClass","split","isVisible","Tooltip","arrow","placement","title","dangerouslySetInnerHTML","__html","Chip","AdditionalInfo","paddingLeft","spacing","gridTemplateColumns","gap","alignItems","Separator","fontSize","lineHeight","ItemAdditionalInfo","infoText","Typography","text","secondary","ColorInfo","ColorVisual","Shade","ItemShade","shade","hexColors","imageUrl","shadeName","canBeSold","productCode","Small","Root","alignSelf","gridTemplateRows","maxWidth","values","md","Name","typography","body1","WebkitLineClamp","WebkitBoxOrient","textWrap","whiteSpace","textOverflow","NameInner","NameLink","InfoSection","justifyContent","alignContent","justifyItems","ItemDescription","brand","flags","infoAddon","flag","length","showInfo","useMemo","showShade","letterSpacing","textTransform","NumberInner","flexFlow","NumberInnerValue","ItemBpBv","bv","showBp","isNonNullable","defaultMessage","Points","offer","contrastText","overline","fontWeight","BeautyPoints","FormattedPoints","culture","pointsFormat","useCulture","u","currency","Hearts","RewardsHeartsFilled","Price","arePointsShown","isOfferColor","primary","Plus","content","ItemPrice","points","useTranslations","useTranslationsFromNamespace","NumberInnerUnit","ItemUnitPrice","translations","matches","useMediaQuery","BasicCataloguePrice","textDecoration","ItemCataloguePrice","basicCataloguePrice","priceLogic","isBrandPartner","cataloguePriceNumber","basicCataloguePriceNumber","unitPriceNumber","showCataloguePrice","showBasicCataloguePrice","usePriceLogic","Numbers","justifySelf","ItemCostBenefit","ItemButtons","buttons","delayBackorder","favorites","notifyMe","postpone","remove","replace","repurchase","reserve","subscribe","unreserve","buttonList","key","visible","IconButton","hoverIcon","TrashcanFilled","onClick","Trashcan","AddToBagFilled","A","AddToBag","FavoritesHeartIconButton","NotificationFilled","Notification","button","disableFocusListener","Button","QuantityText","ItemQuantity","minQuantity","quantityPickerDisabled","quantityPickerDelayTimer","onQuantityChange","setValue","changeOrigin","setChangeOrigin","ready","setReady","debounceTimer","pickerId","minValue","handleChange","useCallback","inputValue","source","currentValue","triggerOnQuantityChange","handleClickAway","prev","timeoutId","setTimeout","clearTimeout","QuantityPicker","maxValue","DecreaseIconButtonProps","IncreaseIconButtonProps","InputProps","onClickAway","Actions","columnGap","FirstPart","SecondPart","ItemActions","hideActionSection","hideQuantity","BASKET_ITEM_IDENTIFIER","gridTemplateAreas","rowGap","BasketItemRoot","BundleWrapper","CollapseTrigger","textAlign","border","outline","InnerBasketItemBundle","bundleItems","expanded","setExpanded","handleExpandClick","bundleData","data","ArrowUpThin","ArrowDownThin","Collapse","unmountOnExit","in","timeout","itemData","InnerBasketItem","translationsNamespace","language","useLanguage","mergedTranslations","contextData","LoggerProvider","logger","ErrorBoundary","areaName","TranslationsProvider","defaultTranslationsWithNamespaces","translationsWithNamespaces","TranslationsNamespaceProvider","namespace","Section","mdMaxWidth","paper","largeComponentRadius","SectionHeader","SubSectionHeader","BasketSection","overrideMdMaxWidth","getActionBannerUtilityClass","ActionBannerRoot","prop","short","showBorder","focusVisible","dark","outlineOffset","ActionBannerContent","isHovering","contentHover","iconName","setIsHovering","handleMouseOver","handleMouseOut","infoIcon","IconComponent","DiscountTagFilled","getActionBannerSlots","onMouseOver","onMouseOut","InfoIcon","ArrowRightThin","SIZE","BACKGROUND","OPACITY","LOADING","COMPONENT","SMALL","sm","SMALL_FONT_SIZE","MEDIUM","MEDIUM_FONT_SIZE","LARGE","LARGE_FONT_SIZE","BASKETITEM","BASKETITEM_FONT_SIZE","WIDTH","HEIGHT","CheckoutSrcOptions","useCheckoutImage","sizeObject","sizeValue","fontSizeValue","getSizeConstants","urlSrc","noImage","imageSrc","surprise","toLocaleLowerCase","includes","sizeParams","URL","params","searchParams","baseParams","additionalParams","paramName","paramValue","baseImageSrc","origin","pathname","encodeURI","encodeURIComponent","CheckoutImageRoot","LazyImage","ignoreContainerSize","lazyImageClasses","maxHeight","isBasketItemSmall","NoImageRoot","SkeletonRoot","testIdValue","fallbackComponent","Products","decodeURI","getInfoBannerUtilityClass","InfoBannerRoot","InfoBannerContent","getInfoIconUtilityClass","InfoIconRoot","autoResize","InfoIconContent","isText","contentText","contentIcon","contentAutoResize","getInfoIconSlots","parseNumberFromString","checkedValue","numberValue","Number","parseFloat","replaceAll","isNaN","isNullableStringAGreaterThanB","a","b","first","second","stringEmptyToUndefined","trim","ProductBoxCarousel","analyticsPlacement","classNames","customerId","hideRating","mrpStatementEnabled","showSkeletonIfEmpty","slider","tenant","withTranslationsProvider","ProductBoxMode","Concept","getTestId","useTestId","areFavoritesEnabled","isAuthenticated","isAuthenticatedCustomer","setAreFavoritesEnabled","dispatchRequestFavoritesEvent","window","dispatchEvent","CustomEvent","useAreFavoritesEnabled","isMobile","useIsMobile","sortedData","sort","quickBuy","sortProductBoxesByAvailability","Carousel","hasFocusableSlides","carousel","getSliderOptions","pagination","show","navigation","showArrows","index","CarouselSlide","minWidth","ProductBoxSkeleton","product","ProductBox","analyticsData","basicSwrOptions","revalidateIfStale","revalidateOnFocus","revalidateOnReconnect","getRetryErrorSwrOptions","retryCount","retryCountParam","retryInterval","shouldRetryOnError","errorRetryCount","errorRetryInterval","onErrorRetry","config","revalidate","statusCode","response","status","GatewayTimeout","BadRequest","InternalServerError","useHideRating","staticApiUrl","enabled","fetchKey","join","async","client","ApiClient","baseUrl","bazaarvoiceConfig","testfreaksConfig","all","ratingsAndReviewsEnabled","scriptUrl","Error","cause","resolveHideRating","mapProductBoxesFromStaticApi","products","overrides","t","nodeType","e","n","clientHeight","scrollHeight","clientWidth","scrollWidth","o","getComputedStyle","overflowY","overflowX","ownerDocument","defaultView","frameElement","l","r","i","s","parentElement","getRootNode","host","idCounter","cbToCb","cb","noop","scrollIntoView","node","menuNode","actions","h","document","scrollMode","c","block","f","inline","boundary","skipOverflowHiddenElements","g","p","TypeError","m","scrollingElement","documentElement","w","W","push","body","visualViewport","innerWidth","H","innerHeight","scrollX","y","scrollY","M","v","E","x","right","C","bottom","I","R","getBoundingClientRect","T","B","F","V","scrollMarginTop","scrollMarginRight","scrollMarginBottom","scrollMarginLeft","k","D","L","parseInt","borderLeftWidth","borderTopWidth","borderRightWidth","borderBottomWidth","offsetWidth","S","offsetHeight","X","Y","Math","max","scrollLeft","scrollTop","min","el","_ref","isOrContainsNode","parent","child","environment","Node","contains","debounce","fn","time","cancel","wrapper","_len","arguments","args","Array","_key","apply","callAllEventHandlers","_len2","fns","_key2","_len3","_key3","some","concat","preventDownshiftDefault","hasOwnProperty","handleRefs","_len4","refs","_key4","generateId","String","getA11yStatusMessage","_ref2","isOpen","resultCount","previousResultCount","unwrapArray","arg","defaultValue","isArray","isDOMElement","element","getElementProps","stateKeys","pickState","getState","keys","reduce","prevState","isControlledProp","normalizeArrowKey","keyCode","indexOf","getHighlightedIndex","start","offset","items","isItemDisabled","circular","count","itemsLastIndex","highlightedIndex","getNonDisabledIndex","backwards","_index","targetWithinDownshift","downshiftElements","checkActiveElement","contextNode","activeElement","cleanupStatus","documentProp","getStatusDiv","textContent","statusDiv","getElementById","createElement","setAttribute","assign","clip","appendChild","setStatus","stateChangeTypes$3","freeze","__proto__","blurButton","blurInput","changeInput","clickButton","clickItem","controlledPropUpdatedSelectedItem","itemMouseEnter","keyDownArrowDown","keyDownArrowUp","keyDownEnd","keyDownEnter","keyDownEscape","keyDownHome","keyDownSpaceButton","mouseUp","touchEnd","unknown","_excluded$3","_excluded2$3","_excluded3$2","_excluded4$2","_excluded5","Downshift$1","Downshift","_Component","_props","_this","call","this","menuId","labelId","inputId","getItemId","itemCount","timeoutIds","internalSetTimeout","setItemCount","unsetItemCount","_item","currentElementNode","getItemNodeFromIndex","hasAttribute","setHighlightedIndex","otherStateToSet","defaultHighlightedIndex","internalSetState","clearSelection","selectedItem","defaultIsOpen","selectItem","item","itemToString","selectItemAtIndex","itemIndex","selectHighlightedItem","stateToSet","isItemSelected","onChangeArg","onStateChangeArg","isStateToSetFunction","onInputValueChange","getStateAndHelpers","setState","_newStateToSet","newStateToSet","stateReducer","nextState","onStateChange","onSelect","onUserAction","rootRef","_rootNode","getRootProps","_temp","_temp2","_extends2","_ref$refKey","refKey","rest","_ref2$suppressRefErro","suppressRefError","called","keyDownHandlers","ArrowDown","_this2","preventDefault","amount","shiftKey","moveHighlightedIndex","getItemCount","nextHighlightedIndex","ArrowUp","_this3","Enter","which","_this$getState2","itemNode","Escape","reset","buttonKeyDownHandlers","toggleMenu","inputKeyDownHandlers","Home","newHighlightedIndex","End","getToggleButtonProps","_temp3","_ref3","onPress","onKeyDown","onKeyUp","enabledEventHandlers","buttonHandleClick","buttonHandleKeyDown","buttonHandleKeyUp","buttonHandleBlur","eventHandlers","_this$props$environme","focus","blurTarget","isMouseDown","getLabelProps","htmlFor","getInputProps","_temp4","_ref4","onInput","onChangeText","_eventHandlers","_this$getState6","inputHandleChange","inputHandleKeyDown","inputHandleBlur","autoComplete","_activeElement$datase","dataset","toggle","menuRef","_menuNode","getMenuProps","_temp5","_temp6","_extends3","_ref5","_ref5$refKey","_ref6$suppressRefErro","getItemProps","_temp7","_enabledEventHandlers","_ref7","onMouseMove","onMouseDown","_ref7$item","customClickHandler","avoidScrolling","clearItems","_ref8","_ref9","_this$getState7","openMenu","closeMenu","updateStatus","_this$props","highlightedItem","_this$props2","_this$props2$initialH","initialHighlightedIndex","_highlightedIndex","_this$props2$initialI","initialIsOpen","_isOpen","_this$props2$initialI2","initialInputValue","_inputValue","_this$props2$initialS","initialSelectedItem","_selectedItem","_state","_proto","prototype","internalClearTimeouts","stateToMerge","scrollHighlightedItemIntoView","_this$getState9","componentDidMount","_this4","onMouseUp","onOuterClick","onTouchStart","isTouchMove","onTouchMove","onTouchEnd","contextWithinDownshift","cleanup","shouldScroll","prevProps","currentHighlightedIndex","prevHighlightedIndex","componentDidUpdate","selectedItemChanged","componentWillUnmount","render","cloneElement","Component","defaultProps","prevItem","stateChangeTypes","useLayoutEffect","defaultProps$3","itemToKey","changes","commonPropTypes","isRequired","commonDropdownPropTypes","defaultSelectedItem","toggleButtonId","onSelectedItemChange","onHighlightedIndexChange","onIsOpenChange","defaultInputValue","Symbol","for","q","$$typeof"],"sourceRoot":""}