{"version":3,"sources":["webpack:///./Scripts/Containers/BuyButton.Container.js"],"names":["BuyButtonContainer","props","buttonRef","React","createRef","articleNumber","quantityFieldId","addToCart","current","Component","mapStateToProps","state","mapDispatchToProps","dispatch","buttonDomNode","nodeIdToShowNotification","id","Date","now","quantity","document","getElementById","value","notificationMessage","translate","hash","connect"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;;IAEMA,kB;;;;;AACF,8BAAYC,KAAZ,EAAmB;AAAA;;AAAA;;AACf,8BAAMA,KAAN;AACA,UAAKC,SAAL,GAAiBC,4CAAK,CAACC,SAAN,EAAjB;AAFe;AAGlB;;;;6BAEQ;AAAA;;AACL,0BACI;AAAM,WAAG,EAAE,KAAKF;AAAhB,sBACI,2DAAC,6DAAD,eAAe,KAAKD,KAApB;AACI,eAAO,EAAE,iBAACI,aAAD,EAAgBC,eAAhB;AAAA,iBAAoC,MAAI,CAACL,KAAL,CAAWM,SAAX,CAAqB,MAAI,CAACL,SAAL,CAAeM,OAApC,EAA6CH,aAA7C,EAA4DC,eAA5D,CAApC;AAAA;AADb,SADJ,CADJ;AAMH;;;;EAb4BG,+C;;AAgBjC,IAAMC,eAAe,GAAG,SAAlBA,eAAkB,CAAAC,KAAK,EAAI;AAC7B,SAAO,EAAP;AACH,CAFD;;AAIA,IAAMC,kBAAkB,GAAG,SAArBA,kBAAqB,CAAAC,QAAQ,EAAI;AACnC,SAAO;AACHN,aAAS,EAAE,mBAACO,aAAD,EAAgBT,aAAhB,EAA+BC,eAA/B,EAAmD;AAC1D,UAAMS,wBAAwB,GAAGD,aAAa,CAACE,EAAd,GAAmBC,IAAI,CAACC,GAAL,EAApD;AACAL,cAAQ,CAACN,gEAAS,CAAC;AACfF,qBAAa,EAAbA,aADe;AAEfc,gBAAQ,EAAEb,eAAe,GAAGc,QAAQ,CAACC,cAAT,CAAwBf,eAAxB,EAAyCgB,KAA5C,GAAoD,CAF9D;AAGfP,gCAAwB,EAAxBA,wBAHe;AAIfQ,2BAAmB,EAAEC,uEAAS,CAAC,qBAAD,CAJf;AAKfC,YAAI,EAAER,IAAI,CAACC,GAAL;AALS,OAAD,CAAV,CAAR;AAOH;AAVE,GAAP;AAYH,CAbD;;AAeeQ,0HAAO,CAAChB,eAAD,EAAkBE,kBAAlB,CAAP,CAA6CZ,kBAA7C,CAAf,E","file":"2.js","sourcesContent":["import React, { Component } from 'react';\r\nimport { connect } from 'react-redux';\r\nimport BuyButton from '../Components/BuyButton';\r\nimport { add as addToCart } from '../Actions/Cart.action';\r\nimport { translate } from '../Services/translation';\r\n\r\nclass BuyButtonContainer extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.buttonRef = React.createRef();\r\n }\r\n\r\n render() {\r\n return (\r\n \r\n this.props.addToCart(this.buttonRef.current, articleNumber, quantityFieldId)} />\r\n \r\n );\r\n }\r\n}\r\n\r\nconst mapStateToProps = state => {\r\n return { }\r\n}\r\n\r\nconst mapDispatchToProps = dispatch => {\r\n return {\r\n addToCart: (buttonDomNode, articleNumber, quantityFieldId) => {\r\n const nodeIdToShowNotification = buttonDomNode.id = Date.now();\r\n dispatch(addToCart({ \r\n articleNumber, \r\n quantity: quantityFieldId ? document.getElementById(quantityFieldId).value : 1,\r\n nodeIdToShowNotification,\r\n notificationMessage: translate('tooltip.addedtocart'),\r\n hash: Date.now(),\r\n }));\r\n }\r\n }\r\n}\r\n\r\nexport default connect(mapStateToProps, mapDispatchToProps)(BuyButtonContainer);"],"sourceRoot":""}