Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vanilla-cookieconsent

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vanilla-cookieconsent - npm Package Compare versions

Comparing version 2.5.1 to 2.6.0

.github/FUNDING.yml

256

demo/app.js

@@ -1,126 +0,150 @@

/*
* CookieConsent v2 DEMO config.
*/
// obtain cookieconsent plugin
var cc = initCookieConsent();
// microsoft logo
var logo = '<svg style="width: 110px; height: 30px; display: block;" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 337.6 72"><path fill="#737373" d="M140.4 14.4v43.2h-7.5V23.7h-.1l-13.4 33.9h-5l-13.7-33.9h-.1v33.9h-6.9V14.4h10.8l12.4 32h.2l13.1-32h10.2zm6.2 3.3c0-1.2.4-2.2 1.3-3 .9-.8 1.9-1.2 3.1-1.2 1.3 0 2.4.4 3.2 1.2s1.3 1.8 1.3 3-.4 2.2-1.3 3c-.9.8-1.9 1.2-3.2 1.2s-2.3-.4-3.1-1.2c-.8-.9-1.3-1.9-1.3-3zm8.1 8.9v31h-7.3v-31h7.3zm22.1 25.7c1.1 0 2.3-.2 3.6-.8 1.3-.5 2.5-1.2 3.6-2v6.8c-1.2.7-2.5 1.2-4 1.5-1.5.3-3.1.5-4.9.5-4.6 0-8.3-1.4-11.1-4.3-2.9-2.9-4.3-6.6-4.3-11 0-5 1.5-9.1 4.4-12.3 2.9-3.2 7-4.8 12.4-4.8 1.4 0 2.8.2 4.1.5 1.4.3 2.5.8 3.3 1.2v7c-1.1-.8-2.3-1.5-3.4-1.9-1.2-.4-2.4-.7-3.6-.7-2.9 0-5.2.9-7 2.8s-2.6 4.4-2.6 7.6c0 3.1.9 5.6 2.6 7.3 1.7 1.7 4 2.6 6.9 2.6zm27.9-26.2a8.08 8.08 0 0 1 2.8.4v7.4c-.4-.3-.9-.6-1.7-.8s-1.6-.4-2.7-.4c-1.8 0-3.3.8-4.5 2.3s-1.9 3.8-1.9 7v15.6h-7.3v-31h7.3v4.9h.1c.7-1.7 1.7-3 3-4 1.4-.9 3-1.4 4.9-1.4zm3.2 16.5c0-5.1 1.5-9.2 4.3-12.2 2.9-3 6.9-4.5 12-4.5 4.8 0 8.6 1.4 11.3 4.3s4.1 6.8 4.1 11.7c0 5-1.5 9-4.3 12-2.9 3-6.8 4.5-11.8 4.5-4.8 0-8.6-1.4-11.4-4.2-2.8-2.9-4.2-6.8-4.2-11.6zm7.6-.3c0 3.2.7 5.7 2.2 7.4s3.6 2.6 6.3 2.6c2.6 0 4.7-.8 6.1-2.6 1.4-1.7 2.1-4.2 2.1-7.6 0-3.3-.7-5.8-2.1-7.6-1.4-1.7-3.5-2.6-6-2.6-2.7 0-4.7.9-6.2 2.7-1.7 1.9-2.4 4.4-2.4 7.7zm35-7.5c0 1 .3 1.9 1 2.5.7.6 2.1 1.3 4.4 2.2 2.9 1.2 5 2.5 6.1 3.9a8.1 8.1 0 0 1 1.8 5.3c0 2.9-1.1 5.2-3.4 7-2.2 1.8-5.3 2.6-9.1 2.6-1.3 0-2.7-.2-4.3-.5-1.6-.3-2.9-.7-4-1.2v-7.2c1.3.9 2.8 1.7 4.3 2.2 1.5.5 2.9.8 4.2.8 1.6 0 2.9-.2 3.6-.7.8-.5 1.2-1.2 1.2-2.3 0-1-.4-1.8-1.2-2.6-.8-.7-2.4-1.5-4.6-2.4-2.7-1.1-4.6-2.4-5.7-3.8s-1.7-3.2-1.7-5.4c0-2.8 1.1-5.1 3.3-6.9 2.2-1.8 5.1-2.7 8.6-2.7 1.1 0 2.3.1 3.6.4s2.5.6 3.4.9V34c-1-.6-2.1-1.2-3.4-1.7-1.3-.5-2.6-.7-3.8-.7-1.4 0-2.5.3-3.2.8-.7.7-1.1 1.4-1.1 2.4zm16.4 7.8c0-5.1 1.5-9.2 4.3-12.2 2.9-3 6.9-4.5 12-4.5 4.8 0 8.6 1.4 11.3 4.3s4.1 6.8 4.1 11.7c0 5-1.5 9-4.3 12-2.9 3-6.8 4.5-11.8 4.5-4.8 0-8.6-1.4-11.4-4.2-2.7-2.9-4.2-6.8-4.2-11.6zm7.6-.3c0 3.2.7 5.7 2.2 7.4s3.6 2.6 6.3 2.6c2.6 0 4.7-.8 6.1-2.6 1.4-1.7 2.1-4.2 2.1-7.6 0-3.3-.7-5.8-2.1-7.6-1.4-1.7-3.5-2.6-6-2.6-2.7 0-4.7.9-6.2 2.7-1.6 1.9-2.4 4.4-2.4 7.7zm48.4-9.7H312v25h-7.4v-25h-5.2v-6h5.2v-4.3c0-3.2 1.1-5.9 3.2-8s4.8-3.1 8.1-3.1c.9 0 1.7.1 2.4.1s1.3.2 1.8.4V18c-.2-.1-.7-.3-1.3-.5-.6-.2-1.3-.3-2.1-.3-1.5 0-2.7.5-3.5 1.4-.8.9-1.2 2.4-1.2 4.2v3.7h10.9v-7l7.3-2.2v9.2h7.4v6h-7.4V47c0 1.9.4 3.2 1 4 .7.8 1.8 1.2 3.3 1.2.4 0 .9-.1 1.5-.3.6-.2 1.1-.4 1.5-.7v6c-.5.3-1.2.5-2.3.7-1.1.2-2.1.3-3.2.3-3.1 0-5.4-.8-6.9-2.4-1.5-1.6-2.3-4.1-2.3-7.4l.1-15.8z"/><path fill="#f25022" d="M0 0h34.2v34.2H0z"/><path fill="#7fba00" d="M37.8 0H72v34.2H37.8z"/><path fill="#00a4ef" d="M0 37.8h34.2V72H0z"/><path fill="#ffb900" d="M37.8 37.8H72V72H37.8z"/></svg>';
var cookie = '🍪';
// run plugin with config object
cc.run({
autorun : true,
delay : 0,
current_lang : 'en',
auto_language : false,
autoclear_cookies : true,
cookie_expiration : 365,
theme_css: '../dist/cookieconsent.css',
force_consent: false,
current_lang : 'en',
autoclear_cookies : true, // default: false
theme_css: '../src/cookieconsent.css',
cookie_name: 'cc_cookie_demo1', // default: 'cc_cookie'
cookie_expiration : 365, // default: 182
page_scripts: true, // default: false
// auto_language : false, // default: false
// autorun : true, // default: true
// delay : 0, // default: 0
// force_consent: false,
// hide_from_bots: false, // default: false
// remove_cookie_tables: false // default: false
// cookie_domain: location.hostname, // default: current domain
// cookie_path: "/", // default: root
// cookie_same_site: "Lax",
// use_rfc_cookie: false, // default: false
// revision: 0, // default: 0
onAccept: function(cookie){
console.log("onAccept fired ...");
if(cc.allowedCategory('analytics')){
cc.loadScript('https://www.google-analytics.com/analytics.js', function(){
ga('create', 'UA-46747204-4', 'auto');
ga('send', 'pageview');
console.log("analytics.js loaded");
});
}
gui_options : {
consent_modal : {
layout : 'box', // box,cloud,bar
position : 'bottom right', // bottom,middle,top + left,right,center
transition : 'slide' // zoom,slide
},
settings_modal : {
layout : 'box', // box,bar
// position: 'left', // right,left (available only if bar layout selected)
transition : 'slide' // zoom,slide
}
},
// delete line below
typeof doDemoThings === 'function' && doDemoThings(cookie);
},
onAccept: function(cookie){
console.log("onAccept fired ...");
// delete line below
typeof doDemoThings === 'function' && doDemoThings(cookie);
},
onChange: function(cookie){
console.log("onChange fired ...");
// delete line below
typeof doDemoThings === 'function' && doDemoThings(cookie);
},
onChange: function(cookie, changed_preferences){
console.log("onChange fired ...");
languages : {
'en' : {
consent_modal : {
title : "I use cookies",
description : 'Hi, this website uses essential cookies to ensure its proper operation and tracking cookies to understand how you interact with it. The latter will be set only after consent. <button type="button" data-cc="c-settings" class="cc-link">Let me choose</button>',
primary_btn: {
text: 'Accept',
role: 'accept_all' //'accept_selected' or 'accept_all'
},
secondary_btn: {
text : 'Reject',
role : 'accept_necessary' //'settings' or 'accept_necessary'
}
},
settings_modal : {
title : '<div>Cookie settings</div><div aria-hidden="true" style="font-size: .8em; font-weight: 200; color: #687278; margin-top: 5px;">Powered by <a tabindex="-1" aria-hidden="true" href="https://github.com/orestbida/cookieconsent/" style="text-decoration: underline;">cookie-consent</a></div>',
save_settings_btn : "Save settings",
accept_all_btn : "Accept all",
close_btn_label: "Close",
cookie_table_headers : [
{col1: "Name" },
{col2: "Domain" },
{col3: "Expiration" },
{col4: "Description" },
{col5: "Type" }
],
blocks : [
{
title : "Cookie usage",
description: 'I use cookies to ensure the basic functionalities of the website and to enhance your online experience. You can choose for each category to opt-in/out whenever you want. For more details relative to cookies and other sensitive data, please read the full <a href="#" class="cc-link">privacy policy</a>.'
},{
title : "Strictly necessary cookies",
description: 'These cookies are essential for the proper functioning of my website. Without these cookies, the website would not work properly',
toggle : {
value : 'necessary',
enabled : true,
readonly: true //cookie categories with readonly=true are all treated as "necessary cookies"
}
},{
title : "Preferences cookies",
description: 'These cookies allow the website to remember the choices you have made in the past',
toggle : {
value : 'preferences', //there are no default categories => you specify them
enabled : false,
readonly: false
}
},{
title : "Analytics cookies",
description: 'These cookies collect information about how you use the website, which pages you visited and which links you clicked on. All of the data is anonymized and cannot be used to identify you',
toggle : {
value : 'analytics',
enabled : false,
readonly: false
},
cookie_table: [
{
col1: '_ga',
col2: 'google.com',
col3: '2 years',
col4: 'description ...' ,
col5: 'Permanent cookie'
},
{
col1: '_gat',
col2: 'google.com',
col3: '1 minute',
col4: 'description ...' ,
col5: 'Permanent cookie'
},
{
col1: '_gid',
col2: 'google.com',
col3: '1 day',
col4: 'description ...' ,
col5: 'Permanent cookie'
}
]
},{
title : "More information",
description: 'For any queries in relation to my policy on cookies and your choices, please <a class="cc-link" href="https://orestbida.com/contact">contact me</a>.',
}
]
}
}
}
// If analytics category's status was changed ...
if(changed_preferences.indexOf('analytics') > -1){
// If analytics category is disabled ...
if(!cc.allowedCategory('analytics')){
// Disable gtag ...
console.log("disabling gtag")
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('consent', 'default', {
'ad_storage': 'denied',
'analytics_storage': 'denied'
});
}
}
// delete line below
typeof doDemoThings === 'function' && doDemoThings(cookie);
},
languages : {
'en' : {
consent_modal : {
title : cookie + " We use cookies!",
description : 'Hi, this website uses essential cookies to ensure its proper operation and tracking cookies to understand how you interact with it. The latter will be set only after consent. <button type="button" data-cc="c-settings" class="cc-link">Let me choose</button>',
primary_btn: {
text: 'Accept all',
role: 'accept_all' //'accept_selected' or 'accept_all'
},
secondary_btn: {
text : 'Reject all',
role : 'accept_necessary' //'settings' or 'accept_necessary'
}
},
settings_modal : {
title : logo,
save_settings_btn : "Save settings",
accept_all_btn : "Accept all",
reject_all_btn: "Reject all",
close_btn_label: "Close",
cookie_table_headers : [
{col1: "Name" },
{col2: "Domain" },
{col3: "Expiration" },
{col4: "Description" }
],
blocks : [
{
title : "Cookie usage 📢",
description: 'I use cookies to ensure the basic functionalities of the website and to enhance your online experience. You can choose for each category to opt-in/out whenever you want. For more details relative to cookies and other sensitive data, please read the full <a href="#" class="cc-link">privacy policy</a>.'
},{
title : "Strictly necessary cookies",
description: 'These cookies are essential for the proper functioning of my website. Without these cookies, the website would not work properly',
toggle : {
value : 'necessary',
enabled : true,
readonly: true //cookie categories with readonly=true are all treated as "necessary cookies"
}
},{
title : "Performance and Analytics cookies",
description: 'These cookies allow the website to remember the choices you have made in the past',
toggle : {
value : 'analytics', //there are no default categories => you specify them
enabled : false,
readonly: false
},
cookie_table: [
{
col1: '^_ga',
col2: 'google.com',
col3: '2 years',
col4: 'description ...' ,
is_regex: true
},
{
col1: '_gid',
col2: 'google.com',
col3: '1 day',
col4: 'description ...' ,
}
]
},{
title : "Advertisement and Targeting cookies",
description: 'These cookies collect information about how you use the website, which pages you visited and which links you clicked on. All of the data is anonymized and cannot be used to identify you',
toggle : {
value : 'targeting',
enabled : false,
readonly: false
}
},{
title : "More information",
description: 'For any queries in relation to my policy on cookies and your choices, please <a class="cc-link" href="https://orestbida.com/contact">contact me</a>.',
}
]
}
}
}
});

@@ -1,5 +0,1 @@

/*
* CookieConsent v2 DEMO config.
*/
// obtain cookieconsent plugin

@@ -10,32 +6,31 @@ var cc = initCookieConsent();

cc.run({
autorun : true,
delay : 0,
current_lang : 'en',
auto_language : false,
autoclear_cookies : true,
cookie_expiration : 365,
theme_css: '../dist/cookieconsent.css',
force_consent: true,
autoclear_cookies : true, // default: false
theme_css: '../src/cookieconsent.css',
cookie_name: 'cc_cookie_demo2', // default: 'cc_cookie'
cookie_expiration : 365, // default: 182
page_scripts: true, // default: false
force_consent: true, // default: false
/* New options from v2.4 (everything is optional) */
// remove_cookie_tables: false // default: false (if set to true, cookie table's html will not be generated)
// cookie_domain: location.hostname, // default: current domain
// auto_language : false, // default: false
// autorun : true, // default: true
// delay : 0, // default: 0
// hide_from_bots: false, // default: false
// remove_cookie_tables: false // default: false
// cookie_domain: location.hostname, // default: current domain
// cookie_path: "/", // default: root
// cookie_same_site: "Lax",
/* Manage existing <scripts> tags (check readme.md) */
page_scripts: true, // default: false (by default don't manage existing script tags)
// use_rfc_cookie: false, // default: false
// revision: 0, // default: 0
/* Basic gui options */
gui_options : {
consent_modal : {
layout : 'cloud', // box(default),cloud,bar
position : 'bottom center', // bottom(default),top + left,right,center:=> examples: 'bottom' or 'top right'
transition : 'slide' // zoom(default),slide
layout : 'cloud', // box,cloud,bar
position : 'bottom center', // bottom,middle,top + left,right,center
transition : 'slide' // zoom,slide
},
settings_modal : {
layout : 'bar', // box(default),bar
position: 'left', // right(default),left (available only if bar layout selected)
transition : 'slide' // zoom(default),slide
layout : 'bar', // box,bar
position: 'left', // right,left (available only if bar layout selected)
transition : 'slide' // zoom,slide
}

@@ -52,3 +47,3 @@ },

// Delete line below
document.getElementById("cookie_val").innerHTML = JSON.stringify(cookie, null, 2);
document.getElementById("cookie_val") && (document.getElementById("cookie_val").innerHTML = JSON.stringify(cookie, null, 2));
},

@@ -77,10 +72,10 @@

// Delete line below
document.getElementById("cookie_val").innerHTML = JSON.stringify(cookie, null, 2);
document.getElementById("cookie_val") && (document.getElementById("cookie_val").innerHTML = JSON.stringify(cookie, null, 2));
},
languages : {
'en' : {
'en' : {
consent_modal : {
title : "Hello traveler, it's cookie time!",
description : 'Hi, this website uses essential cookies to ensure its proper operation and tracking cookies to understand how you interact with it. The latter will be set only after consent. <a href="#privacy-policy" class="cc-link">Privacy policy</a>',
title : "Hello traveller, it's cookie time!",
description : 'Our website uses essential cookies to ensure its proper operation and tracking cookies to understand how you interact with it. The latter will be set only after consent. <a href="#privacy-policy" class="cc-link">Privacy policy</a>',
primary_btn: {

@@ -97,3 +92,3 @@ text: 'Accept all',

settings_modal : {
title : '<div>Cookie preferences</div><div aria-hidden="true" style="font-size: .8em; font-weight: 400; color: #687278; margin-top: 3px;">Powered by <a tabindex="-1" aria-hidden="true" href="https://github.com/orestbida/cookieconsent/">cookie-consent</a></div>',
title : 'Cookie settings',
save_settings_btn : "Save current selection",

@@ -100,0 +95,0 @@ accept_all_btn : "Accept all",

/*
CookieConsent v2.5.1
CookieConsent v2.6.0
https://www.github.com/orestbida/cookieconsent

@@ -7,31 +7,33 @@ Author Orest Bida

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

@@ -5,0 +5,0 @@ "main": "dist/cookieconsent.js",

@@ -30,6 +30,3 @@ Forked to publish in the NPM registry. No further changes. Thanks and credits to [Orest Bida](https://github.com/orestbida/cookieconsent).

6. [Manage third party scripts](#manage-third-party-scripts)
7. [Configuration examples](#full-example-configurations) (work-in-progress)
- Configuration with [Google analytics](#full-example-configurations)
- Configuration with [explicit `accept all` and `accept necessary only` buttons](#explicit-consent)
- Configuration with embedded full cookie-policy
7. [Configuration examples](#full-example-configurations)
8. [How to enable/manage revisions](#how-to-enablemanage-revisions)

@@ -47,3 +44,3 @@ 9. [FAQ](#faq)

- Allows you to __define different cookie categories with opt in/out toggle__
- Allows you to __define custom cookie tables__ if you want to clarify the cookies you use
- Allows you to __define custom cookie tables__ to specify the cookies you use

@@ -60,59 +57,62 @@ ## How to use

```html
<script src="<path-to-cookieconsent.js>"></script>
<script defer src="<path-to-cookieconsent.js>"></script>
<script>
var cookieconsent = initCookieConsent();
window.addEventListener('load', function(){
cookieconsent.run({
current_lang : 'en',
theme_css : '<path-to-cookieconsent.css>',
var cookieconsent = initCookieConsent();
onAccept : function(){
// do something ...
},
cookieconsent.run({
current_lang : 'en',
theme_css : '<path-to-cookieconsent.css>',
languages : {
en : {
consent_modal : {
title : "I use cookies",
description : 'Your cookie consent message here',
primary_btn: {
text: 'Accept',
role: 'accept_all' //'accept_selected' or 'accept_all'
onAccept : function(){
// do something ...
},
languages : {
en : {
consent_modal : {
title : "I use cookies",
description : 'Your cookie consent message here',
primary_btn: {
text: 'Accept',
role: 'accept_all' //'accept_selected' or 'accept_all'
},
secondary_btn: {
text : 'Reject',
role : 'accept_necessary' //'settings' or 'accept_necessary'
}
},
secondary_btn: {
text : 'Reject',
role : 'accept_necessary' //'settings' or 'accept_necessary'
settings_modal : {
title : 'Cookie settings',
save_settings_btn : "Save settings",
accept_all_btn : "Accept all",
reject_all_btn : "Reject all", // optional, [v.2.5.0 +]
close_btn_label: "Close",
blocks : [
{
title : "Cookie usage",
description: 'Your cookie usage disclaimer'
},{
title : "Strictly necessary cookies",
description: 'Category description ... ',
toggle : {
value : 'necessary',
enabled : false,
readonly: true
}
},{
title : "Analytics cookies",
description: 'Category description ... ',
toggle : {
value : 'analytics',
enabled : false,
readonly: false
}
},
]
}
},
settings_modal : {
title : 'Cookie settings',
save_settings_btn : "Save settings",
accept_all_btn : "Accept all",
reject_all_btn : "Reject all", // optional, [v.2.5.0 +]
close_btn_label: "Close",
blocks : [
{
title : "Cookie usage",
description: 'Your cookie usage disclaimer'
},{
title : "Strictly necessary cookies",
description: 'Category description ... ',
toggle : {
value : 'necessary',
enabled : false,
readonly: true
}
},{
title : "Analytics cookies",
description: 'Category description ... ',
toggle : {
value : 'analytics',
enabled : false,
readonly: false
}
},
]
}
}
}
});
});

@@ -133,3 +133,3 @@ </script>

```html
https://cdn.jsdelivr.net/gh/orestbida/cookieconsent@v2.5.1/dist/cookieconsent.js
https://cdn.jsdelivr.net/gh/orestbida/cookieconsent@v2.6.0/dist/cookieconsent.js
```

@@ -139,3 +139,3 @@

```html
https://cdn.jsdelivr.net/gh/orestbida/cookieconsent@v2.5.1/dist/cookieconsent.css
https://cdn.jsdelivr.net/gh/orestbida/cookieconsent@v2.6.0//dist/cookieconsent.css
```

@@ -148,2 +148,3 @@

npm i vanilla-cookieconsent
yarn add vanilla-cookieconsent
```

@@ -160,3 +161,3 @@

layout : 'cloud', // box/cloud/bar
position : 'bottom center', // bottom/top + left/right/center
position : 'bottom center', // bottom/middle/top + left/right/center
transition: 'slide' // zoom/slide

@@ -187,6 +188,6 @@ },

```
2. Disable the script tag by setting `type="text/plain"` and change src to `data-src`:
2. Disable the script tag by setting `type="text/plain"`:
```html
<script type="text/plain" data-src="<path>/analytics.js" defer>
<script type="text/plain" src="<path>/analytics.js" defer>
```

@@ -196,3 +197,3 @@ 3. Add `data-cookiecategory` attribute:

```html
<script type="text/plain" data-src="<path>/analytics.js" data-cookiecategory="analytics" defer>
<script type="text/plain" data-cookiecategory="analytics" src="<path>/analytics.js" defer>
```

@@ -329,4 +330,43 @@ <i>Note: data-cookiecategory must also be defined inside the config. object</i>

</details>
- <details><summary>cookieconsent<code>.set(&lt;field&gt;, &lt;object&gt;)</code> [v2.6.0+]</summary>
<p>
The `.set()` method allows you to set the following values:
- **data** (used to save custom data inside the plugin's cookie)
- **revision**
<br>
How to save custom `data`:
```javascript
// Set cookie's "data" field to whatever the value of the `value` prop. is
cookieconsent.set('data', {value: {id: 21, country: "italy"}});
// Only add/update the specified props.
cookieconsent.set('data', {value: {id: 22, new_prop: 'new prop value'}, mode: 'update'});
```
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>
</details>
- <details><summary>cookieconsent<code>.get(&lt;field&gt;)</code> [v2.6.0+]</summary>
<p>
The `.get()` method allows you to retrieve any of the fields inside the plugin's cookie:
```javascript
cookieconsent.get('level'); // retrieve all accepted categories (if cookie exists)
cookieconsent.get('data'); // retrieve custom data (if cookie exists)
cookieconsent.get('revision'); // retrieve revision number (if cookie exists)
```
</p>
</details>
### All available options

@@ -342,2 +382,3 @@ Below a table which sums up all of the available options (must be passed to the .run() method).

| `cookie_same_site` | string | "Lax" | SameSite attribute |
| `use_rfc_cookie` | boolean | false | Enable if you want the value of the cookie to be rfc compliant (it's base64 encoded) |
| `theme_css` | string | - | Specify path to the .css file |

@@ -347,6 +388,7 @@ | `force_consent` | boolean | false | Enable if you want to block page navigation until user action (check [faq](#faq) for a proper implementation) |

| `current_lang` | string | - | Specify one of the languages you have defined (can also be dynamic): `'en'`, `'de'` ... |
| `auto_language` | boolean | false | Automatically grab the language based on the user's browser language, if language is not defined => use specified `current_lang` |
| `auto_language` | boolean | false | Automatically detect language based on the user's browser language, if language is not defined => use specified `current_lang` |
| `autoclear_cookies` | boolean | false | Enable if you want to automatically delete cookies when user opts-out of a specific category inside cookie settings |
| `page_scripts` | boolean | false | Enable if you want to easily `manage existing <script>` tags. Check [manage third party scripts](#manage-third-party-scripts) |
| `remove_cookie_tables`| boolean | false | Enable if you want remove the html cookie tables (and still want to make use of `autoclear_cookies`) |
| `remove_cookie_tables`| boolean | false | Enable if you want to remove the html cookie tables (but still want to make use of `autoclear_cookies`) |
| `hide_from_bots` | boolean | false | Enable if you don't want the plugin to run when a bot/crawler is detected |
| `gui_options` | object | - | Customization option which allows to choose layout, position and transition. Check [layout options & customization](#layout-options--customization) |

@@ -358,117 +400,118 @@ | __`onAccept`__ | function | - | Method run `once` either when: <br> 1. The moment the cookie consent is accepted <br> 2. After each page load (if cookie consent has already been accepted) |

## Full example configurations
- <details><summary>Configuration with google analytics</summary>
- <details><summary>Configuration with gtag.js - Google Analytics</summary>
<p>
```javascript
// obtain cookieconsent plugin
var cc = initCookieConsent();
How to:
1. enable `page_scripts`
2. set `type="text/plain"`and `data-cookiecategory="<your-category>"` to each script:
// run plugin with config object
cc.run({
autorun : true,
delay : 0,
current_lang : 'en',
theme_css : "../src/cookieconsent.css",
autoclear_cookies : true,
cookie_expiration : 365,
gui_options : {
consent_modal : {
layout : 'cloud',
position : 'bottom',
transition : 'slide'
},
settings_modal : {
layout : 'box',
transition : 'slide'
}
},
onAccept: function(cookies){
if(cc.allowedCategory('analytics_cookies')){
cc.loadScript('https://www.google-analytics.com/analytics.js', function(){
ga('create', 'UA-XXXXXXXX-Y', 'auto'); //replace UA-XXXXXXXX-Y with your tracking code
ga('send', 'pageview');
});
}
},
languages : {
en : {
consent_modal : {
title : "I use cookies",
description : 'Hi, this website uses essential cookies to ensure its proper operation and tracking cookies to understand how you interact with it. The latter will be set only upon approval. <a aria-label="Cookie policy" class="cc-link" href="#">Read more</a>',
primary_btn: {
text: 'Accept',
role: 'accept_all' //'accept_selected' or 'accept_all'
},
secondary_btn: {
text : 'Settings',
role : 'settings' //'settings' or 'accept_necessary'
}
<br>
```html
<!-- Global site tag (gtag.js) - Google Analytics -->
<script type="text/plain" data-cookiecategory="analytics" async src="https://www.googletagmanager.com/gtag/js?id=GA_MEASUREMENT_ID"></script>
<script type="text/plain" data-cookiecategory="analytics">
window.dataLayer = window.dataLayer || [];
function gtag(){window.dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'GA_MEASUREMENT_ID');
</script>
<script defer src="<path-to-cookieconsent.js>"></script>
<script>
window.addEventListener('load', function(){
// obtain cookieconsent plugin
var cookieconsent = initCookieConsent();
// run plugin with config object
cookieconsent.run({
autorun : true,
current_lang : 'en',
theme_css : "<path-to-cookieconsent.css>",
autoclear_cookies : true,
page_scripts: true,
onAccept: function(cookie){
// ... cookieconsent accepted
},
settings_modal : {
title : 'Cookie preferences',
save_settings_btn : "Save settings",
accept_all_btn : "Accept all",
reject_all_btn : "Reject all", // optional, [v.2.5.0 +]
cookie_table_headers : [
{col1: "Name" },
{col2: "Domain" },
{col3: "Expiration" },
{col4: "Description" },
{col5: "Type" }
],
blocks : [
{
title : "Cookie usage",
description: 'I use cookies to ensure the basic functionalities of the website and to enhance your online experience. You can choose for each category to opt-in/out whenever you want.'
},{
title : "Strictly necessary cookies",
description: 'These cookies are essential for the proper functioning of my website. Without these cookies, the website would not work properly.',
toggle : {
value : 'necessary_cookies',
enabled : true,
readonly: true
onChange: function(cookie, changed_preferences){
// ... cookieconsent preferences were changed
},
languages : {
en : {
consent_modal : {
title : "I use cookies",
description : 'Hi, this website uses essential cookies to ensure its proper operation and tracking cookies to understand how you interact with it. The latter will be set only upon approval. <a aria-label="Cookie policy" class="cc-link" href="#">Read more</a>',
primary_btn: {
text: 'Accept',
role: 'accept_all' //'accept_selected' or 'accept_all'
},
secondary_btn: {
text : 'Settings',
role : 'settings' //'settings' or 'accept_necessary'
}
},{
title : "Analytics cookies",
description: 'These cookies collect information about how you use the website, which pages you visited and which links you clicked on. All of the data is anonymized and cannot be used to identify you.',
toggle : {
value : 'analytics_cookies',
enabled : false,
readonly: false
},
cookie_table: [
},
settings_modal : {
title : 'Cookie preferences',
save_settings_btn : "Save settings",
accept_all_btn : "Accept all",
reject_all_btn : "Reject all", // optional, [v.2.5.0 +]
cookie_table_headers : [
{col1: "Name" },
{col2: "Domain" },
{col3: "Expiration" },
{col4: "Description" },
{col5: "Type" }
],
blocks : [
{
col1: '_ga',
col2: 'google.com',
col3: '2 years',
col4: 'description ...' ,
col5: 'Permanent cookie'
},
{
col1: '_gat',
col2: 'google.com',
col3: '1 minute',
col4: 'description ...' ,
col5: 'Permanent cookie'
},
{
col1: '_gid',
col2: 'google.com',
col3: '1 day',
col4: 'description ...' ,
col5: 'Permanent cookie'
title : "Cookie usage",
description: 'I use cookies to ensure the basic functionalities of the website and to enhance your online experience. You can choose for each category to opt-in/out whenever you want.'
},{
title : "Strictly necessary cookies",
description: 'These cookies are essential for the proper functioning of my website. Without these cookies, the website would not work properly.',
toggle : {
value : 'necessary',
enabled : true,
readonly: true
}
},{
title : "Analytics cookies",
description: 'These cookies collect information about how you use the website, which pages you visited and which links you clicked on. All of the data is anonymized and cannot be used to identify you.',
toggle : {
value : 'analytics',
enabled : false,
readonly: false
},
cookie_table: [
{
col1: '^_ga',
col2: 'google.com',
col3: '2 years',
col4: 'description ...' ,
col5: 'Permanent cookie',
is_regex: true
},
{
col1: '_gid',
col2: 'google.com',
col3: '1 day',
col4: 'description ...' ,
col5: 'Permanent cookie'
}
]
},{
title : "More information",
description: 'For any queries in relation to my policy on cookies and your choices, please <a class="cc-link" href="#yourwebsite">contact me</a>.',
}
]
},{
title : "More information",
description: 'For any queries in relation to my policy on cookies and your choices, please <a class="cc-link" href="#yourwebsite">contact me</a>.',
}
]
}
}
}
}
});
});
});
</script>
```

@@ -488,3 +531,3 @@

cookieconsent.run({
...
...,
languages : {

@@ -591,61 +634,7 @@ 'en' : {

</details>
<details><summary id="explicit-consent">Example with explicit <b>accept all</b> and <b>accept necessary</b> buttons</summary>
<p>
```javascript
cookieconsent.run({
...
languages : {
'en' : {
consent_modal : {
title : "Title here ...",
description : 'Description here ...',
primary_btn: {
text: 'Accept all',
role: 'accept_all' //'accept_selected' or 'accept_all'
},
secondary_btn: {
text : 'Accept necessary',
role : 'accept_necessary' //'settings' or 'accept_necessary'
}
},
settings_modal : {
title : 'Cookie preferences ...',
save_settings_btn : "Save settings",
accept_all_btn : "Accept all",
reject_all_btn: "Reject all", // optional, [v.2.5.0 +]
blocks : [
{
title : "First block title ...",
description: 'First block description ...'
},{
title : "Second block title ...",
description: 'Second block description ...',
toggle : {
value : 'my_category1',
enabled : true,
readonly: true
}
},{
title : "Third block title ...",
description: 'Third block description ...',
toggle : {
value : 'my_category2',
enabled : true,
readonly: false
}
}
]
}
}
}
});
```
</p>
</details>
## How to enable/manage revisions
Note:
- default revision number is 0
- if saved revision number inside the existing cookie is different from the one you just specified => consent modal will be shown.
- if existing revision number is different from the one you just specified => show consent modal

@@ -656,3 +645,3 @@ 1. Enable revisions by specifying a valid `revision` parameter:

cookieconsent.run({
...
...,
revision: 1,

@@ -667,9 +656,9 @@ ...

cookieconsent.run({
...
...,
revision: 1,
...
...,
languages : {
en : {
consent_modal : {
...
...,
description: "Usual description ... {{revision_message}}",

@@ -736,22 +725,42 @@ revision_message: "<br> Dude, my terms have changed. Sorry for bothering you again!",

<div id="#g-analytics-example">You would do something like this: </div>
Suppose you have a `analytics.js` file you want to load after the `analytics` category has been accepted:
- <details><summary>Method 1 (recommended)</summary>
<p>
```javascript
cookieconsent.run({
...
onAccept : function(){
// if analytics category has been accepted
if(cookieconsent.allowedCategory('analytics')){
cookieconsent.loadScript('https://www.google-analytics.com/analytics.js', function(){
ga('create', 'UA-XXXXXXXX-Y', 'auto');
ga('send', 'pageview');
});
}
1. enable `page_scripts`:
if(cookieconsent.allowedCategory('marketing')){
// do something else
```javascript
cookieconsent.run({
..,
page_scripts: true,
...
});
```
2. add a `<script>` tag with the following attributes: `type="text/plain"` and `data-cookiecategory="<category>"`
```html
<script type="text/plain" data-cookiecategory="analytics" src="<path-to-analytics.js"></script>
```
</p>
</details>
- <details><summary>Method 2</summary>
<p>
Load script using the `.loadScript()` method inside the `onAccept` method:
```javascript
cookieconsent.run({
..,
onAccept: function(){
if(cookieconsent.allowedCategory('analytics')){
cookieconsent.loadScript('<path-to-analytics.js', function(){
// script loaded ...
});
}
}
}
});
```
})
```
</p>
</details>

@@ -775,25 +784,2 @@ </p>

</details>
- <details><summary>How to add a "reject all" button inside settings modal</summary>
<p id="add-reject-all-btn">
You need to specify `reject_all_btn` inside `settings_modal`:
```javascript
cookieconsent.run({
...
languages : {
en : {
...
settings_modal : {
...
reject_all_btn : "Reject all",
...
}
}
}
})
```
</p>
</details>
- <details><summary>Make consent required (block page navigation until action)</summary>

@@ -800,0 +786,0 @@ <p>

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc