@nysds/nys-icon 1.21.0 → 1.22.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/dist/nys-icon.d.ts +18 -0
- package/dist/nys-icon.js +567 -537
- package/dist/nys-icon.js.map +1 -1
- package/dist/{nys-icon.library-Bi_7DKlD.js → nys-icon.library-DYsQ8Tiv.js} +11 -4
- package/dist/nys-icon.library-DYsQ8Tiv.js.map +1 -0
- package/package.json +4 -4
- package/dist/nys-icon.library-Bi_7DKlD.js.map +0 -1
package/dist/nys-icon.js
CHANGED
|
@@ -1,211 +1,222 @@
|
|
|
1
|
-
import { LitElement as
|
|
2
|
-
import { property as
|
|
1
|
+
import { LitElement as to, unsafeCSS as eo, html as no } from "lit";
|
|
2
|
+
import { property as J, state as oo } from "lit/decorators.js";
|
|
3
3
|
/*!
|
|
4
4
|
* █▄ █ █ █ █▀▀▀█ █▀▀▄ █▀▀▀█
|
|
5
5
|
* █ █ █ █▄▄▄█ ▀▀▀▄▄ █ █ ▀▀▀▄▄
|
|
6
6
|
* █ ▀█ █ █▄▄▄█ █▄▄▀ █▄▄▄█
|
|
7
7
|
*
|
|
8
|
-
* Icon Component v1.
|
|
8
|
+
* Icon Component v1.22.0
|
|
9
9
|
* Part of the New York State Design System
|
|
10
10
|
* Repository: https://github.com/its-hcd/nysds
|
|
11
11
|
* License: MIT
|
|
12
12
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
/*!
|
|
14
|
+
* New York State Design System v1.22.0
|
|
15
|
+
* Description: A design system for New York State's digital products.
|
|
16
|
+
* Repository: https://github.com/its-hcd/nysds
|
|
17
|
+
* License: MIT
|
|
18
|
+
*/
|
|
19
|
+
let io = 0;
|
|
20
|
+
function ro(o) {
|
|
21
|
+
return `${o}-${Date.now()}-${io++}`;
|
|
16
22
|
}
|
|
17
|
-
|
|
18
|
-
class n extends
|
|
23
|
+
const so = (o) => {
|
|
24
|
+
class n extends o {
|
|
19
25
|
get idPrefix() {
|
|
20
26
|
return this.localName || "nys-element";
|
|
21
27
|
}
|
|
22
28
|
ensureId() {
|
|
23
|
-
this.id || (this.id =
|
|
29
|
+
this.id || (this.id = ro(this.idPrefix));
|
|
24
30
|
}
|
|
25
31
|
connectedCallback() {
|
|
26
32
|
super.connectedCallback(), this.ensureId();
|
|
27
33
|
}
|
|
28
34
|
}
|
|
29
35
|
return n;
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
|
|
36
|
+
}, ao = /* @__PURE__ */ so(to), Rt = globalThis.__nysIconRegistry ??= /* @__PURE__ */ new Map(), mt = globalThis.__nysIconWatchers ??= /* @__PURE__ */ new Map();
|
|
37
|
+
let ce = null, Qe = null;
|
|
38
|
+
async function lo() {
|
|
39
|
+
return ce || (Qe ??= import("./nys-icon.library-DYsQ8Tiv.js").then(
|
|
40
|
+
(o) => ce = o.default
|
|
41
|
+
), Qe);
|
|
33
42
|
}
|
|
34
|
-
function
|
|
35
|
-
if (globalThis.__nysIconDefaultRegistered ||
|
|
43
|
+
function co() {
|
|
44
|
+
if (globalThis.__nysIconDefaultRegistered || Rt.has("default")) {
|
|
36
45
|
globalThis.__nysIconDefaultRegistered = !0;
|
|
37
46
|
return;
|
|
38
47
|
}
|
|
39
|
-
globalThis.__nysIconDefaultRegistered = !0,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
type: "svg",
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
} });
|
|
48
|
+
globalThis.__nysIconDefaultRegistered = !0, Rt.set("default", {
|
|
49
|
+
resolver: async (o) => {
|
|
50
|
+
if (!o) return;
|
|
51
|
+
const a = (await lo())[o];
|
|
52
|
+
return a ? { type: "svg", content: a } : void 0;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
47
55
|
}
|
|
48
|
-
function
|
|
49
|
-
|
|
56
|
+
function ti(o, n) {
|
|
57
|
+
Rt.set(o, n), mt.get(o)?.forEach((a) => a.redraw());
|
|
50
58
|
}
|
|
51
|
-
function
|
|
52
|
-
|
|
59
|
+
function ei(o) {
|
|
60
|
+
Rt.delete(o), mt.get(o)?.forEach((n) => n.redraw());
|
|
53
61
|
}
|
|
54
|
-
function
|
|
55
|
-
return
|
|
62
|
+
function uo(o) {
|
|
63
|
+
return co(), Rt.get(o);
|
|
56
64
|
}
|
|
57
|
-
function
|
|
58
|
-
|
|
65
|
+
function tn(o, n) {
|
|
66
|
+
mt.has(o) || mt.set(o, /* @__PURE__ */ new Set()), mt.get(o).add(n);
|
|
59
67
|
}
|
|
60
|
-
function
|
|
61
|
-
|
|
68
|
+
function en(o, n) {
|
|
69
|
+
mt.get(o)?.delete(n);
|
|
62
70
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
71
|
+
/*! @license DOMPurify 3.4.16 | (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.16/LICENSE */
|
|
72
|
+
function nn(o, n) {
|
|
73
|
+
(n == null || n > o.length) && (n = o.length);
|
|
74
|
+
for (var a = 0, l = Array(n); a < n; a++) l[a] = o[a];
|
|
66
75
|
return l;
|
|
67
76
|
}
|
|
68
|
-
function
|
|
69
|
-
if (Array.isArray(
|
|
77
|
+
function fo(o) {
|
|
78
|
+
if (Array.isArray(o)) return o;
|
|
70
79
|
}
|
|
71
|
-
function
|
|
72
|
-
var
|
|
73
|
-
if (
|
|
74
|
-
var l, u,
|
|
80
|
+
function po(o, n) {
|
|
81
|
+
var a = o == null ? null : typeof Symbol < "u" && o[Symbol.iterator] || o["@@iterator"];
|
|
82
|
+
if (a != null) {
|
|
83
|
+
var l, u, d, y, ht = [], I = !0, Lt = !1;
|
|
75
84
|
try {
|
|
76
|
-
if (
|
|
77
|
-
} catch (
|
|
78
|
-
|
|
85
|
+
if (d = (a = a.call(o)).next, n !== 0) for (; !(I = (l = d.call(a)).done) && (ht.push(l.value), ht.length !== n); I = !0) ;
|
|
86
|
+
} catch (Q) {
|
|
87
|
+
Lt = !0, u = Q;
|
|
79
88
|
} finally {
|
|
80
89
|
try {
|
|
81
|
-
if (!I &&
|
|
90
|
+
if (!I && a.return != null && (y = a.return(), Object(y) !== y)) return;
|
|
82
91
|
} finally {
|
|
83
|
-
if (
|
|
92
|
+
if (Lt) throw u;
|
|
84
93
|
}
|
|
85
94
|
}
|
|
86
|
-
return
|
|
95
|
+
return ht;
|
|
87
96
|
}
|
|
88
97
|
}
|
|
89
|
-
function
|
|
98
|
+
function mo() {
|
|
90
99
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
91
100
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
92
101
|
}
|
|
93
|
-
|
|
94
|
-
|
|
102
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
103
|
+
function ho(o, n) {
|
|
104
|
+
return fo(o) || po(o, n) || _o(o, n) || mo();
|
|
95
105
|
}
|
|
96
|
-
function
|
|
97
|
-
if (
|
|
98
|
-
if (typeof
|
|
99
|
-
var
|
|
100
|
-
return
|
|
106
|
+
function _o(o, n) {
|
|
107
|
+
if (o) {
|
|
108
|
+
if (typeof o == "string") return nn(o, n);
|
|
109
|
+
var a = {}.toString.call(o).slice(8, -1);
|
|
110
|
+
return a === "Object" && o.constructor && (a = o.constructor.name), a === "Map" || a === "Set" ? Array.from(o) : a === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a) ? nn(o, n) : void 0;
|
|
101
111
|
}
|
|
102
112
|
}
|
|
103
|
-
|
|
104
|
-
|
|
113
|
+
const yn = Object.entries, on = Object.setPrototypeOf, go = Object.isFrozen, To = Object.getPrototypeOf, yo = Object.getOwnPropertyDescriptor;
|
|
114
|
+
let b = Object.freeze, S = Object.seal, pt = Object.create, An = typeof Reflect < "u" && Reflect, _e = An.apply, ge = An.construct;
|
|
115
|
+
b || (b = function(n) {
|
|
105
116
|
return n;
|
|
106
117
|
});
|
|
107
|
-
|
|
118
|
+
S || (S = function(n) {
|
|
108
119
|
return n;
|
|
109
120
|
});
|
|
110
|
-
|
|
111
|
-
for (var l = arguments.length, u = new Array(l > 2 ? l - 2 : 0),
|
|
112
|
-
return n.apply(
|
|
121
|
+
_e || (_e = function(n, a) {
|
|
122
|
+
for (var l = arguments.length, u = new Array(l > 2 ? l - 2 : 0), d = 2; d < l; d++) u[d - 2] = arguments[d];
|
|
123
|
+
return n.apply(a, u);
|
|
113
124
|
});
|
|
114
|
-
|
|
115
|
-
for (var
|
|
125
|
+
ge || (ge = function(n) {
|
|
126
|
+
for (var a = arguments.length, l = new Array(a > 1 ? a - 1 : 0), u = 1; u < a; u++) l[u - 1] = arguments[u];
|
|
116
127
|
return new n(...l);
|
|
117
128
|
});
|
|
118
|
-
|
|
119
|
-
function
|
|
129
|
+
const Z = E(Array.prototype.forEach), Ao = E(Array.prototype.lastIndexOf), rn = E(Array.prototype.pop), Et = E(Array.prototype.push), Eo = E(Array.prototype.splice), dt = Array.isArray, wt = E(String.prototype.toLowerCase), ue = E(String.prototype.toString), sn = E(String.prototype.match), bt = E(String.prototype.replace), an = E(String.prototype.indexOf), bo = E(String.prototype.trim), So = E(Number.prototype.toString), wo = E(Boolean.prototype.toString), ln = typeof BigInt > "u" ? null : E(BigInt.prototype.toString), cn = typeof Symbol > "u" ? null : E(Symbol.prototype.toString), L = E(Object.prototype.hasOwnProperty), St = E(Object.prototype.toString), w = E(RegExp.prototype.test), W = Oo(TypeError);
|
|
130
|
+
function E(o) {
|
|
120
131
|
return function(n) {
|
|
121
132
|
n instanceof RegExp && (n.lastIndex = 0);
|
|
122
|
-
for (var
|
|
123
|
-
return
|
|
133
|
+
for (var a = arguments.length, l = new Array(a > 1 ? a - 1 : 0), u = 1; u < a; u++) l[u - 1] = arguments[u];
|
|
134
|
+
return _e(o, n, l);
|
|
124
135
|
};
|
|
125
136
|
}
|
|
126
|
-
function
|
|
137
|
+
function Oo(o) {
|
|
127
138
|
return function() {
|
|
128
|
-
for (var n = arguments.length,
|
|
129
|
-
return
|
|
139
|
+
for (var n = arguments.length, a = new Array(n), l = 0; l < n; l++) a[l] = arguments[l];
|
|
140
|
+
return ge(o, a);
|
|
130
141
|
};
|
|
131
142
|
}
|
|
132
|
-
function
|
|
133
|
-
let
|
|
134
|
-
if (
|
|
143
|
+
function m(o, n) {
|
|
144
|
+
let a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : wt;
|
|
145
|
+
if (on && on(o, null), !dt(n)) return o;
|
|
135
146
|
let l = n.length;
|
|
136
147
|
for (; l--; ) {
|
|
137
148
|
let u = n[l];
|
|
138
149
|
if (typeof u == "string") {
|
|
139
|
-
const
|
|
140
|
-
|
|
150
|
+
const d = a(u);
|
|
151
|
+
d !== u && (go(n) || (n[l] = d), u = d);
|
|
141
152
|
}
|
|
142
|
-
|
|
153
|
+
o[u] = !0;
|
|
143
154
|
}
|
|
144
|
-
return
|
|
155
|
+
return o;
|
|
145
156
|
}
|
|
146
|
-
function
|
|
147
|
-
for (let n = 0; n <
|
|
148
|
-
return
|
|
157
|
+
function Ro(o) {
|
|
158
|
+
for (let n = 0; n < o.length; n++) L(o, n) || (o[n] = null);
|
|
159
|
+
return o;
|
|
149
160
|
}
|
|
150
|
-
function N(
|
|
151
|
-
const n =
|
|
152
|
-
for (const l of
|
|
153
|
-
var
|
|
154
|
-
const u =
|
|
155
|
-
L(
|
|
161
|
+
function N(o) {
|
|
162
|
+
const n = pt(null);
|
|
163
|
+
for (const l of yn(o)) {
|
|
164
|
+
var a = ho(l, 2);
|
|
165
|
+
const u = a[0], d = a[1];
|
|
166
|
+
L(o, u) && (dt(d) ? n[u] = Ro(d) : d && typeof d == "object" && d.constructor === Object ? n[u] = N(d) : n[u] = d);
|
|
156
167
|
}
|
|
157
168
|
return n;
|
|
158
169
|
}
|
|
159
|
-
function
|
|
160
|
-
switch (typeof
|
|
170
|
+
function Lo(o) {
|
|
171
|
+
switch (typeof o) {
|
|
161
172
|
case "string":
|
|
162
|
-
return
|
|
173
|
+
return o;
|
|
163
174
|
case "number":
|
|
164
|
-
return
|
|
175
|
+
return So(o);
|
|
165
176
|
case "boolean":
|
|
166
|
-
return
|
|
177
|
+
return wo(o);
|
|
167
178
|
case "bigint":
|
|
168
|
-
return
|
|
179
|
+
return ln ? ln(o) : "0";
|
|
169
180
|
case "symbol":
|
|
170
|
-
return
|
|
181
|
+
return cn ? cn(o) : "Symbol()";
|
|
171
182
|
case "undefined":
|
|
172
|
-
return
|
|
183
|
+
return St(o);
|
|
173
184
|
case "function":
|
|
174
185
|
case "object": {
|
|
175
|
-
if (
|
|
176
|
-
const n =
|
|
177
|
-
if (typeof
|
|
178
|
-
const l =
|
|
179
|
-
return typeof l == "string" ? l :
|
|
186
|
+
if (o === null) return St(o);
|
|
187
|
+
const n = o, a = M(n, "toString");
|
|
188
|
+
if (typeof a == "function") {
|
|
189
|
+
const l = a(n);
|
|
190
|
+
return typeof l == "string" ? l : St(l);
|
|
180
191
|
}
|
|
181
|
-
return
|
|
192
|
+
return St(o);
|
|
182
193
|
}
|
|
183
194
|
default:
|
|
184
|
-
return
|
|
195
|
+
return St(o);
|
|
185
196
|
}
|
|
186
197
|
}
|
|
187
|
-
function M(
|
|
188
|
-
for (;
|
|
189
|
-
const l =
|
|
198
|
+
function M(o, n) {
|
|
199
|
+
for (; o !== null; ) {
|
|
200
|
+
const l = yo(o, n);
|
|
190
201
|
if (l) {
|
|
191
|
-
if (l.get) return
|
|
192
|
-
if (typeof l.value == "function") return
|
|
202
|
+
if (l.get) return E(l.get);
|
|
203
|
+
if (typeof l.value == "function") return E(l.value);
|
|
193
204
|
}
|
|
194
|
-
|
|
205
|
+
o = To(o);
|
|
195
206
|
}
|
|
196
|
-
function
|
|
207
|
+
function a() {
|
|
197
208
|
return null;
|
|
198
209
|
}
|
|
199
|
-
return
|
|
210
|
+
return a;
|
|
200
211
|
}
|
|
201
|
-
function
|
|
212
|
+
function Io(o) {
|
|
202
213
|
try {
|
|
203
|
-
return
|
|
214
|
+
return w(o, ""), !0;
|
|
204
215
|
} catch {
|
|
205
216
|
return !1;
|
|
206
217
|
}
|
|
207
218
|
}
|
|
208
|
-
|
|
219
|
+
const un = b([
|
|
209
220
|
"a",
|
|
210
221
|
"abbr",
|
|
211
222
|
"acronym",
|
|
@@ -325,7 +336,7 @@ var sn = A([
|
|
|
325
336
|
"var",
|
|
326
337
|
"video",
|
|
327
338
|
"wbr"
|
|
328
|
-
]),
|
|
339
|
+
]), fe = b([
|
|
329
340
|
"svg",
|
|
330
341
|
"a",
|
|
331
342
|
"altglyph",
|
|
@@ -373,7 +384,7 @@ var sn = A([
|
|
|
373
384
|
"tspan",
|
|
374
385
|
"view",
|
|
375
386
|
"vkern"
|
|
376
|
-
]),
|
|
387
|
+
]), pe = b([
|
|
377
388
|
"feBlend",
|
|
378
389
|
"feColorMatrix",
|
|
379
390
|
"feComponentTransfer",
|
|
@@ -399,7 +410,7 @@ var sn = A([
|
|
|
399
410
|
"feSpotLight",
|
|
400
411
|
"feTile",
|
|
401
412
|
"feTurbulence"
|
|
402
|
-
]),
|
|
413
|
+
]), Do = b([
|
|
403
414
|
"animate",
|
|
404
415
|
"color-profile",
|
|
405
416
|
"cursor",
|
|
@@ -422,7 +433,7 @@ var sn = A([
|
|
|
422
433
|
"solidcolor",
|
|
423
434
|
"unknown",
|
|
424
435
|
"use"
|
|
425
|
-
]),
|
|
436
|
+
]), me = b([
|
|
426
437
|
"math",
|
|
427
438
|
"menclose",
|
|
428
439
|
"merror",
|
|
@@ -453,7 +464,7 @@ var sn = A([
|
|
|
453
464
|
"munder",
|
|
454
465
|
"munderover",
|
|
455
466
|
"mprescripts"
|
|
456
|
-
]),
|
|
467
|
+
]), vo = b([
|
|
457
468
|
"maction",
|
|
458
469
|
"maligngroup",
|
|
459
470
|
"malignmark",
|
|
@@ -469,7 +480,7 @@ var sn = A([
|
|
|
469
480
|
"annotation-xml",
|
|
470
481
|
"mprescripts",
|
|
471
482
|
"none"
|
|
472
|
-
]),
|
|
483
|
+
]), fn = b(["#text"]), pn = b([
|
|
473
484
|
"accept",
|
|
474
485
|
"action",
|
|
475
486
|
"align",
|
|
@@ -588,7 +599,7 @@ var sn = A([
|
|
|
588
599
|
"width",
|
|
589
600
|
"wrap",
|
|
590
601
|
"xmlns"
|
|
591
|
-
]),
|
|
602
|
+
]), de = b([
|
|
592
603
|
"accent-height",
|
|
593
604
|
"accumulate",
|
|
594
605
|
"additive",
|
|
@@ -781,7 +792,7 @@ var sn = A([
|
|
|
781
792
|
"y2",
|
|
782
793
|
"z",
|
|
783
794
|
"zoomandpan"
|
|
784
|
-
]),
|
|
795
|
+
]), mn = b([
|
|
785
796
|
"accent",
|
|
786
797
|
"accentunder",
|
|
787
798
|
"align",
|
|
@@ -836,13 +847,13 @@ var sn = A([
|
|
|
836
847
|
"voffset",
|
|
837
848
|
"width",
|
|
838
849
|
"xmlns"
|
|
839
|
-
]),
|
|
850
|
+
]), Wt = b([
|
|
840
851
|
"xlink:href",
|
|
841
852
|
"xml:id",
|
|
842
853
|
"xlink:title",
|
|
843
854
|
"xml:space",
|
|
844
855
|
"xmlns:xlink"
|
|
845
|
-
]),
|
|
856
|
+
]), No = S(/{{[\w\W]*|^[\w\W]*}}/g), Co = S(/<%[\w\W]*|^[\w\W]*%>/g), Mo = S(/\${[\w\W]*/g), xo = S(/^data-[\-\w.\u00B7-\uFFFF]+$/), Po = S(/^aria-[\-\w]+$/), dn = S(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), zo = S(/^(?:\w+script|data):/i), ko = S(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Uo = S(/^html$/i), Fo = S(/^[a-z][.\w]*(-[.\w]+)+$/i), hn = S(/<[/\w!]/g), _n = S(/<[/\w]/g), Ho = S(/<\/no(script|embed|frames)/i), Go = S(/\/>/i), v = {
|
|
846
857
|
element: 1,
|
|
847
858
|
attribute: 2,
|
|
848
859
|
text: 3,
|
|
@@ -855,7 +866,7 @@ var sn = A([
|
|
|
855
866
|
documentType: 10,
|
|
856
867
|
documentFragment: 11,
|
|
857
868
|
notation: 12
|
|
858
|
-
},
|
|
869
|
+
}, En = [
|
|
859
870
|
"style",
|
|
860
871
|
"script",
|
|
861
872
|
"xmp",
|
|
@@ -864,21 +875,21 @@ var sn = A([
|
|
|
864
875
|
"noframes",
|
|
865
876
|
"plaintext",
|
|
866
877
|
"noscript"
|
|
867
|
-
],
|
|
868
|
-
const
|
|
869
|
-
return
|
|
870
|
-
|
|
871
|
-
}),
|
|
872
|
-
})(),
|
|
878
|
+
], Wo = b(m({}, En)), Bo = (function() {
|
|
879
|
+
const o = {};
|
|
880
|
+
return Z(En, (n) => {
|
|
881
|
+
o[n] = S(new RegExp("</" + n + "(?=[\\t\\n\\f\\r />])", "i"));
|
|
882
|
+
}), b(o);
|
|
883
|
+
})(), Yo = function() {
|
|
873
884
|
return typeof window > "u" ? null : window;
|
|
874
|
-
},
|
|
885
|
+
}, jo = function(n, a) {
|
|
875
886
|
if (typeof n != "object" || typeof n.createPolicy != "function") return null;
|
|
876
887
|
let l = null;
|
|
877
888
|
const u = "data-tt-policy-suffix";
|
|
878
|
-
|
|
879
|
-
const
|
|
889
|
+
a && a.hasAttribute(u) && (l = a.getAttribute(u));
|
|
890
|
+
const d = "dompurify" + (l ? "#" + l : "");
|
|
880
891
|
try {
|
|
881
|
-
return n.createPolicy(
|
|
892
|
+
return n.createPolicy(d, {
|
|
882
893
|
createHTML(y) {
|
|
883
894
|
return y;
|
|
884
895
|
},
|
|
@@ -887,9 +898,9 @@ var sn = A([
|
|
|
887
898
|
}
|
|
888
899
|
});
|
|
889
900
|
} catch {
|
|
890
|
-
return console.warn("TrustedTypes policy " +
|
|
901
|
+
return console.warn("TrustedTypes policy " + d + " could not be created."), null;
|
|
891
902
|
}
|
|
892
|
-
},
|
|
903
|
+
}, gn = function() {
|
|
893
904
|
return {
|
|
894
905
|
afterSanitizeAttributes: [],
|
|
895
906
|
afterSanitizeElements: [],
|
|
@@ -901,70 +912,70 @@ var sn = A([
|
|
|
901
912
|
uponSanitizeElement: [],
|
|
902
913
|
uponSanitizeShadowNode: []
|
|
903
914
|
};
|
|
904
|
-
},
|
|
905
|
-
return L(n,
|
|
906
|
-
},
|
|
907
|
-
const u = L(n,
|
|
915
|
+
}, B = function(n, a, l, u) {
|
|
916
|
+
return L(n, a) && dt(n[a]) ? m(u.base ? N(u.base) : {}, n[a], u.transform) : l;
|
|
917
|
+
}, he = function(n, a, l) {
|
|
918
|
+
const u = L(n, a) ? n[a] : void 0;
|
|
908
919
|
return u && typeof u == "object" ? N(u) : l();
|
|
909
920
|
};
|
|
910
|
-
function
|
|
911
|
-
let
|
|
912
|
-
const n = (
|
|
913
|
-
if (n.version = "3.4.
|
|
921
|
+
function bn() {
|
|
922
|
+
let o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Yo();
|
|
923
|
+
const n = (r) => bn(r);
|
|
924
|
+
if (n.version = "3.4.16", n.removed = [], !o || !o.document || o.document.nodeType !== v.document || !o.Element)
|
|
914
925
|
return n.isSupported = !1, n;
|
|
915
|
-
let
|
|
916
|
-
const l =
|
|
917
|
-
|
|
918
|
-
const
|
|
919
|
-
|
|
920
|
-
const
|
|
926
|
+
let a = o.document;
|
|
927
|
+
const l = a, u = l.currentScript;
|
|
928
|
+
o.DocumentFragment;
|
|
929
|
+
const d = o.HTMLTemplateElement, y = o.Node, ht = o.Element, I = o.NodeFilter;
|
|
930
|
+
o.NamedNodeMap === void 0 && (o.NamedNodeMap || o.MozNamedAttrMap), o.HTMLFormElement;
|
|
931
|
+
const Lt = o.DOMParser, Q = o.trustedTypes, U = ht.prototype, wn = M(U, "cloneNode"), Bt = M(U, "remove"), ye = M(U, "removeAttributeNode"), On = M(U, "nextSibling"), tt = M(U, "childNodes"), et = M(U, "parentNode"), Ae = M(U, "shadowRoot"), Yt = M(U, "attributes"), $ = y && y.prototype ? M(y.prototype, "nodeType") : null, nt = y && y.prototype ? M(y.prototype, "nodeName") : null, It = y && y.prototype ? M(y.prototype, "ownerDocument") : null, _t = function(t) {
|
|
921
932
|
return $ ? $(t) : t.nodeType;
|
|
922
|
-
},
|
|
923
|
-
return
|
|
933
|
+
}, jt = function(t) {
|
|
934
|
+
return nt ? nt(t) : t.nodeName;
|
|
924
935
|
};
|
|
925
|
-
if (typeof
|
|
926
|
-
const
|
|
927
|
-
|
|
936
|
+
if (typeof d == "function") {
|
|
937
|
+
const r = a.createElement("template");
|
|
938
|
+
r.content && r.content.ownerDocument && (a = r.content.ownerDocument);
|
|
928
939
|
}
|
|
929
|
-
let
|
|
930
|
-
const
|
|
931
|
-
if (
|
|
932
|
-
},
|
|
933
|
-
|
|
940
|
+
let R, X = "", $t, Ee = !1, gt = 0;
|
|
941
|
+
const be = function() {
|
|
942
|
+
if (gt > 0) throw W('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');
|
|
943
|
+
}, ot = function(t) {
|
|
944
|
+
be(), gt++;
|
|
934
945
|
try {
|
|
935
|
-
return
|
|
946
|
+
return R.createHTML(t);
|
|
936
947
|
} finally {
|
|
937
|
-
|
|
948
|
+
gt--;
|
|
938
949
|
}
|
|
939
|
-
},
|
|
940
|
-
|
|
950
|
+
}, Rn = function(t) {
|
|
951
|
+
be(), gt++;
|
|
941
952
|
try {
|
|
942
|
-
return
|
|
953
|
+
return R.createScriptURL(t);
|
|
943
954
|
} finally {
|
|
944
|
-
|
|
955
|
+
gt--;
|
|
945
956
|
}
|
|
946
|
-
},
|
|
947
|
-
return
|
|
948
|
-
},
|
|
949
|
-
let h =
|
|
950
|
-
n.isSupported = typeof
|
|
951
|
-
const
|
|
952
|
-
let
|
|
953
|
-
const
|
|
954
|
-
...
|
|
955
|
-
...ce,
|
|
956
|
-
...ue,
|
|
957
|
+
}, Ln = function() {
|
|
958
|
+
return Ee || ($t = jo(Q, u), Ee = !0), $t;
|
|
959
|
+
}, Dt = a, Xt = Dt.implementation, Se = Dt.createNodeIterator, In = Dt.createDocumentFragment, Dn = Dt.getElementsByTagName, vn = l.importNode;
|
|
960
|
+
let h = gn();
|
|
961
|
+
n.isSupported = typeof yn == "function" && typeof et == "function" && Xt && Xt.createHTMLDocument !== void 0;
|
|
962
|
+
const Nn = No, Cn = Co, Mn = Mo, xn = xo, Pn = Po, zn = zo, we = ko, kn = Fo;
|
|
963
|
+
let Oe = dn, _ = null;
|
|
964
|
+
const Vt = m({}, [
|
|
965
|
+
...un,
|
|
957
966
|
...fe,
|
|
958
|
-
...
|
|
967
|
+
...pe,
|
|
968
|
+
...me,
|
|
969
|
+
...fn
|
|
959
970
|
]);
|
|
960
971
|
let g = null;
|
|
961
|
-
const
|
|
962
|
-
...
|
|
963
|
-
...
|
|
964
|
-
...
|
|
965
|
-
...
|
|
972
|
+
const qt = m({}, [
|
|
973
|
+
...pn,
|
|
974
|
+
...de,
|
|
975
|
+
...mn,
|
|
976
|
+
...Wt
|
|
966
977
|
]);
|
|
967
|
-
let x = Object.seal(
|
|
978
|
+
let x = Object.seal(pt(null, {
|
|
968
979
|
tagNameCheck: {
|
|
969
980
|
writable: !0,
|
|
970
981
|
configurable: !1,
|
|
@@ -983,8 +994,8 @@ function Tn() {
|
|
|
983
994
|
enumerable: !0,
|
|
984
995
|
value: !1
|
|
985
996
|
}
|
|
986
|
-
})),
|
|
987
|
-
const F = Object.seal(
|
|
997
|
+
})), Tt = null, Re = null;
|
|
998
|
+
const F = Object.seal(pt(null, {
|
|
988
999
|
tagCheck: {
|
|
989
1000
|
writable: !0,
|
|
990
1001
|
configurable: !1,
|
|
@@ -998,10 +1009,10 @@ function Tn() {
|
|
|
998
1009
|
value: null
|
|
999
1010
|
}
|
|
1000
1011
|
}));
|
|
1001
|
-
let
|
|
1002
|
-
const
|
|
1003
|
-
let
|
|
1004
|
-
const
|
|
1012
|
+
let Le = !0, Kt = !0, Ie = !1, De = !0, H = !1, V = !0, q = !1, Zt = !1, vt = null, Nt = null, Jt = !1, it = !1, Ct = !1, Mt = !1, ve = !0, Ne = !1;
|
|
1013
|
+
const Ce = "user-content-";
|
|
1014
|
+
let Qt = !0, te = !1, rt = {}, st = null;
|
|
1015
|
+
const Me = m({}, [
|
|
1005
1016
|
"annotation-xml",
|
|
1006
1017
|
"audio",
|
|
1007
1018
|
"colgroup",
|
|
@@ -1029,8 +1040,8 @@ function Tn() {
|
|
|
1029
1040
|
"video",
|
|
1030
1041
|
"xmp"
|
|
1031
1042
|
]);
|
|
1032
|
-
let
|
|
1033
|
-
const
|
|
1043
|
+
let xe = null;
|
|
1044
|
+
const Pe = m({}, [
|
|
1034
1045
|
"audio",
|
|
1035
1046
|
"video",
|
|
1036
1047
|
"img",
|
|
@@ -1038,8 +1049,8 @@ function Tn() {
|
|
|
1038
1049
|
"image",
|
|
1039
1050
|
"track"
|
|
1040
1051
|
]);
|
|
1041
|
-
let
|
|
1042
|
-
const
|
|
1052
|
+
let ze = null;
|
|
1053
|
+
const ke = m({}, [
|
|
1043
1054
|
"alt",
|
|
1044
1055
|
"class",
|
|
1045
1056
|
"for",
|
|
@@ -1054,113 +1065,113 @@ function Tn() {
|
|
|
1054
1065
|
"value",
|
|
1055
1066
|
"style",
|
|
1056
1067
|
"xmlns"
|
|
1057
|
-
]),
|
|
1058
|
-
let
|
|
1059
|
-
const
|
|
1060
|
-
|
|
1061
|
-
|
|
1068
|
+
]), xt = "http://www.w3.org/1998/Math/MathML", Pt = "http://www.w3.org/2000/svg", P = "http://www.w3.org/1999/xhtml";
|
|
1069
|
+
let at = P, ee = !1, ne = null;
|
|
1070
|
+
const Un = m({}, [
|
|
1071
|
+
xt,
|
|
1072
|
+
Pt,
|
|
1062
1073
|
P
|
|
1063
|
-
],
|
|
1074
|
+
], ue), Ue = b([
|
|
1064
1075
|
"mi",
|
|
1065
1076
|
"mo",
|
|
1066
1077
|
"mn",
|
|
1067
1078
|
"ms",
|
|
1068
1079
|
"mtext"
|
|
1069
1080
|
]);
|
|
1070
|
-
let
|
|
1071
|
-
const
|
|
1072
|
-
let
|
|
1073
|
-
const
|
|
1081
|
+
let oe = m({}, Ue);
|
|
1082
|
+
const Fe = b(["annotation-xml"]);
|
|
1083
|
+
let ie = m({}, Fe);
|
|
1084
|
+
const Fn = m({}, [
|
|
1074
1085
|
"title",
|
|
1075
1086
|
"style",
|
|
1076
1087
|
"font",
|
|
1077
1088
|
"a",
|
|
1078
1089
|
"script"
|
|
1079
1090
|
]);
|
|
1080
|
-
let
|
|
1081
|
-
const
|
|
1082
|
-
let
|
|
1083
|
-
const
|
|
1091
|
+
let yt = null;
|
|
1092
|
+
const Hn = ["application/xhtml+xml", "text/html"], Gn = "text/html";
|
|
1093
|
+
let A = null, lt = null;
|
|
1094
|
+
const Wn = a.createElement("form"), He = function(t) {
|
|
1084
1095
|
return t instanceof RegExp || t instanceof Function;
|
|
1085
1096
|
}, re = function() {
|
|
1086
1097
|
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1087
|
-
if (
|
|
1088
|
-
(!t || typeof t != "object") && (t = {}), t = N(t),
|
|
1089
|
-
transform:
|
|
1090
|
-
base:
|
|
1091
|
-
}),
|
|
1092
|
-
transform:
|
|
1093
|
-
base:
|
|
1094
|
-
}), st =
|
|
1095
|
-
const e =
|
|
1096
|
-
if (x =
|
|
1098
|
+
if (lt && lt === t) return;
|
|
1099
|
+
(!t || typeof t != "object") && (t = {}), t = N(t), yt = Hn.indexOf(t.PARSER_MEDIA_TYPE) === -1 ? Gn : t.PARSER_MEDIA_TYPE, A = yt === "application/xhtml+xml" ? ue : wt, _ = B(t, "ALLOWED_TAGS", Vt, { transform: A }), g = B(t, "ALLOWED_ATTR", qt, { transform: A }), ne = B(t, "ALLOWED_NAMESPACES", Un, { transform: ue }), ze = B(t, "ADD_URI_SAFE_ATTR", ke, {
|
|
1100
|
+
transform: A,
|
|
1101
|
+
base: ke
|
|
1102
|
+
}), xe = B(t, "ADD_DATA_URI_TAGS", Pe, {
|
|
1103
|
+
transform: A,
|
|
1104
|
+
base: Pe
|
|
1105
|
+
}), st = B(t, "FORBID_CONTENTS", Me, { transform: A }), Tt = B(t, "FORBID_TAGS", N({}), { transform: A }), Re = B(t, "FORBID_ATTR", N({}), { transform: A }), rt = L(t, "USE_PROFILES") ? t.USE_PROFILES && typeof t.USE_PROFILES == "object" ? N(t.USE_PROFILES) : t.USE_PROFILES : !1, Le = t.ALLOW_ARIA_ATTR !== !1, Kt = t.ALLOW_DATA_ATTR !== !1, Ie = t.ALLOW_UNKNOWN_PROTOCOLS || !1, De = t.ALLOW_SELF_CLOSE_IN_ATTR !== !1, H = t.SAFE_FOR_TEMPLATES || !1, V = t.SAFE_FOR_XML !== !1, q = t.WHOLE_DOCUMENT || !1, it = t.RETURN_DOM || !1, Ct = t.RETURN_DOM_FRAGMENT || !1, Mt = t.RETURN_TRUSTED_TYPE || !1, Jt = t.FORCE_BODY || !1, ve = t.SANITIZE_DOM !== !1, Ne = t.SANITIZE_NAMED_PROPS || !1, Qt = t.KEEP_CONTENT !== !1, te = t.IN_PLACE || !1, Oe = Io(t.ALLOWED_URI_REGEXP) ? t.ALLOWED_URI_REGEXP : dn, at = typeof t.NAMESPACE == "string" ? t.NAMESPACE : P, oe = he(t, "MATHML_TEXT_INTEGRATION_POINTS", () => m({}, Ue)), ie = he(t, "HTML_INTEGRATION_POINTS", () => m({}, Fe));
|
|
1106
|
+
const e = he(t, "CUSTOM_ELEMENT_HANDLING", () => pt(null));
|
|
1107
|
+
if (x = pt(null), L(e, "tagNameCheck") && He(e.tagNameCheck) && (x.tagNameCheck = e.tagNameCheck), L(e, "attributeNameCheck") && He(e.attributeNameCheck) && (x.attributeNameCheck = e.attributeNameCheck), L(e, "allowCustomizedBuiltInElements") && typeof e.allowCustomizedBuiltInElements == "boolean" && (x.allowCustomizedBuiltInElements = e.allowCustomizedBuiltInElements), S(x), H && (Kt = !1), Ct && (it = !0), rt && (_ = m({}, fn), g = pt(null), rt.html === !0 && (m(_, un), m(g, pn)), rt.svg === !0 && (m(_, fe), m(g, de), m(g, Wt)), rt.svgFilters === !0 && (m(_, pe), m(g, de), m(g, Wt)), rt.mathMl === !0 && (m(_, me), m(g, mn), m(g, Wt))), F.tagCheck = null, F.attributeCheck = null, L(t, "ADD_TAGS") && (typeof t.ADD_TAGS == "function" ? F.tagCheck = t.ADD_TAGS : dt(t.ADD_TAGS) && (_ === Vt && (_ = N(_)), m(_, t.ADD_TAGS, A))), L(t, "ADD_ATTR") && (typeof t.ADD_ATTR == "function" ? F.attributeCheck = t.ADD_ATTR : dt(t.ADD_ATTR) && (g === qt && (g = N(g)), m(g, t.ADD_ATTR, A))), L(t, "ADD_FORBID_CONTENTS") && dt(t.ADD_FORBID_CONTENTS) && (st === Me && (st = N(st)), m(st, t.ADD_FORBID_CONTENTS, A)), Qt && (_["#text"] = !0), q && m(_, [
|
|
1097
1108
|
"html",
|
|
1098
1109
|
"head",
|
|
1099
1110
|
"body"
|
|
1100
|
-
]), _.table && (
|
|
1101
|
-
if (typeof t.TRUSTED_TYPES_POLICY.createHTML != "function") throw
|
|
1102
|
-
if (typeof t.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw
|
|
1103
|
-
const i =
|
|
1104
|
-
|
|
1111
|
+
]), _.table && (m(_, ["tbody"]), delete Tt.tbody), t.TRUSTED_TYPES_POLICY) {
|
|
1112
|
+
if (typeof t.TRUSTED_TYPES_POLICY.createHTML != "function") throw W('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
1113
|
+
if (typeof t.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw W('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
1114
|
+
const i = R;
|
|
1115
|
+
R = t.TRUSTED_TYPES_POLICY;
|
|
1105
1116
|
try {
|
|
1106
|
-
X =
|
|
1107
|
-
} catch (
|
|
1108
|
-
throw
|
|
1117
|
+
X = ot("");
|
|
1118
|
+
} catch (s) {
|
|
1119
|
+
throw R = i, s;
|
|
1109
1120
|
}
|
|
1110
|
-
} else t.TRUSTED_TYPES_POLICY === null ? (
|
|
1111
|
-
|
|
1112
|
-
},
|
|
1113
|
-
...
|
|
1114
|
-
...
|
|
1115
|
-
...
|
|
1116
|
-
]),
|
|
1117
|
-
return e.namespaceURI === P ? t === "svg" : e.namespaceURI ===
|
|
1118
|
-
},
|
|
1119
|
-
return e.namespaceURI === P ? t === "math" : e.namespaceURI ===
|
|
1120
|
-
},
|
|
1121
|
-
return e.namespaceURI ===
|
|
1122
|
-
},
|
|
1123
|
-
let e =
|
|
1121
|
+
} else t.TRUSTED_TYPES_POLICY === null ? (R = void 0, X = "") : (R === void 0 && (R = Ln()), R && typeof X == "string" && (X = ot("")));
|
|
1122
|
+
b && b(t), lt = t;
|
|
1123
|
+
}, Ge = m({}, [
|
|
1124
|
+
...fe,
|
|
1125
|
+
...pe,
|
|
1126
|
+
...Do
|
|
1127
|
+
]), We = m({}, [...me, ...vo]), Bn = function(t, e, i) {
|
|
1128
|
+
return e.namespaceURI === P ? t === "svg" : e.namespaceURI === xt ? t === "svg" && (i === "annotation-xml" || oe[i]) : !!Ge[t];
|
|
1129
|
+
}, Yn = function(t, e, i) {
|
|
1130
|
+
return e.namespaceURI === P ? t === "math" : e.namespaceURI === Pt ? t === "math" && ie[i] : !!We[t];
|
|
1131
|
+
}, jn = function(t, e, i) {
|
|
1132
|
+
return e.namespaceURI === Pt && !ie[i] || e.namespaceURI === xt && !oe[i] ? !1 : !We[t] && (Fn[t] || !Ge[t]);
|
|
1133
|
+
}, $n = function(t) {
|
|
1134
|
+
let e = et(t);
|
|
1124
1135
|
(!e || !e.tagName) && (e = {
|
|
1125
|
-
namespaceURI:
|
|
1136
|
+
namespaceURI: at,
|
|
1126
1137
|
tagName: "template"
|
|
1127
1138
|
});
|
|
1128
|
-
const i =
|
|
1129
|
-
return
|
|
1139
|
+
const i = wt(t.tagName), s = wt(e.tagName);
|
|
1140
|
+
return ne[t.namespaceURI] ? t.namespaceURI === Pt ? Bn(i, e, s) : t.namespaceURI === xt ? Yn(i, e, s) : t.namespaceURI === P ? jn(i, e, s) : !!(yt === "application/xhtml+xml" && ne[t.namespaceURI]) : !1;
|
|
1130
1141
|
}, G = function(t) {
|
|
1131
|
-
|
|
1142
|
+
Et(n.removed, { element: t });
|
|
1132
1143
|
try {
|
|
1133
|
-
|
|
1144
|
+
et(t).removeChild(t);
|
|
1134
1145
|
} catch {
|
|
1135
|
-
if (
|
|
1146
|
+
if (Bt(t), !et(t)) throw W("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
1136
1147
|
}
|
|
1137
|
-
},
|
|
1148
|
+
}, Be = function(t, e, i) {
|
|
1138
1149
|
try {
|
|
1139
|
-
t
|
|
1150
|
+
ye(t, e);
|
|
1140
1151
|
} catch {
|
|
1141
1152
|
try {
|
|
1142
1153
|
t.removeAttribute(i);
|
|
1143
1154
|
} catch {
|
|
1144
1155
|
}
|
|
1145
1156
|
}
|
|
1146
|
-
},
|
|
1147
|
-
|
|
1148
|
-
const e =
|
|
1157
|
+
}, zt = function(t) {
|
|
1158
|
+
kt(t);
|
|
1159
|
+
const e = tt(t);
|
|
1149
1160
|
if (e) {
|
|
1150
|
-
const
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
}),
|
|
1161
|
+
const s = [];
|
|
1162
|
+
Z(e, (c) => {
|
|
1163
|
+
Et(s, c);
|
|
1164
|
+
}), Z(s, (c) => {
|
|
1154
1165
|
try {
|
|
1155
|
-
|
|
1166
|
+
Bt(c);
|
|
1156
1167
|
} catch {
|
|
1157
1168
|
}
|
|
1158
1169
|
});
|
|
1159
1170
|
}
|
|
1160
|
-
const i =
|
|
1161
|
-
if (i) for (let
|
|
1162
|
-
const c = i[
|
|
1163
|
-
typeof f == "string" &&
|
|
1171
|
+
const i = Yt(t);
|
|
1172
|
+
if (i) for (let s = i.length - 1; s >= 0; --s) {
|
|
1173
|
+
const c = i[s], f = c && c.name;
|
|
1174
|
+
typeof f == "string" && Be(t, c, f);
|
|
1164
1175
|
}
|
|
1165
1176
|
}, K = function(t, e, i) {
|
|
1166
1177
|
if (!i) try {
|
|
@@ -1168,12 +1179,12 @@ function Tn() {
|
|
|
1168
1179
|
} catch {
|
|
1169
1180
|
i = null;
|
|
1170
1181
|
}
|
|
1171
|
-
|
|
1182
|
+
Et(n.removed, {
|
|
1172
1183
|
attribute: i || null,
|
|
1173
1184
|
from: e
|
|
1174
1185
|
});
|
|
1175
1186
|
try {
|
|
1176
|
-
i ? e
|
|
1187
|
+
i ? ye(e, i) : e.removeAttribute(t);
|
|
1177
1188
|
} catch {
|
|
1178
1189
|
try {
|
|
1179
1190
|
e.removeAttribute(t);
|
|
@@ -1181,7 +1192,7 @@ function Tn() {
|
|
|
1181
1192
|
}
|
|
1182
1193
|
}
|
|
1183
1194
|
if (t === "is")
|
|
1184
|
-
if (
|
|
1195
|
+
if (it || Ct) try {
|
|
1185
1196
|
G(e);
|
|
1186
1197
|
} catch {
|
|
1187
1198
|
}
|
|
@@ -1189,94 +1200,94 @@ function Tn() {
|
|
|
1189
1200
|
e.setAttribute(t, "");
|
|
1190
1201
|
} catch {
|
|
1191
1202
|
}
|
|
1192
|
-
},
|
|
1193
|
-
const e =
|
|
1203
|
+
}, Xn = function(t) {
|
|
1204
|
+
const e = Yt(t);
|
|
1194
1205
|
if (e)
|
|
1195
1206
|
for (let i = e.length - 1; i >= 0; --i) {
|
|
1196
|
-
const
|
|
1197
|
-
typeof c != "string" || g[
|
|
1207
|
+
const s = e[i], c = s && s.name;
|
|
1208
|
+
typeof c != "string" || g[A(c)] || Be(t, s, c);
|
|
1198
1209
|
}
|
|
1199
|
-
},
|
|
1210
|
+
}, kt = function(t) {
|
|
1200
1211
|
const e = [t];
|
|
1201
1212
|
for (; e.length > 0; ) {
|
|
1202
1213
|
const i = e.pop();
|
|
1203
|
-
|
|
1204
|
-
const
|
|
1205
|
-
if (
|
|
1214
|
+
_t(i) === v.element && Xn(i);
|
|
1215
|
+
const s = tt(i);
|
|
1216
|
+
if (s) for (let c = s.length - 1; c >= 0; --c) e.push(s[c]);
|
|
1206
1217
|
}
|
|
1207
|
-
},
|
|
1218
|
+
}, Ye = function(t, e) {
|
|
1208
1219
|
return V ? t === "patchsrc" ? !0 : t === "for" && e !== "label" && e !== "output" : !1;
|
|
1209
|
-
},
|
|
1220
|
+
}, Vn = function(t) {
|
|
1210
1221
|
if (!V) return;
|
|
1211
1222
|
const e = [t];
|
|
1212
1223
|
for (; e.length > 0; ) {
|
|
1213
|
-
const i = e.pop(),
|
|
1214
|
-
if (
|
|
1224
|
+
const i = e.pop(), s = _t(i);
|
|
1225
|
+
if (s === v.processingInstruction || s === v.comment && w(_n, i.data)) {
|
|
1215
1226
|
try {
|
|
1216
|
-
|
|
1227
|
+
Bt(i);
|
|
1217
1228
|
} catch {
|
|
1218
1229
|
}
|
|
1219
1230
|
continue;
|
|
1220
1231
|
}
|
|
1221
|
-
if (
|
|
1222
|
-
const f = i,
|
|
1232
|
+
if (s === v.element) {
|
|
1233
|
+
const f = i, p = A(jt(i));
|
|
1223
1234
|
try {
|
|
1224
|
-
f.hasAttribute && f.hasAttribute("patchsrc") && f.removeAttribute("patchsrc"), f.hasAttribute && f.hasAttribute("for") &&
|
|
1235
|
+
f.hasAttribute && f.hasAttribute("patchsrc") && f.removeAttribute("patchsrc"), f.hasAttribute && f.hasAttribute("for") && Ye("for", p) && f.removeAttribute("for");
|
|
1225
1236
|
} catch {
|
|
1226
1237
|
}
|
|
1227
1238
|
}
|
|
1228
|
-
const c =
|
|
1239
|
+
const c = tt(i);
|
|
1229
1240
|
if (c) for (let f = c.length - 1; f >= 0; --f) e.push(c[f]);
|
|
1230
1241
|
}
|
|
1231
|
-
},
|
|
1242
|
+
}, je = function(t) {
|
|
1232
1243
|
let e = null, i = null;
|
|
1233
|
-
if (
|
|
1244
|
+
if (Jt) t = "<remove></remove>" + t;
|
|
1234
1245
|
else {
|
|
1235
|
-
const f =
|
|
1246
|
+
const f = sn(t, /^[\r\n\t ]+/);
|
|
1236
1247
|
i = f && f[0];
|
|
1237
1248
|
}
|
|
1238
|
-
|
|
1239
|
-
const
|
|
1240
|
-
if (
|
|
1241
|
-
e = new
|
|
1249
|
+
yt === "application/xhtml+xml" && at === P && (t = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + t + "</body></html>");
|
|
1250
|
+
const s = R ? ot(t) : t;
|
|
1251
|
+
if (at === P) try {
|
|
1252
|
+
e = new Lt().parseFromString(s, yt);
|
|
1242
1253
|
} catch {
|
|
1243
1254
|
}
|
|
1244
1255
|
if (!e || !e.documentElement) {
|
|
1245
|
-
e =
|
|
1256
|
+
e = Xt.createDocument(at, "template", null);
|
|
1246
1257
|
try {
|
|
1247
|
-
e.documentElement.innerHTML =
|
|
1258
|
+
e.documentElement.innerHTML = ee ? X : s;
|
|
1248
1259
|
} catch {
|
|
1249
1260
|
}
|
|
1250
1261
|
}
|
|
1251
1262
|
const c = e.body || e.documentElement;
|
|
1252
|
-
return t && i && c.insertBefore(
|
|
1253
|
-
},
|
|
1254
|
-
const e =
|
|
1255
|
-
return
|
|
1256
|
-
},
|
|
1257
|
-
return t = bt(t,
|
|
1258
|
-
},
|
|
1263
|
+
return t && i && c.insertBefore(a.createTextNode(i), c.childNodes[0] || null), at === P ? Dn.call(e, q ? "html" : "body")[0] : q ? e.documentElement : c;
|
|
1264
|
+
}, $e = function(t) {
|
|
1265
|
+
const e = It ? It(t) : t.ownerDocument;
|
|
1266
|
+
return Se.call(e || t, t, I.SHOW_ELEMENT | I.SHOW_COMMENT | I.SHOW_TEXT | I.SHOW_PROCESSING_INSTRUCTION | I.SHOW_CDATA_SECTION, null);
|
|
1267
|
+
}, Ut = function(t) {
|
|
1268
|
+
return t = bt(t, Nn, " "), t = bt(t, Cn, " "), t = bt(t, Mn, " "), t;
|
|
1269
|
+
}, se = function(t) {
|
|
1259
1270
|
var e;
|
|
1260
1271
|
t.normalize();
|
|
1261
|
-
const i =
|
|
1262
|
-
let c =
|
|
1272
|
+
const i = It ? It(t) : t.ownerDocument, s = Se.call(i || t, t, I.SHOW_TEXT | I.SHOW_COMMENT | I.SHOW_CDATA_SECTION | I.SHOW_PROCESSING_INSTRUCTION, null);
|
|
1273
|
+
let c = s.nextNode();
|
|
1263
1274
|
for (; c; )
|
|
1264
|
-
c.data =
|
|
1275
|
+
c.data = Ut(c.data), c = s.nextNode();
|
|
1265
1276
|
const f = (e = t.querySelectorAll) === null || e === void 0 ? void 0 : e.call(t, "template");
|
|
1266
|
-
f &&
|
|
1267
|
-
|
|
1277
|
+
f && Z(f, (p) => {
|
|
1278
|
+
ct(p.content) && se(p.content);
|
|
1268
1279
|
});
|
|
1269
|
-
},
|
|
1270
|
-
const e =
|
|
1271
|
-
return typeof e != "string" ||
|
|
1272
|
-
},
|
|
1280
|
+
}, Ft = function(t) {
|
|
1281
|
+
const e = nt ? nt(t) : null;
|
|
1282
|
+
return typeof e != "string" || A(e) !== "form" ? !1 : typeof t.nodeName != "string" || typeof t.textContent != "string" || typeof t.removeChild != "function" || t.attributes !== Yt(t) || typeof t.removeAttribute != "function" || typeof t.removeAttributeNode != "function" || typeof t.getAttributeNode != "function" || typeof t.setAttribute != "function" || typeof t.namespaceURI != "string" || typeof t.insertBefore != "function" || typeof t.hasChildNodes != "function" || t.nodeType !== $(t) || t.childNodes !== tt(t);
|
|
1283
|
+
}, ct = function(t) {
|
|
1273
1284
|
if (!$ || typeof t != "object" || t === null) return !1;
|
|
1274
1285
|
try {
|
|
1275
|
-
return $(t) ===
|
|
1286
|
+
return $(t) === v.documentFragment;
|
|
1276
1287
|
} catch {
|
|
1277
1288
|
return !1;
|
|
1278
1289
|
}
|
|
1279
|
-
},
|
|
1290
|
+
}, At = function(t) {
|
|
1280
1291
|
if (!$ || typeof t != "object" || t === null) return !1;
|
|
1281
1292
|
try {
|
|
1282
1293
|
return typeof $(t) == "number";
|
|
@@ -1284,64 +1295,64 @@ function Tn() {
|
|
|
1284
1295
|
return !1;
|
|
1285
1296
|
}
|
|
1286
1297
|
};
|
|
1287
|
-
function z(
|
|
1288
|
-
|
|
1289
|
-
i.call(n, t, e,
|
|
1298
|
+
function z(r, t, e) {
|
|
1299
|
+
r.length !== 0 && Z(r, (i) => {
|
|
1300
|
+
i.call(n, t, e, lt);
|
|
1290
1301
|
});
|
|
1291
1302
|
}
|
|
1292
|
-
const
|
|
1293
|
-
return !!(V && t.hasChildNodes() && !
|
|
1294
|
-
},
|
|
1295
|
-
if (t instanceof RegExp) return
|
|
1303
|
+
const qn = function(t, e) {
|
|
1304
|
+
return !!(V && t.hasChildNodes() && !At(t.firstElementChild) && w(hn, t.textContent) && w(hn, t.innerHTML) || V && t.namespaceURI === P && Wo[e] && (At(t.firstElementChild) || typeof t.textContent == "string" && w(Bo[e], t.textContent)) || t.nodeType === v.processingInstruction || V && t.nodeType === v.comment && w(_n, t.data));
|
|
1305
|
+
}, Ht = function(t, e) {
|
|
1306
|
+
if (t instanceof RegExp) return w(t, e);
|
|
1296
1307
|
if (t instanceof Function) {
|
|
1297
|
-
for (var i = arguments.length,
|
|
1298
|
-
return !!t(e, ...
|
|
1308
|
+
for (var i = arguments.length, s = new Array(i > 2 ? i - 2 : 0), c = 2; c < i; c++) s[c - 2] = arguments[c];
|
|
1309
|
+
return !!t(e, ...s);
|
|
1299
1310
|
}
|
|
1300
1311
|
return !1;
|
|
1301
|
-
},
|
|
1302
|
-
if (!
|
|
1303
|
-
if (
|
|
1304
|
-
const
|
|
1305
|
-
if (c &&
|
|
1312
|
+
}, Kn = function(t, e, i) {
|
|
1313
|
+
if (!Tt[e] && Ke(e) && Ht(x.tagNameCheck, e)) return !1;
|
|
1314
|
+
if (Qt && !st[e]) {
|
|
1315
|
+
const s = et(t), c = tt(t);
|
|
1316
|
+
if (c && s) {
|
|
1306
1317
|
const f = c.length;
|
|
1307
|
-
for (let
|
|
1308
|
-
const
|
|
1309
|
-
|
|
1318
|
+
for (let p = f - 1; p >= 0; --p) {
|
|
1319
|
+
const T = t === i ? wn(c[p], !0) : c[p];
|
|
1320
|
+
s.insertBefore(T, On(t));
|
|
1310
1321
|
}
|
|
1311
1322
|
}
|
|
1312
1323
|
}
|
|
1313
1324
|
return G(t), !0;
|
|
1314
|
-
},
|
|
1315
|
-
return t.length === 0 ? e : e === i || e ===
|
|
1316
|
-
},
|
|
1317
|
-
return t === e ||
|
|
1318
|
-
},
|
|
1319
|
-
if (z(h.beforeSanitizeElements, t, null),
|
|
1320
|
-
if (
|
|
1325
|
+
}, Xe = function(t, e, i, s) {
|
|
1326
|
+
return t.length === 0 ? e : e === i || e === s ? N(e) : e;
|
|
1327
|
+
}, ut = function(t, e) {
|
|
1328
|
+
return t === e || et(t) !== null ? !1 : (te && kt(t), !0);
|
|
1329
|
+
}, Ve = function(t, e) {
|
|
1330
|
+
if (z(h.beforeSanitizeElements, t, null), ut(t, e)) return !0;
|
|
1331
|
+
if (Ft(t))
|
|
1321
1332
|
return G(t), !0;
|
|
1322
|
-
const i =
|
|
1323
|
-
if (_ =
|
|
1333
|
+
const i = A(jt(t));
|
|
1334
|
+
if (_ = Xe(h.uponSanitizeElement, _, Vt, vt), z(h.uponSanitizeElement, t, {
|
|
1324
1335
|
tagName: i,
|
|
1325
1336
|
allowedTags: _
|
|
1326
|
-
}),
|
|
1327
|
-
if (
|
|
1337
|
+
}), ut(t, e)) return !0;
|
|
1338
|
+
if (qn(t, i))
|
|
1328
1339
|
return G(t), !0;
|
|
1329
|
-
if (
|
|
1330
|
-
const
|
|
1331
|
-
return
|
|
1340
|
+
if (Tt[i] || !(F.tagCheck instanceof Function && F.tagCheck(i)) && !_[i]) {
|
|
1341
|
+
const s = Kn(t, i, e);
|
|
1342
|
+
return s === !1 && (z(h.afterSanitizeElements, t, null), ut(t, e)) ? !0 : s;
|
|
1332
1343
|
}
|
|
1333
|
-
if (
|
|
1344
|
+
if (_t(t) === v.element && !$n(t) || (i === "noscript" || i === "noembed" || i === "noframes") && w(Ho, t.innerHTML))
|
|
1334
1345
|
return G(t), !0;
|
|
1335
|
-
if (H && t.nodeType ===
|
|
1336
|
-
const
|
|
1337
|
-
t.textContent !==
|
|
1346
|
+
if (H && t.nodeType === v.text) {
|
|
1347
|
+
const s = Ut(t.textContent);
|
|
1348
|
+
t.textContent !== s && (Et(n.removed, { element: t.cloneNode() }), t.textContent = s);
|
|
1338
1349
|
}
|
|
1339
|
-
return z(h.afterSanitizeElements, t, null),
|
|
1340
|
-
},
|
|
1341
|
-
if (
|
|
1342
|
-
const
|
|
1343
|
-
return
|
|
1344
|
-
},
|
|
1350
|
+
return z(h.afterSanitizeElements, t, null), ut(t, e);
|
|
1351
|
+
}, qe = function(t, e, i) {
|
|
1352
|
+
if (Re[e] || Ye(e, t) || ve && (e === "id" || e === "name") && (i in a || i in Wn)) return !1;
|
|
1353
|
+
const s = g[e] || F.attributeCheck instanceof Function && F.attributeCheck(e, t);
|
|
1354
|
+
return Kt && w(xn, e) || Le && w(Pn, e) ? !0 : s ? ze[e] || w(Oe, bt(i, we, "")) || (e === "src" || e === "xlink:href" || e === "href") && t !== "script" && an(i, "data:") === 0 && xe[t] || Ie && !w(zn, bt(i, we, "")) ? !0 : !i : Ke(t) && Ht(x.tagNameCheck, t) && Ht(x.attributeNameCheck, e, t) || e === "is" && x.allowCustomizedBuiltInElements && Ht(x.tagNameCheck, i);
|
|
1355
|
+
}, Zn = m({}, [
|
|
1345
1356
|
"annotation-xml",
|
|
1346
1357
|
"color-profile",
|
|
1347
1358
|
"font-face",
|
|
@@ -1350,74 +1361,74 @@ function Tn() {
|
|
|
1350
1361
|
"font-face-src",
|
|
1351
1362
|
"font-face-uri",
|
|
1352
1363
|
"missing-glyph"
|
|
1353
|
-
]),
|
|
1354
|
-
return !
|
|
1355
|
-
},
|
|
1356
|
-
if (
|
|
1364
|
+
]), Ke = function(t) {
|
|
1365
|
+
return !Zn[wt(t)] && w(kn, t);
|
|
1366
|
+
}, Jn = function(t, e, i, s) {
|
|
1367
|
+
if (R && typeof Q == "object" && typeof Q.getAttributeType == "function" && !i) switch (Q.getAttributeType(t, e)) {
|
|
1357
1368
|
case "TrustedHTML":
|
|
1358
|
-
return
|
|
1369
|
+
return ot(s);
|
|
1359
1370
|
case "TrustedScriptURL":
|
|
1360
|
-
return
|
|
1371
|
+
return Rn(s);
|
|
1361
1372
|
}
|
|
1362
|
-
return
|
|
1363
|
-
},
|
|
1373
|
+
return s;
|
|
1374
|
+
}, Qn = function(t, e, i, s) {
|
|
1364
1375
|
try {
|
|
1365
|
-
i ? t.setAttributeNS(i, e,
|
|
1376
|
+
return i ? t.setAttributeNS(i, e, s) : t.setAttribute(e, s), Ft(t) ? (G(t), !1) : !0;
|
|
1366
1377
|
} catch {
|
|
1367
|
-
K(e, t);
|
|
1378
|
+
return K(e, t), !1;
|
|
1368
1379
|
}
|
|
1369
|
-
},
|
|
1370
|
-
z(h.beforeSanitizeAttributes, t, null);
|
|
1371
|
-
const
|
|
1372
|
-
if (!
|
|
1373
|
-
g =
|
|
1374
|
-
const
|
|
1380
|
+
}, Ze = function(t, e) {
|
|
1381
|
+
if (z(h.beforeSanitizeAttributes, t, null), ut(t, e)) return;
|
|
1382
|
+
const i = t.attributes;
|
|
1383
|
+
if (!i || Ft(t)) return;
|
|
1384
|
+
g = Xe(h.uponSanitizeAttribute, g, qt, Nt);
|
|
1385
|
+
const s = {
|
|
1375
1386
|
attrName: "",
|
|
1376
1387
|
attrValue: "",
|
|
1377
1388
|
keepAttr: !0,
|
|
1378
1389
|
allowedAttributes: g,
|
|
1379
1390
|
forceKeepAttr: void 0
|
|
1380
1391
|
};
|
|
1381
|
-
let
|
|
1382
|
-
const
|
|
1383
|
-
for (;
|
|
1384
|
-
const
|
|
1385
|
-
let
|
|
1386
|
-
if (
|
|
1387
|
-
K(
|
|
1392
|
+
let c = i.length;
|
|
1393
|
+
const f = A(t.nodeName);
|
|
1394
|
+
for (; c--; ) {
|
|
1395
|
+
const p = i[c], T = p.name, C = p.namespaceURI, D = p.value, ft = A(T), le = D;
|
|
1396
|
+
let O = T === "value" ? le : bo(le), Je = !1;
|
|
1397
|
+
if (s.attrName = ft, s.attrValue = O, s.keepAttr = !0, s.forceKeepAttr = void 0, z(h.uponSanitizeAttribute, t, s), O = s.attrValue, Ne && (ft === "id" || ft === "name") && an(O, Ce) !== 0 && (K(T, t, p), O = Ce + O, Je = !0), V && w(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, O)) {
|
|
1398
|
+
K(T, t, p);
|
|
1388
1399
|
continue;
|
|
1389
1400
|
}
|
|
1390
|
-
if (
|
|
1391
|
-
K(
|
|
1401
|
+
if (ft === "attributename" && sn(O, "href")) {
|
|
1402
|
+
K(T, t, p);
|
|
1392
1403
|
continue;
|
|
1393
1404
|
}
|
|
1394
|
-
if (!
|
|
1395
|
-
if (!
|
|
1396
|
-
K(
|
|
1405
|
+
if (!s.forceKeepAttr) {
|
|
1406
|
+
if (!s.keepAttr) {
|
|
1407
|
+
K(T, t, p);
|
|
1397
1408
|
continue;
|
|
1398
1409
|
}
|
|
1399
|
-
if (!
|
|
1400
|
-
K(
|
|
1410
|
+
if (!De && w(Go, O)) {
|
|
1411
|
+
K(T, t, p);
|
|
1401
1412
|
continue;
|
|
1402
1413
|
}
|
|
1403
|
-
if (H && (
|
|
1404
|
-
K(
|
|
1414
|
+
if (H && (O = Ut(O)), !qe(f, ft, O)) {
|
|
1415
|
+
K(T, t, p);
|
|
1405
1416
|
continue;
|
|
1406
1417
|
}
|
|
1407
|
-
|
|
1418
|
+
O = Jn(f, ft, C, O), O !== le && Qn(t, T, C, O) && Je && rn(n.removed);
|
|
1408
1419
|
}
|
|
1409
1420
|
}
|
|
1410
|
-
z(h.afterSanitizeAttributes, t, null);
|
|
1411
|
-
},
|
|
1421
|
+
z(h.afterSanitizeAttributes, t, null), ut(t, e);
|
|
1422
|
+
}, Gt = function(t) {
|
|
1412
1423
|
let e = null;
|
|
1413
|
-
const i =
|
|
1424
|
+
const i = $e(t);
|
|
1414
1425
|
for (z(h.beforeSanitizeShadowDOM, t, null); e = i.nextNode(); )
|
|
1415
|
-
if (z(h.uponSanitizeShadowNode, e, null),
|
|
1416
|
-
const
|
|
1417
|
-
|
|
1426
|
+
if (z(h.uponSanitizeShadowNode, e, null), Ve(e, t), Ze(e, t), ct(e.content) && Gt(e.content), _t(e) === v.element) {
|
|
1427
|
+
const s = Ae(e);
|
|
1428
|
+
ct(s) && (ae(s), Gt(s));
|
|
1418
1429
|
}
|
|
1419
1430
|
z(h.afterSanitizeShadowDOM, t, null);
|
|
1420
|
-
},
|
|
1431
|
+
}, ae = function(t) {
|
|
1421
1432
|
const e = [{
|
|
1422
1433
|
node: t,
|
|
1423
1434
|
shadow: null
|
|
@@ -1425,164 +1436,156 @@ function Tn() {
|
|
|
1425
1436
|
for (; e.length > 0; ) {
|
|
1426
1437
|
const i = e.pop();
|
|
1427
1438
|
if (i.shadow) {
|
|
1428
|
-
|
|
1439
|
+
Gt(i.shadow);
|
|
1429
1440
|
continue;
|
|
1430
1441
|
}
|
|
1431
|
-
const
|
|
1432
|
-
if (f) for (let
|
|
1433
|
-
node: f[
|
|
1442
|
+
const s = i.node, c = _t(s) === v.element, f = tt(s);
|
|
1443
|
+
if (f) for (let p = f.length - 1; p >= 0; --p) e.push({
|
|
1444
|
+
node: f[p],
|
|
1434
1445
|
shadow: null
|
|
1435
1446
|
});
|
|
1436
1447
|
if (c) {
|
|
1437
|
-
const
|
|
1438
|
-
if (typeof
|
|
1439
|
-
const
|
|
1440
|
-
|
|
1441
|
-
node:
|
|
1448
|
+
const p = nt ? nt(s) : null;
|
|
1449
|
+
if (typeof p == "string" && A(p) === "template") {
|
|
1450
|
+
const T = s.content;
|
|
1451
|
+
ct(T) && e.push({
|
|
1452
|
+
node: T,
|
|
1442
1453
|
shadow: null
|
|
1443
1454
|
});
|
|
1444
1455
|
}
|
|
1445
1456
|
}
|
|
1446
1457
|
if (c) {
|
|
1447
|
-
const
|
|
1448
|
-
|
|
1458
|
+
const p = Ae(s);
|
|
1459
|
+
ct(p) && e.push({
|
|
1449
1460
|
node: null,
|
|
1450
|
-
shadow:
|
|
1461
|
+
shadow: p
|
|
1451
1462
|
}, {
|
|
1452
|
-
node:
|
|
1463
|
+
node: p,
|
|
1453
1464
|
shadow: null
|
|
1454
1465
|
});
|
|
1455
1466
|
}
|
|
1456
1467
|
}
|
|
1457
1468
|
};
|
|
1458
|
-
return n.sanitize = function(
|
|
1459
|
-
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, e = null, i = null,
|
|
1460
|
-
if (
|
|
1461
|
-
throw
|
|
1462
|
-
if (!n.isSupported) return
|
|
1463
|
-
|
|
1464
|
-
const f =
|
|
1469
|
+
return n.sanitize = function(r) {
|
|
1470
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, e = null, i = null, s = null, c = null;
|
|
1471
|
+
if (ee = !r, ee && (r = "<!-->"), typeof r != "string" && !At(r) && (r = Lo(r), typeof r != "string"))
|
|
1472
|
+
throw W("dirty is not a string, aborting");
|
|
1473
|
+
if (!n.isSupported) return r;
|
|
1474
|
+
Zt ? (_ = vt, g = Nt) : re(t), (h.uponSanitizeElement.length > 0 || h.uponSanitizeAttribute.length > 0) && (_ = N(_)), h.uponSanitizeAttribute.length > 0 && (g = N(g)), n.removed = [];
|
|
1475
|
+
const f = te && typeof r != "string" && At(r);
|
|
1465
1476
|
if (f) {
|
|
1466
|
-
|
|
1467
|
-
const C =
|
|
1477
|
+
Vn(r);
|
|
1478
|
+
const C = jt(r);
|
|
1468
1479
|
if (typeof C == "string") {
|
|
1469
|
-
const
|
|
1470
|
-
if (!_[
|
|
1471
|
-
throw
|
|
1480
|
+
const D = A(C);
|
|
1481
|
+
if (!_[D] || Tt[D])
|
|
1482
|
+
throw zt(r), W("root node is forbidden and cannot be sanitized in-place");
|
|
1472
1483
|
}
|
|
1473
|
-
if (
|
|
1474
|
-
throw
|
|
1484
|
+
if (Ft(r))
|
|
1485
|
+
throw zt(r), W("root node is clobbered and cannot be sanitized in-place");
|
|
1475
1486
|
try {
|
|
1476
|
-
|
|
1477
|
-
} catch (
|
|
1478
|
-
throw
|
|
1487
|
+
ae(r);
|
|
1488
|
+
} catch (D) {
|
|
1489
|
+
throw zt(r), D;
|
|
1479
1490
|
}
|
|
1480
|
-
} else if (
|
|
1481
|
-
e =
|
|
1491
|
+
} else if (At(r))
|
|
1492
|
+
e = je("<!---->"), i = e.ownerDocument.importNode(r, !0), i.nodeType === v.element && i.nodeName === "BODY" || i.nodeName === "HTML" ? e = i : e.appendChild(i), ae(e);
|
|
1482
1493
|
else {
|
|
1483
|
-
if (!
|
|
1484
|
-
if (e =
|
|
1494
|
+
if (!it && !H && !q && r.indexOf("<") === -1) return R && Mt ? ot(r) : r;
|
|
1495
|
+
if (e = je(r), !e) return it ? null : Mt ? X : "";
|
|
1485
1496
|
}
|
|
1486
|
-
e &&
|
|
1487
|
-
const
|
|
1497
|
+
e && Jt && G(e.firstChild);
|
|
1498
|
+
const p = f ? r : e;
|
|
1488
1499
|
try {
|
|
1489
|
-
const C =
|
|
1490
|
-
for (;
|
|
1491
|
-
|
|
1500
|
+
const C = $e(p);
|
|
1501
|
+
for (; s = C.nextNode(); )
|
|
1502
|
+
Ve(s, p), Ze(s, p), ct(s.content) && Gt(s.content);
|
|
1492
1503
|
} catch (C) {
|
|
1493
|
-
throw f && (
|
|
1494
|
-
|
|
1504
|
+
throw f && (zt(r), Z(n.removed, (D) => {
|
|
1505
|
+
D.element && kt(D.element);
|
|
1495
1506
|
})), C;
|
|
1496
1507
|
}
|
|
1497
|
-
if (f)
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1508
|
+
if (f) {
|
|
1509
|
+
let C = !1;
|
|
1510
|
+
if (Z(n.removed, (D) => {
|
|
1511
|
+
D.element && (D.element === r && (C = !0), kt(D.element));
|
|
1512
|
+
}), C) throw W("a node selected for removal could not be safely returned; refusing to sanitize in place");
|
|
1513
|
+
return H && se(r), r;
|
|
1514
|
+
}
|
|
1515
|
+
if (it) {
|
|
1516
|
+
if (H && se(e), Ct)
|
|
1517
|
+
for (c = In.call(e.ownerDocument); e.firstChild; ) c.appendChild(e.firstChild);
|
|
1504
1518
|
else c = e;
|
|
1505
|
-
return (g.shadowroot || g.shadowrootmode) && (c =
|
|
1519
|
+
return (g.shadowroot || g.shadowrootmode) && (c = vn.call(l, c, !0)), c;
|
|
1506
1520
|
}
|
|
1507
|
-
let
|
|
1508
|
-
return q && _["!doctype"] && e.ownerDocument && e.ownerDocument.doctype && e.ownerDocument.doctype.name &&
|
|
1509
|
-
` +
|
|
1521
|
+
let T = q ? e.outerHTML : e.innerHTML;
|
|
1522
|
+
return q && _["!doctype"] && e.ownerDocument && e.ownerDocument.doctype && e.ownerDocument.doctype.name && w(Uo, e.ownerDocument.doctype.name) && (T = "<!DOCTYPE " + e.ownerDocument.doctype.name + `>
|
|
1523
|
+
` + T), H && (T = Ut(T)), R && Mt ? ot(T) : T;
|
|
1510
1524
|
}, n.setConfig = function() {
|
|
1511
|
-
let
|
|
1512
|
-
re(
|
|
1525
|
+
let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1526
|
+
re(r), Zt = !0, vt = _, Nt = g;
|
|
1513
1527
|
}, n.clearConfig = function() {
|
|
1514
|
-
|
|
1515
|
-
}, n.isValidAttribute = function(
|
|
1516
|
-
|
|
1517
|
-
const i =
|
|
1518
|
-
return
|
|
1519
|
-
}, n.addHook = function(
|
|
1520
|
-
typeof t == "function" && L(h,
|
|
1521
|
-
}, n.removeHook = function(
|
|
1522
|
-
if (L(h,
|
|
1528
|
+
lt = null, Zt = !1, vt = null, Nt = null, R = $t, X = "";
|
|
1529
|
+
}, n.isValidAttribute = function(r, t, e) {
|
|
1530
|
+
lt || re({});
|
|
1531
|
+
const i = A(r), s = A(t);
|
|
1532
|
+
return qe(i, s, e);
|
|
1533
|
+
}, n.addHook = function(r, t) {
|
|
1534
|
+
typeof t == "function" && L(h, r) && Et(h[r], t);
|
|
1535
|
+
}, n.removeHook = function(r, t) {
|
|
1536
|
+
if (L(h, r)) {
|
|
1523
1537
|
if (t !== void 0) {
|
|
1524
|
-
const e =
|
|
1525
|
-
return e === -1 ? void 0 :
|
|
1538
|
+
const e = Ao(h[r], t);
|
|
1539
|
+
return e === -1 ? void 0 : Eo(h[r], e, 1)[0];
|
|
1526
1540
|
}
|
|
1527
|
-
return
|
|
1541
|
+
return rn(h[r]);
|
|
1528
1542
|
}
|
|
1529
|
-
}, n.removeHooks = function(
|
|
1530
|
-
L(h,
|
|
1543
|
+
}, n.removeHooks = function(r) {
|
|
1544
|
+
L(h, r) && (h[r] = []);
|
|
1531
1545
|
}, n.removeAllHooks = function() {
|
|
1532
|
-
h =
|
|
1546
|
+
h = gn();
|
|
1533
1547
|
}, n;
|
|
1534
1548
|
}
|
|
1535
|
-
var
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
svgFilters: !0
|
|
1541
|
-
},
|
|
1549
|
+
var $o = bn();
|
|
1550
|
+
const Ot = /* @__PURE__ */ new Map(), Te = /* @__PURE__ */ new Map();
|
|
1551
|
+
function Sn(o, n) {
|
|
1552
|
+
const a = $o.sanitize(o, {
|
|
1553
|
+
USE_PROFILES: { svg: !0, svgFilters: !0 },
|
|
1542
1554
|
FORBID_TAGS: ["script", "use"],
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
]
|
|
1550
|
-
}), l = new DOMParser().parseFromString(s, "image/svg+xml").documentElement;
|
|
1551
|
-
if (!(l instanceof SVGElement)) throw new Error(`Invalid SVG from ${n}`);
|
|
1552
|
-
return l;
|
|
1553
|
-
}
|
|
1554
|
-
async function jr(r) {
|
|
1555
|
-
const n = await fetch(r);
|
|
1556
|
-
if (!n.ok) throw new Error(`Failed to load icon: ${n.status}`);
|
|
1557
|
-
return bn(await n.text(), r);
|
|
1555
|
+
// <use> can SSRF to external hrefs
|
|
1556
|
+
FORBID_ATTR: ["onload", "onerror", "onbegin", "href", "xlink:href"]
|
|
1557
|
+
}), d = new DOMParser().parseFromString(a, "image/svg+xml").documentElement;
|
|
1558
|
+
if (!(d instanceof SVGElement))
|
|
1559
|
+
throw new Error(`Invalid SVG from ${n}`);
|
|
1560
|
+
return d;
|
|
1558
1561
|
}
|
|
1559
|
-
async function
|
|
1560
|
-
|
|
1562
|
+
async function Xo(o) {
|
|
1563
|
+
const n = await fetch(o);
|
|
1564
|
+
if (!n.ok)
|
|
1565
|
+
throw new Error(`Failed to load icon: ${n.status}`);
|
|
1566
|
+
return Sn(await n.text(), o);
|
|
1561
1567
|
}
|
|
1562
|
-
function
|
|
1563
|
-
|
|
1564
|
-
return n || (n = bn(r, "inline SVG source"), _e.set(r, n)), n.cloneNode(!0);
|
|
1568
|
+
async function Tn(o) {
|
|
1569
|
+
return Ot.has(o) || Ot.set(o, Xo(o)), (await Ot.get(o)).cloneNode(!0);
|
|
1565
1570
|
}
|
|
1566
|
-
function
|
|
1567
|
-
|
|
1571
|
+
function Vo(o) {
|
|
1572
|
+
let n = Te.get(o);
|
|
1573
|
+
return n || (n = Sn(o, "inline SVG source"), Te.set(o, n)), n.cloneNode(!0);
|
|
1568
1574
|
}
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(r, n);
|
|
1575
|
+
function ni(o) {
|
|
1576
|
+
o ? Ot.delete(o) : (Ot.clear(), Te.clear());
|
|
1572
1577
|
}
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
return u
|
|
1578
|
-
}
|
|
1579
|
-
|
|
1580
|
-
constructor(
|
|
1581
|
-
super(...
|
|
1582
|
-
}
|
|
1583
|
-
static {
|
|
1584
|
-
this.styles = tr($r);
|
|
1578
|
+
const qo = ":host{display:inline-block;width:fit-content;height:fit-content;--_nys-icon-size: var( --nys-icon-size, .7em );box-sizing:content-box!important;vertical-align:middle}@supports (font-size: 1cap){:host{--_nys-icon-size: var(--nys-icon-size, 1cap)}}.nys-icon--svg{width:var(--_nys-icon-size, 1em);height:var(--_nys-icon-size, 1em);display:block;white-space:nowrap}.nys-icon--xs{width:calc(var(--_nys-icon-size) * .75);height:calc(var(--_nys-icon-size) * .75)}.nys-icon--sm{width:calc(var(--_nys-icon-size) * .875);height:calc(var(--_nys-icon-size) * .875)}.nys-icon--md{width:var(--_nys-icon-size);height:var(--_nys-icon-size)}.nys-icon--lg{width:calc(var(--_nys-icon-size) * 1.125);height:calc(var(--_nys-icon-size) * 1.125)}.nys-icon--xl{width:calc(var(--_nys-icon-size) * 1.25);height:calc(var(--_nys-icon-size) * 1.25)}.nys-icon--2xl{width:calc(var(--_nys-icon-size) * 1.5);height:calc(var(--_nys-icon-size) * 1.5)}.nys-icon--3xl{width:calc(var(--_nys-icon-size) * 1.875);height:calc(var(--_nys-icon-size) * 1.875)}.nys-icon--4xl{width:calc(var(--_nys-icon-size) * 2.25);height:calc(var(--_nys-icon-size) * 2.25)}.nys-icon--5xl{width:calc(var(--_nys-icon-size) * 3);height:calc(var(--_nys-icon-size) * 3)}.nys-icon--12{width:.75rem;height:.75rem}.nys-icon--14{width:.875rem;height:.875rem}.nys-icon--16{width:1rem;height:1rem}.nys-icon--18{width:1.125rem;height:1.125rem}.nys-icon--20{width:1.25rem;height:1.25rem}.nys-icon--24{width:1.5rem;height:1.5rem}.nys-icon--32{width:2rem;height:2rem}.nys-icon--40{width:2.5rem;height:2.5rem}.nys-icon--50{width:3.125rem;height:3.125rem}.nys-icon--flip-horizontal{transform:scaleX(-1)}.nys-icon--flip-vertical{transform:scaleY(-1)}.nys-icon--flip-both{transform:scale(-1)}";
|
|
1579
|
+
var Ko = Object.defineProperty, j = (o, n, a, l) => {
|
|
1580
|
+
for (var u = void 0, d = o.length - 1, y; d >= 0; d--)
|
|
1581
|
+
(y = o[d]) && (u = y(n, a, u) || u);
|
|
1582
|
+
return u && Ko(n, a, u), u;
|
|
1583
|
+
}, Y;
|
|
1584
|
+
const k = (Y = class extends ao {
|
|
1585
|
+
constructor() {
|
|
1586
|
+
super(...arguments), this.name = "", this.library = "default", this.ariaLabel = "", this.rotate = "0", this.flip = "", this.color = "", this.size = "md", this._svg = null, this._loadSeq = 0, this._loadPromise = null;
|
|
1585
1587
|
}
|
|
1588
|
+
/** Resolves when the current icon load (if any) is complete. */
|
|
1586
1589
|
get updateComplete() {
|
|
1587
1590
|
return (async () => {
|
|
1588
1591
|
const n = await super.updateComplete;
|
|
@@ -1590,29 +1593,34 @@ var U = class An extends or {
|
|
|
1590
1593
|
})();
|
|
1591
1594
|
}
|
|
1592
1595
|
connectedCallback() {
|
|
1593
|
-
super.connectedCallback(), this._reflectHostSemantics(),
|
|
1596
|
+
super.connectedCallback(), this._reflectHostSemantics(), tn(this.library, this);
|
|
1594
1597
|
}
|
|
1595
1598
|
disconnectedCallback() {
|
|
1596
|
-
super.disconnectedCallback(),
|
|
1599
|
+
super.disconnectedCallback(), en(this.library, this);
|
|
1597
1600
|
}
|
|
1601
|
+
/** Called by the icon library registry when the current library changes. */
|
|
1598
1602
|
redraw() {
|
|
1599
1603
|
this._loadIcon();
|
|
1600
1604
|
}
|
|
1605
|
+
/**
|
|
1606
|
+
* Lit calls firstUpdated after the first render, once all reactive
|
|
1607
|
+
* properties (including those set from the template) are resolved.
|
|
1608
|
+
* This guarantees the initial _loadIcon runs with the correct name
|
|
1609
|
+
* and library values, avoiding the race where updated() might not
|
|
1610
|
+
* fire for properties that equal their defaults.
|
|
1611
|
+
*/
|
|
1601
1612
|
firstUpdated() {
|
|
1602
1613
|
this._loadIcon();
|
|
1603
1614
|
}
|
|
1604
|
-
static {
|
|
1605
|
-
this._validName = /^[a-zA-Z0-9_-]+$/;
|
|
1606
|
-
}
|
|
1607
1615
|
updated(n) {
|
|
1608
|
-
if (n.has("name") && !
|
|
1616
|
+
if (n.has("name") && !Y._validName.test(this.name)) {
|
|
1609
1617
|
console.warn(`nys-icon: invalid name "${this.name}" — ignored`), this._svg = null;
|
|
1610
1618
|
return;
|
|
1611
1619
|
}
|
|
1612
1620
|
if (n.has("name") || n.has("library")) {
|
|
1613
1621
|
if (n.has("library")) {
|
|
1614
|
-
const
|
|
1615
|
-
|
|
1622
|
+
const a = n.get("library");
|
|
1623
|
+
a && en(a, this), tn(this.library, this);
|
|
1616
1624
|
}
|
|
1617
1625
|
this._loadIcon();
|
|
1618
1626
|
}
|
|
@@ -1621,21 +1629,21 @@ var U = class An extends or {
|
|
|
1621
1629
|
_loadIcon() {
|
|
1622
1630
|
const n = ++this._loadSeq;
|
|
1623
1631
|
this._loadPromise = (async () => {
|
|
1624
|
-
const
|
|
1625
|
-
if (!
|
|
1632
|
+
const a = uo(this.library);
|
|
1633
|
+
if (!a || !this.name) {
|
|
1626
1634
|
this._svg = null;
|
|
1627
1635
|
return;
|
|
1628
1636
|
}
|
|
1629
1637
|
try {
|
|
1630
|
-
const l = await
|
|
1638
|
+
const l = await a.resolver(this.name);
|
|
1631
1639
|
if (n !== this._loadSeq) return;
|
|
1632
1640
|
if (!l) {
|
|
1633
1641
|
this._svg = null;
|
|
1634
1642
|
return;
|
|
1635
1643
|
}
|
|
1636
|
-
const u = typeof l == "string" ? await
|
|
1644
|
+
const u = typeof l == "string" ? await Tn(l) : l.type === "url" ? await Tn(l.href) : Vo(l.content);
|
|
1637
1645
|
if (n !== this._loadSeq) return;
|
|
1638
|
-
|
|
1646
|
+
a.mutator?.(u), this._applyAttributes(u), this._svg = u;
|
|
1639
1647
|
} catch {
|
|
1640
1648
|
n === this._loadSeq && (this._svg = null);
|
|
1641
1649
|
}
|
|
@@ -1644,34 +1652,56 @@ var U = class An extends or {
|
|
|
1644
1652
|
_applyAttributes(n) {
|
|
1645
1653
|
n.setAttribute("role", "img"), this.ariaLabel ? (n.setAttribute("aria-label", this.ariaLabel), n.removeAttribute("aria-hidden")) : (n.setAttribute("aria-hidden", "true"), n.removeAttribute("aria-label")), this.rotate && this.rotate !== "0" ? n.style.rotate = `${this.rotate}deg` : n.style.removeProperty("rotate"), n.style.color = this.color || "currentcolor", n.classList.add(`nys-icon--${this.size}`), n.classList.add("nys-icon--svg"), this.flip && n.classList.add(`nys-icon--flip-${this.flip}`), this._reflectHostSemantics();
|
|
1646
1654
|
}
|
|
1655
|
+
/**
|
|
1656
|
+
* Reflects the icon's accessible state onto the host:
|
|
1657
|
+
* - Labeled icon -> role="img" + aria-label, no aria-hidden.
|
|
1658
|
+
* - Decorative -> aria-hidden="true", no role/label.
|
|
1659
|
+
*
|
|
1660
|
+
* These are reflected as host *attributes* (rather than via
|
|
1661
|
+
* ElementInternals) on purpose: aria-hidden / role / aria-label in
|
|
1662
|
+
* attribute form have universal, consistent assistive-technology support,
|
|
1663
|
+
* whereas AT support for these states set through ElementInternals is still
|
|
1664
|
+
* uneven across browser/screen-reader combinations. The host role/label
|
|
1665
|
+
* therefore depend on runtime state (ariaLabel), so defaultRole stays null.
|
|
1666
|
+
*/
|
|
1647
1667
|
_reflectHostSemantics() {
|
|
1648
1668
|
this.ariaLabel ? (this.setAttribute("role", "img"), this.setAttribute("aria-label", this.ariaLabel), this.removeAttribute("aria-hidden")) : (this.removeAttribute("role"), this.removeAttribute("aria-label"), this.setAttribute("aria-hidden", "true"));
|
|
1649
1669
|
}
|
|
1650
1670
|
render() {
|
|
1651
|
-
return this._svg ?
|
|
1671
|
+
return this._svg ? no`${this._svg}` : null;
|
|
1652
1672
|
}
|
|
1653
|
-
};
|
|
1654
|
-
j([
|
|
1655
|
-
type: String,
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
j([
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
j([
|
|
1667
|
-
|
|
1668
|
-
|
|
1673
|
+
}, Y.styles = eo(qo), Y._validName = /^[a-zA-Z0-9_-]+$/, Y);
|
|
1674
|
+
j([
|
|
1675
|
+
J({ type: String, reflect: !0 })
|
|
1676
|
+
], k.prototype, "name");
|
|
1677
|
+
j([
|
|
1678
|
+
J({ type: String, reflect: !0 })
|
|
1679
|
+
], k.prototype, "library");
|
|
1680
|
+
j([
|
|
1681
|
+
J({ type: String })
|
|
1682
|
+
], k.prototype, "ariaLabel");
|
|
1683
|
+
j([
|
|
1684
|
+
J({ type: String })
|
|
1685
|
+
], k.prototype, "rotate");
|
|
1686
|
+
j([
|
|
1687
|
+
J({ type: String })
|
|
1688
|
+
], k.prototype, "flip");
|
|
1689
|
+
j([
|
|
1690
|
+
J({ type: String })
|
|
1691
|
+
], k.prototype, "color");
|
|
1692
|
+
j([
|
|
1693
|
+
J({ type: String })
|
|
1694
|
+
], k.prototype, "size");
|
|
1695
|
+
j([
|
|
1696
|
+
oo()
|
|
1697
|
+
], k.prototype, "_svg");
|
|
1698
|
+
let Zo = k;
|
|
1699
|
+
customElements.get("nys-icon") || customElements.define("nys-icon", Zo);
|
|
1669
1700
|
export {
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1701
|
+
Zo as NysIcon,
|
|
1702
|
+
ni as clearIconCache,
|
|
1703
|
+
uo as getIconLibrary,
|
|
1704
|
+
ti as registerIconLibrary,
|
|
1705
|
+
ei as unregisterIconLibrary
|
|
1675
1706
|
};
|
|
1676
|
-
|
|
1677
|
-
//# sourceMappingURL=nys-icon.js.map
|
|
1707
|
+
//# sourceMappingURL=nys-icon.js.map
|