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E,EAAAmF,GAAA,SAAAG,UAAA,uDAAA1B,MAAA,CAAAC,OAAA3B,CAAA,EAAAmB,SAAA,GAAArD,EAAAmF,GAAA,SAAAG,UAAA,+CAAAW,IAAA1D,EAAAc,SAAAyB,EAAAV,GAAA,UAAA5G,CAAA,CAAAC,CAAA,WAAAuC,EAAAmF,GAAA,EAAAJ,EAAA,CAAAE,QAAA,GAAAD,IAAAxH,EAAA0H,WAAA,IAAAzH,EAAA,SAAAqH,GAAA,EAAApH,GAAA,GAAAsC,EAAAmF,GAAA,SAAAG,UAAA,oDAAAjC,SAAA,GAAArD,EAAAmF,GAAA,EAAAhE,EAAA,CAAAI,UAAA1D,EAAAyI,QAAAzD,EAAA0D,OAAAxE,EAAAyE,YAAA9I,EAAA+I,YAAA9I,CAAA,YAAAgC,EAAA+G,YAAA,EAAAtF,SAAA","sources":["webpack://_N_E/./node_modules/classnames/index.js","webpack://_N_E/./adapters/helpers/functions.js","webpack://_N_E/./components/ProductsOverview/desktop/CollapsibleProductsOverview.js","webpack://_N_E/"],"sourcesContent":["/*!\n Copyright (c) 2017 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg) && arg.length) {\n\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\tif (inner) {\n\t\t\t\t\tclasses.push(inner);\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","export function chunk(items, size) {\n if(!Array.isArray(items)\n || items.length === 0\n || !Number.isInteger(size)\n || size === 0) {\n return [];\n }\n\n const chunks = [];\n let chunk = [];\n\n for(let i = 0; i < items.length; i++) {\n chunk.push(items[i]);\n if((i + 1) % size === 0) {\n chunks.push(chunk);\n chunk = [];\n }\n }\n\n if(chunk.length > 0) {\n chunks.push(chunk);\n }\n\n return chunks;\n}\n\nexport function flatten(array) {\n if (!Array.isArray(array)) {\n return [];\n }\n\n return array.reduce((previous, current) => {\n if (Array.isArray(current)){\n return previous.concat(current);\n } else {\n previous.push(current);\n return previous;\n }\n }, []);\n}\n\nexport function minimum(array) {\n if (!Array.isArray(array)) {\n return undefined;\n }\n\n let minimum = undefined;\n\n for(let i = 0; i < array.length; i++) {\n const value = array[i];\n if(typeof value === 'number') {\n if(minimum === undefined || value < minimum) {\n minimum = value;\n }\n }\n }\n\n return minimum;\n}\n\n// function to return N given of items in an Array\nexport function first(array, n) {\n // if passed array is not an array, return empty array\n if (!Array.isArray(array)\n || n <= 0) {\n return [];\n }\n\n //if N number is bigger or equal slice up the entire thing\n if(n >= array.length) {\n return array.slice();\n } else {\n // otherwise return only N numbers of array items\n return array.slice(0, n);\n }\n}\n\nexport function isLater(value) {\n // Return true if today is after the value date\n let result = false\n\n if (value && value instanceof Date) {\n result = new Date() > value;\n } else if (value) {\n result = new Date() > new Date(value)\n }\n\n return result;\n}\n\nexport function isObject(value) {\n return (!!value) && (value.constructor === Object);\n}\n\nexport function findIndex(array, fn) {\n if (!Array.isArray(array)\n || !(typeof fn === 'function')) {\n return undefined;\n }\n for(let i = 0; i < array.length; i++) {\n const element = array[i];\n\n if(fn(element)) {\n return i;\n }\n }\n\n return undefined;\n}\n\nexport function escapeHtml(unsafe) {\n return unsafe\n .replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\n}\n","import React, { useCallback, useState, useRef, useMemo , Suspense} from 'react';\nimport PropTypes from 'prop-types';\nimport dynamic from 'next/dynamic';\nimport { Waypoint } from 'react-waypoint';\nimport C from 'classnames';\nimport { CSSTransition } from 'react-transition-group';\nimport { chunk, minimum} from '../../../adapters/helpers/functions';\nimport {useIsomorphicLayoutEffect} from '../../../adapters/helpers/Hooks';\nimport Loader from '../../../adapters/helpers/Loader';\n\nconst ProductOverview = dynamic(() => import('../ProductOverview'));\nconst SeeMoreButton = dynamic(() => import('../../SeeMoreButton/SeeMoreButton'));\n\nfunction makeRows(products, itemsPerLine) {\n return chunk(products, itemsPerLine)\n .map(chunk => {\n const aspectRatios = chunk\n .map((item) =>{ \n if(item?.fields?.mainAsset?.fields){\n item.fields.mainAsset.fields.isPreload = false\n }\n item?.fields?.mainAsset?.fields?.imageRendition?.fields?.aspectRatio});\n\n\n const minAspectRatio = minimum(aspectRatios)\n\n return {aspectRatio: minAspectRatio, items: chunk};\n }).map(row => {\n // Temporary while aspect Ratios are too extreme\n const aspectRatio = row.aspectRatio && Math.max(row.aspectRatio, 0.4);\n return {...row, aspectRatio};\n });\n}\n\nexport default function CollapsibleProductsOverview({\n products,\n seeMoreProductsText,\n seeLessProductsText,\n whiteText,\n itemsPerRow,\n onClickCallback,\n productOverview,\n isRecentlyViewed,\n removeLazyLoad\n}) {\n\n const [isViewedMore, setIsViewedMore] = useState(false);\n const [navHeight, setNavHeight] = useState(0);\n const [isLoaded, setIsLoaded] = useState(false);\n const collapsibleRef = useRef(null);\n const wrapperRef = useRef(null);\n const [isShown, setIsShown] = useState(false);\n\n const onViewMore = useCallback(\n () => {\n setIsViewedMore(prevState => !prevState);\n },\n [],\n );\n\n const handleWaypoint = useCallback(() => {\n setIsShown(true);\n }, []);\n\n const calculateHeight = useCallback(\n () => {\n if (collapsibleRef.current) {\n setNavHeight(collapsibleRef.current.scrollHeight);\n }\n },\n [],\n );\n\n useIsomorphicLayoutEffect(() => {\n if (wrapperRef?.current && isLoaded && !isRecentlyViewed) {\n const seeMoreWrapperClassName = 'ob-collapsible-products-overview-see-more-wrapper';\n const collapsibleWrapperClassName = 'ob-collapsible-products-overview-collapsible';\n const imageWrapperSelector = '.ob-products-overview__overview-image-wrapper-1';\n const productsOverviewRows = Array.from(wrapperRef?.current?.children);\n let imageHeight = 0;\n // The timeout is to give time for the images to load\n let timeout = null;\n timeout = window.setTimeout(() => {\n productsOverviewRows.forEach(productsOverviewRow => {\n if (!productsOverviewRow.classList.contains(seeMoreWrapperClassName)) {\n const productsOverviewList = Array.from(productsOverviewRow.children);\n\n productsOverviewList.forEach((productsOverviewListItem => {\n if (productsOverviewListItem.classList.contains(collapsibleWrapperClassName)) {\n const innerProductsOverviewList = Array.from(productsOverviewListItem.children);\n let innerImageHeight = 0;\n\n innerProductsOverviewList.forEach(innerProductsOverviewListItem => {\n const imageWrapper = innerProductsOverviewListItem.querySelector(imageWrapperSelector);\n const currentImageHeight = imageWrapper.clientHeight;\n innerImageHeight = currentImageHeight > innerImageHeight ? currentImageHeight : innerImageHeight;\n });\n\n // we have to do another loop to make sure every item gets the proper height\n innerProductsOverviewList.forEach(innerProductsOverviewListItem => {\n const imageWrapper = innerProductsOverviewListItem.querySelector(imageWrapperSelector);\n imageWrapper.style.height = `${innerImageHeight}px`;\n });\n }\n\n const imageWrapper = productsOverviewListItem.querySelector(imageWrapperSelector);\n const currentImageHeight = imageWrapper.clientHeight;\n imageHeight = currentImageHeight > imageHeight ? currentImageHeight : imageHeight;\n }));\n\n // we have to do another loop to make sure every item gets the proper height\n productsOverviewList.forEach(productsOverviewListItem => {\n const imageWrapper = productsOverviewListItem.querySelector(imageWrapperSelector);\n imageWrapper.style.height = `${imageHeight}px`;\n });\n }\n });\n }, 500);\n\n return () => {\n window.clearTimeout(timeout)\n }\n }\n },[isLoaded, isViewedMore]);\n\n const fullScreenWidth = useMemo(() => `${(100 / itemsPerRow).toFixed(2)}%`, [itemsPerRow]);\n const rows = useMemo(() => makeRows(products, itemsPerRow), [products, itemsPerRow]);\n const firstRow = useMemo(() => rows.length > 0 && rows[0], [rows]);\n const remainingRows = useMemo(() => rows.length > 1 ? rows.slice(1) : undefined, [rows]);\n\n const Row = useCallback(({row, isShown, isAnimated = false}) => (\n <>\n {row.items.map((item, i) => (\n
\n }>\n \n \n
\n ))}\n \n ), [fullScreenWidth, whiteText]);\n\n return (\n }>\n \n
setIsLoaded(true)}>\n\n {/* Arbitrary numbers */}\n {!!firstRow && \n
\n \n
\n
}\n\n {!!remainingRows &&\n
\n
\n {remainingRows.map((row, i) => (\n \n ))}\n
\n
}\n {!!remainingRows && !!seeMoreProductsText &&\n
\n \n
}\n
\n
\n
\n )\n}\n\nCollapsibleProductsOverview.defaultProps = {\n products: [],\n}\n\nCollapsibleProductsOverview.propTypes = {\n products: PropTypes.array,\n seeMoreProductsText: PropTypes.string,\n seeLessProductsText: PropTypes.string,\n whiteText: PropTypes.bool,\n itemsPerRow: PropTypes.number.isRequired,\n productOverview: PropTypes.any,\n removeLazyLoad: PropTypes.bool,\n onClickCallback: PropTypes.func,\n isRecentlyViewed: PropTypes.bool\n}\n","/*! For license information please see 9985.80fcf709801a598e.js.LICENSE */\n(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9985],{94184:function(e,r){var t;!function(){\"use strict\";var n={}.hasOwnProperty;function i(){for(var e=[],r=0;r0&&t.push(n),t}function i(e){if(Array.isArray(e)){for(var r=void 0,t=0;t=e.length?e.slice():e.slice(0,r)}function c(e){var r=!1;return e&&e instanceof Date?r=new Date>e:e&&(r=new Date>new Date(e)),r}function s(e){return!!e&&e.constructor===Object}function u(e,r){if(Array.isArray(e)&&\"function\"==typeof r)for(var t=0;t/g,\">\").replace(/\"/g,\""\").replace(/'/g,\"'\")}t.d(r,{Kn:function(){return s},LT:function(){return i},Ps:function(){return o},Xv:function(){return a},cx:function(){return u},en:function(){return c},yo:function(){return n}})},39985:function(e,r,t){\"use strict\";t.r(r),t.d(r,{default:function(){return x}});var n=t(930),i=t.n(n),o=t(67294),c=t(5152),s=t.n(c),u=t(83824),a=t(94184),l=t.n(a),f=t(68665),p=t(61986),d=t(71357),v=t(47322),h=t(85893);function b(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function w(e){for(var r=1;rn?r:n})),r.forEach((function(e){e.querySelector(t).style.height=\"\".concat(n,\"px\")}))}var o=e.querySelector(t).clientHeight;i=o>i?o:i})),r.forEach((function(e){e.querySelector(t).style.height=\"\".concat(i,\"px\")}))}}))}),500),function(){window.clearTimeout(r)}}}),[R,j]);var H=(0,o.useMemo)((function(){return\"\".concat((100/c).toFixed(2),\"%\")}),[c]),z=(0,o.useMemo)((function(){return function(e,r){return(0,p.yo)(e,r).map((function(e){var r=e.map((function(e){var r,t,n,i,o,c,s;(null==e||null==(r=e.fields)||null==(t=r.mainAsset)?void 0:t.fields)&&(e.fields.mainAsset.fields.isPreload=!1),null==e||null==(n=e.fields)||null==(i=n.mainAsset)||null==(o=i.fields)||null==(c=o.imageRendition)||null==(s=c.fields)||s.aspectRatio}));return{aspectRatio:(0,p.LT)(r),items:e}})).map((function(e){var r=e.aspectRatio&&Math.max(e.aspectRatio,.4);return w(w({},e),{},{aspectRatio:r})}))}(r,c)}),[r,c]),F=(0,o.useMemo)((function(){return z.length>0&&z[0]}),[z]),G=(0,o.useMemo)((function(){return z.length>1?z.slice(1):void 0}),[z]),I=(0,o.useCallback)((function(e){var r=e.row,t=e.isShown,n=e.isAnimated,c=void 0!==n&&n;return(0,h.jsx)(h.Fragment,{children:r.items.map((function(e,n){return(0,h.jsx)(\"div\",{style:{width:H},className:\"ob-collapsible-products-overview-product-wrapper\",children:(0,h.jsx)(o.Suspense,{fallback:(0,h.jsx)(v.default,{}),children:(0,h.jsx)(m,{product:e,whiteText:i,aspectRatio:r.aspectRatio,index:n,isShown:t,isRecentlyViewed:b,isAnimated:c,removeLazyLoad:x,onClickCallback:s,productOverview:a})})},n)}))})}),[H,i]);return(0,h.jsx)(o.Suspense,{fallback:(0,h.jsx)(v.default,{}),children:(0,h.jsx)(f.Z,{in:j,timeout:800,onEntering:q,onExit:q,children:(0,h.jsxs)(\"div\",{ref:C,className:l()(\"ob-collapsible-products-overview\"),onLoad:function(){return E(!0)},children:[!!F&&(0,h.jsx)(u.h,{onEnter:_,topOffset:\"500px\",bottomOffset:\"300px\",children:(0,h.jsx)(\"div\",{className:\"ob-collapsible-products-overview-first-line\",children:(0,h.jsx)(I,{row:F,isShown:N,isAnimated:!0})})}),!!G&&(0,h.jsx)(\"div\",{className:\"ob-collapsible-products-overview-collapsible-wrapper\",style:{height:k},children:(0,h.jsx)(\"div\",{className:\"ob-collapsible-products-overview-collapsible\",ref:L,children:G.map((function(e,r){return(0,h.jsx)(I,{isShown:!0,row:e,isAnimated:!0},r)}))})}),!!G&&!!t&&(0,h.jsx)(\"div\",{className:\"ob-collapsible-products-overview-see-more-wrapper\",children:(0,h.jsx)(y,{whiteText:i,onClick:M,isOpen:j,seeMoreText:t,seeLessText:n})})]})})})}x.defaultProps={products:[]}}}]);"],"names":["self","webpackChunk_N_E","push","e","r","t","n","hasOwnProperty","i","arguments","length","o","Array","isArray","c","apply","s","call","join","exports","default","Number","isInteger","slice","Date","constructor","Object","u","a","replace","d","Kn","LT","Ps","Xv","cx","en","yo","x","l","f","p","v","h","b","keys","getOwnPropertySymbols","filter","getOwnPropertyDescriptor","enumerable","w","forEach","getOwnPropertyDescriptors","defineProperties","defineProperty","m","Promise","all","then","bind","loadableGenerated","webpack","y","products","seeMoreProductsText","seeLessProductsText","whiteText","itemsPerRow","onClickCallback","productOverview","isRecentlyViewed","removeLazyLoad","g","useState","j","O","A","k","P","S","R","E","L","useRef","C","T","N","D","M","useCallback","_","q","current","scrollHeight","LI","from","children","window","setTimeout","classList","contains","querySelector","clientHeight","style","height","concat","clearTimeout","H","useMemo","toFixed","z","map","fields","mainAsset","isPreload","imageRendition","aspectRatio","items","Math","max","F","G","I","row","isShown","isAnimated","jsx","Fragment","width","className","Suspense","fallback","product","index","Z","in","timeout","onEntering","onExit","jsxs","ref","onLoad","onEnter","topOffset","bottomOffset","onClick","isOpen","seeMoreText","seeLessText","defaultProps"],"sourceRoot":""}