@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.
Files changed (92) hide show
  1. package/LICENSE +73 -0
  2. package/README.md +292 -2
  3. package/dist/blocking/attribute-blocker.d.ts +18 -0
  4. package/dist/blocking/gtm-consent-mode.d.ts +19 -0
  5. package/dist/blocking/uet-consent.d.ts +9 -0
  6. package/dist/capsules/banner-experiment.d.ts +2 -0
  7. package/dist/capsules/banner-experiment.js +1 -0
  8. package/dist/capsules/country-banners.d.ts +2 -0
  9. package/dist/capsules/country-banners.js +1 -0
  10. package/dist/capsules/loader.d.ts +8 -0
  11. package/dist/capsules/subdomain-consent.d.ts +5 -0
  12. package/dist/capsules/subdomain-consent.js +1 -0
  13. package/dist/config/schema.d.ts +19 -0
  14. package/dist/config/validator.d.ts +8 -0
  15. package/dist/core/consent-log.d.ts +14 -0
  16. package/dist/core/consent-manager.d.ts +13 -0
  17. package/dist/core/consent-stats.d.ts +13 -0
  18. package/dist/core/events.d.ts +5 -0
  19. package/dist/core/gpc.d.ts +5 -0
  20. package/dist/core/storage.d.ts +9 -0
  21. package/dist/geo/detector.d.ts +3 -0
  22. package/dist/i18n/langs/ar.d.ts +1 -0
  23. package/dist/i18n/langs/cs.d.ts +1 -0
  24. package/dist/i18n/langs/da.d.ts +1 -0
  25. package/dist/i18n/langs/de.d.ts +1 -0
  26. package/dist/i18n/langs/es.d.ts +1 -0
  27. package/dist/i18n/langs/fr.d.ts +1 -0
  28. package/dist/i18n/langs/hi.d.ts +1 -0
  29. package/dist/i18n/langs/it.d.ts +1 -0
  30. package/dist/i18n/langs/ja.d.ts +1 -0
  31. package/dist/i18n/langs/ko.d.ts +1 -0
  32. package/dist/i18n/langs/nl.d.ts +1 -0
  33. package/dist/i18n/langs/no.d.ts +1 -0
  34. package/dist/i18n/langs/pl.d.ts +1 -0
  35. package/dist/i18n/langs/pt.d.ts +1 -0
  36. package/dist/i18n/langs/ro.d.ts +1 -0
  37. package/dist/i18n/langs/ru.d.ts +1 -0
  38. package/dist/i18n/langs/sv.d.ts +1 -0
  39. package/dist/i18n/langs/tr.d.ts +1 -0
  40. package/dist/i18n/langs/zh.d.ts +1 -0
  41. package/dist/i18n/loader.d.ts +11 -0
  42. package/dist/i18n/remote.d.ts +23 -0
  43. package/dist/i18n/translations.d.ts +14 -0
  44. package/dist/index.d.ts +10 -0
  45. package/dist/lang/ar.json +1 -0
  46. package/dist/lang/cs.json +1 -0
  47. package/dist/lang/da.json +1 -0
  48. package/dist/lang/de.json +1 -0
  49. package/dist/lang/es.json +1 -0
  50. package/dist/lang/fr.json +1 -0
  51. package/dist/lang/hi.json +1 -0
  52. package/dist/lang/it.json +1 -0
  53. package/dist/lang/ja.json +1 -0
  54. package/dist/lang/ko.json +1 -0
  55. package/dist/lang/nl.json +1 -0
  56. package/dist/lang/no.json +1 -0
  57. package/dist/lang/pl.json +1 -0
  58. package/dist/lang/pt.json +1 -0
  59. package/dist/lang/ro.json +1 -0
  60. package/dist/lang/ru.json +1 -0
  61. package/dist/lang/sv.json +1 -0
  62. package/dist/lang/tr.json +1 -0
  63. package/dist/lang/zh.json +1 -0
  64. package/dist/react/SmartConsent.d.ts +14 -0
  65. package/dist/react/SmartConsent.js +2260 -0
  66. package/dist/react/SmartConsent.js.map +1 -0
  67. package/dist/regulations/loader.d.ts +3 -0
  68. package/dist/regulations/reasoner.d.ts +6 -0
  69. package/dist/regulations/schema.d.ts +8 -0
  70. package/dist/site/consent-records.d.ts +26 -0
  71. package/dist/site/settings.d.ts +48 -0
  72. package/dist/smartconsent.es.js +3063 -0
  73. package/dist/smartconsent.es.js.map +1 -0
  74. package/dist/smartconsent.js +3962 -0
  75. package/dist/smartconsent.js.map +1 -0
  76. package/dist/smartconsent.min.js +534 -0
  77. package/dist/smartconsent.min.js.map +1 -0
  78. package/dist/types.d.ts +377 -0
  79. package/dist/ui/a11y.d.ts +4 -0
  80. package/dist/ui/attribution-guard.d.ts +3 -0
  81. package/dist/ui/badge.d.ts +7 -0
  82. package/dist/ui/banner.d.ts +10 -0
  83. package/dist/ui/cookie-policy.d.ts +8 -0
  84. package/dist/ui/cookie-table.d.ts +7 -0
  85. package/dist/ui/credit.d.ts +15 -0
  86. package/dist/ui/embed-placeholder.d.ts +7 -0
  87. package/dist/ui/opt-out-notice.d.ts +7 -0
  88. package/dist/ui/styles.d.ts +3 -0
  89. package/dist/webhook.d.ts +5 -0
  90. package/package.json +100 -4
  91. package/templates/privacy-policy-template.md +135 -0
  92. package/templates/vanilla.html +116 -0
@@ -0,0 +1,3063 @@
1
+ const le = [
2
+ {
3
+ id: "essential",
4
+ label: "Essential",
5
+ description: "Required for the website to function. Cannot be disabled.",
6
+ required: !0
7
+ },
8
+ {
9
+ id: "analytics",
10
+ label: "Analytics",
11
+ description: "Help us understand how visitors interact with our website.",
12
+ required: !1
13
+ },
14
+ {
15
+ id: "functional",
16
+ label: "Functional",
17
+ description: "Enable personalised features and remember your preferences.",
18
+ required: !1
19
+ },
20
+ {
21
+ id: "marketing",
22
+ label: "Marketing",
23
+ description: "Used to deliver relevant advertisements and track campaign performance.",
24
+ required: !1
25
+ }
26
+ ], pt = {
27
+ bg: "#FFFFFF",
28
+ surface: "#F4F6F8",
29
+ border: "#DCE1E7",
30
+ text: "#182230",
31
+ textMuted: "#526071",
32
+ accent: "#33465F",
33
+ accept: "#33465F",
34
+ reject: "#33465F",
35
+ toggleOn: "#33465F",
36
+ toggleOff: "#778496",
37
+ radius: "12px",
38
+ font: "system-ui, sans-serif"
39
+ }, X = {
40
+ heading: "Cookie Preferences",
41
+ description: "We use cookies to improve your experience.",
42
+ acceptAll: "Accept All",
43
+ rejectOptional: "Reject Optional",
44
+ managePreferences: "Manage Preferences",
45
+ essentialOnly: "Essential Only",
46
+ savePreferences: "Save Preferences",
47
+ poweredBy: "Powered by SmartGenie",
48
+ doNotSell: "Do Not Sell or Share My Personal Information",
49
+ cookieSettings: "Cookie settings",
50
+ dataRequest: "Your data rights",
51
+ policyCredit: "Cookie consent by SmartConsent from SmartGenie",
52
+ embedNotice: "This content is from {service}. Loading it may set cookies.",
53
+ embedLoad: "Load content"
54
+ }, mt = "https://smartconsentsettings.blob.core.windows.net/$web", ft = "https://cdn.smartgenie.co.uk/v1/", $e = "https://api.smartgenie.co.uk", ae = {
55
+ version: 0,
56
+ categories: le,
57
+ theme: pt,
58
+ position: "bottom",
59
+ badgePosition: "bottom-right",
60
+ showBadge: !0,
61
+ attribution: !0,
62
+ attributionUrl: "https://www.smartgenie.co.uk/smartconsent",
63
+ consentMode: !0,
64
+ expiry: 13,
65
+ texts: X,
66
+ dir: "ltr",
67
+ layout: "box",
68
+ boxPosition: "bottom-right",
69
+ cookies: []
70
+ }, gt = 1, ht = 13;
71
+ function bt(t) {
72
+ if (t == null || typeof t != "object")
73
+ throw new Error("SmartConsent: config must be an object");
74
+ const e = t;
75
+ if (e.version === void 0 || e.version === null)
76
+ throw new Error("SmartConsent: config.version is required");
77
+ if (typeof e.version != "number" || !Number.isFinite(e.version))
78
+ throw new Error("SmartConsent: config.version must be a finite number");
79
+ const n = {
80
+ ...ae,
81
+ version: e.version
82
+ };
83
+ if (Array.isArray(e.categories) && (n.categories = e.categories), e.theme !== void 0 && typeof e.theme == "object" && e.theme !== null && (n.theme = { ...ae.theme, ...e.theme }), e.texts !== void 0 && typeof e.texts == "object" && e.texts !== null && (n.texts = { ...ae.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(ht, 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)) {
84
+ const o = [];
85
+ for (const a of e.cookies)
86
+ if (a && typeof a == "object") {
87
+ const s = a;
88
+ typeof s.name == "string" && typeof s.category == "string" ? o.push({
89
+ name: s.name,
90
+ category: s.category,
91
+ ...typeof s.domain == "string" && { domain: s.domain },
92
+ ...typeof s.description == "string" && { description: s.description },
93
+ ...typeof s.duration == "string" && { duration: s.duration },
94
+ ...(s.party === "first" || s.party === "third") && { party: s.party }
95
+ }) : console.warn("SmartConsent: Skipping invalid cookie declaration:", s);
96
+ }
97
+ n.cookies = o;
98
+ }
99
+ if (e.logo && typeof e.logo == "object") {
100
+ const o = e.logo;
101
+ typeof o.src == "string" && typeof o.alt == "string" && (n.logo = {
102
+ src: o.src,
103
+ alt: o.alt,
104
+ ...typeof o.width == "number" && { width: o.width },
105
+ ...typeof o.height == "number" && { height: o.height }
106
+ });
107
+ }
108
+ return n;
109
+ }
110
+ const de = "smartconsent_state";
111
+ function Ye() {
112
+ function t() {
113
+ try {
114
+ const e = localStorage.getItem(de);
115
+ return e ? JSON.parse(e) : null;
116
+ } catch {
117
+ return null;
118
+ }
119
+ }
120
+ return {
121
+ getConsent() {
122
+ return t();
123
+ },
124
+ saveConsent(e) {
125
+ try {
126
+ localStorage.setItem(de, JSON.stringify(e));
127
+ } catch {
128
+ }
129
+ },
130
+ clearConsent() {
131
+ try {
132
+ localStorage.removeItem(de);
133
+ } catch {
134
+ }
135
+ },
136
+ isExpired() {
137
+ const e = t();
138
+ return !e || !e.expiresAt ? !0 : new Date(e.expiresAt).getTime() <= Date.now();
139
+ },
140
+ isVersionMatch(e) {
141
+ const n = t();
142
+ return n ? n.version === e : !1;
143
+ }
144
+ };
145
+ }
146
+ const ye = "smartconsent:update";
147
+ function _t(t) {
148
+ window.dispatchEvent(new CustomEvent(ye, { detail: t }));
149
+ }
150
+ function Ae(t) {
151
+ const e = (n) => {
152
+ t(n.detail);
153
+ };
154
+ return window.addEventListener(ye, e), () => window.removeEventListener(ye, e);
155
+ }
156
+ function yt(t) {
157
+ const e = Ye();
158
+ function n() {
159
+ const i = e.getConsent();
160
+ return i ? e.isExpired() || !e.isVersionMatch(t.version) ? (e.clearConsent(), null) : i : null;
161
+ }
162
+ function o(i) {
163
+ const l = {};
164
+ for (const d of t.categories)
165
+ l[d.id] = d.required ? !0 : i;
166
+ return l;
167
+ }
168
+ function a() {
169
+ const i = /* @__PURE__ */ new Date();
170
+ return i.setMonth(i.getMonth() + t.expiry), i.toISOString();
171
+ }
172
+ function s(i, l) {
173
+ const d = (/* @__PURE__ */ new Date()).toISOString(), h = {
174
+ version: t.version,
175
+ categories: i,
176
+ timestamp: d,
177
+ action: l,
178
+ expiresAt: a()
179
+ };
180
+ e.saveConsent(h);
181
+ const f = {
182
+ categories: i,
183
+ action: l,
184
+ timestamp: d,
185
+ version: t.version
186
+ };
187
+ _t(f), t.onConsent && t.onConsent(h);
188
+ }
189
+ return {
190
+ acceptAll() {
191
+ s(o(!0), "accept_all");
192
+ },
193
+ rejectOptional() {
194
+ s(o(!1), "reject_optional");
195
+ },
196
+ saveCustom(i) {
197
+ const l = {};
198
+ for (const d of t.categories)
199
+ d.required ? l[d.id] = !0 : l[d.id] = i[d.id] ?? !1;
200
+ s(l, "custom");
201
+ },
202
+ withdraw() {
203
+ s(o(!1), "withdraw");
204
+ },
205
+ reset() {
206
+ e.clearConsent();
207
+ },
208
+ getState() {
209
+ return n();
210
+ },
211
+ hasConsent(i) {
212
+ const l = n();
213
+ return l ? l.categories[i] === !0 : !1;
214
+ },
215
+ needsConsent() {
216
+ return n() === null;
217
+ },
218
+ onConsentChange(i) {
219
+ return Ae(i);
220
+ }
221
+ };
222
+ }
223
+ function wt(t, e, n) {
224
+ const o = typeof navigator < "u" ? navigator : null, s = !!o && (o.globalPrivacyControl === !0 || o.doNotTrack === "1") && n.signals.gpc_auto_reject;
225
+ if (s) {
226
+ const i = t.getState(), l = !!i && e.categories.some((d) => !d.required && i.categories[d.id] === !0);
227
+ (!i || l) && t.rejectOptional();
228
+ }
229
+ return s;
230
+ }
231
+ const pe = "smartconsent_log", qe = 100;
232
+ function vt(t) {
233
+ function e() {
234
+ try {
235
+ const a = localStorage.getItem(pe);
236
+ return a ? JSON.parse(a) : [];
237
+ } catch {
238
+ return [];
239
+ }
240
+ }
241
+ function n(a) {
242
+ try {
243
+ localStorage.setItem(pe, JSON.stringify(a));
244
+ } catch {
245
+ }
246
+ }
247
+ function o() {
248
+ try {
249
+ return crypto.randomUUID();
250
+ } catch {
251
+ return Date.now().toString(36) + Math.random().toString(36).slice(2);
252
+ }
253
+ }
254
+ return {
255
+ addRecord(a, s) {
256
+ const i = {
257
+ id: o(),
258
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
259
+ action: a,
260
+ categories: { ...s },
261
+ visitorHash: t.visitorHash,
262
+ version: t.version,
263
+ jurisdiction: t.jurisdiction
264
+ }, l = e();
265
+ return l.push(i), n(l.length > qe ? l.slice(-qe) : l), i;
266
+ },
267
+ getLog() {
268
+ return e();
269
+ },
270
+ getLatest() {
271
+ const a = e();
272
+ return a.length > 0 ? a[a.length - 1] : null;
273
+ },
274
+ clear() {
275
+ try {
276
+ localStorage.removeItem(pe);
277
+ } catch {
278
+ }
279
+ }
280
+ };
281
+ }
282
+ async function xt() {
283
+ const t = [navigator.userAgent, screen.width, screen.height, (/* @__PURE__ */ new Date()).getTimezoneOffset(), navigator.language].join("|");
284
+ try {
285
+ const e = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(t));
286
+ return Array.from(new Uint8Array(e), (n) => n.toString(16).padStart(2, "0")).join("");
287
+ } catch {
288
+ let e = 2166136261;
289
+ for (let n = 0; n < t.length; n++)
290
+ e ^= t.charCodeAt(n), e = Math.imul(e, 16777619);
291
+ return (e >>> 0).toString(16).padStart(8, "0");
292
+ }
293
+ }
294
+ function Ct(t) {
295
+ return {
296
+ send(e, n) {
297
+ if (!t.webhookUrl) return;
298
+ const o = {
299
+ action: e.action,
300
+ categories: e.categories,
301
+ version: e.version,
302
+ timestamp: e.timestamp,
303
+ pageUrl: window.location.href,
304
+ userAgent: navigator.userAgent,
305
+ ...n && {
306
+ recordId: n.id,
307
+ visitorHash: n.visitorHash,
308
+ jurisdiction: n.jurisdiction
309
+ }
310
+ };
311
+ try {
312
+ fetch(t.webhookUrl, {
313
+ method: "POST",
314
+ headers: { "Content-Type": "application/json" },
315
+ body: JSON.stringify(o)
316
+ }).catch(() => {
317
+ });
318
+ } catch {
319
+ }
320
+ }
321
+ };
322
+ }
323
+ function je(t) {
324
+ return {
325
+ analytics_storage: t.analytics ? "granted" : "denied",
326
+ ad_storage: t.marketing ? "granted" : "denied",
327
+ ad_user_data: t.marketing ? "granted" : "denied",
328
+ ad_personalization: t.marketing ? "granted" : "denied",
329
+ functionality_storage: t.functional ? "granted" : "denied",
330
+ personalization_storage: t.functional ? "granted" : "denied",
331
+ security_storage: "granted"
332
+ // always granted (essential)
333
+ };
334
+ }
335
+ function ke() {
336
+ window.dataLayer || (window.dataLayer = []), window.gtag || (window.gtag = function(...t) {
337
+ window.dataLayer.push(t);
338
+ });
339
+ }
340
+ const Je = {
341
+ analytics_storage: "denied",
342
+ ad_storage: "denied",
343
+ ad_user_data: "denied",
344
+ ad_personalization: "denied",
345
+ functionality_storage: "denied",
346
+ personalization_storage: "denied",
347
+ security_storage: "granted"
348
+ };
349
+ function Ze() {
350
+ ke(), window.gtag("consent", "default", { ...Je, wait_for_update: 500 });
351
+ }
352
+ function At() {
353
+ ke(), window.gtag("consent", "update", { ...Je });
354
+ }
355
+ function kt(t, e) {
356
+ let n = null;
357
+ return {
358
+ init(o) {
359
+ if (!t.consentMode) return;
360
+ o != null && o.defaultSent || Ze(), ke(), n = Ae((s) => {
361
+ window.gtag("consent", "update", je(s.categories));
362
+ });
363
+ const a = e.getState();
364
+ a && window.gtag("consent", "update", je(a.categories));
365
+ },
366
+ destroy() {
367
+ n && (n(), n = null);
368
+ }
369
+ };
370
+ }
371
+ function Xe(t, e) {
372
+ (window.uetq = window.uetq || []).push("consent", t, { ad_storage: e ? "granted" : "denied" });
373
+ }
374
+ function Et() {
375
+ Xe("default", !1);
376
+ }
377
+ function me(t) {
378
+ Xe("update", t);
379
+ }
380
+ function Re(t, e) {
381
+ return t && /^\d+(\.\d+)?$/.test(t.trim()) ? t.trim() + "px" : (t == null ? void 0 : t.trim()) || e;
382
+ }
383
+ function St(t, e) {
384
+ const n = document.createElement("div");
385
+ n.setAttribute("data-smartconsent", "embed"), n.setAttribute("role", "region");
386
+ const o = Re(t.getAttribute("width"), t.style.width), a = Re(t.getAttribute("height"), t.style.height);
387
+ o && n.style.setProperty("--sc-embed-w", o), a && n.style.setProperty("--sc-embed-h", a);
388
+ const s = document.createElement("p"), i = document.createElement("button");
389
+ return i.type = "button", i.addEventListener("click", e), n.append(s, i), n;
390
+ }
391
+ function Le(t, e, n) {
392
+ const o = n.embedNotice.split("{service}").join(e);
393
+ t.setAttribute("aria-label", o), t.firstChild.textContent = o;
394
+ const a = t.lastChild;
395
+ a.textContent = n.embedLoad, a.setAttribute("aria-label", `${n.embedLoad}: ${e}`);
396
+ }
397
+ const ne = "data-smartconsent-blocked", Pe = document.createElement, $t = "cdn.smartgenie.co.uk", fe = "", Ie = "\0", Ne = Node.prototype.appendChild, Te = Node.prototype.insertBefore, Y = Node.prototype.replaceChild, Be = Element.prototype.append;
398
+ function qt(t) {
399
+ let e = null, n = null, o = null;
400
+ const a = [], s = [];
401
+ let i = X, l = /* @__PURE__ */ new WeakSet(), d, h = /* @__PURE__ */ new WeakSet();
402
+ function f(r) {
403
+ if (!r) return null;
404
+ try {
405
+ const c = new URL(r, location.href);
406
+ return /^https?:$/.test(c.protocol) && c.hostname !== location.hostname && c.hostname !== $t ? c : null;
407
+ } catch {
408
+ return null;
409
+ }
410
+ }
411
+ function g(r) {
412
+ if (!r) return null;
413
+ const c = r.hostname.toLowerCase(), p = (c + r.pathname).toLowerCase();
414
+ for (const [b, A] of d || [])
415
+ if (b.includes("/") ? p.includes(b) : c === b || c.endsWith("." + b)) return A;
416
+ return null;
417
+ }
418
+ function _(r, c) {
419
+ if (d === void 0) return null;
420
+ const p = f(r);
421
+ return p ? d ? g(p) : c ? fe : null : null;
422
+ }
423
+ function u(r) {
424
+ return e ? e.hasConsent(r) : !1;
425
+ }
426
+ function m(r) {
427
+ return r.getAttribute(ne) === "true";
428
+ }
429
+ function T(r) {
430
+ return r.type !== "text/plain" || m(r);
431
+ }
432
+ function $(r, c) {
433
+ const p = r.getAttribute("src") || r.getAttribute("data-original-src"), b = r.textContent || null, A = [];
434
+ for (const w of Array.from(r.attributes))
435
+ w.name !== "type" && w.name !== "src" && w.name !== "data-original-src" && A.push({ name: w.name, value: w.value });
436
+ return { node: r, src: p, content: b, category: c, attributes: A };
437
+ }
438
+ function x(r) {
439
+ const c = a.findIndex((p) => p.node === r.node);
440
+ if (c >= 0) {
441
+ a[c] = r;
442
+ return;
443
+ }
444
+ a.push(r);
445
+ }
446
+ function k(r, c) {
447
+ const p = $(r, c);
448
+ x(p), r.setAttribute(ne, "true"), r.type = "text/plain", p.src && (r.setAttribute("data-original-src", p.src), r.removeAttribute("src"));
449
+ }
450
+ function G(r) {
451
+ const c = document.createElement("script");
452
+ for (const b of r.attributes)
453
+ c.setAttribute(b.name, b.value);
454
+ if (c.removeAttribute("type"), c.removeAttribute(ne), r.src ? c.src = r.src : r.content && (c.textContent = r.content), r.node.parentNode) {
455
+ r.node.parentNode.replaceChild(c, r.node);
456
+ return;
457
+ }
458
+ (document.body || document.head || document.documentElement).appendChild(c);
459
+ }
460
+ function K(r, c = !1) {
461
+ var b;
462
+ const p = r.getAttribute("data-consent-category") ?? ((b = a.find((A) => A.node === r)) == null ? void 0 : b.category) ?? _(r.getAttribute("src"), c || h.has(r) || r.hasAttribute("async"));
463
+ p === null || u(p) || !T(r) || k(r, p);
464
+ }
465
+ function P(r) {
466
+ var c;
467
+ return (((c = f(r.getAttribute("data-original-src"))) == null ? void 0 : c.hostname) ?? "").replace(/^www\./, "");
468
+ }
469
+ function q(r) {
470
+ const c = r.node.parentNode;
471
+ r.category === fe || r.box || !c || (r.box = St(r.node, () => {
472
+ s.splice(s.indexOf(r), 1), l.add(r.node), C(r);
473
+ }), Le(r.box, P(r.node), i), Y.call(c, r.box, r.node));
474
+ }
475
+ function C(r) {
476
+ const c = r.box;
477
+ r.box = void 0, c != null && c.parentNode && Y.call(c.parentNode, r.node, c);
478
+ const p = r.node.getAttribute("data-original-src");
479
+ r.node.removeAttribute("data-original-src"), p && r.node.setAttribute("src", p);
480
+ }
481
+ function M(r) {
482
+ if (l.has(r)) return;
483
+ const c = s.find((w) => w.node === r);
484
+ if (c) return q(c);
485
+ const p = r.getAttribute("src"), b = _(p, !0);
486
+ if (b === null || u(b)) return;
487
+ r.setAttribute("data-original-src", p), r.removeAttribute("src");
488
+ const A = { node: r, category: b };
489
+ s.push(A), q(A);
490
+ }
491
+ function I(r, c) {
492
+ r instanceof HTMLScriptElement ? K(r, c) : r instanceof HTMLIFrameElement && M(r);
493
+ }
494
+ function S(r, c = !0) {
495
+ if (r instanceof Element && I(r, c), r instanceof Element || r instanceof DocumentFragment)
496
+ for (const p of Array.from(r.querySelectorAll("script, iframe"))) I(p, c);
497
+ return r;
498
+ }
499
+ function R() {
500
+ for (const r of Array.from(document.querySelectorAll("script, iframe"))) I(r, !1);
501
+ }
502
+ function N(r) {
503
+ var p;
504
+ const c = document.querySelectorAll(
505
+ `script[type="text/plain"][data-consent-category]:not([${ne}="true"])`
506
+ );
507
+ for (const b of c)
508
+ try {
509
+ const A = b.getAttribute("data-consent-category");
510
+ if (!r(A)) continue;
511
+ const w = b.getAttribute("data-original-src") || b.getAttribute("src"), E = b.textContent, L = document.createElement("script");
512
+ for (const D of Array.from(b.attributes))
513
+ D.name !== "type" && D.name !== "data-original-src" && L.setAttribute(D.name, D.value);
514
+ w ? L.src = w : E && (L.textContent = E), (p = b.parentNode) == null || p.replaceChild(L, b);
515
+ } catch {
516
+ }
517
+ }
518
+ function v(r) {
519
+ const c = [], p = [];
520
+ for (const b of s.splice(0)) {
521
+ if (!r(b.category)) {
522
+ s.push(b);
523
+ continue;
524
+ }
525
+ C(b);
526
+ }
527
+ for (const b of a)
528
+ r(b.category) ? c.push(b) : p.push(b);
529
+ a.length = 0, a.push(...p);
530
+ for (const b of c)
531
+ try {
532
+ G(b);
533
+ } catch {
534
+ }
535
+ N(r);
536
+ }
537
+ function O(r) {
538
+ v((c) => r.categories[c] === !0);
539
+ }
540
+ function B() {
541
+ v((r) => u(r));
542
+ }
543
+ return {
544
+ init() {
545
+ R(), n = new MutationObserver((r) => {
546
+ for (const c of r)
547
+ for (const p of Array.from(c.addedNodes))
548
+ S(p, !1);
549
+ e && N(u);
550
+ }), n.observe(document.documentElement, { childList: !0, subtree: !0 }), document.createElement = function(r, c) {
551
+ const p = Pe.call(document, r, c), b = String(r).toLowerCase();
552
+ if (b === "script" || b === "iframe") {
553
+ h.add(p);
554
+ const A = p.setAttribute.bind(p);
555
+ p.setAttribute = (L, D) => {
556
+ A(L, D), (L === "data-consent-category" || L === "src") && I(p, !0);
557
+ };
558
+ const w = b === "script" ? HTMLScriptElement.prototype : HTMLIFrameElement.prototype, E = Object.getOwnPropertyDescriptor(w, "src");
559
+ E != null && E.get && E.set && Object.defineProperty(p, "src", {
560
+ configurable: !0,
561
+ enumerable: !0,
562
+ get() {
563
+ return E.get.call(this);
564
+ },
565
+ set(L) {
566
+ E.set.call(this, L), I(p, !0);
567
+ }
568
+ });
569
+ }
570
+ return p;
571
+ }, Node.prototype.appendChild = function(r) {
572
+ return Ne.call(this, S(r));
573
+ }, Node.prototype.insertBefore = function(r, c) {
574
+ return Te.call(this, S(r), c);
575
+ }, Node.prototype.replaceChild = function(r, c) {
576
+ return Y.call(this, S(r), c);
577
+ }, Element.prototype.append = function(...r) {
578
+ Be.apply(
579
+ this,
580
+ r.map((c) => typeof c == "string" ? c : S(c))
581
+ );
582
+ }, e && (o = e.onConsentChange(O), B());
583
+ },
584
+ attach(r) {
585
+ o = r.onConsentChange(O), e = r, B();
586
+ },
587
+ setRules(r) {
588
+ const c = d === null;
589
+ if (d = r, !(!c || !r)) {
590
+ for (const p of [...a, ...s]) {
591
+ if (p.category !== fe) continue;
592
+ const b = "src" in p ? p.src : p.node.getAttribute("data-original-src");
593
+ p.category = g(f(b)) ?? Ie;
594
+ }
595
+ v((p) => p === Ie || u(p));
596
+ for (const p of s) q(p);
597
+ }
598
+ },
599
+ setTexts(r) {
600
+ i = r;
601
+ for (const c of s) c.box && Le(c.box, P(c.node), r);
602
+ },
603
+ destroy() {
604
+ n && (n.disconnect(), n = null), document.createElement = Pe, Node.prototype.appendChild = Ne, Node.prototype.insertBefore = Te, Node.prototype.replaceChild = Y, Element.prototype.append = Be, o && (o(), o = null), e = null, a.length = 0;
605
+ for (const r of s) {
606
+ const c = r.box;
607
+ c != null && c.parentNode && Y.call(c.parentNode, r.node, c);
608
+ }
609
+ s.length = 0, l = /* @__PURE__ */ new WeakSet(), i = X, d = void 0, h = /* @__PURE__ */ new WeakSet();
610
+ }
611
+ };
612
+ }
613
+ const De = "smartconsent-styles";
614
+ function jt(t) {
615
+ if (document.getElementById(De)) return;
616
+ const e = document.createElement("style");
617
+ e.id = De, e.textContent = Rt(t), document.head.appendChild(e);
618
+ }
619
+ function Rt(t) {
620
+ return `
621
+ [data-smartconsent] {
622
+ --sc-bg: ${t.bg};
623
+ --sc-surface: ${t.surface};
624
+ --sc-border: ${t.border};
625
+ --sc-text: ${t.text};
626
+ --sc-text-muted: ${t.textMuted};
627
+ --sc-accent: ${t.accent};
628
+ --sc-accept: ${t.accept};
629
+ --sc-reject: ${t.reject};
630
+ --sc-toggle-on: ${t.toggleOn};
631
+ --sc-toggle-off: ${t.toggleOff};
632
+ --sc-radius: ${t.radius};
633
+ --sc-font: ${t.font};
634
+ }
635
+
636
+ [data-smartconsent] *,
637
+ [data-smartconsent] *::before,
638
+ [data-smartconsent] *::after {
639
+ box-sizing: border-box;
640
+ margin: 0;
641
+ padding: 0;
642
+ }
643
+
644
+ [data-smartconsent="backdrop"] {
645
+ position: fixed;
646
+ inset: 0;
647
+ background: rgba(0, 0, 0, 0.4);
648
+ z-index: 9998;
649
+ }
650
+
651
+ [data-smartconsent="banner"] {
652
+ position: fixed;
653
+ bottom: 0;
654
+ left: 0;
655
+ right: 0;
656
+ z-index: 9999;
657
+ background: var(--sc-bg);
658
+ color: var(--sc-text);
659
+ font-family: var(--sc-font);
660
+ font-size: 14px;
661
+ line-height: 1.5;
662
+ animation: sc-slide-up 0.3s ease-out;
663
+ }
664
+
665
+ [data-smartconsent="banner"][data-sc-position="top"] {
666
+ bottom: auto;
667
+ top: 0;
668
+ animation: sc-slide-down-in 0.3s ease-out;
669
+ }
670
+
671
+ [data-smartconsent="banner"] .sc-accent-line {
672
+ height: 2px;
673
+ background: linear-gradient(90deg, var(--sc-accent), var(--sc-accept));
674
+ }
675
+
676
+ [data-smartconsent="banner"] .sc-inner {
677
+ max-width: 960px;
678
+ margin: 0 auto;
679
+ padding: 16px 20px;
680
+ }
681
+
682
+ /* Compact state */
683
+ [data-smartconsent="banner"] .sc-compact {
684
+ display: flex;
685
+ align-items: center;
686
+ gap: 16px;
687
+ flex-wrap: wrap;
688
+ }
689
+
690
+ [data-smartconsent="banner"] .sc-compact-text {
691
+ flex: 1 1 300px;
692
+ color: var(--sc-text);
693
+ font-size: 14px;
694
+ }
695
+
696
+ [data-smartconsent="banner"] .sc-compact-actions {
697
+ display: flex;
698
+ align-items: center;
699
+ gap: 10px;
700
+ flex-wrap: wrap;
701
+ }
702
+
703
+ [data-smartconsent="banner"] .sc-compact-attribution {
704
+ flex: 1 1 100%;
705
+ margin-top: 6px;
706
+ font-size: 11px;
707
+ }
708
+
709
+ [data-smartconsent="banner"] .sc-compact-attribution a {
710
+ color: var(--sc-accent);
711
+ text-decoration: none;
712
+ font-weight: 500;
713
+ }
714
+
715
+ [data-smartconsent="banner"] .sc-compact-attribution a:hover {
716
+ text-decoration: underline;
717
+ }
718
+
719
+ /* Expanded state */
720
+ [data-smartconsent="banner"] .sc-expanded {
721
+ display: none;
722
+ }
723
+
724
+ [data-smartconsent="banner"] .sc-expanded.sc-active {
725
+ display: block;
726
+ }
727
+
728
+ [data-smartconsent="banner"] .sc-compact.sc-hidden {
729
+ display: none;
730
+ }
731
+
732
+ [data-smartconsent="banner"] .sc-header {
733
+ display: flex;
734
+ align-items: center;
735
+ gap: 12px;
736
+ margin-bottom: 8px;
737
+ }
738
+
739
+ [data-smartconsent="banner"] .sc-logo {
740
+ flex-shrink: 0;
741
+ max-height: 48px;
742
+ width: auto;
743
+ }
744
+
745
+ [data-smartconsent="banner"] .sc-header .sc-heading {
746
+ margin-bottom: 0;
747
+ }
748
+
749
+ [data-smartconsent="banner"] .sc-heading {
750
+ font-size: 18px;
751
+ font-weight: 600;
752
+ margin-bottom: 8px;
753
+ color: var(--sc-text);
754
+ }
755
+
756
+ [data-smartconsent="banner"] .sc-description {
757
+ color: var(--sc-text-muted);
758
+ margin-bottom: 16px;
759
+ font-size: 13px;
760
+ }
761
+
762
+ /* Category rows */
763
+ [data-smartconsent="banner"] .sc-categories {
764
+ margin-bottom: 16px;
765
+ }
766
+
767
+ [data-smartconsent="banner"] .sc-category {
768
+ display: flex;
769
+ align-items: center;
770
+ justify-content: space-between;
771
+ padding: 12px;
772
+ border-bottom: 1px solid var(--sc-border);
773
+ }
774
+
775
+ [data-smartconsent="banner"] .sc-category:hover {
776
+ background: var(--sc-surface);
777
+ }
778
+
779
+ [data-smartconsent="banner"] .sc-category-info {
780
+ flex: 1;
781
+ margin-right: 12px;
782
+ }
783
+
784
+ [data-smartconsent="banner"] .sc-category-label {
785
+ font-size: 14px;
786
+ font-weight: 500;
787
+ color: var(--sc-text);
788
+ }
789
+
790
+ [data-smartconsent="banner"] .sc-category-desc {
791
+ font-size: 12px;
792
+ color: var(--sc-text-muted);
793
+ margin-top: 2px;
794
+ }
795
+
796
+ /* Toggle switch */
797
+ [data-smartconsent="banner"] .sc-toggle {
798
+ position: relative;
799
+ width: 44px;
800
+ height: 24px;
801
+ background: var(--sc-toggle-off);
802
+ border-radius: 12px;
803
+ border: none;
804
+ cursor: pointer;
805
+ transition: background 0.2s;
806
+ flex-shrink: 0;
807
+ }
808
+
809
+ [data-smartconsent="banner"] .sc-toggle[aria-checked="true"] {
810
+ background: var(--sc-toggle-on);
811
+ }
812
+
813
+ [data-smartconsent="banner"] .sc-toggle::after {
814
+ content: '';
815
+ position: absolute;
816
+ top: 3px;
817
+ left: 3px;
818
+ width: 18px;
819
+ height: 18px;
820
+ background: white;
821
+ border-radius: 50%;
822
+ transition: left 0.2s;
823
+ }
824
+
825
+ [data-smartconsent="banner"] .sc-toggle[aria-checked="true"]::after {
826
+ left: 23px;
827
+ }
828
+
829
+ [data-smartconsent="banner"] .sc-toggle:disabled {
830
+ opacity: 0.5;
831
+ cursor: not-allowed;
832
+ }
833
+
834
+ /* Held embed placeholder (CR-035): the size of the iframe it stands in for */
835
+ [data-smartconsent="embed"] {
836
+ display: flex;
837
+ flex-direction: column;
838
+ align-items: center;
839
+ justify-content: center;
840
+ gap: 12px;
841
+ width: var(--sc-embed-w, 100%);
842
+ max-width: 100%;
843
+ height: var(--sc-embed-h, auto);
844
+ min-height: 150px;
845
+ padding: 16px;
846
+ background: var(--sc-surface);
847
+ color: var(--sc-text);
848
+ border: 1px solid var(--sc-border);
849
+ border-radius: var(--sc-radius);
850
+ font-family: var(--sc-font);
851
+ font-size: 14px;
852
+ line-height: 1.5;
853
+ text-align: center;
854
+ box-sizing: border-box;
855
+ }
856
+
857
+ [data-smartconsent="embed"] button {
858
+ padding: 8px 18px;
859
+ border: none;
860
+ border-radius: var(--sc-radius);
861
+ background: var(--sc-accent);
862
+ color: #fff;
863
+ font: 500 13px var(--sc-font);
864
+ cursor: pointer;
865
+ }
866
+
867
+ [data-smartconsent="embed"] button:focus-visible {
868
+ outline: 2px solid var(--sc-accent);
869
+ outline-offset: 2px;
870
+ }
871
+
872
+ /* Buttons */
873
+ [data-smartconsent="banner"] .sc-btn {
874
+ padding: 8px 18px;
875
+ border: none;
876
+ border-radius: var(--sc-radius);
877
+ font-family: var(--sc-font);
878
+ font-size: 13px;
879
+ font-weight: 500;
880
+ cursor: pointer;
881
+ transition: opacity 0.2s;
882
+ white-space: nowrap;
883
+ }
884
+
885
+ [data-smartconsent="banner"] .sc-btn:hover {
886
+ opacity: 0.85;
887
+ }
888
+
889
+ [data-smartconsent="banner"] .sc-btn:focus-visible {
890
+ outline: 2px solid var(--sc-accent);
891
+ outline-offset: 2px;
892
+ }
893
+
894
+ [data-smartconsent="banner"] .sc-btn-accept {
895
+ background: var(--sc-accept);
896
+ color: #fff;
897
+ }
898
+
899
+ [data-smartconsent="banner"] .sc-btn-reject {
900
+ background: var(--sc-reject);
901
+ color: #fff;
902
+ }
903
+
904
+ [data-smartconsent="banner"] .sc-btn-save {
905
+ background: var(--sc-accent);
906
+ color: #fff;
907
+ }
908
+
909
+ [data-smartconsent="banner"] .sc-btn-essential {
910
+ background: var(--sc-reject);
911
+ color: #fff;
912
+ }
913
+
914
+ [data-smartconsent="banner"] .sc-link {
915
+ background: none;
916
+ border: none;
917
+ color: var(--sc-accent);
918
+ font-family: var(--sc-font);
919
+ font-size: 13px;
920
+ cursor: pointer;
921
+ text-decoration: underline;
922
+ padding: 4px;
923
+ }
924
+
925
+ [data-smartconsent="banner"] .sc-link:focus-visible {
926
+ outline: 2px solid var(--sc-accent);
927
+ outline-offset: 2px;
928
+ }
929
+
930
+ /* Expanded actions */
931
+ [data-smartconsent="banner"] .sc-expanded-actions {
932
+ display: flex;
933
+ gap: 10px;
934
+ flex-wrap: wrap;
935
+ margin-top: 16px;
936
+ }
937
+
938
+ /* Attribution */
939
+ [data-smartconsent="banner"] .sc-attribution {
940
+ text-align: center;
941
+ margin-top: 12px;
942
+ padding-top: 12px;
943
+ border-top: 1px solid var(--sc-border);
944
+ }
945
+
946
+ [data-smartconsent="banner"] .sc-attribution a {
947
+ color: var(--sc-text-muted);
948
+ font-size: 11px;
949
+ text-decoration: none;
950
+ }
951
+
952
+ [data-smartconsent="banner"] .sc-attribution a:hover {
953
+ color: var(--sc-accent);
954
+ }
955
+
956
+ /* Badge */
957
+ [data-smartconsent="badge"] {
958
+ position: fixed;
959
+ width: 40px;
960
+ height: 40px;
961
+ border-radius: 50%;
962
+ background: var(--sc-accent);
963
+ color: #fff;
964
+ border: none;
965
+ cursor: pointer;
966
+ z-index: 9997;
967
+ display: flex;
968
+ align-items: center;
969
+ justify-content: center;
970
+ font-size: 20px;
971
+ opacity: 0.7;
972
+ transition: opacity 0.2s;
973
+ font-family: var(--sc-font);
974
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
975
+ }
976
+
977
+ [data-smartconsent="badge"]:hover {
978
+ opacity: 1;
979
+ }
980
+
981
+ [data-smartconsent="badge"]:focus-visible {
982
+ outline: 2px solid var(--sc-accent);
983
+ outline-offset: 2px;
984
+ opacity: 1;
985
+ }
986
+
987
+ [data-smartconsent="badge"][data-sc-position="bottom-right"] {
988
+ bottom: 16px;
989
+ right: 16px;
990
+ }
991
+
992
+ [data-smartconsent="badge"][data-sc-position="bottom-left"] {
993
+ bottom: 16px;
994
+ left: 16px;
995
+ }
996
+
997
+ /* Layout: Box (FP-06) */
998
+ [data-smartconsent="banner"][data-sc-layout="box"] {
999
+ bottom: 16px;
1000
+ left: 16px;
1001
+ right: auto;
1002
+ width: 400px;
1003
+ max-width: calc(100vw - 32px);
1004
+ border-radius: var(--sc-radius);
1005
+ box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
1006
+ animation: sc-fade-in 0.3s ease-out;
1007
+ }
1008
+
1009
+ [data-smartconsent="banner"][data-sc-layout="box"][data-sc-box-position="bottom-right"] {
1010
+ left: auto;
1011
+ right: 16px;
1012
+ }
1013
+
1014
+ [data-smartconsent="banner"][data-sc-layout="box"] .sc-compact {
1015
+ flex-direction: column;
1016
+ align-items: stretch;
1017
+ }
1018
+
1019
+ /* In a column a flex basis is a height: the text and credit hug their content (BRIEF-280). */
1020
+ [data-smartconsent="banner"][data-sc-layout="box"] .sc-compact-text,
1021
+ [data-smartconsent="banner"][data-sc-layout="box"] .sc-compact-attribution {
1022
+ flex-basis: auto;
1023
+ }
1024
+
1025
+ [data-smartconsent="banner"][data-sc-layout="box"] .sc-compact-actions {
1026
+ justify-content: stretch;
1027
+ }
1028
+
1029
+ [data-smartconsent="banner"][data-sc-layout="box"] .sc-compact-actions .sc-btn {
1030
+ flex: 1;
1031
+ }
1032
+
1033
+ /* Layout: Popup (FP-06) */
1034
+ [data-smartconsent="banner"][data-sc-layout="popup"] {
1035
+ bottom: auto;
1036
+ left: 50%;
1037
+ right: auto;
1038
+ top: 50%;
1039
+ transform: translate(-50%, -50%);
1040
+ width: 520px;
1041
+ max-width: calc(100vw - 32px);
1042
+ max-height: calc(100vh - 32px);
1043
+ overflow-y: auto;
1044
+ border-radius: var(--sc-radius);
1045
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
1046
+ animation: sc-fade-in 0.3s ease-out;
1047
+ }
1048
+
1049
+ @keyframes sc-fade-in {
1050
+ from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
1051
+ to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
1052
+ }
1053
+
1054
+ [data-smartconsent="banner"][data-sc-layout="box"] + [data-smartconsent="backdrop"],
1055
+ [data-smartconsent="banner"][data-sc-layout="box"] ~ [data-smartconsent="backdrop"] {
1056
+ display: none;
1057
+ }
1058
+
1059
+ /* Animations */
1060
+ @keyframes sc-slide-up {
1061
+ from { transform: translateY(100%); }
1062
+ to { transform: translateY(0); }
1063
+ }
1064
+
1065
+ @keyframes sc-slide-down-in {
1066
+ from { transform: translateY(-100%); }
1067
+ to { transform: translateY(0); }
1068
+ }
1069
+
1070
+ /* Responsive */
1071
+ @media (max-width: 480px) {
1072
+ [data-smartconsent="banner"] .sc-compact {
1073
+ flex-direction: column;
1074
+ align-items: stretch;
1075
+ }
1076
+
1077
+ [data-smartconsent="banner"] .sc-compact-text,
1078
+ [data-smartconsent="banner"] .sc-compact-attribution {
1079
+ flex-basis: auto;
1080
+ }
1081
+
1082
+ [data-smartconsent="banner"] .sc-compact-actions {
1083
+ justify-content: stretch;
1084
+ }
1085
+
1086
+ [data-smartconsent="banner"] .sc-compact-attribution {
1087
+ text-align: center;
1088
+ }
1089
+
1090
+ [data-smartconsent="banner"] .sc-compact-actions .sc-btn {
1091
+ flex: 1;
1092
+ }
1093
+
1094
+ [data-smartconsent="banner"] .sc-expanded-actions {
1095
+ flex-direction: column;
1096
+ }
1097
+
1098
+ [data-smartconsent="banner"] .sc-expanded-actions .sc-btn {
1099
+ width: 100%;
1100
+ }
1101
+
1102
+ /* A full-width strip for every box position: the position attribute matches the bottom-right rule's weight, and
1103
+ width: auto with left and right at 0 fits the viewport exactly (the banner itself is not border-box) (BRIEF-280). */
1104
+ [data-smartconsent="banner"][data-sc-layout="box"],
1105
+ [data-smartconsent="banner"][data-sc-layout="box"][data-sc-box-position] {
1106
+ left: 0;
1107
+ right: 0;
1108
+ bottom: 0;
1109
+ width: auto;
1110
+ max-width: none;
1111
+ border-radius: 0;
1112
+ }
1113
+
1114
+ [data-smartconsent="banner"][data-sc-layout="popup"] {
1115
+ left: 0;
1116
+ right: 0;
1117
+ top: auto;
1118
+ bottom: 0;
1119
+ width: 100%;
1120
+ max-width: 100%;
1121
+ transform: none;
1122
+ border-radius: 0;
1123
+ animation: sc-slide-up 0.3s ease-out;
1124
+ }
1125
+ }
1126
+ `;
1127
+ }
1128
+ function Lt(t) {
1129
+ const e = 'button:not([disabled]), [href], input:not([disabled]), [tabindex]:not([tabindex="-1"]), [role="switch"]:not([disabled])';
1130
+ function n() {
1131
+ return Array.from(t.querySelectorAll(e));
1132
+ }
1133
+ function o(s) {
1134
+ if (s.key !== "Tab") return;
1135
+ const i = n();
1136
+ if (i.length === 0) return;
1137
+ const l = i[0], d = i[i.length - 1];
1138
+ s.shiftKey ? document.activeElement === l && (s.preventDefault(), d.focus()) : document.activeElement === d && (s.preventDefault(), l.focus());
1139
+ }
1140
+ t.addEventListener("keydown", o);
1141
+ const a = n();
1142
+ return a.length > 0 && a[0].focus(), () => {
1143
+ t.removeEventListener("keydown", o);
1144
+ };
1145
+ }
1146
+ function Pt(t) {
1147
+ const e = document.createElement("div");
1148
+ 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(() => {
1149
+ e.remove();
1150
+ }, 1e3);
1151
+ }
1152
+ const ge = {
1153
+ ar: "مدعوم بواسطة SmartGenie",
1154
+ cs: "Zajišťuje SmartGenie",
1155
+ da: "Drevet af SmartGenie",
1156
+ de: "Bereitgestellt von SmartGenie",
1157
+ es: "Desarrollado por SmartGenie",
1158
+ fr: "Propulsé par SmartGenie",
1159
+ hi: "SmartGenie द्वारा संचालित",
1160
+ it: "Offerto da SmartGenie",
1161
+ ja: "SmartGenie提供",
1162
+ ko: "SmartGenie 제공",
1163
+ nl: "Mogelijk gemaakt door SmartGenie",
1164
+ no: "Drevet av SmartGenie",
1165
+ pl: "Dostarczone przez SmartGenie",
1166
+ pt: "Fornecido por SmartGenie",
1167
+ ro: "Furnizat de SmartGenie",
1168
+ ru: "Работает на SmartGenie",
1169
+ sv: "Drivs av SmartGenie",
1170
+ tr: "SmartGenie tarafından desteklenmektedir",
1171
+ zh: "由 SmartGenie 提供支持"
1172
+ }, It = (t, e) => Object.prototype.hasOwnProperty.call(t, e);
1173
+ function we(t) {
1174
+ if (typeof t != "string") return null;
1175
+ try {
1176
+ const { protocol: e } = new URL(t);
1177
+ return e === "http:" || e === "https:" ? t : null;
1178
+ } catch {
1179
+ return null;
1180
+ }
1181
+ }
1182
+ const Q = "sponsored nofollow noopener";
1183
+ function ie(t) {
1184
+ const e = we(t.attributionUrl);
1185
+ return e && t.attributionRef ? `https://www.smartgenie.co.uk/r/${encodeURIComponent(t.attributionRef)}` : e;
1186
+ }
1187
+ function ee(t, e) {
1188
+ const n = t.texts[e], o = X[e];
1189
+ if (e === "policyCredit") return n === o ? n : o;
1190
+ if (n === o || Object.values(ge).includes(n)) return n;
1191
+ const s = (t.language || (typeof navigator < "u" ? navigator.language : "") || "en").split("-")[0].toLowerCase();
1192
+ return It(ge, s) ? ge[s] : o;
1193
+ }
1194
+ const Nt = [".sc-compact-attribution", ".sc-attribution"], Tt = 5, Bt = 1e3, Dt = [
1195
+ ["display", (t) => t === "none"],
1196
+ ["visibility", (t) => t === "hidden"],
1197
+ ["opacity", (t) => t !== "" && parseFloat(t) === 0]
1198
+ ];
1199
+ function he(t) {
1200
+ return Dt.filter(([e, n]) => n(t.style.getPropertyValue(e))).map(([e]) => e);
1201
+ }
1202
+ function Qe(t, e) {
1203
+ if (!e.attribution) return () => {
1204
+ };
1205
+ const n = [];
1206
+ for (const f of Nt) {
1207
+ const g = t.querySelector(f), _ = g == null ? void 0 : g.querySelector("a"), u = g == null ? void 0 : g.parentElement;
1208
+ g && _ && u && n.push({ container: g, parent: u, link: _ });
1209
+ }
1210
+ if (n.length === 0) return () => {
1211
+ };
1212
+ const o = ee(e, "poweredBy"), a = ie(e), s = ({ container: f, parent: g, link: _ }) => _.parentElement !== f || f.parentElement !== g || _.getAttribute("href") !== a || Q.split(" ").some((u) => !_.relList.contains(u)) || _.textContent !== o || he(_).length > 0 || he(f).length > 0, i = ({ container: f, parent: g, link: _ }) => {
1213
+ f.parentElement !== g && g.appendChild(f), _.parentElement !== f && f.appendChild(_), _.getAttribute("href") !== a && (a === null ? _.removeAttribute("href") : _.setAttribute("href", a)), _.relList.add(...Q.split(" ")), _.textContent !== o && (_.textContent = o);
1214
+ for (const u of [_, f])
1215
+ for (const m of he(u)) u.style.removeProperty(m);
1216
+ };
1217
+ let l = 0, d = 0;
1218
+ const h = new MutationObserver(() => {
1219
+ const f = n.filter(s);
1220
+ if (f.length === 0) return;
1221
+ const g = Date.now();
1222
+ if (g - d >= Bt && (d = g, l = 0), l >= Tt) {
1223
+ h.disconnect(), console.warn("SmartConsent: attribution link keeps being removed; guard stopped.");
1224
+ return;
1225
+ }
1226
+ l++, f.forEach(i);
1227
+ });
1228
+ return h.observe(t, {
1229
+ childList: !0,
1230
+ subtree: !0,
1231
+ attributes: !0,
1232
+ attributeFilter: ["href", "rel", "style"],
1233
+ characterData: !0
1234
+ }), () => h.disconnect();
1235
+ }
1236
+ function et(t, e) {
1237
+ if (!e.dataRequestUrl) return;
1238
+ t.firstChild && t.appendChild(document.createTextNode(" · "));
1239
+ const n = document.createElement("a");
1240
+ n.className = "sc-data-rights", n.href = e.dataRequestUrl, n.target = "_blank", n.rel = "noopener", n.textContent = e.texts.dataRequest, t.appendChild(n);
1241
+ }
1242
+ function J(t, e) {
1243
+ let n = null, o = null, a = null, s = null, i = null;
1244
+ const l = !!e.language && e.language !== "en", d = l ? e.texts.heading : "Cookie consent";
1245
+ function h() {
1246
+ return document.body ?? document.documentElement;
1247
+ }
1248
+ function f() {
1249
+ t.rejectOptional(), u.hide();
1250
+ }
1251
+ function g() {
1252
+ const m = document.createElement("div");
1253
+ 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);
1254
+ const T = document.createElement("div");
1255
+ T.className = "sc-accent-line", m.appendChild(T);
1256
+ const $ = document.createElement("div");
1257
+ $.className = "sc-inner";
1258
+ const x = document.createElement("div");
1259
+ x.className = "sc-compact";
1260
+ const k = document.createElement("div");
1261
+ k.className = "sc-compact-text", k.textContent = e.texts.description, x.appendChild(k);
1262
+ const G = document.createElement("div");
1263
+ G.className = "sc-compact-actions";
1264
+ const K = _(e.texts.rejectOptional, "sc-btn sc-btn-reject", () => {
1265
+ f();
1266
+ });
1267
+ G.appendChild(K);
1268
+ const P = _(e.texts.acceptAll, "sc-btn sc-btn-accept", () => {
1269
+ t.acceptAll(), u.hide();
1270
+ });
1271
+ G.appendChild(P);
1272
+ const q = document.createElement("button");
1273
+ if (q.className = "sc-link", q.textContent = e.texts.managePreferences, q.type = "button", q.addEventListener("click", () => {
1274
+ x.classList.add("sc-hidden"), C.classList.add("sc-active");
1275
+ }), G.appendChild(q), x.appendChild(G), e.attribution) {
1276
+ const r = document.createElement("div");
1277
+ r.className = "sc-compact-attribution";
1278
+ const c = document.createElement("a"), p = ie(e);
1279
+ p && (c.href = p), c.target = "_blank", c.rel = Q, c.textContent = ee(e, "poweredBy"), r.appendChild(c), x.appendChild(r);
1280
+ }
1281
+ $.appendChild(x);
1282
+ const C = document.createElement("div");
1283
+ if (C.className = "sc-expanded", e.logo) {
1284
+ const r = document.createElement("div");
1285
+ r.className = "sc-header";
1286
+ const c = document.createElement("img");
1287
+ 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);
1288
+ const p = document.createElement("h2");
1289
+ p.className = "sc-heading", p.textContent = e.texts.heading, r.appendChild(p), C.appendChild(r);
1290
+ } else {
1291
+ const r = document.createElement("h2");
1292
+ r.className = "sc-heading", r.textContent = e.texts.heading, C.appendChild(r);
1293
+ }
1294
+ const M = document.createElement("p");
1295
+ M.className = "sc-description", M.textContent = e.texts.description, C.appendChild(M);
1296
+ const I = t.getState(), S = {}, R = document.createElement("div");
1297
+ R.className = "sc-categories";
1298
+ for (const r of e.categories) {
1299
+ S[r.id] = r.required ? !0 : (I == null ? void 0 : I.categories[r.id]) ?? !1;
1300
+ const c = document.createElement("div");
1301
+ c.className = "sc-category";
1302
+ const p = document.createElement("div");
1303
+ p.className = "sc-category-info";
1304
+ const b = document.createElement("div");
1305
+ b.className = "sc-category-label", b.textContent = r.label, p.appendChild(b);
1306
+ const A = document.createElement("div");
1307
+ A.className = "sc-category-desc", A.textContent = r.description, p.appendChild(A), c.appendChild(p);
1308
+ const w = document.createElement("button");
1309
+ w.className = "sc-toggle", w.type = "button", w.setAttribute("role", "switch"), w.setAttribute("aria-checked", String(S[r.id])), w.setAttribute("aria-label", r.label), r.required ? w.disabled = !0 : w.addEventListener("click", () => {
1310
+ const E = w.getAttribute("aria-checked") === "true";
1311
+ w.setAttribute("aria-checked", String(!E)), S[r.id] = !E;
1312
+ }), c.appendChild(w), R.appendChild(c);
1313
+ }
1314
+ C.appendChild(R);
1315
+ const N = document.createElement("div");
1316
+ N.className = "sc-expanded-actions";
1317
+ const v = _(e.texts.essentialOnly, "sc-btn sc-btn-essential", () => {
1318
+ f();
1319
+ });
1320
+ N.appendChild(v);
1321
+ const O = _(e.texts.savePreferences, "sc-btn sc-btn-save", () => {
1322
+ t.saveCustom(S), u.hide();
1323
+ });
1324
+ N.appendChild(O);
1325
+ const B = _(e.texts.acceptAll, "sc-btn sc-btn-accept", () => {
1326
+ t.acceptAll(), u.hide();
1327
+ });
1328
+ if (N.appendChild(B), C.appendChild(N), e.attribution || e.dataRequestUrl) {
1329
+ const r = document.createElement("div");
1330
+ if (r.className = "sc-attribution", e.attribution) {
1331
+ const c = document.createElement("a"), p = ie(e);
1332
+ p && (c.href = p), c.target = "_blank", c.rel = Q, c.textContent = ee(e, "poweredBy"), r.appendChild(c);
1333
+ }
1334
+ et(r, e), C.appendChild(r);
1335
+ }
1336
+ return $.appendChild(C), m.appendChild($), m;
1337
+ }
1338
+ function _(m, T, $) {
1339
+ const x = document.createElement("button");
1340
+ return x.type = "button", x.className = T, x.textContent = m, x.addEventListener("click", $), x;
1341
+ }
1342
+ const u = {
1343
+ show() {
1344
+ n || (e.layout !== "box" && (o = document.createElement("div"), o.setAttribute("data-smartconsent", "backdrop"), o.addEventListener("click", f), h().appendChild(o)), n = g(), h().appendChild(n), i = Qe(n, e), a = Lt(n), s = (m) => {
1345
+ m.key === "Escape" && f();
1346
+ }, document.addEventListener("keydown", s), Pt(d));
1347
+ },
1348
+ hide() {
1349
+ 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);
1350
+ },
1351
+ destroy() {
1352
+ u.hide();
1353
+ }
1354
+ };
1355
+ return u;
1356
+ }
1357
+ function Mt(t, e, n) {
1358
+ let o = null, a = () => {
1359
+ };
1360
+ const s = e.texts, i = (h, f, g) => {
1361
+ const _ = document.createElement(h);
1362
+ return _.className = f, g && (_.textContent = g), _;
1363
+ }, l = (h, f) => {
1364
+ const g = i("button", "sc-link", h);
1365
+ return g.type = "button", g.addEventListener("click", () => {
1366
+ d.hide(), f();
1367
+ }), g;
1368
+ }, d = {
1369
+ show() {
1370
+ if (o) return;
1371
+ 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");
1372
+ const h = i("div", "sc-compact");
1373
+ h.appendChild(i("div", "sc-compact-text", s.description));
1374
+ const f = i("div", "sc-compact-actions");
1375
+ if (f.appendChild(l(s.doNotSell, () => t.rejectOptional())), f.appendChild(l(s.cookieSettings, n)), h.appendChild(f), e.attribution || e.dataRequestUrl) {
1376
+ const _ = i("div", "sc-compact-attribution");
1377
+ if (e.attribution) {
1378
+ const u = i("a", "", ee(e, "poweredBy")), m = ie(e);
1379
+ m && (u.href = m), u.target = "_blank", u.rel = Q, _.appendChild(u);
1380
+ }
1381
+ et(_, e), h.appendChild(_);
1382
+ }
1383
+ const g = i("div", "sc-inner");
1384
+ g.appendChild(h), o.appendChild(g), (document.body ?? document.documentElement).appendChild(o), a = Qe(o, e);
1385
+ },
1386
+ hide() {
1387
+ a(), o == null || o.remove(), o = null;
1388
+ }
1389
+ };
1390
+ return d;
1391
+ }
1392
+ function Ot(t, e) {
1393
+ let n = null;
1394
+ function o() {
1395
+ return document.body ?? document.documentElement;
1396
+ }
1397
+ function a() {
1398
+ const i = document.createElement("button");
1399
+ 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;
1400
+ }
1401
+ return {
1402
+ show() {
1403
+ if (t.showBadge) {
1404
+ if (n) {
1405
+ n.style.display = "flex";
1406
+ return;
1407
+ }
1408
+ n = a(), o().appendChild(n);
1409
+ }
1410
+ },
1411
+ hide() {
1412
+ n && (n.style.display = "none");
1413
+ },
1414
+ destroy() {
1415
+ n && (n.remove(), n = null);
1416
+ }
1417
+ };
1418
+ }
1419
+ function Ut(t) {
1420
+ if (t == null || typeof t != "object")
1421
+ throw new Error("Regulation: data must be an object");
1422
+ const e = t;
1423
+ if (!e.id || typeof e.id != "string")
1424
+ throw new Error('Regulation: missing or invalid "id" (must be a non-empty string)');
1425
+ if (!e.name || typeof e.name != "string")
1426
+ throw new Error(`Regulation [${e.id}]: missing or invalid "name"`);
1427
+ if (e.consent_model !== "opt-in" && e.consent_model !== "opt-out")
1428
+ throw new Error(
1429
+ `Regulation [${e.id}]: "consent_model" must be "opt-in" or "opt-out", got "${String(e.consent_model)}"`
1430
+ );
1431
+ if (e.default_cookie_state !== "blocked" && e.default_cookie_state !== "allowed")
1432
+ throw new Error(
1433
+ `Regulation [${e.id}]: "default_cookie_state" must be "blocked" or "allowed"`
1434
+ );
1435
+ if (!e.jurisdiction || typeof e.jurisdiction != "object")
1436
+ throw new Error(`Regulation [${e.id}]: missing "jurisdiction" object`);
1437
+ const n = e.jurisdiction;
1438
+ if (!Array.isArray(n.countries))
1439
+ throw new Error(`Regulation [${e.id}]: "jurisdiction.countries" must be an array`);
1440
+ if (!e.banner_requirements || typeof e.banner_requirements != "object")
1441
+ throw new Error(`Regulation [${e.id}]: missing "banner_requirements" object`);
1442
+ if (!e.consent_rules || typeof e.consent_rules != "object")
1443
+ throw new Error(`Regulation [${e.id}]: missing "consent_rules" object`);
1444
+ if (!e.language || typeof e.language != "object")
1445
+ throw new Error(`Regulation [${e.id}]: missing "language" object`);
1446
+ if (!e.signals || typeof e.signals != "object")
1447
+ throw new Error(`Regulation [${e.id}]: missing "signals" object`);
1448
+ if (!e.children || typeof e.children != "object")
1449
+ throw new Error(`Regulation [${e.id}]: missing "children" object`);
1450
+ if (!e.audit || typeof e.audit != "object")
1451
+ throw new Error(`Regulation [${e.id}]: missing "audit" object`);
1452
+ return t;
1453
+ }
1454
+ const Gt = "uk-gdpr-pecr", Ft = "UK GDPR & PECR", zt = "opt-in", Ht = "blocked", Vt = "1.0", Wt = "2026-03-01", Kt = [
1455
+ "https://ico.org.uk/for-organisations/guide-to-pecr/cookies-and-similar-technologies/",
1456
+ "https://ico.org.uk/for-organisations/uk-gdpr-guidance-and-resources/"
1457
+ ], Yt = {
1458
+ countries: [
1459
+ "GB"
1460
+ ],
1461
+ states: null
1462
+ }, Jt = {
1463
+ require_accept_button: !0,
1464
+ require_reject_button: !0,
1465
+ require_equal_prominence: !0,
1466
+ require_customise_button: !0,
1467
+ cookie_wall_permitted: !1,
1468
+ require_granular_categories: !0
1469
+ }, Zt = {
1470
+ expiry_days: 395,
1471
+ withdrawal_mechanism: "persistent badge",
1472
+ withdrawal_ease: "as easy as giving consent",
1473
+ re_consent_on_policy_change: !0
1474
+ }, Xt = {
1475
+ mandatory_languages: [
1476
+ "en"
1477
+ ],
1478
+ auto_detect_browser_language: !1
1479
+ }, Qt = {
1480
+ honour_gpc: !0,
1481
+ honour_dnt: !0
1482
+ }, en = {
1483
+ age_threshold: 13,
1484
+ tracking_prohibited: !1,
1485
+ parental_consent_required: !0
1486
+ }, tn = {
1487
+ consent_log_required: !0,
1488
+ retention_years: 6,
1489
+ proof_of_consent_required: !0
1490
+ }, nn = {
1491
+ id: Gt,
1492
+ name: Ft,
1493
+ consent_model: zt,
1494
+ default_cookie_state: Ht,
1495
+ version: Vt,
1496
+ last_updated: Wt,
1497
+ sources: Kt,
1498
+ jurisdiction: Yt,
1499
+ banner_requirements: Jt,
1500
+ consent_rules: Zt,
1501
+ language: Xt,
1502
+ signals: Qt,
1503
+ children: en,
1504
+ audit: tn
1505
+ }, on = "eu-gdpr-eprivacy", rn = "EU GDPR & ePrivacy Directive", an = "opt-in", sn = "blocked", cn = "1.0", ln = "2026-03-01", un = [
1506
+ "https://eur-lex.europa.eu/eli/reg/2016/679/oj",
1507
+ "https://eur-lex.europa.eu/eli/dir/2002/58/oj"
1508
+ ], dn = {
1509
+ countries: [
1510
+ "AT",
1511
+ "BE",
1512
+ "BG",
1513
+ "HR",
1514
+ "CY",
1515
+ "CZ",
1516
+ "DK",
1517
+ "EE",
1518
+ "FI",
1519
+ "FR",
1520
+ "DE",
1521
+ "GR",
1522
+ "HU",
1523
+ "IE",
1524
+ "IT",
1525
+ "LV",
1526
+ "LT",
1527
+ "LU",
1528
+ "MT",
1529
+ "NL",
1530
+ "PL",
1531
+ "PT",
1532
+ "RO",
1533
+ "SK",
1534
+ "SI",
1535
+ "ES",
1536
+ "SE",
1537
+ "IS",
1538
+ "LI",
1539
+ "NO"
1540
+ ],
1541
+ states: null
1542
+ }, pn = {
1543
+ require_accept_button: !0,
1544
+ require_reject_button: !0,
1545
+ require_equal_prominence: !0,
1546
+ require_customise_button: !0,
1547
+ cookie_wall_permitted: !1,
1548
+ require_granular_categories: !0
1549
+ }, mn = {
1550
+ expiry_days: 365,
1551
+ withdrawal_mechanism: "persistent badge",
1552
+ withdrawal_ease: "as easy as giving consent",
1553
+ re_consent_on_policy_change: !0
1554
+ }, fn = {
1555
+ mandatory_languages: [
1556
+ "en"
1557
+ ],
1558
+ auto_detect_browser_language: !0
1559
+ }, gn = {
1560
+ honour_gpc: !0,
1561
+ honour_dnt: !0
1562
+ }, hn = {
1563
+ age_threshold: 16,
1564
+ tracking_prohibited: !1,
1565
+ parental_consent_required: !0
1566
+ }, bn = {
1567
+ consent_log_required: !0,
1568
+ retention_years: 5,
1569
+ proof_of_consent_required: !0
1570
+ }, _n = {
1571
+ id: on,
1572
+ name: rn,
1573
+ consent_model: an,
1574
+ default_cookie_state: sn,
1575
+ version: cn,
1576
+ last_updated: ln,
1577
+ sources: un,
1578
+ jurisdiction: dn,
1579
+ banner_requirements: pn,
1580
+ consent_rules: mn,
1581
+ language: fn,
1582
+ signals: gn,
1583
+ children: hn,
1584
+ audit: bn
1585
+ }, yn = "dpdp-india", wn = "Digital Personal Data Protection Act (India)", vn = "opt-in", xn = "blocked", Cn = "1.0", An = "2026-03-01", kn = [
1586
+ "https://www.meity.gov.in/content/digital-personal-data-protection-act-2023"
1587
+ ], En = {
1588
+ countries: [
1589
+ "IN"
1590
+ ],
1591
+ states: null
1592
+ }, Sn = {
1593
+ require_accept_button: !0,
1594
+ require_reject_button: !0,
1595
+ require_equal_prominence: !0,
1596
+ require_customise_button: !0,
1597
+ cookie_wall_permitted: !1,
1598
+ require_granular_categories: !0
1599
+ }, $n = {
1600
+ expiry_days: 365,
1601
+ withdrawal_mechanism: "persistent badge",
1602
+ withdrawal_ease: "as easy as giving consent",
1603
+ re_consent_on_policy_change: !0
1604
+ }, qn = {
1605
+ mandatory_languages: [
1606
+ "en",
1607
+ "hi",
1608
+ "bn",
1609
+ "te",
1610
+ "mr",
1611
+ "ta",
1612
+ "ur",
1613
+ "gu",
1614
+ "kn",
1615
+ "ml",
1616
+ "or",
1617
+ "pa",
1618
+ "as",
1619
+ "mai",
1620
+ "sa",
1621
+ "ne",
1622
+ "sd",
1623
+ "kok",
1624
+ "doi",
1625
+ "mni",
1626
+ "sat",
1627
+ "ks",
1628
+ "bo"
1629
+ ],
1630
+ auto_detect_browser_language: !0
1631
+ }, jn = {
1632
+ honour_gpc: !0,
1633
+ honour_dnt: !0
1634
+ }, Rn = {
1635
+ age_threshold: 18,
1636
+ tracking_prohibited: !0,
1637
+ parental_consent_required: !0
1638
+ }, Ln = {
1639
+ consent_log_required: !0,
1640
+ retention_years: null,
1641
+ proof_of_consent_required: !0
1642
+ }, Pn = {
1643
+ id: yn,
1644
+ name: wn,
1645
+ consent_model: vn,
1646
+ default_cookie_state: xn,
1647
+ version: Cn,
1648
+ last_updated: An,
1649
+ sources: kn,
1650
+ jurisdiction: En,
1651
+ banner_requirements: Sn,
1652
+ consent_rules: $n,
1653
+ language: qn,
1654
+ signals: jn,
1655
+ children: Rn,
1656
+ audit: Ln
1657
+ }, In = "lgpd-brazil", Nn = "Lei Geral de Proteção de Dados (Brazil)", Tn = "opt-in", Bn = "blocked", Dn = "1.0", Mn = "2026-03-01", On = [
1658
+ "https://www.planalto.gov.br/ccivil_03/_ato2015-2018/2018/lei/l13709.htm"
1659
+ ], Un = {
1660
+ countries: [
1661
+ "BR"
1662
+ ],
1663
+ states: null
1664
+ }, Gn = {
1665
+ require_accept_button: !0,
1666
+ require_reject_button: !0,
1667
+ require_equal_prominence: !0,
1668
+ require_customise_button: !0,
1669
+ cookie_wall_permitted: !1,
1670
+ require_granular_categories: !0
1671
+ }, Fn = {
1672
+ expiry_days: 365,
1673
+ withdrawal_mechanism: "persistent badge",
1674
+ withdrawal_ease: "as easy as giving consent",
1675
+ re_consent_on_policy_change: !0
1676
+ }, zn = {
1677
+ mandatory_languages: [
1678
+ "pt"
1679
+ ],
1680
+ auto_detect_browser_language: !1
1681
+ }, Hn = {
1682
+ honour_gpc: !0,
1683
+ honour_dnt: !0
1684
+ }, Vn = {
1685
+ age_threshold: 12,
1686
+ tracking_prohibited: !1,
1687
+ parental_consent_required: !0
1688
+ }, Wn = {
1689
+ consent_log_required: !0,
1690
+ retention_years: null,
1691
+ proof_of_consent_required: !0
1692
+ }, Kn = {
1693
+ id: In,
1694
+ name: Nn,
1695
+ consent_model: Tn,
1696
+ default_cookie_state: Bn,
1697
+ version: Dn,
1698
+ last_updated: Mn,
1699
+ sources: On,
1700
+ jurisdiction: Un,
1701
+ banner_requirements: Gn,
1702
+ consent_rules: Fn,
1703
+ language: zn,
1704
+ signals: Hn,
1705
+ children: Vn,
1706
+ audit: Wn
1707
+ }, Yn = "popia-south-africa", Jn = "Protection of Personal Information Act (South Africa)", Zn = "opt-in", Xn = "blocked", Qn = "1.0", eo = "2026-03-01", to = [
1708
+ "https://popia.co.za/"
1709
+ ], no = {
1710
+ countries: [
1711
+ "ZA"
1712
+ ],
1713
+ states: null
1714
+ }, oo = {
1715
+ require_accept_button: !0,
1716
+ require_reject_button: !0,
1717
+ require_equal_prominence: !0,
1718
+ require_customise_button: !0,
1719
+ cookie_wall_permitted: !1,
1720
+ require_granular_categories: !0
1721
+ }, ro = {
1722
+ expiry_days: 365,
1723
+ withdrawal_mechanism: "persistent badge",
1724
+ withdrawal_ease: "as easy as giving consent",
1725
+ re_consent_on_policy_change: !0
1726
+ }, ao = {
1727
+ mandatory_languages: [
1728
+ "en"
1729
+ ],
1730
+ auto_detect_browser_language: !1
1731
+ }, so = {
1732
+ honour_gpc: !0,
1733
+ honour_dnt: !0
1734
+ }, io = {
1735
+ age_threshold: 18,
1736
+ tracking_prohibited: !1,
1737
+ parental_consent_required: !0
1738
+ }, co = {
1739
+ consent_log_required: !0,
1740
+ retention_years: null,
1741
+ proof_of_consent_required: !0
1742
+ }, lo = {
1743
+ id: Yn,
1744
+ name: Jn,
1745
+ consent_model: Zn,
1746
+ default_cookie_state: Xn,
1747
+ version: Qn,
1748
+ last_updated: eo,
1749
+ sources: to,
1750
+ jurisdiction: no,
1751
+ banner_requirements: oo,
1752
+ consent_rules: ro,
1753
+ language: ao,
1754
+ signals: so,
1755
+ children: io,
1756
+ audit: co
1757
+ }, uo = "pipeda-canada", po = "PIPEDA & Quebec Law 25 (Canada)", mo = "opt-in", fo = "blocked", go = "1.0", ho = "2026-03-01", bo = [
1758
+ "https://www.priv.gc.ca/en/privacy-topics/privacy-laws-in-canada/the-personal-information-protection-and-electronic-documents-act-pipeda/"
1759
+ ], _o = {
1760
+ countries: [
1761
+ "CA"
1762
+ ],
1763
+ states: null
1764
+ }, yo = {
1765
+ require_accept_button: !0,
1766
+ require_reject_button: !0,
1767
+ require_equal_prominence: !0,
1768
+ require_customise_button: !0,
1769
+ cookie_wall_permitted: !1,
1770
+ require_granular_categories: !0
1771
+ }, wo = {
1772
+ expiry_days: 365,
1773
+ withdrawal_mechanism: "persistent badge",
1774
+ withdrawal_ease: "as easy as giving consent",
1775
+ re_consent_on_policy_change: !0
1776
+ }, vo = {
1777
+ mandatory_languages: [
1778
+ "en",
1779
+ "fr"
1780
+ ],
1781
+ auto_detect_browser_language: !0
1782
+ }, xo = {
1783
+ honour_gpc: !0,
1784
+ honour_dnt: !0
1785
+ }, Co = {
1786
+ age_threshold: 13,
1787
+ tracking_prohibited: !1,
1788
+ parental_consent_required: !0
1789
+ }, Ao = {
1790
+ consent_log_required: !0,
1791
+ retention_years: null,
1792
+ proof_of_consent_required: !0
1793
+ }, ko = {
1794
+ id: uo,
1795
+ name: po,
1796
+ consent_model: mo,
1797
+ default_cookie_state: fo,
1798
+ version: go,
1799
+ last_updated: ho,
1800
+ sources: bo,
1801
+ jurisdiction: _o,
1802
+ banner_requirements: yo,
1803
+ consent_rules: wo,
1804
+ language: vo,
1805
+ signals: xo,
1806
+ children: Co,
1807
+ audit: Ao
1808
+ }, Eo = "pdpa-singapore", So = "Personal Data Protection Act (Singapore)", $o = "opt-in", qo = "blocked", jo = "1.0", Ro = "2026-03-01", Lo = [
1809
+ "https://www.pdpc.gov.sg/overview-of-pdpa/the-legislation/personal-data-protection-act"
1810
+ ], Po = {
1811
+ countries: [
1812
+ "SG"
1813
+ ],
1814
+ states: null
1815
+ }, Io = {
1816
+ require_accept_button: !0,
1817
+ require_reject_button: !0,
1818
+ require_equal_prominence: !1,
1819
+ require_customise_button: !1,
1820
+ cookie_wall_permitted: !1,
1821
+ require_granular_categories: !1
1822
+ }, No = {
1823
+ expiry_days: 365,
1824
+ withdrawal_mechanism: "persistent badge",
1825
+ withdrawal_ease: "reasonable effort",
1826
+ re_consent_on_policy_change: !0
1827
+ }, To = {
1828
+ mandatory_languages: [
1829
+ "en"
1830
+ ],
1831
+ auto_detect_browser_language: !1
1832
+ }, Bo = {
1833
+ honour_gpc: !0,
1834
+ honour_dnt: !0
1835
+ }, Do = {
1836
+ age_threshold: 13,
1837
+ tracking_prohibited: !1,
1838
+ parental_consent_required: !0
1839
+ }, Mo = {
1840
+ consent_log_required: !0,
1841
+ retention_years: null,
1842
+ proof_of_consent_required: !1
1843
+ }, Oo = {
1844
+ id: Eo,
1845
+ name: So,
1846
+ consent_model: $o,
1847
+ default_cookie_state: qo,
1848
+ version: jo,
1849
+ last_updated: Ro,
1850
+ sources: Lo,
1851
+ jurisdiction: Po,
1852
+ banner_requirements: Io,
1853
+ consent_rules: No,
1854
+ language: To,
1855
+ signals: Bo,
1856
+ children: Do,
1857
+ audit: Mo
1858
+ }, Uo = "pdpa-thailand", Go = "Personal Data Protection Act (Thailand)", Fo = "opt-in", zo = "blocked", Ho = "1.0", Vo = "2026-03-01", Wo = [
1859
+ "https://thaipdpa.com/"
1860
+ ], Ko = {
1861
+ countries: [
1862
+ "TH"
1863
+ ],
1864
+ states: null
1865
+ }, Yo = {
1866
+ require_accept_button: !0,
1867
+ require_reject_button: !0,
1868
+ require_equal_prominence: !0,
1869
+ require_customise_button: !0,
1870
+ cookie_wall_permitted: !1,
1871
+ require_granular_categories: !0
1872
+ }, Jo = {
1873
+ expiry_days: 365,
1874
+ withdrawal_mechanism: "persistent badge",
1875
+ withdrawal_ease: "as easy as giving consent",
1876
+ re_consent_on_policy_change: !0
1877
+ }, Zo = {
1878
+ mandatory_languages: [
1879
+ "th",
1880
+ "en"
1881
+ ],
1882
+ auto_detect_browser_language: !0
1883
+ }, Xo = {
1884
+ honour_gpc: !0,
1885
+ honour_dnt: !0
1886
+ }, Qo = {
1887
+ age_threshold: 10,
1888
+ tracking_prohibited: !1,
1889
+ parental_consent_required: !0
1890
+ }, er = {
1891
+ consent_log_required: !0,
1892
+ retention_years: null,
1893
+ proof_of_consent_required: !0
1894
+ }, tr = {
1895
+ id: Uo,
1896
+ name: Go,
1897
+ consent_model: Fo,
1898
+ default_cookie_state: zo,
1899
+ version: Ho,
1900
+ last_updated: Vo,
1901
+ sources: Wo,
1902
+ jurisdiction: Ko,
1903
+ banner_requirements: Yo,
1904
+ consent_rules: Jo,
1905
+ language: Zo,
1906
+ signals: Xo,
1907
+ children: Qo,
1908
+ audit: er
1909
+ }, nr = "ccpa-cpra", or = "CCPA / CPRA (California)", rr = "opt-out", ar = "allowed", sr = "1.0", ir = "2026-03-01", cr = [
1910
+ "https://oag.ca.gov/privacy/ccpa",
1911
+ "https://cppa.ca.gov/"
1912
+ ], lr = {
1913
+ countries: [
1914
+ "US"
1915
+ ],
1916
+ states: [
1917
+ "CA"
1918
+ ]
1919
+ }, ur = {
1920
+ require_accept_button: !1,
1921
+ require_reject_button: !0,
1922
+ require_equal_prominence: !1,
1923
+ require_customise_button: !0,
1924
+ cookie_wall_permitted: !1,
1925
+ require_granular_categories: !0
1926
+ }, dr = {
1927
+ expiry_days: 365,
1928
+ withdrawal_mechanism: "do not sell link",
1929
+ withdrawal_ease: "clear and conspicuous link",
1930
+ re_consent_on_policy_change: !1
1931
+ }, pr = {
1932
+ mandatory_languages: [
1933
+ "en"
1934
+ ],
1935
+ auto_detect_browser_language: !1
1936
+ }, mr = {
1937
+ honour_gpc: !0,
1938
+ honour_dnt: !0
1939
+ }, fr = {
1940
+ age_threshold: 16,
1941
+ tracking_prohibited: !1,
1942
+ parental_consent_required: !0
1943
+ }, gr = {
1944
+ consent_log_required: !0,
1945
+ retention_years: 2,
1946
+ proof_of_consent_required: !1
1947
+ }, hr = {
1948
+ id: nr,
1949
+ name: or,
1950
+ consent_model: rr,
1951
+ default_cookie_state: ar,
1952
+ version: sr,
1953
+ last_updated: ir,
1954
+ sources: cr,
1955
+ jurisdiction: lr,
1956
+ banner_requirements: ur,
1957
+ consent_rules: dr,
1958
+ language: pr,
1959
+ signals: mr,
1960
+ children: fr,
1961
+ audit: gr
1962
+ }, br = "us-state-general", _r = "US State Privacy Laws (General)", yr = "opt-out", wr = "allowed", vr = "1.0", xr = "2026-03-01", Cr = [
1963
+ "https://iapp.org/resources/article/us-state-privacy-legislation-tracker/"
1964
+ ], Ar = {
1965
+ countries: [
1966
+ "US"
1967
+ ],
1968
+ states: [
1969
+ "CO",
1970
+ "CT",
1971
+ "VA",
1972
+ "UT",
1973
+ "TX",
1974
+ "OR",
1975
+ "MT",
1976
+ "DE",
1977
+ "IA",
1978
+ "NH",
1979
+ "NJ",
1980
+ "TN",
1981
+ "IN",
1982
+ "KY",
1983
+ "NE",
1984
+ "MD",
1985
+ "MN"
1986
+ ]
1987
+ }, kr = {
1988
+ require_accept_button: !1,
1989
+ require_reject_button: !0,
1990
+ require_equal_prominence: !1,
1991
+ require_customise_button: !0,
1992
+ cookie_wall_permitted: !1,
1993
+ require_granular_categories: !1
1994
+ }, Er = {
1995
+ expiry_days: 365,
1996
+ withdrawal_mechanism: "opt-out link",
1997
+ withdrawal_ease: "clear mechanism",
1998
+ re_consent_on_policy_change: !1
1999
+ }, Sr = {
2000
+ mandatory_languages: [
2001
+ "en"
2002
+ ],
2003
+ auto_detect_browser_language: !1
2004
+ }, $r = {
2005
+ honour_gpc: !0,
2006
+ honour_dnt: !0
2007
+ }, qr = {
2008
+ age_threshold: 13,
2009
+ tracking_prohibited: !1,
2010
+ parental_consent_required: !0
2011
+ }, jr = {
2012
+ consent_log_required: !1,
2013
+ retention_years: null,
2014
+ proof_of_consent_required: !1
2015
+ }, Rr = {
2016
+ id: br,
2017
+ name: _r,
2018
+ consent_model: yr,
2019
+ default_cookie_state: wr,
2020
+ version: vr,
2021
+ last_updated: xr,
2022
+ sources: Cr,
2023
+ jurisdiction: Ar,
2024
+ banner_requirements: kr,
2025
+ consent_rules: Er,
2026
+ language: Sr,
2027
+ signals: $r,
2028
+ children: qr,
2029
+ audit: jr
2030
+ }, Lr = "default-global", Pr = "Default Global (GDPR-equivalent)", Ir = "opt-in", Nr = "blocked", Tr = "1.0", Br = "2026-03-01", Dr = [], Mr = {
2031
+ countries: [],
2032
+ states: null
2033
+ }, Or = {
2034
+ require_accept_button: !0,
2035
+ require_reject_button: !0,
2036
+ require_equal_prominence: !0,
2037
+ require_customise_button: !0,
2038
+ cookie_wall_permitted: !1,
2039
+ require_granular_categories: !0
2040
+ }, Ur = {
2041
+ expiry_days: 365,
2042
+ withdrawal_mechanism: "persistent badge",
2043
+ withdrawal_ease: "as easy as giving consent",
2044
+ re_consent_on_policy_change: !0
2045
+ }, Gr = {
2046
+ mandatory_languages: [
2047
+ "en"
2048
+ ],
2049
+ auto_detect_browser_language: !0
2050
+ }, Fr = {
2051
+ honour_gpc: !0,
2052
+ honour_dnt: !0
2053
+ }, zr = {
2054
+ age_threshold: 16,
2055
+ tracking_prohibited: !1,
2056
+ parental_consent_required: !0
2057
+ }, Hr = {
2058
+ consent_log_required: !0,
2059
+ retention_years: null,
2060
+ proof_of_consent_required: !0
2061
+ }, Vr = {
2062
+ id: Lr,
2063
+ name: Pr,
2064
+ consent_model: Ir,
2065
+ default_cookie_state: Nr,
2066
+ version: Tr,
2067
+ last_updated: Br,
2068
+ sources: Dr,
2069
+ jurisdiction: Mr,
2070
+ banner_requirements: Or,
2071
+ consent_rules: Ur,
2072
+ language: Gr,
2073
+ signals: Fr,
2074
+ children: zr,
2075
+ audit: Hr
2076
+ }, Wr = [
2077
+ nn,
2078
+ _n,
2079
+ Pn,
2080
+ Kn,
2081
+ lo,
2082
+ ko,
2083
+ Oo,
2084
+ tr,
2085
+ hr,
2086
+ Rr,
2087
+ Vr
2088
+ ];
2089
+ function Kr() {
2090
+ const t = [];
2091
+ for (const e of Wr)
2092
+ try {
2093
+ t.push(Ut(e));
2094
+ } catch (n) {
2095
+ console.warn(
2096
+ "SmartConsent: Skipping invalid regulation file.",
2097
+ n instanceof Error ? n.message : n
2098
+ );
2099
+ }
2100
+ return t;
2101
+ }
2102
+ function Yr(t, e) {
2103
+ 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));
2104
+ if (n.length === 0) {
2105
+ const o = e.find((a) => a.id === "default-global");
2106
+ o && (n = [o]);
2107
+ }
2108
+ return Jr(n);
2109
+ }
2110
+ function Jr(t) {
2111
+ let e = "opt-out", n = !1, o = !1, a = !1, s = !1, i = !0, l = 1 / 0, d = !1, h = "opt-out link", f = !1;
2112
+ const g = [], _ = [];
2113
+ for (const m of t)
2114
+ g.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 && (f = !0);
2115
+ l === 1 / 0 && (l = 365);
2116
+ const u = [...le];
2117
+ return {
2118
+ mode: e,
2119
+ buttons: {
2120
+ accept_all: n,
2121
+ reject_all: o,
2122
+ customise: a,
2123
+ equal_prominence: s
2124
+ },
2125
+ categories: u,
2126
+ blocking: {
2127
+ mode: "block-first",
2128
+ unknown_scripts: e === "opt-in" ? "blocked" : "allowed"
2129
+ },
2130
+ consent: {
2131
+ expiry_days: l,
2132
+ withdrawal_mechanism: h,
2133
+ re_consent_on_version_change: f
2134
+ },
2135
+ signals: {
2136
+ gpc_auto_reject: d
2137
+ },
2138
+ cookie_wall: i,
2139
+ language: "en",
2140
+ applicable_regulations: g,
2141
+ regulation_ids: _
2142
+ };
2143
+ }
2144
+ const Zr = {
2145
+ "Africa/Ceuta": "ES",
2146
+ "Africa/Johannesburg": "ZA",
2147
+ "America/Araguaina": "BR",
2148
+ "America/Atikokan": "CA",
2149
+ "America/Bahia": "BR",
2150
+ "America/Belem": "BR",
2151
+ "America/Blanc-Sablon": "CA",
2152
+ "America/Boa_Vista": "BR",
2153
+ "America/Boise": "US-VA",
2154
+ "America/Cambridge_Bay": "CA",
2155
+ "America/Campo_Grande": "BR",
2156
+ "America/Chicago": "US-VA",
2157
+ "America/Coral_Harbour": "CA",
2158
+ "America/Creston": "CA",
2159
+ "America/Cuiaba": "BR",
2160
+ "America/Dawson": "CA",
2161
+ "America/Dawson_Creek": "CA",
2162
+ "America/Denver": "US-VA",
2163
+ "America/Detroit": "US-VA",
2164
+ "America/Edmonton": "CA",
2165
+ "America/Eirunepe": "BR",
2166
+ "America/Fort_Nelson": "CA",
2167
+ "America/Fortaleza": "BR",
2168
+ "America/Glace_Bay": "CA",
2169
+ "America/Goose_Bay": "CA",
2170
+ "America/Halifax": "CA",
2171
+ "America/Indiana/Indianapolis": "US-VA",
2172
+ "America/Indianapolis": "US-VA",
2173
+ "America/Inuvik": "CA",
2174
+ "America/Iqaluit": "CA",
2175
+ "America/Kentucky/Louisville": "US-VA",
2176
+ "America/Los_Angeles": "US-CA",
2177
+ "America/Louisville": "US-VA",
2178
+ "America/Maceio": "BR",
2179
+ "America/Manaus": "BR",
2180
+ "America/Moncton": "CA",
2181
+ "America/New_York": "US-VA",
2182
+ "America/Noronha": "BR",
2183
+ "America/Porto_Velho": "BR",
2184
+ "America/Rankin_Inlet": "CA",
2185
+ "America/Recife": "BR",
2186
+ "America/Regina": "CA",
2187
+ "America/Rio_Branco": "BR",
2188
+ "America/Santarem": "BR",
2189
+ "America/Sao_Paulo": "BR",
2190
+ "America/St_Johns": "CA",
2191
+ "America/Swift_Current": "CA",
2192
+ "America/Toronto": "CA",
2193
+ "America/Vancouver": "CA",
2194
+ "America/Whitehorse": "CA",
2195
+ "America/Winnipeg": "CA",
2196
+ "America/Yellowknife": "CA",
2197
+ "Asia/Bangkok": "TH",
2198
+ "Asia/Calcutta": "IN",
2199
+ "Asia/Kolkata": "IN",
2200
+ "Asia/Nicosia": "CY",
2201
+ "Asia/Singapore": "SG",
2202
+ "Atlantic/Azores": "PT",
2203
+ "Atlantic/Canary": "ES",
2204
+ "Atlantic/Madeira": "PT",
2205
+ "Atlantic/Reykjavik": "IS",
2206
+ "Europe/Amsterdam": "NL",
2207
+ "Europe/Athens": "GR",
2208
+ "Europe/Belfast": "GB",
2209
+ "Europe/Berlin": "DE",
2210
+ "Europe/Bratislava": "SK",
2211
+ "Europe/Brussels": "BE",
2212
+ "Europe/Bucharest": "RO",
2213
+ "Europe/Budapest": "HU",
2214
+ "Europe/Busingen": "DE",
2215
+ "Europe/Copenhagen": "DK",
2216
+ "Europe/Dublin": "IE",
2217
+ "Europe/Helsinki": "FI",
2218
+ "Europe/Lisbon": "PT",
2219
+ "Europe/Ljubljana": "SI",
2220
+ "Europe/London": "GB",
2221
+ "Europe/Luxembourg": "LU",
2222
+ "Europe/Madrid": "ES",
2223
+ "Europe/Malta": "MT",
2224
+ "Europe/Nicosia": "CY",
2225
+ "Europe/Oslo": "NO",
2226
+ "Europe/Paris": "FR",
2227
+ "Europe/Prague": "CZ",
2228
+ "Europe/Riga": "LV",
2229
+ "Europe/Rome": "IT",
2230
+ "Europe/Sofia": "BG",
2231
+ "Europe/Stockholm": "SE",
2232
+ "Europe/Tallinn": "EE",
2233
+ "Europe/Vaduz": "LI",
2234
+ "Europe/Vienna": "AT",
2235
+ "Europe/Vilnius": "LT",
2236
+ "Europe/Warsaw": "PL",
2237
+ "Europe/Zagreb": "HR"
2238
+ }, Xr = {
2239
+ "Europe/London": [
2240
+ "JE",
2241
+ "GG",
2242
+ "IM"
2243
+ ],
2244
+ "Europe/Paris": [
2245
+ "MC"
2246
+ ],
2247
+ "Europe/Rome": [
2248
+ "SM",
2249
+ "VA"
2250
+ ],
2251
+ "Asia/Bangkok": [
2252
+ "KH",
2253
+ "LA",
2254
+ "VN"
2255
+ ]
2256
+ }, tt = {
2257
+ zones: Zr,
2258
+ shared: Xr
2259
+ }, nt = "smartconsent_geo", Qr = 24 * 60 * 60 * 1e3, be = "ZZ", ea = tt.zones, ta = tt.shared;
2260
+ function na() {
2261
+ try {
2262
+ const t = sessionStorage.getItem(nt);
2263
+ if (!t) return null;
2264
+ const e = JSON.parse(t);
2265
+ return Date.now() - e.timestamp > Qr ? null : { country: e.country, state: e.state, source: "cache" };
2266
+ } catch {
2267
+ return null;
2268
+ }
2269
+ }
2270
+ function oa(t, e) {
2271
+ try {
2272
+ const n = { country: t, state: e, timestamp: Date.now() };
2273
+ sessionStorage.setItem(nt, JSON.stringify(n));
2274
+ } catch {
2275
+ }
2276
+ }
2277
+ function ra() {
2278
+ try {
2279
+ return new Intl.DateTimeFormat().resolvedOptions().timeZone || null;
2280
+ } catch {
2281
+ return null;
2282
+ }
2283
+ }
2284
+ function aa() {
2285
+ try {
2286
+ const t = /^[A-Za-z]{2,3}-(?:[A-Za-z]{4}-)?([A-Za-z]{2})\b/.exec(navigator.language || "");
2287
+ return t ? t[1].toUpperCase() : "";
2288
+ } catch {
2289
+ return "";
2290
+ }
2291
+ }
2292
+ async function sa() {
2293
+ var s;
2294
+ const t = na();
2295
+ if (t) return t;
2296
+ const e = ra();
2297
+ if (!e) return { country: be, source: "fallback" };
2298
+ const n = ea[e];
2299
+ if (!n) return { country: be, source: "timezone" };
2300
+ if ((s = ta[e]) != null && s.includes(aa())) return { country: be, source: "timezone" };
2301
+ const [o, a] = n.split("-");
2302
+ return oa(o, a), { country: o, state: a, source: "timezone" };
2303
+ }
2304
+ const ce = {};
2305
+ function Me(t) {
2306
+ ce[t.lang] = t;
2307
+ }
2308
+ function ia(t) {
2309
+ return ce[t] ?? ce[t.split("-")[0]] ?? null;
2310
+ }
2311
+ function ve(t) {
2312
+ const e = t.split("-")[0];
2313
+ return e === "en" || e in ce;
2314
+ }
2315
+ function ca() {
2316
+ const t = {};
2317
+ for (const e of le)
2318
+ t[e.id] = { label: e.label, description: e.description };
2319
+ return { lang: "en", dir: "ltr", texts: { ...X }, categories: t };
2320
+ }
2321
+ function la(t) {
2322
+ return t.split("-")[0] === "en" ? ca() : ia(t);
2323
+ }
2324
+ function ua(t) {
2325
+ if (t) {
2326
+ const o = t.split("-")[0];
2327
+ if (o === "en" || ve(t)) return o;
2328
+ }
2329
+ const n = (typeof navigator < "u" && navigator.language || "en").split("-")[0];
2330
+ return n === "en" || ve(n) ? n : "en";
2331
+ }
2332
+ const da = [
2333
+ "ar",
2334
+ "cs",
2335
+ "da",
2336
+ "de",
2337
+ "es",
2338
+ "fr",
2339
+ "hi",
2340
+ "it",
2341
+ "ja",
2342
+ "ko",
2343
+ "nl",
2344
+ "no",
2345
+ "pl",
2346
+ "pt",
2347
+ "ro",
2348
+ "ru",
2349
+ "sv",
2350
+ "tr",
2351
+ "zh"
2352
+ ], pa = 1500, ma = "smartconsent_lang_", Z = (t) => typeof t == "string" ? t.split("-")[0].toLowerCase() : "", ot = (t) => da.includes(t), Oe = (t) => t === "en" || ot(t);
2353
+ function fa() {
2354
+ const t = document.currentScript && document.currentScript.src;
2355
+ if (t && /^https?:\/\//.test(t)) {
2356
+ const e = t.split(/[?#]/)[0];
2357
+ return e.slice(0, e.lastIndexOf("/") + 1);
2358
+ }
2359
+ return ft;
2360
+ }
2361
+ function ga(t) {
2362
+ const e = t.settings.banner, n = Z(e == null ? void 0 : e.language), o = () => {
2363
+ for (const s of [n, Z(t.pageLanguage), Z(t.htmlLang)]) if (Oe(s)) return s;
2364
+ return "en";
2365
+ }, a = Z(t.browserLang);
2366
+ return Array.isArray(e == null ? void 0 : e.languages) ? [n, ...e.languages.map(Z)].filter(Oe).includes(a) ? a : o() : ot(a) ? a : o();
2367
+ }
2368
+ const oe = (t) => typeof t == "string", ha = ["heading", "description", "acceptAll", "rejectOptional", "managePreferences", "essentialOnly", "savePreferences", "poweredBy"];
2369
+ function Ue(t, e) {
2370
+ const n = e;
2371
+ if (!n || typeof n != "object" || n.lang !== t || n.dir !== "ltr" && n.dir !== "rtl") return null;
2372
+ const o = n.texts, a = n.categories;
2373
+ if (!o || typeof o != "object" || Array.isArray(o) || !a || typeof a != "object" || Array.isArray(a)) return null;
2374
+ const s = {};
2375
+ for (const l of ha) {
2376
+ if (!oe(o[l])) return null;
2377
+ s[l] = o[l];
2378
+ }
2379
+ for (const l of ["doNotSell", "cookieSettings", "embedNotice", "embedLoad", "dataRequest"]) oe(o[l]) && (s[l] = o[l]);
2380
+ const i = {};
2381
+ for (const { id: l } of le) {
2382
+ const d = a[l];
2383
+ if (!d || !oe(d.label) || !oe(d.description)) return null;
2384
+ i[l] = { label: d.label, description: d.description };
2385
+ }
2386
+ return { lang: t, dir: n.dir, texts: s, categories: i };
2387
+ }
2388
+ async function ba(t, e) {
2389
+ const n = `${e}lang/${t}.json`, o = ma + n;
2390
+ try {
2391
+ const d = Ue(t, JSON.parse(sessionStorage.getItem(o) || "null"));
2392
+ if (d)
2393
+ return Me(d), !0;
2394
+ } catch {
2395
+ }
2396
+ const a = new AbortController();
2397
+ let s;
2398
+ const i = new Promise((d) => {
2399
+ s = setTimeout(() => {
2400
+ a.abort(), d(null);
2401
+ }, pa);
2402
+ }), l = (async () => {
2403
+ try {
2404
+ const d = await fetch(n, { signal: a.signal, credentials: "omit" });
2405
+ if (!d.ok) return null;
2406
+ const h = Ue(t, await d.json());
2407
+ if (h)
2408
+ try {
2409
+ sessionStorage.setItem(o, JSON.stringify(h));
2410
+ } catch {
2411
+ }
2412
+ return h;
2413
+ } catch {
2414
+ return null;
2415
+ }
2416
+ })();
2417
+ try {
2418
+ const d = await Promise.race([l, i]);
2419
+ return d ? (Me(d), !0) : !1;
2420
+ } finally {
2421
+ clearTimeout(s);
2422
+ }
2423
+ }
2424
+ const rt = /* @__PURE__ */ new WeakSet();
2425
+ function _a(t) {
2426
+ return rt.add(t), t;
2427
+ }
2428
+ function Ee(t) {
2429
+ const e = t.cookies;
2430
+ if (e.length === 0)
2431
+ return '<p class="sc-table-empty">No cookies declared.</p>';
2432
+ const n = wa(e, t);
2433
+ let o = '<div class="sc-cookie-table-wrap">';
2434
+ for (const [a, s] of n) {
2435
+ o += `<h3 class="sc-table-category">${W(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>";
2436
+ for (const i of s) {
2437
+ o += "<tr>", o += `<td>${W(i.name)}${i.domain ? ` <small>(${W(i.domain)})</small>` : ""}</td>`;
2438
+ const l = rt.has(i);
2439
+ o += `<td>${W(i.duration ?? (l ? "" : "Session"))}</td>`, o += `<td>${W(i.description ?? "")}</td>`, o += `<td>${W(i.party === "third" ? "Third party" : i.party || !l ? "First party" : "")}</td>`, o += "</tr>";
2440
+ }
2441
+ o += "</tbody></table>";
2442
+ }
2443
+ return o += "</div>", o;
2444
+ }
2445
+ function ya(t, e) {
2446
+ const n = document.querySelector(t);
2447
+ if (!n) {
2448
+ console.warn(`SmartConsent: Cookie table target "${t}" not found.`);
2449
+ return;
2450
+ }
2451
+ n.innerHTML = Ee(e);
2452
+ }
2453
+ function wa(t, e) {
2454
+ const n = /* @__PURE__ */ new Map();
2455
+ for (const s of t) {
2456
+ const i = s.category;
2457
+ n.has(i) || n.set(i, []), n.get(i).push(s);
2458
+ }
2459
+ const o = {};
2460
+ for (const s of e.categories)
2461
+ o[s.id] = s.label;
2462
+ const a = [];
2463
+ for (const [s, i] of n)
2464
+ a.push([o[s] ?? s, i]);
2465
+ return a;
2466
+ }
2467
+ function W(t) {
2468
+ return t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
2469
+ }
2470
+ function at(t, e) {
2471
+ const { siteName: n, siteUrl: o, contactEmail: a } = e, s = (/* @__PURE__ */ new Date()).toLocaleDateString("en-GB", { day: "numeric", month: "long", year: "numeric" }), i = t.categories.map((u) => `<li><strong>${z(u.label)}</strong>: ${z(u.description)}</li>`).join(`
2472
+ `), l = t.cookies.length > 0 ? Ee(t) : "<p>No specific cookies have been declared for this site.</p>", d = z(ee(t, "policyCredit")), h = we(t.attributionUrl), f = t.attribution ? `
2473
+ <p class="sc-policy-credit">${h ? `<a href="${z(h)}">${d}</a>` : d}</p>` : "", g = z(o), _ = we(o) ? `<a href="${g}">${g}</a>` : g;
2474
+ return `<div class="sc-cookie-policy">
2475
+ <h1>Cookie Policy</h1>
2476
+ <p><em>Last updated: ${s}</em></p>
2477
+
2478
+ <h2>What are cookies?</h2>
2479
+ <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>
2480
+
2481
+ <h2>How ${z(n)} uses cookies</h2>
2482
+ <p>We use cookies on ${_} for the following purposes:</p>
2483
+ <ul>
2484
+ ${i}
2485
+ </ul>
2486
+
2487
+ <h2>Cookies we use</h2>
2488
+ ${l}
2489
+
2490
+ <h2>Managing your preferences</h2>
2491
+ <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>
2492
+
2493
+ <h2>Contact</h2>
2494
+ <p>If you have questions about our use of cookies, please contact us at <a href="mailto:${z(a)}">${z(a)}</a>.</p>
2495
+
2496
+ <hr>
2497
+ <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>${f}
2498
+ </div>`;
2499
+ }
2500
+ function va(t, e, n) {
2501
+ const o = document.querySelector(t);
2502
+ if (!o) {
2503
+ console.warn(`SmartConsent: Cookie policy target "${t}" not found.`);
2504
+ return;
2505
+ }
2506
+ o.innerHTML = at(e, n);
2507
+ }
2508
+ function z(t) {
2509
+ return t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
2510
+ }
2511
+ function xa(t) {
2512
+ if (t.length === 0)
2513
+ return {
2514
+ totalActions: 0,
2515
+ acceptAllRate: 0,
2516
+ rejectAllRate: 0,
2517
+ customRate: 0,
2518
+ categoryBreakdown: {},
2519
+ lastUpdated: (/* @__PURE__ */ new Date()).toISOString()
2520
+ };
2521
+ let e = 0, n = 0, o = 0;
2522
+ const a = {};
2523
+ for (const i of t) {
2524
+ i.action === "accept_all" ? e++ : i.action === "reject_optional" ? n++ : i.action === "custom" && o++;
2525
+ for (const [l, d] of Object.entries(i.categories))
2526
+ a[l] || (a[l] = { accepted: 0, rejected: 0 }), d ? a[l].accepted++ : a[l].rejected++;
2527
+ }
2528
+ const s = t.length;
2529
+ return {
2530
+ totalActions: s,
2531
+ acceptAllRate: Math.round(e / s * 100),
2532
+ rejectAllRate: Math.round(n / s * 100),
2533
+ customRate: Math.round(o / s * 100),
2534
+ categoryBreakdown: a,
2535
+ lastUpdated: t[t.length - 1].timestamp
2536
+ };
2537
+ }
2538
+ const Ca = /^[A-Za-z0-9_-]{1,64}$/, Aa = 1500, ka = "smartconsent_site3_", Ge = "smartconsent_site2_", st = (t) => typeof t == "string" && Ca.test(t) ? t : null;
2539
+ function Ea(t) {
2540
+ const e = t && typeof t == "object" ? t.siteId : void 0;
2541
+ return st(e) ?? it();
2542
+ }
2543
+ const it = () => {
2544
+ var t;
2545
+ return st((t = document.querySelector('script[src*="smartconsent"][data-site-id]')) == null ? void 0 : t.getAttribute("data-site-id"));
2546
+ };
2547
+ function Fe(t) {
2548
+ const e = t;
2549
+ 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";
2550
+ }
2551
+ async function Sa(t, e) {
2552
+ const n = ka + t;
2553
+ let o = null;
2554
+ for (const d of [n, Ge + t])
2555
+ try {
2556
+ const h = JSON.parse(sessionStorage.getItem(d) || "null");
2557
+ if (Fe(h)) {
2558
+ h.attribution.required && (o = { ...h, attribution: { required: !0 } });
2559
+ break;
2560
+ }
2561
+ } catch {
2562
+ }
2563
+ const a = new AbortController();
2564
+ let s;
2565
+ const i = new Promise((d) => {
2566
+ s = setTimeout(() => {
2567
+ a.abort(), d(null);
2568
+ }, Aa);
2569
+ }), l = (async () => {
2570
+ try {
2571
+ const d = await fetch(`${e}/v1/sites/${t}.json`, { signal: a.signal, credentials: "omit" });
2572
+ if (!d.ok) return null;
2573
+ const h = await d.json();
2574
+ if (!Fe(h)) return null;
2575
+ try {
2576
+ sessionStorage.setItem(n, JSON.stringify(h)), sessionStorage.removeItem(Ge + t);
2577
+ } catch {
2578
+ }
2579
+ return h;
2580
+ } catch {
2581
+ return null;
2582
+ }
2583
+ })();
2584
+ try {
2585
+ return await Promise.race([l, i]) ?? o;
2586
+ } finally {
2587
+ clearTimeout(s);
2588
+ }
2589
+ }
2590
+ const re = (t) => t.toLowerCase().replace(/\.$/, "").replace(/^www\./, "");
2591
+ function $a(t, e, n) {
2592
+ t.attributionRef !== void 0 && (t = { ...t }, delete t.attributionRef);
2593
+ const o = t.platform === "wordpress-plugin" || t.platform === "joomla-extension" || t.platform === "drupal-module";
2594
+ if (o && t.attribution !== !0 && (t = { ...t, attribution: !1 }), !e) return t;
2595
+ const a = qa(e);
2596
+ if (a.length && t.cookies.length === 0 && (t = { ...t, cookies: a }), o && !t.attribution) return t;
2597
+ const s = e.attribution;
2598
+ let i = e.mode === "safe" || s.required;
2599
+ if (!i && e.plan !== "enterprise" && (i = !(typeof e.host == "string" && re(e.host) === re(location.hostname) && t.attribution === !1)), !i) return t;
2600
+ const l = { ...t, attribution: !0, attributionUrl: ae.attributionUrl }, d = it(), h = s.ref === n && (!d || d === n);
2601
+ return s.ref && h && typeof s.host == "string" && re(s.host) === re(location.hostname) && (l.attributionRef = s.ref), l;
2602
+ }
2603
+ function qa(t) {
2604
+ const e = t.cookies, n = [];
2605
+ if (!Array.isArray(e)) return n;
2606
+ for (const o of e) {
2607
+ if (!o || typeof o.name != "string" || typeof o.category != "string") continue;
2608
+ const a = { name: o.name, category: o.category }, s = [o.provider, o.purpose].filter((i) => typeof i == "string" && i !== "");
2609
+ 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(_a(a));
2610
+ }
2611
+ return n;
2612
+ }
2613
+ const ja = ["bg", "surface", "border", "text", "textMuted", "accent", "accept", "reject", "toggleOn", "toggleOff", "radius", "font"], Ra = ["heading", "description", "acceptAll", "rejectOptional", "managePreferences", "essentialOnly", "savePreferences"];
2614
+ function ze(t, e) {
2615
+ const n = {};
2616
+ if (t && typeof t == "object")
2617
+ for (const o of e) {
2618
+ const a = t[o];
2619
+ typeof a == "string" && (n[o] = a);
2620
+ }
2621
+ return n;
2622
+ }
2623
+ function La(t) {
2624
+ const e = t;
2625
+ 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;
2626
+ }
2627
+ function He(t) {
2628
+ const e = { ...t };
2629
+ return delete e.logo, e;
2630
+ }
2631
+ function Pa(t, e) {
2632
+ if (!e) return t;
2633
+ 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;
2634
+ if (!o) return s ? He(t) : t;
2635
+ let i = { ...t };
2636
+ s && (i = He(i));
2637
+ const l = a ? La(o.logo) : null;
2638
+ return l && (i.logo = l), ct(i, o);
2639
+ }
2640
+ function ct(t, e) {
2641
+ const n = { ...t };
2642
+ 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, ...ze(e.theme, ja) }, n.texts = { ...t.texts, ...ze(e.texts, Ra) }, n;
2643
+ }
2644
+ function Ve(t, e, n, o) {
2645
+ if (!o || !e || e.v !== 1 || typeof e.apply != "function") return t;
2646
+ let a;
2647
+ try {
2648
+ a = e.apply([...n], o.regions);
2649
+ } catch {
2650
+ return t;
2651
+ }
2652
+ return a && typeof a == "object" && !Array.isArray(a) ? ct(t, a) : t;
2653
+ }
2654
+ function Ia(t) {
2655
+ var o;
2656
+ const e = (a) => {
2657
+ const [s, ...i] = Array.from(a), l = t[s];
2658
+ if (typeof l != "function") {
2659
+ console.warn("SmartConsent: unknown method", s);
2660
+ return;
2661
+ }
2662
+ try {
2663
+ l.apply(t, i);
2664
+ } catch (d) {
2665
+ console.error("SmartConsent: queued call failed.", s, d);
2666
+ }
2667
+ }, n = ((o = window.smartconsent) == null ? void 0 : o.q) || [];
2668
+ window.smartconsent = (...a) => e(a);
2669
+ for (let a = 0; a < n.length; a++) e(n[a]);
2670
+ }
2671
+ const xe = "smartconsent_block_", Na = /^[a-z0-9._/-]{1,100}$/;
2672
+ function lt(t) {
2673
+ return Array.isArray(t) ? t.filter((e) => Array.isArray(e) && typeof e[0] == "string" && Na.test(e[0]) && (e[1] === "analytics" || e[1] === "marketing")).slice(0, 300) : null;
2674
+ }
2675
+ function Ta(t) {
2676
+ try {
2677
+ return lt(JSON.parse(localStorage.getItem(xe + t) || "null"));
2678
+ } catch {
2679
+ return null;
2680
+ }
2681
+ }
2682
+ function Ba(t, e) {
2683
+ const n = lt(e.block);
2684
+ try {
2685
+ n ? localStorage.setItem(xe + t, JSON.stringify(n)) : localStorage.removeItem(xe + t);
2686
+ } catch {
2687
+ }
2688
+ return n ?? [];
2689
+ }
2690
+ const Da = /^[a-z0-9-]{1,32}$/, Ma = 1500, Oa = document.createElement, We = /* @__PURE__ */ new Map();
2691
+ function _e(t, e, n) {
2692
+ if (!Da.test(t) || !Array.isArray(n) || !n.includes(t)) return Promise.resolve(null);
2693
+ let o = We.get(t);
2694
+ return o || (o = new Promise((a) => {
2695
+ const s = Oa.call(document, "script"), i = (d) => {
2696
+ var f;
2697
+ clearTimeout(l);
2698
+ const h = d ? (f = window.SmartConsentCapsules) == null ? void 0 : f[t] : null;
2699
+ a(h && typeof h == "object" ? h : null);
2700
+ }, l = setTimeout(() => i(!1), Ma);
2701
+ s.async = !0, s.src = `${e}capsules/${t}.js`, s.onload = () => i(!0), s.onerror = () => i(!1), document.head.appendChild(s);
2702
+ }), We.set(t, o)), o;
2703
+ }
2704
+ const Ua = "1.0.0", Ce = "smartconsent_vid";
2705
+ function Ga() {
2706
+ try {
2707
+ return crypto.randomUUID();
2708
+ } catch {
2709
+ return Date.now().toString(36) + Math.random().toString(36).slice(2) + Math.random().toString(36).slice(2);
2710
+ }
2711
+ }
2712
+ function Fa() {
2713
+ try {
2714
+ return localStorage.getItem(Ce);
2715
+ } catch {
2716
+ return null;
2717
+ }
2718
+ }
2719
+ function Ke(t) {
2720
+ if (typeof t != "string") return null;
2721
+ try {
2722
+ if (t.startsWith("/") && t[1] !== "/" && t[1] !== "\\" || /^https?:\/\//i.test(t)) {
2723
+ const n = new URL(t, location.href);
2724
+ if (n.origin === location.origin && (n.protocol === "http:" || n.protocol === "https:")) return n.href;
2725
+ }
2726
+ } catch {
2727
+ }
2728
+ return console.warn("SmartConsent: recordsEndpoint ignored (it must be on this site)."), null;
2729
+ }
2730
+ function za() {
2731
+ var t;
2732
+ return ((t = document.querySelector('script[src*="smartconsent"][data-records-endpoint]')) == null ? void 0 : t.getAttribute("data-records-endpoint")) ?? void 0;
2733
+ }
2734
+ function Ha(t) {
2735
+ const { siteId: e, recordsUrl: n, config: o, language: a, experiment: s } = t;
2736
+ let i = null, l = !1, d = !0;
2737
+ Promise.resolve().then(() => {
2738
+ d = !1;
2739
+ });
2740
+ function h() {
2741
+ if (!i) {
2742
+ try {
2743
+ const f = localStorage.getItem(Ce);
2744
+ if (f) {
2745
+ i = f, l = !0;
2746
+ return;
2747
+ }
2748
+ } catch {
2749
+ }
2750
+ i = Ga();
2751
+ try {
2752
+ localStorage.setItem(Ce, i), l = !0;
2753
+ } catch {
2754
+ l = !1;
2755
+ }
2756
+ }
2757
+ }
2758
+ return {
2759
+ send(f) {
2760
+ try {
2761
+ h();
2762
+ const g = o.texts, _ = {};
2763
+ for (const x of o.categories) _[x.id] = x.label;
2764
+ const u = {
2765
+ site_id: e,
2766
+ consent_id: f.id,
2767
+ visitor_id: i,
2768
+ visitor_id_persisted: l,
2769
+ timestamp: f.timestamp,
2770
+ action: f.action,
2771
+ categories: { ...f.categories },
2772
+ consent_version: f.version,
2773
+ jurisdiction: f.jurisdiction,
2774
+ gpc: d && f.action === "reject_optional" && navigator.globalPrivacyControl === !0,
2775
+ language: a,
2776
+ wording: {
2777
+ heading: g.heading,
2778
+ description: g.description,
2779
+ acceptAll: g.acceptAll,
2780
+ rejectOptional: g.rejectOptional,
2781
+ managePreferences: g.managePreferences,
2782
+ essentialOnly: g.essentialOnly,
2783
+ savePreferences: g.savePreferences,
2784
+ categories: _
2785
+ },
2786
+ page_url: location.origin + location.pathname,
2787
+ engine_version: Ua,
2788
+ ...s && { experiment: s.id, variant: s.variant, page: location.pathname.slice(0, 200) }
2789
+ }, m = n, T = JSON.stringify(u);
2790
+ let $ = !1;
2791
+ try {
2792
+ $ = typeof navigator.sendBeacon == "function" && navigator.sendBeacon(m, T);
2793
+ } catch {
2794
+ $ = !1;
2795
+ }
2796
+ $ || fetch(m, { method: "POST", body: T, keepalive: !0, mode: "no-cors", credentials: "omit" }).catch(() => {
2797
+ });
2798
+ } catch {
2799
+ }
2800
+ }
2801
+ };
2802
+ }
2803
+ async function Va() {
2804
+ const t = qt(), e = Ea(window.SmartConsentConfig), n = e ? Ta(e) : null;
2805
+ e && t.setRules(n), t.init();
2806
+ const o = window.SmartConsentConfig, a = !(o && typeof o == "object" && o.consentMode === !1);
2807
+ a && (Ze(), Et());
2808
+ let s = null;
2809
+ try {
2810
+ const i = fa(), l = e ? Sa(e, mt) : Promise.resolve(null);
2811
+ e && l.then((y) => t.setRules(y ? Ba(e, y) : n ?? []));
2812
+ const d = Kr(), h = await sa(), f = Yr(h, d), g = window.SmartConsentConfig, _ = Ja(f, g);
2813
+ let u;
2814
+ try {
2815
+ u = bt(_);
2816
+ } catch (y) {
2817
+ return console.error("SmartConsent: Invalid config.", y instanceof Error ? y.message : y), se();
2818
+ }
2819
+ const m = await l;
2820
+ u = $a(u, m, e ?? void 0), delete u.dataRequestUrl, e && (m == null ? void 0 : m.requests) === !0 && (u = { ...u, dataRequestUrl: `${$e}/api/v1/privacy-request/${encodeURIComponent(e)}` });
2821
+ const T = _e("country-banners", i, m == null ? void 0 : m.capsules), $ = Ka(m), x = $ ? _e("subdomain-consent", i, m == null ? void 0 : m.capsules) : Promise.resolve(null), k = m == null ? void 0 : m.experiment, K = !!k && typeof k.id == "string" && !!k.b && typeof k.b == "object" ? _e("banner-experiment", i, m == null ? void 0 : m.capsules) : Promise.resolve(null), P = g && typeof g == "object" ? g : {};
2822
+ let q;
2823
+ e && m ? (q = ga({
2824
+ pageLanguage: u.language,
2825
+ settings: m,
2826
+ htmlLang: document.documentElement.lang,
2827
+ browserLang: typeof navigator < "u" ? navigator.language : void 0
2828
+ }), ve(q) || await ba(q, i)) : q = ua(u.language);
2829
+ const C = la(q);
2830
+ if (C) {
2831
+ u = { ...u, language: C.lang };
2832
+ const y = P.texts && typeof P.texts == "object" ? P.texts : {};
2833
+ u = {
2834
+ ...u,
2835
+ texts: { ...u.texts, ...C.texts, ...y },
2836
+ dir: C.dir
2837
+ }, P.categories === void 0 && (u = {
2838
+ ...u,
2839
+ categories: u.categories.map((j) => {
2840
+ const F = C.categories[j.id];
2841
+ return F ? { ...j, label: F.label, description: F.description } : j;
2842
+ })
2843
+ });
2844
+ } else u.language && u.language !== "en" && (u = { ...u, language: "en" });
2845
+ if (P.translations && typeof P.translations == "object") {
2846
+ const y = P.translations, j = u.texts;
2847
+ for (const [F, te] of Object.entries(y))
2848
+ if (typeof te == "string") {
2849
+ if (F.startsWith("banner.")) {
2850
+ const V = F.slice(7);
2851
+ V in j && (j[V] = te);
2852
+ } else if (F.startsWith("categories.")) {
2853
+ const V = F.split(".");
2854
+ if (V.length === 3) {
2855
+ const dt = V[1], Se = V[2];
2856
+ u = {
2857
+ ...u,
2858
+ categories: u.categories.map(
2859
+ (ue) => ue.id === dt ? { ...ue, ...Se === "name" ? { label: te } : Se === "description" ? { description: te } : {} } : ue
2860
+ )
2861
+ };
2862
+ }
2863
+ }
2864
+ }
2865
+ }
2866
+ u = Pa(u, m), u = Ve(u, await T, f.regulation_ids, m);
2867
+ const M = Wa(await K, k == null ? void 0 : k.id);
2868
+ if (M === "b") {
2869
+ const y = u.texts.rejectOptional;
2870
+ u = Ve(u, { v: 1, apply: () => k == null ? void 0 : k.b }, [], m), u.texts.rejectOptional = y;
2871
+ }
2872
+ const I = Math.ceil(f.consent.expiry_days / 30);
2873
+ I < u.expiry && (u = { ...u, expiry: Math.max(1, Math.min(13, I)) });
2874
+ const S = await x, R = (S == null ? void 0 : S.v) === 1 && typeof S.read == "function" && typeof S.write == "function" ? S : null, N = (y) => {
2875
+ try {
2876
+ R == null || R.write($, y);
2877
+ } catch {
2878
+ }
2879
+ };
2880
+ if (R)
2881
+ try {
2882
+ Ya(R.read($), u.version, N);
2883
+ } catch {
2884
+ }
2885
+ const v = yt(u);
2886
+ R && v.onConsentChange(() => N(v.getState()));
2887
+ let O = f.mode === "opt-out" && v.needsConsent(), B = null;
2888
+ const r = () => {
2889
+ B == null || B.hide(), B = null;
2890
+ };
2891
+ v.onConsentChange(() => {
2892
+ O = !1, r();
2893
+ });
2894
+ const c = {
2895
+ ...v,
2896
+ getState: () => v.getState() ?? (O ? { version: u.version, categories: Object.fromEntries(u.categories.map((y) => [y.id, !0])), timestamp: "", action: "accept_all", expiresAt: "" } : null),
2897
+ hasConsent: (y) => {
2898
+ var j;
2899
+ return ((j = c.getState()) == null ? void 0 : j.categories[y]) === !0;
2900
+ }
2901
+ }, p = Ct(u), b = kt(u, c), A = await xt(), w = f.applicable_regulations.join(", ") || "unknown", E = vt({
2902
+ visitorHash: A,
2903
+ jurisdiction: w,
2904
+ version: String(u.version)
2905
+ }), L = Ke(u.recordsEndpoint) ?? Ke(za()), D = e && (m || L) ? Ha({
2906
+ siteId: e,
2907
+ recordsUrl: L ?? `${$e}/api/v1/consent-records`,
2908
+ config: u,
2909
+ language: C ? q : "en",
2910
+ experiment: M && k ? { id: k.id, variant: M } : null
2911
+ }) : null;
2912
+ v.onConsentChange((y) => {
2913
+ const j = E.addRecord(y.action, y.categories);
2914
+ p.send(y, j), D == null || D.send(j);
2915
+ });
2916
+ const ut = wt(v, u, f);
2917
+ t.setTexts(u.texts);
2918
+ try {
2919
+ if (b.init({ defaultSent: a }), a) {
2920
+ s = Ae((j) => me(!!j.categories.marketing));
2921
+ const y = c.getState();
2922
+ y && me(!!y.categories.marketing);
2923
+ }
2924
+ t.attach(c);
2925
+ } catch (y) {
2926
+ try {
2927
+ b.destroy(), s == null || s(), a && (At(), me(!1));
2928
+ } catch {
2929
+ }
2930
+ return console.error("SmartConsent: Initialization error.", y instanceof Error ? y.message : y), se();
2931
+ }
2932
+ jt(u.theme);
2933
+ let U = J(c, u);
2934
+ const H = Ot(u, () => {
2935
+ H.hide(), U = J(c, u), U.show();
2936
+ });
2937
+ return v.onConsentChange(() => {
2938
+ setTimeout(() => {
2939
+ v.needsConsent() || H.show();
2940
+ }, 0);
2941
+ }), ut ? H.show() : v.needsConsent() ? O ? (B = Mt(v, u, () => (U = J(c, u)).show())).show() : U.show() : H.show(), {
2942
+ hasConsent(y) {
2943
+ return c.hasConsent(y);
2944
+ },
2945
+ getConsent() {
2946
+ return v.getState();
2947
+ },
2948
+ getConsentLog() {
2949
+ return E.getLog();
2950
+ },
2951
+ getLatestConsent() {
2952
+ return E.getLatest();
2953
+ },
2954
+ getConsentStats() {
2955
+ return xa(E.getLog());
2956
+ },
2957
+ getCookies() {
2958
+ return u.cookies;
2959
+ },
2960
+ renderCookieTable(y) {
2961
+ ya(y, u);
2962
+ },
2963
+ getCookieTableHTML() {
2964
+ return Ee(u);
2965
+ },
2966
+ generateCookiePolicy(y) {
2967
+ return at(u, y);
2968
+ },
2969
+ renderCookiePolicy(y, j) {
2970
+ va(y, u, j);
2971
+ },
2972
+ show() {
2973
+ r(), H.hide(), U = J(c, u), U.show();
2974
+ },
2975
+ reset() {
2976
+ r(), O = !1, U.destroy(), H.destroy(), v.reset(), R && N(null), E.clear(), U = J(c, u), U.show();
2977
+ }
2978
+ };
2979
+ } catch (i) {
2980
+ return console.error("SmartConsent: Initialization error.", i instanceof Error ? i.message : i), se();
2981
+ }
2982
+ }
2983
+ function Wa(t, e) {
2984
+ if (!t || t.v !== 1 || typeof t.pick != "function" || !e) return null;
2985
+ try {
2986
+ const n = t.pick(Fa(), e);
2987
+ return n === "a" || n === "b" ? n : null;
2988
+ } catch {
2989
+ return null;
2990
+ }
2991
+ }
2992
+ function Ka(t) {
2993
+ var a;
2994
+ const e = (a = t == null ? void 0 : t.share) == null ? void 0 : a.domain;
2995
+ if (typeof e != "string" || !e) return null;
2996
+ const n = e.toLowerCase(), o = location.hostname.toLowerCase();
2997
+ return o === n || o.endsWith("." + n) ? n : null;
2998
+ }
2999
+ function Ya(t, e, n) {
3000
+ const o = (l) => !!l && l.version === e && Date.parse(l.expiresAt) > Date.now() && !!l.categories && typeof l.categories == "object", a = Ye(), s = a.getConsent(), i = o(t);
3001
+ 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);
3002
+ }
3003
+ function Ja(t, e) {
3004
+ 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);
3005
+ return {
3006
+ version: o,
3007
+ expiry: i,
3008
+ // Site owner cosmetic overrides
3009
+ ...n.theme !== void 0 && { theme: n.theme },
3010
+ ...n.texts !== void 0 && { texts: n.texts },
3011
+ ...n.webhookUrl !== void 0 && { webhookUrl: n.webhookUrl },
3012
+ ...n.recordsEndpoint !== void 0 && { recordsEndpoint: n.recordsEndpoint },
3013
+ ...n.attribution !== void 0 && { attribution: n.attribution },
3014
+ ...n.platform !== void 0 && { platform: n.platform },
3015
+ ...n.attributionUrl !== void 0 && { attributionUrl: n.attributionUrl },
3016
+ ...n.showBadge !== void 0 && { showBadge: n.showBadge },
3017
+ ...n.badgePosition !== void 0 && { badgePosition: n.badgePosition },
3018
+ ...n.position !== void 0 && { position: n.position },
3019
+ ...n.onConsent !== void 0 && { onConsent: n.onConsent },
3020
+ // Categories from site owner if provided, else from regulation
3021
+ ...n.categories !== void 0 ? { categories: n.categories } : { categories: t.categories },
3022
+ // consentMode from site owner if provided
3023
+ ...n.consentMode !== void 0 && { consentMode: n.consentMode },
3024
+ // language (FP-03: i18n)
3025
+ ...n.language !== void 0 && { language: n.language },
3026
+ // layout (FP-06)
3027
+ ...n.layout !== void 0 && { layout: n.layout },
3028
+ ...n.boxPosition !== void 0 && { boxPosition: n.boxPosition },
3029
+ // logo (FP-05)
3030
+ ...n.logo !== void 0 && { logo: n.logo },
3031
+ // cookies (FP-07)
3032
+ ...n.cookies !== void 0 && { cookies: n.cookies }
3033
+ };
3034
+ }
3035
+ function se() {
3036
+ return {
3037
+ hasConsent: () => !1,
3038
+ getConsent: () => null,
3039
+ getConsentLog: () => [],
3040
+ getLatestConsent: () => null,
3041
+ getConsentStats: () => ({ totalActions: 0, acceptAllRate: 0, rejectAllRate: 0, customRate: 0, categoryBreakdown: {}, lastUpdated: "" }),
3042
+ getCookies: () => [],
3043
+ renderCookieTable: () => {
3044
+ },
3045
+ getCookieTableHTML: () => "",
3046
+ generateCookiePolicy: () => "",
3047
+ renderCookiePolicy: () => {
3048
+ },
3049
+ show: () => {
3050
+ },
3051
+ reset: () => {
3052
+ }
3053
+ };
3054
+ }
3055
+ const Za = Va();
3056
+ window.SmartConsent = se();
3057
+ Za.then((t) => {
3058
+ window.SmartConsent = t, Ia(t);
3059
+ });
3060
+ export {
3061
+ Za as default
3062
+ };
3063
+ //# sourceMappingURL=smartconsent.es.js.map