var EPiCookiePro=function(){function f(){var b=document.querySelectorAll('[cookiepro-check="true"]'),c="",t,y,p,u,w,h;for(i=window.OnetrustActiveGroups,r=window.OneTrust.GetDomainData(),console.log(window.OnetrustActiveGroups),u=0;u<b.length;u++){t=b[u];c=t.tagName;console.log("Element: "+c);var v="",a="",g="",s="",o="";t.attributes.src!=null&&typeof t.attributes.src!="undefined"&&(v=t.attributes.src.value);t.attributes["data-src"]!=null&&typeof t.attributes["data-src"]!="undefined"&&(a=t.attributes["data-src"].value);t.attributes.type!=null&&typeof t.attributes.type!="undefined"&&(g=t.attributes.type.value);t.attributes["class"]!=null&&typeof t.attributes["class"]!="undefined"&&(s=t.attributes["class"].value);s.indexOf("cookie-category-")>-1&&(o=s.replace("cookie-category-",""));y=v;v===""&&(y=a);o===""&&(o=l(r,y));o===""&&(o=n.StrictlyNecessary);o!==""&&s.indexOf("cookie-category-"+o)===-1&&(s="cookie-category-"+o,t.classList.add(s.trim()));i.indexOf(o)>-1&&(c==="IFRAME"&&(a!==""&&t.setAttribute("src",a),t.removeAttribute("cookiepro-check"),t.style.display="block",p=document.getElementsByClassName("blocked-iframe-message"),p.length&&(p[u].style.display="none")),c==="SCRIPT"&&(t.attributes.type.value="text/javascript",t.removeAttribute("cookiepro-check"),t.setAttribute("reload-script","true")))}var f=document.querySelectorAll('[reload-script="true"][src]'),k=0,d=0;if(f!==null&&f!=="string")for(k=f.length,u=0;u<f.length;u++)w=document.createElement("div"),f[u].parentNode.insertBefore(w,f[u]),f[u].parentNode.removeChild(f[u]),f[u].attributes.src!=null&&typeof f[u].attributes.src!="undefined"&&(h=document.createElement("script"),h.type="text/javascript",h.src=f[u].attributes.src.value,h.addEventListener("load",function(){d++;d===k&&e()}),w.appendChild(h))}function e(){var n=document.querySelectorAll('[reload-script="true"]:not([src])'),t,r,i;if(n!==null&&n!=="string")for(t=0;t<n.length;t++)r=document.createElement("div"),n[t].parentNode.insertBefore(r,n[t]),n[t].parentNode.removeChild(n[t]),i=document.createElement("script"),i.type="text/javascript",i.innerHTML=n[t].innerHTML,r.appendChild(i)}function o(n){for(var u,i,f,r,s=document.getElementsByClassName(n),o=0;o<s.length;o++)if(u=s[o],u!==null&&typeof u!="undefined"&&(i=u.getElementsByTagName("iframe"),i!==null&&typeof i!="undefined"&&i.length))for(f=0;f<i.length;f++)if(r=i[f],r.attributes["class"]!=null&&typeof r.attributes["class"]!="undefined"){var h=r.attributes["class"].value,c=t(h),e=u.getElementsByClassName("blocked-iframe-message");c?(r.style.display="block",e.length&&(e[0].style.display="none")):(r.style.display="none",e.length&&(e[0].style.display="block"))}}function t(n){var t=s();return t==="false"||t===!1?!0:((n.indexOf("cookie-category-")>-1||n.indexOf("optanon-category-")>-1)&&(n=n.replace("cookie-category-",""),n=n.replace("optanon-category-","")),window.OnetrustActiveGroups!==null&&typeof OnetrustActiveGroups!="undefined"&&window.OnetrustActiveGroups.indexOf(n)>-1)?!0:!1}function s(){var n=document.querySelector("[data-cookiepro-enabled]");return n!==null&&typeof n!="undefined"?u=n.dataset.cookieProEnabled:console.log("data-cookiepro-enabled attribute not set in body tag."),u}function h(){if(t(n.LiveChat)){var i=document.getElementById("fakeChatButton");$("#chatCookieModal").modal("hide");i.style.display="none";$(document).trigger("initSnapEngage")}}function c(){$(window).trigger("element-tracking-event")}function l(n,t){var e="",o=a(t),i,u,r,f;if(n!==null&&typeof n!="undefined"&&t!==""&&(i=n.Groups,i!==null&&typeof i!="undefined"))for(u=0;u<i.length;u++)r=i[u],r!==null&&typeof r!="undefined"&&(f=r.Hosts.filter(function(n){return o.indexOf(n.HostName)>-1})[0],f!==null&&typeof f!="undefined"&&(e=r.OptanonGroupId));return e}function a(n){var t="";return t=n.indexOf("//")>-1?n.split("/")[2]:n.split("/")[0],t=t.split(":")[0],t.split("?")[0]}var i="",r={},u=!1,n={StrictlyNecessary:"C0001",Performance:"C0002",Functional:"C0003",Targeting:"C0004",SocialMedia:"C0005",LiveChat:"C0007"};return{CheckCustomItems:f,DisplayVideoOverlay:o,IsCookieCategoryAllowed:t,ConsentCategories:n,HandleFakeChatButton:h,ElementTrackingEvent:c}}();
//# sourceMappingURL=/bundles/epi-cookiepromap
