html-minifier-next 6.2.8 → 6.2.9

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.
@@ -8,14 +8,15 @@ declare namespace _default {
8
8
  export default _default;
9
9
  /**
10
10
  * Representation of an attribute from the HTML parser.
11
+ * Internal counterpart: `HTMLAttribute` in `lib/attributes.js`—keep in sync.
11
12
  */
12
13
  export type HTMLAttribute = {
13
14
  name: string;
14
- value?: string | undefined;
15
- quote?: string | undefined;
16
- customAssign?: string | undefined;
17
- customOpen?: string | undefined;
18
- customClose?: string | undefined;
15
+ value?: string;
16
+ quote?: string;
17
+ customAssign?: string;
18
+ customOpen?: string;
19
+ customClose?: string;
19
20
  };
20
21
  /**
21
22
  * Options that control how HTML is minified. All of these are optional
@@ -28,14 +29,14 @@ export type MinifierOptions = {
28
29
  *
29
30
  * Default: Built-in `canCollapseWhitespace` function
30
31
  */
31
- canCollapseWhitespace?: ((tag: string, attrs: HTMLAttribute[], canCollapseWhitespace: (tag: string) => boolean) => boolean) | undefined;
32
+ canCollapseWhitespace?: (tag: string, attrs: HTMLAttribute[], canCollapseWhitespace: (tag: string) => boolean) => boolean;
32
33
  /**
33
34
  * Predicate that determines whether leading/trailing whitespace around
34
35
  * the element may be trimmed.
35
36
  *
36
37
  * Default: Built-in `canTrimWhitespace` function
37
38
  */
38
- canTrimWhitespace?: ((tag: string | null, attrs: HTMLAttribute[] | undefined, canTrimWhitespace: (tag: string) => boolean) => boolean) | undefined;
39
+ canTrimWhitespace?: (tag: string | null, attrs: HTMLAttribute[] | undefined, canTrimWhitespace: (tag: string) => boolean) => boolean;
39
40
  /**
40
41
  * The maximum number of entries for the CSS minification cache. Higher values
41
42
  * improve performance for inputs with repeated CSS (e.g., batch processing).
@@ -45,7 +46,7 @@ export type MinifierOptions = {
45
46
  *
46
47
  * Default: `500`
47
48
  */
48
- cacheCSS?: number | undefined;
49
+ cacheCSS?: number;
49
50
  /**
50
51
  * The maximum number of entries for the JavaScript minification cache. Higher
51
52
  * values improve performance for inputs with repeated JavaScript.
@@ -55,7 +56,7 @@ export type MinifierOptions = {
55
56
  *
56
57
  * Default: `500`
57
58
  */
58
- cacheJS?: number | undefined;
59
+ cacheJS?: number;
59
60
  /**
60
61
  * The maximum number of entries for the SVG minification cache. Higher
61
62
  * values improve performance for inputs with repeated SVG content.
@@ -65,7 +66,7 @@ export type MinifierOptions = {
65
66
  *
66
67
  * Default: `500`
67
68
  */
68
- cacheSVG?: number | undefined;
69
+ cacheSVG?: number;
69
70
  /**
70
71
  * When true, tag and attribute names are treated as case-sensitive.
71
72
  * Useful for custom HTML tags.
@@ -73,7 +74,7 @@ export type MinifierOptions = {
73
74
  *
74
75
  * Default: `false`
75
76
  */
76
- caseSensitive?: boolean | undefined;
77
+ caseSensitive?: boolean;
77
78
  /**
78
79
  * Collapse multiple whitespace characters within attribute values into a
79
80
  * single space. Also trims leading and trailing whitespace from attribute
@@ -82,7 +83,7 @@ export type MinifierOptions = {
82
83
  *
83
84
  * Default: `false`
84
85
  */
85
- collapseAttributeWhitespace?: boolean | undefined;
86
+ collapseAttributeWhitespace?: boolean;
86
87
  /**
87
88
  * Collapse boolean attributes to their name only (for example
88
89
  * `disabled="disabled"` → `disabled`).
@@ -90,7 +91,7 @@ export type MinifierOptions = {
90
91
  *
91
92
  * Default: `false`
92
93
  */
93
- collapseBooleanAttributes?: boolean | undefined;
94
+ collapseBooleanAttributes?: boolean;
94
95
  /**
95
96
  * When false (default) whitespace around `inline` tags is preserved in
96
97
  * more cases. When true, whitespace around inline tags may be collapsed.
@@ -98,7 +99,7 @@ export type MinifierOptions = {
98
99
  *
99
100
  * Default: `false`
100
101
  */
101
- collapseInlineTagWhitespace?: boolean | undefined;
102
+ collapseInlineTagWhitespace?: boolean;
102
103
  /**
103
104
  * Collapse multiple whitespace characters into one where allowed. Also
104
105
  * controls trimming behaviour in several code paths.
@@ -106,7 +107,7 @@ export type MinifierOptions = {
106
107
  *
107
108
  * Default: `false`
108
109
  */
109
- collapseWhitespace?: boolean | undefined;
110
+ collapseWhitespace?: boolean;
110
111
  /**
111
112
  * If true, be conservative when collapsing whitespace (preserve more
112
113
  * whitespace in edge cases). Affects collapse algorithms.
@@ -114,7 +115,7 @@ export type MinifierOptions = {
114
115
  *
115
116
  * Default: `false`
116
117
  */
117
- conservativeCollapse?: boolean | undefined;
118
+ conservativeCollapse?: boolean;
118
119
  /**
119
120
  * When set to `false`, minification errors may throw.
120
121
  * By default, the minifier will attempt to recover from minification
@@ -122,14 +123,14 @@ export type MinifierOptions = {
122
123
  *
123
124
  * Default: `true`
124
125
  */
125
- continueOnMinifyError?: boolean | undefined;
126
+ continueOnMinifyError?: boolean;
126
127
  /**
127
128
  * When true, the parser will attempt to continue on recoverable parse
128
129
  * errors. Otherwise, parsing errors may throw.
129
130
  *
130
131
  * Default: `false`
131
132
  */
132
- continueOnParseError?: boolean | undefined;
133
+ continueOnParseError?: boolean;
133
134
  /**
134
135
  * Array of regexes used to recognise custom attribute assignment
135
136
  * operators (e.g. `'<div flex?="{{mode != cover}}"></div>'`).
@@ -137,40 +138,40 @@ export type MinifierOptions = {
137
138
  *
138
139
  * Default: `[]`
139
140
  */
140
- customAttrAssign?: RegExp[] | undefined;
141
+ customAttrAssign?: RegExp[];
141
142
  /**
142
143
  * Regex matching attribute names whose values should be collapsed.
143
144
  * Basically used to remove newlines and excess spaces inside attribute values,
144
145
  * e.g. `/ng-class/`.
145
146
  */
146
- customAttrCollapse?: RegExp | undefined;
147
+ customAttrCollapse?: RegExp;
147
148
  /**
148
149
  * Array of `[openRegExp, closeRegExp]` pairs used by the parser to
149
150
  * detect custom attribute surround patterns (for non-standard syntaxes,
150
151
  * e.g. `<input {{#if value}}checked="checked"{{/if}}>`).
151
152
  */
152
- customAttrSurround?: [RegExp, RegExp][] | undefined;
153
+ customAttrSurround?: [RegExp, RegExp][];
153
154
  /**
154
155
  * Array of regexes used to detect event handler attributes for `minifyJS`
155
156
  * (e.g. `ng-click`). The default matches standard `on…` event attributes.
156
157
  *
157
158
  * Default: `[/^on[a-z]{3,}$/]`
158
159
  */
159
- customEventAttributes?: RegExp[] | undefined;
160
+ customEventAttributes?: RegExp[];
160
161
  /**
161
162
  * Limits the quantifier used when building a safe regex for custom
162
163
  * fragments to avoid ReDoS. See source use for details.
163
164
  *
164
165
  * Default: `200`
165
166
  */
166
- customFragmentQuantifierLimit?: number | undefined;
167
+ customFragmentQuantifierLimit?: number;
167
168
  /**
168
169
  * When true, decodes HTML entities in text and attributes before
169
170
  * processing, and re-encodes ambiguous ampersands when outputting.
170
171
  *
171
172
  * Default: `false`
172
173
  */
173
- decodeEntities?: boolean | undefined;
174
+ decodeEntities?: boolean;
174
175
  /**
175
176
  * Comments matching any pattern in this array of regexes will be
176
177
  * preserved when `removeComments` is enabled. The default preserves
@@ -178,7 +179,7 @@ export type MinifierOptions = {
178
179
  *
179
180
  * Default: `[/^!/, /^\s*#/]`
180
181
  */
181
- ignoreCustomComments?: RegExp[] | undefined;
182
+ ignoreCustomComments?: RegExp[];
182
183
  /**
183
184
  * Array of regexes used to identify fragments that should be
184
185
  * preserved (for example server templates). These fragments are temporarily
@@ -187,27 +188,27 @@ export type MinifierOptions = {
187
188
  *
188
189
  * Default: `[/<%[\s\S]*?%>/, /<\?[\s\S]*?\?>/]`
189
190
  */
190
- ignoreCustomFragments?: RegExp[] | undefined;
191
+ ignoreCustomFragments?: RegExp[];
191
192
  /**
192
193
  * If false, tags marked as auto-generated by the parser will be omitted
193
194
  * from output. Useful to skip injected tags.
194
195
  *
195
196
  * Default: `false`
196
197
  */
197
- includeAutoGeneratedTags?: boolean | undefined;
198
+ includeAutoGeneratedTags?: boolean;
198
199
  /**
199
200
  * Collection of custom element tag names that should be treated as inline
200
201
  * elements for white-space handling, alongside the built-in inline elements.
201
202
  *
202
203
  * Default: `[]`
203
204
  */
204
- inlineCustomElements?: ArrayLike<string> | undefined;
205
+ inlineCustomElements?: ArrayLike<string>;
205
206
  /**
206
207
  * Preserve the trailing slash in self-closing tags when present.
207
208
  *
208
209
  * Default: `false`
209
210
  */
210
- keepClosingSlash?: boolean | undefined;
211
+ keepClosingSlash?: boolean;
211
212
  /**
212
213
  * Logging function used by the minifier for warnings/errors/info.
213
214
  * You can directly provide `console.log`, but `message` may also be an `Error`
@@ -215,7 +216,7 @@ export type MinifierOptions = {
215
216
  *
216
217
  * Default: `() => {}` (no-op function)
217
218
  */
218
- log?: ((message: unknown) => void) | undefined;
219
+ log?: (message: unknown) => void;
219
220
  /**
220
221
  * The maximum allowed input length. Used as a guard against ReDoS via
221
222
  * pathological inputs. If the input exceeds this length an error is
@@ -223,14 +224,14 @@ export type MinifierOptions = {
223
224
  *
224
225
  * Default: No limit
225
226
  */
226
- maxInputLength?: number | undefined;
227
+ maxInputLength?: number;
227
228
  /**
228
229
  * Maximum line length for the output. When set the minifier will wrap
229
230
  * output to the given number of characters where possible.
230
231
  *
231
232
  * Default: No limit
232
233
  */
233
- maxLineLength?: number | undefined;
234
+ maxLineLength?: number;
234
235
  /**
235
236
  * When true, consecutive inline `<script>` elements are merged into one.
236
237
  * Only merges compatible scripts (same `type`, matching `async`/`defer`/
@@ -238,7 +239,7 @@ export type MinifierOptions = {
238
239
  *
239
240
  * Default: `false`
240
241
  */
241
- mergeScripts?: boolean | undefined;
242
+ mergeScripts?: boolean;
242
243
  /**
243
244
  * When true, enables CSS minification for inline `<style>` tags or
244
245
  * `style` attributes. If an object is provided, it is passed to
@@ -248,7 +249,7 @@ export type MinifierOptions = {
248
249
  *
249
250
  * Default: `false`
250
251
  */
251
- minifyCSS?: boolean | Partial<import("lightningcss").TransformOptions<import("lightningcss").CustomAtRules>> | ((text: string, type?: string) => Promise<string> | string) | undefined;
252
+ minifyCSS?: boolean | Partial<import("lightningcss").TransformOptions<import("lightningcss").CustomAtRules>> | ((text: string, type?: string) => Promise<string> | string);
252
253
  /**
253
254
  * When true, enables JS minification for `<script>` contents and
254
255
  * event handler attributes. If an object is provided, it can include:
@@ -263,9 +264,9 @@ export type MinifierOptions = {
263
264
  * Default: `false`
264
265
  */
265
266
  minifyJS?: boolean | import("terser").MinifyOptions | {
266
- [key: string]: any;
267
267
  engine?: "terser" | "swc";
268
- } | ((text: string, inline?: boolean) => Promise<string> | string) | undefined;
268
+ [key: string]: any;
269
+ } | ((text: string, inline?: boolean) => Promise<string> | string);
269
270
  /**
270
271
  * When true, enables URL rewriting/minification. If an object is provided,
271
272
  * the `site` property sets the base URL for computing relative paths.
@@ -275,9 +276,9 @@ export type MinifierOptions = {
275
276
  *
276
277
  * Default: `false`
277
278
  */
278
- minifyURLs?: string | boolean | {
279
+ minifyURLs?: boolean | string | {
279
280
  site?: string;
280
- } | ((text: string) => Promise<string> | string) | undefined;
281
+ } | ((text: string) => Promise<string> | string);
281
282
  /**
282
283
  * When true, enables SVG minification using [SVGO](https://github.com/svg/svgo).
283
284
  * Complete SVG subtrees are extracted and optimized as a block.
@@ -286,7 +287,7 @@ export type MinifierOptions = {
286
287
  *
287
288
  * Default: `false`
288
289
  */
289
- minifySVG?: boolean | Object | undefined;
290
+ minifySVG?: boolean | Object;
290
291
  /**
291
292
  * Function used to normalise tag/attribute names. By default, this lowercases
292
293
  * names, unless `caseSensitive` is enabled.
@@ -294,14 +295,14 @@ export type MinifierOptions = {
294
295
  * Default: `(name) => name.toLowerCase()`,
295
296
  * or `(name) => name` (no-op function) if `caseSensitive` is enabled.
296
297
  */
297
- name?: ((name: string) => string) | undefined;
298
+ name?: (name: string) => string;
298
299
  /**
299
300
  * When wrapping lines, prevent inserting a newline directly before a
300
301
  * closing tag (useful to keep tags like `</a>` on the same line).
301
302
  *
302
303
  * Default: `false`
303
304
  */
304
- noNewlinesBeforeTagClose?: boolean | undefined;
305
+ noNewlinesBeforeTagClose?: boolean;
305
306
  /**
306
307
  * When true, treat input as a partial HTML fragment rather than a complete
307
308
  * document. This preserves stray end tags (closing tags without corresponding
@@ -311,7 +312,7 @@ export type MinifierOptions = {
311
312
  *
312
313
  * Default: `false`
313
314
  */
314
- partialMarkup?: boolean | undefined;
315
+ partialMarkup?: boolean;
315
316
  /**
316
317
  * Preserve a single line break at the start/end of text nodes when
317
318
  * collapsing/trimming whitespace.
@@ -319,14 +320,14 @@ export type MinifierOptions = {
319
320
  *
320
321
  * Default: `false`
321
322
  */
322
- preserveLineBreaks?: boolean | undefined;
323
+ preserveLineBreaks?: boolean;
323
324
  /**
324
325
  * When true, attribute values will not be HTML-escaped (dangerous for
325
326
  * untrusted input). By default, attributes are escaped.
326
327
  *
327
328
  * Default: `false`
328
329
  */
329
- preventAttributesEscaping?: boolean | undefined;
330
+ preventAttributesEscaping?: boolean;
330
331
  /**
331
332
  * Array of `type` attribute values for `<script>` elements whose contents
332
333
  * should be processed as HTML
@@ -336,21 +337,21 @@ export type MinifierOptions = {
336
337
  *
337
338
  * Default: `[]`
338
339
  */
339
- processScripts?: string[] | undefined;
340
+ processScripts?: string[];
340
341
  /**
341
342
  * Preferred quote character for attribute values. If unspecified the
342
343
  * minifier picks the safest quote based on the attribute value.
343
344
  *
344
345
  * Default: Auto-detected
345
346
  */
346
- quoteCharacter?: "\"" | "'" | undefined;
347
+ quoteCharacter?: "\"" | "'";
347
348
  /**
348
349
  * Remove quotes around attribute values where it is safe to do so.
349
350
  * See also: https://perfectionkills.com/experimenting-with-html-minifier/#remove_attribute_quotes
350
351
  *
351
352
  * Default: `false`
352
353
  */
353
- removeAttributeQuotes?: boolean | undefined;
354
+ removeAttributeQuotes?: boolean;
354
355
  /**
355
356
  * Remove HTML comments. Comments that match `ignoreCustomComments` will
356
357
  * still be preserved.
@@ -358,7 +359,7 @@ export type MinifierOptions = {
358
359
  *
359
360
  * Default: `false`
360
361
  */
361
- removeComments?: boolean | undefined;
362
+ removeComments?: boolean;
362
363
  /**
363
364
  * If true, removes attributes whose values are empty (some attributes
364
365
  * are excluded by name). Can also be a function to customise which empty
@@ -367,7 +368,7 @@ export type MinifierOptions = {
367
368
  *
368
369
  * Default: `false`
369
370
  */
370
- removeEmptyAttributes?: boolean | ((attrName: string, tag: string) => boolean) | undefined;
371
+ removeEmptyAttributes?: boolean | ((attrName: string, tag: string) => boolean);
371
372
  /**
372
373
  * Remove elements that are empty and safe to remove (for example
373
374
  * `<script />` without `src`).
@@ -375,7 +376,7 @@ export type MinifierOptions = {
375
376
  *
376
377
  * Default: `false`
377
378
  */
378
- removeEmptyElements?: boolean | undefined;
379
+ removeEmptyElements?: boolean;
379
380
  /**
380
381
  * Specifies empty elements to preserve when `removeEmptyElements` is enabled.
381
382
  * Has no effect unless `removeEmptyElements: true`.
@@ -401,7 +402,7 @@ export type MinifierOptions = {
401
402
  *
402
403
  * Default: `[]`
403
404
  */
404
- removeEmptyElementsExcept?: string[] | undefined;
405
+ removeEmptyElementsExcept?: string[];
405
406
  /**
406
407
  * Drop optional start/end tags where the HTML specification permits it
407
408
  * (for example `</li>`, optional `<html>` etc.).
@@ -409,7 +410,7 @@ export type MinifierOptions = {
409
410
  *
410
411
  * Default: `false`
411
412
  */
412
- removeOptionalTags?: boolean | undefined;
413
+ removeOptionalTags?: boolean;
413
414
  /**
414
415
  * Remove attributes that are redundant because they match the element’s
415
416
  * default values (for example `<button type="submit">`).
@@ -417,21 +418,21 @@ export type MinifierOptions = {
417
418
  *
418
419
  * Default: `false`
419
420
  */
420
- removeRedundantAttributes?: boolean | undefined;
421
+ removeRedundantAttributes?: boolean;
421
422
  /**
422
423
  * Remove `type` attributes from `<script>` when they are unnecessary
423
424
  * (e.g. `type="text/javascript"`).
424
425
  *
425
426
  * Default: `false`
426
427
  */
427
- removeScriptTypeAttributes?: boolean | undefined;
428
+ removeScriptTypeAttributes?: boolean;
428
429
  /**
429
430
  * Remove `type` attributes from `<style>` and `<link>` elements when
430
431
  * they are unnecessary (e.g. `type="text/css"`).
431
432
  *
432
433
  * Default: `false`
433
434
  */
434
- removeStyleLinkTypeAttributes?: boolean | undefined;
435
+ removeStyleLinkTypeAttributes?: boolean;
435
436
  /**
436
437
  * **Note that this will result in invalid HTML!**
437
438
  *
@@ -441,7 +442,7 @@ export type MinifierOptions = {
441
442
  *
442
443
  * Default: `false`
443
444
  */
444
- removeTagWhitespace?: boolean | undefined;
445
+ removeTagWhitespace?: boolean;
445
446
  /**
446
447
  * When true, enables sorting of attributes. If a function is provided it
447
448
  * will be used as a custom attribute sorter, which should mutate `attrs`
@@ -450,7 +451,7 @@ export type MinifierOptions = {
450
451
  *
451
452
  * Default: `false`
452
453
  */
453
- sortAttributes?: boolean | ((tag: string, attrs: HTMLAttribute[]) => void) | undefined;
454
+ sortAttributes?: boolean | ((tag: string, attrs: HTMLAttribute[]) => void);
454
455
  /**
455
456
  * When true, enables sorting of class names inside `class` attributes.
456
457
  * If a function is provided, it will be used to transform/sort the class
@@ -459,7 +460,7 @@ export type MinifierOptions = {
459
460
  *
460
461
  * Default: `false`
461
462
  */
462
- sortClassNames?: boolean | ((value: string) => string) | undefined;
463
+ sortClassNames?: boolean | ((value: string) => string);
463
464
  /**
464
465
  * When true, whitespace around ignored custom fragments may be trimmed
465
466
  * more aggressively. This affects how preserved fragments interact with
@@ -467,14 +468,30 @@ export type MinifierOptions = {
467
468
  *
468
469
  * Default: `false`
469
470
  */
470
- trimCustomFragments?: boolean | undefined;
471
+ trimCustomFragments?: boolean;
471
472
  /**
472
473
  * Replace the HTML doctype with the short `<!doctype html>` form.
473
474
  * See also: https://perfectionkills.com/experimenting-with-html-minifier/#use_short_doctype
474
475
  *
475
476
  * Default: `false`
476
477
  */
477
- useShortDoctype?: boolean | undefined;
478
+ useShortDoctype?: boolean;
479
+ /**
480
+ * - Internal: Set when inside SVG/MathML context
481
+ */
482
+ insideSVG?: boolean;
483
+ /**
484
+ * - Internal: Set when inside SVG `foreignObject`
485
+ */
486
+ insideForeignContent?: boolean;
487
+ /**
488
+ * - Internal: Preserved name function during namespace transitions
489
+ */
490
+ parentName?: Function;
491
+ /**
492
+ * - Internal: HTML name function preserved from outer context
493
+ */
494
+ htmlName?: Function;
478
495
  };
479
496
  import { presets } from './presets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;;;;;;;;;gCAOP,MAAM,EAAE;;;;;;;;yBAyBR,OAAO;;;;;;;;gCAOP,OAAO;;;;;;;iCAOP,OAAO;;;;;;;oCAMP,OAAO;;;;;;;;;;0BAMP,OAAO;;;;;;;;;qBASP,OAAO,GAAG,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,IAAI,CAAC;;;;;;;;;qBAQzD,OAAO,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;;;;;;;;0BAQrC,OAAO;;;;;;;sBAOP,OAAO;;;;gBAMP,OAAO;;;;2BACP,OAAO;;;;;;;;;;wBAvdkC,cAAc;0BAAd,cAAc;+BAAd,cAAc"}
@@ -1,8 +1,24 @@
1
1
  export const endTag: RegExp;
2
2
  export class HTMLParser {
3
- constructor(html: any, handler: any);
4
- html: any;
5
- handler: any;
3
+ /**
4
+ * @param {string} html
5
+ * @param {HTMLParserHandler} handler
6
+ */
7
+ constructor(html: string, handler: HTMLParserHandler);
8
+ html: string;
9
+ handler: HTMLParserHandler;
6
10
  parse(): Promise<void>;
7
11
  }
12
+ export type HTMLParserHandler = {
13
+ start?: Function;
14
+ end?: Function;
15
+ chars?: Function;
16
+ comment?: Function;
17
+ doctype?: Function;
18
+ continueOnParseError?: boolean | undefined;
19
+ partialMarkup?: boolean | undefined;
20
+ wantsNextTag?: boolean | undefined;
21
+ customAttrSurround?: RegExp[][] | undefined;
22
+ customAttrAssign?: RegExp[] | undefined;
23
+ };
8
24
  //# sourceMappingURL=htmlparser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"htmlparser.d.ts","sourceRoot":"","sources":["../../src/htmlparser.js"],"names":[],"mappings":"AAqDA,4BAAkE;AA0GlE;IACE,qCAGC;IAFC,UAAgB;IAChB,aAAsB;IAGxB,uBAgnBC;CACF"}
1
+ {"version":3,"file":"htmlparser.d.ts","sourceRoot":"","sources":["../../src/htmlparser.js"],"names":[],"mappings":"AAyEA,4BAAkE;AA2HlE;IACE;;;OAGG;IACH,kBAHW,MAAM,WACN,iBAAiB,EAK3B;IAFC,aAAgB;IAChB,2BAAsB;IAGxB,uBA4nBC;CACF;gCA7zBY;IACR,KAAK,CAAC,WAAW;IACjB,GAAG,CAAC,WAAW;IACf,KAAK,CAAC,WAAW;IACjB,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,WAAW;IACnB,oBAAoB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3C,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACpC,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACnC,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,SAAS,CAAC;IAC5C,gBAAgB,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;CACxC"}