(()=>{var o;o=jQuery,window.BorlabsCookie=function(){"use strict";var e,t,n="#BorlabsCookieBox input[type='checkbox']",i="#BorlabsCookieBox",a="#BorlabsCookieBoxWrap",s="#BorlabsCookieBox input[type='checkbox'][name='cookieGroup[]']",c="._brlbs-btn-switch-status",r="data-borlabs-cookie-uid",l="data-borlabs-cookie-consent-history",d=".BorlabsCookie",b={},u={},h={},k={},p={scriptBlockerId:{},jsHandle:{}},f=!1,v={consents:{},expires:null,uid:null,version:null},g="borlabs-cookie",m={consentSaved:null,codeUnblocked:null,codeUnblockedAfterConsent:null};function x(o,e){if(e){var t=e.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])'),n=Array.from(t).filter((function(o){return 0!==o.offsetHeight})),i=n[0],a=n[n.length-1];("Tab"===o.key||9===o.keyCode)&&(o.shiftKey?document.activeElement===i&&(o.preventDefault(),a.focus()):document.activeElement===a&&(o.preventDefault(),i.focus()))}}function C(o){o.addEventListener("keydown",(function(e){return x(e,o)}),!0)}function y(o){o.removeEventListener("keydown",(function(e){return x(e,o)}),!0)}function B(){o(i).attr("aria-modal",!1)}var w=function(t){o(i).attr("aria-modal",!0),o("body").addClass("borlabs-position-fix"),C(document.querySelector(".cookie-box")),void 0===t&&(t=!1);var a=o(s),c=null;return Object.keys(v.consents).length?(o("[data-borlabs-cookie-group]").each((function(){-1===Object.keys(v.consents).indexOf(this.dataset.borlabsCookieGroup)&&o(this).addClass("borlabs-hide")})),a.length&&"1"===e.boxLayoutAdvanced&&a.each((function(){c=this.value,"string"==typeof this.dataset.borlabsCookieCheckbox&&("object"==typeof v.consents[c]?o(this).prop("checked",!0):o(this).prop("checked",!1))}))):a.length&&a.each((function(){c=this.value,"1"===e.boxLayoutAdvanced&&"1"===e.ignorePreSelectStatus&&!1===f&&"essential"!==c&&(o(this).prop("checked",!1),o(n+"[name='cookies["+c+"][]']").prop("checked",!1).trigger("change"))})),e.blockContent?(o("#BorlabsCookieBox > div").addClass("_brlbs-block-content"),e.animation?(o("#BorlabsCookieBox > div").addClass("_brlbs-bg-animation"),setTimeout((function(){o("#BorlabsCookieBox > div").addClass("_brlbs-bg-dark")}),25)):o("#BorlabsCookieBox > div").addClass("_brlbs-bg-dark")):o("._brlbs-"+e.boxLayout+"-wrap").addClass("_brlbs-position-fixed"),o("#BorlabsCookieBox > div").css("display",""),o("#BorlabsCookieBox > div").addClass("show-cookie-box"),e.animation&&o("#BorlabsCookieBox ._brlbs-"+e.boxLayout).addClass("animated "+e.animationIn+(t&&e.animationDelay?" delay-1s":"")),o("#CookieBoxSaveButton")[0].focus(),!0},L=function(){return B(),y(document.querySelector(".cookie-box")),e.animation&&(o("#BorlabsCookieBox ._brlbs-"+e.boxLayout).removeClass("delay-1s "),o("#BorlabsCookieBox ._brlbs-"+e.boxLayout).removeClass(e.animationIn),o("#BorlabsCookieBox ._brlbs-"+e.boxLayout).addClass(e.animationOut)),o("#BorlabsCookieBox > div").addClass("borlabs-hide"),e.blockContent?o("#BorlabsCookieBox > div").removeClass("_brlbs-bg-dark"):o("._brlbs-"+e.boxLayout+"-wrap").addClass("_brlbs-position-fixed"),setTimeout((function(){o("._brlbs-"+e.boxLayout+"-wrap").removeAttr("style"),o("._brlbs-"+e.boxLayout+" .cookie-box .container").removeAttr("style"),o("._brlbs-"+e.boxLayout+" .cookie-preference .container").removeAttr("style"),e.animation&&(o("._brlbs-"+e.boxLayout).removeClass("animated"),o("._brlbs-"+e.boxLayout).removeClass("delay-1s"),o("._brlbs-"+e.boxLayout).removeClass(e.animationIn),o("._brlbs-"+e.boxLayout).removeClass(e.animationOut)),o("#BorlabsCookieBox > div").removeClass("show-cookie-box"),e.blockContent&&o("#BorlabsCookieBox > div").removeClass("_brlbs-block-content")}),e.animation?1e3:0),o("body").removeClass("borlabs-position-fix"),!0},_=function(){y(document.querySelector(".cookie-box")),C(document.querySelector(".cookie-preference"));var t=o(s),i=null;t.length&&t.each((function(){i=this.value,Object.keys(v.consents).length?!1===f&&(void 0!==v.consents[i]?(o(this).prop("checked",!0),o(this).trigger("change"),o(n+"[name='cookies["+i+"][]']").each((function(){-1!==v.consents[i].indexOf(this.value)?o(this).prop("checked",!0):o(this).prop("checked",!1),o(this).trigger("change")}))):(o(this).prop("checked",!1),o(this).trigger("change"),o(n+"[name='cookies["+i+"][]']").prop("checked",!1).trigger("change"))):("1"===e.ignorePreSelectStatus&&!1===f&&(o(this).prop("checked",!1),o("#BorlabsCookieBox [data-borlabs-cookie-group='"+this.value+"']").addClass("borlabs-hide")),o(this).trigger("change"),o(n+"[name='cookies["+i+"][]']").each((function(){"1"===e.ignorePreSelectStatus&&!1===f&&o(this).prop("checked",!1),o(this).trigger("change")})))})),o("._brlbs-"+e.boxLayout+" .cookie-box .container").animate({height:0,opacity:0},(function(){o("._brlbs-"+e.boxLayout+" .cookie-box").attr("aria-hidden",!0),o("._brlbs-"+e.boxLayout+" .cookie-preference").attr("aria-hidden",!1),o("#CookiePrefSave")[0].focus(),o("._brlbs-"+e.boxLayout+"-wrap").animate({width:"100vw",maxWidth:"box"===e.boxLayout?"768px":"100%"},"box"===e.boxLayout?400:0,(function(){var t=o("._brlbs-"+e.boxLayout+" .cookie-preference .container")[0].scrollHeight;o("._brlbs-"+e.boxLayout+" .cookie-preference .container").animate({height:"80vh",maxHeight:t,opacity:1})}))}))},S=function(){y(document.querySelector(".cookie-preference")),o("._brlbs-"+e.boxLayout+" .cookie-preference .container").animate({height:0,opacity:0},(function(){o("._brlbs-"+e.boxLayout+" .cookie-box").attr("aria-hidden",!1),o("._brlbs-"+e.boxLayout+" .cookie-preference").attr("aria-hidden",!0),o("._brlbs-"+e.boxLayout+"-wrap").animate({maxWidth:"box"===e.boxLayout?"375px":"100%"},"box"===e.boxLayout?400:0,(function(){var t=o("._brlbs-"+e.boxLayout+" .cookie-box .container")[0].scrollHeight+"px";o("._brlbs-"+e.boxLayout+" .cookie-box .container").animate({height:t,opacity:1})})),o("#CookieBoxSaveButton")[0].focus()}))},O=function(t){return void 0!==t&&t.preventDefault(),o("._brlbs-"+e.boxLayout+" .cookie-preference .container a["+"data-cookie-back]").css("display","none"),o("._brlbs-"+e.boxLayout+" .cookie-preference .container a["+"data-cookie-back] + span._brlbs-separator").css("display","none"),o("._brlbs-"+e.boxLayout+" .cookie-box .container").css("height",0),o("._brlbs-"+e.boxLayout+" .cookie-box .container").css("opacity",0),o("._brlbs-"+e.boxLayout+"-wrap").css({width:"100vw",maxWidth:"box"===e.boxLayout?"768px":"100%"}),w(!1),setTimeout((function(){_()}),500),!0},j=function(){o("[data-cookie-accordion]").on("click","[data-cookie-accordion-target]",(function(){var e=o(this).closest("[data-cookie-accordion]");e.find("[data-cookie-accordion-parent]:visible").length&&(e.find("[data-cookie-accordion-status='hide']").addClass("borlabs-hide"),e.find("[data-cookie-accordion-status='show']").removeClass("borlabs-hide"),e.find("[data-cookie-accordion-parent]:visible").slideUp()),e.find("[data-cookie-accordion-parent='"+this.dataset.cookieAccordionTarget+"']:hidden").length&&(o(this).children("[data-cookie-accordion-status='show']").addClass("borlabs-hide"),o(this).children("[data-cookie-accordion-status='hide']").removeClass("borlabs-hide"),e.find("[data-cookie-accordion-parent='"+this.dataset.cookieAccordionTarget+"']").slideDown())}))},I=function(){var e=o(s),t=null;e.length&&e.each((function(){t=this.value,o(this).prop("checked",!0),o(this).trigger("change"),o(n+"[name='cookies["+t+"][]']").each((function(){o(this).prop("checked",!0),o(this).trigger("change")}))})),E(),L()},D=function(){o(document).on("click",s,(function(){f=!0,this.checked?(o(n+"[name='cookies["+this.value+"][]']").prop("checked",!0).trigger("change"),o(s+"[value='"+this.value+"']").prop("checked",!0),o("#BorlabsCookieBox [data-borlabs-cookie-group='"+this.value+"']").length&&o("#BorlabsCookieBox [data-borlabs-cookie-group='"+this.value+"']").removeClass("borlabs-hide")):(o(n+"[name='cookies["+this.value+"][]']").prop("checked",!1).trigger("change"),o(s+"[value='"+this.value+"']").prop("checked",!1),o("#BorlabsCookieBox [data-borlabs-cookie-group='"+this.value+"']").length&&o("#BorlabsCookieBox [data-borlabs-cookie-group='"+this.value+"']").addClass("borlabs-hide"))}))},T=function(){o(document).on("click",n+"[name^='cookies']",(function(){f=!0,this.checked&&(o(s+"[value='"+this.dataset.cookieGroup+"']").prop("checked",!0).trigger("change"),o("#BorlabsCookieBox [data-borlabs-cookie-group='"+this.dataset.cookieGroup+"']").length&&o("#BorlabsCookieBox [data-borlabs-cookie-group='"+this.dataset.cookieGroup+"']").removeClass("borlabs-hide"))}))},A=function(){!0===this.checked?(o(this).parent().parent().children(c).children().last().css("display","none"),o(this).parent().parent().children(c).children().first().css("display","inline-block")):(o(this).parent().parent().children(c).children().first().css("display","none"),o(this).parent().parent().children(c).children().last().css("display","inline-block"))},E=function(){var t={essential:e.cookies.essential},i=o(s+":checked"),a=o(n+"[name^='cookies']:checked");if(i.length&&(i.each((function(){this.value.length&&new RegExp(/^[a-z-_]{3,}$/).test(this.value)&&"essential"!==this.value&&(t[this.value]=[])})),a.length&&a.each((function(){this.value.length&&"string"==typeof this.dataset.cookieGroup&&new RegExp(/^[a-z-_]{3,}$/).test(this.value)&&new RegExp(/^[a-z-_]{3,}$/).test(this.dataset.cookieGroup)&&t[this.dataset.cookieGroup].push(this.value)}))),Object.keys(v.consents).length)for(var c in v.consents)if(void 0!==t[c])for(var r in v.consents[c])-1===t[c].indexOf(v.consents[c][r])&&$(c,v.consents[c][r]);else if(void 0!==b[c])for(var l in b[c])$(c,l);H(t,!1),"1"!==e.reloadAfterConsent&&(M(),z(),q(),document.dispatchEvent(m.codeUnblockedAfterConsent),document.dispatchEvent(m.codeUnblocked))},U=function(){var o=!1;return"string"==typeof v.version&&(v.version===e.cookieVersion?o=!0:v.consents={}),o},P=function(){if(document.cookie.length)for(var o=document.cookie.split(";"),t=0;t0&&location.reload(!0)}))},X=function(){o.ajax(e.ajaxURL,{type:"POST",data:{action:"borlabs_cookie_handler",type:"consent_history",language:e.language,uid:v.uid}}).done((function(e){(e=o.parseJSON(e)).length&&o.each(e,(function(e,t){o("["+l+"] table").append(""+t.stamp+""+t.version+""+t.consent+"")}))}))},Y=function(){if(e.crossDomainCookie.length)for(var t in e.crossDomainCookie){var n=e.crossDomainCookie[t];o("body").append('')}},oo=function(){o(".BorlabsCookie [name^='borlabsCookie']").each((function(){J(this.value)?this.checked=!0:this.checked=!1,o(this).trigger("change")})),o(document).on("change",".BorlabsCookie [name^='borlabsCookie']",(function(){this.checked?R(this.dataset.cookieGroup,this.value):G(this.dataset.cookieGroup,this.value)}))};return{addConsent:R,allocateScriptBlockerToContentBlocker:function(o,e,t){"scriptBlockerId"!==t&&"jsHandle"!==t||(void 0===k[o]&&(k[o]={scriptBlockerId:[],jsHandle:[]}),-1===k[o][t].indexOf(e)&&k[o][t].push(e))},callWhenLoaded:function(o,e){var t=function(){!0===window.hasOwnProperty(o)?e(e):window.setTimeout(t,1e3)};t()},checkCookieConsent:J,checkCookieGroupConsent:function(o){var e=!1;return void 0!==v.consents[o]&&(e=!0),e},deleteCookie:N,getCookie:P,hideCookieBox:L,init:function(n,i,c,h){return"about:blank"!==window.location.href&&(e=o.extend({ajaxURL:"",language:"en",animation:"1",animationDelay:"",animationIn:"fadeIn",animationOut:"fadeOut",blockContent:"",boxLayout:"box",boxLayoutAdvanced:"0",automaticCookieDomainAndPath:"",cookieDomain:"",cookiePath:"",cookieLifetime:"365",crossDomainCookie:[],cookieBeforeConsent:"",cookiesForBots:"1",cookieVersion:"1",hideCookieBoxOnPages:[],respectDoNotTrack:"",reloadAfterConsent:"",showCookieBox:"1",cookieBoxIntegration:"javascript",ignorePreSelectStatus:"1",cookies:[]},n),t=h,b=i,u=c,m.consentSaved=document.createEvent("Event"),m.consentSaved.initEvent("borlabs-cookie-consent-saved",!0,!0),m.codeUnblocked=document.createEvent("Event"),m.codeUnblocked.initEvent("borlabs-cookie-code-unblocked",!0,!0),m.codeUnblockedAfterConsent=document.createEvent("Event"),m.codeUnblockedAfterConsent.initEvent("borlabs-cookie-code-unblocked-after-consent",!0,!0),P(),function(){if(Object.keys(b).length)for(var o in b)if(Object.keys(b[o]).length)for(var e in b[o])if(void 0!==b[o][e].settings&&void 0!==b[o][e].settings.blockCookiesBeforeConsent&&"1"===b[o][e].settings.blockCookiesBeforeConsent&&void 0!==b[o][e].cookieNameList&&!1===J(e))for(var t in b[o][e].cookieNameList)N(t,null,-1!==t.indexOf("*")),N(t,"",-1!==t.indexOf("*"))}(),null===v.uid&&(v.uid=function(){function o(){var o="";if("object"==typeof window.crypto){var e=0,t=new Uint32Array(4);for(window.crypto.getRandomValues(t);e<4;e++)o+="abcdefhgihjklmnopqrstuvwxyz0123456789"[t[e]%37]}else o=Math.floor(65536*(1+Math.random())).toString(16).substring(1);return o}return o()+o()+"-"+o()+o()+"-"+o()+o()+"-"+o()+o()}()),e.cookieBeforeConsent&&"function"==typeof Object&&(void 0===Object.entries&&(Object.entries=function(o){for(var e=Object.keys(o),t=e.length,n=new Array(t);t--;)n[t]=[e[t],o[e[t]]];return n}),0===Object.entries(v.consents).length&&null===v.expires&&(function(){var o={},t=[],n=e.cookieLifetimeEssentialOnly,i=new Date;i.setTime(i.getTime()+24*parseInt(n)*60*60*1e3);var a=i.toUTCString();o.consents={},o.domainPath=e.cookieDomain+e.cookiePath,o.expires=a,o.uid=v.uid,o.version=null,t.push(g+"="+encodeURIComponent(JSON.stringify(o))),""!==e.cookieDomain&&""===e.automaticCookieDomainAndPath&&t.push("domain="+e.cookieDomain),t.push("path="+e.cookiePath),t.push("expires="+a),t.push("SameSite=Lax"),document.cookie=t.join(";"),P()}(),Z())),o(a).length&&"SCRIPT"===o(a)[0].tagName&&o(a).after(o(a).html()),o(document).on("click","[data-cookie-accept]",(function(o){o.preventDefault(),E(),L()})),o(document).on("click","[data-cookie-accept-all]",(function(o){o.preventDefault(),I()})),o(document).on("click","[data-cookie-back]",(function(o){o.preventDefault(),S()})),o(document).on("click","[data-cookie-individual]",(function(o){o.preventDefault(),_()})),o(document).on("click","[data-cookie-refuse]",(function(e){e.preventDefault();var t=[];o(s+":checked").each((function(){-1===t.indexOf(this.value)&&(o(this).trigger("click"),t.push(this.value))})),E(),L()})),j(),D(),T(),!0===U()?(M(),z(),q(),document.dispatchEvent(m.codeUnblocked),B()):e.showCookieBox?0===e.hideCookieBoxOnPages.length||-1===e.hideCookieBoxOnPages.indexOf(window.location.protocol+"//"+window.location.host+window.location.pathname)?e.cookiesForBots&&/bot|googlebot|crawler|spider|robot|crawling|lighthouse/i.test(navigator.userAgent.toLowerCase())?(H(e.cookies,!1),M(),z(),q(),B(),document.dispatchEvent(m.codeUnblocked)):e.respectDoNotTrack&&void 0!==navigator.doNotTrack&&"1"===navigator.doNotTrack?(H({essential:e.cookies.essential},!1),M(),z(),q(),B(),document.dispatchEvent(m.codeUnblocked)):w(!0):(M(),z(),q(),B(),document.dispatchEvent(m.codeUnblocked)):B(),o(document).on("click","[data-borlabs-cookie-unblock]",W),o(document).on("click","[data-borlabs-cookie-preference]",O),o(document).on("click",".borlabs-cookie-preference",O),o(document).on("change","[data-borlabs-cookie-switch]",A),o(document).on("keydown",(function(e){9===e.keyCode&&o(d).addClass("_brlbs-keyboard")})),o(document).on("mousedown",(function(e){o(d).is(":visible")&&o(d).removeClass("_brlbs-keyboard")})),o("body").on("focus",".BorlabsCookie._brlbs-keyboard input[type='checkbox']",(function(e){var t=o(e.currentTarget).closest("label");t&&o(t).addClass("_brlbs-focused")})),o(d).on("blur","input[type='checkbox']",(function(e){var t=o(e.currentTarget).closest("label");t&&o(t).removeClass("_brlbs-focused")})),o("["+l+"]").length&&X(),oo(),o("["+r+"]").length&&o("["+r+"]").each((function(){o(this).html(v.uid)})),!0)},initConsentHistoryTable:X,initSwitchConsentButtonStatus:oo,openCookiePreference:O,removeConsent:G,showCookieBox:w,unblockContentId:function(e){o("[data-borlabs-cookie-type='content-blocker'][data-borlabs-cookie-id='"+e+"']").each((function(){V(o(this).parents(".BorlabsCookie"))}))},unblockScriptBlockerId:function(e){var t="[data-borlabs-script-blocker-id='"+e+"']";return o(t).length&&(p.scriptBlockerId[e]=o(t).length,F(t,e,"scriptBlockerId")),!0},unblockScriptBlockerJSHandle:function(e){var t="[data-borlabs-script-blocker-js-handle='"+e+"']";return o(t).length&&(p.jsHandle[e]=o(t).length,F(t,e,"jsHandle")),!0}}}()})();