{"version":3,"sources":["webpack:///./scripts/Actions/Cart.action.js","webpack:///./scripts/Components/BuyButton.js","webpack:///./scripts/Components/withReactiveStyleBuyButton.js","webpack:///./scripts/Services/Cart.service.js"],"names":["load","dispatch","getState","get","then","response","json","cart","receive","catch","ex","catchError","error","loadError","type","CART_LOAD_ERROR","payload","CART_RECEIVE","toggle","value","show","showInfo","visible","CART_SHOW_INFO","update","articleNumber","quantity","abortController","put","BuyButton","label","quantityFieldId","href","cssClass","onClick","React","Fragment","className","e","preventDefault","rel","props","useDispatch","Button","withReactiveStyleBuyButton","async","document","getElementById","addToCartService","undefined","window","fbq","content_ids","StateStyles","LOADING","SUCCESS","ERROR","WrappedComponent","stylePrefix","stateClass","setStateClass","useState","startTime","useRef","useEffect","changeState","complete","autoReset","setTimeout","current","resetTimeout","onButtonClick","params","Date","now","loadingDuration","minimumLoadingTime","onComplete","_extends","add","isNaN","parseFloat","post","result","addToDataLayer","orderRows","err","console","log","reorder","orderId","getTierPrices","products","responseProducts","map","row","i","Object","hasOwnProperty","call","findIndex","gtmEcommerceItem","index","length","push","gtmEcommerceItems","p","dataLayerAddToCart"],"mappings":"+KAIO,MAAMA,EAAOA,IAAM,CAACC,EAAUC,KAC5BC,QAAI,aACRC,MAAMC,GAAaA,EAASC,SAC5BF,MAAMG,IACLN,EAASO,EAAQD,GAAM,IAExBE,OAAOC,GAAOT,GAASU,OAAWD,GAAKE,GAAUC,EAAUD,QAGnDC,EAAaD,IAAK,CAC7BE,KAAMC,KACNC,QAAS,CACPJ,WAISJ,EAAWD,IAAI,CAC1BO,KAAMG,KACND,QAAST,IAGEW,EAASA,CAACC,EAAQ,OAAS,CAAClB,EAAUC,KAE/CD,EAASmB,EADE,MAATD,EACYA,GAECjB,IAAWK,KAAKc,UACjC,EAGID,EAAQE,IAAO,CACnBR,KAAMS,KACNP,QAAS,CACPK,SAAUC,KAIDE,EAASA,CAACC,EAAeC,EAAUC,EAAkB,OAChE1B,IAEO2B,QAAI,mBAAoB,CA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C,MAAQT,EAAiBU,OAC9CV,EAAiBW,KAAKT,GAE1B,CAEJ,IAGF,MAAMU,EAAoBZ,EAAiBC,KAAKY,GAAMA,EAAEL,mBACpDI,IACFE,QAAmBF,EACrB,C","file":"4715.296a0baf9583b53a388b.js","sourcesContent":["import { get, put } from '../Services/http';\nimport { catchError } from './Error.action';\nimport { CART_LOAD_ERROR, CART_RECEIVE, CART_SHOW_INFO } from '../constants';\n\nexport const load = () => (dispatch, getState) => {\n return get('/api/cart')\n .then((response) => response.json())\n .then((cart) => {\n dispatch(receive(cart));\n })\n .catch((ex) => dispatch(catchError(ex, (error) => loadError(error))));\n};\n\nexport const loadError = (error) => ({\n type: CART_LOAD_ERROR,\n payload: {\n error,\n },\n});\n\nexport const receive = (cart) => ({\n type: CART_RECEIVE,\n payload: cart,\n});\n\nexport const toggle = (value = null) => (dispatch, getState) => {\n if (value != null) {\n dispatch(show(value));\n } else {\n dispatch(show(!getState().cart.showInfo));\n }\n};\n\nconst show = (visible) => ({\n type: CART_SHOW_INFO,\n payload: {\n showInfo: visible,\n },\n});\n\nexport const update = (articleNumber, quantity, abortController = null) => (\n dispatch\n) => {\n return put(`/api/cart/update`, { articleNumber, quantity }, abortController)\n .then((response) => response.json())\n .then((cart) => dispatch(receive(cart)))\n .catch((ex) => dispatch(catchError(ex, (error) => loadError(error))));\n};\n","import React, { Fragment } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { loadError, receive } from '../Actions/Cart.action';\nimport { catchError } from '../Actions/Error.action';\nimport { add as addToCartService } from '../Services/Cart.service';\nimport withReactiveStyleBuyButton from './withReactiveStyleBuyButton';\n\nconst BuyButton = ({\n label,\n articleNumber,\n quantityFieldId,\n href,\n cssClass,\n onClick,\n}) => {\n return (\n \n {articleNumber ? (\n {\n e.preventDefault();\n onClick({ articleNumber, quantityFieldId });\n }}\n href={href || '#'}\n rel=\"nofollow\"\n >\n {label}\n \n ) : (\n \n {label}\n \n )}\n \n );\n};\n\nconst StyledButton = (props) => {\n const dispatch = useDispatch();\n\n const onClick = async ({ articleNumber, quantityFieldId }) => {\n try {\n const quantity = quantityFieldId\n ? document.getElementById(quantityFieldId).value\n : 1;\n const cart = await addToCartService({ articleNumber, quantity });\n if (window.fbq != undefined) {\n fbq('track', 'AddToCart', { content_ids: [articleNumber] });\n }\n dispatch(receive(cart));\n return true;\n } catch (ex) {\n dispatch(catchError(ex, (error) => loadError(error)));\n return false;\n }\n };\n const Button = withReactiveStyleBuyButton(BuyButton, onClick, 'buy-button');\n return