source: imaps-frontend/node_modules/vite/dist/node/chunks/dep-Ba1kN6Mp.js

main
Last change on this file was 0c6b92a, checked in by stefan toskovski <stefantoska84@…>, 5 weeks ago

Pred finalna verzija

  • Property mode set to 100644
File size: 227.2 KB
RevLine 
[0c6b92a]1import { C as commonjsGlobal, B as getDefaultExportFromCjs } from './dep-CB_7IfJ-.js';
[d565449]2import require$$0__default from 'fs';
3import require$$0 from 'postcss';
4import require$$0$1 from 'path';
5import require$$3 from 'crypto';
6import require$$0$2 from 'util';
7import { l as lib } from './dep-IQS-Za7F.js';
8
9import { fileURLToPath as __cjs_fileURLToPath } from 'node:url';
10import { dirname as __cjs_dirname } from 'node:path';
11import { createRequire as __cjs_createRequire } from 'node:module';
12
13const __filename = __cjs_fileURLToPath(import.meta.url);
14const __dirname = __cjs_dirname(__filename);
15const require = __cjs_createRequire(import.meta.url);
16const __require = require;
17function _mergeNamespaces(n, m) {
18 for (var i = 0; i < m.length; i++) {
19 var e = m[i];
20 if (typeof e !== 'string' && !Array.isArray(e)) { for (var k in e) {
21 if (k !== 'default' && !(k in n)) {
22 n[k] = e[k];
23 }
24 } }
25 }
26 return n;
27}
28
29var build = {exports: {}};
30
31var fs = {};
32
33Object.defineProperty(fs, "__esModule", {
34 value: true
35});
36fs.getFileSystem = getFileSystem;
37fs.setFileSystem = setFileSystem;
38let fileSystem = {
39 readFile: () => {
40 throw Error("readFile not implemented");
41 },
42 writeFile: () => {
43 throw Error("writeFile not implemented");
44 }
45};
46
47function setFileSystem(fs) {
48 fileSystem.readFile = fs.readFile;
49 fileSystem.writeFile = fs.writeFile;
50}
51
52function getFileSystem() {
53 return fileSystem;
54}
55
56var pluginFactory = {};
57
58var unquote$1 = {};
59
60Object.defineProperty(unquote$1, "__esModule", {
61 value: true
62});
63unquote$1.default = unquote;
64// copied from https://github.com/lakenen/node-unquote
65const reg = /['"]/;
66
67function unquote(str) {
68 if (!str) {
69 return "";
70 }
71
72 if (reg.test(str.charAt(0))) {
73 str = str.substr(1);
74 }
75
76 if (reg.test(str.charAt(str.length - 1))) {
77 str = str.substr(0, str.length - 1);
78 }
79
80 return str;
81}
82
83var Parser$1 = {};
84
85const matchValueName = /[$]?[\w-]+/g;
86
87const replaceValueSymbols$2 = (value, replacements) => {
88 let matches;
89
90 while ((matches = matchValueName.exec(value))) {
91 const replacement = replacements[matches[0]];
92
93 if (replacement) {
94 value =
95 value.slice(0, matches.index) +
96 replacement +
97 value.slice(matchValueName.lastIndex);
98
99 matchValueName.lastIndex -= matches[0].length - replacement.length;
100 }
101 }
102
103 return value;
104};
105
106var replaceValueSymbols_1 = replaceValueSymbols$2;
107
108const replaceValueSymbols$1 = replaceValueSymbols_1;
109
110const replaceSymbols$1 = (css, replacements) => {
111 css.walk((node) => {
112 if (node.type === "decl" && node.value) {
113 node.value = replaceValueSymbols$1(node.value.toString(), replacements);
114 } else if (node.type === "rule" && node.selector) {
115 node.selector = replaceValueSymbols$1(
116 node.selector.toString(),
117 replacements
118 );
119 } else if (node.type === "atrule" && node.params) {
120 node.params = replaceValueSymbols$1(node.params.toString(), replacements);
121 }
122 });
123};
124
125var replaceSymbols_1 = replaceSymbols$1;
126
127const importPattern = /^:import\(("[^"]*"|'[^']*'|[^"']+)\)$/;
128const balancedQuotes = /^("[^"]*"|'[^']*'|[^"']+)$/;
129
130const getDeclsObject = (rule) => {
131 const object = {};
132
133 rule.walkDecls((decl) => {
134 const before = decl.raws.before ? decl.raws.before.trim() : "";
135
136 object[before + decl.prop] = decl.value;
137 });
138
139 return object;
140};
141/**
142 *
143 * @param {string} css
144 * @param {boolean} removeRules
145 * @param {'auto' | 'rule' | 'at-rule'} mode
146 */
147const extractICSS$2 = (css, removeRules = true, mode = "auto") => {
148 const icssImports = {};
149 const icssExports = {};
150
151 function addImports(node, path) {
152 const unquoted = path.replace(/'|"/g, "");
153 icssImports[unquoted] = Object.assign(
154 icssImports[unquoted] || {},
155 getDeclsObject(node)
156 );
157
158 if (removeRules) {
159 node.remove();
160 }
161 }
162
163 function addExports(node) {
164 Object.assign(icssExports, getDeclsObject(node));
165 if (removeRules) {
166 node.remove();
167 }
168 }
169
170 css.each((node) => {
171 if (node.type === "rule" && mode !== "at-rule") {
172 if (node.selector.slice(0, 7) === ":import") {
173 const matches = importPattern.exec(node.selector);
174
175 if (matches) {
176 addImports(node, matches[1]);
177 }
178 }
179
180 if (node.selector === ":export") {
181 addExports(node);
182 }
183 }
184
185 if (node.type === "atrule" && mode !== "rule") {
186 if (node.name === "icss-import") {
187 const matches = balancedQuotes.exec(node.params);
188
189 if (matches) {
190 addImports(node, matches[1]);
191 }
192 }
193 if (node.name === "icss-export") {
194 addExports(node);
195 }
196 }
197 });
198
199 return { icssImports, icssExports };
200};
201
202var extractICSS_1 = extractICSS$2;
203
204const createImports = (imports, postcss, mode = "rule") => {
205 return Object.keys(imports).map((path) => {
206 const aliases = imports[path];
207 const declarations = Object.keys(aliases).map((key) =>
208 postcss.decl({
209 prop: key,
210 value: aliases[key],
211 raws: { before: "\n " },
212 })
213 );
214
215 const hasDeclarations = declarations.length > 0;
216
217 const rule =
218 mode === "rule"
219 ? postcss.rule({
220 selector: `:import('${path}')`,
221 raws: { after: hasDeclarations ? "\n" : "" },
222 })
223 : postcss.atRule({
224 name: "icss-import",
225 params: `'${path}'`,
226 raws: { after: hasDeclarations ? "\n" : "" },
227 });
228
229 if (hasDeclarations) {
230 rule.append(declarations);
231 }
232
233 return rule;
234 });
235};
236
237const createExports = (exports, postcss, mode = "rule") => {
238 const declarations = Object.keys(exports).map((key) =>
239 postcss.decl({
240 prop: key,
241 value: exports[key],
242 raws: { before: "\n " },
243 })
244 );
245
246 if (declarations.length === 0) {
247 return [];
248 }
249 const rule =
250 mode === "rule"
251 ? postcss.rule({
252 selector: `:export`,
253 raws: { after: "\n" },
254 })
255 : postcss.atRule({
256 name: "icss-export",
257 raws: { after: "\n" },
258 });
259
260 rule.append(declarations);
261
262 return [rule];
263};
264
265const createICSSRules$1 = (imports, exports, postcss, mode) => [
266 ...createImports(imports, postcss, mode),
267 ...createExports(exports, postcss, mode),
268];
269
270var createICSSRules_1 = createICSSRules$1;
271
272const replaceValueSymbols = replaceValueSymbols_1;
273const replaceSymbols = replaceSymbols_1;
274const extractICSS$1 = extractICSS_1;
275const createICSSRules = createICSSRules_1;
276
277var src$4 = {
278 replaceValueSymbols,
279 replaceSymbols,
280 extractICSS: extractICSS$1,
281 createICSSRules,
282};
283
284Object.defineProperty(Parser$1, "__esModule", {
285 value: true
286});
287Parser$1.default = void 0;
288
289var _icssUtils = src$4;
290
291// Initially copied from https://github.com/css-modules/css-modules-loader-core
292const importRegexp = /^:import\((.+)\)$/;
293
294class Parser {
295 constructor(pathFetcher, trace) {
296 this.pathFetcher = pathFetcher;
297 this.plugin = this.plugin.bind(this);
298 this.exportTokens = {};
299 this.translations = {};
300 this.trace = trace;
301 }
302
303 plugin() {
304 const parser = this;
305 return {
306 postcssPlugin: "css-modules-parser",
307
308 async OnceExit(css) {
309 await Promise.all(parser.fetchAllImports(css));
310 parser.linkImportedSymbols(css);
311 return parser.extractExports(css);
312 }
313
314 };
315 }
316
317 fetchAllImports(css) {
318 let imports = [];
319 css.each(node => {
320 if (node.type == "rule" && node.selector.match(importRegexp)) {
321 imports.push(this.fetchImport(node, css.source.input.from, imports.length));
322 }
323 });
324 return imports;
325 }
326
327 linkImportedSymbols(css) {
328 (0, _icssUtils.replaceSymbols)(css, this.translations);
329 }
330
331 extractExports(css) {
332 css.each(node => {
333 if (node.type == "rule" && node.selector == ":export") this.handleExport(node);
334 });
335 }
336
337 handleExport(exportNode) {
338 exportNode.each(decl => {
339 if (decl.type == "decl") {
340 Object.keys(this.translations).forEach(translation => {
341 decl.value = decl.value.replace(translation, this.translations[translation]);
342 });
343 this.exportTokens[decl.prop] = decl.value;
344 }
345 });
346 exportNode.remove();
347 }
348
349 async fetchImport(importNode, relativeTo, depNr) {
350 const file = importNode.selector.match(importRegexp)[1];
351 const depTrace = this.trace + String.fromCharCode(depNr);
352 const exports = await this.pathFetcher(file, relativeTo, depTrace);
353
354 try {
355 importNode.each(decl => {
356 if (decl.type == "decl") {
357 this.translations[decl.prop] = exports[decl.value];
358 }
359 });
360 importNode.remove();
361 } catch (err) {
362 console.log(err);
363 }
364 }
365
366}
367
368Parser$1.default = Parser;
369
370var saveJSON$1 = {};
371
372Object.defineProperty(saveJSON$1, "__esModule", {
373 value: true
374});
375saveJSON$1.default = saveJSON;
376
377var _fs$2 = fs;
378
379function saveJSON(cssFile, json) {
380 return new Promise((resolve, reject) => {
381 const {
382 writeFile
383 } = (0, _fs$2.getFileSystem)();
384 writeFile(`${cssFile}.json`, JSON.stringify(json), e => e ? reject(e) : resolve(json));
385 });
386}
387
388var localsConvention = {};
389
390/**
391 * lodash (Custom Build) <https://lodash.com/>
392 * Build: `lodash modularize exports="npm" -o ./`
393 * Copyright jQuery Foundation and other contributors <https://jquery.org/>
394 * Released under MIT license <https://lodash.com/license>
395 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
396 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
397 */
398
399/** Used as references for various `Number` constants. */
400var INFINITY = 1 / 0;
401
402/** `Object#toString` result references. */
403var symbolTag = '[object Symbol]';
404
405/** Used to match words composed of alphanumeric characters. */
406var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
407
408/** Used to match Latin Unicode letters (excluding mathematical operators). */
409var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
410
411/** Used to compose unicode character classes. */
412var rsAstralRange = '\\ud800-\\udfff',
413 rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23',
414 rsComboSymbolsRange = '\\u20d0-\\u20f0',
415 rsDingbatRange = '\\u2700-\\u27bf',
416 rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
417 rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
418 rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
419 rsPunctuationRange = '\\u2000-\\u206f',
420 rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',
421 rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
422 rsVarRange = '\\ufe0e\\ufe0f',
423 rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
424
425/** Used to compose unicode capture groups. */
426var rsApos = "['\u2019]",
427 rsAstral = '[' + rsAstralRange + ']',
428 rsBreak = '[' + rsBreakRange + ']',
429 rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']',
430 rsDigits = '\\d+',
431 rsDingbat = '[' + rsDingbatRange + ']',
432 rsLower = '[' + rsLowerRange + ']',
433 rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
434 rsFitz = '\\ud83c[\\udffb-\\udfff]',
435 rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
436 rsNonAstral = '[^' + rsAstralRange + ']',
437 rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
438 rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
439 rsUpper = '[' + rsUpperRange + ']',
440 rsZWJ = '\\u200d';
441
442/** Used to compose unicode regexes. */
443var rsLowerMisc = '(?:' + rsLower + '|' + rsMisc + ')',
444 rsUpperMisc = '(?:' + rsUpper + '|' + rsMisc + ')',
445 rsOptLowerContr = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
446 rsOptUpperContr = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
447 reOptMod = rsModifier + '?',
448 rsOptVar = '[' + rsVarRange + ']?',
449 rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
450 rsSeq = rsOptVar + reOptMod + rsOptJoin,
451 rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
452 rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
453
454/** Used to match apostrophes. */
455var reApos = RegExp(rsApos, 'g');
456
457/**
458 * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
459 * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
460 */
461var reComboMark = RegExp(rsCombo, 'g');
462
463/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
464var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
465
466/** Used to match complex or compound words. */
467var reUnicodeWord = RegExp([
468 rsUpper + '?' + rsLower + '+' + rsOptLowerContr + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
469 rsUpperMisc + '+' + rsOptUpperContr + '(?=' + [rsBreak, rsUpper + rsLowerMisc, '$'].join('|') + ')',
470 rsUpper + '?' + rsLowerMisc + '+' + rsOptLowerContr,
471 rsUpper + '+' + rsOptUpperContr,
472 rsDigits,
473 rsEmoji
474].join('|'), 'g');
475
476/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
477var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']');
478
479/** Used to detect strings that need a more robust regexp to match words. */
480var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
481
482/** Used to map Latin Unicode letters to basic Latin letters. */
483var deburredLetters = {
484 // Latin-1 Supplement block.
485 '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
486 '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
487 '\xc7': 'C', '\xe7': 'c',
488 '\xd0': 'D', '\xf0': 'd',
489 '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
490 '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
491 '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
492 '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
493 '\xd1': 'N', '\xf1': 'n',
494 '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
495 '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
496 '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
497 '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
498 '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
499 '\xc6': 'Ae', '\xe6': 'ae',
500 '\xde': 'Th', '\xfe': 'th',
501 '\xdf': 'ss',
502 // Latin Extended-A block.
503 '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
504 '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
505 '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
506 '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
507 '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
508 '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
509 '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
510 '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
511 '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
512 '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
513 '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
514 '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
515 '\u0134': 'J', '\u0135': 'j',
516 '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
517 '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
518 '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
519 '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
520 '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
521 '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
522 '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
523 '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
524 '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
525 '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
526 '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
527 '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
528 '\u0163': 't', '\u0165': 't', '\u0167': 't',
529 '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
530 '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
531 '\u0174': 'W', '\u0175': 'w',
532 '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
533 '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
534 '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
535 '\u0132': 'IJ', '\u0133': 'ij',
536 '\u0152': 'Oe', '\u0153': 'oe',
537 '\u0149': "'n", '\u017f': 'ss'
538};
539
540/** Detect free variable `global` from Node.js. */
541var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
542
543/** Detect free variable `self`. */
544var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
545
546/** Used as a reference to the global object. */
547var root$2 = freeGlobal || freeSelf || Function('return this')();
548
549/**
550 * A specialized version of `_.reduce` for arrays without support for
551 * iteratee shorthands.
552 *
553 * @private
554 * @param {Array} [array] The array to iterate over.
555 * @param {Function} iteratee The function invoked per iteration.
556 * @param {*} [accumulator] The initial value.
557 * @param {boolean} [initAccum] Specify using the first element of `array` as
558 * the initial value.
559 * @returns {*} Returns the accumulated value.
560 */
561function arrayReduce(array, iteratee, accumulator, initAccum) {
562 var index = -1,
563 length = array ? array.length : 0;
564 while (++index < length) {
565 accumulator = iteratee(accumulator, array[index], index, array);
566 }
567 return accumulator;
568}
569
570/**
571 * Converts an ASCII `string` to an array.
572 *
573 * @private
574 * @param {string} string The string to convert.
575 * @returns {Array} Returns the converted array.
576 */
577function asciiToArray(string) {
578 return string.split('');
579}
580
581/**
582 * Splits an ASCII `string` into an array of its words.
583 *
584 * @private
585 * @param {string} The string to inspect.
586 * @returns {Array} Returns the words of `string`.
587 */
588function asciiWords(string) {
589 return string.match(reAsciiWord) || [];
590}
591
592/**
593 * The base implementation of `_.propertyOf` without support for deep paths.
594 *
595 * @private
596 * @param {Object} object The object to query.
597 * @returns {Function} Returns the new accessor function.
598 */
599function basePropertyOf(object) {
600 return function(key) {
601 return object == null ? undefined : object[key];
602 };
603}
604
605/**
606 * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
607 * letters to basic Latin letters.
608 *
609 * @private
610 * @param {string} letter The matched letter to deburr.
611 * @returns {string} Returns the deburred letter.
612 */
613var deburrLetter = basePropertyOf(deburredLetters);
614
615/**
616 * Checks if `string` contains Unicode symbols.
617 *
618 * @private
619 * @param {string} string The string to inspect.
620 * @returns {boolean} Returns `true` if a symbol is found, else `false`.
621 */
622function hasUnicode(string) {
623 return reHasUnicode.test(string);
624}
625
626/**
627 * Checks if `string` contains a word composed of Unicode symbols.
628 *
629 * @private
630 * @param {string} string The string to inspect.
631 * @returns {boolean} Returns `true` if a word is found, else `false`.
632 */
633function hasUnicodeWord(string) {
634 return reHasUnicodeWord.test(string);
635}
636
637/**
638 * Converts `string` to an array.
639 *
640 * @private
641 * @param {string} string The string to convert.
642 * @returns {Array} Returns the converted array.
643 */
644function stringToArray(string) {
645 return hasUnicode(string)
646 ? unicodeToArray(string)
647 : asciiToArray(string);
648}
649
650/**
651 * Converts a Unicode `string` to an array.
652 *
653 * @private
654 * @param {string} string The string to convert.
655 * @returns {Array} Returns the converted array.
656 */
657function unicodeToArray(string) {
658 return string.match(reUnicode) || [];
659}
660
661/**
662 * Splits a Unicode `string` into an array of its words.
663 *
664 * @private
665 * @param {string} The string to inspect.
666 * @returns {Array} Returns the words of `string`.
667 */
668function unicodeWords(string) {
669 return string.match(reUnicodeWord) || [];
670}
671
672/** Used for built-in method references. */
673var objectProto = Object.prototype;
674
675/**
676 * Used to resolve the
677 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
678 * of values.
679 */
680var objectToString = objectProto.toString;
681
682/** Built-in value references. */
683var Symbol$1 = root$2.Symbol;
684
685/** Used to convert symbols to primitives and strings. */
686var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined,
687 symbolToString = symbolProto ? symbolProto.toString : undefined;
688
689/**
690 * The base implementation of `_.slice` without an iteratee call guard.
691 *
692 * @private
693 * @param {Array} array The array to slice.
694 * @param {number} [start=0] The start position.
695 * @param {number} [end=array.length] The end position.
696 * @returns {Array} Returns the slice of `array`.
697 */
698function baseSlice(array, start, end) {
699 var index = -1,
700 length = array.length;
701
702 if (start < 0) {
703 start = -start > length ? 0 : (length + start);
704 }
705 end = end > length ? length : end;
706 if (end < 0) {
707 end += length;
708 }
709 length = start > end ? 0 : ((end - start) >>> 0);
710 start >>>= 0;
711
712 var result = Array(length);
713 while (++index < length) {
714 result[index] = array[index + start];
715 }
716 return result;
717}
718
719/**
720 * The base implementation of `_.toString` which doesn't convert nullish
721 * values to empty strings.
722 *
723 * @private
724 * @param {*} value The value to process.
725 * @returns {string} Returns the string.
726 */
727function baseToString(value) {
728 // Exit early for strings to avoid a performance hit in some environments.
729 if (typeof value == 'string') {
730 return value;
731 }
732 if (isSymbol(value)) {
733 return symbolToString ? symbolToString.call(value) : '';
734 }
735 var result = (value + '');
736 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
737}
738
739/**
740 * Casts `array` to a slice if it's needed.
741 *
742 * @private
743 * @param {Array} array The array to inspect.
744 * @param {number} start The start position.
745 * @param {number} [end=array.length] The end position.
746 * @returns {Array} Returns the cast slice.
747 */
748function castSlice(array, start, end) {
749 var length = array.length;
750 end = end === undefined ? length : end;
751 return (!start && end >= length) ? array : baseSlice(array, start, end);
752}
753
754/**
755 * Creates a function like `_.lowerFirst`.
756 *
757 * @private
758 * @param {string} methodName The name of the `String` case method to use.
759 * @returns {Function} Returns the new case function.
760 */
761function createCaseFirst(methodName) {
762 return function(string) {
763 string = toString(string);
764
765 var strSymbols = hasUnicode(string)
766 ? stringToArray(string)
767 : undefined;
768
769 var chr = strSymbols
770 ? strSymbols[0]
771 : string.charAt(0);
772
773 var trailing = strSymbols
774 ? castSlice(strSymbols, 1).join('')
775 : string.slice(1);
776
777 return chr[methodName]() + trailing;
778 };
779}
780
781/**
782 * Creates a function like `_.camelCase`.
783 *
784 * @private
785 * @param {Function} callback The function to combine each word.
786 * @returns {Function} Returns the new compounder function.
787 */
788function createCompounder(callback) {
789 return function(string) {
790 return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
791 };
792}
793
794/**
795 * Checks if `value` is object-like. A value is object-like if it's not `null`
796 * and has a `typeof` result of "object".
797 *
798 * @static
799 * @memberOf _
800 * @since 4.0.0
801 * @category Lang
802 * @param {*} value The value to check.
803 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
804 * @example
805 *
806 * _.isObjectLike({});
807 * // => true
808 *
809 * _.isObjectLike([1, 2, 3]);
810 * // => true
811 *
812 * _.isObjectLike(_.noop);
813 * // => false
814 *
815 * _.isObjectLike(null);
816 * // => false
817 */
818function isObjectLike(value) {
819 return !!value && typeof value == 'object';
820}
821
822/**
823 * Checks if `value` is classified as a `Symbol` primitive or object.
824 *
825 * @static
826 * @memberOf _
827 * @since 4.0.0
828 * @category Lang
829 * @param {*} value The value to check.
830 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
831 * @example
832 *
833 * _.isSymbol(Symbol.iterator);
834 * // => true
835 *
836 * _.isSymbol('abc');
837 * // => false
838 */
839function isSymbol(value) {
840 return typeof value == 'symbol' ||
841 (isObjectLike(value) && objectToString.call(value) == symbolTag);
842}
843
844/**
845 * Converts `value` to a string. An empty string is returned for `null`
846 * and `undefined` values. The sign of `-0` is preserved.
847 *
848 * @static
849 * @memberOf _
850 * @since 4.0.0
851 * @category Lang
852 * @param {*} value The value to process.
853 * @returns {string} Returns the string.
854 * @example
855 *
856 * _.toString(null);
857 * // => ''
858 *
859 * _.toString(-0);
860 * // => '-0'
861 *
862 * _.toString([1, 2, 3]);
863 * // => '1,2,3'
864 */
865function toString(value) {
866 return value == null ? '' : baseToString(value);
867}
868
869/**
870 * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
871 *
872 * @static
873 * @memberOf _
874 * @since 3.0.0
875 * @category String
876 * @param {string} [string=''] The string to convert.
877 * @returns {string} Returns the camel cased string.
878 * @example
879 *
880 * _.camelCase('Foo Bar');
881 * // => 'fooBar'
882 *
883 * _.camelCase('--foo-bar--');
884 * // => 'fooBar'
885 *
886 * _.camelCase('__FOO_BAR__');
887 * // => 'fooBar'
888 */
889var camelCase = createCompounder(function(result, word, index) {
890 word = word.toLowerCase();
891 return result + (index ? capitalize(word) : word);
892});
893
894/**
895 * Converts the first character of `string` to upper case and the remaining
896 * to lower case.
897 *
898 * @static
899 * @memberOf _
900 * @since 3.0.0
901 * @category String
902 * @param {string} [string=''] The string to capitalize.
903 * @returns {string} Returns the capitalized string.
904 * @example
905 *
906 * _.capitalize('FRED');
907 * // => 'Fred'
908 */
909function capitalize(string) {
910 return upperFirst(toString(string).toLowerCase());
911}
912
913/**
914 * Deburrs `string` by converting
915 * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
916 * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
917 * letters to basic Latin letters and removing
918 * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
919 *
920 * @static
921 * @memberOf _
922 * @since 3.0.0
923 * @category String
924 * @param {string} [string=''] The string to deburr.
925 * @returns {string} Returns the deburred string.
926 * @example
927 *
928 * _.deburr('déjà vu');
929 * // => 'deja vu'
930 */
931function deburr(string) {
932 string = toString(string);
933 return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
934}
935
936/**
937 * Converts the first character of `string` to upper case.
938 *
939 * @static
940 * @memberOf _
941 * @since 4.0.0
942 * @category String
943 * @param {string} [string=''] The string to convert.
944 * @returns {string} Returns the converted string.
945 * @example
946 *
947 * _.upperFirst('fred');
948 * // => 'Fred'
949 *
950 * _.upperFirst('FRED');
951 * // => 'FRED'
952 */
953var upperFirst = createCaseFirst('toUpperCase');
954
955/**
956 * Splits `string` into an array of its words.
957 *
958 * @static
959 * @memberOf _
960 * @since 3.0.0
961 * @category String
962 * @param {string} [string=''] The string to inspect.
963 * @param {RegExp|string} [pattern] The pattern to match words.
964 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
965 * @returns {Array} Returns the words of `string`.
966 * @example
967 *
968 * _.words('fred, barney, & pebbles');
969 * // => ['fred', 'barney', 'pebbles']
970 *
971 * _.words('fred, barney, & pebbles', /[^, ]+/g);
972 * // => ['fred', 'barney', '&', 'pebbles']
973 */
974function words(string, pattern, guard) {
975 string = toString(string);
976 pattern = pattern;
977
978 if (pattern === undefined) {
979 return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
980 }
981 return string.match(pattern) || [];
982}
983
984var lodash_camelcase = camelCase;
985
986Object.defineProperty(localsConvention, "__esModule", {
987 value: true
988});
989localsConvention.makeLocalsConventionReducer = makeLocalsConventionReducer;
990
991var _lodash = _interopRequireDefault$5(lodash_camelcase);
992
993function _interopRequireDefault$5(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
994
995function dashesCamelCase(string) {
996 return string.replace(/-+(\w)/g, (_, firstLetter) => firstLetter.toUpperCase());
997}
998
999function makeLocalsConventionReducer(localsConvention, inputFile) {
1000 const isFunc = typeof localsConvention === "function";
1001 return (tokens, [className, value]) => {
1002 if (isFunc) {
1003 const convention = localsConvention(className, value, inputFile);
1004 tokens[convention] = value;
1005 return tokens;
1006 }
1007
1008 switch (localsConvention) {
1009 case "camelCase":
1010 tokens[className] = value;
1011 tokens[(0, _lodash.default)(className)] = value;
1012 break;
1013
1014 case "camelCaseOnly":
1015 tokens[(0, _lodash.default)(className)] = value;
1016 break;
1017
1018 case "dashes":
1019 tokens[className] = value;
1020 tokens[dashesCamelCase(className)] = value;
1021 break;
1022
1023 case "dashesOnly":
1024 tokens[dashesCamelCase(className)] = value;
1025 break;
1026 }
1027
1028 return tokens;
1029 };
1030}
1031
1032var FileSystemLoader$1 = {};
1033
1034Object.defineProperty(FileSystemLoader$1, "__esModule", {
1035 value: true
1036});
1037FileSystemLoader$1.default = void 0;
1038
1039var _postcss$1 = _interopRequireDefault$4(require$$0);
1040
1041var _path = _interopRequireDefault$4(require$$0$1);
1042
1043var _Parser$1 = _interopRequireDefault$4(Parser$1);
1044
1045var _fs$1 = fs;
1046
1047function _interopRequireDefault$4(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1048
1049// Initially copied from https://github.com/css-modules/css-modules-loader-core
1050class Core {
1051 constructor(plugins) {
1052 this.plugins = plugins || Core.defaultPlugins;
1053 }
1054
1055 async load(sourceString, sourcePath, trace, pathFetcher) {
1056 const parser = new _Parser$1.default(pathFetcher, trace);
1057 const plugins = this.plugins.concat([parser.plugin()]);
1058 const result = await (0, _postcss$1.default)(plugins).process(sourceString, {
1059 from: sourcePath
1060 });
1061 return {
1062 injectableSource: result.css,
1063 exportTokens: parser.exportTokens
1064 };
1065 }
1066
1067} // Sorts dependencies in the following way:
1068// AAA comes before AA and A
1069// AB comes after AA and before A
1070// All Bs come after all As
1071// This ensures that the files are always returned in the following order:
1072// - In the order they were required, except
1073// - After all their dependencies
1074
1075
1076const traceKeySorter = (a, b) => {
1077 if (a.length < b.length) {
1078 return a < b.substring(0, a.length) ? -1 : 1;
1079 }
1080
1081 if (a.length > b.length) {
1082 return a.substring(0, b.length) <= b ? -1 : 1;
1083 }
1084
1085 return a < b ? -1 : 1;
1086};
1087
1088class FileSystemLoader {
1089 constructor(root, plugins, fileResolve) {
1090 if (root === "/" && process.platform === "win32") {
1091 const cwdDrive = process.cwd().slice(0, 3);
1092
1093 if (!/^[A-Za-z]:\\$/.test(cwdDrive)) {
1094 throw new Error(`Failed to obtain root from "${process.cwd()}".`);
1095 }
1096
1097 root = cwdDrive;
1098 }
1099
1100 this.root = root;
1101 this.fileResolve = fileResolve;
1102 this.sources = {};
1103 this.traces = {};
1104 this.importNr = 0;
1105 this.core = new Core(plugins);
1106 this.tokensByFile = {};
1107 this.fs = (0, _fs$1.getFileSystem)();
1108 }
1109
1110 async fetch(_newPath, relativeTo, _trace) {
1111 const newPath = _newPath.replace(/^["']|["']$/g, "");
1112
1113 const trace = _trace || String.fromCharCode(this.importNr++);
1114
1115 const useFileResolve = typeof this.fileResolve === "function";
1116 const fileResolvedPath = useFileResolve ? await this.fileResolve(newPath, relativeTo) : await Promise.resolve();
1117
1118 if (fileResolvedPath && !_path.default.isAbsolute(fileResolvedPath)) {
1119 throw new Error('The returned path from the "fileResolve" option must be absolute.');
1120 }
1121
1122 const relativeDir = _path.default.dirname(relativeTo);
1123
1124 const rootRelativePath = fileResolvedPath || _path.default.resolve(relativeDir, newPath);
1125
1126 let fileRelativePath = fileResolvedPath || _path.default.resolve(_path.default.resolve(this.root, relativeDir), newPath); // if the path is not relative or absolute, try to resolve it in node_modules
1127
1128
1129 if (!useFileResolve && newPath[0] !== "." && !_path.default.isAbsolute(newPath)) {
1130 try {
1131 fileRelativePath = require.resolve(newPath);
1132 } catch (e) {// noop
1133 }
1134 }
1135
1136 const tokens = this.tokensByFile[fileRelativePath];
1137 if (tokens) return tokens;
1138 return new Promise((resolve, reject) => {
1139 this.fs.readFile(fileRelativePath, "utf-8", async (err, source) => {
1140 if (err) reject(err);
1141 const {
1142 injectableSource,
1143 exportTokens
1144 } = await this.core.load(source, rootRelativePath, trace, this.fetch.bind(this));
1145 this.sources[fileRelativePath] = injectableSource;
1146 this.traces[trace] = fileRelativePath;
1147 this.tokensByFile[fileRelativePath] = exportTokens;
1148 resolve(exportTokens);
1149 });
1150 });
1151 }
1152
1153 get finalSource() {
1154 const traces = this.traces;
1155 const sources = this.sources;
1156 let written = new Set();
1157 return Object.keys(traces).sort(traceKeySorter).map(key => {
1158 const filename = traces[key];
1159
1160 if (written.has(filename)) {
1161 return null;
1162 }
1163
1164 written.add(filename);
1165 return sources[filename];
1166 }).join("");
1167 }
1168
1169}
1170
1171FileSystemLoader$1.default = FileSystemLoader;
1172
1173var scoping = {};
1174
1175var src$3 = {exports: {}};
1176
1177const PERMANENT_MARKER = 2;
1178const TEMPORARY_MARKER = 1;
1179
1180function createError(node, graph) {
1181 const er = new Error("Nondeterministic import's order");
1182
1183 const related = graph[node];
1184 const relatedNode = related.find(
1185 (relatedNode) => graph[relatedNode].indexOf(node) > -1
1186 );
1187
1188 er.nodes = [node, relatedNode];
1189
1190 return er;
1191}
1192
1193function walkGraph(node, graph, state, result, strict) {
1194 if (state[node] === PERMANENT_MARKER) {
1195 return;
1196 }
1197
1198 if (state[node] === TEMPORARY_MARKER) {
1199 if (strict) {
1200 return createError(node, graph);
1201 }
1202
1203 return;
1204 }
1205
1206 state[node] = TEMPORARY_MARKER;
1207
1208 const children = graph[node];
1209 const length = children.length;
1210
1211 for (let i = 0; i < length; ++i) {
1212 const error = walkGraph(children[i], graph, state, result, strict);
1213
1214 if (error instanceof Error) {
1215 return error;
1216 }
1217 }
1218
1219 state[node] = PERMANENT_MARKER;
1220
1221 result.push(node);
1222}
1223
1224function topologicalSort$1(graph, strict) {
1225 const result = [];
1226 const state = {};
1227
1228 const nodes = Object.keys(graph);
1229 const length = nodes.length;
1230
1231 for (let i = 0; i < length; ++i) {
1232 const er = walkGraph(nodes[i], graph, state, result, strict);
1233
1234 if (er instanceof Error) {
1235 return er;
1236 }
1237 }
1238
1239 return result;
1240}
1241
1242var topologicalSort_1 = topologicalSort$1;
1243
1244const topologicalSort = topologicalSort_1;
1245
1246const matchImports$1 = /^(.+?)\s+from\s+(?:"([^"]+)"|'([^']+)'|(global))$/;
1247const icssImport = /^:import\((?:"([^"]+)"|'([^']+)')\)/;
1248
1249const VISITED_MARKER = 1;
1250
1251/**
1252 * :import('G') {}
1253 *
1254 * Rule
1255 * composes: ... from 'A'
1256 * composes: ... from 'B'
1257
1258 * Rule
1259 * composes: ... from 'A'
1260 * composes: ... from 'A'
1261 * composes: ... from 'C'
1262 *
1263 * Results in:
1264 *
1265 * graph: {
1266 * G: [],
1267 * A: [],
1268 * B: ['A'],
1269 * C: ['A'],
1270 * }
1271 */
1272function addImportToGraph(importId, parentId, graph, visited) {
1273 const siblingsId = parentId + "_" + "siblings";
1274 const visitedId = parentId + "_" + importId;
1275
1276 if (visited[visitedId] !== VISITED_MARKER) {
1277 if (!Array.isArray(visited[siblingsId])) {
1278 visited[siblingsId] = [];
1279 }
1280
1281 const siblings = visited[siblingsId];
1282
1283 if (Array.isArray(graph[importId])) {
1284 graph[importId] = graph[importId].concat(siblings);
1285 } else {
1286 graph[importId] = siblings.slice();
1287 }
1288
1289 visited[visitedId] = VISITED_MARKER;
1290
1291 siblings.push(importId);
1292 }
1293}
1294
1295src$3.exports = (options = {}) => {
1296 let importIndex = 0;
1297 const createImportedName =
1298 typeof options.createImportedName !== "function"
1299 ? (importName /*, path*/) =>
1300 `i__imported_${importName.replace(/\W/g, "_")}_${importIndex++}`
1301 : options.createImportedName;
1302 const failOnWrongOrder = options.failOnWrongOrder;
1303
1304 return {
1305 postcssPlugin: "postcss-modules-extract-imports",
1306 prepare() {
1307 const graph = {};
1308 const visited = {};
1309 const existingImports = {};
1310 const importDecls = {};
1311 const imports = {};
1312
1313 return {
1314 Once(root, postcss) {
1315 // Check the existing imports order and save refs
1316 root.walkRules((rule) => {
1317 const matches = icssImport.exec(rule.selector);
1318
1319 if (matches) {
1320 const [, /*match*/ doubleQuotePath, singleQuotePath] = matches;
1321 const importPath = doubleQuotePath || singleQuotePath;
1322
1323 addImportToGraph(importPath, "root", graph, visited);
1324
1325 existingImports[importPath] = rule;
1326 }
1327 });
1328
1329 root.walkDecls(/^composes$/, (declaration) => {
[0c6b92a]1330 const multiple = declaration.value.split(",");
1331 const values = [];
[d565449]1332
[0c6b92a]1333 multiple.forEach((value) => {
1334 const matches = value.trim().match(matchImports$1);
[d565449]1335
[0c6b92a]1336 if (!matches) {
1337 values.push(value);
[d565449]1338
[0c6b92a]1339 return;
[d565449]1340 }
1341
[0c6b92a]1342 let tmpSymbols;
1343 let [
1344 ,
1345 /*match*/ symbols,
1346 doubleQuotePath,
1347 singleQuotePath,
1348 global,
1349 ] = matches;
1350
1351 if (global) {
1352 // Composing globals simply means changing these classes to wrap them in global(name)
1353 tmpSymbols = symbols.split(/\s+/).map((s) => `global(${s})`);
1354 } else {
1355 const importPath = doubleQuotePath || singleQuotePath;
[d565449]1356
[0c6b92a]1357 let parent = declaration.parent;
1358 let parentIndexes = "";
[d565449]1359
[0c6b92a]1360 while (parent.type !== "root") {
1361 parentIndexes =
1362 parent.parent.index(parent) + "_" + parentIndexes;
1363 parent = parent.parent;
[d565449]1364 }
1365
[0c6b92a]1366 const { selector } = declaration.parent;
1367 const parentRule = `_${parentIndexes}${selector}`;
1368
1369 addImportToGraph(importPath, parentRule, graph, visited);
1370
1371 importDecls[importPath] = declaration;
1372 imports[importPath] = imports[importPath] || {};
1373
1374 tmpSymbols = symbols.split(/\s+/).map((s) => {
1375 if (!imports[importPath][s]) {
1376 imports[importPath][s] = createImportedName(s, importPath);
1377 }
1378
1379 return imports[importPath][s];
1380 });
1381 }
1382
1383 values.push(tmpSymbols.join(" "));
1384 });
[d565449]1385
[0c6b92a]1386 declaration.value = values.join(", ");
[d565449]1387 });
1388
1389 const importsOrder = topologicalSort(graph, failOnWrongOrder);
1390
1391 if (importsOrder instanceof Error) {
1392 const importPath = importsOrder.nodes.find((importPath) =>
1393 // eslint-disable-next-line no-prototype-builtins
1394 importDecls.hasOwnProperty(importPath)
1395 );
1396 const decl = importDecls[importPath];
1397
1398 throw decl.error(
1399 "Failed to resolve order of composed modules " +
1400 importsOrder.nodes
1401 .map((importPath) => "`" + importPath + "`")
1402 .join(", ") +
1403 ".",
1404 {
1405 plugin: "postcss-modules-extract-imports",
1406 word: "composes",
1407 }
1408 );
1409 }
1410
1411 let lastImportRule;
1412
1413 importsOrder.forEach((path) => {
1414 const importedSymbols = imports[path];
1415 let rule = existingImports[path];
1416
1417 if (!rule && importedSymbols) {
1418 rule = postcss.rule({
1419 selector: `:import("${path}")`,
1420 raws: { after: "\n" },
1421 });
1422
1423 if (lastImportRule) {
1424 root.insertAfter(lastImportRule, rule);
1425 } else {
1426 root.prepend(rule);
1427 }
1428 }
1429
1430 lastImportRule = rule;
1431
1432 if (!importedSymbols) {
1433 return;
1434 }
1435
1436 Object.keys(importedSymbols).forEach((importedSymbol) => {
1437 rule.append(
1438 postcss.decl({
1439 value: importedSymbol,
1440 prop: importedSymbols[importedSymbol],
1441 raws: { before: "\n " },
1442 })
1443 );
1444 });
1445 });
1446 },
1447 };
1448 },
1449 };
1450};
1451
1452src$3.exports.postcss = true;
1453
1454var srcExports$2 = src$3.exports;
1455
1456var wasmHash = {exports: {}};
1457
1458/*
1459 MIT License http://www.opensource.org/licenses/mit-license.php
1460 Author Tobias Koppers @sokra
1461*/
1462
1463var hasRequiredWasmHash;
1464
1465function requireWasmHash () {
1466 if (hasRequiredWasmHash) return wasmHash.exports;
1467 hasRequiredWasmHash = 1;
1468
1469 // 65536 is the size of a wasm memory page
1470 // 64 is the maximum chunk size for every possible wasm hash implementation
1471 // 4 is the maximum number of bytes per char for string encoding (max is utf-8)
1472 // ~3 makes sure that it's always a block of 4 chars, so avoid partially encoded bytes for base64
1473 const MAX_SHORT_STRING = Math.floor((65536 - 64) / 4) & ~3;
1474
1475 class WasmHash {
1476 /**
1477 * @param {WebAssembly.Instance} instance wasm instance
1478 * @param {WebAssembly.Instance[]} instancesPool pool of instances
1479 * @param {number} chunkSize size of data chunks passed to wasm
1480 * @param {number} digestSize size of digest returned by wasm
1481 */
1482 constructor(instance, instancesPool, chunkSize, digestSize) {
1483 const exports = /** @type {any} */ (instance.exports);
1484
1485 exports.init();
1486
1487 this.exports = exports;
1488 this.mem = Buffer.from(exports.memory.buffer, 0, 65536);
1489 this.buffered = 0;
1490 this.instancesPool = instancesPool;
1491 this.chunkSize = chunkSize;
1492 this.digestSize = digestSize;
1493 }
1494
1495 reset() {
1496 this.buffered = 0;
1497 this.exports.init();
1498 }
1499
1500 /**
1501 * @param {Buffer | string} data data
1502 * @param {BufferEncoding=} encoding encoding
1503 * @returns {this} itself
1504 */
1505 update(data, encoding) {
1506 if (typeof data === "string") {
1507 while (data.length > MAX_SHORT_STRING) {
1508 this._updateWithShortString(data.slice(0, MAX_SHORT_STRING), encoding);
1509 data = data.slice(MAX_SHORT_STRING);
1510 }
1511
1512 this._updateWithShortString(data, encoding);
1513
1514 return this;
1515 }
1516
1517 this._updateWithBuffer(data);
1518
1519 return this;
1520 }
1521
1522 /**
1523 * @param {string} data data
1524 * @param {BufferEncoding=} encoding encoding
1525 * @returns {void}
1526 */
1527 _updateWithShortString(data, encoding) {
1528 const { exports, buffered, mem, chunkSize } = this;
1529
1530 let endPos;
1531
1532 if (data.length < 70) {
1533 if (!encoding || encoding === "utf-8" || encoding === "utf8") {
1534 endPos = buffered;
1535 for (let i = 0; i < data.length; i++) {
1536 const cc = data.charCodeAt(i);
1537
1538 if (cc < 0x80) {
1539 mem[endPos++] = cc;
1540 } else if (cc < 0x800) {
1541 mem[endPos] = (cc >> 6) | 0xc0;
1542 mem[endPos + 1] = (cc & 0x3f) | 0x80;
1543 endPos += 2;
1544 } else {
1545 // bail-out for weird chars
1546 endPos += mem.write(data.slice(i), endPos, encoding);
1547 break;
1548 }
1549 }
1550 } else if (encoding === "latin1") {
1551 endPos = buffered;
1552
1553 for (let i = 0; i < data.length; i++) {
1554 const cc = data.charCodeAt(i);
1555
1556 mem[endPos++] = cc;
1557 }
1558 } else {
1559 endPos = buffered + mem.write(data, buffered, encoding);
1560 }
1561 } else {
1562 endPos = buffered + mem.write(data, buffered, encoding);
1563 }
1564
1565 if (endPos < chunkSize) {
1566 this.buffered = endPos;
1567 } else {
1568 const l = endPos & ~(this.chunkSize - 1);
1569
1570 exports.update(l);
1571
1572 const newBuffered = endPos - l;
1573
1574 this.buffered = newBuffered;
1575
1576 if (newBuffered > 0) {
1577 mem.copyWithin(0, l, endPos);
1578 }
1579 }
1580 }
1581
1582 /**
1583 * @param {Buffer} data data
1584 * @returns {void}
1585 */
1586 _updateWithBuffer(data) {
1587 const { exports, buffered, mem } = this;
1588 const length = data.length;
1589
1590 if (buffered + length < this.chunkSize) {
1591 data.copy(mem, buffered, 0, length);
1592
1593 this.buffered += length;
1594 } else {
1595 const l = (buffered + length) & ~(this.chunkSize - 1);
1596
1597 if (l > 65536) {
1598 let i = 65536 - buffered;
1599
1600 data.copy(mem, buffered, 0, i);
1601 exports.update(65536);
1602
1603 const stop = l - buffered - 65536;
1604
1605 while (i < stop) {
1606 data.copy(mem, 0, i, i + 65536);
1607 exports.update(65536);
1608 i += 65536;
1609 }
1610
1611 data.copy(mem, 0, i, l - buffered);
1612
1613 exports.update(l - buffered - i);
1614 } else {
1615 data.copy(mem, buffered, 0, l - buffered);
1616
1617 exports.update(l);
1618 }
1619
1620 const newBuffered = length + buffered - l;
1621
1622 this.buffered = newBuffered;
1623
1624 if (newBuffered > 0) {
1625 data.copy(mem, 0, length - newBuffered, length);
1626 }
1627 }
1628 }
1629
1630 digest(type) {
1631 const { exports, buffered, mem, digestSize } = this;
1632
1633 exports.final(buffered);
1634
1635 this.instancesPool.push(this);
1636
1637 const hex = mem.toString("latin1", 0, digestSize);
1638
1639 if (type === "hex") {
1640 return hex;
1641 }
1642
1643 if (type === "binary" || !type) {
1644 return Buffer.from(hex, "hex");
1645 }
1646
1647 return Buffer.from(hex, "hex").toString(type);
1648 }
1649 }
1650
1651 const create = (wasmModule, instancesPool, chunkSize, digestSize) => {
1652 if (instancesPool.length > 0) {
1653 const old = instancesPool.pop();
1654
1655 old.reset();
1656
1657 return old;
1658 } else {
1659 return new WasmHash(
1660 new WebAssembly.Instance(wasmModule),
1661 instancesPool,
1662 chunkSize,
1663 digestSize
1664 );
1665 }
1666 };
1667
1668 wasmHash.exports = create;
1669 wasmHash.exports.MAX_SHORT_STRING = MAX_SHORT_STRING;
1670 return wasmHash.exports;
1671}
1672
1673/*
1674 MIT License http://www.opensource.org/licenses/mit-license.php
1675 Author Tobias Koppers @sokra
1676*/
1677
1678var xxhash64_1;
1679var hasRequiredXxhash64;
1680
1681function requireXxhash64 () {
1682 if (hasRequiredXxhash64) return xxhash64_1;
1683 hasRequiredXxhash64 = 1;
1684
1685 const create = requireWasmHash();
1686
1687 //#region wasm code: xxhash64 (../../../assembly/hash/xxhash64.asm.ts) --initialMemory 1
1688 const xxhash64 = new WebAssembly.Module(
1689 Buffer.from(
1690 // 1173 bytes
1691 "AGFzbQEAAAABCAJgAX8AYAAAAwQDAQAABQMBAAEGGgV+AUIAC34BQgALfgFCAAt+AUIAC34BQgALByIEBGluaXQAAAZ1cGRhdGUAAQVmaW5hbAACBm1lbW9yeQIACrUIAzAAQtbrgu7q/Yn14AAkAELP1tO+0ser2UIkAUIAJAJC+erQ0OfJoeThACQDQgAkBAvUAQIBfwR+IABFBEAPCyMEIACtfCQEIwAhAiMBIQMjAiEEIwMhBQNAIAIgASkDAELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiECIAMgASkDCELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEDIAQgASkDEELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEEIAUgASkDGELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEFIAAgAUEgaiIBSw0ACyACJAAgAyQBIAQkAiAFJAMLqwYCAX8EfiMEQgBSBH4jACICQgGJIwEiA0IHiXwjAiIEQgyJfCMDIgVCEol8IAJCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0gA0LP1tO+0ser2UJ+Qh+JQoeVr6+Ytt6bnn9+hUKHla+vmLbem55/fkKdo7Xqg7GNivoAfSAEQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IAVCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0FQsXP2bLx5brqJwsjBCAArXx8IQIDQCABQQhqIABNBEAgAiABKQMAQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQhuJQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IQIgAUEIaiEBDAELCyABQQRqIABNBEACfyACIAE1AgBCh5Wvr5i23puef36FQheJQs/W077Sx6vZQn5C+fPd8Zn2masWfCECIAFBBGoLIQELA0AgACABRwRAIAIgATEAAELFz9my8eW66id+hUILiUKHla+vmLbem55/fiECIAFBAWohAQwBCwtBACACIAJCIYiFQs/W077Sx6vZQn4iAiACQh2IhUL5893xmfaZqxZ+IgIgAkIgiIUiAkIgiCIDQv//A4NCIIYgA0KAgPz/D4NCEIiEIgNC/4GAgPAfg0IQhiADQoD+g4CA4D+DQgiIhCIDQo+AvIDwgcAHg0IIhiADQvCBwIeAnoD4AINCBIiEIgNChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IANCsODAgYOGjJgwhHw3AwBBCCACQv////8PgyICQv//A4NCIIYgAkKAgPz/D4NCEIiEIgJC/4GAgPAfg0IQhiACQoD+g4CA4D+DQgiIhCICQo+AvIDwgcAHg0IIhiACQvCBwIeAnoD4AINCBIiEIgJChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IAJCsODAgYOGjJgwhHw3AwAL",
1692 "base64"
1693 )
1694 );
1695 //#endregion
1696
1697 xxhash64_1 = create.bind(null, xxhash64, [], 32, 16);
1698 return xxhash64_1;
1699}
1700
1701var BatchedHash_1;
1702var hasRequiredBatchedHash;
1703
1704function requireBatchedHash () {
1705 if (hasRequiredBatchedHash) return BatchedHash_1;
1706 hasRequiredBatchedHash = 1;
1707 const MAX_SHORT_STRING = requireWasmHash().MAX_SHORT_STRING;
1708
1709 class BatchedHash {
1710 constructor(hash) {
1711 this.string = undefined;
1712 this.encoding = undefined;
1713 this.hash = hash;
1714 }
1715
1716 /**
1717 * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding}
1718 * @param {string|Buffer} data data
1719 * @param {string=} inputEncoding data encoding
1720 * @returns {this} updated hash
1721 */
1722 update(data, inputEncoding) {
1723 if (this.string !== undefined) {
1724 if (
1725 typeof data === "string" &&
1726 inputEncoding === this.encoding &&
1727 this.string.length + data.length < MAX_SHORT_STRING
1728 ) {
1729 this.string += data;
1730
1731 return this;
1732 }
1733
1734 this.hash.update(this.string, this.encoding);
1735 this.string = undefined;
1736 }
1737
1738 if (typeof data === "string") {
1739 if (
1740 data.length < MAX_SHORT_STRING &&
1741 // base64 encoding is not valid since it may contain padding chars
1742 (!inputEncoding || !inputEncoding.startsWith("ba"))
1743 ) {
1744 this.string = data;
1745 this.encoding = inputEncoding;
1746 } else {
1747 this.hash.update(data, inputEncoding);
1748 }
1749 } else {
1750 this.hash.update(data);
1751 }
1752
1753 return this;
1754 }
1755
1756 /**
1757 * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding}
1758 * @param {string=} encoding encoding of the return value
1759 * @returns {string|Buffer} digest
1760 */
1761 digest(encoding) {
1762 if (this.string !== undefined) {
1763 this.hash.update(this.string, this.encoding);
1764 }
1765
1766 return this.hash.digest(encoding);
1767 }
1768 }
1769
1770 BatchedHash_1 = BatchedHash;
1771 return BatchedHash_1;
1772}
1773
1774/*
1775 MIT License http://www.opensource.org/licenses/mit-license.php
1776 Author Tobias Koppers @sokra
1777*/
1778
1779var md4_1;
1780var hasRequiredMd4;
1781
1782function requireMd4 () {
1783 if (hasRequiredMd4) return md4_1;
1784 hasRequiredMd4 = 1;
1785
1786 const create = requireWasmHash();
1787
1788 //#region wasm code: md4 (../../../assembly/hash/md4.asm.ts) --initialMemory 1
1789 const md4 = new WebAssembly.Module(
1790 Buffer.from(
1791 // 2150 bytes
1792 "AGFzbQEAAAABCAJgAX8AYAAAAwUEAQAAAAUDAQABBhoFfwFBAAt/AUEAC38BQQALfwFBAAt/AUEACwciBARpbml0AAAGdXBkYXRlAAIFZmluYWwAAwZtZW1vcnkCAAqFEAQmAEGBxpS6BiQBQYnXtv5+JAJB/rnrxXkkA0H2qMmBASQEQQAkAAvMCgEYfyMBIQojAiEGIwMhByMEIQgDQCAAIAVLBEAgBSgCCCINIAcgBiAFKAIEIgsgCCAHIAUoAgAiDCAKIAggBiAHIAhzcXNqakEDdyIDIAYgB3Nxc2pqQQd3IgEgAyAGc3FzampBC3chAiAFKAIUIg8gASACIAUoAhAiCSADIAEgBSgCDCIOIAYgAyACIAEgA3Nxc2pqQRN3IgQgASACc3FzampBA3ciAyACIARzcXNqakEHdyEBIAUoAiAiEiADIAEgBSgCHCIRIAQgAyAFKAIYIhAgAiAEIAEgAyAEc3FzampBC3ciAiABIANzcXNqakETdyIEIAEgAnNxc2pqQQN3IQMgBSgCLCIVIAQgAyAFKAIoIhQgAiAEIAUoAiQiEyABIAIgAyACIARzcXNqakEHdyIBIAMgBHNxc2pqQQt3IgIgASADc3FzampBE3chBCAPIBAgCSAVIBQgEyAFKAI4IhYgAiAEIAUoAjQiFyABIAIgBSgCMCIYIAMgASAEIAEgAnNxc2pqQQN3IgEgAiAEc3FzampBB3ciAiABIARzcXNqakELdyIDIAkgAiAMIAEgBSgCPCIJIAQgASADIAEgAnNxc2pqQRN3IgEgAiADcnEgAiADcXJqakGZ84nUBWpBA3ciAiABIANycSABIANxcmpqQZnzidQFakEFdyIEIAEgAnJxIAEgAnFyaiASakGZ84nUBWpBCXciAyAPIAQgCyACIBggASADIAIgBHJxIAIgBHFyampBmfOJ1AVqQQ13IgEgAyAEcnEgAyAEcXJqakGZ84nUBWpBA3ciAiABIANycSABIANxcmpqQZnzidQFakEFdyIEIAEgAnJxIAEgAnFyampBmfOJ1AVqQQl3IgMgECAEIAIgFyABIAMgAiAEcnEgAiAEcXJqakGZ84nUBWpBDXciASADIARycSADIARxcmogDWpBmfOJ1AVqQQN3IgIgASADcnEgASADcXJqakGZ84nUBWpBBXciBCABIAJycSABIAJxcmpqQZnzidQFakEJdyIDIBEgBCAOIAIgFiABIAMgAiAEcnEgAiAEcXJqakGZ84nUBWpBDXciASADIARycSADIARxcmpqQZnzidQFakEDdyICIAEgA3JxIAEgA3FyampBmfOJ1AVqQQV3IgQgASACcnEgASACcXJqakGZ84nUBWpBCXciAyAMIAIgAyAJIAEgAyACIARycSACIARxcmpqQZnzidQFakENdyIBcyAEc2pqQaHX5/YGakEDdyICIAQgASACcyADc2ogEmpBodfn9gZqQQl3IgRzIAFzampBodfn9gZqQQt3IgMgAiADIBggASADIARzIAJzampBodfn9gZqQQ93IgFzIARzaiANakGh1+f2BmpBA3ciAiAUIAQgASACcyADc2pqQaHX5/YGakEJdyIEcyABc2pqQaHX5/YGakELdyIDIAsgAiADIBYgASADIARzIAJzampBodfn9gZqQQ93IgFzIARzampBodfn9gZqQQN3IgIgEyAEIAEgAnMgA3NqakGh1+f2BmpBCXciBHMgAXNqakGh1+f2BmpBC3chAyAKIA4gAiADIBcgASADIARzIAJzampBodfn9gZqQQ93IgFzIARzampBodfn9gZqQQN3IgJqIQogBiAJIAEgESADIAIgFSAEIAEgAnMgA3NqakGh1+f2BmpBCXciBHMgAXNqakGh1+f2BmpBC3ciAyAEcyACc2pqQaHX5/YGakEPd2ohBiADIAdqIQcgBCAIaiEIIAVBQGshBQwBCwsgCiQBIAYkAiAHJAMgCCQECw0AIAAQASMAIABqJAAL/wQCA38BfiMAIABqrUIDhiEEIABByABqQUBxIgJBCGshAyAAIgFBAWohACABQYABOgAAA0AgACACSUEAIABBB3EbBEAgAEEAOgAAIABBAWohAAwBCwsDQCAAIAJJBEAgAEIANwMAIABBCGohAAwBCwsgAyAENwMAIAIQAUEAIwGtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEIIwKtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEQIwOtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEYIwStIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAAs=",
1793 "base64"
1794 )
1795 );
1796 //#endregion
1797
1798 md4_1 = create.bind(null, md4, [], 64, 32);
1799 return md4_1;
1800}
1801
1802var BulkUpdateDecorator_1;
1803var hasRequiredBulkUpdateDecorator;
1804
1805function requireBulkUpdateDecorator () {
1806 if (hasRequiredBulkUpdateDecorator) return BulkUpdateDecorator_1;
1807 hasRequiredBulkUpdateDecorator = 1;
1808 const BULK_SIZE = 2000;
1809
1810 // We are using an object instead of a Map as this will stay static during the runtime
1811 // so access to it can be optimized by v8
1812 const digestCaches = {};
1813
1814 class BulkUpdateDecorator {
1815 /**
1816 * @param {Hash | function(): Hash} hashOrFactory function to create a hash
1817 * @param {string=} hashKey key for caching
1818 */
1819 constructor(hashOrFactory, hashKey) {
1820 this.hashKey = hashKey;
1821
1822 if (typeof hashOrFactory === "function") {
1823 this.hashFactory = hashOrFactory;
1824 this.hash = undefined;
1825 } else {
1826 this.hashFactory = undefined;
1827 this.hash = hashOrFactory;
1828 }
1829
1830 this.buffer = "";
1831 }
1832
1833 /**
1834 * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding}
1835 * @param {string|Buffer} data data
1836 * @param {string=} inputEncoding data encoding
1837 * @returns {this} updated hash
1838 */
1839 update(data, inputEncoding) {
1840 if (
1841 inputEncoding !== undefined ||
1842 typeof data !== "string" ||
1843 data.length > BULK_SIZE
1844 ) {
1845 if (this.hash === undefined) {
1846 this.hash = this.hashFactory();
1847 }
1848
1849 if (this.buffer.length > 0) {
1850 this.hash.update(this.buffer);
1851 this.buffer = "";
1852 }
1853
1854 this.hash.update(data, inputEncoding);
1855 } else {
1856 this.buffer += data;
1857
1858 if (this.buffer.length > BULK_SIZE) {
1859 if (this.hash === undefined) {
1860 this.hash = this.hashFactory();
1861 }
1862
1863 this.hash.update(this.buffer);
1864 this.buffer = "";
1865 }
1866 }
1867
1868 return this;
1869 }
1870
1871 /**
1872 * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding}
1873 * @param {string=} encoding encoding of the return value
1874 * @returns {string|Buffer} digest
1875 */
1876 digest(encoding) {
1877 let digestCache;
1878
1879 const buffer = this.buffer;
1880
1881 if (this.hash === undefined) {
1882 // short data for hash, we can use caching
1883 const cacheKey = `${this.hashKey}-${encoding}`;
1884
1885 digestCache = digestCaches[cacheKey];
1886
1887 if (digestCache === undefined) {
1888 digestCache = digestCaches[cacheKey] = new Map();
1889 }
1890
1891 const cacheEntry = digestCache.get(buffer);
1892
1893 if (cacheEntry !== undefined) {
1894 return cacheEntry;
1895 }
1896
1897 this.hash = this.hashFactory();
1898 }
1899
1900 if (buffer.length > 0) {
1901 this.hash.update(buffer);
1902 }
1903
1904 const digestResult = this.hash.digest(encoding);
1905
1906 if (digestCache !== undefined) {
1907 digestCache.set(buffer, digestResult);
1908 }
1909
1910 return digestResult;
1911 }
1912 }
1913
1914 BulkUpdateDecorator_1 = BulkUpdateDecorator;
1915 return BulkUpdateDecorator_1;
1916}
1917
1918const baseEncodeTables = {
1919 26: "abcdefghijklmnopqrstuvwxyz",
1920 32: "123456789abcdefghjkmnpqrstuvwxyz", // no 0lio
1921 36: "0123456789abcdefghijklmnopqrstuvwxyz",
1922 49: "abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ", // no lIO
1923 52: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
1924 58: "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ", // no 0lIO
1925 62: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
1926 64: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_",
1927};
1928
1929/**
1930 * @param {Uint32Array} uint32Array Treated as a long base-0x100000000 number, little endian
1931 * @param {number} divisor The divisor
1932 * @return {number} Modulo (remainder) of the division
1933 */
1934function divmod32(uint32Array, divisor) {
1935 let carry = 0;
1936 for (let i = uint32Array.length - 1; i >= 0; i--) {
1937 const value = carry * 0x100000000 + uint32Array[i];
1938 carry = value % divisor;
1939 uint32Array[i] = Math.floor(value / divisor);
1940 }
1941 return carry;
1942}
1943
1944function encodeBufferToBase(buffer, base, length) {
1945 const encodeTable = baseEncodeTables[base];
1946
1947 if (!encodeTable) {
1948 throw new Error("Unknown encoding base" + base);
1949 }
1950
1951 // Input bits are only enough to generate this many characters
1952 const limit = Math.ceil((buffer.length * 8) / Math.log2(base));
1953 length = Math.min(length, limit);
1954
1955 // Most of the crypto digests (if not all) has length a multiple of 4 bytes.
1956 // Fewer numbers in the array means faster math.
1957 const uint32Array = new Uint32Array(Math.ceil(buffer.length / 4));
1958
1959 // Make sure the input buffer data is copied and is not mutated by reference.
1960 // divmod32() would corrupt the BulkUpdateDecorator cache otherwise.
1961 buffer.copy(Buffer.from(uint32Array.buffer));
1962
1963 let output = "";
1964
1965 for (let i = 0; i < length; i++) {
1966 output = encodeTable[divmod32(uint32Array, base)] + output;
1967 }
1968
1969 return output;
1970}
1971
1972let crypto = undefined;
1973let createXXHash64 = undefined;
1974let createMd4 = undefined;
1975let BatchedHash = undefined;
1976let BulkUpdateDecorator = undefined;
1977
1978function getHashDigest$1(buffer, algorithm, digestType, maxLength) {
1979 algorithm = algorithm || "xxhash64";
1980 maxLength = maxLength || 9999;
1981
1982 let hash;
1983
1984 if (algorithm === "xxhash64") {
1985 if (createXXHash64 === undefined) {
1986 createXXHash64 = requireXxhash64();
1987
1988 if (BatchedHash === undefined) {
1989 BatchedHash = requireBatchedHash();
1990 }
1991 }
1992
1993 hash = new BatchedHash(createXXHash64());
1994 } else if (algorithm === "md4") {
1995 if (createMd4 === undefined) {
1996 createMd4 = requireMd4();
1997
1998 if (BatchedHash === undefined) {
1999 BatchedHash = requireBatchedHash();
2000 }
2001 }
2002
2003 hash = new BatchedHash(createMd4());
2004 } else if (algorithm === "native-md4") {
2005 if (typeof crypto === "undefined") {
2006 crypto = require$$3;
2007
2008 if (BulkUpdateDecorator === undefined) {
2009 BulkUpdateDecorator = requireBulkUpdateDecorator();
2010 }
2011 }
2012
2013 hash = new BulkUpdateDecorator(() => crypto.createHash("md4"), "md4");
2014 } else {
2015 if (typeof crypto === "undefined") {
2016 crypto = require$$3;
2017
2018 if (BulkUpdateDecorator === undefined) {
2019 BulkUpdateDecorator = requireBulkUpdateDecorator();
2020 }
2021 }
2022
2023 hash = new BulkUpdateDecorator(
2024 () => crypto.createHash(algorithm),
2025 algorithm
2026 );
2027 }
2028
2029 hash.update(buffer);
2030
2031 if (
2032 digestType === "base26" ||
2033 digestType === "base32" ||
2034 digestType === "base36" ||
2035 digestType === "base49" ||
2036 digestType === "base52" ||
2037 digestType === "base58" ||
2038 digestType === "base62"
2039 ) {
2040 return encodeBufferToBase(hash.digest(), digestType.substr(4), maxLength);
2041 } else {
2042 return hash.digest(digestType || "hex").substr(0, maxLength);
2043 }
2044}
2045
2046var getHashDigest_1 = getHashDigest$1;
2047
2048const path$1 = require$$0$1;
2049const getHashDigest = getHashDigest_1;
2050
2051function interpolateName$1(loaderContext, name, options = {}) {
2052 let filename;
2053
2054 const hasQuery =
2055 loaderContext.resourceQuery && loaderContext.resourceQuery.length > 1;
2056
2057 if (typeof name === "function") {
2058 filename = name(
2059 loaderContext.resourcePath,
2060 hasQuery ? loaderContext.resourceQuery : undefined
2061 );
2062 } else {
2063 filename = name || "[hash].[ext]";
2064 }
2065
2066 const context = options.context;
2067 const content = options.content;
2068 const regExp = options.regExp;
2069
2070 let ext = "bin";
2071 let basename = "file";
2072 let directory = "";
2073 let folder = "";
2074 let query = "";
2075
2076 if (loaderContext.resourcePath) {
2077 const parsed = path$1.parse(loaderContext.resourcePath);
2078 let resourcePath = loaderContext.resourcePath;
2079
2080 if (parsed.ext) {
2081 ext = parsed.ext.substr(1);
2082 }
2083
2084 if (parsed.dir) {
2085 basename = parsed.name;
2086 resourcePath = parsed.dir + path$1.sep;
2087 }
2088
2089 if (typeof context !== "undefined") {
2090 directory = path$1
2091 .relative(context, resourcePath + "_")
2092 .replace(/\\/g, "/")
2093 .replace(/\.\.(\/)?/g, "_$1");
2094 directory = directory.substr(0, directory.length - 1);
2095 } else {
2096 directory = resourcePath.replace(/\\/g, "/").replace(/\.\.(\/)?/g, "_$1");
2097 }
2098
2099 if (directory.length === 1) {
2100 directory = "";
2101 } else if (directory.length > 1) {
2102 folder = path$1.basename(directory);
2103 }
2104 }
2105
2106 if (loaderContext.resourceQuery && loaderContext.resourceQuery.length > 1) {
2107 query = loaderContext.resourceQuery;
2108
2109 const hashIdx = query.indexOf("#");
2110
2111 if (hashIdx >= 0) {
2112 query = query.substr(0, hashIdx);
2113 }
2114 }
2115
2116 let url = filename;
2117
2118 if (content) {
2119 // Match hash template
2120 url = url
2121 // `hash` and `contenthash` are same in `loader-utils` context
2122 // let's keep `hash` for backward compatibility
2123 .replace(
2124 /\[(?:([^[:\]]+):)?(?:hash|contenthash)(?::([a-z]+\d*))?(?::(\d+))?\]/gi,
2125 (all, hashType, digestType, maxLength) =>
2126 getHashDigest(content, hashType, digestType, parseInt(maxLength, 10))
2127 );
2128 }
2129
2130 url = url
2131 .replace(/\[ext\]/gi, () => ext)
2132 .replace(/\[name\]/gi, () => basename)
2133 .replace(/\[path\]/gi, () => directory)
2134 .replace(/\[folder\]/gi, () => folder)
2135 .replace(/\[query\]/gi, () => query);
2136
2137 if (regExp && loaderContext.resourcePath) {
2138 const match = loaderContext.resourcePath.match(new RegExp(regExp));
2139
2140 match &&
2141 match.forEach((matched, i) => {
2142 url = url.replace(new RegExp("\\[" + i + "\\]", "ig"), matched);
2143 });
2144 }
2145
2146 if (
2147 typeof loaderContext.options === "object" &&
2148 typeof loaderContext.options.customInterpolateName === "function"
2149 ) {
2150 url = loaderContext.options.customInterpolateName.call(
2151 loaderContext,
2152 url,
2153 name,
2154 options
2155 );
2156 }
2157
2158 return url;
2159}
2160
2161var interpolateName_1 = interpolateName$1;
2162
2163var interpolateName = interpolateName_1;
2164var path = require$$0$1;
2165
2166/**
2167 * @param {string} pattern
2168 * @param {object} options
2169 * @param {string} options.context
2170 * @param {string} options.hashPrefix
2171 * @return {function}
2172 */
2173var genericNames = function createGenerator(pattern, options) {
2174 options = options || {};
2175 var context =
2176 options && typeof options.context === "string"
2177 ? options.context
2178 : process.cwd();
2179 var hashPrefix =
2180 options && typeof options.hashPrefix === "string" ? options.hashPrefix : "";
2181
2182 /**
2183 * @param {string} localName Usually a class name
2184 * @param {string} filepath Absolute path
2185 * @return {string}
2186 */
2187 return function generate(localName, filepath) {
2188 var name = pattern.replace(/\[local\]/gi, localName);
2189 var loaderContext = {
2190 resourcePath: filepath,
2191 };
2192
2193 var loaderOptions = {
2194 content:
2195 hashPrefix +
2196 path.relative(context, filepath).replace(/\\/g, "/") +
2197 "\x00" +
2198 localName,
2199 context: context,
2200 };
2201
2202 var genericName = interpolateName(loaderContext, name, loaderOptions);
2203 return genericName
2204 .replace(new RegExp("[^a-zA-Z0-9\\-_\u00A0-\uFFFF]", "g"), "-")
2205 .replace(/^((-?[0-9])|--)/, "_$1");
2206 };
2207};
2208
2209var src$2 = {exports: {}};
2210
2211var dist = {exports: {}};
2212
2213var processor = {exports: {}};
2214
2215var parser = {exports: {}};
2216
2217var root$1 = {exports: {}};
2218
2219var container = {exports: {}};
2220
2221var node$1 = {exports: {}};
2222
2223var util = {};
2224
2225var unesc = {exports: {}};
2226
2227(function (module, exports) {
2228
2229 exports.__esModule = true;
2230 exports["default"] = unesc;
2231 // Many thanks for this post which made this migration much easier.
2232 // https://mathiasbynens.be/notes/css-escapes
2233
2234 /**
2235 *
2236 * @param {string} str
2237 * @returns {[string, number]|undefined}
2238 */
2239 function gobbleHex(str) {
2240 var lower = str.toLowerCase();
2241 var hex = '';
2242 var spaceTerminated = false;
2243 for (var i = 0; i < 6 && lower[i] !== undefined; i++) {
[0c6b92a]2244 var code = lower.charCodeAt(i);
2245 // check to see if we are dealing with a valid hex char [a-f|0-9]
2246 var valid = code >= 97 && code <= 102 || code >= 48 && code <= 57;
2247 // https://drafts.csswg.org/css-syntax/#consume-escaped-code-point
[d565449]2248 spaceTerminated = code === 32;
2249 if (!valid) {
2250 break;
2251 }
2252 hex += lower[i];
2253 }
2254 if (hex.length === 0) {
2255 return undefined;
2256 }
2257 var codePoint = parseInt(hex, 16);
[0c6b92a]2258 var isSurrogate = codePoint >= 0xD800 && codePoint <= 0xDFFF;
2259 // Add special case for
[d565449]2260 // "If this number is zero, or is for a surrogate, or is greater than the maximum allowed code point"
2261 // https://drafts.csswg.org/css-syntax/#maximum-allowed-code-point
2262 if (isSurrogate || codePoint === 0x0000 || codePoint > 0x10FFFF) {
2263 return ["\uFFFD", hex.length + (spaceTerminated ? 1 : 0)];
2264 }
2265 return [String.fromCodePoint(codePoint), hex.length + (spaceTerminated ? 1 : 0)];
2266 }
2267 var CONTAINS_ESCAPE = /\\/;
2268 function unesc(str) {
2269 var needToProcess = CONTAINS_ESCAPE.test(str);
2270 if (!needToProcess) {
2271 return str;
2272 }
2273 var ret = "";
2274 for (var i = 0; i < str.length; i++) {
2275 if (str[i] === "\\") {
2276 var gobbled = gobbleHex(str.slice(i + 1, i + 7));
2277 if (gobbled !== undefined) {
2278 ret += gobbled[0];
2279 i += gobbled[1];
2280 continue;
[0c6b92a]2281 }
[d565449]2282
[0c6b92a]2283 // Retain a pair of \\ if double escaped `\\\\`
2284 // https://github.com/postcss/postcss-selector-parser/commit/268c9a7656fb53f543dc620aa5b73a30ec3ff20e
[d565449]2285 if (str[i + 1] === "\\") {
2286 ret += "\\";
2287 i++;
2288 continue;
[0c6b92a]2289 }
[d565449]2290
[0c6b92a]2291 // if \\ is at the end of the string retain it
2292 // https://github.com/postcss/postcss-selector-parser/commit/01a6b346e3612ce1ab20219acc26abdc259ccefb
[d565449]2293 if (str.length === i + 1) {
2294 ret += str[i];
2295 }
2296 continue;
2297 }
2298 ret += str[i];
2299 }
2300 return ret;
2301 }
2302 module.exports = exports.default;
2303} (unesc, unesc.exports));
2304
2305var unescExports = unesc.exports;
2306
2307var getProp = {exports: {}};
2308
2309(function (module, exports) {
2310
2311 exports.__esModule = true;
2312 exports["default"] = getProp;
2313 function getProp(obj) {
2314 for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
2315 props[_key - 1] = arguments[_key];
2316 }
2317 while (props.length > 0) {
2318 var prop = props.shift();
2319 if (!obj[prop]) {
2320 return undefined;
2321 }
2322 obj = obj[prop];
2323 }
2324 return obj;
2325 }
2326 module.exports = exports.default;
2327} (getProp, getProp.exports));
2328
2329var getPropExports = getProp.exports;
2330
2331var ensureObject = {exports: {}};
2332
2333(function (module, exports) {
2334
2335 exports.__esModule = true;
2336 exports["default"] = ensureObject;
2337 function ensureObject(obj) {
2338 for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
2339 props[_key - 1] = arguments[_key];
2340 }
2341 while (props.length > 0) {
2342 var prop = props.shift();
2343 if (!obj[prop]) {
2344 obj[prop] = {};
2345 }
2346 obj = obj[prop];
2347 }
2348 }
2349 module.exports = exports.default;
2350} (ensureObject, ensureObject.exports));
2351
2352var ensureObjectExports = ensureObject.exports;
2353
2354var stripComments = {exports: {}};
2355
2356(function (module, exports) {
2357
2358 exports.__esModule = true;
2359 exports["default"] = stripComments;
2360 function stripComments(str) {
2361 var s = "";
2362 var commentStart = str.indexOf("/*");
2363 var lastEnd = 0;
2364 while (commentStart >= 0) {
2365 s = s + str.slice(lastEnd, commentStart);
2366 var commentEnd = str.indexOf("*/", commentStart + 2);
2367 if (commentEnd < 0) {
2368 return s;
2369 }
2370 lastEnd = commentEnd + 2;
2371 commentStart = str.indexOf("/*", lastEnd);
2372 }
2373 s = s + str.slice(lastEnd);
2374 return s;
2375 }
2376 module.exports = exports.default;
2377} (stripComments, stripComments.exports));
2378
2379var stripCommentsExports = stripComments.exports;
2380
2381util.__esModule = true;
[0c6b92a]2382util.unesc = util.stripComments = util.getProp = util.ensureObject = void 0;
[d565449]2383var _unesc = _interopRequireDefault$3(unescExports);
2384util.unesc = _unesc["default"];
2385var _getProp = _interopRequireDefault$3(getPropExports);
2386util.getProp = _getProp["default"];
2387var _ensureObject = _interopRequireDefault$3(ensureObjectExports);
2388util.ensureObject = _ensureObject["default"];
2389var _stripComments = _interopRequireDefault$3(stripCommentsExports);
2390util.stripComments = _stripComments["default"];
2391function _interopRequireDefault$3(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
2392
2393(function (module, exports) {
2394
2395 exports.__esModule = true;
2396 exports["default"] = void 0;
2397 var _util = util;
2398 function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
[0c6b92a]2399 function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
[d565449]2400 var cloneNode = function cloneNode(obj, parent) {
2401 if (typeof obj !== 'object' || obj === null) {
2402 return obj;
2403 }
2404 var cloned = new obj.constructor();
2405 for (var i in obj) {
2406 if (!obj.hasOwnProperty(i)) {
2407 continue;
2408 }
2409 var value = obj[i];
2410 var type = typeof value;
2411 if (i === 'parent' && type === 'object') {
2412 if (parent) {
2413 cloned[i] = parent;
2414 }
2415 } else if (value instanceof Array) {
2416 cloned[i] = value.map(function (j) {
2417 return cloneNode(j, cloned);
2418 });
2419 } else {
2420 cloned[i] = cloneNode(value, cloned);
2421 }
2422 }
2423 return cloned;
2424 };
2425 var Node = /*#__PURE__*/function () {
2426 function Node(opts) {
2427 if (opts === void 0) {
2428 opts = {};
2429 }
2430 Object.assign(this, opts);
2431 this.spaces = this.spaces || {};
2432 this.spaces.before = this.spaces.before || '';
2433 this.spaces.after = this.spaces.after || '';
2434 }
2435 var _proto = Node.prototype;
2436 _proto.remove = function remove() {
2437 if (this.parent) {
2438 this.parent.removeChild(this);
2439 }
2440 this.parent = undefined;
2441 return this;
2442 };
2443 _proto.replaceWith = function replaceWith() {
2444 if (this.parent) {
2445 for (var index in arguments) {
2446 this.parent.insertBefore(this, arguments[index]);
2447 }
2448 this.remove();
2449 }
2450 return this;
2451 };
2452 _proto.next = function next() {
2453 return this.parent.at(this.parent.index(this) + 1);
2454 };
2455 _proto.prev = function prev() {
2456 return this.parent.at(this.parent.index(this) - 1);
2457 };
2458 _proto.clone = function clone(overrides) {
2459 if (overrides === void 0) {
2460 overrides = {};
2461 }
2462 var cloned = cloneNode(this);
2463 for (var name in overrides) {
2464 cloned[name] = overrides[name];
2465 }
2466 return cloned;
2467 }
[0c6b92a]2468
[d565449]2469 /**
2470 * Some non-standard syntax doesn't follow normal escaping rules for css.
2471 * This allows non standard syntax to be appended to an existing property
2472 * by specifying the escaped value. By specifying the escaped value,
2473 * illegal characters are allowed to be directly inserted into css output.
2474 * @param {string} name the property to set
2475 * @param {any} value the unescaped value of the property
2476 * @param {string} valueEscaped optional. the escaped value of the property.
[0c6b92a]2477 */;
[d565449]2478 _proto.appendToPropertyAndEscape = function appendToPropertyAndEscape(name, value, valueEscaped) {
2479 if (!this.raws) {
2480 this.raws = {};
2481 }
2482 var originalValue = this[name];
2483 var originalEscaped = this.raws[name];
2484 this[name] = originalValue + value; // this may trigger a setter that updates raws, so it has to be set first.
2485 if (originalEscaped || valueEscaped !== value) {
2486 this.raws[name] = (originalEscaped || originalValue) + valueEscaped;
2487 } else {
2488 delete this.raws[name]; // delete any escaped value that was created by the setter.
2489 }
2490 }
[0c6b92a]2491
[d565449]2492 /**
2493 * Some non-standard syntax doesn't follow normal escaping rules for css.
2494 * This allows the escaped value to be specified directly, allowing illegal
2495 * characters to be directly inserted into css output.
2496 * @param {string} name the property to set
2497 * @param {any} value the unescaped value of the property
2498 * @param {string} valueEscaped the escaped value of the property.
[0c6b92a]2499 */;
[d565449]2500 _proto.setPropertyAndEscape = function setPropertyAndEscape(name, value, valueEscaped) {
2501 if (!this.raws) {
2502 this.raws = {};
2503 }
2504 this[name] = value; // this may trigger a setter that updates raws, so it has to be set first.
2505 this.raws[name] = valueEscaped;
2506 }
[0c6b92a]2507
[d565449]2508 /**
2509 * When you want a value to passed through to CSS directly. This method
2510 * deletes the corresponding raw value causing the stringifier to fallback
2511 * to the unescaped value.
2512 * @param {string} name the property to set.
2513 * @param {any} value The value that is both escaped and unescaped.
[0c6b92a]2514 */;
[d565449]2515 _proto.setPropertyWithoutEscape = function setPropertyWithoutEscape(name, value) {
2516 this[name] = value; // this may trigger a setter that updates raws, so it has to be set first.
2517 if (this.raws) {
2518 delete this.raws[name];
2519 }
2520 }
[0c6b92a]2521
[d565449]2522 /**
2523 *
2524 * @param {number} line The number (starting with 1)
2525 * @param {number} column The column number (starting with 1)
[0c6b92a]2526 */;
[d565449]2527 _proto.isAtPosition = function isAtPosition(line, column) {
2528 if (this.source && this.source.start && this.source.end) {
2529 if (this.source.start.line > line) {
2530 return false;
2531 }
2532 if (this.source.end.line < line) {
2533 return false;
2534 }
2535 if (this.source.start.line === line && this.source.start.column > column) {
2536 return false;
2537 }
2538 if (this.source.end.line === line && this.source.end.column < column) {
2539 return false;
2540 }
2541 return true;
2542 }
2543 return undefined;
2544 };
2545 _proto.stringifyProperty = function stringifyProperty(name) {
2546 return this.raws && this.raws[name] || this[name];
2547 };
2548 _proto.valueToString = function valueToString() {
2549 return String(this.stringifyProperty("value"));
2550 };
2551 _proto.toString = function toString() {
2552 return [this.rawSpaceBefore, this.valueToString(), this.rawSpaceAfter].join('');
2553 };
2554 _createClass(Node, [{
2555 key: "rawSpaceBefore",
2556 get: function get() {
2557 var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.before;
2558 if (rawSpace === undefined) {
2559 rawSpace = this.spaces && this.spaces.before;
2560 }
2561 return rawSpace || "";
2562 },
2563 set: function set(raw) {
2564 (0, _util.ensureObject)(this, "raws", "spaces");
2565 this.raws.spaces.before = raw;
2566 }
2567 }, {
2568 key: "rawSpaceAfter",
2569 get: function get() {
2570 var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.after;
2571 if (rawSpace === undefined) {
2572 rawSpace = this.spaces.after;
2573 }
2574 return rawSpace || "";
2575 },
2576 set: function set(raw) {
2577 (0, _util.ensureObject)(this, "raws", "spaces");
2578 this.raws.spaces.after = raw;
2579 }
2580 }]);
2581 return Node;
2582 }();
2583 exports["default"] = Node;
2584 module.exports = exports.default;
2585} (node$1, node$1.exports));
2586
2587var nodeExports = node$1.exports;
2588
2589var types = {};
2590
2591types.__esModule = true;
[0c6b92a]2592types.UNIVERSAL = types.TAG = types.STRING = types.SELECTOR = types.ROOT = types.PSEUDO = types.NESTING = types.ID = types.COMMENT = types.COMBINATOR = types.CLASS = types.ATTRIBUTE = void 0;
[d565449]2593var TAG = 'tag';
2594types.TAG = TAG;
2595var STRING = 'string';
2596types.STRING = STRING;
2597var SELECTOR = 'selector';
2598types.SELECTOR = SELECTOR;
2599var ROOT = 'root';
2600types.ROOT = ROOT;
2601var PSEUDO = 'pseudo';
2602types.PSEUDO = PSEUDO;
2603var NESTING = 'nesting';
2604types.NESTING = NESTING;
2605var ID = 'id';
2606types.ID = ID;
2607var COMMENT = 'comment';
2608types.COMMENT = COMMENT;
2609var COMBINATOR = 'combinator';
2610types.COMBINATOR = COMBINATOR;
2611var CLASS = 'class';
2612types.CLASS = CLASS;
2613var ATTRIBUTE = 'attribute';
2614types.ATTRIBUTE = ATTRIBUTE;
2615var UNIVERSAL = 'universal';
2616types.UNIVERSAL = UNIVERSAL;
2617
2618(function (module, exports) {
2619
2620 exports.__esModule = true;
2621 exports["default"] = void 0;
2622 var _node = _interopRequireDefault(nodeExports);
2623 var types$1 = _interopRequireWildcard(types);
[0c6b92a]2624 function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
2625 function _interopRequireWildcard(obj, nodeInterop) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
[d565449]2626 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
[0c6b92a]2627 function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike) { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
[d565449]2628 function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
2629 function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
2630 function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
[0c6b92a]2631 function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
[d565449]2632 function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
[0c6b92a]2633 function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
[d565449]2634 var Container = /*#__PURE__*/function (_Node) {
2635 _inheritsLoose(Container, _Node);
2636 function Container(opts) {
2637 var _this;
2638 _this = _Node.call(this, opts) || this;
2639 if (!_this.nodes) {
2640 _this.nodes = [];
2641 }
2642 return _this;
2643 }
2644 var _proto = Container.prototype;
2645 _proto.append = function append(selector) {
2646 selector.parent = this;
2647 this.nodes.push(selector);
2648 return this;
2649 };
2650 _proto.prepend = function prepend(selector) {
2651 selector.parent = this;
2652 this.nodes.unshift(selector);
2653 return this;
2654 };
2655 _proto.at = function at(index) {
2656 return this.nodes[index];
2657 };
2658 _proto.index = function index(child) {
2659 if (typeof child === 'number') {
2660 return child;
2661 }
2662 return this.nodes.indexOf(child);
2663 };
2664 _proto.removeChild = function removeChild(child) {
2665 child = this.index(child);
2666 this.at(child).parent = undefined;
2667 this.nodes.splice(child, 1);
2668 var index;
2669 for (var id in this.indexes) {
2670 index = this.indexes[id];
2671 if (index >= child) {
2672 this.indexes[id] = index - 1;
2673 }
2674 }
2675 return this;
2676 };
2677 _proto.removeAll = function removeAll() {
2678 for (var _iterator = _createForOfIteratorHelperLoose(this.nodes), _step; !(_step = _iterator()).done;) {
2679 var node = _step.value;
2680 node.parent = undefined;
2681 }
2682 this.nodes = [];
2683 return this;
2684 };
2685 _proto.empty = function empty() {
2686 return this.removeAll();
2687 };
2688 _proto.insertAfter = function insertAfter(oldNode, newNode) {
2689 newNode.parent = this;
2690 var oldIndex = this.index(oldNode);
2691 this.nodes.splice(oldIndex + 1, 0, newNode);
2692 newNode.parent = this;
2693 var index;
2694 for (var id in this.indexes) {
2695 index = this.indexes[id];
2696 if (oldIndex <= index) {
2697 this.indexes[id] = index + 1;
2698 }
2699 }
2700 return this;
2701 };
2702 _proto.insertBefore = function insertBefore(oldNode, newNode) {
2703 newNode.parent = this;
2704 var oldIndex = this.index(oldNode);
2705 this.nodes.splice(oldIndex, 0, newNode);
2706 newNode.parent = this;
2707 var index;
2708 for (var id in this.indexes) {
2709 index = this.indexes[id];
2710 if (index <= oldIndex) {
2711 this.indexes[id] = index + 1;
2712 }
2713 }
2714 return this;
2715 };
2716 _proto._findChildAtPosition = function _findChildAtPosition(line, col) {
2717 var found = undefined;
2718 this.each(function (node) {
2719 if (node.atPosition) {
2720 var foundChild = node.atPosition(line, col);
2721 if (foundChild) {
2722 found = foundChild;
2723 return false;
2724 }
2725 } else if (node.isAtPosition(line, col)) {
2726 found = node;
2727 return false;
2728 }
2729 });
2730 return found;
2731 }
[0c6b92a]2732
[d565449]2733 /**
2734 * Return the most specific node at the line and column number given.
2735 * The source location is based on the original parsed location, locations aren't
2736 * updated as selector nodes are mutated.
2737 *
2738 * Note that this location is relative to the location of the first character
2739 * of the selector, and not the location of the selector in the overall document
2740 * when used in conjunction with postcss.
2741 *
2742 * If not found, returns undefined.
2743 * @param {number} line The line number of the node to find. (1-based index)
2744 * @param {number} col The column number of the node to find. (1-based index)
[0c6b92a]2745 */;
[d565449]2746 _proto.atPosition = function atPosition(line, col) {
2747 if (this.isAtPosition(line, col)) {
2748 return this._findChildAtPosition(line, col) || this;
2749 } else {
2750 return undefined;
2751 }
2752 };
2753 _proto._inferEndPosition = function _inferEndPosition() {
2754 if (this.last && this.last.source && this.last.source.end) {
2755 this.source = this.source || {};
2756 this.source.end = this.source.end || {};
2757 Object.assign(this.source.end, this.last.source.end);
2758 }
2759 };
2760 _proto.each = function each(callback) {
2761 if (!this.lastEach) {
2762 this.lastEach = 0;
2763 }
2764 if (!this.indexes) {
2765 this.indexes = {};
2766 }
2767 this.lastEach++;
2768 var id = this.lastEach;
2769 this.indexes[id] = 0;
2770 if (!this.length) {
2771 return undefined;
2772 }
2773 var index, result;
2774 while (this.indexes[id] < this.length) {
2775 index = this.indexes[id];
2776 result = callback(this.at(index), index);
2777 if (result === false) {
2778 break;
2779 }
2780 this.indexes[id] += 1;
2781 }
2782 delete this.indexes[id];
2783 if (result === false) {
2784 return false;
2785 }
2786 };
2787 _proto.walk = function walk(callback) {
2788 return this.each(function (node, i) {
2789 var result = callback(node, i);
2790 if (result !== false && node.length) {
2791 result = node.walk(callback);
2792 }
2793 if (result === false) {
2794 return false;
2795 }
2796 });
2797 };
2798 _proto.walkAttributes = function walkAttributes(callback) {
2799 var _this2 = this;
2800 return this.walk(function (selector) {
2801 if (selector.type === types$1.ATTRIBUTE) {
2802 return callback.call(_this2, selector);
2803 }
2804 });
2805 };
2806 _proto.walkClasses = function walkClasses(callback) {
2807 var _this3 = this;
2808 return this.walk(function (selector) {
2809 if (selector.type === types$1.CLASS) {
2810 return callback.call(_this3, selector);
2811 }
2812 });
2813 };
2814 _proto.walkCombinators = function walkCombinators(callback) {
2815 var _this4 = this;
2816 return this.walk(function (selector) {
2817 if (selector.type === types$1.COMBINATOR) {
2818 return callback.call(_this4, selector);
2819 }
2820 });
2821 };
2822 _proto.walkComments = function walkComments(callback) {
2823 var _this5 = this;
2824 return this.walk(function (selector) {
2825 if (selector.type === types$1.COMMENT) {
2826 return callback.call(_this5, selector);
2827 }
2828 });
2829 };
2830 _proto.walkIds = function walkIds(callback) {
2831 var _this6 = this;
2832 return this.walk(function (selector) {
2833 if (selector.type === types$1.ID) {
2834 return callback.call(_this6, selector);
2835 }
2836 });
2837 };
2838 _proto.walkNesting = function walkNesting(callback) {
2839 var _this7 = this;
2840 return this.walk(function (selector) {
2841 if (selector.type === types$1.NESTING) {
2842 return callback.call(_this7, selector);
2843 }
2844 });
2845 };
2846 _proto.walkPseudos = function walkPseudos(callback) {
2847 var _this8 = this;
2848 return this.walk(function (selector) {
2849 if (selector.type === types$1.PSEUDO) {
2850 return callback.call(_this8, selector);
2851 }
2852 });
2853 };
2854 _proto.walkTags = function walkTags(callback) {
2855 var _this9 = this;
2856 return this.walk(function (selector) {
2857 if (selector.type === types$1.TAG) {
2858 return callback.call(_this9, selector);
2859 }
2860 });
2861 };
2862 _proto.walkUniversals = function walkUniversals(callback) {
2863 var _this10 = this;
2864 return this.walk(function (selector) {
2865 if (selector.type === types$1.UNIVERSAL) {
2866 return callback.call(_this10, selector);
2867 }
2868 });
2869 };
2870 _proto.split = function split(callback) {
2871 var _this11 = this;
2872 var current = [];
2873 return this.reduce(function (memo, node, index) {
2874 var split = callback.call(_this11, node);
2875 current.push(node);
2876 if (split) {
2877 memo.push(current);
2878 current = [];
2879 } else if (index === _this11.length - 1) {
2880 memo.push(current);
2881 }
2882 return memo;
2883 }, []);
2884 };
2885 _proto.map = function map(callback) {
2886 return this.nodes.map(callback);
2887 };
2888 _proto.reduce = function reduce(callback, memo) {
2889 return this.nodes.reduce(callback, memo);
2890 };
2891 _proto.every = function every(callback) {
2892 return this.nodes.every(callback);
2893 };
2894 _proto.some = function some(callback) {
2895 return this.nodes.some(callback);
2896 };
2897 _proto.filter = function filter(callback) {
2898 return this.nodes.filter(callback);
2899 };
2900 _proto.sort = function sort(callback) {
2901 return this.nodes.sort(callback);
2902 };
2903 _proto.toString = function toString() {
2904 return this.map(String).join('');
2905 };
2906 _createClass(Container, [{
2907 key: "first",
2908 get: function get() {
2909 return this.at(0);
2910 }
2911 }, {
2912 key: "last",
2913 get: function get() {
2914 return this.at(this.length - 1);
2915 }
2916 }, {
2917 key: "length",
2918 get: function get() {
2919 return this.nodes.length;
2920 }
2921 }]);
2922 return Container;
2923 }(_node["default"]);
2924 exports["default"] = Container;
2925 module.exports = exports.default;
2926} (container, container.exports));
2927
2928var containerExports = container.exports;
2929
2930(function (module, exports) {
2931
2932 exports.__esModule = true;
2933 exports["default"] = void 0;
2934 var _container = _interopRequireDefault(containerExports);
2935 var _types = types;
2936 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
2937 function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
[0c6b92a]2938 function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
[d565449]2939 function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
[0c6b92a]2940 function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
[d565449]2941 var Root = /*#__PURE__*/function (_Container) {
2942 _inheritsLoose(Root, _Container);
2943 function Root(opts) {
2944 var _this;
2945 _this = _Container.call(this, opts) || this;
2946 _this.type = _types.ROOT;
2947 return _this;
2948 }
2949 var _proto = Root.prototype;
2950 _proto.toString = function toString() {
2951 var str = this.reduce(function (memo, selector) {
2952 memo.push(String(selector));
2953 return memo;
2954 }, []).join(',');
2955 return this.trailingComma ? str + ',' : str;
2956 };
2957 _proto.error = function error(message, options) {
2958 if (this._error) {
2959 return this._error(message, options);
2960 } else {
2961 return new Error(message);
2962 }
2963 };
2964 _createClass(Root, [{
2965 key: "errorGenerator",
2966 set: function set(handler) {
2967 this._error = handler;
2968 }
2969 }]);
2970 return Root;
2971 }(_container["default"]);
2972 exports["default"] = Root;
2973 module.exports = exports.default;
2974} (root$1, root$1.exports));
2975
2976var rootExports = root$1.exports;
2977
2978var selector$1 = {exports: {}};
2979
2980(function (module, exports) {
2981
2982 exports.__esModule = true;
2983 exports["default"] = void 0;
2984 var _container = _interopRequireDefault(containerExports);
2985 var _types = types;
2986 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
2987 function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
[0c6b92a]2988 function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
[d565449]2989 var Selector = /*#__PURE__*/function (_Container) {
2990 _inheritsLoose(Selector, _Container);
2991 function Selector(opts) {
2992 var _this;
2993 _this = _Container.call(this, opts) || this;
2994 _this.type = _types.SELECTOR;
2995 return _this;
2996 }
2997 return Selector;
2998 }(_container["default"]);
2999 exports["default"] = Selector;
3000 module.exports = exports.default;
3001} (selector$1, selector$1.exports));
3002
3003var selectorExports = selector$1.exports;
3004
3005var className$1 = {exports: {}};
3006
3007/*! https://mths.be/cssesc v3.0.0 by @mathias */
3008
3009var object = {};
3010var hasOwnProperty$1 = object.hasOwnProperty;
3011var merge = function merge(options, defaults) {
3012 if (!options) {
3013 return defaults;
3014 }
3015 var result = {};
3016 for (var key in defaults) {
3017 // `if (defaults.hasOwnProperty(key) { … }` is not needed here, since
3018 // only recognized option names are used.
3019 result[key] = hasOwnProperty$1.call(options, key) ? options[key] : defaults[key];
3020 }
3021 return result;
3022};
3023
3024var regexAnySingleEscape = /[ -,\.\/:-@\[-\^`\{-~]/;
3025var regexSingleEscape = /[ -,\.\/:-@\[\]\^`\{-~]/;
3026var regexExcessiveSpaces = /(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g;
3027
3028// https://mathiasbynens.be/notes/css-escapes#css
3029var cssesc = function cssesc(string, options) {
3030 options = merge(options, cssesc.options);
3031 if (options.quotes != 'single' && options.quotes != 'double') {
3032 options.quotes = 'single';
3033 }
3034 var quote = options.quotes == 'double' ? '"' : '\'';
3035 var isIdentifier = options.isIdentifier;
3036
3037 var firstChar = string.charAt(0);
3038 var output = '';
3039 var counter = 0;
3040 var length = string.length;
3041 while (counter < length) {
3042 var character = string.charAt(counter++);
3043 var codePoint = character.charCodeAt();
3044 var value = void 0;
3045 // If it’s not a printable ASCII character…
3046 if (codePoint < 0x20 || codePoint > 0x7E) {
3047 if (codePoint >= 0xD800 && codePoint <= 0xDBFF && counter < length) {
3048 // It’s a high surrogate, and there is a next character.
3049 var extra = string.charCodeAt(counter++);
3050 if ((extra & 0xFC00) == 0xDC00) {
3051 // next character is low surrogate
3052 codePoint = ((codePoint & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000;
3053 } else {
3054 // It’s an unmatched surrogate; only append this code unit, in case
3055 // the next code unit is the high surrogate of a surrogate pair.
3056 counter--;
3057 }
3058 }
3059 value = '\\' + codePoint.toString(16).toUpperCase() + ' ';
3060 } else {
3061 if (options.escapeEverything) {
3062 if (regexAnySingleEscape.test(character)) {
3063 value = '\\' + character;
3064 } else {
3065 value = '\\' + codePoint.toString(16).toUpperCase() + ' ';
3066 }
3067 } else if (/[\t\n\f\r\x0B]/.test(character)) {
3068 value = '\\' + codePoint.toString(16).toUpperCase() + ' ';
3069 } else if (character == '\\' || !isIdentifier && (character == '"' && quote == character || character == '\'' && quote == character) || isIdentifier && regexSingleEscape.test(character)) {
3070 value = '\\' + character;
3071 } else {
3072 value = character;
3073 }
3074 }
3075 output += value;
3076 }
3077
3078 if (isIdentifier) {
3079 if (/^-[-\d]/.test(output)) {
3080 output = '\\-' + output.slice(1);
3081 } else if (/\d/.test(firstChar)) {
3082 output = '\\3' + firstChar + ' ' + output.slice(1);
3083 }
3084 }
3085
3086 // Remove spaces after `\HEX` escapes that are not followed by a hex digit,
3087 // since they’re redundant. Note that this is only possible if the escape
3088 // sequence isn’t preceded by an odd number of backslashes.
3089 output = output.replace(regexExcessiveSpaces, function ($0, $1, $2) {
3090 if ($1 && $1.length % 2) {
3091 // It’s not safe to remove the space, so don’t.
3092 return $0;
3093 }
3094 // Strip the space.
3095 return ($1 || '') + $2;
3096 });
3097
3098 if (!isIdentifier && options.wrap) {
3099 return quote + output + quote;
3100 }
3101 return output;
3102};
3103
3104// Expose default options (so they can be overridden globally).
3105cssesc.options = {
3106 'escapeEverything': false,
3107 'isIdentifier': false,
3108 'quotes': 'single',
3109 'wrap': false
3110};
3111
3112cssesc.version = '3.0.0';
3113
3114var cssesc_1 = cssesc;
3115
3116(function (module, exports) {
3117
3118 exports.__esModule = true;
3119 exports["default"] = void 0;
3120 var _cssesc = _interopRequireDefault(cssesc_1);
3121 var _util = util;
3122 var _node = _interopRequireDefault(nodeExports);
3123 var _types = types;
3124 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
3125 function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
[0c6b92a]3126 function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
[d565449]3127 function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
[0c6b92a]3128 function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
[d565449]3129 var ClassName = /*#__PURE__*/function (_Node) {
3130 _inheritsLoose(ClassName, _Node);
3131 function ClassName(opts) {
3132 var _this;
3133 _this = _Node.call(this, opts) || this;
3134 _this.type = _types.CLASS;
3135 _this._constructed = true;
3136 return _this;
3137 }
3138 var _proto = ClassName.prototype;
3139 _proto.valueToString = function valueToString() {
3140 return '.' + _Node.prototype.valueToString.call(this);
3141 };
3142 _createClass(ClassName, [{
3143 key: "value",
3144 get: function get() {
3145 return this._value;
3146 },
3147 set: function set(v) {
3148 if (this._constructed) {
3149 var escaped = (0, _cssesc["default"])(v, {
3150 isIdentifier: true
3151 });
3152 if (escaped !== v) {
3153 (0, _util.ensureObject)(this, "raws");
3154 this.raws.value = escaped;
3155 } else if (this.raws) {
3156 delete this.raws.value;
3157 }
3158 }
3159 this._value = v;
3160 }
3161 }]);
3162 return ClassName;
3163 }(_node["default"]);
3164 exports["default"] = ClassName;
3165 module.exports = exports.default;
3166} (className$1, className$1.exports));
3167
3168var classNameExports = className$1.exports;
3169
3170var comment$2 = {exports: {}};
3171
3172(function (module, exports) {
3173
3174 exports.__esModule = true;
3175 exports["default"] = void 0;
3176 var _node = _interopRequireDefault(nodeExports);
3177 var _types = types;
3178 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
3179 function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
[0c6b92a]3180 function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
[d565449]3181 var Comment = /*#__PURE__*/function (_Node) {
3182 _inheritsLoose(Comment, _Node);
3183 function Comment(opts) {
3184 var _this;
3185 _this = _Node.call(this, opts) || this;
3186 _this.type = _types.COMMENT;
3187 return _this;
3188 }
3189 return Comment;
3190 }(_node["default"]);
3191 exports["default"] = Comment;
3192 module.exports = exports.default;
3193} (comment$2, comment$2.exports));
3194
3195var commentExports = comment$2.exports;
3196
3197var id$1 = {exports: {}};
3198
3199(function (module, exports) {
3200
3201 exports.__esModule = true;
3202 exports["default"] = void 0;
3203 var _node = _interopRequireDefault(nodeExports);
3204 var _types = types;
3205 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
3206 function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
[0c6b92a]3207 function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
[d565449]3208 var ID = /*#__PURE__*/function (_Node) {
3209 _inheritsLoose(ID, _Node);
3210 function ID(opts) {
3211 var _this;
3212 _this = _Node.call(this, opts) || this;
3213 _this.type = _types.ID;
3214 return _this;
3215 }
3216 var _proto = ID.prototype;
3217 _proto.valueToString = function valueToString() {
3218 return '#' + _Node.prototype.valueToString.call(this);
3219 };
3220 return ID;
3221 }(_node["default"]);
3222 exports["default"] = ID;
3223 module.exports = exports.default;
3224} (id$1, id$1.exports));
3225
3226var idExports = id$1.exports;
3227
3228var tag$1 = {exports: {}};
3229
3230var namespace = {exports: {}};
3231
3232(function (module, exports) {
3233
3234 exports.__esModule = true;
3235 exports["default"] = void 0;
3236 var _cssesc = _interopRequireDefault(cssesc_1);
3237 var _util = util;
3238 var _node = _interopRequireDefault(nodeExports);
3239 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
3240 function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
[0c6b92a]3241 function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
[d565449]3242 function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
[0c6b92a]3243 function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
[d565449]3244 var Namespace = /*#__PURE__*/function (_Node) {
3245 _inheritsLoose(Namespace, _Node);
3246 function Namespace() {
3247 return _Node.apply(this, arguments) || this;
3248 }
3249 var _proto = Namespace.prototype;
3250 _proto.qualifiedName = function qualifiedName(value) {
3251 if (this.namespace) {
3252 return this.namespaceString + "|" + value;
3253 } else {
3254 return value;
3255 }
3256 };
3257 _proto.valueToString = function valueToString() {
3258 return this.qualifiedName(_Node.prototype.valueToString.call(this));
3259 };
3260 _createClass(Namespace, [{
3261 key: "namespace",
3262 get: function get() {
3263 return this._namespace;
3264 },
3265 set: function set(namespace) {
3266 if (namespace === true || namespace === "*" || namespace === "&") {
3267 this._namespace = namespace;
3268 if (this.raws) {
3269 delete this.raws.namespace;
3270 }
3271 return;
3272 }
3273 var escaped = (0, _cssesc["default"])(namespace, {
3274 isIdentifier: true
3275 });
3276 this._namespace = namespace;
3277 if (escaped !== namespace) {
3278 (0, _util.ensureObject)(this, "raws");
3279 this.raws.namespace = escaped;
3280 } else if (this.raws) {
3281 delete this.raws.namespace;
3282 }
3283 }
3284 }, {
3285 key: "ns",
3286 get: function get() {
3287 return this._namespace;
3288 },
3289 set: function set(namespace) {
3290 this.namespace = namespace;
3291 }
3292 }, {
3293 key: "namespaceString",
3294 get: function get() {
3295 if (this.namespace) {
3296 var ns = this.stringifyProperty("namespace");
3297 if (ns === true) {
3298 return '';
3299 } else {
3300 return ns;
3301 }
3302 } else {
3303 return '';
3304 }
3305 }
3306 }]);
3307 return Namespace;
3308 }(_node["default"]);
3309 exports["default"] = Namespace;
3310 module.exports = exports.default;
3311} (namespace, namespace.exports));
3312
3313var namespaceExports = namespace.exports;
3314
3315(function (module, exports) {
3316
3317 exports.__esModule = true;
3318 exports["default"] = void 0;
3319 var _namespace = _interopRequireDefault(namespaceExports);
3320 var _types = types;
3321 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
3322 function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
[0c6b92a]3323 function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
[d565449]3324 var Tag = /*#__PURE__*/function (_Namespace) {
3325 _inheritsLoose(Tag, _Namespace);
3326 function Tag(opts) {
3327 var _this;
3328 _this = _Namespace.call(this, opts) || this;
3329 _this.type = _types.TAG;
3330 return _this;
3331 }
3332 return Tag;
3333 }(_namespace["default"]);
3334 exports["default"] = Tag;
3335 module.exports = exports.default;
3336} (tag$1, tag$1.exports));
3337
3338var tagExports = tag$1.exports;
3339
3340var string$1 = {exports: {}};
3341
3342(function (module, exports) {
3343
3344 exports.__esModule = true;
3345 exports["default"] = void 0;
3346 var _node = _interopRequireDefault(nodeExports);
3347 var _types = types;
3348 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
3349 function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
[0c6b92a]3350 function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
[d565449]3351 var String = /*#__PURE__*/function (_Node) {
3352 _inheritsLoose(String, _Node);
3353 function String(opts) {
3354 var _this;
3355 _this = _Node.call(this, opts) || this;
3356 _this.type = _types.STRING;
3357 return _this;
3358 }
3359 return String;
3360 }(_node["default"]);
3361 exports["default"] = String;
3362 module.exports = exports.default;
3363} (string$1, string$1.exports));
3364
3365var stringExports = string$1.exports;
3366
3367var pseudo$1 = {exports: {}};
3368
3369(function (module, exports) {
3370
3371 exports.__esModule = true;
3372 exports["default"] = void 0;
3373 var _container = _interopRequireDefault(containerExports);
3374 var _types = types;
3375 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
3376 function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
[0c6b92a]3377 function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
[d565449]3378 var Pseudo = /*#__PURE__*/function (_Container) {
3379 _inheritsLoose(Pseudo, _Container);
3380 function Pseudo(opts) {
3381 var _this;
3382 _this = _Container.call(this, opts) || this;
3383 _this.type = _types.PSEUDO;
3384 return _this;
3385 }
3386 var _proto = Pseudo.prototype;
3387 _proto.toString = function toString() {
3388 var params = this.length ? '(' + this.map(String).join(',') + ')' : '';
3389 return [this.rawSpaceBefore, this.stringifyProperty("value"), params, this.rawSpaceAfter].join('');
3390 };
3391 return Pseudo;
3392 }(_container["default"]);
3393 exports["default"] = Pseudo;
3394 module.exports = exports.default;
3395} (pseudo$1, pseudo$1.exports));
3396
3397var pseudoExports = pseudo$1.exports;
3398
3399var attribute$1 = {};
3400
3401/**
3402 * For Node.js, simply re-export the core `util.deprecate` function.
3403 */
3404
3405var node = require$$0$2.deprecate;
3406
3407(function (exports) {
3408
3409 exports.__esModule = true;
3410 exports["default"] = void 0;
[0c6b92a]3411 exports.unescapeValue = unescapeValue;
[d565449]3412 var _cssesc = _interopRequireDefault(cssesc_1);
3413 var _unesc = _interopRequireDefault(unescExports);
3414 var _namespace = _interopRequireDefault(namespaceExports);
3415 var _types = types;
3416 var _CSSESC_QUOTE_OPTIONS;
3417 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
3418 function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
[0c6b92a]3419 function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
[d565449]3420 function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
[0c6b92a]3421 function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
[d565449]3422 var deprecate = node;
3423 var WRAPPED_IN_QUOTES = /^('|")([^]*)\1$/;
3424 var warnOfDeprecatedValueAssignment = deprecate(function () {}, "Assigning an attribute a value containing characters that might need to be escaped is deprecated. " + "Call attribute.setValue() instead.");
3425 var warnOfDeprecatedQuotedAssignment = deprecate(function () {}, "Assigning attr.quoted is deprecated and has no effect. Assign to attr.quoteMark instead.");
3426 var warnOfDeprecatedConstructor = deprecate(function () {}, "Constructing an Attribute selector with a value without specifying quoteMark is deprecated. Note: The value should be unescaped now.");
3427 function unescapeValue(value) {
3428 var deprecatedUsage = false;
3429 var quoteMark = null;
3430 var unescaped = value;
3431 var m = unescaped.match(WRAPPED_IN_QUOTES);
3432 if (m) {
3433 quoteMark = m[1];
3434 unescaped = m[2];
3435 }
3436 unescaped = (0, _unesc["default"])(unescaped);
3437 if (unescaped !== value) {
3438 deprecatedUsage = true;
3439 }
3440 return {
3441 deprecatedUsage: deprecatedUsage,
3442 unescaped: unescaped,
3443 quoteMark: quoteMark
3444 };
3445 }
3446 function handleDeprecatedContructorOpts(opts) {
3447 if (opts.quoteMark !== undefined) {
3448 return opts;
3449 }
3450 if (opts.value === undefined) {
3451 return opts;
3452 }
3453 warnOfDeprecatedConstructor();
3454 var _unescapeValue = unescapeValue(opts.value),
[0c6b92a]3455 quoteMark = _unescapeValue.quoteMark,
3456 unescaped = _unescapeValue.unescaped;
[d565449]3457 if (!opts.raws) {
3458 opts.raws = {};
3459 }
3460 if (opts.raws.value === undefined) {
3461 opts.raws.value = opts.value;
3462 }
3463 opts.value = unescaped;
3464 opts.quoteMark = quoteMark;
3465 return opts;
3466 }
3467 var Attribute = /*#__PURE__*/function (_Namespace) {
3468 _inheritsLoose(Attribute, _Namespace);
3469 function Attribute(opts) {
3470 var _this;
3471 if (opts === void 0) {
3472 opts = {};
3473 }
3474 _this = _Namespace.call(this, handleDeprecatedContructorOpts(opts)) || this;
3475 _this.type = _types.ATTRIBUTE;
3476 _this.raws = _this.raws || {};
3477 Object.defineProperty(_this.raws, 'unquoted', {
3478 get: deprecate(function () {
3479 return _this.value;
3480 }, "attr.raws.unquoted is deprecated. Call attr.value instead."),
3481 set: deprecate(function () {
3482 return _this.value;
3483 }, "Setting attr.raws.unquoted is deprecated and has no effect. attr.value is unescaped by default now.")
3484 });
3485 _this._constructed = true;
3486 return _this;
3487 }
[0c6b92a]3488
[d565449]3489 /**
3490 * Returns the Attribute's value quoted such that it would be legal to use
3491 * in the value of a css file. The original value's quotation setting
3492 * used for stringification is left unchanged. See `setValue(value, options)`
3493 * if you want to control the quote settings of a new value for the attribute.
3494 *
3495 * You can also change the quotation used for the current value by setting quoteMark.
3496 *
3497 * Options:
3498 * * quoteMark {'"' | "'" | null} - Use this value to quote the value. If this
3499 * option is not set, the original value for quoteMark will be used. If
3500 * indeterminate, a double quote is used. The legal values are:
3501 * * `null` - the value will be unquoted and characters will be escaped as necessary.
3502 * * `'` - the value will be quoted with a single quote and single quotes are escaped.
3503 * * `"` - the value will be quoted with a double quote and double quotes are escaped.
3504 * * preferCurrentQuoteMark {boolean} - if true, prefer the source quote mark
3505 * over the quoteMark option value.
3506 * * smart {boolean} - if true, will select a quote mark based on the value
3507 * and the other options specified here. See the `smartQuoteMark()`
3508 * method.
3509 **/
3510 var _proto = Attribute.prototype;
3511 _proto.getQuotedValue = function getQuotedValue(options) {
3512 if (options === void 0) {
3513 options = {};
3514 }
3515 var quoteMark = this._determineQuoteMark(options);
3516 var cssescopts = CSSESC_QUOTE_OPTIONS[quoteMark];
3517 var escaped = (0, _cssesc["default"])(this._value, cssescopts);
3518 return escaped;
3519 };
3520 _proto._determineQuoteMark = function _determineQuoteMark(options) {
3521 return options.smart ? this.smartQuoteMark(options) : this.preferredQuoteMark(options);
3522 }
[0c6b92a]3523
[d565449]3524 /**
3525 * Set the unescaped value with the specified quotation options. The value
3526 * provided must not include any wrapping quote marks -- those quotes will
3527 * be interpreted as part of the value and escaped accordingly.
[0c6b92a]3528 */;
[d565449]3529 _proto.setValue = function setValue(value, options) {
3530 if (options === void 0) {
3531 options = {};
3532 }
3533 this._value = value;
3534 this._quoteMark = this._determineQuoteMark(options);
3535 this._syncRawValue();
3536 }
[0c6b92a]3537
[d565449]3538 /**
3539 * Intelligently select a quoteMark value based on the value's contents. If
3540 * the value is a legal CSS ident, it will not be quoted. Otherwise a quote
3541 * mark will be picked that minimizes the number of escapes.
3542 *
3543 * If there's no clear winner, the quote mark from these options is used,
3544 * then the source quote mark (this is inverted if `preferCurrentQuoteMark` is
3545 * true). If the quoteMark is unspecified, a double quote is used.
3546 *
3547 * @param options This takes the quoteMark and preferCurrentQuoteMark options
3548 * from the quoteValue method.
[0c6b92a]3549 */;
[d565449]3550 _proto.smartQuoteMark = function smartQuoteMark(options) {
3551 var v = this.value;
3552 var numSingleQuotes = v.replace(/[^']/g, '').length;
3553 var numDoubleQuotes = v.replace(/[^"]/g, '').length;
3554 if (numSingleQuotes + numDoubleQuotes === 0) {
3555 var escaped = (0, _cssesc["default"])(v, {
3556 isIdentifier: true
3557 });
3558 if (escaped === v) {
3559 return Attribute.NO_QUOTE;
3560 } else {
3561 var pref = this.preferredQuoteMark(options);
3562 if (pref === Attribute.NO_QUOTE) {
3563 // pick a quote mark that isn't none and see if it's smaller
3564 var quote = this.quoteMark || options.quoteMark || Attribute.DOUBLE_QUOTE;
3565 var opts = CSSESC_QUOTE_OPTIONS[quote];
3566 var quoteValue = (0, _cssesc["default"])(v, opts);
3567 if (quoteValue.length < escaped.length) {
3568 return quote;
3569 }
3570 }
3571 return pref;
3572 }
3573 } else if (numDoubleQuotes === numSingleQuotes) {
3574 return this.preferredQuoteMark(options);
3575 } else if (numDoubleQuotes < numSingleQuotes) {
3576 return Attribute.DOUBLE_QUOTE;
3577 } else {
3578 return Attribute.SINGLE_QUOTE;
3579 }
3580 }
[0c6b92a]3581
[d565449]3582 /**
3583 * Selects the preferred quote mark based on the options and the current quote mark value.
3584 * If you want the quote mark to depend on the attribute value, call `smartQuoteMark(opts)`
3585 * instead.
[0c6b92a]3586 */;
[d565449]3587 _proto.preferredQuoteMark = function preferredQuoteMark(options) {
3588 var quoteMark = options.preferCurrentQuoteMark ? this.quoteMark : options.quoteMark;
3589 if (quoteMark === undefined) {
3590 quoteMark = options.preferCurrentQuoteMark ? options.quoteMark : this.quoteMark;
3591 }
3592 if (quoteMark === undefined) {
3593 quoteMark = Attribute.DOUBLE_QUOTE;
3594 }
3595 return quoteMark;
3596 };
3597 _proto._syncRawValue = function _syncRawValue() {
3598 var rawValue = (0, _cssesc["default"])(this._value, CSSESC_QUOTE_OPTIONS[this.quoteMark]);
3599 if (rawValue === this._value) {
3600 if (this.raws) {
3601 delete this.raws.value;
3602 }
3603 } else {
3604 this.raws.value = rawValue;
3605 }
3606 };
3607 _proto._handleEscapes = function _handleEscapes(prop, value) {
3608 if (this._constructed) {
3609 var escaped = (0, _cssesc["default"])(value, {
3610 isIdentifier: true
3611 });
3612 if (escaped !== value) {
3613 this.raws[prop] = escaped;
3614 } else {
3615 delete this.raws[prop];
3616 }
3617 }
3618 };
3619 _proto._spacesFor = function _spacesFor(name) {
3620 var attrSpaces = {
3621 before: '',
3622 after: ''
3623 };
3624 var spaces = this.spaces[name] || {};
3625 var rawSpaces = this.raws.spaces && this.raws.spaces[name] || {};
3626 return Object.assign(attrSpaces, spaces, rawSpaces);
3627 };
3628 _proto._stringFor = function _stringFor(name, spaceName, concat) {
3629 if (spaceName === void 0) {
3630 spaceName = name;
3631 }
3632 if (concat === void 0) {
3633 concat = defaultAttrConcat;
3634 }
3635 var attrSpaces = this._spacesFor(spaceName);
3636 return concat(this.stringifyProperty(name), attrSpaces);
3637 }
[0c6b92a]3638
[d565449]3639 /**
3640 * returns the offset of the attribute part specified relative to the
3641 * start of the node of the output string.
3642 *
3643 * * "ns" - alias for "namespace"
3644 * * "namespace" - the namespace if it exists.
3645 * * "attribute" - the attribute name
3646 * * "attributeNS" - the start of the attribute or its namespace
3647 * * "operator" - the match operator of the attribute
3648 * * "value" - The value (string or identifier)
3649 * * "insensitive" - the case insensitivity flag;
3650 * @param part One of the possible values inside an attribute.
3651 * @returns -1 if the name is invalid or the value doesn't exist in this attribute.
[0c6b92a]3652 */;
[d565449]3653 _proto.offsetOf = function offsetOf(name) {
3654 var count = 1;
3655 var attributeSpaces = this._spacesFor("attribute");
3656 count += attributeSpaces.before.length;
3657 if (name === "namespace" || name === "ns") {
3658 return this.namespace ? count : -1;
3659 }
3660 if (name === "attributeNS") {
3661 return count;
3662 }
3663 count += this.namespaceString.length;
3664 if (this.namespace) {
3665 count += 1;
3666 }
3667 if (name === "attribute") {
3668 return count;
3669 }
3670 count += this.stringifyProperty("attribute").length;
3671 count += attributeSpaces.after.length;
3672 var operatorSpaces = this._spacesFor("operator");
3673 count += operatorSpaces.before.length;
3674 var operator = this.stringifyProperty("operator");
3675 if (name === "operator") {
3676 return operator ? count : -1;
3677 }
3678 count += operator.length;
3679 count += operatorSpaces.after.length;
3680 var valueSpaces = this._spacesFor("value");
3681 count += valueSpaces.before.length;
3682 var value = this.stringifyProperty("value");
3683 if (name === "value") {
3684 return value ? count : -1;
3685 }
3686 count += value.length;
3687 count += valueSpaces.after.length;
3688 var insensitiveSpaces = this._spacesFor("insensitive");
3689 count += insensitiveSpaces.before.length;
3690 if (name === "insensitive") {
3691 return this.insensitive ? count : -1;
3692 }
3693 return -1;
3694 };
3695 _proto.toString = function toString() {
3696 var _this2 = this;
3697 var selector = [this.rawSpaceBefore, '['];
3698 selector.push(this._stringFor('qualifiedAttribute', 'attribute'));
3699 if (this.operator && (this.value || this.value === '')) {
3700 selector.push(this._stringFor('operator'));
3701 selector.push(this._stringFor('value'));
3702 selector.push(this._stringFor('insensitiveFlag', 'insensitive', function (attrValue, attrSpaces) {
3703 if (attrValue.length > 0 && !_this2.quoted && attrSpaces.before.length === 0 && !(_this2.spaces.value && _this2.spaces.value.after)) {
3704 attrSpaces.before = " ";
3705 }
3706 return defaultAttrConcat(attrValue, attrSpaces);
3707 }));
3708 }
3709 selector.push(']');
3710 selector.push(this.rawSpaceAfter);
3711 return selector.join('');
3712 };
3713 _createClass(Attribute, [{
3714 key: "quoted",
3715 get: function get() {
3716 var qm = this.quoteMark;
3717 return qm === "'" || qm === '"';
3718 },
3719 set: function set(value) {
3720 warnOfDeprecatedQuotedAssignment();
3721 }
[0c6b92a]3722
[d565449]3723 /**
3724 * returns a single (`'`) or double (`"`) quote character if the value is quoted.
3725 * returns `null` if the value is not quoted.
3726 * returns `undefined` if the quotation state is unknown (this can happen when
3727 * the attribute is constructed without specifying a quote mark.)
3728 */
3729 }, {
3730 key: "quoteMark",
3731 get: function get() {
3732 return this._quoteMark;
3733 }
[0c6b92a]3734
[d565449]3735 /**
3736 * Set the quote mark to be used by this attribute's value.
3737 * If the quote mark changes, the raw (escaped) value at `attr.raws.value` of the attribute
3738 * value is updated accordingly.
3739 *
3740 * @param {"'" | '"' | null} quoteMark The quote mark or `null` if the value should be unquoted.
[0c6b92a]3741 */,
[d565449]3742 set: function set(quoteMark) {
3743 if (!this._constructed) {
3744 this._quoteMark = quoteMark;
3745 return;
3746 }
3747 if (this._quoteMark !== quoteMark) {
3748 this._quoteMark = quoteMark;
3749 this._syncRawValue();
3750 }
3751 }
3752 }, {
3753 key: "qualifiedAttribute",
3754 get: function get() {
3755 return this.qualifiedName(this.raws.attribute || this.attribute);
3756 }
3757 }, {
3758 key: "insensitiveFlag",
3759 get: function get() {
3760 return this.insensitive ? 'i' : '';
3761 }
3762 }, {
3763 key: "value",
3764 get: function get() {
3765 return this._value;
3766 },
3767 set:
3768 /**
3769 * Before 3.0, the value had to be set to an escaped value including any wrapped
3770 * quote marks. In 3.0, the semantics of `Attribute.value` changed so that the value
3771 * is unescaped during parsing and any quote marks are removed.
3772 *
3773 * Because the ambiguity of this semantic change, if you set `attr.value = newValue`,
3774 * a deprecation warning is raised when the new value contains any characters that would
3775 * require escaping (including if it contains wrapped quotes).
3776 *
3777 * Instead, you should call `attr.setValue(newValue, opts)` and pass options that describe
3778 * how the new value is quoted.
3779 */
3780 function set(v) {
3781 if (this._constructed) {
3782 var _unescapeValue2 = unescapeValue(v),
[0c6b92a]3783 deprecatedUsage = _unescapeValue2.deprecatedUsage,
3784 unescaped = _unescapeValue2.unescaped,
3785 quoteMark = _unescapeValue2.quoteMark;
[d565449]3786 if (deprecatedUsage) {
3787 warnOfDeprecatedValueAssignment();
3788 }
3789 if (unescaped === this._value && quoteMark === this._quoteMark) {
3790 return;
3791 }
3792 this._value = unescaped;
3793 this._quoteMark = quoteMark;
3794 this._syncRawValue();
3795 } else {
3796 this._value = v;
3797 }
3798 }
3799 }, {
3800 key: "insensitive",
3801 get: function get() {
3802 return this._insensitive;
3803 }
[0c6b92a]3804
[d565449]3805 /**
3806 * Set the case insensitive flag.
3807 * If the case insensitive flag changes, the raw (escaped) value at `attr.raws.insensitiveFlag`
3808 * of the attribute is updated accordingly.
3809 *
3810 * @param {true | false} insensitive true if the attribute should match case-insensitively.
[0c6b92a]3811 */,
[d565449]3812 set: function set(insensitive) {
3813 if (!insensitive) {
[0c6b92a]3814 this._insensitive = false;
[d565449]3815
[0c6b92a]3816 // "i" and "I" can be used in "this.raws.insensitiveFlag" to store the original notation.
3817 // When setting `attr.insensitive = false` both should be erased to ensure correct serialization.
[d565449]3818 if (this.raws && (this.raws.insensitiveFlag === 'I' || this.raws.insensitiveFlag === 'i')) {
3819 this.raws.insensitiveFlag = undefined;
3820 }
3821 }
3822 this._insensitive = insensitive;
3823 }
3824 }, {
3825 key: "attribute",
3826 get: function get() {
3827 return this._attribute;
3828 },
3829 set: function set(name) {
3830 this._handleEscapes("attribute", name);
3831 this._attribute = name;
3832 }
3833 }]);
3834 return Attribute;
3835 }(_namespace["default"]);
3836 exports["default"] = Attribute;
3837 Attribute.NO_QUOTE = null;
3838 Attribute.SINGLE_QUOTE = "'";
3839 Attribute.DOUBLE_QUOTE = '"';
3840 var CSSESC_QUOTE_OPTIONS = (_CSSESC_QUOTE_OPTIONS = {
3841 "'": {
3842 quotes: 'single',
3843 wrap: true
3844 },
3845 '"': {
3846 quotes: 'double',
3847 wrap: true
3848 }
3849 }, _CSSESC_QUOTE_OPTIONS[null] = {
3850 isIdentifier: true
3851 }, _CSSESC_QUOTE_OPTIONS);
3852 function defaultAttrConcat(attrValue, attrSpaces) {
3853 return "" + attrSpaces.before + attrValue + attrSpaces.after;
3854 }
3855} (attribute$1));
3856
3857var universal$1 = {exports: {}};
3858
3859(function (module, exports) {
3860
3861 exports.__esModule = true;
3862 exports["default"] = void 0;
3863 var _namespace = _interopRequireDefault(namespaceExports);
3864 var _types = types;
3865 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
3866 function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
[0c6b92a]3867 function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
[d565449]3868 var Universal = /*#__PURE__*/function (_Namespace) {
3869 _inheritsLoose(Universal, _Namespace);
3870 function Universal(opts) {
3871 var _this;
3872 _this = _Namespace.call(this, opts) || this;
3873 _this.type = _types.UNIVERSAL;
3874 _this.value = '*';
3875 return _this;
3876 }
3877 return Universal;
3878 }(_namespace["default"]);
3879 exports["default"] = Universal;
3880 module.exports = exports.default;
3881} (universal$1, universal$1.exports));
3882
3883var universalExports = universal$1.exports;
3884
3885var combinator$2 = {exports: {}};
3886
3887(function (module, exports) {
3888
3889 exports.__esModule = true;
3890 exports["default"] = void 0;
3891 var _node = _interopRequireDefault(nodeExports);
3892 var _types = types;
3893 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
3894 function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
[0c6b92a]3895 function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
[d565449]3896 var Combinator = /*#__PURE__*/function (_Node) {
3897 _inheritsLoose(Combinator, _Node);
3898 function Combinator(opts) {
3899 var _this;
3900 _this = _Node.call(this, opts) || this;
3901 _this.type = _types.COMBINATOR;
3902 return _this;
3903 }
3904 return Combinator;
3905 }(_node["default"]);
3906 exports["default"] = Combinator;
3907 module.exports = exports.default;
3908} (combinator$2, combinator$2.exports));
3909
3910var combinatorExports = combinator$2.exports;
3911
3912var nesting$1 = {exports: {}};
3913
3914(function (module, exports) {
3915
3916 exports.__esModule = true;
3917 exports["default"] = void 0;
3918 var _node = _interopRequireDefault(nodeExports);
3919 var _types = types;
3920 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
3921 function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
[0c6b92a]3922 function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
[d565449]3923 var Nesting = /*#__PURE__*/function (_Node) {
3924 _inheritsLoose(Nesting, _Node);
3925 function Nesting(opts) {
3926 var _this;
3927 _this = _Node.call(this, opts) || this;
3928 _this.type = _types.NESTING;
3929 _this.value = '&';
3930 return _this;
3931 }
3932 return Nesting;
3933 }(_node["default"]);
3934 exports["default"] = Nesting;
3935 module.exports = exports.default;
3936} (nesting$1, nesting$1.exports));
3937
3938var nestingExports = nesting$1.exports;
3939
3940var sortAscending = {exports: {}};
3941
3942(function (module, exports) {
3943
3944 exports.__esModule = true;
3945 exports["default"] = sortAscending;
3946 function sortAscending(list) {
3947 return list.sort(function (a, b) {
3948 return a - b;
3949 });
3950 }
3951 module.exports = exports.default;
3952} (sortAscending, sortAscending.exports));
3953
3954var sortAscendingExports = sortAscending.exports;
3955
3956var tokenize = {};
3957
3958var tokenTypes = {};
3959
3960tokenTypes.__esModule = true;
[0c6b92a]3961tokenTypes.word = tokenTypes.tilde = tokenTypes.tab = tokenTypes.str = tokenTypes.space = tokenTypes.slash = tokenTypes.singleQuote = tokenTypes.semicolon = tokenTypes.plus = tokenTypes.pipe = tokenTypes.openSquare = tokenTypes.openParenthesis = tokenTypes.newline = tokenTypes.greaterThan = tokenTypes.feed = tokenTypes.equals = tokenTypes.doubleQuote = tokenTypes.dollar = tokenTypes.cr = tokenTypes.comment = tokenTypes.comma = tokenTypes.combinator = tokenTypes.colon = tokenTypes.closeSquare = tokenTypes.closeParenthesis = tokenTypes.caret = tokenTypes.bang = tokenTypes.backslash = tokenTypes.at = tokenTypes.asterisk = tokenTypes.ampersand = void 0;
[d565449]3962var ampersand = 38; // `&`.charCodeAt(0);
3963tokenTypes.ampersand = ampersand;
3964var asterisk = 42; // `*`.charCodeAt(0);
3965tokenTypes.asterisk = asterisk;
3966var at = 64; // `@`.charCodeAt(0);
3967tokenTypes.at = at;
3968var comma = 44; // `,`.charCodeAt(0);
3969tokenTypes.comma = comma;
3970var colon = 58; // `:`.charCodeAt(0);
3971tokenTypes.colon = colon;
3972var semicolon = 59; // `;`.charCodeAt(0);
3973tokenTypes.semicolon = semicolon;
3974var openParenthesis = 40; // `(`.charCodeAt(0);
3975tokenTypes.openParenthesis = openParenthesis;
3976var closeParenthesis = 41; // `)`.charCodeAt(0);
3977tokenTypes.closeParenthesis = closeParenthesis;
3978var openSquare = 91; // `[`.charCodeAt(0);
3979tokenTypes.openSquare = openSquare;
3980var closeSquare = 93; // `]`.charCodeAt(0);
3981tokenTypes.closeSquare = closeSquare;
3982var dollar = 36; // `$`.charCodeAt(0);
3983tokenTypes.dollar = dollar;
3984var tilde = 126; // `~`.charCodeAt(0);
3985tokenTypes.tilde = tilde;
3986var caret = 94; // `^`.charCodeAt(0);
3987tokenTypes.caret = caret;
3988var plus = 43; // `+`.charCodeAt(0);
3989tokenTypes.plus = plus;
3990var equals = 61; // `=`.charCodeAt(0);
3991tokenTypes.equals = equals;
3992var pipe = 124; // `|`.charCodeAt(0);
3993tokenTypes.pipe = pipe;
3994var greaterThan = 62; // `>`.charCodeAt(0);
3995tokenTypes.greaterThan = greaterThan;
3996var space = 32; // ` `.charCodeAt(0);
3997tokenTypes.space = space;
3998var singleQuote = 39; // `'`.charCodeAt(0);
3999tokenTypes.singleQuote = singleQuote;
4000var doubleQuote = 34; // `"`.charCodeAt(0);
4001tokenTypes.doubleQuote = doubleQuote;
4002var slash = 47; // `/`.charCodeAt(0);
4003tokenTypes.slash = slash;
4004var bang = 33; // `!`.charCodeAt(0);
4005tokenTypes.bang = bang;
4006var backslash = 92; // '\\'.charCodeAt(0);
4007tokenTypes.backslash = backslash;
4008var cr = 13; // '\r'.charCodeAt(0);
4009tokenTypes.cr = cr;
4010var feed = 12; // '\f'.charCodeAt(0);
4011tokenTypes.feed = feed;
4012var newline = 10; // '\n'.charCodeAt(0);
4013tokenTypes.newline = newline;
4014var tab = 9; // '\t'.charCodeAt(0);
4015
[0c6b92a]4016// Expose aliases primarily for readability.
[d565449]4017tokenTypes.tab = tab;
[0c6b92a]4018var str = singleQuote;
[d565449]4019
[0c6b92a]4020// No good single character representation!
[d565449]4021tokenTypes.str = str;
4022var comment$1 = -1;
4023tokenTypes.comment = comment$1;
4024var word = -2;
4025tokenTypes.word = word;
4026var combinator$1 = -3;
4027tokenTypes.combinator = combinator$1;
4028
4029(function (exports) {
4030
4031 exports.__esModule = true;
4032 exports.FIELDS = void 0;
[0c6b92a]4033 exports["default"] = tokenize;
[d565449]4034 var t = _interopRequireWildcard(tokenTypes);
4035 var _unescapable, _wordDelimiters;
[0c6b92a]4036 function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
4037 function _interopRequireWildcard(obj, nodeInterop) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
[d565449]4038 var unescapable = (_unescapable = {}, _unescapable[t.tab] = true, _unescapable[t.newline] = true, _unescapable[t.cr] = true, _unescapable[t.feed] = true, _unescapable);
4039 var wordDelimiters = (_wordDelimiters = {}, _wordDelimiters[t.space] = true, _wordDelimiters[t.tab] = true, _wordDelimiters[t.newline] = true, _wordDelimiters[t.cr] = true, _wordDelimiters[t.feed] = true, _wordDelimiters[t.ampersand] = true, _wordDelimiters[t.asterisk] = true, _wordDelimiters[t.bang] = true, _wordDelimiters[t.comma] = true, _wordDelimiters[t.colon] = true, _wordDelimiters[t.semicolon] = true, _wordDelimiters[t.openParenthesis] = true, _wordDelimiters[t.closeParenthesis] = true, _wordDelimiters[t.openSquare] = true, _wordDelimiters[t.closeSquare] = true, _wordDelimiters[t.singleQuote] = true, _wordDelimiters[t.doubleQuote] = true, _wordDelimiters[t.plus] = true, _wordDelimiters[t.pipe] = true, _wordDelimiters[t.tilde] = true, _wordDelimiters[t.greaterThan] = true, _wordDelimiters[t.equals] = true, _wordDelimiters[t.dollar] = true, _wordDelimiters[t.caret] = true, _wordDelimiters[t.slash] = true, _wordDelimiters);
4040 var hex = {};
4041 var hexChars = "0123456789abcdefABCDEF";
4042 for (var i = 0; i < hexChars.length; i++) {
4043 hex[hexChars.charCodeAt(i)] = true;
4044 }
[0c6b92a]4045
[d565449]4046 /**
4047 * Returns the last index of the bar css word
4048 * @param {string} css The string in which the word begins
4049 * @param {number} start The index into the string where word's first letter occurs
4050 */
4051 function consumeWord(css, start) {
4052 var next = start;
4053 var code;
4054 do {
4055 code = css.charCodeAt(next);
4056 if (wordDelimiters[code]) {
4057 return next - 1;
4058 } else if (code === t.backslash) {
4059 next = consumeEscape(css, next) + 1;
4060 } else {
4061 // All other characters are part of the word
4062 next++;
4063 }
4064 } while (next < css.length);
4065 return next - 1;
4066 }
[0c6b92a]4067
[d565449]4068 /**
4069 * Returns the last index of the escape sequence
4070 * @param {string} css The string in which the sequence begins
4071 * @param {number} start The index into the string where escape character (`\`) occurs.
4072 */
4073 function consumeEscape(css, start) {
4074 var next = start;
4075 var code = css.charCodeAt(next + 1);
4076 if (unescapable[code]) ; else if (hex[code]) {
[0c6b92a]4077 var hexDigits = 0;
4078 // consume up to 6 hex chars
[d565449]4079 do {
4080 next++;
4081 hexDigits++;
4082 code = css.charCodeAt(next + 1);
[0c6b92a]4083 } while (hex[code] && hexDigits < 6);
4084 // if fewer than 6 hex chars, a trailing space ends the escape
[d565449]4085 if (hexDigits < 6 && code === t.space) {
4086 next++;
4087 }
4088 } else {
4089 // the next char is part of the current word
4090 next++;
4091 }
4092 return next;
4093 }
4094 var FIELDS = {
4095 TYPE: 0,
4096 START_LINE: 1,
4097 START_COL: 2,
4098 END_LINE: 3,
4099 END_COL: 4,
4100 START_POS: 5,
4101 END_POS: 6
4102 };
4103 exports.FIELDS = FIELDS;
4104 function tokenize(input) {
4105 var tokens = [];
4106 var css = input.css.valueOf();
4107 var _css = css,
[0c6b92a]4108 length = _css.length;
[d565449]4109 var offset = -1;
4110 var line = 1;
4111 var start = 0;
4112 var end = 0;
4113 var code, content, endColumn, endLine, escaped, escapePos, last, lines, next, nextLine, nextOffset, quote, tokenType;
4114 function unclosed(what, fix) {
4115 if (input.safe) {
4116 // fyi: this is never set to true.
4117 css += fix;
4118 next = css.length - 1;
4119 } else {
4120 throw input.error('Unclosed ' + what, line, start - offset, start);
4121 }
4122 }
4123 while (start < length) {
4124 code = css.charCodeAt(start);
4125 if (code === t.newline) {
4126 offset = start;
4127 line += 1;
4128 }
4129 switch (code) {
4130 case t.space:
4131 case t.tab:
4132 case t.newline:
4133 case t.cr:
4134 case t.feed:
4135 next = start;
4136 do {
4137 next += 1;
4138 code = css.charCodeAt(next);
4139 if (code === t.newline) {
4140 offset = next;
4141 line += 1;
4142 }
4143 } while (code === t.space || code === t.newline || code === t.tab || code === t.cr || code === t.feed);
4144 tokenType = t.space;
4145 endLine = line;
4146 endColumn = next - offset - 1;
4147 end = next;
4148 break;
4149 case t.plus:
4150 case t.greaterThan:
4151 case t.tilde:
4152 case t.pipe:
4153 next = start;
4154 do {
4155 next += 1;
4156 code = css.charCodeAt(next);
4157 } while (code === t.plus || code === t.greaterThan || code === t.tilde || code === t.pipe);
4158 tokenType = t.combinator;
4159 endLine = line;
4160 endColumn = start - offset;
4161 end = next;
4162 break;
4163
[0c6b92a]4164 // Consume these characters as single tokens.
[d565449]4165 case t.asterisk:
4166 case t.ampersand:
4167 case t.bang:
4168 case t.comma:
4169 case t.equals:
4170 case t.dollar:
4171 case t.caret:
4172 case t.openSquare:
4173 case t.closeSquare:
4174 case t.colon:
4175 case t.semicolon:
4176 case t.openParenthesis:
4177 case t.closeParenthesis:
4178 next = start;
4179 tokenType = code;
4180 endLine = line;
4181 endColumn = start - offset;
4182 end = next + 1;
4183 break;
4184 case t.singleQuote:
4185 case t.doubleQuote:
4186 quote = code === t.singleQuote ? "'" : '"';
4187 next = start;
4188 do {
4189 escaped = false;
4190 next = css.indexOf(quote, next + 1);
4191 if (next === -1) {
4192 unclosed('quote', quote);
4193 }
4194 escapePos = next;
4195 while (css.charCodeAt(escapePos - 1) === t.backslash) {
4196 escapePos -= 1;
4197 escaped = !escaped;
4198 }
4199 } while (escaped);
4200 tokenType = t.str;
4201 endLine = line;
4202 endColumn = start - offset;
4203 end = next + 1;
4204 break;
4205 default:
4206 if (code === t.slash && css.charCodeAt(start + 1) === t.asterisk) {
4207 next = css.indexOf('*/', start + 2) + 1;
4208 if (next === 0) {
4209 unclosed('comment', '*/');
4210 }
4211 content = css.slice(start, next + 1);
4212 lines = content.split('\n');
4213 last = lines.length - 1;
4214 if (last > 0) {
4215 nextLine = line + last;
4216 nextOffset = next - lines[last].length;
4217 } else {
4218 nextLine = line;
4219 nextOffset = offset;
4220 }
4221 tokenType = t.comment;
4222 line = nextLine;
4223 endLine = nextLine;
4224 endColumn = next - nextOffset;
4225 } else if (code === t.slash) {
4226 next = start;
4227 tokenType = code;
4228 endLine = line;
4229 endColumn = start - offset;
4230 end = next + 1;
4231 } else {
4232 next = consumeWord(css, start);
4233 tokenType = t.word;
4234 endLine = line;
4235 endColumn = next - offset;
4236 }
4237 end = next + 1;
4238 break;
[0c6b92a]4239 }
[d565449]4240
[0c6b92a]4241 // Ensure that the token structure remains consistent
4242 tokens.push([tokenType,
4243 // [0] Token type
4244 line,
4245 // [1] Starting line
4246 start - offset,
4247 // [2] Starting column
4248 endLine,
4249 // [3] Ending line
4250 endColumn,
4251 // [4] Ending column
4252 start,
4253 // [5] Start position / Source index
[d565449]4254 end // [6] End position
[0c6b92a]4255 ]);
[d565449]4256
[0c6b92a]4257 // Reset offset for the next token
[d565449]4258 if (nextOffset) {
4259 offset = nextOffset;
4260 nextOffset = null;
4261 }
4262 start = end;
4263 }
4264 return tokens;
4265 }
4266} (tokenize));
4267
4268(function (module, exports) {
4269
4270 exports.__esModule = true;
4271 exports["default"] = void 0;
4272 var _root = _interopRequireDefault(rootExports);
4273 var _selector = _interopRequireDefault(selectorExports);
4274 var _className = _interopRequireDefault(classNameExports);
4275 var _comment = _interopRequireDefault(commentExports);
4276 var _id = _interopRequireDefault(idExports);
4277 var _tag = _interopRequireDefault(tagExports);
4278 var _string = _interopRequireDefault(stringExports);
4279 var _pseudo = _interopRequireDefault(pseudoExports);
4280 var _attribute = _interopRequireWildcard(attribute$1);
4281 var _universal = _interopRequireDefault(universalExports);
4282 var _combinator = _interopRequireDefault(combinatorExports);
4283 var _nesting = _interopRequireDefault(nestingExports);
4284 var _sortAscending = _interopRequireDefault(sortAscendingExports);
4285 var _tokenize = _interopRequireWildcard(tokenize);
4286 var tokens = _interopRequireWildcard(tokenTypes);
4287 var types$1 = _interopRequireWildcard(types);
4288 var _util = util;
4289 var _WHITESPACE_TOKENS, _Object$assign;
[0c6b92a]4290 function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
4291 function _interopRequireWildcard(obj, nodeInterop) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
[d565449]4292 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
4293 function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
[0c6b92a]4294 function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
[d565449]4295 var WHITESPACE_TOKENS = (_WHITESPACE_TOKENS = {}, _WHITESPACE_TOKENS[tokens.space] = true, _WHITESPACE_TOKENS[tokens.cr] = true, _WHITESPACE_TOKENS[tokens.feed] = true, _WHITESPACE_TOKENS[tokens.newline] = true, _WHITESPACE_TOKENS[tokens.tab] = true, _WHITESPACE_TOKENS);
4296 var WHITESPACE_EQUIV_TOKENS = Object.assign({}, WHITESPACE_TOKENS, (_Object$assign = {}, _Object$assign[tokens.comment] = true, _Object$assign));
4297 function tokenStart(token) {
4298 return {
4299 line: token[_tokenize.FIELDS.START_LINE],
4300 column: token[_tokenize.FIELDS.START_COL]
4301 };
4302 }
4303 function tokenEnd(token) {
4304 return {
4305 line: token[_tokenize.FIELDS.END_LINE],
4306 column: token[_tokenize.FIELDS.END_COL]
4307 };
4308 }
4309 function getSource(startLine, startColumn, endLine, endColumn) {
4310 return {
4311 start: {
4312 line: startLine,
4313 column: startColumn
4314 },
4315 end: {
4316 line: endLine,
4317 column: endColumn
4318 }
4319 };
4320 }
4321 function getTokenSource(token) {
4322 return getSource(token[_tokenize.FIELDS.START_LINE], token[_tokenize.FIELDS.START_COL], token[_tokenize.FIELDS.END_LINE], token[_tokenize.FIELDS.END_COL]);
4323 }
4324 function getTokenSourceSpan(startToken, endToken) {
4325 if (!startToken) {
4326 return undefined;
4327 }
4328 return getSource(startToken[_tokenize.FIELDS.START_LINE], startToken[_tokenize.FIELDS.START_COL], endToken[_tokenize.FIELDS.END_LINE], endToken[_tokenize.FIELDS.END_COL]);
4329 }
4330 function unescapeProp(node, prop) {
4331 var value = node[prop];
4332 if (typeof value !== "string") {
4333 return;
4334 }
4335 if (value.indexOf("\\") !== -1) {
4336 (0, _util.ensureObject)(node, 'raws');
4337 node[prop] = (0, _util.unesc)(value);
4338 if (node.raws[prop] === undefined) {
4339 node.raws[prop] = value;
4340 }
4341 }
4342 return node;
4343 }
4344 function indexesOf(array, item) {
4345 var i = -1;
4346 var indexes = [];
4347 while ((i = array.indexOf(item, i + 1)) !== -1) {
4348 indexes.push(i);
4349 }
4350 return indexes;
4351 }
4352 function uniqs() {
4353 var list = Array.prototype.concat.apply([], arguments);
4354 return list.filter(function (item, i) {
4355 return i === list.indexOf(item);
4356 });
4357 }
4358 var Parser = /*#__PURE__*/function () {
4359 function Parser(rule, options) {
4360 if (options === void 0) {
4361 options = {};
4362 }
4363 this.rule = rule;
4364 this.options = Object.assign({
4365 lossy: false,
4366 safe: false
4367 }, options);
4368 this.position = 0;
4369 this.css = typeof this.rule === 'string' ? this.rule : this.rule.selector;
4370 this.tokens = (0, _tokenize["default"])({
4371 css: this.css,
4372 error: this._errorGenerator(),
4373 safe: this.options.safe
4374 });
4375 var rootSource = getTokenSourceSpan(this.tokens[0], this.tokens[this.tokens.length - 1]);
4376 this.root = new _root["default"]({
4377 source: rootSource
4378 });
4379 this.root.errorGenerator = this._errorGenerator();
4380 var selector = new _selector["default"]({
4381 source: {
4382 start: {
4383 line: 1,
4384 column: 1
4385 }
[0c6b92a]4386 },
4387 sourceIndex: 0
[d565449]4388 });
4389 this.root.append(selector);
4390 this.current = selector;
4391 this.loop();
4392 }
4393 var _proto = Parser.prototype;
4394 _proto._errorGenerator = function _errorGenerator() {
4395 var _this = this;
4396 return function (message, errorOptions) {
4397 if (typeof _this.rule === 'string') {
4398 return new Error(message);
4399 }
4400 return _this.rule.error(message, errorOptions);
4401 };
4402 };
4403 _proto.attribute = function attribute() {
4404 var attr = [];
4405 var startingToken = this.currToken;
4406 this.position++;
4407 while (this.position < this.tokens.length && this.currToken[_tokenize.FIELDS.TYPE] !== tokens.closeSquare) {
4408 attr.push(this.currToken);
4409 this.position++;
4410 }
4411 if (this.currToken[_tokenize.FIELDS.TYPE] !== tokens.closeSquare) {
4412 return this.expected('closing square bracket', this.currToken[_tokenize.FIELDS.START_POS]);
4413 }
4414 var len = attr.length;
4415 var node = {
4416 source: getSource(startingToken[1], startingToken[2], this.currToken[3], this.currToken[4]),
4417 sourceIndex: startingToken[_tokenize.FIELDS.START_POS]
4418 };
4419 if (len === 1 && !~[tokens.word].indexOf(attr[0][_tokenize.FIELDS.TYPE])) {
4420 return this.expected('attribute', attr[0][_tokenize.FIELDS.START_POS]);
4421 }
4422 var pos = 0;
4423 var spaceBefore = '';
4424 var commentBefore = '';
4425 var lastAdded = null;
4426 var spaceAfterMeaningfulToken = false;
4427 while (pos < len) {
4428 var token = attr[pos];
4429 var content = this.content(token);
4430 var next = attr[pos + 1];
4431 switch (token[_tokenize.FIELDS.TYPE]) {
4432 case tokens.space:
4433 // if (
4434 // len === 1 ||
4435 // pos === 0 && this.content(next) === '|'
4436 // ) {
4437 // return this.expected('attribute', token[TOKEN.START_POS], content);
4438 // }
4439 spaceAfterMeaningfulToken = true;
4440 if (this.options.lossy) {
4441 break;
4442 }
4443 if (lastAdded) {
4444 (0, _util.ensureObject)(node, 'spaces', lastAdded);
4445 var prevContent = node.spaces[lastAdded].after || '';
4446 node.spaces[lastAdded].after = prevContent + content;
4447 var existingComment = (0, _util.getProp)(node, 'raws', 'spaces', lastAdded, 'after') || null;
4448 if (existingComment) {
4449 node.raws.spaces[lastAdded].after = existingComment + content;
4450 }
4451 } else {
4452 spaceBefore = spaceBefore + content;
4453 commentBefore = commentBefore + content;
4454 }
4455 break;
4456 case tokens.asterisk:
4457 if (next[_tokenize.FIELDS.TYPE] === tokens.equals) {
4458 node.operator = content;
4459 lastAdded = 'operator';
4460 } else if ((!node.namespace || lastAdded === "namespace" && !spaceAfterMeaningfulToken) && next) {
4461 if (spaceBefore) {
4462 (0, _util.ensureObject)(node, 'spaces', 'attribute');
4463 node.spaces.attribute.before = spaceBefore;
4464 spaceBefore = '';
4465 }
4466 if (commentBefore) {
4467 (0, _util.ensureObject)(node, 'raws', 'spaces', 'attribute');
4468 node.raws.spaces.attribute.before = spaceBefore;
4469 commentBefore = '';
4470 }
4471 node.namespace = (node.namespace || "") + content;
4472 var rawValue = (0, _util.getProp)(node, 'raws', 'namespace') || null;
4473 if (rawValue) {
4474 node.raws.namespace += content;
4475 }
4476 lastAdded = 'namespace';
4477 }
4478 spaceAfterMeaningfulToken = false;
4479 break;
4480 case tokens.dollar:
4481 if (lastAdded === "value") {
4482 var oldRawValue = (0, _util.getProp)(node, 'raws', 'value');
4483 node.value += "$";
4484 if (oldRawValue) {
4485 node.raws.value = oldRawValue + "$";
4486 }
4487 break;
4488 }
4489 // Falls through
4490 case tokens.caret:
4491 if (next[_tokenize.FIELDS.TYPE] === tokens.equals) {
4492 node.operator = content;
4493 lastAdded = 'operator';
4494 }
4495 spaceAfterMeaningfulToken = false;
4496 break;
4497 case tokens.combinator:
4498 if (content === '~' && next[_tokenize.FIELDS.TYPE] === tokens.equals) {
4499 node.operator = content;
4500 lastAdded = 'operator';
4501 }
4502 if (content !== '|') {
4503 spaceAfterMeaningfulToken = false;
4504 break;
4505 }
4506 if (next[_tokenize.FIELDS.TYPE] === tokens.equals) {
4507 node.operator = content;
4508 lastAdded = 'operator';
4509 } else if (!node.namespace && !node.attribute) {
4510 node.namespace = true;
4511 }
4512 spaceAfterMeaningfulToken = false;
4513 break;
4514 case tokens.word:
[0c6b92a]4515 if (next && this.content(next) === '|' && attr[pos + 2] && attr[pos + 2][_tokenize.FIELDS.TYPE] !== tokens.equals &&
4516 // this look-ahead probably fails with comment nodes involved.
[d565449]4517 !node.operator && !node.namespace) {
4518 node.namespace = content;
4519 lastAdded = 'namespace';
4520 } else if (!node.attribute || lastAdded === "attribute" && !spaceAfterMeaningfulToken) {
4521 if (spaceBefore) {
4522 (0, _util.ensureObject)(node, 'spaces', 'attribute');
4523 node.spaces.attribute.before = spaceBefore;
4524 spaceBefore = '';
4525 }
4526 if (commentBefore) {
4527 (0, _util.ensureObject)(node, 'raws', 'spaces', 'attribute');
4528 node.raws.spaces.attribute.before = commentBefore;
4529 commentBefore = '';
4530 }
4531 node.attribute = (node.attribute || "") + content;
4532 var _rawValue = (0, _util.getProp)(node, 'raws', 'attribute') || null;
4533 if (_rawValue) {
4534 node.raws.attribute += content;
4535 }
4536 lastAdded = 'attribute';
4537 } else if (!node.value && node.value !== "" || lastAdded === "value" && !(spaceAfterMeaningfulToken || node.quoteMark)) {
4538 var _unescaped = (0, _util.unesc)(content);
4539 var _oldRawValue = (0, _util.getProp)(node, 'raws', 'value') || '';
4540 var oldValue = node.value || '';
4541 node.value = oldValue + _unescaped;
4542 node.quoteMark = null;
4543 if (_unescaped !== content || _oldRawValue) {
4544 (0, _util.ensureObject)(node, 'raws');
4545 node.raws.value = (_oldRawValue || oldValue) + content;
4546 }
4547 lastAdded = 'value';
4548 } else {
4549 var insensitive = content === 'i' || content === "I";
4550 if ((node.value || node.value === '') && (node.quoteMark || spaceAfterMeaningfulToken)) {
4551 node.insensitive = insensitive;
4552 if (!insensitive || content === "I") {
4553 (0, _util.ensureObject)(node, 'raws');
4554 node.raws.insensitiveFlag = content;
4555 }
4556 lastAdded = 'insensitive';
4557 if (spaceBefore) {
4558 (0, _util.ensureObject)(node, 'spaces', 'insensitive');
4559 node.spaces.insensitive.before = spaceBefore;
4560 spaceBefore = '';
4561 }
4562 if (commentBefore) {
4563 (0, _util.ensureObject)(node, 'raws', 'spaces', 'insensitive');
4564 node.raws.spaces.insensitive.before = commentBefore;
4565 commentBefore = '';
4566 }
4567 } else if (node.value || node.value === '') {
4568 lastAdded = 'value';
4569 node.value += content;
4570 if (node.raws.value) {
4571 node.raws.value += content;
4572 }
4573 }
4574 }
4575 spaceAfterMeaningfulToken = false;
4576 break;
4577 case tokens.str:
4578 if (!node.attribute || !node.operator) {
4579 return this.error("Expected an attribute followed by an operator preceding the string.", {
4580 index: token[_tokenize.FIELDS.START_POS]
4581 });
4582 }
4583 var _unescapeValue = (0, _attribute.unescapeValue)(content),
[0c6b92a]4584 unescaped = _unescapeValue.unescaped,
4585 quoteMark = _unescapeValue.quoteMark;
[d565449]4586 node.value = unescaped;
4587 node.quoteMark = quoteMark;
4588 lastAdded = 'value';
4589 (0, _util.ensureObject)(node, 'raws');
4590 node.raws.value = content;
4591 spaceAfterMeaningfulToken = false;
4592 break;
4593 case tokens.equals:
4594 if (!node.attribute) {
4595 return this.expected('attribute', token[_tokenize.FIELDS.START_POS], content);
4596 }
4597 if (node.value) {
4598 return this.error('Unexpected "=" found; an operator was already defined.', {
4599 index: token[_tokenize.FIELDS.START_POS]
4600 });
4601 }
4602 node.operator = node.operator ? node.operator + content : content;
4603 lastAdded = 'operator';
4604 spaceAfterMeaningfulToken = false;
4605 break;
4606 case tokens.comment:
4607 if (lastAdded) {
4608 if (spaceAfterMeaningfulToken || next && next[_tokenize.FIELDS.TYPE] === tokens.space || lastAdded === 'insensitive') {
4609 var lastComment = (0, _util.getProp)(node, 'spaces', lastAdded, 'after') || '';
4610 var rawLastComment = (0, _util.getProp)(node, 'raws', 'spaces', lastAdded, 'after') || lastComment;
4611 (0, _util.ensureObject)(node, 'raws', 'spaces', lastAdded);
4612 node.raws.spaces[lastAdded].after = rawLastComment + content;
4613 } else {
4614 var lastValue = node[lastAdded] || '';
4615 var rawLastValue = (0, _util.getProp)(node, 'raws', lastAdded) || lastValue;
4616 (0, _util.ensureObject)(node, 'raws');
4617 node.raws[lastAdded] = rawLastValue + content;
4618 }
4619 } else {
4620 commentBefore = commentBefore + content;
4621 }
4622 break;
4623 default:
4624 return this.error("Unexpected \"" + content + "\" found.", {
4625 index: token[_tokenize.FIELDS.START_POS]
4626 });
4627 }
4628 pos++;
4629 }
4630 unescapeProp(node, "attribute");
4631 unescapeProp(node, "namespace");
4632 this.newNode(new _attribute["default"](node));
4633 this.position++;
4634 }
[0c6b92a]4635
[d565449]4636 /**
4637 * return a node containing meaningless garbage up to (but not including) the specified token position.
4638 * if the token position is negative, all remaining tokens are consumed.
4639 *
4640 * This returns an array containing a single string node if all whitespace,
4641 * otherwise an array of comment nodes with space before and after.
4642 *
4643 * These tokens are not added to the current selector, the caller can add them or use them to amend
4644 * a previous node's space metadata.
4645 *
4646 * In lossy mode, this returns only comments.
[0c6b92a]4647 */;
[d565449]4648 _proto.parseWhitespaceEquivalentTokens = function parseWhitespaceEquivalentTokens(stopPosition) {
4649 if (stopPosition < 0) {
4650 stopPosition = this.tokens.length;
4651 }
4652 var startPosition = this.position;
4653 var nodes = [];
4654 var space = "";
4655 var lastComment = undefined;
4656 do {
4657 if (WHITESPACE_TOKENS[this.currToken[_tokenize.FIELDS.TYPE]]) {
4658 if (!this.options.lossy) {
4659 space += this.content();
4660 }
4661 } else if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.comment) {
4662 var spaces = {};
4663 if (space) {
4664 spaces.before = space;
4665 space = "";
4666 }
4667 lastComment = new _comment["default"]({
4668 value: this.content(),
4669 source: getTokenSource(this.currToken),
4670 sourceIndex: this.currToken[_tokenize.FIELDS.START_POS],
4671 spaces: spaces
4672 });
4673 nodes.push(lastComment);
4674 }
4675 } while (++this.position < stopPosition);
4676 if (space) {
4677 if (lastComment) {
4678 lastComment.spaces.after = space;
4679 } else if (!this.options.lossy) {
4680 var firstToken = this.tokens[startPosition];
4681 var lastToken = this.tokens[this.position - 1];
4682 nodes.push(new _string["default"]({
4683 value: '',
4684 source: getSource(firstToken[_tokenize.FIELDS.START_LINE], firstToken[_tokenize.FIELDS.START_COL], lastToken[_tokenize.FIELDS.END_LINE], lastToken[_tokenize.FIELDS.END_COL]),
4685 sourceIndex: firstToken[_tokenize.FIELDS.START_POS],
4686 spaces: {
4687 before: space,
4688 after: ''
4689 }
4690 }));
4691 }
4692 }
4693 return nodes;
4694 }
[0c6b92a]4695
[d565449]4696 /**
4697 *
4698 * @param {*} nodes
[0c6b92a]4699 */;
[d565449]4700 _proto.convertWhitespaceNodesToSpace = function convertWhitespaceNodesToSpace(nodes, requiredSpace) {
4701 var _this2 = this;
4702 if (requiredSpace === void 0) {
4703 requiredSpace = false;
4704 }
4705 var space = "";
4706 var rawSpace = "";
4707 nodes.forEach(function (n) {
4708 var spaceBefore = _this2.lossySpace(n.spaces.before, requiredSpace);
4709 var rawSpaceBefore = _this2.lossySpace(n.rawSpaceBefore, requiredSpace);
4710 space += spaceBefore + _this2.lossySpace(n.spaces.after, requiredSpace && spaceBefore.length === 0);
4711 rawSpace += spaceBefore + n.value + _this2.lossySpace(n.rawSpaceAfter, requiredSpace && rawSpaceBefore.length === 0);
4712 });
4713 if (rawSpace === space) {
4714 rawSpace = undefined;
4715 }
4716 var result = {
4717 space: space,
4718 rawSpace: rawSpace
4719 };
4720 return result;
4721 };
4722 _proto.isNamedCombinator = function isNamedCombinator(position) {
4723 if (position === void 0) {
4724 position = this.position;
4725 }
4726 return this.tokens[position + 0] && this.tokens[position + 0][_tokenize.FIELDS.TYPE] === tokens.slash && this.tokens[position + 1] && this.tokens[position + 1][_tokenize.FIELDS.TYPE] === tokens.word && this.tokens[position + 2] && this.tokens[position + 2][_tokenize.FIELDS.TYPE] === tokens.slash;
4727 };
4728 _proto.namedCombinator = function namedCombinator() {
4729 if (this.isNamedCombinator()) {
4730 var nameRaw = this.content(this.tokens[this.position + 1]);
4731 var name = (0, _util.unesc)(nameRaw).toLowerCase();
4732 var raws = {};
4733 if (name !== nameRaw) {
4734 raws.value = "/" + nameRaw + "/";
4735 }
4736 var node = new _combinator["default"]({
4737 value: "/" + name + "/",
4738 source: getSource(this.currToken[_tokenize.FIELDS.START_LINE], this.currToken[_tokenize.FIELDS.START_COL], this.tokens[this.position + 2][_tokenize.FIELDS.END_LINE], this.tokens[this.position + 2][_tokenize.FIELDS.END_COL]),
4739 sourceIndex: this.currToken[_tokenize.FIELDS.START_POS],
4740 raws: raws
4741 });
4742 this.position = this.position + 3;
4743 return node;
4744 } else {
4745 this.unexpected();
4746 }
4747 };
4748 _proto.combinator = function combinator() {
4749 var _this3 = this;
4750 if (this.content() === '|') {
4751 return this.namespace();
[0c6b92a]4752 }
4753 // We need to decide between a space that's a descendant combinator and meaningless whitespace at the end of a selector.
[d565449]4754 var nextSigTokenPos = this.locateNextMeaningfulToken(this.position);
4755 if (nextSigTokenPos < 0 || this.tokens[nextSigTokenPos][_tokenize.FIELDS.TYPE] === tokens.comma) {
4756 var nodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos);
4757 if (nodes.length > 0) {
4758 var last = this.current.last;
4759 if (last) {
4760 var _this$convertWhitespa = this.convertWhitespaceNodesToSpace(nodes),
[0c6b92a]4761 space = _this$convertWhitespa.space,
4762 rawSpace = _this$convertWhitespa.rawSpace;
[d565449]4763 if (rawSpace !== undefined) {
4764 last.rawSpaceAfter += rawSpace;
4765 }
4766 last.spaces.after += space;
4767 } else {
4768 nodes.forEach(function (n) {
4769 return _this3.newNode(n);
4770 });
4771 }
4772 }
4773 return;
4774 }
4775 var firstToken = this.currToken;
4776 var spaceOrDescendantSelectorNodes = undefined;
4777 if (nextSigTokenPos > this.position) {
4778 spaceOrDescendantSelectorNodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos);
4779 }
4780 var node;
4781 if (this.isNamedCombinator()) {
4782 node = this.namedCombinator();
4783 } else if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.combinator) {
4784 node = new _combinator["default"]({
4785 value: this.content(),
4786 source: getTokenSource(this.currToken),
4787 sourceIndex: this.currToken[_tokenize.FIELDS.START_POS]
4788 });
4789 this.position++;
4790 } else if (WHITESPACE_TOKENS[this.currToken[_tokenize.FIELDS.TYPE]]) ; else if (!spaceOrDescendantSelectorNodes) {
4791 this.unexpected();
4792 }
4793 if (node) {
4794 if (spaceOrDescendantSelectorNodes) {
4795 var _this$convertWhitespa2 = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes),
[0c6b92a]4796 _space = _this$convertWhitespa2.space,
4797 _rawSpace = _this$convertWhitespa2.rawSpace;
[d565449]4798 node.spaces.before = _space;
4799 node.rawSpaceBefore = _rawSpace;
4800 }
4801 } else {
4802 // descendant combinator
4803 var _this$convertWhitespa3 = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes, true),
[0c6b92a]4804 _space2 = _this$convertWhitespa3.space,
4805 _rawSpace2 = _this$convertWhitespa3.rawSpace;
[d565449]4806 if (!_rawSpace2) {
4807 _rawSpace2 = _space2;
4808 }
4809 var spaces = {};
4810 var raws = {
4811 spaces: {}
4812 };
4813 if (_space2.endsWith(' ') && _rawSpace2.endsWith(' ')) {
4814 spaces.before = _space2.slice(0, _space2.length - 1);
4815 raws.spaces.before = _rawSpace2.slice(0, _rawSpace2.length - 1);
4816 } else if (_space2.startsWith(' ') && _rawSpace2.startsWith(' ')) {
4817 spaces.after = _space2.slice(1);
4818 raws.spaces.after = _rawSpace2.slice(1);
4819 } else {
4820 raws.value = _rawSpace2;
4821 }
4822 node = new _combinator["default"]({
4823 value: ' ',
4824 source: getTokenSourceSpan(firstToken, this.tokens[this.position - 1]),
4825 sourceIndex: firstToken[_tokenize.FIELDS.START_POS],
4826 spaces: spaces,
4827 raws: raws
4828 });
4829 }
4830 if (this.currToken && this.currToken[_tokenize.FIELDS.TYPE] === tokens.space) {
4831 node.spaces.after = this.optionalSpace(this.content());
4832 this.position++;
4833 }
4834 return this.newNode(node);
4835 };
4836 _proto.comma = function comma() {
4837 if (this.position === this.tokens.length - 1) {
4838 this.root.trailingComma = true;
4839 this.position++;
4840 return;
4841 }
4842 this.current._inferEndPosition();
4843 var selector = new _selector["default"]({
4844 source: {
4845 start: tokenStart(this.tokens[this.position + 1])
[0c6b92a]4846 },
4847 sourceIndex: this.tokens[this.position + 1][_tokenize.FIELDS.START_POS]
[d565449]4848 });
4849 this.current.parent.append(selector);
4850 this.current = selector;
4851 this.position++;
4852 };
4853 _proto.comment = function comment() {
4854 var current = this.currToken;
4855 this.newNode(new _comment["default"]({
4856 value: this.content(),
4857 source: getTokenSource(current),
4858 sourceIndex: current[_tokenize.FIELDS.START_POS]
4859 }));
4860 this.position++;
4861 };
4862 _proto.error = function error(message, opts) {
4863 throw this.root.error(message, opts);
4864 };
4865 _proto.missingBackslash = function missingBackslash() {
4866 return this.error('Expected a backslash preceding the semicolon.', {
4867 index: this.currToken[_tokenize.FIELDS.START_POS]
4868 });
4869 };
4870 _proto.missingParenthesis = function missingParenthesis() {
4871 return this.expected('opening parenthesis', this.currToken[_tokenize.FIELDS.START_POS]);
4872 };
4873 _proto.missingSquareBracket = function missingSquareBracket() {
4874 return this.expected('opening square bracket', this.currToken[_tokenize.FIELDS.START_POS]);
4875 };
4876 _proto.unexpected = function unexpected() {
4877 return this.error("Unexpected '" + this.content() + "'. Escaping special characters with \\ may help.", this.currToken[_tokenize.FIELDS.START_POS]);
4878 };
[0c6b92a]4879 _proto.unexpectedPipe = function unexpectedPipe() {
4880 return this.error("Unexpected '|'.", this.currToken[_tokenize.FIELDS.START_POS]);
4881 };
[d565449]4882 _proto.namespace = function namespace() {
4883 var before = this.prevToken && this.content(this.prevToken) || true;
4884 if (this.nextToken[_tokenize.FIELDS.TYPE] === tokens.word) {
4885 this.position++;
4886 return this.word(before);
4887 } else if (this.nextToken[_tokenize.FIELDS.TYPE] === tokens.asterisk) {
4888 this.position++;
4889 return this.universal(before);
4890 }
[0c6b92a]4891 this.unexpectedPipe();
[d565449]4892 };
4893 _proto.nesting = function nesting() {
4894 if (this.nextToken) {
4895 var nextContent = this.content(this.nextToken);
4896 if (nextContent === "|") {
4897 this.position++;
4898 return;
4899 }
4900 }
4901 var current = this.currToken;
4902 this.newNode(new _nesting["default"]({
4903 value: this.content(),
4904 source: getTokenSource(current),
4905 sourceIndex: current[_tokenize.FIELDS.START_POS]
4906 }));
4907 this.position++;
4908 };
4909 _proto.parentheses = function parentheses() {
4910 var last = this.current.last;
4911 var unbalanced = 1;
4912 this.position++;
4913 if (last && last.type === types$1.PSEUDO) {
4914 var selector = new _selector["default"]({
4915 source: {
[0c6b92a]4916 start: tokenStart(this.tokens[this.position])
4917 },
4918 sourceIndex: this.tokens[this.position][_tokenize.FIELDS.START_POS]
[d565449]4919 });
4920 var cache = this.current;
4921 last.append(selector);
4922 this.current = selector;
4923 while (this.position < this.tokens.length && unbalanced) {
4924 if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) {
4925 unbalanced++;
4926 }
4927 if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) {
4928 unbalanced--;
4929 }
4930 if (unbalanced) {
4931 this.parse();
4932 } else {
4933 this.current.source.end = tokenEnd(this.currToken);
4934 this.current.parent.source.end = tokenEnd(this.currToken);
4935 this.position++;
4936 }
4937 }
4938 this.current = cache;
4939 } else {
4940 // I think this case should be an error. It's used to implement a basic parse of media queries
4941 // but I don't think it's a good idea.
4942 var parenStart = this.currToken;
4943 var parenValue = "(";
4944 var parenEnd;
4945 while (this.position < this.tokens.length && unbalanced) {
4946 if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) {
4947 unbalanced++;
4948 }
4949 if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) {
4950 unbalanced--;
4951 }
4952 parenEnd = this.currToken;
4953 parenValue += this.parseParenthesisToken(this.currToken);
4954 this.position++;
4955 }
4956 if (last) {
4957 last.appendToPropertyAndEscape("value", parenValue, parenValue);
4958 } else {
4959 this.newNode(new _string["default"]({
4960 value: parenValue,
4961 source: getSource(parenStart[_tokenize.FIELDS.START_LINE], parenStart[_tokenize.FIELDS.START_COL], parenEnd[_tokenize.FIELDS.END_LINE], parenEnd[_tokenize.FIELDS.END_COL]),
4962 sourceIndex: parenStart[_tokenize.FIELDS.START_POS]
4963 }));
4964 }
4965 }
4966 if (unbalanced) {
4967 return this.expected('closing parenthesis', this.currToken[_tokenize.FIELDS.START_POS]);
4968 }
4969 };
4970 _proto.pseudo = function pseudo() {
4971 var _this4 = this;
4972 var pseudoStr = '';
4973 var startingToken = this.currToken;
4974 while (this.currToken && this.currToken[_tokenize.FIELDS.TYPE] === tokens.colon) {
4975 pseudoStr += this.content();
4976 this.position++;
4977 }
4978 if (!this.currToken) {
4979 return this.expected(['pseudo-class', 'pseudo-element'], this.position - 1);
4980 }
4981 if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.word) {
4982 this.splitWord(false, function (first, length) {
4983 pseudoStr += first;
4984 _this4.newNode(new _pseudo["default"]({
4985 value: pseudoStr,
4986 source: getTokenSourceSpan(startingToken, _this4.currToken),
4987 sourceIndex: startingToken[_tokenize.FIELDS.START_POS]
4988 }));
4989 if (length > 1 && _this4.nextToken && _this4.nextToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) {
4990 _this4.error('Misplaced parenthesis.', {
4991 index: _this4.nextToken[_tokenize.FIELDS.START_POS]
4992 });
4993 }
4994 });
4995 } else {
4996 return this.expected(['pseudo-class', 'pseudo-element'], this.currToken[_tokenize.FIELDS.START_POS]);
4997 }
4998 };
4999 _proto.space = function space() {
[0c6b92a]5000 var content = this.content();
5001 // Handle space before and after the selector
[d565449]5002 if (this.position === 0 || this.prevToken[_tokenize.FIELDS.TYPE] === tokens.comma || this.prevToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis || this.current.nodes.every(function (node) {
5003 return node.type === 'comment';
5004 })) {
5005 this.spaces = this.optionalSpace(content);
5006 this.position++;
5007 } else if (this.position === this.tokens.length - 1 || this.nextToken[_tokenize.FIELDS.TYPE] === tokens.comma || this.nextToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) {
5008 this.current.last.spaces.after = this.optionalSpace(content);
5009 this.position++;
5010 } else {
5011 this.combinator();
5012 }
5013 };
5014 _proto.string = function string() {
5015 var current = this.currToken;
5016 this.newNode(new _string["default"]({
5017 value: this.content(),
5018 source: getTokenSource(current),
5019 sourceIndex: current[_tokenize.FIELDS.START_POS]
5020 }));
5021 this.position++;
5022 };
5023 _proto.universal = function universal(namespace) {
5024 var nextToken = this.nextToken;
5025 if (nextToken && this.content(nextToken) === '|') {
5026 this.position++;
5027 return this.namespace();
5028 }
5029 var current = this.currToken;
5030 this.newNode(new _universal["default"]({
5031 value: this.content(),
5032 source: getTokenSource(current),
5033 sourceIndex: current[_tokenize.FIELDS.START_POS]
5034 }), namespace);
5035 this.position++;
5036 };
5037 _proto.splitWord = function splitWord(namespace, firstCallback) {
5038 var _this5 = this;
5039 var nextToken = this.nextToken;
5040 var word = this.content();
5041 while (nextToken && ~[tokens.dollar, tokens.caret, tokens.equals, tokens.word].indexOf(nextToken[_tokenize.FIELDS.TYPE])) {
5042 this.position++;
5043 var current = this.content();
5044 word += current;
5045 if (current.lastIndexOf('\\') === current.length - 1) {
5046 var next = this.nextToken;
5047 if (next && next[_tokenize.FIELDS.TYPE] === tokens.space) {
5048 word += this.requiredSpace(this.content(next));
5049 this.position++;
5050 }
5051 }
5052 nextToken = this.nextToken;
5053 }
5054 var hasClass = indexesOf(word, '.').filter(function (i) {
5055 // Allow escaped dot within class name
[0c6b92a]5056 var escapedDot = word[i - 1] === '\\';
5057 // Allow decimal numbers percent in @keyframes
[d565449]5058 var isKeyframesPercent = /^\d+\.\d+%$/.test(word);
5059 return !escapedDot && !isKeyframesPercent;
5060 });
5061 var hasId = indexesOf(word, '#').filter(function (i) {
5062 return word[i - 1] !== '\\';
[0c6b92a]5063 });
5064 // Eliminate Sass interpolations from the list of id indexes
[d565449]5065 var interpolations = indexesOf(word, '#{');
5066 if (interpolations.length) {
5067 hasId = hasId.filter(function (hashIndex) {
5068 return !~interpolations.indexOf(hashIndex);
5069 });
5070 }
5071 var indices = (0, _sortAscending["default"])(uniqs([0].concat(hasClass, hasId)));
5072 indices.forEach(function (ind, i) {
5073 var index = indices[i + 1] || word.length;
5074 var value = word.slice(ind, index);
5075 if (i === 0 && firstCallback) {
5076 return firstCallback.call(_this5, value, indices.length);
5077 }
5078 var node;
5079 var current = _this5.currToken;
5080 var sourceIndex = current[_tokenize.FIELDS.START_POS] + indices[i];
5081 var source = getSource(current[1], current[2] + ind, current[3], current[2] + (index - 1));
5082 if (~hasClass.indexOf(ind)) {
5083 var classNameOpts = {
5084 value: value.slice(1),
5085 source: source,
5086 sourceIndex: sourceIndex
5087 };
5088 node = new _className["default"](unescapeProp(classNameOpts, "value"));
5089 } else if (~hasId.indexOf(ind)) {
5090 var idOpts = {
5091 value: value.slice(1),
5092 source: source,
5093 sourceIndex: sourceIndex
5094 };
5095 node = new _id["default"](unescapeProp(idOpts, "value"));
5096 } else {
5097 var tagOpts = {
5098 value: value,
5099 source: source,
5100 sourceIndex: sourceIndex
5101 };
5102 unescapeProp(tagOpts, "value");
5103 node = new _tag["default"](tagOpts);
5104 }
[0c6b92a]5105 _this5.newNode(node, namespace);
5106 // Ensure that the namespace is used only once
[d565449]5107 namespace = null;
5108 });
5109 this.position++;
5110 };
5111 _proto.word = function word(namespace) {
5112 var nextToken = this.nextToken;
5113 if (nextToken && this.content(nextToken) === '|') {
5114 this.position++;
5115 return this.namespace();
5116 }
5117 return this.splitWord(namespace);
5118 };
5119 _proto.loop = function loop() {
5120 while (this.position < this.tokens.length) {
5121 this.parse(true);
5122 }
5123 this.current._inferEndPosition();
5124 return this.root;
5125 };
5126 _proto.parse = function parse(throwOnParenthesis) {
5127 switch (this.currToken[_tokenize.FIELDS.TYPE]) {
5128 case tokens.space:
5129 this.space();
5130 break;
5131 case tokens.comment:
5132 this.comment();
5133 break;
5134 case tokens.openParenthesis:
5135 this.parentheses();
5136 break;
5137 case tokens.closeParenthesis:
5138 if (throwOnParenthesis) {
5139 this.missingParenthesis();
5140 }
5141 break;
5142 case tokens.openSquare:
5143 this.attribute();
5144 break;
5145 case tokens.dollar:
5146 case tokens.caret:
5147 case tokens.equals:
5148 case tokens.word:
5149 this.word();
5150 break;
5151 case tokens.colon:
5152 this.pseudo();
5153 break;
5154 case tokens.comma:
5155 this.comma();
5156 break;
5157 case tokens.asterisk:
5158 this.universal();
5159 break;
5160 case tokens.ampersand:
5161 this.nesting();
5162 break;
5163 case tokens.slash:
5164 case tokens.combinator:
5165 this.combinator();
5166 break;
5167 case tokens.str:
5168 this.string();
5169 break;
5170 // These cases throw; no break needed.
5171 case tokens.closeSquare:
5172 this.missingSquareBracket();
5173 case tokens.semicolon:
5174 this.missingBackslash();
5175 default:
5176 this.unexpected();
5177 }
5178 }
[0c6b92a]5179
[d565449]5180 /**
5181 * Helpers
[0c6b92a]5182 */;
[d565449]5183 _proto.expected = function expected(description, index, found) {
5184 if (Array.isArray(description)) {
5185 var last = description.pop();
5186 description = description.join(', ') + " or " + last;
5187 }
5188 var an = /^[aeiou]/.test(description[0]) ? 'an' : 'a';
5189 if (!found) {
5190 return this.error("Expected " + an + " " + description + ".", {
5191 index: index
5192 });
5193 }
5194 return this.error("Expected " + an + " " + description + ", found \"" + found + "\" instead.", {
5195 index: index
5196 });
5197 };
5198 _proto.requiredSpace = function requiredSpace(space) {
5199 return this.options.lossy ? ' ' : space;
5200 };
5201 _proto.optionalSpace = function optionalSpace(space) {
5202 return this.options.lossy ? '' : space;
5203 };
5204 _proto.lossySpace = function lossySpace(space, required) {
5205 if (this.options.lossy) {
5206 return required ? ' ' : '';
5207 } else {
5208 return space;
5209 }
5210 };
5211 _proto.parseParenthesisToken = function parseParenthesisToken(token) {
5212 var content = this.content(token);
5213 if (token[_tokenize.FIELDS.TYPE] === tokens.space) {
5214 return this.requiredSpace(content);
5215 } else {
5216 return content;
5217 }
5218 };
5219 _proto.newNode = function newNode(node, namespace) {
5220 if (namespace) {
5221 if (/^ +$/.test(namespace)) {
5222 if (!this.options.lossy) {
5223 this.spaces = (this.spaces || '') + namespace;
5224 }
5225 namespace = true;
5226 }
5227 node.namespace = namespace;
5228 unescapeProp(node, "namespace");
5229 }
5230 if (this.spaces) {
5231 node.spaces.before = this.spaces;
5232 this.spaces = '';
5233 }
5234 return this.current.append(node);
5235 };
5236 _proto.content = function content(token) {
5237 if (token === void 0) {
5238 token = this.currToken;
5239 }
5240 return this.css.slice(token[_tokenize.FIELDS.START_POS], token[_tokenize.FIELDS.END_POS]);
5241 };
5242 /**
5243 * returns the index of the next non-whitespace, non-comment token.
5244 * returns -1 if no meaningful token is found.
5245 */
5246 _proto.locateNextMeaningfulToken = function locateNextMeaningfulToken(startPosition) {
5247 if (startPosition === void 0) {
5248 startPosition = this.position + 1;
5249 }
5250 var searchPosition = startPosition;
5251 while (searchPosition < this.tokens.length) {
5252 if (WHITESPACE_EQUIV_TOKENS[this.tokens[searchPosition][_tokenize.FIELDS.TYPE]]) {
5253 searchPosition++;
5254 continue;
5255 } else {
5256 return searchPosition;
5257 }
5258 }
5259 return -1;
5260 };
5261 _createClass(Parser, [{
5262 key: "currToken",
5263 get: function get() {
5264 return this.tokens[this.position];
5265 }
5266 }, {
5267 key: "nextToken",
5268 get: function get() {
5269 return this.tokens[this.position + 1];
5270 }
5271 }, {
5272 key: "prevToken",
5273 get: function get() {
5274 return this.tokens[this.position - 1];
5275 }
5276 }]);
5277 return Parser;
5278 }();
5279 exports["default"] = Parser;
5280 module.exports = exports.default;
5281} (parser, parser.exports));
5282
5283var parserExports = parser.exports;
5284
5285(function (module, exports) {
5286
5287 exports.__esModule = true;
5288 exports["default"] = void 0;
5289 var _parser = _interopRequireDefault(parserExports);
5290 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
5291 var Processor = /*#__PURE__*/function () {
5292 function Processor(func, options) {
5293 this.func = func || function noop() {};
5294 this.funcRes = null;
5295 this.options = options;
5296 }
5297 var _proto = Processor.prototype;
5298 _proto._shouldUpdateSelector = function _shouldUpdateSelector(rule, options) {
5299 if (options === void 0) {
5300 options = {};
5301 }
5302 var merged = Object.assign({}, this.options, options);
5303 if (merged.updateSelector === false) {
5304 return false;
5305 } else {
5306 return typeof rule !== "string";
5307 }
5308 };
5309 _proto._isLossy = function _isLossy(options) {
5310 if (options === void 0) {
5311 options = {};
5312 }
5313 var merged = Object.assign({}, this.options, options);
5314 if (merged.lossless === false) {
5315 return true;
5316 } else {
5317 return false;
5318 }
5319 };
5320 _proto._root = function _root(rule, options) {
5321 if (options === void 0) {
5322 options = {};
5323 }
5324 var parser = new _parser["default"](rule, this._parseOptions(options));
5325 return parser.root;
5326 };
5327 _proto._parseOptions = function _parseOptions(options) {
5328 return {
5329 lossy: this._isLossy(options)
5330 };
5331 };
5332 _proto._run = function _run(rule, options) {
5333 var _this = this;
5334 if (options === void 0) {
5335 options = {};
5336 }
5337 return new Promise(function (resolve, reject) {
5338 try {
5339 var root = _this._root(rule, options);
5340 Promise.resolve(_this.func(root)).then(function (transform) {
5341 var string = undefined;
5342 if (_this._shouldUpdateSelector(rule, options)) {
5343 string = root.toString();
5344 rule.selector = string;
5345 }
5346 return {
5347 transform: transform,
5348 root: root,
5349 string: string
5350 };
5351 }).then(resolve, reject);
5352 } catch (e) {
5353 reject(e);
5354 return;
5355 }
5356 });
5357 };
5358 _proto._runSync = function _runSync(rule, options) {
5359 if (options === void 0) {
5360 options = {};
5361 }
5362 var root = this._root(rule, options);
5363 var transform = this.func(root);
5364 if (transform && typeof transform.then === "function") {
5365 throw new Error("Selector processor returned a promise to a synchronous call.");
5366 }
5367 var string = undefined;
5368 if (options.updateSelector && typeof rule !== "string") {
5369 string = root.toString();
5370 rule.selector = string;
5371 }
5372 return {
5373 transform: transform,
5374 root: root,
5375 string: string
5376 };
5377 }
[0c6b92a]5378
[d565449]5379 /**
5380 * Process rule into a selector AST.
5381 *
5382 * @param rule {postcss.Rule | string} The css selector to be processed
5383 * @param options The options for processing
5384 * @returns {Promise<parser.Root>} The AST of the selector after processing it.
[0c6b92a]5385 */;
[d565449]5386 _proto.ast = function ast(rule, options) {
5387 return this._run(rule, options).then(function (result) {
5388 return result.root;
5389 });
5390 }
[0c6b92a]5391
[d565449]5392 /**
5393 * Process rule into a selector AST synchronously.
5394 *
5395 * @param rule {postcss.Rule | string} The css selector to be processed
5396 * @param options The options for processing
5397 * @returns {parser.Root} The AST of the selector after processing it.
[0c6b92a]5398 */;
[d565449]5399 _proto.astSync = function astSync(rule, options) {
5400 return this._runSync(rule, options).root;
5401 }
[0c6b92a]5402
[d565449]5403 /**
5404 * Process a selector into a transformed value asynchronously
5405 *
5406 * @param rule {postcss.Rule | string} The css selector to be processed
5407 * @param options The options for processing
5408 * @returns {Promise<any>} The value returned by the processor.
[0c6b92a]5409 */;
[d565449]5410 _proto.transform = function transform(rule, options) {
5411 return this._run(rule, options).then(function (result) {
5412 return result.transform;
5413 });
5414 }
[0c6b92a]5415
[d565449]5416 /**
5417 * Process a selector into a transformed value synchronously.
5418 *
5419 * @param rule {postcss.Rule | string} The css selector to be processed
5420 * @param options The options for processing
5421 * @returns {any} The value returned by the processor.
[0c6b92a]5422 */;
[d565449]5423 _proto.transformSync = function transformSync(rule, options) {
5424 return this._runSync(rule, options).transform;
5425 }
[0c6b92a]5426
[d565449]5427 /**
5428 * Process a selector into a new selector string asynchronously.
5429 *
5430 * @param rule {postcss.Rule | string} The css selector to be processed
5431 * @param options The options for processing
5432 * @returns {string} the selector after processing.
[0c6b92a]5433 */;
[d565449]5434 _proto.process = function process(rule, options) {
5435 return this._run(rule, options).then(function (result) {
5436 return result.string || result.root.toString();
5437 });
5438 }
[0c6b92a]5439
[d565449]5440 /**
5441 * Process a selector into a new selector string synchronously.
5442 *
5443 * @param rule {postcss.Rule | string} The css selector to be processed
5444 * @param options The options for processing
5445 * @returns {string} the selector after processing.
[0c6b92a]5446 */;
[d565449]5447 _proto.processSync = function processSync(rule, options) {
5448 var result = this._runSync(rule, options);
5449 return result.string || result.root.toString();
5450 };
5451 return Processor;
5452 }();
5453 exports["default"] = Processor;
5454 module.exports = exports.default;
5455} (processor, processor.exports));
5456
5457var processorExports = processor.exports;
5458
5459var selectors = {};
5460
5461var constructors = {};
5462
5463constructors.__esModule = true;
5464constructors.universal = constructors.tag = constructors.string = constructors.selector = constructors.root = constructors.pseudo = constructors.nesting = constructors.id = constructors.comment = constructors.combinator = constructors.className = constructors.attribute = void 0;
5465var _attribute = _interopRequireDefault$2(attribute$1);
5466var _className = _interopRequireDefault$2(classNameExports);
5467var _combinator = _interopRequireDefault$2(combinatorExports);
5468var _comment = _interopRequireDefault$2(commentExports);
5469var _id = _interopRequireDefault$2(idExports);
5470var _nesting = _interopRequireDefault$2(nestingExports);
5471var _pseudo = _interopRequireDefault$2(pseudoExports);
5472var _root = _interopRequireDefault$2(rootExports);
5473var _selector = _interopRequireDefault$2(selectorExports);
5474var _string = _interopRequireDefault$2(stringExports);
5475var _tag = _interopRequireDefault$2(tagExports);
5476var _universal = _interopRequireDefault$2(universalExports);
5477function _interopRequireDefault$2(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
5478var attribute = function attribute(opts) {
5479 return new _attribute["default"](opts);
5480};
5481constructors.attribute = attribute;
5482var className = function className(opts) {
5483 return new _className["default"](opts);
5484};
5485constructors.className = className;
5486var combinator = function combinator(opts) {
5487 return new _combinator["default"](opts);
5488};
5489constructors.combinator = combinator;
5490var comment = function comment(opts) {
5491 return new _comment["default"](opts);
5492};
5493constructors.comment = comment;
5494var id = function id(opts) {
5495 return new _id["default"](opts);
5496};
5497constructors.id = id;
5498var nesting = function nesting(opts) {
5499 return new _nesting["default"](opts);
5500};
5501constructors.nesting = nesting;
5502var pseudo = function pseudo(opts) {
5503 return new _pseudo["default"](opts);
5504};
5505constructors.pseudo = pseudo;
5506var root = function root(opts) {
5507 return new _root["default"](opts);
5508};
5509constructors.root = root;
5510var selector = function selector(opts) {
5511 return new _selector["default"](opts);
5512};
5513constructors.selector = selector;
5514var string = function string(opts) {
5515 return new _string["default"](opts);
5516};
5517constructors.string = string;
5518var tag = function tag(opts) {
5519 return new _tag["default"](opts);
5520};
5521constructors.tag = tag;
5522var universal = function universal(opts) {
5523 return new _universal["default"](opts);
5524};
5525constructors.universal = universal;
5526
5527var guards = {};
5528
5529guards.__esModule = true;
[0c6b92a]5530guards.isComment = guards.isCombinator = guards.isClassName = guards.isAttribute = void 0;
[d565449]5531guards.isContainer = isContainer;
[0c6b92a]5532guards.isIdentifier = void 0;
[d565449]5533guards.isNamespace = isNamespace;
[0c6b92a]5534guards.isNesting = void 0;
5535guards.isNode = isNode;
5536guards.isPseudo = void 0;
5537guards.isPseudoClass = isPseudoClass;
5538guards.isPseudoElement = isPseudoElement;
5539guards.isUniversal = guards.isTag = guards.isString = guards.isSelector = guards.isRoot = void 0;
[d565449]5540var _types = types;
5541var _IS_TYPE;
5542var IS_TYPE = (_IS_TYPE = {}, _IS_TYPE[_types.ATTRIBUTE] = true, _IS_TYPE[_types.CLASS] = true, _IS_TYPE[_types.COMBINATOR] = true, _IS_TYPE[_types.COMMENT] = true, _IS_TYPE[_types.ID] = true, _IS_TYPE[_types.NESTING] = true, _IS_TYPE[_types.PSEUDO] = true, _IS_TYPE[_types.ROOT] = true, _IS_TYPE[_types.SELECTOR] = true, _IS_TYPE[_types.STRING] = true, _IS_TYPE[_types.TAG] = true, _IS_TYPE[_types.UNIVERSAL] = true, _IS_TYPE);
5543function isNode(node) {
5544 return typeof node === "object" && IS_TYPE[node.type];
5545}
5546function isNodeType(type, node) {
5547 return isNode(node) && node.type === type;
5548}
5549var isAttribute = isNodeType.bind(null, _types.ATTRIBUTE);
5550guards.isAttribute = isAttribute;
5551var isClassName = isNodeType.bind(null, _types.CLASS);
5552guards.isClassName = isClassName;
5553var isCombinator = isNodeType.bind(null, _types.COMBINATOR);
5554guards.isCombinator = isCombinator;
5555var isComment = isNodeType.bind(null, _types.COMMENT);
5556guards.isComment = isComment;
5557var isIdentifier = isNodeType.bind(null, _types.ID);
5558guards.isIdentifier = isIdentifier;
5559var isNesting = isNodeType.bind(null, _types.NESTING);
5560guards.isNesting = isNesting;
5561var isPseudo = isNodeType.bind(null, _types.PSEUDO);
5562guards.isPseudo = isPseudo;
5563var isRoot = isNodeType.bind(null, _types.ROOT);
5564guards.isRoot = isRoot;
5565var isSelector = isNodeType.bind(null, _types.SELECTOR);
5566guards.isSelector = isSelector;
5567var isString = isNodeType.bind(null, _types.STRING);
5568guards.isString = isString;
5569var isTag = isNodeType.bind(null, _types.TAG);
5570guards.isTag = isTag;
5571var isUniversal = isNodeType.bind(null, _types.UNIVERSAL);
5572guards.isUniversal = isUniversal;
5573function isPseudoElement(node) {
5574 return isPseudo(node) && node.value && (node.value.startsWith("::") || node.value.toLowerCase() === ":before" || node.value.toLowerCase() === ":after" || node.value.toLowerCase() === ":first-letter" || node.value.toLowerCase() === ":first-line");
5575}
5576function isPseudoClass(node) {
5577 return isPseudo(node) && !isPseudoElement(node);
5578}
5579function isContainer(node) {
5580 return !!(isNode(node) && node.walk);
5581}
5582function isNamespace(node) {
5583 return isAttribute(node) || isTag(node);
5584}
5585
5586(function (exports) {
5587
5588 exports.__esModule = true;
5589 var _types = types;
5590 Object.keys(_types).forEach(function (key) {
5591 if (key === "default" || key === "__esModule") return;
5592 if (key in exports && exports[key] === _types[key]) return;
5593 exports[key] = _types[key];
5594 });
5595 var _constructors = constructors;
5596 Object.keys(_constructors).forEach(function (key) {
5597 if (key === "default" || key === "__esModule") return;
5598 if (key in exports && exports[key] === _constructors[key]) return;
5599 exports[key] = _constructors[key];
5600 });
5601 var _guards = guards;
5602 Object.keys(_guards).forEach(function (key) {
5603 if (key === "default" || key === "__esModule") return;
5604 if (key in exports && exports[key] === _guards[key]) return;
5605 exports[key] = _guards[key];
5606 });
5607} (selectors));
5608
5609(function (module, exports) {
5610
5611 exports.__esModule = true;
5612 exports["default"] = void 0;
5613 var _processor = _interopRequireDefault(processorExports);
5614 var selectors$1 = _interopRequireWildcard(selectors);
[0c6b92a]5615 function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
5616 function _interopRequireWildcard(obj, nodeInterop) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
[d565449]5617 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
5618 var parser = function parser(processor) {
5619 return new _processor["default"](processor);
5620 };
5621 Object.assign(parser, selectors$1);
5622 delete parser.__esModule;
5623 var _default = parser;
5624 exports["default"] = _default;
5625 module.exports = exports.default;
5626} (dist, dist.exports));
5627
5628var distExports = dist.exports;
5629
5630const selectorParser$1 = distExports;
5631const valueParser = lib;
5632const { extractICSS } = src$4;
5633
5634const isSpacing = (node) => node.type === "combinator" && node.value === " ";
5635
5636function normalizeNodeArray(nodes) {
5637 const array = [];
5638
5639 nodes.forEach((x) => {
5640 if (Array.isArray(x)) {
5641 normalizeNodeArray(x).forEach((item) => {
5642 array.push(item);
5643 });
5644 } else if (x) {
5645 array.push(x);
5646 }
5647 });
5648
5649 if (array.length > 0 && isSpacing(array[array.length - 1])) {
5650 array.pop();
5651 }
5652 return array;
5653}
5654
5655function localizeNode(rule, mode, localAliasMap) {
5656 const transform = (node, context) => {
5657 if (context.ignoreNextSpacing && !isSpacing(node)) {
5658 throw new Error("Missing whitespace after " + context.ignoreNextSpacing);
5659 }
5660
5661 if (context.enforceNoSpacing && isSpacing(node)) {
5662 throw new Error("Missing whitespace before " + context.enforceNoSpacing);
5663 }
5664
5665 let newNodes;
5666
5667 switch (node.type) {
5668 case "root": {
5669 let resultingGlobal;
5670
5671 context.hasPureGlobals = false;
5672
5673 newNodes = node.nodes.map((n) => {
5674 const nContext = {
5675 global: context.global,
5676 lastWasSpacing: true,
5677 hasLocals: false,
5678 explicit: false,
5679 };
5680
5681 n = transform(n, nContext);
5682
5683 if (typeof resultingGlobal === "undefined") {
5684 resultingGlobal = nContext.global;
5685 } else if (resultingGlobal !== nContext.global) {
5686 throw new Error(
5687 'Inconsistent rule global/local result in rule "' +
5688 node +
5689 '" (multiple selectors must result in the same mode for the rule)'
5690 );
5691 }
5692
5693 if (!nContext.hasLocals) {
5694 context.hasPureGlobals = true;
5695 }
5696
5697 return n;
5698 });
5699
5700 context.global = resultingGlobal;
5701
5702 node.nodes = normalizeNodeArray(newNodes);
5703 break;
5704 }
5705 case "selector": {
5706 newNodes = node.map((childNode) => transform(childNode, context));
5707
5708 node = node.clone();
5709 node.nodes = normalizeNodeArray(newNodes);
5710 break;
5711 }
5712 case "combinator": {
5713 if (isSpacing(node)) {
5714 if (context.ignoreNextSpacing) {
5715 context.ignoreNextSpacing = false;
5716 context.lastWasSpacing = false;
5717 context.enforceNoSpacing = false;
5718 return null;
5719 }
5720 context.lastWasSpacing = true;
5721 return node;
5722 }
5723 break;
5724 }
5725 case "pseudo": {
5726 let childContext;
5727 const isNested = !!node.length;
5728 const isScoped = node.value === ":local" || node.value === ":global";
5729 const isImportExport =
5730 node.value === ":import" || node.value === ":export";
5731
5732 if (isImportExport) {
5733 context.hasLocals = true;
5734 // :local(.foo)
5735 } else if (isNested) {
5736 if (isScoped) {
5737 if (node.nodes.length === 0) {
5738 throw new Error(`${node.value}() can't be empty`);
5739 }
5740
5741 if (context.inside) {
5742 throw new Error(
5743 `A ${node.value} is not allowed inside of a ${context.inside}(...)`
5744 );
5745 }
5746
5747 childContext = {
5748 global: node.value === ":global",
5749 inside: node.value,
5750 hasLocals: false,
5751 explicit: true,
5752 };
5753
5754 newNodes = node
5755 .map((childNode) => transform(childNode, childContext))
5756 .reduce((acc, next) => acc.concat(next.nodes), []);
5757
5758 if (newNodes.length) {
5759 const { before, after } = node.spaces;
5760
5761 const first = newNodes[0];
5762 const last = newNodes[newNodes.length - 1];
5763
5764 first.spaces = { before, after: first.spaces.after };
5765 last.spaces = { before: last.spaces.before, after };
5766 }
5767
5768 node = newNodes;
5769
5770 break;
5771 } else {
5772 childContext = {
5773 global: context.global,
5774 inside: context.inside,
5775 lastWasSpacing: true,
5776 hasLocals: false,
5777 explicit: context.explicit,
5778 };
[0c6b92a]5779 newNodes = node.map((childNode) => {
5780 const newContext = {
5781 ...childContext,
5782 enforceNoSpacing: false,
5783 };
5784
5785 const result = transform(childNode, newContext);
5786
5787 childContext.global = newContext.global;
5788 childContext.hasLocals = newContext.hasLocals;
5789
5790 return result;
5791 });
[d565449]5792
5793 node = node.clone();
5794 node.nodes = normalizeNodeArray(newNodes);
5795
5796 if (childContext.hasLocals) {
5797 context.hasLocals = true;
5798 }
5799 }
5800 break;
5801
5802 //:local .foo .bar
5803 } else if (isScoped) {
5804 if (context.inside) {
5805 throw new Error(
5806 `A ${node.value} is not allowed inside of a ${context.inside}(...)`
5807 );
5808 }
5809
5810 const addBackSpacing = !!node.spaces.before;
5811
5812 context.ignoreNextSpacing = context.lastWasSpacing
5813 ? node.value
5814 : false;
5815
5816 context.enforceNoSpacing = context.lastWasSpacing
5817 ? false
5818 : node.value;
5819
5820 context.global = node.value === ":global";
5821 context.explicit = true;
5822
5823 // because this node has spacing that is lost when we remove it
5824 // we make up for it by adding an extra combinator in since adding
5825 // spacing on the parent selector doesn't work
5826 return addBackSpacing
5827 ? selectorParser$1.combinator({ value: " " })
5828 : null;
5829 }
5830 break;
5831 }
5832 case "id":
5833 case "class": {
5834 if (!node.value) {
5835 throw new Error("Invalid class or id selector syntax");
5836 }
5837
5838 if (context.global) {
5839 break;
5840 }
5841
5842 const isImportedValue = localAliasMap.has(node.value);
5843 const isImportedWithExplicitScope = isImportedValue && context.explicit;
5844
5845 if (!isImportedValue || isImportedWithExplicitScope) {
5846 const innerNode = node.clone();
5847 innerNode.spaces = { before: "", after: "" };
5848
5849 node = selectorParser$1.pseudo({
5850 value: ":local",
5851 nodes: [innerNode],
5852 spaces: node.spaces,
5853 });
5854
5855 context.hasLocals = true;
5856 }
5857
5858 break;
5859 }
[0c6b92a]5860 case "nesting": {
5861 if (node.value === "&") {
5862 context.hasLocals = true;
5863 }
5864 }
[d565449]5865 }
5866
5867 context.lastWasSpacing = false;
5868 context.ignoreNextSpacing = false;
5869 context.enforceNoSpacing = false;
5870
5871 return node;
5872 };
5873
5874 const rootContext = {
5875 global: mode === "global",
5876 hasPureGlobals: false,
5877 };
5878
5879 rootContext.selector = selectorParser$1((root) => {
5880 transform(root, rootContext);
5881 }).processSync(rule, { updateSelector: false, lossless: true });
5882
5883 return rootContext;
5884}
5885
5886function localizeDeclNode(node, context) {
5887 switch (node.type) {
5888 case "word":
5889 if (context.localizeNextItem) {
5890 if (!context.localAliasMap.has(node.value)) {
5891 node.value = ":local(" + node.value + ")";
5892 context.localizeNextItem = false;
5893 }
5894 }
5895 break;
5896
5897 case "function":
5898 if (
5899 context.options &&
5900 context.options.rewriteUrl &&
5901 node.value.toLowerCase() === "url"
5902 ) {
5903 node.nodes.map((nestedNode) => {
5904 if (nestedNode.type !== "string" && nestedNode.type !== "word") {
5905 return;
5906 }
5907
5908 let newUrl = context.options.rewriteUrl(
5909 context.global,
5910 nestedNode.value
5911 );
5912
5913 switch (nestedNode.type) {
5914 case "string":
5915 if (nestedNode.quote === "'") {
5916 newUrl = newUrl.replace(/(\\)/g, "\\$1").replace(/'/g, "\\'");
5917 }
5918
5919 if (nestedNode.quote === '"') {
5920 newUrl = newUrl.replace(/(\\)/g, "\\$1").replace(/"/g, '\\"');
5921 }
5922
5923 break;
5924 case "word":
5925 newUrl = newUrl.replace(/("|'|\)|\\)/g, "\\$1");
5926 break;
5927 }
5928
5929 nestedNode.value = newUrl;
5930 });
5931 }
5932 break;
5933 }
5934 return node;
5935}
5936
[0c6b92a]5937// `none` is special value, other is global values
5938const specialKeywords = [
5939 "none",
5940 "inherit",
5941 "initial",
5942 "revert",
5943 "revert-layer",
5944 "unset",
5945];
[d565449]5946
5947function localizeDeclarationValues(localize, declaration, context) {
5948 const valueNodes = valueParser(declaration.value);
5949
5950 valueNodes.walk((node, index, nodes) => {
[0c6b92a]5951 if (
5952 node.type === "function" &&
5953 (node.value.toLowerCase() === "var" || node.value.toLowerCase() === "env")
5954 ) {
5955 return false;
5956 }
5957
5958 if (
5959 node.type === "word" &&
5960 specialKeywords.includes(node.value.toLowerCase())
5961 ) {
5962 return;
5963 }
5964
[d565449]5965 const subContext = {
5966 options: context.options,
5967 global: context.global,
5968 localizeNextItem: localize && !context.global,
5969 localAliasMap: context.localAliasMap,
5970 };
5971 nodes[index] = localizeDeclNode(node, subContext);
5972 });
5973
5974 declaration.value = valueNodes.toString();
5975}
5976
5977function localizeDeclaration(declaration, context) {
5978 const isAnimation = /animation$/i.test(declaration.prop);
5979
5980 if (isAnimation) {
[0c6b92a]5981 // letter
5982 // An uppercase letter or a lowercase letter.
5983 //
5984 // ident-start code point
5985 // A letter, a non-ASCII code point, or U+005F LOW LINE (_).
5986 //
5987 // ident code point
5988 // An ident-start code point, a digit, or U+002D HYPHEN-MINUS (-).
5989
5990 // We don't validate `hex digits`, because we don't need it, it is work of linters.
5991 const validIdent =
5992 /^-?([a-z\u0080-\uFFFF_]|(\\[^\r\n\f])|-(?![0-9]))((\\[^\r\n\f])|[a-z\u0080-\uFFFF_0-9-])*$/i;
[d565449]5993
5994 /*
5995 The spec defines some keywords that you can use to describe properties such as the timing
5996 function. These are still valid animation names, so as long as there is a property that accepts
5997 a keyword, it is given priority. Only when all the properties that can take a keyword are
5998 exhausted can the animation name be set to the keyword. I.e.
[0c6b92a]5999
[d565449]6000 animation: infinite infinite;
[0c6b92a]6001
[d565449]6002 The animation will repeat an infinite number of times from the first argument, and will have an
6003 animation name of infinite from the second.
6004 */
6005 const animationKeywords = {
[0c6b92a]6006 // animation-direction
6007 $normal: 1,
6008 $reverse: 1,
[d565449]6009 $alternate: 1,
6010 "$alternate-reverse": 1,
[0c6b92a]6011 // animation-fill-mode
6012 $forwards: 1,
[d565449]6013 $backwards: 1,
6014 $both: 1,
[0c6b92a]6015 // animation-iteration-count
6016 $infinite: 1,
6017 // animation-play-state
6018 $paused: 1,
6019 $running: 1,
6020 // animation-timing-function
[d565449]6021 $ease: 1,
6022 "$ease-in": 1,
6023 "$ease-out": 1,
[0c6b92a]6024 "$ease-in-out": 1,
[d565449]6025 $linear: 1,
6026 "$step-end": 1,
6027 "$step-start": 1,
[0c6b92a]6028 // Special
6029 $none: Infinity, // No matter how many times you write none, it will never be an animation name
6030 // Global values
[d565449]6031 $initial: Infinity,
6032 $inherit: Infinity,
6033 $unset: Infinity,
[0c6b92a]6034 $revert: Infinity,
6035 "$revert-layer": Infinity,
[d565449]6036 };
6037 let parsedAnimationKeywords = {};
6038 const valueNodes = valueParser(declaration.value).walk((node) => {
[0c6b92a]6039 // If div-token appeared (represents as comma ','), a possibility of an animation-keywords should be reflesh.
[d565449]6040 if (node.type === "div") {
6041 parsedAnimationKeywords = {};
[0c6b92a]6042
6043 return;
6044 }
6045 // Do not handle nested functions
6046 else if (node.type === "function") {
6047 return false;
[d565449]6048 }
[0c6b92a]6049 // Ignore all except word
6050 else if (node.type !== "word") {
6051 return;
[d565449]6052 }
[0c6b92a]6053
6054 const value = node.type === "word" ? node.value.toLowerCase() : null;
[d565449]6055
6056 let shouldParseAnimationName = false;
6057
6058 if (value && validIdent.test(value)) {
6059 if ("$" + value in animationKeywords) {
6060 parsedAnimationKeywords["$" + value] =
6061 "$" + value in parsedAnimationKeywords
6062 ? parsedAnimationKeywords["$" + value] + 1
6063 : 0;
6064
6065 shouldParseAnimationName =
6066 parsedAnimationKeywords["$" + value] >=
6067 animationKeywords["$" + value];
6068 } else {
6069 shouldParseAnimationName = true;
6070 }
6071 }
6072
6073 const subContext = {
6074 options: context.options,
6075 global: context.global,
6076 localizeNextItem: shouldParseAnimationName && !context.global,
6077 localAliasMap: context.localAliasMap,
6078 };
[0c6b92a]6079
[d565449]6080 return localizeDeclNode(node, subContext);
6081 });
6082
6083 declaration.value = valueNodes.toString();
6084
6085 return;
6086 }
6087
6088 const isAnimationName = /animation(-name)?$/i.test(declaration.prop);
6089
6090 if (isAnimationName) {
6091 return localizeDeclarationValues(true, declaration, context);
6092 }
6093
6094 const hasUrl = /url\(/i.test(declaration.value);
6095
6096 if (hasUrl) {
6097 return localizeDeclarationValues(false, declaration, context);
6098 }
6099}
6100
6101src$2.exports = (options = {}) => {
6102 if (
6103 options &&
6104 options.mode &&
6105 options.mode !== "global" &&
6106 options.mode !== "local" &&
6107 options.mode !== "pure"
6108 ) {
6109 throw new Error(
6110 'options.mode must be either "global", "local" or "pure" (default "local")'
6111 );
6112 }
6113
6114 const pureMode = options && options.mode === "pure";
6115 const globalMode = options && options.mode === "global";
6116
6117 return {
6118 postcssPlugin: "postcss-modules-local-by-default",
6119 prepare() {
6120 const localAliasMap = new Map();
6121
6122 return {
6123 Once(root) {
6124 const { icssImports } = extractICSS(root, false);
6125
6126 Object.keys(icssImports).forEach((key) => {
6127 Object.keys(icssImports[key]).forEach((prop) => {
6128 localAliasMap.set(prop, icssImports[key][prop]);
6129 });
6130 });
6131
6132 root.walkAtRules((atRule) => {
6133 if (/keyframes$/i.test(atRule.name)) {
6134 const globalMatch = /^\s*:global\s*\((.+)\)\s*$/.exec(
6135 atRule.params
6136 );
6137 const localMatch = /^\s*:local\s*\((.+)\)\s*$/.exec(
6138 atRule.params
6139 );
6140
6141 let globalKeyframes = globalMode;
6142
6143 if (globalMatch) {
6144 if (pureMode) {
6145 throw atRule.error(
6146 "@keyframes :global(...) is not allowed in pure mode"
6147 );
6148 }
6149 atRule.params = globalMatch[1];
6150 globalKeyframes = true;
6151 } else if (localMatch) {
6152 atRule.params = localMatch[0];
6153 globalKeyframes = false;
[0c6b92a]6154 } else if (
6155 atRule.params &&
6156 !globalMode &&
6157 !localAliasMap.has(atRule.params)
6158 ) {
6159 atRule.params = ":local(" + atRule.params + ")";
[d565449]6160 }
6161
6162 atRule.walkDecls((declaration) => {
6163 localizeDeclaration(declaration, {
6164 localAliasMap,
6165 options: options,
6166 global: globalKeyframes,
6167 });
6168 });
[0c6b92a]6169 } else if (/scope$/i.test(atRule.name)) {
6170 if (atRule.params) {
6171 atRule.params = atRule.params
6172 .split("to")
6173 .map((item) => {
6174 const selector = item.trim().slice(1, -1).trim();
6175 const context = localizeNode(
6176 selector,
6177 options.mode,
6178 localAliasMap
6179 );
6180
6181 context.options = options;
6182 context.localAliasMap = localAliasMap;
6183
6184 if (pureMode && context.hasPureGlobals) {
6185 throw atRule.error(
6186 'Selector in at-rule"' +
6187 selector +
6188 '" is not pure ' +
6189 "(pure selectors must contain at least one local class or id)"
6190 );
6191 }
6192
6193 return `(${context.selector})`;
6194 })
6195 .join(" to ");
6196 }
6197
6198 atRule.nodes.forEach((declaration) => {
6199 if (declaration.type === "decl") {
6200 localizeDeclaration(declaration, {
6201 localAliasMap,
6202 options: options,
6203 global: globalMode,
6204 });
6205 }
6206 });
[d565449]6207 } else if (atRule.nodes) {
6208 atRule.nodes.forEach((declaration) => {
6209 if (declaration.type === "decl") {
6210 localizeDeclaration(declaration, {
6211 localAliasMap,
6212 options: options,
6213 global: globalMode,
6214 });
6215 }
6216 });
6217 }
6218 });
6219
6220 root.walkRules((rule) => {
6221 if (
6222 rule.parent &&
6223 rule.parent.type === "atrule" &&
6224 /keyframes$/i.test(rule.parent.name)
6225 ) {
6226 // ignore keyframe rules
6227 return;
6228 }
6229
6230 const context = localizeNode(rule, options.mode, localAliasMap);
6231
6232 context.options = options;
6233 context.localAliasMap = localAliasMap;
6234
6235 if (pureMode && context.hasPureGlobals) {
6236 throw rule.error(
6237 'Selector "' +
6238 rule.selector +
6239 '" is not pure ' +
6240 "(pure selectors must contain at least one local class or id)"
6241 );
6242 }
6243
6244 rule.selector = context.selector;
6245
6246 // Less-syntax mixins parse as rules with no nodes
6247 if (rule.nodes) {
6248 rule.nodes.forEach((declaration) =>
6249 localizeDeclaration(declaration, context)
6250 );
6251 }
6252 });
6253 },
6254 };
6255 },
6256 };
6257};
6258src$2.exports.postcss = true;
6259
6260var srcExports$1 = src$2.exports;
6261
6262const selectorParser = distExports;
6263
6264const hasOwnProperty = Object.prototype.hasOwnProperty;
6265
[0c6b92a]6266function isNestedRule(rule) {
6267 if (!rule.parent || rule.parent.type === "root") {
6268 return false;
6269 }
6270
6271 if (rule.parent.type === "rule") {
6272 return true;
6273 }
6274
6275 return isNestedRule(rule.parent);
6276}
6277
6278function getSingleLocalNamesForComposes(root, rule) {
6279 if (isNestedRule(rule)) {
6280 throw new Error(`composition is not allowed in nested rule \n\n${rule}`);
6281 }
6282
[d565449]6283 return root.nodes.map((node) => {
6284 if (node.type !== "selector" || node.nodes.length !== 1) {
6285 throw new Error(
6286 `composition is only allowed when selector is single :local class name not in "${root}"`
6287 );
6288 }
6289
6290 node = node.nodes[0];
6291
6292 if (
6293 node.type !== "pseudo" ||
6294 node.value !== ":local" ||
6295 node.nodes.length !== 1
6296 ) {
6297 throw new Error(
6298 'composition is only allowed when selector is single :local class name not in "' +
6299 root +
6300 '", "' +
6301 node +
6302 '" is weird'
6303 );
6304 }
6305
6306 node = node.first;
6307
6308 if (node.type !== "selector" || node.length !== 1) {
6309 throw new Error(
6310 'composition is only allowed when selector is single :local class name not in "' +
6311 root +
6312 '", "' +
6313 node +
6314 '" is weird'
6315 );
6316 }
6317
6318 node = node.first;
6319
6320 if (node.type !== "class") {
6321 // 'id' is not possible, because you can't compose ids
6322 throw new Error(
6323 'composition is only allowed when selector is single :local class name not in "' +
6324 root +
6325 '", "' +
6326 node +
6327 '" is weird'
6328 );
6329 }
6330
6331 return node.value;
6332 });
6333}
6334
6335const whitespace = "[\\x20\\t\\r\\n\\f]";
6336const unescapeRegExp = new RegExp(
6337 "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)",
6338 "ig"
6339);
6340
6341function unescape(str) {
6342 return str.replace(unescapeRegExp, (_, escaped, escapedWhitespace) => {
6343 const high = "0x" + escaped - 0x10000;
6344
6345 // NaN means non-codepoint
6346 // Workaround erroneous numeric interpretation of +"0x"
6347 return high !== high || escapedWhitespace
6348 ? escaped
6349 : high < 0
6350 ? // BMP codepoint
6351 String.fromCharCode(high + 0x10000)
6352 : // Supplemental Plane codepoint (surrogate pair)
6353 String.fromCharCode((high >> 10) | 0xd800, (high & 0x3ff) | 0xdc00);
6354 });
6355}
6356
6357const plugin = (options = {}) => {
6358 const generateScopedName =
6359 (options && options.generateScopedName) || plugin.generateScopedName;
6360 const generateExportEntry =
6361 (options && options.generateExportEntry) || plugin.generateExportEntry;
6362 const exportGlobals = options && options.exportGlobals;
6363
6364 return {
6365 postcssPlugin: "postcss-modules-scope",
6366 Once(root, { rule }) {
6367 const exports = Object.create(null);
6368
[0c6b92a]6369 function exportScopedName(name, rawName, node) {
[d565449]6370 const scopedName = generateScopedName(
6371 rawName ? rawName : name,
6372 root.source.input.from,
[0c6b92a]6373 root.source.input.css,
6374 node
[d565449]6375 );
6376 const exportEntry = generateExportEntry(
6377 rawName ? rawName : name,
6378 scopedName,
6379 root.source.input.from,
[0c6b92a]6380 root.source.input.css,
6381 node
[d565449]6382 );
6383 const { key, value } = exportEntry;
6384
6385 exports[key] = exports[key] || [];
6386
6387 if (exports[key].indexOf(value) < 0) {
6388 exports[key].push(value);
6389 }
6390
6391 return scopedName;
6392 }
6393
6394 function localizeNode(node) {
6395 switch (node.type) {
6396 case "selector":
[0c6b92a]6397 node.nodes = node.map((item) => localizeNode(item));
[d565449]6398 return node;
6399 case "class":
6400 return selectorParser.className({
6401 value: exportScopedName(
6402 node.value,
[0c6b92a]6403 node.raws && node.raws.value ? node.raws.value : null,
6404 node
[d565449]6405 ),
6406 });
6407 case "id": {
6408 return selectorParser.id({
6409 value: exportScopedName(
6410 node.value,
[0c6b92a]6411 node.raws && node.raws.value ? node.raws.value : null,
6412 node
[d565449]6413 ),
6414 });
6415 }
[0c6b92a]6416 case "attribute": {
6417 if (node.attribute === "class" && node.operator === "=") {
6418 return selectorParser.attribute({
6419 attribute: node.attribute,
6420 operator: node.operator,
6421 quoteMark: "'",
6422 value: exportScopedName(node.value, null, null),
6423 });
6424 }
6425 }
[d565449]6426 }
6427
6428 throw new Error(
6429 `${node.type} ("${node}") is not allowed in a :local block`
6430 );
6431 }
6432
6433 function traverseNode(node) {
6434 switch (node.type) {
6435 case "pseudo":
6436 if (node.value === ":local") {
6437 if (node.nodes.length !== 1) {
6438 throw new Error('Unexpected comma (",") in :local block');
6439 }
6440
6441 const selector = localizeNode(node.first);
[0c6b92a]6442 // move the spaces that were around the pseudo selector to the first
[d565449]6443 // non-container node
6444 selector.first.spaces = node.spaces;
6445
6446 const nextNode = node.next();
6447
6448 if (
6449 nextNode &&
6450 nextNode.type === "combinator" &&
6451 nextNode.value === " " &&
6452 /\\[A-F0-9]{1,6}$/.test(selector.last.value)
6453 ) {
6454 selector.last.spaces.after = " ";
6455 }
6456
6457 node.replaceWith(selector);
6458
6459 return;
6460 }
6461 /* falls through */
6462 case "root":
6463 case "selector": {
[0c6b92a]6464 node.each((item) => traverseNode(item));
[d565449]6465 break;
6466 }
6467 case "id":
6468 case "class":
6469 if (exportGlobals) {
6470 exports[node.value] = [node.value];
6471 }
6472 break;
6473 }
6474 return node;
6475 }
6476
6477 // Find any :import and remember imported names
6478 const importedNames = {};
6479
6480 root.walkRules(/^:import\(.+\)$/, (rule) => {
6481 rule.walkDecls((decl) => {
6482 importedNames[decl.prop] = true;
6483 });
6484 });
6485
6486 // Find any :local selectors
6487 root.walkRules((rule) => {
6488 let parsedSelector = selectorParser().astSync(rule);
6489
6490 rule.selector = traverseNode(parsedSelector.clone()).toString();
6491
[0c6b92a]6492 rule.walkDecls(/^(composes|compose-with)$/i, (decl) => {
6493 const localNames = getSingleLocalNamesForComposes(
6494 parsedSelector,
6495 decl.parent
6496 );
6497 const multiple = decl.value.split(",");
[d565449]6498
[0c6b92a]6499 multiple.forEach((value) => {
6500 const classes = value.trim().split(/\s+/);
[d565449]6501
[0c6b92a]6502 classes.forEach((className) => {
6503 const global = /^global\(([^)]+)\)$/.exec(className);
6504
6505 if (global) {
6506 localNames.forEach((exportedName) => {
6507 exports[exportedName].push(global[1]);
[d565449]6508 });
[0c6b92a]6509 } else if (hasOwnProperty.call(importedNames, className)) {
6510 localNames.forEach((exportedName) => {
6511 exports[exportedName].push(className);
6512 });
6513 } else if (hasOwnProperty.call(exports, className)) {
6514 localNames.forEach((exportedName) => {
6515 exports[className].forEach((item) => {
6516 exports[exportedName].push(item);
6517 });
6518 });
6519 } else {
6520 throw decl.error(
6521 `referenced class name "${className}" in ${decl.prop} not found`
6522 );
6523 }
6524 });
[d565449]6525 });
6526
6527 decl.remove();
6528 });
6529
6530 // Find any :local values
6531 rule.walkDecls((decl) => {
6532 if (!/:local\s*\((.+?)\)/.test(decl.value)) {
6533 return;
6534 }
6535
6536 let tokens = decl.value.split(/(,|'[^']*'|"[^"]*")/);
6537
6538 tokens = tokens.map((token, idx) => {
6539 if (idx === 0 || tokens[idx - 1] === ",") {
6540 let result = token;
6541
6542 const localMatch = /:local\s*\((.+?)\)/.exec(token);
6543
6544 if (localMatch) {
6545 const input = localMatch.input;
6546 const matchPattern = localMatch[0];
6547 const matchVal = localMatch[1];
6548 const newVal = exportScopedName(matchVal);
6549
6550 result = input.replace(matchPattern, newVal);
6551 } else {
6552 return token;
6553 }
6554
6555 return result;
6556 } else {
6557 return token;
6558 }
6559 });
6560
6561 decl.value = tokens.join("");
6562 });
6563 });
6564
6565 // Find any :local keyframes
6566 root.walkAtRules(/keyframes$/i, (atRule) => {
6567 const localMatch = /^\s*:local\s*\((.+?)\)\s*$/.exec(atRule.params);
6568
6569 if (!localMatch) {
6570 return;
6571 }
6572
6573 atRule.params = exportScopedName(localMatch[1]);
6574 });
6575
[0c6b92a]6576 root.walkAtRules(/scope$/i, (atRule) => {
6577 if (atRule.params) {
6578 atRule.params = atRule.params
6579 .split("to")
6580 .map((item) => {
6581 const selector = item.trim().slice(1, -1).trim();
6582
6583 const localMatch = /^\s*:local\s*\((.+?)\)\s*$/.exec(selector);
6584
6585 if (!localMatch) {
6586 return `(${selector})`;
6587 }
6588
6589 let parsedSelector = selectorParser().astSync(selector);
6590
6591 return `(${traverseNode(parsedSelector).toString()})`;
6592 })
6593 .join(" to ");
6594 }
6595 });
6596
[d565449]6597 // If we found any :locals, insert an :export rule
6598 const exportedNames = Object.keys(exports);
6599
6600 if (exportedNames.length > 0) {
6601 const exportRule = rule({ selector: ":export" });
6602
6603 exportedNames.forEach((exportedName) =>
6604 exportRule.append({
6605 prop: exportedName,
6606 value: exports[exportedName].join(" "),
6607 raws: { before: "\n " },
6608 })
6609 );
6610
6611 root.append(exportRule);
6612 }
6613 },
6614 };
6615};
6616
6617plugin.postcss = true;
6618
6619plugin.generateScopedName = function (name, path) {
6620 const sanitisedPath = path
6621 .replace(/\.[^./\\]+$/, "")
6622 .replace(/[\W_]+/g, "_")
6623 .replace(/^_|_$/g, "");
6624
6625 return `_${sanitisedPath}__${name}`.trim();
6626};
6627
6628plugin.generateExportEntry = function (name, scopedName) {
6629 return {
6630 key: unescape(name),
6631 value: unescape(scopedName),
6632 };
6633};
6634
6635var src$1 = plugin;
6636
6637function hash(str) {
6638 var hash = 5381,
6639 i = str.length;
6640
6641 while(i) {
6642 hash = (hash * 33) ^ str.charCodeAt(--i);
6643 }
6644
6645 /* JavaScript does bitwise operations (like XOR, above) on 32-bit signed
6646 * integers. Since we want the results to be always positive, convert the
6647 * signed int to an unsigned by doing an unsigned bitshift. */
6648 return hash >>> 0;
6649}
6650
6651var stringHash = hash;
6652
6653var src = {exports: {}};
6654
6655const ICSSUtils = src$4;
6656
6657const matchImports = /^(.+?|\([\s\S]+?\))\s+from\s+("[^"]*"|'[^']*'|[\w-]+)$/;
6658const matchValueDefinition = /(?:\s+|^)([\w-]+):?(.*?)$/;
6659const matchImport = /^([\w-]+)(?:\s+as\s+([\w-]+))?/;
6660
6661src.exports = (options) => {
6662 let importIndex = 0;
6663 const createImportedName =
6664 (options && options.createImportedName) ||
6665 ((importName /*, path*/) =>
6666 `i__const_${importName.replace(/\W/g, "_")}_${importIndex++}`);
6667
6668 return {
6669 postcssPlugin: "postcss-modules-values",
6670 prepare(result) {
6671 const importAliases = [];
6672 const definitions = {};
6673
6674 return {
6675 Once(root, postcss) {
6676 root.walkAtRules(/value/i, (atRule) => {
6677 const matches = atRule.params.match(matchImports);
6678
6679 if (matches) {
6680 let [, /*match*/ aliases, path] = matches;
6681
6682 // We can use constants for path names
6683 if (definitions[path]) {
6684 path = definitions[path];
6685 }
6686
6687 const imports = aliases
6688 .replace(/^\(\s*([\s\S]+)\s*\)$/, "$1")
6689 .split(/\s*,\s*/)
6690 .map((alias) => {
6691 const tokens = matchImport.exec(alias);
6692
6693 if (tokens) {
6694 const [, /*match*/ theirName, myName = theirName] = tokens;
6695 const importedName = createImportedName(myName);
6696 definitions[myName] = importedName;
6697 return { theirName, importedName };
6698 } else {
6699 throw new Error(`@import statement "${alias}" is invalid!`);
6700 }
6701 });
6702
6703 importAliases.push({ path, imports });
6704
6705 atRule.remove();
6706
6707 return;
6708 }
6709
6710 if (atRule.params.indexOf("@value") !== -1) {
6711 result.warn("Invalid value definition: " + atRule.params);
6712 }
6713
6714 let [, key, value] = `${atRule.params}${atRule.raws.between}`.match(
6715 matchValueDefinition
6716 );
6717
6718 const normalizedValue = value.replace(/\/\*((?!\*\/).*?)\*\//g, "");
6719
6720 if (normalizedValue.length === 0) {
6721 result.warn("Invalid value definition: " + atRule.params);
6722 atRule.remove();
6723
6724 return;
6725 }
6726
6727 let isOnlySpace = /^\s+$/.test(normalizedValue);
6728
6729 if (!isOnlySpace) {
6730 value = value.trim();
6731 }
6732
6733 // Add to the definitions, knowing that values can refer to each other
6734 definitions[key] = ICSSUtils.replaceValueSymbols(
6735 value,
6736 definitions
6737 );
6738
6739 atRule.remove();
6740 });
6741
6742 /* If we have no definitions, don't continue */
6743 if (!Object.keys(definitions).length) {
6744 return;
6745 }
6746
6747 /* Perform replacements */
6748 ICSSUtils.replaceSymbols(root, definitions);
6749
6750 /* We want to export anything defined by now, but don't add it to the CSS yet or it well get picked up by the replacement stuff */
6751 const exportDeclarations = Object.keys(definitions).map((key) =>
6752 postcss.decl({
6753 value: definitions[key],
6754 prop: key,
6755 raws: { before: "\n " },
6756 })
6757 );
6758
6759 /* Add export rules if any */
6760 if (exportDeclarations.length > 0) {
6761 const exportRule = postcss.rule({
6762 selector: ":export",
6763 raws: { after: "\n" },
6764 });
6765
6766 exportRule.append(exportDeclarations);
6767
6768 root.prepend(exportRule);
6769 }
6770
6771 /* Add import rules */
6772 importAliases.reverse().forEach(({ path, imports }) => {
6773 const importRule = postcss.rule({
6774 selector: `:import(${path})`,
6775 raws: { after: "\n" },
6776 });
6777
6778 imports.forEach(({ theirName, importedName }) => {
6779 importRule.append({
6780 value: theirName,
6781 prop: importedName,
6782 raws: { before: "\n " },
6783 });
6784 });
6785
6786 root.prepend(importRule);
6787 });
6788 },
6789 };
6790 },
6791 };
6792};
6793
6794src.exports.postcss = true;
6795
6796var srcExports = src.exports;
6797
6798Object.defineProperty(scoping, "__esModule", {
6799 value: true
6800});
6801scoping.behaviours = void 0;
6802scoping.getDefaultPlugins = getDefaultPlugins;
6803scoping.getDefaultScopeBehaviour = getDefaultScopeBehaviour;
6804scoping.getScopedNameGenerator = getScopedNameGenerator;
6805
6806var _postcssModulesExtractImports = _interopRequireDefault$1(srcExports$2);
6807
6808var _genericNames = _interopRequireDefault$1(genericNames);
6809
6810var _postcssModulesLocalByDefault = _interopRequireDefault$1(srcExports$1);
6811
6812var _postcssModulesScope = _interopRequireDefault$1(src$1);
6813
6814var _stringHash = _interopRequireDefault$1(stringHash);
6815
6816var _postcssModulesValues = _interopRequireDefault$1(srcExports);
6817
6818function _interopRequireDefault$1(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6819
6820const behaviours = {
6821 LOCAL: "local",
6822 GLOBAL: "global"
6823};
6824scoping.behaviours = behaviours;
6825
6826function getDefaultPlugins({
6827 behaviour,
6828 generateScopedName,
6829 exportGlobals
6830}) {
6831 const scope = (0, _postcssModulesScope.default)({
6832 generateScopedName,
6833 exportGlobals
6834 });
6835 const plugins = {
6836 [behaviours.LOCAL]: [_postcssModulesValues.default, (0, _postcssModulesLocalByDefault.default)({
6837 mode: "local"
6838 }), _postcssModulesExtractImports.default, scope],
6839 [behaviours.GLOBAL]: [_postcssModulesValues.default, (0, _postcssModulesLocalByDefault.default)({
6840 mode: "global"
6841 }), _postcssModulesExtractImports.default, scope]
6842 };
6843 return plugins[behaviour];
6844}
6845
6846function isValidBehaviour(behaviour) {
6847 return Object.keys(behaviours).map(key => behaviours[key]).indexOf(behaviour) > -1;
6848}
6849
6850function getDefaultScopeBehaviour(scopeBehaviour) {
6851 return scopeBehaviour && isValidBehaviour(scopeBehaviour) ? scopeBehaviour : behaviours.LOCAL;
6852}
6853
6854function generateScopedNameDefault(name, filename, css) {
6855 const i = css.indexOf(`.${name}`);
6856 const lineNumber = css.substr(0, i).split(/[\r\n]/).length;
6857 const hash = (0, _stringHash.default)(css).toString(36).substr(0, 5);
6858 return `_${name}_${hash}_${lineNumber}`;
6859}
6860
6861function getScopedNameGenerator(generateScopedName, hashPrefix) {
6862 const scopedNameGenerator = generateScopedName || generateScopedNameDefault;
6863
6864 if (typeof scopedNameGenerator === "function") {
6865 return scopedNameGenerator;
6866 }
6867
6868 return (0, _genericNames.default)(scopedNameGenerator, {
6869 context: process.cwd(),
6870 hashPrefix: hashPrefix
6871 });
6872}
6873
6874Object.defineProperty(pluginFactory, "__esModule", {
6875 value: true
6876});
6877pluginFactory.makePlugin = makePlugin;
6878
6879var _postcss = _interopRequireDefault(require$$0);
6880
6881var _unquote = _interopRequireDefault(unquote$1);
6882
6883var _Parser = _interopRequireDefault(Parser$1);
6884
6885var _saveJSON = _interopRequireDefault(saveJSON$1);
6886
6887var _localsConvention = localsConvention;
6888
6889var _FileSystemLoader = _interopRequireDefault(FileSystemLoader$1);
6890
6891var _scoping = scoping;
6892
6893function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6894
6895const PLUGIN_NAME = "postcss-modules";
6896
6897function isGlobalModule(globalModules, inputFile) {
6898 return globalModules.some(regex => inputFile.match(regex));
6899}
6900
6901function getDefaultPluginsList(opts, inputFile) {
6902 const globalModulesList = opts.globalModulePaths || null;
6903 const exportGlobals = opts.exportGlobals || false;
6904 const defaultBehaviour = (0, _scoping.getDefaultScopeBehaviour)(opts.scopeBehaviour);
6905 const generateScopedName = (0, _scoping.getScopedNameGenerator)(opts.generateScopedName, opts.hashPrefix);
6906
6907 if (globalModulesList && isGlobalModule(globalModulesList, inputFile)) {
6908 return (0, _scoping.getDefaultPlugins)({
6909 behaviour: _scoping.behaviours.GLOBAL,
6910 generateScopedName,
6911 exportGlobals
6912 });
6913 }
6914
6915 return (0, _scoping.getDefaultPlugins)({
6916 behaviour: defaultBehaviour,
6917 generateScopedName,
6918 exportGlobals
6919 });
6920}
6921
6922function getLoader(opts, plugins) {
6923 const root = typeof opts.root === "undefined" ? "/" : opts.root;
6924 return typeof opts.Loader === "function" ? new opts.Loader(root, plugins, opts.resolve) : new _FileSystemLoader.default(root, plugins, opts.resolve);
6925}
6926
6927function isOurPlugin(plugin) {
6928 return plugin.postcssPlugin === PLUGIN_NAME;
6929}
6930
6931function makePlugin(opts) {
6932 return {
6933 postcssPlugin: PLUGIN_NAME,
6934
6935 async OnceExit(css, {
6936 result
6937 }) {
6938 const getJSON = opts.getJSON || _saveJSON.default;
6939 const inputFile = css.source.input.file;
6940 const pluginList = getDefaultPluginsList(opts, inputFile);
6941 const resultPluginIndex = result.processor.plugins.findIndex(plugin => isOurPlugin(plugin));
6942
6943 if (resultPluginIndex === -1) {
6944 throw new Error("Plugin missing from options.");
6945 }
6946
6947 const earlierPlugins = result.processor.plugins.slice(0, resultPluginIndex);
6948 const loaderPlugins = [...earlierPlugins, ...pluginList];
6949 const loader = getLoader(opts, loaderPlugins);
6950
6951 const fetcher = async (file, relativeTo, depTrace) => {
6952 const unquoteFile = (0, _unquote.default)(file);
6953 return loader.fetch.call(loader, unquoteFile, relativeTo, depTrace);
6954 };
6955
6956 const parser = new _Parser.default(fetcher);
6957 await (0, _postcss.default)([...pluginList, parser.plugin()]).process(css, {
6958 from: inputFile
6959 });
6960 const out = loader.finalSource;
6961 if (out) css.prepend(out);
6962
6963 if (opts.localsConvention) {
6964 const reducer = (0, _localsConvention.makeLocalsConventionReducer)(opts.localsConvention, inputFile);
6965 parser.exportTokens = Object.entries(parser.exportTokens).reduce(reducer, {});
6966 }
6967
6968 result.messages.push({
6969 type: "export",
6970 plugin: "postcss-modules",
6971 exportTokens: parser.exportTokens
6972 }); // getJSON may return a promise
6973
6974 return getJSON(css.source.input.file, parser.exportTokens, result.opts.to);
6975 }
6976
6977 };
6978}
6979
6980var _fs = require$$0__default;
6981
6982var _fs2 = fs;
6983
6984var _pluginFactory = pluginFactory;
6985
6986(0, _fs2.setFileSystem)({
6987 readFile: _fs.readFile,
6988 writeFile: _fs.writeFile
6989});
6990
6991build.exports = (opts = {}) => (0, _pluginFactory.makePlugin)(opts);
6992
6993var postcss = build.exports.postcss = true;
6994
6995var buildExports = build.exports;
6996var index = /*@__PURE__*/getDefaultExportFromCjs(buildExports);
6997
6998var index$1 = /*#__PURE__*/_mergeNamespaces({
6999 __proto__: null,
7000 default: index,
7001 postcss: postcss
7002}, [buildExports]);
7003
7004export { index$1 as i };
Note: See TracBrowser for help on using the repository browser.