//tealium universal tag - utag.307 ut4.0.202103241710, Copyright 2021 Tealium.com Inc. All Rights Reserved.
try{(function(id,loader){var u={};utag.o[loader].sender[id]=u;if(utag===undefined){utag={};}
if(utag.ut===undefined){utag.ut={};}
if(utag.ut.loader===undefined){u.loader=function(o){var a,b,c,l;a=document;if(o.type==="iframe"){b=a.createElement("iframe");b.setAttribute("height","1");b.setAttribute("width","1");b.setAttribute("style","display:none");b.setAttribute("src",o.src);}else if(o.type==="img"){utag.DB("Attach img: "+o.src);b=new Image();b.src=o.src;return;}else{b=a.createElement("script");b.language="javascript";b.type="text/javascript";b.async=1;b.charset="utf-8";b.src=o.src;}
if(o.id){b.id=o.id;}
if(typeof o.cb==="function"){if(b.addEventListener){b.addEventListener("load",function(){o.cb();},false);}else{b.onreadystatechange=function(){if(this.readyState==="complete"||this.readyState==="loaded"){this.onreadystatechange=null;o.cb();}};}}
l=o.loc||"head";c=a.getElementsByTagName(l)[0];if(c){utag.DB("Attach to "+l+": "+o.src);if(l==="script"){c.parentNode.insertBefore(b,c);}else{c.appendChild(b);}}};}else{u.loader=utag.ut.loader;}
u.ev={'view':1};u.initialized=false;u.map={"ad_unit_section":"ad_unit","content_id":"content_id","internal_site_id":"site","content_tag_commas":"content_tag_commas","content_author_commas":"content_author_commas","page_type":"page_type","page_level_3":"page_level_3","free_paid_content":"free_paid_content","page_level_1":"page_level_1","lead_media":"lead_media","cid":"cid","dom.referrer":"referrer","enable_prebid":"enable_prebid","page_level_5":"page_level_5","_sm_307_15":"enable_tcf,enable_amazon_tam"};u.extend=[function(a,b){try{b['_sm_307_15']="true";}catch(e){utag.DB(e);}},function(a,b){try{if((b['enable_prebid'].toString().toLowerCase()=='true'.toLowerCase()&&b['site_domain'].toString().toLowerCase().indexOf('west.ops.politico.com'.toLowerCase())<0&&b['site_domain'].toString().toLowerCase().indexOf('design.politico.com'.toLowerCase())<0&&b['site_domain'].toString().toLowerCase().indexOf('qablue'.toLowerCase())<0)){(function(){var id='prebid';if(!document.getElementById(id)){var adScript=document.createElement('script');adScript.id=id;adScript.async='true';adScript.type='text/javascript';var useSSL='https:'==document.location.protocol;adScript.src=(useSSL?'https:':'http:')+'//acdn.adnxs.com/prebid/c/7917/pb.js';var scriptInsert=document.getElementsByTagName('script')[0];scriptInsert.parentNode.insertBefore(adScript,scriptInsert);}})();}}catch(e){utag.DB(e)}},function(a,b){try{if(b['page_type'].toString().toLowerCase()=='tag'.toLowerCase()){b['content_tag_commas']=b['page_level_2']}}catch(e){utag.DB(e);}},function(a,b){try{if((b['internal_site_id']=='politico'&&b['page_type']=='tag')||(b['internal_site_id']=='politico'&&b['page_type'].toString().toLowerCase()=='module-container-page'.toLowerCase())){b['content_tag_commas']=b['page_level_2']}}catch(e){utag.DB(e);}},function(a,b){try{if((b['page_type']=='module-container-page'&&b['ad_unit_section']=='politico-money-front')||b['page_level_2']=='politico-money'){b['content_tag_commas']='politico money'}}catch(e){utag.DB(e);}},function(a,b){try{if((b['site_section']=='tipsheets'&&b['page_level_1']!='tipsheets'&&b['page_level_1']!='newsletters')){b['ad_unit_section']=b['page_level_1']}}catch(e){utag.DB(e);}},function(a,b){try{if(b['active_device'].toString().toLowerCase()=='Android'.toLowerCase()||b['active_device'].toString().toLowerCase()=='iPhone'.toLowerCase()||b['active_device'].toString().toLowerCase()=='iPad'.toLowerCase()||b['active_device'].toString().toLowerCase()=='Windows tablet'.toLowerCase()||b['active_device'].toString().toLowerCase()=='BlackBerry'.toLowerCase()||b['active_device'].toString().toLowerCase()=='Windows phone'.toLowerCase()){(function(){var adScript=document.createElement('script');adScript.async='true';adScript.type='text/javascript';var useSSL='https:'==document.location.protocol;adScript.src=(useSSL?'https:':'http:')+'//confiant-integrations.global.ssl.fastly.net/NZD0M0OBz2-7bntA9GZmnQ6AMFI/gpt_and_prebid/config.js';var scriptInsert=document.getElementsByTagName('script')[0];scriptInsert.parentNode.insertBefore(adScript,scriptInsert);})();}}catch(e){utag.DB(e)}},function(a,b){try{if((b['page_type']=='module-container-page'&&b['ad_unit_section']=='women-rule-podcast')||b['page_level_2']=='women-rule-podcast'){b['content_tag_commas']='Women Rule podcast'}}catch(e){utag.DB(e);}},function(a,b){try{if(typeof b['dom.referrer']!='undefined'&&b['dom.referrer']!=''){try{b['dom.referrer']=b["dom.referrer"].match(/:\/\/(www[0-9]?\.)?(.[^/:]+)/i)[2]}catch(e){}}}catch(e){utag.DB(e);}},function(a,b){try{if(1){var slot=null;var pos=201;utag.dfp.updateAdCounter=function(element,value){element.innerText='0:'+value.toLocaleString('en',{minimumIntegerDigits:2,useGrouping:false})}
utag.dfp.generateGalleryAd=window.generateGalleryAd=function(){var timeout=parseInt(document.querySelector('.gallery-carousel-group').dataset.videoAdSlideTimeout)||5;var mapping=googletag.sizeMapping();mapping.addSize([0,0],[[375,250],[300,250]]);mapping.addSize([650-utag.dfp.getScrollbarWidth(),50],[[640,480],[300,250]]);mapping=mapping.build()
var countdown=document.querySelector('.js-gallery-carousel-ad-countdown')
var button=document.querySelector('.js-gallery-carousel-ad-close')
var value=document.querySelector('.js-gallery-carousel-ad-countdown-value')
if(!slot){slot=googletag.defineSlot(u.data.network_id+"/"+u.data.site+"/"+u.data.ad_unit+"/"+pos,[300,250],'pol-gallery');slot.defineSizeMapping(mapping)
slot.setTargeting("pos",201)
slot.addService(googletag.pubads());googletag.pubads().disableInitialLoad();googletag.enableServices();pos+=1;}
apstag.fetchBids({timeout:1000,slots:[{slotID:'pol-gallery',slotName:u.data.network_id+"/"+u.data.site+"/"+u.data.ad_unit+"/",sizes:[[640,480],[375,250],[300,250]],}]},function(bids){apstag.setDisplayBids();pbjs.refreshAds(['pol-gallery'])
utag.dfp.updateAdCounter(value,timeout)
countdown.classList.remove('is-hidden')
button.classList.add('is-hidden')
button.addEventListener('click',function(){googletag.destroySlots([slot])
slot=null})
var interval=setInterval(function(){timeout-=1;utag.dfp.updateAdCounter(value,timeout)
if(timeout===0){countdown.classList.add('is-hidden')
button.classList.remove('is-hidden')
clearInterval(interval)}},1000)})}}}catch(e){utag.DB(e)}}];u.send=function(a,b){var adsLoaded=false;if(typeof window.gptadslots!=='undefined'){if(window.gptadslots.length>0){adsLoaded=true;}}
if(!adsLoaded){if(u.ev[a]||u.ev.all!==undefined){var c,d,e,f,i;u.data={"ad_unit":"default","network_id":"6326","site":"politico","scrollbar_width":utag.dfp.getScrollbarWidth(),"content_id":"","content_tag_commas":"","content_author_commas":"","page_type":"","page_level_1":"","referrer":"","cid":"","enable_prebid":"","page_level_3":""};for(c=0;c<u.extend.length;c++){try{d=u.extend[c](a,b);if(d==false)return}catch(e){}};for(d in utag.loader.GV(u.map)){if(b[d]!==undefined&&b[d]!==""){e=u.map[d].split(",");for(f=0;f<e.length;f++){u.data[e[f]]=b[d];}}}
var ad_unit=u.data.ad_unit,isLessonsFromLeaders=false;var site=u.data.site;window.adsRefreshed=false;window.scrollbarWidth=u.data.scrollbar_width;window.adSlots={};u.loader_cb=function(){u.initialized=true;window.adstruct_all_ads={'pol-01':{'adtype':'pol-01','dccat':'null','isflex':true,'moduleid':'pol-01','pg':u.data.ad_unit,'pos':1,'sz':[{'definition':[0,0],'sizes':[[320,50]]},{'definition':[748-scrollbarWidth,50],'sizes':[[1,1],[728,90]]},{'definition':[990-scrollbarWidth,50],'sizes':[[1,1],[970,90],[728,90],[970,250]]}],'tile':1},'pol-02':{'adtype':'pol-02','dccat':'null','isflex':true,'moduleid':'pol-02','pg':u.data.ad_unit,'pos':2,'sz':[{'definition':[0,0],'sizes':[[300,250]]},{'definition':[1012-scrollbarWidth,60],'sizes':[[300,250],[300,600],[300,1050]]}],'tile':2},'pol-04':{'adtype':'pol-04','dccat':'null','isflex':true,'moduleid':'pol-04','pg':u.data.ad_unit,'pos':4,'sz':[{'definition':[0,0],'sizes':[[300,250]]},{'definition':[1012-scrollbarWidth,60],'sizes':[[300,250],[300,600],[300,1050]]}],'tile':4},'pol-05':{'adtype':'pol-05','dccat':'null','isflex':false,'moduleid':'pol-05','pg':u.data.ad_unit,'pos':5,'sz':[{'definition':[0,0],'sizes':[[300,250],[320,250]]},{'definition':[650-scrollbarWidth,50],'sizes':[[300,250]]}],'tile':5},'pol-06':{'adtype':'pol-06','clicktoload':true,'dccat':'null','isflex':true,'moduleid':'pol-06','pg':u.data.ad_unit,'pos':6,'sz':[{'definition':[0,0],'sizes':[]},{'definition':[1012-scrollbarWidth,60],'sizes':[[300,250],[300,600],[300,1050]]}],'tile':6},'pol-07':{'adtype':'pol-07','dccat':'null','isflex':true,'moduleid':'pol-07','pg':u.data.ad_unit,'pos':7,'sz':[{'definition':[0,0],'sizes':[[300,250]]},{'definition':[1012-scrollbarWidth,60],'sizes':[[300,250],[300,600],[300,1050]]}],'tile':7},'pol-08':{'adtype':'pol-08','dccat':'null','isflex':true,'moduleid':'pol-08','pg':u.data.ad_unit,'pos':8,'sz':[{'definition':[0,0],'sizes':[[320,250],[320,50]]},{'definition':[640-scrollbarWidth,50],'sizes':[[640,250]]},{'definition':[1000-scrollbarWidth,50],'sizes':[[1000,250]]},{'definition':[1160-scrollbarWidth,50],'sizes':[[1160,400],[1160,250],[1000,250],[970,250],[970,90],[728,90]]}],'tile':8},'pol-09':{'adtype':'pol-09','dccat':'null','isflex':true,'moduleid':'pol-09','pg':u.data.ad_unit,'pos':9,'sz':[{'definition':[0,0],'sizes':[[320,250],[320,50]]},{'definition':[640-scrollbarWidth,50],'sizes':[[320,50],[640,250]]},{'definition':[728-scrollbarWidth,50],'sizes':[[728,90],[640,250]]},{'definition':[1000-scrollbarWidth,50],'sizes':[[970,90],[728,90],[1160,250],[1000,250]]}],'tile':9},'pol-native-12':{'adtype':'pol-native-12','dccat':'null','isflex':true,'moduleid':'pol-native-12','pg':u.data.ad_unit,'pos':12,'sz':[{'definition':[0,0],'sizes':['fluid']}],'tile':12},};window.adsConfig=utag.dfp.generateConfig(adstruct_all_ads);utag.dfp.loadAds(window.adsConfig,true);utag.dfp.initAdsWithTagParams(u.data)};u.loader_cb();}}};utag.o[loader].loader.LOAD(id);})("307","politico.main");}catch(error){utag.DB(error);}
