@vitejs/devtools 0.0.0-alpha.22 → 0.0.0-alpha.24
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/DockIcon-B3uZMhP_.js +1719 -0
- package/dist/ViewBuiltinLogs-FLr_sRZn.js +12 -0
- package/dist/ViewBuiltinTerminals-D-EWWPT5.js +10418 -0
- package/dist/{cli-commands-91HuPBSu.js → cli-commands-tTICAwZZ.js} +4 -3
- package/dist/cli-commands.js +2 -2
- package/dist/cli.js +2 -2
- package/dist/client/inject.js +3 -1
- package/dist/client/standalone/assets/ViewBuiltinLogs-CnVEaSMm.js +1 -0
- package/dist/client/standalone/assets/ViewBuiltinTerminals-x7geWavo.js +36 -0
- package/dist/client/standalone/assets/index-BQSrRIa9.css +1 -0
- package/dist/client/standalone/assets/index-BTGj0xT1.js +2 -0
- package/dist/client/standalone/index.html +3 -3
- package/dist/client/webcomponents.d.ts +1 -1
- package/dist/client/webcomponents.js +263 -7634
- package/dist/dirs.js +1 -1
- package/dist/dist-Ce2tZLIf.js +815 -0
- package/dist/docks-C4bgrO3z.js +71 -0
- package/dist/export-helper-Dw-qygE5.js +9 -0
- package/dist/{index-CLc-E8sF.d.ts → index-BYIZX1ss.d.ts} +6 -3
- package/dist/index.d.ts +8 -6
- package/dist/index.js +1 -1
- package/dist/{plugins-C1AF2q2c.js → plugins-Palbn5Oi.js} +139 -67
- package/dist/{docks-C4khS_Su.js → vue.runtime.esm-bundler-B98sE5ly.js} +479 -949
- package/package.json +15 -14
- package/dist/chunk-CwIu-FEx.js +0 -29
- package/dist/client/standalone/assets/index-DvusdnNm.js +0 -7
- package/dist/client/standalone/assets/index-bVBlMYV3.css +0 -1
- /package/dist/{dirs-BJIz1OY5.js → dirs-C0s1Ghvy.js} +0 -0
|
@@ -0,0 +1,1719 @@
|
|
|
1
|
+
import { E as watchEffect, F as ref, c as createBlock, d as createStaticVNode, f as createVNode, i as Fragment, m as defineComponent, o as computed, u as createElementBlock, x as openBlock } from "./vue.runtime.esm-bundler-B98sE5ly.js";
|
|
2
|
+
import { t as export_helper_default } from "./export-helper-Dw-qygE5.js";
|
|
3
|
+
|
|
4
|
+
//#region ../../node_modules/.pnpm/dompurify@3.3.1/node_modules/dompurify/dist/purify.es.mjs
|
|
5
|
+
/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */
|
|
6
|
+
const { entries, setPrototypeOf, isFrozen, getPrototypeOf, getOwnPropertyDescriptor } = Object;
|
|
7
|
+
let { freeze, seal, create } = Object;
|
|
8
|
+
let { apply, construct } = typeof Reflect !== "undefined" && Reflect;
|
|
9
|
+
if (!freeze) freeze = function freeze$1(x) {
|
|
10
|
+
return x;
|
|
11
|
+
};
|
|
12
|
+
if (!seal) seal = function seal$1(x) {
|
|
13
|
+
return x;
|
|
14
|
+
};
|
|
15
|
+
if (!apply) apply = function apply$1(func, thisArg) {
|
|
16
|
+
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) args[_key - 2] = arguments[_key];
|
|
17
|
+
return func.apply(thisArg, args);
|
|
18
|
+
};
|
|
19
|
+
if (!construct) construct = function construct$1(Func) {
|
|
20
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) args[_key2 - 1] = arguments[_key2];
|
|
21
|
+
return new Func(...args);
|
|
22
|
+
};
|
|
23
|
+
const arrayForEach = unapply(Array.prototype.forEach);
|
|
24
|
+
const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
|
|
25
|
+
const arrayPop = unapply(Array.prototype.pop);
|
|
26
|
+
const arrayPush = unapply(Array.prototype.push);
|
|
27
|
+
const arraySplice = unapply(Array.prototype.splice);
|
|
28
|
+
const stringToLowerCase = unapply(String.prototype.toLowerCase);
|
|
29
|
+
const stringToString = unapply(String.prototype.toString);
|
|
30
|
+
const stringMatch = unapply(String.prototype.match);
|
|
31
|
+
const stringReplace = unapply(String.prototype.replace);
|
|
32
|
+
const stringIndexOf = unapply(String.prototype.indexOf);
|
|
33
|
+
const stringTrim = unapply(String.prototype.trim);
|
|
34
|
+
const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
|
|
35
|
+
const regExpTest = unapply(RegExp.prototype.test);
|
|
36
|
+
const typeErrorCreate = unconstruct(TypeError);
|
|
37
|
+
/**
|
|
38
|
+
* Creates a new function that calls the given function with a specified thisArg and arguments.
|
|
39
|
+
*
|
|
40
|
+
* @param func - The function to be wrapped and called.
|
|
41
|
+
* @returns A new function that calls the given function with a specified thisArg and arguments.
|
|
42
|
+
*/
|
|
43
|
+
function unapply(func) {
|
|
44
|
+
return function(thisArg) {
|
|
45
|
+
if (thisArg instanceof RegExp) thisArg.lastIndex = 0;
|
|
46
|
+
for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) args[_key3 - 1] = arguments[_key3];
|
|
47
|
+
return apply(func, thisArg, args);
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Creates a new function that constructs an instance of the given constructor function with the provided arguments.
|
|
52
|
+
*
|
|
53
|
+
* @param func - The constructor function to be wrapped and called.
|
|
54
|
+
* @returns A new function that constructs an instance of the given constructor function with the provided arguments.
|
|
55
|
+
*/
|
|
56
|
+
function unconstruct(Func) {
|
|
57
|
+
return function() {
|
|
58
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) args[_key4] = arguments[_key4];
|
|
59
|
+
return construct(Func, args);
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Add properties to a lookup table
|
|
64
|
+
*
|
|
65
|
+
* @param set - The set to which elements will be added.
|
|
66
|
+
* @param array - The array containing elements to be added to the set.
|
|
67
|
+
* @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.
|
|
68
|
+
* @returns The modified set with added elements.
|
|
69
|
+
*/
|
|
70
|
+
function addToSet(set, array) {
|
|
71
|
+
let transformCaseFunc = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : stringToLowerCase;
|
|
72
|
+
if (setPrototypeOf) setPrototypeOf(set, null);
|
|
73
|
+
let l = array.length;
|
|
74
|
+
while (l--) {
|
|
75
|
+
let element = array[l];
|
|
76
|
+
if (typeof element === "string") {
|
|
77
|
+
const lcElement = transformCaseFunc(element);
|
|
78
|
+
if (lcElement !== element) {
|
|
79
|
+
if (!isFrozen(array)) array[l] = lcElement;
|
|
80
|
+
element = lcElement;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
set[element] = true;
|
|
84
|
+
}
|
|
85
|
+
return set;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Clean up an array to harden against CSPP
|
|
89
|
+
*
|
|
90
|
+
* @param array - The array to be cleaned.
|
|
91
|
+
* @returns The cleaned version of the array
|
|
92
|
+
*/
|
|
93
|
+
function cleanArray(array) {
|
|
94
|
+
for (let index = 0; index < array.length; index++) if (!objectHasOwnProperty(array, index)) array[index] = null;
|
|
95
|
+
return array;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Shallow clone an object
|
|
99
|
+
*
|
|
100
|
+
* @param object - The object to be cloned.
|
|
101
|
+
* @returns A new object that copies the original.
|
|
102
|
+
*/
|
|
103
|
+
function clone(object) {
|
|
104
|
+
const newObject = create(null);
|
|
105
|
+
for (const [property, value] of entries(object)) if (objectHasOwnProperty(object, property)) if (Array.isArray(value)) newObject[property] = cleanArray(value);
|
|
106
|
+
else if (value && typeof value === "object" && value.constructor === Object) newObject[property] = clone(value);
|
|
107
|
+
else newObject[property] = value;
|
|
108
|
+
return newObject;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* This method automatically checks if the prop is function or getter and behaves accordingly.
|
|
112
|
+
*
|
|
113
|
+
* @param object - The object to look up the getter function in its prototype chain.
|
|
114
|
+
* @param prop - The property name for which to find the getter function.
|
|
115
|
+
* @returns The getter function found in the prototype chain or a fallback function.
|
|
116
|
+
*/
|
|
117
|
+
function lookupGetter(object, prop) {
|
|
118
|
+
while (object !== null) {
|
|
119
|
+
const desc = getOwnPropertyDescriptor(object, prop);
|
|
120
|
+
if (desc) {
|
|
121
|
+
if (desc.get) return unapply(desc.get);
|
|
122
|
+
if (typeof desc.value === "function") return unapply(desc.value);
|
|
123
|
+
}
|
|
124
|
+
object = getPrototypeOf(object);
|
|
125
|
+
}
|
|
126
|
+
function fallbackValue() {
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
return fallbackValue;
|
|
130
|
+
}
|
|
131
|
+
const html$1 = freeze([
|
|
132
|
+
"a",
|
|
133
|
+
"abbr",
|
|
134
|
+
"acronym",
|
|
135
|
+
"address",
|
|
136
|
+
"area",
|
|
137
|
+
"article",
|
|
138
|
+
"aside",
|
|
139
|
+
"audio",
|
|
140
|
+
"b",
|
|
141
|
+
"bdi",
|
|
142
|
+
"bdo",
|
|
143
|
+
"big",
|
|
144
|
+
"blink",
|
|
145
|
+
"blockquote",
|
|
146
|
+
"body",
|
|
147
|
+
"br",
|
|
148
|
+
"button",
|
|
149
|
+
"canvas",
|
|
150
|
+
"caption",
|
|
151
|
+
"center",
|
|
152
|
+
"cite",
|
|
153
|
+
"code",
|
|
154
|
+
"col",
|
|
155
|
+
"colgroup",
|
|
156
|
+
"content",
|
|
157
|
+
"data",
|
|
158
|
+
"datalist",
|
|
159
|
+
"dd",
|
|
160
|
+
"decorator",
|
|
161
|
+
"del",
|
|
162
|
+
"details",
|
|
163
|
+
"dfn",
|
|
164
|
+
"dialog",
|
|
165
|
+
"dir",
|
|
166
|
+
"div",
|
|
167
|
+
"dl",
|
|
168
|
+
"dt",
|
|
169
|
+
"element",
|
|
170
|
+
"em",
|
|
171
|
+
"fieldset",
|
|
172
|
+
"figcaption",
|
|
173
|
+
"figure",
|
|
174
|
+
"font",
|
|
175
|
+
"footer",
|
|
176
|
+
"form",
|
|
177
|
+
"h1",
|
|
178
|
+
"h2",
|
|
179
|
+
"h3",
|
|
180
|
+
"h4",
|
|
181
|
+
"h5",
|
|
182
|
+
"h6",
|
|
183
|
+
"head",
|
|
184
|
+
"header",
|
|
185
|
+
"hgroup",
|
|
186
|
+
"hr",
|
|
187
|
+
"html",
|
|
188
|
+
"i",
|
|
189
|
+
"img",
|
|
190
|
+
"input",
|
|
191
|
+
"ins",
|
|
192
|
+
"kbd",
|
|
193
|
+
"label",
|
|
194
|
+
"legend",
|
|
195
|
+
"li",
|
|
196
|
+
"main",
|
|
197
|
+
"map",
|
|
198
|
+
"mark",
|
|
199
|
+
"marquee",
|
|
200
|
+
"menu",
|
|
201
|
+
"menuitem",
|
|
202
|
+
"meter",
|
|
203
|
+
"nav",
|
|
204
|
+
"nobr",
|
|
205
|
+
"ol",
|
|
206
|
+
"optgroup",
|
|
207
|
+
"option",
|
|
208
|
+
"output",
|
|
209
|
+
"p",
|
|
210
|
+
"picture",
|
|
211
|
+
"pre",
|
|
212
|
+
"progress",
|
|
213
|
+
"q",
|
|
214
|
+
"rp",
|
|
215
|
+
"rt",
|
|
216
|
+
"ruby",
|
|
217
|
+
"s",
|
|
218
|
+
"samp",
|
|
219
|
+
"search",
|
|
220
|
+
"section",
|
|
221
|
+
"select",
|
|
222
|
+
"shadow",
|
|
223
|
+
"slot",
|
|
224
|
+
"small",
|
|
225
|
+
"source",
|
|
226
|
+
"spacer",
|
|
227
|
+
"span",
|
|
228
|
+
"strike",
|
|
229
|
+
"strong",
|
|
230
|
+
"style",
|
|
231
|
+
"sub",
|
|
232
|
+
"summary",
|
|
233
|
+
"sup",
|
|
234
|
+
"table",
|
|
235
|
+
"tbody",
|
|
236
|
+
"td",
|
|
237
|
+
"template",
|
|
238
|
+
"textarea",
|
|
239
|
+
"tfoot",
|
|
240
|
+
"th",
|
|
241
|
+
"thead",
|
|
242
|
+
"time",
|
|
243
|
+
"tr",
|
|
244
|
+
"track",
|
|
245
|
+
"tt",
|
|
246
|
+
"u",
|
|
247
|
+
"ul",
|
|
248
|
+
"var",
|
|
249
|
+
"video",
|
|
250
|
+
"wbr"
|
|
251
|
+
]);
|
|
252
|
+
const svg$1 = freeze([
|
|
253
|
+
"svg",
|
|
254
|
+
"a",
|
|
255
|
+
"altglyph",
|
|
256
|
+
"altglyphdef",
|
|
257
|
+
"altglyphitem",
|
|
258
|
+
"animatecolor",
|
|
259
|
+
"animatemotion",
|
|
260
|
+
"animatetransform",
|
|
261
|
+
"circle",
|
|
262
|
+
"clippath",
|
|
263
|
+
"defs",
|
|
264
|
+
"desc",
|
|
265
|
+
"ellipse",
|
|
266
|
+
"enterkeyhint",
|
|
267
|
+
"exportparts",
|
|
268
|
+
"filter",
|
|
269
|
+
"font",
|
|
270
|
+
"g",
|
|
271
|
+
"glyph",
|
|
272
|
+
"glyphref",
|
|
273
|
+
"hkern",
|
|
274
|
+
"image",
|
|
275
|
+
"inputmode",
|
|
276
|
+
"line",
|
|
277
|
+
"lineargradient",
|
|
278
|
+
"marker",
|
|
279
|
+
"mask",
|
|
280
|
+
"metadata",
|
|
281
|
+
"mpath",
|
|
282
|
+
"part",
|
|
283
|
+
"path",
|
|
284
|
+
"pattern",
|
|
285
|
+
"polygon",
|
|
286
|
+
"polyline",
|
|
287
|
+
"radialgradient",
|
|
288
|
+
"rect",
|
|
289
|
+
"stop",
|
|
290
|
+
"style",
|
|
291
|
+
"switch",
|
|
292
|
+
"symbol",
|
|
293
|
+
"text",
|
|
294
|
+
"textpath",
|
|
295
|
+
"title",
|
|
296
|
+
"tref",
|
|
297
|
+
"tspan",
|
|
298
|
+
"view",
|
|
299
|
+
"vkern"
|
|
300
|
+
]);
|
|
301
|
+
const svgFilters = freeze([
|
|
302
|
+
"feBlend",
|
|
303
|
+
"feColorMatrix",
|
|
304
|
+
"feComponentTransfer",
|
|
305
|
+
"feComposite",
|
|
306
|
+
"feConvolveMatrix",
|
|
307
|
+
"feDiffuseLighting",
|
|
308
|
+
"feDisplacementMap",
|
|
309
|
+
"feDistantLight",
|
|
310
|
+
"feDropShadow",
|
|
311
|
+
"feFlood",
|
|
312
|
+
"feFuncA",
|
|
313
|
+
"feFuncB",
|
|
314
|
+
"feFuncG",
|
|
315
|
+
"feFuncR",
|
|
316
|
+
"feGaussianBlur",
|
|
317
|
+
"feImage",
|
|
318
|
+
"feMerge",
|
|
319
|
+
"feMergeNode",
|
|
320
|
+
"feMorphology",
|
|
321
|
+
"feOffset",
|
|
322
|
+
"fePointLight",
|
|
323
|
+
"feSpecularLighting",
|
|
324
|
+
"feSpotLight",
|
|
325
|
+
"feTile",
|
|
326
|
+
"feTurbulence"
|
|
327
|
+
]);
|
|
328
|
+
const svgDisallowed = freeze([
|
|
329
|
+
"animate",
|
|
330
|
+
"color-profile",
|
|
331
|
+
"cursor",
|
|
332
|
+
"discard",
|
|
333
|
+
"font-face",
|
|
334
|
+
"font-face-format",
|
|
335
|
+
"font-face-name",
|
|
336
|
+
"font-face-src",
|
|
337
|
+
"font-face-uri",
|
|
338
|
+
"foreignobject",
|
|
339
|
+
"hatch",
|
|
340
|
+
"hatchpath",
|
|
341
|
+
"mesh",
|
|
342
|
+
"meshgradient",
|
|
343
|
+
"meshpatch",
|
|
344
|
+
"meshrow",
|
|
345
|
+
"missing-glyph",
|
|
346
|
+
"script",
|
|
347
|
+
"set",
|
|
348
|
+
"solidcolor",
|
|
349
|
+
"unknown",
|
|
350
|
+
"use"
|
|
351
|
+
]);
|
|
352
|
+
const mathMl$1 = freeze([
|
|
353
|
+
"math",
|
|
354
|
+
"menclose",
|
|
355
|
+
"merror",
|
|
356
|
+
"mfenced",
|
|
357
|
+
"mfrac",
|
|
358
|
+
"mglyph",
|
|
359
|
+
"mi",
|
|
360
|
+
"mlabeledtr",
|
|
361
|
+
"mmultiscripts",
|
|
362
|
+
"mn",
|
|
363
|
+
"mo",
|
|
364
|
+
"mover",
|
|
365
|
+
"mpadded",
|
|
366
|
+
"mphantom",
|
|
367
|
+
"mroot",
|
|
368
|
+
"mrow",
|
|
369
|
+
"ms",
|
|
370
|
+
"mspace",
|
|
371
|
+
"msqrt",
|
|
372
|
+
"mstyle",
|
|
373
|
+
"msub",
|
|
374
|
+
"msup",
|
|
375
|
+
"msubsup",
|
|
376
|
+
"mtable",
|
|
377
|
+
"mtd",
|
|
378
|
+
"mtext",
|
|
379
|
+
"mtr",
|
|
380
|
+
"munder",
|
|
381
|
+
"munderover",
|
|
382
|
+
"mprescripts"
|
|
383
|
+
]);
|
|
384
|
+
const mathMlDisallowed = freeze([
|
|
385
|
+
"maction",
|
|
386
|
+
"maligngroup",
|
|
387
|
+
"malignmark",
|
|
388
|
+
"mlongdiv",
|
|
389
|
+
"mscarries",
|
|
390
|
+
"mscarry",
|
|
391
|
+
"msgroup",
|
|
392
|
+
"mstack",
|
|
393
|
+
"msline",
|
|
394
|
+
"msrow",
|
|
395
|
+
"semantics",
|
|
396
|
+
"annotation",
|
|
397
|
+
"annotation-xml",
|
|
398
|
+
"mprescripts",
|
|
399
|
+
"none"
|
|
400
|
+
]);
|
|
401
|
+
const text = freeze(["#text"]);
|
|
402
|
+
const html = freeze([
|
|
403
|
+
"accept",
|
|
404
|
+
"action",
|
|
405
|
+
"align",
|
|
406
|
+
"alt",
|
|
407
|
+
"autocapitalize",
|
|
408
|
+
"autocomplete",
|
|
409
|
+
"autopictureinpicture",
|
|
410
|
+
"autoplay",
|
|
411
|
+
"background",
|
|
412
|
+
"bgcolor",
|
|
413
|
+
"border",
|
|
414
|
+
"capture",
|
|
415
|
+
"cellpadding",
|
|
416
|
+
"cellspacing",
|
|
417
|
+
"checked",
|
|
418
|
+
"cite",
|
|
419
|
+
"class",
|
|
420
|
+
"clear",
|
|
421
|
+
"color",
|
|
422
|
+
"cols",
|
|
423
|
+
"colspan",
|
|
424
|
+
"controls",
|
|
425
|
+
"controlslist",
|
|
426
|
+
"coords",
|
|
427
|
+
"crossorigin",
|
|
428
|
+
"datetime",
|
|
429
|
+
"decoding",
|
|
430
|
+
"default",
|
|
431
|
+
"dir",
|
|
432
|
+
"disabled",
|
|
433
|
+
"disablepictureinpicture",
|
|
434
|
+
"disableremoteplayback",
|
|
435
|
+
"download",
|
|
436
|
+
"draggable",
|
|
437
|
+
"enctype",
|
|
438
|
+
"enterkeyhint",
|
|
439
|
+
"exportparts",
|
|
440
|
+
"face",
|
|
441
|
+
"for",
|
|
442
|
+
"headers",
|
|
443
|
+
"height",
|
|
444
|
+
"hidden",
|
|
445
|
+
"high",
|
|
446
|
+
"href",
|
|
447
|
+
"hreflang",
|
|
448
|
+
"id",
|
|
449
|
+
"inert",
|
|
450
|
+
"inputmode",
|
|
451
|
+
"integrity",
|
|
452
|
+
"ismap",
|
|
453
|
+
"kind",
|
|
454
|
+
"label",
|
|
455
|
+
"lang",
|
|
456
|
+
"list",
|
|
457
|
+
"loading",
|
|
458
|
+
"loop",
|
|
459
|
+
"low",
|
|
460
|
+
"max",
|
|
461
|
+
"maxlength",
|
|
462
|
+
"media",
|
|
463
|
+
"method",
|
|
464
|
+
"min",
|
|
465
|
+
"minlength",
|
|
466
|
+
"multiple",
|
|
467
|
+
"muted",
|
|
468
|
+
"name",
|
|
469
|
+
"nonce",
|
|
470
|
+
"noshade",
|
|
471
|
+
"novalidate",
|
|
472
|
+
"nowrap",
|
|
473
|
+
"open",
|
|
474
|
+
"optimum",
|
|
475
|
+
"part",
|
|
476
|
+
"pattern",
|
|
477
|
+
"placeholder",
|
|
478
|
+
"playsinline",
|
|
479
|
+
"popover",
|
|
480
|
+
"popovertarget",
|
|
481
|
+
"popovertargetaction",
|
|
482
|
+
"poster",
|
|
483
|
+
"preload",
|
|
484
|
+
"pubdate",
|
|
485
|
+
"radiogroup",
|
|
486
|
+
"readonly",
|
|
487
|
+
"rel",
|
|
488
|
+
"required",
|
|
489
|
+
"rev",
|
|
490
|
+
"reversed",
|
|
491
|
+
"role",
|
|
492
|
+
"rows",
|
|
493
|
+
"rowspan",
|
|
494
|
+
"spellcheck",
|
|
495
|
+
"scope",
|
|
496
|
+
"selected",
|
|
497
|
+
"shape",
|
|
498
|
+
"size",
|
|
499
|
+
"sizes",
|
|
500
|
+
"slot",
|
|
501
|
+
"span",
|
|
502
|
+
"srclang",
|
|
503
|
+
"start",
|
|
504
|
+
"src",
|
|
505
|
+
"srcset",
|
|
506
|
+
"step",
|
|
507
|
+
"style",
|
|
508
|
+
"summary",
|
|
509
|
+
"tabindex",
|
|
510
|
+
"title",
|
|
511
|
+
"translate",
|
|
512
|
+
"type",
|
|
513
|
+
"usemap",
|
|
514
|
+
"valign",
|
|
515
|
+
"value",
|
|
516
|
+
"width",
|
|
517
|
+
"wrap",
|
|
518
|
+
"xmlns",
|
|
519
|
+
"slot"
|
|
520
|
+
]);
|
|
521
|
+
const svg = freeze([
|
|
522
|
+
"accent-height",
|
|
523
|
+
"accumulate",
|
|
524
|
+
"additive",
|
|
525
|
+
"alignment-baseline",
|
|
526
|
+
"amplitude",
|
|
527
|
+
"ascent",
|
|
528
|
+
"attributename",
|
|
529
|
+
"attributetype",
|
|
530
|
+
"azimuth",
|
|
531
|
+
"basefrequency",
|
|
532
|
+
"baseline-shift",
|
|
533
|
+
"begin",
|
|
534
|
+
"bias",
|
|
535
|
+
"by",
|
|
536
|
+
"class",
|
|
537
|
+
"clip",
|
|
538
|
+
"clippathunits",
|
|
539
|
+
"clip-path",
|
|
540
|
+
"clip-rule",
|
|
541
|
+
"color",
|
|
542
|
+
"color-interpolation",
|
|
543
|
+
"color-interpolation-filters",
|
|
544
|
+
"color-profile",
|
|
545
|
+
"color-rendering",
|
|
546
|
+
"cx",
|
|
547
|
+
"cy",
|
|
548
|
+
"d",
|
|
549
|
+
"dx",
|
|
550
|
+
"dy",
|
|
551
|
+
"diffuseconstant",
|
|
552
|
+
"direction",
|
|
553
|
+
"display",
|
|
554
|
+
"divisor",
|
|
555
|
+
"dur",
|
|
556
|
+
"edgemode",
|
|
557
|
+
"elevation",
|
|
558
|
+
"end",
|
|
559
|
+
"exponent",
|
|
560
|
+
"fill",
|
|
561
|
+
"fill-opacity",
|
|
562
|
+
"fill-rule",
|
|
563
|
+
"filter",
|
|
564
|
+
"filterunits",
|
|
565
|
+
"flood-color",
|
|
566
|
+
"flood-opacity",
|
|
567
|
+
"font-family",
|
|
568
|
+
"font-size",
|
|
569
|
+
"font-size-adjust",
|
|
570
|
+
"font-stretch",
|
|
571
|
+
"font-style",
|
|
572
|
+
"font-variant",
|
|
573
|
+
"font-weight",
|
|
574
|
+
"fx",
|
|
575
|
+
"fy",
|
|
576
|
+
"g1",
|
|
577
|
+
"g2",
|
|
578
|
+
"glyph-name",
|
|
579
|
+
"glyphref",
|
|
580
|
+
"gradientunits",
|
|
581
|
+
"gradienttransform",
|
|
582
|
+
"height",
|
|
583
|
+
"href",
|
|
584
|
+
"id",
|
|
585
|
+
"image-rendering",
|
|
586
|
+
"in",
|
|
587
|
+
"in2",
|
|
588
|
+
"intercept",
|
|
589
|
+
"k",
|
|
590
|
+
"k1",
|
|
591
|
+
"k2",
|
|
592
|
+
"k3",
|
|
593
|
+
"k4",
|
|
594
|
+
"kerning",
|
|
595
|
+
"keypoints",
|
|
596
|
+
"keysplines",
|
|
597
|
+
"keytimes",
|
|
598
|
+
"lang",
|
|
599
|
+
"lengthadjust",
|
|
600
|
+
"letter-spacing",
|
|
601
|
+
"kernelmatrix",
|
|
602
|
+
"kernelunitlength",
|
|
603
|
+
"lighting-color",
|
|
604
|
+
"local",
|
|
605
|
+
"marker-end",
|
|
606
|
+
"marker-mid",
|
|
607
|
+
"marker-start",
|
|
608
|
+
"markerheight",
|
|
609
|
+
"markerunits",
|
|
610
|
+
"markerwidth",
|
|
611
|
+
"maskcontentunits",
|
|
612
|
+
"maskunits",
|
|
613
|
+
"max",
|
|
614
|
+
"mask",
|
|
615
|
+
"mask-type",
|
|
616
|
+
"media",
|
|
617
|
+
"method",
|
|
618
|
+
"mode",
|
|
619
|
+
"min",
|
|
620
|
+
"name",
|
|
621
|
+
"numoctaves",
|
|
622
|
+
"offset",
|
|
623
|
+
"operator",
|
|
624
|
+
"opacity",
|
|
625
|
+
"order",
|
|
626
|
+
"orient",
|
|
627
|
+
"orientation",
|
|
628
|
+
"origin",
|
|
629
|
+
"overflow",
|
|
630
|
+
"paint-order",
|
|
631
|
+
"path",
|
|
632
|
+
"pathlength",
|
|
633
|
+
"patterncontentunits",
|
|
634
|
+
"patterntransform",
|
|
635
|
+
"patternunits",
|
|
636
|
+
"points",
|
|
637
|
+
"preservealpha",
|
|
638
|
+
"preserveaspectratio",
|
|
639
|
+
"primitiveunits",
|
|
640
|
+
"r",
|
|
641
|
+
"rx",
|
|
642
|
+
"ry",
|
|
643
|
+
"radius",
|
|
644
|
+
"refx",
|
|
645
|
+
"refy",
|
|
646
|
+
"repeatcount",
|
|
647
|
+
"repeatdur",
|
|
648
|
+
"restart",
|
|
649
|
+
"result",
|
|
650
|
+
"rotate",
|
|
651
|
+
"scale",
|
|
652
|
+
"seed",
|
|
653
|
+
"shape-rendering",
|
|
654
|
+
"slope",
|
|
655
|
+
"specularconstant",
|
|
656
|
+
"specularexponent",
|
|
657
|
+
"spreadmethod",
|
|
658
|
+
"startoffset",
|
|
659
|
+
"stddeviation",
|
|
660
|
+
"stitchtiles",
|
|
661
|
+
"stop-color",
|
|
662
|
+
"stop-opacity",
|
|
663
|
+
"stroke-dasharray",
|
|
664
|
+
"stroke-dashoffset",
|
|
665
|
+
"stroke-linecap",
|
|
666
|
+
"stroke-linejoin",
|
|
667
|
+
"stroke-miterlimit",
|
|
668
|
+
"stroke-opacity",
|
|
669
|
+
"stroke",
|
|
670
|
+
"stroke-width",
|
|
671
|
+
"style",
|
|
672
|
+
"surfacescale",
|
|
673
|
+
"systemlanguage",
|
|
674
|
+
"tabindex",
|
|
675
|
+
"tablevalues",
|
|
676
|
+
"targetx",
|
|
677
|
+
"targety",
|
|
678
|
+
"transform",
|
|
679
|
+
"transform-origin",
|
|
680
|
+
"text-anchor",
|
|
681
|
+
"text-decoration",
|
|
682
|
+
"text-rendering",
|
|
683
|
+
"textlength",
|
|
684
|
+
"type",
|
|
685
|
+
"u1",
|
|
686
|
+
"u2",
|
|
687
|
+
"unicode",
|
|
688
|
+
"values",
|
|
689
|
+
"viewbox",
|
|
690
|
+
"visibility",
|
|
691
|
+
"version",
|
|
692
|
+
"vert-adv-y",
|
|
693
|
+
"vert-origin-x",
|
|
694
|
+
"vert-origin-y",
|
|
695
|
+
"width",
|
|
696
|
+
"word-spacing",
|
|
697
|
+
"wrap",
|
|
698
|
+
"writing-mode",
|
|
699
|
+
"xchannelselector",
|
|
700
|
+
"ychannelselector",
|
|
701
|
+
"x",
|
|
702
|
+
"x1",
|
|
703
|
+
"x2",
|
|
704
|
+
"xmlns",
|
|
705
|
+
"y",
|
|
706
|
+
"y1",
|
|
707
|
+
"y2",
|
|
708
|
+
"z",
|
|
709
|
+
"zoomandpan"
|
|
710
|
+
]);
|
|
711
|
+
const mathMl = freeze([
|
|
712
|
+
"accent",
|
|
713
|
+
"accentunder",
|
|
714
|
+
"align",
|
|
715
|
+
"bevelled",
|
|
716
|
+
"close",
|
|
717
|
+
"columnsalign",
|
|
718
|
+
"columnlines",
|
|
719
|
+
"columnspan",
|
|
720
|
+
"denomalign",
|
|
721
|
+
"depth",
|
|
722
|
+
"dir",
|
|
723
|
+
"display",
|
|
724
|
+
"displaystyle",
|
|
725
|
+
"encoding",
|
|
726
|
+
"fence",
|
|
727
|
+
"frame",
|
|
728
|
+
"height",
|
|
729
|
+
"href",
|
|
730
|
+
"id",
|
|
731
|
+
"largeop",
|
|
732
|
+
"length",
|
|
733
|
+
"linethickness",
|
|
734
|
+
"lspace",
|
|
735
|
+
"lquote",
|
|
736
|
+
"mathbackground",
|
|
737
|
+
"mathcolor",
|
|
738
|
+
"mathsize",
|
|
739
|
+
"mathvariant",
|
|
740
|
+
"maxsize",
|
|
741
|
+
"minsize",
|
|
742
|
+
"movablelimits",
|
|
743
|
+
"notation",
|
|
744
|
+
"numalign",
|
|
745
|
+
"open",
|
|
746
|
+
"rowalign",
|
|
747
|
+
"rowlines",
|
|
748
|
+
"rowspacing",
|
|
749
|
+
"rowspan",
|
|
750
|
+
"rspace",
|
|
751
|
+
"rquote",
|
|
752
|
+
"scriptlevel",
|
|
753
|
+
"scriptminsize",
|
|
754
|
+
"scriptsizemultiplier",
|
|
755
|
+
"selection",
|
|
756
|
+
"separator",
|
|
757
|
+
"separators",
|
|
758
|
+
"stretchy",
|
|
759
|
+
"subscriptshift",
|
|
760
|
+
"supscriptshift",
|
|
761
|
+
"symmetric",
|
|
762
|
+
"voffset",
|
|
763
|
+
"width",
|
|
764
|
+
"xmlns"
|
|
765
|
+
]);
|
|
766
|
+
const xml = freeze([
|
|
767
|
+
"xlink:href",
|
|
768
|
+
"xml:id",
|
|
769
|
+
"xlink:title",
|
|
770
|
+
"xml:space",
|
|
771
|
+
"xmlns:xlink"
|
|
772
|
+
]);
|
|
773
|
+
const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm);
|
|
774
|
+
const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
|
|
775
|
+
const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm);
|
|
776
|
+
const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/);
|
|
777
|
+
const ARIA_ATTR = seal(/^aria-[\-\w]+$/);
|
|
778
|
+
const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i);
|
|
779
|
+
const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
|
|
780
|
+
const ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g);
|
|
781
|
+
const DOCTYPE_NAME = seal(/^html$/i);
|
|
782
|
+
const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
783
|
+
var EXPRESSIONS = /* @__PURE__ */ Object.freeze({
|
|
784
|
+
__proto__: null,
|
|
785
|
+
ARIA_ATTR,
|
|
786
|
+
ATTR_WHITESPACE,
|
|
787
|
+
CUSTOM_ELEMENT,
|
|
788
|
+
DATA_ATTR,
|
|
789
|
+
DOCTYPE_NAME,
|
|
790
|
+
ERB_EXPR,
|
|
791
|
+
IS_ALLOWED_URI,
|
|
792
|
+
IS_SCRIPT_OR_DATA,
|
|
793
|
+
MUSTACHE_EXPR,
|
|
794
|
+
TMPLIT_EXPR
|
|
795
|
+
});
|
|
796
|
+
const NODE_TYPE = {
|
|
797
|
+
element: 1,
|
|
798
|
+
attribute: 2,
|
|
799
|
+
text: 3,
|
|
800
|
+
cdataSection: 4,
|
|
801
|
+
entityReference: 5,
|
|
802
|
+
entityNode: 6,
|
|
803
|
+
progressingInstruction: 7,
|
|
804
|
+
comment: 8,
|
|
805
|
+
document: 9,
|
|
806
|
+
documentType: 10,
|
|
807
|
+
documentFragment: 11,
|
|
808
|
+
notation: 12
|
|
809
|
+
};
|
|
810
|
+
const getGlobal = function getGlobal$1() {
|
|
811
|
+
return typeof window === "undefined" ? null : window;
|
|
812
|
+
};
|
|
813
|
+
/**
|
|
814
|
+
* Creates a no-op policy for internal use only.
|
|
815
|
+
* Don't export this function outside this module!
|
|
816
|
+
* @param trustedTypes The policy factory.
|
|
817
|
+
* @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).
|
|
818
|
+
* @return The policy created (or null, if Trusted Types
|
|
819
|
+
* are not supported or creating the policy failed).
|
|
820
|
+
*/
|
|
821
|
+
const _createTrustedTypesPolicy = function _createTrustedTypesPolicy$1(trustedTypes, purifyHostElement) {
|
|
822
|
+
if (typeof trustedTypes !== "object" || typeof trustedTypes.createPolicy !== "function") return null;
|
|
823
|
+
let suffix = null;
|
|
824
|
+
const ATTR_NAME = "data-tt-policy-suffix";
|
|
825
|
+
if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) suffix = purifyHostElement.getAttribute(ATTR_NAME);
|
|
826
|
+
const policyName = "dompurify" + (suffix ? "#" + suffix : "");
|
|
827
|
+
try {
|
|
828
|
+
return trustedTypes.createPolicy(policyName, {
|
|
829
|
+
createHTML(html$2) {
|
|
830
|
+
return html$2;
|
|
831
|
+
},
|
|
832
|
+
createScriptURL(scriptUrl) {
|
|
833
|
+
return scriptUrl;
|
|
834
|
+
}
|
|
835
|
+
});
|
|
836
|
+
} catch (_) {
|
|
837
|
+
console.warn("TrustedTypes policy " + policyName + " could not be created.");
|
|
838
|
+
return null;
|
|
839
|
+
}
|
|
840
|
+
};
|
|
841
|
+
const _createHooksMap = function _createHooksMap$1() {
|
|
842
|
+
return {
|
|
843
|
+
afterSanitizeAttributes: [],
|
|
844
|
+
afterSanitizeElements: [],
|
|
845
|
+
afterSanitizeShadowDOM: [],
|
|
846
|
+
beforeSanitizeAttributes: [],
|
|
847
|
+
beforeSanitizeElements: [],
|
|
848
|
+
beforeSanitizeShadowDOM: [],
|
|
849
|
+
uponSanitizeAttribute: [],
|
|
850
|
+
uponSanitizeElement: [],
|
|
851
|
+
uponSanitizeShadowNode: []
|
|
852
|
+
};
|
|
853
|
+
};
|
|
854
|
+
function createDOMPurify() {
|
|
855
|
+
let window$1 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
|
|
856
|
+
const DOMPurify = (root) => createDOMPurify(root);
|
|
857
|
+
DOMPurify.version = "3.3.1";
|
|
858
|
+
DOMPurify.removed = [];
|
|
859
|
+
if (!window$1 || !window$1.document || window$1.document.nodeType !== NODE_TYPE.document || !window$1.Element) {
|
|
860
|
+
DOMPurify.isSupported = false;
|
|
861
|
+
return DOMPurify;
|
|
862
|
+
}
|
|
863
|
+
let { document } = window$1;
|
|
864
|
+
const originalDocument = document;
|
|
865
|
+
const currentScript = originalDocument.currentScript;
|
|
866
|
+
const { DocumentFragment, HTMLTemplateElement, Node, Element, NodeFilter, NamedNodeMap = window$1.NamedNodeMap || window$1.MozNamedAttrMap, HTMLFormElement, DOMParser, trustedTypes } = window$1;
|
|
867
|
+
const ElementPrototype = Element.prototype;
|
|
868
|
+
const cloneNode = lookupGetter(ElementPrototype, "cloneNode");
|
|
869
|
+
const remove = lookupGetter(ElementPrototype, "remove");
|
|
870
|
+
const getNextSibling = lookupGetter(ElementPrototype, "nextSibling");
|
|
871
|
+
const getChildNodes = lookupGetter(ElementPrototype, "childNodes");
|
|
872
|
+
const getParentNode = lookupGetter(ElementPrototype, "parentNode");
|
|
873
|
+
if (typeof HTMLTemplateElement === "function") {
|
|
874
|
+
const template = document.createElement("template");
|
|
875
|
+
if (template.content && template.content.ownerDocument) document = template.content.ownerDocument;
|
|
876
|
+
}
|
|
877
|
+
let trustedTypesPolicy;
|
|
878
|
+
let emptyHTML = "";
|
|
879
|
+
const { implementation, createNodeIterator, createDocumentFragment, getElementsByTagName } = document;
|
|
880
|
+
const { importNode } = originalDocument;
|
|
881
|
+
let hooks = _createHooksMap();
|
|
882
|
+
/**
|
|
883
|
+
* Expose whether this browser supports running the full DOMPurify.
|
|
884
|
+
*/
|
|
885
|
+
DOMPurify.isSupported = typeof entries === "function" && typeof getParentNode === "function" && implementation && implementation.createHTMLDocument !== void 0;
|
|
886
|
+
const { MUSTACHE_EXPR: MUSTACHE_EXPR$1, ERB_EXPR: ERB_EXPR$1, TMPLIT_EXPR: TMPLIT_EXPR$1, DATA_ATTR: DATA_ATTR$1, ARIA_ATTR: ARIA_ATTR$1, IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA$1, ATTR_WHITESPACE: ATTR_WHITESPACE$1, CUSTOM_ELEMENT: CUSTOM_ELEMENT$1 } = EXPRESSIONS;
|
|
887
|
+
let { IS_ALLOWED_URI: IS_ALLOWED_URI$1 } = EXPRESSIONS;
|
|
888
|
+
/**
|
|
889
|
+
* We consider the elements and attributes below to be safe. Ideally
|
|
890
|
+
* don't add any new ones but feel free to remove unwanted ones.
|
|
891
|
+
*/
|
|
892
|
+
let ALLOWED_TAGS = null;
|
|
893
|
+
const DEFAULT_ALLOWED_TAGS = addToSet({}, [
|
|
894
|
+
...html$1,
|
|
895
|
+
...svg$1,
|
|
896
|
+
...svgFilters,
|
|
897
|
+
...mathMl$1,
|
|
898
|
+
...text
|
|
899
|
+
]);
|
|
900
|
+
let ALLOWED_ATTR = null;
|
|
901
|
+
const DEFAULT_ALLOWED_ATTR = addToSet({}, [
|
|
902
|
+
...html,
|
|
903
|
+
...svg,
|
|
904
|
+
...mathMl,
|
|
905
|
+
...xml
|
|
906
|
+
]);
|
|
907
|
+
let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {
|
|
908
|
+
tagNameCheck: {
|
|
909
|
+
writable: true,
|
|
910
|
+
configurable: false,
|
|
911
|
+
enumerable: true,
|
|
912
|
+
value: null
|
|
913
|
+
},
|
|
914
|
+
attributeNameCheck: {
|
|
915
|
+
writable: true,
|
|
916
|
+
configurable: false,
|
|
917
|
+
enumerable: true,
|
|
918
|
+
value: null
|
|
919
|
+
},
|
|
920
|
+
allowCustomizedBuiltInElements: {
|
|
921
|
+
writable: true,
|
|
922
|
+
configurable: false,
|
|
923
|
+
enumerable: true,
|
|
924
|
+
value: false
|
|
925
|
+
}
|
|
926
|
+
}));
|
|
927
|
+
let FORBID_TAGS = null;
|
|
928
|
+
let FORBID_ATTR = null;
|
|
929
|
+
const EXTRA_ELEMENT_HANDLING = Object.seal(create(null, {
|
|
930
|
+
tagCheck: {
|
|
931
|
+
writable: true,
|
|
932
|
+
configurable: false,
|
|
933
|
+
enumerable: true,
|
|
934
|
+
value: null
|
|
935
|
+
},
|
|
936
|
+
attributeCheck: {
|
|
937
|
+
writable: true,
|
|
938
|
+
configurable: false,
|
|
939
|
+
enumerable: true,
|
|
940
|
+
value: null
|
|
941
|
+
}
|
|
942
|
+
}));
|
|
943
|
+
let ALLOW_ARIA_ATTR = true;
|
|
944
|
+
let ALLOW_DATA_ATTR = true;
|
|
945
|
+
let ALLOW_UNKNOWN_PROTOCOLS = false;
|
|
946
|
+
let ALLOW_SELF_CLOSE_IN_ATTR = true;
|
|
947
|
+
let SAFE_FOR_TEMPLATES = false;
|
|
948
|
+
let SAFE_FOR_XML = true;
|
|
949
|
+
let WHOLE_DOCUMENT = false;
|
|
950
|
+
let SET_CONFIG = false;
|
|
951
|
+
let FORCE_BODY = false;
|
|
952
|
+
let RETURN_DOM = false;
|
|
953
|
+
let RETURN_DOM_FRAGMENT = false;
|
|
954
|
+
let RETURN_TRUSTED_TYPE = false;
|
|
955
|
+
let SANITIZE_DOM = true;
|
|
956
|
+
let SANITIZE_NAMED_PROPS = false;
|
|
957
|
+
const SANITIZE_NAMED_PROPS_PREFIX = "user-content-";
|
|
958
|
+
let KEEP_CONTENT = true;
|
|
959
|
+
let IN_PLACE = false;
|
|
960
|
+
let USE_PROFILES = {};
|
|
961
|
+
let FORBID_CONTENTS = null;
|
|
962
|
+
const DEFAULT_FORBID_CONTENTS = addToSet({}, [
|
|
963
|
+
"annotation-xml",
|
|
964
|
+
"audio",
|
|
965
|
+
"colgroup",
|
|
966
|
+
"desc",
|
|
967
|
+
"foreignobject",
|
|
968
|
+
"head",
|
|
969
|
+
"iframe",
|
|
970
|
+
"math",
|
|
971
|
+
"mi",
|
|
972
|
+
"mn",
|
|
973
|
+
"mo",
|
|
974
|
+
"ms",
|
|
975
|
+
"mtext",
|
|
976
|
+
"noembed",
|
|
977
|
+
"noframes",
|
|
978
|
+
"noscript",
|
|
979
|
+
"plaintext",
|
|
980
|
+
"script",
|
|
981
|
+
"style",
|
|
982
|
+
"svg",
|
|
983
|
+
"template",
|
|
984
|
+
"thead",
|
|
985
|
+
"title",
|
|
986
|
+
"video",
|
|
987
|
+
"xmp"
|
|
988
|
+
]);
|
|
989
|
+
let DATA_URI_TAGS = null;
|
|
990
|
+
const DEFAULT_DATA_URI_TAGS = addToSet({}, [
|
|
991
|
+
"audio",
|
|
992
|
+
"video",
|
|
993
|
+
"img",
|
|
994
|
+
"source",
|
|
995
|
+
"image",
|
|
996
|
+
"track"
|
|
997
|
+
]);
|
|
998
|
+
let URI_SAFE_ATTRIBUTES = null;
|
|
999
|
+
const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, [
|
|
1000
|
+
"alt",
|
|
1001
|
+
"class",
|
|
1002
|
+
"for",
|
|
1003
|
+
"id",
|
|
1004
|
+
"label",
|
|
1005
|
+
"name",
|
|
1006
|
+
"pattern",
|
|
1007
|
+
"placeholder",
|
|
1008
|
+
"role",
|
|
1009
|
+
"summary",
|
|
1010
|
+
"title",
|
|
1011
|
+
"value",
|
|
1012
|
+
"style",
|
|
1013
|
+
"xmlns"
|
|
1014
|
+
]);
|
|
1015
|
+
const MATHML_NAMESPACE = "http://www.w3.org/1998/Math/MathML";
|
|
1016
|
+
const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
|
|
1017
|
+
const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
|
|
1018
|
+
let NAMESPACE = HTML_NAMESPACE;
|
|
1019
|
+
let IS_EMPTY_INPUT = false;
|
|
1020
|
+
let ALLOWED_NAMESPACES = null;
|
|
1021
|
+
const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [
|
|
1022
|
+
MATHML_NAMESPACE,
|
|
1023
|
+
SVG_NAMESPACE,
|
|
1024
|
+
HTML_NAMESPACE
|
|
1025
|
+
], stringToString);
|
|
1026
|
+
let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, [
|
|
1027
|
+
"mi",
|
|
1028
|
+
"mo",
|
|
1029
|
+
"mn",
|
|
1030
|
+
"ms",
|
|
1031
|
+
"mtext"
|
|
1032
|
+
]);
|
|
1033
|
+
let HTML_INTEGRATION_POINTS = addToSet({}, ["annotation-xml"]);
|
|
1034
|
+
const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, [
|
|
1035
|
+
"title",
|
|
1036
|
+
"style",
|
|
1037
|
+
"font",
|
|
1038
|
+
"a",
|
|
1039
|
+
"script"
|
|
1040
|
+
]);
|
|
1041
|
+
let PARSER_MEDIA_TYPE = null;
|
|
1042
|
+
const SUPPORTED_PARSER_MEDIA_TYPES = ["application/xhtml+xml", "text/html"];
|
|
1043
|
+
const DEFAULT_PARSER_MEDIA_TYPE = "text/html";
|
|
1044
|
+
let transformCaseFunc = null;
|
|
1045
|
+
let CONFIG = null;
|
|
1046
|
+
const formElement = document.createElement("form");
|
|
1047
|
+
const isRegexOrFunction = function isRegexOrFunction$1(testValue) {
|
|
1048
|
+
return testValue instanceof RegExp || testValue instanceof Function;
|
|
1049
|
+
};
|
|
1050
|
+
/**
|
|
1051
|
+
* _parseConfig
|
|
1052
|
+
*
|
|
1053
|
+
* @param cfg optional config literal
|
|
1054
|
+
*/
|
|
1055
|
+
const _parseConfig = function _parseConfig$1() {
|
|
1056
|
+
let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1057
|
+
if (CONFIG && CONFIG === cfg) return;
|
|
1058
|
+
if (!cfg || typeof cfg !== "object") cfg = {};
|
|
1059
|
+
cfg = clone(cfg);
|
|
1060
|
+
PARSER_MEDIA_TYPE = SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
|
|
1061
|
+
transformCaseFunc = PARSER_MEDIA_TYPE === "application/xhtml+xml" ? stringToString : stringToLowerCase;
|
|
1062
|
+
ALLOWED_TAGS = objectHasOwnProperty(cfg, "ALLOWED_TAGS") ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
|
|
1063
|
+
ALLOWED_ATTR = objectHasOwnProperty(cfg, "ALLOWED_ATTR") ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
|
|
1064
|
+
ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, "ALLOWED_NAMESPACES") ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
|
|
1065
|
+
URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, "ADD_URI_SAFE_ATTR") ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES;
|
|
1066
|
+
DATA_URI_TAGS = objectHasOwnProperty(cfg, "ADD_DATA_URI_TAGS") ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS;
|
|
1067
|
+
FORBID_CONTENTS = objectHasOwnProperty(cfg, "FORBID_CONTENTS") ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
|
|
1068
|
+
FORBID_TAGS = objectHasOwnProperty(cfg, "FORBID_TAGS") ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : clone({});
|
|
1069
|
+
FORBID_ATTR = objectHasOwnProperty(cfg, "FORBID_ATTR") ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : clone({});
|
|
1070
|
+
USE_PROFILES = objectHasOwnProperty(cfg, "USE_PROFILES") ? cfg.USE_PROFILES : false;
|
|
1071
|
+
ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false;
|
|
1072
|
+
ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false;
|
|
1073
|
+
ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false;
|
|
1074
|
+
ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false;
|
|
1075
|
+
SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false;
|
|
1076
|
+
SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false;
|
|
1077
|
+
WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false;
|
|
1078
|
+
RETURN_DOM = cfg.RETURN_DOM || false;
|
|
1079
|
+
RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false;
|
|
1080
|
+
RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false;
|
|
1081
|
+
FORCE_BODY = cfg.FORCE_BODY || false;
|
|
1082
|
+
SANITIZE_DOM = cfg.SANITIZE_DOM !== false;
|
|
1083
|
+
SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false;
|
|
1084
|
+
KEEP_CONTENT = cfg.KEEP_CONTENT !== false;
|
|
1085
|
+
IN_PLACE = cfg.IN_PLACE || false;
|
|
1086
|
+
IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;
|
|
1087
|
+
NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
|
|
1088
|
+
MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS;
|
|
1089
|
+
HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS;
|
|
1090
|
+
CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};
|
|
1091
|
+
if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
|
|
1092
|
+
if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;
|
|
1093
|
+
if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === "boolean") CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;
|
|
1094
|
+
if (SAFE_FOR_TEMPLATES) ALLOW_DATA_ATTR = false;
|
|
1095
|
+
if (RETURN_DOM_FRAGMENT) RETURN_DOM = true;
|
|
1096
|
+
if (USE_PROFILES) {
|
|
1097
|
+
ALLOWED_TAGS = addToSet({}, text);
|
|
1098
|
+
ALLOWED_ATTR = [];
|
|
1099
|
+
if (USE_PROFILES.html === true) {
|
|
1100
|
+
addToSet(ALLOWED_TAGS, html$1);
|
|
1101
|
+
addToSet(ALLOWED_ATTR, html);
|
|
1102
|
+
}
|
|
1103
|
+
if (USE_PROFILES.svg === true) {
|
|
1104
|
+
addToSet(ALLOWED_TAGS, svg$1);
|
|
1105
|
+
addToSet(ALLOWED_ATTR, svg);
|
|
1106
|
+
addToSet(ALLOWED_ATTR, xml);
|
|
1107
|
+
}
|
|
1108
|
+
if (USE_PROFILES.svgFilters === true) {
|
|
1109
|
+
addToSet(ALLOWED_TAGS, svgFilters);
|
|
1110
|
+
addToSet(ALLOWED_ATTR, svg);
|
|
1111
|
+
addToSet(ALLOWED_ATTR, xml);
|
|
1112
|
+
}
|
|
1113
|
+
if (USE_PROFILES.mathMl === true) {
|
|
1114
|
+
addToSet(ALLOWED_TAGS, mathMl$1);
|
|
1115
|
+
addToSet(ALLOWED_ATTR, mathMl);
|
|
1116
|
+
addToSet(ALLOWED_ATTR, xml);
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
if (cfg.ADD_TAGS) if (typeof cfg.ADD_TAGS === "function") EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;
|
|
1120
|
+
else {
|
|
1121
|
+
if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) ALLOWED_TAGS = clone(ALLOWED_TAGS);
|
|
1122
|
+
addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
|
|
1123
|
+
}
|
|
1124
|
+
if (cfg.ADD_ATTR) if (typeof cfg.ADD_ATTR === "function") EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;
|
|
1125
|
+
else {
|
|
1126
|
+
if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) ALLOWED_ATTR = clone(ALLOWED_ATTR);
|
|
1127
|
+
addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
|
|
1128
|
+
}
|
|
1129
|
+
if (cfg.ADD_URI_SAFE_ATTR) addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
|
|
1130
|
+
if (cfg.FORBID_CONTENTS) {
|
|
1131
|
+
if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) FORBID_CONTENTS = clone(FORBID_CONTENTS);
|
|
1132
|
+
addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
|
|
1133
|
+
}
|
|
1134
|
+
if (cfg.ADD_FORBID_CONTENTS) {
|
|
1135
|
+
if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) FORBID_CONTENTS = clone(FORBID_CONTENTS);
|
|
1136
|
+
addToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc);
|
|
1137
|
+
}
|
|
1138
|
+
if (KEEP_CONTENT) ALLOWED_TAGS["#text"] = true;
|
|
1139
|
+
if (WHOLE_DOCUMENT) addToSet(ALLOWED_TAGS, [
|
|
1140
|
+
"html",
|
|
1141
|
+
"head",
|
|
1142
|
+
"body"
|
|
1143
|
+
]);
|
|
1144
|
+
if (ALLOWED_TAGS.table) {
|
|
1145
|
+
addToSet(ALLOWED_TAGS, ["tbody"]);
|
|
1146
|
+
delete FORBID_TAGS.tbody;
|
|
1147
|
+
}
|
|
1148
|
+
if (cfg.TRUSTED_TYPES_POLICY) {
|
|
1149
|
+
if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== "function") throw typeErrorCreate("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
|
|
1150
|
+
if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== "function") throw typeErrorCreate("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
|
|
1151
|
+
trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
|
|
1152
|
+
emptyHTML = trustedTypesPolicy.createHTML("");
|
|
1153
|
+
} else {
|
|
1154
|
+
if (trustedTypesPolicy === void 0) trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
|
|
1155
|
+
if (trustedTypesPolicy !== null && typeof emptyHTML === "string") emptyHTML = trustedTypesPolicy.createHTML("");
|
|
1156
|
+
}
|
|
1157
|
+
if (freeze) freeze(cfg);
|
|
1158
|
+
CONFIG = cfg;
|
|
1159
|
+
};
|
|
1160
|
+
const ALL_SVG_TAGS = addToSet({}, [
|
|
1161
|
+
...svg$1,
|
|
1162
|
+
...svgFilters,
|
|
1163
|
+
...svgDisallowed
|
|
1164
|
+
]);
|
|
1165
|
+
const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
|
|
1166
|
+
/**
|
|
1167
|
+
* @param element a DOM element whose namespace is being checked
|
|
1168
|
+
* @returns Return false if the element has a
|
|
1169
|
+
* namespace that a spec-compliant parser would never
|
|
1170
|
+
* return. Return true otherwise.
|
|
1171
|
+
*/
|
|
1172
|
+
const _checkValidNamespace = function _checkValidNamespace$1(element) {
|
|
1173
|
+
let parent = getParentNode(element);
|
|
1174
|
+
if (!parent || !parent.tagName) parent = {
|
|
1175
|
+
namespaceURI: NAMESPACE,
|
|
1176
|
+
tagName: "template"
|
|
1177
|
+
};
|
|
1178
|
+
const tagName = stringToLowerCase(element.tagName);
|
|
1179
|
+
const parentTagName = stringToLowerCase(parent.tagName);
|
|
1180
|
+
if (!ALLOWED_NAMESPACES[element.namespaceURI]) return false;
|
|
1181
|
+
if (element.namespaceURI === SVG_NAMESPACE) {
|
|
1182
|
+
if (parent.namespaceURI === HTML_NAMESPACE) return tagName === "svg";
|
|
1183
|
+
if (parent.namespaceURI === MATHML_NAMESPACE) return tagName === "svg" && (parentTagName === "annotation-xml" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
|
|
1184
|
+
return Boolean(ALL_SVG_TAGS[tagName]);
|
|
1185
|
+
}
|
|
1186
|
+
if (element.namespaceURI === MATHML_NAMESPACE) {
|
|
1187
|
+
if (parent.namespaceURI === HTML_NAMESPACE) return tagName === "math";
|
|
1188
|
+
if (parent.namespaceURI === SVG_NAMESPACE) return tagName === "math" && HTML_INTEGRATION_POINTS[parentTagName];
|
|
1189
|
+
return Boolean(ALL_MATHML_TAGS[tagName]);
|
|
1190
|
+
}
|
|
1191
|
+
if (element.namespaceURI === HTML_NAMESPACE) {
|
|
1192
|
+
if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) return false;
|
|
1193
|
+
if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) return false;
|
|
1194
|
+
return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
|
|
1195
|
+
}
|
|
1196
|
+
if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && ALLOWED_NAMESPACES[element.namespaceURI]) return true;
|
|
1197
|
+
return false;
|
|
1198
|
+
};
|
|
1199
|
+
/**
|
|
1200
|
+
* _forceRemove
|
|
1201
|
+
*
|
|
1202
|
+
* @param node a DOM node
|
|
1203
|
+
*/
|
|
1204
|
+
const _forceRemove = function _forceRemove$1(node) {
|
|
1205
|
+
arrayPush(DOMPurify.removed, { element: node });
|
|
1206
|
+
try {
|
|
1207
|
+
getParentNode(node).removeChild(node);
|
|
1208
|
+
} catch (_) {
|
|
1209
|
+
remove(node);
|
|
1210
|
+
}
|
|
1211
|
+
};
|
|
1212
|
+
/**
|
|
1213
|
+
* _removeAttribute
|
|
1214
|
+
*
|
|
1215
|
+
* @param name an Attribute name
|
|
1216
|
+
* @param element a DOM node
|
|
1217
|
+
*/
|
|
1218
|
+
const _removeAttribute = function _removeAttribute$1(name, element) {
|
|
1219
|
+
try {
|
|
1220
|
+
arrayPush(DOMPurify.removed, {
|
|
1221
|
+
attribute: element.getAttributeNode(name),
|
|
1222
|
+
from: element
|
|
1223
|
+
});
|
|
1224
|
+
} catch (_) {
|
|
1225
|
+
arrayPush(DOMPurify.removed, {
|
|
1226
|
+
attribute: null,
|
|
1227
|
+
from: element
|
|
1228
|
+
});
|
|
1229
|
+
}
|
|
1230
|
+
element.removeAttribute(name);
|
|
1231
|
+
if (name === "is") if (RETURN_DOM || RETURN_DOM_FRAGMENT) try {
|
|
1232
|
+
_forceRemove(element);
|
|
1233
|
+
} catch (_) {}
|
|
1234
|
+
else try {
|
|
1235
|
+
element.setAttribute(name, "");
|
|
1236
|
+
} catch (_) {}
|
|
1237
|
+
};
|
|
1238
|
+
/**
|
|
1239
|
+
* _initDocument
|
|
1240
|
+
*
|
|
1241
|
+
* @param dirty - a string of dirty markup
|
|
1242
|
+
* @return a DOM, filled with the dirty markup
|
|
1243
|
+
*/
|
|
1244
|
+
const _initDocument = function _initDocument$1(dirty) {
|
|
1245
|
+
let doc = null;
|
|
1246
|
+
let leadingWhitespace = null;
|
|
1247
|
+
if (FORCE_BODY) dirty = "<remove></remove>" + dirty;
|
|
1248
|
+
else {
|
|
1249
|
+
const matches = stringMatch(dirty, /^[\r\n\t ]+/);
|
|
1250
|
+
leadingWhitespace = matches && matches[0];
|
|
1251
|
+
}
|
|
1252
|
+
if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && NAMESPACE === HTML_NAMESPACE) dirty = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + dirty + "</body></html>";
|
|
1253
|
+
const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
|
|
1254
|
+
if (NAMESPACE === HTML_NAMESPACE) try {
|
|
1255
|
+
doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
|
|
1256
|
+
} catch (_) {}
|
|
1257
|
+
if (!doc || !doc.documentElement) {
|
|
1258
|
+
doc = implementation.createDocument(NAMESPACE, "template", null);
|
|
1259
|
+
try {
|
|
1260
|
+
doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
|
|
1261
|
+
} catch (_) {}
|
|
1262
|
+
}
|
|
1263
|
+
const body = doc.body || doc.documentElement;
|
|
1264
|
+
if (dirty && leadingWhitespace) body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
|
|
1265
|
+
if (NAMESPACE === HTML_NAMESPACE) return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? "html" : "body")[0];
|
|
1266
|
+
return WHOLE_DOCUMENT ? doc.documentElement : body;
|
|
1267
|
+
};
|
|
1268
|
+
/**
|
|
1269
|
+
* Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
|
|
1270
|
+
*
|
|
1271
|
+
* @param root The root element or node to start traversing on.
|
|
1272
|
+
* @return The created NodeIterator
|
|
1273
|
+
*/
|
|
1274
|
+
const _createNodeIterator = function _createNodeIterator$1(root) {
|
|
1275
|
+
return createNodeIterator.call(root.ownerDocument || root, root, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
|
|
1276
|
+
};
|
|
1277
|
+
/**
|
|
1278
|
+
* _isClobbered
|
|
1279
|
+
*
|
|
1280
|
+
* @param element element to check for clobbering attacks
|
|
1281
|
+
* @return true if clobbered, false if safe
|
|
1282
|
+
*/
|
|
1283
|
+
const _isClobbered = function _isClobbered$1(element) {
|
|
1284
|
+
return element instanceof HTMLFormElement && (typeof element.nodeName !== "string" || typeof element.textContent !== "string" || typeof element.removeChild !== "function" || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== "function" || typeof element.setAttribute !== "function" || typeof element.namespaceURI !== "string" || typeof element.insertBefore !== "function" || typeof element.hasChildNodes !== "function");
|
|
1285
|
+
};
|
|
1286
|
+
/**
|
|
1287
|
+
* Checks whether the given object is a DOM node.
|
|
1288
|
+
*
|
|
1289
|
+
* @param value object to check whether it's a DOM node
|
|
1290
|
+
* @return true is object is a DOM node
|
|
1291
|
+
*/
|
|
1292
|
+
const _isNode = function _isNode$1(value) {
|
|
1293
|
+
return typeof Node === "function" && value instanceof Node;
|
|
1294
|
+
};
|
|
1295
|
+
function _executeHooks(hooks$1, currentNode, data) {
|
|
1296
|
+
arrayForEach(hooks$1, (hook) => {
|
|
1297
|
+
hook.call(DOMPurify, currentNode, data, CONFIG);
|
|
1298
|
+
});
|
|
1299
|
+
}
|
|
1300
|
+
/**
|
|
1301
|
+
* _sanitizeElements
|
|
1302
|
+
*
|
|
1303
|
+
* @protect nodeName
|
|
1304
|
+
* @protect textContent
|
|
1305
|
+
* @protect removeChild
|
|
1306
|
+
* @param currentNode to check for permission to exist
|
|
1307
|
+
* @return true if node was killed, false if left alive
|
|
1308
|
+
*/
|
|
1309
|
+
const _sanitizeElements = function _sanitizeElements$1(currentNode) {
|
|
1310
|
+
let content = null;
|
|
1311
|
+
_executeHooks(hooks.beforeSanitizeElements, currentNode, null);
|
|
1312
|
+
if (_isClobbered(currentNode)) {
|
|
1313
|
+
_forceRemove(currentNode);
|
|
1314
|
+
return true;
|
|
1315
|
+
}
|
|
1316
|
+
const tagName = transformCaseFunc(currentNode.nodeName);
|
|
1317
|
+
_executeHooks(hooks.uponSanitizeElement, currentNode, {
|
|
1318
|
+
tagName,
|
|
1319
|
+
allowedTags: ALLOWED_TAGS
|
|
1320
|
+
});
|
|
1321
|
+
if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w!]/g, currentNode.innerHTML) && regExpTest(/<[/\w!]/g, currentNode.textContent)) {
|
|
1322
|
+
_forceRemove(currentNode);
|
|
1323
|
+
return true;
|
|
1324
|
+
}
|
|
1325
|
+
if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {
|
|
1326
|
+
_forceRemove(currentNode);
|
|
1327
|
+
return true;
|
|
1328
|
+
}
|
|
1329
|
+
if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) {
|
|
1330
|
+
_forceRemove(currentNode);
|
|
1331
|
+
return true;
|
|
1332
|
+
}
|
|
1333
|
+
if (!(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName])) {
|
|
1334
|
+
if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
|
|
1335
|
+
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) return false;
|
|
1336
|
+
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) return false;
|
|
1337
|
+
}
|
|
1338
|
+
if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
|
|
1339
|
+
const parentNode = getParentNode(currentNode) || currentNode.parentNode;
|
|
1340
|
+
const childNodes = getChildNodes(currentNode) || currentNode.childNodes;
|
|
1341
|
+
if (childNodes && parentNode) {
|
|
1342
|
+
const childCount = childNodes.length;
|
|
1343
|
+
for (let i = childCount - 1; i >= 0; --i) {
|
|
1344
|
+
const childClone = cloneNode(childNodes[i], true);
|
|
1345
|
+
childClone.__removalCount = (currentNode.__removalCount || 0) + 1;
|
|
1346
|
+
parentNode.insertBefore(childClone, getNextSibling(currentNode));
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
_forceRemove(currentNode);
|
|
1351
|
+
return true;
|
|
1352
|
+
}
|
|
1353
|
+
if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {
|
|
1354
|
+
_forceRemove(currentNode);
|
|
1355
|
+
return true;
|
|
1356
|
+
}
|
|
1357
|
+
if ((tagName === "noscript" || tagName === "noembed" || tagName === "noframes") && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) {
|
|
1358
|
+
_forceRemove(currentNode);
|
|
1359
|
+
return true;
|
|
1360
|
+
}
|
|
1361
|
+
if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
|
|
1362
|
+
content = currentNode.textContent;
|
|
1363
|
+
arrayForEach([
|
|
1364
|
+
MUSTACHE_EXPR$1,
|
|
1365
|
+
ERB_EXPR$1,
|
|
1366
|
+
TMPLIT_EXPR$1
|
|
1367
|
+
], (expr) => {
|
|
1368
|
+
content = stringReplace(content, expr, " ");
|
|
1369
|
+
});
|
|
1370
|
+
if (currentNode.textContent !== content) {
|
|
1371
|
+
arrayPush(DOMPurify.removed, { element: currentNode.cloneNode() });
|
|
1372
|
+
currentNode.textContent = content;
|
|
1373
|
+
}
|
|
1374
|
+
}
|
|
1375
|
+
_executeHooks(hooks.afterSanitizeElements, currentNode, null);
|
|
1376
|
+
return false;
|
|
1377
|
+
};
|
|
1378
|
+
/**
|
|
1379
|
+
* _isValidAttribute
|
|
1380
|
+
*
|
|
1381
|
+
* @param lcTag Lowercase tag name of containing element.
|
|
1382
|
+
* @param lcName Lowercase attribute name.
|
|
1383
|
+
* @param value Attribute value.
|
|
1384
|
+
* @return Returns true if `value` is valid, otherwise false.
|
|
1385
|
+
*/
|
|
1386
|
+
const _isValidAttribute = function _isValidAttribute$1(lcTag, lcName, value) {
|
|
1387
|
+
if (SANITIZE_DOM && (lcName === "id" || lcName === "name") && (value in document || value in formElement)) return false;
|
|
1388
|
+
if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR$1, lcName));
|
|
1389
|
+
else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$1, lcName));
|
|
1390
|
+
else if (EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag));
|
|
1391
|
+
else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) if (_isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName, lcTag)) || lcName === "is" && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value)));
|
|
1392
|
+
else return false;
|
|
1393
|
+
else if (URI_SAFE_ATTRIBUTES[lcName]);
|
|
1394
|
+
else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE$1, "")));
|
|
1395
|
+
else if ((lcName === "src" || lcName === "xlink:href" || lcName === "href") && lcTag !== "script" && stringIndexOf(value, "data:") === 0 && DATA_URI_TAGS[lcTag]);
|
|
1396
|
+
else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$1, stringReplace(value, ATTR_WHITESPACE$1, "")));
|
|
1397
|
+
else if (value) return false;
|
|
1398
|
+
return true;
|
|
1399
|
+
};
|
|
1400
|
+
/**
|
|
1401
|
+
* _isBasicCustomElement
|
|
1402
|
+
* checks if at least one dash is included in tagName, and it's not the first char
|
|
1403
|
+
* for more sophisticated checking see https://github.com/sindresorhus/validate-element-name
|
|
1404
|
+
*
|
|
1405
|
+
* @param tagName name of the tag of the node to sanitize
|
|
1406
|
+
* @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.
|
|
1407
|
+
*/
|
|
1408
|
+
const _isBasicCustomElement = function _isBasicCustomElement$1(tagName) {
|
|
1409
|
+
return tagName !== "annotation-xml" && stringMatch(tagName, CUSTOM_ELEMENT$1);
|
|
1410
|
+
};
|
|
1411
|
+
/**
|
|
1412
|
+
* _sanitizeAttributes
|
|
1413
|
+
*
|
|
1414
|
+
* @protect attributes
|
|
1415
|
+
* @protect nodeName
|
|
1416
|
+
* @protect removeAttribute
|
|
1417
|
+
* @protect setAttribute
|
|
1418
|
+
*
|
|
1419
|
+
* @param currentNode to sanitize
|
|
1420
|
+
*/
|
|
1421
|
+
const _sanitizeAttributes = function _sanitizeAttributes$1(currentNode) {
|
|
1422
|
+
_executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
|
|
1423
|
+
const { attributes } = currentNode;
|
|
1424
|
+
if (!attributes || _isClobbered(currentNode)) return;
|
|
1425
|
+
const hookEvent = {
|
|
1426
|
+
attrName: "",
|
|
1427
|
+
attrValue: "",
|
|
1428
|
+
keepAttr: true,
|
|
1429
|
+
allowedAttributes: ALLOWED_ATTR,
|
|
1430
|
+
forceKeepAttr: void 0
|
|
1431
|
+
};
|
|
1432
|
+
let l = attributes.length;
|
|
1433
|
+
while (l--) {
|
|
1434
|
+
const { name, namespaceURI, value: attrValue } = attributes[l];
|
|
1435
|
+
const lcName = transformCaseFunc(name);
|
|
1436
|
+
const initValue = attrValue;
|
|
1437
|
+
let value = name === "value" ? initValue : stringTrim(initValue);
|
|
1438
|
+
hookEvent.attrName = lcName;
|
|
1439
|
+
hookEvent.attrValue = value;
|
|
1440
|
+
hookEvent.keepAttr = true;
|
|
1441
|
+
hookEvent.forceKeepAttr = void 0;
|
|
1442
|
+
_executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);
|
|
1443
|
+
value = hookEvent.attrValue;
|
|
1444
|
+
if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name")) {
|
|
1445
|
+
_removeAttribute(name, currentNode);
|
|
1446
|
+
value = SANITIZE_NAMED_PROPS_PREFIX + value;
|
|
1447
|
+
}
|
|
1448
|
+
if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title|textarea)/i, value)) {
|
|
1449
|
+
_removeAttribute(name, currentNode);
|
|
1450
|
+
continue;
|
|
1451
|
+
}
|
|
1452
|
+
if (lcName === "attributename" && stringMatch(value, "href")) {
|
|
1453
|
+
_removeAttribute(name, currentNode);
|
|
1454
|
+
continue;
|
|
1455
|
+
}
|
|
1456
|
+
if (hookEvent.forceKeepAttr) continue;
|
|
1457
|
+
if (!hookEvent.keepAttr) {
|
|
1458
|
+
_removeAttribute(name, currentNode);
|
|
1459
|
+
continue;
|
|
1460
|
+
}
|
|
1461
|
+
if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) {
|
|
1462
|
+
_removeAttribute(name, currentNode);
|
|
1463
|
+
continue;
|
|
1464
|
+
}
|
|
1465
|
+
if (SAFE_FOR_TEMPLATES) arrayForEach([
|
|
1466
|
+
MUSTACHE_EXPR$1,
|
|
1467
|
+
ERB_EXPR$1,
|
|
1468
|
+
TMPLIT_EXPR$1
|
|
1469
|
+
], (expr) => {
|
|
1470
|
+
value = stringReplace(value, expr, " ");
|
|
1471
|
+
});
|
|
1472
|
+
const lcTag = transformCaseFunc(currentNode.nodeName);
|
|
1473
|
+
if (!_isValidAttribute(lcTag, lcName, value)) {
|
|
1474
|
+
_removeAttribute(name, currentNode);
|
|
1475
|
+
continue;
|
|
1476
|
+
}
|
|
1477
|
+
if (trustedTypesPolicy && typeof trustedTypes === "object" && typeof trustedTypes.getAttributeType === "function") if (namespaceURI);
|
|
1478
|
+
else switch (trustedTypes.getAttributeType(lcTag, lcName)) {
|
|
1479
|
+
case "TrustedHTML":
|
|
1480
|
+
value = trustedTypesPolicy.createHTML(value);
|
|
1481
|
+
break;
|
|
1482
|
+
case "TrustedScriptURL":
|
|
1483
|
+
value = trustedTypesPolicy.createScriptURL(value);
|
|
1484
|
+
break;
|
|
1485
|
+
}
|
|
1486
|
+
if (value !== initValue) try {
|
|
1487
|
+
if (namespaceURI) currentNode.setAttributeNS(namespaceURI, name, value);
|
|
1488
|
+
else currentNode.setAttribute(name, value);
|
|
1489
|
+
if (_isClobbered(currentNode)) _forceRemove(currentNode);
|
|
1490
|
+
else arrayPop(DOMPurify.removed);
|
|
1491
|
+
} catch (_) {
|
|
1492
|
+
_removeAttribute(name, currentNode);
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
_executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
|
|
1496
|
+
};
|
|
1497
|
+
/**
|
|
1498
|
+
* _sanitizeShadowDOM
|
|
1499
|
+
*
|
|
1500
|
+
* @param fragment to iterate over recursively
|
|
1501
|
+
*/
|
|
1502
|
+
const _sanitizeShadowDOM = function _sanitizeShadowDOM$1(fragment) {
|
|
1503
|
+
let shadowNode = null;
|
|
1504
|
+
const shadowIterator = _createNodeIterator(fragment);
|
|
1505
|
+
_executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);
|
|
1506
|
+
while (shadowNode = shadowIterator.nextNode()) {
|
|
1507
|
+
_executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
|
|
1508
|
+
_sanitizeElements(shadowNode);
|
|
1509
|
+
_sanitizeAttributes(shadowNode);
|
|
1510
|
+
if (shadowNode.content instanceof DocumentFragment) _sanitizeShadowDOM$1(shadowNode.content);
|
|
1511
|
+
}
|
|
1512
|
+
_executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
|
|
1513
|
+
};
|
|
1514
|
+
DOMPurify.sanitize = function(dirty) {
|
|
1515
|
+
let cfg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
1516
|
+
let body = null;
|
|
1517
|
+
let importedNode = null;
|
|
1518
|
+
let currentNode = null;
|
|
1519
|
+
let returnNode = null;
|
|
1520
|
+
IS_EMPTY_INPUT = !dirty;
|
|
1521
|
+
if (IS_EMPTY_INPUT) dirty = "<!-->";
|
|
1522
|
+
if (typeof dirty !== "string" && !_isNode(dirty)) if (typeof dirty.toString === "function") {
|
|
1523
|
+
dirty = dirty.toString();
|
|
1524
|
+
if (typeof dirty !== "string") throw typeErrorCreate("dirty is not a string, aborting");
|
|
1525
|
+
} else throw typeErrorCreate("toString is not a function");
|
|
1526
|
+
if (!DOMPurify.isSupported) return dirty;
|
|
1527
|
+
if (!SET_CONFIG) _parseConfig(cfg);
|
|
1528
|
+
DOMPurify.removed = [];
|
|
1529
|
+
if (typeof dirty === "string") IN_PLACE = false;
|
|
1530
|
+
if (IN_PLACE) {
|
|
1531
|
+
if (dirty.nodeName) {
|
|
1532
|
+
const tagName = transformCaseFunc(dirty.nodeName);
|
|
1533
|
+
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place");
|
|
1534
|
+
}
|
|
1535
|
+
} else if (dirty instanceof Node) {
|
|
1536
|
+
body = _initDocument("<!---->");
|
|
1537
|
+
importedNode = body.ownerDocument.importNode(dirty, true);
|
|
1538
|
+
if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === "BODY") body = importedNode;
|
|
1539
|
+
else if (importedNode.nodeName === "HTML") body = importedNode;
|
|
1540
|
+
else body.appendChild(importedNode);
|
|
1541
|
+
} else {
|
|
1542
|
+
if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && dirty.indexOf("<") === -1) return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
|
|
1543
|
+
body = _initDocument(dirty);
|
|
1544
|
+
if (!body) return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : "";
|
|
1545
|
+
}
|
|
1546
|
+
if (body && FORCE_BODY) _forceRemove(body.firstChild);
|
|
1547
|
+
const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);
|
|
1548
|
+
while (currentNode = nodeIterator.nextNode()) {
|
|
1549
|
+
_sanitizeElements(currentNode);
|
|
1550
|
+
_sanitizeAttributes(currentNode);
|
|
1551
|
+
if (currentNode.content instanceof DocumentFragment) _sanitizeShadowDOM(currentNode.content);
|
|
1552
|
+
}
|
|
1553
|
+
if (IN_PLACE) return dirty;
|
|
1554
|
+
if (RETURN_DOM) {
|
|
1555
|
+
if (RETURN_DOM_FRAGMENT) {
|
|
1556
|
+
returnNode = createDocumentFragment.call(body.ownerDocument);
|
|
1557
|
+
while (body.firstChild) returnNode.appendChild(body.firstChild);
|
|
1558
|
+
} else returnNode = body;
|
|
1559
|
+
if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) returnNode = importNode.call(originalDocument, returnNode, true);
|
|
1560
|
+
return returnNode;
|
|
1561
|
+
}
|
|
1562
|
+
let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
|
|
1563
|
+
if (WHOLE_DOCUMENT && ALLOWED_TAGS["!doctype"] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) serializedHTML = "<!DOCTYPE " + body.ownerDocument.doctype.name + ">\n" + serializedHTML;
|
|
1564
|
+
if (SAFE_FOR_TEMPLATES) arrayForEach([
|
|
1565
|
+
MUSTACHE_EXPR$1,
|
|
1566
|
+
ERB_EXPR$1,
|
|
1567
|
+
TMPLIT_EXPR$1
|
|
1568
|
+
], (expr) => {
|
|
1569
|
+
serializedHTML = stringReplace(serializedHTML, expr, " ");
|
|
1570
|
+
});
|
|
1571
|
+
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
|
|
1572
|
+
};
|
|
1573
|
+
DOMPurify.setConfig = function() {
|
|
1574
|
+
_parseConfig(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {});
|
|
1575
|
+
SET_CONFIG = true;
|
|
1576
|
+
};
|
|
1577
|
+
DOMPurify.clearConfig = function() {
|
|
1578
|
+
CONFIG = null;
|
|
1579
|
+
SET_CONFIG = false;
|
|
1580
|
+
};
|
|
1581
|
+
DOMPurify.isValidAttribute = function(tag, attr, value) {
|
|
1582
|
+
if (!CONFIG) _parseConfig({});
|
|
1583
|
+
return _isValidAttribute(transformCaseFunc(tag), transformCaseFunc(attr), value);
|
|
1584
|
+
};
|
|
1585
|
+
DOMPurify.addHook = function(entryPoint, hookFunction) {
|
|
1586
|
+
if (typeof hookFunction !== "function") return;
|
|
1587
|
+
arrayPush(hooks[entryPoint], hookFunction);
|
|
1588
|
+
};
|
|
1589
|
+
DOMPurify.removeHook = function(entryPoint, hookFunction) {
|
|
1590
|
+
if (hookFunction !== void 0) {
|
|
1591
|
+
const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
|
|
1592
|
+
return index === -1 ? void 0 : arraySplice(hooks[entryPoint], index, 1)[0];
|
|
1593
|
+
}
|
|
1594
|
+
return arrayPop(hooks[entryPoint]);
|
|
1595
|
+
};
|
|
1596
|
+
DOMPurify.removeHooks = function(entryPoint) {
|
|
1597
|
+
hooks[entryPoint] = [];
|
|
1598
|
+
};
|
|
1599
|
+
DOMPurify.removeAllHooks = function() {
|
|
1600
|
+
hooks = _createHooksMap();
|
|
1601
|
+
};
|
|
1602
|
+
return DOMPurify;
|
|
1603
|
+
}
|
|
1604
|
+
var purify$1 = createDOMPurify();
|
|
1605
|
+
|
|
1606
|
+
//#endregion
|
|
1607
|
+
//#region src/client/webcomponents/utils/iconify.ts
|
|
1608
|
+
const getIconifySvgMap = /* @__PURE__ */ new Map();
|
|
1609
|
+
const purify = purify$1();
|
|
1610
|
+
async function getIconifySvg(collection, icon) {
|
|
1611
|
+
const id = `${collection}:${icon}`;
|
|
1612
|
+
if (getIconifySvgMap.has(id)) return getIconifySvgMap.get(id);
|
|
1613
|
+
const promise = _get().then((svg$2) => {
|
|
1614
|
+
getIconifySvgMap.set(id, svg$2);
|
|
1615
|
+
return svg$2;
|
|
1616
|
+
});
|
|
1617
|
+
getIconifySvgMap.set(id, promise);
|
|
1618
|
+
return promise;
|
|
1619
|
+
async function _get() {
|
|
1620
|
+
const url = `https://api.iconify.design/${collection}/${icon}.svg?color=currentColor&width=full`;
|
|
1621
|
+
const svg$2 = await fetch(url).then((res) => res.text());
|
|
1622
|
+
return purify.sanitize(svg$2);
|
|
1623
|
+
}
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
//#endregion
|
|
1627
|
+
//#region src/client/webcomponents/components/IconifyIcon.vue
|
|
1628
|
+
const _hoisted_1$2 = ["innerHTML"];
|
|
1629
|
+
const _hoisted_2 = ["src"];
|
|
1630
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
1631
|
+
__name: "IconifyIcon",
|
|
1632
|
+
props: { icon: {} },
|
|
1633
|
+
setup(__props) {
|
|
1634
|
+
const props = __props;
|
|
1635
|
+
const isUrlIcon = computed(() => props.icon.includes("/") || props.icon.startsWith("data:") || props.icon.startsWith("builtin:"));
|
|
1636
|
+
const iconifyParsed = computed(() => {
|
|
1637
|
+
if (isUrlIcon.value) return void 0;
|
|
1638
|
+
const match = props.icon.match(/^(?:i-)?([\w-]+):([\w-]+)$/);
|
|
1639
|
+
if (!match) return void 0;
|
|
1640
|
+
return {
|
|
1641
|
+
collection: match[1],
|
|
1642
|
+
icon: match[2]
|
|
1643
|
+
};
|
|
1644
|
+
});
|
|
1645
|
+
const iconifyLoaded = ref(void 0);
|
|
1646
|
+
watchEffect(async () => {
|
|
1647
|
+
if (!iconifyParsed.value) {
|
|
1648
|
+
iconifyLoaded.value = void 0;
|
|
1649
|
+
return;
|
|
1650
|
+
}
|
|
1651
|
+
iconifyLoaded.value = await getIconifySvg(iconifyParsed.value.collection, iconifyParsed.value.icon);
|
|
1652
|
+
});
|
|
1653
|
+
return (_ctx, _cache) => {
|
|
1654
|
+
return iconifyParsed.value ? (openBlock(), createElementBlock("div", {
|
|
1655
|
+
key: 0,
|
|
1656
|
+
innerHTML: iconifyLoaded.value
|
|
1657
|
+
}, null, 8, _hoisted_1$2)) : (openBlock(), createElementBlock("img", {
|
|
1658
|
+
key: 1,
|
|
1659
|
+
src: __props.icon,
|
|
1660
|
+
class: "w-full h-full m-auto",
|
|
1661
|
+
draggable: "false"
|
|
1662
|
+
}, null, 8, _hoisted_2));
|
|
1663
|
+
};
|
|
1664
|
+
}
|
|
1665
|
+
});
|
|
1666
|
+
var IconifyIcon_default = _sfc_main$2;
|
|
1667
|
+
|
|
1668
|
+
//#endregion
|
|
1669
|
+
//#region src/client/webcomponents/components/icons/VitePlusCore.vue
|
|
1670
|
+
const _sfc_main$1 = {};
|
|
1671
|
+
const _hoisted_1$1 = {
|
|
1672
|
+
viewBox: "0 0 22 22",
|
|
1673
|
+
fill: "none",
|
|
1674
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1675
|
+
};
|
|
1676
|
+
function _sfc_render(_ctx, _cache) {
|
|
1677
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$1, [..._cache[0] || (_cache[0] = [createStaticVNode("<g clip-path=\"url(#clip0_2_2)\"><path d=\"M11.85 20.535C11.7881 20.6144 11.7029 20.6726 11.6064 20.7012C11.5098 20.7298 11.4067 20.7276 11.3115 20.6947C11.2163 20.6619 11.1337 20.6001 11.0754 20.5181C11.017 20.436 10.9858 20.3377 10.986 20.237V15.834C10.986 15.5775 10.8841 15.3316 10.7028 15.1502C10.5214 14.9689 10.2755 14.867 10.019 14.867H5.157C5.06821 14.867 4.98114 14.8426 4.90534 14.7964C4.82954 14.7501 4.76795 14.6839 4.72734 14.6049C4.68673 14.526 4.66866 14.4374 4.67513 14.3488C4.6816 14.2603 4.71235 14.1752 4.764 14.103L7.961 9.62801C8.06459 9.48335 8.12626 9.31291 8.13923 9.13546C8.15219 8.95801 8.11594 8.78042 8.03448 8.62224C7.95301 8.46406 7.82948 8.33143 7.67749 8.23893C7.52549 8.14644 7.35093 8.09768 7.173 8.09801H1.29C1.20122 8.09803 1.11414 8.07359 1.03834 8.02736C0.962542 7.98113 0.900953 7.91489 0.86034 7.83594C0.819727 7.75699 0.801662 7.66837 0.80813 7.57982C0.814597 7.49127 0.845347 7.40622 0.897 7.33401L5.04 1.53301C5.08452 1.46999 5.14358 1.41864 5.21217 1.38331C5.28075 1.34797 5.35685 1.32969 5.434 1.33001H17.782C18.175 1.33001 18.404 1.77501 18.175 2.09401L14.978 6.57001C14.521 7.21001 14.978 8.10001 15.766 8.10001H20.627C21.031 8.10001 21.257 8.56401 21.007 8.88201L11.85 20.535Z\" fill=\"#6254FE\"></path><mask id=\"mask0_2_2\" style=\"mask-type:alpha;\" maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"1\" width=\"22\" height=\"20\"><path d=\"M11.85 20.535C11.7881 20.6144 11.7029 20.6726 11.6064 20.7012C11.5098 20.7298 11.4067 20.7276 11.3115 20.6947C11.2163 20.6619 11.1337 20.6001 11.0754 20.5181C11.017 20.436 10.9858 20.3377 10.986 20.237V15.834C10.986 15.5775 10.8841 15.3316 10.7028 15.1502C10.5214 14.9689 10.2755 14.867 10.019 14.867H5.157C5.06821 14.867 4.98114 14.8426 4.90534 14.7964C4.82954 14.7501 4.76795 14.6839 4.72734 14.6049C4.68673 14.526 4.66866 14.4374 4.67513 14.3488C4.6816 14.2603 4.71235 14.1752 4.764 14.103L7.961 9.62801C8.06459 9.48335 8.12626 9.31291 8.13923 9.13546C8.15219 8.95801 8.11594 8.78042 8.03448 8.62224C7.95301 8.46406 7.82948 8.33143 7.67749 8.23893C7.52549 8.14644 7.35093 8.09768 7.173 8.09801H1.29C1.20122 8.09803 1.11414 8.07359 1.03834 8.02736C0.962542 7.98113 0.900953 7.91489 0.86034 7.83594C0.819727 7.75699 0.801662 7.66837 0.80813 7.57982C0.814597 7.49127 0.845347 7.40622 0.897 7.33401L5.04 1.53301C5.08452 1.46999 5.14358 1.41864 5.21217 1.38331C5.28075 1.34797 5.35685 1.32969 5.434 1.33001H17.782C18.175 1.33001 18.404 1.77501 18.175 2.09401L14.978 6.57001C14.521 7.21001 14.978 8.10001 15.766 8.10001H20.627C21.031 8.10001 21.257 8.56401 21.007 8.88201L11.85 20.535Z\" fill=\"#833BFF\"></path></mask><g mask=\"url(#mask0_2_2)\"><g filter=\"url(#filter0_f_2_2)\"><path d=\"M11.4271 17.1119C11.4313 18.412 8.62134 19.475 5.1508 19.4863C1.68026 19.4975 -1.13659 18.4528 -1.14081 17.1527C-1.14503 15.8526 1.66497 14.7896 5.13551 14.7783C8.60605 14.767 11.4229 15.8118 11.4271 17.1119Z\" fill=\"#EDE6FF\"></path></g><g filter=\"url(#filter1_f_2_2)\"><path d=\"M9.48364 9.06048C9.49161 11.5148 3.78614 13.523 -3.25987 13.5459C-10.3059 13.5688 -16.0243 11.5977 -16.0322 9.14332C-16.0402 6.68898 -10.3347 4.6808 -3.28872 4.65792C3.75729 4.63505 9.47567 6.60614 9.48364 9.06048Z\" fill=\"#EDE6FF\"></path></g><g filter=\"url(#filter2_f_2_2)\"><path d=\"M9.53104 8.43813C9.53526 9.7382 3.70543 10.8111 -3.49025 10.8344C-10.6859 10.8578 -16.5226 9.82279 -16.5268 8.52272C-16.531 7.22265 -10.7012 6.1498 -3.50554 6.12644C3.69014 6.10308 9.52682 7.13806 9.53104 8.43813Z\" fill=\"#4E14FF\"></path></g><g filter=\"url(#filter3_f_2_2)\"><path d=\"M11.5916 16.1293C11.5958 17.4293 5.74448 18.5022 -1.47775 18.5256C-8.69997 18.549 -14.5582 17.5141 -14.5624 16.214C-14.5666 14.9139 -8.71523 13.841 -1.493 13.8176C5.72923 13.7942 11.5874 14.8292 11.5916 16.1293Z\" fill=\"#4E14FF\"></path></g><g filter=\"url(#filter4_f_2_2)\"><path d=\"M12.2473 16.6206C12.2515 17.9206 6.40021 18.9935 -0.821978 19.017C-8.04417 19.0404 -13.9023 18.0055 -13.9066 16.7055C-13.9108 15.4054 -8.05945 14.3325 -0.837261 14.309C6.38493 14.2856 12.2431 15.3205 12.2473 16.6206Z\" fill=\"#4E14FF\"></path></g><g filter=\"url(#filter5_f_2_2)\"><path d=\"M14.047 5.7039C14.2411 2.38813 18.6158 -0.0529585 23.8183 0.251568C29.0207 0.556095 33.0808 3.49092 32.8867 6.80669C32.6926 10.1225 28.3179 12.5635 23.1154 12.259C17.913 11.9545 13.8529 9.01966 14.047 5.7039Z\" fill=\"#EDE6FF\"></path></g><g filter=\"url(#filter6_f_2_2)\"><path d=\"M14.7518 7.88531C14.7376 7.06639 18.8396 6.33138 23.9137 6.2436C28.9879 6.15583 33.1129 6.74854 33.127 7.56745C33.1412 8.38637 29.0392 9.12139 23.965 9.20916C18.8909 9.29693 14.7659 8.70422 14.7518 7.88531Z\" fill=\"#4E14FF\"></path></g><g filter=\"url(#filter7_f_2_2)\"><path d=\"M14.7518 7.88531C14.7376 7.06639 18.8396 6.33138 23.9137 6.2436C28.9879 6.15583 33.1129 6.74854 33.127 7.56745C33.1412 8.38637 29.0392 9.12139 23.965 9.20916C18.8909 9.29693 14.7659 8.70422 14.7518 7.88531Z\" fill=\"#4E14FF\"></path></g><g filter=\"url(#filter8_f_2_2)\"><path d=\"M-6.98848 14.7616C-6.18615 15.4233 -1.99229 11.6626 2.37876 6.362C6.74982 1.06138 9.64283 -3.77199 8.84049 -4.43362C8.03816 -5.09525 3.8443 -1.3346 -0.526755 3.96602C-4.89781 9.26665 -7.79082 14.1 -6.98848 14.7616Z\" fill=\"#4E14FF\"></path></g><g filter=\"url(#filter9_f_2_2)\"><path d=\"M13.4305 8.5449C14.2512 9.18361 18.3372 5.30605 22.5568 -0.115883C26.7764 -5.53781 29.5318 -10.4509 28.7111 -11.0896C27.8904 -11.7284 23.8044 -7.8508 19.5848 -2.42887C15.3651 2.99306 12.6098 7.90619 13.4305 8.5449Z\" fill=\"#4E14FF\"></path></g><g filter=\"url(#filter10_f_2_2)\"><path d=\"M14.9501 9.73878C16.4926 10.9392 19.2111 10.026 21.0221 7.69897C22.8331 5.37198 23.0507 2.51245 21.5083 1.31202C19.9658 0.111596 17.2473 1.02485 15.4363 3.35184C13.6253 5.67882 13.4077 8.53835 14.9501 9.73878Z\" fill=\"#2BFDD2\"></path></g><g filter=\"url(#filter11_f_2_2)\"><path d=\"M-7.68233 27.5293C-6.86163 28.168 -2.77563 24.2904 1.44401 18.8685C5.66365 13.4466 8.41904 8.53346 7.59834 7.89474C6.77764 7.25603 2.69164 11.1336 -1.528 16.5555C-5.74764 21.9775 -8.50303 26.8906 -7.68233 27.5293Z\" fill=\"#4E14FF\"></path></g><g filter=\"url(#filter12_f_2_2)\"><path d=\"M-7.68233 27.5293C-6.86163 28.168 -2.77563 24.2904 1.44401 18.8685C5.66365 13.4466 8.41904 8.53346 7.59834 7.89474C6.77764 7.25603 2.69164 11.1336 -1.528 16.5555C-5.74764 21.9775 -8.50303 26.8906 -7.68233 27.5293Z\" fill=\"#4E14FF\"></path></g><g filter=\"url(#filter13_f_2_2)\"><path d=\"M8.26366 23.8563C9.13579 24.535 13.2635 20.6899 17.4831 15.268C21.7028 9.84604 24.4165 4.90047 23.5443 4.22173C22.6722 3.54299 18.5445 7.38811 14.3249 12.81C10.1052 18.232 7.39153 23.1775 8.26366 23.8563Z\" fill=\"#4E14FF\"></path></g><g filter=\"url(#filter14_f_2_2)\"><path d=\"M12.2866 22.5389C13.7846 23.7047 17.4746 21.4689 20.5284 17.5449C23.5822 13.621 24.8434 9.49495 23.3454 8.32912C21.8474 7.16329 18.1574 9.39917 15.1036 13.3231C12.0498 17.247 10.7886 21.3731 12.2866 22.5389Z\" fill=\"#2BFDD2\"></path></g></g></g><defs><filter id=\"filter0_f_2_2\" x=\"-7.68682\" y=\"8.2322\" width=\"25.6599\" height=\"17.8002\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\"><feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"></feFlood><feBlend mode=\"normal\" in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"></feBlend><feGaussianBlur stdDeviation=\"3.273\" result=\"effect1_foregroundBlur_2_2\"></feGaussianBlur></filter><filter id=\"filter1_f_2_2\" x=\"-22.5782\" y=\"-1.88827\" width=\"38.6079\" height=\"21.9804\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\"><feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"></feFlood><feBlend mode=\"normal\" in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"></feBlend><feGaussianBlur stdDeviation=\"3.273\" result=\"effect1_foregroundBlur_2_2\"></feGaussianBlur></filter><filter id=\"filter2_f_2_2\" x=\"-20.4548\" y=\"2.19805\" width=\"33.9139\" height=\"12.5647\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\"><feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"></feFlood><feBlend mode=\"normal\" in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"></feBlend><feGaussianBlur stdDeviation=\"1.964\" result=\"effect1_foregroundBlur_2_2\"></feGaussianBlur></filter><filter id=\"filter3_f_2_2\" x=\"-18.4904\" y=\"9.88925\" width=\"34.01\" height=\"12.5648\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\"><feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"></feFlood><feBlend mode=\"normal\" in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"></feBlend><feGaussianBlur stdDeviation=\"1.964\" result=\"effect1_foregroundBlur_2_2\"></feGaussianBlur></filter><filter id=\"filter4_f_2_2\" x=\"-17.8346\" y=\"10.3806\" width=\"34.0099\" height=\"12.5648\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\"><feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"></feFlood><feBlend mode=\"normal\" in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"></feBlend><feGaussianBlur stdDeviation=\"1.964\" result=\"effect1_foregroundBlur_2_2\"></feGaussianBlur></filter><filter id=\"filter5_f_2_2\" x=\"7.4943\" y=\"-6.32009\" width=\"31.9451\" height=\"25.1508\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\"><feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"></feFlood><feBlend mode=\"normal\" in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"></feBlend><feGaussianBlur stdDeviation=\"3.273\" result=\"effect1_foregroundBlur_2_2\"></feGaussianBlur></filter><filter id=\"filter6_f_2_2\" x=\"10.8237\" y=\"2.30699\" width=\"26.2313\" height=\"10.8388\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\"><feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"></feFlood><feBlend mode=\"normal\" in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"></feBlend><feGaussianBlur stdDeviation=\"1.964\" result=\"effect1_foregroundBlur_2_2\"></feGaussianBlur></filter><filter id=\"filter7_f_2_2\" x=\"10.8237\" y=\"2.30699\" width=\"26.2313\" height=\"10.8388\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\"><feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"></feFlood><feBlend mode=\"normal\" in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"></feBlend><feGaussianBlur stdDeviation=\"1.964\" result=\"effect1_foregroundBlur_2_2\"></feGaussianBlur></filter><filter id=\"filter8_f_2_2\" x=\"-11.0501\" y=\"-8.43711\" width=\"23.9523\" height=\"27.2022\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\"><feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"></feFlood><feBlend mode=\"normal\" in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"></feBlend><feGaussianBlur stdDeviation=\"1.964\" result=\"effect1_foregroundBlur_2_2\"></feGaussianBlur></filter><filter id=\"filter9_f_2_2\" x=\"9.35783\" y=\"-15.0865\" width=\"23.4259\" height=\"27.6282\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\"><feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"></feFlood><feBlend mode=\"normal\" in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"></feBlend><feGaussianBlur stdDeviation=\"1.964\" result=\"effect1_foregroundBlur_2_2\"></feGaussianBlur></filter><filter id=\"filter10_f_2_2\" x=\"9.99386\" y=\"-3.14457\" width=\"16.4707\" height=\"17.3399\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\"><feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"></feFlood><feBlend mode=\"normal\" in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"></feBlend><feGaussianBlur stdDeviation=\"1.964\" result=\"effect1_foregroundBlur_2_2\"></feGaussianBlur></filter><filter id=\"filter11_f_2_2\" x=\"-11.755\" y=\"3.89791\" width=\"23.4259\" height=\"27.6282\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\"><feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"></feFlood><feBlend mode=\"normal\" in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"></feBlend><feGaussianBlur stdDeviation=\"1.964\" result=\"effect1_foregroundBlur_2_2\"></feGaussianBlur></filter><filter id=\"filter12_f_2_2\" x=\"-11.755\" y=\"3.89791\" width=\"23.4259\" height=\"27.6282\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\"><feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"></feFlood><feBlend mode=\"normal\" in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"></feBlend><feGaussianBlur stdDeviation=\"1.964\" result=\"effect1_foregroundBlur_2_2\"></feGaussianBlur></filter><filter id=\"filter13_f_2_2\" x=\"4.17262\" y=\"0.216058\" width=\"23.4628\" height=\"27.6459\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\"><feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"></feFlood><feBlend mode=\"normal\" in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"></feBlend><feGaussianBlur stdDeviation=\"1.964\" result=\"effect1_foregroundBlur_2_2\"></feGaussianBlur></filter><filter id=\"filter14_f_2_2\" x=\"7.72776\" y=\"4.09222\" width=\"20.1765\" height=\"22.6836\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\"><feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"></feFlood><feBlend mode=\"normal\" in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"></feBlend><feGaussianBlur stdDeviation=\"1.964\" result=\"effect1_foregroundBlur_2_2\"></feGaussianBlur></filter><clipPath id=\"clip0_2_2\"><rect width=\"22\" height=\"22\" fill=\"white\"></rect></clipPath></defs>", 2)])]);
|
|
1678
|
+
}
|
|
1679
|
+
var VitePlusCore_default = /* @__PURE__ */ export_helper_default(_sfc_main$1, [["render", _sfc_render]]);
|
|
1680
|
+
|
|
1681
|
+
//#endregion
|
|
1682
|
+
//#region src/client/webcomponents/components/DockIcon.vue
|
|
1683
|
+
const _hoisted_1 = { key: 1 };
|
|
1684
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
1685
|
+
__name: "DockIcon",
|
|
1686
|
+
props: {
|
|
1687
|
+
icon: {},
|
|
1688
|
+
title: {}
|
|
1689
|
+
},
|
|
1690
|
+
setup(__props) {
|
|
1691
|
+
const props = __props;
|
|
1692
|
+
const icon = computed(() => {
|
|
1693
|
+
if (typeof props.icon === "string") return {
|
|
1694
|
+
dark: props.icon,
|
|
1695
|
+
light: props.icon
|
|
1696
|
+
};
|
|
1697
|
+
return props.icon;
|
|
1698
|
+
});
|
|
1699
|
+
return (_ctx, _cache) => {
|
|
1700
|
+
return icon.value.light === "builtin:vite-plus-core" ? (openBlock(), createBlock(VitePlusCore_default, { key: 0 })) : (openBlock(), createElementBlock("div", _hoisted_1, [icon.value.light === icon.value.dark ? (openBlock(), createBlock(IconifyIcon_default, {
|
|
1701
|
+
key: 0,
|
|
1702
|
+
icon: icon.value.light,
|
|
1703
|
+
title: __props.title
|
|
1704
|
+
}, null, 8, ["icon", "title"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createVNode(IconifyIcon_default, {
|
|
1705
|
+
class: "dark-hidden",
|
|
1706
|
+
icon: icon.value.light,
|
|
1707
|
+
title: __props.title
|
|
1708
|
+
}, null, 8, ["icon", "title"]), createVNode(IconifyIcon_default, {
|
|
1709
|
+
class: "light-hidden",
|
|
1710
|
+
icon: icon.value.dark,
|
|
1711
|
+
title: __props.title
|
|
1712
|
+
}, null, 8, ["icon", "title"])], 64))]));
|
|
1713
|
+
};
|
|
1714
|
+
}
|
|
1715
|
+
});
|
|
1716
|
+
var DockIcon_default = _sfc_main;
|
|
1717
|
+
|
|
1718
|
+
//#endregion
|
|
1719
|
+
export { VitePlusCore_default as n, DockIcon_default as t };
|