var CookieConsentHandler=new function(){"use strict";var n=this;n.cookieName="BComCookieConsent",n.blockedScripts=[],n.cookieCategories=["functional","performance","targeting"],n.cookieBannerDisabled=function(){n.processConsentedScripts(null,!0),n.processIframes(!0)},n.consentGiven=function(t){var i=n.getConsentCookie();return i?i.some(function(n){return n===t}):!1},n.needsToBeBlacklisted=function(t){return t?n.consentGiven(t)?!1:!0:!1},n.blockScripts=function(){const t=new MutationObserver(function(t){t.forEach(function(t){var i=t.addedNodes;i.forEach(function(t){if(t.nodeType===1&&t.tagName==="SCRIPT"){var u=t.src||"",f=t.type,r=t.dataset.type;if(n.needsToBeBlacklisted(r)){t.type="javascript/blocked";const i=function(n){t.getAttribute("type")==="javascript/blocked"&&n.preventDefault(),t.removeEventListener("beforescriptexecute",i)};t.addEventListener("beforescriptexecute",i),t.parentElement.removeChild(t),n.blockedScripts.push(t)}}}),[].filter.call(i,function(n){return n.nodeType==1&&n.querySelectorAll("iframe").length}).forEach(function(t){n.processIFrameMutations(t)})})});t.observe(document.documentElement,{childList:!0,subtree:!0})},n.processIFrameMutations=function(t){var i=t.querySelectorAll("iframe");i&&i.forEach(function(t){var i=$(t).attr("data-type");i||n.unblockIFrame(t),n.consentGiven(i)&&n.unblockIFrame(t)})},n.setCookie=function(n,t,i){var r=new Date,u;r.setTime(r.getTime()+i*864e5),u="expires="+r.toUTCString(),document.cookie=n+"="+t+";"+u+";path=/"},n.getCookie=function(n){for(var r=n+"=",f=decodeURIComponent(document.cookie),u=f.split(";"),t,i=0;i<u.length;i++){for(t=u[i];t.charAt(0)===" ";)t=t.substring(1);if(t.indexOf(r)===0)return t.substring(r.length,t.length)}return undefined},n.deleteCookie=function(n){var t="expires=Thu, 01 Jan 1970 00:00:00 UTC";document.cookie=n.Name+"=;"+t+"; domain="+n.Domain+"; path=/"},n.getConsentCookie=function(){var t=n.getCookie(n.cookieName),i;return t?i=JSON.parse(t):undefined},n.trackingConsent=function(t,i){n.consentGiven("performance")&&t?t.forEach(function(n){var t=new Function(n.Script);t()}):i&&i.forEach(function(n){var t=new Function(n.Script);t()})},n.setConsentCookie=function(t,i,r,u){n.setCookie(n.cookieName,JSON.stringify(t),365),n.processConsentedScripts(i),n.trackingConsent(r,u),n.processIframes()},n.processConsentedScripts=function(t,i){n.blockedScripts&&Object.assign([],n.blockedScripts,[]).forEach(function(t){var e=t.dataset.type,u,f;(n.consentGiven(e)||i)&&(t.type="application/javascript",u=document.createElement("script"),u.setAttribute("type","application/javascript"),u.setAttribute("data-type",t.dataset.type),t.src&&u.setAttribute("src",t.src),t.async&&u.setAttribute("async",""),t.textContent&&(f=document.createTextNode(t.textContent),u.appendChild(f)),document.getElementsByTagName("head")[0].appendChild(u),n.blockedScripts.splice(0,1))}),t&&n.blockUnconsentedScripts(t)},n.blockUnconsentedScripts=function(t){n.cookieCategories.forEach(function(i){n.consentGiven(i)||($('script[data-type="'+i+'"]').each(function(){this.type="javascript/blocked",this.parentElement.removeChild(this),n.blockedScripts.push(this)}),t.forEach(function(t){t.BComCookieType===i&&n.deleteCookie(t)}))})},n.processIframes=function(t){n.cookieCategories.forEach(function(i){n.consentGiven(i)||t?$('iframe[data-type="'+i+'"]').each(function(){n.unblockIFrame(this)}):$('iframe[data-type="'+i+'"]').each(function(){n.blockIFrame(this)})}),$("iframe:not([data-type])").each(function(){n.unblockIFrame(this)})},n.blockIFrame=function(n){n.src="",$(n.parentElement).find(".iframe-blocked-placeholder").show()},n.unblockIFrame=function(n){$(n).attr("data-src")&&(n.src=$(n).attr("data-src")),$(n.parentElement).find(".iframe-blocked-placeholder").hide()},n.preBlockedScripts=function(){$('script[type="javascript/blocked"]').each(function(){var t=$(this).attr("data-type");n.consentGiven(t)?$(this).attr("type","application/javascript"):(this.parentElement.removeChild(this),n.blockedScripts.push(this))})},n.initialize=function(){n.blockScripts(),n.preBlockedScripts()},n.initialize()}