cookie-though
Advanced tools
Comparing version 2.0.0-rc.2 to 2.0.0-rc.3
@@ -1,1 +0,1 @@ | ||
function e(e){return e&&e.__esModule?e.default:e}var t,n,o,r,i,c,l,a={},s=[],u=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function d(e,t){for(var n in t)e[n]=t[n];return e}function _(e){var t=e.parentNode;t&&t.removeChild(e)}function p(e,n,o){var r,i,c,l={};for(c in n)"key"==c?r=n[c]:"ref"==c?i=n[c]:l[c]=n[c];if(arguments.length>2&&(l.children=arguments.length>3?t.call(arguments,2):o),"function"==typeof e&&null!=e.defaultProps)for(c in e.defaultProps)void 0===l[c]&&(l[c]=e.defaultProps[c]);return f(e,l,r,i,null)}function f(e,t,r,i,c){var l={type:e,props:t,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==c?++o:c};return null==c&&null!=n.vnode&&n.vnode(l),l}function h(e){return e.children}function v(e,t){this.props=e,this.context=t}function m(e,t){if(null==t)return e.__?m(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?m(e):null}function b(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return b(e)}}function g(e){(!e.__d&&(e.__d=!0)&&r.push(e)&&!y.__r++||c!==n.debounceRendering)&&((c=n.debounceRendering)||i)(y)}function y(){for(var e;y.__r=r.length;)e=r.sort((function(e,t){return e.__v.__b-t.__v.__b})),r=[],e.some((function(e){var t,n,o,r,i,c;e.__d&&(i=(r=(t=e).__v).__e,(c=t.__P)&&(n=[],(o=d({},r)).__v=r.__v+1,L(c,r,o,t.__n,void 0!==c.ownerSVGElement,null!=r.__h?[i]:null,n,null==i?m(r):i,r.__h),S(n,r),r.__e!=i&&b(r)))}))}function k(e,t,n,o,r,i,c,l,u,d){var _,p,v,b,g,y,k,C=o&&o.__k||s,P=C.length;for(n.__k=[],_=0;_<t.length;_++)if(null!=(b=n.__k[_]=null==(b=t[_])||"boolean"==typeof b?null:"string"==typeof b||"number"==typeof b||"bigint"==typeof b?f(null,b,null,null,b):Array.isArray(b)?f(h,{children:b},null,null,null):b.__b>0?f(b.type,b.props,b.key,null,b.__v):b)){if(b.__=n,b.__b=n.__b+1,null===(v=C[_])||v&&b.key==v.key&&b.type===v.type)C[_]=void 0;else for(p=0;p<P;p++){if((v=C[p])&&b.key==v.key&&b.type===v.type){C[p]=void 0;break}v=null}L(e,b,v=v||a,r,i,c,l,u,d),g=b.__e,(p=b.ref)&&v.ref!=p&&(k||(k=[]),v.ref&&k.push(v.ref,null,b),k.push(p,b.__c||g,b)),null!=g?(null==y&&(y=g),"function"==typeof b.type&&b.__k===v.__k?b.__d=u=x(b,u,e):u=w(e,b,v,C,g,u),"function"==typeof n.type&&(n.__d=u)):u&&v.__e==u&&u.parentNode!=e&&(u=m(v))}for(n.__e=y,_=P;_--;)null!=C[_]&&("function"==typeof n.type&&null!=C[_].__e&&C[_].__e==n.__d&&(n.__d=m(o,_+1)),H(C[_],C[_]));if(k)for(_=0;_<k.length;_++)A(k[_],k[++_],k[++_])}function x(e,t,n){for(var o,r=e.__k,i=0;r&&i<r.length;i++)(o=r[i])&&(o.__=e,t="function"==typeof o.type?x(o,t,n):w(n,o,o,r,o.__e,t));return t}function w(e,t,n,o,r,i){var c,l,a;if(void 0!==t.__d)c=t.__d,t.__d=void 0;else if(null==n||r!=i||null==r.parentNode)e:if(null==i||i.parentNode!==e)e.appendChild(r),c=null;else{for(l=i,a=0;(l=l.nextSibling)&&a<o.length;a+=2)if(l==r)break e;e.insertBefore(r,i),c=i}return void 0!==c?c:r.nextSibling}function C(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||u.test(t)?n:n+"px"}function P(e,t,n,o,r){var i;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof o&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||C(e.style,t,"");if(n)for(t in n)o&&n[t]===o[t]||C(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])i=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?o||e.addEventListener(t,i?E:z,i):e.removeEventListener(t,i?E:z,i);else if("dangerouslySetInnerHTML"!==t){if(r)t=t.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null!=n&&(!1!==n||"a"===t[0]&&"r"===t[1])?e.setAttribute(t,n):e.removeAttribute(t))}}function z(e){this.l[e.type+!1](n.event?n.event(e):e)}function E(e){this.l[e.type+!0](n.event?n.event(e):e)}function L(e,o,r,i,c,l,s,u,p){var f,b,g,y,x,w,C,z,E,L,S,A=o.type;if(void 0!==o.constructor)return null;null!=r.__h&&(p=r.__h,u=o.__e=r.__e,o.__h=null,l=[u]),(f=n.__b)&&f(o);try{e:if("function"==typeof A){if(z=o.props,E=(f=A.contextType)&&i[f.__c],L=f?E?E.props.value:f.__:i,r.__c?C=(b=o.__c=r.__c).__=b.__E:("prototype"in A&&A.prototype.render?o.__c=b=new A(z,L):(o.__c=b=new v(z,L),b.constructor=A,b.render=q),E&&E.sub(b),b.props=z,b.state||(b.state={}),b.context=L,b.__n=i,g=b.__d=!0,b.__h=[]),null==b.__s&&(b.__s=b.state),null!=A.getDerivedStateFromProps&&(b.__s==b.state&&(b.__s=d({},b.__s)),d(b.__s,A.getDerivedStateFromProps(z,b.__s))),y=b.props,x=b.state,g)null==A.getDerivedStateFromProps&&null!=b.componentWillMount&&b.componentWillMount(),null!=b.componentDidMount&&b.__h.push(b.componentDidMount);else{if(null==A.getDerivedStateFromProps&&z!==y&&null!=b.componentWillReceiveProps&&b.componentWillReceiveProps(z,L),!b.__e&&null!=b.shouldComponentUpdate&&!1===b.shouldComponentUpdate(z,b.__s,L)||o.__v===r.__v){b.props=z,b.state=b.__s,o.__v!==r.__v&&(b.__d=!1),b.__v=o,o.__e=r.__e,o.__k=r.__k,o.__k.forEach((function(e){e&&(e.__=o)})),b.__h.length&&s.push(b);break e}null!=b.componentWillUpdate&&b.componentWillUpdate(z,b.__s,L),null!=b.componentDidUpdate&&b.__h.push((function(){b.componentDidUpdate(y,x,w)}))}b.context=L,b.props=z,b.state=b.__s,(f=n.__r)&&f(o),b.__d=!1,b.__v=o,b.__P=e,f=b.render(b.props,b.state,b.context),b.state=b.__s,null!=b.getChildContext&&(i=d(d({},i),b.getChildContext())),g||null==b.getSnapshotBeforeUpdate||(w=b.getSnapshotBeforeUpdate(y,x)),S=null!=f&&f.type===h&&null==f.key?f.props.children:f,k(e,Array.isArray(S)?S:[S],o,r,i,c,l,s,u,p),b.base=o.__e,o.__h=null,b.__h.length&&s.push(b),C&&(b.__E=b.__=null),b.__e=!1}else null==l&&o.__v===r.__v?(o.__k=r.__k,o.__e=r.__e):o.__e=function(e,n,o,r,i,c,l,s){var u,d,p,f=o.props,h=n.props,v=n.type,b=0;if("svg"===v&&(i=!0),null!=c)for(;b<c.length;b++)if((u=c[b])&&"setAttribute"in u==!!v&&(v?u.localName===v:3===u.nodeType)){e=u,c[b]=null;break}if(null==e){if(null===v)return document.createTextNode(h);e=i?document.createElementNS("http://www.w3.org/2000/svg",v):document.createElement(v,h.is&&h),c=null,s=!1}if(null===v)f===h||s&&e.data===h||(e.data=h);else{if(c=c&&t.call(e.childNodes),d=(f=o.props||a).dangerouslySetInnerHTML,p=h.dangerouslySetInnerHTML,!s){if(null!=c)for(f={},b=0;b<e.attributes.length;b++)f[e.attributes[b].name]=e.attributes[b].value;(p||d)&&(p&&(d&&p.__html==d.__html||p.__html===e.innerHTML)||(e.innerHTML=p&&p.__html||""))}if(function(e,t,n,o,r){var i;for(i in n)"children"===i||"key"===i||i in t||P(e,i,null,n[i],o);for(i in t)r&&"function"!=typeof t[i]||"children"===i||"key"===i||"value"===i||"checked"===i||n[i]===t[i]||P(e,i,t[i],n[i],o)}(e,h,f,i,s),p)n.__k=[];else if(b=n.props.children,k(e,Array.isArray(b)?b:[b],n,o,r,i&&"foreignObject"!==v,c,l,c?c[0]:o.__k&&m(o,0),s),null!=c)for(b=c.length;b--;)null!=c[b]&&_(c[b]);s||("value"in h&&void 0!==(b=h.value)&&(b!==f.value||b!==e.value||"progress"===v&&!b)&&P(e,"value",b,f.value,!1),"checked"in h&&void 0!==(b=h.checked)&&b!==e.checked&&P(e,"checked",b,f.checked,!1))}return e}(r.__e,o,r,i,c,l,s,p);(f=n.diffed)&&f(o)}catch(e){o.__v=null,(p||null!=l)&&(o.__e=u,o.__h=!!p,l[l.indexOf(u)]=null),n.__e(e,o,r)}}function S(e,t){n.__c&&n.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){n.__e(e,t.__v)}}))}function A(e,t,o){try{"function"==typeof e?e(t):e.current=t}catch(e){n.__e(e,o)}}function H(e,t,o){var r,i;if(n.unmount&&n.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||A(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){n.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&H(r[i],t,"function"!=typeof e.type);o||null==e.__e||_(e.__e),e.__e=e.__d=void 0}function q(e,t,n){return this.constructor(e,n)}function T(e,o,r){var i,c,l;n.__&&n.__(e,o),c=(i="function"==typeof r)?null:r&&r.__k||o.__k,l=[],L(o,e=(!i&&r||o).__k=p(h,null,[e]),c||a,a,void 0!==o.ownerSVGElement,!i&&r?[r]:c?null:o.firstChild?t.call(o.childNodes):null,l,!i&&r?r:c?c.__e:o.firstChild,i),S(l,e)}function F(e,t){var n={__c:t="__cC"+l++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,o;return this.getChildContext||(n=[],(o={})[t]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some(g)},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}t=s.slice,n={__e:function(e,t){for(var n,o,r;t=t.__;)if((n=t.__c)&&!n.__)try{if((o=n.constructor)&&null!=o.getDerivedStateFromError&&(n.setState(o.getDerivedStateFromError(e)),r=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e),r=n.__d),r)return n.__E=n}catch(t){e=t}throw e}},o=0,v.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=d({},this.state),"function"==typeof e&&(e=e(d({},n),this.props)),e&&d(n,e),null!=e&&this.__v&&(t&&this.__h.push(t),g(this))},v.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),g(this))},v.prototype.render=h,r=[],i="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,y.__r=0,l=0;var M=0;function U(e,t,o,r,i){var c,l,a={};for(l in t)"ref"==l?c=t[l]:a[l]=t[l];var s={type:e,props:a,key:o,ref:c,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--M,__source:r,__self:i};if("function"==typeof e&&(c=e.defaultProps))for(l in c)void 0===a[l]&&(a[l]=c[l]);return n.vnode&&n.vnode(s),s}const $="cookie-preferences";var D,N,K,W={ariaLabel:"Cookie banner",optionsAriaLabel:"Cookie options",policies:[{id:"essential",label:"Strictly necessary cookies",description:"These cookies are required to run the site.",category:"essential"},{id:"functional",label:"Functional cookies",description:"We'll remember the basics such as language.",category:"functional"},{id:"statistics",label:"Statistics",description:"We'll know where we should improve your experience.",category:"statistics"},{id:"marketing",label:"Marketing",description:"We'll only show you ads you're interested in.",category:"marketing"},{id:"social",label:"Social",description:"This allows us to track your social activity",category:"social"},{id:"personalisation",label:"Personalisation",description:"We'll only show you content that interests you.",category:"personalisation"}],essentialLabel:"Always on",header:{intro:"You're probably fed up with these banners...",title:"cookie though?",description:"Everybody wants to show his best side - and so do we. That's why we use cookies to guarantee you a better experience."},permissionLabels:{accept:"Accept",acceptAll:"Accept all",decline:"Decline"},customizeLabel:"Customize",cookiePreferencesKey:$},O=0,B=[],I=n.__b,R=n.__r,Y=n.diffed,Z=n.__c,V=n.unmount;function j(e,t){n.__h&&n.__h(N,e,O||t),O=0;var o=N.__H||(N.__H={__:[],__h:[]});return e>=o.__.length&&o.__.push({}),o.__[e]}function G(e){return O=1,J(se,e)}function J(e,t,n){var o=j(D++,2);return o.t=e,o.__c||(o.__=[n?n(t):se(void 0,t),function(e){var t=o.t(o.__[0],e);o.__[0]!==t&&(o.__=[t,o.__[1]],o.__c.setState({}))}],o.__c=N),o.__}function Q(e,t){var o=j(D++,3);!n.__s&&ae(o.__H,t)&&(o.__=e,o.__H=t,N.__H.__h.push(o))}function X(e,t){var o=j(D++,4);!n.__s&&ae(o.__H,t)&&(o.__=e,o.__H=t,N.__h.push(o))}function ee(e){return O=5,te((function(){return{current:e}}),[])}function te(e,t){var n=j(D++,7);return ae(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function ne(e,t){return O=8,te((function(){return e}),t)}function oe(e){var t=N.context[e.__c],n=j(D++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(N)),t.props.value):e.__}function re(){for(var e;e=B.shift();)if(e.__P)try{e.__H.__h.forEach(ce),e.__H.__h.forEach(le),e.__H.__h=[]}catch(t){e.__H.__h=[],n.__e(t,e.__v)}}n.__b=function(e){N=null,I&&I(e)},n.__r=function(e){R&&R(e),D=0;var t=(N=e.__c).__H;t&&(t.__h.forEach(ce),t.__h.forEach(le),t.__h=[])},n.diffed=function(e){Y&&Y(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==B.push(t)&&K===n.requestAnimationFrame||((K=n.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(o),ie&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,100);ie&&(t=requestAnimationFrame(n))})(re)),N=null},n.__c=function(e,t){t.some((function(e){try{e.__h.forEach(ce),e.__h=e.__h.filter((function(e){return!e.__||le(e)}))}catch(o){t.some((function(e){e.__h&&(e.__h=[])})),t=[],n.__e(o,e.__v)}})),Z&&Z(e,t)},n.unmount=function(e){V&&V(e);var t,o=e.__c;o&&o.__H&&(o.__H.__.forEach((function(e){try{ce(e)}catch(e){t=e}})),t&&n.__e(t,o.__v))};var ie="function"==typeof requestAnimationFrame;function ce(e){var t=N,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),N=t}function le(e){var t=N;e.__c=e.__(),N=t}function ae(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function se(e,t){return"function"==typeof t?t(e):t}const ue=F(void 0),de=({container:e,children:t})=>{const[n]=G((()=>e));return U(ue.Provider,{value:n,children:t},void 0)},_e=()=>{const e=oe(ue);if(void 0===e)throw new Error("useContainer must be used within a ContainerProvider");return e},pe=F(void 0),fe=({onPreferencesChanged:e,children:t})=>{const[n]=G((()=>e));return U(pe.Provider,{value:n,children:t},void 0)};var he=e=>{X(e,[])};const ve=e=>"essential"===e,me=({policies:e,preferences:t,isCustomised:n})=>({options:e.map((e=>{const n=!!t.find((({id:t})=>t===e.id))?.isEnabled;return{...e,isEnabled:n}})),isCustomised:n}),be=({newPreferences:e,currentPreferences:t})=>e.map((({id:e})=>({id:e,isEnabled:!!t.find((t=>t.id===e))?.isEnabled}))),ge=e=>{const t=decodeURIComponent(document.cookie).split(";").reduce(((t,n)=>{if(t)return t;const[o,r]=n.split("=");return o.trim()===e?r.split("|"):void 0}),void 0);if(t)return t.map((e=>{const[t,n]=e.split(":");return{id:t,isEnabled:!!+n}}))},ye=({cookiePreferencesKey:e,options:t,onPreferencesChanged:n})=>{const o=(e=>e.reduce(((e,{id:t,isEnabled:n},o)=>`${e}${0!==o?"|":""}${t}:${+n}`),""))(t),r=`expires=${(()=>{const e=new Date;return new Date(e.setFullYear(e.getFullYear()+1)).toUTCString()})()}`;return document.cookie=`${e}=${o};${r};path=/;SameSite=strict`,n&&n({isCustomised:!0,preferences:t.map((({id:e,isEnabled:t})=>({id:e,isEnabled:t})))}),t};var ke=({policies:e,cookiePreferencesKey:t})=>{const n=ge(t),o=(e=>e.map((({id:e,category:t})=>({id:e,isEnabled:ve(t)}))))(e),r=me({policies:e,preferences:o,isCustomised:!1});return n?(({newPreferences:e,currentPreferences:t})=>{const n=e.map((({id:e})=>e)),o=t.map((({id:e})=>e));return o.length!==n.length||n.reduce(((e,t)=>e||!o.includes(t)),!1)})({newPreferences:o,currentPreferences:n})?me({policies:e,preferences:be({newPreferences:o,currentPreferences:n}),isCustomised:!1}):me({policies:e,preferences:n,isCustomised:!0}):r};const xe=()=>!window.matchMedia("(prefers-reduced-motion: no-preference)").matches;var we=()=>{const[e,t]=G(xe);return Q((()=>{const e=window.matchMedia("(prefers-reduced-motion: no-preference)"),n=e=>t(!e.matches);return e.addEventListener("change",n),()=>e.removeEventListener("change",n)}),[]),e};const Ce=e=>parseInt(getComputedStyle(e).getPropertyValue("--ct-transition-duration"),10);var Pe=()=>{const e=_e();return Ce(e)};let ze=0,Ee=0;const Le=(e,t)=>{const n=window.getComputedStyle(e)[t];return"auto"===n||""===n?0:parseFloat(n)},Se=e=>Le(e,"height")+Le(e,"marginBottom"),Ae=e=>{const t=ze+Ee,n=e.previousElementSibling,o=e.querySelector("summary"),r=e.nextElementSibling,i=Se(n),c=Se(o),l=Se(r),a=4*parseInt(getComputedStyle(Fe()).paddingBottom,10),s=window.innerHeight-i-c-l-a,u=s-a/4,d=t>s;return{hasOverflow:d,openHeight:`${d?u:ze}px`,maxHeight:`${u}px`}},He=e=>`${parseFloat(e)+Ee}px`;var qe=e=>{const[t,n]=G(null),[o,r]=G(!1),i=we(),c=Pe();Q((()=>{e.current&&n(e.current)}),[t,e]);const l=ne((()=>{const e=t.querySelector(".content"),{maxHeight:n}=Ae(t);e.style.maxHeight=n,e.style.overflowY="scroll",r((e=>!e))}),[t]),a=ne((e=>{e.preventDefault();const n=t.querySelector(".content"),o=n.childElementCount>1,i=({details:e,isOpen:t})=>{const n=e.querySelector(".content"),{openHeight:i,hasOverflow:l}=Ae(e),a=t?["0px",o?He(i):i]:[n.style.height,"0px"];n.animate({height:a},{duration:c,easing:"ease-in-out"}).onfinish=()=>t?(n.style.height=i,(o||l)&&(n.style.marginBottom=`${Ee}px`),l?n.style.overflowY="scroll":n.style.removeProperty("overflowY")):(e.open=t,r(t),n.removeAttribute("style"))};n.style.overflow="hidden",t.open?window.requestAnimationFrame((()=>{const e=Se(n);n.style.height=`${e}px`,n.style.marginBottom="0px",i({details:t,isOpen:!1})})):(()=>{const e=t.querySelector(".content");t.open=!0,r(!0),ze=Le(e,"height"),Ee=Le(e,"marginBottom"),e.style.height="0px",e.style.marginBottom="0px",window.requestAnimationFrame((()=>i({details:t,isOpen:!0})))})()}),[t,c]);return X((()=>{if(!t)return;const e=t.querySelector("summary");if(i)return e.removeEventListener("click",a),e.addEventListener("click",l);e.removeEventListener("click",l),e.addEventListener("click",a)}),[a,t,c,i,l]),{isOpen:o}};var Te=()=>e('a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{border:0;font:inherit;font-size:100%;margin:0;padding:0;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:after,blockquote:before,q:after,q:before{content:"";content:none}table{border-collapse:collapse;border-spacing:0}')+e(':host{--ct-primary-400:#009;--ct-primary-300:#6161e8;--ct-primary-200:#e0e0ff;--ct-primary-100:#f0f0ff;--ct-neutral-400:#6b7280;--ct-neutral-300:#d1d5db;--ct-neutral-000:#fff;--ct-font-family-default:ui-sans-serif,system-ui,-apple-system,blinkmacsystemfont,"Segoe UI",roboto,"Helvetica Neue",arial,"Noto Sans",sans-serif;--ct-font-family:var(--ct-font-family-default);--ct-font-size:16px;--ct-spacing-1:4px;--ct-spacing-2:8px;--ct-spacing-3:12px;--ct-spacing-4:16px;--ct-transition-duration:300ms;--ct-banner-z-index:10000;--ct-banner-spacing:var(--ct-spacing-4);--ct-intro-color:var(--ct-primary-300);--ct-intro-weight:500;--ct-intro-size:0.75rem;--ct-tagline-size:calc(var(--ct-font-size)*0.875);--ct-tagline-title-color:var(--ct-primary-400);--ct-tagline-title-weight:700;--ct-tagline-title-size:calc(var(--ct-font-size)*1.25);--ct-cookie-color:var(--ct-primary-400);--ct-explanation-color:var(--ct-neutral-400);--ct-explanation-weight:inherit;--ct-explanation-size:calc(var(--ct-font-size)*0.875);--ct-customize-label-color:var(--ct-neutral-400);--ct-customize-label-size:calc(var(--ct-font-size)*0.9375);--ct-option-size:calc(var(--ct-font-size)*0.875);--ct-option-max-width:70%;--ct-option-background:var(--ct-neutral-000);--ct-option-background--enabled:var(--ct-primary-400);--ct-option-background--essential:var(--ct-primary-100);--ct-option-color:var(--ct-primary-400);--ct-option-color--enabled:var(--ct-neutral-000);--ct-option-color--essential:var(--ct-primary-400);--ct-option-focus-color:var(--ct-primary-400);--ct-option-focus-color--enabled:var(--ct-neutral-000);--ct-pill:var(--ct-neutral-300);--ct-pill--enabled:#4c4cff;--ct-pill-switch:var(--ct-neutral-400);--ct-pill-switch--enabled:#b3b3ff;--ct-essential-label-color:var(--ct-neutral-400);--ct-declaration-color:var(--ct-neutral-400);--ct-declaration-size:calc(var(--ct-font-size)*0.875);--ct-button-color--primary:var(--ct-neutral-000);--ct-button-color--secondary:var(--ct-neutral-000);--ct-button-background--primary:var(--ct-primary-400);--ct-button-background--secondary:var(--ct-primary-300);--ct-button-focus-color--primary:var(--ct-neutral-000);--ct-button-focus-color--secondary:var(--ct-neutral-000);--ct-button-size:calc(var(--ct-font-size)*0.9375)}:host(.cookie-though){background-color:var(--ct-neutral-000);border-radius:20px;box-shadow:0 2px 19px -4px rgba(1,1,63,.1);box-sizing:border-box!important;display:block!important;font-family:var(--ct-font-family),var(--ct-font-family-default)!important;font-size:var(--ct-font-size);left:var(--ct-banner-spacing);max-height:calc(100% - var(--ct-default-padding)*2);padding:var(--ct-banner-spacing);position:fixed;width:calc(100vw - var(--ct-banner-spacing)*2);z-index:var(--ct-banner-z-index)}@media only screen and (min-width:640px){:host(.cookie-though){width:343px}}@media (prefers-reduced-motion:no-preference){:host(.cookie-though){transition:bottom var(--ct-transition-duration) ease-in-out}}.sr-only{clip:rect(1px,1px,1px,1px);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}')+e("header{margin-bottom:var(--ct-spacing-4)}h2{color:var(--ct-tagline-title-color);display:flex;flex-direction:column;font-size:var(--ct-tagline-size);font-weight:500;max-width:calc(100% - 33px - var(--ct-spacing-2))}h2>strong{font-size:var(--ct-tagline-title-size);font-weight:var(--ct-tagline-title-weight)}.tagline{align-items:flex-start;display:flex;margin-bottom:var(--ct-spacing-2)}svg{margin-left:auto}header p{color:var(--ct-explanation-color);font-size:var(--ct-explanation-size);font-weight:var(--ct-explanation-weight)}")+e(".content,fieldset,summary{margin-bottom:var(--ct-spacing-4)}.content:focus{outline:none}summary{align-items:center;color:var(--ct-customize-label-color);cursor:pointer;display:inline-flex;font-size:var(--ct-customize-label-size)}summary>svg{height:var(--ct-customize-label-size);margin-left:2px}details[open] summary>svg{transform:rotate(-180deg)}.declaration{text-align:center}.declaration a{color:var(--ct-declaration-color);font-size:var(--ct-declaration-size);text-decoration:none}.declaration a:focus,summary:focus{box-shadow:inset 0 -1px 0 0 var(--ct-customize-label-color);outline:none}.acceptance button:not(:first-child){margin-left:var(--ct-spacing-2)}@media (prefers-reduced-motion:no-preference){details[open] summary>svg{transition:transform var(--ct-transition-duration) ease-in-out}}")+e('.option{display:flex}.option:not(:last-of-type){margin-bottom:var(--ct-spacing-2)}label{align-items:center;background-color:var(--ct-option-background);border:1px solid var(--ct-primary-200);border-radius:5px;color:var(--ct-option-color);cursor:pointer;display:flex;font-size:var(--ct-option-size);padding:var(--ct-spacing-3);user-select:none;width:100%}label strong{display:block;font-weight:500;margin-bottom:var(--ct-text-margin)}label>span:first-of-type{max-width:var(--ct-option-max-width)}.essential-label,.pill-switch{margin-left:auto}.essential-label{color:var(--ct-essential-label-color)}input+label .pill-switch,input+label .pill-switch:after{border-radius:9999px}input:checked+label{background-color:var(--ct-option-background--enabled);border-color:var(--ct-option-background--enabled);color:var(--ct-option-color--enabled)}input:disabled+label{background-color:var(--ct-option-background--essential);border-color:var(--ct-option-background--essential);color:var(--ct-option-color--essential);cursor:default}input:focus+label,input:not(:disabled):active+label{box-shadow:inset 0 0 0 3px var(--ct-option-background),inset 0 0 0 5px var(--ct-option-focus-color)}input:checked:focus+label,input:not(:disabled):checked:active+label{box-shadow:inset 0 0 0 3px var(--ct-option-background--enabled),inset 0 0 0 5px var(--ct-option-focus-color--enabled)}input+label .pill-switch{background:linear-gradient(to right,var(--ct-pill--enabled) 50%,var(--ct-pill) 50%);background-position:100%;background-size:200%;height:8px;position:relative;width:26px}input:checked+label .pill-switch{background-position:0}input+label .pill-switch:after{background-color:var(--ct-pill-switch);content:"";height:16px;left:0;position:absolute;top:-4px;width:16px}input:checked+label .pill-switch:after{background-color:var(--ct-pill-switch--enabled);left:50%}@media (prefers-reduced-motion:no-preference){input+label .pill-switch{transition:background-position var(--ct-transition-duration) ease-in-out}input+label .pill-switch:after{transition-duration:var(--ct-transition-duration);transition-property:background-color,left;transition-timing-function:ease-in-out}}')+e(".button{appearance:none;border:0;border-radius:2px;cursor:pointer;font-family:inherit;font-size:var(--ct-button-size);outline:none;padding:var(--ct-spacing-2)}.button--primary{background-color:var(--ct-button-background--primary);color:var(--ct-button-color--primary)}.button--primary:focus{box-shadow:inset 0 0 0 3px var(--ct-button-background--primary),inset 0 0 0 5px var(--ct-button-focus-color--primary)}.button--secondary{background-color:var(--ct-button-background--secondary);color:var(--ct-button-color--secondary)}.button--secondary:focus{box-shadow:inset 0 0 0 3px var(--ct-button-background--secondary),inset 0 0 0 5px var(--ct-button-focus-color--secondary)}");const Fe=()=>document.querySelector(".cookie-though"),Me=e=>`-${Le(e,"height")}px`,Ue=(e,t)=>{let n=Fe();n||(n=Ze()),n.setAttribute("aria-hidden",String(!e)),n.style.bottom=t||Me(n),e||setTimeout((()=>n.style.bottom=Me(n)),Ce(n)+1)};var $e=(e,t)=>{switch(t.type){case"decline":return ye({cookiePreferencesKey:t.cookiePreferencesKey,options:e.map((e=>({...e,isEnabled:ve(e.category)}))),onPreferencesChanged:t.onPreferencesChanged});case"accept":return ye({cookiePreferencesKey:t.cookiePreferencesKey,options:t.areAllOptionsEnabled?e.map((e=>({...e,isEnabled:!0}))):e,onPreferencesChanged:t.onPreferencesChanged});case"toggle":return e.map(((e,n)=>n===t.index?{...e,isEnabled:!e.isEnabled}:e))}};var De=({option:{isEnabled:e,id:t,label:n,description:o,category:r},onClick:i,essentialLabel:c})=>{const l=ee(null),a=ve(r);return U("div",{ref:l,class:"option",children:[U("input",{type:"checkbox",class:"sr-only",id:t,name:t,disabled:a,checked:e,onClick:i,onFocus:()=>l.current?.scrollIntoView({block:"nearest",inline:"nearest"})},void 0),U("label",{htmlFor:t,class:"info","aria-label":n,children:[U("span",{children:[U("strong",{children:n},void 0),o]},void 0),U("span",{class:a?"essential-label":"pill-switch",children:a&&c},void 0)]},void 0)]},void 0)};const Ne=()=>U("svg",{fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:U("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},void 0)},void 0);var Ke=({customizeLabel:e,optionsAriaLabel:t,consent:n,essentialLabel:o,permissionLabels:r=W.permissionLabels,cookiePolicy:i,cookiePreferencesKey:c})=>{const[l,a]=J($e,n.options),s=ee(null),{isOpen:u}=qe(s),d=_e(),_=Pe(),p=oe(pe),f=te((()=>!u&&!(e=>e.some((({category:e,isEnabled:t})=>!ve(e)&&!0===t)))(l)||(e=>e.every((e=>e.isEnabled)))(l)?r.acceptAll??W.permissionLabels.acceptAll:r.accept??W.permissionLabels.accept),[u,l,r.accept,r.acceptAll]),v=()=>{Ue(!1,Me(d)),s.current&&setTimeout((()=>s.current.open=!1),_)};return U(h,{children:[U("details",{ref:s,children:[U("summary",{children:[e,U(Ne,{},void 0)]},void 0),U("div",{class:"content",tabIndex:-1,children:[U("fieldset",{children:[U("legend",{class:"sr-only",children:t},void 0),l.map(((e,t)=>U(De,{option:e,onClick:()=>a({type:"toggle",index:t}),essentialLabel:o},t)))]},void 0),i&&U("div",{class:"declaration",children:U("a",{href:i.url,children:i.label},void 0)},void 0)]},void 0)]},void 0),U("div",{class:"acceptance",children:[U("button",{class:"button button--secondary",onClick:()=>{a({type:"decline",cookiePreferencesKey:c,onPreferencesChanged:p}),v()},children:r.decline??W.permissionLabels.decline},void 0),U("button",{class:"button button--primary",onClick:()=>{a({type:"accept",cookiePreferencesKey:c,areAllOptionsEnabled:f===(r.acceptAll??W.permissionLabels.acceptAll),onPreferencesChanged:p}),v()},children:f},void 0)]},void 0)]},void 0)};const We=()=>U("svg",{width:"33",height:"33",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"presentation",children:U("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M20.5 14C21.4008 14 22.251 13.7834 23.0014 13.3996C23.0005 13.4329 23 13.4664 23 13.5C23 15.0583 24.0184 16.3788 25.426 16.8321C23.7905 22.1414 18.8459 26 13 26C5.8203 26 0 20.1797 0 13C0 5.8203 5.8203 0 13 0C13.954 0 14.884 0.102758 15.7795 0.29781C15.292 0.899245 15 1.66552 15 2.5C15 3.53742 15.4514 4.46941 16.1684 5.11034C15.4364 6.04443 15 7.22125 15 8.5C15 11.5376 17.4624 14 20.5 14ZM11 7C11 7.55228 10.5523 8 10 8C9.44772 8 9 7.55228 9 7C9 6.44772 9.44772 6 10 6C10.5523 6 11 6.44772 11 7ZM12 13C12 14.1046 11.1046 15 10 15C8.89543 15 8 14.1046 8 13C8 11.8954 8.89543 11 10 11C11.1046 11 12 11.8954 12 13ZM17 20C17.5523 20 18 19.5523 18 19C18 18.4477 17.5523 18 17 18C16.4477 18 16 18.4477 16 19C16 19.5523 16.4477 20 17 20ZM10 19.5C10 20.3284 9.32843 21 8.5 21C7.67157 21 7 20.3284 7 19.5C7 18.6716 7.67157 18 8.5 18C9.32843 18 10 18.6716 10 19.5Z",fill:"var(--ct-cookie-color)"},void 0)},void 0);var Oe=({intro:e,title:t,description:n})=>U("header",{children:[U("div",{class:"tagline",children:[(null!==e||null!==t)&&U("h2",{children:[null!==e&&(e||W.header.intro),null!==t&&U("strong",{"aria-hidden":"true",children:t||W.header.title},void 0)]},void 0),U(We,{},void 0)]},void 0),U("p",{children:n||W.header.description},void 0)]},void 0);var Be=({config:e,container:t})=>{const{header:n=W.header,policies:o,cookiePreferencesKey:r=$,customizeLabel:i,optionsAriaLabel:c,essentialLabel:l,permissionLabels:a,cookiePolicy:s}=e,u=ke({policies:o,cookiePreferencesKey:r});return he((()=>{t.style.bottom=Me(t),t.setAttribute("aria-hidden","true"),u.isCustomised||setTimeout((()=>Ue(!0,Ie)))})),U(fe,{onPreferencesChanged:e.onPreferencesChanged,children:U(de,{container:t,children:[U(Oe,{intro:n.intro,title:n.title,description:n.description},void 0),U(Ke,{customizeLabel:i??W.customizeLabel,optionsAriaLabel:c??W.optionsAriaLabel,consent:u,essentialLabel:l??W.essentialLabel,permissionLabels:a??W.permissionLabels,cookiePolicy:s,cookiePreferencesKey:r},void 0)]},void 0)},void 0)};const Ie="var(--ct-banner-spacing)";let Re=$;const Ye=(e=W)=>{e.cookiePreferencesKey&&(Re=e.cookiePreferencesKey);const t=Fe();if(t&&t.shadowRoot)return T(p(Be,{config:e,container:t}),t.shadowRoot),t;const{container:n,shadowRoot:o}=(e=>{const t=document.createElement("aside");t.className="cookie-though",t.setAttribute("aria-label",e);const n=t.attachShadow({mode:"open"}),o=document.createElement("style");return o.textContent=Te(),n.appendChild(o),{container:t,shadowRoot:n}})(e.ariaLabel||W.ariaLabel);return document.body.prepend(n),T(p(Be,{config:e,container:n}),o),n},Ze=Ye,Ve=()=>Ue(!0,Ie),je=()=>Ue(!1),Ge=()=>{const e=ge(Re);return{isCustomised:!!e,preferences:e}};export{Ie as BANNER_SPACING,Ye as configure,Ze as init,Ve as show,je as hide,Ge as getCookiePreferences}; | ||
function e(e){return e&&e.__esModule?e.default:e}var t,n,o,r,i,l,c,a={},s=[],u=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function d(e,t){for(var n in t)e[n]=t[n];return e}function _(e){var t=e.parentNode;t&&t.removeChild(e)}function p(e,n,o){var r,i,l,c={};for(l in n)"key"==l?r=n[l]:"ref"==l?i=n[l]:c[l]=n[l];if(arguments.length>2&&(c.children=arguments.length>3?t.call(arguments,2):o),"function"==typeof e&&null!=e.defaultProps)for(l in e.defaultProps)void 0===c[l]&&(c[l]=e.defaultProps[l]);return f(e,c,r,i,null)}function f(e,t,r,i,l){var c={type:e,props:t,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==l?++o:l};return null==l&&null!=n.vnode&&n.vnode(c),c}function h(e){return e.children}function v(e,t){this.props=e,this.context=t}function m(e,t){if(null==t)return e.__?m(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?m(e):null}function b(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return b(e)}}function g(e){(!e.__d&&(e.__d=!0)&&r.push(e)&&!y.__r++||l!==n.debounceRendering)&&((l=n.debounceRendering)||i)(y)}function y(){for(var e;y.__r=r.length;)e=r.sort((function(e,t){return e.__v.__b-t.__v.__b})),r=[],e.some((function(e){var t,n,o,r,i,l;e.__d&&(i=(r=(t=e).__v).__e,(l=t.__P)&&(n=[],(o=d({},r)).__v=r.__v+1,L(l,r,o,t.__n,void 0!==l.ownerSVGElement,null!=r.__h?[i]:null,n,null==i?m(r):i,r.__h),S(n,r),r.__e!=i&&b(r)))}))}function k(e,t,n,o,r,i,l,c,u,d){var _,p,v,b,g,y,k,C=o&&o.__k||s,P=C.length;for(n.__k=[],_=0;_<t.length;_++)if(null!=(b=n.__k[_]=null==(b=t[_])||"boolean"==typeof b?null:"string"==typeof b||"number"==typeof b||"bigint"==typeof b?f(null,b,null,null,b):Array.isArray(b)?f(h,{children:b},null,null,null):b.__b>0?f(b.type,b.props,b.key,null,b.__v):b)){if(b.__=n,b.__b=n.__b+1,null===(v=C[_])||v&&b.key==v.key&&b.type===v.type)C[_]=void 0;else for(p=0;p<P;p++){if((v=C[p])&&b.key==v.key&&b.type===v.type){C[p]=void 0;break}v=null}L(e,b,v=v||a,r,i,l,c,u,d),g=b.__e,(p=b.ref)&&v.ref!=p&&(k||(k=[]),v.ref&&k.push(v.ref,null,b),k.push(p,b.__c||g,b)),null!=g?(null==y&&(y=g),"function"==typeof b.type&&b.__k===v.__k?b.__d=u=x(b,u,e):u=w(e,b,v,C,g,u),"function"==typeof n.type&&(n.__d=u)):u&&v.__e==u&&u.parentNode!=e&&(u=m(v))}for(n.__e=y,_=P;_--;)null!=C[_]&&("function"==typeof n.type&&null!=C[_].__e&&C[_].__e==n.__d&&(n.__d=m(o,_+1)),H(C[_],C[_]));if(k)for(_=0;_<k.length;_++)A(k[_],k[++_],k[++_])}function x(e,t,n){for(var o,r=e.__k,i=0;r&&i<r.length;i++)(o=r[i])&&(o.__=e,t="function"==typeof o.type?x(o,t,n):w(n,o,o,r,o.__e,t));return t}function w(e,t,n,o,r,i){var l,c,a;if(void 0!==t.__d)l=t.__d,t.__d=void 0;else if(null==n||r!=i||null==r.parentNode)e:if(null==i||i.parentNode!==e)e.appendChild(r),l=null;else{for(c=i,a=0;(c=c.nextSibling)&&a<o.length;a+=2)if(c==r)break e;e.insertBefore(r,i),l=i}return void 0!==l?l:r.nextSibling}function C(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||u.test(t)?n:n+"px"}function P(e,t,n,o,r){var i;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof o&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||C(e.style,t,"");if(n)for(t in n)o&&n[t]===o[t]||C(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])i=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?o||e.addEventListener(t,i?E:z,i):e.removeEventListener(t,i?E:z,i);else if("dangerouslySetInnerHTML"!==t){if(r)t=t.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null!=n&&(!1!==n||"a"===t[0]&&"r"===t[1])?e.setAttribute(t,n):e.removeAttribute(t))}}function z(e){this.l[e.type+!1](n.event?n.event(e):e)}function E(e){this.l[e.type+!0](n.event?n.event(e):e)}function L(e,o,r,i,l,c,s,u,p){var f,b,g,y,x,w,C,z,E,L,S,A=o.type;if(void 0!==o.constructor)return null;null!=r.__h&&(p=r.__h,u=o.__e=r.__e,o.__h=null,c=[u]),(f=n.__b)&&f(o);try{e:if("function"==typeof A){if(z=o.props,E=(f=A.contextType)&&i[f.__c],L=f?E?E.props.value:f.__:i,r.__c?C=(b=o.__c=r.__c).__=b.__E:("prototype"in A&&A.prototype.render?o.__c=b=new A(z,L):(o.__c=b=new v(z,L),b.constructor=A,b.render=q),E&&E.sub(b),b.props=z,b.state||(b.state={}),b.context=L,b.__n=i,g=b.__d=!0,b.__h=[]),null==b.__s&&(b.__s=b.state),null!=A.getDerivedStateFromProps&&(b.__s==b.state&&(b.__s=d({},b.__s)),d(b.__s,A.getDerivedStateFromProps(z,b.__s))),y=b.props,x=b.state,g)null==A.getDerivedStateFromProps&&null!=b.componentWillMount&&b.componentWillMount(),null!=b.componentDidMount&&b.__h.push(b.componentDidMount);else{if(null==A.getDerivedStateFromProps&&z!==y&&null!=b.componentWillReceiveProps&&b.componentWillReceiveProps(z,L),!b.__e&&null!=b.shouldComponentUpdate&&!1===b.shouldComponentUpdate(z,b.__s,L)||o.__v===r.__v){b.props=z,b.state=b.__s,o.__v!==r.__v&&(b.__d=!1),b.__v=o,o.__e=r.__e,o.__k=r.__k,o.__k.forEach((function(e){e&&(e.__=o)})),b.__h.length&&s.push(b);break e}null!=b.componentWillUpdate&&b.componentWillUpdate(z,b.__s,L),null!=b.componentDidUpdate&&b.__h.push((function(){b.componentDidUpdate(y,x,w)}))}b.context=L,b.props=z,b.state=b.__s,(f=n.__r)&&f(o),b.__d=!1,b.__v=o,b.__P=e,f=b.render(b.props,b.state,b.context),b.state=b.__s,null!=b.getChildContext&&(i=d(d({},i),b.getChildContext())),g||null==b.getSnapshotBeforeUpdate||(w=b.getSnapshotBeforeUpdate(y,x)),S=null!=f&&f.type===h&&null==f.key?f.props.children:f,k(e,Array.isArray(S)?S:[S],o,r,i,l,c,s,u,p),b.base=o.__e,o.__h=null,b.__h.length&&s.push(b),C&&(b.__E=b.__=null),b.__e=!1}else null==c&&o.__v===r.__v?(o.__k=r.__k,o.__e=r.__e):o.__e=function(e,n,o,r,i,l,c,s){var u,d,p,f=o.props,h=n.props,v=n.type,b=0;if("svg"===v&&(i=!0),null!=l)for(;b<l.length;b++)if((u=l[b])&&"setAttribute"in u==!!v&&(v?u.localName===v:3===u.nodeType)){e=u,l[b]=null;break}if(null==e){if(null===v)return document.createTextNode(h);e=i?document.createElementNS("http://www.w3.org/2000/svg",v):document.createElement(v,h.is&&h),l=null,s=!1}if(null===v)f===h||s&&e.data===h||(e.data=h);else{if(l=l&&t.call(e.childNodes),d=(f=o.props||a).dangerouslySetInnerHTML,p=h.dangerouslySetInnerHTML,!s){if(null!=l)for(f={},b=0;b<e.attributes.length;b++)f[e.attributes[b].name]=e.attributes[b].value;(p||d)&&(p&&(d&&p.__html==d.__html||p.__html===e.innerHTML)||(e.innerHTML=p&&p.__html||""))}if(function(e,t,n,o,r){var i;for(i in n)"children"===i||"key"===i||i in t||P(e,i,null,n[i],o);for(i in t)r&&"function"!=typeof t[i]||"children"===i||"key"===i||"value"===i||"checked"===i||n[i]===t[i]||P(e,i,t[i],n[i],o)}(e,h,f,i,s),p)n.__k=[];else if(b=n.props.children,k(e,Array.isArray(b)?b:[b],n,o,r,i&&"foreignObject"!==v,l,c,l?l[0]:o.__k&&m(o,0),s),null!=l)for(b=l.length;b--;)null!=l[b]&&_(l[b]);s||("value"in h&&void 0!==(b=h.value)&&(b!==f.value||b!==e.value||"progress"===v&&!b)&&P(e,"value",b,f.value,!1),"checked"in h&&void 0!==(b=h.checked)&&b!==e.checked&&P(e,"checked",b,f.checked,!1))}return e}(r.__e,o,r,i,l,c,s,p);(f=n.diffed)&&f(o)}catch(e){o.__v=null,(p||null!=c)&&(o.__e=u,o.__h=!!p,c[c.indexOf(u)]=null),n.__e(e,o,r)}}function S(e,t){n.__c&&n.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){n.__e(e,t.__v)}}))}function A(e,t,o){try{"function"==typeof e?e(t):e.current=t}catch(e){n.__e(e,o)}}function H(e,t,o){var r,i;if(n.unmount&&n.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||A(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){n.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&H(r[i],t,"function"!=typeof e.type);o||null==e.__e||_(e.__e),e.__e=e.__d=void 0}function q(e,t,n){return this.constructor(e,n)}function T(e,o,r){var i,l,c;n.__&&n.__(e,o),l=(i="function"==typeof r)?null:r&&r.__k||o.__k,c=[],L(o,e=(!i&&r||o).__k=p(h,null,[e]),l||a,a,void 0!==o.ownerSVGElement,!i&&r?[r]:l?null:o.firstChild?t.call(o.childNodes):null,c,!i&&r?r:l?l.__e:o.firstChild,i),S(c,e)}function F(e,t){var n={__c:t="__cC"+c++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,o;return this.getChildContext||(n=[],(o={})[t]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some(g)},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}t=s.slice,n={__e:function(e,t){for(var n,o,r;t=t.__;)if((n=t.__c)&&!n.__)try{if((o=n.constructor)&&null!=o.getDerivedStateFromError&&(n.setState(o.getDerivedStateFromError(e)),r=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e),r=n.__d),r)return n.__E=n}catch(t){e=t}throw e}},o=0,v.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=d({},this.state),"function"==typeof e&&(e=e(d({},n),this.props)),e&&d(n,e),null!=e&&this.__v&&(t&&this.__h.push(t),g(this))},v.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),g(this))},v.prototype.render=h,r=[],i="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,y.__r=0,c=0;var M=0;function U(e,t,o,r,i){var l,c,a={};for(c in t)"ref"==c?l=t[c]:a[c]=t[c];var s={type:e,props:a,key:o,ref:l,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--M,__source:r,__self:i};if("function"==typeof e&&(l=e.defaultProps))for(c in l)void 0===a[c]&&(a[c]=l[c]);return n.vnode&&n.vnode(s),s}const $="cookie-preferences";var D,N,K,W={ariaLabel:"Cookie banner",optionsAriaLabel:"Cookie options",policies:[{id:"essential",label:"Strictly necessary cookies",description:"These cookies are required to run the site.",category:"essential"},{id:"functional",label:"Functional cookies",description:"We'll remember the basics such as language.",category:"functional"},{id:"statistics",label:"Statistics",description:"We'll know where we should improve your experience.",category:"statistics"},{id:"marketing",label:"Marketing",description:"We'll only show you ads you're interested in.",category:"marketing"},{id:"social",label:"Social",description:"This allows us to track your social activity",category:"social"},{id:"personalisation",label:"Personalisation",description:"We'll only show you content that interests you.",category:"personalisation"}],essentialLabel:"Always on",header:{intro:"You're probably fed up with these banners...",title:"cookie though?",description:"Everybody wants to show his best side - and so do we. That's why we use cookies to guarantee you a better experience."},permissionLabels:{accept:"Accept",acceptAll:"Accept all",decline:"Decline"},customizeLabel:"Customize",cookiePreferencesKey:$},O=0,B=[],I=n.__b,R=n.__r,Y=n.diffed,Z=n.__c,V=n.unmount;function j(e,t){n.__h&&n.__h(N,e,O||t),O=0;var o=N.__H||(N.__H={__:[],__h:[]});return e>=o.__.length&&o.__.push({}),o.__[e]}function G(e){return O=1,J(se,e)}function J(e,t,n){var o=j(D++,2);return o.t=e,o.__c||(o.__=[n?n(t):se(void 0,t),function(e){var t=o.t(o.__[0],e);o.__[0]!==t&&(o.__=[t,o.__[1]],o.__c.setState({}))}],o.__c=N),o.__}function Q(e,t){var o=j(D++,3);!n.__s&&ae(o.__H,t)&&(o.__=e,o.__H=t,N.__H.__h.push(o))}function X(e,t){var o=j(D++,4);!n.__s&&ae(o.__H,t)&&(o.__=e,o.__H=t,N.__h.push(o))}function ee(e){return O=5,te((function(){return{current:e}}),[])}function te(e,t){var n=j(D++,7);return ae(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function ne(e,t){return O=8,te((function(){return e}),t)}function oe(e){var t=N.context[e.__c],n=j(D++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(N)),t.props.value):e.__}function re(){for(var e;e=B.shift();)if(e.__P)try{e.__H.__h.forEach(le),e.__H.__h.forEach(ce),e.__H.__h=[]}catch(t){e.__H.__h=[],n.__e(t,e.__v)}}n.__b=function(e){N=null,I&&I(e)},n.__r=function(e){R&&R(e),D=0;var t=(N=e.__c).__H;t&&(t.__h.forEach(le),t.__h.forEach(ce),t.__h=[])},n.diffed=function(e){Y&&Y(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==B.push(t)&&K===n.requestAnimationFrame||((K=n.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(o),ie&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,100);ie&&(t=requestAnimationFrame(n))})(re)),N=null},n.__c=function(e,t){t.some((function(e){try{e.__h.forEach(le),e.__h=e.__h.filter((function(e){return!e.__||ce(e)}))}catch(o){t.some((function(e){e.__h&&(e.__h=[])})),t=[],n.__e(o,e.__v)}})),Z&&Z(e,t)},n.unmount=function(e){V&&V(e);var t,o=e.__c;o&&o.__H&&(o.__H.__.forEach((function(e){try{le(e)}catch(e){t=e}})),t&&n.__e(t,o.__v))};var ie="function"==typeof requestAnimationFrame;function le(e){var t=N,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),N=t}function ce(e){var t=N;e.__c=e.__(),N=t}function ae(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function se(e,t){return"function"==typeof t?t(e):t}const ue=F(void 0),de=({container:e,children:t})=>{const[n]=G((()=>e));return U(ue.Provider,{value:n,children:t},void 0)},_e=()=>{const e=oe(ue);if(void 0===e)throw new Error("useContainer must be used within a ContainerProvider");return e},pe=F(void 0),fe=({onPreferencesChanged:e,children:t})=>{const[n]=G((()=>e));return U(pe.Provider,{value:n,children:t},void 0)};var he=e=>{X(e,[])};const ve=e=>"essential"===e,me=({policies:e,preferences:t,isCustomised:n})=>({options:e.map((e=>{const n=!!t.find((({id:t})=>t===e.id))?.isEnabled;return{...e,isEnabled:n}})),isCustomised:n}),be=({newPreferences:e,currentPreferences:t})=>e.map((({id:e})=>({id:e,isEnabled:!!t.find((t=>t.id===e))?.isEnabled}))),ge=e=>{const t=decodeURIComponent(document.cookie).split(";").reduce(((t,n)=>{if(t)return t;const[o,r]=n.split("=");return o.trim()===e?r.split("|"):void 0}),void 0);if(t)return t.map((e=>{const[t,n]=e.split(":");return{id:t,isEnabled:!!+n}}))},ye=({cookiePreferencesKey:e,options:t,onPreferencesChanged:n})=>{const o=(e=>e.reduce(((e,{id:t,isEnabled:n},o)=>`${e}${0!==o?"|":""}${t}:${+n}`),""))(t),r=`expires=${(()=>{const e=new Date;return new Date(e.setFullYear(e.getFullYear()+1)).toUTCString()})()}`;return document.cookie=`${e}=${o};${r};path=/;SameSite=strict`,n&&n({isCustomised:!0,preferences:t.map((({id:e,isEnabled:t})=>({id:e,isEnabled:t})))}),t};var ke=({policies:e,cookiePreferencesKey:t})=>{const n=ge(t),o=(e=>e.map((({id:e,category:t})=>({id:e,isEnabled:ve(t)}))))(e),r=me({policies:e,preferences:o,isCustomised:!1});return n?(({newPreferences:e,currentPreferences:t})=>{const n=e.map((({id:e})=>e)),o=t.map((({id:e})=>e));return o.length!==n.length||n.reduce(((e,t)=>e||!o.includes(t)),!1)})({newPreferences:o,currentPreferences:n})?me({policies:e,preferences:be({newPreferences:o,currentPreferences:n}),isCustomised:!1}):me({policies:e,preferences:n,isCustomised:!0}):r};const xe=()=>!window.matchMedia("(prefers-reduced-motion: no-preference)").matches;var we=()=>{const[e,t]=G(xe);return Q((()=>{const e=window.matchMedia("(prefers-reduced-motion: no-preference)"),n=e=>t(!e.matches);return e.addEventListener("change",n),()=>e.removeEventListener("change",n)}),[]),e};const Ce=e=>parseInt(getComputedStyle(e).getPropertyValue("--ct-transition-duration"),10);var Pe=()=>{const e=_e();return Ce(e)};let ze=0,Ee=0;const Le=(e,t)=>{const n=window.getComputedStyle(e)[t];return"auto"===n||""===n?0:parseFloat(n)},Se=e=>Le(e,"height")+Le(e,"marginBottom"),Ae=e=>{const t=ze+Ee,n=e.previousElementSibling,o=e.querySelector("summary"),r=e.nextElementSibling,i=Se(n),l=Se(o),c=Se(r),a=4*parseInt(getComputedStyle(Fe()).paddingBottom,10),s=window.innerHeight-i-l-c-a,u=s-a/4,d=t>s;return{hasOverflow:d,openHeight:`${d?u:ze}px`,maxHeight:`${u}px`}},He=e=>`${parseFloat(e)+Ee}px`;var qe=e=>{const[t,n]=G(null),[o,r]=G(!1),i=we(),l=Pe();Q((()=>{e.current&&n(e.current)}),[t,e]);const c=ne((()=>{const e=t.querySelector(".content"),{maxHeight:n}=Ae(t);e.style.maxHeight=n,e.style.overflowY="scroll",r((e=>!e))}),[t]),a=ne((e=>{e.preventDefault();const n=t.querySelector(".content"),o=n.childElementCount>1,i=({details:e,isOpen:t})=>{const n=e.querySelector(".content"),{openHeight:i,hasOverflow:c}=Ae(e),a=t?["0px",o?He(i):i]:[n.style.height,"0px"];n.animate({height:a},{duration:l,easing:"ease-in-out"}).onfinish=()=>t?(n.style.height=i,(o||c)&&(n.style.marginBottom=`${Ee}px`),c?n.style.overflowY="scroll":n.style.removeProperty("overflowY")):(e.open=t,r(t),n.removeAttribute("style"))};n.style.overflow="hidden",t.open?window.requestAnimationFrame((()=>{const e=Se(n);n.style.height=`${e}px`,n.style.marginBottom="0px",i({details:t,isOpen:!1})})):(()=>{const e=t.querySelector(".content");t.open=!0,r(!0),ze=Le(e,"height"),Ee=Le(e,"marginBottom"),e.style.height="0px",e.style.marginBottom="0px",window.requestAnimationFrame((()=>i({details:t,isOpen:!0})))})()}),[t,l]);return X((()=>{if(!t)return;const e=t.querySelector("summary");if(i)return e.removeEventListener("click",a),e.addEventListener("click",c);e.removeEventListener("click",c),e.addEventListener("click",a)}),[a,t,l,i,c]),{isOpen:o}};var Te=()=>e('a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{border:0;font:inherit;font-size:100%;margin:0;padding:0;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:after,blockquote:before,q:after,q:before{content:"";content:none}table{border-collapse:collapse;border-spacing:0}')+e(':host{--ct-primary-400:#009;--ct-primary-300:#6161e8;--ct-primary-200:#e0e0ff;--ct-primary-100:#f0f0ff;--ct-neutral-400:#6b7280;--ct-neutral-300:#d1d5db;--ct-neutral-000:#fff;--ct-font-family-default:ui-sans-serif,system-ui,-apple-system,blinkmacsystemfont,"Segoe UI",roboto,"Helvetica Neue",arial,"Noto Sans",sans-serif;--ct-font-family:var(--ct-font-family-default);--ct-font-size:16px;--ct-spacing-1:4px;--ct-spacing-2:8px;--ct-spacing-3:12px;--ct-spacing-4:16px;--ct-transition-duration:300ms;--ct-banner-z-index:10000;--ct-banner-spacing:var(--ct-spacing-4);--ct-intro-color:var(--ct-primary-300);--ct-intro-weight:500;--ct-intro-size:0.75rem;--ct-tagline-size:calc(var(--ct-font-size)*0.875);--ct-tagline-title-color:var(--ct-primary-400);--ct-tagline-title-weight:700;--ct-tagline-title-size:calc(var(--ct-font-size)*1.25);--ct-cookie-color:var(--ct-primary-400);--ct-explanation-color:var(--ct-neutral-400);--ct-explanation-weight:inherit;--ct-explanation-size:calc(var(--ct-font-size)*0.875);--ct-customize-label-color:var(--ct-neutral-400);--ct-customize-label-size:calc(var(--ct-font-size)*0.9375);--ct-option-size:calc(var(--ct-font-size)*0.875);--ct-option-max-width:70%;--ct-option-background:var(--ct-neutral-000);--ct-option-background--enabled:var(--ct-primary-400);--ct-option-background--essential:var(--ct-primary-100);--ct-option-color:var(--ct-primary-400);--ct-option-color--enabled:var(--ct-neutral-000);--ct-option-color--essential:var(--ct-primary-400);--ct-option-focus-color:var(--ct-primary-400);--ct-option-focus-color--enabled:var(--ct-neutral-000);--ct-pill:var(--ct-neutral-300);--ct-pill--enabled:#4c4cff;--ct-pill-switch:var(--ct-neutral-400);--ct-pill-switch--enabled:#b3b3ff;--ct-essential-label-color:var(--ct-neutral-400);--ct-declaration-color:var(--ct-neutral-400);--ct-declaration-size:calc(var(--ct-font-size)*0.875);--ct-button-color--primary:var(--ct-neutral-000);--ct-button-color--secondary:var(--ct-neutral-000);--ct-button-background--primary:var(--ct-primary-400);--ct-button-background--secondary:var(--ct-primary-300);--ct-button-focus-color--primary:var(--ct-neutral-000);--ct-button-focus-color--secondary:var(--ct-neutral-000);--ct-button-size:calc(var(--ct-font-size)*0.9375)}:host(.cookie-though){background-color:var(--ct-neutral-000);border-radius:20px;box-shadow:0 2px 19px -4px rgba(1,1,63,.1);box-sizing:border-box!important;display:block!important;font-family:var(--ct-font-family),var(--ct-font-family-default)!important;font-size:var(--ct-font-size);left:var(--ct-banner-spacing);max-height:calc(100% - var(--ct-default-padding)*2);padding:var(--ct-banner-spacing);position:fixed;width:calc(100vw - var(--ct-banner-spacing)*2);z-index:var(--ct-banner-z-index)}@media only screen and (min-width:640px){:host(.cookie-though){width:343px}}@media (prefers-reduced-motion:no-preference){:host(.cookie-though){transition:bottom var(--ct-transition-duration) ease-in-out}}.sr-only{clip:rect(1px,1px,1px,1px);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}')+e("header{margin-bottom:var(--ct-spacing-4)}h2{color:var(--ct-tagline-title-color);display:flex;flex-direction:column;font-size:var(--ct-tagline-size);font-weight:500;max-width:calc(100% - 33px - var(--ct-spacing-2))}h2>strong{font-size:var(--ct-tagline-title-size);font-weight:var(--ct-tagline-title-weight)}.tagline{align-items:flex-start;display:flex;margin-bottom:var(--ct-spacing-2)}svg{margin-left:auto}header p{color:var(--ct-explanation-color);font-size:var(--ct-explanation-size);font-weight:var(--ct-explanation-weight)}")+e(".content,fieldset,summary{margin-bottom:var(--ct-spacing-4)}.content:focus{outline:none}summary{align-items:center;color:var(--ct-customize-label-color);cursor:pointer;display:inline-flex;font-size:var(--ct-customize-label-size)}summary>svg{height:var(--ct-customize-label-size);margin-left:2px}details[open] summary>svg{transform:rotate(-180deg)}.declaration{text-align:center}.declaration a{color:var(--ct-declaration-color);font-size:var(--ct-declaration-size);text-decoration:none}.declaration a:focus,summary:focus{box-shadow:inset 0 -1px 0 0 var(--ct-customize-label-color);outline:none}.acceptance button:not(:first-child){margin-left:var(--ct-spacing-2)}@media (prefers-reduced-motion:no-preference){details[open] summary>svg{transition:transform var(--ct-transition-duration) ease-in-out}}")+e('.option{display:flex}.option:not(:last-of-type){margin-bottom:var(--ct-spacing-2)}label{align-items:center;background-color:var(--ct-option-background);border:1px solid var(--ct-primary-200);border-radius:5px;color:var(--ct-option-color);cursor:pointer;display:flex;font-size:var(--ct-option-size);padding:var(--ct-spacing-3);user-select:none;width:100%}label strong{display:block;font-weight:500;margin-bottom:var(--ct-text-margin)}label>span:first-of-type{max-width:var(--ct-option-max-width)}.essential-label,.pill-switch{margin-left:auto}.essential-label{color:var(--ct-essential-label-color)}input+label .pill-switch,input+label .pill-switch:after{border-radius:9999px}input:checked+label{background-color:var(--ct-option-background--enabled);border-color:var(--ct-option-background--enabled);color:var(--ct-option-color--enabled)}input:disabled+label{background-color:var(--ct-option-background--essential);border-color:var(--ct-option-background--essential);color:var(--ct-option-color--essential);cursor:default}input:focus+label,input:not(:disabled):active+label{box-shadow:inset 0 0 0 3px var(--ct-option-background),inset 0 0 0 5px var(--ct-option-focus-color)}input:checked:focus+label,input:not(:disabled):checked:active+label{box-shadow:inset 0 0 0 3px var(--ct-option-background--enabled),inset 0 0 0 5px var(--ct-option-focus-color--enabled)}input+label .pill-switch{background:linear-gradient(to right,var(--ct-pill--enabled) 50%,var(--ct-pill) 50%);background-position:100%;background-size:200%;height:8px;position:relative;width:26px}input:checked+label .pill-switch{background-position:0}input+label .pill-switch:after{background-color:var(--ct-pill-switch);content:"";height:16px;left:0;position:absolute;top:-4px;width:16px}input:checked+label .pill-switch:after{background-color:var(--ct-pill-switch--enabled);left:50%}@media (prefers-reduced-motion:no-preference){input+label .pill-switch{transition:background-position var(--ct-transition-duration) ease-in-out}input+label .pill-switch:after{transition-duration:var(--ct-transition-duration);transition-property:background-color,left;transition-timing-function:ease-in-out}}')+e(".button{appearance:none;border:0;border-radius:2px;cursor:pointer;font-family:inherit;font-size:var(--ct-button-size);outline:none;padding:var(--ct-spacing-2)}.button--primary{background-color:var(--ct-button-background--primary);color:var(--ct-button-color--primary)}.button--primary:focus{box-shadow:inset 0 0 0 3px var(--ct-button-background--primary),inset 0 0 0 5px var(--ct-button-focus-color--primary)}.button--secondary{background-color:var(--ct-button-background--secondary);color:var(--ct-button-color--secondary)}.button--secondary:focus{box-shadow:inset 0 0 0 3px var(--ct-button-background--secondary),inset 0 0 0 5px var(--ct-button-focus-color--secondary)}");const Fe=()=>document.querySelector(".cookie-though"),Me=e=>`-${Le(e,"height")}px`,Ue=(e,t)=>{let n=Fe();n||(n=Ze()),n.setAttribute("aria-hidden",String(!e)),n.style.bottom=t||Me(n),e||setTimeout((()=>n.style.bottom=Me(n)),Ce(n)+1)};var $e=(e,t)=>{switch(t.type){case"decline":return ye({cookiePreferencesKey:t.cookiePreferencesKey,options:e.map((e=>({...e,isEnabled:ve(e.category)}))),onPreferencesChanged:t.onPreferencesChanged});case"accept":return ye({cookiePreferencesKey:t.cookiePreferencesKey,options:t.areAllOptionsEnabled?e.map((e=>({...e,isEnabled:!0}))):e,onPreferencesChanged:t.onPreferencesChanged});case"toggle":return e.map(((e,n)=>n===t.index?{...e,isEnabled:!e.isEnabled}:e))}};var De=({option:{isEnabled:e,id:t,label:n,description:o,category:r},onClick:i,essentialLabel:l})=>{const c=ee(null),a=ve(r);return U("div",{ref:c,class:"option",children:[U("input",{type:"checkbox",class:"sr-only",id:t,name:t,disabled:a,checked:e,onClick:i,onFocus:()=>c.current?.scrollIntoView({block:"nearest",inline:"nearest"})},void 0),U("label",{htmlFor:t,class:"info","aria-label":n,children:[U("span",{children:[U("strong",{children:n},void 0),o]},void 0),U("span",{class:a?"essential-label":"pill-switch",children:a&&l},void 0)]},void 0)]},void 0)};const Ne=()=>U("svg",{fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:U("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},void 0)},void 0);var Ke=({customizeLabel:e,optionsAriaLabel:t,consent:n,essentialLabel:o,permissionLabels:r=W.permissionLabels,cookiePolicy:i,cookiePreferencesKey:l})=>{const[c,a]=J($e,n.options),s=ee(null),{isOpen:u}=qe(s),d=_e(),_=Pe(),p=oe(pe),f=te((()=>!u&&!(e=>e.some((({category:e,isEnabled:t})=>!ve(e)&&!0===t)))(c)||(e=>e.every((e=>e.isEnabled)))(c)?r.acceptAll??W.permissionLabels.acceptAll:r.accept??W.permissionLabels.accept),[u,c,r.accept,r.acceptAll]),v=()=>{Ue(!1,Me(d)),s.current&&setTimeout((()=>s.current.open=!1),_)};return U(h,{children:[U("details",{ref:s,children:[U("summary",{children:[e,U(Ne,{},void 0)]},void 0),U("div",{class:"content",tabIndex:-1,children:[U("fieldset",{children:[U("legend",{class:"sr-only",children:t},void 0),c.map(((e,t)=>U(De,{option:e,onClick:()=>a({type:"toggle",index:t}),essentialLabel:o},t)))]},void 0),i&&U("div",{class:"declaration",children:U("a",{href:i.url,children:i.label},void 0)},void 0)]},void 0)]},void 0),U("div",{class:"acceptance",children:[U("button",{class:"button button--secondary",onClick:()=>{a({type:"decline",cookiePreferencesKey:l,onPreferencesChanged:p}),v()},children:r.decline??W.permissionLabels.decline},void 0),U("button",{class:"button button--primary",onClick:()=>{a({type:"accept",cookiePreferencesKey:l,areAllOptionsEnabled:f===(r.acceptAll??W.permissionLabels.acceptAll),onPreferencesChanged:p}),v()},children:f},void 0)]},void 0)]},void 0)};const We=()=>U("svg",{width:"33",height:"33",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"presentation",children:U("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M20.5 14C21.4008 14 22.251 13.7834 23.0014 13.3996C23.0005 13.4329 23 13.4664 23 13.5C23 15.0583 24.0184 16.3788 25.426 16.8321C23.7905 22.1414 18.8459 26 13 26C5.8203 26 0 20.1797 0 13C0 5.8203 5.8203 0 13 0C13.954 0 14.884 0.102758 15.7795 0.29781C15.292 0.899245 15 1.66552 15 2.5C15 3.53742 15.4514 4.46941 16.1684 5.11034C15.4364 6.04443 15 7.22125 15 8.5C15 11.5376 17.4624 14 20.5 14ZM11 7C11 7.55228 10.5523 8 10 8C9.44772 8 9 7.55228 9 7C9 6.44772 9.44772 6 10 6C10.5523 6 11 6.44772 11 7ZM12 13C12 14.1046 11.1046 15 10 15C8.89543 15 8 14.1046 8 13C8 11.8954 8.89543 11 10 11C11.1046 11 12 11.8954 12 13ZM17 20C17.5523 20 18 19.5523 18 19C18 18.4477 17.5523 18 17 18C16.4477 18 16 18.4477 16 19C16 19.5523 16.4477 20 17 20ZM10 19.5C10 20.3284 9.32843 21 8.5 21C7.67157 21 7 20.3284 7 19.5C7 18.6716 7.67157 18 8.5 18C9.32843 18 10 18.6716 10 19.5Z",fill:"var(--ct-cookie-color)"},void 0)},void 0);var Oe=({intro:e,title:t,description:n})=>U("header",{children:[U("div",{class:"tagline",children:[(null!==e||null!==t)&&U("h2",{children:[null!==e&&(e||W.header.intro),null!==t&&U("strong",{"aria-hidden":"true",children:t||W.header.title},void 0)]},void 0),U(We,{},void 0)]},void 0),null!==n&&U("p",{children:n||W.header.description},void 0)]},void 0);var Be=({config:e,container:t})=>{const{header:n=W.header,policies:o,cookiePreferencesKey:r=$,customizeLabel:i,optionsAriaLabel:l,essentialLabel:c,permissionLabels:a,cookiePolicy:s}=e,u=ke({policies:o,cookiePreferencesKey:r});return he((()=>{t.style.bottom=Me(t),t.setAttribute("aria-hidden","true"),u.isCustomised||setTimeout((()=>Ue(!0,Ie)))})),U(fe,{onPreferencesChanged:e.onPreferencesChanged,children:U(de,{container:t,children:[U(Oe,{intro:n.intro,title:n.title,description:n.description},void 0),U(Ke,{customizeLabel:i??W.customizeLabel,optionsAriaLabel:l??W.optionsAriaLabel,consent:u,essentialLabel:c??W.essentialLabel,permissionLabels:a??W.permissionLabels,cookiePolicy:s,cookiePreferencesKey:r},void 0)]},void 0)},void 0)};const Ie="var(--ct-banner-spacing)";let Re=$;const Ye=(e=W)=>{e.cookiePreferencesKey&&(Re=e.cookiePreferencesKey);const t=Fe();if(t&&t.shadowRoot)return T(p(Be,{config:e,container:t}),t.shadowRoot),t;const{container:n,shadowRoot:o}=(e=>{const t=document.createElement("aside");t.className="cookie-though",t.setAttribute("aria-label",e);const n=t.attachShadow({mode:"open"}),o=document.createElement("style");return o.textContent=Te(),n.appendChild(o),{container:t,shadowRoot:n}})(e.ariaLabel||W.ariaLabel);return document.body.prepend(n),T(p(Be,{config:e,container:n}),o),n},Ze=Ye,Ve=()=>Ue(!0,Ie),je=()=>Ue(!1),Ge=()=>{const e=ge(Re);return{isCustomised:!!e,preferences:e}};export{Ie as BANNER_SPACING,Ye as configure,Ze as init,Ve as show,je as hide,Ge as getCookiePreferences}; |
@@ -10,14 +10,59 @@ interface Preference { | ||
type OnPreferencesChanged = ((cookiePreferences: CookiePreferences) => void) | undefined; | ||
/** | ||
* The category to which a policy belongs to. | ||
*/ | ||
type Category = 'essential' | 'social' | 'personalisation' | 'marketing' | 'statistics' | 'functional'; | ||
interface Policy { | ||
/** | ||
* The id that is used to save the user's preferences in the cookie. | ||
* | ||
* Example: `functional` | ||
*/ | ||
id: string; | ||
/** | ||
* The label of the policy checkbox shown to the user in bold. | ||
* | ||
* Example: `Functional Cookies` | ||
*/ | ||
label: string; | ||
/** | ||
* The label of the policy checkbox shown to the user. | ||
* | ||
* Example: `We'll remember the basics such as language.` | ||
*/ | ||
description: string; | ||
/** | ||
* The category to which this policy belongs to. | ||
*/ | ||
category: Category; | ||
} | ||
interface Config { | ||
/** | ||
* Announces the presence of a cookie banner to a user using a screenreader. | ||
* | ||
* Default: `Cookie Banner`. | ||
*/ | ||
ariaLabel?: string; | ||
/** | ||
* Announces a group of a cookie options to a user using a screenreader. | ||
* | ||
* Default: `Cookie options`. | ||
*/ | ||
optionsAriaLabel?: string; | ||
/** | ||
* An array of policies that are shown to the user. | ||
* | ||
* Default: a list of all possible policies. | ||
*/ | ||
policies: Policy[]; | ||
/** | ||
* The label that is displayed instead of the checkbox for essential cookies. | ||
* Seeing as essential cookies can't be turned off, we display a label instead. | ||
* | ||
* Default:`Always on`. | ||
*/ | ||
essentialLabel?: string; | ||
/** | ||
* An object which contains the labels that are displayed to the user to accept (all) or decline cookies. | ||
*/ | ||
permissionLabels?: { | ||
@@ -28,9 +73,29 @@ accept?: string; | ||
}; | ||
/** | ||
* The key that is used for saving the cookie with the user's preferences. | ||
* | ||
* Default: `cookie-preferences`. | ||
*/ | ||
cookiePreferencesKey?: string; | ||
/** | ||
* An object which contains the labels that are displayed in the header. | ||
* In order for Cookie Though not to render one or more of these labels, pass `null` as the value. | ||
*/ | ||
header?: { | ||
/** Default: `You're probably fed up with these banners...` */ | ||
intro?: string | null; | ||
/** Default: `cookie though?` */ | ||
title?: string | null; | ||
/** Default: `Everybody wants to show his best side - and so do we. That's why we use cookies to guarantee you a better experience.` */ | ||
description?: string | null; | ||
}; | ||
/** | ||
* The label for the customize <summary> tag which opens and closes the cookie options. | ||
* | ||
* Default: `Customize` | ||
*/ | ||
customizeLabel?: string; | ||
/** | ||
* An object which contains a url and label which allow the user to read the full cookie policy. | ||
*/ | ||
cookiePolicy?: { | ||
@@ -40,2 +105,5 @@ url: string; | ||
}; | ||
/** | ||
* A function which will be called whenever the preferences of the user change. | ||
*/ | ||
onPreferencesChanged?: OnPreferencesChanged; | ||
@@ -42,0 +110,0 @@ } |
{ | ||
"name": "cookie-though", | ||
"version": "2.0.0-rc.2", | ||
"version": "2.0.0-rc.3", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "homepage": "https://cookiethough.dev", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
42114
116