{"version":3,"sources":["webpack:///./src/components/pmicom/widgets/social-media-highlights/controller.js"],"names":["fillWithDomElementsAll","trackLink","require","SELECTOR_TILE","CLASS_LINK","CLASS_SHARE","CLASS_FOLLOW","selectorsAll","links","shares","follows","module","exports","init","forEach","elements","label","element","addEventListener","e","trackGTM","target","eventLabelName","url","closest","querySelector","href"],"mappings":";;;;;;;;;AAAA,MAAM;EAAEA,sBAAF;EAA0BC;AAA1B,IAAwCC,mBAAO,CAAC,6CAAD,CAArD;;AAEA,MAAMC,aAAa,GAAG,gCAAtB;AACA,MAAMC,UAAU,GAAG,+BAAnB;AACA,MAAMC,WAAW,GAAG,gCAApB;AACA,MAAMC,YAAY,GAAG,iCAArB;AAEA,MAAMC,YAAY,GAAG;EACpBC,KAAK,EAAEJ,UADa;EAEpBK,MAAM,EAAEJ,WAFY;EAGpBK,OAAO,EAAEJ;AAHW,CAArB;AAMAK,MAAM,CAACC,OAAP,GAAiB;EAChBC,IAAI,GAAG;IACNb,sBAAsB,CAAC,IAAD,EAAOO,YAAP,CAAtB;IACA,CACC,CAAC,KAAKC,KAAN,EAAa,OAAb,CADD,EAEC,CAAC,KAAKC,MAAN,EAAc,aAAd,CAFD,EAGC,CAAC,KAAKC,OAAN,EAAe,cAAf,CAHD,EAIEI,OAJF,CAIU,CAAC,CAACC,QAAD,EAAWC,KAAX,CAAD,KAAuB;MAChCD,QAAQ,CAACD,OAAT,CAAiBG,OAAO,IAAI;QAC3BA,OAAO,CAACC,gBAAR,CAAyB,OAAzB,EAAkCC,CAAC,IAAI;UACtC,KAAKC,QAAL,CAAcD,CAAd,EAAiBH,KAAjB;QACA,CAFD;MAGA,CAJD;IAKA,CAVD;EAWA,CAde;;EAehBI,QAAQ,CAAC;IAAEC;EAAF,CAAD,EAAaC,cAAb,EAA6B;IACpC,MAAMC,GAAG,GAAGF,MAAM,CAChBG,OADU,CACFrB,aADE,EAEVsB,aAFU,CAEI,MAAMrB,UAFV,EAEsBsB,IAFlC;IAGAzB,SAAS,CAACqB,cAAD,EAAiBC,GAAjB,CAAT;EACA;;AApBe,CAAjB,C","file":"components--social-media-highlightsd91775db6ac0caf70696.js","sourcesContent":["const { fillWithDomElementsAll, trackLink } = require('util/functions');\n\nconst SELECTOR_TILE = '.social-media-highlights--tile';\nconst CLASS_LINK = 'social-media-highlights--link';\nconst CLASS_SHARE = 'social-media-highlights--share';\nconst CLASS_FOLLOW = 'social-media-highlights--follow';\n\nconst selectorsAll = {\n\tlinks: CLASS_LINK,\n\tshares: CLASS_SHARE,\n\tfollows: CLASS_FOLLOW,\n};\n\nmodule.exports = {\n\tinit() {\n\t\tfillWithDomElementsAll(this, selectorsAll);\n\t\t[\n\t\t\t[this.links, 'tweet'],\n\t\t\t[this.shares, 'tweet share'],\n\t\t\t[this.follows, 'tweet follow'],\n\t\t].forEach(([elements, label]) => {\n\t\t\telements.forEach(element => {\n\t\t\t\telement.addEventListener('click', e => {\n\t\t\t\t\tthis.trackGTM(e, label);\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t},\n\ttrackGTM({ target }, eventLabelName) {\n\t\tconst url = target\n\t\t\t.closest(SELECTOR_TILE)\n\t\t\t.querySelector('.' + CLASS_LINK).href;\n\t\ttrackLink(eventLabelName, url);\n\t},\n};\n"],"sourceRoot":""}