@naturalcycles/internal-web-lib 1.6.1 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/analyticsClient.js +137 -137
- package/bundle/analyticsClient.js.map +1 -1
- package/bundle/conversionClient.js +28 -28
- package/bundle/conversionClient.js.map +1 -1
- package/bundle/cookieMonster.js +86 -76
- package/bundle/cookieMonster.js.map +1 -1
- package/dist/cookie-monster/components/setting-dropdown/setting-dropdown.component.js +1 -1
- package/dist/cookie-monster/components/themed-button/themed-button.component.js +1 -1
- package/dist/cookie-monster/consent/consent.service.js +1 -1
- package/dist/cookie-monster/cookie-monster-element.d.ts +2 -2
- package/dist/cookie-monster/cookie-monster-element.js +9 -5
- package/dist/cookie-monster/cookieMonsterService.d.ts +3 -0
- package/dist/cookie-monster/cookieMonsterService.js +12 -4
- package/dist/cookie-monster/css/variants.js +3 -0
- package/dist/cookie-monster/index.js +2 -2
- package/dist/cookie-monster/types/CookieMonster.types.d.ts +5 -0
- package/dist/cookie-monster/types/CookieMonster.types.js +6 -1
- package/dist/cookie-monster/views/settings.view.js +1 -2
- package/dist/cookie-monster/views/views.js +1 -1
- package/package.json +1 -1
- package/dist/cookie-monster/icons/back.js +0 -3
package/bundle/cookieMonster.js
CHANGED
|
@@ -15,12 +15,14 @@ var i = r(e.replaceAll(":root", ":host")), a = r(n), o = r(t), s = "data:image/s
|
|
|
15
15
|
return e.DropdownOpen = "DropdownOpen", e;
|
|
16
16
|
}({}), f = /* @__PURE__ */ function(e) {
|
|
17
17
|
return e.explicit = "explicit", e.gpc = "gpc", e;
|
|
18
|
-
}({}), p =
|
|
19
|
-
|
|
18
|
+
}({}), p = /* @__PURE__ */ function(e) {
|
|
19
|
+
return e.Default = "default", e.R1B2 = "r1b2", e;
|
|
20
|
+
}({}), ee = Object.keys;
|
|
21
|
+
// ../../node_modules/.pnpm/@naturalcycles+js-lib@15.99.0_undici@8.12.3/node_modules/@naturalcycles/js-lib/dist/env.js
|
|
20
22
|
function m() {
|
|
21
|
-
return !
|
|
23
|
+
return !te();
|
|
22
24
|
}
|
|
23
|
-
function
|
|
25
|
+
function te() {
|
|
24
26
|
return typeof window < "u" && !!window?.document;
|
|
25
27
|
}
|
|
26
28
|
// ../shared/dist/lang/langService.js
|
|
@@ -64,7 +66,7 @@ var g = h.en_US, _ = [
|
|
|
64
66
|
h.fi_FI,
|
|
65
67
|
h.da_DK,
|
|
66
68
|
h.no_NO
|
|
67
|
-
],
|
|
69
|
+
], S = {
|
|
68
70
|
[h.pt_BR]: "Português",
|
|
69
71
|
[h.en_US]: "English (US)",
|
|
70
72
|
[h.en_GB]: "English (GB)",
|
|
@@ -86,8 +88,8 @@ var g = h.en_US, _ = [
|
|
|
86
88
|
[h.sk_SK]: "Slovenčina",
|
|
87
89
|
[h.sl_SI]: "Slovenščina",
|
|
88
90
|
[h.en]: "English"
|
|
89
|
-
},
|
|
90
|
-
label:
|
|
91
|
+
}, C = v.map((e) => ({
|
|
92
|
+
label: S[e],
|
|
91
93
|
value: e
|
|
92
94
|
})).concat([
|
|
93
95
|
{
|
|
@@ -118,7 +120,7 @@ var g = h.en_US, _ = [
|
|
|
118
120
|
label: "Polski",
|
|
119
121
|
value: "pl-PL"
|
|
120
122
|
}
|
|
121
|
-
]),
|
|
123
|
+
]), ne = /* @__PURE__ */ new Set([
|
|
122
124
|
h.de_DE,
|
|
123
125
|
h.es_US,
|
|
124
126
|
h.fr_FR,
|
|
@@ -131,8 +133,8 @@ var g = h.en_US, _ = [
|
|
|
131
133
|
SUPPORTED_WEBSIGNUP_LANGUAGES = y;
|
|
132
134
|
SUPPORTED_NCWEB_LANGUAGES = b;
|
|
133
135
|
SUPPORTED_COOKIE_MONSTER_LANGUAGES = x;
|
|
134
|
-
SUPPORTED_HELP_CENTER_LANGUAGES =
|
|
135
|
-
SUPPORTED_WEBSIGNUP_CONSENT_LANGUAGE_OPTIONS =
|
|
136
|
+
SUPPORTED_HELP_CENTER_LANGUAGES = ne;
|
|
137
|
+
SUPPORTED_WEBSIGNUP_CONSENT_LANGUAGE_OPTIONS = C;
|
|
136
138
|
normalizeLang(e) {
|
|
137
139
|
if (!e || e.length < 2) return;
|
|
138
140
|
let t = e.slice(0, 2).toLowerCase();
|
|
@@ -214,7 +216,7 @@ var g = h.en_US, _ = [
|
|
|
214
216
|
deleteCookie(e) {
|
|
215
217
|
document.cookie = `${e}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/`;
|
|
216
218
|
}
|
|
217
|
-
}(),
|
|
219
|
+
}(), re = {
|
|
218
220
|
"button-back": "Tilbage",
|
|
219
221
|
"button-cookie-policy": "Cookiepolitik",
|
|
220
222
|
"button-cookies-accept": "Acceptér alle",
|
|
@@ -232,7 +234,7 @@ var g = h.en_US, _ = [
|
|
|
232
234
|
"heading-cookies-privacy": "Din privatliv betyder noget for os.",
|
|
233
235
|
"heading-manage-cookie-settings": "Administrér cookieindstillinger:",
|
|
234
236
|
"text-cookies-usage": "Vi bruger cookies til at analysere trafik og tilpasse indhold og annoncer, men du har selv kontrollen og kan ændre dine indstillinger nedenfor eller når som helst i vores {{ cookiePolicyLink }}."
|
|
235
|
-
},
|
|
237
|
+
}, ie = {
|
|
236
238
|
"button-back": "Zurück",
|
|
237
239
|
"button-cookie-policy": "Cookie-Richtlinie",
|
|
238
240
|
"button-cookies-accept": "Akzeptieren",
|
|
@@ -250,7 +252,7 @@ var g = h.en_US, _ = [
|
|
|
250
252
|
"heading-cookies-privacy": "Deine Privatsphäre ist uns wichtig.",
|
|
251
253
|
"heading-manage-cookie-settings": "Cookie-Einstellungen verwalten:",
|
|
252
254
|
"text-cookies-usage": "Wir verwenden Cookies, um den Datenverkehr zu analysieren sowie Inhalte und Anzeigen zu personalisieren. Du hast die Kontrolle und kannst die Einstellungen unten oder jederzeit in unserer {{ cookiePolicyLink }} verwalten."
|
|
253
|
-
},
|
|
255
|
+
}, ae = {
|
|
254
256
|
"button-back": "Back",
|
|
255
257
|
"button-cookie-policy": "Cookie Policy",
|
|
256
258
|
"button-cookies-accept": "Accept all",
|
|
@@ -268,7 +270,7 @@ var g = h.en_US, _ = [
|
|
|
268
270
|
"heading-cookies-privacy": "Your privacy matters to us.",
|
|
269
271
|
"heading-manage-cookie-settings": "Manage cookie settings:",
|
|
270
272
|
"text-cookies-usage": "While we use cookies to analyze traffic and personalize content and ads, you are in control and can manage settings below or anytime in our {{ cookiePolicyLink }}."
|
|
271
|
-
},
|
|
273
|
+
}, E = {
|
|
272
274
|
"button-back": "Back",
|
|
273
275
|
"button-cookie-policy": "Cookie Policy",
|
|
274
276
|
"button-cookies-accept": "Accept all",
|
|
@@ -286,7 +288,7 @@ var g = h.en_US, _ = [
|
|
|
286
288
|
"heading-cookies-privacy": "Your privacy matters to us.",
|
|
287
289
|
"heading-manage-cookie-settings": "Manage cookie settings:",
|
|
288
290
|
"text-cookies-usage": "While we use cookies to analyze traffic and personalize content and ads, you are in control and can manage settings below or anytime in our {{ cookiePolicyLink }}."
|
|
289
|
-
},
|
|
291
|
+
}, D = {
|
|
290
292
|
"button-back": "Atrás",
|
|
291
293
|
"button-cookie-policy": "Política de cookies",
|
|
292
294
|
"button-cookies-accept": "Aceptar todo",
|
|
@@ -304,7 +306,7 @@ var g = h.en_US, _ = [
|
|
|
304
306
|
"heading-cookies-privacy": "Tu privacidad nos importa.",
|
|
305
307
|
"heading-manage-cookie-settings": "Administrar configuración de cookies:",
|
|
306
308
|
"text-cookies-usage": "Aunque usamos cookies para analizar el tráfico y personalizar el contenido y los anuncios, tú tienes el control y puedes gestionar la configuración abajo o en cualquier momento en nuestra {{ cookiePolicyLink }}."
|
|
307
|
-
},
|
|
309
|
+
}, oe = {
|
|
308
310
|
"button-back": "Takaisin",
|
|
309
311
|
"button-cookie-policy": "Evästekäytäntö",
|
|
310
312
|
"button-cookies-accept": "Hyväksy kaikki",
|
|
@@ -322,7 +324,7 @@ var g = h.en_US, _ = [
|
|
|
322
324
|
"heading-cookies-privacy": "Yksityisyytesi on meille tärkeää.",
|
|
323
325
|
"heading-manage-cookie-settings": "Evästeasetusten hallinta:",
|
|
324
326
|
"text-cookies-usage": "Käytämme evästeitä liikenteen analysointiin sekä sisällön ja mainosten personointiin. Voit hallita asetuksia alla tai milloin tahansa {{ cookiePolicyLink }}-sivullamme."
|
|
325
|
-
},
|
|
327
|
+
}, O = {
|
|
326
328
|
"button-back": "Retour",
|
|
327
329
|
"button-cookie-policy": "Politique en matière de cookies",
|
|
328
330
|
"button-cookies-accept": "Tout accepter",
|
|
@@ -340,7 +342,7 @@ var g = h.en_US, _ = [
|
|
|
340
342
|
"heading-cookies-privacy": "Votre confidentialité nous tient à cœur.",
|
|
341
343
|
"heading-manage-cookie-settings": "Gérer les paramètres des cookies:",
|
|
342
344
|
"text-cookies-usage": "Nous utilisons des cookies pour analyser le trafic, personnaliser le contenu et les publicités, mais vous gardez le contrôle et pouvez gérer vos préférences ci-dessous ou à tout moment dans notre {{ cookiePolicyLink }}."
|
|
343
|
-
},
|
|
345
|
+
}, k = {
|
|
344
346
|
"button-back": "Indietro",
|
|
345
347
|
"button-cookie-policy": "Cookie Policy",
|
|
346
348
|
"button-cookies-accept": "Accetta tutto",
|
|
@@ -358,7 +360,7 @@ var g = h.en_US, _ = [
|
|
|
358
360
|
"heading-cookies-privacy": "La tua privacy per noi è importante.",
|
|
359
361
|
"heading-manage-cookie-settings": "Gestisci le impostazioni dei cookie:",
|
|
360
362
|
"text-cookies-usage": "Anche se usiamo i cookie per analizzare il traffico e personalizzare contenuti e annunci, il controllo è nelle tue mani e puoi gestire le impostazioni qui sotto o in qualsiasi momento nella nostra {{ cookiePolicyLink }}."
|
|
361
|
-
},
|
|
363
|
+
}, A = {
|
|
362
364
|
"button-back": "Tilbake",
|
|
363
365
|
"button-cookie-policy": "Retningslinjer for informasjonskapsler",
|
|
364
366
|
"button-cookies-accept": "Godta alle",
|
|
@@ -376,7 +378,7 @@ var g = h.en_US, _ = [
|
|
|
376
378
|
"heading-cookies-privacy": "Personvernet ditt er viktig for oss.",
|
|
377
379
|
"heading-manage-cookie-settings": "Administrer informasjonskapselinnstillinger:",
|
|
378
380
|
"text-cookies-usage": "Vi bruker informasjonskapsler for å analysere trafikk og tilpasse innhold og annonser. Du har full kontroll og kan administrere innstillingene nedenfor eller når som helst i våre {{ cookiePolicyLink }}."
|
|
379
|
-
},
|
|
381
|
+
}, j = {
|
|
380
382
|
"button-back": "Voltar",
|
|
381
383
|
"button-cookie-policy": "Política de cookies",
|
|
382
384
|
"button-cookies-accept": "Aceitar todos",
|
|
@@ -412,26 +414,26 @@ var g = h.en_US, _ = [
|
|
|
412
414
|
"heading-cookies-privacy": "Din integritet är viktig för oss.",
|
|
413
415
|
"heading-manage-cookie-settings": "Hantera cookie-inställningar:",
|
|
414
416
|
"text-cookies-usage": "Vi använder cookies för att analysera trafik och anpassa innehåll och annonser, men det är du som bestämmer och du kan hantera inställningarna nedan eller när som helst i vår {{ cookiePolicyLink }}."
|
|
415
|
-
},
|
|
416
|
-
[h.en_US]:
|
|
417
|
-
[h.en_GB]:
|
|
418
|
-
[h.de_DE]:
|
|
419
|
-
[h.fr_FR]:
|
|
420
|
-
[h.es_US]:
|
|
421
|
-
[h.it_IT]:
|
|
422
|
-
[h.pt_BR]:
|
|
417
|
+
}, M = {
|
|
418
|
+
[h.en_US]: E,
|
|
419
|
+
[h.en_GB]: ae,
|
|
420
|
+
[h.de_DE]: ie,
|
|
421
|
+
[h.fr_FR]: O,
|
|
422
|
+
[h.es_US]: D,
|
|
423
|
+
[h.it_IT]: k,
|
|
424
|
+
[h.pt_BR]: j,
|
|
423
425
|
[h.sv_SE]: se,
|
|
424
|
-
[h.fi_FI]:
|
|
425
|
-
[h.da_DK]:
|
|
426
|
-
[h.no_NO]:
|
|
426
|
+
[h.fi_FI]: oe,
|
|
427
|
+
[h.da_DK]: re,
|
|
428
|
+
[h.no_NO]: A
|
|
427
429
|
};
|
|
428
|
-
|
|
429
|
-
var
|
|
430
|
-
copy =
|
|
430
|
+
ee(M);
|
|
431
|
+
var N = new class {
|
|
432
|
+
copy = M[w.LANG_DEFAULT];
|
|
431
433
|
setLanguage(e) {
|
|
432
|
-
let t = w.toCookieMonsterLangOrUndefined(e) ?? w.LANG_DEFAULT, n =
|
|
434
|
+
let t = w.toCookieMonsterLangOrUndefined(e) ?? w.LANG_DEFAULT, n = M[t];
|
|
433
435
|
this.copy = t !== w.LANG_DEFAULT && w.isEnglish(t) ? {
|
|
434
|
-
...
|
|
436
|
+
...M[w.LANG_DEFAULT],
|
|
435
437
|
...n
|
|
436
438
|
} : n;
|
|
437
439
|
}
|
|
@@ -442,14 +444,14 @@ var M = new class {
|
|
|
442
444
|
return r;
|
|
443
445
|
}
|
|
444
446
|
}();
|
|
445
|
-
function
|
|
446
|
-
|
|
447
|
+
function P(e) {
|
|
448
|
+
N.setLanguage(e);
|
|
447
449
|
}
|
|
448
|
-
function
|
|
449
|
-
return
|
|
450
|
+
function F(e, t) {
|
|
451
|
+
return N.tr(e, t);
|
|
450
452
|
}
|
|
451
453
|
// src/cookie-monster/components/setting-dropdown/setting-dropdown.component.ts
|
|
452
|
-
var
|
|
454
|
+
var I = r(".CookieMonster__dropdown{border-bottom:1px solid var(--color-ink-300);grid-template-columns:max-content 1fr;align-items:center;padding:16px 0;display:grid}:host(:last-of-type) .CookieMonster__dropdown{border-bottom:none}.CookieMonster__icon{width:24px;height:24px;transition:transform var(--cm-icon-transition-duration) ease;margin-right:4px}.CookieMonster__icon___expanded{transform:rotate(180deg)}.CookieMonster__dropdownHeading{color:var(--color-ink-1000);font-size:16px;font-weight:var(--cm-heading-weight);letter-spacing:var(--cm-heading-spacing);align-self:center}.CookieMonster__dropdownContent{color:var(--color-ink-600);grid-column:1/span 2;padding-top:16px;font-size:14px;overflow-y:auto}.CookieMonster__dropdownButton{cursor:pointer;background-color:#0000;border:none;display:flex}.CookieMonster__dropdownLabel{color:var(--color-ink-600);justify-self:end;font-size:14px}input[type=checkbox]{appearance:none;border:2px solid var(--cm-accent);cursor:pointer;width:18px;height:18px;transition:background-color var(--cm-checkbox-transition-duration) ease, border-color var(--cm-checkbox-transition-duration) ease;border-radius:2px;justify-self:end;position:relative}input[type=checkbox]:after{content:var(--cm-checkbox-mark);color:#fff;background:var(--cm-checkbox-mark-image) center / contain no-repeat;opacity:0;transition:opacity var(--cm-checkbox-transition-duration) ease;justify-content:center;align-items:center;font-size:14px;display:flex;position:absolute;inset:0}input[type=checkbox]:checked:after{opacity:1}@media (prefers-reduced-motion:reduce){.CookieMonster__icon,input[type=checkbox],input[type=checkbox]:after{transition:none}}input[type=checkbox]:checked:not(:disabled){background-color:var(--cm-accent);border-color:var(--cm-accent)}input[type=checkbox]:checked:disabled{background-color:var(--color-ink-400);border-color:var(--color-ink-400)}.CookieMonster__alwaysOnGroup{justify-content:flex-end;align-items:center;gap:8px;display:flex}::slotted(a){color:var(--color-neue-blue-500)}"), L = class extends HTMLElement {
|
|
453
455
|
root;
|
|
454
456
|
dropdown;
|
|
455
457
|
button;
|
|
@@ -463,7 +465,7 @@ var F = r(".CookieMonster__dropdown{border-bottom:1px solid var(--color-ink-300)
|
|
|
463
465
|
i,
|
|
464
466
|
a,
|
|
465
467
|
o,
|
|
466
|
-
|
|
468
|
+
I
|
|
467
469
|
], this.dropdown = document.createElement("div"), this.dropdown.classList.add("CookieMonster__dropdown");
|
|
468
470
|
let e = document.createElement("button");
|
|
469
471
|
e.setAttribute("uid", `cm-dropdown-btn-${this.uid}`), e.classList.add("CookieMonster__dropdownButton"), e.setAttribute("aria-expanded", "false"), e.setAttribute("aria-controls", "content"), e.type = "button", this.button = e;
|
|
@@ -496,7 +498,7 @@ var F = r(".CookieMonster__dropdown{border-bottom:1px solid var(--color-ink-300)
|
|
|
496
498
|
if (e === "always-on" && n !== null) {
|
|
497
499
|
this.checkbox.checked = !0, this.checkbox.disabled = !0;
|
|
498
500
|
let e = document.createElement("p");
|
|
499
|
-
e.textContent =
|
|
501
|
+
e.textContent = F("dropdown-always-on-warning"), e.classList.add("CookieMonster__dropdownLabel");
|
|
500
502
|
let t = document.createElement("div");
|
|
501
503
|
t.classList.add("CookieMonster__alwaysOnGroup"), this.checkbox.replaceWith(t), t.append(e, this.checkbox);
|
|
502
504
|
}
|
|
@@ -520,7 +522,7 @@ var F = r(".CookieMonster__dropdown{border-bottom:1px solid var(--color-ink-300)
|
|
|
520
522
|
isChecked() {
|
|
521
523
|
return this.checkbox.checked;
|
|
522
524
|
}
|
|
523
|
-
},
|
|
525
|
+
}, R = r(".CookieMonster__button{text-align:center;white-space:nowrap;cursor:pointer;background-color:#0000;border:none;border-radius:28px;justify-content:center;align-items:center;gap:4px;width:100%;padding:8px 16px;font-size:14px;font-style:normal;line-height:100%;display:flex}.CookieMonster__button___primary{border:1px solid var(--cm-accent);background-color:var(--cm-accent);color:var(--color-white-1000)}.CookieMonster__button___secondary{border:1px solid var(--cm-accent);color:var(--cm-accent)}"), z = class extends HTMLElement {
|
|
524
526
|
root;
|
|
525
527
|
button;
|
|
526
528
|
constructor() {
|
|
@@ -528,7 +530,7 @@ var F = r(".CookieMonster__dropdown{border-bottom:1px solid var(--color-ink-300)
|
|
|
528
530
|
i,
|
|
529
531
|
a,
|
|
530
532
|
o,
|
|
531
|
-
|
|
533
|
+
R
|
|
532
534
|
], this.button = document.createElement("button"), this.button.classList.add("CookieMonster__button"), this.button.innerHTML = "<slot></slot>", this.root.append(this.button);
|
|
533
535
|
}
|
|
534
536
|
static get observedAttributes() {
|
|
@@ -539,13 +541,13 @@ var F = r(".CookieMonster__dropdown{border-bottom:1px solid var(--color-ink-300)
|
|
|
539
541
|
}
|
|
540
542
|
};
|
|
541
543
|
l.cookieMonsterOnMount, l.cookieMonsterOnDisplay, l.cookieMonsterOnClose, l.cookieMonsterOnSettingsViewed, l.cookieMonsterOnBackToBanner;
|
|
542
|
-
var
|
|
544
|
+
var B = {
|
|
543
545
|
necessary: !0,
|
|
544
546
|
preferences: !1,
|
|
545
547
|
statistics: !1,
|
|
546
548
|
marketing: !1,
|
|
547
549
|
source: f.gpc
|
|
548
|
-
}
|
|
550
|
+
};
|
|
549
551
|
// src/cookie-monster/utils/getCookieMonsterEvent.ts
|
|
550
552
|
function V(e, t) {
|
|
551
553
|
return new CustomEvent(e, {
|
|
@@ -573,7 +575,7 @@ function U(e) {
|
|
|
573
575
|
return t.textContent = e, t.innerHTML = t.innerHTML.replaceAll(/\bhttps?:\/\/[^\s<]+[^\s<.)\]]/g, (e) => `<a href="${e}" target="_blank" rel="noopener noreferrer">${e}</a>`), t.innerHTML;
|
|
574
576
|
}
|
|
575
577
|
// src/cookie-monster/views/views.css?inline
|
|
576
|
-
var W = ".CookieMonster__overlay{z-index:9999998;background-color:#1a1a1acc;position:fixed;inset:0}.CookieMonster__mainBanner{background-color:var(--color-white-1000);border:1px solid var(--color-ink-300);z-index:9999999;border-radius:16px 16px 0 0;padding:32px 16px 24px;position:fixed;bottom:0;left:0;right:0;overflow:hidden;box-shadow:0 10px 24px #1a1a1a29}@media only screen and (width>=768px){.CookieMonster__mainBanner{border-radius:16px;width:375px;inset:50% auto auto 50%;transform:translate(-50%,-50%)}}.CookieMonster__mainBanner[data-state=settings]{height:auto;max-height:90vh}.CookieMonster__bannerContent{display:grid}.CookieMonster__mainBanner[data-state=settings] .CookieMonster__bannerContent,settings-view{display:none}.CookieMonster__settingsContent{background-color:var(--color-purple-200);border-radius:8px;flex-direction:column;max-height:228px;margin-bottom:24px;padding:0 16px;display:flex;overflow-y:scroll}.CookieMonster__settingsHeader{flex-direction:row;justify-content:space-between;display:flex}.CookieMonster__settingActions{flex-direction:column;gap:8px;display:flex}.CookieMonster__settingActions themed-button{flex:1}.CookieMonster__mainBanner[data-state=settings] settings-view{display:block}.CookieMonster__mainHeading{color:var(--color-ink-1000);
|
|
578
|
+
var W = ".CookieMonster__overlay{z-index:9999998;background-color:#1a1a1acc;position:fixed;inset:0}.CookieMonster__mainBanner{background-color:var(--color-white-1000);border:1px solid var(--color-ink-300);z-index:9999999;border-radius:16px 16px 0 0;padding:32px 16px 24px;position:fixed;bottom:0;left:0;right:0;overflow:hidden;box-shadow:0 10px 24px #1a1a1a29}@media only screen and (width>=768px){.CookieMonster__mainBanner{border-radius:16px;width:375px;inset:50% auto auto 50%;transform:translate(-50%,-50%)}}.CookieMonster__mainBanner[data-state=settings]{height:auto;max-height:90vh}.CookieMonster__bannerContent{display:grid}.CookieMonster__mainBanner[data-state=settings] .CookieMonster__bannerContent,settings-view{display:none}.CookieMonster__settingsContent{background-color:var(--color-purple-200);border-radius:8px;flex-direction:column;max-height:228px;margin-bottom:24px;padding:0 16px;display:flex;overflow-y:scroll}.CookieMonster__settingsHeader{flex-direction:row;justify-content:space-between;display:flex}.CookieMonster__settingActions{flex-direction:column;gap:8px;display:flex}.CookieMonster__settingActions themed-button{flex:1}.CookieMonster__mainBanner[data-state=settings] settings-view{display:block}.CookieMonster__mainHeading{color:var(--color-ink-1000);font-size:20px;font-weight:var(--cm-heading-weight);letter-spacing:var(--cm-title-spacing);margin-bottom:12px}.CookieMonster__backIcon{background:var(--cm-back-icon) center / contain no-repeat;width:16px;height:16px}.CookieMonster__heading{color:var(--color-ink-1000);margin:0 0 24px;font-size:20px;font-weight:800}.CookieMonster__text{color:var(--color-ink-600);font-size:14px}.CookieMonster__bannerButtons{flex-direction:column;align-items:center;gap:8px;margin:16px 0 0;display:flex}.CookieMonster__bannerButtons themed-button{flex:1;width:100%}.CookieMonster__buttonLink{cursor:pointer;color:var(--color-neue-blue-500);background-color:#0000;border:none;font-size:14px;text-decoration:underline}", G = r(W), ce = class extends HTMLElement {
|
|
577
579
|
root;
|
|
578
580
|
container;
|
|
579
581
|
necessaryDropdown;
|
|
@@ -585,16 +587,16 @@ var W = ".CookieMonster__overlay{z-index:9999998;background-color:#1a1a1acc;posi
|
|
|
585
587
|
constructor() {
|
|
586
588
|
super(), this.handleBack = this.handleBack.bind(this), this.handleSaveSettings = this.handleSaveSettings.bind(this), this.root = this.attachShadow({ mode: "open" }), this.root.adoptedStyleSheets = [i, G], this.container = document.createElement("div"), this.container.classList.add("CookieMonster__settings"), this.container.innerHTML = `
|
|
587
589
|
<div class="CookieMonster__settingsHeader">
|
|
588
|
-
<p class="CookieMonster__heading">${
|
|
590
|
+
<p class="CookieMonster__heading">${F("heading-manage-cookie-settings")}</p>
|
|
589
591
|
</div>
|
|
590
592
|
<div class="CookieMonster__settingsContent"></div>
|
|
591
593
|
|
|
592
594
|
<div class="CookieMonster__settingActions">
|
|
593
595
|
<themed-button uid="settings-save" data-action="save" theme="primary">
|
|
594
|
-
${
|
|
596
|
+
${F("button-cookies-settings-save")}
|
|
595
597
|
</themed-button>
|
|
596
598
|
<themed-button uid="settings-back" data-action="back" theme="secondary">
|
|
597
|
-
<
|
|
599
|
+
<span class="CookieMonster__backIcon" aria-hidden="true"></span>${F("button-back")}
|
|
598
600
|
</themed-button>
|
|
599
601
|
</div>
|
|
600
602
|
`, this.root.append(this.container);
|
|
@@ -635,7 +637,7 @@ var W = ".CookieMonster__overlay{z-index:9999998;background-color:#1a1a1acc;posi
|
|
|
635
637
|
}
|
|
636
638
|
createSettingsDropdown(e, t, n, r) {
|
|
637
639
|
let i = document.createElement("setting-dropdown");
|
|
638
|
-
return i.setAttribute("uid", e), i.setAttribute("title",
|
|
640
|
+
return i.setAttribute("uid", e), i.setAttribute("title", F(t)), i.innerHTML = U(F(n)), r && i.setAttribute("always-on", ""), i;
|
|
639
641
|
}
|
|
640
642
|
};
|
|
641
643
|
// src/cookie-monster/utils/createButton.ts
|
|
@@ -660,12 +662,12 @@ var le = r(W), ue = class extends HTMLElement {
|
|
|
660
662
|
o,
|
|
661
663
|
le
|
|
662
664
|
];
|
|
663
|
-
let e = K("accept-all", "acceptAll", "primary",
|
|
665
|
+
let e = K("accept-all", "acceptAll", "primary", F("button-cookies-accept")), t = K("open-settings", "settings", "secondary", F("button-manage-cookies")), n = document.createElement("div");
|
|
664
666
|
n.className = "CookieMonster__bannerButtons", n.append(e, t);
|
|
665
667
|
let r = document.createElement("h1");
|
|
666
|
-
r.className = "CookieMonster__mainHeading", r.textContent =
|
|
668
|
+
r.className = "CookieMonster__mainHeading", r.textContent = F("heading-cookies-privacy"), this.heading = r;
|
|
667
669
|
let s = document.createElement("p");
|
|
668
|
-
s.className = "CookieMonster__text", s.innerHTML =
|
|
670
|
+
s.className = "CookieMonster__text", s.innerHTML = F("text-cookies-usage", { cookiePolicyLink: `<a uid="cookie-policy" href="https://www.naturalcycles.com/other/legal/cookies" target="_blank" rel="noopener noreferrer" class="CookieMonster__buttonLink">${F("button-cookie-policy")}</a>` }), this.text = s;
|
|
669
671
|
let c = document.createElement("settings-view");
|
|
670
672
|
this.settings = c;
|
|
671
673
|
let l = document.createElement("div");
|
|
@@ -720,37 +722,38 @@ var le = r(W), ue = class extends HTMLElement {
|
|
|
720
722
|
updateView() {
|
|
721
723
|
this.mainBanner.dataset.state = this.state;
|
|
722
724
|
}
|
|
723
|
-
}, de = r(W), q = class e extends HTMLElement {
|
|
725
|
+
}, de = r(":host{--cm-accent:var(--color-purple-500);--cm-heading-weight:800;--cm-heading-spacing:normal;--cm-title-spacing:normal;--cm-checkbox-mark:\"✓\";--cm-checkbox-mark-image:none;--cm-back-icon:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.38381%208.25519C1.41634%208.33382%201.46457%208.40749%201.52849%208.4714L6.19515%2013.1381C6.4555%2013.3984%206.87761%2013.3984%207.13796%2013.1381C7.39831%2012.8777%207.39831%2012.4556%207.13796%2012.1953L3.60937%208.66666L13.9999%208.66667C14.3681%208.66667%2014.6666%208.36819%2014.6666%208C14.6666%207.63181%2014.3681%207.33333%2013.9999%207.33333L3.60937%207.33333L7.13796%203.80473C7.39831%203.54439%207.39831%203.12228%207.13796%202.86193C6.87761%202.60158%206.4555%202.60158%206.19515%202.86193L1.52849%207.52859C1.39988%207.6572%201.3348%207.82529%201.33325%207.99384'%20fill='%2372035D'/%3e%3cpath%20d='M1.38381%208.25519C1.35195%208.17837%201.33405%208.0943%201.33325%208.00615L1.38381%208.25519Z'%20fill='%2372035D'/%3e%3c/svg%3e\");--cm-icon-transition-duration:0s;--cm-checkbox-transition-duration:0s}:host([variant=r1b2]){--cm-accent:var(--color-purple-1000);--cm-heading-weight:500;--cm-heading-spacing:-.48px;--cm-title-spacing:-.54px;--cm-checkbox-mark:\"\";--cm-checkbox-mark-image:url(\"data:image/svg+xml,%3csvg%20width='21'%20height='20'%20viewBox='0%200%2021%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.16683%2010.8334L8.00016%2015.8334L19.0098%204.16669'%20stroke='%23FFF'%20stroke-width='3'%20/%3e%3c/svg%3e\");--cm-back-icon:url(\"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.38381%208.25519C1.41634%208.33382%201.46457%208.40749%201.52849%208.4714L6.19515%2013.1381C6.4555%2013.3984%206.87761%2013.3984%207.13796%2013.1381C7.39831%2012.8777%207.39831%2012.4556%207.13796%2012.1953L3.60937%208.66666L13.9999%208.66667C14.3681%208.66667%2014.6666%208.36819%2014.6666%208C14.6666%207.63181%2014.3681%207.33333%2013.9999%207.33333L3.60937%207.33333L7.13796%203.80473C7.39831%203.54439%207.39831%203.12228%207.13796%202.86193C6.87761%202.60158%206.4555%202.60158%206.19515%202.86193L1.52849%207.52859C1.39988%207.6572%201.3348%207.82529%201.33325%207.99384'%20fill='%23310629'/%3e%3cpath%20d='M1.38381%208.25519C1.35195%208.17837%201.33405%208.0943%201.33325%208.00615L1.38381%208.25519Z'%20fill='%23310629'/%3e%3c/svg%3e\");--cm-icon-transition-duration:.15s;--cm-checkbox-transition-duration:.2s}"), fe = r(W), q = class e extends HTMLElement {
|
|
724
726
|
root;
|
|
725
727
|
container;
|
|
726
728
|
mainView;
|
|
727
729
|
isScrollLocked = !1;
|
|
728
730
|
scrollY = 0;
|
|
729
|
-
static open(t) {
|
|
731
|
+
static open(t, n = p.Default) {
|
|
730
732
|
if (m()) return;
|
|
731
733
|
if (document.readyState === "loading") {
|
|
732
|
-
document.addEventListener("DOMContentLoaded", () => e.open(t), { once: !0 });
|
|
734
|
+
document.addEventListener("DOMContentLoaded", () => e.open(t, n), { once: !0 });
|
|
733
735
|
return;
|
|
734
736
|
}
|
|
735
|
-
let
|
|
736
|
-
t?.view === c.settings ?
|
|
737
|
+
let r = e.getOrCreate(t?.language, n);
|
|
738
|
+
t?.view === c.settings ? r.showSettings() : t?.view === c.banner && r.showBanner(), r.setAttribute("display", "true");
|
|
737
739
|
}
|
|
738
740
|
static close() {
|
|
739
741
|
m() || document.querySelector("cookie-monster")?.setAttribute("display", "false");
|
|
740
742
|
}
|
|
741
|
-
static getOrCreate(e) {
|
|
742
|
-
let
|
|
743
|
-
return
|
|
743
|
+
static getOrCreate(e, t) {
|
|
744
|
+
let n = document.querySelector("cookie-monster");
|
|
745
|
+
return n ||= document.createElement("cookie-monster"), n.setAttribute("variant", t), e && n.setAttribute("language", e), n.isConnected || document.body.append(n), n;
|
|
744
746
|
}
|
|
745
747
|
constructor() {
|
|
746
|
-
super(),
|
|
748
|
+
super(), P(this.getAttribute("language") || w.LANG_DEFAULT), this.root = this.attachShadow({ mode: "open" }), this.root.adoptedStyleSheets = [
|
|
747
749
|
i,
|
|
750
|
+
de,
|
|
748
751
|
a,
|
|
749
|
-
|
|
752
|
+
fe
|
|
750
753
|
], this.container = document.createElement("div"), this.container.id = "CookieMonster", this.container.setAttribute("uid", "cookiemonster"), this.root.append(this.container), this.mainView = document.createElement("main-view"), this.container.append(this.mainView);
|
|
751
754
|
}
|
|
752
755
|
connectedCallback() {
|
|
753
|
-
|
|
756
|
+
P(this.getAttribute("language") || w.LANG_DEFAULT), this.replaceMainView(), this.dispatchEvent(V(l.cookieMonsterOnMount)), this.attributeChangedCallback("display", null, this.getAttribute("display")), this.addEventListener(l.cookieMonsterOnClose, this.handleFinalDecision);
|
|
754
757
|
}
|
|
755
758
|
static get observedAttributes() {
|
|
756
759
|
return ["display", "language"];
|
|
@@ -762,7 +765,7 @@ var le = r(W), ue = class extends HTMLElement {
|
|
|
762
765
|
}
|
|
763
766
|
if (e === "language") {
|
|
764
767
|
if (t === n) return;
|
|
765
|
-
|
|
768
|
+
P(n || w.LANG_DEFAULT), this.replaceMainView();
|
|
766
769
|
}
|
|
767
770
|
}
|
|
768
771
|
disconnectedCallback() {
|
|
@@ -790,7 +793,7 @@ var le = r(W), ue = class extends HTMLElement {
|
|
|
790
793
|
let e = document.createElement("main-view");
|
|
791
794
|
this.mainView.replaceWith(e), this.mainView = e;
|
|
792
795
|
}
|
|
793
|
-
}, J = "CookieConsent",
|
|
796
|
+
}, J = "CookieConsent", pe = 365, Y = "CookieMonsterConsentLog", X = new class {
|
|
794
797
|
readConsentCookie() {
|
|
795
798
|
let e = T.getCookie(J);
|
|
796
799
|
if (e) try {
|
|
@@ -800,7 +803,7 @@ var le = r(W), ue = class extends HTMLElement {
|
|
|
800
803
|
}
|
|
801
804
|
}
|
|
802
805
|
writeConsentCookie(e, t) {
|
|
803
|
-
t && T.deleteCookie(J), T.setCookie(J, JSON.stringify(e),
|
|
806
|
+
t && T.deleteCookie(J), T.setCookie(J, JSON.stringify(e), pe, t);
|
|
804
807
|
}
|
|
805
808
|
getConsentLogEntries() {
|
|
806
809
|
try {
|
|
@@ -824,7 +827,7 @@ var le = r(W), ue = class extends HTMLElement {
|
|
|
824
827
|
this.versionProvider = e;
|
|
825
828
|
}
|
|
826
829
|
initConsent(e) {
|
|
827
|
-
m() || this.initialized || (this.initialized = !0, this.domain = e?.domain, this.isGpcActive() && this.persistConsent({ ...
|
|
830
|
+
m() || this.initialized || (this.initialized = !0, this.domain = e?.domain, this.isGpcActive() && this.persistConsent({ ...B }, e?.domain, void 0), globalThis.addEventListener(l.cookieMonsterOnClose, this.handleClose), X.readConsentCookie() || q.open({ language: e?.language }, e?.variant));
|
|
828
831
|
}
|
|
829
832
|
teardownConsent() {
|
|
830
833
|
m() || (globalThis.removeEventListener(l.cookieMonsterOnClose, this.handleClose), this.initialized = !1, this.domain = void 0);
|
|
@@ -857,18 +860,22 @@ var le = r(W), ue = class extends HTMLElement {
|
|
|
857
860
|
getBannerText() {
|
|
858
861
|
return document.querySelector("cookie-monster")?.getBannerText();
|
|
859
862
|
}
|
|
860
|
-
}(),
|
|
863
|
+
}(), me = class {
|
|
864
|
+
variant = p.Default;
|
|
861
865
|
register(e) {
|
|
862
|
-
$("cookie-monster", q), $("main-view", ue), $("settings-view", ce), $("setting-dropdown",
|
|
866
|
+
this.variant = this.toKnownVariant(e?.variant), $("cookie-monster", q), $("main-view", ue), $("settings-view", ce), $("setting-dropdown", L), $("themed-button", z), Z.setVersionProvider(Q), Z.initConsent({
|
|
867
|
+
...e,
|
|
868
|
+
variant: this.variant
|
|
869
|
+
});
|
|
863
870
|
}
|
|
864
871
|
unregister() {
|
|
865
872
|
Z.teardownConsent();
|
|
866
873
|
}
|
|
867
874
|
open(e) {
|
|
868
|
-
q.open(e);
|
|
875
|
+
q.open(e, this.variant);
|
|
869
876
|
}
|
|
870
877
|
openSettings() {
|
|
871
|
-
q.open({ view: c.settings });
|
|
878
|
+
q.open({ view: c.settings }, this.variant);
|
|
872
879
|
}
|
|
873
880
|
close() {
|
|
874
881
|
q.close();
|
|
@@ -882,6 +889,9 @@ var le = r(W), ue = class extends HTMLElement {
|
|
|
882
889
|
getCookieMonsterVersion() {
|
|
883
890
|
return Q();
|
|
884
891
|
}
|
|
892
|
+
toKnownVariant(e) {
|
|
893
|
+
return e && Object.values(p).includes(e) ? e : p.Default;
|
|
894
|
+
}
|
|
885
895
|
};
|
|
886
896
|
function Q() {
|
|
887
897
|
return "1.0.0";
|
|
@@ -889,7 +899,7 @@ function Q() {
|
|
|
889
899
|
function $(e, t) {
|
|
890
900
|
globalThis.customElements && (globalThis.customElements.get(e) || globalThis.customElements.define(e, t));
|
|
891
901
|
}
|
|
892
|
-
var
|
|
893
|
-
globalThis.cookieMonsterService =
|
|
902
|
+
var he = new me();
|
|
903
|
+
globalThis.cookieMonsterService = he, document.dispatchEvent(new CustomEvent("CookieMonsterReady"));
|
|
894
904
|
|
|
895
905
|
//# sourceMappingURL=cookieMonster.js.map
|