var Strossle=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=17)}([function(t,e,r){"use strict";window.StrossleStorage=window.StrossleStorage||{},e.a={getItem:function(t){return window.StrossleStorage[t]},setItem:function(t,e){window.StrossleStorage[t]=e}}},function(t,e,r){"use strict";function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(n=(a=c.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==c.return||c.return()}finally{if(o)throw i}}return r}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r2&&void 0!==arguments[2]?arguments[2]:{},o=document.createElement("script");if(o.type="text/javascript",o.src=t,o.async=!0,r&&"object"===i(r)&&Object.entries(r).forEach((function(t){var e=n(t,2),r=e[0],i=e[1];o.setAttribute(r,i)})),"string"==typeof e){var a=document.querySelector(e);a.parentNode.insertBefore(o,a.nextSibling)}else{var c=document.getElementsByTagName("head");c&&c.length&&c[0].appendChild(o)}},applyCSSFromStringToSiteHead:function(t){var e=document.createElement("style"),r=document.getElementsByTagName("head")[0],n=t;e.type="text/css",e.appendChild(document.createTextNode(n)),r.appendChild(e)},wrapPostInATag:function(t,e){var r="_top";c(s.getCurrentBrowserUrl(),e)||(r="_blank");var n=document.createElement("a");return n.href=e,n.target=r,n.innerHTML=t.innerHTML,n.rel="nofollow",t.innerHTML="",t.appendChild(n),t},crawlWindowsToTheTop:function(t){var e,r,n,o=0,i=!1,a=!1;try{t.location.ancestorOrigins&&(e=t.location.ancestorOrigins)}catch(t){}do{var c=r,s=a,u=void 0,l=!1,p=null;a=!1,r=r?r.parent:t;try{u=r.location.href||null}catch(t){l=!0}if(l)if(s)try{n=p=c.context.sourceUrl,i=!0}catch(t){}else{try{var f=c.document.referrer;f&&(p=f)}catch(t){}!p&&e&&e[o-1]&&(p=e[o-1]),p&&!i&&(n=p)}else u&&(n=p=u,i=!1),r.context&&r.context.sourceUrl&&(a=!0);o++}while(r!==t.top&&o<1e3);return n||null},getCurrentBrowserUrl:function(){return a()?s.crawlWindowsToTheTop(window):window.location.href},getCurrentBrowserHostName:function(){var t=window.location.hostname;return a()&&(t=s.getCurrentBrowserUrl().replace(/https?:\/*/,"").split("/")[0].split(":")[0]),t},getCurrentBrowserHostNameWithoutWWW:function(){return s.getCurrentBrowserHostName().replace(/^(www\.)/,"")},getCurrentBrowserDeviceType:function(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)?"mobile":"desktop"},isElementInView:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=t.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight,o=window.innerWidth||document.documentElement.clientWidth,i=r.top-e<=n&&r.top+r.height>=0,a=r.left<=o&&r.left+r.width>=0,c=i&&a;return c},getDataAttributeValue:function(t,e){return"string"==typeof t&&(t=document.querySelector(t)),t&&1===t.nodeType?t.getAttribute(e):null},createIframe:function(t){var e=t.doc||document,r=e.createElement("iframe");t.attrs&&Object.assign(r,t.attrs),t.style&&Object.assign(r.style,t.style),t.src&&(r.src=t.src);var n=t.targetSelector||"body",o=e.querySelector(n);return o&&(o.appendChild(r),t.html&&function(e){e.open(),e.write(t.html),e.close()}(r.contentWindow.document)),r}},u=s,l=!1,p=null,f=window,d={};function h(t){var e={};try{e="string"==typeof t.data?JSON.parse(t.data):t.data}catch(t){}var r=e.__tcfapiReturn;r&&"function"==typeof d[r.callId]&&(d[r.callId](r.returnValue,r.success),d[r.callId]=null)}var y,g=function(){if(!l){if(!p)for(;f;){try{if(f.frames.__tcfapiLocator){p=f;break}}catch(t){}if(f===window.top)break;f=f.parent}window.__tcfapi=function(t,e,r,n){if(p){var o=Math.random()+"",i={__tcfapiCall:{command:t,parameter:n,version:e,callId:o}};d[o]=r,p.postMessage(i,"*")}else r({msg:"CMP not found"},!1)},window.addEventListener("message",h,!1),l=!0}},m={getConsentData:function(){var t={gdprApplies:"",gdprConsent:"",strossleConsents:{}};return new Promise((function(e){try{if(!window.hasOwnProperty("__tcfapi")&&function(){try{return window.self!==window.top}catch(t){return!0}}()&&g(),!window.hasOwnProperty("__tcfapi"))return e(t);var r=!1,n=setTimeout((function(){return r=!0,e(t)}),1e4);window.__tcfapi("addEventListener",2,(function(o,i){if(!r){if(!i)return clearTimeout(n),e(t);if(!1===o.gdprApplies||"tcloaded"===o.eventStatus||"useractioncomplete"===o.eventStatus){clearTimeout(n);var a=((o||{}).purpose||{}).consents||{};return(((o||{}).vendor||{}).consents||{})[851]||Object.keys(a).forEach((function(t){return a[t]=!1})),e({gdprApplies:+o.gdprApplies||t.gdprApplies,gdprConsent:o.tcString||t.gdprConsent,strossleConsents:a})}}}))}catch(r){return e(t)}}))}},v=r(0),b=(y=!1,function(t,e){if(!y){y=!0;try{var r="https://ad.360yield.com/user_sync?publisher_id=1983&gdpr=[GDPR]&gdpr_consent=[GDPR_CONSENT]";r&&(r=(r=r.replace("[GDPR]",t)).replace("[GDPR_CONSENT]",e),fetch(r,{credentials:"include"}).then((function(t){if(t.ok)return t.json()})).then((function(t){Array.isArray(t.sync)&&t.sync.forEach((function(t){var e=document.createElement("img");e.src=t.url,e.style.visibility="hidden",document.body.appendChild(e),e.remove()}))})))}catch(t){}}}),w=function(){var t=!1;return function(e,r){if(!t){t=!0;try{var n="https://hb.360yield.com/prebid-universal-creative/load-cookie-tcf.html?pbs=1&gdpr=[GDPR]&gdpr_consent=[GDPR_CONSENT]&publisher_id=1983&bidders=appnexus,outbrain,smartadserver,adf,criteo,ix,rubicon,pubmatic,medianet";n&&(n=(n=n.replace("[GDPR]",e)).replace("[GDPR_CONSENT]",r),u.createIframe({src:n,style:{display:"none",height:"0px",width:"0px",border:"0px"}}))}catch(t){}}}}();function S(t){return(S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function k(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}function x(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){k(i,n,o,a,c,"next",t)}function c(t){k(i,n,o,a,c,"throw",t)}a(void 0)}))}}function _(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function E(t,e){for(var r=0;r1&&void 0!==l[1]?l[1]:{},n=u.getCurrentBrowserUrl(),o=u.getCurrentBrowserDeviceType(),i=v.a.getItem("strosslePageSessionId"),t.next=6,m.getConsentData();case 6:return r.gdpr=t.sent,t.next=9,this.getWidgetSiteSettings(e);case 9:return a=t.sent,(c=this.isSitePersonalizedTargetingAllowed(a))&&(b(r.gdpr.gdprApplies,r.gdpr.gdprConsent),a.is_pbs_enabled&&w(r.gdpr.gdprApplies,r.gdpr.gdprConsent)),s="".concat(c?"https://widgets.strossle.360yield.com/v1/widgets":"https://widgets.spklw.com/v1/widgets","/").concat(e)+"?url=".concat(encodeURIComponent(n))+"&device=".concat(o)+"&gdpr=".concat(r.gdpr.gdprApplies)+"&gdpr_consent=".concat(r.gdpr.gdprConsent),i&&(s=s.concat("&page-session-id=".concat(i))),r.context&&Array.isArray(r.context)&&r.context.length&&(s=s.concat("&context=".concat(r.context.join(",")))),r.clickUrl&&"string"==typeof r.clickUrl&&(s=s.concat("&click_url=".concat(encodeURIComponent(r.clickUrl)))),t.abrupt("return",s);case 17:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"getWidgetSiteSettings",value:(r=x(regeneratorRuntime.mark((function t(e){var r,n,o,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r="".concat(e,":siteSettings"),!(n=v.a.getItem(r))||"object"!==S(n)){t.next=4;break}return t.abrupt("return",n);case 4:return o="".concat("https://widgets.spklw.com/v1/widgets","/").concat(e,"/settings"),t.next=7,fetch(o);case 7:if((i=t.sent).ok){t.next=10;break}return t.abrupt("return",null);case 10:return t.next=12,i.json();case 12:return n=t.sent,v.a.setItem(r,n),t.abrupt("return",n);case 15:case"end":return t.stop()}}),t)}))),function(t){return r.apply(this,arguments)})},{key:"getWidgetData",value:(e=x(regeneratorRuntime.mark((function t(e){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch(e,{credentials:"include"});case 2:if((r=t.sent).ok){t.next=5;break}return t.abrupt("return",null);case 5:return t.abrupt("return",r.json());case 6:case"end":return t.stop()}}),t)}))),function(t){return e.apply(this,arguments)})},{key:"isSitePersonalizedTargetingAllowed",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.is_device_storage_enabled&&t.is_personalized_ads_enabled}},{key:"loadPlugins",value:function(t){for(var e=0;e'));e.appendChild(r)}}]),t}(),A=function(){function t(e){_(this,t),this.instanceId=t.generateInstanceId(),this.targetSelector=e,this.privateMethods=new R,this.adBlockerInUse=u.checkForAdblocker(),this.adBlockRedirectUrl="https://widgets.sprinklecontent.com/r/?u="}return P(t,null,[{key:"generateInstanceId",value:function(){return Math.random().toString(36).substr(2,9)}},{key:"getWidgetSiteSettings",value:function(t){return R.prototype.getWidgetSiteSettings(t)}}]),t}(),O=function(t){var e=[];for(var r in t)t.hasOwnProperty(r)&&e.push(encodeURIComponent(r)+"="+encodeURIComponent(t[r]));return e.join("&")},I={buildAndSendLoadEvent:function(t){var e=(v.a.getItem("strosslePageSessionId")||"").replace(/\-/g,""),r={widget_id:t,device:u.getCurrentBrowserDeviceType(),session_id:e,url:u.getCurrentBrowserUrl(),origin_type:"widget",event:"load",type:"widget"},n=encodeURIComponent(O(r)),o="".concat("https://bonfire.spklw.com","/?t=bulk&i=").concat(n);fetch(o)},preparePostClickEvent:function(t,e,r){t.addEventListener("click",(function(){if(!t.getAttribute("data-clicked")){t.setAttribute("data-clicked",!0),fetch(e);try{r&&Array.isArray(r)&&(r=r.concat(r.filter(Boolean)))&&r.length>0&&r.forEach((function(e){var r=document.createElement("img");r.src=e,r.style.visibility="hidden",t.appendChild(r),r.remove()}))}catch(t){}}}))}};function j(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}function T(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(n=(a=c.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==c.return||c.return()}finally{if(o)throw i}}return r}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return C(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return C(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function D(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=this.viewabilityThreshold&&null===this.timer&&(this.timer=setTimeout((function(t){t.fire()}),1e3,this)),n.intersectionRatiot.length)&&(e=t.length);for(var r=0,n=new Array(e);r2&&void 0!==arguments[2]?arguments[2]:{};return tt(this,h),(r=d.call(this,e)).id=t,r.opts=n,r.postCounter=0,r.events=[],r.eventListeners=[],r.plugins=r.opts.plugins&&Array.isArray(r.opts.plugins)?r.opts.plugins:[],r.plugins.unshift(G),r}return e=h,(r=[{key:"pluginEventListener",value:(f=Z(regeneratorRuntime.mark((function t(e,r){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:W.debug("Plugin event received: %s %o",e,r),t.t0=e,t.next="loadContent"===t.t0?4:9;break;case 4:return t.next=6,this.fetchData();case 6:return(n=t.sent)&&n.content&&this.renderPosts(n.content),t.abrupt("return");case 9:return t.abrupt("return");case 10:case"end":return t.stop()}}),t,this)}))),function(t,e){return f.apply(this,arguments)})},{key:"lifecycleHook",value:(p=Z(regeneratorRuntime.mark((function t(e){var r,n,o,i=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>1&&void 0!==i[1]?i[1]:{},this.events.push({name:e,data:r,timestamp:(new Date).toISOString()}),n=[],Array.isArray(this.eventListeners)&&(o=Y(Y({},this.getPluginContext()),{},{event:{name:e,data:r}}),this.eventListeners.forEach((function(t){"function"==typeof t[e]&&n.push(t[e].call(t,o))}))),t.next=6,Promise.all(n);case 6:case"end":return t.stop()}}),t,this)}))),function(t){return p.apply(this,arguments)})},{key:"getPluginContext",value:function(){return{emit:this.pluginEventListener.bind(this),widgetInstanceId:this.instanceId,widgetSelector:this.targetSelector,widgetId:this.id}}},{key:"registerPlugin",value:(l=Z(regeneratorRuntime.mark((function t(e){var r=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(){var t=Z(regeneratorRuntime.mark((function t(n){var o,i,a,c,s,u,l;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r.lifecycleHook("pluginWillLoad",{plugin:e}),!e.link||null===(o=e.type)||void 0===o||!o.startsWith("script:")){t.next=16;break}if(c=null===(a=e.type)||void 0===a?void 0:a.slice("script:".length),window[c]&&"function"!=typeof window[c]){t.next=14;break}return t.prev=4,s=new N({src:e.link,global:c}),t.next=8,s.load();case 8:i=t.sent,t.next=14;break;case 11:return t.prev=11,t.t0=t.catch(4),t.abrupt("return");case 14:t.next=17;break;case 16:i=function(){return Y({},e)};case 17:return u=Y({options:e.options},r.getPluginContext()),i&&"function"==typeof i&&(l=i.call(i,u),r.eventListeners.push(l)),r.lifecycleHook("pluginDidLoad",{plugin:e}),t.abrupt("return",n());case 21:case"end":return t.stop()}}),t,null,[[4,11]])})));return function(e){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}}),t)}))),function(t){return l.apply(this,arguments)})},{key:"loadPluginsAndWait",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return new Promise(function(){var n=Z(regeneratorRuntime.mark((function n(o){var i,a;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=setTimeout((function(){W.debug("Load plugins took too long"),o()}),r),a=t.map(e.registerPlugin.bind(e)),n.next=4,Promise.all(a);case 4:clearTimeout(i),o();case 6:case"end":return n.stop()}}),n)})));return function(t){return n.apply(this,arguments)}}())}},{key:"initialize",value:(s=Z(regeneratorRuntime.mark((function t(){var e,r,n,o,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,e=(u.getDataAttributeValue(this.targetSelector,"data-strossle-context")||"").split(",").filter(Boolean),this.opts.context&&Array.isArray(this.opts.context)?this.opts.context=this.opts.context.concat(e):this.opts.context=e,this.opts.context=V(new Set(this.opts.context)),t.prev=4,this.plugins=this.plugins.filter((function(t){var e;return!(null!=t&&null!==(e=t.type)&&void 0!==e&&e.includes("vlyby"))})),this.privateMethods.loadPlugins(this.plugins.filter((function(t){return t.link&&["css","script"].includes(t.type)}))),t.next=9,this.loadPluginsAndWait(this.plugins);case 9:t.next=13;break;case 11:t.prev=11,t.t0=t.catch(4);case 13:if(!this.id){t.next=23;break}return t.prev=14,t.next=17,this.fetchData();case 17:r=t.sent,t.next=23;break;case 20:t.prev=20,t.t1=t.catch(14);case 23:if(r||this.opts.content){t.next=25;break}return t.abrupt("return");case 25:if(n=r&&r.widget&&r.widget.settings?JSON.parse(r.widget.settings):{},this.opts.design&&"object"===J(this.opts.design)&&(n.designSettings=Object.assign({},n.designSettings,this.opts.design)),o=r&&r.content?r.content:{posts:[]},this.opts&&this.opts.content&&this.opts.content.posts&&Array.isArray(this.opts.content.posts)&&(o.posts=this.opts.content.posts),this.widgetSettings=n,!n.plugins||!n.plugins.length){t.next=43;break}if(this.privateMethods.loadPlugins(n.plugins.filter((function(t){return t.link&&["css","script"].includes(t.type)}))),t.prev=32,i=n.plugins.filter((function(t){var e;return t.link&&(null==t||null===(e=t.type)||void 0===e?void 0:e.startsWith("script:"))})),!Array.isArray(i)||!i.length){t.next=37;break}return t.next=37,this.loadPluginsAndWait(i);case 37:t.next=42;break;case 39:t.prev=39,t.t2=t.catch(32),W.debug("Error while loading remote plugins",t.t2);case 42:this.plugins=[].concat(V(this.plugins),V(n.plugins));case 43:return u.applyCSSFromStringToSiteHead(n.designSettings.widgetCSS),t.next=46,this.lifecycleHook("widgetWillRender",{content:o,settings:n,widget:{t_imp:o.t_imp,t_load:o.t_load,t_emp:o.t_emp},metadata:{contentCount:o.posts.length}});case 46:if(!r||!r.html){t.next=51;break}return t.next=49,this.renderHtml(n,o,r.html);case 49:t.next=53;break;case 51:return t.next=53,this.renderRegular(n,o);case 53:return t.next=55,this.lifecycleHook("widgetDidRender");case 55:t.next=60;break;case 57:t.prev=57,t.t3=t.catch(0);case 60:case"end":return t.stop()}}),t,this,[[0,57],[4,11],[14,20],[32,39]])}))),function(){return s.apply(this,arguments)})},{key:"fetchData",value:(c=Z(regeneratorRuntime.mark((function t(){var e,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.id){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,this.privateMethods.buildWidgetServerURL(this.id,this.opts);case 4:return e=t.sent,t.next=7,this.privateMethods.getWidgetData(e);case 7:return r=t.sent,t.next=10,this.lifecycleHook("widgetDataLoaded",r);case 10:return t.abrupt("return",r);case 11:case"end":return t.stop()}}),t,this)}))),function(){return c.apply(this,arguments)})},{key:"renderHtml",value:(a=Z(regeneratorRuntime.mark((function t(e,r,n){var o,i=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:try{o=u.createElementFromString(n),document.querySelector(this.targetSelector).appendChild(o),o.querySelectorAll(".strossle-post").forEach((function(t){var e=t.getAttribute("data-id"),r=t.getAttribute("data-type"),n=t.getAttribute("data-link");if("ad"===r&&i.adBlockerInUse)try{var o=btoa(encodeURIComponent(n));n=i.adBlockRedirectUrl+encodeURIComponent(o)+"&b64=1"}catch(t){n=i.adBlockRedirectUrl+n}JSON.parse(t.getAttribute("data-third-party-link")),t.getAttribute("data-track-impression");var a=JSON.parse(t.getAttribute("data-click-pixels")),c=t.getAttribute("data-track-click");I.preparePostClickEvent(t,c,a),u.wrapPostInATag(t,n),"ad"===t.getAttribute("data-type")&&"overlay"===t.getAttribute("data-ad-type")&&i.setupOverlay(e,n,t)})),r.posts.length<1&&this.opts&&this.opts.passbackUrl&&"string"==typeof this.opts.passbackUrl&&u.loadScript(this.opts.passbackUrl,this.targetSelector)}catch(t){}case 1:case"end":return t.stop()}}),t,this)}))),function(t,e,r){return a.apply(this,arguments)})},{key:"renderRegular",value:(i=Z(regeneratorRuntime.mark((function t(e,r){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,n=this.privateMethods.generateWrapperElement(e.designSettings.widgetWrapperTemplate,this.targetSelector),r.posts.length&&(e.designSettings.widgetHeaderTemplate&&this.privateMethods.appendWidgetHeader(e.designSettings.widgetHeaderTemplate,e.designSettings.widgetHeaderText,n),this.privateMethods.appendPostsEnd(this.instanceId,n),e.designSettings.widgetFooterTemplate&&this.privateMethods.appendWidgetFooter(e.designSettings.widgetFooterTemplate,n)),t.next=5,this.renderPosts(r);case 5:r.posts.length<1&&this.opts&&this.opts.passbackUrl&&"string"==typeof this.opts.passbackUrl&&u.loadScript(this.opts.passbackUrl,this.targetSelector),t.next=11;break;case 8:t.prev=8,t.t0=t.catch(0);case 11:case"end":return t.stop()}}),t,this,[[0,8]])}))),function(t,e){return i.apply(this,arguments)})},{key:"renderPosts",value:(o=Z(regeneratorRuntime.mark((function t(e){var r,n=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=this.widgetSettings,e.posts.forEach((function(t,e){n.lifecycleHook("contentWillRender",{content:JSON.parse(JSON.stringify(t))});var o=u.createElementFromString(n.privateMethods.generatePostElement(t,r.designSettings.widgetPostTemplate,r.designSettings.contentLabels,n.adBlockerInUse,n.adBlockRedirectUrl));if(t.retouch_mark&&"string"==typeof t.retouch_mark){var i=o.querySelector('[class^="post-image-container-"]');n.applyRetouchMark(i,t.retouch_mark)}if(t.logo&&t.logo.src){var a=o.querySelector('[class^="post-image-container-"]');n.applyLogo(a,t.logo)}var c=u.wrapPostInATag(o,t.url),s=document.getElementById("strossle-posts-end-".concat(n.instanceId));s.parentNode.insertBefore(c,s),I.preparePostClickEvent(c,t.t_click,t.click_pixels),c.addEventListener("click",(function(){n.lifecycleHook("onContentClick",{content:JSON.parse(JSON.stringify(t))})})),"ad"===t.type&&"overlay"===t.ad_type&&n.setupOverlay(t.id,t.url,o),n.lifecycleHook("contentDidRender",{content:JSON.parse(JSON.stringify(t)),el:o})}));case 2:case"end":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})},{key:"applyRetouchMark",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"dark_top_left";if(t&&e){var r="string"==typeof e?e.split(/-|_/):[],n=r.length>0?r[0]:"dark",o=r.length>1?r[1]:"top",i=r.length>2?r[2]:"left",a="https://assets.strossle.com/images/retouch-mark-".concat(n,".png"),c=u.createElementFromString('
');c.style.position="absolute",c.style.width="15%",c.style.paddingTop="15%",c.style.margin="10px",c.style.boxSizing="border-box",c.style.background="url(".concat(a,")"),c.style.backgroundRepeat="none",c.style.backgroundSize="cover",c.style.zIndex="1000",c.style[o]="0",c.style[i]="0",t.prepend(c)}}},{key:"applyLogo",value:function(t,e){if(t&&e){var r="string"==typeof e.position?e.position.toLowerCase().split(/[-_]/):[],n=r.length>0?r[0]:"bottom",o=r.length>1?r[1]:"right",i=e.size||0,a=["width","height"].includes(e.side)?e.side:"width",c=e.opacity||0,s=document.createElement("img");s.src=e.src,s.style.position="absolute",s.style.zIndex="1001",s.style[n]="0",s.style[o]="0",s.style[a]="".concat(i,"%"),s.style.opacity=c,t.append(s)}}},{key:"setupOverlay",value:function(t,e,r){var n={id:t,url:e};r.firstChild.removeAttribute("target");var o="".concat("https://assets.strossle.com/strossle-widget-sdk/1","/plugins/overlay.js"),i=document.getElementsByTagName("body");i&&i.length&&i[0].addEventListener("strossleOverlay",(function(t){return t.detail.loadOverlay(n,r)})),v.a.getItem("overlayPluginLoaded")||(v.a.setItem("overlayPluginLoaded",!0),u.loadScript(o))}}])&&et(e.prototype,r),n&&et(e,n),h}(A);function ct(t){return(ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function st(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}function ut(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&2===e.filter((function(t){return t&&"string"==typeof t})).length&&Ut.initializeAndRenderWidgetWhenNearView(e[0],e[1],e,(function(){return At(at,e).initialize()}))}};e.a=Nt},,,,function(t,e,r){var n=r(9),o=r(10);t.exports=function(t,e,r){var i=e&&r||0;"string"==typeof t&&(e="binary"===t?new Array(16):null,t=null);var a=(t=t||{}).random||(t.rng||n)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,e)for(var c=0;c<16;++c)e[i+c]=a[c];return e||o(a)}},,function(t,e,r){(function(t){function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var r=function(t){"use strict";var r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new _(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return P()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=S(a,r);if(c){if(c===p)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=l(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===p)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,a),i}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var p={};function f(){}function d(){}function h(){}var y={};y[i]=function(){return this};var g=Object.getPrototypeOf,m=g&&g(g(E([])));m&&m!==r&&n.call(m,i)&&(y=m);var v=h.prototype=f.prototype=Object.create(y);function b(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,r){var o;this._invoke=function(i,a){function c(){return new r((function(o,c){!function o(i,a,c,s){var u=l(t[i],t,a);if("throw"!==u.type){var p=u.arg,f=p.value;return f&&"object"===e(f)&&n.call(f,"__await")?r.resolve(f.__await).then((function(t){o("next",t,c,s)}),(function(t){o("throw",t,c,s)})):r.resolve(f).then((function(t){p.value=t,c(p)}),(function(t){return o("throw",t,c,s)}))}s(u.arg)}(i,a,o,c)}))}return o=o?o.then(c,c):c()}}function S(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method))return p;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var n=l(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,p;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(c&&s){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:E(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},t}("object"===e(t)?t.exports:{});try{regeneratorRuntime=r}catch(t){Function("r","regeneratorRuntime = r")(r)}}).call(this,r(8)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){var r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(r){var n=new Uint8Array(16);t.exports=function(){return r(n),n}}else{var o=new Array(16);t.exports=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),o[e]=t>>>((3&e)<<3)&255;return o}}},function(t,e){for(var r=[],n=0;n<256;++n)r[n]=(n+256).toString(16).substr(1);t.exports=function(t,e){var n=e||0,o=r;return[o[t[n++]],o[t[n++]],o[t[n++]],o[t[n++]],"-",o[t[n++]],o[t[n++]],"-",o[t[n++]],o[t[n++]],"-",o[t[n++]],o[t[n++]],"-",o[t[n++]],o[t[n++]],o[t[n++]],o[t[n++]],o[t[n++]],o[t[n++]]].join("")}},,,,,,,function(t,e,r){"use strict";r.r(e);r(7);var n=r(1),o=r(5),i=r.n(o),a=r(0);function c(t){return function(t){if(Array.isArray(t))return s(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return s(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return s(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r