alue=function(...e){return ke(this,()=>r.apply(this,e))})},Ae=(e=window.location.search)=>{let t=e.indexOf(`?`)===0?1:0;return e.slice(t).split(`&`).reduce((e,t)=>{let[n,r]=t.split(`=`);return e.set(n,r),e},new Map)},je=e=>{let t={},n=Ae().get(e);if(n)try{let r=decodeURIComponent(n).replace(/\+/g,``);t=JSON.parse(r),T.event(`ExperimentOverridesUtil`,`getExperimentOverrides`,e,t)}catch(e){e instanceof URIError}return t},Me=(e,t)=>typeof e==typeof t,Ne=(e,t)=>{let n=e.adDensityEnabled,r=e.adDensityLayout.pageOverrides.find(e=>!!document.querySelector(e.pageSelector)&&(e[t].onePerViewport||typeof e[t].adDensity==`number`));return n?!r:!0},Pe=e=>{var t;let n=(t=e.videoPlayers)==null||(t=t.partners)==null||(t=t.stickyOutstream)==null?void 0:t.blockedPageSelectors;return n?!document.querySelector(n):!0},Fe=e=>{let t=e.adOptions.interstitialBlockedPageSelectors;return t?!document.querySelector(t):!0},Ie=(e,t,n)=>{switch(t){case V.AdDensity:return Ne(e,n);case V.StickyOutstream:return Pe(e);case V.Interstitial:return Fe(e);default:return!0}},Le=e=>e.length===1,Re=e=>{let t=e.reduce((e,t)=>t.weight?t.weight+e:e,0);return e.length>0&&e.every(e=>{let t=e.value,n=e.weight;return!!(t!=null&&!(typeof t==`number`&&isNaN(t))&&n)})&&t===100},ze=(e,t)=>{if(!e)return!1;let n=!!e.enabled,r=e.dateStart==null||Date.now()>=e.dateStart,i=e.dateEnd==null||Date.now()<=e.dateEnd,a=e.selector===null||e.selector!==``&&!!document.querySelector(e.selector),o=e.platform===`mobile`&&t===`mobile`,s=e.platform===`desktop`&&t===`desktop`,c=e.platform===null||e.platform===`all`||o||s,l=e.experimentType===`bernoulliTrial`?Le(e.variants):Re(e.variants);return l||T.error(`SiteTest`,`validateSiteExperiment`,`experiment presented invalid choices for key:`,e.key,e.variants),n&&r&&i&&a&&c&&l};var W=class{constructor(e){var t,n;s(this,`siteExperiments`,[]),s(this,`_clsOptions`,void 0),s(this,`_device`,void 0),this._clsOptions=e,this._device=u()?`mobile`:`desktop`,this.siteExperiments=(t=(n=this._clsOptions.siteAds.siteExperiments)==null?void 0:n.filter(e=>{let t=e.key,n=ze(e,this._device),r=Ie(this._clsOptions.siteAds,t,this._device);return n&&r}))==null?[]:t}getSiteExperimentByKey(e){let t=this.siteExperiments.filter(t=>t.key.toLowerCase()===e.toLowerCase())[0],n=je(`at_site_features`),r=Me(t!=null&&t.variants[1]?t==null?void 0:t.variants[1].value:t==null?void 0:t.variants[0].value,n[e]);return t&&n[e]&&r&&(t.variants=[{displayName:`test`,value:n[e],weight:100,id:0}]),t}},Be=class{constructor(){s(this,`experimentConfig`,void 0)}get enabled(){return this.experimentConfig!==void 0}_isValidResult(e,t=()=>!0){return t()&&Oe(e)}},G=class extends Be{constructor(...e){super(...e),s(this,`_resultValidator`,()=>!0)}_isValidResult(e){return super._isValidResult(e,()=>this._resultValidator(e)||e===`control`)}run(){if(!this.enabled)return T.error(`CLSWeightedChoiceSiteExperiment`,`run`,`() => %o`,`No experiment config found. Defaulting to control.`),`control`;if(!this._mappedChoices||this._mappedChoices.length===0)return T.error(`CLSWeightedChoiceSiteExperiment`,`run`,`() => %o`,`No experiment variants found. Defaulting to control.`),`control`;let e=new B(this._mappedChoices).get();return this._isValidResult(e)?e:(T.error(`CLSWeightedChoiceSiteExperiment`,`run`,`() => %o`,`Invalid result from experiment choices. Defaulting to control.`),`control`)}};function K(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var q=class extends G{constructor(e){super(),s(this,`_choices`,[]),s(this,`_mappedChoices`,[]),s(this,`_result`,``),s(this,`_clsSiteExperiments`,void 0),s(this,`_resultValidator`,e=>typeof e==`string`),s(this,`key`,V.AdLayout),s(this,`abgroup`,V.AdLayout),this._clsSiteExperiments=new W(e),this.experimentConfig=this._clsSiteExperiments.getSiteExperimentByKey(this.key),this.enabled&&this.experimentConfig&&(this._choices=this.experimentConfig.variants,this._mappedChoices=this._mapChoices(),this._result=this.run(),e.setWeightedChoiceExperiment(this.abgroup,this._result,!0))}get result(){return this._result}run(){if(!this.enabled)return T.error(`CLSAdLayoutSiteExperiment`,`run`,`() => %o`,`No experiment config found. Defaulting to empty class name.`),``;let e=new B(this._mappedChoices).get();return this._isValidResult(e)?e:(T.error(`CLSAdLayoutSiteExperiment`,`run`,`() => %o`,`Invalid result from experiment choices. Defaulting to empty class name.`),``)}_mapChoices(){return this._choices.map(({weight:e,value:t})=>({weight:e,choice:t}))}};K([U()],q.prototype,`run`,null);var J=class extends G{constructor(e){super(),s(this,`_choices`,[]),s(this,`_mappedChoices`,[]),s(this,`_result`,`control`),s(this,`_clsSiteExperiments`,void 0),s(this,`_resultValidator`,e=>typeof e==`number`),s(this,`key`,V.AdDensity),s(this,`abgroup`,V.AdDensity),this._clsSiteExperiments=new W(e),this.experimentConfig=this._clsSiteExperiments.getSiteExperimentByKey(this.key),this.enabled&&this.experimentConfig&&(this._choices=this.experimentConfig.variants,this._mappedChoices=this._mapChoices(),this._result=this.run(),e.setWeightedChoiceExperiment(this.abgroup,this._result,!0))}get result(){return this._result}run(){if(!this.enabled)return T.error(`CLSTargetAdDensitySiteExperiment`,`run`,`() => %o`,`No experiment config found. Defaulting to control.`),`control`;let e=new B(this._mappedChoices).get();return this._isValidResult(e)?e:(T.error(`CLSTargetAdDensitySiteExperiment`,`run`,`() => %o`,`Invalid result from experiment choices. Defaulting to control.`),`control`)}_mapChoices(){return this._choices.map(({weight:e,value:t})=>({weight:e,choice:typeof t==`number`?(t||0)/100:`control`}))}};K([U()],J.prototype,`run`,null);let Y=`250px`;var Ve=class{constructor(t,n){this._clsOptions=t,this._adInjectionMap=n,s(this,`_recipeCount`,0),s(this,`_mainContentHeight`,0),s(this,`_mainContentDiv`,null),s(this,`_totalAvailableElements`,[]),s(this,`_minDivHeight`,250),s(this,`_densityDevice`,E.Desktop),s(this,`_pubLog`,{onePerViewport:!1,targetDensity:0,targetDensityUnits:0,combinedMax:0}),s(this,`_densityMax`,.99),s(this,`_smallerIncrementAttempts`,0),s(this,`_absoluteMinimumSpacingByDevice`,250),s(this,`_usedAbsoluteMinimum`,!1),s(this,`_infPageEndOffset`,0),s(this,`locationMaxLazySequence`,new Map([[e.Recipe,5]])),s(this,`locationToMinHeight`,{Below_Post:Y,Content:Y,Recipe:Y,Sidebar:Y}),s(this,`_device`,void 0),s(this,`_clsTargetAdDensitySiteExperiment`,void 0);let{tablet:r,desktop:i}=this._clsOptions.siteAds.breakpoints;this._device=de(r,i),this._clsTargetAdDensitySiteExperiment=this._clsOptions.siteAds.siteExperiments?new J(this._clsOptions):null}start(){try{var e;ue(this._device);let n=new q(this._clsOptions);if(n.enabled){let e=n.result,t=e.startsWith(`.`)?e.substring(1):e;if(ye(t))try{document.body.classList.add(t)}catch(e){T.error(`ClsDynamicAdsInjector`,`start`,`Uncaught CSS Class error: ${e}`)}else T.error(`ClsDynamicAdsInjector`,`start`,`Invalid class name: ${t}`)}let r=se(this._device,this._clsOptions.siteAds).filter(e=>this._locationEnabled(e)).filter(e=>ce(e,this._device)).filter(e=>le(e)),i=this.inject(r),a=this._clsOptions.siteAds.adOptions.stickyContainerConfig;if(!(a==null||(e=a.content)==null)&&e.enabled&&!F(a.blockedSelectors||[])){var t;N(a==null||(t=a.content)==null?void 0:t.minHeight)}i.forEach(e=>this._clsOptions.setInjectedSlots(e))}catch(e){T.error(`ClsDynamicAdsInjector`,`start`,e)}}inject(t,n=document){this._densityDevice=this._device===`desktop`?E.Desktop:E.Mobile,this._overrideDefaultAdDensitySettingsWithSiteExperiment();let r=this._clsOptions.siteAds,i=f(r.adDensityEnabled,!0),a=r.adDensityLayout&&i,o=t.filter(t=>a?t.location!==e.Content:t),s=t.filter(t=>a?t.location===e.Content:null);return this._capturePreSlotInsertionPageAreaMeasurement(),[...o.length?this._injectNonDensitySlots(o,n):[],...s.length?this._injectDensitySlots(s,n):[]]}_injectNonDensitySlots(t,n=document){var r;let i=[],a=[],o=!1;if(t.some(t=>t.location===e.Recipe&&t.sticky)&&!F(((r=this._clsOptions.siteAds.adOptions.stickyContainerConfig)==null?void 0:r.blockedSelectors)||[])){var s,c;let e=this._clsOptions.siteAds.adOptions.stickyContainerConfig,t=this._device===`phone`?e==null||(s=e.recipeMobile)==null?void 0:s.minHeight:e==null||(c=e.recipeDesktop)==null?void 0:c.minHeight;P(t),o=!0}for(let e of t)this._insertNonDensityAds(e,i,a,n);return o||a.forEach(({location:e,element:t})=>{t.style.minHeight=this.locationToMinHeight[e]}),i}_injectDensitySlots(e,t=document){try{this._calculateMainContentHeightAndAllElements(e,t),this._capturePreSlotInsertionMainContentMeasurement()}catch(e){return[]}let{onePerViewport:n,targetAll:r,targetDensityUnits:i,combinedMax:a,numberOfUnits:o}=this._getDensitySettings(e,t);return this._absoluteMinimumSpacingByDevice=n?window.innerHeight:this._absoluteMinimumSpacingByDevice,o?(this._adInjectionMap.filterUsed(),this._findElementsForAds(o,n,r,a,i,t),this._insertAds()):[]}_overrideDefaultAdDensitySettingsWithSiteExperiment(){var e;if((e=this._clsTargetAdDensitySiteExperiment)!=null&&e.enabled){let e=this._clsTargetAdDensitySiteExperiment.result;typeof e==`number`&&(this._clsOptions.siteAds.adDensityEnabled=!0,this._clsOptions.siteAds.adDensityLayout[this._densityDevice].adDensity=e)}}_getDensitySettings(e,t=document){let n=this._clsOptions.siteAds.adDensityLayout,r=this._determineOverrides(n.pageOverrides),i=r.length?r[0]:n[this._densityDevice],a=i.adDensity,o=i.onePerViewport,s=this._shouldTargetAllEligible(a),c=this._getTargetDensityUnits(a,s),l=this._getCombinedMax(e,t),u=Math.min(this._totalAvailableElements.length,c,...l>0?[l]:[]);return this._pubLog={onePerViewport:o,targetDensity:a,targetDensityUnits:c,combinedMax:l},{onePerViewport:o,targetAll:s,targetDensityUnits:c,combinedMax:l,numberOfUnits:u}}_determineOverrides(e){return e.filter(e=>{let t=z(e.pageSelector);return e.pageSelector===``||t.elements&&t.elements.length}).map(e=>e[this._densityDevice])}_shouldTargetAllEligible(e){return e===this._densityMax}_getTargetDensityUnits(e,t){return t?this._totalAvailableElements.length:Math.floor(e*this._mainContentHeight/(1-e)/this._minDivHeight)-this._recipeCount}_getCombinedMax(e,t=document){return f(e.filter(e=>{let n;try{n=t.querySelector(e.elementSelector)}catch(e){}return n}).map(e=>Number(e.max)+Number(e.lazyMaxDefaulted?0:e.lazyMax)).sort((e,t)=>t-e)[0],0)}_elementLargerThanMainContent(e){return e.offsetHeight>=this._mainContentHeight&&this._totalAvailableElements.length>1}_elementDisplayNone(e){let t=window.getComputedStyle(e,null).display;return t&&t===`none`||e.style.display===`none`}_isBelowMaxes(e,t){return this._adInjectionMap.map.length{for(let{dynamicAd:t,element:o}of this._totalAvailableElements){if(this._logDensityInfo(o,t.elementSelector,e),!n&&this._elementLargerThanMainContent(o)||this._elementDisplayNone(o))continue;if(this._isBelowMaxes(r,i))this._checkElementSpacing({dynamicAd:t,element:o,insertEvery:e,targetAll:n,target:a});else break}!this._usedAbsoluteMinimum&&this._smallerIncrementAttempts<5&&(++this._smallerIncrementAttempts,o(this._getSmallerIncrement(e)))},s=this._getInsertEvery(e,t,i);o(s)}_getSmallerIncrement(e){let t=e*.6;return t<=this._absoluteMinimumSpacingByDevice&&(t=this._absoluteMinimumSpacingByDevice,this._usedAbsoluteMinimum=!0),t}_insertNonDensityAds(t,n,r,i=document){let a=0,o=0,s=0;t.spacing>0&&(a=window.innerHeight*t.spacing,o=a);let c=this._repeatDynamicAds(t),l=this.getElements(t.elementSelector,i);t.skip;for(let u=t.skip;uc.length);u+=t.every){let d=l[u];if(a>0){let{bottom:e}=fe(d);if(e<=o)continue;o=e+a}let f=c[s],p=`${f.location}_${f.sequence}`;n.some(e=>e.name===p)&&(s+=1);let m=this.getDynamicElementId(f),h=D(t),g=O(t),_=t.location===e.Sidebar&&t.sticky&&t.sequence&&t.sequence<=5?`adthrive-sticky-sidebar`:``,v=t.location===e.Recipe&&t.sticky?`adthrive-recipe-sticky-container`:``,y=[_,v,h,g,...t.classNames];if(be(d,t.position,t.location)&&t.location===e.Recipe)continue;let b=this.addAd(d,m,t.position,y);if(b){let a=w(f,b);if(a.length){let o={clsDynamicAd:t,dynamicAd:f,element:b,sizes:a,name:p,infinite:i!==document};n.push(o),r.push({location:f.location,element:b}),t.location===e.Recipe&&++this._recipeCount,s+=1}d=b}}}_insertAds(){let e=[],t=0;return this._adInjectionMap.filterUsed(),this._adInjectionMap.map.forEach(({el:n,dynamicAd:r,target:i},a)=>{let o=Number(r.sequence)+a,s=r.max,c=r.lazy&&o>s;r.sequence=o,r.lazy=c;let l=this._addContentAd(n,r,i);l&&(r.used=!0,e.push(l),++t)}),e}_getInsertEvery(e,t,n){let r=this._absoluteMinimumSpacingByDevice;return this._moreAvailableElementsThanUnitsToInject(n,e)?(this._usedAbsoluteMinimum=!1,r=this._useWiderSpacing(n,e)):(this._usedAbsoluteMinimum=!0,r=this._useSmallestSpacing(t)),t&&window.innerHeight>r?window.innerHeight:r}_useWiderSpacing(e,t){return this._mainContentHeight/Math.min(e,t)}_useSmallestSpacing(e){return e&&window.innerHeight>this._absoluteMinimumSpacingByDevice?window.innerHeight:this._absoluteMinimumSpacingByDevice}_moreAvailableElementsThanUnitsToInject(e,t){return this._totalAvailableElements.length>e||this._totalAvailableElements.length>t}_logDensityInfo(e,t,n){let{onePerViewport:r,targetDensity:i,targetDensityUnits:a,combinedMax:o}=this._pubLog;this._totalAvailableElements.length}_checkElementSpacing({dynamicAd:e,element:t,insertEvery:n,targetAll:r,target:i=document}){(this._isFirstAdInjected()||this._hasProperSpacing(t,e,r,n))&&this._markSpotForContentAd(t,L({},e),i)}_isFirstAdInjected(){return!this._adInjectionMap.map.length}_markSpotForContentAd(e,t,n=document){let r=t.position===`beforebegin`||t.position===`afterbegin`;this._adInjectionMap.addSorted(e,this._getElementCoords(e,r),t,n)}_hasProperSpacing(t,n,r,i){let a=n.position===`beforebegin`||n.position===`afterbegin`,o=n.position===`beforeend`||n.position===`afterbegin`,s=r||this._isElementFarEnoughFromOtherAdElements(t,i,a),c=o||this._isElementNotInRow(t,a),l=t.id.indexOf(`AdThrive_${e.Below_Post}`)===-1;return s&&c&&l}_isElementFarEnoughFromOtherAdElements(e,t,n){let r=this._getElementCoords(e,n),[i,a]=this._adInjectionMap.findNeighborIndices(r),o=i===null?void 0:this._adInjectionMap.map[i].coords,s=a===null?void 0:this._adInjectionMap.map[a].coords;return(o===void 0||r-t>o)&&(s===void 0||r+t`;e.insertAdjacentHTML(n,i)}return document.getElementById(t)}_repeatDynamicAds(t){let n=[],r=t.location===e.Recipe?99:this.locationMaxLazySequence.get(t.location),i=t.lazy?f(r,0):0,a=t.max,o=t.lazyMax,s=i===0&&t.lazy?a+o:Math.min(Math.max(i-t.sequence+1,0),a+o),c=Math.max(a,s);for(let e=0;e=a,o=r;t.name===`Recipe_1`&&r>=5&&(o=r+1),n.push(L(L({},t),{},{sequence:o,lazy:i}))}return n}_locationEnabled(e){let t=this._clsOptions.enabledLocations.includes(e.location),n=this._clsOptions.disableAds&&this._clsOptions.disableAds.all||document.body.classList.contains(`adthrive-disable-all`),r=!document.body.classList.contains(`adthrive-disable-content`)&&!this._clsOptions.disableAds.reasons.has(`content_plugin`);return t&&!n&&r}},He=class{constructor(){s(this,`_map`,[])}add(e,t,n,r=document){this._map.push({el:e,coords:t,dynamicAd:n,target:r})}addSorted(e,t,n,r=document){let i=this._upperBoundIndex(t);this._map.splice(i,0,{el:e,coords:t,dynamicAd:n,target:r})}get map(){return this._map}sort(){this._map.sort(({coords:e},{coords:t})=>e-t)}filterUsed(){this._map=this._map.filter(({dynamicAd:e})=>!e.used)}findNeighborIndices(e){let t=this._upperBoundIndex(e),n=t-1>=0?t-1:null,r=t>>1;this._map[r].coords<=e?t=r+1:n=r}return t}reset(){this._map=[]}},Ue=class extends He{};let X=l((e=navigator.userAgent)=>/(Windows NT|Macintosh|X11;[^)]*(Linux|CrOS))/i.test(e)),Z=()=>{let e=u()?`mobile`:`tablet`;return X(h)?`desktop`:e},We=e=>{let t=v(),n=Z(),r=e.siteAdsProfiles,i=null;if(r&&r.length)for(let e of r){let r=e.targeting.device,a=e.targeting.browserEngine,o=r&&r.length&&r.includes(n),s=a&&a.length&&a.includes(t);o&&s&&(i=e)}return i},Ge=e=>{let t=We(e);if(t){let e=t.profileId;document.body.classList.add(`raptive-profile-${e}`)}},Q={Video_Collapse_Autoplay_SoundOff:`Video_Collapse_Autoplay_SoundOff`,Video_Individual_Autoplay_SOff:`Video_Individual_Autoplay_SOff`,Video_Coll_SOff_Smartphone:`Video_Coll_SOff_Smartphone`,Video_In_Post_ClicktoPlay_SoundOn:`Video_In-Post_ClicktoPlay_SoundOn`,Video_Collapse_Autoplay_SoundOff_15s:`Video_Collapse_Autoplay_SoundOff_15s`,Video_Individual_Autoplay_SOff_15s:`Video_Individual_Autoplay_SOff_15s`,Video_Coll_SOff_Smartphone_15s:`Video_Coll_SOff_Smartphone_15s`,Video_In_Post_ClicktoPlay_SoundOn_15s:`Video_In-Post_ClicktoPlay_SoundOn_15s`};var Ke=class{get enabled(){return!0}};function qe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function $(e,t){if(e==null)return{};var n,r,i=qe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;re.type===`stationaryRelated`&&e.enabled),this._potentialPlayerMap=t,this._potentialPlayerMap}_filterPlayerMap(){let e=this._videoConfig.players,t={stickyRelated:[],stickyPlaylist:[],stationaryRelated:[]};return e&&e.length?e.filter(e=>{var t;return(t=e.devices)==null?void 0:t.includes(this._device)}).reduce((e,t)=>(e[t.type]||(T.event(this._component,`constructor`,`Unknown Video Player Type detected`,t.type),e[t.type]=[]),t.enabled&&e[t.type].push(t),e),t):t}_checkPlayerSelectorOnPage(e){for(let t of this._potentialPlayerMap[e]){let e=this._getPlacementElement(t);if(e)return{player:t,playerElement:e}}return{player:null,playerElement:null}}_getOverrideElement(e,t,n){if(e&&t){let r=document.createElement(`div`);t.insertAdjacentElement(e.position,r),n=r}else{let{player:e,playerElement:t}=this._checkPlayerSelectorOnPage(`stickyPlaylist`);if(e&&t){let r=document.createElement(`div`);t.insertAdjacentElement(e.position,r),n=r}}return n}_shouldOverrideElement(e){let t=e.getAttribute(`override-embed`);return t===`true`||t===`false`?t===`true`:this._videoConfig.relatedSettings?this._videoConfig.relatedSettings.overrideEmbedLocation:!1}_checkPageSelector(e,t,n=[]){return e&&t&&n.length===0?(window.location.pathname!==`/`&&T.event(`VideoUtils`,`getPlacementElement`,Error(`PSNF: ${e} does not exist on the page`)),!1):!0}_getElementSelector(e,t,n){return t&&t.length>n?t[n]:(T.event(`VideoUtils`,`getPlacementElement`,Error(`ESNF: ${e} does not exist on the page`)),null)}_getPlacementElement(e){let{pageSelector:t,elementSelector:n,skip:r}=e,i=z(t),{valid:a,elements:o}=i,s=$(i,Je),c=R(n),{valid:l,elements:u}=c,d=$(c,Ye);return t!==``&&!a?(T.error(`VideoUtils`,`getPlacementElement`,Error(`${t} is not a valid selector`),s),null):l?this._checkPageSelector(t,a,o)&&this._getElementSelector(n,u,r)||null:(T.error(`VideoUtils`,`getPlacementElement`,Error(`${n} is not a valid selector`),d),null)}_getEmbeddedPlayerType(e){let t=e.getAttribute(`data-player-type`);return(!t||t===`default`)&&(t=this._videoConfig.relatedSettings?this._videoConfig.relatedSettings.defaultPlayerType:`static`),this._stickyRelatedOnPage&&(t=`static`),t}_getMediaId(e){let t=e.getAttribute(`data-video-id`);return t?(this._relatedMediaIds.push(t),t):!1}_createRelatedPlayer(e,t,n,r){t===`collapse`?this._createCollapsePlayer(e,n):t===`static`&&this._createStaticPlayer(e,n,r)}_createCollapsePlayer(e,t){let{player:n,playerElement:r}=this._checkPlayerSelectorOnPage(`stickyRelated`),i=n||this._potentialPlayerMap.stationaryRelated[0];i&&i.playerId?(this._shouldOverrideElement(t)&&(t=this._getOverrideElement(n,r,t)),t=document.querySelector(`#cls-video-container-${e} > div`)||t,this._createStickyRelatedPlayer(L(L({},i),{},{mediaId:e}),t)):T.error(this._component,`_createCollapsePlayer`,`No video player found`)}_createStaticPlayer(e,t,n){if(this._potentialPlayerMap.stationaryRelated.length&&this._potentialPlayerMap.stationaryRelated[0].playerId){let r=this._potentialPlayerMap.stationaryRelated[0];this._createStationaryRelatedPlayer(L(L({},r),{},{mediaOrPlaylistId:e}),t,n)}else T.error(this._component,`_createStaticPlayer`,`No video player found`)}_shouldRunAutoplayPlayers(){return!!(this._isVideoAllowedOnPage()&&(this._potentialPlayerMap.stickyRelated.length||this._potentialPlayerMap.stickyPlaylist.length))}_setPlaylistMediaIdWhenStationaryOnPage(e,t){if(this._potentialPlayerMap.stationaryRelated.length&&this._potentialPlayerMap.stationaryRelated[0].playerId&&e&&e.length){let n=e[0].getAttribute(`data-video-id`);return n?L(L({},t),{},{mediaId:n}):t}return t}_determineAutoplayPlayers(e){let t=this._component,n=t===`VideoManagerComponent`,r=this._context;if(this._stickyRelatedOnPage){T.event(t,`stickyRelatedOnPage`,n&&{device:r&&r.device,isDesktop:this._device}||{});return}let{playerElement:i}=this._checkPlayerSelectorOnPage(`stickyPlaylist`),{player:a}=this._checkPlayerSelectorOnPage(`stickyPlaylist`);a&&a.playerId&&i?(a=this._setPlaylistMediaIdWhenStationaryOnPage(e,a),this._createPlaylistPlayer(a,i)):Math.random()<.01&&setTimeout(()=>{T.event(t,`noStickyPlaylist`,n&&{vendor:`none`,device:r&&r.device,isDesktop:this._device}||{})},1e3)}_initializeRelatedPlayers(e){let t=new Map;for(let n=0;n{let e=new c;!e||!e.enabled||(e.siteAds&&Ge(e.siteAds),new Ve(e,new Ue).start(),new Ze(new m(e),e).init())})()}catch(e){T.error(`CLS`,`pluginsertion-iife`,e),window.adthriveCLS&&(window.adthriveCLS.injectedFromPlugin=!1)}})();