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ACD,OACI,SAAC,EAAoB,CAAC2P,cAAe7P,EAAMiQ,iBAAgB,UACvD,SAACE,EAAA,EAAI,CAAC/K,MAAM,aAAagL,QAAM,EAAC9K,KAAM,GAAE,UACpC,SAAC+K,EAAA,EAAI,CAACnL,KAAM,IAAWjF,MAAO,GAAIC,OAAQ,SAK1D,QACI,OAAO,KACf,C,kFCnCG,MAAMoQ,EAOT,8BAAOC,CAAwBC,GAC3B,OAAOC,EAAwBD,EACnC,EARuB,EAAAE,cAAgB,WAEhB,EAAAC,qBAAuB,gBAEvB,EAAAC,kBAAoB,cAmB/C,MAAMH,EAA6D,CAC/DI,SAAU,CACNC,YAAa,CACT,CAAC,MAAsB,CACnBC,cAAe,IACfC,eAAgB,GAEpB,EAAC,QAAoB,KAAYC,KAAM,CACnCF,cAAe,IACfC,eAAgB,KAI5BE,cAAe,CACXJ,YAAa,CACT,CAAC,MAAsB,CACnBC,cAAe,IACfC,eAAgB,GAEpB,EAAC,QAAoB,KAAYC,KAAM,CACnCF,cAAe,EACfC,eAAgB,GAEpB,EAAC,QAAoB,KAAYG,MAAO,CACpCJ,cAAe,EACfC,eAAgB,KAI5BI,YAAa,CACTN,YAAa,CACT,CAAC,MAAsB,CACnBC,cAAe,IACfC,eAAgB,GAEpB,EAAC,QAAoB,KAAYK,MAAO,CACpCN,cAAe,IACfC,eAAgB,KAEpB,EAAC,QAAoB,KAAYC,KAAM,CACnCF,cAAe,EACfC,eAAgB,GAEpB,EAAC,QAAoB,KAAYM,KAAM,CACnCP,cAAe,EACfC,eAAgB,K","sources":["webpack:///../../packages/icons/src/stroke2/clock.svg","webpack:///../../packages/icons/src/stroke2/trash.svg","webpack:///./src/microApps/cart/components/molecules/ProductListingItem/ProductListingItem.tsx","webpack:///./src/microApps/cart/selectors/cartRecipeSelectors.ts","webpack:///./src/microApps/common/components/atoms/SubstituteTrigger.tsx","webpack:///./src/microApps/common/components/atoms/Tooltip.tsx","webpack:///./src/microApps/common/components/molecules/ProductSubstitutes.tsx","webpack:///./src/microApps/common/components/molecules/TabSwitcher/TabSwitcher.hooks.ts","webpack:///./src/microApps/common/components/molecules/TabSwitcher/TabSwitcher.tsx","webpack:///./src/microApps/common/components/molecules/TabSwitcher/StatefulTabSwitcher.tsx","webpack:///./src/microApps/common/hooks/useSwiperOverflowClasses.ts","webpack:///./src/microApps/recipe/components/CommonRecipesTooltip/CommonRecipesTooltip.tsx","webpack:///./src/microApps/recipe/components/SharedRecipesTooltip/SharedRecipesTooltip.tsx","webpack:///./src/microApps/recipe/components/SharedBetweenRecipesTooltip/SharedBetweenRecipesTooltip.tsx","webpack:///./src/utility/coopSwiperBreakpointsUnique.ts"],"sourcesContent":["var _path, _path2;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nconst SvgClock = _ref => {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: \"1em\",\n height: \"1em\",\n viewBox: \"0 0 24 24\",\n xmlns: \"http://www.w3.org/2000/svg\",\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M11 5C11 4.44772 11.4477 4 12 4C12.5523 4 13 4.44772 13 5V12.3343C13 12.6687 12.8328 12.981 12.5545 13.1664L8.55451 15.8318C8.09491 16.138 7.47407 16.0137 7.16782 15.5541C6.86158 15.0945 6.98589 14.4737 7.44549 14.1674L11 11.7989V5Z\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0ZM2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12Z\"\n })));\n};\nexport default SvgClock;","var _path;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nconst SvgTrash = _ref => {\n let {\n title,\n titleId,\n ...props\n } = _ref;\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: \"1em\",\n height: \"1em\",\n viewBox: \"0 0 24 24\",\n xmlns: \"http://www.w3.org/2000/svg\",\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M8 5C8 3.34315 9.34315 2 11 2H13C14.6569 2 16 3.34315 16 5V6H20C20.5523 6 21 6.44772 21 7C21 7.55228 20.5523 8 20 8H19V19C19 20.6569 17.6569 22 16 22H8C6.34315 22 5 20.6569 5 19V8H4C3.44772 8 3 7.55228 3 7C3 6.44772 3.44772 6 4 6H8V5ZM10 6H14V5C14 4.44772 13.5523 4 13 4H11C10.4477 4 10 4.44772 10 5V6ZM7 8V19C7 19.5523 7.44772 20 8 20H16C16.5523 20 17 19.5523 17 19V8H7ZM10 10C10.5523 10 11 10.4477 11 11V17C11 17.5523 10.5523 18 10 18C9.44772 18 9 17.5523 9 17V11C9 10.4477 9.44772 10 10 10ZM14 10C14.5523 10 15 10.4477 15 11V17C15 17.5523 14.5523 18 14 18C13.4477 18 13 17.5523 13 17V11C13 10.4477 13.4477 10 14 10Z\"\n })));\n};\nexport default SvgTrash;","import classnames from 'classnames';\nimport type { ReactElement, ReactNode } from 'react';\n\nimport type { AnalyticsListOptions } from '../../../../../analytics/analyticsHandler';\nimport CloudinaryImage from '../../../../common/components/atoms/CloudinaryImage';\nimport { ConditionalMultipleWrappers } from '../../../../common/components/atoms/ConditionalWrapper';\nimport { ItemMedicalInfo } from '../../../../common/components/atoms/MedicalInfo';\nimport {\n getFormattedComparativePrice,\n getFormattedPackagingInfo,\n} from '../../../../common/utils/productUtils';\nimport MaxPromotionUsage from '../../../../ecommerce/components/MaxPromotionUsage';\n\ninterface ProductListingItemProps {\n innerRef?: React.Ref<HTMLLIElement>;\n name?: string;\n packageSizeInformation?: string;\n variantName?: string;\n image?: string;\n manufacturer?: string;\n productUrl?: string;\n additionalClassNames?: string;\n slotLeft?: ReactNode;\n slotPrice?: ReactNode;\n slotSplash?: ReactNode;\n analyticsOptions: AnalyticsListOptions | null;\n bottomRow?: ReactNode;\n handleLinkClick?: (e: React.MouseEvent<HTMLAnchorElement>) => void;\n comparativePrice?: number;\n comparativeText?: string;\n isNicotineProduct: boolean;\n isPharmaceutical: boolean;\n promotion?: EcomPromotion;\n isOutOfStock?: boolean;\n isALink?: boolean;\n}\n\nconst ProductListingItem = ({\n isALink = true,\n ...props\n}: React.PropsWithChildren<ProductListingItemProps>) => {\n return (\n <li ref={props.innerRef} className={classnames('Cart-item', props.additionalClassNames)}>\n <div className={classnames('Cart-itemRow', props.isOutOfStock && 'u-textLineThrough')}>\n {props.slotLeft}\n <div className={classnames('Cart-itemContainer', 'Cart-itemContainerWrapped')}>\n <div className=\"Cart-itemRow Cart-itemRowPrimary\">\n <div\n className={classnames(\n 'Cart-itemWrapperImage',\n !!props.slotSplash && 'Cart-itemWrapperImageWithPromo',\n )}\n >\n <ProductItemImage\n productUrl={props.productUrl}\n handleLinkClick={props.handleLinkClick}\n image={props.image}\n name={props.name}\n isALink={isALink}\n />\n {props.slotSplash && (\n <div className=\"Cart-itemSplash\">{props.slotSplash}</div>\n )}\n </div>\n <div className=\"Cart-itemWrapper\">\n <div className=\"Cart-itemWrapperProduct\">\n <div className=\"Cart-itemWrapperDetail\">\n <ProductItemInfo\n productUrl={props.productUrl}\n name={props.name}\n manufacturer={props.manufacturer}\n variantName={props.variantName}\n packageSizeInformation={props.packageSizeInformation}\n comparativePrice={props.comparativePrice}\n comparativeText={props.comparativeText}\n handleLinkClick={props.handleLinkClick}\n isNicotineProduct={props.isNicotineProduct}\n isPharmaceutical={props.isPharmaceutical}\n promotion={props.promotion}\n isALink={isALink}\n />\n </div>\n <div className=\"Cart-itemWrapperPrice\">{props.slotPrice}</div>\n </div>\n {!!props.children && (\n <div className=\"Cart-itemRow\">\n <div className=\"Cart-itemWrapperActions\">{props.children}</div>\n </div>\n )}\n </div>\n </div>\n </div>\n </div>\n {!!props.bottomRow && <div className=\"Cart-itemRow\">{props.bottomRow}</div>}\n </li>\n );\n};\n\ninterface ProductItemInfoProps {\n productUrl?: string;\n handleLinkClick?: React.MouseEventHandler<HTMLAnchorElement>;\n name?: string | ReactElement;\n manufacturer?: string;\n variantName?: string;\n packageSizeInformation?: string;\n comparativePrice?: number;\n comparativeText?: string;\n isNicotineProduct?: boolean;\n isPharmaceutical?: boolean;\n promotion?: EcomPromotion;\n isALink?: boolean;\n}\n\nconst ProductItemInfo = ({\n productUrl,\n handleLinkClick,\n name,\n manufacturer,\n variantName,\n packageSizeInformation,\n comparativePrice,\n comparativeText,\n isNicotineProduct,\n isPharmaceutical,\n promotion,\n isALink = true,\n}: ProductItemInfoProps) => {\n const packagingInfo = getFormattedPackagingInfo(variantName, packageSizeInformation);\n\n const comparativePriceFormatted = getFormattedComparativePrice(\n comparativePrice,\n comparativeText,\n );\n\n return (\n <div className=\"u-flexAlignSelfCenter u-textLeft\">\n <ConditionalMultipleWrappers\n choices={[\n {\n condition: !!productUrl && isALink,\n renderWrapper: (ch) => (\n <a\n href={productUrl}\n className=\"Cart-itemHeading Cart-itemHeading--link\"\n style={{ whiteSpace: 'normal' }}\n onClick={handleLinkClick}\n data-test=\"cart-productitem-name\"\n tabIndex={-1}\n >\n {ch}\n </a>\n ),\n },\n {\n condition: !isALink || !productUrl,\n renderWrapper: (ch) => (\n <div\n className=\"Cart-itemHeading\"\n style={{ whiteSpace: 'normal' }}\n data-test=\"cart-productitem-name\"\n >\n {ch}\n </div>\n ),\n },\n ]}\n >\n {name}\n </ConditionalMultipleWrappers>\n <p\n className=\"Cart-itemSubtitle Cart-itemSubtitleWrapped\"\n style={{ whiteSpace: 'normal' }}\n >\n {manufacturer && (\n <span className=\"u-textWeightBold\">\n {`${manufacturer}`}\n {manufacturer && '. '}\n </span>\n )}\n {!!packagingInfo && (\n <span>\n {packagingInfo}\n {!!comparativePriceFormatted && '. '}\n </span>\n )}\n {!!comparativePriceFormatted && <span>{comparativePriceFormatted}</span>}\n {!!promotion?.maxUseText && <MaxPromotionUsage text={promotion.maxUseText} />}\n </p>\n <ItemMedicalInfo isNicotine={isNicotineProduct} isPharmaceutical={isPharmaceutical} />\n </div>\n );\n};\n\ninterface ProductItemImageProps {\n productUrl?: string;\n handleLinkClick?: React.MouseEventHandler<HTMLAnchorElement>;\n image?: string;\n name?: string;\n isALink?: boolean;\n}\n\nconst ProductItemImage = ({\n productUrl,\n handleLinkClick,\n image,\n name,\n isALink = true,\n}: ProductItemImageProps) => {\n return (\n <ConditionalMultipleWrappers\n choices={[\n {\n condition: !!productUrl && isALink,\n renderWrapper: (ch) => (\n <a href={productUrl} className=\"u-block\" onClick={handleLinkClick}>\n {ch}\n </a>\n ),\n },\n {\n condition: !isALink || !productUrl,\n renderWrapper: (ch) => ch,\n },\n ]}\n >\n <CloudinaryImage\n cssClass=\"Cart-itemImage\"\n url={image}\n name={name || ''}\n transform=\"e_sharpen,f_auto,fl_clip,fl_progressive,q_90,c_lpad,g_center,h_68,w_68\"\n retinaTransform=\"e_sharpen,f_auto,fl_clip,fl_progressive,q_70,c_lpad,g_center,h_136,w_136\"\n fallbackUrl=\"/Assets/Images/missing-image-product.png\"\n />\n </ConditionalMultipleWrappers>\n );\n};\n\nexport default ProductListingItem;\n\nexport const ProductListItem = {\n Image: ProductItemImage,\n Info: ProductItemInfo,\n};\n","import { createSelector } from '@reduxjs/toolkit';\n\nimport { recipesAdapter } from '../../common/store/adapters/recipesAdapter';\nimport type { RootState } from '../../common/store/structureDefinitions/cartState';\n\nconst recipeSelectors = recipesAdapter.getSelectors((state: RootState) => state.cart.recipes);\nconst selectNonEmptyRecipes = createSelector(recipeSelectors.selectAll, (cartRecipes) =>\n cartRecipes.filter((x) => !!x.productsMap?.length),\n);\n\nconst selectNonEmptyRecipeIds = createSelector(selectNonEmptyRecipes, (cartRecipes) =>\n cartRecipes.map((item) => item.code),\n);\nconst selectNonEmptyRecipebyId = createSelector(\n selectNonEmptyRecipes,\n (_: RootState, recipeId: string) => recipeId,\n (cartRecipes, recipeId) => cartRecipes.find((item) => item.code === recipeId),\n);\n\nconst hasFoodboxInCart = createSelector(recipeSelectors.selectAll, (cartRecipes) =>\n cartRecipes.some((r) => r.group === 'foodbox'),\n);\n\nconst cartRecipeSelectors = {\n all: recipeSelectors,\n nonEmpty: {\n selectAll: selectNonEmptyRecipes,\n selectIds: selectNonEmptyRecipeIds,\n selectById: selectNonEmptyRecipebyId,\n },\n hasFoodboxInCart,\n};\n\nexport default cartRecipeSelectors;\n","import { ChipButton, ChipIconButton } from '@coop/components';\nimport { CloseIcon } from '@coop/icons';\nimport type { FC } from 'react';\n\ntype SubstituteTriggerButtonTheme = 'whiteGreen' | 'greenCta';\n\ninterface SubstituteTriggerProps {\n handleSubsituteTrigger: () => void;\n theme: SubstituteTriggerButtonTheme;\n isActive: boolean;\n}\n\nconst SubstituteTrigger: FC<React.PropsWithChildren<SubstituteTriggerProps>> = (\n props: SubstituteTriggerProps,\n) => {\n return props.isActive ? (\n <ChipIconButton\n icon={CloseIcon}\n label=\"Stäng\"\n isActive\n theme=\"whiteGreen\"\n onClick={props.handleSubsituteTrigger}\n size={32}\n />\n ) : (\n <ChipButton theme={props.theme} onClick={props.handleSubsituteTrigger} size={32}>\n Byt vara\n </ChipButton>\n );\n};\n\nexport default SubstituteTrigger;\n","import { useElementEvent, useOutsideClick } from '@coop/hooks';\nimport classnames from 'classnames';\nimport type { CSSProperties, FC, MutableRefObject, ReactNode } from 'react';\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport * as _ from 'underscore';\n\ninterface TooltipProps {\n children: ReactNode;\n content: string | ReactNode;\n className?: string;\n style?: CSSProperties;\n tooltipStyle?: CSSProperties;\n disabled?: boolean;\n defaultCursor?: boolean;\n visibleTooltip?: boolean;\n handleClick?: () => void;\n handleMouseOver?: () => void;\n handleMouseOut?: () => void;\n handleOutsideClick?: () => void;\n useOutsideClick?: boolean;\n arrowPlacement?: string;\n arrowOffset?: number;\n}\n\nenum ArrowPosition {\n Center,\n Right,\n Left,\n}\n\nconst TOOLTIP_WIDTH = 250;\nconst TOOLTIP_DEFAULT = 'Tooltip u-textLeft u-posAbsolute';\nconst ARROW_TOP = 'Tooltip--topArrow';\nconst ARROW_BOTTOM = 'Tooltip--bottomArrow';\nconst ARROW_LEFT = 'Tooltip--left Tooltip--leftArrow';\nconst ARROW_CENTER = 'Tooltip--center Tooltip--centerArrow';\nconst ARROW_RIGHT = 'Tooltip--right Tooltip--rightArrow';\n\nconst getPosFromCss = (tooltipCss: string): ArrowPosition => {\n if (tooltipCss?.indexOf('left') > -1) {\n return ArrowPosition.Left;\n }\n if (tooltipCss?.indexOf('right') > -1) {\n return ArrowPosition.Right;\n }\n return ArrowPosition.Center;\n};\n\nconst getFreeSpace = (\n oldPos: ArrowPosition,\n left: number,\n): { spaceOnLeft: number; spaceOnRight: number } => {\n if (oldPos === ArrowPosition.Center) {\n return {\n spaceOnLeft: TOOLTIP_WIDTH / 2 + left,\n spaceOnRight: window.innerWidth - (TOOLTIP_WIDTH / 2 + left),\n };\n }\n if (oldPos === ArrowPosition.Left) {\n return { spaceOnLeft: left, spaceOnRight: window.innerWidth - left };\n }\n return {\n spaceOnLeft: left + TOOLTIP_WIDTH,\n spaceOnRight: window.innerWidth - (left + TOOLTIP_WIDTH),\n };\n};\n\nconst calculateTooltipArrowPosition = (\n propsArrowPlacement: string | undefined,\n oldTooltipCss: string,\n tooltipRef: MutableRefObject<HTMLSpanElement | null>,\n setCurrentPosRef: (arrowPosition: ArrowPosition) => void,\n currentPosRef: MutableRefObject<ArrowPosition | null>,\n): string => {\n if (propsArrowPlacement) {\n const arrowPlacement = [TOOLTIP_DEFAULT];\n\n if (propsArrowPlacement?.indexOf('top') > -1) {\n arrowPlacement.push(ARROW_TOP);\n } else {\n arrowPlacement.push(ARROW_BOTTOM);\n }\n\n if (propsArrowPlacement?.indexOf('left') > -1) {\n arrowPlacement.push(ARROW_LEFT);\n } else if (propsArrowPlacement?.indexOf('right') > -1) {\n arrowPlacement.push(ARROW_RIGHT);\n } else {\n arrowPlacement.push(ARROW_CENTER);\n }\n\n return arrowPlacement.join(' ');\n }\n\n if (!tooltipRef?.current) {\n return `${TOOLTIP_DEFAULT} ${ARROW_BOTTOM} ${ARROW_CENTER}`;\n }\n\n const { left } = tooltipRef.current.getBoundingClientRect();\n\n const oldPos = currentPosRef?.current ?? getPosFromCss(oldTooltipCss);\n const { spaceOnLeft, spaceOnRight } = getFreeSpace(oldPos, left);\n const changeToCenter = spaceOnLeft > TOOLTIP_WIDTH / 2 && spaceOnRight > TOOLTIP_WIDTH / 2;\n\n // if possible change to center\n if (changeToCenter) {\n setCurrentPosRef(ArrowPosition.Center);\n return `${TOOLTIP_DEFAULT} ${ARROW_BOTTOM} ${ARROW_CENTER}`;\n }\n\n if (spaceOnLeft > spaceOnRight) {\n setCurrentPosRef(ArrowPosition.Right);\n return `${TOOLTIP_DEFAULT} ${ARROW_BOTTOM} ${ARROW_RIGHT}`;\n }\n\n setCurrentPosRef(ArrowPosition.Left);\n return `${TOOLTIP_DEFAULT} ${ARROW_BOTTOM} ${ARROW_LEFT}`;\n};\n\nconst arrowHeight = 20;\n\n// NOTE: margin on props.children will make the tooltips placement slightly off. So use props.style for margins.\nexport const Tooltip: FC<React.PropsWithChildren<TooltipProps>> = (props) => {\n const [tooltipClassNames, setTooltipClassNames] = useState(\n `${TOOLTIP_DEFAULT} ${ARROW_BOTTOM} ${ARROW_CENTER}`,\n );\n const currentPosRef = useRef<ArrowPosition | null>(null);\n\n const setCurrentPosRef = (position: ArrowPosition) => {\n currentPosRef.current = position;\n };\n\n const [uniqueIdForAria] = useState(() => _.uniqueId('tooltip-'));\n\n const tooltipRef = useRef<HTMLSpanElement | null>(null);\n\n useOutsideClick(\n tooltipRef,\n props.handleOutsideClick!,\n !!props.handleOutsideClick && !!props.useOutsideClick,\n );\n\n const top =\n props.arrowPlacement && props.arrowPlacement?.indexOf('top') > -1\n ? undefined\n : -arrowHeight - (props.arrowOffset || 0) - (tooltipRef.current?.offsetHeight || 0);\n\n const bottom =\n props.arrowPlacement && props.arrowPlacement?.indexOf('top') > -1\n ? -arrowHeight - (props.arrowOffset || 0) - (tooltipRef.current?.offsetHeight || 0)\n : undefined;\n\n const resetTooltipPosition = useCallback(() => {\n const tooltipArrowPosCss = calculateTooltipArrowPosition(\n props.arrowPlacement,\n tooltipClassNames,\n tooltipRef,\n setCurrentPosRef,\n currentPosRef,\n );\n if (tooltipArrowPosCss !== tooltipClassNames) {\n setTooltipClassNames(tooltipArrowPosCss);\n }\n }, [props.arrowPlacement, tooltipClassNames]);\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const onResize = useCallback(\n _.debounce(() => {\n resetTooltipPosition();\n }, 200),\n [resetTooltipPosition],\n );\n\n useEffect(() => {\n resetTooltipPosition();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [props.disabled]);\n\n useElementEvent(window, 'resize', onResize, true);\n\n return (\n <div\n style={{ position: 'relative', ...props.style }}\n className={props.defaultCursor ? 'u-cursorDefault' : 'u-cursorPointer'}\n onClick={props.handleClick}\n onMouseEnter={props.handleMouseOver}\n onMouseLeave={props.handleMouseOut}\n // onMouseOver={props.handleMouseOver}\n // onMouseOut={props.handleMouseOut}\n // onFocus={props.handleMouseOver}\n // onBlur={props.handleMouseOut}\n aria-labelledby={uniqueIdForAria}\n >\n {props.children}\n\n <span\n id={uniqueIdForAria}\n role=\"tooltip\"\n ref={tooltipRef}\n style={{\n top,\n bottom,\n whiteSpace: 'normal',\n color: '#333',\n transition: 'visibility 0.3s ease, opacity 0.3s ease',\n ...props.tooltipStyle,\n }}\n className={classnames(\n 'u-textWeightNormal',\n tooltipClassNames,\n props.visibleTooltip ? 'u-isVisible u-opacity1' : 'u-isInvisible u-opacity0',\n props.className ? props.className : '',\n )}\n >\n {props.content}\n </span>\n </div>\n );\n};\n\nconst withHover =\n (TooltipComponent: FC<React.PropsWithChildren<TooltipProps>>) => (props: TooltipProps) => {\n const [hovering, setHovering] = useState<boolean>(false);\n const onMouseOver = () => {\n setHovering(true);\n if (props.handleMouseOver) {\n props.handleMouseOver();\n }\n };\n const onMouseOut = () => {\n setHovering(false);\n if (props.handleMouseOut) {\n props.handleMouseOut();\n }\n };\n\n return (\n <TooltipComponent\n arrowPlacement={props.arrowPlacement}\n content={props.content}\n className={props.className}\n defaultCursor={props.defaultCursor}\n disabled={props.disabled}\n handleClick={props.handleClick}\n handleOutsideClick={props.handleOutsideClick}\n style={props.style}\n tooltipStyle={props.tooltipStyle}\n useOutsideClick={props.useOutsideClick}\n visibleTooltip={props.disabled ? false : hovering}\n handleMouseOver={onMouseOver}\n handleMouseOut={onMouseOut}\n >\n {props.children}\n </TooltipComponent>\n );\n };\n\nexport const TooltipOnHover = withHover(Tooltip);\n","import { Button } from '@coop/components';\nimport type { FC } from 'react';\nimport { useMemo } from 'react';\nimport type { SwiperOptions } from 'swiper/types';\n\nimport type { AnalyticsListOptions } from '../../../../analytics/analyticsHandler';\nimport type { SwiperBreakpoints } from '../../../../utility/coopSwiperBreakpoints';\nimport { useIsInCheckoutMicroApp } from '../../contexts/microAppContext';\nimport { useSwiperOverflowClasses } from '../../hooks/useSwiperOverflowClasses';\nimport type { PriceType } from '../../models/priceData/priceData';\nimport { mapProductToProps } from '../../utils/productUtils';\nimport { useIsMobile } from '../atoms/ResponsiveBreakpoints';\nimport { SwipableList } from '../SwipableList';\nimport EcomProductTeaser from './EcomProductTeaser';\n\nexport interface ProductSubstitutesProps {\n substitutes: ApiProduct[];\n handleProductSubstitution: (product: ApiProduct) => void;\n analyticsOptions?: AnalyticsListOptions;\n activeSubstituteId?: string;\n productSubstitutesBreakpoints: SwiperBreakpoints;\n isConstrained?: boolean;\n priceType: PriceType;\n}\n\nconst ProductSubstitutes: FC<React.PropsWithChildren<ProductSubstitutesProps>> = (props) => {\n const isInCheckout = useIsInCheckoutMicroApp();\n const isMobile = useIsMobile();\n\n const { mainSwiperClasses, spaceBetween } = useSwiperOverflowClasses({\n constrainedX: (isInCheckout && isMobile) || props.isConstrained,\n constrainedY: true,\n });\n\n const swiperOptions: SwiperOptions = useMemo(\n () => ({\n spaceBetween,\n breakpoints: props.productSubstitutesBreakpoints,\n }),\n [props.productSubstitutesBreakpoints, spaceBetween],\n );\n\n const onButtonClick = (item: ApiProduct) => (e: React.MouseEvent) => {\n e.stopPropagation();\n props.handleProductSubstitution(item);\n };\n\n if (!props.substitutes?.length) {\n return null;\n }\n\n return (\n <SwipableList swiperOptions={swiperOptions} swiperMainClassName={mainSwiperClasses}>\n {props.substitutes.map((item: ApiProduct) => (\n <EcomProductTeaser\n key={item.identifier}\n handleTeaserClick={() => props.handleProductSubstitution(item)}\n product={mapProductToProps(item)}\n isALink={false}\n containerCss=\"u-borderAllGrayLight2\"\n priceType={props.priceType}\n actionsSlot={\n props.activeSubstituteId === item.identifier ? (\n <Button theme=\"light\" onClick={onButtonClick(item)} fullWidth>\n Vald\n </Button>\n ) : (\n <Button theme=\"primary\" onClick={onButtonClick(item)} fullWidth>\n Välj\n </Button>\n )\n }\n />\n ))}\n </SwipableList>\n );\n};\n\nexport default ProductSubstitutes;\n","import { useElementEvent } from '@coop/hooks';\nimport { useCallback, useLayoutEffect, useRef } from 'react';\nimport _ from 'underscore';\n\nexport const useTabSwitcher = () => {\n const indicatorRef = useRef<HTMLDivElement>(null);\n\n const tabScrollableRef = useRef<HTMLDivElement>(null);\n const activeItemRef = useRef<HTMLButtonElement>(null);\n const tabListRef = useRef<HTMLDivElement>(null);\n\n const renderIndicator = useCallback(() => {\n if (activeItemRef.current && indicatorRef.current) {\n const linkWidth = activeItemRef.current.offsetWidth;\n\n const linkPos = activeItemRef.current.offsetLeft;\n\n indicatorRef.current.style.width = `${linkWidth}px`;\n indicatorRef.current.style.left = `${linkPos}px`;\n }\n }, []);\n\n const onLeftArrowClick = (e: React.MouseEvent | React.FocusEvent) => {\n e.preventDefault();\n if (tabScrollableRef.current) {\n tabScrollableRef.current.scrollBy({\n left:\n tabScrollableRef.current.scrollLeft -\n tabScrollableRef.current.scrollWidth +\n 100,\n behavior: 'smooth',\n });\n }\n };\n\n const onRightArrowClick = (e: React.MouseEvent | React.FocusEvent) => {\n e.preventDefault();\n if (tabScrollableRef.current) {\n tabScrollableRef.current.scrollBy({\n left:\n tabScrollableRef.current.scrollLeft +\n tabScrollableRef.current.clientWidth -\n 100,\n behavior: 'smooth',\n });\n }\n };\n\n const arrowLeftRef = useRef<HTMLDivElement>(null);\n const arrowRightRef = useRef<HTMLDivElement>(null);\n\n const toggleNavigationButtons = useCallback(() => {\n const tabScrollable = tabScrollableRef.current;\n if (!tabScrollable) {\n return null;\n }\n const tabScrollableWidth = tabScrollable.clientWidth;\n\n if (!tabListRef.current) {\n return null;\n }\n\n const tabListWidth = tabListRef.current.clientWidth;\n const { scrollLeft } = tabScrollable;\n const leftButton = arrowLeftRef.current;\n const rightButton = arrowRightRef.current;\n\n if (tabListWidth > tabScrollableWidth) {\n if (leftButton) {\n if (scrollLeft > 0) {\n // leftButton.fadeIn(200);\n // leftButton.animate({ display: 'block' }, 200);\n leftButton.style.display = 'block'; // ({ display: 'block' }, 200);\n } else {\n // leftButton.fadeOut(200);\n // leftButton.animate({ display: 'none' }, 200);\n leftButton.style.display = 'none';\n }\n }\n\n if (rightButton) {\n if (scrollLeft + tabScrollableWidth < tabListWidth - 2) {\n // rightButton.fadeIn(200);\n // rightButton.animate({ display: 'block' }, 200);\n rightButton.style.display = 'block';\n } else {\n // rightButton.fadeOut(200);\n // rightButton.animate({ display: 'none' }, 200);\n rightButton.style.display = 'none';\n }\n }\n } else {\n // leftButton.fadeOut(200);\n // rightButton.fadeOut(200);\n // leftButton.animate({ display: 'none' }, 200);\n if (leftButton) {\n leftButton.style.display = 'none';\n }\n\n // rightButton.animate({ display: 'none' }, 200);\n if (rightButton) {\n rightButton.style.display = 'none';\n }\n }\n }, [tabListRef, tabScrollableRef]);\n\n const centerSelected = useCallback(() => {\n const tabScrollable = tabScrollableRef.current;\n const tabActive = activeItemRef.current;\n if (!tabScrollable || !tabActive) {\n return null;\n }\n const tabActiveWidth = tabActive.clientWidth;\n const lastKnownScrollPosition = tabScrollable.scrollLeft;\n\n const tabActivePosition = tabActive.getBoundingClientRect().left + tabActiveWidth;\n\n tabScrollable.scroll({ left: lastKnownScrollPosition, behavior: 'smooth' });\n tabScrollable.scrollBy({\n left: tabActivePosition - window.innerWidth / 2 - tabActiveWidth / 2,\n behavior: 'smooth',\n });\n }, [activeItemRef, tabScrollableRef]);\n\n const onResize = useCallback(\n () =>\n _.debounce(() => {\n toggleNavigationButtons();\n centerSelected();\n renderIndicator();\n }, 200),\n [centerSelected, renderIndicator, toggleNavigationButtons],\n );\n\n useLayoutEffect(() => {\n renderIndicator();\n centerSelected();\n toggleNavigationButtons();\n }, [centerSelected, renderIndicator, toggleNavigationButtons]);\n\n const onItemClick = () => {\n renderIndicator();\n centerSelected();\n toggleNavigationButtons();\n };\n\n useElementEvent(window, 'resize', onResize, true);\n useElementEvent(tabScrollableRef.current, 'scroll', toggleNavigationButtons, true);\n\n return {\n onItemClick,\n indicatorRef,\n tabScrollableRef,\n activeItemRef,\n tabListRef,\n onLeftArrowClick,\n onRightArrowClick,\n arrowLeftRef,\n arrowRightRef,\n };\n};\n","/* eslint-disable react/no-danger */\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport { useLayoutEffect, useRef } from 'react';\n\nimport { useTabSwitcher } from './TabSwitcher.hooks';\nimport type { TabItem, TabItemRenderer } from './TabSwitcher.types';\n\ntype AlignType = 'left' | 'center' | 'right';\n\nexport interface TabSwitcherProps<TData, TId extends string> {\n items: TabItem<TData, TId>[];\n align?: AlignType;\n wrapperClasses?: string;\n containerClasses?: string;\n itemClasses?: (isActive: boolean) => string;\n listClasses?: string;\n renderNextToTabs?: () => React.ReactNode;\n panelClasses?: string;\n handleClick: (tab: TabItem<TData, TId>) => void;\n renderTabItem?: TabItemRenderer<TData, TId>;\n activeTabId: TId;\n forcePanelRerenderOnTabChange?: boolean;\n panelSlot?: React.ReactNode;\n disableTabAnimation?: boolean;\n hidePanelsWithCss?: boolean /** Use when SEO is important - this will render all content up front and hide with css, making it crawlable */;\n noTabIndicator?: boolean;\n}\n\n/**\n * The TabSwitcher is always scrollable and animated\n * */\nconst TabSwitcher = <TData, TId extends string>(props: TabSwitcherProps<TData, TId>) => {\n const ref = useRef<HTMLDivElement>(null);\n const {\n indicatorRef,\n tabScrollableRef,\n activeItemRef: currentLinkRef,\n tabListRef,\n onLeftArrowClick,\n onRightArrowClick,\n arrowLeftRef,\n arrowRightRef,\n onItemClick,\n } = useTabSwitcher();\n\n useLayoutEffect(() => {\n onItemClick();\n }, [props.activeTabId, onItemClick]);\n\n const handleNavItemClick = (item: TabItem<TData, TId>) => {\n props.handleClick?.(item);\n };\n\n const activeTab = props.items.find((item) => item.id === props.activeTabId);\n\n const getAlignmentClass = (align?: AlignType) => {\n if (align === 'left') return 'u-textLeft';\n if (align === 'right') return 'u-textRight';\n return 'u-textCenter';\n };\n\n const renderDefaultTab: TabItemRenderer<TData, TId> = (\n { tab, handleClick: handleTabClick, isActive },\n _ref,\n ) => {\n const cssClasses = classNames(\n 'Tab-item',\n isActive && 'is-active',\n props.itemClasses && props.itemClasses(isActive),\n );\n\n return (\n <button\n ref={_ref as React.Ref<HTMLButtonElement>}\n type=\"button\"\n className={cssClasses}\n onClick={() => {\n handleTabClick(tab);\n }}\n aria-label={tab.ariaLabel}\n dangerouslySetInnerHTML={{ __html: tab.name }}\n />\n );\n };\n\n return (\n <div\n ref={ref}\n className={classNames(\n 'Tab',\n !props.disableTabAnimation && 'Tab--animated',\n 'Tab--scrollable',\n props.wrapperClasses,\n )}\n >\n <div\n ref={tabScrollableRef}\n className={classNames(\n 'Tab-container',\n getAlignmentClass(props.align),\n props.containerClasses,\n )}\n >\n <div ref={tabListRef} className={classNames('Tab-list', props.listClasses)}>\n {props.items.map((item) => {\n const isActive = props.activeTabId === item.id;\n return (\n <TabNavigationItem\n ref={isActive ? currentLinkRef : null}\n key={item.id}\n tabItem={item}\n isActive={isActive}\n renderTabItem={\n props.renderTabItem ? props.renderTabItem : renderDefaultTab\n }\n handleNavItemClick={() => handleNavItemClick(item)}\n additinalClasses={props.itemClasses}\n />\n );\n })}\n {props.noTabIndicator || <div ref={indicatorRef} className=\"Tab-indicator\" />}\n </div>\n {props.renderNextToTabs && props.renderNextToTabs()}\n </div>\n {props.hidePanelsWithCss\n ? props.items.map((item) => {\n const isActive = props.activeTabId === item.id;\n return (\n <TabPanel\n key={item.id}\n isActive={isActive}\n panelClasses={props.panelClasses}\n >\n {item.component}\n </TabPanel>\n );\n })\n : props.panelSlot || (\n <TabPanel\n key={props.forcePanelRerenderOnTabChange ? props.activeTabId : undefined}\n isActive={props.activeTabId === activeTab?.id}\n panelClasses={props.panelClasses}\n >\n {activeTab?.component}\n </TabPanel>\n )}\n <div\n ref={arrowLeftRef}\n className=\"Tab-arrow Tab-arrow--left\"\n style={{ display: 'none' }}\n onClick={onLeftArrowClick}\n onMouseOver={onLeftArrowClick}\n onFocus={onLeftArrowClick}\n />\n <div\n ref={arrowRightRef}\n className=\"Tab-arrow Tab-arrow--right\"\n style={{ display: 'none' }}\n onClick={onRightArrowClick}\n onMouseOver={onRightArrowClick}\n onFocus={onRightArrowClick}\n />\n </div>\n );\n};\n\nconst TabNavigationItemInner = <TData, TId>(\n props: {\n isActive: boolean;\n tabItem: TabItem<TData, TId>;\n handleNavItemClick: (tab: TabItem<TData, TId>) => void;\n additinalClasses?: (isActive: boolean) => string;\n renderTabItem: TabItemRenderer<TData, TId>;\n },\n ref: React.Ref<HTMLButtonElement>,\n) => {\n return (\n <>\n {props.renderTabItem(\n {\n tab: props.tabItem,\n handleClick: props.handleNavItemClick,\n isActive: props.isActive,\n },\n ref,\n )}\n </>\n );\n};\n\nconst TabNavigationItem = React.forwardRef(TabNavigationItemInner);\n\ninterface TabPanelProps {\n children: React.ReactNode;\n isActive: boolean;\n panelClasses?: string;\n}\n\nconst TabPanel = ({ children, isActive, panelClasses }: TabPanelProps) => {\n const cssClasses = classNames('Tab-panel ', isActive ? 'is-active' : null, panelClasses);\n\n return <div className={cssClasses}>{children}</div>;\n};\n\nexport default TabSwitcher;\n","import { useEffect, useState } from 'react';\n\nimport type { TabSwitcherProps } from './TabSwitcher';\nimport TabSwitcher from './TabSwitcher';\n\ntype StatefulTabSwitcherProps<T, TId extends string> = {\n initialActiveId?: TId;\n} & Omit<TabSwitcherProps<T, TId>, 'activeTabId' | 'setActiveTabId' | 'handleClick'> &\n Partial<Pick<TabSwitcherProps<T, TId>, 'handleClick'>>;\n\nconst StatefulTabSwitcher = <T, TId extends string>(props: StatefulTabSwitcherProps<T, TId>) => {\n const [activeTabId, setActiveTabId] = useState(props.initialActiveId ?? props.items[0].id);\n\n useEffect(() => {\n if (props.initialActiveId) {\n setActiveTabId(props.initialActiveId);\n }\n }, [props.initialActiveId]);\n\n const handleItemClick: (typeof props)['handleClick'] = (tab) => {\n setActiveTabId(tab.id);\n props.handleClick?.(tab);\n };\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return <TabSwitcher {...props} activeTabId={activeTabId} handleClick={handleItemClick} />;\n};\n\nexport default StatefulTabSwitcher;\n","import classNames from 'classnames';\n\nimport { useIsMobile } from '../components/atoms/ResponsiveBreakpoints';\nimport { useIsInsideModalContext } from '../contexts/siteContext';\n\nexport const useSwiperOverflowClasses = (params?: {\n constrainedX?: boolean;\n constrainedY?: boolean;\n}) => {\n const isInsideModal = useIsInsideModalContext();\n\n const swiperIsXConstrained = isInsideModal || params?.constrainedX;\n const swiperIsYConstrained = !!params?.constrainedY;\n\n const isMobile = useIsMobile();\n\n // shadow must be the same size as space between slides, to not have cut shadows\n const classes = classNames(\n 'swiper-overflow',\n swiperIsYConstrained && 'swiper-overflow--constrainedY',\n isMobile ? 'swiper-overflow20' : 'swiper-overflow10', // mobila has 20, to overflow until the edge of the screen - 20 is the main content's padding\n swiperIsXConstrained && 'swiper-overflow--constrainedX',\n );\n\n return {\n spaceBetween: 10,\n mainSwiperClasses: classes,\n };\n};\n","import type { FC } from 'react';\nimport * as React from 'react';\n\nimport { TooltipOnHover } from '../../../common/components/atoms/Tooltip';\nimport type { SharedRecipe } from '../../models';\n\ninterface CommonRecipesTooltipProps {\n sharedRecipes: SharedRecipe[];\n}\n\nconst CommonRecipesTooltip: FC<React.PropsWithChildren<CommonRecipesTooltipProps>> = (props) => {\n const recipeNamesJoinedText = props.sharedRecipes.map((recipe, index) => {\n return (\n <React.Fragment key={recipe.code}>\n {index > 0 ? ' och ' : ''}\n <span className=\"u-colorGreen\">{recipe.name}</span>\n </React.Fragment>\n );\n });\n\n const TooltipContent = <span>Den här produkten ingår i recepten {recipeNamesJoinedText}</span>;\n\n return <TooltipOnHover content={TooltipContent}>{props.children}</TooltipOnHover>;\n};\n\nexport default CommonRecipesTooltip;\n","import type { FC } from 'react';\nimport * as React from 'react';\n\nimport { TooltipOnHover } from '../../../common/components/atoms/Tooltip';\nimport type { SharedRecipe } from '../../models';\n\ninterface SharedRecipesTooltipProps {\n sharedRecipes: SharedRecipe[];\n}\n\nconst SharedRecipesTooltip: FC<React.PropsWithChildren<SharedRecipesTooltipProps>> = (props) => {\n const recipeNamesJoinedText = props.sharedRecipes.map((recipe, index) => {\n return (\n <React.Fragment key={recipe.code}>\n {index > 0 ? ' och ' : ''}\n <span className=\"u-colorGreen\">{recipe.name}</span>\n </React.Fragment>\n );\n });\n\n const TooltipContent = (\n <span>Den här produkten delas mellan recepten {recipeNamesJoinedText}</span>\n );\n\n return <TooltipOnHover content={TooltipContent}>{props.children}</TooltipOnHover>;\n};\n\nexport default SharedRecipesTooltip;\n","import { Chip, Icon } from '@coop/components';\nimport { PaperIcon } from '@coop/icons';\nimport type { FC } from 'react';\nimport type React from 'react';\n\nimport type { RecipeSectionType, SharedRecipe } from '../../models';\nimport CommonRecipesTooltip from '../CommonRecipesTooltip/CommonRecipesTooltip';\nimport SharedRecipesTooltip from '../SharedRecipesTooltip/SharedRecipesTooltip';\n\ninterface SharedBetweenRecipesTooltipProps {\n sectionType: RecipeSectionType;\n belongsToRecipes: SharedRecipe[];\n}\n\nconst SharedBetweenRecipesTooltip: FC<React.PropsWithChildren<SharedBetweenRecipesTooltipProps>> = (\n props,\n) => {\n if (props.belongsToRecipes.length === 0) return null;\n\n switch (props.sectionType) {\n case 'shared':\n return (\n <SharedRecipesTooltip sharedRecipes={props.belongsToRecipes}>\n <Chip theme=\"whiteGreen\" asIcon size={32}>\n <Icon icon={PaperIcon} width={16} height={16} />\n </Chip>\n </SharedRecipesTooltip>\n );\n case 'common':\n return (\n <CommonRecipesTooltip sharedRecipes={props.belongsToRecipes}>\n <Chip theme=\"whiteGreen\" asIcon size={32}>\n <Icon icon={PaperIcon} width={16} height={16} />\n </Chip>\n </CommonRecipesTooltip>\n );\n\n default:\n return null;\n }\n};\n\nexport default SharedBetweenRecipesTooltip;\n","import { BREAKPOINT_MIN_FROM, BrowserSize } from './browser';\nimport type { SwiperBreakpoints } from './coopSwiperBreakpoints';\nimport { getSwiperBreakpoint } from './coopSwiperBreakpoints';\n\nexport class CoopSwiperBreakpointsUnique {\n public static readonly AREA_MINICART = 'MiniCart';\n\n public static readonly AREA_CHECKOUT_STEP_2 = 'CheckoutStep2';\n\n public static readonly AREA_RECIPE_MODAL = 'RecipeModal';\n\n static getUniqueBreakpointsFor(uniqueArea: keyof SwiperBreakpointsCollectionUnique) {\n return UNIQUE_AREA_BREAKPOINTS[uniqueArea];\n }\n}\n\ninterface SwiperBreakpointsCollectionUnique {\n MiniCart: {\n ProductList: SwiperBreakpoints;\n };\n CheckoutStep2: {\n ProductList: SwiperBreakpoints;\n };\n RecipeModal: {\n ProductList: SwiperBreakpoints;\n };\n}\n\nconst UNIQUE_AREA_BREAKPOINTS: SwiperBreakpointsCollectionUnique = {\n MiniCart: {\n ProductList: {\n [BREAKPOINT_MIN_FROM]: {\n slidesPerView: 2.1,\n slidesPerGroup: 2,\n },\n [getSwiperBreakpoint(BrowserSize.sm)]: {\n slidesPerView: 2.5,\n slidesPerGroup: 2,\n },\n },\n },\n CheckoutStep2: {\n ProductList: {\n [BREAKPOINT_MIN_FROM]: {\n slidesPerView: 2.1,\n slidesPerGroup: 2,\n },\n [getSwiperBreakpoint(BrowserSize.sm)]: {\n slidesPerView: 3,\n slidesPerGroup: 3,\n },\n [getSwiperBreakpoint(BrowserSize.xlg)]: {\n slidesPerView: 4,\n slidesPerGroup: 4,\n },\n },\n },\n RecipeModal: {\n ProductList: {\n [BREAKPOINT_MIN_FROM]: {\n slidesPerView: 2.1,\n slidesPerGroup: 2,\n },\n [getSwiperBreakpoint(BrowserSize.xsm)]: {\n slidesPerView: 2.5,\n slidesPerGroup: 2.5,\n },\n [getSwiperBreakpoint(BrowserSize.sm)]: {\n slidesPerView: 3,\n slidesPerGroup: 3,\n },\n [getSwiperBreakpoint(BrowserSize.md)]: {\n slidesPerView: 4,\n slidesPerGroup: 4,\n },\n },\n },\n};\n"],"names":["_path","_path2","_extends","Object","assign","bind","n","e","arguments","length","t","r","hasOwnProperty","call","apply","_ref","title","titleId","props","width","height","viewBox","xmlns","id","d","fillRule","clipRule","ProductItemInfo","productUrl","handleLinkClick","name","manufacturer","variantName","packageSizeInformation","comparativePrice","comparativeText","isNicotineProduct","isPharmaceutical","promotion","isALink","packagingInfo","comparativePriceFormatted","className","choices","condition","renderWrapper","ch","href","style","whiteSpace","onClick","tabIndex","maxUseText","text","isNicotine","ProductItemImage","image","cssClass","url","transform","retinaTransform","fallbackUrl","ref","innerRef","additionalClassNames","isOutOfStock","slotLeft","slotSplash","slotPrice","children","bottomRow","ProductListItem","Image","Info","recipeSelectors","getSelectors","state","cart","recipes","selectNonEmptyRecipes","selectAll","cartRecipes","filter","x","productsMap","cartRecipeSelectors","all","nonEmpty","selectIds","map","item","code","selectById","_","recipeId","find","hasFoodboxInCart","some","group","isActive","icon","label","theme","handleSubsituteTrigger","size","ArrowPosition","TOOLTIP_DEFAULT","ARROW_BOTTOM","ARROW_LEFT","ARROW_CENTER","ARROW_RIGHT","Tooltip","tooltipClassNames","setTooltipClassNames","useState","currentPosRef","useRef","setCurrentPosRef","position","current","uniqueIdForAria","tooltipRef","handleOutsideClick","useOutsideClick","top","arrowPlacement","indexOf","undefined","arrowOffset","offsetHeight","bottom","resetTooltipPosition","useCallback","tooltipArrowPosCss","propsArrowPlacement","oldTooltipCss","push","join","left","getBoundingClientRect","oldPos","tooltipCss","Left","Right","Center","spaceOnLeft","spaceOnRight","TOOLTIP_WIDTH","window","innerWidth","getFreeSpace","calculateTooltipArrowPosition","onResize","useEffect","disabled","defaultCursor","handleClick","onMouseEnter","handleMouseOver","onMouseLeave","handleMouseOut","role","color","transition","tooltipStyle","visibleTooltip","content","TooltipOnHover","TooltipComponent","hovering","setHovering","isInCheckout","isMobile","mainSwiperClasses","spaceBetween","constrainedX","isConstrained","constrainedY","swiperOptions","useMemo","breakpoints","productSubstitutesBreakpoints","onButtonClick","stopPropagation","handleProductSubstitution","substitutes","swiperMainClassName","handleTeaserClick","product","containerCss","priceType","actionsSlot","activeSubstituteId","identifier","fullWidth","TabNavigationItem","renderTabItem","tab","tabItem","handleNavItemClick","TabPanel","panelClasses","cssClasses","indicatorRef","tabScrollableRef","activeItemRef","currentLinkRef","tabListRef","onLeftArrowClick","onRightArrowClick","arrowLeftRef","arrowRightRef","onItemClick","renderIndicator","linkWidth","offsetWidth","linkPos","offsetLeft","toggleNavigationButtons","tabScrollable","tabScrollableWidth","clientWidth","tabListWidth","scrollLeft","leftButton","rightButton","display","centerSelected","tabActive","tabActiveWidth","lastKnownScrollPosition","tabActivePosition","scroll","behavior","scrollBy","useLayoutEffect","useElementEvent","preventDefault","scrollWidth","useTabSwitcher","activeTabId","activeTab","items","renderDefaultTab","handleTabClick","itemClasses","type","ariaLabel","dangerouslySetInnerHTML","__html","disableTabAnimation","wrapperClasses","align","containerClasses","listClasses","additinalClasses","noTabIndicator","renderNextToTabs","hidePanelsWithCss","component","panelSlot","forcePanelRerenderOnTabChange","onMouseOver","onFocus","setActiveTabId","initialActiveId","useSwiperOverflowClasses","params","swiperIsXConstrained","swiperIsYConstrained","recipeNamesJoinedText","sharedRecipes","recipe","index","TooltipContent","belongsToRecipes","sectionType","Chip","asIcon","Icon","CoopSwiperBreakpointsUnique","getUniqueBreakpointsFor","uniqueArea","UNIQUE_AREA_BREAKPOINTS","AREA_MINICART","AREA_CHECKOUT_STEP_2","AREA_RECIPE_MODAL","MiniCart","ProductList","slidesPerView","slidesPerGroup","sm","CheckoutStep2","xlg","RecipeModal","xsm","md"],"sourceRoot":""}