Socket
Socket
Sign inDemoInstall

vanilla-cookieconsent

Package Overview
Dependencies
0
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.8.0 to 2.8.1

types/types.d.ts

77

dist/cookieconsent.js
/*
CookieConsent v2.8.0
CookieConsent v2.8.1
https://www.github.com/orestbida/cookieconsent

@@ -7,39 +7,38 @@ Author Orest Bida

*/
(function(){var kb=function(eb){var e={mode:"opt-in",current_lang:"en",auto_language:null,autorun:!0,cookie_name:"cc_cookie",cookie_expiration:182,cookie_domain:window.location.hostname,cookie_path:"/",cookie_same_site:"Lax",use_rfc_cookie:!1,autoclear_cookies:!0,revision:0,script_selector:"data-cookiecategory"},m={},g,t={},C=null,K=!1,Q=!1,na=!1,Ca=!1,oa=!1,v,Y,U,pa,Da,Ea,Fa=!1,Z=!0,Sa="",V=[],xa=!1,Ga,Ha=[],Ta=[],Ia=[],Ua=!1,qa,Ja,Ka=[],ja=[],R=[],I=[],ya=[],ra=document.documentElement,L,sa,x,aa,
ta,W,S,T,ba,E,M,ua,ka,la,y,ca,da,ea,fa,Va=function(a){function b(n){return(a||document).querySelectorAll('a[data-cc="'+n+'"], button[data-cc="'+n+'"]')}function c(n,p){n.preventDefault?n.preventDefault():n.returnValue=!1;m.accept(p);m.hideSettings();m.hide()}for(var d=b("c-settings"),f=b("accept-all"),l=b("accept-necessary"),q=b("accept-selection"),h=0;h<d.length;h++)d[h].setAttribute("aria-haspopup","dialog"),z(d[h],"click",function(n){n.preventDefault?n.preventDefault():n.returnValue=!1;m.showSettings(0)});
for(h=0;h<f.length;h++)z(f[h],"click",function(n){c(n,"all")});for(h=0;h<q.length;h++)z(q[h],"click",function(n){c(n)});for(h=0;h<l.length;h++)z(l[h],"click",function(n){c(n,[])})},za=function(a,b){if(Object.prototype.hasOwnProperty.call(b,a))return a;if(0<va(b).length)return Object.prototype.hasOwnProperty.call(b,e.current_lang)?e.current_lang:va(b)[0]},Wa=function(){function a(c,d){var f=!1,l=!1;try{for(var q=c.querySelectorAll(b.join(':not([tabindex="-1"]), ')),h,n=q.length,p=0;p<n;)h=q[p].getAttribute("data-focus"),
l||"1"!==h?"0"===h&&(f=q[p],l||"0"===q[p+1].getAttribute("data-focus")||(l=q[p+1])):l=q[p],p++}catch(F){return c.querySelectorAll(b.join(", "))}d[0]=q[0];d[1]=q[q.length-1];d[2]=f;d[3]=l}var b=["[href]","button","input","details",'[tabindex="0"]'];a(M,ja);Q&&a(x,Ka)},La=function(a){!0===g.force_consent&&J(ra,"force--consent");if(!x){x=k("div");var b=k("div"),c=k("div");x.id="cm";b.id="c-inr-i";c.id="cm-ov";x.setAttribute("role","dialog");x.setAttribute("aria-modal","true");x.setAttribute("aria-hidden",
"false");x.setAttribute("aria-labelledby","c-ttl");x.setAttribute("aria-describedby","c-txt");sa.appendChild(x);sa.appendChild(c);x.style.visibility=c.style.visibility="hidden";c.style.opacity=0}if(c=g.languages[a].consent_modal.title)aa||(aa=k("div"),aa.id="c-ttl",aa.setAttribute("role","heading"),aa.setAttribute("aria-level","2"),b.appendChild(aa)),aa.innerHTML=c;c=g.languages[a].consent_modal.description;Fa&&(c=Z?c.replace("{{revision_message}}",""):c.replace("{{revision_message}}",Sa||g.languages[a].consent_modal.revision_message||
""));ta||(ta=k("div"),ta.id="c-txt",b.appendChild(ta));ta.innerHTML=c;c=g.languages[a].consent_modal.primary_btn;var d=g.languages[a].consent_modal.secondary_btn;if(c){if(!W){W=k("button");W.id="c-p-bn";W.className="c-bn";var f;"accept_all"===c.role&&(f="all");z(W,"click",function(){m.hide();m.accept(f)})}W.textContent=g.languages[a].consent_modal.primary_btn.text}d&&(S||(S=k("button"),S.id="c-s-bn",S.className="c-bn c_link","accept_necessary"===d.role?z(S,"click",function(){m.hide();m.accept([])}):
z(S,"click",function(){m.showSettings(0)})),S.textContent=g.languages[a].consent_modal.secondary_btn.text);a=g.gui_options;ba||(ba=k("div"),ba.id="c-inr",ba.appendChild(b));T||(T=k("div"),T.id="c-bns",a&&a.consent_modal&&!0===a.consent_modal.swap_buttons?(d&&T.appendChild(S),c&&T.appendChild(W),T.className="swap"):(c&&T.appendChild(W),d&&T.appendChild(S)),(c||d)&&ba.appendChild(T),x.appendChild(ba));Q=!0},ab=function(a){if(E)y=k("div"),y.id="s-bl";else{E=k("div");var b=k("div"),c=k("div"),d=k("div");
M=k("div");ua=k("div");var f=k("div");ka=k("button");var l=k("div");la=k("div");var q=k("div");E.id="s-cnt";b.id="c-vln";d.id="c-s-in";c.id="cs";ua.id="s-ttl";M.id="s-inr";f.id="s-hdr";la.id="s-bl";ka.id="s-c-bn";q.id="cs-ov";l.id="s-c-bnc";ka.className="c-bn";E.setAttribute("role","dialog");E.setAttribute("aria-modal","true");E.setAttribute("aria-hidden","true");E.setAttribute("aria-labelledby","s-ttl");ua.setAttribute("role","heading");E.style.visibility=q.style.visibility="hidden";q.style.opacity=
0;l.appendChild(ka);z(b,"keydown",function(ma){ma=ma||window.event;27===ma.keyCode&&m.hideSettings(0)},!0);z(ka,"click",function(){m.hideSettings(0)})}ka.setAttribute("aria-label",g.languages[a].settings_modal.close_btn_label||"Close");U=g.languages[a].settings_modal.blocks;Y=g.languages[a].settings_modal.cookie_table_headers;var h=U.length;ua.innerHTML=g.languages[a].settings_modal.title;for(var n=0;n<h;++n){var p=U[n].title,F=U[n].description,w=U[n].toggle,A=U[n].cookie_table,u=!0===g.remove_cookie_tables,
r=F&&"truthy"||!u&&A&&"truthy",B=k("div"),X=k("div");if(F){var Ma=k("div");Ma.className="p";Ma.insertAdjacentHTML("beforeend",F)}var D=k("div");D.className="title";B.className="c-bl";X.className="desc";if("undefined"!==typeof w){var N="c-ac-"+n,ha=r?k("button"):k("div"),G=k("label"),O=k("input"),P=k("span"),ia=k("span"),Xa=k("span"),Ya=k("span");ha.className=r?"b-tl exp":"b-tl";G.className="b-tg";O.className="c-tgl";Xa.className="on-i";Ya.className="off-i";P.className="c-tg";ia.className="t-lb";r&&
(ha.setAttribute("aria-expanded","false"),ha.setAttribute("aria-controls",N));O.type="checkbox";P.setAttribute("aria-hidden","true");var Aa=w.value;O.value=Aa;ia.textContent=p;ha.insertAdjacentHTML("beforeend",p);D.appendChild(ha);P.appendChild(Xa);P.appendChild(Ya);K?-1<H(t.level,Aa)?(O.checked=!0,!y&&R.push(!0)):!y&&R.push(!1):w.enabled?(O.checked=!0,!y&&R.push(!0),w.enabled&&!y&&Ia.push(Aa)):!y&&R.push(!1);!y&&I.push(Aa);w.readonly?(O.disabled=!0,J(P,"c-ro"),!y&&ya.push(!0)):!y&&ya.push(!1);J(X,
"b-acc");J(D,"b-bn");J(B,"b-ex");X.id=N;X.setAttribute("aria-hidden","true");G.appendChild(O);G.appendChild(P);G.appendChild(ia);D.appendChild(G);r&&function(ma,Na,Za){z(ha,"click",function(){$a(Na,"act")?(Oa(Na,"act"),Za.setAttribute("aria-expanded","false"),ma.setAttribute("aria-hidden","true")):(J(Na,"act"),Za.setAttribute("aria-expanded","true"),ma.setAttribute("aria-hidden","false"))},!1)}(X,B,ha)}else p&&(r=k("div"),r.className="b-tl",r.setAttribute("role","heading"),r.setAttribute("aria-level",
"3"),r.insertAdjacentHTML("beforeend",p),D.appendChild(r));p&&B.appendChild(D);F&&X.appendChild(Ma);if(!u&&"undefined"!==typeof A){r=document.createDocumentFragment();for(N=0;N<Y.length;++N)G=k("th"),u=Y[N],G.setAttribute("scope","col"),u&&(D=u&&va(u)[0],G.textContent=Y[N][D],r.appendChild(G));u=k("tr");u.appendChild(r);D=k("thead");D.appendChild(u);r=k("table");r.appendChild(D);N=document.createDocumentFragment();for(G=0;G<A.length;G++){O=k("tr");for(P=0;P<Y.length;++P)if(u=Y[P])D=va(u)[0],ia=k("td"),
ia.insertAdjacentHTML("beforeend",A[G][D]),ia.setAttribute("data-column",u[D]),O.appendChild(ia);N.appendChild(O)}A=k("tbody");A.appendChild(N);r.appendChild(A);X.appendChild(r)}if(w&&p||!w&&(p||F))B.appendChild(X),y?y.appendChild(B):la.appendChild(B)}ca||(ca=k("div"),ca.id="s-bns");ea||(ea=k("button"),ea.id="s-all-bn",ea.className="c-bn",ca.appendChild(ea),z(ea,"click",function(){m.hideSettings();m.hide();m.accept("all")}));ea.textContent=g.languages[a].settings_modal.accept_all_btn;if(h=g.languages[a].settings_modal.reject_all_btn)fa||
(fa=k("button"),fa.id="s-rall-bn",fa.className="c-bn",z(fa,"click",function(){m.hideSettings();m.hide();m.accept([])}),M.className="bns-t",ca.appendChild(fa)),fa.textContent=h;da||(da=k("button"),da.id="s-sv-bn",da.className="c-bn",ca.appendChild(da),z(da,"click",function(){m.hideSettings();m.hide();m.accept()}));da.textContent=g.languages[a].settings_modal.save_settings_btn;y?(M.replaceChild(y,la),la=y):(f.appendChild(ua),f.appendChild(l),M.appendChild(f),M.appendChild(la),M.appendChild(ca),d.appendChild(M),
c.appendChild(d),b.appendChild(c),E.appendChild(b),sa.appendChild(E),sa.appendChild(q))},fb=function(){L=k("div");L.id="cc--main";L.style.position="fixed";L.style.zIndex="1000000";L.innerHTML='\x3c!--[if lt IE 9 ]><div id="cc_div" class="cc_div ie"></div><![endif]--\x3e\x3c!--[if (gt IE 8)|!(IE)]>\x3c!--\x3e<div id="cc_div" class="cc_div"></div>\x3c!--<![endif]--\x3e';sa=L.children[0];var a=e.current_lang;Q&&La(a);ab(a);(eb||document.body).appendChild(L)};m.updateLanguage=function(a,b){if("string"===
typeof a)return a=za(a,g.languages),a!==e.current_lang||!0===b?(e.current_lang=a,Q&&(La(a),Va(ba)),ab(a),!0):!1};var cb=function(a){var b=U.length,c=-1;xa=!1;var d=wa("","all"),f=[e.cookie_domain,"."+e.cookie_domain];if("www."===e.cookie_domain.slice(0,4)){var l=e.cookie_domain.substr(4);f.push(l);f.push("."+l)}for(l=0;l<b;l++){var q=U[l];if(Object.prototype.hasOwnProperty.call(q,"toggle")){var h=-1<H(V,q.toggle.value);if(!R[++c]&&Object.prototype.hasOwnProperty.call(q,"cookie_table")&&(a||h)){var n=
q.cookie_table,p=va(Y[0])[0],F=n.length;"on_disable"===q.toggle.reload&&h&&(xa=!0);for(h=0;h<F;h++){var w=n[h],A=[],u=w[p],r=w.is_regex||!1,B=w.domain||null;w=w.path||!1;B&&(f=[B,"."+B]);if(r)for(r=0;r<d.length;r++)d[r].match(u)&&A.push(d[r]);else u=H(d,u),-1<u&&A.push(d[u]);0<A.length&&(bb(A,w,f),"on_clear"===q.toggle.reload&&(xa=!0))}}}}},gb=function(a){V=[];var b=document.querySelectorAll(".c-tgl")||[];if(0<b.length)for(var c=0;c<b.length;c++)-1!==H(a,I[c])?(b[c].checked=!0,R[c]||(V.push(I[c]),
R[c]=!0)):(b[c].checked=!1,R[c]&&(V.push(I[c]),R[c]=!1));K&&e.autoclear_cookies&&0<V.length&&cb();t={level:a,revision:e.revision,data:C,rfc_cookie:e.use_rfc_cookie};if(!K||0<V.length||!Z)Z=!0,Ga=Pa(Qa()),Ra(e.cookie_name,JSON.stringify(t)),Ba();if(!K&&(e.autoclear_cookies&&cb(!0),"function"===typeof Ea&&Ea(m.getUserPreferences(),t),"function"===typeof pa&&pa(t),K=!0,"opt-in"===e.mode))return;"function"===typeof Da&&0<V.length&&Da(t,V);xa&&window.location.reload()},hb=function(a,b){if("string"!==typeof a||
""===a||document.getElementById("cc--style"))b();else{var c=k("style");c.id="cc--style";var d=new XMLHttpRequest;d.onreadystatechange=function(){4===this.readyState&&200===this.status&&(c.setAttribute("type","text/css"),c.styleSheet?c.styleSheet.cssText=this.responseText:c.appendChild(document.createTextNode(this.responseText)),document.getElementsByTagName("head")[0].appendChild(c),b())};d.open("GET",a);d.send()}},H=function(a,b){for(var c=a.length,d=0;d<c;d++)if(a[d]===b)return d;return-1},k=function(a){var b=
document.createElement(a);"button"===a&&b.setAttribute("type",a);return b},ib=function(a,b){return"browser"===e.auto_language?(b=navigator.language||navigator.browserLanguage,2<b.length&&(b=b[0]+b[1]),b=b.toLowerCase(),za(b,a)):"document"===e.auto_language?za(document.documentElement.lang,a):"string"===typeof b?e.current_lang=za(b,a):e.current_lang},jb=function(){var a=!1,b=!1;z(document,"keydown",function(c){c=c||window.event;"Tab"===c.key&&(v&&(c.shiftKey?document.activeElement===v[0]&&(v[1].focus(),
c.preventDefault()):document.activeElement===v[1]&&(v[0].focus(),c.preventDefault()),b||oa||(b=!0,!a&&c.preventDefault(),c.shiftKey?v[3]?v[2]?v[2].focus():v[0].focus():v[1].focus():v[3]?v[3].focus():v[0].focus())),!b&&(a=!0))});document.contains&&z(L,"click",function(c){c=c||window.event;Ca?M.contains(c.target)?oa=!0:(m.hideSettings(0),oa=!1):na&&x.contains(c.target)&&(oa=!0)},!0)},db=function(a,b){function c(f,l,q,h,n,p,F){p=p&&p.split(" ")||[];if(-1<H(l,n)&&(J(f,n),("bar"!==n||"middle"!==p[0])&&
-1<H(q,p[0])))for(l=0;l<p.length;l++)J(f,p[l]);-1<H(h,F)&&J(f,F)}if("object"===typeof a){var d=a.consent_modal;a=a.settings_modal;Q&&d&&c(x,["box","bar","cloud"],["top","middle","bottom"],["zoom","slide"],d.layout,d.position,d.transition);!b&&a&&c(E,["bar"],["left","right"],["zoom","slide"],a.layout,a.position,a.transition)}};m.allowedCategory=function(a){var b=K||"opt-in"===e.mode?JSON.parse(wa(e.cookie_name,"one",!0)||"{}").level||[]:Ia;return-1<H(b,a)};m.run=function(a){if(!document.getElementById("cc_div")&&
(g=a,"number"===typeof g.cookie_expiration&&(e.cookie_expiration=g.cookie_expiration),"number"===typeof g.cookie_necessary_only_expiration&&(e.cookie_necessary_only_expiration=g.cookie_necessary_only_expiration),"boolean"===typeof g.autorun&&(e.autorun=g.autorun),"string"===typeof g.cookie_domain&&(e.cookie_domain=g.cookie_domain),"string"===typeof g.cookie_same_site&&(e.cookie_same_site=g.cookie_same_site),"string"===typeof g.cookie_path&&(e.cookie_path=g.cookie_path),"string"===typeof g.cookie_name&&
(e.cookie_name=g.cookie_name),"function"===typeof g.onAccept&&(pa=g.onAccept),"function"===typeof g.onFirstAction&&(Ea=g.onFirstAction),"function"===typeof g.onChange&&(Da=g.onChange),"opt-out"===g.mode&&(e.mode="opt-out"),"number"===typeof g.revision&&(-1<g.revision&&(e.revision=g.revision),Fa=!0),"boolean"===typeof g.autoclear_cookies&&(e.autoclear_cookies=g.autoclear_cookies),!0===g.use_rfc_cookie&&(e.use_rfc_cookie=!0),!0===g.hide_from_bots&&(Ua=navigator&&(navigator.userAgent&&/bot|crawl|spider|slurp|teoma/i.test(navigator.userAgent)||
navigator.webdriver)),e.page_scripts=!0===g.page_scripts,e.page_scripts_order=!1!==g.page_scripts_order,"browser"===g.auto_language||!0===g.auto_language?e.auto_language="browser":"document"===g.auto_language&&(e.auto_language="document"),e.current_lang=ib(g.languages,g.current_lang),!Ua))if(t=JSON.parse(wa(e.cookie_name,"one",!0)||"{}"),K=void 0!==t.level,C=void 0!==t.data?t.data:null,Z="number"===typeof a.revision?K?-1<a.revision?t.revision===e.revision:!0:!0:!0,Q=!K||!Z,fb(),hb(a.theme_css,function(){Wa();
db(a.gui_options);Va();e.autorun&&Q&&m.show(a.delay||0);setTimeout(function(){J(L,"c--anim")},30);setTimeout(function(){jb()},100)}),K&&Z){var b="boolean"===typeof t.rfc_cookie;if(!b||b&&t.rfc_cookie!==e.use_rfc_cookie)t.rfc_cookie=e.use_rfc_cookie,Ra(e.cookie_name,JSON.stringify(t));Ga=Pa(Qa());Ba();"function"===typeof pa&&pa(t)}else"opt-out"===e.mode&&Ba(Ia)};m.showSettings=function(a){setTimeout(function(){J(ra,"show--settings");E.setAttribute("aria-hidden","false");Ca=!0;setTimeout(function(){na?
Ja=document.activeElement:qa=document.activeElement;0!==ja.length&&(ja[3]?ja[3].focus():ja[0].focus(),v=ja)},200)},0<a?a:0)};var Ba=function(a){if(e.page_scripts){var b=document.querySelectorAll("script["+e.script_selector+"]"),c=e.page_scripts_order,d=a||t.level||[],f=function(l,q){if(q<l.length){var h=l[q],n=h.getAttribute(e.script_selector);if(-1<H(d,n)){h.type="text/javascript";h.removeAttribute(e.script_selector);(n=h.getAttribute("data-src"))&&h.removeAttribute("data-src");var p=k("script");
p.textContent=h.innerHTML;(function(F,w){for(var A=w.attributes,u=A.length,r=0;r<u;r++){var B=A[r].nodeName;F.setAttribute(B,w[B]||w.getAttribute(B))}})(p,h);n?p.src=n:n=h.src;n&&(c?p.readyState?p.onreadystatechange=function(){if("loaded"===p.readyState||"complete"===p.readyState)p.onreadystatechange=null,f(l,++q)}:p.onload=function(){p.onload=null;f(l,++q)}:n=!1);h.parentNode.replaceChild(p,h);if(n)return}f(l,++q)}};f(b,0)}};m.set=function(a,b){switch(a){case "data":a=b.value;var c=!1;if("update"===
b.mode)if(C=m.get("data"),(b=typeof C===typeof a)&&"object"===typeof C){!C&&(C={});for(var d in a)C[d]!==a[d]&&(C[d]=a[d],c=!0)}else!b&&C||C===a||(C=a,c=!0);else C=a,c=!0;c&&(t.data=C,Ra(e.cookie_name,JSON.stringify(t)));return c;case "revision":return d=b.value,a=b.prompt_consent,b=b.message,L&&"number"===typeof d&&t.revision!==d?(Fa=!0,Sa=b,Z=!1,e.revision=d,!0===a?(La(g),db(g.gui_options,!0),Wa(),m.show()):m.accept(),b=!0):b=!1,b;default:return!1}};m.get=function(a,b){return JSON.parse(wa(b||e.cookie_name,
"one",!0)||"{}")[a]};m.getConfig=function(a){return e[a]||g[a]};var Qa=function(){Ha=t.level||[];Ta=I.filter(function(a){return-1===H(Ha,a)});return{accepted:Ha,rejected:Ta}},Pa=function(a){var b="custom",c=ya.filter(function(d){return!0===d}).length;a.accepted.length===I.length?b="all":a.accepted.length===c&&(b="necessary");return b};m.getUserPreferences=function(){var a=Qa();return{accept_type:Pa(a),accepted_categories:a.accepted,rejected_categories:a.rejected}};m.loadScript=function(a,b,c){var d=
"function"===typeof b;if(document.querySelector('script[src="'+a+'"]'))d&&b();else{var f=k("script");if(c&&0<c.length)for(var l=0;l<c.length;++l)c[l]&&f.setAttribute(c[l].name,c[l].value);d&&(f.readyState?f.onreadystatechange=function(){if("loaded"===f.readyState||"complete"===f.readyState)f.onreadystatechange=null,b()}:f.onload=b);f.src=a;(document.head?document.head:document.getElementsByTagName("head")[0]).appendChild(f)}};m.updateScripts=function(){Ba()};m.show=function(a){Q&&setTimeout(function(){J(ra,
"show--consent");x.setAttribute("aria-hidden","false");na=!0;setTimeout(function(){qa=document.activeElement;v=Ka},200)},0<a?a:0)};m.hide=function(){Q&&(Oa(ra,"show--consent"),x.setAttribute("aria-hidden","true"),na=!1,setTimeout(function(){qa.focus();v=null},200))};m.hideSettings=function(){Oa(ra,"show--settings");Ca=!1;E.setAttribute("aria-hidden","true");setTimeout(function(){na?(Ja&&Ja.focus(),v=Ka):(qa&&qa.focus(),v=null);oa=!1},200)};m.accept=function(a,b){a=a||void 0;var c=b||[];b=[];var d=
function(){for(var l=document.querySelectorAll(".c-tgl")||[],q=[],h=0;h<l.length;h++)l[h].checked&&q.push(l[h].value);return q};if(a)if("object"===typeof a&&"number"===typeof a.length)for(var f=0;f<a.length;f++)-1!==H(I,a[f])&&b.push(a[f]);else"string"===typeof a&&("all"===a?b=I.slice():-1!==H(I,a)&&b.push(a));else b=d();if(1<=c.length)for(f=0;f<c.length;f++)b=b.filter(function(l){return l!==c[f]});for(f=0;f<I.length;f++)!0===ya[f]&&-1===H(b,I[f])&&b.push(I[f]);gb(b)};m.eraseCookies=function(a,b,
c){var d=[];c=c?[c,"."+c]:[e.cookie_domain,"."+e.cookie_domain];if("object"===typeof a&&0<a.length)for(var f=0;f<a.length;f++)this.validCookie(a[f])&&d.push(a[f]);else this.validCookie(a)&&d.push(a);bb(d,b,c)};var Ra=function(a,b){var c=e.cookie_expiration;"number"===typeof e.cookie_necessary_only_expiration&&"necessary"===Ga&&(c=e.cookie_necessary_only_expiration);b=e.use_rfc_cookie?encodeURIComponent(b):b;var d=new Date;d.setTime(d.getTime()+864E5*c);c="; expires="+d.toUTCString();a=a+"="+(b||"")+
c+"; Path="+e.cookie_path+";";a+=" SameSite="+e.cookie_same_site+";";-1<window.location.hostname.indexOf(".")&&(a+=" Domain="+e.cookie_domain+";");"https:"===window.location.protocol&&(a+=" Secure;");document.cookie=a},wa=function(a,b,c){var d;if("one"===b){if((d=(d=document.cookie.match("(^|;)\\s*"+a+"\\s*=\\s*([^;]+)"))?c?d.pop():a:"")&&a===e.cookie_name){try{d=JSON.parse(d)}catch(f){try{d=JSON.parse(decodeURIComponent(d))}catch(l){d={}}}d=JSON.stringify(d)}}else if("all"===b)for(a=document.cookie.split(/;\s*/),
d=[],b=0;b<a.length;b++)d.push(a[b].split("=")[0]);return d},bb=function(a,b,c){b=b?b:"/";for(var d=0;d<a.length;d++)for(var f=0;f<c.length;f++)document.cookie=a[d]+"=; path="+b+(-1<c[f].indexOf(".")?"; domain="+c[f]:"")+"; Expires=Thu, 01 Jan 1970 00:00:01 GMT;"};m.validCookie=function(a){return""!==wa(a,"one",!0)};var z=function(a,b,c,d){a.addEventListener?!0===d?a.addEventListener(b,c,{passive:!0}):a.addEventListener(b,c,!1):a.attachEvent("on"+b,c)},va=function(a){if("object"===typeof a){var b=
[],c=0;for(b[c++]in a);return b}},J=function(a,b){a.classList?a.classList.add(b):$a(a,b)||(a.className+=" "+b)},Oa=function(a,b){a.classList?a.classList.remove(b):a.className=a.className.replace(new RegExp("(\\s|^)"+b+"(\\s|$)")," ")},$a=function(a,b){return a.classList?a.classList.contains(b):!!a.className.match(new RegExp("(\\s|^)"+b+"(\\s|$)"))};return m};"function"!==typeof window.initCookieConsent&&(window.initCookieConsent=kb)})();
(function(){var jb=function(bb){var e={mode:"opt-in",current_lang:"en",auto_language:null,autorun:!0,page_scripts:!0,hide_from_bots:!0,cookie_name:"cc_cookie",cookie_expiration:182,cookie_domain:window.location.hostname,cookie_path:"/",cookie_same_site:"Lax",use_rfc_cookie:!1,autoclear_cookies:!0,revision:0,script_selector:"data-cookiecategory"},m={},g,t={},B=null,X,Y,na,S=!0,N=!1,oa=!1,Ea=!1,pa=!1,v,Z,T,qa,Fa,Ga,Ha=!1,ya=!0,U=[],za=!1,Ia,Ja=[],Ta=[],Ka=[],Ua=!1,ra,La,Ma=[],ja=[],O=[],G=[],Aa=[],
sa=document.documentElement,P,ta,x,aa,ua,V,Q,R,ba,E,J,va,ka,la,y,ca,da,ea,fa,Va=function(a){function b(n){return(a||document).querySelectorAll('a[data-cc="'+n+'"], button[data-cc="'+n+'"]')}function c(n,q){n.preventDefault();m.accept(q);m.hideSettings();m.hide()}for(var d=b("c-settings"),f=b("accept-all"),l=b("accept-necessary"),p=b("accept-custom"),k=0;k<d.length;k++)d[k].setAttribute("aria-haspopup","dialog"),z(d[k],"click",function(n){n.preventDefault();m.showSettings(0)});for(k=0;k<f.length;k++)z(f[k],
"click",function(n){c(n,"all")});for(k=0;k<p.length;k++)z(p[k],"click",function(n){c(n)});for(k=0;k<l.length;k++)z(l[k],"click",function(n){c(n,[])})},Ba=function(a,b){if(Object.prototype.hasOwnProperty.call(b,a))return a;if(0<wa(b).length)return Object.prototype.hasOwnProperty.call(b,e.current_lang)?e.current_lang:wa(b)[0]},cb=function(){function a(c,d){var f=!1,l=!1;try{for(var p=c.querySelectorAll(b.join(':not([tabindex="-1"]), ')),k,n=p.length,q=0;q<n;)k=p[q].getAttribute("data-focus"),l||"1"!==
k?"0"===k&&(f=p[q],l||"0"===p[q+1].getAttribute("data-focus")||(l=p[q+1])):l=p[q],q++}catch(A){return c.querySelectorAll(b.join(", "))}d[0]=p[0];d[1]=p[p.length-1];d[2]=f;d[3]=l}var b=["[href]","button","input","details",'[tabindex="0"]'];a(J,ja);N&&a(x,Ma)},Na=function(a){!0===g.force_consent&&H(sa,"force--consent");if(!x){x=h("div");var b=h("div"),c=h("div");x.id="cm";b.id="c-inr-i";c.id="cm-ov";x.setAttribute("role","dialog");x.setAttribute("aria-modal","true");x.setAttribute("aria-hidden","false");
x.setAttribute("aria-labelledby","c-ttl");x.setAttribute("aria-describedby","c-txt");ta.appendChild(x);ta.appendChild(c);x.style.visibility=c.style.visibility="hidden";c.style.opacity=0}if(c=g.languages[a].consent_modal.title)aa||(aa=h("div"),aa.id="c-ttl",aa.setAttribute("role","heading"),aa.setAttribute("aria-level","2"),b.appendChild(aa)),aa.innerHTML=c;c=g.languages[a].consent_modal.description;Ha&&(c=ya?c.replace("{{revision_message}}",""):c.replace("{{revision_message}}",g.languages[a].consent_modal.revision_message||
""));ua||(ua=h("div"),ua.id="c-txt",b.appendChild(ua));ua.innerHTML=c;c=g.languages[a].consent_modal.primary_btn;var d=g.languages[a].consent_modal.secondary_btn;if(c){if(!V){V=h("button");V.id="c-p-bn";V.className="c-bn";var f;"accept_all"===c.role&&(f="all");z(V,"click",function(){m.hide();m.accept(f)})}V.innerHTML=g.languages[a].consent_modal.primary_btn.text}d&&(Q||(Q=h("button"),Q.id="c-s-bn",Q.className="c-bn c_link","accept_necessary"===d.role?z(Q,"click",function(){m.hide();m.accept([])}):
z(Q,"click",function(){m.showSettings(0)})),Q.innerHTML=g.languages[a].consent_modal.secondary_btn.text);a=g.gui_options;ba||(ba=h("div"),ba.id="c-inr",ba.appendChild(b));R||(R=h("div"),R.id="c-bns",a&&a.consent_modal&&!0===a.consent_modal.swap_buttons?(d&&R.appendChild(Q),c&&R.appendChild(V),R.className="swap"):(c&&R.appendChild(V),d&&R.appendChild(Q)),(c||d)&&ba.appendChild(R),x.appendChild(ba));N=!0},Za=function(a){if(E)y=h("div"),y.id="s-bl";else{E=h("div");var b=h("div"),c=h("div"),d=h("div");
J=h("div");va=h("div");var f=h("div");ka=h("button");var l=h("div");la=h("div");var p=h("div");E.id="s-cnt";b.id="c-vln";d.id="c-s-in";c.id="cs";va.id="s-ttl";J.id="s-inr";f.id="s-hdr";la.id="s-bl";ka.id="s-c-bn";p.id="cs-ov";l.id="s-c-bnc";ka.className="c-bn";E.setAttribute("role","dialog");E.setAttribute("aria-modal","true");E.setAttribute("aria-hidden","true");E.setAttribute("aria-labelledby","s-ttl");va.setAttribute("role","heading");E.style.visibility=p.style.visibility="hidden";p.style.opacity=
0;l.appendChild(ka);z(b,"keydown",function(ma){ma=ma||window.event;27===ma.keyCode&&m.hideSettings(0)},!0);z(ka,"click",function(){m.hideSettings(0)})}ka.setAttribute("aria-label",g.languages[a].settings_modal.close_btn_label||"Close");T=g.languages[a].settings_modal.blocks;Z=g.languages[a].settings_modal.cookie_table_headers;var k=T.length;va.innerHTML=g.languages[a].settings_modal.title;for(var n=0;n<k;++n){var q=T[n].title,A=T[n].description,w=T[n].toggle,C=T[n].cookie_table,u=!0===g.remove_cookie_tables,
r=A&&"truthy"||!u&&C&&"truthy",I=h("div"),W=h("div");if(A){var Oa=h("div");Oa.className="p";Oa.insertAdjacentHTML("beforeend",A)}var D=h("div");D.className="title";I.className="c-bl";W.className="desc";if("undefined"!==typeof w){var K="c-ac-"+n,ha=r?h("button"):h("div"),F=h("label"),L=h("input"),M=h("span"),ia=h("span"),Wa=h("span"),Xa=h("span");ha.className=r?"b-tl exp":"b-tl";F.className="b-tg";L.className="c-tgl";Wa.className="on-i";Xa.className="off-i";M.className="c-tg";ia.className="t-lb";r&&
(ha.setAttribute("aria-expanded","false"),ha.setAttribute("aria-controls",K));L.type="checkbox";M.setAttribute("aria-hidden","true");var Ca=w.value;L.value=Ca;ia.textContent=q;ha.insertAdjacentHTML("beforeend",q);D.appendChild(ha);M.appendChild(Wa);M.appendChild(Xa);S?w.enabled?(L.checked=!0,!y&&O.push(!0),w.enabled&&!y&&Ka.push(Ca)):!y&&O.push(!1):-1<t.categories.indexOf(Ca)?(L.checked=!0,!y&&O.push(!0)):!y&&O.push(!1);!y&&G.push(Ca);w.readonly?(L.disabled=!0,H(M,"c-ro"),!y&&Aa.push(!0)):!y&&Aa.push(!1);
H(W,"b-acc");H(D,"b-bn");H(I,"b-ex");W.id=K;W.setAttribute("aria-hidden","true");F.appendChild(L);F.appendChild(M);F.appendChild(ia);D.appendChild(F);r&&function(ma,Pa,Ya){z(ha,"click",function(){Pa.classList.contains("act")?(Pa.classList.remove("act"),Ya.setAttribute("aria-expanded","false"),ma.setAttribute("aria-hidden","true")):(H(Pa,"act"),Ya.setAttribute("aria-expanded","true"),ma.setAttribute("aria-hidden","false"))},!1)}(W,I,ha)}else q&&(r=h("div"),r.className="b-tl",r.setAttribute("role",
"heading"),r.setAttribute("aria-level","3"),r.insertAdjacentHTML("beforeend",q),D.appendChild(r));q&&I.appendChild(D);A&&W.appendChild(Oa);if(!u&&"undefined"!==typeof C){r=document.createDocumentFragment();for(K=0;K<Z.length;++K)F=h("th"),u=Z[K],F.setAttribute("scope","col"),u&&(D=u&&wa(u)[0],F.textContent=Z[K][D],r.appendChild(F));u=h("tr");u.appendChild(r);D=h("thead");D.appendChild(u);r=h("table");r.appendChild(D);K=document.createDocumentFragment();for(F=0;F<C.length;F++){L=h("tr");for(M=0;M<
Z.length;++M)if(u=Z[M])D=wa(u)[0],ia=h("td"),ia.insertAdjacentHTML("beforeend",C[F][D]),ia.setAttribute("data-column",u[D]),L.appendChild(ia);K.appendChild(L)}C=h("tbody");C.appendChild(K);r.appendChild(C);W.appendChild(r)}if(w&&q||!w&&(q||A))I.appendChild(W),y?y.appendChild(I):la.appendChild(I)}ca||(ca=h("div"),ca.id="s-bns");ea||(ea=h("button"),ea.id="s-all-bn",ea.className="c-bn",ca.appendChild(ea),z(ea,"click",function(){m.hideSettings();m.hide();m.accept("all")}));ea.innerHTML=g.languages[a].settings_modal.accept_all_btn;
if(k=g.languages[a].settings_modal.reject_all_btn)fa||(fa=h("button"),fa.id="s-rall-bn",fa.className="c-bn",z(fa,"click",function(){m.hideSettings();m.hide();m.accept([])}),J.className="bns-t",ca.appendChild(fa)),fa.innerHTML=k;da||(da=h("button"),da.id="s-sv-bn",da.className="c-bn",ca.appendChild(da),z(da,"click",function(){m.hideSettings();m.hide();m.accept()}));da.innerHTML=g.languages[a].settings_modal.save_settings_btn;y?(J.replaceChild(y,la),la=y):(f.appendChild(va),f.appendChild(l),J.appendChild(f),
J.appendChild(la),J.appendChild(ca),d.appendChild(J),c.appendChild(d),b.appendChild(c),E.appendChild(b),ta.appendChild(E),ta.appendChild(p))},db=function(){P=h("div");P.id="cc--main";P.style.position="fixed";P.style.zIndex="1000000";P.innerHTML='\x3c!--[if lt IE 9 ]><div id="cc_div" class="cc_div ie"></div><![endif]--\x3e\x3c!--[if (gt IE 8)|!(IE)]>\x3c!--\x3e<div id="cc_div" class="cc_div"></div>\x3c!--<![endif]--\x3e';ta=P.children[0];var a=e.current_lang;N&&Na(a);Za(a);(bb||document.body).appendChild(P)};
m.updateLanguage=function(a,b){if("string"===typeof a)return a=Ba(a,g.languages),a!==e.current_lang||!0===b?(e.current_lang=a,N&&(Na(a),Va(ba)),Za(a),!0):!1};var ab=function(a){var b=T.length,c=-1;za=!1;var d=xa("","all"),f=[e.cookie_domain,"."+e.cookie_domain];if("www."===e.cookie_domain.slice(0,4)){var l=e.cookie_domain.substr(4);f.push(l);f.push("."+l)}for(l=0;l<b;l++){var p=T[l];if(Object.prototype.hasOwnProperty.call(p,"toggle")){var k=-1<U.indexOf(p.toggle.value);if(!O[++c]&&Object.prototype.hasOwnProperty.call(p,
"cookie_table")&&(a||k)){var n=p.cookie_table,q=wa(Z[0])[0],A=n.length;"on_disable"===p.toggle.reload&&k&&(za=!0);for(k=0;k<A;k++){var w=n[k],C=[],u=w[q],r=w.is_regex||!1,I=w.domain||null;w=w.path||!1;I&&(f=[I,"."+I]);if(r)for(r=0;r<d.length;r++)d[r].match(u)&&C.push(d[r]);else u=d.indexOf(u),-1<u&&C.push(d[u]);0<C.length&&($a(C,w,f),"on_clear"===p.toggle.reload&&(za=!0))}}}}},fb=function(a){U=[];var b=document.querySelectorAll(".c-tgl")||[];if(0<b.length)for(var c=0;c<b.length;c++)-1!==a.indexOf(G[c])?
(b[c].checked=!0,O[c]||(U.push(G[c]),O[c]=!0)):(b[c].checked=!1,O[c]&&(U.push(G[c]),O[c]=!1));!S&&e.autoclear_cookies&&0<U.length&&ab();X||=new Date;na||=eb();t={categories:a,revision:e.revision,data:B,rfc_cookie:e.use_rfc_cookie,consent_date:X.toISOString(),consent_uuid:na};if(S||0<U.length)ya=!0,Y=Y?new Date:X,t.last_consent_update=Y.toISOString(),Ia=Qa(Ra()),Sa(e.cookie_name,JSON.stringify(t)),Da();if(S&&(e.autoclear_cookies&&ab(!0),"function"===typeof Ga&&Ga(m.getUserPreferences(),t),"function"===
typeof qa&&qa(t),S=!1,"opt-in"===e.mode))return;"function"===typeof Fa&&0<U.length&&Fa(t,U);za&&window.location.reload()},h=function(a){var b=document.createElement(a);"button"===a&&b.setAttribute("type",a);return b},eb=function(){return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,function(a){return(a^(window.crypto||window.msCrypto).getRandomValues(new Uint8Array(1))[0]&15>>a/4).toString(16)})},gb=function(a,b){return"browser"===e.auto_language?(b=navigator.language||navigator.browserLanguage,
2<b.length&&(b=b[0]+b[1]),b=b.toLowerCase(),Ba(b,a)):"document"===e.auto_language?Ba(document.documentElement.lang,a):"string"===typeof b?e.current_lang=Ba(b,a):e.current_lang},hb=function(){var a=!1,b=!1;z(document,"keydown",function(c){c=c||window.event;"Tab"===c.key&&(v&&(c.shiftKey?document.activeElement===v[0]&&(v[1].focus(),c.preventDefault()):document.activeElement===v[1]&&(v[0].focus(),c.preventDefault()),b||pa||(b=!0,!a&&c.preventDefault(),c.shiftKey?v[3]?v[2]?v[2].focus():v[0].focus():v[1].focus():
v[3]?v[3].focus():v[0].focus())),!b&&(a=!0))});document.contains&&z(P,"click",function(c){c=c||window.event;Ea?J.contains(c.target)?pa=!0:(m.hideSettings(0),pa=!1):oa&&x.contains(c.target)&&(pa=!0)},!0)},ib=function(a,b){function c(f,l,p,k,n,q,A){q=q&&q.split(" ")||[];if(-1<l.indexOf(n)&&(H(f,n),("bar"!==n||"middle"!==q[0])&&-1<p.indexOf(q[0])))for(l=0;l<q.length;l++)H(f,q[l]);-1<k.indexOf(A)&&H(f,A)}if("object"===typeof a){var d=a.consent_modal;a=a.settings_modal;N&&d&&c(x,["box","bar","cloud"],
["top","middle","bottom"],["zoom","slide"],d.layout,d.position,d.transition);!b&&a&&c(E,["bar"],["left","right"],["zoom","slide"],a.layout,a.position,a.transition)}};m.allowedCategory=function(a){return-1<(S&&"opt-in"!==e.mode?Ka:JSON.parse(xa(e.cookie_name,"one",!0)||"{}").categories||[]).indexOf(a)};m.run=function(a){if(!document.getElementById("cc_div")&&(g=a,"number"===typeof g.cookie_expiration&&(e.cookie_expiration=g.cookie_expiration),"number"===typeof g.cookie_necessary_only_expiration&&(e.cookie_necessary_only_expiration=
g.cookie_necessary_only_expiration),"boolean"===typeof g.autorun&&(e.autorun=g.autorun),"string"===typeof g.cookie_domain&&(e.cookie_domain=g.cookie_domain),"string"===typeof g.cookie_same_site&&(e.cookie_same_site=g.cookie_same_site),"string"===typeof g.cookie_path&&(e.cookie_path=g.cookie_path),"string"===typeof g.cookie_name&&(e.cookie_name=g.cookie_name),"function"===typeof g.onAccept&&(qa=g.onAccept),"function"===typeof g.onFirstAction&&(Ga=g.onFirstAction),"function"===typeof g.onChange&&(Fa=
g.onChange),"opt-out"===g.mode&&(e.mode="opt-out"),"number"===typeof g.revision&&(-1<g.revision&&(e.revision=g.revision),Ha=!0),"boolean"===typeof g.autoclear_cookies&&(e.autoclear_cookies=g.autoclear_cookies),!0===g.use_rfc_cookie&&(e.use_rfc_cookie=!0),!0===g.hide_from_bots&&(Ua=navigator&&(navigator.userAgent&&/bot|crawl|spider|slurp|teoma/i.test(navigator.userAgent)||navigator.webdriver)),e.page_scripts=!0===g.page_scripts,"browser"===g.auto_language||!0===g.auto_language?e.auto_language="browser":
"document"===g.auto_language&&(e.auto_language="document"),e.current_lang=gb(g.languages,g.current_lang),!Ua)){t=JSON.parse(xa(e.cookie_name,"one",!0)||"{}");na=t.consent_uuid;var b=void 0!==na;(X=t.consent_date)&&(X=new Date(X));(Y=t.last_consent_update)&&(Y=new Date(Y));B=void 0!==t.data?t.data:null;Ha&&t.revision!==e.revision&&(ya=!1);N=S=!b||!ya||!X||!Y||!na;db();cb();ib(a.gui_options);Va();e.autorun&&N&&m.show(a.delay||0);setTimeout(function(){H(P,"c--anim")},30);setTimeout(function(){hb()},
100);if(S)"opt-out"===e.mode&&Da(Ka);else{a="boolean"===typeof t.rfc_cookie;if(!a||a&&t.rfc_cookie!==e.use_rfc_cookie)t.rfc_cookie=e.use_rfc_cookie,Sa(e.cookie_name,JSON.stringify(t));Ia=Qa(Ra());Da();"function"===typeof qa&&qa(t)}}};m.showSettings=function(a){setTimeout(function(){H(sa,"show--settings");E.setAttribute("aria-hidden","false");Ea=!0;setTimeout(function(){oa?La=document.activeElement:ra=document.activeElement;0!==ja.length&&(ja[3]?ja[3].focus():ja[0].focus(),v=ja)},200)},0<a?a:0)};var Da=
function(a){if(e.page_scripts){var b=document.querySelectorAll("script["+e.script_selector+"]"),c=a||t.categories||[],d=function(f,l){if(l<f.length){var p=f[l],k=p.getAttribute(e.script_selector);if(-1<c.indexOf(k)){p.type="text/javascript";p.removeAttribute(e.script_selector);(k=p.getAttribute("data-src"))&&p.removeAttribute("data-src");var n=h("script");n.textContent=p.innerHTML;(function(q,A){for(var w=A.attributes,C=w.length,u=0;u<C;u++){var r=w[u].nodeName;q.setAttribute(r,A[r]||A.getAttribute(r))}})(n,
p);k?n.src=k:k=p.src;k&&(n.readyState?n.onreadystatechange=function(){if("loaded"===n.readyState||"complete"===n.readyState)n.onreadystatechange=null,d(f,++l)}:n.onload=function(){n.onload=null;d(f,++l)});p.parentNode.replaceChild(n,p);if(k)return}d(f,++l)}};d(b,0)}};m.set=function(a,b){switch(a){case "data":a=b.value;var c=!1;if("update"===b.mode)if(B=m.get("data"),(b=typeof B===typeof a)&&"object"===typeof B){!B&&(B={});for(var d in a)B[d]!==a[d]&&(B[d]=a[d],c=!0)}else!b&&B||B===a||(B=a,c=!0);else B=
a,c=!0;c&&(t.data=B,Sa(e.cookie_name,JSON.stringify(t)));return c;default:return!1}};m.get=function(a,b){return JSON.parse(xa(b||e.cookie_name,"one",!0)||"{}")[a]};m.getConfig=function(a){return e[a]||g[a]};var Ra=function(){Ja=t.categories||[];Ta=G.filter(function(a){return-1===Ja.indexOf(a)});return{accepted:Ja,rejected:Ta}},Qa=function(a){var b="custom",c=Aa.filter(function(d){return!0===d}).length;a.accepted.length===G.length?b="all":a.accepted.length===c&&(b="necessary");return b};m.getUserPreferences=
function(){var a=Ra();return{accept_type:Qa(a),accepted_categories:a.accepted,rejected_categories:a.rejected}};m.loadScript=function(a,b,c){var d="function"===typeof b;if(document.querySelector('script[src="'+a+'"]'))d&&b();else{var f=h("script");if(c&&0<c.length)for(var l=0;l<c.length;++l)c[l]&&f.setAttribute(c[l].name,c[l].value);d&&(f.onload=b);f.src=a;document.head.appendChild(f)}};m.updateScripts=function(){Da()};m.show=function(a,b){!0===b&&Na(e.current_lang);N&&setTimeout(function(){H(sa,"show--consent");
x.setAttribute("aria-hidden","false");oa=!0;setTimeout(function(){ra=document.activeElement;v=Ma},200)},0<a?a:b?30:0)};m.hide=function(){N&&(sa.classList.remove("show--consent"),x.setAttribute("aria-hidden","true"),oa=!1,setTimeout(function(){ra.focus();v=null},200))};m.hideSettings=function(){sa.classList.remove("show--settings");Ea=!1;E.setAttribute("aria-hidden","true");setTimeout(function(){oa?(La&&La.focus(),v=Ma):(ra&&ra.focus(),v=null);pa=!1},200)};m.accept=function(a,b){a=a||void 0;var c=
b||[];b=[];var d=function(){for(var l=document.querySelectorAll(".c-tgl")||[],p=[],k=0;k<l.length;k++)l[k].checked&&p.push(l[k].value);return p};if(a)if("object"===typeof a&&"number"===typeof a.length)for(var f=0;f<a.length;f++)-1!==G.indexOf(a[f])&&b.push(a[f]);else"string"===typeof a&&("all"===a?b=G.slice():-1!==G.indexOf(a)&&b.push(a));else b=d();if(1<=c.length)for(f=0;f<c.length;f++)b=b.filter(function(l){return l!==c[f]});for(f=0;f<G.length;f++)!0===Aa[f]&&-1===b.indexOf(G[f])&&b.push(G[f]);
fb(b)};m.eraseCookies=function(a,b,c){var d=[];c=c?[c,"."+c]:[e.cookie_domain,"."+e.cookie_domain];if("object"===typeof a&&0<a.length)for(var f=0;f<a.length;f++)this.validCookie(a[f])&&d.push(a[f]);else this.validCookie(a)&&d.push(a);$a(d,b,c)};var Sa=function(a,b){var c=e.cookie_expiration;"number"===typeof e.cookie_necessary_only_expiration&&"necessary"===Ia&&(c=e.cookie_necessary_only_expiration);b=e.use_rfc_cookie?encodeURIComponent(b):b;var d=new Date;d.setTime(d.getTime()+864E5*c);c="; expires="+
d.toUTCString();a=a+"="+(b||"")+c+"; Path="+e.cookie_path+";";a+=" SameSite="+e.cookie_same_site+";";-1<window.location.hostname.indexOf(".")&&(a+=" Domain="+e.cookie_domain+";");"https:"===window.location.protocol&&(a+=" Secure;");document.cookie=a},xa=function(a,b,c){var d;if("one"===b){if((d=(d=document.cookie.match("(^|;)\\s*"+a+"\\s*=\\s*([^;]+)"))?c?d.pop():a:"")&&a===e.cookie_name){try{d=JSON.parse(d)}catch(f){try{d=JSON.parse(decodeURIComponent(d))}catch(l){d={}}}d=JSON.stringify(d)}}else if("all"===
b)for(a=document.cookie.split(/;\s*/),d=[],b=0;b<a.length;b++)d.push(a[b].split("=")[0]);return d},$a=function(a,b,c){b=b?b:"/";for(var d=0;d<a.length;d++)for(var f=0;f<c.length;f++)document.cookie=a[d]+"=; path="+b+(-1<c[f].indexOf(".")?"; domain="+c[f]:"")+"; Expires=Thu, 01 Jan 1970 00:00:01 GMT;"};m.validCookie=function(a){return""!==xa(a,"one",!0)};var z=function(a,b,c,d){a.addEventListener(b,c,!0===d?{passive:!0}:!1)},wa=function(a){if("object"===typeof a)return Object.keys(a)},H=function(a,
b){a.classList.add(b)};return m};"undefined"!==typeof window&&"function"!==typeof window.initCookieConsent&&(window.initCookieConsent=jb)})();
{
"name": "vanilla-cookieconsent",
"version": "2.8.0",
"version": "v2.8.1",
"description": "🍪 Simple cross-browser cookie-consent plugin written in vanilla js.",
"main": "dist/cookieconsent.js",
"files": [
"src",
"dist",
"types"
],
"types": "types/types.d.ts",
"scripts": {

@@ -7,0 +13,0 @@ "test": "echo \"Error: no test specified\" && exit 1"

@@ -15,3 +15,3 @@ [Forked](https://github.com/orestbida/cookieconsent) to publish in the NPM registry. No further

A __lightweight__ & __gdpr compliant__ cookie consent plugin written in plain javascript. An "all-in-one" solution which also allows you to write your cookie policy inside it without the need of having a dedicated page.
A __lightweight__ & __gdpr compliant__ cookie consent plugin written in plain javascript.

@@ -26,13 +26,16 @@ </div>

## Table of contents
1. [Key features](#key-features)
2. [Installation & Usage](#installation--usage)
4. [Layout options & customization](#layout-options--customization)
5. [API methods](#api-methods)
6. [Available callbacks](#available-callbacks)
7. [All configuration options](#all-configuration-options)
8. [How to block/manage scripts](#how-to-blockmanage-scripts)
9. [Configuration examples](#full-example-configurations)
10. [How to enable/manage revisions](#how-to-enablemanage-revisions)
11. [FAQ](#faq)
12. [License](#license)
- [Table of contents](#table-of-contents)
- [Key features](#key-features)
- [Installation & Usage](#installation--usage)
- [Layout options & customization](#layout-options--customization)
- [How to block/manage scripts](#how-to-blockmanage-scripts)
- [API methods](#api-methods)
- [Available `data-cc` actions](#available-data-cc-actions)
- [Available callbacks](#available-callbacks)
- [All configuration options](#all-configuration-options)
- [Full example configurations](#full-example-configurations)
- [How to configure languages & cookie settings](#how-to-configure-languages--cookie-settings)
- [How to enable/manage revisions](#how-to-enablemanage-revisions)
- [FAQ](#faq)
- [License](#license)

@@ -54,4 +57,4 @@ ## Key features

# CDN links
https://cdn.jsdelivr.net/gh/orestbida/cookieconsent@v2.8.0/dist/cookieconsent.js
https://cdn.jsdelivr.net/gh/orestbida/cookieconsent@v2.8.0/dist/cookieconsent.css
https://cdn.jsdelivr.net/gh/orestbida/cookieconsent@v2.8.1/dist/cookieconsent.js
https://cdn.jsdelivr.net/gh/orestbida/cookieconsent@v2.8.1/dist/cookieconsent.css
```

@@ -69,3 +72,7 @@

<html>
<head> <!-- head content --> </head>
<head>
<!-- head content -->
<!-- Deferred CSS loading (recommended) -->
<link rel="stylesheet" href="<path-to-cookieconsent.css>" media="print" onload="this.media='all'">
</head>
<body>

@@ -77,3 +84,3 @@ <!-- body content -->

```
<span>Note: replace `<path-to-cookieconsent.js>` with a valid path!</span>
<span>Note: replace `<path-to-cookieconsent.js>` and `<path-to-cookieconsent.css>` with valid paths!</span>
<br>

@@ -105,3 +112,2 @@

autoclear_cookies: true, // default: false
theme_css: '<path-to-cookieconsent.css>', // 🚨 replace with a valid path
page_scripts: true, // default: false

@@ -237,3 +243,2 @@

autoclear_cookies: true, // default: false
theme_css: '<path-to-cookieconsent.css>', // 🚨 replace with a valid path
page_scripts: true, // default: false

@@ -379,3 +384,2 @@

#### ~~Note: if `force_consent` option is not enabled, the `middle` position will be ignored~~. As of v2.7.0 the `middle` position is allowed regardless of `force_consent`.
<br>

@@ -417,3 +421,3 @@

- cookieconsent`.run(<config_object>)`
- cookieconsent`.show(<optional_delay>)`
- cookieconsent`.show(<optional_delay>, <create_modal>)`
- cookieconsent`.hide()`

@@ -553,11 +557,2 @@ - cookieconsent`.showSettings(<optional_delay>)`

```
How to enforce/set a new `revision`:
```javascript
// Update revision to the new value (without prompting the user)
cookieconsent.set('revision', {value: 2});
// Update revision to the new value (ask consent before setting the new revision)
cookieconsent.set('revision', {value: 2, prompt_consent: true});
```
</p>

@@ -641,2 +636,18 @@ </details>

## Available `data-cc` actions
Any button (or link) can use the custom `data-cc` attribute to perform a few actions without manually invoking the api methods.
Valid values:
- `c-settings`: show settings modal
- `accept-all`: accept all categories
- `accept-necessary`: accept only categories marked as necessary/readonly (reject all)
- `accept-custom`: accept currently selected categories inside the settings modal
Examples:
```html
<button type="button" data-cc="c-settings">Show cookie settings</button>
<button type="button" data-cc="accept-all">Accept all cookies</button>
```
<br>
## Available callbacks

@@ -742,3 +753,2 @@ The following functions have to be defined inside the configuration object passed to the `.run()` method.

| `use_rfc_cookie` | boolean | false | Enable if you want the value of the cookie to be rfc compliant |
| `theme_css` | string | - | Specify path to the .css file |
| `force_consent` | boolean | false | Enable if you want to block page navigation until user action (check [faq](#faq) for a proper implementation) |

@@ -788,3 +798,2 @@ | `revision` | number | 0 | Specify this option to enable revisions. [Check below](#how-to-enablemanage-revisions) for a proper usage |

current_lang: 'en',
theme_css: '<path-to-cookieconsent.css>',
autoclear_cookies: true,

@@ -1124,17 +1133,2 @@ page_scripts: true,

</details>
- <details><summary>How to autoload the .css file</summary>
<p id="autoload-css">
You need to set `theme_css` to a valid path.
```javascript
cookieconsent.run({
// ...
theme_css: '../src/cookieconsent.css',
// ...
});
```
</p>
</details>
- <details><summary>Make consent required (block page navigation until action)</summary>

@@ -1141,0 +1135,0 @@ <p>

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc