@justeattakeaway/pie-cookie-banner 1.9.1 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/cdn_dist/index.d.ts +33 -0
- package/cdn_dist/index.js +16 -16
- package/custom-elements.json +56 -2
- package/dist/index.d.ts +33 -0
- package/dist/index.js +404 -377
- package/dist/react.d.ts +33 -0
- package/package.json +8 -8
- package/src/defs.ts +21 -0
- package/src/index.ts +37 -5
- package/src/localisation-utils.ts +7 -4
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { LitElement as
|
|
2
|
-
import { state as dt, property as
|
|
3
|
-
import { repeat as
|
|
4
|
-
import { unsafeHTML as
|
|
1
|
+
import { LitElement as Nn, unsafeCSS as Rn, html as F, nothing as Bt } from "lit";
|
|
2
|
+
import { state as dt, property as V, queryAll as Ln } from "lit/decorators.js";
|
|
3
|
+
import { repeat as On } from "lit/directives/repeat.js";
|
|
4
|
+
import { unsafeHTML as $t } from "lit/directives/unsafe-html.js";
|
|
5
5
|
import "@justeattakeaway/pie-button";
|
|
6
6
|
import "@justeattakeaway/pie-divider";
|
|
7
7
|
import "@justeattakeaway/pie-icon-button";
|
|
@@ -9,27 +9,27 @@ import "@justeattakeaway/pie-link";
|
|
|
9
9
|
import "@justeattakeaway/pie-modal";
|
|
10
10
|
import "@justeattakeaway/pie-switch";
|
|
11
11
|
import { safeCustomElement as kn, dispatchCustomEvent as Be } from "@justeattakeaway/pie-webc-core";
|
|
12
|
-
import
|
|
13
|
-
const
|
|
14
|
-
const r = t[
|
|
12
|
+
import Ht from "@justeattakeaway/pie-cookie-banner/locales/en.js";
|
|
13
|
+
const In = (t, n, o) => {
|
|
14
|
+
const r = t[n];
|
|
15
15
|
return r ? typeof r == "function" ? r() : Promise.resolve(r) : new Promise((s, c) => {
|
|
16
16
|
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
|
|
17
17
|
c.bind(
|
|
18
18
|
null,
|
|
19
19
|
new Error(
|
|
20
|
-
"Unknown variable dynamic import: " +
|
|
20
|
+
"Unknown variable dynamic import: " + n + (n.split("/").length !== o ? ". Note that variables only represent file names one level deep." : "")
|
|
21
21
|
)
|
|
22
22
|
)
|
|
23
23
|
);
|
|
24
24
|
});
|
|
25
|
-
}, He = class He extends
|
|
25
|
+
}, He = class He extends Nn {
|
|
26
26
|
willUpdate() {
|
|
27
27
|
this.getAttribute("v") || this.setAttribute("v", He.v);
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
|
-
He.v = "1.
|
|
30
|
+
He.v = "1.10.0";
|
|
31
31
|
let ft = He;
|
|
32
|
-
const
|
|
32
|
+
const Dn = "*,*:after,*:before{box-sizing:inherit}*{margin:0}.c-cookieBanner{--cb-font-family: var(--dt-font-interactive-l-family);--cb-font-size: calc(var(--dt-font-body-l-size) * 1px);--cb-line-height: calc(var(--dt-font-body-l-line-height) * 1px);--cb-font-weight: var(--dt-font-body-l-weight);--cb-padding-inline: var(--dt-spacing-d);--cb-padding-block: var(--dt-spacing-d);--cb-offset: 0;color-scheme:only dark;background-color:var(--dt-color-background-dark);color:var(--dt-color-content-inverse);font-family:var(--cb-font-family);font-size:var(--cb-font-size);line-height:var(--cb-line-height);font-weight:var(--cb-font-weight);padding-block-start:var(--cb-padding-block);padding-block-end:var(--cb-padding-block);max-height:432px;position:fixed;bottom:var(--cb-offset);left:var(--cb-offset);right:var(--cb-offset);border-top-left-radius:var(--dt-radius-rounded-c);border-top-right-radius:var(--dt-radius-rounded-c);z-index:var(--dt-z-index-cookie-banner)}@media(min-width:700px)and (orientation:landscape){.c-cookieBanner{--cb-padding-inline: var(--dt-spacing-f);--cb-offset: var(--dt-spacing-d);max-height:90%;border-bottom-left-radius:var(--dt-radius-rounded-c);border-bottom-right-radius:var(--dt-radius-rounded-c)}}.c-cookieBanner[isCookieBannerHidden]{display:none}@media(prefers-reduced-motion:no-preference){@keyframes animate-enter{0%{transform:translate3d(0,75%,0)}to{transform:translateZ(0)}}.c-cookieBanner{animation:.5s animate-enter ease-out}}.c-cookieBanner-title,.c-cookieBanner-body,.c-cookieBanner-actions{padding-inline-start:var(--cb-padding-inline);padding-inline-end:var(--cb-padding-inline)}.c-cookieBanner-title{--cb-title-font-size: var(--dt-font-heading-s-size--narrow);--cb-title-line-height: var(--dt-font-heading-s-line-height--narrow);font-size:calc(var(--cb-title-font-size) * 1px);font-weight:var(--dt-font-heading-s-weight);line-height:calc(var(--cb-title-line-height) * 1px)}@media(min-width:700px)and (orientation:landscape){.c-cookieBanner-title{--cb-title-font-size: var(--dt-font-heading-s-size--wide);--cb-title-line-height: var(--dt-font-heading-s-line-height--wide)}}.c-cookieBanner-body{--cb-scroll-shadow-color: var(--dt-color-black);margin-block-start:var(--dt-spacing-a);max-height:200px;overflow-y:auto;background:linear-gradient(to bottom,transparent,var(--dt-color-background-dark) 75%) center bottom,linear-gradient(transparent,var(--cb-scroll-shadow-color)) center bottom;background-repeat:no-repeat;background-size:100% 48px,100% 8px;background-attachment:local,scroll}@media(min-width:700px)and (orientation:landscape){.c-cookieBanner-body{max-height:150px}}.c-cookieBanner-actions{--cb-actions-flex-dir: column;margin-block-start:var(--dt-spacing-d);display:flex;gap:var(--dt-spacing-d);flex-direction:var(--cb-actions-flex-dir)}.c-cookieBanner-actions>pie-link{text-align:center;align-self:center}@media(min-width:700px)and (orientation:landscape){.c-cookieBanner-actions{--cb-actions-flex-dir: row-reverse;justify-content:flex-start;align-items:center}.c-cookieBanner-actions>pie-button{width:auto}}.c-cookieBanner-subheading{--cb-subheading-font-size: var(--dt-font-heading-s-size--narrow);--cb-subheading-line-height: var(--dt-font-heading-s-line-height--narrow);font-size:calc(var(--cb-subheading-font-size) * 1px);font-weight:var(--dt-font-heading-s-weight);line-height:calc(var(--cb-subheading-line-height) * 1px)}@media(min-width:700px)and (orientation:landscape){.c-cookieBanner-subheading{--cb-subheading-font-size: var(--dt-font-heading-s-size--wide);--cb-subheading-line-height: var(--dt-font-heading-s-line-height--wide)}}.c-cookieBanner-description{font-size:calc(var(--dt-font-body-s-size) * 1px);line-height:calc(var(--dt-font-body-s-line-height) * 1px)}.c-cookieBanner-preference{display:flex;gap:var(--dt-spacing-d);justify-content:space-between;margin-block-start:var(--dt-spacing-e);margin-block-end:var(--dt-spacing-e)}.c-cookieBanner-preference p{margin-block-start:var(--dt-spacing-b)}.c-cookieBanner-preference:last-child{margin-block-end:0}", p = {
|
|
33
33
|
BULGARIAN: "bg",
|
|
34
34
|
CATALAN: "ca",
|
|
35
35
|
DANISH: "da",
|
|
@@ -61,7 +61,7 @@ const In = "*,*:after,*:before{box-sizing:inherit}*{margin:0}.c-cookieBanner{--c
|
|
|
61
61
|
SLOVAKIA: "sk",
|
|
62
62
|
SPAIN: "es",
|
|
63
63
|
SWITZERLAND: "ch"
|
|
64
|
-
},
|
|
64
|
+
}, Cn = "pie-cookie-banner-accept-all", wn = "pie-cookie-banner-necessary-only", vn = "pie-cookie-banner-manage-prefs", Mn = "pie-cookie-banner-prefs-saved", xn = [
|
|
65
65
|
{
|
|
66
66
|
id: "all",
|
|
67
67
|
hasDivider: !0,
|
|
@@ -85,12 +85,14 @@ const In = "*,*:after,*:before{box-sizing:inherit}*{margin:0}.c-cookieBanner{--c
|
|
|
85
85
|
id: "personalized",
|
|
86
86
|
hasDescription: !0
|
|
87
87
|
}
|
|
88
|
-
],
|
|
88
|
+
], W = {
|
|
89
89
|
hasPrimaryActionsOnly: !1,
|
|
90
90
|
defaultPreferences: {},
|
|
91
91
|
country: g.GREAT_BRITAIN,
|
|
92
92
|
language: p.ENGLISH,
|
|
93
93
|
cookieStatementLink: "",
|
|
94
|
+
personalizedLabel: "",
|
|
95
|
+
personalizedDescription: "",
|
|
94
96
|
cookieTechnologiesLink: "",
|
|
95
97
|
openLinksInSameTab: !1
|
|
96
98
|
}, it = /* @__PURE__ */ new Set([
|
|
@@ -110,7 +112,7 @@ const In = "*,*:after,*:before{box-sizing:inherit}*{margin:0}.c-cookieBanner{--c
|
|
|
110
112
|
`${p.SLOVAK}`,
|
|
111
113
|
`${p.CATALAN}`,
|
|
112
114
|
`${p.SPANISH}`
|
|
113
|
-
]),
|
|
115
|
+
]), Pn = /* @__PURE__ */ new Map([
|
|
114
116
|
[g.AUSTRALIA, `${p.ENGLISH}`],
|
|
115
117
|
[g.AUSTRIA, `${p.GERMAN}`],
|
|
116
118
|
[g.BELGIUM, `${p.DUTCH}`],
|
|
@@ -131,130 +133,130 @@ const In = "*,*:after,*:before{box-sizing:inherit}*{margin:0}.c-cookieBanner{--c
|
|
|
131
133
|
[g.SWITZERLAND, `${p.GERMAN}`]
|
|
132
134
|
]);
|
|
133
135
|
/*! @license DOMPurify 3.4.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.8/LICENSE */
|
|
134
|
-
function
|
|
135
|
-
(
|
|
136
|
-
for (var o = 0, r = Array(
|
|
136
|
+
function Ft(t, n) {
|
|
137
|
+
(n == null || n > t.length) && (n = t.length);
|
|
138
|
+
for (var o = 0, r = Array(n); o < n; o++) r[o] = t[o];
|
|
137
139
|
return r;
|
|
138
140
|
}
|
|
139
|
-
function
|
|
141
|
+
function Bn(t) {
|
|
140
142
|
if (Array.isArray(t)) return t;
|
|
141
143
|
}
|
|
142
|
-
function
|
|
144
|
+
function $n(t, n) {
|
|
143
145
|
var o = t == null ? null : typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
|
|
144
146
|
if (o != null) {
|
|
145
|
-
var r, s, c,
|
|
147
|
+
var r, s, c, d, v = [], b = !0, X = !1;
|
|
146
148
|
try {
|
|
147
|
-
if (c = (o = o.call(t)).next,
|
|
149
|
+
if (c = (o = o.call(t)).next, n !== 0) for (; !(b = (r = c.call(o)).done) && (v.push(r.value), v.length !== n); b = !0) ;
|
|
148
150
|
} catch (ne) {
|
|
149
|
-
|
|
151
|
+
X = !0, s = ne;
|
|
150
152
|
} finally {
|
|
151
153
|
try {
|
|
152
|
-
if (!b && o.return != null && (
|
|
154
|
+
if (!b && o.return != null && (d = o.return(), Object(d) !== d)) return;
|
|
153
155
|
} finally {
|
|
154
|
-
if (
|
|
156
|
+
if (X) throw s;
|
|
155
157
|
}
|
|
156
158
|
}
|
|
157
|
-
return
|
|
159
|
+
return v;
|
|
158
160
|
}
|
|
159
161
|
}
|
|
160
|
-
function
|
|
162
|
+
function Hn() {
|
|
161
163
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
162
164
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
163
165
|
}
|
|
164
|
-
function
|
|
165
|
-
return
|
|
166
|
+
function Fn(t, n) {
|
|
167
|
+
return Bn(t) || $n(t, n) || Un(t, n) || Hn();
|
|
166
168
|
}
|
|
167
|
-
function
|
|
169
|
+
function Un(t, n) {
|
|
168
170
|
if (t) {
|
|
169
|
-
if (typeof t == "string") return
|
|
171
|
+
if (typeof t == "string") return Ft(t, n);
|
|
170
172
|
var o = {}.toString.call(t).slice(8, -1);
|
|
171
|
-
return o === "Object" && t.constructor && (o = t.constructor.name), o === "Map" || o === "Set" ? Array.from(t) : o === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o) ?
|
|
173
|
+
return o === "Object" && t.constructor && (o = t.constructor.name), o === "Map" || o === "Set" ? Array.from(t) : o === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o) ? Ft(t, n) : void 0;
|
|
172
174
|
}
|
|
173
175
|
}
|
|
174
|
-
const
|
|
175
|
-
let
|
|
176
|
-
|
|
177
|
-
return
|
|
176
|
+
const en = Object.entries, Ut = Object.setPrototypeOf, zn = Object.isFrozen, Gn = Object.getPrototypeOf, Wn = Object.getOwnPropertyDescriptor;
|
|
177
|
+
let C = Object.freeze, P = Object.seal, me = Object.create, tn = typeof Reflect < "u" && Reflect, ut = tn.apply, pt = tn.construct;
|
|
178
|
+
C || (C = function(n) {
|
|
179
|
+
return n;
|
|
178
180
|
});
|
|
179
|
-
|
|
180
|
-
return
|
|
181
|
+
P || (P = function(n) {
|
|
182
|
+
return n;
|
|
181
183
|
});
|
|
182
|
-
ut || (ut = function(
|
|
184
|
+
ut || (ut = function(n, o) {
|
|
183
185
|
for (var r = arguments.length, s = new Array(r > 2 ? r - 2 : 0), c = 2; c < r; c++)
|
|
184
186
|
s[c - 2] = arguments[c];
|
|
185
|
-
return
|
|
187
|
+
return n.apply(o, s);
|
|
186
188
|
});
|
|
187
|
-
pt || (pt = function(
|
|
189
|
+
pt || (pt = function(n) {
|
|
188
190
|
for (var o = arguments.length, r = new Array(o > 1 ? o - 1 : 0), s = 1; s < o; s++)
|
|
189
191
|
r[s - 1] = arguments[s];
|
|
190
|
-
return new
|
|
192
|
+
return new n(...r);
|
|
191
193
|
});
|
|
192
|
-
const
|
|
194
|
+
const te = S(Array.prototype.forEach), jn = S(Array.prototype.lastIndexOf), zt = S(Array.prototype.pop), ue = S(Array.prototype.push), Yn = S(Array.prototype.splice), D = Array.isArray, be = S(String.prototype.toLowerCase), ot = S(String.prototype.toString), Gt = S(String.prototype.match), pe = S(String.prototype.replace), Wt = S(String.prototype.indexOf), Kn = S(String.prototype.trim), Vn = S(Number.prototype.toString), Xn = S(Boolean.prototype.toString), jt = typeof BigInt > "u" ? null : S(BigInt.prototype.toString), Yt = typeof Symbol > "u" ? null : S(Symbol.prototype.toString), T = S(Object.prototype.hasOwnProperty), Ee = S(Object.prototype.toString), O = S(RegExp.prototype.test), de = qn(TypeError);
|
|
193
195
|
function S(t) {
|
|
194
|
-
return function(
|
|
195
|
-
|
|
196
|
+
return function(n) {
|
|
197
|
+
n instanceof RegExp && (n.lastIndex = 0);
|
|
196
198
|
for (var o = arguments.length, r = new Array(o > 1 ? o - 1 : 0), s = 1; s < o; s++)
|
|
197
199
|
r[s - 1] = arguments[s];
|
|
198
|
-
return ut(t,
|
|
200
|
+
return ut(t, n, r);
|
|
199
201
|
};
|
|
200
202
|
}
|
|
201
|
-
function
|
|
203
|
+
function qn(t) {
|
|
202
204
|
return function() {
|
|
203
|
-
for (var
|
|
205
|
+
for (var n = arguments.length, o = new Array(n), r = 0; r < n; r++)
|
|
204
206
|
o[r] = arguments[r];
|
|
205
207
|
return pt(t, o);
|
|
206
208
|
};
|
|
207
209
|
}
|
|
208
|
-
function f(t,
|
|
210
|
+
function f(t, n) {
|
|
209
211
|
let o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : be;
|
|
210
|
-
if (
|
|
212
|
+
if (Ut && Ut(t, null), !D(n))
|
|
211
213
|
return t;
|
|
212
|
-
let r =
|
|
214
|
+
let r = n.length;
|
|
213
215
|
for (; r--; ) {
|
|
214
|
-
let s =
|
|
216
|
+
let s = n[r];
|
|
215
217
|
if (typeof s == "string") {
|
|
216
218
|
const c = o(s);
|
|
217
|
-
c !== s && (
|
|
219
|
+
c !== s && (zn(n) || (n[r] = c), s = c);
|
|
218
220
|
}
|
|
219
221
|
t[s] = !0;
|
|
220
222
|
}
|
|
221
223
|
return t;
|
|
222
224
|
}
|
|
223
|
-
function
|
|
224
|
-
for (let
|
|
225
|
-
T(t,
|
|
225
|
+
function Zn(t) {
|
|
226
|
+
for (let n = 0; n < t.length; n++)
|
|
227
|
+
T(t, n) || (t[n] = null);
|
|
226
228
|
return t;
|
|
227
229
|
}
|
|
228
|
-
function
|
|
229
|
-
const
|
|
230
|
-
for (const r of
|
|
231
|
-
var o =
|
|
230
|
+
function k(t) {
|
|
231
|
+
const n = me(null);
|
|
232
|
+
for (const r of en(t)) {
|
|
233
|
+
var o = Fn(r, 2);
|
|
232
234
|
const s = o[0], c = o[1];
|
|
233
|
-
T(t, s) && (
|
|
235
|
+
T(t, s) && (D(c) ? n[s] = Zn(c) : c && typeof c == "object" && c.constructor === Object ? n[s] = k(c) : n[s] = c);
|
|
234
236
|
}
|
|
235
|
-
return
|
|
237
|
+
return n;
|
|
236
238
|
}
|
|
237
|
-
function
|
|
239
|
+
function Jn(t) {
|
|
238
240
|
switch (typeof t) {
|
|
239
241
|
case "string":
|
|
240
242
|
return t;
|
|
241
243
|
case "number":
|
|
242
244
|
return Vn(t);
|
|
243
245
|
case "boolean":
|
|
244
|
-
return
|
|
246
|
+
return Xn(t);
|
|
245
247
|
case "bigint":
|
|
246
248
|
return jt ? jt(t) : "0";
|
|
247
249
|
case "symbol":
|
|
248
|
-
return
|
|
250
|
+
return Yt ? Yt(t) : "Symbol()";
|
|
249
251
|
case "undefined":
|
|
250
252
|
return Ee(t);
|
|
251
253
|
case "function":
|
|
252
254
|
case "object": {
|
|
253
255
|
if (t === null)
|
|
254
256
|
return Ee(t);
|
|
255
|
-
const
|
|
257
|
+
const n = t, o = Y(n, "toString");
|
|
256
258
|
if (typeof o == "function") {
|
|
257
|
-
const r = o(
|
|
259
|
+
const r = o(n);
|
|
258
260
|
return typeof r == "string" ? r : Ee(r);
|
|
259
261
|
}
|
|
260
262
|
return Ee(t);
|
|
@@ -263,36 +265,36 @@ function Zn(t) {
|
|
|
263
265
|
return Ee(t);
|
|
264
266
|
}
|
|
265
267
|
}
|
|
266
|
-
function
|
|
268
|
+
function Y(t, n) {
|
|
267
269
|
for (; t !== null; ) {
|
|
268
|
-
const r =
|
|
270
|
+
const r = Wn(t, n);
|
|
269
271
|
if (r) {
|
|
270
272
|
if (r.get)
|
|
271
273
|
return S(r.get);
|
|
272
274
|
if (typeof r.value == "function")
|
|
273
275
|
return S(r.value);
|
|
274
276
|
}
|
|
275
|
-
t =
|
|
277
|
+
t = Gn(t);
|
|
276
278
|
}
|
|
277
279
|
function o() {
|
|
278
280
|
return null;
|
|
279
281
|
}
|
|
280
282
|
return o;
|
|
281
283
|
}
|
|
282
|
-
function
|
|
284
|
+
function Qn(t) {
|
|
283
285
|
try {
|
|
284
|
-
return
|
|
286
|
+
return O(t, ""), !0;
|
|
285
287
|
} catch {
|
|
286
288
|
return !1;
|
|
287
289
|
}
|
|
288
290
|
}
|
|
289
|
-
const
|
|
291
|
+
const Kt = C(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), rt = C(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), at = C(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), ei = C(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), st = C(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), ti = C(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Vt = C(["#text"]), Xt = C(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "command", "commandfor", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns"]), lt = C(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), qt = C(["accent", "accentunder", "align", "bevelled", "close", "columnalign", "columnlines", "columnspacing", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lquote", "lspace", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), $e = C(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), ni = P(/{{[\w\W]*|^[\w\W]*}}/g), ii = P(/<%[\w\W]*|^[\w\W]*%>/g), oi = P(/\${[\w\W]*/g), ri = P(/^data-[\-\w.\u00B7-\uFFFF]+$/), ai = P(/^aria-[\-\w]+$/), Zt = P(
|
|
290
292
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
291
293
|
// eslint-disable-line no-useless-escape
|
|
292
|
-
),
|
|
294
|
+
), si = P(/^(?:\w+script|data):/i), li = P(
|
|
293
295
|
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
294
296
|
// eslint-disable-line no-control-regex
|
|
295
|
-
),
|
|
297
|
+
), ci = P(/^html$/i), fi = P(/^[a-z][.\w]*(-[.\w]+)+$/i), j = {
|
|
296
298
|
element: 1,
|
|
297
299
|
attribute: 2,
|
|
298
300
|
text: 3,
|
|
@@ -308,28 +310,28 @@ const Yt = D(["a", "abbr", "acronym", "address", "area", "article", "aside", "au
|
|
|
308
310
|
documentFragment: 11,
|
|
309
311
|
notation: 12
|
|
310
312
|
// Deprecated
|
|
311
|
-
},
|
|
313
|
+
}, ui = function() {
|
|
312
314
|
return typeof window > "u" ? null : window;
|
|
313
|
-
},
|
|
314
|
-
if (typeof
|
|
315
|
+
}, pi = function(n, o) {
|
|
316
|
+
if (typeof n != "object" || typeof n.createPolicy != "function")
|
|
315
317
|
return null;
|
|
316
318
|
let r = null;
|
|
317
319
|
const s = "data-tt-policy-suffix";
|
|
318
320
|
o && o.hasAttribute(s) && (r = o.getAttribute(s));
|
|
319
321
|
const c = "dompurify" + (r ? "#" + r : "");
|
|
320
322
|
try {
|
|
321
|
-
return
|
|
322
|
-
createHTML(
|
|
323
|
-
return
|
|
323
|
+
return n.createPolicy(c, {
|
|
324
|
+
createHTML(d) {
|
|
325
|
+
return d;
|
|
324
326
|
},
|
|
325
|
-
createScriptURL(
|
|
326
|
-
return
|
|
327
|
+
createScriptURL(d) {
|
|
328
|
+
return d;
|
|
327
329
|
}
|
|
328
330
|
});
|
|
329
331
|
} catch {
|
|
330
332
|
return console.warn("TrustedTypes policy " + c + " could not be created."), null;
|
|
331
333
|
}
|
|
332
|
-
},
|
|
334
|
+
}, Jt = function() {
|
|
333
335
|
return {
|
|
334
336
|
afterSanitizeAttributes: [],
|
|
335
337
|
afterSanitizeElements: [],
|
|
@@ -342,39 +344,39 @@ const Yt = D(["a", "abbr", "acronym", "address", "area", "article", "aside", "au
|
|
|
342
344
|
uponSanitizeShadowNode: []
|
|
343
345
|
};
|
|
344
346
|
};
|
|
345
|
-
function
|
|
346
|
-
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
347
|
-
const
|
|
348
|
-
if (
|
|
349
|
-
return
|
|
347
|
+
function nn() {
|
|
348
|
+
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ui();
|
|
349
|
+
const n = (l) => nn(l);
|
|
350
|
+
if (n.version = "3.4.8", n.removed = [], !t || !t.document || t.document.nodeType !== j.document || !t.Element)
|
|
351
|
+
return n.isSupported = !1, n;
|
|
350
352
|
let o = t.document;
|
|
351
353
|
const r = o, s = r.currentScript;
|
|
352
354
|
t.DocumentFragment;
|
|
353
|
-
const c = t.HTMLTemplateElement,
|
|
354
|
-
|
|
355
|
-
const ne = t.DOMParser, ie = t.trustedTypes, U =
|
|
355
|
+
const c = t.HTMLTemplateElement, d = t.Node, v = t.Element, b = t.NodeFilter, X = t.NamedNodeMap;
|
|
356
|
+
X === void 0 && (t.NamedNodeMap || t.MozNamedAttrMap), t.HTMLFormElement;
|
|
357
|
+
const ne = t.DOMParser, ie = t.trustedTypes, U = v.prototype, an = Y(U, "cloneNode"), sn = Y(U, "remove"), ln = Y(U, "nextSibling"), ye = Y(U, "childNodes"), Se = Y(U, "parentNode"), Ne = Y(U, "shadowRoot"), cn = Y(U, "attributes"), B = d && d.prototype ? Y(d.prototype, "nodeType") : null, q = d && d.prototype ? Y(d.prototype, "nodeName") : null;
|
|
356
358
|
if (typeof c == "function") {
|
|
357
359
|
const l = o.createElement("template");
|
|
358
360
|
l.content && l.content.ownerDocument && (o = l.content.ownerDocument);
|
|
359
361
|
}
|
|
360
|
-
let
|
|
362
|
+
let M, he = "", Fe = 0;
|
|
361
363
|
const oe = function(e) {
|
|
362
364
|
if (Fe > 0)
|
|
363
365
|
throw de('The configured TRUSTED_TYPES_POLICY.createHTML must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose createHTML wraps DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');
|
|
364
366
|
Fe++;
|
|
365
367
|
try {
|
|
366
|
-
return
|
|
368
|
+
return M.createHTML(e);
|
|
367
369
|
} finally {
|
|
368
370
|
Fe--;
|
|
369
371
|
}
|
|
370
|
-
},
|
|
371
|
-
let
|
|
372
|
-
|
|
373
|
-
const
|
|
374
|
-
let gt =
|
|
375
|
-
const ze = f({}, [...
|
|
372
|
+
}, Re = o, Ue = Re.implementation, mt = Re.createNodeIterator, fn = Re.createDocumentFragment, un = Re.getElementsByTagName, pn = r.importNode;
|
|
373
|
+
let R = Jt();
|
|
374
|
+
n.isSupported = typeof en == "function" && typeof Se == "function" && Ue && Ue.createHTMLDocument !== void 0;
|
|
375
|
+
const Le = ni, Oe = ii, ke = oi, dn = ri, mn = ai, hn = si, ht = li, gn = fi;
|
|
376
|
+
let gt = Zt, A = null;
|
|
377
|
+
const ze = f({}, [...Kt, ...rt, ...at, ...st, ...Vt]);
|
|
376
378
|
let y = null;
|
|
377
|
-
const Ge = f({}, [...
|
|
379
|
+
const Ge = f({}, [...Xt, ...lt, ...qt, ...$e]);
|
|
378
380
|
let _ = Object.seal(me(null, {
|
|
379
381
|
tagNameCheck: {
|
|
380
382
|
writable: !0,
|
|
@@ -395,7 +397,7 @@ function en() {
|
|
|
395
397
|
value: !1
|
|
396
398
|
}
|
|
397
399
|
})), ge = null, Ie = null;
|
|
398
|
-
const
|
|
400
|
+
const Z = Object.seal(me(null, {
|
|
399
401
|
tagCheck: {
|
|
400
402
|
writable: !0,
|
|
401
403
|
configurable: !1,
|
|
@@ -409,109 +411,109 @@ function en() {
|
|
|
409
411
|
value: null
|
|
410
412
|
}
|
|
411
413
|
}));
|
|
412
|
-
let Tt = !0,
|
|
414
|
+
let Tt = !0, We = !0, At = !1, _t = !0, J = !1, Te = !0, Q = !1, je = !1, Ye = !1, re = !1, De = !1, Ce = !1, Et = !0, bt = !1;
|
|
413
415
|
const yt = "user-content-";
|
|
414
|
-
let
|
|
415
|
-
const
|
|
416
|
+
let Ke = !0, Ae = !1, ae = {}, z = null;
|
|
417
|
+
const Ve = f({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
|
|
416
418
|
let St = null;
|
|
417
|
-
const
|
|
419
|
+
const Nt = f({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
418
420
|
let Xe = null;
|
|
419
|
-
const
|
|
421
|
+
const Rt = f({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), we = "http://www.w3.org/1998/Math/MathML", ve = "http://www.w3.org/2000/svg", G = "http://www.w3.org/1999/xhtml";
|
|
420
422
|
let se = G, qe = !1, Ze = null;
|
|
421
|
-
const
|
|
423
|
+
const Tn = f({}, [we, ve, G], ot);
|
|
422
424
|
let Je = f({}, ["mi", "mo", "mn", "ms", "mtext"]), Qe = f({}, ["annotation-xml"]);
|
|
423
|
-
const
|
|
425
|
+
const An = f({}, ["title", "style", "font", "a", "script"]);
|
|
424
426
|
let _e = null;
|
|
425
|
-
const
|
|
427
|
+
const _n = ["application/xhtml+xml", "text/html"], En = "text/html";
|
|
426
428
|
let E = null, le = null;
|
|
427
|
-
const
|
|
429
|
+
const bn = o.createElement("form"), Lt = function(e) {
|
|
428
430
|
return e instanceof RegExp || e instanceof Function;
|
|
429
431
|
}, et = function() {
|
|
430
432
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
431
433
|
if (le && le === e)
|
|
432
434
|
return;
|
|
433
|
-
(!e || typeof e != "object") && (e = {}), e =
|
|
434
|
-
|
|
435
|
-
const
|
|
436
|
-
if (_ = me(null), T(
|
|
435
|
+
(!e || typeof e != "object") && (e = {}), e = k(e), _e = // eslint-disable-next-line unicorn/prefer-includes
|
|
436
|
+
_n.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? En : e.PARSER_MEDIA_TYPE, E = _e === "application/xhtml+xml" ? ot : be, A = T(e, "ALLOWED_TAGS") && D(e.ALLOWED_TAGS) ? f({}, e.ALLOWED_TAGS, E) : ze, y = T(e, "ALLOWED_ATTR") && D(e.ALLOWED_ATTR) ? f({}, e.ALLOWED_ATTR, E) : Ge, Ze = T(e, "ALLOWED_NAMESPACES") && D(e.ALLOWED_NAMESPACES) ? f({}, e.ALLOWED_NAMESPACES, ot) : Tn, Xe = T(e, "ADD_URI_SAFE_ATTR") && D(e.ADD_URI_SAFE_ATTR) ? f(k(Rt), e.ADD_URI_SAFE_ATTR, E) : Rt, St = T(e, "ADD_DATA_URI_TAGS") && D(e.ADD_DATA_URI_TAGS) ? f(k(Nt), e.ADD_DATA_URI_TAGS, E) : Nt, z = T(e, "FORBID_CONTENTS") && D(e.FORBID_CONTENTS) ? f({}, e.FORBID_CONTENTS, E) : Ve, ge = T(e, "FORBID_TAGS") && D(e.FORBID_TAGS) ? f({}, e.FORBID_TAGS, E) : k({}), Ie = T(e, "FORBID_ATTR") && D(e.FORBID_ATTR) ? f({}, e.FORBID_ATTR, E) : k({}), ae = T(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? k(e.USE_PROFILES) : e.USE_PROFILES : !1, Tt = e.ALLOW_ARIA_ATTR !== !1, We = e.ALLOW_DATA_ATTR !== !1, At = e.ALLOW_UNKNOWN_PROTOCOLS || !1, _t = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, J = e.SAFE_FOR_TEMPLATES || !1, Te = e.SAFE_FOR_XML !== !1, Q = e.WHOLE_DOCUMENT || !1, re = e.RETURN_DOM || !1, De = e.RETURN_DOM_FRAGMENT || !1, Ce = e.RETURN_TRUSTED_TYPE || !1, Ye = e.FORCE_BODY || !1, Et = e.SANITIZE_DOM !== !1, bt = e.SANITIZE_NAMED_PROPS || !1, Ke = e.KEEP_CONTENT !== !1, Ae = e.IN_PLACE || !1, gt = Qn(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : Zt, se = typeof e.NAMESPACE == "string" ? e.NAMESPACE : G, Je = T(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? k(e.MATHML_TEXT_INTEGRATION_POINTS) : f({}, ["mi", "mo", "mn", "ms", "mtext"]), Qe = T(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? k(e.HTML_INTEGRATION_POINTS) : f({}, ["annotation-xml"]);
|
|
437
|
+
const i = T(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? k(e.CUSTOM_ELEMENT_HANDLING) : me(null);
|
|
438
|
+
if (_ = me(null), T(i, "tagNameCheck") && Lt(i.tagNameCheck) && (_.tagNameCheck = i.tagNameCheck), T(i, "attributeNameCheck") && Lt(i.attributeNameCheck) && (_.attributeNameCheck = i.attributeNameCheck), T(i, "allowCustomizedBuiltInElements") && typeof i.allowCustomizedBuiltInElements == "boolean" && (_.allowCustomizedBuiltInElements = i.allowCustomizedBuiltInElements), J && (We = !1), De && (re = !0), ae && (A = f({}, Vt), y = me(null), ae.html === !0 && (f(A, Kt), f(y, Xt)), ae.svg === !0 && (f(A, rt), f(y, lt), f(y, $e)), ae.svgFilters === !0 && (f(A, at), f(y, lt), f(y, $e)), ae.mathMl === !0 && (f(A, st), f(y, qt), f(y, $e))), Z.tagCheck = null, Z.attributeCheck = null, T(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? Z.tagCheck = e.ADD_TAGS : D(e.ADD_TAGS) && (A === ze && (A = k(A)), f(A, e.ADD_TAGS, E))), T(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? Z.attributeCheck = e.ADD_ATTR : D(e.ADD_ATTR) && (y === Ge && (y = k(y)), f(y, e.ADD_ATTR, E))), T(e, "ADD_URI_SAFE_ATTR") && D(e.ADD_URI_SAFE_ATTR) && f(Xe, e.ADD_URI_SAFE_ATTR, E), T(e, "FORBID_CONTENTS") && D(e.FORBID_CONTENTS) && (z === Ve && (z = k(z)), f(z, e.FORBID_CONTENTS, E)), T(e, "ADD_FORBID_CONTENTS") && D(e.ADD_FORBID_CONTENTS) && (z === Ve && (z = k(z)), f(z, e.ADD_FORBID_CONTENTS, E)), Ke && (A["#text"] = !0), Q && f(A, ["html", "head", "body"]), A.table && (f(A, ["tbody"]), delete ge.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
437
439
|
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
438
440
|
throw de('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
439
441
|
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
440
442
|
throw de('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
441
|
-
const a =
|
|
442
|
-
|
|
443
|
+
const a = M;
|
|
444
|
+
M = e.TRUSTED_TYPES_POLICY;
|
|
443
445
|
try {
|
|
444
446
|
he = oe("");
|
|
445
|
-
} catch (
|
|
446
|
-
throw
|
|
447
|
+
} catch (m) {
|
|
448
|
+
throw M = a, m;
|
|
447
449
|
}
|
|
448
450
|
} else
|
|
449
|
-
|
|
450
|
-
(
|
|
451
|
-
},
|
|
452
|
-
let
|
|
453
|
-
(!
|
|
451
|
+
M === void 0 && e.TRUSTED_TYPES_POLICY !== null && (M = pi(ie, s)), M && typeof he == "string" && (he = oe(""));
|
|
452
|
+
(R.uponSanitizeElement.length > 0 || R.uponSanitizeAttribute.length > 0) && A === ze && (A = k(A)), R.uponSanitizeAttribute.length > 0 && y === Ge && (y = k(y)), C && C(e), le = e;
|
|
453
|
+
}, Ot = f({}, [...rt, ...at, ...ei]), kt = f({}, [...st, ...ti]), yn = function(e) {
|
|
454
|
+
let i = Se(e);
|
|
455
|
+
(!i || !i.tagName) && (i = {
|
|
454
456
|
namespaceURI: se,
|
|
455
457
|
tagName: "template"
|
|
456
458
|
});
|
|
457
|
-
const a = be(e.tagName),
|
|
458
|
-
return Ze[e.namespaceURI] ? e.namespaceURI === ve ?
|
|
459
|
+
const a = be(e.tagName), m = be(i.tagName);
|
|
460
|
+
return Ze[e.namespaceURI] ? e.namespaceURI === ve ? i.namespaceURI === G ? a === "svg" : i.namespaceURI === we ? a === "svg" && (m === "annotation-xml" || Je[m]) : !!Ot[a] : e.namespaceURI === we ? i.namespaceURI === G ? a === "math" : i.namespaceURI === ve ? a === "math" && Qe[m] : !!kt[a] : e.namespaceURI === G ? i.namespaceURI === ve && !Qe[m] || i.namespaceURI === we && !Je[m] ? !1 : !kt[a] && (An[a] || !Ot[a]) : !!(_e === "application/xhtml+xml" && Ze[e.namespaceURI]) : !1;
|
|
459
461
|
}, $ = function(e) {
|
|
460
|
-
ue(
|
|
462
|
+
ue(n.removed, {
|
|
461
463
|
element: e
|
|
462
464
|
});
|
|
463
465
|
try {
|
|
464
466
|
Se(e).removeChild(e);
|
|
465
467
|
} catch {
|
|
466
|
-
|
|
468
|
+
sn(e);
|
|
467
469
|
}
|
|
468
|
-
},
|
|
470
|
+
}, ee = function(e, i) {
|
|
469
471
|
try {
|
|
470
|
-
ue(
|
|
471
|
-
attribute:
|
|
472
|
-
from:
|
|
472
|
+
ue(n.removed, {
|
|
473
|
+
attribute: i.getAttributeNode(e),
|
|
474
|
+
from: i
|
|
473
475
|
});
|
|
474
476
|
} catch {
|
|
475
|
-
ue(
|
|
477
|
+
ue(n.removed, {
|
|
476
478
|
attribute: null,
|
|
477
|
-
from:
|
|
479
|
+
from: i
|
|
478
480
|
});
|
|
479
481
|
}
|
|
480
|
-
if (
|
|
482
|
+
if (i.removeAttribute(e), e === "is")
|
|
481
483
|
if (re || De)
|
|
482
484
|
try {
|
|
483
|
-
$(
|
|
485
|
+
$(i);
|
|
484
486
|
} catch {
|
|
485
487
|
}
|
|
486
488
|
else
|
|
487
489
|
try {
|
|
488
|
-
|
|
490
|
+
i.setAttribute(e, "");
|
|
489
491
|
} catch {
|
|
490
492
|
}
|
|
491
493
|
}, It = function(e) {
|
|
492
|
-
let
|
|
494
|
+
let i = null, a = null;
|
|
493
495
|
if (Ye)
|
|
494
496
|
e = "<remove></remove>" + e;
|
|
495
497
|
else {
|
|
496
|
-
const h =
|
|
498
|
+
const h = Gt(e, /^[\r\n\t ]+/);
|
|
497
499
|
a = h && h[0];
|
|
498
500
|
}
|
|
499
501
|
_e === "application/xhtml+xml" && se === G && (e = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
|
|
500
|
-
const
|
|
502
|
+
const m = M ? oe(e) : e;
|
|
501
503
|
if (se === G)
|
|
502
504
|
try {
|
|
503
|
-
|
|
505
|
+
i = new ne().parseFromString(m, _e);
|
|
504
506
|
} catch {
|
|
505
507
|
}
|
|
506
|
-
if (!
|
|
507
|
-
|
|
508
|
+
if (!i || !i.documentElement) {
|
|
509
|
+
i = Ue.createDocument(se, "template", null);
|
|
508
510
|
try {
|
|
509
|
-
|
|
511
|
+
i.documentElement.innerHTML = qe ? he : m;
|
|
510
512
|
} catch {
|
|
511
513
|
}
|
|
512
514
|
}
|
|
513
|
-
const u =
|
|
514
|
-
return e && a && u.insertBefore(o.createTextNode(a), u.childNodes[0] || null), se === G ?
|
|
515
|
+
const u = i.body || i.documentElement;
|
|
516
|
+
return e && a && u.insertBefore(o.createTextNode(a), u.childNodes[0] || null), se === G ? un.call(i, Q ? "html" : "body")[0] : Q ? i.documentElement : u;
|
|
515
517
|
}, Dt = function(e) {
|
|
516
518
|
return mt.call(
|
|
517
519
|
e.ownerDocument || e,
|
|
@@ -521,34 +523,34 @@ function en() {
|
|
|
521
523
|
null
|
|
522
524
|
);
|
|
523
525
|
}, tt = function(e) {
|
|
524
|
-
var
|
|
526
|
+
var i, a;
|
|
525
527
|
e.normalize();
|
|
526
|
-
const
|
|
528
|
+
const m = mt.call(
|
|
527
529
|
e.ownerDocument || e,
|
|
528
530
|
e,
|
|
529
531
|
// eslint-disable-next-line no-bitwise
|
|
530
532
|
b.SHOW_TEXT | b.SHOW_COMMENT | b.SHOW_CDATA_SECTION | b.SHOW_PROCESSING_INSTRUCTION,
|
|
531
533
|
null
|
|
532
534
|
);
|
|
533
|
-
let u =
|
|
535
|
+
let u = m.nextNode();
|
|
534
536
|
for (; u; ) {
|
|
535
|
-
let
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
}), u.data =
|
|
537
|
+
let N = u.data;
|
|
538
|
+
te([Le, Oe, ke], (x) => {
|
|
539
|
+
N = pe(N, x, " ");
|
|
540
|
+
}), u.data = N, u = m.nextNode();
|
|
539
541
|
}
|
|
540
|
-
const h = (
|
|
541
|
-
|
|
542
|
-
ce(
|
|
542
|
+
const h = (i = (a = e.querySelectorAll) === null || a === void 0 ? void 0 : a.call(e, "template")) !== null && i !== void 0 ? i : [];
|
|
543
|
+
te(Array.from(h), (N) => {
|
|
544
|
+
ce(N.content) && tt(N.content);
|
|
543
545
|
});
|
|
544
546
|
}, Me = function(e) {
|
|
545
|
-
const
|
|
546
|
-
return typeof
|
|
547
|
+
const i = q ? q(e) : null;
|
|
548
|
+
return typeof i != "string" || E(i) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || // Realm-safe NamedNodeMap detection: equality against the cached
|
|
547
549
|
// prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
|
|
548
550
|
// makes the direct read diverge from the cached read; a clean form
|
|
549
551
|
// (same-realm OR foreign-realm) has both reads pointing at the same
|
|
550
552
|
// canonical NamedNodeMap.
|
|
551
|
-
e.attributes !==
|
|
553
|
+
e.attributes !== cn(e) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || // NodeType clobbering probe. Cached Node.prototype.nodeType getter
|
|
552
554
|
// returns the integer 1 for any Element regardless of realm; direct
|
|
553
555
|
// read on a clobbered form (e.g. <input name="nodeType">) returns
|
|
554
556
|
// the named child element. Cheap addition — nodeType is read from
|
|
@@ -584,60 +586,60 @@ function en() {
|
|
|
584
586
|
return !1;
|
|
585
587
|
}
|
|
586
588
|
};
|
|
587
|
-
function
|
|
588
|
-
|
|
589
|
-
a.call(
|
|
589
|
+
function K(l, e, i) {
|
|
590
|
+
te(l, (a) => {
|
|
591
|
+
a.call(n, e, i, le);
|
|
590
592
|
});
|
|
591
593
|
}
|
|
592
594
|
const Ct = function(e) {
|
|
593
|
-
let
|
|
594
|
-
if (
|
|
595
|
+
let i = null;
|
|
596
|
+
if (K(R.beforeSanitizeElements, e, null), Me(e))
|
|
595
597
|
return $(e), !0;
|
|
596
|
-
const a = E(
|
|
597
|
-
if (
|
|
598
|
+
const a = E(q ? q(e) : e.nodeName);
|
|
599
|
+
if (K(R.uponSanitizeElement, e, {
|
|
598
600
|
tagName: a,
|
|
599
601
|
allowedTags: A
|
|
600
|
-
}), Te && e.hasChildNodes() && !xe(e.firstElementChild) &&
|
|
602
|
+
}), Te && e.hasChildNodes() && !xe(e.firstElementChild) && O(/<[/\w!]/g, e.innerHTML) && O(/<[/\w!]/g, e.textContent) || Te && e.namespaceURI === G && a === "style" && xe(e.firstElementChild) || e.nodeType === j.progressingInstruction || Te && e.nodeType === j.comment && O(/<[/\w]/g, e.data))
|
|
601
603
|
return $(e), !0;
|
|
602
|
-
if (ge[a] || !(
|
|
603
|
-
if (!ge[a] && vt(a) && (_.tagNameCheck instanceof RegExp &&
|
|
604
|
+
if (ge[a] || !(Z.tagCheck instanceof Function && Z.tagCheck(a)) && !A[a]) {
|
|
605
|
+
if (!ge[a] && vt(a) && (_.tagNameCheck instanceof RegExp && O(_.tagNameCheck, a) || _.tagNameCheck instanceof Function && _.tagNameCheck(a)))
|
|
604
606
|
return !1;
|
|
605
|
-
if (
|
|
607
|
+
if (Ke && !z[a]) {
|
|
606
608
|
const u = Se(e), h = ye(e);
|
|
607
609
|
if (h && u) {
|
|
608
|
-
const
|
|
609
|
-
for (let
|
|
610
|
-
const H =
|
|
611
|
-
u.insertBefore(H,
|
|
610
|
+
const N = h.length;
|
|
611
|
+
for (let x = N - 1; x >= 0; --x) {
|
|
612
|
+
const H = an(h[x], !0);
|
|
613
|
+
u.insertBefore(H, ln(e));
|
|
612
614
|
}
|
|
613
615
|
}
|
|
614
616
|
}
|
|
615
617
|
return $(e), !0;
|
|
616
618
|
}
|
|
617
|
-
return (B ? B(e) : e.nodeType) === j.element && !
|
|
618
|
-
|
|
619
|
-
}), e.textContent !==
|
|
619
|
+
return (B ? B(e) : e.nodeType) === j.element && !yn(e) || (a === "noscript" || a === "noembed" || a === "noframes") && O(/<\/no(script|embed|frames)/i, e.innerHTML) ? ($(e), !0) : (J && e.nodeType === j.text && (i = e.textContent, te([Le, Oe, ke], (u) => {
|
|
620
|
+
i = pe(i, u, " ");
|
|
621
|
+
}), e.textContent !== i && (ue(n.removed, {
|
|
620
622
|
element: e.cloneNode()
|
|
621
|
-
}), e.textContent =
|
|
622
|
-
}, wt = function(e,
|
|
623
|
-
if (Ie[
|
|
623
|
+
}), e.textContent = i)), K(R.afterSanitizeElements, e, null), !1);
|
|
624
|
+
}, wt = function(e, i, a) {
|
|
625
|
+
if (Ie[i] || Et && (i === "id" || i === "name") && (a in o || a in bn))
|
|
624
626
|
return !1;
|
|
625
|
-
const
|
|
626
|
-
if (!(
|
|
627
|
-
if (!(Tt &&
|
|
628
|
-
if (!
|
|
627
|
+
const m = y[i] || Z.attributeCheck instanceof Function && Z.attributeCheck(i, e);
|
|
628
|
+
if (!(We && !Ie[i] && O(dn, i))) {
|
|
629
|
+
if (!(Tt && O(mn, i))) {
|
|
630
|
+
if (!m || Ie[i]) {
|
|
629
631
|
if (
|
|
630
632
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
631
633
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
632
634
|
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
633
|
-
!(vt(e) && (_.tagNameCheck instanceof RegExp &&
|
|
635
|
+
!(vt(e) && (_.tagNameCheck instanceof RegExp && O(_.tagNameCheck, e) || _.tagNameCheck instanceof Function && _.tagNameCheck(e)) && (_.attributeNameCheck instanceof RegExp && O(_.attributeNameCheck, i) || _.attributeNameCheck instanceof Function && _.attributeNameCheck(i, e)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
634
636
|
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
635
|
-
|
|
637
|
+
i === "is" && _.allowCustomizedBuiltInElements && (_.tagNameCheck instanceof RegExp && O(_.tagNameCheck, a) || _.tagNameCheck instanceof Function && _.tagNameCheck(a)))
|
|
636
638
|
) return !1;
|
|
637
|
-
} else if (!Xe[
|
|
638
|
-
if (!
|
|
639
|
-
if (!((
|
|
640
|
-
if (!(At && !
|
|
639
|
+
} else if (!Xe[i]) {
|
|
640
|
+
if (!O(gt, pe(a, ht, ""))) {
|
|
641
|
+
if (!((i === "src" || i === "xlink:href" || i === "href") && e !== "script" && Wt(a, "data:") === 0 && St[e])) {
|
|
642
|
+
if (!(At && !O(hn, pe(a, ht, "")))) {
|
|
641
643
|
if (a)
|
|
642
644
|
return !1;
|
|
643
645
|
}
|
|
@@ -647,12 +649,12 @@ function en() {
|
|
|
647
649
|
}
|
|
648
650
|
}
|
|
649
651
|
return !0;
|
|
650
|
-
},
|
|
651
|
-
return !
|
|
652
|
+
}, Sn = f({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), vt = function(e) {
|
|
653
|
+
return !Sn[be(e)] && O(gn, e);
|
|
652
654
|
}, Mt = function(e) {
|
|
653
|
-
|
|
654
|
-
const
|
|
655
|
-
if (!
|
|
655
|
+
K(R.beforeSanitizeAttributes, e, null);
|
|
656
|
+
const i = e.attributes;
|
|
657
|
+
if (!i || Me(e))
|
|
656
658
|
return;
|
|
657
659
|
const a = {
|
|
658
660
|
attrName: "",
|
|
@@ -661,97 +663,97 @@ function en() {
|
|
|
661
663
|
allowedAttributes: y,
|
|
662
664
|
forceKeepAttr: void 0
|
|
663
665
|
};
|
|
664
|
-
let
|
|
665
|
-
for (;
|
|
666
|
-
const u =
|
|
667
|
-
let
|
|
668
|
-
if (a.attrName = H, a.attrValue =
|
|
669
|
-
|
|
666
|
+
let m = i.length;
|
|
667
|
+
for (; m--; ) {
|
|
668
|
+
const u = i[m], h = u.name, N = u.namespaceURI, x = u.value, H = E(h), nt = x;
|
|
669
|
+
let L = h === "value" ? nt : Kn(nt);
|
|
670
|
+
if (a.attrName = H, a.attrValue = L, a.keepAttr = !0, a.forceKeepAttr = void 0, K(R.uponSanitizeAttribute, e, a), L = a.attrValue, bt && (H === "id" || H === "name") && Wt(L, yt) !== 0 && (ee(h, e), L = yt + L), Te && O(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, L)) {
|
|
671
|
+
ee(h, e);
|
|
670
672
|
continue;
|
|
671
673
|
}
|
|
672
|
-
if (H === "attributename" &&
|
|
673
|
-
|
|
674
|
+
if (H === "attributename" && Gt(L, "href")) {
|
|
675
|
+
ee(h, e);
|
|
674
676
|
continue;
|
|
675
677
|
}
|
|
676
678
|
if (a.forceKeepAttr)
|
|
677
679
|
continue;
|
|
678
680
|
if (!a.keepAttr) {
|
|
679
|
-
|
|
681
|
+
ee(h, e);
|
|
680
682
|
continue;
|
|
681
683
|
}
|
|
682
|
-
if (!_t &&
|
|
683
|
-
|
|
684
|
+
if (!_t && O(/\/>/i, L)) {
|
|
685
|
+
ee(h, e);
|
|
684
686
|
continue;
|
|
685
687
|
}
|
|
686
|
-
|
|
687
|
-
|
|
688
|
+
J && te([Le, Oe, ke], (Pt) => {
|
|
689
|
+
L = pe(L, Pt, " ");
|
|
688
690
|
});
|
|
689
691
|
const xt = E(e.nodeName);
|
|
690
|
-
if (!wt(xt, H,
|
|
691
|
-
|
|
692
|
+
if (!wt(xt, H, L)) {
|
|
693
|
+
ee(h, e);
|
|
692
694
|
continue;
|
|
693
695
|
}
|
|
694
|
-
if (
|
|
696
|
+
if (M && typeof ie == "object" && typeof ie.getAttributeType == "function" && !N)
|
|
695
697
|
switch (ie.getAttributeType(xt, H)) {
|
|
696
698
|
case "TrustedHTML": {
|
|
697
|
-
|
|
699
|
+
L = oe(L);
|
|
698
700
|
break;
|
|
699
701
|
}
|
|
700
702
|
case "TrustedScriptURL": {
|
|
701
|
-
|
|
703
|
+
L = M.createScriptURL(L);
|
|
702
704
|
break;
|
|
703
705
|
}
|
|
704
706
|
}
|
|
705
|
-
if (
|
|
707
|
+
if (L !== nt)
|
|
706
708
|
try {
|
|
707
|
-
|
|
709
|
+
N ? e.setAttributeNS(N, h, L) : e.setAttribute(h, L), Me(e) ? $(e) : zt(n.removed);
|
|
708
710
|
} catch {
|
|
709
|
-
|
|
711
|
+
ee(h, e);
|
|
710
712
|
}
|
|
711
713
|
}
|
|
712
|
-
|
|
714
|
+
K(R.afterSanitizeAttributes, e, null);
|
|
713
715
|
}, Pe = function(e) {
|
|
714
|
-
let
|
|
716
|
+
let i = null;
|
|
715
717
|
const a = Dt(e);
|
|
716
|
-
for (
|
|
717
|
-
if (
|
|
718
|
-
const u =
|
|
718
|
+
for (K(R.beforeSanitizeShadowDOM, e, null); i = a.nextNode(); )
|
|
719
|
+
if (K(R.uponSanitizeShadowNode, i, null), Ct(i), Mt(i), ce(i.content) && Pe(i.content), (B ? B(i) : i.nodeType) === j.element) {
|
|
720
|
+
const u = Ne ? Ne(i) : i.shadowRoot;
|
|
719
721
|
ce(u) && (fe(u), Pe(u));
|
|
720
722
|
}
|
|
721
|
-
|
|
723
|
+
K(R.afterSanitizeShadowDOM, e, null);
|
|
722
724
|
}, fe = function(e) {
|
|
723
|
-
const
|
|
724
|
-
if (
|
|
725
|
-
const u =
|
|
725
|
+
const i = B ? B(e) : e.nodeType;
|
|
726
|
+
if (i === j.element) {
|
|
727
|
+
const u = Ne ? Ne(e) : e.shadowRoot;
|
|
726
728
|
ce(u) && (fe(u), Pe(u));
|
|
727
729
|
}
|
|
728
730
|
const a = ye ? ye(e) : e.childNodes;
|
|
729
731
|
if (!a)
|
|
730
732
|
return;
|
|
731
|
-
const
|
|
732
|
-
|
|
733
|
-
ue(
|
|
733
|
+
const m = [];
|
|
734
|
+
te(a, (u) => {
|
|
735
|
+
ue(m, u);
|
|
734
736
|
});
|
|
735
|
-
for (const u of
|
|
737
|
+
for (const u of m)
|
|
736
738
|
fe(u);
|
|
737
|
-
if (
|
|
738
|
-
const u =
|
|
739
|
+
if (i === j.element) {
|
|
740
|
+
const u = q ? q(e) : null;
|
|
739
741
|
if (typeof u == "string" && E(u) === "template") {
|
|
740
742
|
const h = e.content;
|
|
741
743
|
ce(h) && fe(h);
|
|
742
744
|
}
|
|
743
745
|
}
|
|
744
746
|
};
|
|
745
|
-
return
|
|
746
|
-
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {},
|
|
747
|
-
if (qe = !l, qe && (l = "<!-->"), typeof l != "string" && !xe(l) && (l =
|
|
747
|
+
return n.sanitize = function(l) {
|
|
748
|
+
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, a = null, m = null, u = null;
|
|
749
|
+
if (qe = !l, qe && (l = "<!-->"), typeof l != "string" && !xe(l) && (l = Jn(l), typeof l != "string"))
|
|
748
750
|
throw de("dirty is not a string, aborting");
|
|
749
|
-
if (!
|
|
751
|
+
if (!n.isSupported)
|
|
750
752
|
return l;
|
|
751
|
-
if (
|
|
752
|
-
const
|
|
753
|
-
if (typeof
|
|
754
|
-
const H = E(
|
|
753
|
+
if (je || et(e), n.removed = [], typeof l == "string" && (Ae = !1), Ae) {
|
|
754
|
+
const x = q ? q(l) : l.nodeName;
|
|
755
|
+
if (typeof x == "string") {
|
|
756
|
+
const H = E(x);
|
|
755
757
|
if (!A[H] || ge[H])
|
|
756
758
|
throw de("root node is forbidden and cannot be sanitized in-place");
|
|
757
759
|
}
|
|
@@ -759,131 +761,132 @@ function en() {
|
|
|
759
761
|
throw de("root node is clobbered and cannot be sanitized in-place");
|
|
760
762
|
fe(l);
|
|
761
763
|
} else if (xe(l))
|
|
762
|
-
|
|
764
|
+
i = It("<!---->"), a = i.ownerDocument.importNode(l, !0), a.nodeType === j.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? i = a : i.appendChild(a), fe(a);
|
|
763
765
|
else {
|
|
764
|
-
if (!re && !
|
|
766
|
+
if (!re && !J && !Q && // eslint-disable-next-line unicorn/prefer-includes
|
|
765
767
|
l.indexOf("<") === -1)
|
|
766
|
-
return
|
|
767
|
-
if (
|
|
768
|
+
return M && Ce ? oe(l) : l;
|
|
769
|
+
if (i = It(l), !i)
|
|
768
770
|
return re ? null : Ce ? he : "";
|
|
769
771
|
}
|
|
770
|
-
|
|
771
|
-
const h = Dt(Ae ? l :
|
|
772
|
-
for (;
|
|
773
|
-
Ct(
|
|
772
|
+
i && Ye && $(i.firstChild);
|
|
773
|
+
const h = Dt(Ae ? l : i);
|
|
774
|
+
for (; m = h.nextNode(); )
|
|
775
|
+
Ct(m), Mt(m), ce(m.content) && Pe(m.content);
|
|
774
776
|
if (Ae)
|
|
775
|
-
return
|
|
777
|
+
return J && tt(l), l;
|
|
776
778
|
if (re) {
|
|
777
|
-
if (
|
|
778
|
-
for (u =
|
|
779
|
-
u.appendChild(
|
|
779
|
+
if (J && tt(i), De)
|
|
780
|
+
for (u = fn.call(i.ownerDocument); i.firstChild; )
|
|
781
|
+
u.appendChild(i.firstChild);
|
|
780
782
|
else
|
|
781
|
-
u =
|
|
782
|
-
return (y.shadowroot || y.shadowrootmode) && (u =
|
|
783
|
+
u = i;
|
|
784
|
+
return (y.shadowroot || y.shadowrootmode) && (u = pn.call(r, u, !0)), u;
|
|
783
785
|
}
|
|
784
|
-
let
|
|
785
|
-
return
|
|
786
|
-
` +
|
|
787
|
-
|
|
788
|
-
}),
|
|
789
|
-
},
|
|
786
|
+
let N = Q ? i.outerHTML : i.innerHTML;
|
|
787
|
+
return Q && A["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && O(ci, i.ownerDocument.doctype.name) && (N = "<!DOCTYPE " + i.ownerDocument.doctype.name + `>
|
|
788
|
+
` + N), J && te([Le, Oe, ke], (x) => {
|
|
789
|
+
N = pe(N, x, " ");
|
|
790
|
+
}), M && Ce ? oe(N) : N;
|
|
791
|
+
}, n.setConfig = function() {
|
|
790
792
|
let l = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
791
|
-
et(l),
|
|
792
|
-
},
|
|
793
|
-
le = null,
|
|
794
|
-
},
|
|
793
|
+
et(l), je = !0;
|
|
794
|
+
}, n.clearConfig = function() {
|
|
795
|
+
le = null, je = !1;
|
|
796
|
+
}, n.isValidAttribute = function(l, e, i) {
|
|
795
797
|
le || et({});
|
|
796
|
-
const a = E(l),
|
|
797
|
-
return wt(a,
|
|
798
|
-
},
|
|
799
|
-
typeof e == "function" && ue(
|
|
800
|
-
},
|
|
798
|
+
const a = E(l), m = E(e);
|
|
799
|
+
return wt(a, m, i);
|
|
800
|
+
}, n.addHook = function(l, e) {
|
|
801
|
+
typeof e == "function" && ue(R[l], e);
|
|
802
|
+
}, n.removeHook = function(l, e) {
|
|
801
803
|
if (e !== void 0) {
|
|
802
|
-
const
|
|
803
|
-
return
|
|
804
|
+
const i = jn(R[l], e);
|
|
805
|
+
return i === -1 ? void 0 : Yn(R[l], i, 1)[0];
|
|
804
806
|
}
|
|
805
|
-
return
|
|
806
|
-
},
|
|
807
|
-
|
|
808
|
-
},
|
|
809
|
-
|
|
810
|
-
},
|
|
807
|
+
return zt(R[l]);
|
|
808
|
+
}, n.removeHooks = function(l) {
|
|
809
|
+
R[l] = [];
|
|
810
|
+
}, n.removeAllHooks = function() {
|
|
811
|
+
R = Jt();
|
|
812
|
+
}, n;
|
|
811
813
|
}
|
|
812
|
-
var ct =
|
|
813
|
-
function
|
|
814
|
+
var ct = nn();
|
|
815
|
+
function on(t) {
|
|
814
816
|
console.error(`[localisation-utils]: ${t}`);
|
|
815
817
|
}
|
|
816
|
-
function
|
|
817
|
-
const o = (s) => String.prototype.split.call(
|
|
818
|
+
function di(t, n) {
|
|
819
|
+
const o = (s) => String.prototype.split.call(n, s).filter(Boolean).reduce((c, d) => c != null && typeof c == "object" ? c[d] : c, t), r = o(/[,[\]]+?/) || o(/[,[\].]+?/);
|
|
818
820
|
return typeof r != "string" ? "" : r;
|
|
819
821
|
}
|
|
820
|
-
function
|
|
822
|
+
function rn(t, n) {
|
|
821
823
|
if (!t) throw new Error('"locale" parameter cannot be empty');
|
|
822
|
-
if (!
|
|
823
|
-
const o =
|
|
824
|
-
return o || (
|
|
824
|
+
if (!n) throw new Error('"key" parameter cannot be empty');
|
|
825
|
+
const o = di(t, n);
|
|
826
|
+
return o || (on(`Couldn't find a value for the key "${n}", it will be used as fallback.`), n);
|
|
825
827
|
}
|
|
826
|
-
function
|
|
828
|
+
function mi(t) {
|
|
827
829
|
const o = t.map((s) => `(<${s}.*>.*</${s}>)`).join("|");
|
|
828
830
|
return new RegExp(o, "igm");
|
|
829
831
|
}
|
|
830
|
-
function
|
|
831
|
-
const o = Object.keys(
|
|
832
|
+
function hi(t, n) {
|
|
833
|
+
const o = Object.keys(n);
|
|
832
834
|
if (o.length === 0) return [t];
|
|
833
|
-
const r =
|
|
835
|
+
const r = mi(o);
|
|
834
836
|
return t.split(r).filter((s) => !!s).map((s) => {
|
|
835
837
|
if (!s.match(r)) return s;
|
|
836
|
-
const
|
|
837
|
-
if (!
|
|
838
|
-
const [,
|
|
839
|
-
return [
|
|
838
|
+
const d = s.match(/<(.*)>(.*)<\/.*>/);
|
|
839
|
+
if (!d) return s;
|
|
840
|
+
const [, v, b] = d;
|
|
841
|
+
return [v, b];
|
|
840
842
|
}).map((s) => {
|
|
841
843
|
if (!Array.isArray(s)) return s;
|
|
842
|
-
const [
|
|
843
|
-
return b || typeof b == "function" ? b(
|
|
844
|
+
const [d, v] = s, b = n[d];
|
|
845
|
+
return b || typeof b == "function" ? b(v) : (on(`Custom tag "${d}" does not have a matching enhancer function`), v);
|
|
844
846
|
});
|
|
845
847
|
}
|
|
846
|
-
function
|
|
848
|
+
function Qt(t, n = "_blank") {
|
|
847
849
|
if (typeof window > "u")
|
|
848
850
|
return t.replace(/<[^>]*>/g, "");
|
|
849
|
-
const o =
|
|
850
|
-
if (
|
|
851
|
-
if (
|
|
852
|
-
|
|
851
|
+
const o = ["A", "PIE-LINK"], r = n === "_self" ? "_self" : "_blank", s = (c) => {
|
|
852
|
+
if (!o.includes(c.tagName)) return;
|
|
853
|
+
if (c.setAttribute("target", r), r !== "_blank") {
|
|
854
|
+
c.removeAttribute("rel");
|
|
853
855
|
return;
|
|
854
856
|
}
|
|
855
|
-
const
|
|
856
|
-
|
|
857
|
+
const d = new Set((c.getAttribute("rel") ?? "").split(/\s+/).filter(Boolean));
|
|
858
|
+
d.add("noopener"), d.add("noreferrer"), c.setAttribute("rel", Array.from(d).join(" "));
|
|
857
859
|
};
|
|
858
860
|
try {
|
|
859
|
-
return ct.addHook("afterSanitizeAttributes",
|
|
860
|
-
|
|
861
|
+
return ct.addHook("afterSanitizeAttributes", s), ct.sanitize(t, {
|
|
862
|
+
// Convert to lowercase for DOMPurify's tag list
|
|
863
|
+
ALLOWED_TAGS: o.map((c) => c.toLowerCase()),
|
|
861
864
|
ALLOWED_ATTR: ["href", "rel", "target"]
|
|
862
865
|
});
|
|
863
866
|
} finally {
|
|
864
867
|
ct.removeHook("afterSanitizeAttributes");
|
|
865
868
|
}
|
|
866
869
|
}
|
|
867
|
-
function gi(t,
|
|
870
|
+
function gi(t, n, o) {
|
|
868
871
|
if (!t) throw new Error('"locale" parameter cannot be empty');
|
|
869
|
-
if (!
|
|
872
|
+
if (!n) throw new Error('"key" parameter cannot be empty');
|
|
870
873
|
if (!o) throw new Error('"customTagEnhancers" parameter cannot be empty');
|
|
871
|
-
const r =
|
|
872
|
-
return
|
|
874
|
+
const r = rn(t, n);
|
|
875
|
+
return hi(r, o);
|
|
873
876
|
}
|
|
874
|
-
var Ti = Object.defineProperty, Ai = Object.getOwnPropertyDescriptor,
|
|
875
|
-
for (var s = r > 1 ? void 0 : r ? Ai(
|
|
876
|
-
(
|
|
877
|
-
return r && s && Ti(
|
|
877
|
+
var Ti = Object.defineProperty, Ai = Object.getOwnPropertyDescriptor, w = (t, n, o, r) => {
|
|
878
|
+
for (var s = r > 1 ? void 0 : r ? Ai(n, o) : n, c = t.length - 1, d; c >= 0; c--)
|
|
879
|
+
(d = t[c]) && (s = (r ? d(n, o, s) : d(s)) || s);
|
|
880
|
+
return r && s && Ti(n, o, s), s;
|
|
878
881
|
};
|
|
879
|
-
let
|
|
882
|
+
let I = class extends ft {
|
|
880
883
|
constructor() {
|
|
881
|
-
super(...arguments), this._isCookieBannerHidden = !1, this._isModalOpen = !1, this._locale =
|
|
882
|
-
let o = `${t}-${
|
|
884
|
+
super(...arguments), this._isCookieBannerHidden = !1, this._isModalOpen = !1, this._locale = Ht, this.hasPrimaryActionsOnly = W.hasPrimaryActionsOnly, this.defaultPreferences = W.defaultPreferences, this.cookieStatementLink = W.cookieStatementLink, this.personalizedLabel = W.personalizedLabel, this.personalizedDescription = W.personalizedDescription, this.cookieTechnologiesLink = W.cookieTechnologiesLink, this.country = W.country, this.language = W.language, this.openLinksInSameTab = W.openLinksInSameTab, this._getLocaleString = (t, n) => {
|
|
885
|
+
let o = `${t}-${n}`.toLowerCase();
|
|
883
886
|
if (it.has(o) || (o = `${t}`.toLowerCase(), it.has(o)))
|
|
884
887
|
return o;
|
|
885
|
-
const r =
|
|
886
|
-
return r && it.has(r) ? r : `${
|
|
888
|
+
const r = Pn.get(n.toLowerCase());
|
|
889
|
+
return r && it.has(r) ? r : `${W.language}`;
|
|
887
890
|
}, this._customTagEnhancers = {
|
|
888
891
|
linkStatement: (t) => F`<pie-link href="${this.cookieStatementLink}" variant="inverse" target="${this._linkTargetAttribute}" data-test-id="cookie-statement-link">${t}</pie-link>`,
|
|
889
892
|
linkNecessaryOnly: (t) => F`<pie-link data-test-id="body-necessary-only" tag="button" variant="inverse" @click="${this._onNecessaryOnly}">${t}</pie-link>`,
|
|
@@ -892,14 +895,14 @@ let C = class extends ft {
|
|
|
892
895
|
linkCookieStatement: (t) => F`<pie-link href="${this.cookieStatementLink}" size="small" target="${this._linkTargetAttribute}" data-test-id="cookie-statement-link">${t}</pie-link>`,
|
|
893
896
|
linkCookieTechList: (t) => F`<pie-link href="${this.cookieTechnologiesLink}" size="small" target="${this._linkTargetAttribute}" data-test-id="cookie-technology-link">${t}</pie-link>`
|
|
894
897
|
}, this._onNecessaryOnly = () => {
|
|
895
|
-
Be(this,
|
|
898
|
+
Be(this, wn), this._isCookieBannerHidden = !0;
|
|
896
899
|
}, this._onAcceptAll = () => {
|
|
897
|
-
Be(this,
|
|
900
|
+
Be(this, Cn), this._isCookieBannerHidden = !0;
|
|
898
901
|
}, this._openManagePreferencesModal = () => {
|
|
899
|
-
this._isCookieBannerHidden = !0, Be(this,
|
|
902
|
+
this._isCookieBannerHidden = !0, Be(this, vn), this._isModalOpen = !0;
|
|
900
903
|
}, this._handleSwitchStates = (t) => {
|
|
901
|
-
const { id:
|
|
902
|
-
if (
|
|
904
|
+
const { id: n } = t == null ? void 0 : t.currentTarget, o = [...this._preferencesNodes].find(({ id: r }) => r === "all");
|
|
905
|
+
if (n === o.id) {
|
|
903
906
|
const { checked: r } = t.target;
|
|
904
907
|
this._preferencesNodes.forEach((s) => {
|
|
905
908
|
s.checked = s.disabled ? s.checked : r;
|
|
@@ -920,20 +923,38 @@ let C = class extends ft {
|
|
|
920
923
|
(t.has("language") || t.has("country")) && await this._setLocaleBasedOnCountryAndLanguage(this.language, this.country);
|
|
921
924
|
}
|
|
922
925
|
// Dynamically import locale JSON based on country and language
|
|
923
|
-
async _setLocaleBasedOnCountryAndLanguage(t,
|
|
926
|
+
async _setLocaleBasedOnCountryAndLanguage(t, n) {
|
|
924
927
|
try {
|
|
925
|
-
const o = this._getLocaleString(t,
|
|
926
|
-
this._locale = (await
|
|
928
|
+
const o = this._getLocaleString(t, n);
|
|
929
|
+
this._locale = (await In(/* @__PURE__ */ Object.assign({ "../locales/bg.js": () => import("./bg-DGJESQ4e.js"), "../locales/ca.js": () => import("./ca-Bcf7sXQS.js"), "../locales/da.js": () => import("./da-zmkmo2qP.js"), "../locales/de.js": () => import("./de-CCDQDaL_.js"), "../locales/en-ca.js": () => import("./en-ca-BWMoXxW2.js"), "../locales/en-fr.js": () => import("./en-fr-B3W1OBz4.js"), "../locales/en.js": () => import("./en-Cg12pw29.js"), "../locales/es.js": () => import("./es-BGd5IeE8.js"), "../locales/fr-ca.js": () => import("./fr-ca-B2Z4Z4i0.js"), "../locales/fr-fr.js": () => import("./fr-fr-Bj0z2tFA.js"), "../locales/fr.js": () => import("./fr-ZJirJTQ1.js"), "../locales/he.js": () => import("./he-CD4nZodw.js"), "../locales/it.js": () => import("./it-C20n5M6-.js"), "../locales/nl.js": () => import("./nl-potC62A2.js"), "../locales/pl.js": () => import("./pl-BZMXvf-W.js"), "../locales/sk.js": () => import("./sk-B2GkzqzB.js") }), `../locales/${o}.js`, 3)).default;
|
|
927
930
|
} catch {
|
|
928
|
-
this._locale =
|
|
931
|
+
this._locale = Ht;
|
|
929
932
|
}
|
|
930
933
|
}
|
|
931
934
|
_localiseText(t) {
|
|
932
|
-
return
|
|
935
|
+
return rn(this._locale, t);
|
|
933
936
|
}
|
|
934
937
|
_localiseRichText(t) {
|
|
935
938
|
return gi(this._locale, t, this._customTagEnhancers);
|
|
936
939
|
}
|
|
940
|
+
/**
|
|
941
|
+
* Renders a preference label.
|
|
942
|
+
* For the personalised preference, uses the consumer-supplied `personalizedLabel`
|
|
943
|
+
* prop when provided as plain text, and falls back to the built-in locale string otherwise.
|
|
944
|
+
*/
|
|
945
|
+
_renderPreferenceLabel(t) {
|
|
946
|
+
return t === "personalized" && this.personalizedLabel ? this.personalizedLabel : this._localiseText(`preferencesManagement.${t}.title`);
|
|
947
|
+
}
|
|
948
|
+
/**
|
|
949
|
+
* Renders a preference description.
|
|
950
|
+
* For the personalised preference, uses the consumer-supplied `personalizedDescription`
|
|
951
|
+
* prop when provided (allowing consumers to embed their own privacy policy link using
|
|
952
|
+
* plain HTML `<a>` or `<pie-link>` tags), and falls back to the built-in locale string otherwise.
|
|
953
|
+
* All other preferences use the plain locale text with HTML sanitisation.
|
|
954
|
+
*/
|
|
955
|
+
_renderPreferenceDescription(t, n) {
|
|
956
|
+
return t === "personalized" && this.personalizedDescription ? $t(Qt(this.personalizedDescription, this._linkTargetAttribute)) : $t(Qt(n, this._linkTargetAttribute));
|
|
957
|
+
}
|
|
937
958
|
/**
|
|
938
959
|
* Handles closing the modal and re-displaying the cookie banner
|
|
939
960
|
* and making the cookie banner visible
|
|
@@ -952,9 +973,9 @@ let C = class extends ft {
|
|
|
952
973
|
*/
|
|
953
974
|
_handlePreferencesSaved() {
|
|
954
975
|
let t = {};
|
|
955
|
-
[...this._preferencesNodes].filter(({ id:
|
|
956
|
-
t = { ...t, [
|
|
957
|
-
}), Be(this,
|
|
976
|
+
[...this._preferencesNodes].filter(({ id: n }) => n !== "all").forEach(({ id: n, checked: o }) => {
|
|
977
|
+
t = { ...t, [n]: o };
|
|
978
|
+
}), Be(this, Mn, t), this._isModalOpen = !1, this._isCookieBannerHidden = !0;
|
|
958
979
|
}
|
|
959
980
|
/**
|
|
960
981
|
* Renders the content of the preference item.
|
|
@@ -962,26 +983,26 @@ let C = class extends ft {
|
|
|
962
983
|
*/
|
|
963
984
|
renderPreference({
|
|
964
985
|
id: t,
|
|
965
|
-
checked:
|
|
986
|
+
checked: n,
|
|
966
987
|
disabled: o,
|
|
967
988
|
hasDivider: r,
|
|
968
989
|
hasDescription: s
|
|
969
990
|
}) {
|
|
970
991
|
var ne;
|
|
971
|
-
const c = this.
|
|
992
|
+
const c = this._renderPreferenceLabel(t), d = `preferencesManagement.${t}.description`, v = s && this._localiseText(d), X = ["functional", "personalized", "analytical"].every((ie) => {
|
|
972
993
|
var U;
|
|
973
994
|
return ((U = this.defaultPreferences) == null ? void 0 : U[ie]) === !0;
|
|
974
995
|
});
|
|
975
996
|
return F`
|
|
976
997
|
<div class="c-cookieBanner-preference">
|
|
977
998
|
<div>
|
|
978
|
-
<h3 class="c-cookieBanner-subheading">${c}</h3>
|
|
979
|
-
|
|
980
|
-
|
|
999
|
+
<h3 class="c-cookieBanner-subheading" data-test-id="${t}-label">${c}</h3>
|
|
1000
|
+
${v ? F`<p class="c-cookieBanner-description" data-test-id="${t}-description">${this._renderPreferenceDescription(t, v)}</p>` : Bt}
|
|
1001
|
+
</div>
|
|
981
1002
|
<pie-switch
|
|
982
1003
|
id="${t}"
|
|
983
1004
|
.aria="${{ label: c }}"
|
|
984
|
-
?checked="${((ne = this.defaultPreferences) == null ? void 0 : ne[t]) ||
|
|
1005
|
+
?checked="${((ne = this.defaultPreferences) == null ? void 0 : ne[t]) || X || n}"
|
|
985
1006
|
?disabled="${o}"
|
|
986
1007
|
@change="${this._handleSwitchStates}">
|
|
987
1008
|
</pie-switch>
|
|
@@ -997,8 +1018,8 @@ let C = class extends ft {
|
|
|
997
1018
|
<p class="c-cookieBanner-description" data-test-id="modal-description">
|
|
998
1019
|
${this._localiseRichText("preferencesManagement.description")}
|
|
999
1020
|
</p>
|
|
1000
|
-
${
|
|
1001
|
-
|
|
1021
|
+
${On(
|
|
1022
|
+
xn,
|
|
1002
1023
|
({ id: t }) => t,
|
|
1003
1024
|
(t) => this.renderPreference(t)
|
|
1004
1025
|
)}`;
|
|
@@ -1055,53 +1076,59 @@ let C = class extends ft {
|
|
|
1055
1076
|
</aside>`;
|
|
1056
1077
|
}
|
|
1057
1078
|
};
|
|
1058
|
-
|
|
1059
|
-
|
|
1079
|
+
I.styles = Rn(Dn);
|
|
1080
|
+
w([
|
|
1060
1081
|
dt()
|
|
1061
|
-
],
|
|
1062
|
-
|
|
1082
|
+
], I.prototype, "_isCookieBannerHidden", 2);
|
|
1083
|
+
w([
|
|
1063
1084
|
dt()
|
|
1064
|
-
],
|
|
1065
|
-
|
|
1085
|
+
], I.prototype, "_isModalOpen", 2);
|
|
1086
|
+
w([
|
|
1066
1087
|
dt()
|
|
1067
|
-
],
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
],
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
],
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
],
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
],
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
],
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
],
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
],
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
],
|
|
1092
|
-
|
|
1088
|
+
], I.prototype, "_locale", 2);
|
|
1089
|
+
w([
|
|
1090
|
+
V({ type: Boolean })
|
|
1091
|
+
], I.prototype, "hasPrimaryActionsOnly", 2);
|
|
1092
|
+
w([
|
|
1093
|
+
V({ type: Object })
|
|
1094
|
+
], I.prototype, "defaultPreferences", 2);
|
|
1095
|
+
w([
|
|
1096
|
+
V({ type: String })
|
|
1097
|
+
], I.prototype, "cookieStatementLink", 2);
|
|
1098
|
+
w([
|
|
1099
|
+
V({ type: String })
|
|
1100
|
+
], I.prototype, "personalizedLabel", 2);
|
|
1101
|
+
w([
|
|
1102
|
+
V({ type: String })
|
|
1103
|
+
], I.prototype, "personalizedDescription", 2);
|
|
1104
|
+
w([
|
|
1105
|
+
V({ type: String })
|
|
1106
|
+
], I.prototype, "cookieTechnologiesLink", 2);
|
|
1107
|
+
w([
|
|
1108
|
+
V({ type: String })
|
|
1109
|
+
], I.prototype, "country", 2);
|
|
1110
|
+
w([
|
|
1111
|
+
V({ type: String })
|
|
1112
|
+
], I.prototype, "language", 2);
|
|
1113
|
+
w([
|
|
1114
|
+
V({ type: Boolean })
|
|
1115
|
+
], I.prototype, "openLinksInSameTab", 2);
|
|
1116
|
+
w([
|
|
1117
|
+
Ln("pie-switch")
|
|
1118
|
+
], I.prototype, "_preferencesNodes", 2);
|
|
1119
|
+
I = w([
|
|
1093
1120
|
kn("pie-cookie-banner")
|
|
1094
|
-
],
|
|
1121
|
+
], I);
|
|
1095
1122
|
export {
|
|
1096
1123
|
g as Country,
|
|
1097
1124
|
p as Language,
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1125
|
+
Cn as ON_COOKIE_BANNER_ACCEPT_ALL,
|
|
1126
|
+
vn as ON_COOKIE_BANNER_MANAGE_PREFS,
|
|
1127
|
+
wn as ON_COOKIE_BANNER_NECESSARY_ONLY,
|
|
1128
|
+
Mn as ON_COOKIE_BANNER_PREFS_SAVED,
|
|
1129
|
+
I as PieCookieBanner,
|
|
1103
1130
|
it as availableLocales,
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1131
|
+
Pn as defaultLocaleForCountry,
|
|
1132
|
+
W as defaultProps,
|
|
1133
|
+
xn as preferences
|
|
1107
1134
|
};
|