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sources":["webpack://_N_E/./node_modules/ramda/es/max.js","webpack://_N_E/./components/Gallery/Gallery.js","webpack://_N_E/./components/Gallery/index.js","webpack://_N_E/./components/Gallery/Gallery.folkhem.module.scss","webpack://_N_E/./components/Gallery/Gallery.nordr.module.scss"],"sourcesContent":["import _curry2 from \"./internal/_curry2.js\";\n/**\n * Returns the larger of its two arguments.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Relation\n * @sig Ord a => a -> a -> a\n * @param {*} a\n * @param {*} b\n * @return {*}\n * @see R.maxBy, R.min\n * @example\n *\n * R.max(789, 123); //=> 789\n * R.max('a', 'b'); //=> 'b'\n */\n\nvar max =\n/*#__PURE__*/\n_curry2(function max(a, b) {\n return b > a ? b : a;\n});\n\nexport default max;","import React from 'react';\nimport PropTypes from 'prop-types';\nimport LazyLoad from 'react-lazy-load';\nimport * as R from 'ramda';\nimport Modal from '../Modal';\nimport GalleryModal from '../GalleryModal';\nimport mediaCheck from '../../utils/MediaCheck';\nimport classNames from 'classnames';\nimport { ThemeContext, themes } from '../../themes/ThemeContext';\nimport stylesNordr from './Gallery.nordr.module.scss';\nimport stylesFolkhem from './Gallery.folkhem.module.scss';\n\nconst getStyles = (theme) => ({\n [themes.NORDR]: stylesNordr,\n [themes.FOLKHEM]: stylesFolkhem,\n }[theme]\n);\n\nconst FEW = 7;\n\nclass GalleryObject extends React.PureComponent {\n constructor(props) {\n super(props);\n this.state = { isPrint: false };\n }\n\n componentWillUnmount() {\n window.removeEventListener(\n 'beforeprint',\n this.displayLazyLoadedContent\n );\n }\n\n componentDidMount() {\n window.addEventListener('beforeprint', this.displayLazyLoadedContent);\n }\n\n displayLazyLoadedContent = () => {\n this.setState({ isPrint: true });\n };\n\n render() {\n const { item, onClick, index, modifiers } = this.props;\n\n const theme = this.context;\n const styles = getStyles(theme);\n\n return (\n x)\n .map((x) => styles[`Gallery__ImageContent--${x}`])\n )}\n key={index}\n onClick={onClick}\n href={`#image-${item.id}`}>\n \n \n \n\n {this.state.isPrint && (\n \n )}\n \n );\n }\n}\n\nGalleryObject.defaultProps = { modifiers: [] };\n\nGalleryObject.contextType = ThemeContext;\n\nclass Gallery extends React.PureComponent {\n constructor(props) {\n super(props);\n this.state = {\n galleryModalVisible: false,\n };\n }\n\n toggleGalleryModal = () => {\n this.setState({\n galleryModalVisible: !this.state.galleryModalVisible,\n });\n };\n\n getMaxImagesDesktop = () => {\n const theme = this.context;\n\n if (theme === themes.FOLKHEM) {\n return 3;\n } else {\n return 9;\n }\n }\n\n render() {\n const {\n items,\n maxImagesMobile,\n showModal,\n modifiers,\n } = this.props;\n const maxImagesDesktop = this.getMaxImagesDesktop();\n const restMobile = items.length - maxImagesMobile;\n const restDesktop = items.length - maxImagesDesktop;\n\n const theme = this.context;\n const styles = getStyles(theme);\n\n return (\n styles[\"Gallery--\"+mod])\n )}\n key=\"gallery\"\n data-few={items.length <= maxImagesDesktop - 2}>\n
\n {items\n .slice(0, R.max(maxImagesDesktop, maxImagesMobile))\n .map((item, index) => (\n 4)\n ? 'Featured'\n : '',\n ]}\n />\n ))}\n\n 0,\n [styles[\"Gallery__ImageContent--VisibleDesktop\"]]:\n restDesktop > 0,\n }\n )}\n key=\"rest\"\n data-rest-mobile={restMobile}\n data-rest-desktop={restDesktop}\n onClick={() => {\n this.toggleModalRest();\n }}\n />\n
\n\n {!showModal && (\n \n \n \n )}\n \n );\n }\n\n toggleModal = () => {\n if (!this.props.showModal) {\n this.toggleGalleryModal();\n return;\n }\n\n this.props.showModal();\n };\n\n toggleModalRest = () => {\n if (!this.props.showModal) {\n this.toggleGalleryModal();\n return;\n }\n\n this.props.showModal();\n\n let index = this.props.maxImagesMobile;\n if (mediaCheck('min-width: 832px')) {\n index = this.getMaxImagesDesktop();\n }\n\n window.location.hash = `image-${this.props.items[index].id}`;\n };\n}\n\nGallery.propTypes = {\n showModal: PropTypes.func, // If left empty internal modal is used\n items: PropTypes.array,\n renditions: PropTypes.array,\n maxImagesMobile: PropTypes.number,\n modifiers: PropTypes.array,\n};\n\nGallery.defaultProps = {\n maxImagesMobile: 4,\n modifiers: [],\n items: [],\n};\n\nGallery.contextType = ThemeContext;\n\nexport default Gallery;\n","import Gallery from './Gallery';\n\nexport default Gallery;\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"Gallery\":\"Gallery_folkhem_Gallery__Jr4Hx\",\"Gallery__Anchor\":\"Gallery_folkhem_Gallery__Anchor__rQQY4\",\"Gallery__Title\":\"Gallery_folkhem_Gallery__Title__fOhIE\",\"Gallery__TitleLink\":\"Gallery_folkhem_Gallery__TitleLink__1yF4B\",\"Gallery__Content\":\"Gallery_folkhem_Gallery__Content__sWDq_\",\"Gallery__ImageContent\":\"Gallery_folkhem_Gallery__ImageContent__fp1tm\",\"Gallery__ImageContent--VisibleMobile\":\"Gallery_folkhem_Gallery__ImageContent--VisibleMobile__xwUkn\",\"Gallery__ImageContent--VisibleDesktop\":\"Gallery_folkhem_Gallery__ImageContent--VisibleDesktop__H_wPJ\",\"Gallery__ImageContent--0\":\"Gallery_folkhem_Gallery__ImageContent--0__7cm9Y\",\"Gallery__ImageContent--1\":\"Gallery_folkhem_Gallery__ImageContent--1__Jtg24\",\"Gallery__ImageContent--2\":\"Gallery_folkhem_Gallery__ImageContent--2__R0hjc\",\"Gallery__ImageContent--Rest\":\"Gallery_folkhem_Gallery__ImageContent--Rest__CSJ6_\",\"Gallery__Image\":\"Gallery_folkhem_Gallery__Image__YlsCh\",\"fadeIn\":\"Gallery_folkhem_fadeIn__V_qvI\",\"Gallery__imagecontent--0\":\"Gallery_folkhem_Gallery__imagecontent--0__2_dGu\",\"Gallery__imagecontent--1\":\"Gallery_folkhem_Gallery__imagecontent--1__8CPJP\",\"Gallery__PrintImage\":\"Gallery_folkhem_Gallery__PrintImage__KXjX0\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"Gallery\":\"Gallery_nordr_Gallery__9wsSF\",\"Gallery__Anchor\":\"Gallery_nordr_Gallery__Anchor__zY5eB\",\"Gallery__Title\":\"Gallery_nordr_Gallery__Title__uYc5v\",\"Gallery__TitleLink\":\"Gallery_nordr_Gallery__TitleLink__RGjWn\",\"Gallery__Content\":\"Gallery_nordr_Gallery__Content__o6GCF\",\"Gallery__ImageContent\":\"Gallery_nordr_Gallery__ImageContent__3J9ik\",\"Gallery__ImageContent--VisibleMobile\":\"Gallery_nordr_Gallery__ImageContent--VisibleMobile__RcSJ_\",\"Gallery__ImageContent--VisibleDesktop\":\"Gallery_nordr_Gallery__ImageContent--VisibleDesktop__vASeO\",\"Gallery__ImageContent--Featured\":\"Gallery_nordr_Gallery__ImageContent--Featured__14ABC\",\"Gallery__ImageContent--0\":\"Gallery_nordr_Gallery__ImageContent--0__ck3C7\",\"Gallery__ImageContent--1\":\"Gallery_nordr_Gallery__ImageContent--1__afw_g\",\"Gallery__ImageContent--Rest\":\"Gallery_nordr_Gallery__ImageContent--Rest___ZSJW\",\"Gallery__Image\":\"Gallery_nordr_Gallery__Image__QiAMG\",\"fadeIn\":\"Gallery_nordr_fadeIn__E2zkJ\",\"Gallery__imagecontent--0\":\"Gallery_nordr_Gallery__imagecontent--0__wkWAu\",\"Gallery__imagecontent--1\":\"Gallery_nordr_Gallery__imagecontent--1__vSS__\",\"Gallery__LazyImgWrapper\":\"Gallery_nordr_Gallery__LazyImgWrapper__MyM_6\",\"Gallery__PrintImage\":\"Gallery_nordr_Gallery__PrintImage__nLhE7\"};"],"names":["a","b","getStyles","theme","themes","stylesNordr","stylesFolkhem","GalleryObject","props","displayLazyLoadedContent","setState","isPrint","state","window","removeEventListener","this","addEventListener","item","onClick","index","modifiers","context","styles","className","classNames","filter","x","map","href","id","LazyLoad","offset","throttle","debounce","style","backgroundImage","renditions","standard900","src","standard300","loading","React","defaultProps","contextType","ThemeContext","Gallery","toggleGalleryModal","galleryModalVisible","getMaxImagesDesktop","toggleModal","showModal","toggleModalRest","maxImagesMobile","mediaCheck","location","hash","items","maxImagesDesktop","restMobile","length","restDesktop","mod","slice","R","Modal","active","onClose","GalleryModal","module","exports"],"sourceRoot":""}