@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,2260 @@
|
|
|
1
|
+
import { useRef as _e, useEffect as oe } from "react";
|
|
2
|
+
const pe = [
|
|
3
|
+
{
|
|
4
|
+
id: "essential",
|
|
5
|
+
label: "Essential",
|
|
6
|
+
description: "Required for the website to function. Cannot be disabled.",
|
|
7
|
+
required: !0
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
id: "analytics",
|
|
11
|
+
label: "Analytics",
|
|
12
|
+
description: "Help us understand how visitors interact with our website.",
|
|
13
|
+
required: !1
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
id: "functional",
|
|
17
|
+
label: "Functional",
|
|
18
|
+
description: "Enable personalised features and remember your preferences.",
|
|
19
|
+
required: !1
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: "marketing",
|
|
23
|
+
label: "Marketing",
|
|
24
|
+
description: "Used to deliver relevant advertisements and track campaign performance.",
|
|
25
|
+
required: !1
|
|
26
|
+
}
|
|
27
|
+
], be = {
|
|
28
|
+
bg: "#FFFFFF",
|
|
29
|
+
surface: "#F4F6F8",
|
|
30
|
+
border: "#DCE1E7",
|
|
31
|
+
text: "#182230",
|
|
32
|
+
textMuted: "#526071",
|
|
33
|
+
accent: "#33465F",
|
|
34
|
+
accept: "#33465F",
|
|
35
|
+
reject: "#33465F",
|
|
36
|
+
toggleOn: "#33465F",
|
|
37
|
+
toggleOff: "#778496",
|
|
38
|
+
radius: "12px",
|
|
39
|
+
font: "system-ui, sans-serif"
|
|
40
|
+
}, z = {
|
|
41
|
+
heading: "Cookie Preferences",
|
|
42
|
+
description: "We use cookies to improve your experience.",
|
|
43
|
+
acceptAll: "Accept All",
|
|
44
|
+
rejectOptional: "Reject Optional",
|
|
45
|
+
managePreferences: "Manage Preferences",
|
|
46
|
+
essentialOnly: "Essential Only",
|
|
47
|
+
savePreferences: "Save Preferences",
|
|
48
|
+
poweredBy: "Powered by SmartGenie",
|
|
49
|
+
doNotSell: "Do Not Sell or Share My Personal Information",
|
|
50
|
+
cookieSettings: "Cookie settings",
|
|
51
|
+
dataRequest: "Your data rights",
|
|
52
|
+
policyCredit: "Cookie consent by SmartConsent from SmartGenie",
|
|
53
|
+
embedNotice: "This content is from {service}. Loading it may set cookies.",
|
|
54
|
+
embedLoad: "Load content"
|
|
55
|
+
}, V = {
|
|
56
|
+
version: 0,
|
|
57
|
+
categories: pe,
|
|
58
|
+
theme: be,
|
|
59
|
+
position: "bottom",
|
|
60
|
+
badgePosition: "bottom-right",
|
|
61
|
+
showBadge: !0,
|
|
62
|
+
attribution: !0,
|
|
63
|
+
attributionUrl: "https://www.smartgenie.co.uk/smartconsent",
|
|
64
|
+
consentMode: !0,
|
|
65
|
+
expiry: 13,
|
|
66
|
+
texts: z,
|
|
67
|
+
dir: "ltr",
|
|
68
|
+
layout: "box",
|
|
69
|
+
boxPosition: "bottom-right",
|
|
70
|
+
cookies: []
|
|
71
|
+
}, he = 1, ye = 13;
|
|
72
|
+
function we(t) {
|
|
73
|
+
if (t == null || typeof t != "object")
|
|
74
|
+
throw new Error("SmartConsent: config must be an object");
|
|
75
|
+
const e = t;
|
|
76
|
+
if (e.version === void 0 || e.version === null)
|
|
77
|
+
throw new Error("SmartConsent: config.version is required");
|
|
78
|
+
if (typeof e.version != "number" || !Number.isFinite(e.version))
|
|
79
|
+
throw new Error("SmartConsent: config.version must be a finite number");
|
|
80
|
+
const o = {
|
|
81
|
+
...V,
|
|
82
|
+
version: e.version
|
|
83
|
+
};
|
|
84
|
+
if (Array.isArray(e.categories) && (o.categories = e.categories), e.theme !== void 0 && typeof e.theme == "object" && e.theme !== null && (o.theme = { ...V.theme, ...e.theme }), e.texts !== void 0 && typeof e.texts == "object" && e.texts !== null && (o.texts = { ...V.texts, ...e.texts }), (e.position === "bottom" || e.position === "top") && (o.position = e.position), (e.badgePosition === "bottom-right" || e.badgePosition === "bottom-left") && (o.badgePosition = e.badgePosition), typeof e.showBadge == "boolean" && (o.showBadge = e.showBadge), typeof e.attribution == "boolean" && (o.attribution = e.attribution), typeof e.consentMode == "boolean" && (o.consentMode = e.consentMode), typeof e.attributionUrl == "string" && (o.attributionUrl = e.attributionUrl), typeof e.webhookUrl == "string" && (o.webhookUrl = e.webhookUrl), typeof e.expiry == "number" && Number.isFinite(e.expiry) && (o.expiry = Math.max(he, Math.min(ye, e.expiry))), typeof e.onConsent == "function" && (o.onConsent = e.onConsent), typeof e.siteId == "string" && (o.siteId = e.siteId), (e.platform === "wordpress-plugin" || e.platform === "joomla-extension" || e.platform === "drupal-module") && (o.platform = e.platform, o.attribution = e.attribution === !0), typeof e.recordsEndpoint == "string" ? o.recordsEndpoint = e.recordsEndpoint : e.recordsEndpoint !== void 0 && console.warn("SmartConsent: recordsEndpoint ignored (it must be a string)."), typeof e.language == "string" && (o.language = e.language), (e.dir === "ltr" || e.dir === "rtl") && (o.dir = e.dir), (e.layout === "banner" || e.layout === "box" || e.layout === "popup") && (o.layout = e.layout), (e.boxPosition === "bottom-left" || e.boxPosition === "bottom-right") && (o.boxPosition = e.boxPosition), Array.isArray(e.cookies)) {
|
|
85
|
+
const a = [];
|
|
86
|
+
for (const u of e.cookies)
|
|
87
|
+
if (u && typeof u == "object") {
|
|
88
|
+
const i = u;
|
|
89
|
+
typeof i.name == "string" && typeof i.category == "string" ? a.push({
|
|
90
|
+
name: i.name,
|
|
91
|
+
category: i.category,
|
|
92
|
+
...typeof i.domain == "string" && { domain: i.domain },
|
|
93
|
+
...typeof i.description == "string" && { description: i.description },
|
|
94
|
+
...typeof i.duration == "string" && { duration: i.duration },
|
|
95
|
+
...(i.party === "first" || i.party === "third") && { party: i.party }
|
|
96
|
+
}) : console.warn("SmartConsent: Skipping invalid cookie declaration:", i);
|
|
97
|
+
}
|
|
98
|
+
o.cookies = a;
|
|
99
|
+
}
|
|
100
|
+
if (e.logo && typeof e.logo == "object") {
|
|
101
|
+
const a = e.logo;
|
|
102
|
+
typeof a.src == "string" && typeof a.alt == "string" && (o.logo = {
|
|
103
|
+
src: a.src,
|
|
104
|
+
alt: a.alt,
|
|
105
|
+
...typeof a.width == "number" && { width: a.width },
|
|
106
|
+
...typeof a.height == "number" && { height: a.height }
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
return o;
|
|
110
|
+
}
|
|
111
|
+
const W = "smartconsent_state";
|
|
112
|
+
function xe() {
|
|
113
|
+
function t() {
|
|
114
|
+
try {
|
|
115
|
+
const e = localStorage.getItem(W);
|
|
116
|
+
return e ? JSON.parse(e) : null;
|
|
117
|
+
} catch {
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return {
|
|
122
|
+
getConsent() {
|
|
123
|
+
return t();
|
|
124
|
+
},
|
|
125
|
+
saveConsent(e) {
|
|
126
|
+
try {
|
|
127
|
+
localStorage.setItem(W, JSON.stringify(e));
|
|
128
|
+
} catch {
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
clearConsent() {
|
|
132
|
+
try {
|
|
133
|
+
localStorage.removeItem(W);
|
|
134
|
+
} catch {
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
isExpired() {
|
|
138
|
+
const e = t();
|
|
139
|
+
return !e || !e.expiresAt ? !0 : new Date(e.expiresAt).getTime() <= Date.now();
|
|
140
|
+
},
|
|
141
|
+
isVersionMatch(e) {
|
|
142
|
+
const o = t();
|
|
143
|
+
return o ? o.version === e : !1;
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
const X = "smartconsent:update";
|
|
148
|
+
function ve(t) {
|
|
149
|
+
window.dispatchEvent(new CustomEvent(X, { detail: t }));
|
|
150
|
+
}
|
|
151
|
+
function ne(t) {
|
|
152
|
+
const e = (o) => {
|
|
153
|
+
t(o.detail);
|
|
154
|
+
};
|
|
155
|
+
return window.addEventListener(X, e), () => window.removeEventListener(X, e);
|
|
156
|
+
}
|
|
157
|
+
function Ae(t) {
|
|
158
|
+
const e = xe();
|
|
159
|
+
function o() {
|
|
160
|
+
const c = e.getConsent();
|
|
161
|
+
return c ? e.isExpired() || !e.isVersionMatch(t.version) ? (e.clearConsent(), null) : c : null;
|
|
162
|
+
}
|
|
163
|
+
function a(c) {
|
|
164
|
+
const m = {};
|
|
165
|
+
for (const l of t.categories)
|
|
166
|
+
m[l.id] = l.required ? !0 : c;
|
|
167
|
+
return m;
|
|
168
|
+
}
|
|
169
|
+
function u() {
|
|
170
|
+
const c = /* @__PURE__ */ new Date();
|
|
171
|
+
return c.setMonth(c.getMonth() + t.expiry), c.toISOString();
|
|
172
|
+
}
|
|
173
|
+
function i(c, m) {
|
|
174
|
+
const l = (/* @__PURE__ */ new Date()).toISOString(), f = {
|
|
175
|
+
version: t.version,
|
|
176
|
+
categories: c,
|
|
177
|
+
timestamp: l,
|
|
178
|
+
action: m,
|
|
179
|
+
expiresAt: u()
|
|
180
|
+
};
|
|
181
|
+
e.saveConsent(f);
|
|
182
|
+
const _ = {
|
|
183
|
+
categories: c,
|
|
184
|
+
action: m,
|
|
185
|
+
timestamp: l,
|
|
186
|
+
version: t.version
|
|
187
|
+
};
|
|
188
|
+
ve(_), t.onConsent && t.onConsent(f);
|
|
189
|
+
}
|
|
190
|
+
return {
|
|
191
|
+
acceptAll() {
|
|
192
|
+
i(a(!0), "accept_all");
|
|
193
|
+
},
|
|
194
|
+
rejectOptional() {
|
|
195
|
+
i(a(!1), "reject_optional");
|
|
196
|
+
},
|
|
197
|
+
saveCustom(c) {
|
|
198
|
+
const m = {};
|
|
199
|
+
for (const l of t.categories)
|
|
200
|
+
l.required ? m[l.id] = !0 : m[l.id] = c[l.id] ?? !1;
|
|
201
|
+
i(m, "custom");
|
|
202
|
+
},
|
|
203
|
+
withdraw() {
|
|
204
|
+
i(a(!1), "withdraw");
|
|
205
|
+
},
|
|
206
|
+
reset() {
|
|
207
|
+
e.clearConsent();
|
|
208
|
+
},
|
|
209
|
+
getState() {
|
|
210
|
+
return o();
|
|
211
|
+
},
|
|
212
|
+
hasConsent(c) {
|
|
213
|
+
const m = o();
|
|
214
|
+
return m ? m.categories[c] === !0 : !1;
|
|
215
|
+
},
|
|
216
|
+
needsConsent() {
|
|
217
|
+
return o() === null;
|
|
218
|
+
},
|
|
219
|
+
onConsentChange(c) {
|
|
220
|
+
return ne(c);
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
function Ce(t, e, o) {
|
|
225
|
+
const a = typeof navigator < "u" ? navigator : null, i = !!a && (a.globalPrivacyControl === !0 || a.doNotTrack === "1") && o.signals.gpc_auto_reject;
|
|
226
|
+
if (i) {
|
|
227
|
+
const c = t.getState(), m = !!c && e.categories.some((l) => !l.required && c.categories[l.id] === !0);
|
|
228
|
+
(!c || m) && t.rejectOptional();
|
|
229
|
+
}
|
|
230
|
+
return i;
|
|
231
|
+
}
|
|
232
|
+
function Ee(t) {
|
|
233
|
+
return {
|
|
234
|
+
send(e, o) {
|
|
235
|
+
if (!t.webhookUrl) return;
|
|
236
|
+
const a = {
|
|
237
|
+
action: e.action,
|
|
238
|
+
categories: e.categories,
|
|
239
|
+
version: e.version,
|
|
240
|
+
timestamp: e.timestamp,
|
|
241
|
+
pageUrl: window.location.href,
|
|
242
|
+
userAgent: navigator.userAgent,
|
|
243
|
+
...o && {
|
|
244
|
+
recordId: o.id,
|
|
245
|
+
visitorHash: o.visitorHash,
|
|
246
|
+
jurisdiction: o.jurisdiction
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
try {
|
|
250
|
+
fetch(t.webhookUrl, {
|
|
251
|
+
method: "POST",
|
|
252
|
+
headers: { "Content-Type": "application/json" },
|
|
253
|
+
body: JSON.stringify(a)
|
|
254
|
+
}).catch(() => {
|
|
255
|
+
});
|
|
256
|
+
} catch {
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
function re(t) {
|
|
262
|
+
return {
|
|
263
|
+
analytics_storage: t.analytics ? "granted" : "denied",
|
|
264
|
+
ad_storage: t.marketing ? "granted" : "denied",
|
|
265
|
+
ad_user_data: t.marketing ? "granted" : "denied",
|
|
266
|
+
ad_personalization: t.marketing ? "granted" : "denied",
|
|
267
|
+
functionality_storage: t.functional ? "granted" : "denied",
|
|
268
|
+
personalization_storage: t.functional ? "granted" : "denied",
|
|
269
|
+
security_storage: "granted"
|
|
270
|
+
// always granted (essential)
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
function me() {
|
|
274
|
+
window.dataLayer || (window.dataLayer = []), window.gtag || (window.gtag = function(...t) {
|
|
275
|
+
window.dataLayer.push(t);
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
const ke = {
|
|
279
|
+
analytics_storage: "denied",
|
|
280
|
+
ad_storage: "denied",
|
|
281
|
+
ad_user_data: "denied",
|
|
282
|
+
ad_personalization: "denied",
|
|
283
|
+
functionality_storage: "denied",
|
|
284
|
+
personalization_storage: "denied",
|
|
285
|
+
security_storage: "granted"
|
|
286
|
+
};
|
|
287
|
+
function $e() {
|
|
288
|
+
me(), window.gtag("consent", "default", { ...ke, wait_for_update: 500 });
|
|
289
|
+
}
|
|
290
|
+
function qe(t, e) {
|
|
291
|
+
let o = null;
|
|
292
|
+
return {
|
|
293
|
+
init(a) {
|
|
294
|
+
if (!t.consentMode) return;
|
|
295
|
+
a != null && a.defaultSent || $e(), me(), o = ne((i) => {
|
|
296
|
+
window.gtag("consent", "update", re(i.categories));
|
|
297
|
+
});
|
|
298
|
+
const u = e.getState();
|
|
299
|
+
u && window.gtag("consent", "update", re(u.categories));
|
|
300
|
+
},
|
|
301
|
+
destroy() {
|
|
302
|
+
o && (o(), o = null);
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
function ae(t, e) {
|
|
307
|
+
return t && /^\d+(\.\d+)?$/.test(t.trim()) ? t.trim() + "px" : (t == null ? void 0 : t.trim()) || e;
|
|
308
|
+
}
|
|
309
|
+
function Se(t, e) {
|
|
310
|
+
const o = document.createElement("div");
|
|
311
|
+
o.setAttribute("data-smartconsent", "embed"), o.setAttribute("role", "region");
|
|
312
|
+
const a = ae(t.getAttribute("width"), t.style.width), u = ae(t.getAttribute("height"), t.style.height);
|
|
313
|
+
a && o.style.setProperty("--sc-embed-w", a), u && o.style.setProperty("--sc-embed-h", u);
|
|
314
|
+
const i = document.createElement("p"), c = document.createElement("button");
|
|
315
|
+
return c.type = "button", c.addEventListener("click", e), o.append(i, c), o;
|
|
316
|
+
}
|
|
317
|
+
function se(t, e, o) {
|
|
318
|
+
const a = o.embedNotice.split("{service}").join(e);
|
|
319
|
+
t.setAttribute("aria-label", a), t.firstChild.textContent = a;
|
|
320
|
+
const u = t.lastChild;
|
|
321
|
+
u.textContent = o.embedLoad, u.setAttribute("aria-label", `${o.embedLoad}: ${e}`);
|
|
322
|
+
}
|
|
323
|
+
const U = "data-smartconsent-blocked", ie = document.createElement, je = "cdn.smartgenie.co.uk", Y = "", ce = "\0", ue = Node.prototype.appendChild, le = Node.prototype.insertBefore, T = Node.prototype.replaceChild, de = Element.prototype.append;
|
|
324
|
+
function Re(t) {
|
|
325
|
+
let e = t ?? null, o = null, a = null;
|
|
326
|
+
const u = [], i = [];
|
|
327
|
+
let c = z, m = /* @__PURE__ */ new WeakSet(), l, f = /* @__PURE__ */ new WeakSet();
|
|
328
|
+
function _(n) {
|
|
329
|
+
if (!n) return null;
|
|
330
|
+
try {
|
|
331
|
+
const r = new URL(n, location.href);
|
|
332
|
+
return /^https?:$/.test(r.protocol) && r.hostname !== location.hostname && r.hostname !== je ? r : null;
|
|
333
|
+
} catch {
|
|
334
|
+
return null;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
function b(n) {
|
|
338
|
+
if (!n) return null;
|
|
339
|
+
const r = n.hostname.toLowerCase(), s = (r + n.pathname).toLowerCase();
|
|
340
|
+
for (const [p, w] of l || [])
|
|
341
|
+
if (p.includes("/") ? s.includes(p) : r === p || r.endsWith("." + p)) return w;
|
|
342
|
+
return null;
|
|
343
|
+
}
|
|
344
|
+
function g(n, r) {
|
|
345
|
+
if (l === void 0) return null;
|
|
346
|
+
const s = _(n);
|
|
347
|
+
return s ? l ? b(s) : r ? Y : null : null;
|
|
348
|
+
}
|
|
349
|
+
function h(n) {
|
|
350
|
+
return e ? e.hasConsent(n) : !1;
|
|
351
|
+
}
|
|
352
|
+
function d(n) {
|
|
353
|
+
return n.getAttribute(U) === "true";
|
|
354
|
+
}
|
|
355
|
+
function x(n) {
|
|
356
|
+
return n.type !== "text/plain" || d(n);
|
|
357
|
+
}
|
|
358
|
+
function A(n, r) {
|
|
359
|
+
const s = n.getAttribute("src") || n.getAttribute("data-original-src"), p = n.textContent || null, w = [];
|
|
360
|
+
for (const y of Array.from(n.attributes))
|
|
361
|
+
y.name !== "type" && y.name !== "src" && y.name !== "data-original-src" && w.push({ name: y.name, value: y.value });
|
|
362
|
+
return { node: n, src: s, content: p, category: r, attributes: w };
|
|
363
|
+
}
|
|
364
|
+
function v(n) {
|
|
365
|
+
const r = u.findIndex((s) => s.node === n.node);
|
|
366
|
+
if (r >= 0) {
|
|
367
|
+
u[r] = n;
|
|
368
|
+
return;
|
|
369
|
+
}
|
|
370
|
+
u.push(n);
|
|
371
|
+
}
|
|
372
|
+
function B(n, r) {
|
|
373
|
+
const s = A(n, r);
|
|
374
|
+
v(s), n.setAttribute(U, "true"), n.type = "text/plain", s.src && (n.setAttribute("data-original-src", s.src), n.removeAttribute("src"));
|
|
375
|
+
}
|
|
376
|
+
function R(n) {
|
|
377
|
+
const r = document.createElement("script");
|
|
378
|
+
for (const p of n.attributes)
|
|
379
|
+
r.setAttribute(p.name, p.value);
|
|
380
|
+
if (r.removeAttribute("type"), r.removeAttribute(U), n.src ? r.src = n.src : n.content && (r.textContent = n.content), n.node.parentNode) {
|
|
381
|
+
n.node.parentNode.replaceChild(r, n.node);
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
(document.body || document.head || document.documentElement).appendChild(r);
|
|
385
|
+
}
|
|
386
|
+
function H(n, r = !1) {
|
|
387
|
+
var p;
|
|
388
|
+
const s = n.getAttribute("data-consent-category") ?? ((p = u.find((w) => w.node === n)) == null ? void 0 : p.category) ?? g(n.getAttribute("src"), r || f.has(n) || n.hasAttribute("async"));
|
|
389
|
+
s === null || h(s) || !x(n) || B(n, s);
|
|
390
|
+
}
|
|
391
|
+
function D(n) {
|
|
392
|
+
var r;
|
|
393
|
+
return (((r = _(n.getAttribute("data-original-src"))) == null ? void 0 : r.hostname) ?? "").replace(/^www\./, "");
|
|
394
|
+
}
|
|
395
|
+
function q(n) {
|
|
396
|
+
const r = n.node.parentNode;
|
|
397
|
+
n.category === Y || n.box || !r || (n.box = Se(n.node, () => {
|
|
398
|
+
i.splice(i.indexOf(n), 1), m.add(n.node), C(n);
|
|
399
|
+
}), se(n.box, D(n.node), c), T.call(r, n.box, n.node));
|
|
400
|
+
}
|
|
401
|
+
function C(n) {
|
|
402
|
+
const r = n.box;
|
|
403
|
+
n.box = void 0, r != null && r.parentNode && T.call(r.parentNode, n.node, r);
|
|
404
|
+
const s = n.node.getAttribute("data-original-src");
|
|
405
|
+
n.node.removeAttribute("data-original-src"), s && n.node.setAttribute("src", s);
|
|
406
|
+
}
|
|
407
|
+
function L(n) {
|
|
408
|
+
if (m.has(n)) return;
|
|
409
|
+
const r = i.find((y) => y.node === n);
|
|
410
|
+
if (r) return q(r);
|
|
411
|
+
const s = n.getAttribute("src"), p = g(s, !0);
|
|
412
|
+
if (p === null || h(p)) return;
|
|
413
|
+
n.setAttribute("data-original-src", s), n.removeAttribute("src");
|
|
414
|
+
const w = { node: n, category: p };
|
|
415
|
+
i.push(w), q(w);
|
|
416
|
+
}
|
|
417
|
+
function S(n, r) {
|
|
418
|
+
n instanceof HTMLScriptElement ? H(n, r) : n instanceof HTMLIFrameElement && L(n);
|
|
419
|
+
}
|
|
420
|
+
function k(n, r = !0) {
|
|
421
|
+
if (n instanceof Element && S(n, r), n instanceof Element || n instanceof DocumentFragment)
|
|
422
|
+
for (const s of Array.from(n.querySelectorAll("script, iframe"))) S(s, r);
|
|
423
|
+
return n;
|
|
424
|
+
}
|
|
425
|
+
function P() {
|
|
426
|
+
for (const n of Array.from(document.querySelectorAll("script, iframe"))) S(n, !1);
|
|
427
|
+
}
|
|
428
|
+
function j(n) {
|
|
429
|
+
var s;
|
|
430
|
+
const r = document.querySelectorAll(
|
|
431
|
+
`script[type="text/plain"][data-consent-category]:not([${U}="true"])`
|
|
432
|
+
);
|
|
433
|
+
for (const p of r)
|
|
434
|
+
try {
|
|
435
|
+
const w = p.getAttribute("data-consent-category");
|
|
436
|
+
if (!n(w)) continue;
|
|
437
|
+
const y = p.getAttribute("data-original-src") || p.getAttribute("src"), E = p.textContent, $ = document.createElement("script");
|
|
438
|
+
for (const N of Array.from(p.attributes))
|
|
439
|
+
N.name !== "type" && N.name !== "data-original-src" && $.setAttribute(N.name, N.value);
|
|
440
|
+
y ? $.src = y : E && ($.textContent = E), (s = p.parentNode) == null || s.replaceChild($, p);
|
|
441
|
+
} catch {
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
function I(n) {
|
|
445
|
+
const r = [], s = [];
|
|
446
|
+
for (const p of i.splice(0)) {
|
|
447
|
+
if (!n(p.category)) {
|
|
448
|
+
i.push(p);
|
|
449
|
+
continue;
|
|
450
|
+
}
|
|
451
|
+
C(p);
|
|
452
|
+
}
|
|
453
|
+
for (const p of u)
|
|
454
|
+
n(p.category) ? r.push(p) : s.push(p);
|
|
455
|
+
u.length = 0, u.push(...s);
|
|
456
|
+
for (const p of r)
|
|
457
|
+
try {
|
|
458
|
+
R(p);
|
|
459
|
+
} catch {
|
|
460
|
+
}
|
|
461
|
+
j(n);
|
|
462
|
+
}
|
|
463
|
+
function M(n) {
|
|
464
|
+
I((r) => n.categories[r] === !0);
|
|
465
|
+
}
|
|
466
|
+
function G() {
|
|
467
|
+
I((n) => h(n));
|
|
468
|
+
}
|
|
469
|
+
return {
|
|
470
|
+
init() {
|
|
471
|
+
P(), o = new MutationObserver((n) => {
|
|
472
|
+
for (const r of n)
|
|
473
|
+
for (const s of Array.from(r.addedNodes))
|
|
474
|
+
k(s, !1);
|
|
475
|
+
e && j(h);
|
|
476
|
+
}), o.observe(document.documentElement, { childList: !0, subtree: !0 }), document.createElement = function(n, r) {
|
|
477
|
+
const s = ie.call(document, n, r), p = String(n).toLowerCase();
|
|
478
|
+
if (p === "script" || p === "iframe") {
|
|
479
|
+
f.add(s);
|
|
480
|
+
const w = s.setAttribute.bind(s);
|
|
481
|
+
s.setAttribute = ($, N) => {
|
|
482
|
+
w($, N), ($ === "data-consent-category" || $ === "src") && S(s, !0);
|
|
483
|
+
};
|
|
484
|
+
const y = p === "script" ? HTMLScriptElement.prototype : HTMLIFrameElement.prototype, E = Object.getOwnPropertyDescriptor(y, "src");
|
|
485
|
+
E != null && E.get && E.set && Object.defineProperty(s, "src", {
|
|
486
|
+
configurable: !0,
|
|
487
|
+
enumerable: !0,
|
|
488
|
+
get() {
|
|
489
|
+
return E.get.call(this);
|
|
490
|
+
},
|
|
491
|
+
set($) {
|
|
492
|
+
E.set.call(this, $), S(s, !0);
|
|
493
|
+
}
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
return s;
|
|
497
|
+
}, Node.prototype.appendChild = function(n) {
|
|
498
|
+
return ue.call(this, k(n));
|
|
499
|
+
}, Node.prototype.insertBefore = function(n, r) {
|
|
500
|
+
return le.call(this, k(n), r);
|
|
501
|
+
}, Node.prototype.replaceChild = function(n, r) {
|
|
502
|
+
return T.call(this, k(n), r);
|
|
503
|
+
}, Element.prototype.append = function(...n) {
|
|
504
|
+
de.apply(
|
|
505
|
+
this,
|
|
506
|
+
n.map((r) => typeof r == "string" ? r : k(r))
|
|
507
|
+
);
|
|
508
|
+
}, e && (a = e.onConsentChange(M), G());
|
|
509
|
+
},
|
|
510
|
+
attach(n) {
|
|
511
|
+
a = n.onConsentChange(M), e = n, G();
|
|
512
|
+
},
|
|
513
|
+
setRules(n) {
|
|
514
|
+
const r = l === null;
|
|
515
|
+
if (l = n, !(!r || !n)) {
|
|
516
|
+
for (const s of [...u, ...i]) {
|
|
517
|
+
if (s.category !== Y) continue;
|
|
518
|
+
const p = "src" in s ? s.src : s.node.getAttribute("data-original-src");
|
|
519
|
+
s.category = b(_(p)) ?? ce;
|
|
520
|
+
}
|
|
521
|
+
I((s) => s === ce || h(s));
|
|
522
|
+
for (const s of i) q(s);
|
|
523
|
+
}
|
|
524
|
+
},
|
|
525
|
+
setTexts(n) {
|
|
526
|
+
c = n;
|
|
527
|
+
for (const r of i) r.box && se(r.box, D(r.node), n);
|
|
528
|
+
},
|
|
529
|
+
destroy() {
|
|
530
|
+
o && (o.disconnect(), o = null), document.createElement = ie, Node.prototype.appendChild = ue, Node.prototype.insertBefore = le, Node.prototype.replaceChild = T, Element.prototype.append = de, a && (a(), a = null), e = t ?? null, u.length = 0;
|
|
531
|
+
for (const n of i) {
|
|
532
|
+
const r = n.box;
|
|
533
|
+
r != null && r.parentNode && T.call(r.parentNode, n.node, r);
|
|
534
|
+
}
|
|
535
|
+
i.length = 0, m = /* @__PURE__ */ new WeakSet(), c = z, l = void 0, f = /* @__PURE__ */ new WeakSet();
|
|
536
|
+
}
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
const Q = "smartconsent-styles";
|
|
540
|
+
function Ne(t) {
|
|
541
|
+
if (document.getElementById(Q)) return;
|
|
542
|
+
const e = document.createElement("style");
|
|
543
|
+
e.id = Q, e.textContent = Le(t), document.head.appendChild(e);
|
|
544
|
+
}
|
|
545
|
+
function Be() {
|
|
546
|
+
const t = document.getElementById(Q);
|
|
547
|
+
t && t.remove();
|
|
548
|
+
}
|
|
549
|
+
function Le(t) {
|
|
550
|
+
return `
|
|
551
|
+
[data-smartconsent] {
|
|
552
|
+
--sc-bg: ${t.bg};
|
|
553
|
+
--sc-surface: ${t.surface};
|
|
554
|
+
--sc-border: ${t.border};
|
|
555
|
+
--sc-text: ${t.text};
|
|
556
|
+
--sc-text-muted: ${t.textMuted};
|
|
557
|
+
--sc-accent: ${t.accent};
|
|
558
|
+
--sc-accept: ${t.accept};
|
|
559
|
+
--sc-reject: ${t.reject};
|
|
560
|
+
--sc-toggle-on: ${t.toggleOn};
|
|
561
|
+
--sc-toggle-off: ${t.toggleOff};
|
|
562
|
+
--sc-radius: ${t.radius};
|
|
563
|
+
--sc-font: ${t.font};
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
[data-smartconsent] *,
|
|
567
|
+
[data-smartconsent] *::before,
|
|
568
|
+
[data-smartconsent] *::after {
|
|
569
|
+
box-sizing: border-box;
|
|
570
|
+
margin: 0;
|
|
571
|
+
padding: 0;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
[data-smartconsent="backdrop"] {
|
|
575
|
+
position: fixed;
|
|
576
|
+
inset: 0;
|
|
577
|
+
background: rgba(0, 0, 0, 0.4);
|
|
578
|
+
z-index: 9998;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
[data-smartconsent="banner"] {
|
|
582
|
+
position: fixed;
|
|
583
|
+
bottom: 0;
|
|
584
|
+
left: 0;
|
|
585
|
+
right: 0;
|
|
586
|
+
z-index: 9999;
|
|
587
|
+
background: var(--sc-bg);
|
|
588
|
+
color: var(--sc-text);
|
|
589
|
+
font-family: var(--sc-font);
|
|
590
|
+
font-size: 14px;
|
|
591
|
+
line-height: 1.5;
|
|
592
|
+
animation: sc-slide-up 0.3s ease-out;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
[data-smartconsent="banner"][data-sc-position="top"] {
|
|
596
|
+
bottom: auto;
|
|
597
|
+
top: 0;
|
|
598
|
+
animation: sc-slide-down-in 0.3s ease-out;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
[data-smartconsent="banner"] .sc-accent-line {
|
|
602
|
+
height: 2px;
|
|
603
|
+
background: linear-gradient(90deg, var(--sc-accent), var(--sc-accept));
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
[data-smartconsent="banner"] .sc-inner {
|
|
607
|
+
max-width: 960px;
|
|
608
|
+
margin: 0 auto;
|
|
609
|
+
padding: 16px 20px;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
/* Compact state */
|
|
613
|
+
[data-smartconsent="banner"] .sc-compact {
|
|
614
|
+
display: flex;
|
|
615
|
+
align-items: center;
|
|
616
|
+
gap: 16px;
|
|
617
|
+
flex-wrap: wrap;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
[data-smartconsent="banner"] .sc-compact-text {
|
|
621
|
+
flex: 1 1 300px;
|
|
622
|
+
color: var(--sc-text);
|
|
623
|
+
font-size: 14px;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
[data-smartconsent="banner"] .sc-compact-actions {
|
|
627
|
+
display: flex;
|
|
628
|
+
align-items: center;
|
|
629
|
+
gap: 10px;
|
|
630
|
+
flex-wrap: wrap;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
[data-smartconsent="banner"] .sc-compact-attribution {
|
|
634
|
+
flex: 1 1 100%;
|
|
635
|
+
margin-top: 6px;
|
|
636
|
+
font-size: 11px;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
[data-smartconsent="banner"] .sc-compact-attribution a {
|
|
640
|
+
color: var(--sc-accent);
|
|
641
|
+
text-decoration: none;
|
|
642
|
+
font-weight: 500;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
[data-smartconsent="banner"] .sc-compact-attribution a:hover {
|
|
646
|
+
text-decoration: underline;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
/* Expanded state */
|
|
650
|
+
[data-smartconsent="banner"] .sc-expanded {
|
|
651
|
+
display: none;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
[data-smartconsent="banner"] .sc-expanded.sc-active {
|
|
655
|
+
display: block;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
[data-smartconsent="banner"] .sc-compact.sc-hidden {
|
|
659
|
+
display: none;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
[data-smartconsent="banner"] .sc-header {
|
|
663
|
+
display: flex;
|
|
664
|
+
align-items: center;
|
|
665
|
+
gap: 12px;
|
|
666
|
+
margin-bottom: 8px;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
[data-smartconsent="banner"] .sc-logo {
|
|
670
|
+
flex-shrink: 0;
|
|
671
|
+
max-height: 48px;
|
|
672
|
+
width: auto;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
[data-smartconsent="banner"] .sc-header .sc-heading {
|
|
676
|
+
margin-bottom: 0;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
[data-smartconsent="banner"] .sc-heading {
|
|
680
|
+
font-size: 18px;
|
|
681
|
+
font-weight: 600;
|
|
682
|
+
margin-bottom: 8px;
|
|
683
|
+
color: var(--sc-text);
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
[data-smartconsent="banner"] .sc-description {
|
|
687
|
+
color: var(--sc-text-muted);
|
|
688
|
+
margin-bottom: 16px;
|
|
689
|
+
font-size: 13px;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
/* Category rows */
|
|
693
|
+
[data-smartconsent="banner"] .sc-categories {
|
|
694
|
+
margin-bottom: 16px;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
[data-smartconsent="banner"] .sc-category {
|
|
698
|
+
display: flex;
|
|
699
|
+
align-items: center;
|
|
700
|
+
justify-content: space-between;
|
|
701
|
+
padding: 12px;
|
|
702
|
+
border-bottom: 1px solid var(--sc-border);
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
[data-smartconsent="banner"] .sc-category:hover {
|
|
706
|
+
background: var(--sc-surface);
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
[data-smartconsent="banner"] .sc-category-info {
|
|
710
|
+
flex: 1;
|
|
711
|
+
margin-right: 12px;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
[data-smartconsent="banner"] .sc-category-label {
|
|
715
|
+
font-size: 14px;
|
|
716
|
+
font-weight: 500;
|
|
717
|
+
color: var(--sc-text);
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
[data-smartconsent="banner"] .sc-category-desc {
|
|
721
|
+
font-size: 12px;
|
|
722
|
+
color: var(--sc-text-muted);
|
|
723
|
+
margin-top: 2px;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
/* Toggle switch */
|
|
727
|
+
[data-smartconsent="banner"] .sc-toggle {
|
|
728
|
+
position: relative;
|
|
729
|
+
width: 44px;
|
|
730
|
+
height: 24px;
|
|
731
|
+
background: var(--sc-toggle-off);
|
|
732
|
+
border-radius: 12px;
|
|
733
|
+
border: none;
|
|
734
|
+
cursor: pointer;
|
|
735
|
+
transition: background 0.2s;
|
|
736
|
+
flex-shrink: 0;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
[data-smartconsent="banner"] .sc-toggle[aria-checked="true"] {
|
|
740
|
+
background: var(--sc-toggle-on);
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
[data-smartconsent="banner"] .sc-toggle::after {
|
|
744
|
+
content: '';
|
|
745
|
+
position: absolute;
|
|
746
|
+
top: 3px;
|
|
747
|
+
left: 3px;
|
|
748
|
+
width: 18px;
|
|
749
|
+
height: 18px;
|
|
750
|
+
background: white;
|
|
751
|
+
border-radius: 50%;
|
|
752
|
+
transition: left 0.2s;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
[data-smartconsent="banner"] .sc-toggle[aria-checked="true"]::after {
|
|
756
|
+
left: 23px;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
[data-smartconsent="banner"] .sc-toggle:disabled {
|
|
760
|
+
opacity: 0.5;
|
|
761
|
+
cursor: not-allowed;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
/* Held embed placeholder (CR-035): the size of the iframe it stands in for */
|
|
765
|
+
[data-smartconsent="embed"] {
|
|
766
|
+
display: flex;
|
|
767
|
+
flex-direction: column;
|
|
768
|
+
align-items: center;
|
|
769
|
+
justify-content: center;
|
|
770
|
+
gap: 12px;
|
|
771
|
+
width: var(--sc-embed-w, 100%);
|
|
772
|
+
max-width: 100%;
|
|
773
|
+
height: var(--sc-embed-h, auto);
|
|
774
|
+
min-height: 150px;
|
|
775
|
+
padding: 16px;
|
|
776
|
+
background: var(--sc-surface);
|
|
777
|
+
color: var(--sc-text);
|
|
778
|
+
border: 1px solid var(--sc-border);
|
|
779
|
+
border-radius: var(--sc-radius);
|
|
780
|
+
font-family: var(--sc-font);
|
|
781
|
+
font-size: 14px;
|
|
782
|
+
line-height: 1.5;
|
|
783
|
+
text-align: center;
|
|
784
|
+
box-sizing: border-box;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
[data-smartconsent="embed"] button {
|
|
788
|
+
padding: 8px 18px;
|
|
789
|
+
border: none;
|
|
790
|
+
border-radius: var(--sc-radius);
|
|
791
|
+
background: var(--sc-accent);
|
|
792
|
+
color: #fff;
|
|
793
|
+
font: 500 13px var(--sc-font);
|
|
794
|
+
cursor: pointer;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
[data-smartconsent="embed"] button:focus-visible {
|
|
798
|
+
outline: 2px solid var(--sc-accent);
|
|
799
|
+
outline-offset: 2px;
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
/* Buttons */
|
|
803
|
+
[data-smartconsent="banner"] .sc-btn {
|
|
804
|
+
padding: 8px 18px;
|
|
805
|
+
border: none;
|
|
806
|
+
border-radius: var(--sc-radius);
|
|
807
|
+
font-family: var(--sc-font);
|
|
808
|
+
font-size: 13px;
|
|
809
|
+
font-weight: 500;
|
|
810
|
+
cursor: pointer;
|
|
811
|
+
transition: opacity 0.2s;
|
|
812
|
+
white-space: nowrap;
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
[data-smartconsent="banner"] .sc-btn:hover {
|
|
816
|
+
opacity: 0.85;
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
[data-smartconsent="banner"] .sc-btn:focus-visible {
|
|
820
|
+
outline: 2px solid var(--sc-accent);
|
|
821
|
+
outline-offset: 2px;
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
[data-smartconsent="banner"] .sc-btn-accept {
|
|
825
|
+
background: var(--sc-accept);
|
|
826
|
+
color: #fff;
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
[data-smartconsent="banner"] .sc-btn-reject {
|
|
830
|
+
background: var(--sc-reject);
|
|
831
|
+
color: #fff;
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
[data-smartconsent="banner"] .sc-btn-save {
|
|
835
|
+
background: var(--sc-accent);
|
|
836
|
+
color: #fff;
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
[data-smartconsent="banner"] .sc-btn-essential {
|
|
840
|
+
background: var(--sc-reject);
|
|
841
|
+
color: #fff;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
[data-smartconsent="banner"] .sc-link {
|
|
845
|
+
background: none;
|
|
846
|
+
border: none;
|
|
847
|
+
color: var(--sc-accent);
|
|
848
|
+
font-family: var(--sc-font);
|
|
849
|
+
font-size: 13px;
|
|
850
|
+
cursor: pointer;
|
|
851
|
+
text-decoration: underline;
|
|
852
|
+
padding: 4px;
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
[data-smartconsent="banner"] .sc-link:focus-visible {
|
|
856
|
+
outline: 2px solid var(--sc-accent);
|
|
857
|
+
outline-offset: 2px;
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
/* Expanded actions */
|
|
861
|
+
[data-smartconsent="banner"] .sc-expanded-actions {
|
|
862
|
+
display: flex;
|
|
863
|
+
gap: 10px;
|
|
864
|
+
flex-wrap: wrap;
|
|
865
|
+
margin-top: 16px;
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
/* Attribution */
|
|
869
|
+
[data-smartconsent="banner"] .sc-attribution {
|
|
870
|
+
text-align: center;
|
|
871
|
+
margin-top: 12px;
|
|
872
|
+
padding-top: 12px;
|
|
873
|
+
border-top: 1px solid var(--sc-border);
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
[data-smartconsent="banner"] .sc-attribution a {
|
|
877
|
+
color: var(--sc-text-muted);
|
|
878
|
+
font-size: 11px;
|
|
879
|
+
text-decoration: none;
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
[data-smartconsent="banner"] .sc-attribution a:hover {
|
|
883
|
+
color: var(--sc-accent);
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
/* Badge */
|
|
887
|
+
[data-smartconsent="badge"] {
|
|
888
|
+
position: fixed;
|
|
889
|
+
width: 40px;
|
|
890
|
+
height: 40px;
|
|
891
|
+
border-radius: 50%;
|
|
892
|
+
background: var(--sc-accent);
|
|
893
|
+
color: #fff;
|
|
894
|
+
border: none;
|
|
895
|
+
cursor: pointer;
|
|
896
|
+
z-index: 9997;
|
|
897
|
+
display: flex;
|
|
898
|
+
align-items: center;
|
|
899
|
+
justify-content: center;
|
|
900
|
+
font-size: 20px;
|
|
901
|
+
opacity: 0.7;
|
|
902
|
+
transition: opacity 0.2s;
|
|
903
|
+
font-family: var(--sc-font);
|
|
904
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
[data-smartconsent="badge"]:hover {
|
|
908
|
+
opacity: 1;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
[data-smartconsent="badge"]:focus-visible {
|
|
912
|
+
outline: 2px solid var(--sc-accent);
|
|
913
|
+
outline-offset: 2px;
|
|
914
|
+
opacity: 1;
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
[data-smartconsent="badge"][data-sc-position="bottom-right"] {
|
|
918
|
+
bottom: 16px;
|
|
919
|
+
right: 16px;
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
[data-smartconsent="badge"][data-sc-position="bottom-left"] {
|
|
923
|
+
bottom: 16px;
|
|
924
|
+
left: 16px;
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
/* Layout: Box (FP-06) */
|
|
928
|
+
[data-smartconsent="banner"][data-sc-layout="box"] {
|
|
929
|
+
bottom: 16px;
|
|
930
|
+
left: 16px;
|
|
931
|
+
right: auto;
|
|
932
|
+
width: 400px;
|
|
933
|
+
max-width: calc(100vw - 32px);
|
|
934
|
+
border-radius: var(--sc-radius);
|
|
935
|
+
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
|
|
936
|
+
animation: sc-fade-in 0.3s ease-out;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
[data-smartconsent="banner"][data-sc-layout="box"][data-sc-box-position="bottom-right"] {
|
|
940
|
+
left: auto;
|
|
941
|
+
right: 16px;
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
[data-smartconsent="banner"][data-sc-layout="box"] .sc-compact {
|
|
945
|
+
flex-direction: column;
|
|
946
|
+
align-items: stretch;
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
/* In a column a flex basis is a height: the text and credit hug their content (BRIEF-280). */
|
|
950
|
+
[data-smartconsent="banner"][data-sc-layout="box"] .sc-compact-text,
|
|
951
|
+
[data-smartconsent="banner"][data-sc-layout="box"] .sc-compact-attribution {
|
|
952
|
+
flex-basis: auto;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
[data-smartconsent="banner"][data-sc-layout="box"] .sc-compact-actions {
|
|
956
|
+
justify-content: stretch;
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
[data-smartconsent="banner"][data-sc-layout="box"] .sc-compact-actions .sc-btn {
|
|
960
|
+
flex: 1;
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
/* Layout: Popup (FP-06) */
|
|
964
|
+
[data-smartconsent="banner"][data-sc-layout="popup"] {
|
|
965
|
+
bottom: auto;
|
|
966
|
+
left: 50%;
|
|
967
|
+
right: auto;
|
|
968
|
+
top: 50%;
|
|
969
|
+
transform: translate(-50%, -50%);
|
|
970
|
+
width: 520px;
|
|
971
|
+
max-width: calc(100vw - 32px);
|
|
972
|
+
max-height: calc(100vh - 32px);
|
|
973
|
+
overflow-y: auto;
|
|
974
|
+
border-radius: var(--sc-radius);
|
|
975
|
+
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
|
|
976
|
+
animation: sc-fade-in 0.3s ease-out;
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
@keyframes sc-fade-in {
|
|
980
|
+
from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
|
|
981
|
+
to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
[data-smartconsent="banner"][data-sc-layout="box"] + [data-smartconsent="backdrop"],
|
|
985
|
+
[data-smartconsent="banner"][data-sc-layout="box"] ~ [data-smartconsent="backdrop"] {
|
|
986
|
+
display: none;
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
/* Animations */
|
|
990
|
+
@keyframes sc-slide-up {
|
|
991
|
+
from { transform: translateY(100%); }
|
|
992
|
+
to { transform: translateY(0); }
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
@keyframes sc-slide-down-in {
|
|
996
|
+
from { transform: translateY(-100%); }
|
|
997
|
+
to { transform: translateY(0); }
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
/* Responsive */
|
|
1001
|
+
@media (max-width: 480px) {
|
|
1002
|
+
[data-smartconsent="banner"] .sc-compact {
|
|
1003
|
+
flex-direction: column;
|
|
1004
|
+
align-items: stretch;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
[data-smartconsent="banner"] .sc-compact-text,
|
|
1008
|
+
[data-smartconsent="banner"] .sc-compact-attribution {
|
|
1009
|
+
flex-basis: auto;
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
[data-smartconsent="banner"] .sc-compact-actions {
|
|
1013
|
+
justify-content: stretch;
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
[data-smartconsent="banner"] .sc-compact-attribution {
|
|
1017
|
+
text-align: center;
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
[data-smartconsent="banner"] .sc-compact-actions .sc-btn {
|
|
1021
|
+
flex: 1;
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
[data-smartconsent="banner"] .sc-expanded-actions {
|
|
1025
|
+
flex-direction: column;
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
[data-smartconsent="banner"] .sc-expanded-actions .sc-btn {
|
|
1029
|
+
width: 100%;
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
/* A full-width strip for every box position: the position attribute matches the bottom-right rule's weight, and
|
|
1033
|
+
width: auto with left and right at 0 fits the viewport exactly (the banner itself is not border-box) (BRIEF-280). */
|
|
1034
|
+
[data-smartconsent="banner"][data-sc-layout="box"],
|
|
1035
|
+
[data-smartconsent="banner"][data-sc-layout="box"][data-sc-box-position] {
|
|
1036
|
+
left: 0;
|
|
1037
|
+
right: 0;
|
|
1038
|
+
bottom: 0;
|
|
1039
|
+
width: auto;
|
|
1040
|
+
max-width: none;
|
|
1041
|
+
border-radius: 0;
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
[data-smartconsent="banner"][data-sc-layout="popup"] {
|
|
1045
|
+
left: 0;
|
|
1046
|
+
right: 0;
|
|
1047
|
+
top: auto;
|
|
1048
|
+
bottom: 0;
|
|
1049
|
+
width: 100%;
|
|
1050
|
+
max-width: 100%;
|
|
1051
|
+
transform: none;
|
|
1052
|
+
border-radius: 0;
|
|
1053
|
+
animation: sc-slide-up 0.3s ease-out;
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
`;
|
|
1057
|
+
}
|
|
1058
|
+
function Pe(t) {
|
|
1059
|
+
const e = 'button:not([disabled]), [href], input:not([disabled]), [tabindex]:not([tabindex="-1"]), [role="switch"]:not([disabled])';
|
|
1060
|
+
function o() {
|
|
1061
|
+
return Array.from(t.querySelectorAll(e));
|
|
1062
|
+
}
|
|
1063
|
+
function a(i) {
|
|
1064
|
+
if (i.key !== "Tab") return;
|
|
1065
|
+
const c = o();
|
|
1066
|
+
if (c.length === 0) return;
|
|
1067
|
+
const m = c[0], l = c[c.length - 1];
|
|
1068
|
+
i.shiftKey ? document.activeElement === m && (i.preventDefault(), l.focus()) : document.activeElement === l && (i.preventDefault(), m.focus());
|
|
1069
|
+
}
|
|
1070
|
+
t.addEventListener("keydown", a);
|
|
1071
|
+
const u = o();
|
|
1072
|
+
return u.length > 0 && u[0].focus(), () => {
|
|
1073
|
+
t.removeEventListener("keydown", a);
|
|
1074
|
+
};
|
|
1075
|
+
}
|
|
1076
|
+
function Ie(t) {
|
|
1077
|
+
const e = document.createElement("div");
|
|
1078
|
+
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(() => {
|
|
1079
|
+
e.remove();
|
|
1080
|
+
}, 1e3);
|
|
1081
|
+
}
|
|
1082
|
+
const K = {
|
|
1083
|
+
ar: "مدعوم بواسطة SmartGenie",
|
|
1084
|
+
cs: "Zajišťuje SmartGenie",
|
|
1085
|
+
da: "Drevet af SmartGenie",
|
|
1086
|
+
de: "Bereitgestellt von SmartGenie",
|
|
1087
|
+
es: "Desarrollado por SmartGenie",
|
|
1088
|
+
fr: "Propulsé par SmartGenie",
|
|
1089
|
+
hi: "SmartGenie द्वारा संचालित",
|
|
1090
|
+
it: "Offerto da SmartGenie",
|
|
1091
|
+
ja: "SmartGenie提供",
|
|
1092
|
+
ko: "SmartGenie 제공",
|
|
1093
|
+
nl: "Mogelijk gemaakt door SmartGenie",
|
|
1094
|
+
no: "Drevet av SmartGenie",
|
|
1095
|
+
pl: "Dostarczone przez SmartGenie",
|
|
1096
|
+
pt: "Fornecido por SmartGenie",
|
|
1097
|
+
ro: "Furnizat de SmartGenie",
|
|
1098
|
+
ru: "Работает на SmartGenie",
|
|
1099
|
+
sv: "Drivs av SmartGenie",
|
|
1100
|
+
tr: "SmartGenie tarafından desteklenmektedir",
|
|
1101
|
+
zh: "由 SmartGenie 提供支持"
|
|
1102
|
+
}, Te = (t, e) => Object.prototype.hasOwnProperty.call(t, e);
|
|
1103
|
+
function De(t) {
|
|
1104
|
+
if (typeof t != "string") return null;
|
|
1105
|
+
try {
|
|
1106
|
+
const { protocol: e } = new URL(t);
|
|
1107
|
+
return e === "http:" || e === "https:" ? t : null;
|
|
1108
|
+
} catch {
|
|
1109
|
+
return null;
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
const F = "sponsored nofollow noopener";
|
|
1113
|
+
function ee(t) {
|
|
1114
|
+
const e = De(t.attributionUrl);
|
|
1115
|
+
return e && t.attributionRef ? `https://www.smartgenie.co.uk/r/${encodeURIComponent(t.attributionRef)}` : e;
|
|
1116
|
+
}
|
|
1117
|
+
function te(t, e) {
|
|
1118
|
+
const o = t.texts[e], a = z[e];
|
|
1119
|
+
if (o === a || Object.values(K).includes(o)) return o;
|
|
1120
|
+
const i = (t.language || (typeof navigator < "u" ? navigator.language : "") || "en").split("-")[0].toLowerCase();
|
|
1121
|
+
return Te(K, i) ? K[i] : a;
|
|
1122
|
+
}
|
|
1123
|
+
const Me = [".sc-compact-attribution", ".sc-attribution"], Ge = 5, Ue = 1e3, Oe = [
|
|
1124
|
+
["display", (t) => t === "none"],
|
|
1125
|
+
["visibility", (t) => t === "hidden"],
|
|
1126
|
+
["opacity", (t) => t !== "" && parseFloat(t) === 0]
|
|
1127
|
+
];
|
|
1128
|
+
function Z(t) {
|
|
1129
|
+
return Oe.filter(([e, o]) => o(t.style.getPropertyValue(e))).map(([e]) => e);
|
|
1130
|
+
}
|
|
1131
|
+
function ze(t, e) {
|
|
1132
|
+
if (!e.attribution) return () => {
|
|
1133
|
+
};
|
|
1134
|
+
const o = [];
|
|
1135
|
+
for (const _ of Me) {
|
|
1136
|
+
const b = t.querySelector(_), g = b == null ? void 0 : b.querySelector("a"), h = b == null ? void 0 : b.parentElement;
|
|
1137
|
+
b && g && h && o.push({ container: b, parent: h, link: g });
|
|
1138
|
+
}
|
|
1139
|
+
if (o.length === 0) return () => {
|
|
1140
|
+
};
|
|
1141
|
+
const a = te(e, "poweredBy"), u = ee(e), i = ({ container: _, parent: b, link: g }) => g.parentElement !== _ || _.parentElement !== b || g.getAttribute("href") !== u || F.split(" ").some((h) => !g.relList.contains(h)) || g.textContent !== a || Z(g).length > 0 || Z(_).length > 0, c = ({ container: _, parent: b, link: g }) => {
|
|
1142
|
+
_.parentElement !== b && b.appendChild(_), g.parentElement !== _ && _.appendChild(g), g.getAttribute("href") !== u && (u === null ? g.removeAttribute("href") : g.setAttribute("href", u)), g.relList.add(...F.split(" ")), g.textContent !== a && (g.textContent = a);
|
|
1143
|
+
for (const h of [g, _])
|
|
1144
|
+
for (const d of Z(h)) h.style.removeProperty(d);
|
|
1145
|
+
};
|
|
1146
|
+
let m = 0, l = 0;
|
|
1147
|
+
const f = new MutationObserver(() => {
|
|
1148
|
+
const _ = o.filter(i);
|
|
1149
|
+
if (_.length === 0) return;
|
|
1150
|
+
const b = Date.now();
|
|
1151
|
+
if (b - l >= Ue && (l = b, m = 0), m >= Ge) {
|
|
1152
|
+
f.disconnect(), console.warn("SmartConsent: attribution link keeps being removed; guard stopped.");
|
|
1153
|
+
return;
|
|
1154
|
+
}
|
|
1155
|
+
m++, _.forEach(c);
|
|
1156
|
+
});
|
|
1157
|
+
return f.observe(t, {
|
|
1158
|
+
childList: !0,
|
|
1159
|
+
subtree: !0,
|
|
1160
|
+
attributes: !0,
|
|
1161
|
+
attributeFilter: ["href", "rel", "style"],
|
|
1162
|
+
characterData: !0
|
|
1163
|
+
}), () => f.disconnect();
|
|
1164
|
+
}
|
|
1165
|
+
function Fe(t, e) {
|
|
1166
|
+
if (!e.dataRequestUrl) return;
|
|
1167
|
+
t.firstChild && t.appendChild(document.createTextNode(" · "));
|
|
1168
|
+
const o = document.createElement("a");
|
|
1169
|
+
o.className = "sc-data-rights", o.href = e.dataRequestUrl, o.target = "_blank", o.rel = "noopener", o.textContent = e.texts.dataRequest, t.appendChild(o);
|
|
1170
|
+
}
|
|
1171
|
+
function O(t, e) {
|
|
1172
|
+
let o = null, a = null, u = null, i = null, c = null;
|
|
1173
|
+
const m = !!e.language && e.language !== "en", l = m ? e.texts.heading : "Cookie consent";
|
|
1174
|
+
function f() {
|
|
1175
|
+
return document.body ?? document.documentElement;
|
|
1176
|
+
}
|
|
1177
|
+
function _() {
|
|
1178
|
+
t.rejectOptional(), h.hide();
|
|
1179
|
+
}
|
|
1180
|
+
function b() {
|
|
1181
|
+
const d = document.createElement("div");
|
|
1182
|
+
d.setAttribute("data-smartconsent", "banner"), d.setAttribute("role", "dialog"), d.setAttribute("aria-modal", "true"), d.setAttribute("aria-label", l), m && d.setAttribute("lang", e.language), e.position === "top" && d.setAttribute("data-sc-position", "top"), e.dir === "rtl" && d.setAttribute("dir", "rtl"), e.layout !== "banner" && d.setAttribute("data-sc-layout", e.layout), e.layout === "box" && d.setAttribute("data-sc-box-position", e.boxPosition);
|
|
1183
|
+
const x = document.createElement("div");
|
|
1184
|
+
x.className = "sc-accent-line", d.appendChild(x);
|
|
1185
|
+
const A = document.createElement("div");
|
|
1186
|
+
A.className = "sc-inner";
|
|
1187
|
+
const v = document.createElement("div");
|
|
1188
|
+
v.className = "sc-compact";
|
|
1189
|
+
const B = document.createElement("div");
|
|
1190
|
+
B.className = "sc-compact-text", B.textContent = e.texts.description, v.appendChild(B);
|
|
1191
|
+
const R = document.createElement("div");
|
|
1192
|
+
R.className = "sc-compact-actions";
|
|
1193
|
+
const H = g(e.texts.rejectOptional, "sc-btn sc-btn-reject", () => {
|
|
1194
|
+
_();
|
|
1195
|
+
});
|
|
1196
|
+
R.appendChild(H);
|
|
1197
|
+
const D = g(e.texts.acceptAll, "sc-btn sc-btn-accept", () => {
|
|
1198
|
+
t.acceptAll(), h.hide();
|
|
1199
|
+
});
|
|
1200
|
+
R.appendChild(D);
|
|
1201
|
+
const q = document.createElement("button");
|
|
1202
|
+
if (q.className = "sc-link", q.textContent = e.texts.managePreferences, q.type = "button", q.addEventListener("click", () => {
|
|
1203
|
+
v.classList.add("sc-hidden"), C.classList.add("sc-active");
|
|
1204
|
+
}), R.appendChild(q), v.appendChild(R), e.attribution) {
|
|
1205
|
+
const n = document.createElement("div");
|
|
1206
|
+
n.className = "sc-compact-attribution";
|
|
1207
|
+
const r = document.createElement("a"), s = ee(e);
|
|
1208
|
+
s && (r.href = s), r.target = "_blank", r.rel = F, r.textContent = te(e, "poweredBy"), n.appendChild(r), v.appendChild(n);
|
|
1209
|
+
}
|
|
1210
|
+
A.appendChild(v);
|
|
1211
|
+
const C = document.createElement("div");
|
|
1212
|
+
if (C.className = "sc-expanded", e.logo) {
|
|
1213
|
+
const n = document.createElement("div");
|
|
1214
|
+
n.className = "sc-header";
|
|
1215
|
+
const r = document.createElement("img");
|
|
1216
|
+
r.src = e.logo.src, r.alt = e.logo.alt, r.className = "sc-logo", e.logo.width && (r.width = e.logo.width), e.logo.height && (r.height = e.logo.height), r.style.maxHeight = "48px", n.appendChild(r);
|
|
1217
|
+
const s = document.createElement("h2");
|
|
1218
|
+
s.className = "sc-heading", s.textContent = e.texts.heading, n.appendChild(s), C.appendChild(n);
|
|
1219
|
+
} else {
|
|
1220
|
+
const n = document.createElement("h2");
|
|
1221
|
+
n.className = "sc-heading", n.textContent = e.texts.heading, C.appendChild(n);
|
|
1222
|
+
}
|
|
1223
|
+
const L = document.createElement("p");
|
|
1224
|
+
L.className = "sc-description", L.textContent = e.texts.description, C.appendChild(L);
|
|
1225
|
+
const S = t.getState(), k = {}, P = document.createElement("div");
|
|
1226
|
+
P.className = "sc-categories";
|
|
1227
|
+
for (const n of e.categories) {
|
|
1228
|
+
k[n.id] = n.required ? !0 : (S == null ? void 0 : S.categories[n.id]) ?? !1;
|
|
1229
|
+
const r = document.createElement("div");
|
|
1230
|
+
r.className = "sc-category";
|
|
1231
|
+
const s = document.createElement("div");
|
|
1232
|
+
s.className = "sc-category-info";
|
|
1233
|
+
const p = document.createElement("div");
|
|
1234
|
+
p.className = "sc-category-label", p.textContent = n.label, s.appendChild(p);
|
|
1235
|
+
const w = document.createElement("div");
|
|
1236
|
+
w.className = "sc-category-desc", w.textContent = n.description, s.appendChild(w), r.appendChild(s);
|
|
1237
|
+
const y = document.createElement("button");
|
|
1238
|
+
y.className = "sc-toggle", y.type = "button", y.setAttribute("role", "switch"), y.setAttribute("aria-checked", String(k[n.id])), y.setAttribute("aria-label", n.label), n.required ? y.disabled = !0 : y.addEventListener("click", () => {
|
|
1239
|
+
const E = y.getAttribute("aria-checked") === "true";
|
|
1240
|
+
y.setAttribute("aria-checked", String(!E)), k[n.id] = !E;
|
|
1241
|
+
}), r.appendChild(y), P.appendChild(r);
|
|
1242
|
+
}
|
|
1243
|
+
C.appendChild(P);
|
|
1244
|
+
const j = document.createElement("div");
|
|
1245
|
+
j.className = "sc-expanded-actions";
|
|
1246
|
+
const I = g(e.texts.essentialOnly, "sc-btn sc-btn-essential", () => {
|
|
1247
|
+
_();
|
|
1248
|
+
});
|
|
1249
|
+
j.appendChild(I);
|
|
1250
|
+
const M = g(e.texts.savePreferences, "sc-btn sc-btn-save", () => {
|
|
1251
|
+
t.saveCustom(k), h.hide();
|
|
1252
|
+
});
|
|
1253
|
+
j.appendChild(M);
|
|
1254
|
+
const G = g(e.texts.acceptAll, "sc-btn sc-btn-accept", () => {
|
|
1255
|
+
t.acceptAll(), h.hide();
|
|
1256
|
+
});
|
|
1257
|
+
if (j.appendChild(G), C.appendChild(j), e.attribution || e.dataRequestUrl) {
|
|
1258
|
+
const n = document.createElement("div");
|
|
1259
|
+
if (n.className = "sc-attribution", e.attribution) {
|
|
1260
|
+
const r = document.createElement("a"), s = ee(e);
|
|
1261
|
+
s && (r.href = s), r.target = "_blank", r.rel = F, r.textContent = te(e, "poweredBy"), n.appendChild(r);
|
|
1262
|
+
}
|
|
1263
|
+
Fe(n, e), C.appendChild(n);
|
|
1264
|
+
}
|
|
1265
|
+
return A.appendChild(C), d.appendChild(A), d;
|
|
1266
|
+
}
|
|
1267
|
+
function g(d, x, A) {
|
|
1268
|
+
const v = document.createElement("button");
|
|
1269
|
+
return v.type = "button", v.className = x, v.textContent = d, v.addEventListener("click", A), v;
|
|
1270
|
+
}
|
|
1271
|
+
const h = {
|
|
1272
|
+
show() {
|
|
1273
|
+
o || (e.layout !== "box" && (a = document.createElement("div"), a.setAttribute("data-smartconsent", "backdrop"), a.addEventListener("click", _), f().appendChild(a)), o = b(), f().appendChild(o), c = ze(o, e), u = Pe(o), i = (d) => {
|
|
1274
|
+
d.key === "Escape" && _();
|
|
1275
|
+
}, document.addEventListener("keydown", i), Ie(l));
|
|
1276
|
+
},
|
|
1277
|
+
hide() {
|
|
1278
|
+
c && (c(), c = null), u && (u(), u = null), i && (document.removeEventListener("keydown", i), i = null), o && (o.remove(), o = null), a && (a.remove(), a = null);
|
|
1279
|
+
},
|
|
1280
|
+
destroy() {
|
|
1281
|
+
h.hide();
|
|
1282
|
+
}
|
|
1283
|
+
};
|
|
1284
|
+
return h;
|
|
1285
|
+
}
|
|
1286
|
+
function He(t, e) {
|
|
1287
|
+
let o = null;
|
|
1288
|
+
function a() {
|
|
1289
|
+
return document.body ?? document.documentElement;
|
|
1290
|
+
}
|
|
1291
|
+
function u() {
|
|
1292
|
+
const c = document.createElement("button");
|
|
1293
|
+
return c.setAttribute("data-smartconsent", "badge"), c.setAttribute("data-sc-position", t.badgePosition), c.setAttribute("aria-label", "Cookie preferences"), c.type = "button", c.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>', c.addEventListener("click", e), c;
|
|
1294
|
+
}
|
|
1295
|
+
return {
|
|
1296
|
+
show() {
|
|
1297
|
+
if (t.showBadge) {
|
|
1298
|
+
if (o) {
|
|
1299
|
+
o.style.display = "flex";
|
|
1300
|
+
return;
|
|
1301
|
+
}
|
|
1302
|
+
o = u(), a().appendChild(o);
|
|
1303
|
+
}
|
|
1304
|
+
},
|
|
1305
|
+
hide() {
|
|
1306
|
+
o && (o.style.display = "none");
|
|
1307
|
+
},
|
|
1308
|
+
destroy() {
|
|
1309
|
+
o && (o.remove(), o = null);
|
|
1310
|
+
}
|
|
1311
|
+
};
|
|
1312
|
+
}
|
|
1313
|
+
function Ve(t) {
|
|
1314
|
+
if (t == null || typeof t != "object")
|
|
1315
|
+
throw new Error("Regulation: data must be an object");
|
|
1316
|
+
const e = t;
|
|
1317
|
+
if (!e.id || typeof e.id != "string")
|
|
1318
|
+
throw new Error('Regulation: missing or invalid "id" (must be a non-empty string)');
|
|
1319
|
+
if (!e.name || typeof e.name != "string")
|
|
1320
|
+
throw new Error(`Regulation [${e.id}]: missing or invalid "name"`);
|
|
1321
|
+
if (e.consent_model !== "opt-in" && e.consent_model !== "opt-out")
|
|
1322
|
+
throw new Error(
|
|
1323
|
+
`Regulation [${e.id}]: "consent_model" must be "opt-in" or "opt-out", got "${String(e.consent_model)}"`
|
|
1324
|
+
);
|
|
1325
|
+
if (e.default_cookie_state !== "blocked" && e.default_cookie_state !== "allowed")
|
|
1326
|
+
throw new Error(
|
|
1327
|
+
`Regulation [${e.id}]: "default_cookie_state" must be "blocked" or "allowed"`
|
|
1328
|
+
);
|
|
1329
|
+
if (!e.jurisdiction || typeof e.jurisdiction != "object")
|
|
1330
|
+
throw new Error(`Regulation [${e.id}]: missing "jurisdiction" object`);
|
|
1331
|
+
const o = e.jurisdiction;
|
|
1332
|
+
if (!Array.isArray(o.countries))
|
|
1333
|
+
throw new Error(`Regulation [${e.id}]: "jurisdiction.countries" must be an array`);
|
|
1334
|
+
if (!e.banner_requirements || typeof e.banner_requirements != "object")
|
|
1335
|
+
throw new Error(`Regulation [${e.id}]: missing "banner_requirements" object`);
|
|
1336
|
+
if (!e.consent_rules || typeof e.consent_rules != "object")
|
|
1337
|
+
throw new Error(`Regulation [${e.id}]: missing "consent_rules" object`);
|
|
1338
|
+
if (!e.language || typeof e.language != "object")
|
|
1339
|
+
throw new Error(`Regulation [${e.id}]: missing "language" object`);
|
|
1340
|
+
if (!e.signals || typeof e.signals != "object")
|
|
1341
|
+
throw new Error(`Regulation [${e.id}]: missing "signals" object`);
|
|
1342
|
+
if (!e.children || typeof e.children != "object")
|
|
1343
|
+
throw new Error(`Regulation [${e.id}]: missing "children" object`);
|
|
1344
|
+
if (!e.audit || typeof e.audit != "object")
|
|
1345
|
+
throw new Error(`Regulation [${e.id}]: missing "audit" object`);
|
|
1346
|
+
return t;
|
|
1347
|
+
}
|
|
1348
|
+
const We = "uk-gdpr-pecr", Ye = "UK GDPR & PECR", Ke = "opt-in", Ze = "blocked", Je = "1.0", Xe = "2026-03-01", Qe = [
|
|
1349
|
+
"https://ico.org.uk/for-organisations/guide-to-pecr/cookies-and-similar-technologies/",
|
|
1350
|
+
"https://ico.org.uk/for-organisations/uk-gdpr-guidance-and-resources/"
|
|
1351
|
+
], et = {
|
|
1352
|
+
countries: [
|
|
1353
|
+
"GB"
|
|
1354
|
+
],
|
|
1355
|
+
states: null
|
|
1356
|
+
}, tt = {
|
|
1357
|
+
require_accept_button: !0,
|
|
1358
|
+
require_reject_button: !0,
|
|
1359
|
+
require_equal_prominence: !0,
|
|
1360
|
+
require_customise_button: !0,
|
|
1361
|
+
cookie_wall_permitted: !1,
|
|
1362
|
+
require_granular_categories: !0
|
|
1363
|
+
}, nt = {
|
|
1364
|
+
expiry_days: 395,
|
|
1365
|
+
withdrawal_mechanism: "persistent badge",
|
|
1366
|
+
withdrawal_ease: "as easy as giving consent",
|
|
1367
|
+
re_consent_on_policy_change: !0
|
|
1368
|
+
}, ot = {
|
|
1369
|
+
mandatory_languages: [
|
|
1370
|
+
"en"
|
|
1371
|
+
],
|
|
1372
|
+
auto_detect_browser_language: !1
|
|
1373
|
+
}, rt = {
|
|
1374
|
+
honour_gpc: !0,
|
|
1375
|
+
honour_dnt: !0
|
|
1376
|
+
}, at = {
|
|
1377
|
+
age_threshold: 13,
|
|
1378
|
+
tracking_prohibited: !1,
|
|
1379
|
+
parental_consent_required: !0
|
|
1380
|
+
}, st = {
|
|
1381
|
+
consent_log_required: !0,
|
|
1382
|
+
retention_years: 6,
|
|
1383
|
+
proof_of_consent_required: !0
|
|
1384
|
+
}, it = {
|
|
1385
|
+
id: We,
|
|
1386
|
+
name: Ye,
|
|
1387
|
+
consent_model: Ke,
|
|
1388
|
+
default_cookie_state: Ze,
|
|
1389
|
+
version: Je,
|
|
1390
|
+
last_updated: Xe,
|
|
1391
|
+
sources: Qe,
|
|
1392
|
+
jurisdiction: et,
|
|
1393
|
+
banner_requirements: tt,
|
|
1394
|
+
consent_rules: nt,
|
|
1395
|
+
language: ot,
|
|
1396
|
+
signals: rt,
|
|
1397
|
+
children: at,
|
|
1398
|
+
audit: st
|
|
1399
|
+
}, ct = "eu-gdpr-eprivacy", ut = "EU GDPR & ePrivacy Directive", lt = "opt-in", dt = "blocked", pt = "1.0", mt = "2026-03-01", gt = [
|
|
1400
|
+
"https://eur-lex.europa.eu/eli/reg/2016/679/oj",
|
|
1401
|
+
"https://eur-lex.europa.eu/eli/dir/2002/58/oj"
|
|
1402
|
+
], ft = {
|
|
1403
|
+
countries: [
|
|
1404
|
+
"AT",
|
|
1405
|
+
"BE",
|
|
1406
|
+
"BG",
|
|
1407
|
+
"HR",
|
|
1408
|
+
"CY",
|
|
1409
|
+
"CZ",
|
|
1410
|
+
"DK",
|
|
1411
|
+
"EE",
|
|
1412
|
+
"FI",
|
|
1413
|
+
"FR",
|
|
1414
|
+
"DE",
|
|
1415
|
+
"GR",
|
|
1416
|
+
"HU",
|
|
1417
|
+
"IE",
|
|
1418
|
+
"IT",
|
|
1419
|
+
"LV",
|
|
1420
|
+
"LT",
|
|
1421
|
+
"LU",
|
|
1422
|
+
"MT",
|
|
1423
|
+
"NL",
|
|
1424
|
+
"PL",
|
|
1425
|
+
"PT",
|
|
1426
|
+
"RO",
|
|
1427
|
+
"SK",
|
|
1428
|
+
"SI",
|
|
1429
|
+
"ES",
|
|
1430
|
+
"SE",
|
|
1431
|
+
"IS",
|
|
1432
|
+
"LI",
|
|
1433
|
+
"NO"
|
|
1434
|
+
],
|
|
1435
|
+
states: null
|
|
1436
|
+
}, _t = {
|
|
1437
|
+
require_accept_button: !0,
|
|
1438
|
+
require_reject_button: !0,
|
|
1439
|
+
require_equal_prominence: !0,
|
|
1440
|
+
require_customise_button: !0,
|
|
1441
|
+
cookie_wall_permitted: !1,
|
|
1442
|
+
require_granular_categories: !0
|
|
1443
|
+
}, bt = {
|
|
1444
|
+
expiry_days: 365,
|
|
1445
|
+
withdrawal_mechanism: "persistent badge",
|
|
1446
|
+
withdrawal_ease: "as easy as giving consent",
|
|
1447
|
+
re_consent_on_policy_change: !0
|
|
1448
|
+
}, ht = {
|
|
1449
|
+
mandatory_languages: [
|
|
1450
|
+
"en"
|
|
1451
|
+
],
|
|
1452
|
+
auto_detect_browser_language: !0
|
|
1453
|
+
}, yt = {
|
|
1454
|
+
honour_gpc: !0,
|
|
1455
|
+
honour_dnt: !0
|
|
1456
|
+
}, wt = {
|
|
1457
|
+
age_threshold: 16,
|
|
1458
|
+
tracking_prohibited: !1,
|
|
1459
|
+
parental_consent_required: !0
|
|
1460
|
+
}, xt = {
|
|
1461
|
+
consent_log_required: !0,
|
|
1462
|
+
retention_years: 5,
|
|
1463
|
+
proof_of_consent_required: !0
|
|
1464
|
+
}, vt = {
|
|
1465
|
+
id: ct,
|
|
1466
|
+
name: ut,
|
|
1467
|
+
consent_model: lt,
|
|
1468
|
+
default_cookie_state: dt,
|
|
1469
|
+
version: pt,
|
|
1470
|
+
last_updated: mt,
|
|
1471
|
+
sources: gt,
|
|
1472
|
+
jurisdiction: ft,
|
|
1473
|
+
banner_requirements: _t,
|
|
1474
|
+
consent_rules: bt,
|
|
1475
|
+
language: ht,
|
|
1476
|
+
signals: yt,
|
|
1477
|
+
children: wt,
|
|
1478
|
+
audit: xt
|
|
1479
|
+
}, At = "dpdp-india", Ct = "Digital Personal Data Protection Act (India)", Et = "opt-in", kt = "blocked", $t = "1.0", qt = "2026-03-01", St = [
|
|
1480
|
+
"https://www.meity.gov.in/content/digital-personal-data-protection-act-2023"
|
|
1481
|
+
], jt = {
|
|
1482
|
+
countries: [
|
|
1483
|
+
"IN"
|
|
1484
|
+
],
|
|
1485
|
+
states: null
|
|
1486
|
+
}, Rt = {
|
|
1487
|
+
require_accept_button: !0,
|
|
1488
|
+
require_reject_button: !0,
|
|
1489
|
+
require_equal_prominence: !0,
|
|
1490
|
+
require_customise_button: !0,
|
|
1491
|
+
cookie_wall_permitted: !1,
|
|
1492
|
+
require_granular_categories: !0
|
|
1493
|
+
}, Nt = {
|
|
1494
|
+
expiry_days: 365,
|
|
1495
|
+
withdrawal_mechanism: "persistent badge",
|
|
1496
|
+
withdrawal_ease: "as easy as giving consent",
|
|
1497
|
+
re_consent_on_policy_change: !0
|
|
1498
|
+
}, Bt = {
|
|
1499
|
+
mandatory_languages: [
|
|
1500
|
+
"en",
|
|
1501
|
+
"hi",
|
|
1502
|
+
"bn",
|
|
1503
|
+
"te",
|
|
1504
|
+
"mr",
|
|
1505
|
+
"ta",
|
|
1506
|
+
"ur",
|
|
1507
|
+
"gu",
|
|
1508
|
+
"kn",
|
|
1509
|
+
"ml",
|
|
1510
|
+
"or",
|
|
1511
|
+
"pa",
|
|
1512
|
+
"as",
|
|
1513
|
+
"mai",
|
|
1514
|
+
"sa",
|
|
1515
|
+
"ne",
|
|
1516
|
+
"sd",
|
|
1517
|
+
"kok",
|
|
1518
|
+
"doi",
|
|
1519
|
+
"mni",
|
|
1520
|
+
"sat",
|
|
1521
|
+
"ks",
|
|
1522
|
+
"bo"
|
|
1523
|
+
],
|
|
1524
|
+
auto_detect_browser_language: !0
|
|
1525
|
+
}, Lt = {
|
|
1526
|
+
honour_gpc: !0,
|
|
1527
|
+
honour_dnt: !0
|
|
1528
|
+
}, Pt = {
|
|
1529
|
+
age_threshold: 18,
|
|
1530
|
+
tracking_prohibited: !0,
|
|
1531
|
+
parental_consent_required: !0
|
|
1532
|
+
}, It = {
|
|
1533
|
+
consent_log_required: !0,
|
|
1534
|
+
retention_years: null,
|
|
1535
|
+
proof_of_consent_required: !0
|
|
1536
|
+
}, Tt = {
|
|
1537
|
+
id: At,
|
|
1538
|
+
name: Ct,
|
|
1539
|
+
consent_model: Et,
|
|
1540
|
+
default_cookie_state: kt,
|
|
1541
|
+
version: $t,
|
|
1542
|
+
last_updated: qt,
|
|
1543
|
+
sources: St,
|
|
1544
|
+
jurisdiction: jt,
|
|
1545
|
+
banner_requirements: Rt,
|
|
1546
|
+
consent_rules: Nt,
|
|
1547
|
+
language: Bt,
|
|
1548
|
+
signals: Lt,
|
|
1549
|
+
children: Pt,
|
|
1550
|
+
audit: It
|
|
1551
|
+
}, Dt = "lgpd-brazil", Mt = "Lei Geral de Proteção de Dados (Brazil)", Gt = "opt-in", Ut = "blocked", Ot = "1.0", zt = "2026-03-01", Ft = [
|
|
1552
|
+
"https://www.planalto.gov.br/ccivil_03/_ato2015-2018/2018/lei/l13709.htm"
|
|
1553
|
+
], Ht = {
|
|
1554
|
+
countries: [
|
|
1555
|
+
"BR"
|
|
1556
|
+
],
|
|
1557
|
+
states: null
|
|
1558
|
+
}, Vt = {
|
|
1559
|
+
require_accept_button: !0,
|
|
1560
|
+
require_reject_button: !0,
|
|
1561
|
+
require_equal_prominence: !0,
|
|
1562
|
+
require_customise_button: !0,
|
|
1563
|
+
cookie_wall_permitted: !1,
|
|
1564
|
+
require_granular_categories: !0
|
|
1565
|
+
}, Wt = {
|
|
1566
|
+
expiry_days: 365,
|
|
1567
|
+
withdrawal_mechanism: "persistent badge",
|
|
1568
|
+
withdrawal_ease: "as easy as giving consent",
|
|
1569
|
+
re_consent_on_policy_change: !0
|
|
1570
|
+
}, Yt = {
|
|
1571
|
+
mandatory_languages: [
|
|
1572
|
+
"pt"
|
|
1573
|
+
],
|
|
1574
|
+
auto_detect_browser_language: !1
|
|
1575
|
+
}, Kt = {
|
|
1576
|
+
honour_gpc: !0,
|
|
1577
|
+
honour_dnt: !0
|
|
1578
|
+
}, Zt = {
|
|
1579
|
+
age_threshold: 12,
|
|
1580
|
+
tracking_prohibited: !1,
|
|
1581
|
+
parental_consent_required: !0
|
|
1582
|
+
}, Jt = {
|
|
1583
|
+
consent_log_required: !0,
|
|
1584
|
+
retention_years: null,
|
|
1585
|
+
proof_of_consent_required: !0
|
|
1586
|
+
}, Xt = {
|
|
1587
|
+
id: Dt,
|
|
1588
|
+
name: Mt,
|
|
1589
|
+
consent_model: Gt,
|
|
1590
|
+
default_cookie_state: Ut,
|
|
1591
|
+
version: Ot,
|
|
1592
|
+
last_updated: zt,
|
|
1593
|
+
sources: Ft,
|
|
1594
|
+
jurisdiction: Ht,
|
|
1595
|
+
banner_requirements: Vt,
|
|
1596
|
+
consent_rules: Wt,
|
|
1597
|
+
language: Yt,
|
|
1598
|
+
signals: Kt,
|
|
1599
|
+
children: Zt,
|
|
1600
|
+
audit: Jt
|
|
1601
|
+
}, Qt = "popia-south-africa", en = "Protection of Personal Information Act (South Africa)", tn = "opt-in", nn = "blocked", on = "1.0", rn = "2026-03-01", an = [
|
|
1602
|
+
"https://popia.co.za/"
|
|
1603
|
+
], sn = {
|
|
1604
|
+
countries: [
|
|
1605
|
+
"ZA"
|
|
1606
|
+
],
|
|
1607
|
+
states: null
|
|
1608
|
+
}, cn = {
|
|
1609
|
+
require_accept_button: !0,
|
|
1610
|
+
require_reject_button: !0,
|
|
1611
|
+
require_equal_prominence: !0,
|
|
1612
|
+
require_customise_button: !0,
|
|
1613
|
+
cookie_wall_permitted: !1,
|
|
1614
|
+
require_granular_categories: !0
|
|
1615
|
+
}, un = {
|
|
1616
|
+
expiry_days: 365,
|
|
1617
|
+
withdrawal_mechanism: "persistent badge",
|
|
1618
|
+
withdrawal_ease: "as easy as giving consent",
|
|
1619
|
+
re_consent_on_policy_change: !0
|
|
1620
|
+
}, ln = {
|
|
1621
|
+
mandatory_languages: [
|
|
1622
|
+
"en"
|
|
1623
|
+
],
|
|
1624
|
+
auto_detect_browser_language: !1
|
|
1625
|
+
}, dn = {
|
|
1626
|
+
honour_gpc: !0,
|
|
1627
|
+
honour_dnt: !0
|
|
1628
|
+
}, pn = {
|
|
1629
|
+
age_threshold: 18,
|
|
1630
|
+
tracking_prohibited: !1,
|
|
1631
|
+
parental_consent_required: !0
|
|
1632
|
+
}, mn = {
|
|
1633
|
+
consent_log_required: !0,
|
|
1634
|
+
retention_years: null,
|
|
1635
|
+
proof_of_consent_required: !0
|
|
1636
|
+
}, gn = {
|
|
1637
|
+
id: Qt,
|
|
1638
|
+
name: en,
|
|
1639
|
+
consent_model: tn,
|
|
1640
|
+
default_cookie_state: nn,
|
|
1641
|
+
version: on,
|
|
1642
|
+
last_updated: rn,
|
|
1643
|
+
sources: an,
|
|
1644
|
+
jurisdiction: sn,
|
|
1645
|
+
banner_requirements: cn,
|
|
1646
|
+
consent_rules: un,
|
|
1647
|
+
language: ln,
|
|
1648
|
+
signals: dn,
|
|
1649
|
+
children: pn,
|
|
1650
|
+
audit: mn
|
|
1651
|
+
}, fn = "pipeda-canada", _n = "PIPEDA & Quebec Law 25 (Canada)", bn = "opt-in", hn = "blocked", yn = "1.0", wn = "2026-03-01", xn = [
|
|
1652
|
+
"https://www.priv.gc.ca/en/privacy-topics/privacy-laws-in-canada/the-personal-information-protection-and-electronic-documents-act-pipeda/"
|
|
1653
|
+
], vn = {
|
|
1654
|
+
countries: [
|
|
1655
|
+
"CA"
|
|
1656
|
+
],
|
|
1657
|
+
states: null
|
|
1658
|
+
}, An = {
|
|
1659
|
+
require_accept_button: !0,
|
|
1660
|
+
require_reject_button: !0,
|
|
1661
|
+
require_equal_prominence: !0,
|
|
1662
|
+
require_customise_button: !0,
|
|
1663
|
+
cookie_wall_permitted: !1,
|
|
1664
|
+
require_granular_categories: !0
|
|
1665
|
+
}, Cn = {
|
|
1666
|
+
expiry_days: 365,
|
|
1667
|
+
withdrawal_mechanism: "persistent badge",
|
|
1668
|
+
withdrawal_ease: "as easy as giving consent",
|
|
1669
|
+
re_consent_on_policy_change: !0
|
|
1670
|
+
}, En = {
|
|
1671
|
+
mandatory_languages: [
|
|
1672
|
+
"en",
|
|
1673
|
+
"fr"
|
|
1674
|
+
],
|
|
1675
|
+
auto_detect_browser_language: !0
|
|
1676
|
+
}, kn = {
|
|
1677
|
+
honour_gpc: !0,
|
|
1678
|
+
honour_dnt: !0
|
|
1679
|
+
}, $n = {
|
|
1680
|
+
age_threshold: 13,
|
|
1681
|
+
tracking_prohibited: !1,
|
|
1682
|
+
parental_consent_required: !0
|
|
1683
|
+
}, qn = {
|
|
1684
|
+
consent_log_required: !0,
|
|
1685
|
+
retention_years: null,
|
|
1686
|
+
proof_of_consent_required: !0
|
|
1687
|
+
}, Sn = {
|
|
1688
|
+
id: fn,
|
|
1689
|
+
name: _n,
|
|
1690
|
+
consent_model: bn,
|
|
1691
|
+
default_cookie_state: hn,
|
|
1692
|
+
version: yn,
|
|
1693
|
+
last_updated: wn,
|
|
1694
|
+
sources: xn,
|
|
1695
|
+
jurisdiction: vn,
|
|
1696
|
+
banner_requirements: An,
|
|
1697
|
+
consent_rules: Cn,
|
|
1698
|
+
language: En,
|
|
1699
|
+
signals: kn,
|
|
1700
|
+
children: $n,
|
|
1701
|
+
audit: qn
|
|
1702
|
+
}, jn = "pdpa-singapore", Rn = "Personal Data Protection Act (Singapore)", Nn = "opt-in", Bn = "blocked", Ln = "1.0", Pn = "2026-03-01", In = [
|
|
1703
|
+
"https://www.pdpc.gov.sg/overview-of-pdpa/the-legislation/personal-data-protection-act"
|
|
1704
|
+
], Tn = {
|
|
1705
|
+
countries: [
|
|
1706
|
+
"SG"
|
|
1707
|
+
],
|
|
1708
|
+
states: null
|
|
1709
|
+
}, Dn = {
|
|
1710
|
+
require_accept_button: !0,
|
|
1711
|
+
require_reject_button: !0,
|
|
1712
|
+
require_equal_prominence: !1,
|
|
1713
|
+
require_customise_button: !1,
|
|
1714
|
+
cookie_wall_permitted: !1,
|
|
1715
|
+
require_granular_categories: !1
|
|
1716
|
+
}, Mn = {
|
|
1717
|
+
expiry_days: 365,
|
|
1718
|
+
withdrawal_mechanism: "persistent badge",
|
|
1719
|
+
withdrawal_ease: "reasonable effort",
|
|
1720
|
+
re_consent_on_policy_change: !0
|
|
1721
|
+
}, Gn = {
|
|
1722
|
+
mandatory_languages: [
|
|
1723
|
+
"en"
|
|
1724
|
+
],
|
|
1725
|
+
auto_detect_browser_language: !1
|
|
1726
|
+
}, Un = {
|
|
1727
|
+
honour_gpc: !0,
|
|
1728
|
+
honour_dnt: !0
|
|
1729
|
+
}, On = {
|
|
1730
|
+
age_threshold: 13,
|
|
1731
|
+
tracking_prohibited: !1,
|
|
1732
|
+
parental_consent_required: !0
|
|
1733
|
+
}, zn = {
|
|
1734
|
+
consent_log_required: !0,
|
|
1735
|
+
retention_years: null,
|
|
1736
|
+
proof_of_consent_required: !1
|
|
1737
|
+
}, Fn = {
|
|
1738
|
+
id: jn,
|
|
1739
|
+
name: Rn,
|
|
1740
|
+
consent_model: Nn,
|
|
1741
|
+
default_cookie_state: Bn,
|
|
1742
|
+
version: Ln,
|
|
1743
|
+
last_updated: Pn,
|
|
1744
|
+
sources: In,
|
|
1745
|
+
jurisdiction: Tn,
|
|
1746
|
+
banner_requirements: Dn,
|
|
1747
|
+
consent_rules: Mn,
|
|
1748
|
+
language: Gn,
|
|
1749
|
+
signals: Un,
|
|
1750
|
+
children: On,
|
|
1751
|
+
audit: zn
|
|
1752
|
+
}, Hn = "pdpa-thailand", Vn = "Personal Data Protection Act (Thailand)", Wn = "opt-in", Yn = "blocked", Kn = "1.0", Zn = "2026-03-01", Jn = [
|
|
1753
|
+
"https://thaipdpa.com/"
|
|
1754
|
+
], Xn = {
|
|
1755
|
+
countries: [
|
|
1756
|
+
"TH"
|
|
1757
|
+
],
|
|
1758
|
+
states: null
|
|
1759
|
+
}, Qn = {
|
|
1760
|
+
require_accept_button: !0,
|
|
1761
|
+
require_reject_button: !0,
|
|
1762
|
+
require_equal_prominence: !0,
|
|
1763
|
+
require_customise_button: !0,
|
|
1764
|
+
cookie_wall_permitted: !1,
|
|
1765
|
+
require_granular_categories: !0
|
|
1766
|
+
}, eo = {
|
|
1767
|
+
expiry_days: 365,
|
|
1768
|
+
withdrawal_mechanism: "persistent badge",
|
|
1769
|
+
withdrawal_ease: "as easy as giving consent",
|
|
1770
|
+
re_consent_on_policy_change: !0
|
|
1771
|
+
}, to = {
|
|
1772
|
+
mandatory_languages: [
|
|
1773
|
+
"th",
|
|
1774
|
+
"en"
|
|
1775
|
+
],
|
|
1776
|
+
auto_detect_browser_language: !0
|
|
1777
|
+
}, no = {
|
|
1778
|
+
honour_gpc: !0,
|
|
1779
|
+
honour_dnt: !0
|
|
1780
|
+
}, oo = {
|
|
1781
|
+
age_threshold: 10,
|
|
1782
|
+
tracking_prohibited: !1,
|
|
1783
|
+
parental_consent_required: !0
|
|
1784
|
+
}, ro = {
|
|
1785
|
+
consent_log_required: !0,
|
|
1786
|
+
retention_years: null,
|
|
1787
|
+
proof_of_consent_required: !0
|
|
1788
|
+
}, ao = {
|
|
1789
|
+
id: Hn,
|
|
1790
|
+
name: Vn,
|
|
1791
|
+
consent_model: Wn,
|
|
1792
|
+
default_cookie_state: Yn,
|
|
1793
|
+
version: Kn,
|
|
1794
|
+
last_updated: Zn,
|
|
1795
|
+
sources: Jn,
|
|
1796
|
+
jurisdiction: Xn,
|
|
1797
|
+
banner_requirements: Qn,
|
|
1798
|
+
consent_rules: eo,
|
|
1799
|
+
language: to,
|
|
1800
|
+
signals: no,
|
|
1801
|
+
children: oo,
|
|
1802
|
+
audit: ro
|
|
1803
|
+
}, so = "ccpa-cpra", io = "CCPA / CPRA (California)", co = "opt-out", uo = "allowed", lo = "1.0", po = "2026-03-01", mo = [
|
|
1804
|
+
"https://oag.ca.gov/privacy/ccpa",
|
|
1805
|
+
"https://cppa.ca.gov/"
|
|
1806
|
+
], go = {
|
|
1807
|
+
countries: [
|
|
1808
|
+
"US"
|
|
1809
|
+
],
|
|
1810
|
+
states: [
|
|
1811
|
+
"CA"
|
|
1812
|
+
]
|
|
1813
|
+
}, fo = {
|
|
1814
|
+
require_accept_button: !1,
|
|
1815
|
+
require_reject_button: !0,
|
|
1816
|
+
require_equal_prominence: !1,
|
|
1817
|
+
require_customise_button: !0,
|
|
1818
|
+
cookie_wall_permitted: !1,
|
|
1819
|
+
require_granular_categories: !0
|
|
1820
|
+
}, _o = {
|
|
1821
|
+
expiry_days: 365,
|
|
1822
|
+
withdrawal_mechanism: "do not sell link",
|
|
1823
|
+
withdrawal_ease: "clear and conspicuous link",
|
|
1824
|
+
re_consent_on_policy_change: !1
|
|
1825
|
+
}, bo = {
|
|
1826
|
+
mandatory_languages: [
|
|
1827
|
+
"en"
|
|
1828
|
+
],
|
|
1829
|
+
auto_detect_browser_language: !1
|
|
1830
|
+
}, ho = {
|
|
1831
|
+
honour_gpc: !0,
|
|
1832
|
+
honour_dnt: !0
|
|
1833
|
+
}, yo = {
|
|
1834
|
+
age_threshold: 16,
|
|
1835
|
+
tracking_prohibited: !1,
|
|
1836
|
+
parental_consent_required: !0
|
|
1837
|
+
}, wo = {
|
|
1838
|
+
consent_log_required: !0,
|
|
1839
|
+
retention_years: 2,
|
|
1840
|
+
proof_of_consent_required: !1
|
|
1841
|
+
}, xo = {
|
|
1842
|
+
id: so,
|
|
1843
|
+
name: io,
|
|
1844
|
+
consent_model: co,
|
|
1845
|
+
default_cookie_state: uo,
|
|
1846
|
+
version: lo,
|
|
1847
|
+
last_updated: po,
|
|
1848
|
+
sources: mo,
|
|
1849
|
+
jurisdiction: go,
|
|
1850
|
+
banner_requirements: fo,
|
|
1851
|
+
consent_rules: _o,
|
|
1852
|
+
language: bo,
|
|
1853
|
+
signals: ho,
|
|
1854
|
+
children: yo,
|
|
1855
|
+
audit: wo
|
|
1856
|
+
}, vo = "us-state-general", Ao = "US State Privacy Laws (General)", Co = "opt-out", Eo = "allowed", ko = "1.0", $o = "2026-03-01", qo = [
|
|
1857
|
+
"https://iapp.org/resources/article/us-state-privacy-legislation-tracker/"
|
|
1858
|
+
], So = {
|
|
1859
|
+
countries: [
|
|
1860
|
+
"US"
|
|
1861
|
+
],
|
|
1862
|
+
states: [
|
|
1863
|
+
"CO",
|
|
1864
|
+
"CT",
|
|
1865
|
+
"VA",
|
|
1866
|
+
"UT",
|
|
1867
|
+
"TX",
|
|
1868
|
+
"OR",
|
|
1869
|
+
"MT",
|
|
1870
|
+
"DE",
|
|
1871
|
+
"IA",
|
|
1872
|
+
"NH",
|
|
1873
|
+
"NJ",
|
|
1874
|
+
"TN",
|
|
1875
|
+
"IN",
|
|
1876
|
+
"KY",
|
|
1877
|
+
"NE",
|
|
1878
|
+
"MD",
|
|
1879
|
+
"MN"
|
|
1880
|
+
]
|
|
1881
|
+
}, jo = {
|
|
1882
|
+
require_accept_button: !1,
|
|
1883
|
+
require_reject_button: !0,
|
|
1884
|
+
require_equal_prominence: !1,
|
|
1885
|
+
require_customise_button: !0,
|
|
1886
|
+
cookie_wall_permitted: !1,
|
|
1887
|
+
require_granular_categories: !1
|
|
1888
|
+
}, Ro = {
|
|
1889
|
+
expiry_days: 365,
|
|
1890
|
+
withdrawal_mechanism: "opt-out link",
|
|
1891
|
+
withdrawal_ease: "clear mechanism",
|
|
1892
|
+
re_consent_on_policy_change: !1
|
|
1893
|
+
}, No = {
|
|
1894
|
+
mandatory_languages: [
|
|
1895
|
+
"en"
|
|
1896
|
+
],
|
|
1897
|
+
auto_detect_browser_language: !1
|
|
1898
|
+
}, Bo = {
|
|
1899
|
+
honour_gpc: !0,
|
|
1900
|
+
honour_dnt: !0
|
|
1901
|
+
}, Lo = {
|
|
1902
|
+
age_threshold: 13,
|
|
1903
|
+
tracking_prohibited: !1,
|
|
1904
|
+
parental_consent_required: !0
|
|
1905
|
+
}, Po = {
|
|
1906
|
+
consent_log_required: !1,
|
|
1907
|
+
retention_years: null,
|
|
1908
|
+
proof_of_consent_required: !1
|
|
1909
|
+
}, Io = {
|
|
1910
|
+
id: vo,
|
|
1911
|
+
name: Ao,
|
|
1912
|
+
consent_model: Co,
|
|
1913
|
+
default_cookie_state: Eo,
|
|
1914
|
+
version: ko,
|
|
1915
|
+
last_updated: $o,
|
|
1916
|
+
sources: qo,
|
|
1917
|
+
jurisdiction: So,
|
|
1918
|
+
banner_requirements: jo,
|
|
1919
|
+
consent_rules: Ro,
|
|
1920
|
+
language: No,
|
|
1921
|
+
signals: Bo,
|
|
1922
|
+
children: Lo,
|
|
1923
|
+
audit: Po
|
|
1924
|
+
}, To = "default-global", Do = "Default Global (GDPR-equivalent)", Mo = "opt-in", Go = "blocked", Uo = "1.0", Oo = "2026-03-01", zo = [], Fo = {
|
|
1925
|
+
countries: [],
|
|
1926
|
+
states: null
|
|
1927
|
+
}, Ho = {
|
|
1928
|
+
require_accept_button: !0,
|
|
1929
|
+
require_reject_button: !0,
|
|
1930
|
+
require_equal_prominence: !0,
|
|
1931
|
+
require_customise_button: !0,
|
|
1932
|
+
cookie_wall_permitted: !1,
|
|
1933
|
+
require_granular_categories: !0
|
|
1934
|
+
}, Vo = {
|
|
1935
|
+
expiry_days: 365,
|
|
1936
|
+
withdrawal_mechanism: "persistent badge",
|
|
1937
|
+
withdrawal_ease: "as easy as giving consent",
|
|
1938
|
+
re_consent_on_policy_change: !0
|
|
1939
|
+
}, Wo = {
|
|
1940
|
+
mandatory_languages: [
|
|
1941
|
+
"en"
|
|
1942
|
+
],
|
|
1943
|
+
auto_detect_browser_language: !0
|
|
1944
|
+
}, Yo = {
|
|
1945
|
+
honour_gpc: !0,
|
|
1946
|
+
honour_dnt: !0
|
|
1947
|
+
}, Ko = {
|
|
1948
|
+
age_threshold: 16,
|
|
1949
|
+
tracking_prohibited: !1,
|
|
1950
|
+
parental_consent_required: !0
|
|
1951
|
+
}, Zo = {
|
|
1952
|
+
consent_log_required: !0,
|
|
1953
|
+
retention_years: null,
|
|
1954
|
+
proof_of_consent_required: !0
|
|
1955
|
+
}, Jo = {
|
|
1956
|
+
id: To,
|
|
1957
|
+
name: Do,
|
|
1958
|
+
consent_model: Mo,
|
|
1959
|
+
default_cookie_state: Go,
|
|
1960
|
+
version: Uo,
|
|
1961
|
+
last_updated: Oo,
|
|
1962
|
+
sources: zo,
|
|
1963
|
+
jurisdiction: Fo,
|
|
1964
|
+
banner_requirements: Ho,
|
|
1965
|
+
consent_rules: Vo,
|
|
1966
|
+
language: Wo,
|
|
1967
|
+
signals: Yo,
|
|
1968
|
+
children: Ko,
|
|
1969
|
+
audit: Zo
|
|
1970
|
+
}, Xo = [
|
|
1971
|
+
it,
|
|
1972
|
+
vt,
|
|
1973
|
+
Tt,
|
|
1974
|
+
Xt,
|
|
1975
|
+
gn,
|
|
1976
|
+
Sn,
|
|
1977
|
+
Fn,
|
|
1978
|
+
ao,
|
|
1979
|
+
xo,
|
|
1980
|
+
Io,
|
|
1981
|
+
Jo
|
|
1982
|
+
];
|
|
1983
|
+
function Qo() {
|
|
1984
|
+
const t = [];
|
|
1985
|
+
for (const e of Xo)
|
|
1986
|
+
try {
|
|
1987
|
+
t.push(Ve(e));
|
|
1988
|
+
} catch (o) {
|
|
1989
|
+
console.warn(
|
|
1990
|
+
"SmartConsent: Skipping invalid regulation file.",
|
|
1991
|
+
o instanceof Error ? o.message : o
|
|
1992
|
+
);
|
|
1993
|
+
}
|
|
1994
|
+
return t;
|
|
1995
|
+
}
|
|
1996
|
+
function er(t, e) {
|
|
1997
|
+
let o = e.filter((a) => a.jurisdiction.countries.length === 0 || !a.jurisdiction.countries.includes(t.country) ? !1 : a.jurisdiction.states && a.jurisdiction.states.length > 0 && t.state ? a.jurisdiction.states.includes(t.state) : !(a.jurisdiction.states && a.jurisdiction.states.length > 0 && !t.state));
|
|
1998
|
+
if (o.length === 0) {
|
|
1999
|
+
const a = e.find((u) => u.id === "default-global");
|
|
2000
|
+
a && (o = [a]);
|
|
2001
|
+
}
|
|
2002
|
+
return tr(o);
|
|
2003
|
+
}
|
|
2004
|
+
function tr(t) {
|
|
2005
|
+
let e = "opt-out", o = !1, a = !1, u = !1, i = !1, c = !0, m = 1 / 0, l = !1, f = "opt-out link", _ = !1;
|
|
2006
|
+
const b = [], g = [];
|
|
2007
|
+
for (const d of t)
|
|
2008
|
+
b.push(d.name), g.push(d.id), d.consent_model === "opt-in" && (e = "opt-in"), d.banner_requirements.require_accept_button && (o = !0), d.banner_requirements.require_reject_button && (a = !0), d.banner_requirements.require_customise_button && (u = !0), d.banner_requirements.require_equal_prominence && (i = !0), d.banner_requirements.cookie_wall_permitted || (c = !1), d.consent_rules.expiry_days < m && (m = d.consent_rules.expiry_days), d.signals.honour_gpc && (l = !0), d.consent_rules.withdrawal_mechanism === "persistent badge" && (f = "persistent badge"), d.consent_rules.re_consent_on_policy_change && (_ = !0);
|
|
2009
|
+
m === 1 / 0 && (m = 365);
|
|
2010
|
+
const h = [...pe];
|
|
2011
|
+
return {
|
|
2012
|
+
mode: e,
|
|
2013
|
+
buttons: {
|
|
2014
|
+
accept_all: o,
|
|
2015
|
+
reject_all: a,
|
|
2016
|
+
customise: u,
|
|
2017
|
+
equal_prominence: i
|
|
2018
|
+
},
|
|
2019
|
+
categories: h,
|
|
2020
|
+
blocking: {
|
|
2021
|
+
mode: "block-first",
|
|
2022
|
+
unknown_scripts: e === "opt-in" ? "blocked" : "allowed"
|
|
2023
|
+
},
|
|
2024
|
+
consent: {
|
|
2025
|
+
expiry_days: m,
|
|
2026
|
+
withdrawal_mechanism: f,
|
|
2027
|
+
re_consent_on_version_change: _
|
|
2028
|
+
},
|
|
2029
|
+
signals: {
|
|
2030
|
+
gpc_auto_reject: l
|
|
2031
|
+
},
|
|
2032
|
+
cookie_wall: c,
|
|
2033
|
+
language: "en",
|
|
2034
|
+
applicable_regulations: b,
|
|
2035
|
+
regulation_ids: g
|
|
2036
|
+
};
|
|
2037
|
+
}
|
|
2038
|
+
const nr = {
|
|
2039
|
+
"Africa/Ceuta": "ES",
|
|
2040
|
+
"Africa/Johannesburg": "ZA",
|
|
2041
|
+
"America/Araguaina": "BR",
|
|
2042
|
+
"America/Atikokan": "CA",
|
|
2043
|
+
"America/Bahia": "BR",
|
|
2044
|
+
"America/Belem": "BR",
|
|
2045
|
+
"America/Blanc-Sablon": "CA",
|
|
2046
|
+
"America/Boa_Vista": "BR",
|
|
2047
|
+
"America/Boise": "US-VA",
|
|
2048
|
+
"America/Cambridge_Bay": "CA",
|
|
2049
|
+
"America/Campo_Grande": "BR",
|
|
2050
|
+
"America/Chicago": "US-VA",
|
|
2051
|
+
"America/Coral_Harbour": "CA",
|
|
2052
|
+
"America/Creston": "CA",
|
|
2053
|
+
"America/Cuiaba": "BR",
|
|
2054
|
+
"America/Dawson": "CA",
|
|
2055
|
+
"America/Dawson_Creek": "CA",
|
|
2056
|
+
"America/Denver": "US-VA",
|
|
2057
|
+
"America/Detroit": "US-VA",
|
|
2058
|
+
"America/Edmonton": "CA",
|
|
2059
|
+
"America/Eirunepe": "BR",
|
|
2060
|
+
"America/Fort_Nelson": "CA",
|
|
2061
|
+
"America/Fortaleza": "BR",
|
|
2062
|
+
"America/Glace_Bay": "CA",
|
|
2063
|
+
"America/Goose_Bay": "CA",
|
|
2064
|
+
"America/Halifax": "CA",
|
|
2065
|
+
"America/Indiana/Indianapolis": "US-VA",
|
|
2066
|
+
"America/Indianapolis": "US-VA",
|
|
2067
|
+
"America/Inuvik": "CA",
|
|
2068
|
+
"America/Iqaluit": "CA",
|
|
2069
|
+
"America/Kentucky/Louisville": "US-VA",
|
|
2070
|
+
"America/Los_Angeles": "US-CA",
|
|
2071
|
+
"America/Louisville": "US-VA",
|
|
2072
|
+
"America/Maceio": "BR",
|
|
2073
|
+
"America/Manaus": "BR",
|
|
2074
|
+
"America/Moncton": "CA",
|
|
2075
|
+
"America/New_York": "US-VA",
|
|
2076
|
+
"America/Noronha": "BR",
|
|
2077
|
+
"America/Porto_Velho": "BR",
|
|
2078
|
+
"America/Rankin_Inlet": "CA",
|
|
2079
|
+
"America/Recife": "BR",
|
|
2080
|
+
"America/Regina": "CA",
|
|
2081
|
+
"America/Rio_Branco": "BR",
|
|
2082
|
+
"America/Santarem": "BR",
|
|
2083
|
+
"America/Sao_Paulo": "BR",
|
|
2084
|
+
"America/St_Johns": "CA",
|
|
2085
|
+
"America/Swift_Current": "CA",
|
|
2086
|
+
"America/Toronto": "CA",
|
|
2087
|
+
"America/Vancouver": "CA",
|
|
2088
|
+
"America/Whitehorse": "CA",
|
|
2089
|
+
"America/Winnipeg": "CA",
|
|
2090
|
+
"America/Yellowknife": "CA",
|
|
2091
|
+
"Asia/Bangkok": "TH",
|
|
2092
|
+
"Asia/Calcutta": "IN",
|
|
2093
|
+
"Asia/Kolkata": "IN",
|
|
2094
|
+
"Asia/Nicosia": "CY",
|
|
2095
|
+
"Asia/Singapore": "SG",
|
|
2096
|
+
"Atlantic/Azores": "PT",
|
|
2097
|
+
"Atlantic/Canary": "ES",
|
|
2098
|
+
"Atlantic/Madeira": "PT",
|
|
2099
|
+
"Atlantic/Reykjavik": "IS",
|
|
2100
|
+
"Europe/Amsterdam": "NL",
|
|
2101
|
+
"Europe/Athens": "GR",
|
|
2102
|
+
"Europe/Belfast": "GB",
|
|
2103
|
+
"Europe/Berlin": "DE",
|
|
2104
|
+
"Europe/Bratislava": "SK",
|
|
2105
|
+
"Europe/Brussels": "BE",
|
|
2106
|
+
"Europe/Bucharest": "RO",
|
|
2107
|
+
"Europe/Budapest": "HU",
|
|
2108
|
+
"Europe/Busingen": "DE",
|
|
2109
|
+
"Europe/Copenhagen": "DK",
|
|
2110
|
+
"Europe/Dublin": "IE",
|
|
2111
|
+
"Europe/Helsinki": "FI",
|
|
2112
|
+
"Europe/Lisbon": "PT",
|
|
2113
|
+
"Europe/Ljubljana": "SI",
|
|
2114
|
+
"Europe/London": "GB",
|
|
2115
|
+
"Europe/Luxembourg": "LU",
|
|
2116
|
+
"Europe/Madrid": "ES",
|
|
2117
|
+
"Europe/Malta": "MT",
|
|
2118
|
+
"Europe/Nicosia": "CY",
|
|
2119
|
+
"Europe/Oslo": "NO",
|
|
2120
|
+
"Europe/Paris": "FR",
|
|
2121
|
+
"Europe/Prague": "CZ",
|
|
2122
|
+
"Europe/Riga": "LV",
|
|
2123
|
+
"Europe/Rome": "IT",
|
|
2124
|
+
"Europe/Sofia": "BG",
|
|
2125
|
+
"Europe/Stockholm": "SE",
|
|
2126
|
+
"Europe/Tallinn": "EE",
|
|
2127
|
+
"Europe/Vaduz": "LI",
|
|
2128
|
+
"Europe/Vienna": "AT",
|
|
2129
|
+
"Europe/Vilnius": "LT",
|
|
2130
|
+
"Europe/Warsaw": "PL",
|
|
2131
|
+
"Europe/Zagreb": "HR"
|
|
2132
|
+
}, or = {
|
|
2133
|
+
"Europe/London": [
|
|
2134
|
+
"JE",
|
|
2135
|
+
"GG",
|
|
2136
|
+
"IM"
|
|
2137
|
+
],
|
|
2138
|
+
"Europe/Paris": [
|
|
2139
|
+
"MC"
|
|
2140
|
+
],
|
|
2141
|
+
"Europe/Rome": [
|
|
2142
|
+
"SM",
|
|
2143
|
+
"VA"
|
|
2144
|
+
],
|
|
2145
|
+
"Asia/Bangkok": [
|
|
2146
|
+
"KH",
|
|
2147
|
+
"LA",
|
|
2148
|
+
"VN"
|
|
2149
|
+
]
|
|
2150
|
+
}, ge = {
|
|
2151
|
+
zones: nr,
|
|
2152
|
+
shared: or
|
|
2153
|
+
}, fe = "smartconsent_geo", rr = 24 * 60 * 60 * 1e3, J = "ZZ", ar = ge.zones, sr = ge.shared;
|
|
2154
|
+
function ir() {
|
|
2155
|
+
try {
|
|
2156
|
+
const t = sessionStorage.getItem(fe);
|
|
2157
|
+
if (!t) return null;
|
|
2158
|
+
const e = JSON.parse(t);
|
|
2159
|
+
return Date.now() - e.timestamp > rr ? null : { country: e.country, state: e.state, source: "cache" };
|
|
2160
|
+
} catch {
|
|
2161
|
+
return null;
|
|
2162
|
+
}
|
|
2163
|
+
}
|
|
2164
|
+
function cr(t, e) {
|
|
2165
|
+
try {
|
|
2166
|
+
const o = { country: t, state: e, timestamp: Date.now() };
|
|
2167
|
+
sessionStorage.setItem(fe, JSON.stringify(o));
|
|
2168
|
+
} catch {
|
|
2169
|
+
}
|
|
2170
|
+
}
|
|
2171
|
+
function ur() {
|
|
2172
|
+
try {
|
|
2173
|
+
return new Intl.DateTimeFormat().resolvedOptions().timeZone || null;
|
|
2174
|
+
} catch {
|
|
2175
|
+
return null;
|
|
2176
|
+
}
|
|
2177
|
+
}
|
|
2178
|
+
function lr() {
|
|
2179
|
+
try {
|
|
2180
|
+
const t = /^[A-Za-z]{2,3}-(?:[A-Za-z]{4}-)?([A-Za-z]{2})\b/.exec(navigator.language || "");
|
|
2181
|
+
return t ? t[1].toUpperCase() : "";
|
|
2182
|
+
} catch {
|
|
2183
|
+
return "";
|
|
2184
|
+
}
|
|
2185
|
+
}
|
|
2186
|
+
async function dr() {
|
|
2187
|
+
var i;
|
|
2188
|
+
const t = ir();
|
|
2189
|
+
if (t) return t;
|
|
2190
|
+
const e = ur();
|
|
2191
|
+
if (!e) return { country: J, source: "fallback" };
|
|
2192
|
+
const o = ar[e];
|
|
2193
|
+
if (!o) return { country: J, source: "timezone" };
|
|
2194
|
+
if ((i = sr[e]) != null && i.includes(lr())) return { country: J, source: "timezone" };
|
|
2195
|
+
const [a, u] = o.split("-");
|
|
2196
|
+
return cr(a, u), { country: a, state: u, source: "timezone" };
|
|
2197
|
+
}
|
|
2198
|
+
function mr(t) {
|
|
2199
|
+
const e = _e(null);
|
|
2200
|
+
return oe(() => {
|
|
2201
|
+
let o = !1;
|
|
2202
|
+
async function a() {
|
|
2203
|
+
const u = Qo(), i = await dr();
|
|
2204
|
+
if (o) return;
|
|
2205
|
+
const c = er(i, u), m = {
|
|
2206
|
+
version: t.version ?? 1,
|
|
2207
|
+
...t.theme && { theme: t.theme },
|
|
2208
|
+
...t.webhookUrl && { webhookUrl: t.webhookUrl },
|
|
2209
|
+
...t.attribution !== void 0 && { attribution: t.attribution },
|
|
2210
|
+
...t.attributionUrl && { attributionUrl: t.attributionUrl },
|
|
2211
|
+
...t.showBadge !== void 0 && { showBadge: t.showBadge },
|
|
2212
|
+
...t.badgePosition && { badgePosition: t.badgePosition },
|
|
2213
|
+
...t.consentMode !== void 0 && { consentMode: t.consentMode },
|
|
2214
|
+
categories: c.categories
|
|
2215
|
+
};
|
|
2216
|
+
let l;
|
|
2217
|
+
try {
|
|
2218
|
+
l = we(m);
|
|
2219
|
+
} catch {
|
|
2220
|
+
return;
|
|
2221
|
+
}
|
|
2222
|
+
if (o) return;
|
|
2223
|
+
const f = Ae(l), _ = Ee(l), b = qe(l, f), g = Re(f);
|
|
2224
|
+
f.onConsentChange((A) => _.send(A));
|
|
2225
|
+
const h = Ce(f, l, c);
|
|
2226
|
+
b.init(), g.init(), Ne(l.theme);
|
|
2227
|
+
let d = O(f, l);
|
|
2228
|
+
const x = He(l, () => {
|
|
2229
|
+
x.hide(), d = O(f, l), d.show();
|
|
2230
|
+
});
|
|
2231
|
+
f.onConsentChange(() => {
|
|
2232
|
+
setTimeout(() => {
|
|
2233
|
+
f.needsConsent() || x.show();
|
|
2234
|
+
}, 0);
|
|
2235
|
+
}), h ? x.show() : f.needsConsent() ? d.show() : x.show(), window.SmartConsent = {
|
|
2236
|
+
hasConsent: (A) => f.hasConsent(A),
|
|
2237
|
+
getConsent: () => f.getState(),
|
|
2238
|
+
show: () => {
|
|
2239
|
+
x.hide(), d = O(f, l), d.show();
|
|
2240
|
+
},
|
|
2241
|
+
reset: () => {
|
|
2242
|
+
d.destroy(), x.destroy(), f.reset(), d = O(f, l), d.show();
|
|
2243
|
+
}
|
|
2244
|
+
}, e.current = () => {
|
|
2245
|
+
d.destroy(), x.destroy(), g.destroy(), b.destroy(), Be();
|
|
2246
|
+
};
|
|
2247
|
+
}
|
|
2248
|
+
return a(), () => {
|
|
2249
|
+
o = !0, e.current && (e.current(), e.current = null);
|
|
2250
|
+
};
|
|
2251
|
+
}, []), oe(() => {
|
|
2252
|
+
if (t.onConsentChange)
|
|
2253
|
+
return ne(t.onConsentChange);
|
|
2254
|
+
}, [t.onConsentChange]), null;
|
|
2255
|
+
}
|
|
2256
|
+
export {
|
|
2257
|
+
mr as SmartConsent,
|
|
2258
|
+
mr as default
|
|
2259
|
+
};
|
|
2260
|
+
//# sourceMappingURL=SmartConsent.js.map
|