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ACxD,KAAM,mBAEV,MAAM4D,EAAkBC,eAAeC,QAAQ,mBAO/C,aALuBC,EAAAA,EAAAA,IAAK,gBAAiB,CACzChE,gBACAC,SAAU2D,WAAW3D,GACrB4D,qBAEY1E,MAAM,EAGb8E,EAAU7C,gBACI4C,EAAAA,EAAAA,IAAK,oBAAqB,CAAEE,aACnC/E,M","sources":["webpack:///./Scripts/Actions/Cart.action.js","webpack:///./Scripts/Components/BuyButton.js","webpack:///./Scripts/Components/withReactiveStyleBuyButton.js","webpack:///./Scripts/Services/Cart.service.js"],"sourcesContent":["import { get, put } from '../Services/http';\r\nimport { catchError } from './Error.action';\r\nimport { CART_LOAD_ERROR, CART_RECEIVE, CART_SHOW_INFO } from '../constants';\r\n\r\nexport const load = () => (dispatch, getState) => {\r\n return get('/api/cart')\r\n .then((response) => response.json())\r\n .then((cart) => {\r\n dispatch(receive(cart));\r\n })\r\n .catch((ex) => dispatch(catchError(ex, (error) => loadError(error))));\r\n};\r\n\r\nexport const loadError = (error) => ({\r\n type: CART_LOAD_ERROR,\r\n payload: {\r\n error,\r\n },\r\n});\r\n\r\nexport const receive = (cart) => ({\r\n type: CART_RECEIVE,\r\n payload: cart,\r\n});\r\n\r\nexport const toggle = () => (dispatch, getState) => {\r\n dispatch(show(!getState().cart.showInfo));\r\n};\r\n\r\nconst show = (visible) => ({\r\n type: CART_SHOW_INFO,\r\n payload: {\r\n showInfo: visible,\r\n },\r\n});\r\n\r\nexport const update = (articleNumber, quantity, abortController = null) => (\r\n dispatch\r\n) => {\r\n return put(`/api/cart/update`, { articleNumber, quantity }, abortController)\r\n .then((response) => response.json())\r\n .then((cart) => dispatch(receive(cart)))\r\n .catch((ex) => {\r\n dispatch(catchError(ex, (error) => loadError(error)));\r\n throw ex;\r\n });\r\n};\r\n","import React, { Fragment } from 'react';\r\nimport { add as addToCartService } from '../Services/Cart.service';\r\nimport withReactiveStyleBuyButton from './withReactiveStyleBuyButton';\r\nimport { receive, loadError } from '../Actions/Cart.action';\r\nimport { catchError } from '../Actions/Error.action';\r\nimport { useDispatch } from 'react-redux';\r\n\r\nconst BuyButton = ({\r\n label,\r\n articleNumber,\r\n quantityFieldId,\r\n href,\r\n cssClass,\r\n onClick,\r\n}) => {\r\n return (\r\n \r\n {articleNumber ? (\r\n {\r\n e.preventDefault();\r\n onClick({ articleNumber, quantityFieldId });\r\n }}\r\n href={href || '#'}\r\n rel=\"nofollow\"\r\n >\r\n {label}\r\n \r\n ) : (\r\n \r\n {label}\r\n \r\n )}\r\n \r\n );\r\n};\r\n\r\nconst StyledButton = (props) => {\r\n const dispatch = useDispatch();\r\n const onClick = async ({ articleNumber, quantityFieldId }) => {\r\n var quantity = document.getElementById(quantityFieldId);\r\n var quantityValue = quantity.value;\r\n \r\n \r\n\r\n try {\r\n const quantity = quantityFieldId\r\n ? document.getElementById(quantityFieldId).value\r\n : 1;\r\n const cart = await addToCartService({ articleNumber, quantity });\r\n\r\n dispatch(receive(cart));\r\n window.gtmTracker.pushAddToCartEvent(cart, articleNumber, quantity);\r\n \r\n return true;\r\n } catch (ex) {\r\n dispatch(catchError(ex, (error) => loadError(error)));\r\n return false;\r\n }\r\n };\r\n const Button = withReactiveStyleBuyButton(BuyButton, onClick, 'buy-button');\r\n return