(function() { var preEngineFunc={ preEngineJS: function (loaderParams) {document.querySelector('meta[name="type"][value="article"]')||(loaderParams.su.dy.start=3);var pageBody=getElementAttributeValueBySelector("body","class");function addPageCSS(e){var t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style"),a=document.createTextNode(e);r.type="text/css",r.styleSheet?r.styleSheet.cssText=a.nodeValue:r.appendChild(a),t.appendChild(r)}function getElementAttributeValue(e,t){var r=e.getAttribute(t);return r?r.toLowerCase():null}function getElementAttributeValueBySelector(e,t){var r=document.querySelector(e);return r?getElementAttributeValue(r,t):null}function sortByDomLocation(e){return e.sort(function(e,t){return e===t?0:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING?1:-1})}function buildYieldFunction(e,t){return r=t,function(){return e+r++};var r}pageBody&&pageBody.includes("noad")&&(loaderParams.su.dy.mi=0);var positionsStack={AUTO_INCREASE:buildYieldFunction("AUTO_INCREASE",1)};function replaceAscendingKeys(e){e=sortByDomLocation(e);for(var t=0;t1&&"/"===e[0]?t+"/Web/"+e.slice(1).replace(/\s+/g,"_"):t+"/Web/"+e.replace(/\s+/g,"_"):"/"===location.pathname?t+"/Web/top_stories":t+"/Web/home"}function getPageTargetings(){var e=[],t=getElementAttributeValueBySelector('meta[property="article:tag"]',"content");t&&(t=t.replace(/[^\w\s\,]/gi,"").split(","));var r=getElementAttributeValueBySelector('meta[name="coid"]',"value"),a=getElementAttributeValueBySelector('meta[name="type"]',"value");return t&&e.push({k:"tags",v:t}),r&&e.push({k:"coid",v:r}),a&&e.push({k:"type",v:a}),e.push({k:"view",v:window.matchMedia("(max-width: 1200)").matches?"desktop":["desktop","wide"]}),e}loaderParams.externalFlowHandler={engineInitiator:function(e,t){function r(){clearTimeout(n),t()}function a(){if("complete"===document.readyState)if(document.removeEventListener("readystatechange",a),"/pins/"===window.location.pathname){var e,t=setInterval(function(){window.top.document.querySelector("div.pin-category > div.preview > div.pin-wrap")&&(clearInterval(t),clearTimeout(e),r())},100);e=setTimeout(function(){clearInterval(t),r()},1e4)}else r()}document.addEventListener("readystatechange",a),a();var n=setTimeout(function(){document.removeEventListener("readystatechange",a),t()},2e4)},preDemand:function(e){e.filter(function(e){return["dynamic","dynamic_mc"].indexOf(e.type.toLowerCase())>-1}).forEach(function(e){return e.ref.setAttribute("data-generated-key","AUTO_INCREASE")}),replaceAscendingKeys(e.map(function(e){return e.ref}))},preFetchAsync:function(e,t,r,a,n){if(("header_bidding"===t.providerName||"dfp"===t.providerName)&&(r.kv=(r.kv||[]).concat(getPageTargetings()),"api"!==e.type||e.options&&!e.options.adUnit)){var o="header_bidding"===e.providerName?r.c.d:r.c;r.kv.push({k:"pos",v:e.ref.getAttribute("data-generated-key")}),o.au=getAdUnit()}a()},postFetch:function(e,t){var r=!1;if(["right","left"].includes(e.selectedSize.selectedEmbedding)){r=!0;var a=e.browsiAd.wrapper.style.getPropertyValue("float"),n=e.browsiAd.wrapper.style.getPropertyValue("margin-right"),o=e.browsiAd.wrapper.style.getPropertyValue("margin-left")}var i=getElementAttributeValue(e.ref.parentElement,"class");e.browsiAd.wrapper.style="",i?-1===i.indexOf("fixedad")&&(e.browsiAd.wrapper.setAttribute("class","gmgAdBrowsi"),r&&a&&o&&n&&(e.browsiAd.wrapper.style.setProperty("float",a),e.browsiAd.wrapper.style.setProperty("margin-right",n),e.browsiAd.wrapper.style.setProperty("margin-left",o))):(e.browsiAd.wrapper.setAttribute("class","gmgAdBrowsi"),r&&a&&o&&n?(e.browsiAd.wrapper.style.setProperty("float",a),e.browsiAd.wrapper.style.setProperty("margin-right",n),e.browsiAd.wrapper.style.setProperty("margin-left",o)):e.browsiAd.wrapper.style.setProperty("text-align","center"))}},loaderParams.externalFlowHandler.onPreDemand=loaderParams.externalFlowHandler.preDemand;}}; window["__browsiLoadFunc"](window["__browsiLoadObject"], preEngineFunc); })();