{"version":3,"sources":["webpack:///./Scripts/Components/PageModal.js","webpack:///./Scripts/Containers/PageModal.container.js"],"names":["PageModal","_Component","props","_this","_callSuper","setWrapperRef","bind","handleClickOutside","handleClose","_inherits","key","value","node","this","wrapperRef","event","target","contains","closeModal","document","querySelector","classList","remove","_this2","pageModal","React","createElement","className","concat","isOpen","onClick","e","ref","status","Fragment","data","title","href","link","text","Component","connect","state","dispatch","close","_extends"],"mappings":"2gDAAmD,IAyDpCA,GAvDAC,IACX,SAAAD,EAAYE,G,GAAO,gBAAAF,EAIgC,OAH/CG,EAAAC,EAAA,KAAAJ,EAAA,CAAME,EAAK,GACNG,cAAgBF,EAAKE,cAAcC,KAAIH,CAAK,EACjDA,EAAKI,mBAAqBJ,EAAKI,mBAAmBD,KAAIH,CAAK,EAC3DA,EAAKK,YAAcL,EAAKK,YAAYF,KAAIH,CAAK,EAAEA,E,wDACnD,CAACM,I,IAAAT,E,4GAAA,O,6JAAAA,G,EAAA,EAAAU,IAAA,gBAAAC,MAED,SAAcC,GACVC,KAAKC,WAAaF,CACtB,CAAC,GAAAF,IAAA,qBAAAC,MAED,SAAmBI,GACXF,KAAKC,aAAeC,EAAMC,QAAWH,KAAKC,WAAWG,SAASF,EAAMC,MAAM,IAC1EH,KAAKX,MAAMgB,WAAW,EACtBL,KAAKL,YAAY,EAEzB,CAAC,GAAAE,IAAA,cAAAC,MAED,WACQQ,SAASC,cAAc,kCAAkC,GAClCD,SAASC,cAAc,kCAAkC,EACjEC,UAAUC,OAAO,QAAQ,CAEhD,CAAC,GAAAZ,IAAA,SAAAC,MAGD,WAAS,IAAAY,EAAA,KACGC,EAAcX,KAAKX,MAAnBsB,UACR,OACIC,IAAAC,cAAA,OAAKC,UAAS,yBAAAC,OAA2BJ,EAAUK,OAAS,gEAAkE,EAAE,EAAIC,QAAS,SAACC,GAAC,OAAKR,EAAKhB,mBAAmBwB,CAAC,CAAC,CAAC,EAC3KN,IAAAC,cAAA,OAAKC,UAAU,aAAaK,IAAKnB,KAAKR,aAAc,EAC1B,YAArBmB,EAAUS,OACPR,IAAAC,cAACQ,WAAQ,KACLT,IAAAC,cAAA,QAAMC,UAAU,oBAAoBG,QAAS,WAAOP,EAAKrB,MAAMgB,WAAW,EAAGK,EAAKf,YAAY,CAAC,CAAE,CAAQ,EACzGiB,IAAAC,cAAA,MAAIC,UAAU,qBAAqB,EAAEH,EAAUW,KAAKC,KAAU,EAC9DX,IAAAC,cAAA,OAAKC,UAAU,qBAAqB,EAChCF,IAAAC,cAAA,KAAGW,KAAI,GAAAT,OAAKJ,EAAUW,KAAKG,KAAKD,IAAI,EAAIV,UAAU,yBAAyB,EAAEH,EAAUW,KAAKG,KAAKC,IAAQ,CACxG,CACC,EACVd,IAAAC,cAACQ,WAAQ,KACLT,IAAAC,cAAA,MAAIC,UAAU,qBAAqB,EAAEH,EAAUW,KAAKC,KAAU,EAC9DX,IAAAC,cAAA,OAAKC,UAAU,qBAAqB,EAChCF,IAAAC,cAAA,SAAIF,EAAUW,KAAKG,KAAKC,IAAQ,CAC/B,CACC,CAGb,CACJ,CAEb,CAAC,K,+EAAA,GAnDmBC,WAAS,E,oNCoBlBC,sBAbS,SAACC,GAErB,MAAO,CACHlB,UAFkBkB,EAAdlB,SAGR,CACJ,EAE2B,SAAAmB,GACvB,MAAO,CACHzB,WAAY,WAAF,OAAQyB,EAASC,YAAM,CAAC,CAAC,CACvC,CACJ,CAE0D,EAjB/B,SAAA1C,GAAK,OAC5BuB,IAAAC,cAAC1B,EAAS6C,EAAA,GAAK3C,EAAK,CAAE4B,QAAS,WAAF,O,QAAa5B,MAAMgB,WAAW,CAAC,CAAC,EAAC,CAAC,CAgBY,C","file":"19.js","sourcesContent":["import React, { Component, Fragment } from 'react';\r\n\r\nclass PageModal extends Component {\r\n    constructor(props) {\r\n        super(props);\r\n        this.setWrapperRef = this.setWrapperRef.bind(this);\r\n        this.handleClickOutside = this.handleClickOutside.bind(this);\r\n        this.handleClose = this.handleClose.bind(this);\r\n    }\r\n\r\n    setWrapperRef(node) {\r\n        this.wrapperRef = node;\r\n    }\r\n\r\n    handleClickOutside(event) {\r\n        if (this.wrapperRef !== event.target && !this.wrapperRef.contains(event.target)) {\r\n            this.props.closeModal();\r\n            this.handleClose();\r\n        }\r\n    }\r\n\r\n    handleClose() {\r\n        if (document.querySelector('.wishlist-product__select.active')) {\r\n            const wishListSelect = document.querySelector('.wishlist-product__select.active');\r\n            wishListSelect.classList.remove('active')\r\n        }\r\n    }\r\n\r\n\r\n    render() {\r\n        const { pageModal } = this.props;\r\n        return (\r\n            <div className={`page-modal__container ${pageModal.isOpen ? \"page-modal__container--visible page-modal__container--overlay\" : \"\"}`} onClick={(e) => this.handleClickOutside(e)}>\r\n                <div className=\"page-modal\" ref={this.setWrapperRef}>\r\n                    {pageModal.status === 'success' ?\r\n                        <Fragment>\r\n                            <span className=\"page-modal__close\" onClick={() => {this.props.closeModal(); this.handleClose()}} ></span>\r\n                            <h2 className=\"page-modal__heading\">{pageModal.data.title}</h2>\r\n                            <div className=\"page-modal__wrapper\">\r\n                                <a href={`${pageModal.data.link.href}`} className=\"page-modal__link button\">{pageModal.data.link.text}</a>\r\n                            </div>\r\n                        </Fragment> :\r\n                        <Fragment>\r\n                            <h2 className=\"page-modal__heading\">{pageModal.data.title}</h2>\r\n                            <div className=\"page-modal__wrapper\">\r\n                                <p>{pageModal.data.link.text}</p>\r\n                            </div>\r\n                        </Fragment>\r\n                    }\r\n                    \r\n                </div>\r\n            </div>\r\n        )\r\n    }\r\n}\r\n\r\n\r\nexport default PageModal;","import React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { close } from '../Actions/PageModal.action';\r\nimport PageModal from '../Components/PageModal';\r\n\r\nconst PageModalContainer = props => (\r\n    <PageModal {...props} onClick={() => this.props.closeModal()}/>\r\n);\r\n\r\nconst mapStateToProps = (state) => {\r\n    const { pageModal } = state;\r\n    return {\r\n        pageModal\r\n    }\r\n}\r\n\r\nconst mapDispatchToProps = dispatch => {\r\n    return {\r\n        closeModal: () => dispatch(close())\r\n    }\r\n}\r\n\r\nexport default connect(mapStateToProps, mapDispatchToProps)(PageModalContainer);\r\n"],"sourceRoot":""}