{"version":3,"sources":["webpack:///./src/js/components/shareSocialMedia.js"],"names":["shareSocialMedia","this","dom","buttons","el","querySelectorAll","url","window","location","href","Array","from","forEach","button","socialApi","dataset","shareApi","addEventListener","openModal","winTop","innerHeight","winLeft","innerWidth","open","Component"],"mappings":"olDAEMA,E,sWACJ,WACEC,KAAKC,IAAM,CACTC,QAASF,KAAKG,GAAGC,iBAAiB,8BAEpCJ,KAAKK,IAAMC,OAAOC,SAASC,O,0BAG7B,WAAe,WACbC,MAAMC,KAAKV,KAAKC,IAAIC,SAASS,SAAQ,SAAAC,GACnC,IAAMC,EAAYD,EAAOE,QAAQC,SACjCH,EAAOI,iBAAiB,SAAS,kBAC/B,EAAKC,UAAUJ,EAAY,EAAKR,a,uBAKtC,SAAUA,GACR,IAAMa,EAASZ,OAAOa,YAAc,EAAI,IAClCC,EAAUd,OAAOe,WAAa,EAAI,IAExCf,OAAOgB,KACLjB,EACA,SAFF,cAGSa,EAHT,kBAGyBE,EAHzB,gD,8BArB2BG,aA6BhBxB","file":"53.2022c3472e98a19394c0.js","sourcesContent":["import { Component } from '@verndale/core';\n\nclass shareSocialMedia extends Component {\n setupDefaults() {\n this.dom = {\n buttons: this.el.querySelectorAll('.share-social-media__link')\n };\n this.url = window.location.href;\n }\n\n addListeners() {\n Array.from(this.dom.buttons).forEach(button => {\n const socialApi = button.dataset.shareApi;\n button.addEventListener('click', () =>\n this.openModal(socialApi + this.url)\n );\n });\n }\n\n openModal(url) {\n const winTop = window.innerHeight / 3 - 200;\n const winLeft = window.innerWidth / 2 - 300;\n\n window.open(\n url,\n 'sharer',\n `top=${winTop}, left=${winLeft}, width=600, height=400, scrollbars=no`\n );\n }\n}\n\nexport default shareSocialMedia;\n"],"sourceRoot":""}