@smartgenie/cookie-consent 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +73 -0
- package/README.md +292 -2
- package/dist/blocking/attribute-blocker.d.ts +18 -0
- package/dist/blocking/gtm-consent-mode.d.ts +19 -0
- package/dist/blocking/uet-consent.d.ts +9 -0
- package/dist/capsules/banner-experiment.d.ts +2 -0
- package/dist/capsules/banner-experiment.js +1 -0
- package/dist/capsules/country-banners.d.ts +2 -0
- package/dist/capsules/country-banners.js +1 -0
- package/dist/capsules/loader.d.ts +8 -0
- package/dist/capsules/subdomain-consent.d.ts +5 -0
- package/dist/capsules/subdomain-consent.js +1 -0
- package/dist/config/schema.d.ts +19 -0
- package/dist/config/validator.d.ts +8 -0
- package/dist/core/consent-log.d.ts +14 -0
- package/dist/core/consent-manager.d.ts +13 -0
- package/dist/core/consent-stats.d.ts +13 -0
- package/dist/core/events.d.ts +5 -0
- package/dist/core/gpc.d.ts +5 -0
- package/dist/core/storage.d.ts +9 -0
- package/dist/geo/detector.d.ts +3 -0
- package/dist/i18n/langs/ar.d.ts +1 -0
- package/dist/i18n/langs/cs.d.ts +1 -0
- package/dist/i18n/langs/da.d.ts +1 -0
- package/dist/i18n/langs/de.d.ts +1 -0
- package/dist/i18n/langs/es.d.ts +1 -0
- package/dist/i18n/langs/fr.d.ts +1 -0
- package/dist/i18n/langs/hi.d.ts +1 -0
- package/dist/i18n/langs/it.d.ts +1 -0
- package/dist/i18n/langs/ja.d.ts +1 -0
- package/dist/i18n/langs/ko.d.ts +1 -0
- package/dist/i18n/langs/nl.d.ts +1 -0
- package/dist/i18n/langs/no.d.ts +1 -0
- package/dist/i18n/langs/pl.d.ts +1 -0
- package/dist/i18n/langs/pt.d.ts +1 -0
- package/dist/i18n/langs/ro.d.ts +1 -0
- package/dist/i18n/langs/ru.d.ts +1 -0
- package/dist/i18n/langs/sv.d.ts +1 -0
- package/dist/i18n/langs/tr.d.ts +1 -0
- package/dist/i18n/langs/zh.d.ts +1 -0
- package/dist/i18n/loader.d.ts +11 -0
- package/dist/i18n/remote.d.ts +23 -0
- package/dist/i18n/translations.d.ts +14 -0
- package/dist/index.d.ts +10 -0
- package/dist/lang/ar.json +1 -0
- package/dist/lang/cs.json +1 -0
- package/dist/lang/da.json +1 -0
- package/dist/lang/de.json +1 -0
- package/dist/lang/es.json +1 -0
- package/dist/lang/fr.json +1 -0
- package/dist/lang/hi.json +1 -0
- package/dist/lang/it.json +1 -0
- package/dist/lang/ja.json +1 -0
- package/dist/lang/ko.json +1 -0
- package/dist/lang/nl.json +1 -0
- package/dist/lang/no.json +1 -0
- package/dist/lang/pl.json +1 -0
- package/dist/lang/pt.json +1 -0
- package/dist/lang/ro.json +1 -0
- package/dist/lang/ru.json +1 -0
- package/dist/lang/sv.json +1 -0
- package/dist/lang/tr.json +1 -0
- package/dist/lang/zh.json +1 -0
- package/dist/react/SmartConsent.d.ts +14 -0
- package/dist/react/SmartConsent.js +2260 -0
- package/dist/react/SmartConsent.js.map +1 -0
- package/dist/regulations/loader.d.ts +3 -0
- package/dist/regulations/reasoner.d.ts +6 -0
- package/dist/regulations/schema.d.ts +8 -0
- package/dist/site/consent-records.d.ts +26 -0
- package/dist/site/settings.d.ts +48 -0
- package/dist/smartconsent.es.js +3063 -0
- package/dist/smartconsent.es.js.map +1 -0
- package/dist/smartconsent.js +3962 -0
- package/dist/smartconsent.js.map +1 -0
- package/dist/smartconsent.min.js +534 -0
- package/dist/smartconsent.min.js.map +1 -0
- package/dist/types.d.ts +377 -0
- package/dist/ui/a11y.d.ts +4 -0
- package/dist/ui/attribution-guard.d.ts +3 -0
- package/dist/ui/badge.d.ts +7 -0
- package/dist/ui/banner.d.ts +10 -0
- package/dist/ui/cookie-policy.d.ts +8 -0
- package/dist/ui/cookie-table.d.ts +7 -0
- package/dist/ui/credit.d.ts +15 -0
- package/dist/ui/embed-placeholder.d.ts +7 -0
- package/dist/ui/opt-out-notice.d.ts +7 -0
- package/dist/ui/styles.d.ts +3 -0
- package/dist/webhook.d.ts +5 -0
- package/package.json +100 -4
- package/templates/privacy-policy-template.md +135 -0
- package/templates/vanilla.html +116 -0
|
@@ -0,0 +1,534 @@
|
|
|
1
|
+
this.SmartConsent=function(){"use strict";const te=[{id:"essential",label:"Essential",description:"Required for the website to function. Cannot be disabled.",required:!0},{id:"analytics",label:"Analytics",description:"Help us understand how visitors interact with our website.",required:!1},{id:"functional",label:"Functional",description:"Enable personalised features and remember your preferences.",required:!1},{id:"marketing",label:"Marketing",description:"Used to deliver relevant advertisements and track campaign performance.",required:!1}],dt={bg:"#FFFFFF",surface:"#F4F6F8",border:"#DCE1E7",text:"#182230",textMuted:"#526071",accent:"#33465F",accept:"#33465F",reject:"#33465F",toggleOn:"#33465F",toggleOff:"#778496",radius:"12px",font:"system-ui, sans-serif"},K={heading:"Cookie Preferences",description:"We use cookies to improve your experience.",acceptAll:"Accept All",rejectOptional:"Reject Optional",managePreferences:"Manage Preferences",essentialOnly:"Essential Only",savePreferences:"Save Preferences",poweredBy:"Powered by SmartGenie",doNotSell:"Do Not Sell or Share My Personal Information",cookieSettings:"Cookie settings",dataRequest:"Your data rights",policyCredit:"Cookie consent by SmartConsent from SmartGenie",embedNotice:"This content is from {service}. Loading it may set cookies.",embedLoad:"Load content"},pt="https://smartconsentsettings.blob.core.windows.net/$web",mt="https://cdn.smartgenie.co.uk/v1/",Ee="https://api.smartgenie.co.uk",ne={version:0,categories:te,theme:dt,position:"bottom",badgePosition:"bottom-right",showBadge:!0,attribution:!0,attributionUrl:"https://www.smartgenie.co.uk/smartconsent",consentMode:!0,expiry:13,texts:K,dir:"ltr",layout:"box",boxPosition:"bottom-right",cookies:[]},gt=1,ft=13;function ht(t){if(t==null||typeof t!="object")throw new Error("SmartConsent: config must be an object");const e=t;if(e.version===void 0||e.version===null)throw new Error("SmartConsent: config.version is required");if(typeof e.version!="number"||!Number.isFinite(e.version))throw new Error("SmartConsent: config.version must be a finite number");const n={...ne,version:e.version};if(Array.isArray(e.categories)&&(n.categories=e.categories),e.theme!==void 0&&typeof e.theme=="object"&&e.theme!==null&&(n.theme={...ne.theme,...e.theme}),e.texts!==void 0&&typeof e.texts=="object"&&e.texts!==null&&(n.texts={...ne.texts,...e.texts}),(e.position==="bottom"||e.position==="top")&&(n.position=e.position),(e.badgePosition==="bottom-right"||e.badgePosition==="bottom-left")&&(n.badgePosition=e.badgePosition),typeof e.showBadge=="boolean"&&(n.showBadge=e.showBadge),typeof e.attribution=="boolean"&&(n.attribution=e.attribution),typeof e.consentMode=="boolean"&&(n.consentMode=e.consentMode),typeof e.attributionUrl=="string"&&(n.attributionUrl=e.attributionUrl),typeof e.webhookUrl=="string"&&(n.webhookUrl=e.webhookUrl),typeof e.expiry=="number"&&Number.isFinite(e.expiry)&&(n.expiry=Math.max(gt,Math.min(ft,e.expiry))),typeof e.onConsent=="function"&&(n.onConsent=e.onConsent),typeof e.siteId=="string"&&(n.siteId=e.siteId),(e.platform==="wordpress-plugin"||e.platform==="joomla-extension"||e.platform==="drupal-module")&&(n.platform=e.platform,n.attribution=e.attribution===!0),typeof e.recordsEndpoint=="string"?n.recordsEndpoint=e.recordsEndpoint:e.recordsEndpoint!==void 0&&console.warn("SmartConsent: recordsEndpoint ignored (it must be a string)."),typeof e.language=="string"&&(n.language=e.language),(e.dir==="ltr"||e.dir==="rtl")&&(n.dir=e.dir),(e.layout==="banner"||e.layout==="box"||e.layout==="popup")&&(n.layout=e.layout),(e.boxPosition==="bottom-left"||e.boxPosition==="bottom-right")&&(n.boxPosition=e.boxPosition),Array.isArray(e.cookies)){const o=[];for(const a of e.cookies)if(a&&typeof a=="object"){const s=a;typeof s.name=="string"&&typeof s.category=="string"?o.push({name:s.name,category:s.category,...typeof s.domain=="string"&&{domain:s.domain},...typeof s.description=="string"&&{description:s.description},...typeof s.duration=="string"&&{duration:s.duration},...(s.party==="first"||s.party==="third")&&{party:s.party}}):console.warn("SmartConsent: Skipping invalid cookie declaration:",s)}n.cookies=o}if(e.logo&&typeof e.logo=="object"){const o=e.logo;typeof o.src=="string"&&typeof o.alt=="string"&&(n.logo={src:o.src,alt:o.alt,...typeof o.width=="number"&&{width:o.width},...typeof o.height=="number"&&{height:o.height}})}return n}const ue="smartconsent_state";function Se(){function t(){try{const e=localStorage.getItem(ue);return e?JSON.parse(e):null}catch{return null}}return{getConsent(){return t()},saveConsent(e){try{localStorage.setItem(ue,JSON.stringify(e))}catch{}},clearConsent(){try{localStorage.removeItem(ue)}catch{}},isExpired(){const e=t();return!e||!e.expiresAt?!0:new Date(e.expiresAt).getTime()<=Date.now()},isVersionMatch(e){const n=t();return n?n.version===e:!1}}}const de="smartconsent:update";function bt(t){window.dispatchEvent(new CustomEvent(de,{detail:t}))}function pe(t){const e=n=>{t(n.detail)};return window.addEventListener(de,e),()=>window.removeEventListener(de,e)}function _t(t){const e=Se();function n(){const i=e.getConsent();return i?e.isExpired()||!e.isVersionMatch(t.version)?(e.clearConsent(),null):i:null}function o(i){const l={};for(const d of t.categories)l[d.id]=d.required?!0:i;return l}function a(){const i=new Date;return i.setMonth(i.getMonth()+t.expiry),i.toISOString()}function s(i,l){const d=new Date().toISOString(),h={version:t.version,categories:i,timestamp:d,action:l,expiresAt:a()};e.saveConsent(h);const g={categories:i,action:l,timestamp:d,version:t.version};bt(g),t.onConsent&&t.onConsent(h)}return{acceptAll(){s(o(!0),"accept_all")},rejectOptional(){s(o(!1),"reject_optional")},saveCustom(i){const l={};for(const d of t.categories)d.required?l[d.id]=!0:l[d.id]=i[d.id]??!1;s(l,"custom")},withdraw(){s(o(!1),"withdraw")},reset(){e.clearConsent()},getState(){return n()},hasConsent(i){const l=n();return l?l.categories[i]===!0:!1},needsConsent(){return n()===null},onConsentChange(i){return pe(i)}}}function yt(t,e,n){const o=typeof navigator<"u"?navigator:null,s=!!o&&(o.globalPrivacyControl===!0||o.doNotTrack==="1")&&n.signals.gpc_auto_reject;if(s){const i=t.getState(),l=!!i&&e.categories.some(d=>!d.required&&i.categories[d.id]===!0);(!i||l)&&t.rejectOptional()}return s}const me="smartconsent_log",qe=100;function wt(t){function e(){try{const a=localStorage.getItem(me);return a?JSON.parse(a):[]}catch{return[]}}function n(a){try{localStorage.setItem(me,JSON.stringify(a))}catch{}}function o(){try{return crypto.randomUUID()}catch{return Date.now().toString(36)+Math.random().toString(36).slice(2)}}return{addRecord(a,s){const i={id:o(),timestamp:new Date().toISOString(),action:a,categories:{...s},visitorHash:t.visitorHash,version:t.version,jurisdiction:t.jurisdiction},l=e();return l.push(i),n(l.length>qe?l.slice(-qe):l),i},getLog(){return e()},getLatest(){const a=e();return a.length>0?a[a.length-1]:null},clear(){try{localStorage.removeItem(me)}catch{}}}}async function vt(){const t=[navigator.userAgent,screen.width,screen.height,new Date().getTimezoneOffset(),navigator.language].join("|");try{const e=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(t));return Array.from(new Uint8Array(e),n=>n.toString(16).padStart(2,"0")).join("")}catch{let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=Math.imul(e,16777619);return(e>>>0).toString(16).padStart(8,"0")}}function xt(t){return{send(e,n){if(!t.webhookUrl)return;const o={action:e.action,categories:e.categories,version:e.version,timestamp:e.timestamp,pageUrl:window.location.href,userAgent:navigator.userAgent,...n&&{recordId:n.id,visitorHash:n.visitorHash,jurisdiction:n.jurisdiction}};try{fetch(t.webhookUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)}).catch(()=>{})}catch{}}}}function je(t){return{analytics_storage:t.analytics?"granted":"denied",ad_storage:t.marketing?"granted":"denied",ad_user_data:t.marketing?"granted":"denied",ad_personalization:t.marketing?"granted":"denied",functionality_storage:t.functional?"granted":"denied",personalization_storage:t.functional?"granted":"denied",security_storage:"granted"}}function ge(){window.dataLayer||(window.dataLayer=[]),window.gtag||(window.gtag=function(...t){window.dataLayer.push(t)})}const Re={analytics_storage:"denied",ad_storage:"denied",ad_user_data:"denied",ad_personalization:"denied",functionality_storage:"denied",personalization_storage:"denied",security_storage:"granted"};function Pe(){ge(),window.gtag("consent","default",{...Re,wait_for_update:500})}function $t(){ge(),window.gtag("consent","update",{...Re})}function Ct(t,e){let n=null;return{init(o){if(!t.consentMode)return;o!=null&&o.defaultSent||Pe(),ge(),n=pe(s=>{window.gtag("consent","update",je(s.categories))});const a=e.getState();a&&window.gtag("consent","update",je(a.categories))},destroy(){n&&(n(),n=null)}}}function Le(t,e){(window.uetq=window.uetq||[]).push("consent",t,{ad_storage:e?"granted":"denied"})}function At(){Le("default",!1)}function fe(t){Le("update",t)}function Ie(t,e){return t&&/^\d+(\.\d+)?$/.test(t.trim())?t.trim()+"px":(t==null?void 0:t.trim())||e}function kt(t,e){const n=document.createElement("div");n.setAttribute("data-smartconsent","embed"),n.setAttribute("role","region");const o=Ie(t.getAttribute("width"),t.style.width),a=Ie(t.getAttribute("height"),t.style.height);o&&n.style.setProperty("--sc-embed-w",o),a&&n.style.setProperty("--sc-embed-h",a);const s=document.createElement("p"),i=document.createElement("button");return i.type="button",i.addEventListener("click",e),n.append(s,i),n}function Te(t,e,n){const o=n.embedNotice.split("{service}").join(e);t.setAttribute("aria-label",o),t.firstChild.textContent=o;const a=t.lastChild;a.textContent=n.embedLoad,a.setAttribute("aria-label",`${n.embedLoad}: ${e}`)}const oe="data-smartconsent-blocked",Ne=document.createElement,Et="cdn.smartgenie.co.uk",he="",Be="\0",De=Node.prototype.appendChild,Me=Node.prototype.insertBefore,Y=Node.prototype.replaceChild,Oe=Element.prototype.append;function St(t){let e=null,n=null,o=null;const a=[],s=[];let i=K,l=new WeakSet,d,h=new WeakSet;function g(r){if(!r)return null;try{const c=new URL(r,location.href);return/^https?:$/.test(c.protocol)&&c.hostname!==location.hostname&&c.hostname!==Et?c:null}catch{return null}}function f(r){if(!r)return null;const c=r.hostname.toLowerCase(),p=(c+r.pathname).toLowerCase();for(const[b,C]of d||[])if(b.includes("/")?p.includes(b):c===b||c.endsWith("."+b))return C;return null}function _(r,c){if(d===void 0)return null;const p=g(r);return p?d?f(p):c?he:null:null}function u(r){return e?e.hasConsent(r):!1}function m(r){return r.getAttribute(oe)==="true"}function N(r){return r.type!=="text/plain"||m(r)}function S(r,c){const p=r.getAttribute("src")||r.getAttribute("data-original-src"),b=r.textContent||null,C=[];for(const w of Array.from(r.attributes))w.name!=="type"&&w.name!=="src"&&w.name!=="data-original-src"&&C.push({name:w.name,value:w.value});return{node:r,src:p,content:b,category:c,attributes:C}}function x(r){const c=a.findIndex(p=>p.node===r.node);if(c>=0){a[c]=r;return}a.push(r)}function A(r,c){const p=S(r,c);x(p),r.setAttribute(oe,"true"),r.type="text/plain",p.src&&(r.setAttribute("data-original-src",p.src),r.removeAttribute("src"))}function z(r){const c=document.createElement("script");for(const b of r.attributes)c.setAttribute(b.name,b.value);if(c.removeAttribute("type"),c.removeAttribute(oe),r.src?c.src=r.src:r.content&&(c.textContent=r.content),r.node.parentNode){r.node.parentNode.replaceChild(c,r.node);return}(document.body||document.head||document.documentElement).appendChild(c)}function ee(r,c=!1){var b;const p=r.getAttribute("data-consent-category")??((b=a.find(C=>C.node===r))==null?void 0:b.category)??_(r.getAttribute("src"),c||h.has(r)||r.hasAttribute("async"));p===null||u(p)||!N(r)||A(r,p)}function L(r){var c;return(((c=g(r.getAttribute("data-original-src")))==null?void 0:c.hostname)??"").replace(/^www\./,"")}function q(r){const c=r.node.parentNode;r.category===he||r.box||!c||(r.box=kt(r.node,()=>{s.splice(s.indexOf(r),1),l.add(r.node),$(r)}),Te(r.box,L(r.node),i),Y.call(c,r.box,r.node))}function $(r){const c=r.box;r.box=void 0,c!=null&&c.parentNode&&Y.call(c.parentNode,r.node,c);const p=r.node.getAttribute("data-original-src");r.node.removeAttribute("data-original-src"),p&&r.node.setAttribute("src",p)}function M(r){if(l.has(r))return;const c=s.find(w=>w.node===r);if(c)return q(c);const p=r.getAttribute("src"),b=_(p,!0);if(b===null||u(b))return;r.setAttribute("data-original-src",p),r.removeAttribute("src");const C={node:r,category:b};s.push(C),q(C)}function I(r,c){r instanceof HTMLScriptElement?ee(r,c):r instanceof HTMLIFrameElement&&M(r)}function E(r,c=!0){if(r instanceof Element&&I(r,c),r instanceof Element||r instanceof DocumentFragment)for(const p of Array.from(r.querySelectorAll("script, iframe")))I(p,c);return r}function R(){for(const r of Array.from(document.querySelectorAll("script, iframe")))I(r,!1)}function T(r){var p;const c=document.querySelectorAll(`script[type="text/plain"][data-consent-category]:not([${oe}="true"])`);for(const b of c)try{const C=b.getAttribute("data-consent-category");if(!r(C))continue;const w=b.getAttribute("data-original-src")||b.getAttribute("src"),k=b.textContent,P=document.createElement("script");for(const D of Array.from(b.attributes))D.name!=="type"&&D.name!=="data-original-src"&&P.setAttribute(D.name,D.value);w?P.src=w:k&&(P.textContent=k),(p=b.parentNode)==null||p.replaceChild(P,b)}catch{}}function v(r){const c=[],p=[];for(const b of s.splice(0)){if(!r(b.category)){s.push(b);continue}$(b)}for(const b of a)r(b.category)?c.push(b):p.push(b);a.length=0,a.push(...p);for(const b of c)try{z(b)}catch{}T(r)}function O(r){v(c=>r.categories[c]===!0)}function B(){v(r=>u(r))}return{init(){R(),n=new MutationObserver(r=>{for(const c of r)for(const p of Array.from(c.addedNodes))E(p,!1);e&&T(u)}),n.observe(document.documentElement,{childList:!0,subtree:!0}),document.createElement=function(r,c){const p=Ne.call(document,r,c),b=String(r).toLowerCase();if(b==="script"||b==="iframe"){h.add(p);const C=p.setAttribute.bind(p);p.setAttribute=(P,D)=>{C(P,D),(P==="data-consent-category"||P==="src")&&I(p,!0)};const w=b==="script"?HTMLScriptElement.prototype:HTMLIFrameElement.prototype,k=Object.getOwnPropertyDescriptor(w,"src");k!=null&&k.get&&k.set&&Object.defineProperty(p,"src",{configurable:!0,enumerable:!0,get(){return k.get.call(this)},set(P){k.set.call(this,P),I(p,!0)}})}return p},Node.prototype.appendChild=function(r){return De.call(this,E(r))},Node.prototype.insertBefore=function(r,c){return Me.call(this,E(r),c)},Node.prototype.replaceChild=function(r,c){return Y.call(this,E(r),c)},Element.prototype.append=function(...r){Oe.apply(this,r.map(c=>typeof c=="string"?c:E(c)))},e&&(o=e.onConsentChange(O),B())},attach(r){o=r.onConsentChange(O),e=r,B()},setRules(r){const c=d===null;if(d=r,!(!c||!r)){for(const p of[...a,...s]){if(p.category!==he)continue;const b="src"in p?p.src:p.node.getAttribute("data-original-src");p.category=f(g(b))??Be}v(p=>p===Be||u(p));for(const p of s)q(p)}},setTexts(r){i=r;for(const c of s)c.box&&Te(c.box,L(c.node),r)},destroy(){n&&(n.disconnect(),n=null),document.createElement=Ne,Node.prototype.appendChild=De,Node.prototype.insertBefore=Me,Node.prototype.replaceChild=Y,Element.prototype.append=Oe,o&&(o(),o=null),e=null,a.length=0;for(const r of s){const c=r.box;c!=null&&c.parentNode&&Y.call(c.parentNode,r.node,c)}s.length=0,l=new WeakSet,i=K,d=void 0,h=new WeakSet}}}const Ue="smartconsent-styles";function qt(t){if(document.getElementById(Ue))return;const e=document.createElement("style");e.id=Ue,e.textContent=jt(t),document.head.appendChild(e)}function jt(t){return`
|
|
2
|
+
[data-smartconsent] {
|
|
3
|
+
--sc-bg: ${t.bg};
|
|
4
|
+
--sc-surface: ${t.surface};
|
|
5
|
+
--sc-border: ${t.border};
|
|
6
|
+
--sc-text: ${t.text};
|
|
7
|
+
--sc-text-muted: ${t.textMuted};
|
|
8
|
+
--sc-accent: ${t.accent};
|
|
9
|
+
--sc-accept: ${t.accept};
|
|
10
|
+
--sc-reject: ${t.reject};
|
|
11
|
+
--sc-toggle-on: ${t.toggleOn};
|
|
12
|
+
--sc-toggle-off: ${t.toggleOff};
|
|
13
|
+
--sc-radius: ${t.radius};
|
|
14
|
+
--sc-font: ${t.font};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
[data-smartconsent] *,
|
|
18
|
+
[data-smartconsent] *::before,
|
|
19
|
+
[data-smartconsent] *::after {
|
|
20
|
+
box-sizing: border-box;
|
|
21
|
+
margin: 0;
|
|
22
|
+
padding: 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
[data-smartconsent="backdrop"] {
|
|
26
|
+
position: fixed;
|
|
27
|
+
inset: 0;
|
|
28
|
+
background: rgba(0, 0, 0, 0.4);
|
|
29
|
+
z-index: 9998;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
[data-smartconsent="banner"] {
|
|
33
|
+
position: fixed;
|
|
34
|
+
bottom: 0;
|
|
35
|
+
left: 0;
|
|
36
|
+
right: 0;
|
|
37
|
+
z-index: 9999;
|
|
38
|
+
background: var(--sc-bg);
|
|
39
|
+
color: var(--sc-text);
|
|
40
|
+
font-family: var(--sc-font);
|
|
41
|
+
font-size: 14px;
|
|
42
|
+
line-height: 1.5;
|
|
43
|
+
animation: sc-slide-up 0.3s ease-out;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
[data-smartconsent="banner"][data-sc-position="top"] {
|
|
47
|
+
bottom: auto;
|
|
48
|
+
top: 0;
|
|
49
|
+
animation: sc-slide-down-in 0.3s ease-out;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
[data-smartconsent="banner"] .sc-accent-line {
|
|
53
|
+
height: 2px;
|
|
54
|
+
background: linear-gradient(90deg, var(--sc-accent), var(--sc-accept));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
[data-smartconsent="banner"] .sc-inner {
|
|
58
|
+
max-width: 960px;
|
|
59
|
+
margin: 0 auto;
|
|
60
|
+
padding: 16px 20px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* Compact state */
|
|
64
|
+
[data-smartconsent="banner"] .sc-compact {
|
|
65
|
+
display: flex;
|
|
66
|
+
align-items: center;
|
|
67
|
+
gap: 16px;
|
|
68
|
+
flex-wrap: wrap;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
[data-smartconsent="banner"] .sc-compact-text {
|
|
72
|
+
flex: 1 1 300px;
|
|
73
|
+
color: var(--sc-text);
|
|
74
|
+
font-size: 14px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
[data-smartconsent="banner"] .sc-compact-actions {
|
|
78
|
+
display: flex;
|
|
79
|
+
align-items: center;
|
|
80
|
+
gap: 10px;
|
|
81
|
+
flex-wrap: wrap;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
[data-smartconsent="banner"] .sc-compact-attribution {
|
|
85
|
+
flex: 1 1 100%;
|
|
86
|
+
margin-top: 6px;
|
|
87
|
+
font-size: 11px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
[data-smartconsent="banner"] .sc-compact-attribution a {
|
|
91
|
+
color: var(--sc-accent);
|
|
92
|
+
text-decoration: none;
|
|
93
|
+
font-weight: 500;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
[data-smartconsent="banner"] .sc-compact-attribution a:hover {
|
|
97
|
+
text-decoration: underline;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* Expanded state */
|
|
101
|
+
[data-smartconsent="banner"] .sc-expanded {
|
|
102
|
+
display: none;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
[data-smartconsent="banner"] .sc-expanded.sc-active {
|
|
106
|
+
display: block;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
[data-smartconsent="banner"] .sc-compact.sc-hidden {
|
|
110
|
+
display: none;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
[data-smartconsent="banner"] .sc-header {
|
|
114
|
+
display: flex;
|
|
115
|
+
align-items: center;
|
|
116
|
+
gap: 12px;
|
|
117
|
+
margin-bottom: 8px;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
[data-smartconsent="banner"] .sc-logo {
|
|
121
|
+
flex-shrink: 0;
|
|
122
|
+
max-height: 48px;
|
|
123
|
+
width: auto;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
[data-smartconsent="banner"] .sc-header .sc-heading {
|
|
127
|
+
margin-bottom: 0;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
[data-smartconsent="banner"] .sc-heading {
|
|
131
|
+
font-size: 18px;
|
|
132
|
+
font-weight: 600;
|
|
133
|
+
margin-bottom: 8px;
|
|
134
|
+
color: var(--sc-text);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
[data-smartconsent="banner"] .sc-description {
|
|
138
|
+
color: var(--sc-text-muted);
|
|
139
|
+
margin-bottom: 16px;
|
|
140
|
+
font-size: 13px;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* Category rows */
|
|
144
|
+
[data-smartconsent="banner"] .sc-categories {
|
|
145
|
+
margin-bottom: 16px;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
[data-smartconsent="banner"] .sc-category {
|
|
149
|
+
display: flex;
|
|
150
|
+
align-items: center;
|
|
151
|
+
justify-content: space-between;
|
|
152
|
+
padding: 12px;
|
|
153
|
+
border-bottom: 1px solid var(--sc-border);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
[data-smartconsent="banner"] .sc-category:hover {
|
|
157
|
+
background: var(--sc-surface);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
[data-smartconsent="banner"] .sc-category-info {
|
|
161
|
+
flex: 1;
|
|
162
|
+
margin-right: 12px;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
[data-smartconsent="banner"] .sc-category-label {
|
|
166
|
+
font-size: 14px;
|
|
167
|
+
font-weight: 500;
|
|
168
|
+
color: var(--sc-text);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
[data-smartconsent="banner"] .sc-category-desc {
|
|
172
|
+
font-size: 12px;
|
|
173
|
+
color: var(--sc-text-muted);
|
|
174
|
+
margin-top: 2px;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/* Toggle switch */
|
|
178
|
+
[data-smartconsent="banner"] .sc-toggle {
|
|
179
|
+
position: relative;
|
|
180
|
+
width: 44px;
|
|
181
|
+
height: 24px;
|
|
182
|
+
background: var(--sc-toggle-off);
|
|
183
|
+
border-radius: 12px;
|
|
184
|
+
border: none;
|
|
185
|
+
cursor: pointer;
|
|
186
|
+
transition: background 0.2s;
|
|
187
|
+
flex-shrink: 0;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
[data-smartconsent="banner"] .sc-toggle[aria-checked="true"] {
|
|
191
|
+
background: var(--sc-toggle-on);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
[data-smartconsent="banner"] .sc-toggle::after {
|
|
195
|
+
content: '';
|
|
196
|
+
position: absolute;
|
|
197
|
+
top: 3px;
|
|
198
|
+
left: 3px;
|
|
199
|
+
width: 18px;
|
|
200
|
+
height: 18px;
|
|
201
|
+
background: white;
|
|
202
|
+
border-radius: 50%;
|
|
203
|
+
transition: left 0.2s;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
[data-smartconsent="banner"] .sc-toggle[aria-checked="true"]::after {
|
|
207
|
+
left: 23px;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
[data-smartconsent="banner"] .sc-toggle:disabled {
|
|
211
|
+
opacity: 0.5;
|
|
212
|
+
cursor: not-allowed;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/* Held embed placeholder (CR-035): the size of the iframe it stands in for */
|
|
216
|
+
[data-smartconsent="embed"] {
|
|
217
|
+
display: flex;
|
|
218
|
+
flex-direction: column;
|
|
219
|
+
align-items: center;
|
|
220
|
+
justify-content: center;
|
|
221
|
+
gap: 12px;
|
|
222
|
+
width: var(--sc-embed-w, 100%);
|
|
223
|
+
max-width: 100%;
|
|
224
|
+
height: var(--sc-embed-h, auto);
|
|
225
|
+
min-height: 150px;
|
|
226
|
+
padding: 16px;
|
|
227
|
+
background: var(--sc-surface);
|
|
228
|
+
color: var(--sc-text);
|
|
229
|
+
border: 1px solid var(--sc-border);
|
|
230
|
+
border-radius: var(--sc-radius);
|
|
231
|
+
font-family: var(--sc-font);
|
|
232
|
+
font-size: 14px;
|
|
233
|
+
line-height: 1.5;
|
|
234
|
+
text-align: center;
|
|
235
|
+
box-sizing: border-box;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
[data-smartconsent="embed"] button {
|
|
239
|
+
padding: 8px 18px;
|
|
240
|
+
border: none;
|
|
241
|
+
border-radius: var(--sc-radius);
|
|
242
|
+
background: var(--sc-accent);
|
|
243
|
+
color: #fff;
|
|
244
|
+
font: 500 13px var(--sc-font);
|
|
245
|
+
cursor: pointer;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
[data-smartconsent="embed"] button:focus-visible {
|
|
249
|
+
outline: 2px solid var(--sc-accent);
|
|
250
|
+
outline-offset: 2px;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/* Buttons */
|
|
254
|
+
[data-smartconsent="banner"] .sc-btn {
|
|
255
|
+
padding: 8px 18px;
|
|
256
|
+
border: none;
|
|
257
|
+
border-radius: var(--sc-radius);
|
|
258
|
+
font-family: var(--sc-font);
|
|
259
|
+
font-size: 13px;
|
|
260
|
+
font-weight: 500;
|
|
261
|
+
cursor: pointer;
|
|
262
|
+
transition: opacity 0.2s;
|
|
263
|
+
white-space: nowrap;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
[data-smartconsent="banner"] .sc-btn:hover {
|
|
267
|
+
opacity: 0.85;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
[data-smartconsent="banner"] .sc-btn:focus-visible {
|
|
271
|
+
outline: 2px solid var(--sc-accent);
|
|
272
|
+
outline-offset: 2px;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
[data-smartconsent="banner"] .sc-btn-accept {
|
|
276
|
+
background: var(--sc-accept);
|
|
277
|
+
color: #fff;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
[data-smartconsent="banner"] .sc-btn-reject {
|
|
281
|
+
background: var(--sc-reject);
|
|
282
|
+
color: #fff;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
[data-smartconsent="banner"] .sc-btn-save {
|
|
286
|
+
background: var(--sc-accent);
|
|
287
|
+
color: #fff;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
[data-smartconsent="banner"] .sc-btn-essential {
|
|
291
|
+
background: var(--sc-reject);
|
|
292
|
+
color: #fff;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
[data-smartconsent="banner"] .sc-link {
|
|
296
|
+
background: none;
|
|
297
|
+
border: none;
|
|
298
|
+
color: var(--sc-accent);
|
|
299
|
+
font-family: var(--sc-font);
|
|
300
|
+
font-size: 13px;
|
|
301
|
+
cursor: pointer;
|
|
302
|
+
text-decoration: underline;
|
|
303
|
+
padding: 4px;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
[data-smartconsent="banner"] .sc-link:focus-visible {
|
|
307
|
+
outline: 2px solid var(--sc-accent);
|
|
308
|
+
outline-offset: 2px;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/* Expanded actions */
|
|
312
|
+
[data-smartconsent="banner"] .sc-expanded-actions {
|
|
313
|
+
display: flex;
|
|
314
|
+
gap: 10px;
|
|
315
|
+
flex-wrap: wrap;
|
|
316
|
+
margin-top: 16px;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/* Attribution */
|
|
320
|
+
[data-smartconsent="banner"] .sc-attribution {
|
|
321
|
+
text-align: center;
|
|
322
|
+
margin-top: 12px;
|
|
323
|
+
padding-top: 12px;
|
|
324
|
+
border-top: 1px solid var(--sc-border);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
[data-smartconsent="banner"] .sc-attribution a {
|
|
328
|
+
color: var(--sc-text-muted);
|
|
329
|
+
font-size: 11px;
|
|
330
|
+
text-decoration: none;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
[data-smartconsent="banner"] .sc-attribution a:hover {
|
|
334
|
+
color: var(--sc-accent);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/* Badge */
|
|
338
|
+
[data-smartconsent="badge"] {
|
|
339
|
+
position: fixed;
|
|
340
|
+
width: 40px;
|
|
341
|
+
height: 40px;
|
|
342
|
+
border-radius: 50%;
|
|
343
|
+
background: var(--sc-accent);
|
|
344
|
+
color: #fff;
|
|
345
|
+
border: none;
|
|
346
|
+
cursor: pointer;
|
|
347
|
+
z-index: 9997;
|
|
348
|
+
display: flex;
|
|
349
|
+
align-items: center;
|
|
350
|
+
justify-content: center;
|
|
351
|
+
font-size: 20px;
|
|
352
|
+
opacity: 0.7;
|
|
353
|
+
transition: opacity 0.2s;
|
|
354
|
+
font-family: var(--sc-font);
|
|
355
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
[data-smartconsent="badge"]:hover {
|
|
359
|
+
opacity: 1;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
[data-smartconsent="badge"]:focus-visible {
|
|
363
|
+
outline: 2px solid var(--sc-accent);
|
|
364
|
+
outline-offset: 2px;
|
|
365
|
+
opacity: 1;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
[data-smartconsent="badge"][data-sc-position="bottom-right"] {
|
|
369
|
+
bottom: 16px;
|
|
370
|
+
right: 16px;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
[data-smartconsent="badge"][data-sc-position="bottom-left"] {
|
|
374
|
+
bottom: 16px;
|
|
375
|
+
left: 16px;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/* Layout: Box (FP-06) */
|
|
379
|
+
[data-smartconsent="banner"][data-sc-layout="box"] {
|
|
380
|
+
bottom: 16px;
|
|
381
|
+
left: 16px;
|
|
382
|
+
right: auto;
|
|
383
|
+
width: 400px;
|
|
384
|
+
max-width: calc(100vw - 32px);
|
|
385
|
+
border-radius: var(--sc-radius);
|
|
386
|
+
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
|
|
387
|
+
animation: sc-fade-in 0.3s ease-out;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
[data-smartconsent="banner"][data-sc-layout="box"][data-sc-box-position="bottom-right"] {
|
|
391
|
+
left: auto;
|
|
392
|
+
right: 16px;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
[data-smartconsent="banner"][data-sc-layout="box"] .sc-compact {
|
|
396
|
+
flex-direction: column;
|
|
397
|
+
align-items: stretch;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/* In a column a flex basis is a height: the text and credit hug their content (BRIEF-280). */
|
|
401
|
+
[data-smartconsent="banner"][data-sc-layout="box"] .sc-compact-text,
|
|
402
|
+
[data-smartconsent="banner"][data-sc-layout="box"] .sc-compact-attribution {
|
|
403
|
+
flex-basis: auto;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
[data-smartconsent="banner"][data-sc-layout="box"] .sc-compact-actions {
|
|
407
|
+
justify-content: stretch;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
[data-smartconsent="banner"][data-sc-layout="box"] .sc-compact-actions .sc-btn {
|
|
411
|
+
flex: 1;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
/* Layout: Popup (FP-06) */
|
|
415
|
+
[data-smartconsent="banner"][data-sc-layout="popup"] {
|
|
416
|
+
bottom: auto;
|
|
417
|
+
left: 50%;
|
|
418
|
+
right: auto;
|
|
419
|
+
top: 50%;
|
|
420
|
+
transform: translate(-50%, -50%);
|
|
421
|
+
width: 520px;
|
|
422
|
+
max-width: calc(100vw - 32px);
|
|
423
|
+
max-height: calc(100vh - 32px);
|
|
424
|
+
overflow-y: auto;
|
|
425
|
+
border-radius: var(--sc-radius);
|
|
426
|
+
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
|
|
427
|
+
animation: sc-fade-in 0.3s ease-out;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
@keyframes sc-fade-in {
|
|
431
|
+
from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
|
|
432
|
+
to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
[data-smartconsent="banner"][data-sc-layout="box"] + [data-smartconsent="backdrop"],
|
|
436
|
+
[data-smartconsent="banner"][data-sc-layout="box"] ~ [data-smartconsent="backdrop"] {
|
|
437
|
+
display: none;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
/* Animations */
|
|
441
|
+
@keyframes sc-slide-up {
|
|
442
|
+
from { transform: translateY(100%); }
|
|
443
|
+
to { transform: translateY(0); }
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
@keyframes sc-slide-down-in {
|
|
447
|
+
from { transform: translateY(-100%); }
|
|
448
|
+
to { transform: translateY(0); }
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
/* Responsive */
|
|
452
|
+
@media (max-width: 480px) {
|
|
453
|
+
[data-smartconsent="banner"] .sc-compact {
|
|
454
|
+
flex-direction: column;
|
|
455
|
+
align-items: stretch;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
[data-smartconsent="banner"] .sc-compact-text,
|
|
459
|
+
[data-smartconsent="banner"] .sc-compact-attribution {
|
|
460
|
+
flex-basis: auto;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
[data-smartconsent="banner"] .sc-compact-actions {
|
|
464
|
+
justify-content: stretch;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
[data-smartconsent="banner"] .sc-compact-attribution {
|
|
468
|
+
text-align: center;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
[data-smartconsent="banner"] .sc-compact-actions .sc-btn {
|
|
472
|
+
flex: 1;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
[data-smartconsent="banner"] .sc-expanded-actions {
|
|
476
|
+
flex-direction: column;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
[data-smartconsent="banner"] .sc-expanded-actions .sc-btn {
|
|
480
|
+
width: 100%;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
/* A full-width strip for every box position: the position attribute matches the bottom-right rule's weight, and
|
|
484
|
+
width: auto with left and right at 0 fits the viewport exactly (the banner itself is not border-box) (BRIEF-280). */
|
|
485
|
+
[data-smartconsent="banner"][data-sc-layout="box"],
|
|
486
|
+
[data-smartconsent="banner"][data-sc-layout="box"][data-sc-box-position] {
|
|
487
|
+
left: 0;
|
|
488
|
+
right: 0;
|
|
489
|
+
bottom: 0;
|
|
490
|
+
width: auto;
|
|
491
|
+
max-width: none;
|
|
492
|
+
border-radius: 0;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
[data-smartconsent="banner"][data-sc-layout="popup"] {
|
|
496
|
+
left: 0;
|
|
497
|
+
right: 0;
|
|
498
|
+
top: auto;
|
|
499
|
+
bottom: 0;
|
|
500
|
+
width: 100%;
|
|
501
|
+
max-width: 100%;
|
|
502
|
+
transform: none;
|
|
503
|
+
border-radius: 0;
|
|
504
|
+
animation: sc-slide-up 0.3s ease-out;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
`}function Rt(t){const e='button:not([disabled]), [href], input:not([disabled]), [tabindex]:not([tabindex="-1"]), [role="switch"]:not([disabled])';function n(){return Array.from(t.querySelectorAll(e))}function o(s){if(s.key!=="Tab")return;const i=n();if(i.length===0)return;const l=i[0],d=i[i.length-1];s.shiftKey?document.activeElement===l&&(s.preventDefault(),d.focus()):document.activeElement===d&&(s.preventDefault(),l.focus())}t.addEventListener("keydown",o);const a=n();return a.length>0&&a[0].focus(),()=>{t.removeEventListener("keydown",o)}}function Pt(t){const e=document.createElement("div");e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.setAttribute("aria-atomic","true"),e.style.position="absolute",e.style.width="1px",e.style.height="1px",e.style.overflow="hidden",e.style.clip="rect(0, 0, 0, 0)",e.style.whiteSpace="nowrap",e.textContent=t,(document.body??document.documentElement).appendChild(e),setTimeout(()=>{e.remove()},1e3)}const be={ar:"مدعوم بواسطة SmartGenie",cs:"Zajišťuje SmartGenie",da:"Drevet af SmartGenie",de:"Bereitgestellt von SmartGenie",es:"Desarrollado por SmartGenie",fr:"Propulsé par SmartGenie",hi:"SmartGenie द्वारा संचालित",it:"Offerto da SmartGenie",ja:"SmartGenie提供",ko:"SmartGenie 제공",nl:"Mogelijk gemaakt door SmartGenie",no:"Drevet av SmartGenie",pl:"Dostarczone przez SmartGenie",pt:"Fornecido por SmartGenie",ro:"Furnizat de SmartGenie",ru:"Работает на SmartGenie",sv:"Drivs av SmartGenie",tr:"SmartGenie tarafından desteklenmektedir",zh:"由 SmartGenie 提供支持"},Lt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);function _e(t){if(typeof t!="string")return null;try{const{protocol:e}=new URL(t);return e==="http:"||e==="https:"?t:null}catch{return null}}const J="sponsored nofollow noopener";function re(t){const e=_e(t.attributionUrl);return e&&t.attributionRef?`https://www.smartgenie.co.uk/r/${encodeURIComponent(t.attributionRef)}`:e}function Z(t,e){const n=t.texts[e],o=K[e];if(e==="policyCredit")return n===o?n:o;if(n===o||Object.values(be).includes(n))return n;const s=(t.language||(typeof navigator<"u"?navigator.language:"")||"en").split("-")[0].toLowerCase();return Lt(be,s)?be[s]:o}const It=[".sc-compact-attribution",".sc-attribution"],Tt=5,Nt=1e3,Bt=[["display",t=>t==="none"],["visibility",t=>t==="hidden"],["opacity",t=>t!==""&&parseFloat(t)===0]];function ye(t){return Bt.filter(([e,n])=>n(t.style.getPropertyValue(e))).map(([e])=>e)}function Ge(t,e){if(!e.attribution)return()=>{};const n=[];for(const g of It){const f=t.querySelector(g),_=f==null?void 0:f.querySelector("a"),u=f==null?void 0:f.parentElement;f&&_&&u&&n.push({container:f,parent:u,link:_})}if(n.length===0)return()=>{};const o=Z(e,"poweredBy"),a=re(e),s=({container:g,parent:f,link:_})=>_.parentElement!==g||g.parentElement!==f||_.getAttribute("href")!==a||J.split(" ").some(u=>!_.relList.contains(u))||_.textContent!==o||ye(_).length>0||ye(g).length>0,i=({container:g,parent:f,link:_})=>{g.parentElement!==f&&f.appendChild(g),_.parentElement!==g&&g.appendChild(_),_.getAttribute("href")!==a&&(a===null?_.removeAttribute("href"):_.setAttribute("href",a)),_.relList.add(...J.split(" ")),_.textContent!==o&&(_.textContent=o);for(const u of[_,g])for(const m of ye(u))u.style.removeProperty(m)};let l=0,d=0;const h=new MutationObserver(()=>{const g=n.filter(s);if(g.length===0)return;const f=Date.now();if(f-d>=Nt&&(d=f,l=0),l>=Tt){h.disconnect(),console.warn("SmartConsent: attribution link keeps being removed; guard stopped.");return}l++,g.forEach(i)});return h.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["href","rel","style"],characterData:!0}),()=>h.disconnect()}function ze(t,e){if(!e.dataRequestUrl)return;t.firstChild&&t.appendChild(document.createTextNode(" · "));const n=document.createElement("a");n.className="sc-data-rights",n.href=e.dataRequestUrl,n.target="_blank",n.rel="noopener",n.textContent=e.texts.dataRequest,t.appendChild(n)}function X(t,e){let n=null,o=null,a=null,s=null,i=null;const l=!!e.language&&e.language!=="en",d=l?e.texts.heading:"Cookie consent";function h(){return document.body??document.documentElement}function g(){t.rejectOptional(),u.hide()}function f(){const m=document.createElement("div");m.setAttribute("data-smartconsent","banner"),m.setAttribute("role","dialog"),m.setAttribute("aria-modal","true"),m.setAttribute("aria-label",d),l&&m.setAttribute("lang",e.language),e.position==="top"&&m.setAttribute("data-sc-position","top"),e.dir==="rtl"&&m.setAttribute("dir","rtl"),e.layout!=="banner"&&m.setAttribute("data-sc-layout",e.layout),e.layout==="box"&&m.setAttribute("data-sc-box-position",e.boxPosition);const N=document.createElement("div");N.className="sc-accent-line",m.appendChild(N);const S=document.createElement("div");S.className="sc-inner";const x=document.createElement("div");x.className="sc-compact";const A=document.createElement("div");A.className="sc-compact-text",A.textContent=e.texts.description,x.appendChild(A);const z=document.createElement("div");z.className="sc-compact-actions";const ee=_(e.texts.rejectOptional,"sc-btn sc-btn-reject",()=>{g()});z.appendChild(ee);const L=_(e.texts.acceptAll,"sc-btn sc-btn-accept",()=>{t.acceptAll(),u.hide()});z.appendChild(L);const q=document.createElement("button");if(q.className="sc-link",q.textContent=e.texts.managePreferences,q.type="button",q.addEventListener("click",()=>{x.classList.add("sc-hidden"),$.classList.add("sc-active")}),z.appendChild(q),x.appendChild(z),e.attribution){const r=document.createElement("div");r.className="sc-compact-attribution";const c=document.createElement("a"),p=re(e);p&&(c.href=p),c.target="_blank",c.rel=J,c.textContent=Z(e,"poweredBy"),r.appendChild(c),x.appendChild(r)}S.appendChild(x);const $=document.createElement("div");if($.className="sc-expanded",e.logo){const r=document.createElement("div");r.className="sc-header";const c=document.createElement("img");c.src=e.logo.src,c.alt=e.logo.alt,c.className="sc-logo",e.logo.width&&(c.width=e.logo.width),e.logo.height&&(c.height=e.logo.height),c.style.maxHeight="48px",r.appendChild(c);const p=document.createElement("h2");p.className="sc-heading",p.textContent=e.texts.heading,r.appendChild(p),$.appendChild(r)}else{const r=document.createElement("h2");r.className="sc-heading",r.textContent=e.texts.heading,$.appendChild(r)}const M=document.createElement("p");M.className="sc-description",M.textContent=e.texts.description,$.appendChild(M);const I=t.getState(),E={},R=document.createElement("div");R.className="sc-categories";for(const r of e.categories){E[r.id]=r.required?!0:(I==null?void 0:I.categories[r.id])??!1;const c=document.createElement("div");c.className="sc-category";const p=document.createElement("div");p.className="sc-category-info";const b=document.createElement("div");b.className="sc-category-label",b.textContent=r.label,p.appendChild(b);const C=document.createElement("div");C.className="sc-category-desc",C.textContent=r.description,p.appendChild(C),c.appendChild(p);const w=document.createElement("button");w.className="sc-toggle",w.type="button",w.setAttribute("role","switch"),w.setAttribute("aria-checked",String(E[r.id])),w.setAttribute("aria-label",r.label),r.required?w.disabled=!0:w.addEventListener("click",()=>{const k=w.getAttribute("aria-checked")==="true";w.setAttribute("aria-checked",String(!k)),E[r.id]=!k}),c.appendChild(w),R.appendChild(c)}$.appendChild(R);const T=document.createElement("div");T.className="sc-expanded-actions";const v=_(e.texts.essentialOnly,"sc-btn sc-btn-essential",()=>{g()});T.appendChild(v);const O=_(e.texts.savePreferences,"sc-btn sc-btn-save",()=>{t.saveCustom(E),u.hide()});T.appendChild(O);const B=_(e.texts.acceptAll,"sc-btn sc-btn-accept",()=>{t.acceptAll(),u.hide()});if(T.appendChild(B),$.appendChild(T),e.attribution||e.dataRequestUrl){const r=document.createElement("div");if(r.className="sc-attribution",e.attribution){const c=document.createElement("a"),p=re(e);p&&(c.href=p),c.target="_blank",c.rel=J,c.textContent=Z(e,"poweredBy"),r.appendChild(c)}ze(r,e),$.appendChild(r)}return S.appendChild($),m.appendChild(S),m}function _(m,N,S){const x=document.createElement("button");return x.type="button",x.className=N,x.textContent=m,x.addEventListener("click",S),x}const u={show(){n||(e.layout!=="box"&&(o=document.createElement("div"),o.setAttribute("data-smartconsent","backdrop"),o.addEventListener("click",g),h().appendChild(o)),n=f(),h().appendChild(n),i=Ge(n,e),a=Rt(n),s=m=>{m.key==="Escape"&&g()},document.addEventListener("keydown",s),Pt(d))},hide(){i&&(i(),i=null),a&&(a(),a=null),s&&(document.removeEventListener("keydown",s),s=null),n&&(n.remove(),n=null),o&&(o.remove(),o=null)},destroy(){u.hide()}};return u}function Dt(t,e,n){let o=null,a=()=>{};const s=e.texts,i=(h,g,f)=>{const _=document.createElement(h);return _.className=g,f&&(_.textContent=f),_},l=(h,g)=>{const f=i("button","sc-link",h);return f.type="button",f.addEventListener("click",()=>{d.hide(),g()}),f},d={show(){if(o)return;o=document.createElement("div"),o.setAttribute("data-smartconsent","banner"),o.setAttribute("data-sc-notice",""),o.setAttribute("role","region"),o.setAttribute("aria-label",s.heading),e.position==="top"&&o.setAttribute("data-sc-position","top"),e.dir==="rtl"&&o.setAttribute("dir","rtl");const h=i("div","sc-compact");h.appendChild(i("div","sc-compact-text",s.description));const g=i("div","sc-compact-actions");if(g.appendChild(l(s.doNotSell,()=>t.rejectOptional())),g.appendChild(l(s.cookieSettings,n)),h.appendChild(g),e.attribution||e.dataRequestUrl){const _=i("div","sc-compact-attribution");if(e.attribution){const u=i("a","",Z(e,"poweredBy")),m=re(e);m&&(u.href=m),u.target="_blank",u.rel=J,_.appendChild(u)}ze(_,e),h.appendChild(_)}const f=i("div","sc-inner");f.appendChild(h),o.appendChild(f),(document.body??document.documentElement).appendChild(o),a=Ge(o,e)},hide(){a(),o==null||o.remove(),o=null}};return d}function Mt(t,e){let n=null;function o(){return document.body??document.documentElement}function a(){const i=document.createElement("button");return i.setAttribute("data-smartconsent","badge"),i.setAttribute("data-sc-position",t.badgePosition),i.setAttribute("aria-label","Cookie preferences"),i.type="button",i.innerHTML='<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><circle cx="8" cy="9" r="1" fill="currentColor"/><circle cx="15" cy="11" r="1" fill="currentColor"/><circle cx="10" cy="15" r="1" fill="currentColor"/></svg>',i.addEventListener("click",e),i}return{show(){if(t.showBadge){if(n){n.style.display="flex";return}n=a(),o().appendChild(n)}},hide(){n&&(n.style.display="none")},destroy(){n&&(n.remove(),n=null)}}}function Ot(t){if(t==null||typeof t!="object")throw new Error("Regulation: data must be an object");const e=t;if(!e.id||typeof e.id!="string")throw new Error('Regulation: missing or invalid "id" (must be a non-empty string)');if(!e.name||typeof e.name!="string")throw new Error(`Regulation [${e.id}]: missing or invalid "name"`);if(e.consent_model!=="opt-in"&&e.consent_model!=="opt-out")throw new Error(`Regulation [${e.id}]: "consent_model" must be "opt-in" or "opt-out", got "${String(e.consent_model)}"`);if(e.default_cookie_state!=="blocked"&&e.default_cookie_state!=="allowed")throw new Error(`Regulation [${e.id}]: "default_cookie_state" must be "blocked" or "allowed"`);if(!e.jurisdiction||typeof e.jurisdiction!="object")throw new Error(`Regulation [${e.id}]: missing "jurisdiction" object`);const n=e.jurisdiction;if(!Array.isArray(n.countries))throw new Error(`Regulation [${e.id}]: "jurisdiction.countries" must be an array`);if(!e.banner_requirements||typeof e.banner_requirements!="object")throw new Error(`Regulation [${e.id}]: missing "banner_requirements" object`);if(!e.consent_rules||typeof e.consent_rules!="object")throw new Error(`Regulation [${e.id}]: missing "consent_rules" object`);if(!e.language||typeof e.language!="object")throw new Error(`Regulation [${e.id}]: missing "language" object`);if(!e.signals||typeof e.signals!="object")throw new Error(`Regulation [${e.id}]: missing "signals" object`);if(!e.children||typeof e.children!="object")throw new Error(`Regulation [${e.id}]: missing "children" object`);if(!e.audit||typeof e.audit!="object")throw new Error(`Regulation [${e.id}]: missing "audit" object`);return t}const Ut=[{id:"uk-gdpr-pecr",name:"UK GDPR & PECR",consent_model:"opt-in",default_cookie_state:"blocked",version:"1.0",last_updated:"2026-03-01",sources:["https://ico.org.uk/for-organisations/guide-to-pecr/cookies-and-similar-technologies/","https://ico.org.uk/for-organisations/uk-gdpr-guidance-and-resources/"],jurisdiction:{countries:["GB"],states:null},banner_requirements:{require_accept_button:!0,require_reject_button:!0,require_equal_prominence:!0,require_customise_button:!0,cookie_wall_permitted:!1,require_granular_categories:!0},consent_rules:{expiry_days:395,withdrawal_mechanism:"persistent badge",withdrawal_ease:"as easy as giving consent",re_consent_on_policy_change:!0},language:{mandatory_languages:["en"],auto_detect_browser_language:!1},signals:{honour_gpc:!0,honour_dnt:!0},children:{age_threshold:13,tracking_prohibited:!1,parental_consent_required:!0},audit:{consent_log_required:!0,retention_years:6,proof_of_consent_required:!0}},{id:"eu-gdpr-eprivacy",name:"EU GDPR & ePrivacy Directive",consent_model:"opt-in",default_cookie_state:"blocked",version:"1.0",last_updated:"2026-03-01",sources:["https://eur-lex.europa.eu/eli/reg/2016/679/oj","https://eur-lex.europa.eu/eli/dir/2002/58/oj"],jurisdiction:{countries:["AT","BE","BG","HR","CY","CZ","DK","EE","FI","FR","DE","GR","HU","IE","IT","LV","LT","LU","MT","NL","PL","PT","RO","SK","SI","ES","SE","IS","LI","NO"],states:null},banner_requirements:{require_accept_button:!0,require_reject_button:!0,require_equal_prominence:!0,require_customise_button:!0,cookie_wall_permitted:!1,require_granular_categories:!0},consent_rules:{expiry_days:365,withdrawal_mechanism:"persistent badge",withdrawal_ease:"as easy as giving consent",re_consent_on_policy_change:!0},language:{mandatory_languages:["en"],auto_detect_browser_language:!0},signals:{honour_gpc:!0,honour_dnt:!0},children:{age_threshold:16,tracking_prohibited:!1,parental_consent_required:!0},audit:{consent_log_required:!0,retention_years:5,proof_of_consent_required:!0}},{id:"dpdp-india",name:"Digital Personal Data Protection Act (India)",consent_model:"opt-in",default_cookie_state:"blocked",version:"1.0",last_updated:"2026-03-01",sources:["https://www.meity.gov.in/content/digital-personal-data-protection-act-2023"],jurisdiction:{countries:["IN"],states:null},banner_requirements:{require_accept_button:!0,require_reject_button:!0,require_equal_prominence:!0,require_customise_button:!0,cookie_wall_permitted:!1,require_granular_categories:!0},consent_rules:{expiry_days:365,withdrawal_mechanism:"persistent badge",withdrawal_ease:"as easy as giving consent",re_consent_on_policy_change:!0},language:{mandatory_languages:["en","hi","bn","te","mr","ta","ur","gu","kn","ml","or","pa","as","mai","sa","ne","sd","kok","doi","mni","sat","ks","bo"],auto_detect_browser_language:!0},signals:{honour_gpc:!0,honour_dnt:!0},children:{age_threshold:18,tracking_prohibited:!0,parental_consent_required:!0},audit:{consent_log_required:!0,retention_years:null,proof_of_consent_required:!0}},{id:"lgpd-brazil",name:"Lei Geral de Proteção de Dados (Brazil)",consent_model:"opt-in",default_cookie_state:"blocked",version:"1.0",last_updated:"2026-03-01",sources:["https://www.planalto.gov.br/ccivil_03/_ato2015-2018/2018/lei/l13709.htm"],jurisdiction:{countries:["BR"],states:null},banner_requirements:{require_accept_button:!0,require_reject_button:!0,require_equal_prominence:!0,require_customise_button:!0,cookie_wall_permitted:!1,require_granular_categories:!0},consent_rules:{expiry_days:365,withdrawal_mechanism:"persistent badge",withdrawal_ease:"as easy as giving consent",re_consent_on_policy_change:!0},language:{mandatory_languages:["pt"],auto_detect_browser_language:!1},signals:{honour_gpc:!0,honour_dnt:!0},children:{age_threshold:12,tracking_prohibited:!1,parental_consent_required:!0},audit:{consent_log_required:!0,retention_years:null,proof_of_consent_required:!0}},{id:"popia-south-africa",name:"Protection of Personal Information Act (South Africa)",consent_model:"opt-in",default_cookie_state:"blocked",version:"1.0",last_updated:"2026-03-01",sources:["https://popia.co.za/"],jurisdiction:{countries:["ZA"],states:null},banner_requirements:{require_accept_button:!0,require_reject_button:!0,require_equal_prominence:!0,require_customise_button:!0,cookie_wall_permitted:!1,require_granular_categories:!0},consent_rules:{expiry_days:365,withdrawal_mechanism:"persistent badge",withdrawal_ease:"as easy as giving consent",re_consent_on_policy_change:!0},language:{mandatory_languages:["en"],auto_detect_browser_language:!1},signals:{honour_gpc:!0,honour_dnt:!0},children:{age_threshold:18,tracking_prohibited:!1,parental_consent_required:!0},audit:{consent_log_required:!0,retention_years:null,proof_of_consent_required:!0}},{id:"pipeda-canada",name:"PIPEDA & Quebec Law 25 (Canada)",consent_model:"opt-in",default_cookie_state:"blocked",version:"1.0",last_updated:"2026-03-01",sources:["https://www.priv.gc.ca/en/privacy-topics/privacy-laws-in-canada/the-personal-information-protection-and-electronic-documents-act-pipeda/"],jurisdiction:{countries:["CA"],states:null},banner_requirements:{require_accept_button:!0,require_reject_button:!0,require_equal_prominence:!0,require_customise_button:!0,cookie_wall_permitted:!1,require_granular_categories:!0},consent_rules:{expiry_days:365,withdrawal_mechanism:"persistent badge",withdrawal_ease:"as easy as giving consent",re_consent_on_policy_change:!0},language:{mandatory_languages:["en","fr"],auto_detect_browser_language:!0},signals:{honour_gpc:!0,honour_dnt:!0},children:{age_threshold:13,tracking_prohibited:!1,parental_consent_required:!0},audit:{consent_log_required:!0,retention_years:null,proof_of_consent_required:!0}},{id:"pdpa-singapore",name:"Personal Data Protection Act (Singapore)",consent_model:"opt-in",default_cookie_state:"blocked",version:"1.0",last_updated:"2026-03-01",sources:["https://www.pdpc.gov.sg/overview-of-pdpa/the-legislation/personal-data-protection-act"],jurisdiction:{countries:["SG"],states:null},banner_requirements:{require_accept_button:!0,require_reject_button:!0,require_equal_prominence:!1,require_customise_button:!1,cookie_wall_permitted:!1,require_granular_categories:!1},consent_rules:{expiry_days:365,withdrawal_mechanism:"persistent badge",withdrawal_ease:"reasonable effort",re_consent_on_policy_change:!0},language:{mandatory_languages:["en"],auto_detect_browser_language:!1},signals:{honour_gpc:!0,honour_dnt:!0},children:{age_threshold:13,tracking_prohibited:!1,parental_consent_required:!0},audit:{consent_log_required:!0,retention_years:null,proof_of_consent_required:!1}},{id:"pdpa-thailand",name:"Personal Data Protection Act (Thailand)",consent_model:"opt-in",default_cookie_state:"blocked",version:"1.0",last_updated:"2026-03-01",sources:["https://thaipdpa.com/"],jurisdiction:{countries:["TH"],states:null},banner_requirements:{require_accept_button:!0,require_reject_button:!0,require_equal_prominence:!0,require_customise_button:!0,cookie_wall_permitted:!1,require_granular_categories:!0},consent_rules:{expiry_days:365,withdrawal_mechanism:"persistent badge",withdrawal_ease:"as easy as giving consent",re_consent_on_policy_change:!0},language:{mandatory_languages:["th","en"],auto_detect_browser_language:!0},signals:{honour_gpc:!0,honour_dnt:!0},children:{age_threshold:10,tracking_prohibited:!1,parental_consent_required:!0},audit:{consent_log_required:!0,retention_years:null,proof_of_consent_required:!0}},{id:"ccpa-cpra",name:"CCPA / CPRA (California)",consent_model:"opt-out",default_cookie_state:"allowed",version:"1.0",last_updated:"2026-03-01",sources:["https://oag.ca.gov/privacy/ccpa","https://cppa.ca.gov/"],jurisdiction:{countries:["US"],states:["CA"]},banner_requirements:{require_accept_button:!1,require_reject_button:!0,require_equal_prominence:!1,require_customise_button:!0,cookie_wall_permitted:!1,require_granular_categories:!0},consent_rules:{expiry_days:365,withdrawal_mechanism:"do not sell link",withdrawal_ease:"clear and conspicuous link",re_consent_on_policy_change:!1},language:{mandatory_languages:["en"],auto_detect_browser_language:!1},signals:{honour_gpc:!0,honour_dnt:!0},children:{age_threshold:16,tracking_prohibited:!1,parental_consent_required:!0},audit:{consent_log_required:!0,retention_years:2,proof_of_consent_required:!1}},{id:"us-state-general",name:"US State Privacy Laws (General)",consent_model:"opt-out",default_cookie_state:"allowed",version:"1.0",last_updated:"2026-03-01",sources:["https://iapp.org/resources/article/us-state-privacy-legislation-tracker/"],jurisdiction:{countries:["US"],states:["CO","CT","VA","UT","TX","OR","MT","DE","IA","NH","NJ","TN","IN","KY","NE","MD","MN"]},banner_requirements:{require_accept_button:!1,require_reject_button:!0,require_equal_prominence:!1,require_customise_button:!0,cookie_wall_permitted:!1,require_granular_categories:!1},consent_rules:{expiry_days:365,withdrawal_mechanism:"opt-out link",withdrawal_ease:"clear mechanism",re_consent_on_policy_change:!1},language:{mandatory_languages:["en"],auto_detect_browser_language:!1},signals:{honour_gpc:!0,honour_dnt:!0},children:{age_threshold:13,tracking_prohibited:!1,parental_consent_required:!0},audit:{consent_log_required:!1,retention_years:null,proof_of_consent_required:!1}},{id:"default-global",name:"Default Global (GDPR-equivalent)",consent_model:"opt-in",default_cookie_state:"blocked",version:"1.0",last_updated:"2026-03-01",sources:[],jurisdiction:{countries:[],states:null},banner_requirements:{require_accept_button:!0,require_reject_button:!0,require_equal_prominence:!0,require_customise_button:!0,cookie_wall_permitted:!1,require_granular_categories:!0},consent_rules:{expiry_days:365,withdrawal_mechanism:"persistent badge",withdrawal_ease:"as easy as giving consent",re_consent_on_policy_change:!0},language:{mandatory_languages:["en"],auto_detect_browser_language:!0},signals:{honour_gpc:!0,honour_dnt:!0},children:{age_threshold:16,tracking_prohibited:!1,parental_consent_required:!0},audit:{consent_log_required:!0,retention_years:null,proof_of_consent_required:!0}}];function Gt(){const t=[];for(const e of Ut)try{t.push(Ot(e))}catch(n){console.warn("SmartConsent: Skipping invalid regulation file.",n instanceof Error?n.message:n)}return t}function zt(t,e){let n=e.filter(o=>o.jurisdiction.countries.length===0||!o.jurisdiction.countries.includes(t.country)?!1:o.jurisdiction.states&&o.jurisdiction.states.length>0&&t.state?o.jurisdiction.states.includes(t.state):!(o.jurisdiction.states&&o.jurisdiction.states.length>0&&!t.state));if(n.length===0){const o=e.find(a=>a.id==="default-global");o&&(n=[o])}return Ft(n)}function Ft(t){let e="opt-out",n=!1,o=!1,a=!1,s=!1,i=!0,l=1/0,d=!1,h="opt-out link",g=!1;const f=[],_=[];for(const m of t)f.push(m.name),_.push(m.id),m.consent_model==="opt-in"&&(e="opt-in"),m.banner_requirements.require_accept_button&&(n=!0),m.banner_requirements.require_reject_button&&(o=!0),m.banner_requirements.require_customise_button&&(a=!0),m.banner_requirements.require_equal_prominence&&(s=!0),m.banner_requirements.cookie_wall_permitted||(i=!1),m.consent_rules.expiry_days<l&&(l=m.consent_rules.expiry_days),m.signals.honour_gpc&&(d=!0),m.consent_rules.withdrawal_mechanism==="persistent badge"&&(h="persistent badge"),m.consent_rules.re_consent_on_policy_change&&(g=!0);l===1/0&&(l=365);const u=[...te];return{mode:e,buttons:{accept_all:n,reject_all:o,customise:a,equal_prominence:s},categories:u,blocking:{mode:"block-first",unknown_scripts:e==="opt-in"?"blocked":"allowed"},consent:{expiry_days:l,withdrawal_mechanism:h,re_consent_on_version_change:g},signals:{gpc_auto_reject:d},cookie_wall:i,language:"en",applicable_regulations:f,regulation_ids:_}}const Fe={zones:{"Africa/Ceuta":"ES","Africa/Johannesburg":"ZA","America/Araguaina":"BR","America/Atikokan":"CA","America/Bahia":"BR","America/Belem":"BR","America/Blanc-Sablon":"CA","America/Boa_Vista":"BR","America/Boise":"US-VA","America/Cambridge_Bay":"CA","America/Campo_Grande":"BR","America/Chicago":"US-VA","America/Coral_Harbour":"CA","America/Creston":"CA","America/Cuiaba":"BR","America/Dawson":"CA","America/Dawson_Creek":"CA","America/Denver":"US-VA","America/Detroit":"US-VA","America/Edmonton":"CA","America/Eirunepe":"BR","America/Fort_Nelson":"CA","America/Fortaleza":"BR","America/Glace_Bay":"CA","America/Goose_Bay":"CA","America/Halifax":"CA","America/Indiana/Indianapolis":"US-VA","America/Indianapolis":"US-VA","America/Inuvik":"CA","America/Iqaluit":"CA","America/Kentucky/Louisville":"US-VA","America/Los_Angeles":"US-CA","America/Louisville":"US-VA","America/Maceio":"BR","America/Manaus":"BR","America/Moncton":"CA","America/New_York":"US-VA","America/Noronha":"BR","America/Porto_Velho":"BR","America/Rankin_Inlet":"CA","America/Recife":"BR","America/Regina":"CA","America/Rio_Branco":"BR","America/Santarem":"BR","America/Sao_Paulo":"BR","America/St_Johns":"CA","America/Swift_Current":"CA","America/Toronto":"CA","America/Vancouver":"CA","America/Whitehorse":"CA","America/Winnipeg":"CA","America/Yellowknife":"CA","Asia/Bangkok":"TH","Asia/Calcutta":"IN","Asia/Kolkata":"IN","Asia/Nicosia":"CY","Asia/Singapore":"SG","Atlantic/Azores":"PT","Atlantic/Canary":"ES","Atlantic/Madeira":"PT","Atlantic/Reykjavik":"IS","Europe/Amsterdam":"NL","Europe/Athens":"GR","Europe/Belfast":"GB","Europe/Berlin":"DE","Europe/Bratislava":"SK","Europe/Brussels":"BE","Europe/Bucharest":"RO","Europe/Budapest":"HU","Europe/Busingen":"DE","Europe/Copenhagen":"DK","Europe/Dublin":"IE","Europe/Helsinki":"FI","Europe/Lisbon":"PT","Europe/Ljubljana":"SI","Europe/London":"GB","Europe/Luxembourg":"LU","Europe/Madrid":"ES","Europe/Malta":"MT","Europe/Nicosia":"CY","Europe/Oslo":"NO","Europe/Paris":"FR","Europe/Prague":"CZ","Europe/Riga":"LV","Europe/Rome":"IT","Europe/Sofia":"BG","Europe/Stockholm":"SE","Europe/Tallinn":"EE","Europe/Vaduz":"LI","Europe/Vienna":"AT","Europe/Vilnius":"LT","Europe/Warsaw":"PL","Europe/Zagreb":"HR"},shared:{"Europe/London":["JE","GG","IM"],"Europe/Paris":["MC"],"Europe/Rome":["SM","VA"],"Asia/Bangkok":["KH","LA","VN"]}},He="smartconsent_geo",Ht=24*60*60*1e3,we="ZZ",Vt=Fe.zones,Wt=Fe.shared;function Kt(){try{const t=sessionStorage.getItem(He);if(!t)return null;const e=JSON.parse(t);return Date.now()-e.timestamp>Ht?null:{country:e.country,state:e.state,source:"cache"}}catch{return null}}function Yt(t,e){try{const n={country:t,state:e,timestamp:Date.now()};sessionStorage.setItem(He,JSON.stringify(n))}catch{}}function Jt(){try{return new Intl.DateTimeFormat().resolvedOptions().timeZone||null}catch{return null}}function Zt(){try{const t=/^[A-Za-z]{2,3}-(?:[A-Za-z]{4}-)?([A-Za-z]{2})\b/.exec(navigator.language||"");return t?t[1].toUpperCase():""}catch{return""}}async function Xt(){var s;const t=Kt();if(t)return t;const e=Jt();if(!e)return{country:we,source:"fallback"};const n=Vt[e];if(!n)return{country:we,source:"timezone"};if((s=Wt[e])!=null&&s.includes(Zt()))return{country:we,source:"timezone"};const[o,a]=n.split("-");return Yt(o,a),{country:o,state:a,source:"timezone"}}const ae={};function Ve(t){ae[t.lang]=t}function Qt(t){return ae[t]??ae[t.split("-")[0]]??null}function ve(t){const e=t.split("-")[0];return e==="en"||e in ae}function en(){const t={};for(const e of te)t[e.id]={label:e.label,description:e.description};return{lang:"en",dir:"ltr",texts:{...K},categories:t}}function tn(t){return t.split("-")[0]==="en"?en():Qt(t)}function nn(t){if(t){const o=t.split("-")[0];if(o==="en"||ve(t))return o}const n=(typeof navigator<"u"&&navigator.language||"en").split("-")[0];return n==="en"||ve(n)?n:"en"}const on=["ar","cs","da","de","es","fr","hi","it","ja","ko","nl","no","pl","pt","ro","ru","sv","tr","zh"],rn=1500,an="smartconsent_lang_",Q=t=>typeof t=="string"?t.split("-")[0].toLowerCase():"",We=t=>on.includes(t),Ke=t=>t==="en"||We(t);function sn(){const t=document.currentScript&&document.currentScript.src;if(t&&/^https?:\/\//.test(t)){const e=t.split(/[?#]/)[0];return e.slice(0,e.lastIndexOf("/")+1)}return mt}function cn(t){const e=t.settings.banner,n=Q(e==null?void 0:e.language),o=()=>{for(const s of[n,Q(t.pageLanguage),Q(t.htmlLang)])if(Ke(s))return s;return"en"},a=Q(t.browserLang);return Array.isArray(e==null?void 0:e.languages)?[n,...e.languages.map(Q)].filter(Ke).includes(a)?a:o():We(a)?a:o()}const se=t=>typeof t=="string",ln=["heading","description","acceptAll","rejectOptional","managePreferences","essentialOnly","savePreferences","poweredBy"];function Ye(t,e){const n=e;if(!n||typeof n!="object"||n.lang!==t||n.dir!=="ltr"&&n.dir!=="rtl")return null;const o=n.texts,a=n.categories;if(!o||typeof o!="object"||Array.isArray(o)||!a||typeof a!="object"||Array.isArray(a))return null;const s={};for(const l of ln){if(!se(o[l]))return null;s[l]=o[l]}for(const l of["doNotSell","cookieSettings","embedNotice","embedLoad","dataRequest"])se(o[l])&&(s[l]=o[l]);const i={};for(const{id:l}of te){const d=a[l];if(!d||!se(d.label)||!se(d.description))return null;i[l]={label:d.label,description:d.description}}return{lang:t,dir:n.dir,texts:s,categories:i}}async function un(t,e){const n=`${e}lang/${t}.json`,o=an+n;try{const d=Ye(t,JSON.parse(sessionStorage.getItem(o)||"null"));if(d)return Ve(d),!0}catch{}const a=new AbortController;let s;const i=new Promise(d=>{s=setTimeout(()=>{a.abort(),d(null)},rn)}),l=(async()=>{try{const d=await fetch(n,{signal:a.signal,credentials:"omit"});if(!d.ok)return null;const h=Ye(t,await d.json());if(h)try{sessionStorage.setItem(o,JSON.stringify(h))}catch{}return h}catch{return null}})();try{const d=await Promise.race([l,i]);return d?(Ve(d),!0):!1}finally{clearTimeout(s)}}const Je=new WeakSet;function dn(t){return Je.add(t),t}function xe(t){const e=t.cookies;if(e.length===0)return'<p class="sc-table-empty">No cookies declared.</p>';const n=mn(e,t);let o='<div class="sc-cookie-table-wrap">';for(const[a,s]of n){o+=`<h3 class="sc-table-category">${H(a)}</h3>`,o+='<table class="sc-cookie-table"><thead><tr>',o+='<th scope="col">Cookie</th>',o+='<th scope="col">Duration</th>',o+='<th scope="col">Description</th>',o+='<th scope="col">Type</th>',o+="</tr></thead><tbody>";for(const i of s){o+="<tr>",o+=`<td>${H(i.name)}${i.domain?` <small>(${H(i.domain)})</small>`:""}</td>`;const l=Je.has(i);o+=`<td>${H(i.duration??(l?"":"Session"))}</td>`,o+=`<td>${H(i.description??"")}</td>`,o+=`<td>${H(i.party==="third"?"Third party":i.party||!l?"First party":"")}</td>`,o+="</tr>"}o+="</tbody></table>"}return o+="</div>",o}function pn(t,e){const n=document.querySelector(t);if(!n){console.warn(`SmartConsent: Cookie table target "${t}" not found.`);return}n.innerHTML=xe(e)}function mn(t,e){const n=new Map;for(const s of t){const i=s.category;n.has(i)||n.set(i,[]),n.get(i).push(s)}const o={};for(const s of e.categories)o[s.id]=s.label;const a=[];for(const[s,i]of n)a.push([o[s]??s,i]);return a}function H(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Ze(t,e){const{siteName:n,siteUrl:o,contactEmail:a}=e,s=new Date().toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),i=t.categories.map(u=>`<li><strong>${G(u.label)}</strong>: ${G(u.description)}</li>`).join(`
|
|
508
|
+
`),l=t.cookies.length>0?xe(t):"<p>No specific cookies have been declared for this site.</p>",d=G(Z(t,"policyCredit")),h=_e(t.attributionUrl),g=t.attribution?`
|
|
509
|
+
<p class="sc-policy-credit">${h?`<a href="${G(h)}">${d}</a>`:d}</p>`:"",f=G(o),_=_e(o)?`<a href="${f}">${f}</a>`:f;return`<div class="sc-cookie-policy">
|
|
510
|
+
<h1>Cookie Policy</h1>
|
|
511
|
+
<p><em>Last updated: ${s}</em></p>
|
|
512
|
+
|
|
513
|
+
<h2>What are cookies?</h2>
|
|
514
|
+
<p>Cookies are small text files placed on your device when you visit a website. They are widely used to make websites work efficiently and to provide information to site owners.</p>
|
|
515
|
+
|
|
516
|
+
<h2>How ${G(n)} uses cookies</h2>
|
|
517
|
+
<p>We use cookies on ${_} for the following purposes:</p>
|
|
518
|
+
<ul>
|
|
519
|
+
${i}
|
|
520
|
+
</ul>
|
|
521
|
+
|
|
522
|
+
<h2>Cookies we use</h2>
|
|
523
|
+
${l}
|
|
524
|
+
|
|
525
|
+
<h2>Managing your preferences</h2>
|
|
526
|
+
<p>You can change your cookie preferences at any time by clicking the cookie settings icon on our website, or by clearing cookies in your browser settings.</p>
|
|
527
|
+
|
|
528
|
+
<h2>Contact</h2>
|
|
529
|
+
<p>If you have questions about our use of cookies, please contact us at <a href="mailto:${G(a)}">${G(a)}</a>.</p>
|
|
530
|
+
|
|
531
|
+
<hr>
|
|
532
|
+
<p class="sc-policy-disclaimer"><strong>Disclaimer:</strong> This cookie policy is a template generated by SmartConsent. It is not legal advice. Please consult a legal professional to ensure compliance with applicable regulations.</p>${g}
|
|
533
|
+
</div>`}function gn(t,e,n){const o=document.querySelector(t);if(!o){console.warn(`SmartConsent: Cookie policy target "${t}" not found.`);return}o.innerHTML=Ze(e,n)}function G(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function fn(t){if(t.length===0)return{totalActions:0,acceptAllRate:0,rejectAllRate:0,customRate:0,categoryBreakdown:{},lastUpdated:new Date().toISOString()};let e=0,n=0,o=0;const a={};for(const i of t){i.action==="accept_all"?e++:i.action==="reject_optional"?n++:i.action==="custom"&&o++;for(const[l,d]of Object.entries(i.categories))a[l]||(a[l]={accepted:0,rejected:0}),d?a[l].accepted++:a[l].rejected++}const s=t.length;return{totalActions:s,acceptAllRate:Math.round(e/s*100),rejectAllRate:Math.round(n/s*100),customRate:Math.round(o/s*100),categoryBreakdown:a,lastUpdated:t[t.length-1].timestamp}}const hn=/^[A-Za-z0-9_-]{1,64}$/,bn=1500,_n="smartconsent_site3_",Xe="smartconsent_site2_",Qe=t=>typeof t=="string"&&hn.test(t)?t:null;function yn(t){const e=t&&typeof t=="object"?t.siteId:void 0;return Qe(e)??et()}const et=()=>{var t;return Qe((t=document.querySelector('script[src*="smartconsent"][data-site-id]'))==null?void 0:t.getAttribute("data-site-id"))};function tt(t){const e=t;return!!e&&e.version===1&&(e.plan==="free"||e.plan==="pro"||e.plan==="enterprise")&&(e.mode==="normal"||e.mode==="safe")&&!!e.attribution&&typeof e.attribution.required=="boolean"}async function wn(t,e){const n=_n+t;let o=null;for(const d of[n,Xe+t])try{const h=JSON.parse(sessionStorage.getItem(d)||"null");if(tt(h)){h.attribution.required&&(o={...h,attribution:{required:!0}});break}}catch{}const a=new AbortController;let s;const i=new Promise(d=>{s=setTimeout(()=>{a.abort(),d(null)},bn)}),l=(async()=>{try{const d=await fetch(`${e}/v1/sites/${t}.json`,{signal:a.signal,credentials:"omit"});if(!d.ok)return null;const h=await d.json();if(!tt(h))return null;try{sessionStorage.setItem(n,JSON.stringify(h)),sessionStorage.removeItem(Xe+t)}catch{}return h}catch{return null}})();try{return await Promise.race([l,i])??o}finally{clearTimeout(s)}}const ie=t=>t.toLowerCase().replace(/\.$/,"").replace(/^www\./,"");function vn(t,e,n){t.attributionRef!==void 0&&(t={...t},delete t.attributionRef);const o=t.platform==="wordpress-plugin"||t.platform==="joomla-extension"||t.platform==="drupal-module";if(o&&t.attribution!==!0&&(t={...t,attribution:!1}),!e)return t;const a=xn(e);if(a.length&&t.cookies.length===0&&(t={...t,cookies:a}),o&&!t.attribution)return t;const s=e.attribution;let i=e.mode==="safe"||s.required;if(!i&&e.plan!=="enterprise"&&(i=!(typeof e.host=="string"&&ie(e.host)===ie(location.hostname)&&t.attribution===!1)),!i)return t;const l={...t,attribution:!0,attributionUrl:ne.attributionUrl},d=et(),h=s.ref===n&&(!d||d===n);return s.ref&&h&&typeof s.host=="string"&&ie(s.host)===ie(location.hostname)&&(l.attributionRef=s.ref),l}function xn(t){const e=t.cookies,n=[];if(!Array.isArray(e))return n;for(const o of e){if(!o||typeof o.name!="string"||typeof o.category!="string")continue;const a={name:o.name,category:o.category},s=[o.provider,o.purpose].filter(i=>typeof i=="string"&&i!=="");s.length&&(a.description=s.join(": ")),(o.party==="first"||o.party==="third")&&(a.party=o.party),typeof o.duration=="string"&&o.duration&&(a.duration=o.duration),n.push(dn(a))}return n}const $n=["bg","surface","border","text","textMuted","accent","accept","reject","toggleOn","toggleOff","radius","font"],Cn=["heading","description","acceptAll","rejectOptional","managePreferences","essentialOnly","savePreferences"];function nt(t,e){const n={};if(t&&typeof t=="object")for(const o of e){const a=t[o];typeof a=="string"&&(n[o]=a)}return n}function An(t){const e=t;return!e||typeof e!="object"||typeof e.src!="string"||typeof e.alt!="string"?null:e.src.startsWith("https://")?{src:e.src,alt:e.alt}:null}function ot(t){const e={...t};return delete e.logo,e}function kn(t,e){if(!e)return t;const n=e.banner,o=n&&typeof n=="object"&&!Array.isArray(n)?n:null,a=e.plan==="pro"||e.plan==="enterprise",s=!a&&!!t.logo;if(!o)return s?ot(t):t;let i={...t};s&&(i=ot(i));const l=a?An(o.logo):null;return l&&(i.logo=l),rt(i,o)}function rt(t,e){const n={...t};return(e.layout==="banner"||e.layout==="box"||e.layout==="popup")&&(n.layout=e.layout),(e.position==="bottom"||e.position==="top")&&(n.position=e.position),(e.boxPosition==="bottom-left"||e.boxPosition==="bottom-right")&&(n.boxPosition=e.boxPosition),n.theme={...t.theme,...nt(e.theme,$n)},n.texts={...t.texts,...nt(e.texts,Cn)},n}function at(t,e,n,o){if(!o||!e||e.v!==1||typeof e.apply!="function")return t;let a;try{a=e.apply([...n],o.regions)}catch{return t}return a&&typeof a=="object"&&!Array.isArray(a)?rt(t,a):t}function En(t){var o;const e=a=>{const[s,...i]=Array.from(a),l=t[s];if(typeof l!="function"){console.warn("SmartConsent: unknown method",s);return}try{l.apply(t,i)}catch(d){console.error("SmartConsent: queued call failed.",s,d)}},n=((o=window.smartconsent)==null?void 0:o.q)||[];window.smartconsent=(...a)=>e(a);for(let a=0;a<n.length;a++)e(n[a])}const $e="smartconsent_block_",Sn=/^[a-z0-9._/-]{1,100}$/;function st(t){return Array.isArray(t)?t.filter(e=>Array.isArray(e)&&typeof e[0]=="string"&&Sn.test(e[0])&&(e[1]==="analytics"||e[1]==="marketing")).slice(0,300):null}function qn(t){try{return st(JSON.parse(localStorage.getItem($e+t)||"null"))}catch{return null}}function jn(t,e){const n=st(e.block);try{n?localStorage.setItem($e+t,JSON.stringify(n)):localStorage.removeItem($e+t)}catch{}return n??[]}const Rn=/^[a-z0-9-]{1,32}$/,Pn=1500,Ln=document.createElement,it=new Map;function Ce(t,e,n){if(!Rn.test(t)||!Array.isArray(n)||!n.includes(t))return Promise.resolve(null);let o=it.get(t);return o||(o=new Promise(a=>{const s=Ln.call(document,"script"),i=d=>{var g;clearTimeout(l);const h=d?(g=window.SmartConsentCapsules)==null?void 0:g[t]:null;a(h&&typeof h=="object"?h:null)},l=setTimeout(()=>i(!1),Pn);s.async=!0,s.src=`${e}capsules/${t}.js`,s.onload=()=>i(!0),s.onerror=()=>i(!1),document.head.appendChild(s)}),it.set(t,o)),o}const In="1.0.0",Ae="smartconsent_vid";function Tn(){try{return crypto.randomUUID()}catch{return Date.now().toString(36)+Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)}}function Nn(){try{return localStorage.getItem(Ae)}catch{return null}}function ct(t){if(typeof t!="string")return null;try{if(t.startsWith("/")&&t[1]!=="/"&&t[1]!=="\\"||/^https?:\/\//i.test(t)){const n=new URL(t,location.href);if(n.origin===location.origin&&(n.protocol==="http:"||n.protocol==="https:"))return n.href}}catch{}return console.warn("SmartConsent: recordsEndpoint ignored (it must be on this site)."),null}function Bn(){var t;return((t=document.querySelector('script[src*="smartconsent"][data-records-endpoint]'))==null?void 0:t.getAttribute("data-records-endpoint"))??void 0}function Dn(t){const{siteId:e,recordsUrl:n,config:o,language:a,experiment:s}=t;let i=null,l=!1,d=!0;Promise.resolve().then(()=>{d=!1});function h(){if(!i){try{const g=localStorage.getItem(Ae);if(g){i=g,l=!0;return}}catch{}i=Tn();try{localStorage.setItem(Ae,i),l=!0}catch{l=!1}}}return{send(g){try{h();const f=o.texts,_={};for(const x of o.categories)_[x.id]=x.label;const u={site_id:e,consent_id:g.id,visitor_id:i,visitor_id_persisted:l,timestamp:g.timestamp,action:g.action,categories:{...g.categories},consent_version:g.version,jurisdiction:g.jurisdiction,gpc:d&&g.action==="reject_optional"&&navigator.globalPrivacyControl===!0,language:a,wording:{heading:f.heading,description:f.description,acceptAll:f.acceptAll,rejectOptional:f.rejectOptional,managePreferences:f.managePreferences,essentialOnly:f.essentialOnly,savePreferences:f.savePreferences,categories:_},page_url:location.origin+location.pathname,engine_version:In,...s&&{experiment:s.id,variant:s.variant,page:location.pathname.slice(0,200)}},m=n,N=JSON.stringify(u);let S=!1;try{S=typeof navigator.sendBeacon=="function"&&navigator.sendBeacon(m,N)}catch{S=!1}S||fetch(m,{method:"POST",body:N,keepalive:!0,mode:"no-cors",credentials:"omit"}).catch(()=>{})}catch{}}}}async function Mn(){const t=St(),e=yn(window.SmartConsentConfig),n=e?qn(e):null;e&&t.setRules(n),t.init();const o=window.SmartConsentConfig,a=!(o&&typeof o=="object"&&o.consentMode===!1);a&&(Pe(),At());let s=null;try{const i=sn(),l=e?wn(e,pt):Promise.resolve(null);e&&l.then(y=>t.setRules(y?jn(e,y):n??[]));const d=Gt(),h=await Xt(),g=zt(h,d),f=window.SmartConsentConfig,_=zn(g,f);let u;try{u=ht(_)}catch(y){return console.error("SmartConsent: Invalid config.",y instanceof Error?y.message:y),ce()}const m=await l;u=vn(u,m,e??void 0),delete u.dataRequestUrl,e&&(m==null?void 0:m.requests)===!0&&(u={...u,dataRequestUrl:`${Ee}/api/v1/privacy-request/${encodeURIComponent(e)}`});const N=Ce("country-banners",i,m==null?void 0:m.capsules),S=Un(m),x=S?Ce("subdomain-consent",i,m==null?void 0:m.capsules):Promise.resolve(null),A=m==null?void 0:m.experiment,ee=!!A&&typeof A.id=="string"&&!!A.b&&typeof A.b=="object"?Ce("banner-experiment",i,m==null?void 0:m.capsules):Promise.resolve(null),L=f&&typeof f=="object"?f:{};let q;e&&m?(q=cn({pageLanguage:u.language,settings:m,htmlLang:document.documentElement.lang,browserLang:typeof navigator<"u"?navigator.language:void 0}),ve(q)||await un(q,i)):q=nn(u.language);const $=tn(q);if($){u={...u,language:$.lang};const y=L.texts&&typeof L.texts=="object"?L.texts:{};u={...u,texts:{...u.texts,...$.texts,...y},dir:$.dir},L.categories===void 0&&(u={...u,categories:u.categories.map(j=>{const F=$.categories[j.id];return F?{...j,label:F.label,description:F.description}:j})})}else u.language&&u.language!=="en"&&(u={...u,language:"en"});if(L.translations&&typeof L.translations=="object"){const y=L.translations,j=u.texts;for(const[F,le]of Object.entries(y))if(typeof le=="string"){if(F.startsWith("banner.")){const W=F.slice(7);W in j&&(j[W]=le)}else if(F.startsWith("categories.")){const W=F.split(".");if(W.length===3){const Hn=W[1],ut=W[2];u={...u,categories:u.categories.map(ke=>ke.id===Hn?{...ke,...ut==="name"?{label:le}:ut==="description"?{description:le}:{}}:ke)}}}}}u=kn(u,m),u=at(u,await N,g.regulation_ids,m);const M=On(await ee,A==null?void 0:A.id);if(M==="b"){const y=u.texts.rejectOptional;u=at(u,{v:1,apply:()=>A==null?void 0:A.b},[],m),u.texts.rejectOptional=y}const I=Math.ceil(g.consent.expiry_days/30);I<u.expiry&&(u={...u,expiry:Math.max(1,Math.min(13,I))});const E=await x,R=(E==null?void 0:E.v)===1&&typeof E.read=="function"&&typeof E.write=="function"?E:null,T=y=>{try{R==null||R.write(S,y)}catch{}};if(R)try{Gn(R.read(S),u.version,T)}catch{}const v=_t(u);R&&v.onConsentChange(()=>T(v.getState()));let O=g.mode==="opt-out"&&v.needsConsent(),B=null;const r=()=>{B==null||B.hide(),B=null};v.onConsentChange(()=>{O=!1,r()});const c={...v,getState:()=>v.getState()??(O?{version:u.version,categories:Object.fromEntries(u.categories.map(y=>[y.id,!0])),timestamp:"",action:"accept_all",expiresAt:""}:null),hasConsent:y=>{var j;return((j=c.getState())==null?void 0:j.categories[y])===!0}},p=xt(u),b=Ct(u,c),C=await vt(),w=g.applicable_regulations.join(", ")||"unknown",k=wt({visitorHash:C,jurisdiction:w,version:String(u.version)}),P=ct(u.recordsEndpoint)??ct(Bn()),D=e&&(m||P)?Dn({siteId:e,recordsUrl:P??`${Ee}/api/v1/consent-records`,config:u,language:$?q:"en",experiment:M&&A?{id:A.id,variant:M}:null}):null;v.onConsentChange(y=>{const j=k.addRecord(y.action,y.categories);p.send(y,j),D==null||D.send(j)});const Fn=yt(v,u,g);t.setTexts(u.texts);try{if(b.init({defaultSent:a}),a){s=pe(j=>fe(!!j.categories.marketing));const y=c.getState();y&&fe(!!y.categories.marketing)}t.attach(c)}catch(y){try{b.destroy(),s==null||s(),a&&($t(),fe(!1))}catch{}return console.error("SmartConsent: Initialization error.",y instanceof Error?y.message:y),ce()}qt(u.theme);let U=X(c,u);const V=Mt(u,()=>{V.hide(),U=X(c,u),U.show()});return v.onConsentChange(()=>{setTimeout(()=>{v.needsConsent()||V.show()},0)}),Fn?V.show():v.needsConsent()?O?(B=Dt(v,u,()=>(U=X(c,u)).show())).show():U.show():V.show(),{hasConsent(y){return c.hasConsent(y)},getConsent(){return v.getState()},getConsentLog(){return k.getLog()},getLatestConsent(){return k.getLatest()},getConsentStats(){return fn(k.getLog())},getCookies(){return u.cookies},renderCookieTable(y){pn(y,u)},getCookieTableHTML(){return xe(u)},generateCookiePolicy(y){return Ze(u,y)},renderCookiePolicy(y,j){gn(y,u,j)},show(){r(),V.hide(),U=X(c,u),U.show()},reset(){r(),O=!1,U.destroy(),V.destroy(),v.reset(),R&&T(null),k.clear(),U=X(c,u),U.show()}}}catch(i){return console.error("SmartConsent: Initialization error.",i instanceof Error?i.message:i),ce()}}function On(t,e){if(!t||t.v!==1||typeof t.pick!="function"||!e)return null;try{const n=t.pick(Nn(),e);return n==="a"||n==="b"?n:null}catch{return null}}function Un(t){var a;const e=(a=t==null?void 0:t.share)==null?void 0:a.domain;if(typeof e!="string"||!e)return null;const n=e.toLowerCase(),o=location.hostname.toLowerCase();return o===n||o.endsWith("."+n)?n:null}function Gn(t,e,n){const o=l=>!!l&&l.version===e&&Date.parse(l.expiresAt)>Date.now()&&!!l.categories&&typeof l.categories=="object",a=Se(),s=a.getConsent(),i=o(t);i&&(!o(s)||Date.parse(t.timestamp)>Date.parse(s.timestamp))?a.saveConsent(t):o(s)&&(!i||Date.parse(s.timestamp)>Date.parse(t.timestamp))&&n(s)}function zn(t,e){const n=e&&typeof e=="object"?e:{},o=typeof n.version=="number"?n.version:1,a=Math.max(1,Math.min(13,Math.ceil(t.consent.expiry_days/30))),s=typeof n.expiry=="number"?n.expiry:a,i=Math.min(s,a);return{version:o,expiry:i,...n.theme!==void 0&&{theme:n.theme},...n.texts!==void 0&&{texts:n.texts},...n.webhookUrl!==void 0&&{webhookUrl:n.webhookUrl},...n.recordsEndpoint!==void 0&&{recordsEndpoint:n.recordsEndpoint},...n.attribution!==void 0&&{attribution:n.attribution},...n.platform!==void 0&&{platform:n.platform},...n.attributionUrl!==void 0&&{attributionUrl:n.attributionUrl},...n.showBadge!==void 0&&{showBadge:n.showBadge},...n.badgePosition!==void 0&&{badgePosition:n.badgePosition},...n.position!==void 0&&{position:n.position},...n.onConsent!==void 0&&{onConsent:n.onConsent},...n.categories!==void 0?{categories:n.categories}:{categories:t.categories},...n.consentMode!==void 0&&{consentMode:n.consentMode},...n.language!==void 0&&{language:n.language},...n.layout!==void 0&&{layout:n.layout},...n.boxPosition!==void 0&&{boxPosition:n.boxPosition},...n.logo!==void 0&&{logo:n.logo},...n.cookies!==void 0&&{cookies:n.cookies}}}function ce(){return{hasConsent:()=>!1,getConsent:()=>null,getConsentLog:()=>[],getLatestConsent:()=>null,getConsentStats:()=>({totalActions:0,acceptAllRate:0,rejectAllRate:0,customRate:0,categoryBreakdown:{},lastUpdated:""}),getCookies:()=>[],renderCookieTable:()=>{},getCookieTableHTML:()=>"",generateCookiePolicy:()=>"",renderCookiePolicy:()=>{},show:()=>{},reset:()=>{}}}const lt=Mn();return window.SmartConsent=ce(),lt.then(t=>{window.SmartConsent=t,En(t)}),lt}();
|
|
534
|
+
//# sourceMappingURL=smartconsent.min.js.map
|