external.cookieconsent.3.1.1.cookieconsent.min.js Maven / Gradle / Ivy
The newest version!
(function(d){if(!d.hasInitialised){var b={escapeRegExp:function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},hasClass:function(a,e){return 1===a.nodeType&&0<=(" "+a.className+" ").replace(/[\n\t]/g," ").indexOf(" "+e+" ")},addClass:function(a,e){a.className+=" "+e},removeClass:function(a,e){e=new RegExp("\\b"+this.escapeRegExp(e)+"\\b");a.className=a.className.replace(e,"")},interpolateString:function(a,e){return a.replace(/{{([a-z][a-z0-9\-_]*)}}/gi,function(a,b){return e(b)||
""})},getCookie:function(a){a=("; "+document.cookie).split("; "+a+"=");return 2>a.length?void 0:a.pop().split(";").shift()},setCookie:function(a,e,b,d,p,c){var g=new Date;g.setHours(g.getHours()+24*(b||365));a=[a+"="+e,"expires="+g.toUTCString(),"path="+(p||"/")];d&&a.push("domain="+d);c&&a.push("secure");document.cookie=a.join(";")},deepExtend:function(a,e){for(var b in e)e.hasOwnProperty(b)&&(b in a&&this.isPlainObject(a[b])&&this.isPlainObject(e[b])?this.deepExtend(a[b],e[b]):a[b]=e[b]);return a},
throttle:function(a,b){var e=!1;return function(){e||(a.apply(this,arguments),e=!0,setTimeout(function(){e=!1},b))}},hash:function(a){var b=0,d;if(0===a.length)return b;var h=0;for(d=a.length;h>16)+38;var d=(b>>8&255)+38;b=(b&255)+38;return"#"+(16777216+65536*(255>a?1>a?0:a:255)+256*(255>d?1>d?0:d:255)+(255>b?1>b?0:b:255)).toString(16).slice(1)},isMobile:function(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},isPlainObject:function(a){return"object"===typeof a&&null!==a&&a.constructor==Object},traverseDOMPath:function(a,d){return a&&
a.parentNode?b.hasClass(a,d)?a:this.traverseDOMPath(a.parentNode,d):null}};d.status={deny:"deny",allow:"allow",dismiss:"dismiss"};d.transitionEnd=function(){var a=document.createElement("div"),b={t:"transitionend",OT:"oTransitionEnd",msT:"MSTransitionEnd",MozT:"transitionend",WebkitT:"webkitTransitionEnd"},d;for(d in b)if(b.hasOwnProperty(d)&&"undefined"!=typeof a.style[d+"ransition"])return b[d];return""}();d.hasTransition=!!d.transitionEnd;var t=Object.keys(d.status).map(b.escapeRegExp);d.customStyles=
{};d.Popup=function(){function a(){this.initialise.apply(this,arguments)}function e(a){this.openingTimeout=null;b.removeClass(a,"cc-invisible")}function g(a){a.style.display="none";a.removeEventListener(d.transitionEnd,this.afterTransition);this.afterTransition=null}function h(){var a=this.options.onInitialise.bind(this);if(!window.navigator.cookieEnabled)return a(d.status.deny),!0;if(window.CookiesOK||window.navigator.CookiesOK)return a(d.status.allow),!0;var b=Object.keys(d.status),c=this.getStatus();
(b=0<=b.indexOf(c))&&a(c);return b}function p(){var a=[];this.options.position.split("-").forEach(function(m){a.push("cc-"+m)});return a}function c(){var a=this.options,c="top"==a.position||"bottom"==a.position?"banner":"floating";b.isMobile()&&(c="floating");c=["cc-"+c,"cc-type-"+a.type,"cc-theme-"+a.theme];a.static&&c.push("cc-static");c.push.apply(c,p.call(this));var f=this.options.palette;a=b.hash(JSON.stringify(f));var e="cc-color-override-"+a,l=b.isPlainObject(f);this.customStyleSelector=l?
e:null;if(l)if(l="."+e,d.customStyles[a])++d.customStyles[a].references;else{e={};var k=f.popup,g=f.button;f=f.highlight;if(k&&(k.text=k.text?k.text:b.getContrast(k.background),k.link=k.link?k.link:k.text,e[l+".cc-window"]=["color: "+k.text,"background-color: "+k.background],e[l+".cc-revoke"]=["color: "+k.text,"background-color: "+k.background],e[l+" .cc-link,"+l+" .cc-link:active,"+l+" .cc-link:visited"]=["color: "+k.link],g)){g.text=g.text?g.text:b.getContrast(g.background);g.border=g.border?g.border:
"transparent";e[l+" .cc-btn"]=["color: "+g.text,"border-color: "+g.border,"background-color: "+g.background];g.padding&&e[l+" .cc-btn"].push("padding: "+g.padding);if("transparent"!=g.background){var n;(n=g.hover)||(g=g.background,g=b.normaliseHex(g),n="000000"==g?"#222":b.getLuminance(g));e[l+" .cc-btn:hover, "+l+" .cc-btn:focus"]=["background-color: "+n]}f?(f.text=f.text?f.text:b.getContrast(f.background),f.border=f.border?f.border:"transparent",e[l+" .cc-highlight .cc-btn:first-child"]=["color: "+
f.text,"border-color: "+f.border,"background-color: "+f.background]):e[l+" .cc-highlight .cc-btn:first-child"]=["color: "+k.text]}l=document.createElement("style");document.head.appendChild(l);d.customStyles[a]={references:1,element:l.sheet};a=-1;for(var h in e)e.hasOwnProperty(h)&&l.sheet.insertRule(h+"{"+e[h].join(";")+"}",++a)}this.customStyleSelector&&c.push(this.customStyleSelector);return c}function f(){var a={},c=this.options;c.showLink||(c.elements.link="",c.elements.messagelink=c.elements.message);
Object.keys(c.elements).forEach(function(m){a[m]=b.interpolateString(c.elements[m],function(a){var b=c.content[a];return a&&"string"==typeof b&&b.length?b:""})});var d=c.compliance[c.type];d||(d=c.compliance.info);a.compliance=b.interpolateString(d,function(c){return a[c]});d=c.layouts[c.layout];d||(d=c.layouts.basic);return b.interpolateString(d,function(c){return a[c]})}function n(a){var c=this.options,m=document.createElement("div"),f=c.container&&1===c.container.nodeType?c.container:document.body;
m.innerHTML=a;a=m.children[0];a.style.display="none";b.hasClass(a,"cc-window")&&d.hasTransition&&b.addClass(a,"cc-invisible");this.onButtonClick=k.bind(this);a.addEventListener("click",this.onButtonClick);c.autoAttach&&(f.firstChild?f.insertBefore(a,f.firstChild):f.appendChild(a));return a}function k(a){a=b.traverseDOMPath(a.target,"cc-btn")||a.target;if(b.hasClass(a,"cc-btn")){var c=a.className.match(new RegExp("\\bcc-("+t.join("|")+")\\b"));if(c=c&&c[1]||!1)this.setStatus(c),this.close(!0)}b.hasClass(a,
"cc-close")&&(this.setStatus(d.status.dismiss),this.close(!0));b.hasClass(a,"cc-revoke")&&this.revokeChoice()}function q(a,c){for(var b=0,d=a.length;bMath.floor(e)&&(a(d.status.dismiss),c(!0),window.removeEventListener("scroll",g),this.onWindowScroll=null)};this.options.enabled&&(this.onWindowScroll=g,window.addEventListener("scroll",g))}var k=this.options.ignoreClicksFrom;if(this.options.dismissOnWindowClick){var n=function(m){for(var f=!1,e=m.path.length,g=k.length,h=0;ha.clientY&&(d=!0);b.hasClass(c,"cc-bottom")&&a.clientY>f&&(d=!0);d?b.hasClass(c,"cc-active")||b.addClass(c,"cc-active"):b.hasClass(c,"cc-active")&&b.removeClass(c,"cc-active")},200),window.addEventListener("mousemove",a))}}var w={enabled:!0,container:null,cookie:{name:"cookieconsent_status",
path:"/",domain:"",expiryDays:365,secure:!1},onPopupOpen:function(){},onPopupClose:function(){},onInitialise:function(a){},onStatusChange:function(a,c){},onRevokeChoice:function(){},onNoCookieLaw:function(a,c){},content:{header:"Cookies used on the website!",message:"This website uses cookies to ensure you get the best experience on our website.",dismiss:"Got it!",allow:"Allow cookies",deny:"Decline",link:"Learn more",href:"https://www.cookiesandyou.com",close:"❌",target:"_blank",policy:"Cookie Policy"},
elements:{header:'{{header}} ',message:' ',messagelink:' ',dismiss:'{{dismiss}}',
allow:'{{allow}}',deny:'{{deny}}',link:'{{link}}',close:'{{close}}'},window:'\x3c!--googleoff: all--\x3e{{children}}\x3c!--googleon: all--\x3e',
revokeBtn:'{{policy}}',compliance:{info:'{{dismiss}}',"opt-in":'{{deny}}{{allow}}',"opt-out":'{{deny}}{{allow}}'},type:"info",layouts:{basic:"{{messagelink}}{{compliance}}","basic-close":"{{messagelink}}{{compliance}}{{close}}","basic-header":"{{header}}{{message}}{{link}}{{compliance}}"},layout:"basic",position:"bottom",theme:"block",
static:!1,palette:null,revokable:!1,animateRevokable:!0,showLink:!0,dismissOnScroll:!1,dismissOnTimeout:!1,dismissOnWindowClick:!1,ignoreClicksFrom:["cc-revoke","cc-btn"],autoOpen:!0,autoAttach:!0,whitelistPage:[],blacklistPage:[],overrideHTML:null};a.prototype.initialise=function(a){this.options&&this.destroy();b.deepExtend(this.options={},w);b.isPlainObject(a)&&b.deepExtend(this.options,a);h.call(this)&&(this.options.enabled=!1);q(this.options.blacklistPage,location.pathname)&&(this.options.enabled=
!1);q(this.options.whitelistPage,location.pathname)&&(this.options.enabled=!0);a=this.options.window.replace("{{classes}}",c.call(this).join(" ")).replace("{{children}}",f.call(this));var d=this.options.overrideHTML;"string"==typeof d&&d.length&&(a=d);this.options.static?(a=n.call(this,''+a+""),a.style.display="",this.element=a.firstChild,this.element.style.display="none",b.addClass(this.element,"cc-invisible")):this.element=n.call(this,a);u.call(this);v.call(this);this.options.autoOpen&&
this.autoOpen()};a.prototype.destroy=function(){this.onButtonClick&&this.element&&(this.element.removeEventListener("click",this.onButtonClick),this.onButtonClick=null);this.dismissTimeout&&(clearTimeout(this.dismissTimeout),this.dismissTimeout=null);this.onWindowScroll&&(window.removeEventListener("scroll",this.onWindowScroll),this.onWindowScroll=null);this.onWindowClick&&(window.removeEventListener("click",this.onWindowClick),this.onWindowClick=null);this.onMouseMove&&(window.removeEventListener("mousemove",
this.onMouseMove),this.onMouseMove=null);this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element);this.element=null;this.revokeBtn&&this.revokeBtn.parentNode&&this.revokeBtn.parentNode.removeChild(this.revokeBtn);this.revokeBtn=null;var a=this.options.palette;if(b.isPlainObject(a)){a=b.hash(JSON.stringify(a));var c=d.customStyles[a];c&&!--c.references&&((c=c.element.ownerNode)&&c.parentNode&&c.parentNode.removeChild(c),d.customStyles[a]=null)}this.options=null};a.prototype.open=
function(a){if(this.element)return this.isOpen()||(d.hasTransition?this.fadeIn():this.element.style.display="",this.options.revokable&&this.toggleRevokeButton(),this.options.onPopupOpen.call(this)),this};a.prototype.close=function(a){if(this.element)return this.isOpen()&&(d.hasTransition?this.fadeOut():this.element.style.display="none",a&&this.options.revokable&&this.toggleRevokeButton(!0),this.options.onPopupClose.call(this)),this};a.prototype.fadeIn=function(){var a=this.element;d.hasTransition&&
a&&(this.afterTransition&&g.call(this,a),b.hasClass(a,"cc-invisible")&&(a.style.display="",this.options.static&&(this.element.parentNode.style.maxHeight=this.element.clientHeight+"px"),this.openingTimeout=setTimeout(e.bind(this,a),20)))};a.prototype.fadeOut=function(){var a=this.element;d.hasTransition&&a&&(this.openingTimeout&&(clearTimeout(this.openingTimeout),e.bind(this,a)),b.hasClass(a,"cc-invisible")||(this.options.static&&(this.element.parentNode.style.maxHeight=""),this.afterTransition=g.bind(this,
a),a.addEventListener(d.transitionEnd,this.afterTransition),b.addClass(a,"cc-invisible")))};a.prototype.isOpen=function(){return this.element&&""==this.element.style.display&&(d.hasTransition?!b.hasClass(this.element,"cc-invisible"):!0)};a.prototype.toggleRevokeButton=function(a){this.revokeBtn&&(this.revokeBtn.style.display=a?"":"none")};a.prototype.revokeChoice=function(a){this.options.enabled=!0;this.clearStatus();this.options.onRevokeChoice.call(this);a||this.autoOpen()};a.prototype.hasAnswered=
function(a){return 0<=Object.keys(d.status).indexOf(this.getStatus())};a.prototype.hasConsented=function(a){a=this.getStatus();return a==d.status.allow||a==d.status.dismiss};a.prototype.autoOpen=function(a){!this.hasAnswered()&&this.options.enabled?this.open():this.hasAnswered()&&this.options.revokable&&this.toggleRevokeButton(!0)};a.prototype.setStatus=function(a){var c=this.options.cookie,f=b.getCookie(c.name);f=0<=Object.keys(d.status).indexOf(f);0<=Object.keys(d.status).indexOf(a)?(b.setCookie(c.name,
a,c.expiryDays,c.domain,c.path,c.secure),this.options.onStatusChange.call(this,a,f)):this.clearStatus()};a.prototype.getStatus=function(){return b.getCookie(this.options.cookie.name)};a.prototype.clearStatus=function(){var a=this.options.cookie;b.setCookie(a.name,"",-1,a.domain,a.path)};return a}();d.Location=function(){function a(a){b.deepExtend(this.options={},p);b.isPlainObject(a)&&b.deepExtend(this.options,a);this.currentServiceIndex=-1}function d(a,b,d){var c=document.createElement("script");
c.type="text/"+(a.type||"javascript");c.src=a.src||a;c.async=!1;c.onreadystatechange=c.onload=function(){var a=c.readyState;clearTimeout(f);b.done||a&&!/loaded|complete/.test(a)||(b.done=!0,b(),c.onreadystatechange=c.onload=null)};document.body.appendChild(c);var f=setTimeout(function(){b.done=!0;b();c.onreadystatechange=c.onload=null},d)}function g(a,b,d,g,e){var c=new (window.XMLHttpRequest||window.ActiveXObject)("MSXML2.XMLHTTP.3.0");c.open(g?"POST":"GET",a,1);c.setRequestHeader("Content-type",
"application/x-www-form-urlencoded");if(Array.isArray(e))for(a=0,d=e.length;a
© 2015 - 2024 Weber Informatics LLC | Privacy Policy