=f;if(k&&!l)return g&&b.setLocalStorageValue(a,k.value,d),k.value}}catch(p){}return null};this.setLocalStorageValue=function(a,d,e){void 0===e&&(e=!0);try{e=
e?"adthrive_":"";var f={value:d,created:Date.now()};window.localStorage.setItem("".concat(e).concat(a.toLowerCase()),JSON.stringify(f))}catch(g){}};this.isValidABGroupLocalStorageValue=function(a){return void 0!==a&&null!==a&&!("number"===typeof a&&isNaN(a))};this.getOrSetLocalStorageValue=function(a,d,e,f,g,h,k){void 0===f&&(f=!0);void 0===g&&(g=!0);void 0===k&&(k=!0);e=b.getLocalStorageValue(a,k,f,e,g);if(null!==e)return e;d=d();b.setLocalStorageValue(a,d,k);h&&h(d);return d};this.getOrSetABGroupLocalStorageValue=
function(a,d,e,f,g){var h;void 0===f&&(f=!0);e=b.getLocalStorageValue("abgroup",!0,!0,e,f);if(null!==e&&(f=e[a],b.isValidABGroupLocalStorageValue(f)))return f;d=d();a=y(y({},e),(h={},h[a]=d,h));b.setLocalStorageValue("abgroup",a);g&&g();return d}}c.prototype.init=function(){};return c}()),la=function(){return function(c,b,a){var d=a.value;d&&(a.value=function(){for(var e=this,f=[],g=0;g
%o","No experiment config found. Defaulting to control."),"control";if(!this._mappedChoices||0===this._mappedChoices.length)return q.error("CLSWeightedChoiceSiteExperiment","run","() => %o","No experiment variants found. Defaulting to control."),
"control";var a=(new R(this._mappedChoices)).get();if(this._isValidResult(a))return a;q.error("CLSWeightedChoiceSiteExperiment","run","() => %o","Invalid result from experiment choices. Defaulting to control.");return"control"};return b}(function(){function c(){}Object.defineProperty(c.prototype,"enabled",{get:function(){return void 0!==this.experimentConfig},enumerable:!1,configurable:!0});c.prototype._isValidResult=function(b,a){void 0===a&&(a=function(){return!0});return a()&&M.isValidABGroupLocalStorageValue(b)};
return c}());var ma=function(){function c(b){var a=this,d,e;this.siteExperiments=[];this._clsOptions=b;this._device=E()?"mobile":"desktop";this.siteExperiments=null!==(e=null===(d=this._clsOptions.siteAds.siteExperiments)||void 0===d?void 0:d.filter(function(f){var g=f.key;var h=a._device;if(f){var k=!!f.enabled,l=null==f.dateStart||Date.now()>=f.dateStart,p=null==f.dateEnd||Date.now()<=f.dateEnd,m=null===f.selector||""!==f.selector&&!!document.querySelector(f.selector),t="mobile"===f.platform&&"mobile"===
h;h="desktop"===f.platform&&"desktop"===h;t=null===f.platform||"all"===f.platform||t||h;(h="bernoulliTrial"===f.experimentType?1===f.variants.length:wa(f.variants))||q.error("SiteTest","validateSiteExperiment","experiment presented invalid choices for key:",f.key,f.variants);f=k&&l&&p&&m&&t&&h}else f=!1;a:switch(k=a._clsOptions.siteAds,g){case C.AdDensity:var n=ua(k,a._device);break a;case C.StickyOutstream:var x,A;n=(g=null===(A=null===(x=null===(n=k.videoPlayers)||void 0===n?void 0:n.partners)||
void 0===x?void 0:x.stickyOutstream)||void 0===A?void 0:A.blockedPageSelectors)?!document.querySelector(g):!0;break a;case C.Interstitial:n=(n=k.adOptions.interstitialBlockedPageSelectors)?!document.querySelector(n):!0;break a;default:n=!0}return f&&n}))&&void 0!==e?e:[]}c.prototype.getSiteExperimentByKey=function(b){var a=this.siteExperiments.filter(function(f){return f.key.toLowerCase()===b.toLowerCase()})[0],d=ya("at_site_features"),e=typeof((null===a||void 0===a?0:a.variants[1])?null===a||void 0===
a?void 0:a.variants[1].value:null===a||void 0===a?void 0:a.variants[0].value)===typeof d[b];a&&d[b]&&e&&(a.variants=[{displayName:"test",value:d[b],weight:100,id:0}]);return a};return c}(),Sa=function(c){function b(a){var d=c.call(this)||this;d._choices=[];d._mappedChoices=[];d._result="";d._resultValidator=function(e){return"string"===typeof e};d.key=C.AdLayout;d.abgroup=C.AdLayout;d._clsSiteExperiments=new ma(a);d.experimentConfig=d._clsSiteExperiments.getSiteExperimentByKey(d.key);d.enabled&&d.experimentConfig&&
(d._choices=d.experimentConfig.variants,d._mappedChoices=d._mapChoices(),d._result=d.run(),a.setWeightedChoiceExperiment(d.abgroup,d._result,!0));return d}v(b,c);Object.defineProperty(b.prototype,"result",{get:function(){return this._result},enumerable:!1,configurable:!0});b.prototype.run=function(){if(!this.enabled)return q.error("CLSAdLayoutSiteExperiment","run","() => %o","No experiment config found. Defaulting to empty class name."),"";var a=(new R(this._mappedChoices)).get();if(this._isValidResult(a))return a;
q.error("CLSAdLayoutSiteExperiment","run","() => %o","Invalid result from experiment choices. Defaulting to empty class name.");return""};b.prototype._mapChoices=function(){return this._choices.map(function(a){return{weight:a.weight,choice:a.value}})};I([la(),B("design:type",Function),B("design:paramtypes",[]),B("design:returntype",void 0)],b.prototype,"run",null);return b}(D),Ta=function(c){function b(a){var d=c.call(this)||this;d._choices=[];d._mappedChoices=[];d._result="control";d._resultValidator=
function(e){return"number"===typeof e};d.key=C.AdDensity;d.abgroup=C.AdDensity;d._clsSiteExperiments=new ma(a);d.experimentConfig=d._clsSiteExperiments.getSiteExperimentByKey(d.key);d.enabled&&d.experimentConfig&&(d._choices=d.experimentConfig.variants,d._mappedChoices=d._mapChoices(),d._result=d.run(),a.setWeightedChoiceExperiment(d.abgroup,d._result,!0));return d}v(b,c);Object.defineProperty(b.prototype,"result",{get:function(){return this._result},enumerable:!1,configurable:!0});b.prototype.run=
function(){if(!this.enabled)return q.error("CLSTargetAdDensitySiteExperiment","run","() => %o","No experiment config found. Defaulting to control."),"control";var a=(new R(this._mappedChoices)).get();if(this._isValidResult(a))return a;q.error("CLSTargetAdDensitySiteExperiment","run","() => %o","Invalid result from experiment choices. Defaulting to control.");return"control"};b.prototype._mapChoices=function(){return this._choices.map(function(a){var d=a.value;return{weight:a.weight,choice:"number"===
typeof d?(d||0)/100:"control"}})};I([la(),B("design:type",Function),B("design:paramtypes",[]),B("design:returntype",void 0)],b.prototype,"run",null);return b}(D),Ua=function(c){function b(){var a=c.call(this)||this;a._result=!1;a.abgroup="scae";a.key="StickyContainerAds";a._choices=[{choice:!0},{choice:!1}];a.weight=.99;a._result=a.run();a.setExperimentKey();return a}v(b,c);Object.defineProperty(b.prototype,"result",{get:function(){return this._result},enumerable:!1,configurable:!0});b.prototype.run=
function(){return(new H(this.weight)).get()};return b=I([P("StickyContainerAdsExperiment"),B("design:paramtypes",[])],b)}(z),Va=function(c){function b(){var a=c.call(this)||this;a._result=!1;a.abgroup="scre";a.key="StickyContainerRecipe";a._choices=[{choice:!0},{choice:!1}];a.weight=.99;a._result=a.run();a.setExperimentKey();return a}v(b,c);Object.defineProperty(b.prototype,"result",{get:function(){return this._result},enumerable:!1,configurable:!0});b.prototype.run=function(){return(new H(this.weight)).get()};
return b=I([P("StickyContainerRecipeExperiment"),B("design:paramtypes",[])],b)}(z),Ya=function(){function c(b,a){this._clsOptions=b;this._adInjectionMap=a;this._mainContentHeight=this._recipeCount=0;this._mainContentDiv=null;this._totalAvailableElements=[];this._minDivHeight=250;this._densityDevice=J.Desktop;this._pubLog={onePerViewport:!1,targetDensity:0,targetDensityUnits:0,combinedMax:0};this._densityMax=.99;this._smallerIncrementAttempts=0;this._absoluteMinimumSpacingByDevice=250;this._usedAbsoluteMinimum=
!1;this._infPageEndOffset=0;this.locationMaxLazySequence=new Map([["Recipe",5]]);this.locationToMinHeight={Below_Post:"250px",Content:"250px",Recipe:"250px",Sidebar:"250px"};a=this._clsOptions.siteAds.breakpoints;var d=a.tablet;var e=window.innerWidth;a=e>=a.desktop?"desktop":e>=d?"tablet":"phone";this._device=a;this._config=new Na(b);this._clsOptions.enabledLocations=this._config.enabledLocations;this._clsTargetAdDensitySiteExperiment=this._clsOptions.siteAds.siteExperiments?new Ta(this._clsOptions):
null;this._stickyContainerAdsExperiment=new Ua;this._stickyContainerRecipeExperiment=new Va;this._removeRecipeCapExperiment=new Qa}c.prototype.start=function(){var b=this,a,d,e,f;try{Oa(this._device);var g=new Sa(this._clsOptions);if(g.enabled){var h=g.result,k=h.startsWith(".")?h.substring(1):h;if(/^[-_a-zA-Z]+[-_a-zA-Z0-9]*$/.test(k))try{document.body.classList.add(k)}catch(m){q.error("ClsDynamicAdsInjector","start","Uncaught CSS Class error: ".concat(m))}else q.error("ClsDynamicAdsInjector","start",
"Invalid class name: ".concat(k))}var l=Ma(this._device,this._clsOptions.siteAds).filter(function(m){return b._locationEnabled(m)}).filter(function(m){return m.devices.includes(b._device)}).filter(function(m){return 0===m.pageSelector.length||null!==document.querySelector(m.pageSelector)}),p=this.inject(l);(null===(d=null===(a=this._clsOptions.siteAds.adOptions.stickyContainerConfig)||void 0===a?void 0:a.content)||void 0===d?0:d.enabled)&&this._stickyContainerAdsExperiment.result&&!ka(this._clsOptions.siteAds.adOptions.stickyContainerConfig.blockedSelectors||
[])&&Pa(null===(f=null===(e=this._clsOptions.siteAds.adOptions.stickyContainerConfig)||void 0===e?void 0:e.content)||void 0===f?void 0:f.minHeight);p.forEach(function(m){return b._clsOptions.setInjectedSlots(m)})}catch(m){q.error("ClsDynamicAdsInjector","start",m)}};c.prototype.inject=function(b,a){void 0===a&&(a=document);this._densityDevice="desktop"===this._device?J.Desktop:J.Mobile;this._overrideDefaultAdDensitySettingsWithSiteExperiment();var d=this._clsOptions.siteAds,e=u(d.adDensityEnabled,
!0),f=d.adDensityLayout&&e;d=b.filter(function(g){return f?"Content"!==g.location:g});b=b.filter(function(g){return f?"Content"===g.location:null});return w(w([],r(d.length?this._injectNonDensitySlots(d,a):[]),!1),r(b.length?this._injectDensitySlots(b,a):[]),!1)};c.prototype._injectNonDensitySlots=function(b,a){var d,e=this,f,g,h;void 0===a&&(a=document);var k=[],l=[];this._stickyContainerRecipeExperiment.result&&b.some(function(n){return"Recipe"===n.location&&n.sticky})&&!ka((null===(f=this._clsOptions.siteAds.adOptions.stickyContainerConfig)||
void 0===f?void 0:f.blockedSelectors)||[])&&(f=this._clsOptions.siteAds.adOptions.stickyContainerConfig,f="phone"===this._device?null===(g=null===f||void 0===f?void 0:f.recipeMobile)||void 0===g?void 0:g.minHeight:null===(h=null===f||void 0===f?void 0:f.recipeDesktop)||void 0===h?void 0:h.minHeight,T("\n .adthrive-recipe.adthrive-sticky {\n position: -webkit-sticky;\n position: sticky !important;\n top: 42px !important;\n margin-top: 42px !important;\n }\n .adthrive-recipe-sticky-container {\n position: relative;\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: center;\n min-height:".concat(f?
f:400,"px !important;\n margin: 10px 0 10px 0;\n background-color: #FAFAFA;\n padding-bottom:0px;\n }\n ")));try{for(var p=L(b),m=p.next();!m.done;m=p.next())this._insertNonDensityAds(m.value,k,l,a)}catch(n){var t={error:n}}finally{try{m&&!m.done&&(d=p.return)&&d.call(p)}finally{if(t)throw t.error;}}l.forEach(function(n){n.element.style.minHeight=e.locationToMinHeight[n.location]});return k};c.prototype._injectDensitySlots=function(b,a){void 0===a&&(a=document);try{this._calculateMainContentHeightAndAllElements(b,
a)}catch(h){return[]}var d=this._getDensitySettings(b,a);b=d.onePerViewport;var e=d.targetAll,f=d.targetDensityUnits,g=d.combinedMax;d=d.numberOfUnits;this._absoluteMinimumSpacingByDevice=b?window.innerHeight:this._absoluteMinimumSpacingByDevice;if(!d)return[];this._adInjectionMap.filterUsed();this._findElementsForAds(d,b,e,g,f,a);return this._insertAds()};c.prototype._overrideDefaultAdDensitySettingsWithSiteExperiment=function(){var b;if(null===(b=this._clsTargetAdDensitySiteExperiment)||void 0===
b?0:b.enabled)b=this._clsTargetAdDensitySiteExperiment.result,"number"===typeof b&&(this._clsOptions.siteAds.adDensityEnabled=!0,this._clsOptions.siteAds.adDensityLayout[this._densityDevice].adDensity=b)};c.prototype._getDensitySettings=function(b,a){void 0===a&&(a=document);var d=this._clsOptions.siteAds.adDensityLayout,e=this._determineOverrides(d.pageOverrides);e=e.length?e[0]:d[this._densityDevice];d=this._clsOptions.getTargetDensity(e.adDensity);e=e.onePerViewport;var f=this._shouldTargetAllEligible(d),
g=this._getTargetDensityUnits(d,f);b=this._getCombinedMax(b,a);a=Math.min.apply(Math,w([],r(w([this._totalAvailableElements.length,g],r(0=this._mainContentHeight&&1h._smallerIncrementAttempts&&(++h._smallerIncrementAttempts,k(h._getSmallerIncrement(l)))};b=this._getInsertEvery(b,a,f);k(b)};c.prototype._getSmallerIncrement=function(b){b*=.6;b<=this._absoluteMinimumSpacingByDevice&&(b=this._absoluteMinimumSpacingByDevice,this._usedAbsoluteMinimum=
!0);return b};c.prototype._insertNonDensityAds=function(b,a,d,e){void 0===e&&(e=document);var f=0,g=0,h=0;0k.length)return"break";var x=l[n];if(0=b.sequence?"adthrive-sticky-sidebar":"",m._stickyContainerRecipeExperiment.result&&"Recipe"===b.location&&b.sticky?"adthrive-recipe-sticky-container":"",K,Xa],r(b.classNames),!1);if(x=m.addAd(x,F,b.position,K))F=ia(n,x),F.length&&(a.push({clsDynamicAd:b,dynamicAd:n,element:x,sizes:F,name:A,infinite:e!==document}),d.push({location:n.location,element:x}),"Recipe"===b.location&&++m._recipeCount,h+=1)},m=this,t=b.skip;th;g.sequence=e;g.lazy=h;if(f=b._addContentAd(f,g,d))g.used=!0,a.push(f)});return a};c.prototype._getInsertEvery=function(b,a,d){this._moreAvailableElementsThanUnitsToInject(d,b)?(this._usedAbsoluteMinimum=!1,b=this._useWiderSpacing(d,b)):(this._usedAbsoluteMinimum=!0,b=this._useSmallestSpacing(a));return a&&window.innerHeight>
b?window.innerHeight:b};c.prototype._useWiderSpacing=function(b,a){return this._mainContentHeight/Math.min(b,a)};c.prototype._useSmallestSpacing=function(b){return b&&window.innerHeight>this._absoluteMinimumSpacingByDevice?window.innerHeight:this._absoluteMinimumSpacingByDevice};c.prototype._moreAvailableElementsThanUnitsToInject=function(b,a){return this._totalAvailableElements.length>b||this._totalAvailableElements.length>a};c.prototype._logDensityInfo=function(b,a,d){b=this._pubLog;b.onePerViewport;
b.targetDensity;b.combinedMax};c.prototype._checkElementSpacing=function(b){var a=b.dynamicAd,d=b.element,e=b.insertEvery,f=b.targetAll;b=b.target;b=void 0===b?document:b;(this._isFirstAdInjected()||this._hasProperSpacing(d,a,f,e))&&this._markSpotForContentAd(d,y({},a),b)};c.prototype._isFirstAdInjected=function(){return!this._adInjectionMap.map.length};c.prototype._markSpotForContentAd=function(b,a,d){void 0===d&&(d=document);this._adInjectionMap.add(b,this._getElementCoords(b,"beforebegin"===a.position||
"afterbegin"===a.position),a,d);this._adInjectionMap.sort()};c.prototype._hasProperSpacing=function(b,a,d,e){var f="beforebegin"===a.position||"afterbegin"===a.position;a="beforeend"===a.position||"afterbegin"===a.position;d=d||this._isElementFarEnoughFromOtherAdElements(b,e,f);f=a||this._isElementNotInRow(b,f);b=-1===b.id.indexOf("AdThrive_".concat("Below_Post"));return d&&f&&b};c.prototype._isElementFarEnoughFromOtherAdElements=function(b,a,d){b=this._getElementCoords(b,d);var e=!1;for(d=0;dthis._adInjectionMap.map[d].coords&&(!e||b+a'),b.insertAdjacentHTML(d,e));return document.getElementById(a)};c.prototype._repeatDynamicAds=function(b){var a=
[],d=this._removeRecipeCapExperiment.result&&"Recipe"===b.location?99:this.locationMaxLazySequence.get(b.location),e=b.lazy?u(d,0):0;d=b.max;var f=b.lazyMax;e=Math.max(d,0===e&&b.lazy?d+f:Math.min(Math.max(e-b.sequence+1,0),d+f));for(f=0;f