{"version":3,"sources":["webpack:///./Scripts/Components/BuyButton.js","webpack:///./Scripts/Components/withReactiveStyleBuyButton.js","webpack:///./Scripts/Services/Cart.service.js"],"names":["BuyButton","label","articleNumber","quantityFieldId","href","cssClass","onClick","Fragment","className","e","preventDefault","rel","props","dispatch","useDispatch","Button","withReactiveStyleBuyButton","async","quantity","document","getElementById","value","cart","addToCartService","receive","ex","catchError","error","loadError","StateStyles","WrappedComponent","stylePrefix","stateClass","setStateClass","useState","startTime","useRef","useEffect","changeState","complete","autoReset","setTimeout","current","resetTimeout","onButtonClick","params","Date","now","loadingDuration","minimumLoadingTime","onComplete","add","isNaN","parseFloat","post","json","reorder","orderId"],"mappings":"iLAOA,MAAMA,EAAY,EACdC,QACAC,gBACAC,kBACAC,OACAC,WACAC,aAGI,gBAAC,EAAAC,SAAD,KACKL,EACG,qBACIM,UAAWH,EACXC,QAAUG,IACNA,EAAEC,iBACFJ,EAAQ,CAAEJ,gBAAeC,qBAE7BC,KAAMA,GAAQ,IACdO,IAAI,YAEHV,GAGL,qBAAGO,UAAWH,EAAUD,KAAMA,GAAQ,IAAKO,IAAI,YAC1CV,IA0BrB,EAnBsBW,IAClB,MAAMC,GAAWC,UAcXC,GAASC,OAA2BhB,GAb1BiB,OAASf,gBAAeC,sBACpC,IACI,MAAMe,EAAWf,EACXgB,SAASC,eAAejB,GAAiBkB,MACzC,EACAC,QAAaC,OAAiB,CAAErB,gBAAegB,aAErD,OADAL,GAASW,QAAQF,KACV,EACT,MAAOG,GAEL,OADAZ,GAASa,OAAWD,GAAKE,IAAUC,QAAUD,OACtC,KAG+C,cAC9D,OAAO,gBAACZ,EAAWH,K,0QCpDvB,MAAMiB,EACO,YADPA,EAEO,YAFPA,EAGK,UAgBI,SAASb,EACpBc,EACAxB,EACAyB,GAEA,OAAQnB,IACJ,MAAOoB,EAAYC,IAAiBC,cAAS,IACvCC,GAAYC,YAAO,IAEzBC,gBAAU,IACC,KACHJ,EAAc,MAEnB,IAYH,MAAMK,EAAeC,IACjBN,EACK,GAAEF,IACCQ,EAAWV,EAAsBA,MAMrB,IAApBjB,EAAM4B,WACFC,YAAW,KAnBfR,EAAc,IACdE,EAAUO,QAAU,IAoBb9B,EAAM+B,cAAgB,MAiBjC1B,eAAe2B,EAAcC,GAjCzBZ,EAAe,GAAEF,IAAcF,KAC/BM,EAAUO,QAAUI,KAAKC,OAkB7B,SAAoBR,GAChB,MAAMS,EAAkBF,KAAKC,MAAQZ,EAAUO,QACzCO,EAAqBrC,EAAMqC,oBAAsB,IAGnDD,GAAmBC,EACnBX,EAAYC,GAEZE,YAAW,KACPH,EAAYC,KACbU,EAAqBD,GAO5BE,OADmB5C,EAAQuC,IAI/B,OACI,wBAAMrC,UAAWwB,GACb,gBAACF,EAAD,GACIxB,QAAUuC,GAAWD,EAAcC,IAC/BjC,Q,mECnFjB,MAAMuC,EAAMlC,OAASf,gBAAegB,WAAW,MAClD,IAAKA,GAAYkC,MAAMlC,IAAamC,WAAWnC,IAAa,EACxD,KAAM,mBAOV,aAJuBoC,QAAK,gBAAiB,CACzCpD,gBACAgB,SAAUmC,WAAWnC,MAETqC,QAGPC,EAAUvC,gBACIqC,QAAK,oBAAqB,CAAEG,aACnCF","file":"241.12f99482196c2357080d.js","sourcesContent":["import React, { Fragment } from 'react';\nimport { add as addToCartService } from '../Services/Cart.service';\nimport withReactiveStyleBuyButton from './withReactiveStyleBuyButton';\nimport { receive, loadError } from '../Actions/Cart.action';\nimport { catchError } from '../Actions/Error.action';\nimport { useDispatch } from 'react-redux';\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 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 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