PageSourceSearch

https://animalequality.org.uk/app/plugins/gdpr/dist/js/index.js?ver=1787559896

js animalequality.org.uk collected 2026-10-02 16:23:01 UTC 8,740 bytes, 19 lines download raw bytes

1function d(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var s in n)t[s]=n[s]}return t}var y={read:function(t){return t[0]==='"'&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function g(t,e){function n(o,r,i){if(!(typeof document>"u")){i=d({},e,i),typeof i.expires=="number"&&(i.expires=new Date(Date.now()+i.expires*864e5)),i.expires&&(i.expires=i.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var c in i)i[c]&&(a+="; "+c,i[c]!==!0&&(a+="="+i[c].split(";")[0]));return document.cookie=o+"="+t.write(r,o)+a}}function s(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var r=document.cookie?document.cookie.split("; "):[],i={},a=0;a<r.length;a++){var c=r[a].split("="),k=c.slice(1).join("=");try{var h=decodeURIComponent(c[0]);if(i[h]=t.read(k,h),o===h)break}catch{}}return o?i[o]:i}}return Object.create({set:n,get:s,remove:function(o,r){n(o,"",d({},r,{expires:-1}))},withAttributes:function(o){return g(this.converter,d({},this.attributes,o))},withConverter:function(o){return g(d({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(t)}})}var u=g(y,{path:"/"});var C=(t,e)=>{let n=document.createElement("div"),s=parseInt(Math.random()*1e4),o=e.overlay,r=o.message.text.replace("{link}",`<a href="${o.message.link.url}" target="_blank">${o.message.link.label}</a>`).replace("{source}",t.name);return n.classList.add("no-cookie-consent-overlay"),n.classList.add("no-cookie-consent-overlay--absolute"),n.innerHTML=`<div>
2    <p class="m-0 color-white align-center">
3      ${r}
4    </p>
5    <button class="${o.button.cssClasses} no-cookie-consent-overlay__unlock">
6      ${o.button.label}
7    </button>
8    <form class="mt-2">
9      <input type="checkbox" id="cookie-consent-all-${s}" />
10      <label for="cookie-consent-all-${s}" class="color-white">
11        ${o.checkbox.label}
12      </label>
13    </form>
14  </div>`,n};function p(t){return t.dependencies.filter(e=>this.hasConsent(e,!1)).length===t.dependencies.length}function b(t,e){let n=C(e,this.embedConfig),s=t.parentElement,o;t.dataset.isBlocked!=="true"&&(e.overlayContainer?o=t.closest(e.overlayContainer):s.classList.contains("wp-block-embed__wrapper")?o=s:(o=document.createElement("div"),o.style.position="relative",o.classList.add("no-cookie-consent-overlay-container"),o.style.height="100%",s.insertBefore(o,t),o.appendChild(t)),o.appendChild(n),t.dataset.isBlocked=!0,t.getAttribute("src")&&(t.dataset.gdprSrc=t.getAttribute("src"),t.removeAttribute("src")),n.querySelector(".no-cookie-consent-overlay__unlock").addEventListener("click",()=>{n.querySelector('input[type="checkbox"]').checked&&this._consentToSources(e.dependencies),m(t,e),v(e.id)}))}function m(t,e){let n=null;e.overlayContainer?n=t.closest(e.overlayContainer).querySelector(".no-cookie-consent-overlay"):n=t.parentElement.querySelector(".no-cookie-consent-overlay"),n&&n.remove(),t.dataset.isBlocked=!1,t.dataset.gdprSrc&&(t.setAttribute("src",t.dataset.gdprSrc.replace(/youtube\.com/,"youtube-nocookie.com")),t.removeAttribute("data-gdpr-src"))}function v(t){let e=new window.Event(`aePrivacyConsentEmbed${t[0].toUpperCase()+t.slice(1)}`);window.dispatchEvent(e)}function f(){this.embedConfig.sources.forEach(t=>{let e=document.querySelectorAll(t.embedElement);for(let n of e)p.call(this,t)?m(n,t):b.call(this,n,t);this.hasConsent(t.id)&&v(t.id)})}var _={youtube:{embedElement:'iframe[src*="youtube"],iframe[data-gdpr-src*="youtube"]'},vimeo:{embedElement:'iframe[src*="vimeo"],iframe[data-gdpr-src*="vimeo"]'},flickr:{embedElement:'img[src*="flickr"],img[data-gdpr-src*="flickr"]',overlayContainer:".wp-block-embed__wrapper"},google_maps:{embedElement:".wp-block-animalequality-google-map > div"},asana:{embedElement:'iframe[src*="asana"],iframe[data-gdpr-src*="asana"]'}},l=class{constructor(){this.consentManagerElement=document.querySelector(".cookie-consent-manager"),this.consentSources=[...this.consentManagerElement.querySelectorAll('input[type="checkbox"]:not([data-no-cookie])')],this.buttons=this.consentManagerElement.querySelectorAll(".cookie-consent-manager__buttons button"),this.buttonPersonalizeEnter=this.consentManagerElement.querySelector('button[data-action="personalize-enter"]'),this.buttonPersonalizeSave=this.consentManagerElement.querySelector('button[data-action="personalize-save"]'),this.isPersonalizing=!1,this.googleTagManagerWasLoaded=!1,this.cookieExpires=365,this.cookiePrefix="ae_cookie_consent_";try{this.embedConfig=JSON.parse(this.consentManagerElement.dataset.embedConfig),this.embedConfig.sources=this.embedConfig.sources.map(e=>({...e,..._[e.id]}))}catch(e){this.embedConfig=null,console.warn("PrivacyConsentManager: no embed config provided",e)}try{this.googleTagManagerConfig=JSON.parse(this.consentManagerElement.dataset.googleTagManagerConfig)}catch(e){this.googleTagManagerConfig=null,console.warn("PrivacyConsentManager: no google tag manager config provided",e)}}_getSourceCheckbox(e){return this.consentSources.find(n=>n.name===e)||null}_updateConsent(){this._updateStatistics(),this._writeCookies(),this._consentGiven(),this._hide()}_stateIsValid(){return this.consentSources.filter(e=>this._readCookie(e.name)).length===this.consentSources.length}_writeCookie(e,n){u.set(this.cookiePrefix+e,n,{expires:this.cookieExpires})}
14_writeCookies(){this.consentSources.forEach(e=>{this._writeCookie(e.name,e.checked)})}_readCookie(e){return u.get(`${this.cookiePrefix}${e}`)}_readCookies(){this.consentSources.forEach(e=>{e.checked=this._readCookie(e.name)==="true"})}_consentGiven(){let e="aePrivacyConsentGiven",n=new Event(e);this._readCookies(),window.dispatchEvent(n),this.embedConfig&&f.call(this),window.dataLayer&&window.dataLayer.push({event:e})}_bindOpenLink(){for(let e of document.querySelectorAll(".ae-cookie-consent-manager-open"))e.classList.remove("hide"),e.addEventListener("click",n=>{n.preventDefault(),this._show()})}_enterIsPersonalizing(){this.consentManagerElement.classList.add("is-personalizing"),this.buttonPersonalizeEnter.style.display="none",this.buttonPersonalizeSave.style.display="block",this.isPersonalizing=!0}_exitIsPersonalizing(){this.consentManagerElement.classList.remove("is-personalizing"),this.buttonPersonalizeEnter.style.display="block",this.buttonPersonalizeSave.style.display="none",this.isPersonalizing=!1}_consentToSources(e){e.forEach(n=>{let s=this._getSourceCheckbox(n);s&&(s.checked=!0,this._writeCookie(s.name,s.checked))}),this._stateIsValid()&&this._consentGiven()}_hide(){this.consentManagerElement.style.display="none",document.documentElement.style.overflow="auto"}_show(){let e=getComputedStyle(this.consentManagerElement);
14this._readCookies(),this.consentManagerElement.style.display="block",!(e.display==="none"||e.visibility==="hidden"||e.width==="0px"||e.height==="0px"||parseInt(e.zIndex)<0)&&(document.documentElement.style.overflow="hidden")}async _updateStatistics(){try{let e=this.consentSources.filter(s=>s.checked).map(s=>s.name),n=await fetch("/wp-json/ae-consent-manager/v1/update-statistics",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(["sessions",...e])});if(!n.ok)throw new Error(`Error: ${n.statusText}`)}catch(e){console.error("Error incrementing consent counters:",e)}}init(){this.buttons.forEach(e=>{let n=e.dataset.action;e.addEventListener("click",s=>{switch(s.preventDefault(),n){case"decline":this.consentSources.forEach(o=>{o.checked=!1}),this._updateConsent(),this._exitIsPersonalizing();break;case"consent":this.consentSources.forEach(o=>{o.checked=!0}),this._updateConsent(),this._exitIsPersonalizing();break;case"personalize-enter":this._enterIsPersonalizing();break;case"personalize-save":this._updateConsent(),this._exitIsPersonalizing();break}})}),this._stateIsValid()?this._consentGiven():(f.call(this),this._show()),this._bindOpenLink(),this._exitIsPersonalizing()}hasConsent(e,n=!0){let s=this.embedConfig.sources.find(o=>o.id===e);return this._stateIsValid()&&(this._readCookie(e)==="true"||n&&s&&p.call(this,s))}hasGoogleTagManagerConsent(){if(!this.googleTagManagerConfig?.dependencies?.length)return!0;let e=this.googleTagManagerConfig.logic,n=this.googleTagManagerConfig.dependencies.filter(s=>this.hasConsent(s)).length;return!e||e==="and"?n===this.googleTagManagerConfig.dependencies.length:n>0}};document.addEventListener("DOMContentLoaded",()=>{window.privacyConsentManager=new l,window.privacyConsentManager.init()});
15/*! Bundled license information:
16
17js-cookie/dist/js.cookie.mjs:
18  (*! js-cookie v3.0.5 | MIT *)
19*/

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.