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yC,iEAAiE,kCAAkC,0DAA0D,8BAA8B,sDAAsD,2BAA6B,qDAAqD,2BAA6B,qDAAqD,+BAA+B,uDAAuD,qBAAuB,+CAA+C,yBAA2B","sources":["webpack://_N_E/./components/CardObject/CardObject.js","webpack://_N_E/./components/CardObject/index.js","webpack://_N_E/./components/CardObject/CardObject.folkhem.module.scss","webpack://_N_E/./components/CardObject/CardObject.nordr.module.scss"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport i18n from '../../i18n';\nimport classNames from 'classnames';\nimport { VelocityTransitionGroup } from 'velocity-react';\nimport { camelToPascal } from '../../utils/CaseConverters';\nimport { ThemeContext, themes } from '../../themes/ThemeContext';\nimport stylesNordr from './CardObject.nordr.module.scss';\nimport stylesFolkhem from './CardObject.folkhem.module.scss';\n\nconst getStyles = (theme) => ({\n [themes.NORDR]: stylesNordr,\n [themes.FOLKHEM]: stylesFolkhem,\n }[theme]\n);\n\nconst Attribute = ({ modifiers, label, value }) => {\n const theme = useContext(ThemeContext);\n const styles = getStyles(theme);\n\n return (\n styles[\"CardObject__Attribute--\" + m])\n )}>\n
{label}
\n\n
{value}
\n \n );\n};\n\nAttribute.propTypes = {\n modifiers: PropTypes.array,\n label: PropTypes.string,\n value: PropTypes.string,\n};\n\nclass CardObject extends React.PureComponent {\n state = {\n expanded: false,\n };\n\n render() {\n const {\n variant,\n renditions: { thumb },\n rooms,\n livingSpace,\n floor,\n feeMonthly,\n housingType,\n price,\n saleStatus,\n url,\n area,\n objectName,\n projectTitle,\n } = this.props;\n\n const theme = this.context;\n const styles = getStyles(theme);\n\n const saleStatusSlug = saleStatus ? saleStatus.slug : null;\n const saleStatusLabel = saleStatus ? saleStatus.uiLabel : null;\n const housingTypeLabel = housingType ? housingType.uiLabel : null;\n\n let attributes = [\n ['rooms', rooms],\n ['livingSpace', livingSpace],\n ['floor', floor],\n ['feeMonthly', feeMonthly],\n ['housingType', housingTypeLabel],\n ['price', price],\n ['saleStatus', saleStatusLabel],\n ];\n attributes = attributes.filter(x => x);\n\n let collapsedAttributes = [\n ['saleStatus', saleStatusLabel],\n ['rooms', rooms],\n ['livingSpace', livingSpace],\n ['price', price],\n ];\n let expandedAttributes = [\n ['floor', floor],\n ['feeMonthly', feeMonthly],\n ['housingType', housingTypeLabel],\n ];\n\n const hidePrice =\n ['sold', 'reserved', 'contract-signed'].indexOf(saleStatusSlug) >\n -1;\n\n const expanderClasses = classNames(styles[\"CardObject__MobileExpanded\"], {\n [styles[\"CardObject__MobileExpanded--Open\"]]: this.state.expanded,\n });\n\n let saleSlugMobile = '';\n\n if(saleStatusSlug) {\n saleSlugMobile = camelToPascal(saleStatusSlug)\n }\n\n return (\n \n \n \n {objectName} {projectTitle}\n \n \n {thumb && (\n
\n \n
\n )}\n\n
\n {(objectName || projectTitle || area) && (\n
\n {objectName && (\n
\n {objectName}\n
\n )}\n \n {projectTitle && projectTitle}\n {area && `, ${area}`}\n \n
\n )}\n\n \n this.setState((ps) => {\n return { expanded: !ps.expanded };\n })\n }>\n Expand info\n \n\n
\n
\n {collapsedAttributes.map(([name, value]) => {\n return (\n \n {value}\n
\n );\n })}\n
\n
\n\n \n {this.state.expanded && (\n
\n {expandedAttributes.map(([name, value]) => {\n if (name === 'price' && hidePrice) {\n return null;\n }\n\n if (!value) {\n value = '–';\n }\n\n let modifiers = [camelToPascal(name)];\n if (\n name === 'saleStatus' &&\n saleStatusSlug\n ) {\n modifiers.push(\n camelToPascal(saleStatusSlug)\n );\n }\n\n return (\n \n );\n })}\n
\n )}\n \n \n\n
\n {attributes.map(([name, value]) => {\n if (name === 'price' && hidePrice) {\n return null;\n }\n\n if (!value) {\n value = '–';\n }\n\n if (name === 'floor' && value === '0 tr') {\n value = i18n.t('object.attributes.entryFloor');\n }\n\n let modifiers = [camelToPascal(name)];\n if (name === 'saleStatus' && saleStatusSlug) {\n modifiers.push(camelToPascal(saleStatusSlug));\n }\n\n return (\n \n );\n })}\n
\n\n {saleStatusSlug && (\n \n )}\n \n );\n }\n}\n\nCardObject.propTypes = {\n variant: PropTypes.string,\n renditions: PropTypes.object,\n rooms: PropTypes.string,\n livingSpace: PropTypes.string,\n floor: PropTypes.string,\n feeMonthly: PropTypes.string,\n housingType: PropTypes.object,\n price: PropTypes.string,\n saleStatus: PropTypes.object,\n url: PropTypes.string,\n area: PropTypes.string,\n objectName: PropTypes.string,\n projectTitle: PropTypes.string,\n};\n\nCardObject.defaultProps = {\n variant: 'image', // image | list\n renditions: { thumb: null },\n rooms: null,\n livingSpace: null,\n floor: null,\n feeMonthly: null,\n housingType: null,\n price: null,\n saleStatus: null,\n};\n\nCardObject.contextType = ThemeContext;\n\nexport default CardObject;\n","import CardObject from './CardObject';\n\nexport default CardObject;\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"CardObject\":\"CardObject_folkhem_CardObject__2xL5B\",\"CardObject--List\":\"CardObject_folkhem_CardObject--List__heIFE\",\"CardObject--Title\":\"CardObject_folkhem_CardObject--Title__3dMhi\",\"CardObject--Image\":\"CardObject_folkhem_CardObject--Image__0eHZJ\",\"CardObject--Expanded\":\"CardObject_folkhem_CardObject--Expanded__18GIL\",\"CardObject__MetaWrapper\":\"CardObject_folkhem_CardObject__MetaWrapper__pMYNk\",\"CardObject__Link\":\"CardObject_folkhem_CardObject__Link__VdeIF\",\"CardObject__ImageWrapper\":\"CardObject_folkhem_CardObject__ImageWrapper__b_vjP\",\"CardObject__ImageImg\":\"CardObject_folkhem_CardObject__ImageImg__ogwOa\",\"CardObject__Title\":\"CardObject_folkhem_CardObject__Title__heDXd\",\"CardObject__ExpandButton\":\"CardObject_folkhem_CardObject__ExpandButton__NZHSS\",\"CardObject__MobileAttributes\":\"CardObject_folkhem_CardObject__MobileAttributes__8geqA\",\"CardObject__MobileCollapsed\":\"CardObject_folkhem_CardObject__MobileCollapsed___Ibiv\",\"CardObject__MobileExpanded\":\"CardObject_folkhem_CardObject__MobileExpanded__TuSTc\",\"CardObject__MobileExpanded--Open\":\"CardObject_folkhem_CardObject__MobileExpanded--Open__guyRn\",\"CardObject__CollapsedItem\":\"CardObject_folkhem_CardObject__CollapsedItem__WNspC\",\"CardObject__TitleId\":\"CardObject_folkhem_CardObject__TitleId__CS_TQ\",\"CardObject__Attributes\":\"CardObject_folkhem_CardObject__Attributes__MIwl7\",\"CardObject__Attribute\":\"CardObject_folkhem_CardObject__Attribute__fAuiP\",\"CardObject__Attribute--Price\":\"CardObject_folkhem_CardObject__Attribute--Price__IBLh7\",\"CardObject__Attribute--SaleStatus\":\"CardObject_folkhem_CardObject__Attribute--SaleStatus__hsN1E\",\"CardObject__AttributeLabel\":\"CardObject_folkhem_CardObject__AttributeLabel__eZrUE\",\"CardObject__Attribute--For-sale\":\"CardObject_folkhem_CardObject__Attribute--For-sale__fJ4ke\",\"CardObject__AttributeValue\":\"CardObject_folkhem_CardObject__AttributeValue__qLprN\",\"CardObject__StatusMarker\":\"CardObject_folkhem_CardObject__StatusMarker__fpVxl\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"CardObject\":\"CardObject_nordr_CardObject__O9xa4\",\"CardObject--List\":\"CardObject_nordr_CardObject--List__iqd3i\",\"CardObject--Title\":\"CardObject_nordr_CardObject--Title__h3hGf\",\"CardObject--Expanded\":\"CardObject_nordr_CardObject--Expanded__9hh3D\",\"CardObject--Image\":\"CardObject_nordr_CardObject--Image__La6zd\",\"CardObject__MetaWrapper\":\"CardObject_nordr_CardObject__MetaWrapper__e0NMi\",\"CardObject__Link\":\"CardObject_nordr_CardObject__Link__fQr26\",\"CardObject__ImageWrapper\":\"CardObject_nordr_CardObject__ImageWrapper__NSOu4\",\"CardObject__ImageImg\":\"CardObject_nordr_CardObject__ImageImg__2rrmg\",\"CardObject__Title\":\"CardObject_nordr_CardObject__Title__jpMhN\",\"CardObject__TitleId\":\"CardObject_nordr_CardObject__TitleId__v_H3p\",\"ListObjects--HideProjectName\":\"CardObject_nordr_ListObjects--HideProjectName__34jhY\",\"CardObject__Address\":\"CardObject_nordr_CardObject__Address__JqhJ6\",\"CardObject__ExpandButton\":\"CardObject_nordr_CardObject__ExpandButton__LsvZw\",\"CardObject__MobileAttributes\":\"CardObject_nordr_CardObject__MobileAttributes__6VwBB\",\"CardObject__MobileCollapsed\":\"CardObject_nordr_CardObject__MobileCollapsed__eXSej\",\"CardObject__CollapsedItem--saleStatus\":\"CardObject_nordr_CardObject__CollapsedItem--saleStatus__fo_cz\",\"CardObject__CollapsedItem--Upcoming\":\"CardObject_nordr_CardObject__CollapsedItem--Upcoming__XlhgH\",\"CardObject__CollapsedItem--Reserved\":\"CardObject_nordr_CardObject__CollapsedItem--Reserved__g3hjI\",\"CardObject__CollapsedItem--Contract-signed\":\"CardObject_nordr_CardObject__CollapsedItem--Contract-signed___h8NY\",\"CardObject__CollapsedItem--Sold\":\"CardObject_nordr_CardObject__CollapsedItem--Sold__dZ9IE\",\"CardObject__CollapsedItem--For-sale\":\"CardObject_nordr_CardObject__CollapsedItem--For-sale__8ClDW\",\"CardObject__MobileExpanded\":\"CardObject_nordr_CardObject__MobileExpanded__rEGBX\",\"CardObject__MobileExpanded--Open\":\"CardObject_nordr_CardObject__MobileExpanded--Open__xh4ue\",\"CardObject__CollapsedItem\":\"CardObject_nordr_CardObject__CollapsedItem__sicmS\",\"CardObject__Attributes\":\"CardObject_nordr_CardObject__Attributes__Ym_4H\",\"CardObject__Attribute\":\"CardObject_nordr_CardObject__Attribute___3lcO\",\"CardObject__Attribute--SaleStatus\":\"CardObject_nordr_CardObject__Attribute--SaleStatus__IeYJs\",\"CardObject__Attribute--Upcoming\":\"CardObject_nordr_CardObject__Attribute--Upcoming__0ajoK\",\"CardObject__Attribute--Reserved\":\"CardObject_nordr_CardObject__Attribute--Reserved__Xjs_2\",\"CardObject__Attribute--Contract-signed\":\"CardObject_nordr_CardObject__Attribute--Contract-signed__lSj28\",\"CardObject__Attribute--For-sale\":\"CardObject_nordr_CardObject__Attribute--For-sale__4B_L8\",\"CardObject__Attribute--Sold\":\"CardObject_nordr_CardObject__Attribute--Sold__37_wr\",\"CardObject__AttributeLabel\":\"CardObject_nordr_CardObject__AttributeLabel__mzOVf\",\"CardObject__AttributeValue\":\"CardObject_nordr_CardObject__AttributeValue__iJUIP\",\"CardObject__Attribute--Price\":\"CardObject_nordr_CardObject__Attribute--Price__jBO4Q\",\"PageProject__Section\":\"CardObject_nordr_PageProject__Section__75ORQ\",\"CardObject__StatusMarker\":\"CardObject_nordr_CardObject__StatusMarker___f666\"};"],"names":["getStyles","theme","themes","stylesNordr","stylesFolkhem","Attribute","modifiers","label","value","useContext","ThemeContext","styles","className","classNames","map","m","CardObject","state","expanded","this","props","variant","thumb","renditions","rooms","livingSpace","floor","feeMonthly","housingType","price","saleStatus","url","area","objectName","projectTitle","context","saleStatusSlug","slug","saleStatusLabel","uiLabel","housingTypeLabel","attributes","filter","x","collapsedAttributes","expandedAttributes","hidePrice","indexOf","expanderClasses","saleSlugMobile","camelToPascal","href","loading","onClick","setState","ps","name","VelocityTransitionGroup","enter","animation","leave","push","i18n","React","defaultProps","contextType","module","exports"],"sourceRoot":""}