{"mappings":"kYAAA,IAAAA,EAAAC,EAAA,SAEO,MAAMC,EAAc,KACzBC,EAAAH,EAAA,CAAE,oBAAoBI,GAAG,SAASC,IAChCA,EAAEC,iBACF,MAAMC,EAAeJ,EAAAH,EAAA,CAAEK,EAAEG,eAEnBC,EAAeF,EAAaG,KAAK,iBAAmB,GAEpDC,EAAcJ,EAAaG,KAAK,gBAAkB,GAElDE,EAC0B,MAA9BT,EAAAH,EAAA,CAAE,yBACEG,EAAAH,EAAA,CAAE,yBAAyBa,KAAK,QAChCC,OAAOC,SAASC,KACtB,GAAqB,aAAjBP,EACFK,OAAOG,KAAK,mCAAqCL,QAC5C,GAAqB,YAAjBH,EACTK,OAAOG,KACL,8CACAd,EAAAH,EAAA,CAAE,SAASkB,OACX,UACAP,EACA,KACAC,OAEG,CACL,MAAMO,EAAIC,SAASC,cAAc,UACjCF,EAAEG,aACA,MACA,mDACgB,SAAhBC,KAAKC,UAEPJ,SAASK,KAAKC,YAAYP","sources":["scripts/src/social-share/index.ts"],"sourcesContent":["import $ from \"jquery\";\r\n\r\nexport const socialShare = () => {\r\n $(\".js-social-share\").on(\"click\", e => {\r\n e.preventDefault();\r\n const thisInstance = $(e.currentTarget);\r\n // determine which of social accounts\r\n const accountAlias = thisInstance.data(\"account-alias\") + \"\";\r\n // data from settings in back office\r\n const accountName = thisInstance.data(\"account-name\") + \"\";\r\n // use canonical if avaliable for current page\r\n const currentPage =\r\n $('link[rel=\"canonical\"]') != null\r\n ? $('link[rel=\"canonical\"]').attr(\"href\")\r\n : window.location.href;\r\n if (accountAlias === \"facebook\") {\r\n window.open(\"http://facebook.com/share.php?u=\" + currentPage);\r\n } else if (accountAlias === \"twitter\") {\r\n window.open(\r\n \"http://twitter.com/home?status=Loving this \" +\r\n $(\"title\").html() +\r\n \" from @\" +\r\n accountName +\r\n \": \" +\r\n currentPage\r\n );\r\n } else {\r\n const x = document.createElement(\"script\");\r\n x.setAttribute(\r\n \"src\",\r\n \"https://assets.pinterest.com/js/pinmarklet.js?r=\" +\r\n Math.random() * 99999999\r\n );\r\n document.body.appendChild(x);\r\n }\r\n });\r\n};\r\n"],"names":["$4sYka","parcelRequire","$6ec147efe27f5a00$export$3d90793665d4738b","$parcel$interopDefault","on","e","preventDefault","thisInstance","currentTarget","accountAlias","data","accountName","currentPage","attr","window","location","href","open","html","x","document","createElement","setAttribute","Math","random","body","appendChild"],"version":3,"file":"social-share.4b62edee.js.map"}