gdpr-consent
Version:
GDPR banner to comply with the European cookie law. Inspired by tarteaucitronjs.
1 lines • 34 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.GDPRConsent=t():e.GDPRConsent=t()}(self,function(){return function(){"use strict";var e={d:function(t,i){for(var a in i)e.o(i,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:i[a]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t={};function i(e,t,i=null){const a=document.getElementById(e);if(null!==a)if("string"!=typeof t)for(const[e,i]of Object.entries(t))null!==i?a.style.setProperty(e,i):a.style.removeProperty(e);else null!==i?a.style.setProperty(t,i):a.style.removeProperty(t)}e.d(t,{default:function(){return U}});function a(e,t){const i=document.getElementById(e);null!==i&&("string"==typeof t?i.classList.add(t):i.classList.add(...t))}function o(e,t){const i=document.getElementById(e);null!==i&&("string"==typeof t?i.classList.remove(t):i.classList.remove(...t))}function n(e,t,i){e.dispatchEvent("string"==typeof t?new CustomEvent(t,{detail:i,bubbles:!0,cancelable:!0}):t)}function s(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var a in i)e[a]=i[a]}return e}var r,c=function e(t,i){function a(e,a,o){if("undefined"!=typeof document){"number"==typeof(o=s({},i,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var n="";for(var r in o)o[r]&&(n+="; "+r,!0!==o[r]&&(n+="="+o[r].split(";")[0]));return document.cookie=e+"="+t.write(a,e)+n}}return Object.create({set:a,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var i=document.cookie?document.cookie.split("; "):[],a={},o=0;o<i.length;o++){var n=i[o].split("="),s=n.slice(1).join("=");try{var r=decodeURIComponent(n[0]);if(a[r]=t.read(s,r),e===r)break}catch(e){}}return e?a[e]:a}},remove:function(e,t){a(e,"",s({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,s({},this.attributes,t))},withConverter:function(t){return e(s({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(i)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});!function(e){e[e.localStorage=1]="localStorage",e[e.cookies=2]="cookies"}(r||(r={}));class l{type;constructor(e){this.type=e}}class d extends l{constructor(){super(r.localStorage)}getItem(e){const t=window.localStorage.getItem(e);return null===t?void 0:t}setItem(e,t){window.localStorage.setItem(e,t)}removeItem(e){window.localStorage.removeItem(e)}}class u extends l{expires;constructor(e){super(r.cookies),this.expires=e}getItem(e){return c.get(e)}setItem(e,t){c.set(e,t,{expires:this.expires})}removeItem(e){c.remove(e)}}let p=null;function g(e=365){return null===p&&(p=function(){const e="localStorageTest";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}}()?new d:new u(e)),p}const m=/[&<>"']/g,h=RegExp(m.source),f=Object.freeze({"&":"&","<":"<",">":">",'"':""","'":"'"});function v(e){return h.test(e)?e.replace(m,e=>f[e]):e}const y={hashtag:"#tarteaucitron",cookieName:"tarteaucitron",timeExpire:31536e6,acceptAllCta:!0,moreInfoLink:!0,mandatory:!0,preferLocalStorage:!1,websiteName:window.location.hostname,siteDisclaimerTitle:"",siteDisclaimerMessage:""},w={alertBigScroll:"By continuing to scroll,",alertBigClick:"If you continue to browse this website,",alertBig:"you are allowing all third-party services",alertBigPrivacy:"This site uses cookies and gives you control over what you want to activate",personalize:"Personalize",acceptAll:"OK, accept all",continue:"Reject cookies & keep on browsing",close:"Close",all:"Preference for all services",disclaimer:"By allowing these third party services, you accept their cookies and the use of tracking technologies necessary for their proper functioning.",disclaimerWebsite:"These services help us improve",allow:"Allow",deny:"Deny",noCookie:"This service does not use cookie.",useCookie:"This service can install",useCookieCurrent:"This service has installed",useNoCookie:"This service has not installed any cookie.",source:"View the official website",noServices:"This website does not use any cookie requiring your consent.",title:"Cookies management panel",newWindow:"(new window)",allowAll:"Allow all cookies",denyAll:"Deny all cookies",save:"Save",placeholder:{beforeName:"Cookies for",afterName:"are disabled. If you want to access this content you need to activate this service."},ads:{title:"Advertising network",details:"Ad networks can generate revenue by selling advertising space on the site."},analytic:{title:"Measurement of the navigation (ergonomics), the audience & the marketing performance",details:"The audience measurement services are used to generate useful statistics attendance to improve the site and optimise the marketing campaigns."},audio:{title:"Audio",details:"Audio sharing services help to add rich media on the site and increase its visibility."},social:{title:"Social networks (sharing buttons, Twitter cards, …)",details:"Social networks can improve the usability of the site and help to promote it via the shares."},video:{title:"Videos",details:"Video sharing services help to add rich media on the site and increase its visibility."},comment:{title:"Comments",details:"Comments managers facilitate the filing of comments and fight against spam."},support:{title:"Support",details:"Support services allow you to get in touch with the site team and help to improve it."},api:{title:"Services",details:"APIs are used to load scripts: geolocation, search engines, translations, …"},other:{title:"Other",details:"Services to display web content."},mandatoryTitle:"Mandatory cookies",mandatoryText:"This site uses cookies necessary for its proper functioning which cannot be deactivated."},b={alertBigScroll:"En continuant de défiler,",alertBigClick:"En poursuivant votre navigation,",alertBig:"vous acceptez l’utilisation de services tiers pouvant installer des cookies",alertBigPrivacy:"Ce site utilise des cookies et vous donne le contrôle sur ce que vous souhaitez activer",personalize:"Personnaliser",acceptAll:"Tout autoriser",continue:"Continuer sans accepter",close:"Fermer",all:"Préférences pour tous les services",disclaimer:"En autorisant ces services tiers, vous acceptez le dépôt et la lecture de cookies et l’utilisation de technologies de suivi nécessaires à leur bon fonctionnement.",disclaimerWebsite:"Ces services nous aident à améliorer",allow:"Autoriser",deny:"Interdire",noCookie:"Ce service ne dépose aucun cookie.",useCookie:"Ce service peut déposer",useCookieCurrent:"Ce service a déposé",useNoCookie:"Ce service n’a déposé aucun cookie.",source:"Voir le site officiel",noServices:"Ce site n’utilise aucun cookie nécessitant votre consentement.",title:"Panneau de gestion des cookies",newWindow:"(nouvelle fenêtre)",allowAll:"Tout autoriser",denyAll:"Tout interdire",save:"Enregistrer",placeholder:{beforeName:"Le dépôt de cookies pour",afterName:"est désactivé. Si vous souhaitez accéder à ce contenu, merci de l’activer."},ads:{title:"Régies publicitaires",details:"Les régies publicitaires permettent de générer des revenus en commercialisant les espaces publicitaires du site."},analytic:{title:"Mesure de navigation (ergonomie), d’audience et de performance publicitaire",details:"Les services de mesure d’audience permettent de générer des statistiques de fréquentation utiles à l’amélioration du site et à l’optimisation des campagnes publicitaires."},audio:{title:"Audio",details:"Les services de partage audio permettent d’enrichir le site de contenu multimédia et augmentent sa visibilité."},social:{title:"Réseaux sociaux (boutons de partage, cartes Twitter, …)",details:"Les réseaux sociaux permettent d’améliorer la convivialité du site et aident à sa promotion via les partages."},video:{title:"Vidéos",details:"Les services de partage de vidéo permettent d’enrichir le site de contenu multimédia et augmentent sa visibilité."},comment:{title:"Commentaires",details:"Les gestionnaires de commentaires facilitent le dépôt de vos commentaires et luttent contre le spam."},support:{title:"Support",details:"Les services de support vous permettent d’entrer en contact avec l’équipe du site et d’aider à son amélioration."},api:{title:"Services",details:"Les APIs permettent de charger des scripts : géolocalisation, moteurs de recherche, traductions, …"},other:{title:"Autre",details:"Services visant à afficher du contenu web."},mandatoryTitle:"Cookies obligatoires",mandatoryText:"Ce site utilise des cookies nécessaires à son bon fonctionnement qui ne peuvent pas être désactivés."};function k(){if(!navigator)return"en_US";const e=navigator.language||null;return"fr"===(e?e.substring(0,2):null)?"fr_FR":"en_US"}const _={};let C=null;function L({cookieName:e,timeExpire:t,preferLocalStorage:i}){return null===C&&(C=i?g(t):new u(t),C.type===r.localStorage&&void 0!==c.get(e)&&(C.setItem(e,c.get(e)),c.remove(e))),C}function j(e){return L(e).getItem(e.cookieName)??""}function T(e,t,i){const a=L(i),o=new RegExp("!"+e+"=(wait|true|false)","g"),n=j(i).replace(o,"")+"!"+e+"="+t;a.setItem(i.cookieName,n)}function I(e,t,i){const a=t.cookies,o=a.length;let n=0,s="";const r=document.cookie.indexOf(e+"=true");if(r>=0&&0===o)s+=i.useNoCookie;else if(r>=0){for(let e=0;e<o;e+=1)-1!==document.cookie.indexOf(a[e]+"=")&&(n+=1,void 0===_[a[e]]&&(_[a[e]]=[]),-1===_[a[e]].indexOf(t.name)&&_[a[e]].push(t.name));n>0?(s+=i.useCookieCurrent+" "+n+" cookie",n>1&&(s+="s"),s+="."):s+=i.useNoCookie}else 0===o?s=i.noCookie:(s+=i.useCookie+" "+o+" cookie",o>1&&(s+="s"),s+=".");const c=document.getElementById("tacCL"+e);null!==c&&(c.innerHTML=s)}let A=!0;function x(e){document.location.hash===e.parameters.hashtag&&(window.history?window.history.replaceState("",document.title,window.location.pathname+window.location.search):document.location.hash=""),i("tarteaucitron","display","none");for(const e of document.getElementsByClassName("tarteaucitron-info-box"))e.style.display="none";!0===e.reloadThePage?window.location.reload():i("tarteaucitron-back","display","none"),document.getElementById("tarteaucitron-close-alert")?.focus(),document.getElementsByTagName("body")[0].classList.remove("modal-open"),n(window,"tac.close_panel")}function E(e){i("tarteaucitron","display","block"),i("tarteaucitron-back","display","block"),document.getElementById("tarteaucitron-close-panel").focus(),document.getElementsByTagName("body")[0].classList.add("modal-open");for(let t=0;t<e.job.length;t++)void 0!==e.state[e.job[t]]&&P(e.job[t],e.state[e.job[t]],e);n(window,"tac.open_panel")}function P(e,t,s){const r=document.getElementById(e+"Switch"),l=document.getElementById(e+"Allowed"),d=document.getElementById(e+"Denied");r.classList.remove("switch-denied"),r.classList.remove("switch-allowed"),l.classList.remove("active"),d.classList.remove("active"),!0===t?(r.classList.add("switch-allowed"),r.children[0].innerHTML="✓",l.classList.add("active")):(r.classList.add("switch-denied"),r.children[0].innerHTML="✗",d.classList.add("active"));let u=!1,p=0,g=0;for(let e=0;e<s.job.length;e++){const t=s.job[e],i=s.state[t];void 0!==i?!0===i?p+=1:g+=1:!0!==s.services[t].lazyConsent&&(u=!0)}u||!0!==A&&(i("tarteaucitron-alert-big","display","none"),o("tarteaucitron-root","tarteaucitron-before-visible"),A=!0,n(window,"tac.close_alert")),p===s.job.length?(o("tarteaucitron-all-denied","tarteaucitron-is-selected"),a("tarteaucitron-all-allowed","tarteaucitron-is-selected")):g===s.job.length&&(o("tarteaucitron-all-allowed","tarteaucitron-is-selected"),a("tarteaucitron-all-denied","tarteaucitron-is-selected"));const m=s.services[e].cookies;if(m.length>0&&!1===t&&function(e){for(let t=0;t<e.length;t+=1)c.remove(e[t]),c.remove(e[t],{path:"/"}),c.remove(e[t],{path:"/",domain:"."+location.hostname}),c.remove(e[t],{path:"/",domain:"."+location.hostname.split(".").slice(-2).join(".")})}(m),!0===t){const t=document.getElementById("tacCL"+e);null!==t&&(t.innerHTML="..."),setTimeout(function(){I(e,s.services[e],s.lang)},2500)}else I(e,s.services[e],s.lang)}function B(e,t,i){const a=t.services;for(let o=0;o<t.job.length;o+=1){const n=a[t.job[o]].key;t.state[n]!==e&&(!1===e&&!0===t.launch[n]&&(t.reloadThePage=!0),!0!==t.launch[n]&&!0===e&&(t.launch[n]=!0,t.services[n].js()),t.state[n]=e,T(n,e,i),P(n,e,t))}}const S=new class{user;lang;services;added;state;launch;parameters;reloadThePage;alreadyLaunch;loaded;languagesLoader;servicesLoader;job;constructor(){this.user={},this.services={},this.added={},this.state={},this.launch={},this.reloadThePage=!1,this.alreadyLaunch=0,this.loaded=!1}withLanguages(e){this.languagesLoader=e}withServices(e){this.servicesLoader=e}init(e={}){this.parameters=Object.assign({},structuredClone(y),structuredClone(e)),0===this.alreadyLaunch&&(this.alreadyLaunch=1,window.addEventListener("keydown",e=>function(e,t){"Escape"===t.code&&x(e)}(this,e),!1),window.addEventListener("hashchange",()=>{return e=this,void(document.location.hash===e.parameters.hashtag&&E(e));var e},!1),"complete"===window.document.readyState?this.load():window.addEventListener("load",()=>this.load(),!1))}load(){if("function"!=typeof this.languagesLoader)throw new Error("Missing languages loader !");if("function"!=typeof this.servicesLoader)throw new Error("Missing services loader !");const e=function(e){if(!navigator)return e.en;const t=navigator.language||null,i=t?t.substring(0,2):null;return null===i||void 0===e[i]?e.en:e[i]}(this.languagesLoader());if(void 0===e)throw new Error("Missing english translation !");this.lang=e,this.services=this.servicesLoader(this.user),delete this.languagesLoader,delete this.servicesLoader;const t=document.body,i=document.createElement("div");let a,o,s="",r=["ads","analytic","audio","social","video","comment","support","api","other"];for(r=r.sort((e,t)=>this.lang[e].title>this.lang[t].title?1:this.lang[e].title<this.lang[t].title?-1:0),s+='<button type="button" id="tarteaucitron-back" onclick="GDPRConsent.closePanel();" aria-label="'+this.lang.close+'"></button>',s+='<div id="tarteaucitron" role="dialog" aria-labelledby="dialogTitle">',s+=' <button type="button" id="tarteaucitron-close-panel" onclick="GDPRConsent.closePanel();">X</button>',s+=' <div id="tarteaucitron-services">',s+=' <div id="tarteaucitron-services-top">',s+=' <span class="tarteaucitron-h1" role="heading" aria-level="1" id="dialogTitle">'+this.lang.title+"</span>",s+=' <div id="tarteaucitron-info">',s+=" "+this.lang.disclaimer,this.parameters.websiteName&&(s+=" "+this.lang.disclaimerWebsite+" "+v(this.parameters.websiteName)+"."),s+=" </div>",s+=' <div class="tarteaucitron-line">',s+=' <span class="tarteaucitron-h3" role="heading" aria-level="2">'+this.lang.all+"</span>",s+=' <div class="tarteaucitron-ask">',s+=' <button type="button" id="tarteaucitron-all-allowed" class="tarteaucitron-allow" onclick="GDPRConsent.respondAll(true, true);">',s+=" ✓ "+this.lang.allowAll,s+=" </button> ",s+=' <button type="button" id="tarteaucitron-all-denied" class="tarteaucitron-deny" onclick="GDPRConsent.respondAll(false, true);">',s+=" ✗ "+this.lang.denyAll,s+=" </button>",s+=" </div>",s+=" </div>",s+=" </div>",s+=' <div id="tarteaucitron-services-list">',s+=' <div class="clear"></div>',!0===this.parameters.mandatory&&(s+='<div class="tarteaucitron-cookie-group">',s+=' <div class="tarteaucitron-cookie-text">',s+=' <span class="tarteaucitron-h3" role="heading" aria-level="2">'+this.lang.mandatoryTitle+"</span>",s+=' <span class="tarteaucitron-description">'+this.lang.mandatoryText+"</span>",s+=" </div>",s+=' <div class="tarteaucitron-cookie-buttons">',s+=' <button type="button" class="tarteaucitron-allow solo">',s+=" ✓ "+this.lang.allow,s+=" </button> ",s+=" </div>",s+="</div>"),o=0;o<r.length;o+=1)s+=' <li id="tarteaucitron-services-title_'+r[o]+'" class="tarteaucitron-hidden">',s+=' <div class="tarteaucitron-title">',s+=' <button type="button" onclick="GDPRConsent.toggle(\'tarteaucitron-details'+r[o]+"', 'tarteaucitron-info-box');return false\">✛ "+this.lang[r[o]].title+"</button>",s+=" </div>",s+=' <div id="tarteaucitron-details'+r[o]+'" class="tarteaucitron-details tarteaucitron-info-box">',s+=" "+this.lang[r[o]].details,s+=" </div>",s+=' <ul id="tarteaucitron-services_'+r[o]+'"></ul></li>';if(s+=' <li id="tarteaucitron-no-services-title" class="tarteaucitron-line">'+this.lang.noServices+"</li>",s+=" </ul>",s+=' <div id="tarteaucitron-services-bottom">',s+=' <button type="button" id="tarteaucitron-save-responses" onclick="GDPRConsent.closePanel();">'+this.lang.save+"</button>",s+=" </div>",s+=" </div>",s+=" </div>",s+="</div>",this.parameters.acceptAllCta?(s+='<div id="tarteaucitron-alert-big" class="tarteaucitron-alert-big-bottom">',""!==this.parameters.siteDisclaimerTitle&&""!==this.parameters.siteDisclaimerMessage&&(s+='<div id="tarteaucitron-wrapper">',s+=' <div id="tarteaucitron-disclaimer-texte">',s+=' <span id="tarteaucitron-site-disclaimer-title">',s+=" "+this.parameters.siteDisclaimerTitle,s+=" </span>",s+=' <span id="tarteaucitron-site-disclaimer-message">',s+=" "+this.parameters.siteDisclaimerMessage+"<br />",s+=" </span>"),s+=' <span id="tarteaucitron-disclaimer-alert">',s+=" "+this.lang.alertBigPrivacy,s+=" </span>",s+=" </div>",s+=' <div id="tarteaucitron-disclaimer-buttons">',s+=' <button type="button" id="tarteaucitron-continue" onclick="GDPRConsent.alertRespondAll(false);">',s+=" → "+this.lang.continue,s+=" </button>",s+=' <div id="tarteaucitron-group-buttons">',s+=' <button type="button" id="tarteaucitron-personalize" onclick="GDPRConsent.alertRespondAll(true);">',s+=" ✓ "+this.lang.acceptAll,s+=" </button>",s+=' <button type="button" id="tarteaucitron-close-alert" onclick="GDPRConsent.alertOpenPanel();">',s+=" "+this.lang.personalize,s+=" </button>",s+=" </div>",s+=" </div>",s+=" </div>",s+="</div>"):(s+='<div id="tarteaucitron-alert-big" class="tarteaucitron-alert-big-bottom">',""!==this.parameters.siteDisclaimerTitle&&""!==this.parameters.siteDisclaimerMessage&&(s+='<div id="tarteaucitron-wrapper">',s+=' <div id="tarteaucitron-disclaimer-texte">',s+=' <span id="tarteaucitron-site-disclaimer-title">',s+=" "+this.parameters.siteDisclaimerTitle,s+=" </span>",s+=' <span id="tarteaucitron-site-disclaimer-message">',s+=" "+this.parameters.siteDisclaimerMessage+"<br />",s+=" </span>"),s+=' <span id="tarteaucitron-disclaimer-alert">',s+=" "+this.lang.alertBigPrivacy,s+=" </span>",s+=" </div>",s+=' <div id="tarteaucitron-disclaimer-buttons">',s+=' <button type="button" id="tarteaucitron-personalize" onclick="GDPRConsent.openPanel();">',s+=" "+this.lang.personalize,s+=" </button>",s+=" </div>",s+=" </div>",s+="</div>"),i.id="tarteaucitron-root",t.appendChild(i),i.innerHTML=s,n(window,"tac.root_available"),void 0!==this.job)for(this.job=this.cleanArray(this.job),a=0;a<this.job.length;a+=1)this.addService(this.job[a]);else this.job=[];this.job.push=e=>(-1===this.job.indexOf(e)&&Array.prototype.push.call(this.job,e),this.launch[e]=!1,this.addService(e),this.job.length),document.location.hash===this.parameters.hashtag&&E(this),this.loaded=!0,n(window,"tac.loaded")}addService(e){const t=this.services[e],o=j(this.parameters),s=o.indexOf(t.key+"=false")>=0,r=o.indexOf(t.key+"=true")>=0||!t.needConsent&&o.indexOf(t.key+"=false")<0,c=o.indexOf(t.key+"=false")>=0||o.indexOf(t.key+"=true")>=0;let l="";if(!0!==this.added[t.key]){this.added[t.key]=!0,l+='<div id="'+t.key+'-line" class="tarteaucitron-cookie-group">',l+=' <div class="tarteaucitron-cookie-text">',l+=' <span class="tarteaucitron-h3" role="heading" aria-level="3">'+t.name+"</span>",l+=' <span id="tacCL'+t.key+'" class="tarteaucitron-description"></span>',!0===this.parameters.moreInfoLink&&(l+=' <a href="'+t.uri+'" target="_blank" rel="noreferrer noopener" title="'+t.name+" "+this.lang.newWindow+'">',l+=" "+this.lang.source,l+=" </a>"),l+=" </div>",l+=' <div class="tarteaucitron-cookie-buttons">',l+=' <span id="'+t.key+'Allowed" class="tarteaucitron-switch-state" onclick="GDPRConsent.respond(this, event);">'+this.lang.allow+"</span>",l+=' <div class="tarteaucitron-switch" id="'+t.key+'Switch" onclick="GDPRConsent.respond(this, event);">',l+=' <button type="button" class="tarteaucitron-switch-button"></button>',l+=" </div> ",l+=' <span id="'+t.key+'Denied" class="tarteaucitron-switch-state" onclick="GDPRConsent.respond(this, event);">'+this.lang.deny+"</span>",l+=" </div>",l+="</li>",i("tarteaucitron-services-title_"+t.type,"display","block");const e=document.getElementById("tarteaucitron-services_"+t.type);null!==e&&(e.innerHTML+=l),i("tarteaucitron-no-services-title","display","none"),function(e,t){const i=document.getElementById("tarteaucitron-services_"+e);if(null===i)return;const a=[...i.children];a.sort((e,i)=>t.services[e.id.replace(/-line/g,"")].name>t.services[i.id.replace(/-line/g,"")].name?1:t.services[e.id.replace(/-line/g,"")].name<t.services[i.id.replace(/-line/g,"")].name?-1:0);for(const e of a)i.appendChild(e)}(t.type,this)}r?(!0!==this.launch[t.key]&&(this.launch[t.key]=!0,t.js(),n(window,t.key+"_loaded")),this.state[t.key]=!0):s?("function"==typeof t.fallback&&t.fallback(this.lang),this.state[t.key]=!1):c||(T(t.key,"wait",this.parameters),"function"==typeof t.fallback&&t.fallback(this.lang),!0!==t.lazyConsent&&!1!==A&&(i("tarteaucitron-alert-big","display","block"),a("tarteaucitron-root","tarteaucitron-before-visible"),A=!1,n(window,"tac.open_alert"))),I(t.key,t,this.lang),n(window,t.key+"_added")}cleanArray(e){const t=this.services,i=e.length;let a=[];const o={};for(let n=0;n<i;n+=1)o[e[n]]||(o[e[n]]=!0,void 0!==t[e[n]]&&a.push(e[n]));return a=a.sort(function(e,i){return t[e].type+t[e].key>t[i].type+t[i].key?1:t[e].type+t[e].key<t[i].type+t[i].key?-1:0}),a}closePanel(){x(this)}openPanel(){E(this)}respondEffect(e,t){P(e,t,this)}respondAll(e,t){B(e,this,this.parameters),t&&x(this)}respond(e,t){!function(e,t,i,a){const o=e.id.replace(/(Eng[0-9]+|Allow|Deni)ed|Switch/g,""),s=e.getBoundingClientRect(),r=a.clientX;let c;if(e.classList.contains("tarteaucitron-switch"))c=void 0!==t.state[o]?!!e.classList.contains("switch-denied"):r<s.left+e.clientWidth/2;else if(e.classList.contains("tarteaucitron-switch-state"))if(e.id.includes("Allowed")&&!0!==t.state[o])c=!0;else{if(!e.id.includes("Denied")||!1===t.state[o])return;c=!1}!0===c&&!0!==t.launch[o]&&(t.launch[o]=!0,n(window,o+"_loaded"),t.services[o].js()),!1===c&&!0===t.launch[o]&&(t.reloadThePage=!0),t.state[o]=c,T(o,c,i),P(o,c,t)}(e,this,this.parameters,t)}activate(e){!function(e,t,i){!0!==t.launch[e]&&(t.launch[e]=!0,n(window,e+"_loaded"),t.services[e].js(),t.state[e]=!0,T(e,!0,i),P(e,!0,t))}(e,this,this.parameters)}isActivated(e){return function(e,t){return!0===t.state[e]}(e,this)}toggle(e,t){!function(e,t){const i=document.getElementById(e);if(null!==i){if(void 0!==t)for(const i of document.getElementsByClassName(t))i.id!==e&&(i.style.display="none");"block"!==i.style.display?i.style.display="block":i.style.display="none"}}(e,t)}alertOpenPanel(){E(this),n(window,"tac.alert_outcome",{outcome:"personalize"})}alertRespondAll(e){B(e,this,this.parameters),n(window,"tac.alert_outcome",{outcome:!0===e?"acceptAll":"denyAll"})}};function D(e,t,i){const a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src=e;for(const e in t){const i=t[e];void 0!==i&&a.setAttribute(e,i)}if("function"==typeof i){let e=!1;a.onload=function(){!1===e&&(e=!0,i())}}document.getElementsByTagName("head")[0].appendChild(a)}const M=e=>({key:"facebookpixel",type:"analytic",name:"Facebook Pixel",uri:"https://www.facebook.com/privacy/policies/cookies/",needConsent:!0,lazyConsent:!1,cookies:["datr","fr","reg_ext_ref","reg_fb_gate","reg_fb_ref","sb","wd","x-src","_fbp"],js:function(){if(window.fbq)return;const t=window.fbq=function(){t.callMethod?t.callMethod.apply(t,arguments):t.queue.push(arguments)};window._fbq||(window._fbq=t),t.push=t,t.loaded=!0,t.version="2.0",t.queue=[],D("https://connect.facebook.net/en_US/fbevents.js",{id:"facebook-fbevents"},function(){window.fbq("init",e.fbPixelId),window.fbq("track","PageView"),"function"==typeof e.facebookpixelMore&&e.facebookpixelMore()})}}),R=e=>{const t=e.googleadsId;let i="_gat_gtag_"+t,a="_ga_"+t;return i=i.replace(/-/g,"_"),a=a.replace(/G-/g,""),{key:"googleads",type:"analytic",name:"Google Ads",uri:"https://policies.google.com/privacy",needConsent:!0,lazyConsent:!1,cookies:["_ga","_gat","_gid","__utma","__utmb","__utmc","__utmt","__utmz",i,a,"_gcl_au"],js:function(){window.dataLayer=window.dataLayer||[],D("https://www.googletagmanager.com/gtag/js?id="+e.googleadsId,{},function(){window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date),e.googleadsInitOptions?window.gtag("config",e.googleadsId,e.googleadsInitOptions):window.gtag("config",e.googleadsId),"function"==typeof e.googleadsMore&&e.googleadsMore()})}}},N=e=>{const t=e.googleanalyticsUa;let i="_gat_gtag_"+t,a="_ga_"+t;i=i.replace(/-/g,"_"),a=a.replace(/G-/g,"");return{key:"googleanalytics",type:"analytic",name:!0===e.googleanalyticsWithEnabledAdsLink?"Google Analytics (GA4) & Google Ads":"Google Analytics (GA4)",uri:"https://policies.google.com/privacy",needConsent:!0,lazyConsent:!1,cookies:["_ga","_gat","_gid","__utma","__utmb","__utmc","__utmt","__utmz",i,a,"_gcl_au"],js:function(){window.dataLayer=window.dataLayer||[],D("https://www.googletagmanager.com/gtag/js?id="+e.googleanalyticsUa,{},function(){window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date),e.googleanalyticsInitOptions?window.gtag("config",e.googleanalyticsUa,e.googleanalyticsInitOptions):window.gtag("config",e.googleanalyticsUa),"function"==typeof e.googleanalyticsMore&&e.googleanalyticsMore()})}}},z=e=>({key:"googletagmanager",type:"api",name:"Google Tag Manager",uri:"https://policies.google.com/privacy",needConsent:!0,lazyConsent:!1,cookies:["_ga","_gat","__utma","__utmb","__utmc","__utmt","__utmz","__gads","_drt_","FLC","exchange_uid","id","fc","rrs","rds","rv","uid","UIDR","UID","clid","ipinfo","acs"],js:function(){void 0!==e.googletagmanagerId&&(window.dataLayer=window.dataLayer||[],window.dataLayer.push({"gtm.start":(new Date).getTime(),event:"gtm.js"}),D("https://www.googletagmanager.com/gtm.js?id="+e.googletagmanagerId))}}),G=e=>({key:"signinwithapple",type:"other",name:"Sign In with Apple",uri:"https://www.apple.com/legal/privacy/en-ww/cookies/",needConsent:!0,lazyConsent:!0,cookies:[],js:function(){"function"==typeof e.signinwithappleMore?D("https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js",void 0,function(){e.signinwithappleMore()}):D("https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js")}}),O=e=>({key:"signinwithgoogle",type:"other",name:"Sign In with Google",uri:"https://policies.google.com/technologies/cookies#types-of-cookies",needConsent:!0,lazyConsent:!0,cookies:[],js:function(){"function"==typeof e.signinwithgoogleMore?D("https://accounts.google.com/gsi/client",void 0,function(){e.signinwithgoogleMore()}):D("https://accounts.google.com/gsi/client")}}),$=e=>({key:"subscribewithgoogle",type:"other",name:"Subscribe with Google",uri:"https://policies.google.com/technologies/cookies#types-of-cookies",needConsent:!0,lazyConsent:!0,cookies:[],js:function(){"function"==typeof e.subscribewithgoogleMore?D("https://news.google.com/swg/js/v1/swg.js",{"subscriptions-control":"manual"},function(){e.subscribewithgoogleMore()}):D("https://news.google.com/swg/js/v1/swg.js")}});S.withLanguages(function(){return{fr:b,en:w}}),S.withServices(function(e){return{acast:{key:"acast",type:"audio",name:"Acast",uri:"https://www.acast.com/en/privacy",needConsent:!0,lazyConsent:!0,cookies:[],js:function(){const e=document.getElementsByTagName("div");for(let t=0;t<e.length;t++)if(e[t].classList.contains("tarteaucitron-acast")){const i=e[t].getAttribute("data-tarteaucitron-src")??"";e[t].innerHTML=`<iframe src="${v(i)}" frameborder="0"></iframe>`}},fallback:function(e){const t=document.getElementsByTagName("div");for(let i=0;i<t.length;i++)if(t[i].classList.contains("tarteaucitron-acast")){const a=t[i].getAttribute("data-tarteaucitron-src")??"";t[i].innerHTML=`<div class="tarteaucitron-card-mask">\n <span>${e.placeholder.beforeName} <span class="tarteaucitron-card-type">Acast</span> ${e.placeholder.afterName}</span>\n <button onclick="GDPRConsent.activate('acast')">${e.allow}</button>\n <a href="${v(a)}" class="tarteaucitron-card-url" target="_blank">→ ${v(a)}</a>\n</div>`}}},facebook:{key:"facebook",type:"social",name:"Facebook",uri:"https://www.facebook.com/privacy/policies/cookies/",needConsent:!0,lazyConsent:!1,cookies:["xs","sb","fr","datr","dpr","c_user"],js:function(){D("//connect.facebook.net/"+k()+"/sdk.js",{id:"facebook-jssdk"})}},facebookpixel:M(e),facebookvideo:{key:"facebookvideo",type:"video",name:"Facebook Video",uri:"https://www.facebook.com/privacy/policies/cookies/",needConsent:!0,lazyConsent:!0,cookies:["xs","sb","fr","datr","dpr","c_user"],js:function(){const e=document.getElementsByTagName("div");for(let t=0;t<e.length;t++)if(e[t].classList.contains("tarteaucitron-facebookvideo")){const i=e[t].getAttribute("data-tarteaucitron-src")??"";if(e[t].innerHTML=`<div class="fb-video" data-href="${v(i)}" data-show-text="false"></div>`,null===document.getElementById("fb-root")){const i=window.fbAsyncInit||function(){},a=e[t];window.fbAsyncInit=function(){i(),window.FB.XFBML.parse(a)},null===document.getElementById("facebook-jssdk")&&D("//connect.facebook.net/"+k()+"/sdk.js",{id:"facebook-jssdk"})}else window.FB.XFBML.parse(e[t])}},fallback:function(e){const t=document.getElementsByTagName("div");for(let i=0;i<t.length;i++)if(t[i].classList.contains("tarteaucitron-facebookvideo")){const a=t[i].getAttribute("data-tarteaucitron-src")??"";t[i].innerHTML=`<div class="tarteaucitron-card-mask">\n <span>${e.placeholder.beforeName} <span class="tarteaucitron-card-type">Facebook Video</span> ${e.placeholder.afterName}</span>\n <button onclick="GDPRConsent.activate('facebookvideo')">${e.allow}</button>\n <a href="${v(a)}" class="tarteaucitron-card-url" target="_blank">→ ${v(a)}</a>\n</div>`}}},googleads:R(e),googleanalytics:N(e),googletagmanager:z(e),signinwithapple:G(e),signinwithgoogle:O(e),subscribewithgoogle:$(e),twitter:{key:"twitter",type:"social",name:"X (formerly Twitter)",uri:"https://support.twitter.com/articles/20170514",needConsent:!0,lazyConsent:!1,cookies:[],js:function(){D("//platform.twitter.com/widgets.js",{id:"twitter-wjs"})}},vimeo:{key:"vimeo",type:"video",name:"Vimeo",uri:"https://vimeo.com/privacy",needConsent:!0,lazyConsent:!0,cookies:["__utmt_player","__utma","__utmb","__utmc","__utmv","vuid","__utmz","player"],js:function(){const e=document.getElementsByTagName("div");for(let t=0;t<e.length;t++)if(e[t].classList.contains("tarteaucitron-vimeo")){const i=e[t].getAttribute("data-tarteaucitron-src")??"";e[t].innerHTML=`<iframe src="${v(i)}" scrolling="no" frameborder="0" allowfullscreen="true" allow="autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share"></iframe>`}},fallback:function(e){const t=document.getElementsByTagName("div");for(let i=0;i<t.length;i++)if(t[i].classList.contains("tarteaucitron-vimeo")){const a=t[i].getAttribute("data-tarteaucitron-src")??"";t[i].innerHTML=`<div class="tarteaucitron-card-mask">\n <span>${e.placeholder.beforeName} <span class="tarteaucitron-card-type">Vimeo</span> ${e.placeholder.afterName}</span>\n <button onclick="GDPRConsent.activate('vimeo')">${e.allow}</button>\n <a href="${v(a)}" class="tarteaucitron-card-url" target="_blank">→ ${v(a)}</a>\n</div>`}}},youtube:{key:"youtube",type:"video",name:"YouTube",uri:"https://policies.google.com/privacy",needConsent:!0,lazyConsent:!0,cookies:["VISITOR_INFO1_LIVE","YSC","PREF","GEUP"],js:function(){const e=document.getElementsByTagName("div");for(let t=0;t<e.length;t++)if(e[t].classList.contains("tarteaucitron-youtube")){const i=e[t].getAttribute("data-tarteaucitron-src")??"";e[t].innerHTML=`<iframe src="${v(i)}" scrolling="no" frameborder="0" allowfullscreen="true" allow="autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share"></iframe>`}},fallback:function(e){const t=document.getElementsByTagName("div");for(let i=0;i<t.length;i++)if(t[i].classList.contains("tarteaucitron-youtube")){const a=t[i].getAttribute("data-tarteaucitron-src")??"";t[i].innerHTML=`<div class="tarteaucitron-card-mask">\n <span>${e.placeholder.beforeName} <span class="tarteaucitron-card-type">YouTube</span> ${e.placeholder.afterName}</span>\n <button onclick="GDPRConsent.activate('youtube')">${e.allow}</button>\n <a href="${v(a)}" class="tarteaucitron-card-url" target="_blank">→ ${v(a)}</a>\n</div>`}}}}});var U=S;return t=t.default}()});