{"version":3,"file":"product-type-a54db001.js","sources":["../../../client/src/javascripts/customer_pages/_utils/product-was-price.jsx","../../../client/src/javascripts/customer_pages/_utils/types/was-price-type.js","../../../client/src/javascripts/customer_pages/_utils/product-price.jsx","../../../client/src/javascripts/customer_pages/_utils/get-orientation.js","../../../client/src/javascripts/customer_pages/_shelf-category/types/product-type.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Currency from './tools/currency';\nimport genericHelpers from './generic-helpers';\n\nfunction ProductWasPrice(props) {\n const { was_price: wasPrice, set_size: setSize, price } = props;\n\n const updatedWasPrice = []\n .concat(wasPrice)\n .filter(Boolean)\n .reduce((memo, wp) => {\n if (wp.quantity <= (setSize || 1)) {\n return wp;\n }\n\n return memo;\n }, {});\n\n const isValid = genericHelpers.isWasPriceValid({\n was_price: updatedWasPrice,\n price,\n });\n\n return isValid ? (\n {Currency.format(updatedWasPrice.value)}\n ) : null;\n}\n\nProductWasPrice.propTypes = {\n price: PropTypes.number,\n set_size: PropTypes.number,\n was_price: PropTypes.arrayOf(\n PropTypes.shape({\n end_date: PropTypes.string,\n quantity: PropTypes.number,\n value: PropTypes.number,\n start_data: PropTypes.string,\n })\n ),\n};\n\nProductWasPrice.defaultProps = {\n price: null,\n set_size: null,\n was_price: null,\n};\n\nexport default ProductWasPrice;\n","import PropTypes from 'prop-types';\n\nconst wasPriceType = PropTypes.arrayOf(\n PropTypes.shape({\n end_date: PropTypes.string,\n quantity: PropTypes.number,\n value: PropTypes.number,\n start_data: PropTypes.string,\n })\n);\n\nexport default wasPriceType;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport DisplayPrice from './display-price';\nimport ProductWasPrice from './product-was-price';\nimport wasPriceType from './types/was-price-type';\n\nfunction ProductPrice(props) {\n const { price, price_range: priceRange, set_size: setSize } = props;\n\n if (setSize) {\n return (\n
\n
\n
\n