!function(e,t){var n="707447d2496e8fcf7c3d3a1085662875";t.reviveAsync=t.reviveAsync||{},function(e){if("function"==typeof e.CustomEvent)return!1;function t(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}t.prototype=e.Event.prototype,e.CustomEvent=t}(t);try{if(!t.reviveAsync.hasOwnProperty(n)){var r=t.reviveAsync[n]={id:Object.keys(t.reviveAsync).length,name:"revive",seq:0,main:function(){var n=function(){var a=!1;try{a||(a=!0,e.removeEventListener("DOMContentLoaded",n,!1),t.removeEventListener("load",n,!1),r.addEventListener("start",r.start),r.addEventListener("refresh",r.refresh),r.dispatchEvent("start",{start:!0}))}catch(e){console.log(e)}};r.dispatchEvent("init"),"complete"===e.readyState?setTimeout(n):(e.addEventListener("DOMContentLoaded",n,!1),t.addEventListener("load",n,!1))},start:function(e){e.detail&&e.detail.hasOwnProperty("start")&&!e.detail.start||(r.removeEventListener("start",r.start),r.dispatchEvent("refresh"))},refresh:function(e){r.apply(r.detect())},ajax:function(e,t){var n=new XMLHttpRequest;n.onreadystatechange=function(){4===this.readyState&&200===this.status&&r.spc(JSON.parse(this.responseText))},this.dispatchEvent("send",t),n.open("GET",e+"?"+r.encode(t).join("&"),!0),n.withCredentials=!0,n.send()},encode:function(e,t){var n,a,i=[];for(n in e)if(e.hasOwnProperty(n)){var o=t?t+"["+n+"]":n;if(/^(string|number|boolean)$/.test(typeof e[n]))i.push(encodeURIComponent(o)+"="+encodeURIComponent(e[n]));else{var l=r.encode(e[n],o);for(a in l)i.push(l[a])}}return i},apply:function(t){if(t.zones.length){var n="http:"===e.location.protocol?"http://gepuma.republiknews.fr/rev/p-"+Math.floor(Math.random()*Math.floor(1e5)):"https://gepuma.republiknews.fr/rev/p-"+Math.floor(Math.random()*Math.floor(1e5));t.zones=t.zones.join("|"),t.loc=e.location.href,e.referrer&&(t.referer=e.referrer),r.ajax(n,t)}},detect:function(){for(var t=e.querySelectorAll("ins["+r.getDataAttr("id")+"='"+n+"']"),a=[],i=0;i<t.length;i++){var o=t[i],l=r.getDataAttr("zoneid");if(o.hasAttribute(l)){var s=o.getAttribute(l);a.indexOf(s)>-1?o.outerHTML=o.outerHTML.replace(/ins/g,"insmobile"):a.push(s)}}t=e.querySelectorAll("ins["+r.getDataAttr("id")+"='"+n+"']");var d={zones:[],prefix:r.name+"-"+r.id+"-"};for(i=0;i<t.length;i++){l=r.getDataAttr("zoneid");var c,h=r.getDataAttr("seq");if((o=t[i]).hasAttribute(h)?c=o.getAttribute(h):(c=r.seq++,o.setAttribute(h,c),o.id=d.prefix+c),o.hasAttribute(l)){var u,v=r.getDataAttr("loaded"),p=new RegExp("^"+r.getDataAttr("(.*)")+"$");if(o.hasAttribute(v)&&o.getAttribute(v))continue;o.setAttribute(r.getDataAttr("loaded"),"1");for(var m=0;m<o.attributes.length;m++)(u=o.attributes[m].name.match(p))&&("zoneid"===u[1]?d.zones[c]=o.attributes[m].value:/^(id|seq|loaded)$/.test(u[1])||(d[u[1]]=o.attributes[m].value))}}return d},createFrame:function(t){var n=e.createElement("IFRAME"),r=n.style;return n.scrolling="no",n.frameBorder=0,n.width=t.width>0?t.width:0,n.height=t.height>0?t.height:0,r.border=0,r.overflow="hidden",n},loadFrame:function(e,t){var n=e.contentDocument||e.contentWindow.document;n.open(),n.writeln("<!DOCTYPE html>"),n.writeln("<html>"),n.writeln('<head><base target="_top"><meta charset="UTF-8"></head>'),n.writeln('<body border="0" margin="0" style="margin: 0; padding: 0">'),n.writeln(t),n.writeln("</body>"),n.writeln("</html>"),n.close()},spc:function(t){for(var n in this.dispatchEvent("receive",t),t)if(t.hasOwnProperty(n)){var a=t[n],i=e.getElementById(n);if(i&&""!=a.id){var o=r.getDataAttr("typesite"),l=r.getDataAttr("format"),s=i.getAttribute(r.getDataAttr("zoneid"));if(i.hasAttribute(o)){if("free"==i.getAttribute(o)&&i.hasAttribute(l)){var d=i.cloneNode(!1),c={};a.srctrack.replace(/[?&]+([^=&]+)=?([^&]*)?/gi,function(e,t,n){c[t]=void 0!==n?n:""}),a.srctrack="//gepuma.republiknews.fr/rev/l-"+c.bannerid+"-"+c.campaignid+"-"+c.cb+"-"+c.zoneid+"?loc="+c.loc;c={};a.url.replace(/__/gi,"&").replace(/[?&]+([^=&]+)=?([^&]*)?/gi,function(e,t,n){c[t]=void 0!==n?n:""}),a.url="//gepuma.republiknews.fr/rev/c-"+c.bannerid+"-"+c.zoneid+"-"+c.cb+"?l="+c.oadest;var h='<div id="beacon_'+a.random+'" style="position: absolute; left: 0px; top: 0px; visibility: hidden;"><img src="'+a.srctrack+'" width="0" height="0" alt="'+a.alt+'" style="width: 0px; height: 0px;" />'+a.htmltracking+"</div>";switch(i.getAttribute(l)){case"carre":d.style.textDecoration="none";var u='<a class="d-block" target="_blank" title="'+a.alt+'" href="'+a.url+'" target="_blank"><img class="w-100" src="'+a.src+'" alt="'+a.alt+'"></a>';d.innerHTML=u+h,r.insDivHidden(s,u);break;case"banniere":d.style.textDecoration="none";u='<a class="d-block" target="_blank" title="'+a.alt+'" href="'+a.url+'" target="_blank"><img class="w-100" src="'+a.src+'" alt="'+a.alt+'"></a>';d.innerHTML=u+h;break;case"habillage":d.style.textDecoration="none",d.innerHTML="";var v=document.createElement("div");v.className="habillage-zone";var p=document.getElementsByTagName("main")[0];if(p){p.parentNode.insertBefore(v,p),v.appendChild(p);var m=document.createElement("div");m.className="habillage",m.setAttribute("data-titre",a.alt),m.setAttribute("data-lien",a.url),m.setAttribute("data-id",a.random);var f=document.createElement("style");f.type="text/css",f.innerHTML=".habillage{ padding-top:100px;background-image: url("+a.src+"); }",document.body.appendChild(f),v.parentNode.insertBefore(m,v),m.appendChild(v),m.addEventListener("click",function(e){e.preventDefault(),window.open(this.getAttribute("data-lien"))}),v.addEventListener("click",function(e){e.stopPropagation()}),m.insertAdjacentHTML("beforeEnd",h)}break;case"sponsor":d.style.textDecoration="none";u='<a class="d-block" target="_blank" title="'+a.alt+'" href="'+a.url+'" target="_blank"><img class="w-100" src="'+a.src+'" alt="'+a.alt+'"></a>';d.innerHTML=u+h;break;default:d.style.textDecoration="none",d.innerHTML=a.html}for(var g=d.getElementsByTagName("SCRIPT"),b=0;b<g.length;b++){for(var y=document.createElement("SCRIPT"),E=g[b].attributes,A=0;A<E.length;A++)y[E[A].nodeName]=E[A].value;g[b].innerHTML&&(y.text=g[b].innerHTML),g[b].parentNode.replaceChild(y,g[b])}i.parentNode.replaceChild(d,i)}}else{d=i.cloneNode(!1);if(a.iframeFriendly){var L=r.createFrame(a);d.appendChild(L),i.parentNode.replaceChild(d,i),r.loadFrame(L,a.html)}else{d.style.textDecoration="none",d.innerHTML=a.html;for(g=d.getElementsByTagName("SCRIPT"),b=0;b<g.length;b++){for(y=document.createElement("SCRIPT"),E=g[b].attributes,A=0;A<E.length;A++)y[E[A].nodeName]=E[A].value;g[b].innerHTML&&(y.text=g[b].innerHTML),g[b].parentNode.replaceChild(y,g[b])}i.parentNode.replaceChild(d,i)}}}}},insDivHidden:function(t,n){for(var a=e.querySelectorAll("insmobile["+r.getDataAttr("zoneid")+"='"+t+"']"),i=0;i<a.length;i++)a[0].innerHTML=n},getDataAttr:function(e){return"rdynebhado-"+e},getEventName:function(e){return this.name+"-"+n+"-"+e},addEventListener:function(t,n){e.addEventListener(this.getEventName(t),n)},removeEventListener:function(t,n){e.removeEventListener(this.getEventName(t),n,!0)},dispatchEvent:function(t,n){e.dispatchEvent(new CustomEvent(this.getEventName(t),{detail:n||{}}))}};r.main()}}catch(e){console.log&&console.log(e)}}(document,window);