+Blazing fast and accurate glob matcher written in JavaScript.
+No dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions.
+
+
+
+
+
+## Why picomatch?
+
+* **Lightweight** - No dependencies
+* **Minimal** - Tiny API surface. Main export is a function that takes a glob pattern and returns a matcher function.
+* **Fast** - Loads in about 2ms (that's several times faster than a [single frame of a HD movie](http://www.endmemo.com/sconvert/framespersecondframespermillisecond.php) at 60fps)
+* **Performant** - Use the returned matcher function to speed up repeat matching (like when watching files)
+* **Accurate matching** - Using wildcards (`*` and `?`), globstars (`**`) for nested directories, [advanced globbing](#advanced-globbing) with extglobs, braces, and POSIX brackets, and support for escaping special characters with `\` or quotes.
+* **Well tested** - Thousands of unit tests
+
+See the [library comparison](#library-comparisons) to other libraries.
+
+
+
+
+## Table of Contents
+
+ Click to expand
+
+- [Install](#install)
+- [Usage](#usage)
+- [API](#api)
+ * [picomatch](#picomatch)
+ * [.test](#test)
+ * [.matchBase](#matchbase)
+ * [.isMatch](#ismatch)
+ * [.parse](#parse)
+ * [.scan](#scan)
+ * [.compileRe](#compilere)
+ * [.makeRe](#makere)
+ * [.toRegex](#toregex)
+- [Options](#options)
+ * [Picomatch options](#picomatch-options)
+ * [Scan Options](#scan-options)
+ * [Options Examples](#options-examples)
+- [Globbing features](#globbing-features)
+ * [Basic globbing](#basic-globbing)
+ * [Advanced globbing](#advanced-globbing)
+ * [Braces](#braces)
+ * [Matching special characters as literals](#matching-special-characters-as-literals)
+- [Library Comparisons](#library-comparisons)
+- [Benchmarks](#benchmarks)
+- [Philosophies](#philosophies)
+- [About](#about)
+ * [Author](#author)
+ * [License](#license)
+
+_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_
+
+
+
+
+
+
+## Install
+
+Install with [npm](https://www.npmjs.com/):
+
+```sh
+npm install --save picomatch
+```
+
+
+
+## Usage
+
+The main export is a function that takes a glob pattern and an options object and returns a function for matching strings.
+
+```js
+const pm = require('picomatch');
+const isMatch = pm('*.js');
+
+console.log(isMatch('abcd')); //=> false
+console.log(isMatch('a.js')); //=> true
+console.log(isMatch('a.md')); //=> false
+console.log(isMatch('a/b.js')); //=> false
+```
+
+
+
+## API
+
+### [picomatch](lib/picomatch.js#L31)
+
+Creates a matcher function from one or more glob patterns. The returned function takes a string to match as its first argument, and returns true if the string is a match. The returned matcher function also takes a boolean as the second argument that, when true, returns an object with additional information.
+
+**Params**
+
+* `globs` **{String|Array}**: One or more glob patterns.
+* `options` **{Object=}**
+* `returns` **{Function=}**: Returns a matcher function.
+
+**Example**
+
+```js
+const picomatch = require('picomatch');
+// picomatch(glob[, options]);
+
+const isMatch = picomatch('*.!(*a)');
+console.log(isMatch('a.a')); //=> false
+console.log(isMatch('a.b')); //=> true
+```
+
+**Example without node.js**
+
+For environments without `node.js`, `picomatch/posix` provides you a dependency-free matcher, without automatic OS detection.
+
+```js
+const picomatch = require('picomatch/posix');
+// the same API, defaulting to posix paths
+const isMatch = picomatch('a/*');
+console.log(isMatch('a\\b')); //=> false
+console.log(isMatch('a/b')); //=> true
+
+// you can still configure the matcher function to accept windows paths
+const isMatch = picomatch('a/*', { options: windows });
+console.log(isMatch('a\\b')); //=> true
+console.log(isMatch('a/b')); //=> true
+```
+
+### [.test](lib/picomatch.js#L116)
+
+Test `input` with the given `regex`. This is used by the main `picomatch()` function to test the input string.
+
+**Params**
+
+* `input` **{String}**: String to test.
+* `regex` **{RegExp}**
+* `returns` **{Object}**: Returns an object with matching info.
+
+**Example**
+
+```js
+const picomatch = require('picomatch');
+// picomatch.test(input, regex[, options]);
+
+console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
+// { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
+```
+
+### [.matchBase](lib/picomatch.js#L160)
+
+Match the basename of a filepath.
+
+**Params**
+
+* `input` **{String}**: String to test.
+* `glob` **{RegExp|String}**: Glob pattern or regex created by [.makeRe](#makeRe).
+* `returns` **{Boolean}**
+
+**Example**
+
+```js
+const picomatch = require('picomatch');
+// picomatch.matchBase(input, glob[, options]);
+console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
+```
+
+### [.isMatch](lib/picomatch.js#L182)
+
+Returns true if **any** of the given glob `patterns` match the specified `string`.
+
+**Params**
+
+* **{String|Array}**: str The string to test.
+* **{String|Array}**: patterns One or more glob patterns to use for matching.
+* **{Object}**: See available [options](#options).
+* `returns` **{Boolean}**: Returns true if any patterns match `str`
+
+**Example**
+
+```js
+const picomatch = require('picomatch');
+// picomatch.isMatch(string, patterns[, options]);
+
+console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
+console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
+```
+
+### [.parse](lib/picomatch.js#L198)
+
+Parse a glob pattern to create the source string for a regular expression.
+
+**Params**
+
+* `pattern` **{String}**
+* `options` **{Object}**
+* `returns` **{Object}**: Returns an object with useful properties and output to be used as a regex source string.
+
+**Example**
+
+```js
+const picomatch = require('picomatch');
+const result = picomatch.parse(pattern[, options]);
+```
+
+### [.scan](lib/picomatch.js#L230)
+
+Scan a glob pattern to separate the pattern into segments.
+
+**Params**
+
+* `input` **{String}**: Glob pattern to scan.
+* `options` **{Object}**
+* `returns` **{Object}**: Returns an object with
+
+**Example**
+
+```js
+const picomatch = require('picomatch');
+// picomatch.scan(input[, options]);
+
+const result = picomatch.scan('!./foo/*.js');
+console.log(result);
+{ prefix: '!./',
+ input: '!./foo/*.js',
+ start: 3,
+ base: 'foo',
+ glob: '*.js',
+ isBrace: false,
+ isBracket: false,
+ isGlob: true,
+ isExtglob: false,
+ isGlobstar: false,
+ negated: true }
+```
+
+### [.compileRe](lib/picomatch.js#L244)
+
+Compile a regular expression from the `state` object returned by the
+[parse()](#parse) method.
+
+**Params**
+
+* `state` **{Object}**
+* `options` **{Object}**
+* `returnOutput` **{Boolean}**: Intended for implementors, this argument allows you to return the raw output from the parser.
+* `returnState` **{Boolean}**: Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.
+* `returns` **{RegExp}**
+
+### [.makeRe](lib/picomatch.js#L285)
+
+Create a regular expression from a parsed glob pattern.
+
+**Params**
+
+* `state` **{String}**: The object returned from the `.parse` method.
+* `options` **{Object}**
+* `returnOutput` **{Boolean}**: Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.
+* `returnState` **{Boolean}**: Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
+* `returns` **{RegExp}**: Returns a regex created from the given pattern.
+
+**Example**
+
+```js
+const picomatch = require('picomatch');
+const state = picomatch.parse('*.js');
+// picomatch.compileRe(state[, options]);
+
+console.log(picomatch.compileRe(state));
+//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
+```
+
+### [.toRegex](lib/picomatch.js#L320)
+
+Create a regular expression from the given regex source string.
+
+**Params**
+
+* `source` **{String}**: Regular expression source string.
+* `options` **{Object}**
+* `returns` **{RegExp}**
+
+**Example**
+
+```js
+const picomatch = require('picomatch');
+// picomatch.toRegex(source[, options]);
+
+const { output } = picomatch.parse('*.js');
+console.log(picomatch.toRegex(output));
+//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
+```
+
+
+
+## Options
+
+### Picomatch options
+
+The following options may be used with the main `picomatch()` function or any of the methods on the picomatch API.
+
+| **Option** | **Type** | **Default value** | **Description** |
+| --- | --- | --- | --- |
+| `basename` | `boolean` | `false` | If set, then patterns without slashes will be matched against the basename of the path if it contains slashes. For example, `a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. |
+| `bash` | `boolean` | `false` | Follow bash matching rules more strictly - disallows backslashes as escape characters, and treats single stars as globstars (`**`). |
+| `capture` | `boolean` | `undefined` | Return regex matches in supporting methods. |
+| `contains` | `boolean` | `undefined` | Allows glob to match any part of the given string(s). |
+| `cwd` | `string` | `process.cwd()` | Current working directory. Used by `picomatch.split()` |
+| `debug` | `boolean` | `undefined` | Debug regular expressions when an error is thrown. |
+| `dot` | `boolean` | `false` | Enable dotfile matching. By default, dotfiles are ignored unless a `.` is explicitly defined in the pattern, or `options.dot` is true |
+| `expandRange` | `function` | `undefined` | Custom function for expanding ranges in brace patterns, such as `{a..z}`. The function receives the range values as two arguments, and it must return a string to be used in the generated regex. It's recommended that returned strings be wrapped in parentheses. |
+| `failglob` | `boolean` | `false` | Throws an error if no matches are found. Based on the bash option of the same name. |
+| `fastpaths` | `boolean` | `true` | To speed up processing, full parsing is skipped for a handful common glob patterns. Disable this behavior by setting this option to `false`. |
+| `flags` | `string` | `undefined` | Regex flags to use in the generated regex. If defined, the `nocase` option will be overridden. |
+| [format](#optionsformat) | `function` | `undefined` | Custom function for formatting the returned string. This is useful for removing leading slashes, converting Windows paths to Posix paths, etc. |
+| `ignore` | `array\|string` | `undefined` | One or more glob patterns for excluding strings that should not be matched from the result. |
+| `keepQuotes` | `boolean` | `false` | Retain quotes in the generated regex, since quotes may also be used as an alternative to backslashes. |
+| `literalBrackets` | `boolean` | `undefined` | When `true`, brackets in the glob pattern will be escaped so that only literal brackets will be matched. |
+| `matchBase` | `boolean` | `false` | Alias for `basename` |
+| `maxLength` | `boolean` | `65536` | Limit the max length of the input string. An error is thrown if the input string is longer than this value. |
+| `nobrace` | `boolean` | `false` | Disable brace matching, so that `{a,b}` and `{1..3}` would be treated as literal characters. |
+| `nobracket` | `boolean` | `undefined` | Disable matching with regex brackets. |
+| `nocase` | `boolean` | `false` | Make matching case-insensitive. Equivalent to the regex `i` flag. Note that this option is overridden by the `flags` option. |
+| `nodupes` | `boolean` | `true` | Deprecated, use `nounique` instead. This option will be removed in a future major release. By default duplicates are removed. Disable uniquification by setting this option to false. |
+| `noext` | `boolean` | `false` | Alias for `noextglob` |
+| `noextglob` | `boolean` | `false` | Disable support for matching with extglobs (like `+(a\|b)`) |
+| `noglobstar` | `boolean` | `false` | Disable support for matching nested directories with globstars (`**`) |
+| `nonegate` | `boolean` | `false` | Disable support for negating with leading `!` |
+| `noquantifiers` | `boolean` | `false` | Disable support for regex quantifiers (like `a{1,2}`) and treat them as brace patterns to be expanded. |
+| [onIgnore](#optionsonIgnore) | `function` | `undefined` | Function to be called on ignored items. |
+| [onMatch](#optionsonMatch) | `function` | `undefined` | Function to be called on matched items. |
+| [onResult](#optionsonResult) | `function` | `undefined` | Function to be called on all items, regardless of whether or not they are matched or ignored. |
+| `posix` | `boolean` | `false` | Support POSIX character classes ("posix brackets"). |
+| `posixSlashes` | `boolean` | `undefined` | Convert all slashes in file paths to forward slashes. This does not convert slashes in the glob pattern itself |
+| `prepend` | `boolean` | `undefined` | String to prepend to the generated regex used for matching. |
+| `regex` | `boolean` | `false` | Use regular expression rules for `+` (instead of matching literal `+`), and for stars that follow closing parentheses or brackets (as in `)*` and `]*`). |
+| `strictBrackets` | `boolean` | `undefined` | Throw an error if brackets, braces, or parens are imbalanced. |
+| `strictSlashes` | `boolean` | `undefined` | When true, picomatch won't match trailing slashes with single stars. |
+| `unescape` | `boolean` | `undefined` | Remove backslashes preceding escaped characters in the glob pattern. By default, backslashes are retained. |
+| `unixify` | `boolean` | `undefined` | Alias for `posixSlashes`, for backwards compatibility. |
+| `windows` | `boolean` | `false` | Also accept backslashes as the path separator. |
+
+### Scan Options
+
+In addition to the main [picomatch options](#picomatch-options), the following options may also be used with the [.scan](#scan) method.
+
+| **Option** | **Type** | **Default value** | **Description** |
+| --- | --- | --- | --- |
+| `tokens` | `boolean` | `false` | When `true`, the returned object will include an array of tokens (objects), representing each path "segment" in the scanned glob pattern |
+| `parts` | `boolean` | `false` | When `true`, the returned object will include an array of strings representing each path "segment" in the scanned glob pattern. This is automatically enabled when `options.tokens` is true |
+
+**Example**
+
+```js
+const picomatch = require('picomatch');
+const result = picomatch.scan('!./foo/*.js', { tokens: true });
+console.log(result);
+// {
+// prefix: '!./',
+// input: '!./foo/*.js',
+// start: 3,
+// base: 'foo',
+// glob: '*.js',
+// isBrace: false,
+// isBracket: false,
+// isGlob: true,
+// isExtglob: false,
+// isGlobstar: false,
+// negated: true,
+// maxDepth: 2,
+// tokens: [
+// { value: '!./', depth: 0, isGlob: false, negated: true, isPrefix: true },
+// { value: 'foo', depth: 1, isGlob: false },
+// { value: '*.js', depth: 1, isGlob: true }
+// ],
+// slashes: [ 2, 6 ],
+// parts: [ 'foo', '*.js' ]
+// }
+```
+
+
+
+### Options Examples
+
+#### options.expandRange
+
+**Type**: `function`
+
+**Default**: `undefined`
+
+Custom function for expanding ranges in brace patterns. The [fill-range](https://github.com/jonschlinkert/fill-range) library is ideal for this purpose, or you can use custom code to do whatever you need.
+
+**Example**
+
+The following example shows how to create a glob that matches a folder
+
+```js
+const fill = require('fill-range');
+const regex = pm.makeRe('foo/{01..25}/bar', {
+ expandRange(a, b) {
+ return `(${fill(a, b, { toRegex: true })})`;
+ }
+});
+
+console.log(regex);
+//=> /^(?:foo\/((?:0[1-9]|1[0-9]|2[0-5]))\/bar)$/
+
+console.log(regex.test('foo/00/bar')) // false
+console.log(regex.test('foo/01/bar')) // true
+console.log(regex.test('foo/10/bar')) // true
+console.log(regex.test('foo/22/bar')) // true
+console.log(regex.test('foo/25/bar')) // true
+console.log(regex.test('foo/26/bar')) // false
+```
+
+#### options.format
+
+**Type**: `function`
+
+**Default**: `undefined`
+
+Custom function for formatting strings before they're matched.
+
+**Example**
+
+```js
+// strip leading './' from strings
+const format = str => str.replace(/^\.\//, '');
+const isMatch = picomatch('foo/*.js', { format });
+console.log(isMatch('./foo/bar.js')); //=> true
+```
+
+#### options.onMatch
+
+```js
+const onMatch = ({ glob, regex, input, output }) => {
+ console.log({ glob, regex, input, output });
+};
+
+const isMatch = picomatch('*', { onMatch });
+isMatch('foo');
+isMatch('bar');
+isMatch('baz');
+```
+
+#### options.onIgnore
+
+```js
+const onIgnore = ({ glob, regex, input, output }) => {
+ console.log({ glob, regex, input, output });
+};
+
+const isMatch = picomatch('*', { onIgnore, ignore: 'f*' });
+isMatch('foo');
+isMatch('bar');
+isMatch('baz');
+```
+
+#### options.onResult
+
+```js
+const onResult = ({ glob, regex, input, output }) => {
+ console.log({ glob, regex, input, output });
+};
+
+const isMatch = picomatch('*', { onResult, ignore: 'f*' });
+isMatch('foo');
+isMatch('bar');
+isMatch('baz');
+```
+
+
+
+
+## Globbing features
+
+* [Basic globbing](#basic-globbing) (Wildcard matching)
+* [Advanced globbing](#advanced-globbing) (extglobs, posix brackets, brace matching)
+
+### Basic globbing
+
+| **Character** | **Description** |
+| --- | --- |
+| `*` | Matches any character zero or more times, excluding path separators. Does _not match_ path separators or hidden files or directories ("dotfiles"), unless explicitly enabled by setting the `dot` option to `true`. |
+| `**` | Matches any character zero or more times, including path separators. Note that `**` will only match path separators (`/`, and `\\` with the `windows` option) when they are the only characters in a path segment. Thus, `foo**/bar` is equivalent to `foo*/bar`, and `foo/a**b/bar` is equivalent to `foo/a*b/bar`, and _more than two_ consecutive stars in a glob path segment are regarded as _a single star_. Thus, `foo/***/bar` is equivalent to `foo/*/bar`. |
+| `?` | Matches any character excluding path separators one time. Does _not match_ path separators or leading dots. |
+| `[abc]` | Matches any characters inside the brackets. For example, `[abc]` would match the characters `a`, `b` or `c`, and nothing else. |
+
+#### Matching behavior vs. Bash
+
+Picomatch's matching features and expected results in unit tests are based on Bash's unit tests and the Bash 4.3 specification, with the following exceptions:
+
+* Bash will match `foo/bar/baz` with `*`. Picomatch only matches nested directories with `**`.
+* Bash greedily matches with negated extglobs. For example, Bash 4.3 says that `!(foo)*` should match `foo` and `foobar`, since the trailing `*` bracktracks to match the preceding pattern. This is very memory-inefficient, and IMHO, also incorrect. Picomatch would return `false` for both `foo` and `foobar`.
+
+
+
+### Advanced globbing
+
+* [extglobs](#extglobs)
+* [POSIX brackets](#posix-brackets)
+* [Braces](#brace-expansion)
+
+#### Extglobs
+
+| **Pattern** | **Description** |
+| --- | --- |
+| `@(pattern)` | Match _only one_ consecutive occurrence of `pattern` |
+| `*(pattern)` | Match _zero or more_ consecutive occurrences of `pattern` |
+| `+(pattern)` | Match _one or more_ consecutive occurrences of `pattern` |
+| `?(pattern)` | Match _zero or **one**_ consecutive occurrences of `pattern` |
+| `!(pattern)` | Match _anything but_ `pattern` |
+
+**Examples**
+
+```js
+const pm = require('picomatch');
+
+// *(pattern) matches ZERO or more of "pattern"
+console.log(pm.isMatch('a', 'a*(z)')); // true
+console.log(pm.isMatch('az', 'a*(z)')); // true
+console.log(pm.isMatch('azzz', 'a*(z)')); // true
+
+// +(pattern) matches ONE or more of "pattern"
+console.log(pm.isMatch('a', 'a+(z)')); // false
+console.log(pm.isMatch('az', 'a+(z)')); // true
+console.log(pm.isMatch('azzz', 'a+(z)')); // true
+
+// supports multiple extglobs
+console.log(pm.isMatch('foo.bar', '!(foo).!(bar)')); // false
+
+// supports nested extglobs
+console.log(pm.isMatch('foo.bar', '!(!(foo)).!(!(bar))')); // true
+```
+
+#### POSIX brackets
+
+POSIX classes are disabled by default. Enable this feature by setting the `posix` option to true.
+
+**Enable POSIX bracket support**
+
+```js
+console.log(pm.makeRe('[[:word:]]+', { posix: true }));
+//=> /^(?:(?=.)[A-Za-z0-9_]+\/?)$/
+```
+
+**Supported POSIX classes**
+
+The following named POSIX bracket expressions are supported:
+
+* `[:alnum:]` - Alphanumeric characters, equ `[a-zA-Z0-9]`
+* `[:alpha:]` - Alphabetical characters, equivalent to `[a-zA-Z]`.
+* `[:ascii:]` - ASCII characters, equivalent to `[\\x00-\\x7F]`.
+* `[:blank:]` - Space and tab characters, equivalent to `[ \\t]`.
+* `[:cntrl:]` - Control characters, equivalent to `[\\x00-\\x1F\\x7F]`.
+* `[:digit:]` - Numerical digits, equivalent to `[0-9]`.
+* `[:graph:]` - Graph characters, equivalent to `[\\x21-\\x7E]`.
+* `[:lower:]` - Lowercase letters, equivalent to `[a-z]`.
+* `[:print:]` - Print characters, equivalent to `[\\x20-\\x7E ]`.
+* `[:punct:]` - Punctuation and symbols, equivalent to `[\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~]`.
+* `[:space:]` - Extended space characters, equivalent to `[ \\t\\r\\n\\v\\f]`.
+* `[:upper:]` - Uppercase letters, equivalent to `[A-Z]`.
+* `[:word:]` - Word characters (letters, numbers and underscores), equivalent to `[A-Za-z0-9_]`.
+* `[:xdigit:]` - Hexadecimal digits, equivalent to `[A-Fa-f0-9]`.
+
+See the [Bash Reference Manual](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html) for more information.
+
+### Braces
+
+Picomatch does not do brace expansion. For [brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html) and advanced matching with braces, use [micromatch](https://github.com/micromatch/micromatch) instead. Picomatch has very basic support for braces.
+
+### Matching special characters as literals
+
+If you wish to match the following special characters in a filepath, and you want to use these characters in your glob pattern, they must be escaped with backslashes or quotes:
+
+**Special Characters**
+
+Some characters that are used for matching in regular expressions are also regarded as valid file path characters on some platforms.
+
+To match any of the following characters as literals: `$^*+?()[]
+
+Examples:
+
+```js
+console.log(pm.makeRe('foo/bar \\(1\\)'));
+console.log(pm.makeRe('foo/bar \\(1\\)'));
+```
+
+
+
+
+## Library Comparisons
+
+The following table shows which features are supported by [minimatch](https://github.com/isaacs/minimatch), [micromatch](https://github.com/micromatch/micromatch), [picomatch](https://github.com/micromatch/picomatch), [nanomatch](https://github.com/micromatch/nanomatch), [extglob](https://github.com/micromatch/extglob), [braces](https://github.com/micromatch/braces), and [expand-brackets](https://github.com/micromatch/expand-brackets).
+
+| **Feature** | `minimatch` | `micromatch` | `picomatch` | `nanomatch` | `extglob` | `braces` | `expand-brackets` |
+| --- | --- | --- | --- | --- | --- | --- | --- |
+| Wildcard matching (`*?+`) | โ | โ | โ | โ | - | - | - |
+| Advancing globbing | โ | โ | โ | - | - | - | - |
+| Brace _matching_ | โ | โ | โ | - | - | โ | - |
+| Brace _expansion_ | โ | โ | - | - | - | โ | - |
+| Extglobs | partial | โ | โ | - | โ | - | - |
+| Posix brackets | - | โ | โ | - | - | - | โ |
+| Regular expression syntax | - | โ | โ | โ | โ | - | โ |
+| File system operations | - | - | - | - | - | - | - |
+
+
+
+
+## Benchmarks
+
+Performance comparison of picomatch and minimatch.
+
+_(Pay special attention to the last three benchmarks. Minimatch freezes on long ranges.)_
+
+```
+# .makeRe star (*)
+ picomatch x 4,449,159 ops/sec ยฑ0.24% (97 runs sampled)
+ minimatch x 632,772 ops/sec ยฑ0.14% (98 runs sampled)
+
+# .makeRe star; dot=true (*)
+ picomatch x 3,500,079 ops/sec ยฑ0.26% (99 runs sampled)
+ minimatch x 564,916 ops/sec ยฑ0.23% (96 runs sampled)
+
+# .makeRe globstar (**)
+ picomatch x 3,261,000 ops/sec ยฑ0.27% (98 runs sampled)
+ minimatch x 1,664,766 ops/sec ยฑ0.20% (100 runs sampled)
+
+# .makeRe globstars (**/**/**)
+ picomatch x 3,284,469 ops/sec ยฑ0.18% (97 runs sampled)
+ minimatch x 1,435,880 ops/sec ยฑ0.34% (95 runs sampled)
+
+# .makeRe with leading star (*.txt)
+ picomatch x 3,100,197 ops/sec ยฑ0.35% (99 runs sampled)
+ minimatch x 428,347 ops/sec ยฑ0.42% (94 runs sampled)
+
+# .makeRe - basic braces ({a,b,c}*.txt)
+ picomatch x 443,578 ops/sec ยฑ1.33% (89 runs sampled)
+ minimatch x 107,143 ops/sec ยฑ0.35% (94 runs sampled)
+
+# .makeRe - short ranges ({a..z}*.txt)
+ picomatch x 415,484 ops/sec ยฑ0.76% (96 runs sampled)
+ minimatch x 14,299 ops/sec ยฑ0.26% (96 runs sampled)
+
+# .makeRe - medium ranges ({1..100000}*.txt)
+ picomatch x 395,020 ops/sec ยฑ0.87% (89 runs sampled)
+ minimatch x 2 ops/sec ยฑ4.59% (10 runs sampled)
+
+# .makeRe - long ranges ({1..10000000}*.txt)
+ picomatch x 400,036 ops/sec ยฑ0.83% (90 runs sampled)
+ minimatch (FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory)
+```
+
+
+
+
+## Philosophies
+
+The goal of this library is to be blazing fast, without compromising on accuracy.
+
+**Accuracy**
+
+The number one of goal of this library is accuracy. However, it's not unusual for different glob implementations to have different rules for matching behavior, even with simple wildcard matching. It gets increasingly more complicated when combinations of different features are combined, like when extglobs are combined with globstars, braces, slashes, and so on: `!(**/{a,b,*/c})`.
+
+Thus, given that there is no canonical glob specification to use as a single source of truth when differences of opinion arise regarding behavior, sometimes we have to implement our best judgement and rely on feedback from users to make improvements.
+
+**Performance**
+
+Although this library performs well in benchmarks, and in most cases it's faster than other popular libraries we benchmarked against, we will always choose accuracy over performance. It's not helpful to anyone if our library is faster at returning the wrong answer.
+
+
+
+
+## About
+
+
+Contributing
+
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
+
+Please read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards.
+
+
+
+
+Running Tests
+
+Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
+
+```sh
+npm install && npm test
+```
+
+
+
+
+Building docs
+
+_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
+
+To generate the readme, run the following command:
+
+```sh
+npm install -g verbose/verb#dev verb-generate-readme && verb
+```
+
+
+
+### Author
+
+**Jon Schlinkert**
+
+* [GitHub Profile](https://github.com/jonschlinkert)
+* [Twitter Profile](https://twitter.com/jonschlinkert)
+* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)
+
+### License
+
+Copyright ยฉ 2017-present, [Jon Schlinkert](https://github.com/jonschlinkert).
+Released under the [MIT License](LICENSE).
diff --git a/node_modules/picomatch/index.js b/node_modules/picomatch/index.js
new file mode 100644
index 0000000..a753b1d
--- /dev/null
+++ b/node_modules/picomatch/index.js
@@ -0,0 +1,17 @@
+'use strict';
+
+const pico = require('./lib/picomatch');
+const utils = require('./lib/utils');
+
+function picomatch(glob, options, returnState = false) {
+ // default to os.platform()
+ if (options && (options.windows === null || options.windows === undefined)) {
+ // don't mutate the original options object
+ options = { ...options, windows: utils.isWindows() };
+ }
+
+ return pico(glob, options, returnState);
+}
+
+Object.assign(picomatch, pico);
+module.exports = picomatch;
diff --git a/node_modules/picomatch/lib/constants.js b/node_modules/picomatch/lib/constants.js
new file mode 100644
index 0000000..27b3e20
--- /dev/null
+++ b/node_modules/picomatch/lib/constants.js
@@ -0,0 +1,179 @@
+'use strict';
+
+const WIN_SLASH = '\\\\/';
+const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
+
+/**
+ * Posix glob regex
+ */
+
+const DOT_LITERAL = '\\.';
+const PLUS_LITERAL = '\\+';
+const QMARK_LITERAL = '\\?';
+const SLASH_LITERAL = '\\/';
+const ONE_CHAR = '(?=.)';
+const QMARK = '[^/]';
+const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
+const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
+const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
+const NO_DOT = `(?!${DOT_LITERAL})`;
+const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
+const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
+const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
+const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
+const STAR = `${QMARK}*?`;
+const SEP = '/';
+
+const POSIX_CHARS = {
+ DOT_LITERAL,
+ PLUS_LITERAL,
+ QMARK_LITERAL,
+ SLASH_LITERAL,
+ ONE_CHAR,
+ QMARK,
+ END_ANCHOR,
+ DOTS_SLASH,
+ NO_DOT,
+ NO_DOTS,
+ NO_DOT_SLASH,
+ NO_DOTS_SLASH,
+ QMARK_NO_DOT,
+ STAR,
+ START_ANCHOR,
+ SEP
+};
+
+/**
+ * Windows glob regex
+ */
+
+const WINDOWS_CHARS = {
+ ...POSIX_CHARS,
+
+ SLASH_LITERAL: `[${WIN_SLASH}]`,
+ QMARK: WIN_NO_SLASH,
+ STAR: `${WIN_NO_SLASH}*?`,
+ DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
+ NO_DOT: `(?!${DOT_LITERAL})`,
+ NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
+ NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
+ NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
+ QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
+ START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
+ END_ANCHOR: `(?:[${WIN_SLASH}]|$)`,
+ SEP: '\\'
+};
+
+/**
+ * POSIX Bracket Regex
+ */
+
+const POSIX_REGEX_SOURCE = {
+ alnum: 'a-zA-Z0-9',
+ alpha: 'a-zA-Z',
+ ascii: '\\x00-\\x7F',
+ blank: ' \\t',
+ cntrl: '\\x00-\\x1F\\x7F',
+ digit: '0-9',
+ graph: '\\x21-\\x7E',
+ lower: 'a-z',
+ print: '\\x20-\\x7E ',
+ punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~',
+ space: ' \\t\\r\\n\\v\\f',
+ upper: 'A-Z',
+ word: 'A-Za-z0-9_',
+ xdigit: 'A-Fa-f0-9'
+};
+
+module.exports = {
+ MAX_LENGTH: 1024 * 64,
+ POSIX_REGEX_SOURCE,
+
+ // regular expressions
+ REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
+ REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
+ REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
+ REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
+ REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
+ REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
+
+ // Replace globs with equivalent patterns to reduce parsing time.
+ REPLACEMENTS: {
+ '***': '*',
+ '**/**': '**',
+ '**/**/**': '**'
+ },
+
+ // Digits
+ CHAR_0: 48, /* 0 */
+ CHAR_9: 57, /* 9 */
+
+ // Alphabet chars.
+ CHAR_UPPERCASE_A: 65, /* A */
+ CHAR_LOWERCASE_A: 97, /* a */
+ CHAR_UPPERCASE_Z: 90, /* Z */
+ CHAR_LOWERCASE_Z: 122, /* z */
+
+ CHAR_LEFT_PARENTHESES: 40, /* ( */
+ CHAR_RIGHT_PARENTHESES: 41, /* ) */
+
+ CHAR_ASTERISK: 42, /* * */
+
+ // Non-alphabetic chars.
+ CHAR_AMPERSAND: 38, /* & */
+ CHAR_AT: 64, /* @ */
+ CHAR_BACKWARD_SLASH: 92, /* \ */
+ CHAR_CARRIAGE_RETURN: 13, /* \r */
+ CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */
+ CHAR_COLON: 58, /* : */
+ CHAR_COMMA: 44, /* , */
+ CHAR_DOT: 46, /* . */
+ CHAR_DOUBLE_QUOTE: 34, /* " */
+ CHAR_EQUAL: 61, /* = */
+ CHAR_EXCLAMATION_MARK: 33, /* ! */
+ CHAR_FORM_FEED: 12, /* \f */
+ CHAR_FORWARD_SLASH: 47, /* / */
+ CHAR_GRAVE_ACCENT: 96, /* ` */
+ CHAR_HASH: 35, /* # */
+ CHAR_HYPHEN_MINUS: 45, /* - */
+ CHAR_LEFT_ANGLE_BRACKET: 60, /* < */
+ CHAR_LEFT_CURLY_BRACE: 123, /* { */
+ CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */
+ CHAR_LINE_FEED: 10, /* \n */
+ CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */
+ CHAR_PERCENT: 37, /* % */
+ CHAR_PLUS: 43, /* + */
+ CHAR_QUESTION_MARK: 63, /* ? */
+ CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */
+ CHAR_RIGHT_CURLY_BRACE: 125, /* } */
+ CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */
+ CHAR_SEMICOLON: 59, /* ; */
+ CHAR_SINGLE_QUOTE: 39, /* ' */
+ CHAR_SPACE: 32, /* */
+ CHAR_TAB: 9, /* \t */
+ CHAR_UNDERSCORE: 95, /* _ */
+ CHAR_VERTICAL_LINE: 124, /* | */
+ CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */
+
+ /**
+ * Create EXTGLOB_CHARS
+ */
+
+ extglobChars(chars) {
+ return {
+ '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` },
+ '?': { type: 'qmark', open: '(?:', close: ')?' },
+ '+': { type: 'plus', open: '(?:', close: ')+' },
+ '*': { type: 'star', open: '(?:', close: ')*' },
+ '@': { type: 'at', open: '(?:', close: ')' }
+ };
+ },
+
+ /**
+ * Create GLOB_CHARS
+ */
+
+ globChars(win32) {
+ return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
+ }
+};
diff --git a/node_modules/picomatch/lib/parse.js b/node_modules/picomatch/lib/parse.js
new file mode 100644
index 0000000..8fd8ff4
--- /dev/null
+++ b/node_modules/picomatch/lib/parse.js
@@ -0,0 +1,1085 @@
+'use strict';
+
+const constants = require('./constants');
+const utils = require('./utils');
+
+/**
+ * Constants
+ */
+
+const {
+ MAX_LENGTH,
+ POSIX_REGEX_SOURCE,
+ REGEX_NON_SPECIAL_CHARS,
+ REGEX_SPECIAL_CHARS_BACKREF,
+ REPLACEMENTS
+} = constants;
+
+/**
+ * Helpers
+ */
+
+const expandRange = (args, options) => {
+ if (typeof options.expandRange === 'function') {
+ return options.expandRange(...args, options);
+ }
+
+ args.sort();
+ const value = `[${args.join('-')}]`;
+
+ try {
+ /* eslint-disable-next-line no-new */
+ new RegExp(value);
+ } catch (ex) {
+ return args.map(v => utils.escapeRegex(v)).join('..');
+ }
+
+ return value;
+};
+
+/**
+ * Create the message for a syntax error
+ */
+
+const syntaxError = (type, char) => {
+ return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
+};
+
+/**
+ * Parse the given input string.
+ * @param {String} input
+ * @param {Object} options
+ * @return {Object}
+ */
+
+const parse = (input, options) => {
+ if (typeof input !== 'string') {
+ throw new TypeError('Expected a string');
+ }
+
+ input = REPLACEMENTS[input] || input;
+
+ const opts = { ...options };
+ const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
+
+ let len = input.length;
+ if (len > max) {
+ throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
+ }
+
+ const bos = { type: 'bos', value: '', output: opts.prepend || '' };
+ const tokens = [bos];
+
+ const capture = opts.capture ? '' : '?:';
+
+ // create constants based on platform, for windows or posix
+ const PLATFORM_CHARS = constants.globChars(opts.windows);
+ const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
+
+ const {
+ DOT_LITERAL,
+ PLUS_LITERAL,
+ SLASH_LITERAL,
+ ONE_CHAR,
+ DOTS_SLASH,
+ NO_DOT,
+ NO_DOT_SLASH,
+ NO_DOTS_SLASH,
+ QMARK,
+ QMARK_NO_DOT,
+ STAR,
+ START_ANCHOR
+ } = PLATFORM_CHARS;
+
+ const globstar = opts => {
+ return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
+ };
+
+ const nodot = opts.dot ? '' : NO_DOT;
+ const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
+ let star = opts.bash === true ? globstar(opts) : STAR;
+
+ if (opts.capture) {
+ star = `(${star})`;
+ }
+
+ // minimatch options support
+ if (typeof opts.noext === 'boolean') {
+ opts.noextglob = opts.noext;
+ }
+
+ const state = {
+ input,
+ index: -1,
+ start: 0,
+ dot: opts.dot === true,
+ consumed: '',
+ output: '',
+ prefix: '',
+ backtrack: false,
+ negated: false,
+ brackets: 0,
+ braces: 0,
+ parens: 0,
+ quotes: 0,
+ globstar: false,
+ tokens
+ };
+
+ input = utils.removePrefix(input, state);
+ len = input.length;
+
+ const extglobs = [];
+ const braces = [];
+ const stack = [];
+ let prev = bos;
+ let value;
+
+ /**
+ * Tokenizing helpers
+ */
+
+ const eos = () => state.index === len - 1;
+ const peek = state.peek = (n = 1) => input[state.index + n];
+ const advance = state.advance = () => input[++state.index] || '';
+ const remaining = () => input.slice(state.index + 1);
+ const consume = (value = '', num = 0) => {
+ state.consumed += value;
+ state.index += num;
+ };
+
+ const append = token => {
+ state.output += token.output != null ? token.output : token.value;
+ consume(token.value);
+ };
+
+ const negate = () => {
+ let count = 1;
+
+ while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) {
+ advance();
+ state.start++;
+ count++;
+ }
+
+ if (count % 2 === 0) {
+ return false;
+ }
+
+ state.negated = true;
+ state.start++;
+ return true;
+ };
+
+ const increment = type => {
+ state[type]++;
+ stack.push(type);
+ };
+
+ const decrement = type => {
+ state[type]--;
+ stack.pop();
+ };
+
+ /**
+ * Push tokens onto the tokens array. This helper speeds up
+ * tokenizing by 1) helping us avoid backtracking as much as possible,
+ * and 2) helping us avoid creating extra tokens when consecutive
+ * characters are plain text. This improves performance and simplifies
+ * lookbehinds.
+ */
+
+ const push = tok => {
+ if (prev.type === 'globstar') {
+ const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace');
+ const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren'));
+
+ if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) {
+ state.output = state.output.slice(0, -prev.output.length);
+ prev.type = 'star';
+ prev.value = '*';
+ prev.output = star;
+ state.output += prev.output;
+ }
+ }
+
+ if (extglobs.length && tok.type !== 'paren') {
+ extglobs[extglobs.length - 1].inner += tok.value;
+ }
+
+ if (tok.value || tok.output) append(tok);
+ if (prev && prev.type === 'text' && tok.type === 'text') {
+ prev.output = (prev.output || prev.value) + tok.value;
+ prev.value += tok.value;
+ return;
+ }
+
+ tok.prev = prev;
+ tokens.push(tok);
+ prev = tok;
+ };
+
+ const extglobOpen = (type, value) => {
+ const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' };
+
+ token.prev = prev;
+ token.parens = state.parens;
+ token.output = state.output;
+ const output = (opts.capture ? '(' : '') + token.open;
+
+ increment('parens');
+ push({ type, value, output: state.output ? '' : ONE_CHAR });
+ push({ type: 'paren', extglob: true, value: advance(), output });
+ extglobs.push(token);
+ };
+
+ const extglobClose = token => {
+ let output = token.close + (opts.capture ? ')' : '');
+ let rest;
+
+ if (token.type === 'negate') {
+ let extglobStar = star;
+
+ if (token.inner && token.inner.length > 1 && token.inner.includes('/')) {
+ extglobStar = globstar(opts);
+ }
+
+ if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
+ output = token.close = `)$))${extglobStar}`;
+ }
+
+ if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
+ // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis.
+ // In this case, we need to parse the string and use it in the output of the original pattern.
+ // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`.
+ //
+ // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`.
+ const expression = parse(rest, { ...options, fastpaths: false }).output;
+
+ output = token.close = `)${expression})${extglobStar})`;
+ }
+
+ if (token.prev.type === 'bos') {
+ state.negatedExtglob = true;
+ }
+ }
+
+ push({ type: 'paren', extglob: true, value, output });
+ decrement('parens');
+ };
+
+ /**
+ * Fast paths
+ */
+
+ if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
+ let backslashes = false;
+
+ let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
+ if (first === '\\') {
+ backslashes = true;
+ return m;
+ }
+
+ if (first === '?') {
+ if (esc) {
+ return esc + first + (rest ? QMARK.repeat(rest.length) : '');
+ }
+ if (index === 0) {
+ return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : '');
+ }
+ return QMARK.repeat(chars.length);
+ }
+
+ if (first === '.') {
+ return DOT_LITERAL.repeat(chars.length);
+ }
+
+ if (first === '*') {
+ if (esc) {
+ return esc + first + (rest ? star : '');
+ }
+ return star;
+ }
+ return esc ? m : `\\${m}`;
+ });
+
+ if (backslashes === true) {
+ if (opts.unescape === true) {
+ output = output.replace(/\\/g, '');
+ } else {
+ output = output.replace(/\\+/g, m => {
+ return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : '');
+ });
+ }
+ }
+
+ if (output === input && opts.contains === true) {
+ state.output = input;
+ return state;
+ }
+
+ state.output = utils.wrapOutput(output, state, options);
+ return state;
+ }
+
+ /**
+ * Tokenize input until we reach end-of-string
+ */
+
+ while (!eos()) {
+ value = advance();
+
+ if (value === '\u0000') {
+ continue;
+ }
+
+ /**
+ * Escaped characters
+ */
+
+ if (value === '\\') {
+ const next = peek();
+
+ if (next === '/' && opts.bash !== true) {
+ continue;
+ }
+
+ if (next === '.' || next === ';') {
+ continue;
+ }
+
+ if (!next) {
+ value += '\\';
+ push({ type: 'text', value });
+ continue;
+ }
+
+ // collapse slashes to reduce potential for exploits
+ const match = /^\\+/.exec(remaining());
+ let slashes = 0;
+
+ if (match && match[0].length > 2) {
+ slashes = match[0].length;
+ state.index += slashes;
+ if (slashes % 2 !== 0) {
+ value += '\\';
+ }
+ }
+
+ if (opts.unescape === true) {
+ value = advance();
+ } else {
+ value += advance();
+ }
+
+ if (state.brackets === 0) {
+ push({ type: 'text', value });
+ continue;
+ }
+ }
+
+ /**
+ * If we're inside a regex character class, continue
+ * until we reach the closing bracket.
+ */
+
+ if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) {
+ if (opts.posix !== false && value === ':') {
+ const inner = prev.value.slice(1);
+ if (inner.includes('[')) {
+ prev.posix = true;
+
+ if (inner.includes(':')) {
+ const idx = prev.value.lastIndexOf('[');
+ const pre = prev.value.slice(0, idx);
+ const rest = prev.value.slice(idx + 2);
+ const posix = POSIX_REGEX_SOURCE[rest];
+ if (posix) {
+ prev.value = pre + posix;
+ state.backtrack = true;
+ advance();
+
+ if (!bos.output && tokens.indexOf(prev) === 1) {
+ bos.output = ONE_CHAR;
+ }
+ continue;
+ }
+ }
+ }
+ }
+
+ if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) {
+ value = `\\${value}`;
+ }
+
+ if (value === ']' && (prev.value === '[' || prev.value === '[^')) {
+ value = `\\${value}`;
+ }
+
+ if (opts.posix === true && value === '!' && prev.value === '[') {
+ value = '^';
+ }
+
+ prev.value += value;
+ append({ value });
+ continue;
+ }
+
+ /**
+ * If we're inside a quoted string, continue
+ * until we reach the closing double quote.
+ */
+
+ if (state.quotes === 1 && value !== '"') {
+ value = utils.escapeRegex(value);
+ prev.value += value;
+ append({ value });
+ continue;
+ }
+
+ /**
+ * Double quotes
+ */
+
+ if (value === '"') {
+ state.quotes = state.quotes === 1 ? 0 : 1;
+ if (opts.keepQuotes === true) {
+ push({ type: 'text', value });
+ }
+ continue;
+ }
+
+ /**
+ * Parentheses
+ */
+
+ if (value === '(') {
+ increment('parens');
+ push({ type: 'paren', value });
+ continue;
+ }
+
+ if (value === ')') {
+ if (state.parens === 0 && opts.strictBrackets === true) {
+ throw new SyntaxError(syntaxError('opening', '('));
+ }
+
+ const extglob = extglobs[extglobs.length - 1];
+ if (extglob && state.parens === extglob.parens + 1) {
+ extglobClose(extglobs.pop());
+ continue;
+ }
+
+ push({ type: 'paren', value, output: state.parens ? ')' : '\\)' });
+ decrement('parens');
+ continue;
+ }
+
+ /**
+ * Square brackets
+ */
+
+ if (value === '[') {
+ if (opts.nobracket === true || !remaining().includes(']')) {
+ if (opts.nobracket !== true && opts.strictBrackets === true) {
+ throw new SyntaxError(syntaxError('closing', ']'));
+ }
+
+ value = `\\${value}`;
+ } else {
+ increment('brackets');
+ }
+
+ push({ type: 'bracket', value });
+ continue;
+ }
+
+ if (value === ']') {
+ if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) {
+ push({ type: 'text', value, output: `\\${value}` });
+ continue;
+ }
+
+ if (state.brackets === 0) {
+ if (opts.strictBrackets === true) {
+ throw new SyntaxError(syntaxError('opening', '['));
+ }
+
+ push({ type: 'text', value, output: `\\${value}` });
+ continue;
+ }
+
+ decrement('brackets');
+
+ const prevValue = prev.value.slice(1);
+ if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) {
+ value = `/${value}`;
+ }
+
+ prev.value += value;
+ append({ value });
+
+ // when literal brackets are explicitly disabled
+ // assume we should match with a regex character class
+ if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
+ continue;
+ }
+
+ const escaped = utils.escapeRegex(prev.value);
+ state.output = state.output.slice(0, -prev.value.length);
+
+ // when literal brackets are explicitly enabled
+ // assume we should escape the brackets to match literal characters
+ if (opts.literalBrackets === true) {
+ state.output += escaped;
+ prev.value = escaped;
+ continue;
+ }
+
+ // when the user specifies nothing, try to match both
+ prev.value = `(${capture}${escaped}|${prev.value})`;
+ state.output += prev.value;
+ continue;
+ }
+
+ /**
+ * Braces
+ */
+
+ if (value === '{' && opts.nobrace !== true) {
+ increment('braces');
+
+ const open = {
+ type: 'brace',
+ value,
+ output: '(',
+ outputIndex: state.output.length,
+ tokensIndex: state.tokens.length
+ };
+
+ braces.push(open);
+ push(open);
+ continue;
+ }
+
+ if (value === '}') {
+ const brace = braces[braces.length - 1];
+
+ if (opts.nobrace === true || !brace) {
+ push({ type: 'text', value, output: value });
+ continue;
+ }
+
+ let output = ')';
+
+ if (brace.dots === true) {
+ const arr = tokens.slice();
+ const range = [];
+
+ for (let i = arr.length - 1; i >= 0; i--) {
+ tokens.pop();
+ if (arr[i].type === 'brace') {
+ break;
+ }
+ if (arr[i].type !== 'dots') {
+ range.unshift(arr[i].value);
+ }
+ }
+
+ output = expandRange(range, opts);
+ state.backtrack = true;
+ }
+
+ if (brace.comma !== true && brace.dots !== true) {
+ const out = state.output.slice(0, brace.outputIndex);
+ const toks = state.tokens.slice(brace.tokensIndex);
+ brace.value = brace.output = '\\{';
+ value = output = '\\}';
+ state.output = out;
+ for (const t of toks) {
+ state.output += (t.output || t.value);
+ }
+ }
+
+ push({ type: 'brace', value, output });
+ decrement('braces');
+ braces.pop();
+ continue;
+ }
+
+ /**
+ * Pipes
+ */
+
+ if (value === '|') {
+ if (extglobs.length > 0) {
+ extglobs[extglobs.length - 1].conditions++;
+ }
+ push({ type: 'text', value });
+ continue;
+ }
+
+ /**
+ * Commas
+ */
+
+ if (value === ',') {
+ let output = value;
+
+ const brace = braces[braces.length - 1];
+ if (brace && stack[stack.length - 1] === 'braces') {
+ brace.comma = true;
+ output = '|';
+ }
+
+ push({ type: 'comma', value, output });
+ continue;
+ }
+
+ /**
+ * Slashes
+ */
+
+ if (value === '/') {
+ // if the beginning of the glob is "./", advance the start
+ // to the current index, and don't add the "./" characters
+ // to the state. This greatly simplifies lookbehinds when
+ // checking for BOS characters like "!" and "." (not "./")
+ if (prev.type === 'dot' && state.index === state.start + 1) {
+ state.start = state.index + 1;
+ state.consumed = '';
+ state.output = '';
+ tokens.pop();
+ prev = bos; // reset "prev" to the first token
+ continue;
+ }
+
+ push({ type: 'slash', value, output: SLASH_LITERAL });
+ continue;
+ }
+
+ /**
+ * Dots
+ */
+
+ if (value === '.') {
+ if (state.braces > 0 && prev.type === 'dot') {
+ if (prev.value === '.') prev.output = DOT_LITERAL;
+ const brace = braces[braces.length - 1];
+ prev.type = 'dots';
+ prev.output += value;
+ prev.value += value;
+ brace.dots = true;
+ continue;
+ }
+
+ if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') {
+ push({ type: 'text', value, output: DOT_LITERAL });
+ continue;
+ }
+
+ push({ type: 'dot', value, output: DOT_LITERAL });
+ continue;
+ }
+
+ /**
+ * Question marks
+ */
+
+ if (value === '?') {
+ const isGroup = prev && prev.value === '(';
+ if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
+ extglobOpen('qmark', value);
+ continue;
+ }
+
+ if (prev && prev.type === 'paren') {
+ const next = peek();
+ let output = value;
+
+ if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) {
+ output = `\\${value}`;
+ }
+
+ push({ type: 'text', value, output });
+ continue;
+ }
+
+ if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) {
+ push({ type: 'qmark', value, output: QMARK_NO_DOT });
+ continue;
+ }
+
+ push({ type: 'qmark', value, output: QMARK });
+ continue;
+ }
+
+ /**
+ * Exclamation
+ */
+
+ if (value === '!') {
+ if (opts.noextglob !== true && peek() === '(') {
+ if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) {
+ extglobOpen('negate', value);
+ continue;
+ }
+ }
+
+ if (opts.nonegate !== true && state.index === 0) {
+ negate();
+ continue;
+ }
+ }
+
+ /**
+ * Plus
+ */
+
+ if (value === '+') {
+ if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
+ extglobOpen('plus', value);
+ continue;
+ }
+
+ if ((prev && prev.value === '(') || opts.regex === false) {
+ push({ type: 'plus', value, output: PLUS_LITERAL });
+ continue;
+ }
+
+ if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) {
+ push({ type: 'plus', value });
+ continue;
+ }
+
+ push({ type: 'plus', value: PLUS_LITERAL });
+ continue;
+ }
+
+ /**
+ * Plain text
+ */
+
+ if (value === '@') {
+ if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
+ push({ type: 'at', extglob: true, value, output: '' });
+ continue;
+ }
+
+ push({ type: 'text', value });
+ continue;
+ }
+
+ /**
+ * Plain text
+ */
+
+ if (value !== '*') {
+ if (value === '$' || value === '^') {
+ value = `\\${value}`;
+ }
+
+ const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
+ if (match) {
+ value += match[0];
+ state.index += match[0].length;
+ }
+
+ push({ type: 'text', value });
+ continue;
+ }
+
+ /**
+ * Stars
+ */
+
+ if (prev && (prev.type === 'globstar' || prev.star === true)) {
+ prev.type = 'star';
+ prev.star = true;
+ prev.value += value;
+ prev.output = star;
+ state.backtrack = true;
+ state.globstar = true;
+ consume(value);
+ continue;
+ }
+
+ let rest = remaining();
+ if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
+ extglobOpen('star', value);
+ continue;
+ }
+
+ if (prev.type === 'star') {
+ if (opts.noglobstar === true) {
+ consume(value);
+ continue;
+ }
+
+ const prior = prev.prev;
+ const before = prior.prev;
+ const isStart = prior.type === 'slash' || prior.type === 'bos';
+ const afterStar = before && (before.type === 'star' || before.type === 'globstar');
+
+ if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) {
+ push({ type: 'star', value, output: '' });
+ continue;
+ }
+
+ const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace');
+ const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren');
+ if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) {
+ push({ type: 'star', value, output: '' });
+ continue;
+ }
+
+ // strip consecutive `/**/`
+ while (rest.slice(0, 3) === '/**') {
+ const after = input[state.index + 4];
+ if (after && after !== '/') {
+ break;
+ }
+ rest = rest.slice(3);
+ consume('/**', 3);
+ }
+
+ if (prior.type === 'bos' && eos()) {
+ prev.type = 'globstar';
+ prev.value += value;
+ prev.output = globstar(opts);
+ state.output = prev.output;
+ state.globstar = true;
+ consume(value);
+ continue;
+ }
+
+ if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) {
+ state.output = state.output.slice(0, -(prior.output + prev.output).length);
+ prior.output = `(?:${prior.output}`;
+
+ prev.type = 'globstar';
+ prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)');
+ prev.value += value;
+ state.globstar = true;
+ state.output += prior.output + prev.output;
+ consume(value);
+ continue;
+ }
+
+ if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') {
+ const end = rest[1] !== void 0 ? '|$' : '';
+
+ state.output = state.output.slice(0, -(prior.output + prev.output).length);
+ prior.output = `(?:${prior.output}`;
+
+ prev.type = 'globstar';
+ prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
+ prev.value += value;
+
+ state.output += prior.output + prev.output;
+ state.globstar = true;
+
+ consume(value + advance());
+
+ push({ type: 'slash', value: '/', output: '' });
+ continue;
+ }
+
+ if (prior.type === 'bos' && rest[0] === '/') {
+ prev.type = 'globstar';
+ prev.value += value;
+ prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
+ state.output = prev.output;
+ state.globstar = true;
+ consume(value + advance());
+ push({ type: 'slash', value: '/', output: '' });
+ continue;
+ }
+
+ // remove single star from output
+ state.output = state.output.slice(0, -prev.output.length);
+
+ // reset previous token to globstar
+ prev.type = 'globstar';
+ prev.output = globstar(opts);
+ prev.value += value;
+
+ // reset output with globstar
+ state.output += prev.output;
+ state.globstar = true;
+ consume(value);
+ continue;
+ }
+
+ const token = { type: 'star', value, output: star };
+
+ if (opts.bash === true) {
+ token.output = '.*?';
+ if (prev.type === 'bos' || prev.type === 'slash') {
+ token.output = nodot + token.output;
+ }
+ push(token);
+ continue;
+ }
+
+ if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) {
+ token.output = value;
+ push(token);
+ continue;
+ }
+
+ if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') {
+ if (prev.type === 'dot') {
+ state.output += NO_DOT_SLASH;
+ prev.output += NO_DOT_SLASH;
+
+ } else if (opts.dot === true) {
+ state.output += NO_DOTS_SLASH;
+ prev.output += NO_DOTS_SLASH;
+
+ } else {
+ state.output += nodot;
+ prev.output += nodot;
+ }
+
+ if (peek() !== '*') {
+ state.output += ONE_CHAR;
+ prev.output += ONE_CHAR;
+ }
+ }
+
+ push(token);
+ }
+
+ while (state.brackets > 0) {
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']'));
+ state.output = utils.escapeLast(state.output, '[');
+ decrement('brackets');
+ }
+
+ while (state.parens > 0) {
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')'));
+ state.output = utils.escapeLast(state.output, '(');
+ decrement('parens');
+ }
+
+ while (state.braces > 0) {
+ if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}'));
+ state.output = utils.escapeLast(state.output, '{');
+ decrement('braces');
+ }
+
+ if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) {
+ push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` });
+ }
+
+ // rebuild the output if we had to backtrack at any point
+ if (state.backtrack === true) {
+ state.output = '';
+
+ for (const token of state.tokens) {
+ state.output += token.output != null ? token.output : token.value;
+
+ if (token.suffix) {
+ state.output += token.suffix;
+ }
+ }
+ }
+
+ return state;
+};
+
+/**
+ * Fast paths for creating regular expressions for common glob patterns.
+ * This can significantly speed up processing and has very little downside
+ * impact when none of the fast paths match.
+ */
+
+parse.fastpaths = (input, options) => {
+ const opts = { ...options };
+ const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
+ const len = input.length;
+ if (len > max) {
+ throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
+ }
+
+ input = REPLACEMENTS[input] || input;
+
+ // create constants based on platform, for windows or posix
+ const {
+ DOT_LITERAL,
+ SLASH_LITERAL,
+ ONE_CHAR,
+ DOTS_SLASH,
+ NO_DOT,
+ NO_DOTS,
+ NO_DOTS_SLASH,
+ STAR,
+ START_ANCHOR
+ } = constants.globChars(opts.windows);
+
+ const nodot = opts.dot ? NO_DOTS : NO_DOT;
+ const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
+ const capture = opts.capture ? '' : '?:';
+ const state = { negated: false, prefix: '' };
+ let star = opts.bash === true ? '.*?' : STAR;
+
+ if (opts.capture) {
+ star = `(${star})`;
+ }
+
+ const globstar = opts => {
+ if (opts.noglobstar === true) return star;
+ return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
+ };
+
+ const create = str => {
+ switch (str) {
+ case '*':
+ return `${nodot}${ONE_CHAR}${star}`;
+
+ case '.*':
+ return `${DOT_LITERAL}${ONE_CHAR}${star}`;
+
+ case '*.*':
+ return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
+
+ case '*/*':
+ return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
+
+ case '**':
+ return nodot + globstar(opts);
+
+ case '**/*':
+ return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
+
+ case '**/*.*':
+ return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
+
+ case '**/.*':
+ return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
+
+ default: {
+ const match = /^(.*?)\.(\w+)$/.exec(str);
+ if (!match) return;
+
+ const source = create(match[1]);
+ if (!source) return;
+
+ return source + DOT_LITERAL + match[2];
+ }
+ }
+ };
+
+ const output = utils.removePrefix(input, state);
+ let source = create(output);
+
+ if (source && opts.strictSlashes !== true) {
+ source += `${SLASH_LITERAL}?`;
+ }
+
+ return source;
+};
+
+module.exports = parse;
diff --git a/node_modules/picomatch/lib/picomatch.js b/node_modules/picomatch/lib/picomatch.js
new file mode 100644
index 0000000..d0ebd9f
--- /dev/null
+++ b/node_modules/picomatch/lib/picomatch.js
@@ -0,0 +1,341 @@
+'use strict';
+
+const scan = require('./scan');
+const parse = require('./parse');
+const utils = require('./utils');
+const constants = require('./constants');
+const isObject = val => val && typeof val === 'object' && !Array.isArray(val);
+
+/**
+ * Creates a matcher function from one or more glob patterns. The
+ * returned function takes a string to match as its first argument,
+ * and returns true if the string is a match. The returned matcher
+ * function also takes a boolean as the second argument that, when true,
+ * returns an object with additional information.
+ *
+ * ```js
+ * const picomatch = require('picomatch');
+ * // picomatch(glob[, options]);
+ *
+ * const isMatch = picomatch('*.!(*a)');
+ * console.log(isMatch('a.a')); //=> false
+ * console.log(isMatch('a.b')); //=> true
+ * ```
+ * @name picomatch
+ * @param {String|Array} `globs` One or more glob patterns.
+ * @param {Object=} `options`
+ * @return {Function=} Returns a matcher function.
+ * @api public
+ */
+
+const picomatch = (glob, options, returnState = false) => {
+ if (Array.isArray(glob)) {
+ const fns = glob.map(input => picomatch(input, options, returnState));
+ const arrayMatcher = str => {
+ for (const isMatch of fns) {
+ const state = isMatch(str);
+ if (state) return state;
+ }
+ return false;
+ };
+ return arrayMatcher;
+ }
+
+ const isState = isObject(glob) && glob.tokens && glob.input;
+
+ if (glob === '' || (typeof glob !== 'string' && !isState)) {
+ throw new TypeError('Expected pattern to be a non-empty string');
+ }
+
+ const opts = options || {};
+ const posix = opts.windows;
+ const regex = isState
+ ? picomatch.compileRe(glob, options)
+ : picomatch.makeRe(glob, options, false, true);
+
+ const state = regex.state;
+ delete regex.state;
+
+ let isIgnored = () => false;
+ if (opts.ignore) {
+ const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
+ isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
+ }
+
+ const matcher = (input, returnObject = false) => {
+ const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix });
+ const result = { glob, state, regex, posix, input, output, match, isMatch };
+
+ if (typeof opts.onResult === 'function') {
+ opts.onResult(result);
+ }
+
+ if (isMatch === false) {
+ result.isMatch = false;
+ return returnObject ? result : false;
+ }
+
+ if (isIgnored(input)) {
+ if (typeof opts.onIgnore === 'function') {
+ opts.onIgnore(result);
+ }
+ result.isMatch = false;
+ return returnObject ? result : false;
+ }
+
+ if (typeof opts.onMatch === 'function') {
+ opts.onMatch(result);
+ }
+ return returnObject ? result : true;
+ };
+
+ if (returnState) {
+ matcher.state = state;
+ }
+
+ return matcher;
+};
+
+/**
+ * Test `input` with the given `regex`. This is used by the main
+ * `picomatch()` function to test the input string.
+ *
+ * ```js
+ * const picomatch = require('picomatch');
+ * // picomatch.test(input, regex[, options]);
+ *
+ * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
+ * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
+ * ```
+ * @param {String} `input` String to test.
+ * @param {RegExp} `regex`
+ * @return {Object} Returns an object with matching info.
+ * @api public
+ */
+
+picomatch.test = (input, regex, options, { glob, posix } = {}) => {
+ if (typeof input !== 'string') {
+ throw new TypeError('Expected input to be a string');
+ }
+
+ if (input === '') {
+ return { isMatch: false, output: '' };
+ }
+
+ const opts = options || {};
+ const format = opts.format || (posix ? utils.toPosixSlashes : null);
+ let match = input === glob;
+ let output = (match && format) ? format(input) : input;
+
+ if (match === false) {
+ output = format ? format(input) : input;
+ match = output === glob;
+ }
+
+ if (match === false || opts.capture === true) {
+ if (opts.matchBase === true || opts.basename === true) {
+ match = picomatch.matchBase(input, regex, options, posix);
+ } else {
+ match = regex.exec(output);
+ }
+ }
+
+ return { isMatch: Boolean(match), match, output };
+};
+
+/**
+ * Match the basename of a filepath.
+ *
+ * ```js
+ * const picomatch = require('picomatch');
+ * // picomatch.matchBase(input, glob[, options]);
+ * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
+ * ```
+ * @param {String} `input` String to test.
+ * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).
+ * @return {Boolean}
+ * @api public
+ */
+
+picomatch.matchBase = (input, glob, options) => {
+ const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
+ return regex.test(utils.basename(input));
+};
+
+/**
+ * Returns true if **any** of the given glob `patterns` match the specified `string`.
+ *
+ * ```js
+ * const picomatch = require('picomatch');
+ * // picomatch.isMatch(string, patterns[, options]);
+ *
+ * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
+ * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
+ * ```
+ * @param {String|Array} str The string to test.
+ * @param {String|Array} patterns One or more glob patterns to use for matching.
+ * @param {Object} [options] See available [options](#options).
+ * @return {Boolean} Returns true if any patterns match `str`
+ * @api public
+ */
+
+picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
+
+/**
+ * Parse a glob pattern to create the source string for a regular
+ * expression.
+ *
+ * ```js
+ * const picomatch = require('picomatch');
+ * const result = picomatch.parse(pattern[, options]);
+ * ```
+ * @param {String} `pattern`
+ * @param {Object} `options`
+ * @return {Object} Returns an object with useful properties and output to be used as a regex source string.
+ * @api public
+ */
+
+picomatch.parse = (pattern, options) => {
+ if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options));
+ return parse(pattern, { ...options, fastpaths: false });
+};
+
+/**
+ * Scan a glob pattern to separate the pattern into segments.
+ *
+ * ```js
+ * const picomatch = require('picomatch');
+ * // picomatch.scan(input[, options]);
+ *
+ * const result = picomatch.scan('!./foo/*.js');
+ * console.log(result);
+ * { prefix: '!./',
+ * input: '!./foo/*.js',
+ * start: 3,
+ * base: 'foo',
+ * glob: '*.js',
+ * isBrace: false,
+ * isBracket: false,
+ * isGlob: true,
+ * isExtglob: false,
+ * isGlobstar: false,
+ * negated: true }
+ * ```
+ * @param {String} `input` Glob pattern to scan.
+ * @param {Object} `options`
+ * @return {Object} Returns an object with
+ * @api public
+ */
+
+picomatch.scan = (input, options) => scan(input, options);
+
+/**
+ * Compile a regular expression from the `state` object returned by the
+ * [parse()](#parse) method.
+ *
+ * @param {Object} `state`
+ * @param {Object} `options`
+ * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.
+ * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.
+ * @return {RegExp}
+ * @api public
+ */
+
+picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
+ if (returnOutput === true) {
+ return state.output;
+ }
+
+ const opts = options || {};
+ const prepend = opts.contains ? '' : '^';
+ const append = opts.contains ? '' : '$';
+
+ let source = `${prepend}(?:${state.output})${append}`;
+ if (state && state.negated === true) {
+ source = `^(?!${source}).*$`;
+ }
+
+ const regex = picomatch.toRegex(source, options);
+ if (returnState === true) {
+ regex.state = state;
+ }
+
+ return regex;
+};
+
+/**
+ * Create a regular expression from a parsed glob pattern.
+ *
+ * ```js
+ * const picomatch = require('picomatch');
+ * const state = picomatch.parse('*.js');
+ * // picomatch.compileRe(state[, options]);
+ *
+ * console.log(picomatch.compileRe(state));
+ * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
+ * ```
+ * @param {String} `state` The object returned from the `.parse` method.
+ * @param {Object} `options`
+ * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.
+ * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
+ * @return {RegExp} Returns a regex created from the given pattern.
+ * @api public
+ */
+
+picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
+ if (!input || typeof input !== 'string') {
+ throw new TypeError('Expected a non-empty string');
+ }
+
+ let parsed = { negated: false, fastpaths: true };
+
+ if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) {
+ parsed.output = parse.fastpaths(input, options);
+ }
+
+ if (!parsed.output) {
+ parsed = parse(input, options);
+ }
+
+ return picomatch.compileRe(parsed, options, returnOutput, returnState);
+};
+
+/**
+ * Create a regular expression from the given regex source string.
+ *
+ * ```js
+ * const picomatch = require('picomatch');
+ * // picomatch.toRegex(source[, options]);
+ *
+ * const { output } = picomatch.parse('*.js');
+ * console.log(picomatch.toRegex(output));
+ * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
+ * ```
+ * @param {String} `source` Regular expression source string.
+ * @param {Object} `options`
+ * @return {RegExp}
+ * @api public
+ */
+
+picomatch.toRegex = (source, options) => {
+ try {
+ const opts = options || {};
+ return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));
+ } catch (err) {
+ if (options && options.debug === true) throw err;
+ return /$^/;
+ }
+};
+
+/**
+ * Picomatch constants.
+ * @return {Object}
+ */
+
+picomatch.constants = constants;
+
+/**
+ * Expose "picomatch"
+ */
+
+module.exports = picomatch;
diff --git a/node_modules/picomatch/lib/scan.js b/node_modules/picomatch/lib/scan.js
new file mode 100644
index 0000000..e59cd7a
--- /dev/null
+++ b/node_modules/picomatch/lib/scan.js
@@ -0,0 +1,391 @@
+'use strict';
+
+const utils = require('./utils');
+const {
+ CHAR_ASTERISK, /* * */
+ CHAR_AT, /* @ */
+ CHAR_BACKWARD_SLASH, /* \ */
+ CHAR_COMMA, /* , */
+ CHAR_DOT, /* . */
+ CHAR_EXCLAMATION_MARK, /* ! */
+ CHAR_FORWARD_SLASH, /* / */
+ CHAR_LEFT_CURLY_BRACE, /* { */
+ CHAR_LEFT_PARENTHESES, /* ( */
+ CHAR_LEFT_SQUARE_BRACKET, /* [ */
+ CHAR_PLUS, /* + */
+ CHAR_QUESTION_MARK, /* ? */
+ CHAR_RIGHT_CURLY_BRACE, /* } */
+ CHAR_RIGHT_PARENTHESES, /* ) */
+ CHAR_RIGHT_SQUARE_BRACKET /* ] */
+} = require('./constants');
+
+const isPathSeparator = code => {
+ return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
+};
+
+const depth = token => {
+ if (token.isPrefix !== true) {
+ token.depth = token.isGlobstar ? Infinity : 1;
+ }
+};
+
+/**
+ * Quickly scans a glob pattern and returns an object with a handful of
+ * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
+ * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not
+ * with `!(`) and `negatedExtglob` (true if the path starts with `!(`).
+ *
+ * ```js
+ * const pm = require('picomatch');
+ * console.log(pm.scan('foo/bar/*.js'));
+ * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }
+ * ```
+ * @param {String} `str`
+ * @param {Object} `options`
+ * @return {Object} Returns an object with tokens and regex source string.
+ * @api public
+ */
+
+const scan = (input, options) => {
+ const opts = options || {};
+
+ const length = input.length - 1;
+ const scanToEnd = opts.parts === true || opts.scanToEnd === true;
+ const slashes = [];
+ const tokens = [];
+ const parts = [];
+
+ let str = input;
+ let index = -1;
+ let start = 0;
+ let lastIndex = 0;
+ let isBrace = false;
+ let isBracket = false;
+ let isGlob = false;
+ let isExtglob = false;
+ let isGlobstar = false;
+ let braceEscaped = false;
+ let backslashes = false;
+ let negated = false;
+ let negatedExtglob = false;
+ let finished = false;
+ let braces = 0;
+ let prev;
+ let code;
+ let token = { value: '', depth: 0, isGlob: false };
+
+ const eos = () => index >= length;
+ const peek = () => str.charCodeAt(index + 1);
+ const advance = () => {
+ prev = code;
+ return str.charCodeAt(++index);
+ };
+
+ while (index < length) {
+ code = advance();
+ let next;
+
+ if (code === CHAR_BACKWARD_SLASH) {
+ backslashes = token.backslashes = true;
+ code = advance();
+
+ if (code === CHAR_LEFT_CURLY_BRACE) {
+ braceEscaped = true;
+ }
+ continue;
+ }
+
+ if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
+ braces++;
+
+ while (eos() !== true && (code = advance())) {
+ if (code === CHAR_BACKWARD_SLASH) {
+ backslashes = token.backslashes = true;
+ advance();
+ continue;
+ }
+
+ if (code === CHAR_LEFT_CURLY_BRACE) {
+ braces++;
+ continue;
+ }
+
+ if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
+ isBrace = token.isBrace = true;
+ isGlob = token.isGlob = true;
+ finished = true;
+
+ if (scanToEnd === true) {
+ continue;
+ }
+
+ break;
+ }
+
+ if (braceEscaped !== true && code === CHAR_COMMA) {
+ isBrace = token.isBrace = true;
+ isGlob = token.isGlob = true;
+ finished = true;
+
+ if (scanToEnd === true) {
+ continue;
+ }
+
+ break;
+ }
+
+ if (code === CHAR_RIGHT_CURLY_BRACE) {
+ braces--;
+
+ if (braces === 0) {
+ braceEscaped = false;
+ isBrace = token.isBrace = true;
+ finished = true;
+ break;
+ }
+ }
+ }
+
+ if (scanToEnd === true) {
+ continue;
+ }
+
+ break;
+ }
+
+ if (code === CHAR_FORWARD_SLASH) {
+ slashes.push(index);
+ tokens.push(token);
+ token = { value: '', depth: 0, isGlob: false };
+
+ if (finished === true) continue;
+ if (prev === CHAR_DOT && index === (start + 1)) {
+ start += 2;
+ continue;
+ }
+
+ lastIndex = index + 1;
+ continue;
+ }
+
+ if (opts.noext !== true) {
+ const isExtglobChar = code === CHAR_PLUS
+ || code === CHAR_AT
+ || code === CHAR_ASTERISK
+ || code === CHAR_QUESTION_MARK
+ || code === CHAR_EXCLAMATION_MARK;
+
+ if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
+ isGlob = token.isGlob = true;
+ isExtglob = token.isExtglob = true;
+ finished = true;
+ if (code === CHAR_EXCLAMATION_MARK && index === start) {
+ negatedExtglob = true;
+ }
+
+ if (scanToEnd === true) {
+ while (eos() !== true && (code = advance())) {
+ if (code === CHAR_BACKWARD_SLASH) {
+ backslashes = token.backslashes = true;
+ code = advance();
+ continue;
+ }
+
+ if (code === CHAR_RIGHT_PARENTHESES) {
+ isGlob = token.isGlob = true;
+ finished = true;
+ break;
+ }
+ }
+ continue;
+ }
+ break;
+ }
+ }
+
+ if (code === CHAR_ASTERISK) {
+ if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
+ isGlob = token.isGlob = true;
+ finished = true;
+
+ if (scanToEnd === true) {
+ continue;
+ }
+ break;
+ }
+
+ if (code === CHAR_QUESTION_MARK) {
+ isGlob = token.isGlob = true;
+ finished = true;
+
+ if (scanToEnd === true) {
+ continue;
+ }
+ break;
+ }
+
+ if (code === CHAR_LEFT_SQUARE_BRACKET) {
+ while (eos() !== true && (next = advance())) {
+ if (next === CHAR_BACKWARD_SLASH) {
+ backslashes = token.backslashes = true;
+ advance();
+ continue;
+ }
+
+ if (next === CHAR_RIGHT_SQUARE_BRACKET) {
+ isBracket = token.isBracket = true;
+ isGlob = token.isGlob = true;
+ finished = true;
+ break;
+ }
+ }
+
+ if (scanToEnd === true) {
+ continue;
+ }
+
+ break;
+ }
+
+ if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
+ negated = token.negated = true;
+ start++;
+ continue;
+ }
+
+ if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
+ isGlob = token.isGlob = true;
+
+ if (scanToEnd === true) {
+ while (eos() !== true && (code = advance())) {
+ if (code === CHAR_LEFT_PARENTHESES) {
+ backslashes = token.backslashes = true;
+ code = advance();
+ continue;
+ }
+
+ if (code === CHAR_RIGHT_PARENTHESES) {
+ finished = true;
+ break;
+ }
+ }
+ continue;
+ }
+ break;
+ }
+
+ if (isGlob === true) {
+ finished = true;
+
+ if (scanToEnd === true) {
+ continue;
+ }
+
+ break;
+ }
+ }
+
+ if (opts.noext === true) {
+ isExtglob = false;
+ isGlob = false;
+ }
+
+ let base = str;
+ let prefix = '';
+ let glob = '';
+
+ if (start > 0) {
+ prefix = str.slice(0, start);
+ str = str.slice(start);
+ lastIndex -= start;
+ }
+
+ if (base && isGlob === true && lastIndex > 0) {
+ base = str.slice(0, lastIndex);
+ glob = str.slice(lastIndex);
+ } else if (isGlob === true) {
+ base = '';
+ glob = str;
+ } else {
+ base = str;
+ }
+
+ if (base && base !== '' && base !== '/' && base !== str) {
+ if (isPathSeparator(base.charCodeAt(base.length - 1))) {
+ base = base.slice(0, -1);
+ }
+ }
+
+ if (opts.unescape === true) {
+ if (glob) glob = utils.removeBackslashes(glob);
+
+ if (base && backslashes === true) {
+ base = utils.removeBackslashes(base);
+ }
+ }
+
+ const state = {
+ prefix,
+ input,
+ start,
+ base,
+ glob,
+ isBrace,
+ isBracket,
+ isGlob,
+ isExtglob,
+ isGlobstar,
+ negated,
+ negatedExtglob
+ };
+
+ if (opts.tokens === true) {
+ state.maxDepth = 0;
+ if (!isPathSeparator(code)) {
+ tokens.push(token);
+ }
+ state.tokens = tokens;
+ }
+
+ if (opts.parts === true || opts.tokens === true) {
+ let prevIndex;
+
+ for (let idx = 0; idx < slashes.length; idx++) {
+ const n = prevIndex ? prevIndex + 1 : start;
+ const i = slashes[idx];
+ const value = input.slice(n, i);
+ if (opts.tokens) {
+ if (idx === 0 && start !== 0) {
+ tokens[idx].isPrefix = true;
+ tokens[idx].value = prefix;
+ } else {
+ tokens[idx].value = value;
+ }
+ depth(tokens[idx]);
+ state.maxDepth += tokens[idx].depth;
+ }
+ if (idx !== 0 || value !== '') {
+ parts.push(value);
+ }
+ prevIndex = i;
+ }
+
+ if (prevIndex && prevIndex + 1 < input.length) {
+ const value = input.slice(prevIndex + 1);
+ parts.push(value);
+
+ if (opts.tokens) {
+ tokens[tokens.length - 1].value = value;
+ depth(tokens[tokens.length - 1]);
+ state.maxDepth += tokens[tokens.length - 1].depth;
+ }
+ }
+
+ state.slashes = slashes;
+ state.parts = parts;
+ }
+
+ return state;
+};
+
+module.exports = scan;
diff --git a/node_modules/picomatch/lib/utils.js b/node_modules/picomatch/lib/utils.js
new file mode 100644
index 0000000..9c97cae
--- /dev/null
+++ b/node_modules/picomatch/lib/utils.js
@@ -0,0 +1,72 @@
+/*global navigator*/
+'use strict';
+
+const {
+ REGEX_BACKSLASH,
+ REGEX_REMOVE_BACKSLASH,
+ REGEX_SPECIAL_CHARS,
+ REGEX_SPECIAL_CHARS_GLOBAL
+} = require('./constants');
+
+exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
+exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);
+exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str);
+exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1');
+exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/');
+
+exports.isWindows = () => {
+ if (typeof navigator !== 'undefined' && navigator.platform) {
+ const platform = navigator.platform.toLowerCase();
+ return platform === 'win32' || platform === 'windows';
+ }
+
+ if (typeof process !== 'undefined' && process.platform) {
+ return process.platform === 'win32';
+ }
+
+ return false;
+};
+
+exports.removeBackslashes = str => {
+ return str.replace(REGEX_REMOVE_BACKSLASH, match => {
+ return match === '\\' ? '' : match;
+ });
+};
+
+exports.escapeLast = (input, char, lastIdx) => {
+ const idx = input.lastIndexOf(char, lastIdx);
+ if (idx === -1) return input;
+ if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1);
+ return `${input.slice(0, idx)}\\${input.slice(idx)}`;
+};
+
+exports.removePrefix = (input, state = {}) => {
+ let output = input;
+ if (output.startsWith('./')) {
+ output = output.slice(2);
+ state.prefix = './';
+ }
+ return output;
+};
+
+exports.wrapOutput = (input, state = {}, options = {}) => {
+ const prepend = options.contains ? '' : '^';
+ const append = options.contains ? '' : '$';
+
+ let output = `${prepend}(?:${input})${append}`;
+ if (state.negated === true) {
+ output = `(?:^(?!${output}).*$)`;
+ }
+ return output;
+};
+
+exports.basename = (path, { windows } = {}) => {
+ const segs = path.split(windows ? /[\\/]/ : '/');
+ const last = segs[segs.length - 1];
+
+ if (last === '') {
+ return segs[segs.length - 2];
+ }
+
+ return last;
+};
diff --git a/node_modules/picomatch/package.json b/node_modules/picomatch/package.json
new file mode 100644
index 0000000..703a83d
--- /dev/null
+++ b/node_modules/picomatch/package.json
@@ -0,0 +1,83 @@
+{
+ "name": "picomatch",
+ "description": "Blazing fast and accurate glob matcher written in JavaScript, with no dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions.",
+ "version": "4.0.2",
+ "homepage": "https://github.com/micromatch/picomatch",
+ "author": "Jon Schlinkert (https://github.com/jonschlinkert)",
+ "funding": "https://github.com/sponsors/jonschlinkert",
+ "repository": "micromatch/picomatch",
+ "bugs": {
+ "url": "https://github.com/micromatch/picomatch/issues"
+ },
+ "license": "MIT",
+ "files": [
+ "index.js",
+ "posix.js",
+ "lib"
+ ],
+ "sideEffects": false,
+ "main": "index.js",
+ "engines": {
+ "node": ">=12"
+ },
+ "scripts": {
+ "lint": "eslint --cache --cache-location node_modules/.cache/.eslintcache --report-unused-disable-directives --ignore-path .gitignore .",
+ "mocha": "mocha --reporter dot",
+ "test": "npm run lint && npm run mocha",
+ "test:ci": "npm run test:cover",
+ "test:cover": "nyc npm run mocha"
+ },
+ "devDependencies": {
+ "eslint": "^8.57.0",
+ "fill-range": "^7.0.1",
+ "gulp-format-md": "^2.0.0",
+ "mocha": "^10.4.0",
+ "nyc": "^15.1.0",
+ "time-require": "github:jonschlinkert/time-require"
+ },
+ "keywords": [
+ "glob",
+ "match",
+ "picomatch"
+ ],
+ "nyc": {
+ "reporter": [
+ "html",
+ "lcov",
+ "text-summary"
+ ]
+ },
+ "verb": {
+ "toc": {
+ "render": true,
+ "method": "preWrite",
+ "maxdepth": 3
+ },
+ "layout": "empty",
+ "tasks": [
+ "readme"
+ ],
+ "plugins": [
+ "gulp-format-md"
+ ],
+ "lint": {
+ "reflinks": true
+ },
+ "related": {
+ "list": [
+ "braces",
+ "micromatch"
+ ]
+ },
+ "reflinks": [
+ "braces",
+ "expand-brackets",
+ "extglob",
+ "fill-range",
+ "micromatch",
+ "minimatch",
+ "nanomatch",
+ "picomatch"
+ ]
+ }
+}
diff --git a/node_modules/picomatch/posix.js b/node_modules/picomatch/posix.js
new file mode 100644
index 0000000..d2f2bc5
--- /dev/null
+++ b/node_modules/picomatch/posix.js
@@ -0,0 +1,3 @@
+'use strict';
+
+module.exports = require('./lib/picomatch');
diff --git a/node_modules/postcss/LICENSE b/node_modules/postcss/LICENSE
new file mode 100644
index 0000000..da057b4
--- /dev/null
+++ b/node_modules/postcss/LICENSE
@@ -0,0 +1,20 @@
+The MIT License (MIT)
+
+Copyright 2013 Andrey Sitnik
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/postcss/README.md b/node_modules/postcss/README.md
new file mode 100644
index 0000000..05fed07
--- /dev/null
+++ b/node_modules/postcss/README.md
@@ -0,0 +1,29 @@
+# PostCSS
+
+
+
+PostCSS is a tool for transforming styles with JS plugins.
+These plugins can lint your CSS, supportย variablesย andย mixins,
+transpileย futureย CSSย syntax, inlineย images, andย more.
+
+PostCSS is used by industry leaders including Wikipedia, Twitter, Alibaba,
+and JetBrains. Theย [Autoprefixer] and [Stylelint]ย PostCSS pluginsย are someย ofย theย most popular CSS tools.
+
+---
+
+ย ย Built by
+ Evil Martians, go-to agency for developer tools.
+
+---
+
+[Abstractย Syntaxย Tree]: https://en.wikipedia.org/wiki/Abstract_syntax_tree
+[Evilย Martians]: https://evilmartians.com/?utm_source=postcss
+[Autoprefixer]: https://github.com/postcss/autoprefixer
+[Stylelint]: https://stylelint.io/
+[plugins]: https://github.com/postcss/postcss#plugins
+
+
+## Docs
+Read full docs **[here](https://postcss.org/)**.
diff --git a/node_modules/postcss/lib/at-rule.d.ts b/node_modules/postcss/lib/at-rule.d.ts
new file mode 100644
index 0000000..89fb505
--- /dev/null
+++ b/node_modules/postcss/lib/at-rule.d.ts
@@ -0,0 +1,140 @@
+import Container, {
+ ContainerProps,
+ ContainerWithChildren
+} from './container.js'
+
+declare namespace AtRule {
+ export interface AtRuleRaws extends Record {
+ /**
+ * The space symbols after the last child of the node to the end of the node.
+ */
+ after?: string
+
+ /**
+ * The space between the at-rule name and its parameters.
+ */
+ afterName?: string
+
+ /**
+ * The space symbols before the node. It also stores `*`
+ * and `_` symbols before the declaration (IE hack).
+ */
+ before?: string
+
+ /**
+ * The symbols between the last parameter and `{` for rules.
+ */
+ between?: string
+
+ /**
+ * The ruleโs selector with comments.
+ */
+ params?: {
+ raw: string
+ value: string
+ }
+
+ /**
+ * Contains `true` if the last child has an (optional) semicolon.
+ */
+ semicolon?: boolean
+ }
+
+ export interface AtRuleProps extends ContainerProps {
+ /** Name of the at-rule. */
+ name: string
+ /** Parameters following the name of the at-rule. */
+ params?: number | string
+ /** Information used to generate byte-to-byte equal node string as it was in the origin input. */
+ raws?: AtRuleRaws
+ }
+
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
+ export { AtRule_ as default }
+}
+
+/**
+ * Represents an at-rule.
+ *
+ * ```js
+ * Once (root, { AtRule }) {
+ * let media = new AtRule({ name: 'media', params: 'print' })
+ * media.append(โฆ)
+ * root.append(media)
+ * }
+ * ```
+ *
+ * If itโs followed in the CSS by a `{}` block, this node will have
+ * a nodes property representing its children.
+ *
+ * ```js
+ * const root = postcss.parse('@charset "UTF-8"; @media print {}')
+ *
+ * const charset = root.first
+ * charset.type //=> 'atrule'
+ * charset.nodes //=> undefined
+ *
+ * const media = root.last
+ * media.nodes //=> []
+ * ```
+ */
+declare class AtRule_ extends Container {
+ /**
+ * An array containing the layerโs children.
+ *
+ * ```js
+ * const root = postcss.parse('@layer example { a { color: black } }')
+ * const layer = root.first
+ * layer.nodes.length //=> 1
+ * layer.nodes[0].selector //=> 'a'
+ * ```
+ *
+ * Can be `undefinded` if the at-rule has no body.
+ *
+ * ```js
+ * const root = postcss.parse('@layer a, b, c;')
+ * const layer = root.first
+ * layer.nodes //=> undefined
+ * ```
+ */
+ nodes: Container['nodes'] | undefined
+ parent: ContainerWithChildren | undefined
+
+ raws: AtRule.AtRuleRaws
+ type: 'atrule'
+ /**
+ * The at-ruleโs name immediately follows the `@`.
+ *
+ * ```js
+ * const root = postcss.parse('@media print {}')
+ * const media = root.first
+ * media.name //=> 'media'
+ * ```
+ */
+ get name(): string
+ set name(value: string)
+
+ /**
+ * The at-ruleโs parameters, the values that follow the at-ruleโs name
+ * but precede any `{}` block.
+ *
+ * ```js
+ * const root = postcss.parse('@media print, screen {}')
+ * const media = root.first
+ * media.params //=> 'print, screen'
+ * ```
+ */
+ get params(): string
+
+ set params(value: string)
+
+ constructor(defaults?: AtRule.AtRuleProps)
+ assign(overrides: AtRule.AtRuleProps | object): this
+ clone(overrides?: Partial): this
+ cloneAfter(overrides?: Partial): this
+ cloneBefore(overrides?: Partial): this
+}
+
+declare class AtRule extends AtRule_ {}
+
+export = AtRule
diff --git a/node_modules/postcss/lib/at-rule.js b/node_modules/postcss/lib/at-rule.js
new file mode 100644
index 0000000..9486447
--- /dev/null
+++ b/node_modules/postcss/lib/at-rule.js
@@ -0,0 +1,25 @@
+'use strict'
+
+let Container = require('./container')
+
+class AtRule extends Container {
+ constructor(defaults) {
+ super(defaults)
+ this.type = 'atrule'
+ }
+
+ append(...children) {
+ if (!this.proxyOf.nodes) this.nodes = []
+ return super.append(...children)
+ }
+
+ prepend(...children) {
+ if (!this.proxyOf.nodes) this.nodes = []
+ return super.prepend(...children)
+ }
+}
+
+module.exports = AtRule
+AtRule.default = AtRule
+
+Container.registerAtRule(AtRule)
diff --git a/node_modules/postcss/lib/comment.d.ts b/node_modules/postcss/lib/comment.d.ts
new file mode 100644
index 0000000..6f1f66f
--- /dev/null
+++ b/node_modules/postcss/lib/comment.d.ts
@@ -0,0 +1,68 @@
+import Container from './container.js'
+import Node, { NodeProps } from './node.js'
+
+declare namespace Comment {
+ export interface CommentRaws extends Record {
+ /**
+ * The space symbols before the node.
+ */
+ before?: string
+
+ /**
+ * The space symbols between `/*` and the commentโs text.
+ */
+ left?: string
+
+ /**
+ * The space symbols between the commentโs text.
+ */
+ right?: string
+ }
+
+ export interface CommentProps extends NodeProps {
+ /** Information used to generate byte-to-byte equal node string as it was in the origin input. */
+ raws?: CommentRaws
+ /** Content of the comment. */
+ text: string
+ }
+
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
+ export { Comment_ as default }
+}
+
+/**
+ * It represents a class that handles
+ * [CSS comments](https://developer.mozilla.org/en-US/docs/Web/CSS/Comments)
+ *
+ * ```js
+ * Once (root, { Comment }) {
+ * const note = new Comment({ text: 'Note: โฆ' })
+ * root.append(note)
+ * }
+ * ```
+ *
+ * Remember that CSS comments inside selectors, at-rule parameters,
+ * or declaration values will be stored in the `raws` properties
+ * explained above.
+ */
+declare class Comment_ extends Node {
+ parent: Container | undefined
+ raws: Comment.CommentRaws
+ type: 'comment'
+ /**
+ * The comment's text.
+ */
+ get text(): string
+
+ set text(value: string)
+
+ constructor(defaults?: Comment.CommentProps)
+ assign(overrides: Comment.CommentProps | object): this
+ clone(overrides?: Partial): this
+ cloneAfter(overrides?: Partial): this
+ cloneBefore(overrides?: Partial): this
+}
+
+declare class Comment extends Comment_ {}
+
+export = Comment
diff --git a/node_modules/postcss/lib/comment.js b/node_modules/postcss/lib/comment.js
new file mode 100644
index 0000000..c566506
--- /dev/null
+++ b/node_modules/postcss/lib/comment.js
@@ -0,0 +1,13 @@
+'use strict'
+
+let Node = require('./node')
+
+class Comment extends Node {
+ constructor(defaults) {
+ super(defaults)
+ this.type = 'comment'
+ }
+}
+
+module.exports = Comment
+Comment.default = Comment
diff --git a/node_modules/postcss/lib/container.d.ts b/node_modules/postcss/lib/container.d.ts
new file mode 100644
index 0000000..c2b310b
--- /dev/null
+++ b/node_modules/postcss/lib/container.d.ts
@@ -0,0 +1,483 @@
+import AtRule from './at-rule.js'
+import Comment from './comment.js'
+import Declaration from './declaration.js'
+import Node, { ChildNode, ChildProps, NodeProps } from './node.js'
+import { Root } from './postcss.js'
+import Rule from './rule.js'
+
+declare namespace Container {
+ export type ContainerWithChildren = {
+ nodes: Child[]
+ } & (
+ | AtRule
+ | Root
+ | Rule
+ )
+
+ export interface ValueOptions {
+ /**
+ * String thatโs used to narrow down values and speed up the regexp search.
+ */
+ fast?: string
+
+ /**
+ * An array of property names.
+ */
+ props?: readonly string[]
+ }
+
+ export interface ContainerProps extends NodeProps {
+ nodes?: readonly (ChildProps | Node)[]
+ }
+
+ /**
+ * All types that can be passed into container methods to create or add a new
+ * child node.
+ */
+ export type NewChild =
+ | ChildProps
+ | Node
+ | readonly ChildProps[]
+ | readonly Node[]
+ | readonly string[]
+ | string
+ | undefined
+
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
+ export { Container_ as default }
+}
+
+/**
+ * The `Root`, `AtRule`, and `Rule` container nodes
+ * inherit some common methods to help work with their children.
+ *
+ * Note that all containers can store any content. If you write a rule inside
+ * a rule, PostCSS will parse it.
+ */
+declare abstract class Container_ extends Node {
+ /**
+ * An array containing the containerโs children.
+ *
+ * ```js
+ * const root = postcss.parse('a { color: black }')
+ * root.nodes.length //=> 1
+ * root.nodes[0].selector //=> 'a'
+ * root.nodes[0].nodes[0].prop //=> 'color'
+ * ```
+ */
+ nodes: Child[] | undefined
+
+ /**
+ * The containerโs first child.
+ *
+ * ```js
+ * rule.first === rules.nodes[0]
+ * ```
+ */
+ get first(): Child | undefined
+
+ /**
+ * The containerโs last child.
+ *
+ * ```js
+ * rule.last === rule.nodes[rule.nodes.length - 1]
+ * ```
+ */
+ get last(): Child | undefined
+ /**
+ * Inserts new nodes to the end of the container.
+ *
+ * ```js
+ * const decl1 = new Declaration({ prop: 'color', value: 'black' })
+ * const decl2 = new Declaration({ prop: 'background-color', value: 'white' })
+ * rule.append(decl1, decl2)
+ *
+ * root.append({ name: 'charset', params: '"UTF-8"' }) // at-rule
+ * root.append({ selector: 'a' }) // rule
+ * rule.append({ prop: 'color', value: 'black' }) // declaration
+ * rule.append({ text: 'Comment' }) // comment
+ *
+ * root.append('a {}')
+ * root.first.append('color: black; z-index: 1')
+ * ```
+ *
+ * @param nodes New nodes.
+ * @return This node for methods chain.
+ */
+ append(...nodes: Container.NewChild[]): this
+ assign(overrides: Container.ContainerProps | object): this
+ clone(overrides?: Partial): this
+
+ cloneAfter(overrides?: Partial): this
+
+ cloneBefore(overrides?: Partial): this
+ /**
+ * Iterates through the containerโs immediate children,
+ * calling `callback` for each child.
+ *
+ * Returning `false` in the callback will break iteration.
+ *
+ * This method only iterates through the containerโs immediate children.
+ * If you need to recursively iterate through all the containerโs descendant
+ * nodes, use `Container#walk`.
+ *
+ * Unlike the for `{}`-cycle or `Array#forEach` this iterator is safe
+ * if you are mutating the array of child nodes during iteration.
+ * PostCSS will adjust the current index to match the mutations.
+ *
+ * ```js
+ * const root = postcss.parse('a { color: black; z-index: 1 }')
+ * const rule = root.first
+ *
+ * for (const decl of rule.nodes) {
+ * decl.cloneBefore({ prop: '-webkit-' + decl.prop })
+ * // Cycle will be infinite, because cloneBefore moves the current node
+ * // to the next index
+ * }
+ *
+ * rule.each(decl => {
+ * decl.cloneBefore({ prop: '-webkit-' + decl.prop })
+ * // Will be executed only for color and z-index
+ * })
+ * ```
+ *
+ * @param callback Iterator receives each node and index.
+ * @return Returns `false` if iteration was broke.
+ */
+ each(
+ callback: (node: Child, index: number) => false | void
+ ): false | undefined
+
+ /**
+ * Returns `true` if callback returns `true`
+ * for all of the containerโs children.
+ *
+ * ```js
+ * const noPrefixes = rule.every(i => i.prop[0] !== '-')
+ * ```
+ *
+ * @param condition Iterator returns true or false.
+ * @return Is every child pass condition.
+ */
+ every(
+ condition: (node: Child, index: number, nodes: Child[]) => boolean
+ ): boolean
+ /**
+ * Returns a `child`โs index within the `Container#nodes` array.
+ *
+ * ```js
+ * rule.index( rule.nodes[2] ) //=> 2
+ * ```
+ *
+ * @param child Child of the current container.
+ * @return Child index.
+ */
+ index(child: Child | number): number
+
+ /**
+ * Insert new node after old node within the container.
+ *
+ * @param oldNode Child or childโs index.
+ * @param newNode New node.
+ * @return This node for methods chain.
+ */
+ insertAfter(oldNode: Child | number, newNode: Container.NewChild): this
+
+ /**
+ * Traverses the containerโs descendant nodes, calling callback
+ * for each comment node.
+ *
+ * Like `Container#each`, this method is safe
+ * to use if you are mutating arrays during iteration.
+ *
+ * ```js
+ * root.walkComments(comment => {
+ * comment.remove()
+ * })
+ * ```
+ *
+ * @param callback Iterator receives each node and index.
+ * @return Returns `false` if iteration was broke.
+ */
+
+ /**
+ * Insert new node before old node within the container.
+ *
+ * ```js
+ * rule.insertBefore(decl, decl.clone({ prop: '-webkit-' + decl.prop }))
+ * ```
+ *
+ * @param oldNode Child or childโs index.
+ * @param newNode New node.
+ * @return This node for methods chain.
+ */
+ insertBefore(oldNode: Child | number, newNode: Container.NewChild): this
+ /**
+ * Inserts new nodes to the start of the container.
+ *
+ * ```js
+ * const decl1 = new Declaration({ prop: 'color', value: 'black' })
+ * const decl2 = new Declaration({ prop: 'background-color', value: 'white' })
+ * rule.prepend(decl1, decl2)
+ *
+ * root.append({ name: 'charset', params: '"UTF-8"' }) // at-rule
+ * root.append({ selector: 'a' }) // rule
+ * rule.append({ prop: 'color', value: 'black' }) // declaration
+ * rule.append({ text: 'Comment' }) // comment
+ *
+ * root.append('a {}')
+ * root.first.append('color: black; z-index: 1')
+ * ```
+ *
+ * @param nodes New nodes.
+ * @return This node for methods chain.
+ */
+ prepend(...nodes: Container.NewChild[]): this
+
+ /**
+ * Add child to the end of the node.
+ *
+ * ```js
+ * rule.push(new Declaration({ prop: 'color', value: 'black' }))
+ * ```
+ *
+ * @param child New node.
+ * @return This node for methods chain.
+ */
+ push(child: Child): this
+
+ /**
+ * Removes all children from the container
+ * and cleans their parent properties.
+ *
+ * ```js
+ * rule.removeAll()
+ * rule.nodes.length //=> 0
+ * ```
+ *
+ * @return This node for methods chain.
+ */
+ removeAll(): this
+
+ /**
+ * Removes node from the container and cleans the parent properties
+ * from the node and its children.
+ *
+ * ```js
+ * rule.nodes.length //=> 5
+ * rule.removeChild(decl)
+ * rule.nodes.length //=> 4
+ * decl.parent //=> undefined
+ * ```
+ *
+ * @param child Child or childโs index.
+ * @return This node for methods chain.
+ */
+ removeChild(child: Child | number): this
+
+ replaceValues(
+ pattern: RegExp | string,
+ replaced: { (substring: string, ...args: any[]): string } | string
+ ): this
+ /**
+ * Passes all declaration values within the container that match pattern
+ * through callback, replacing those values with the returned result
+ * of callback.
+ *
+ * This method is useful if you are using a custom unit or function
+ * and need to iterate through all values.
+ *
+ * ```js
+ * root.replaceValues(/\d+rem/, { fast: 'rem' }, string => {
+ * return 15 * parseInt(string) + 'px'
+ * })
+ * ```
+ *
+ * @param pattern Replace pattern.
+ * @param {object} options Options to speed up the search.
+ * @param replaced String to replace pattern or callback
+ * that returns a new value. The callback
+ * will receive the same arguments
+ * as those passed to a function parameter
+ * of `String#replace`.
+ * @return This node for methods chain.
+ */
+ replaceValues(
+ pattern: RegExp | string,
+ options: Container.ValueOptions,
+ replaced: { (substring: string, ...args: any[]): string } | string
+ ): this
+
+ /**
+ * Returns `true` if callback returns `true` for (at least) one
+ * of the containerโs children.
+ *
+ * ```js
+ * const hasPrefix = rule.some(i => i.prop[0] === '-')
+ * ```
+ *
+ * @param condition Iterator returns true or false.
+ * @return Is some child pass condition.
+ */
+ some(
+ condition: (node: Child, index: number, nodes: Child[]) => boolean
+ ): boolean
+
+ /**
+ * Traverses the containerโs descendant nodes, calling callback
+ * for each node.
+ *
+ * Like container.each(), this method is safe to use
+ * if you are mutating arrays during iteration.
+ *
+ * If you only need to iterate through the containerโs immediate children,
+ * use `Container#each`.
+ *
+ * ```js
+ * root.walk(node => {
+ * // Traverses all descendant nodes.
+ * })
+ * ```
+ *
+ * @param callback Iterator receives each node and index.
+ * @return Returns `false` if iteration was broke.
+ */
+ walk(
+ callback: (node: ChildNode, index: number) => false | void
+ ): false | undefined
+
+ /**
+ * Traverses the containerโs descendant nodes, calling callback
+ * for each at-rule node.
+ *
+ * If you pass a filter, iteration will only happen over at-rules
+ * that have matching names.
+ *
+ * Like `Container#each`, this method is safe
+ * to use if you are mutating arrays during iteration.
+ *
+ * ```js
+ * root.walkAtRules(rule => {
+ * if (isOld(rule.name)) rule.remove()
+ * })
+ *
+ * let first = false
+ * root.walkAtRules('charset', rule => {
+ * if (!first) {
+ * first = true
+ * } else {
+ * rule.remove()
+ * }
+ * })
+ * ```
+ *
+ * @param name String or regular expression to filter at-rules by name.
+ * @param callback Iterator receives each node and index.
+ * @return Returns `false` if iteration was broke.
+ */
+ walkAtRules(
+ nameFilter: RegExp | string,
+ callback: (atRule: AtRule, index: number) => false | void
+ ): false | undefined
+ walkAtRules(
+ callback: (atRule: AtRule, index: number) => false | void
+ ): false | undefined
+
+ walkComments(
+ callback: (comment: Comment, indexed: number) => false | void
+ ): false | undefined
+ walkComments(
+ callback: (comment: Comment, indexed: number) => false | void
+ ): false | undefined
+
+ /**
+ * Traverses the containerโs descendant nodes, calling callback
+ * for each declaration node.
+ *
+ * If you pass a filter, iteration will only happen over declarations
+ * with matching properties.
+ *
+ * ```js
+ * root.walkDecls(decl => {
+ * checkPropertySupport(decl.prop)
+ * })
+ *
+ * root.walkDecls('border-radius', decl => {
+ * decl.remove()
+ * })
+ *
+ * root.walkDecls(/^background/, decl => {
+ * decl.value = takeFirstColorFromGradient(decl.value)
+ * })
+ * ```
+ *
+ * Like `Container#each`, this method is safe
+ * to use if you are mutating arrays during iteration.
+ *
+ * @param prop String or regular expression to filter declarations
+ * by property name.
+ * @param callback Iterator receives each node and index.
+ * @return Returns `false` if iteration was broke.
+ */
+ walkDecls(
+ propFilter: RegExp | string,
+ callback: (decl: Declaration, index: number) => false | void
+ ): false | undefined
+ walkDecls(
+ callback: (decl: Declaration, index: number) => false | void
+ ): false | undefined
+ /**
+ * Traverses the containerโs descendant nodes, calling callback
+ * for each rule node.
+ *
+ * If you pass a filter, iteration will only happen over rules
+ * with matching selectors.
+ *
+ * Like `Container#each`, this method is safe
+ * to use if you are mutating arrays during iteration.
+ *
+ * ```js
+ * const selectors = []
+ * root.walkRules(rule => {
+ * selectors.push(rule.selector)
+ * })
+ * console.log(`Your CSS uses ${ selectors.length } selectors`)
+ * ```
+ *
+ * @param selector String or regular expression to filter rules by selector.
+ * @param callback Iterator receives each node and index.
+ * @return Returns `false` if iteration was broke.
+ */
+ walkRules(
+ selectorFilter: RegExp | string,
+ callback: (rule: Rule, index: number) => false | void
+ ): false | undefined
+ walkRules(
+ callback: (rule: Rule, index: number) => false | void
+ ): false | undefined
+ /**
+ * An internal method that converts a {@link NewChild} into a list of actual
+ * child nodes that can then be added to this container.
+ *
+ * This ensures that the nodes' parent is set to this container, that they use
+ * the correct prototype chain, and that they're marked as dirty.
+ *
+ * @param mnodes The new node or nodes to add.
+ * @param sample A node from whose raws the new node's `before` raw should be
+ * taken.
+ * @param type This should be set to `'prepend'` if the new nodes will be
+ * inserted at the beginning of the container.
+ * @hidden
+ */
+ protected normalize(
+ nodes: Container.NewChild,
+ sample: Node | undefined,
+ type?: 'prepend' | false
+ ): Child[]
+}
+
+declare class Container<
+ Child extends Node = ChildNode
+> extends Container_ {}
+
+export = Container
diff --git a/node_modules/postcss/lib/container.js b/node_modules/postcss/lib/container.js
new file mode 100644
index 0000000..edb07cc
--- /dev/null
+++ b/node_modules/postcss/lib/container.js
@@ -0,0 +1,447 @@
+'use strict'
+
+let Comment = require('./comment')
+let Declaration = require('./declaration')
+let Node = require('./node')
+let { isClean, my } = require('./symbols')
+
+let AtRule, parse, Root, Rule
+
+function cleanSource(nodes) {
+ return nodes.map(i => {
+ if (i.nodes) i.nodes = cleanSource(i.nodes)
+ delete i.source
+ return i
+ })
+}
+
+function markTreeDirty(node) {
+ node[isClean] = false
+ if (node.proxyOf.nodes) {
+ for (let i of node.proxyOf.nodes) {
+ markTreeDirty(i)
+ }
+ }
+}
+
+class Container extends Node {
+ get first() {
+ if (!this.proxyOf.nodes) return undefined
+ return this.proxyOf.nodes[0]
+ }
+
+ get last() {
+ if (!this.proxyOf.nodes) return undefined
+ return this.proxyOf.nodes[this.proxyOf.nodes.length - 1]
+ }
+
+ append(...children) {
+ for (let child of children) {
+ let nodes = this.normalize(child, this.last)
+ for (let node of nodes) this.proxyOf.nodes.push(node)
+ }
+
+ this.markDirty()
+
+ return this
+ }
+
+ cleanRaws(keepBetween) {
+ super.cleanRaws(keepBetween)
+ if (this.nodes) {
+ for (let node of this.nodes) node.cleanRaws(keepBetween)
+ }
+ }
+
+ each(callback) {
+ if (!this.proxyOf.nodes) return undefined
+ let iterator = this.getIterator()
+
+ let index, result
+ while (this.indexes[iterator] < this.proxyOf.nodes.length) {
+ index = this.indexes[iterator]
+ result = callback(this.proxyOf.nodes[index], index)
+ if (result === false) break
+
+ this.indexes[iterator] += 1
+ }
+
+ delete this.indexes[iterator]
+ return result
+ }
+
+ every(condition) {
+ return this.nodes.every(condition)
+ }
+
+ getIterator() {
+ if (!this.lastEach) this.lastEach = 0
+ if (!this.indexes) this.indexes = {}
+
+ this.lastEach += 1
+ let iterator = this.lastEach
+ this.indexes[iterator] = 0
+
+ return iterator
+ }
+
+ getProxyProcessor() {
+ return {
+ get(node, prop) {
+ if (prop === 'proxyOf') {
+ return node
+ } else if (!node[prop]) {
+ return node[prop]
+ } else if (
+ prop === 'each' ||
+ (typeof prop === 'string' && prop.startsWith('walk'))
+ ) {
+ return (...args) => {
+ return node[prop](
+ ...args.map(i => {
+ if (typeof i === 'function') {
+ return (child, index) => i(child.toProxy(), index)
+ } else {
+ return i
+ }
+ })
+ )
+ }
+ } else if (prop === 'every' || prop === 'some') {
+ return cb => {
+ return node[prop]((child, ...other) =>
+ cb(child.toProxy(), ...other)
+ )
+ }
+ } else if (prop === 'root') {
+ return () => node.root().toProxy()
+ } else if (prop === 'nodes') {
+ return node.nodes.map(i => i.toProxy())
+ } else if (prop === 'first' || prop === 'last') {
+ return node[prop].toProxy()
+ } else {
+ return node[prop]
+ }
+ },
+
+ set(node, prop, value) {
+ if (node[prop] === value) return true
+ node[prop] = value
+ if (prop === 'name' || prop === 'params' || prop === 'selector') {
+ node.markDirty()
+ }
+ return true
+ }
+ }
+ }
+
+ index(child) {
+ if (typeof child === 'number') return child
+ if (child.proxyOf) child = child.proxyOf
+ return this.proxyOf.nodes.indexOf(child)
+ }
+
+ insertAfter(exist, add) {
+ let existIndex = this.index(exist)
+ let nodes = this.normalize(add, this.proxyOf.nodes[existIndex]).reverse()
+ existIndex = this.index(exist)
+ for (let node of nodes) this.proxyOf.nodes.splice(existIndex + 1, 0, node)
+
+ let index
+ for (let id in this.indexes) {
+ index = this.indexes[id]
+ if (existIndex < index) {
+ this.indexes[id] = index + nodes.length
+ }
+ }
+
+ this.markDirty()
+
+ return this
+ }
+
+ insertBefore(exist, add) {
+ let existIndex = this.index(exist)
+ let type = existIndex === 0 ? 'prepend' : false
+ let nodes = this.normalize(
+ add,
+ this.proxyOf.nodes[existIndex],
+ type
+ ).reverse()
+ existIndex = this.index(exist)
+ for (let node of nodes) this.proxyOf.nodes.splice(existIndex, 0, node)
+
+ let index
+ for (let id in this.indexes) {
+ index = this.indexes[id]
+ if (existIndex <= index) {
+ this.indexes[id] = index + nodes.length
+ }
+ }
+
+ this.markDirty()
+
+ return this
+ }
+
+ normalize(nodes, sample) {
+ if (typeof nodes === 'string') {
+ nodes = cleanSource(parse(nodes).nodes)
+ } else if (typeof nodes === 'undefined') {
+ nodes = []
+ } else if (Array.isArray(nodes)) {
+ nodes = nodes.slice(0)
+ for (let i of nodes) {
+ if (i.parent) i.parent.removeChild(i, 'ignore')
+ }
+ } else if (nodes.type === 'root' && this.type !== 'document') {
+ nodes = nodes.nodes.slice(0)
+ for (let i of nodes) {
+ if (i.parent) i.parent.removeChild(i, 'ignore')
+ }
+ } else if (nodes.type) {
+ nodes = [nodes]
+ } else if (nodes.prop) {
+ if (typeof nodes.value === 'undefined') {
+ throw new Error('Value field is missed in node creation')
+ } else if (typeof nodes.value !== 'string') {
+ nodes.value = String(nodes.value)
+ }
+ nodes = [new Declaration(nodes)]
+ } else if (nodes.selector || nodes.selectors) {
+ nodes = [new Rule(nodes)]
+ } else if (nodes.name) {
+ nodes = [new AtRule(nodes)]
+ } else if (nodes.text) {
+ nodes = [new Comment(nodes)]
+ } else {
+ throw new Error('Unknown node type in node creation')
+ }
+
+ let processed = nodes.map(i => {
+ /* c8 ignore next */
+ if (!i[my]) Container.rebuild(i)
+ i = i.proxyOf
+ if (i.parent) i.parent.removeChild(i)
+ if (i[isClean]) markTreeDirty(i)
+
+ if (!i.raws) i.raws = {}
+ if (typeof i.raws.before === 'undefined') {
+ if (sample && typeof sample.raws.before !== 'undefined') {
+ i.raws.before = sample.raws.before.replace(/\S/g, '')
+ }
+ }
+ i.parent = this.proxyOf
+ return i
+ })
+
+ return processed
+ }
+
+ prepend(...children) {
+ children = children.reverse()
+ for (let child of children) {
+ let nodes = this.normalize(child, this.first, 'prepend').reverse()
+ for (let node of nodes) this.proxyOf.nodes.unshift(node)
+ for (let id in this.indexes) {
+ this.indexes[id] = this.indexes[id] + nodes.length
+ }
+ }
+
+ this.markDirty()
+
+ return this
+ }
+
+ push(child) {
+ child.parent = this
+ this.proxyOf.nodes.push(child)
+ return this
+ }
+
+ removeAll() {
+ for (let node of this.proxyOf.nodes) node.parent = undefined
+ this.proxyOf.nodes = []
+
+ this.markDirty()
+
+ return this
+ }
+
+ removeChild(child) {
+ child = this.index(child)
+ this.proxyOf.nodes[child].parent = undefined
+ this.proxyOf.nodes.splice(child, 1)
+
+ let index
+ for (let id in this.indexes) {
+ index = this.indexes[id]
+ if (index >= child) {
+ this.indexes[id] = index - 1
+ }
+ }
+
+ this.markDirty()
+
+ return this
+ }
+
+ replaceValues(pattern, opts, callback) {
+ if (!callback) {
+ callback = opts
+ opts = {}
+ }
+
+ this.walkDecls(decl => {
+ if (opts.props && !opts.props.includes(decl.prop)) return
+ if (opts.fast && !decl.value.includes(opts.fast)) return
+
+ decl.value = decl.value.replace(pattern, callback)
+ })
+
+ this.markDirty()
+
+ return this
+ }
+
+ some(condition) {
+ return this.nodes.some(condition)
+ }
+
+ walk(callback) {
+ return this.each((child, i) => {
+ let result
+ try {
+ result = callback(child, i)
+ } catch (e) {
+ throw child.addToError(e)
+ }
+ if (result !== false && child.walk) {
+ result = child.walk(callback)
+ }
+
+ return result
+ })
+ }
+
+ walkAtRules(name, callback) {
+ if (!callback) {
+ callback = name
+ return this.walk((child, i) => {
+ if (child.type === 'atrule') {
+ return callback(child, i)
+ }
+ })
+ }
+ if (name instanceof RegExp) {
+ return this.walk((child, i) => {
+ if (child.type === 'atrule' && name.test(child.name)) {
+ return callback(child, i)
+ }
+ })
+ }
+ return this.walk((child, i) => {
+ if (child.type === 'atrule' && child.name === name) {
+ return callback(child, i)
+ }
+ })
+ }
+
+ walkComments(callback) {
+ return this.walk((child, i) => {
+ if (child.type === 'comment') {
+ return callback(child, i)
+ }
+ })
+ }
+
+ walkDecls(prop, callback) {
+ if (!callback) {
+ callback = prop
+ return this.walk((child, i) => {
+ if (child.type === 'decl') {
+ return callback(child, i)
+ }
+ })
+ }
+ if (prop instanceof RegExp) {
+ return this.walk((child, i) => {
+ if (child.type === 'decl' && prop.test(child.prop)) {
+ return callback(child, i)
+ }
+ })
+ }
+ return this.walk((child, i) => {
+ if (child.type === 'decl' && child.prop === prop) {
+ return callback(child, i)
+ }
+ })
+ }
+
+ walkRules(selector, callback) {
+ if (!callback) {
+ callback = selector
+
+ return this.walk((child, i) => {
+ if (child.type === 'rule') {
+ return callback(child, i)
+ }
+ })
+ }
+ if (selector instanceof RegExp) {
+ return this.walk((child, i) => {
+ if (child.type === 'rule' && selector.test(child.selector)) {
+ return callback(child, i)
+ }
+ })
+ }
+ return this.walk((child, i) => {
+ if (child.type === 'rule' && child.selector === selector) {
+ return callback(child, i)
+ }
+ })
+ }
+}
+
+Container.registerParse = dependant => {
+ parse = dependant
+}
+
+Container.registerRule = dependant => {
+ Rule = dependant
+}
+
+Container.registerAtRule = dependant => {
+ AtRule = dependant
+}
+
+Container.registerRoot = dependant => {
+ Root = dependant
+}
+
+module.exports = Container
+Container.default = Container
+
+/* c8 ignore start */
+Container.rebuild = node => {
+ if (node.type === 'atrule') {
+ Object.setPrototypeOf(node, AtRule.prototype)
+ } else if (node.type === 'rule') {
+ Object.setPrototypeOf(node, Rule.prototype)
+ } else if (node.type === 'decl') {
+ Object.setPrototypeOf(node, Declaration.prototype)
+ } else if (node.type === 'comment') {
+ Object.setPrototypeOf(node, Comment.prototype)
+ } else if (node.type === 'root') {
+ Object.setPrototypeOf(node, Root.prototype)
+ }
+
+ node[my] = true
+
+ if (node.nodes) {
+ node.nodes.forEach(child => {
+ Container.rebuild(child)
+ })
+ }
+}
+/* c8 ignore stop */
diff --git a/node_modules/postcss/lib/css-syntax-error.d.ts b/node_modules/postcss/lib/css-syntax-error.d.ts
new file mode 100644
index 0000000..e540d84
--- /dev/null
+++ b/node_modules/postcss/lib/css-syntax-error.d.ts
@@ -0,0 +1,248 @@
+import { FilePosition } from './input.js'
+
+declare namespace CssSyntaxError {
+ /**
+ * A position that is part of a range.
+ */
+ export interface RangePosition {
+ /**
+ * The column number in the input.
+ */
+ column: number
+
+ /**
+ * The line number in the input.
+ */
+ line: number
+ }
+
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
+ export { CssSyntaxError_ as default }
+}
+
+/**
+ * The CSS parser throws this error for broken CSS.
+ *
+ * Custom parsers can throw this error for broken custom syntax using
+ * the `Node#error` method.
+ *
+ * PostCSS will use the input source map to detect the original error location.
+ * If you wrote a Sass file, compiled it to CSS and then parsed it with PostCSS,
+ * PostCSS will show the original position in the Sass file.
+ *
+ * If you need the position in the PostCSS input
+ * (e.g., to debug the previous compiler), use `error.input.file`.
+ *
+ * ```js
+ * // Raising error from plugin
+ * throw node.error('Unknown variable', { plugin: 'postcss-vars' })
+ * ```
+ *
+ * ```js
+ * // Catching and checking syntax error
+ * try {
+ * postcss.parse('a{')
+ * } catch (error) {
+ * if (error.name === 'CssSyntaxError') {
+ * error //=> CssSyntaxError
+ * }
+ * }
+ * ```
+ */
+declare class CssSyntaxError_ extends Error {
+ /**
+ * Source column of the error.
+ *
+ * ```js
+ * error.column //=> 1
+ * error.input.column //=> 4
+ * ```
+ *
+ * PostCSS will use the input source map to detect the original location.
+ * If you need the position in the PostCSS input, use `error.input.column`.
+ */
+ column?: number
+
+ /**
+ * Source column of the error's end, exclusive. Provided if the error pertains
+ * to a range.
+ *
+ * ```js
+ * error.endColumn //=> 1
+ * error.input.endColumn //=> 4
+ * ```
+ *
+ * PostCSS will use the input source map to detect the original location.
+ * If you need the position in the PostCSS input, use `error.input.endColumn`.
+ */
+ endColumn?: number
+
+ /**
+ * Source line of the error's end, exclusive. Provided if the error pertains
+ * to a range.
+ *
+ * ```js
+ * error.endLine //=> 3
+ * error.input.endLine //=> 4
+ * ```
+ *
+ * PostCSS will use the input source map to detect the original location.
+ * If you need the position in the PostCSS input, use `error.input.endLine`.
+ */
+ endLine?: number
+
+ /**
+ * Absolute path to the broken file.
+ *
+ * ```js
+ * error.file //=> 'a.sass'
+ * error.input.file //=> 'a.css'
+ * ```
+ *
+ * PostCSS will use the input source map to detect the original location.
+ * If you need the position in the PostCSS input, use `error.input.file`.
+ */
+ file?: string
+
+ /**
+ * Input object with PostCSS internal information
+ * about input file. If input has source map
+ * from previous tool, PostCSS will use origin
+ * (for example, Sass) source. You can use this
+ * object to get PostCSS input source.
+ *
+ * ```js
+ * error.input.file //=> 'a.css'
+ * error.file //=> 'a.sass'
+ * ```
+ */
+ input?: FilePosition
+
+ /**
+ * Source line of the error.
+ *
+ * ```js
+ * error.line //=> 2
+ * error.input.line //=> 4
+ * ```
+ *
+ * PostCSS will use the input source map to detect the original location.
+ * If you need the position in the PostCSS input, use `error.input.line`.
+ */
+ line?: number
+
+ /**
+ * Full error text in the GNU error format
+ * with plugin, file, line and column.
+ *
+ * ```js
+ * error.message //=> 'a.css:1:1: Unclosed block'
+ * ```
+ */
+ message: string
+
+ /**
+ * Always equal to `'CssSyntaxError'`. You should always check error type
+ * by `error.name === 'CssSyntaxError'`
+ * instead of `error instanceof CssSyntaxError`,
+ * because npm could have several PostCSS versions.
+ *
+ * ```js
+ * if (error.name === 'CssSyntaxError') {
+ * error //=> CssSyntaxError
+ * }
+ * ```
+ */
+ name: 'CssSyntaxError'
+
+ /**
+ * Plugin name, if error came from plugin.
+ *
+ * ```js
+ * error.plugin //=> 'postcss-vars'
+ * ```
+ */
+ plugin?: string
+
+ /**
+ * Error message.
+ *
+ * ```js
+ * error.message //=> 'Unclosed block'
+ * ```
+ */
+ reason: string
+
+ /**
+ * Source code of the broken file.
+ *
+ * ```js
+ * error.source //=> 'a { b {} }'
+ * error.input.source //=> 'a b { }'
+ * ```
+ */
+ source?: string
+
+ stack: string
+
+ /**
+ * Instantiates a CSS syntax error. Can be instantiated for a single position
+ * or for a range.
+ * @param message Error message.
+ * @param lineOrStartPos If for a single position, the line number, or if for
+ * a range, the inclusive start position of the error.
+ * @param columnOrEndPos If for a single position, the column number, or if for
+ * a range, the exclusive end position of the error.
+ * @param source Source code of the broken file.
+ * @param file Absolute path to the broken file.
+ * @param plugin PostCSS plugin name, if error came from plugin.
+ */
+ constructor(
+ message: string,
+ lineOrStartPos?: CssSyntaxError.RangePosition | number,
+ columnOrEndPos?: CssSyntaxError.RangePosition | number,
+ source?: string,
+ file?: string,
+ plugin?: string
+ )
+
+ /**
+ * Returns a few lines of CSS source that caused the error.
+ *
+ * If the CSS has an input source map without `sourceContent`,
+ * this method will return an empty string.
+ *
+ * ```js
+ * error.showSourceCode() //=> " 4 | }
+ * // 5 | a {
+ * // > 6 | bad
+ * // | ^
+ * // 7 | }
+ * // 8 | b {"
+ * ```
+ *
+ * @param color Whether arrow will be colored red by terminal
+ * color codes. By default, PostCSS will detect
+ * color support by `process.stdout.isTTY`
+ * and `process.env.NODE_DISABLE_COLORS`.
+ * @return Few lines of CSS source that caused the error.
+ */
+ showSourceCode(color?: boolean): string
+
+ /**
+ * Returns error position, message and source code of the broken part.
+ *
+ * ```js
+ * error.toString() //=> "CssSyntaxError: app.css:1:1: Unclosed block
+ * // > 1 | a {
+ * // | ^"
+ * ```
+ *
+ * @return Error position, message and source code.
+ */
+ toString(): string
+}
+
+declare class CssSyntaxError extends CssSyntaxError_ {}
+
+export = CssSyntaxError
diff --git a/node_modules/postcss/lib/css-syntax-error.js b/node_modules/postcss/lib/css-syntax-error.js
new file mode 100644
index 0000000..275a4f6
--- /dev/null
+++ b/node_modules/postcss/lib/css-syntax-error.js
@@ -0,0 +1,133 @@
+'use strict'
+
+let pico = require('picocolors')
+
+let terminalHighlight = require('./terminal-highlight')
+
+class CssSyntaxError extends Error {
+ constructor(message, line, column, source, file, plugin) {
+ super(message)
+ this.name = 'CssSyntaxError'
+ this.reason = message
+
+ if (file) {
+ this.file = file
+ }
+ if (source) {
+ this.source = source
+ }
+ if (plugin) {
+ this.plugin = plugin
+ }
+ if (typeof line !== 'undefined' && typeof column !== 'undefined') {
+ if (typeof line === 'number') {
+ this.line = line
+ this.column = column
+ } else {
+ this.line = line.line
+ this.column = line.column
+ this.endLine = column.line
+ this.endColumn = column.column
+ }
+ }
+
+ this.setMessage()
+
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, CssSyntaxError)
+ }
+ }
+
+ setMessage() {
+ this.message = this.plugin ? this.plugin + ': ' : ''
+ this.message += this.file ? this.file : ''
+ if (typeof this.line !== 'undefined') {
+ this.message += ':' + this.line + ':' + this.column
+ }
+ this.message += ': ' + this.reason
+ }
+
+ showSourceCode(color) {
+ if (!this.source) return ''
+
+ let css = this.source
+ if (color == null) color = pico.isColorSupported
+
+ let aside = text => text
+ let mark = text => text
+ let highlight = text => text
+ if (color) {
+ let { bold, gray, red } = pico.createColors(true)
+ mark = text => bold(red(text))
+ aside = text => gray(text)
+ if (terminalHighlight) {
+ highlight = text => terminalHighlight(text)
+ }
+ }
+
+ let lines = css.split(/\r?\n/)
+ let start = Math.max(this.line - 3, 0)
+ let end = Math.min(this.line + 2, lines.length)
+ let maxWidth = String(end).length
+
+ return lines
+ .slice(start, end)
+ .map((line, index) => {
+ let number = start + 1 + index
+ let gutter = ' ' + (' ' + number).slice(-maxWidth) + ' | '
+ if (number === this.line) {
+ if (line.length > 160) {
+ let padding = 20
+ let subLineStart = Math.max(0, this.column - padding)
+ let subLineEnd = Math.max(
+ this.column + padding,
+ this.endColumn + padding
+ )
+ let subLine = line.slice(subLineStart, subLineEnd)
+
+ let spacing =
+ aside(gutter.replace(/\d/g, ' ')) +
+ line
+ .slice(0, Math.min(this.column - 1, padding - 1))
+ .replace(/[^\t]/g, ' ')
+
+ return (
+ mark('>') +
+ aside(gutter) +
+ highlight(subLine) +
+ '\n ' +
+ spacing +
+ mark('^')
+ )
+ }
+
+ let spacing =
+ aside(gutter.replace(/\d/g, ' ')) +
+ line.slice(0, this.column - 1).replace(/[^\t]/g, ' ')
+
+ return (
+ mark('>') +
+ aside(gutter) +
+ highlight(line) +
+ '\n ' +
+ spacing +
+ mark('^')
+ )
+ }
+
+ return ' ' + aside(gutter) + highlight(line)
+ })
+ .join('\n')
+ }
+
+ toString() {
+ let code = this.showSourceCode()
+ if (code) {
+ code = '\n\n' + code + '\n'
+ }
+ return this.name + ': ' + this.message + code
+ }
+}
+
+module.exports = CssSyntaxError
+CssSyntaxError.default = CssSyntaxError
diff --git a/node_modules/postcss/lib/declaration.d.ts b/node_modules/postcss/lib/declaration.d.ts
new file mode 100644
index 0000000..d489b42
--- /dev/null
+++ b/node_modules/postcss/lib/declaration.d.ts
@@ -0,0 +1,151 @@
+import { ContainerWithChildren } from './container.js'
+import Node from './node.js'
+
+declare namespace Declaration {
+ export interface DeclarationRaws extends Record {
+ /**
+ * The space symbols before the node. It also stores `*`
+ * and `_` symbols before the declaration (IE hack).
+ */
+ before?: string
+
+ /**
+ * The symbols between the property and value for declarations.
+ */
+ between?: string
+
+ /**
+ * The content of the important statement, if it is not just `!important`.
+ */
+ important?: string
+
+ /**
+ * Declaration value with comments.
+ */
+ value?: {
+ raw: string
+ value: string
+ }
+ }
+
+ export interface DeclarationProps {
+ /** Whether the declaration has an `!important` annotation. */
+ important?: boolean
+ /** Name of the declaration. */
+ prop: string
+ /** Information used to generate byte-to-byte equal node string as it was in the origin input. */
+ raws?: DeclarationRaws
+ /** Value of the declaration. */
+ value: string
+ }
+
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
+ export { Declaration_ as default }
+}
+
+/**
+ * It represents a class that handles
+ * [CSS declarations](https://developer.mozilla.org/en-US/docs/Web/CSS/Syntax#css_declarations)
+ *
+ * ```js
+ * Once (root, { Declaration }) {
+ * const color = new Declaration({ prop: 'color', value: 'black' })
+ * root.append(color)
+ * }
+ * ```
+ *
+ * ```js
+ * const root = postcss.parse('a { color: black }')
+ * const decl = root.first?.first
+ *
+ * decl.type //=> 'decl'
+ * decl.toString() //=> ' color: black'
+ * ```
+ */
+declare class Declaration_ extends Node {
+ parent: ContainerWithChildren | undefined
+ raws: Declaration.DeclarationRaws
+
+ type: 'decl'
+
+ /**
+ * It represents a specificity of the declaration.
+ *
+ * If true, the CSS declaration will have an
+ * [important](https://developer.mozilla.org/en-US/docs/Web/CSS/important)
+ * specifier.
+ *
+ * ```js
+ * const root = postcss.parse('a { color: black !important; color: red }')
+ *
+ * root.first.first.important //=> true
+ * root.first.last.important //=> undefined
+ * ```
+ */
+ get important(): boolean
+ set important(value: boolean)
+
+ /**
+ * The property name for a CSS declaration.
+ *
+ * ```js
+ * const root = postcss.parse('a { color: black }')
+ * const decl = root.first.first
+ *
+ * decl.prop //=> 'color'
+ * ```
+ */
+ get prop(): string
+
+ set prop(value: string)
+
+ /**
+ * The property value for a CSS declaration.
+ *
+ * Any CSS comments inside the value string will be filtered out.
+ * CSS comments present in the source value will be available in
+ * the `raws` property.
+ *
+ * Assigning new `value` would ignore the comments in `raws`
+ * property while compiling node to string.
+ *
+ * ```js
+ * const root = postcss.parse('a { color: black }')
+ * const decl = root.first.first
+ *
+ * decl.value //=> 'black'
+ * ```
+ */
+ get value(): string
+ set value(value: string)
+
+ /**
+ * It represents a getter that returns `true` if a declaration starts with
+ * `--` or `$`, which are used to declare variables in CSS and SASS/SCSS.
+ *
+ * ```js
+ * const root = postcss.parse(':root { --one: 1 }')
+ * const one = root.first.first
+ *
+ * one.variable //=> true
+ * ```
+ *
+ * ```js
+ * const root = postcss.parse('$one: 1')
+ * const one = root.first
+ *
+ * one.variable //=> true
+ * ```
+ */
+ get variable(): boolean
+ constructor(defaults?: Declaration.DeclarationProps)
+
+ assign(overrides: Declaration.DeclarationProps | object): this
+ clone(overrides?: Partial): this
+ cloneAfter(overrides?: Partial): this
+ cloneBefore(overrides?: Partial): this
+}
+
+declare class Declaration extends Declaration_ {}
+
+export = Declaration
diff --git a/node_modules/postcss/lib/declaration.js b/node_modules/postcss/lib/declaration.js
new file mode 100644
index 0000000..65a03aa
--- /dev/null
+++ b/node_modules/postcss/lib/declaration.js
@@ -0,0 +1,24 @@
+'use strict'
+
+let Node = require('./node')
+
+class Declaration extends Node {
+ get variable() {
+ return this.prop.startsWith('--') || this.prop[0] === '$'
+ }
+
+ constructor(defaults) {
+ if (
+ defaults &&
+ typeof defaults.value !== 'undefined' &&
+ typeof defaults.value !== 'string'
+ ) {
+ defaults = { ...defaults, value: String(defaults.value) }
+ }
+ super(defaults)
+ this.type = 'decl'
+ }
+}
+
+module.exports = Declaration
+Declaration.default = Declaration
diff --git a/node_modules/postcss/lib/document.d.ts b/node_modules/postcss/lib/document.d.ts
new file mode 100644
index 0000000..f9e8063
--- /dev/null
+++ b/node_modules/postcss/lib/document.d.ts
@@ -0,0 +1,69 @@
+import Container, { ContainerProps } from './container.js'
+import { ProcessOptions } from './postcss.js'
+import Result from './result.js'
+import Root from './root.js'
+
+declare namespace Document {
+ export interface DocumentProps extends ContainerProps {
+ nodes?: readonly Root[]
+
+ /**
+ * Information to generate byte-to-byte equal node string as it was
+ * in the origin input.
+ *
+ * Every parser saves its own properties.
+ */
+ raws?: Record
+ }
+
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
+ export { Document_ as default }
+}
+
+/**
+ * Represents a file and contains all its parsed nodes.
+ *
+ * **Experimental:** some aspects of this node could change within minor
+ * or patch version releases.
+ *
+ * ```js
+ * const document = htmlParser(
+ * ''
+ * )
+ * document.type //=> 'document'
+ * document.nodes.length //=> 2
+ * ```
+ */
+declare class Document_ extends Container {
+ nodes: Root[]
+ parent: undefined
+ type: 'document'
+
+ constructor(defaults?: Document.DocumentProps)
+
+ assign(overrides: Document.DocumentProps | object): this
+ clone(overrides?: Partial): this
+ cloneAfter(overrides?: Partial): this
+ cloneBefore(overrides?: Partial): this
+
+ /**
+ * Returns a `Result` instance representing the documentโs CSS roots.
+ *
+ * ```js
+ * const root1 = postcss.parse(css1, { from: 'a.css' })
+ * const root2 = postcss.parse(css2, { from: 'b.css' })
+ * const document = postcss.document()
+ * document.append(root1)
+ * document.append(root2)
+ * const result = document.toResult({ to: 'all.css', map: true })
+ * ```
+ *
+ * @param opts Options.
+ * @return Result with current documentโs CSS.
+ */
+ toResult(options?: ProcessOptions): Result
+}
+
+declare class Document extends Document_ {}
+
+export = Document
diff --git a/node_modules/postcss/lib/document.js b/node_modules/postcss/lib/document.js
new file mode 100644
index 0000000..4468991
--- /dev/null
+++ b/node_modules/postcss/lib/document.js
@@ -0,0 +1,33 @@
+'use strict'
+
+let Container = require('./container')
+
+let LazyResult, Processor
+
+class Document extends Container {
+ constructor(defaults) {
+ // type needs to be passed to super, otherwise child roots won't be normalized correctly
+ super({ type: 'document', ...defaults })
+
+ if (!this.nodes) {
+ this.nodes = []
+ }
+ }
+
+ toResult(opts = {}) {
+ let lazy = new LazyResult(new Processor(), this, opts)
+
+ return lazy.stringify()
+ }
+}
+
+Document.registerLazyResult = dependant => {
+ LazyResult = dependant
+}
+
+Document.registerProcessor = dependant => {
+ Processor = dependant
+}
+
+module.exports = Document
+Document.default = Document
diff --git a/node_modules/postcss/lib/fromJSON.d.ts b/node_modules/postcss/lib/fromJSON.d.ts
new file mode 100644
index 0000000..e1deedb
--- /dev/null
+++ b/node_modules/postcss/lib/fromJSON.d.ts
@@ -0,0 +1,9 @@
+import { JSONHydrator } from './postcss.js'
+
+interface FromJSON extends JSONHydrator {
+ default: FromJSON
+}
+
+declare const fromJSON: FromJSON
+
+export = fromJSON
diff --git a/node_modules/postcss/lib/fromJSON.js b/node_modules/postcss/lib/fromJSON.js
new file mode 100644
index 0000000..c9ac1a8
--- /dev/null
+++ b/node_modules/postcss/lib/fromJSON.js
@@ -0,0 +1,54 @@
+'use strict'
+
+let AtRule = require('./at-rule')
+let Comment = require('./comment')
+let Declaration = require('./declaration')
+let Input = require('./input')
+let PreviousMap = require('./previous-map')
+let Root = require('./root')
+let Rule = require('./rule')
+
+function fromJSON(json, inputs) {
+ if (Array.isArray(json)) return json.map(n => fromJSON(n))
+
+ let { inputs: ownInputs, ...defaults } = json
+ if (ownInputs) {
+ inputs = []
+ for (let input of ownInputs) {
+ let inputHydrated = { ...input, __proto__: Input.prototype }
+ if (inputHydrated.map) {
+ inputHydrated.map = {
+ ...inputHydrated.map,
+ __proto__: PreviousMap.prototype
+ }
+ }
+ inputs.push(inputHydrated)
+ }
+ }
+ if (defaults.nodes) {
+ defaults.nodes = json.nodes.map(n => fromJSON(n, inputs))
+ }
+ if (defaults.source) {
+ let { inputId, ...source } = defaults.source
+ defaults.source = source
+ if (inputId != null) {
+ defaults.source.input = inputs[inputId]
+ }
+ }
+ if (defaults.type === 'root') {
+ return new Root(defaults)
+ } else if (defaults.type === 'decl') {
+ return new Declaration(defaults)
+ } else if (defaults.type === 'rule') {
+ return new Rule(defaults)
+ } else if (defaults.type === 'comment') {
+ return new Comment(defaults)
+ } else if (defaults.type === 'atrule') {
+ return new AtRule(defaults)
+ } else {
+ throw new Error('Unknown node type: ' + json.type)
+ }
+}
+
+module.exports = fromJSON
+fromJSON.default = fromJSON
diff --git a/node_modules/postcss/lib/input.d.ts b/node_modules/postcss/lib/input.d.ts
new file mode 100644
index 0000000..3207da3
--- /dev/null
+++ b/node_modules/postcss/lib/input.d.ts
@@ -0,0 +1,227 @@
+import { CssSyntaxError, ProcessOptions } from './postcss.js'
+import PreviousMap from './previous-map.js'
+
+declare namespace Input {
+ export interface FilePosition {
+ /**
+ * Column of inclusive start position in source file.
+ */
+ column: number
+
+ /**
+ * Column of exclusive end position in source file.
+ */
+ endColumn?: number
+
+ /**
+ * Line of exclusive end position in source file.
+ */
+ endLine?: number
+
+ /**
+ * Offset of exclusive end position in source file.
+ */
+ endOffset?: number
+
+ /**
+ * Absolute path to the source file.
+ */
+ file?: string
+
+ /**
+ * Line of inclusive start position in source file.
+ */
+ line: number
+
+ /**
+ * Offset of inclusive start position in source file.
+ */
+ offset: number
+
+ /**
+ * Source code.
+ */
+ source?: string
+
+ /**
+ * URL for the source file.
+ */
+ url: string
+ }
+
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
+ export { Input_ as default }
+}
+
+/**
+ * Represents the source CSS.
+ *
+ * ```js
+ * const root = postcss.parse(css, { from: file })
+ * const input = root.source.input
+ * ```
+ */
+declare class Input_ {
+ /**
+ * Input CSS source.
+ *
+ * ```js
+ * const input = postcss.parse('a{}', { from: file }).input
+ * input.css //=> "a{}"
+ * ```
+ */
+ css: string
+
+ /**
+ * Input source with support for non-CSS documents.
+ *
+ * ```js
+ * const input = postcss.parse('a{}', { from: file, document: '' }).input
+ * input.document //=> ""
+ * input.css //=> "a{}"
+ * ```
+ */
+ document: string
+
+ /**
+ * The absolute path to the CSS source file defined
+ * with the `from` option.
+ *
+ * ```js
+ * const root = postcss.parse(css, { from: 'a.css' })
+ * root.source.input.file //=> '/home/ai/a.css'
+ * ```
+ */
+ file?: string
+
+ /**
+ * The flag to indicate whether or not the source code has Unicode BOM.
+ */
+ hasBOM: boolean
+
+ /**
+ * The unique ID of the CSS source. It will be created if `from` option
+ * is not provided (because PostCSS does not know the file path).
+ *
+ * ```js
+ * const root = postcss.parse(css)
+ * root.source.input.file //=> undefined
+ * root.source.input.id //=> ""
+ * ```
+ */
+ id?: string
+
+ /**
+ * The input source map passed from a compilation step before PostCSS
+ * (for example, from Sass compiler).
+ *
+ * ```js
+ * root.source.input.map.consumer().sources //=> ['a.sass']
+ * ```
+ */
+ map: PreviousMap
+
+ /**
+ * The CSS source identifier. Contains `Input#file` if the user
+ * set the `from` option, or `Input#id` if they did not.
+ *
+ * ```js
+ * const root = postcss.parse(css, { from: 'a.css' })
+ * root.source.input.from //=> "/home/ai/a.css"
+ *
+ * const root = postcss.parse(css)
+ * root.source.input.from //=> ""
+ * ```
+ */
+ get from(): string
+
+ /**
+ * @param css Input CSS source.
+ * @param opts Process options.
+ */
+ constructor(css: string, opts?: ProcessOptions)
+
+ /**
+ * Returns `CssSyntaxError` with information about the error and its position.
+ */
+ error(
+ message: string,
+ start:
+ | {
+ column: number
+ line: number
+ }
+ | {
+ offset: number
+ },
+ end:
+ | {
+ column: number
+ line: number
+ }
+ | {
+ offset: number
+ },
+ opts?: { plugin?: CssSyntaxError['plugin'] }
+ ): CssSyntaxError
+ error(
+ message: string,
+ line: number,
+ column: number,
+ opts?: { plugin?: CssSyntaxError['plugin'] }
+ ): CssSyntaxError
+ error(
+ message: string,
+ offset: number,
+ opts?: { plugin?: CssSyntaxError['plugin'] }
+ ): CssSyntaxError
+
+ /**
+ * Converts source line and column to offset.
+ *
+ * @param line Source line.
+ * @param column Source column.
+ * @return Source offset.
+ */
+ fromLineAndColumn(line: number, column: number): number
+
+ /**
+ * Converts source offset to line and column.
+ *
+ * @param offset Source offset.
+ */
+ fromOffset(offset: number): { col: number; line: number } | null
+
+ /**
+ * Reads the input source map and returns a symbol position
+ * in the input source (e.g., in a Sass file that was compiled
+ * to CSS before being passed to PostCSS). Optionally takes an
+ * end position, exclusive.
+ *
+ * ```js
+ * root.source.input.origin(1, 1) //=> { file: 'a.css', line: 3, column: 1 }
+ * root.source.input.origin(1, 1, 1, 4)
+ * //=> { file: 'a.css', line: 3, column: 1, endLine: 3, endColumn: 4 }
+ * ```
+ *
+ * @param line Line for inclusive start position in input CSS.
+ * @param column Column for inclusive start position in input CSS.
+ * @param endLine Line for exclusive end position in input CSS.
+ * @param endColumn Column for exclusive end position in input CSS.
+ *
+ * @return Position in input source.
+ */
+ origin(
+ line: number,
+ column: number,
+ endLine?: number,
+ endColumn?: number
+ ): false | Input.FilePosition
+
+ /** Converts this to a JSON-friendly object representation. */
+ toJSON(): object
+}
+
+declare class Input extends Input_ {}
+
+export = Input
diff --git a/node_modules/postcss/lib/input.js b/node_modules/postcss/lib/input.js
new file mode 100644
index 0000000..bb0ccf5
--- /dev/null
+++ b/node_modules/postcss/lib/input.js
@@ -0,0 +1,265 @@
+'use strict'
+
+let { nanoid } = require('nanoid/non-secure')
+let { isAbsolute, resolve } = require('path')
+let { SourceMapConsumer, SourceMapGenerator } = require('source-map-js')
+let { fileURLToPath, pathToFileURL } = require('url')
+
+let CssSyntaxError = require('./css-syntax-error')
+let PreviousMap = require('./previous-map')
+let terminalHighlight = require('./terminal-highlight')
+
+let lineToIndexCache = Symbol('lineToIndexCache')
+
+let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator)
+let pathAvailable = Boolean(resolve && isAbsolute)
+
+function getLineToIndex(input) {
+ if (input[lineToIndexCache]) return input[lineToIndexCache]
+ let lines = input.css.split('\n')
+ let lineToIndex = new Array(lines.length)
+ let prevIndex = 0
+
+ for (let i = 0, l = lines.length; i < l; i++) {
+ lineToIndex[i] = prevIndex
+ prevIndex += lines[i].length + 1
+ }
+
+ input[lineToIndexCache] = lineToIndex
+ return lineToIndex
+}
+
+class Input {
+ get from() {
+ return this.file || this.id
+ }
+
+ constructor(css, opts = {}) {
+ if (
+ css === null ||
+ typeof css === 'undefined' ||
+ (typeof css === 'object' && !css.toString)
+ ) {
+ throw new Error(`PostCSS received ${css} instead of CSS string`)
+ }
+
+ this.css = css.toString()
+
+ if (this.css[0] === '\uFEFF' || this.css[0] === '\uFFFE') {
+ this.hasBOM = true
+ this.css = this.css.slice(1)
+ } else {
+ this.hasBOM = false
+ }
+
+ this.document = this.css
+ if (opts.document) this.document = opts.document.toString()
+
+ if (opts.from) {
+ if (
+ !pathAvailable ||
+ /^\w+:\/\//.test(opts.from) ||
+ isAbsolute(opts.from)
+ ) {
+ this.file = opts.from
+ } else {
+ this.file = resolve(opts.from)
+ }
+ }
+
+ if (pathAvailable && sourceMapAvailable) {
+ let map = new PreviousMap(this.css, opts)
+ if (map.text) {
+ this.map = map
+ let file = map.consumer().file
+ if (!this.file && file) this.file = this.mapResolve(file)
+ }
+ }
+
+ if (!this.file) {
+ this.id = ''
+ }
+ if (this.map) this.map.file = this.from
+ }
+
+ error(message, line, column, opts = {}) {
+ let endColumn, endLine, endOffset, offset, result
+
+ if (line && typeof line === 'object') {
+ let start = line
+ let end = column
+ if (typeof start.offset === 'number') {
+ offset = start.offset
+ let pos = this.fromOffset(offset)
+ line = pos.line
+ column = pos.col
+ } else {
+ line = start.line
+ column = start.column
+ offset = this.fromLineAndColumn(line, column)
+ }
+ if (typeof end.offset === 'number') {
+ endOffset = end.offset
+ let pos = this.fromOffset(endOffset)
+ endLine = pos.line
+ endColumn = pos.col
+ } else {
+ endLine = end.line
+ endColumn = end.column
+ endOffset = this.fromLineAndColumn(end.line, end.column)
+ }
+ } else if (!column) {
+ offset = line
+ let pos = this.fromOffset(offset)
+ line = pos.line
+ column = pos.col
+ } else {
+ offset = this.fromLineAndColumn(line, column)
+ }
+
+ let origin = this.origin(line, column, endLine, endColumn)
+ if (origin) {
+ result = new CssSyntaxError(
+ message,
+ origin.endLine === undefined
+ ? origin.line
+ : { column: origin.column, line: origin.line },
+ origin.endLine === undefined
+ ? origin.column
+ : { column: origin.endColumn, line: origin.endLine },
+ origin.source,
+ origin.file,
+ opts.plugin
+ )
+ } else {
+ result = new CssSyntaxError(
+ message,
+ endLine === undefined ? line : { column, line },
+ endLine === undefined ? column : { column: endColumn, line: endLine },
+ this.css,
+ this.file,
+ opts.plugin
+ )
+ }
+
+ result.input = { column, endColumn, endLine, endOffset, line, offset, source: this.css }
+ if (this.file) {
+ if (pathToFileURL) {
+ result.input.url = pathToFileURL(this.file).toString()
+ }
+ result.input.file = this.file
+ }
+
+ return result
+ }
+
+ fromLineAndColumn(line, column) {
+ let lineToIndex = getLineToIndex(this)
+ let index = lineToIndex[line - 1]
+ return index + column - 1
+ }
+
+ fromOffset(offset) {
+ let lineToIndex = getLineToIndex(this)
+ let lastLine = lineToIndex[lineToIndex.length - 1]
+
+ let min = 0
+ if (offset >= lastLine) {
+ min = lineToIndex.length - 1
+ } else {
+ let max = lineToIndex.length - 2
+ let mid
+ while (min < max) {
+ mid = min + ((max - min) >> 1)
+ if (offset < lineToIndex[mid]) {
+ max = mid - 1
+ } else if (offset >= lineToIndex[mid + 1]) {
+ min = mid + 1
+ } else {
+ min = mid
+ break
+ }
+ }
+ }
+ return {
+ col: offset - lineToIndex[min] + 1,
+ line: min + 1
+ }
+ }
+
+ mapResolve(file) {
+ if (/^\w+:\/\//.test(file)) {
+ return file
+ }
+ return resolve(this.map.consumer().sourceRoot || this.map.root || '.', file)
+ }
+
+ origin(line, column, endLine, endColumn) {
+ if (!this.map) return false
+ let consumer = this.map.consumer()
+
+ let from = consumer.originalPositionFor({ column, line })
+ if (!from.source) return false
+
+ let to
+ if (typeof endLine === 'number') {
+ to = consumer.originalPositionFor({ column: endColumn, line: endLine })
+ }
+
+ let fromUrl
+
+ if (isAbsolute(from.source)) {
+ fromUrl = pathToFileURL(from.source)
+ } else {
+ fromUrl = new URL(
+ from.source,
+ this.map.consumer().sourceRoot || pathToFileURL(this.map.mapFile)
+ )
+ }
+
+ let result = {
+ column: from.column,
+ endColumn: to && to.column,
+ endLine: to && to.line,
+ line: from.line,
+ url: fromUrl.toString()
+ }
+
+ if (fromUrl.protocol === 'file:') {
+ if (fileURLToPath) {
+ result.file = fileURLToPath(fromUrl)
+ } else {
+ /* c8 ignore next 2 */
+ throw new Error(`file: protocol is not available in this PostCSS build`)
+ }
+ }
+
+ let source = consumer.sourceContentFor(from.source)
+ if (source) result.source = source
+
+ return result
+ }
+
+ toJSON() {
+ let json = {}
+ for (let name of ['hasBOM', 'css', 'file', 'id']) {
+ if (this[name] != null) {
+ json[name] = this[name]
+ }
+ }
+ if (this.map) {
+ json.map = { ...this.map }
+ if (json.map.consumerCache) {
+ json.map.consumerCache = undefined
+ }
+ }
+ return json
+ }
+}
+
+module.exports = Input
+Input.default = Input
+
+if (terminalHighlight && terminalHighlight.registerInput) {
+ terminalHighlight.registerInput(Input)
+}
diff --git a/node_modules/postcss/lib/lazy-result.d.ts b/node_modules/postcss/lib/lazy-result.d.ts
new file mode 100644
index 0000000..2eb7279
--- /dev/null
+++ b/node_modules/postcss/lib/lazy-result.d.ts
@@ -0,0 +1,190 @@
+import Document from './document.js'
+import { SourceMap } from './postcss.js'
+import Processor from './processor.js'
+import Result, { Message, ResultOptions } from './result.js'
+import Root from './root.js'
+import Warning from './warning.js'
+
+declare namespace LazyResult {
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
+ export { LazyResult_ as default }
+}
+
+/**
+ * A Promise proxy for the result of PostCSS transformations.
+ *
+ * A `LazyResult` instance is returned by `Processor#process`.
+ *
+ * ```js
+ * const lazy = postcss([autoprefixer]).process(css)
+ * ```
+ */
+declare class LazyResult_
+ implements PromiseLike>
+{
+ /**
+ * Processes input CSS through synchronous and asynchronous plugins
+ * and calls onRejected for each error thrown in any plugin.
+ *
+ * It implements standard Promise API.
+ *
+ * ```js
+ * postcss([autoprefixer]).process(css).then(result => {
+ * console.log(result.css)
+ * }).catch(error => {
+ * console.error(error)
+ * })
+ * ```
+ */
+ catch: Promise>['catch']
+
+ /**
+ * Processes input CSS through synchronous and asynchronous plugins
+ * and calls onFinally on any error or when all plugins will finish work.
+ *
+ * It implements standard Promise API.
+ *
+ * ```js
+ * postcss([autoprefixer]).process(css).finally(() => {
+ * console.log('processing ended')
+ * })
+ * ```
+ */
+ finally: Promise>['finally']
+
+ /**
+ * Processes input CSS through synchronous and asynchronous plugins
+ * and calls `onFulfilled` with a Result instance. If a plugin throws
+ * an error, the `onRejected` callback will be executed.
+ *
+ * It implements standard Promise API.
+ *
+ * ```js
+ * postcss([autoprefixer]).process(css, { from: cssPath }).then(result => {
+ * console.log(result.css)
+ * })
+ * ```
+ */
+ then: Promise>['then']
+
+ /**
+ * An alias for the `css` property. Use it with syntaxes
+ * that generate non-CSS output.
+ *
+ * This property will only work with synchronous plugins.
+ * If the processor contains any asynchronous plugins
+ * it will throw an error.
+ *
+ * PostCSS runners should always use `LazyResult#then`.
+ */
+ get content(): string
+
+ /**
+ * Processes input CSS through synchronous plugins, converts `Root`
+ * to a CSS string and returns `Result#css`.
+ *
+ * This property will only work with synchronous plugins.
+ * If the processor contains any asynchronous plugins
+ * it will throw an error.
+ *
+ * PostCSS runners should always use `LazyResult#then`.
+ */
+ get css(): string
+
+ /**
+ * Processes input CSS through synchronous plugins
+ * and returns `Result#map`.
+ *
+ * This property will only work with synchronous plugins.
+ * If the processor contains any asynchronous plugins
+ * it will throw an error.
+ *
+ * PostCSS runners should always use `LazyResult#then`.
+ */
+ get map(): SourceMap
+
+ /**
+ * Processes input CSS through synchronous plugins
+ * and returns `Result#messages`.
+ *
+ * This property will only work with synchronous plugins. If the processor
+ * contains any asynchronous plugins it will throw an error.
+ *
+ * PostCSS runners should always use `LazyResult#then`.
+ */
+ get messages(): Message[]
+
+ /**
+ * Options from the `Processor#process` call.
+ */
+ get opts(): ResultOptions
+
+ /**
+ * Returns a `Processor` instance, which will be used
+ * for CSS transformations.
+ */
+ get processor(): Processor
+
+ /**
+ * Processes input CSS through synchronous plugins
+ * and returns `Result#root`.
+ *
+ * This property will only work with synchronous plugins. If the processor
+ * contains any asynchronous plugins it will throw an error.
+ *
+ * PostCSS runners should always use `LazyResult#then`.
+ */
+ get root(): RootNode
+
+ /**
+ * Returns the default string description of an object.
+ * Required to implement the Promise interface.
+ */
+ get [Symbol.toStringTag](): string
+
+ /**
+ * @param processor Processor used for this transformation.
+ * @param css CSS to parse and transform.
+ * @param opts Options from the `Processor#process` or `Root#toResult`.
+ */
+ constructor(processor: Processor, css: string, opts: ResultOptions)
+
+ /**
+ * Run plugin in async way and return `Result`.
+ *
+ * @return Result with output content.
+ */
+ async(): Promise>
+
+ /**
+ * Run plugin in sync way and return `Result`.
+ *
+ * @return Result with output content.
+ */
+ sync(): Result
+
+ /**
+ * Alias for the `LazyResult#css` property.
+ *
+ * ```js
+ * lazy + '' === lazy.css
+ * ```
+ *
+ * @return Output CSS.
+ */
+ toString(): string
+
+ /**
+ * Processes input CSS through synchronous plugins
+ * and calls `Result#warnings`.
+ *
+ * @return Warnings from plugins.
+ */
+ warnings(): Warning[]
+}
+
+declare class LazyResult<
+ RootNode = Document | Root
+> extends LazyResult_ {}
+
+export = LazyResult
diff --git a/node_modules/postcss/lib/lazy-result.js b/node_modules/postcss/lib/lazy-result.js
new file mode 100644
index 0000000..1ea52b8
--- /dev/null
+++ b/node_modules/postcss/lib/lazy-result.js
@@ -0,0 +1,550 @@
+'use strict'
+
+let Container = require('./container')
+let Document = require('./document')
+let MapGenerator = require('./map-generator')
+let parse = require('./parse')
+let Result = require('./result')
+let Root = require('./root')
+let stringify = require('./stringify')
+let { isClean, my } = require('./symbols')
+let warnOnce = require('./warn-once')
+
+const TYPE_TO_CLASS_NAME = {
+ atrule: 'AtRule',
+ comment: 'Comment',
+ decl: 'Declaration',
+ document: 'Document',
+ root: 'Root',
+ rule: 'Rule'
+}
+
+const PLUGIN_PROPS = {
+ AtRule: true,
+ AtRuleExit: true,
+ Comment: true,
+ CommentExit: true,
+ Declaration: true,
+ DeclarationExit: true,
+ Document: true,
+ DocumentExit: true,
+ Once: true,
+ OnceExit: true,
+ postcssPlugin: true,
+ prepare: true,
+ Root: true,
+ RootExit: true,
+ Rule: true,
+ RuleExit: true
+}
+
+const NOT_VISITORS = {
+ Once: true,
+ postcssPlugin: true,
+ prepare: true
+}
+
+const CHILDREN = 0
+
+function isPromise(obj) {
+ return typeof obj === 'object' && typeof obj.then === 'function'
+}
+
+function getEvents(node) {
+ let key = false
+ let type = TYPE_TO_CLASS_NAME[node.type]
+ if (node.type === 'decl') {
+ key = node.prop.toLowerCase()
+ } else if (node.type === 'atrule') {
+ key = node.name.toLowerCase()
+ }
+
+ if (key && node.append) {
+ return [
+ type,
+ type + '-' + key,
+ CHILDREN,
+ type + 'Exit',
+ type + 'Exit-' + key
+ ]
+ } else if (key) {
+ return [type, type + '-' + key, type + 'Exit', type + 'Exit-' + key]
+ } else if (node.append) {
+ return [type, CHILDREN, type + 'Exit']
+ } else {
+ return [type, type + 'Exit']
+ }
+}
+
+function toStack(node) {
+ let events
+ if (node.type === 'document') {
+ events = ['Document', CHILDREN, 'DocumentExit']
+ } else if (node.type === 'root') {
+ events = ['Root', CHILDREN, 'RootExit']
+ } else {
+ events = getEvents(node)
+ }
+
+ return {
+ eventIndex: 0,
+ events,
+ iterator: 0,
+ node,
+ visitorIndex: 0,
+ visitors: []
+ }
+}
+
+function cleanMarks(node) {
+ node[isClean] = false
+ if (node.nodes) node.nodes.forEach(i => cleanMarks(i))
+ return node
+}
+
+let postcss = {}
+
+class LazyResult {
+ get content() {
+ return this.stringify().content
+ }
+
+ get css() {
+ return this.stringify().css
+ }
+
+ get map() {
+ return this.stringify().map
+ }
+
+ get messages() {
+ return this.sync().messages
+ }
+
+ get opts() {
+ return this.result.opts
+ }
+
+ get processor() {
+ return this.result.processor
+ }
+
+ get root() {
+ return this.sync().root
+ }
+
+ get [Symbol.toStringTag]() {
+ return 'LazyResult'
+ }
+
+ constructor(processor, css, opts) {
+ this.stringified = false
+ this.processed = false
+
+ let root
+ if (
+ typeof css === 'object' &&
+ css !== null &&
+ (css.type === 'root' || css.type === 'document')
+ ) {
+ root = cleanMarks(css)
+ } else if (css instanceof LazyResult || css instanceof Result) {
+ root = cleanMarks(css.root)
+ if (css.map) {
+ if (typeof opts.map === 'undefined') opts.map = {}
+ if (!opts.map.inline) opts.map.inline = false
+ opts.map.prev = css.map
+ }
+ } else {
+ let parser = parse
+ if (opts.syntax) parser = opts.syntax.parse
+ if (opts.parser) parser = opts.parser
+ if (parser.parse) parser = parser.parse
+
+ try {
+ root = parser(css, opts)
+ } catch (error) {
+ this.processed = true
+ this.error = error
+ }
+
+ if (root && !root[my]) {
+ /* c8 ignore next 2 */
+ Container.rebuild(root)
+ }
+ }
+
+ this.result = new Result(processor, root, opts)
+ this.helpers = { ...postcss, postcss, result: this.result }
+ this.plugins = this.processor.plugins.map(plugin => {
+ if (typeof plugin === 'object' && plugin.prepare) {
+ return { ...plugin, ...plugin.prepare(this.result) }
+ } else {
+ return plugin
+ }
+ })
+ }
+
+ async() {
+ if (this.error) return Promise.reject(this.error)
+ if (this.processed) return Promise.resolve(this.result)
+ if (!this.processing) {
+ this.processing = this.runAsync()
+ }
+ return this.processing
+ }
+
+ catch(onRejected) {
+ return this.async().catch(onRejected)
+ }
+
+ finally(onFinally) {
+ return this.async().then(onFinally, onFinally)
+ }
+
+ getAsyncError() {
+ throw new Error('Use process(css).then(cb) to work with async plugins')
+ }
+
+ handleError(error, node) {
+ let plugin = this.result.lastPlugin
+ try {
+ if (node) node.addToError(error)
+ this.error = error
+ if (error.name === 'CssSyntaxError' && !error.plugin) {
+ error.plugin = plugin.postcssPlugin
+ error.setMessage()
+ } else if (plugin.postcssVersion) {
+ if (process.env.NODE_ENV !== 'production') {
+ let pluginName = plugin.postcssPlugin
+ let pluginVer = plugin.postcssVersion
+ let runtimeVer = this.result.processor.version
+ let a = pluginVer.split('.')
+ let b = runtimeVer.split('.')
+
+ if (a[0] !== b[0] || parseInt(a[1]) > parseInt(b[1])) {
+ // eslint-disable-next-line no-console
+ console.error(
+ 'Unknown error from PostCSS plugin. Your current PostCSS ' +
+ 'version is ' +
+ runtimeVer +
+ ', but ' +
+ pluginName +
+ ' uses ' +
+ pluginVer +
+ '. Perhaps this is the source of the error below.'
+ )
+ }
+ }
+ }
+ } catch (err) {
+ /* c8 ignore next 3 */
+ // eslint-disable-next-line no-console
+ if (console && console.error) console.error(err)
+ }
+ return error
+ }
+
+ prepareVisitors() {
+ this.listeners = {}
+ let add = (plugin, type, cb) => {
+ if (!this.listeners[type]) this.listeners[type] = []
+ this.listeners[type].push([plugin, cb])
+ }
+ for (let plugin of this.plugins) {
+ if (typeof plugin === 'object') {
+ for (let event in plugin) {
+ if (!PLUGIN_PROPS[event] && /^[A-Z]/.test(event)) {
+ throw new Error(
+ `Unknown event ${event} in ${plugin.postcssPlugin}. ` +
+ `Try to update PostCSS (${this.processor.version} now).`
+ )
+ }
+ if (!NOT_VISITORS[event]) {
+ if (typeof plugin[event] === 'object') {
+ for (let filter in plugin[event]) {
+ if (filter === '*') {
+ add(plugin, event, plugin[event][filter])
+ } else {
+ add(
+ plugin,
+ event + '-' + filter.toLowerCase(),
+ plugin[event][filter]
+ )
+ }
+ }
+ } else if (typeof plugin[event] === 'function') {
+ add(plugin, event, plugin[event])
+ }
+ }
+ }
+ }
+ }
+ this.hasListener = Object.keys(this.listeners).length > 0
+ }
+
+ async runAsync() {
+ this.plugin = 0
+ for (let i = 0; i < this.plugins.length; i++) {
+ let plugin = this.plugins[i]
+ let promise = this.runOnRoot(plugin)
+ if (isPromise(promise)) {
+ try {
+ await promise
+ } catch (error) {
+ throw this.handleError(error)
+ }
+ }
+ }
+
+ this.prepareVisitors()
+ if (this.hasListener) {
+ let root = this.result.root
+ while (!root[isClean]) {
+ root[isClean] = true
+ let stack = [toStack(root)]
+ while (stack.length > 0) {
+ let promise = this.visitTick(stack)
+ if (isPromise(promise)) {
+ try {
+ await promise
+ } catch (e) {
+ let node = stack[stack.length - 1].node
+ throw this.handleError(e, node)
+ }
+ }
+ }
+ }
+
+ if (this.listeners.OnceExit) {
+ for (let [plugin, visitor] of this.listeners.OnceExit) {
+ this.result.lastPlugin = plugin
+ try {
+ if (root.type === 'document') {
+ let roots = root.nodes.map(subRoot =>
+ visitor(subRoot, this.helpers)
+ )
+
+ await Promise.all(roots)
+ } else {
+ await visitor(root, this.helpers)
+ }
+ } catch (e) {
+ throw this.handleError(e)
+ }
+ }
+ }
+ }
+
+ this.processed = true
+ return this.stringify()
+ }
+
+ runOnRoot(plugin) {
+ this.result.lastPlugin = plugin
+ try {
+ if (typeof plugin === 'object' && plugin.Once) {
+ if (this.result.root.type === 'document') {
+ let roots = this.result.root.nodes.map(root =>
+ plugin.Once(root, this.helpers)
+ )
+
+ if (isPromise(roots[0])) {
+ return Promise.all(roots)
+ }
+
+ return roots
+ }
+
+ return plugin.Once(this.result.root, this.helpers)
+ } else if (typeof plugin === 'function') {
+ return plugin(this.result.root, this.result)
+ }
+ } catch (error) {
+ throw this.handleError(error)
+ }
+ }
+
+ stringify() {
+ if (this.error) throw this.error
+ if (this.stringified) return this.result
+ this.stringified = true
+
+ this.sync()
+
+ let opts = this.result.opts
+ let str = stringify
+ if (opts.syntax) str = opts.syntax.stringify
+ if (opts.stringifier) str = opts.stringifier
+ if (str.stringify) str = str.stringify
+
+ let map = new MapGenerator(str, this.result.root, this.result.opts)
+ let data = map.generate()
+ this.result.css = data[0]
+ this.result.map = data[1]
+
+ return this.result
+ }
+
+ sync() {
+ if (this.error) throw this.error
+ if (this.processed) return this.result
+ this.processed = true
+
+ if (this.processing) {
+ throw this.getAsyncError()
+ }
+
+ for (let plugin of this.plugins) {
+ let promise = this.runOnRoot(plugin)
+ if (isPromise(promise)) {
+ throw this.getAsyncError()
+ }
+ }
+
+ this.prepareVisitors()
+ if (this.hasListener) {
+ let root = this.result.root
+ while (!root[isClean]) {
+ root[isClean] = true
+ this.walkSync(root)
+ }
+ if (this.listeners.OnceExit) {
+ if (root.type === 'document') {
+ for (let subRoot of root.nodes) {
+ this.visitSync(this.listeners.OnceExit, subRoot)
+ }
+ } else {
+ this.visitSync(this.listeners.OnceExit, root)
+ }
+ }
+ }
+
+ return this.result
+ }
+
+ then(onFulfilled, onRejected) {
+ if (process.env.NODE_ENV !== 'production') {
+ if (!('from' in this.opts)) {
+ warnOnce(
+ 'Without `from` option PostCSS could generate wrong source map ' +
+ 'and will not find Browserslist config. Set it to CSS file path ' +
+ 'or to `undefined` to prevent this warning.'
+ )
+ }
+ }
+ return this.async().then(onFulfilled, onRejected)
+ }
+
+ toString() {
+ return this.css
+ }
+
+ visitSync(visitors, node) {
+ for (let [plugin, visitor] of visitors) {
+ this.result.lastPlugin = plugin
+ let promise
+ try {
+ promise = visitor(node, this.helpers)
+ } catch (e) {
+ throw this.handleError(e, node.proxyOf)
+ }
+ if (node.type !== 'root' && node.type !== 'document' && !node.parent) {
+ return true
+ }
+ if (isPromise(promise)) {
+ throw this.getAsyncError()
+ }
+ }
+ }
+
+ visitTick(stack) {
+ let visit = stack[stack.length - 1]
+ let { node, visitors } = visit
+
+ if (node.type !== 'root' && node.type !== 'document' && !node.parent) {
+ stack.pop()
+ return
+ }
+
+ if (visitors.length > 0 && visit.visitorIndex < visitors.length) {
+ let [plugin, visitor] = visitors[visit.visitorIndex]
+ visit.visitorIndex += 1
+ if (visit.visitorIndex === visitors.length) {
+ visit.visitors = []
+ visit.visitorIndex = 0
+ }
+ this.result.lastPlugin = plugin
+ try {
+ return visitor(node.toProxy(), this.helpers)
+ } catch (e) {
+ throw this.handleError(e, node)
+ }
+ }
+
+ if (visit.iterator !== 0) {
+ let iterator = visit.iterator
+ let child
+ while ((child = node.nodes[node.indexes[iterator]])) {
+ node.indexes[iterator] += 1
+ if (!child[isClean]) {
+ child[isClean] = true
+ stack.push(toStack(child))
+ return
+ }
+ }
+ visit.iterator = 0
+ delete node.indexes[iterator]
+ }
+
+ let events = visit.events
+ while (visit.eventIndex < events.length) {
+ let event = events[visit.eventIndex]
+ visit.eventIndex += 1
+ if (event === CHILDREN) {
+ if (node.nodes && node.nodes.length) {
+ node[isClean] = true
+ visit.iterator = node.getIterator()
+ }
+ return
+ } else if (this.listeners[event]) {
+ visit.visitors = this.listeners[event]
+ return
+ }
+ }
+ stack.pop()
+ }
+
+ walkSync(node) {
+ node[isClean] = true
+ let events = getEvents(node)
+ for (let event of events) {
+ if (event === CHILDREN) {
+ if (node.nodes) {
+ node.each(child => {
+ if (!child[isClean]) this.walkSync(child)
+ })
+ }
+ } else {
+ let visitors = this.listeners[event]
+ if (visitors) {
+ if (this.visitSync(visitors, node.toProxy())) return
+ }
+ }
+ }
+ }
+
+ warnings() {
+ return this.sync().warnings()
+ }
+}
+
+LazyResult.registerPostcss = dependant => {
+ postcss = dependant
+}
+
+module.exports = LazyResult
+LazyResult.default = LazyResult
+
+Root.registerLazyResult(LazyResult)
+Document.registerLazyResult(LazyResult)
diff --git a/node_modules/postcss/lib/list.d.ts b/node_modules/postcss/lib/list.d.ts
new file mode 100644
index 0000000..e262ad3
--- /dev/null
+++ b/node_modules/postcss/lib/list.d.ts
@@ -0,0 +1,60 @@
+declare namespace list {
+ type List = {
+ /**
+ * Safely splits comma-separated values (such as those for `transition-*`
+ * and `background` properties).
+ *
+ * ```js
+ * Once (root, { list }) {
+ * list.comma('black, linear-gradient(white, black)')
+ * //=> ['black', 'linear-gradient(white, black)']
+ * }
+ * ```
+ *
+ * @param str Comma-separated values.
+ * @return Split values.
+ */
+ comma(str: string): string[]
+
+ default: List
+
+ /**
+ * Safely splits space-separated values (such as those for `background`,
+ * `border-radius`, and other shorthand properties).
+ *
+ * ```js
+ * Once (root, { list }) {
+ * list.space('1px calc(10% + 1px)') //=> ['1px', 'calc(10% + 1px)']
+ * }
+ * ```
+ *
+ * @param str Space-separated values.
+ * @return Split values.
+ */
+ space(str: string): string[]
+
+ /**
+ * Safely splits values.
+ *
+ * ```js
+ * Once (root, { list }) {
+ * list.split('1px calc(10% + 1px)', [' ', '\n', '\t']) //=> ['1px', 'calc(10% + 1px)']
+ * }
+ * ```
+ *
+ * @param string separated values.
+ * @param separators array of separators.
+ * @param last boolean indicator.
+ * @return Split values.
+ */
+ split(
+ string: string,
+ separators: readonly string[],
+ last: boolean
+ ): string[]
+ }
+}
+
+declare const list: list.List
+
+export = list
diff --git a/node_modules/postcss/lib/list.js b/node_modules/postcss/lib/list.js
new file mode 100644
index 0000000..1b31f98
--- /dev/null
+++ b/node_modules/postcss/lib/list.js
@@ -0,0 +1,58 @@
+'use strict'
+
+let list = {
+ comma(string) {
+ return list.split(string, [','], true)
+ },
+
+ space(string) {
+ let spaces = [' ', '\n', '\t']
+ return list.split(string, spaces)
+ },
+
+ split(string, separators, last) {
+ let array = []
+ let current = ''
+ let split = false
+
+ let func = 0
+ let inQuote = false
+ let prevQuote = ''
+ let escape = false
+
+ for (let letter of string) {
+ if (escape) {
+ escape = false
+ } else if (letter === '\\') {
+ escape = true
+ } else if (inQuote) {
+ if (letter === prevQuote) {
+ inQuote = false
+ }
+ } else if (letter === '"' || letter === "'") {
+ inQuote = true
+ prevQuote = letter
+ } else if (letter === '(') {
+ func += 1
+ } else if (letter === ')') {
+ if (func > 0) func -= 1
+ } else if (func === 0) {
+ if (separators.includes(letter)) split = true
+ }
+
+ if (split) {
+ if (current !== '') array.push(current.trim())
+ current = ''
+ split = false
+ } else {
+ current += letter
+ }
+ }
+
+ if (last || current !== '') array.push(current.trim())
+ return array
+ }
+}
+
+module.exports = list
+list.default = list
diff --git a/node_modules/postcss/lib/map-generator.js b/node_modules/postcss/lib/map-generator.js
new file mode 100644
index 0000000..89069d3
--- /dev/null
+++ b/node_modules/postcss/lib/map-generator.js
@@ -0,0 +1,368 @@
+'use strict'
+
+let { dirname, relative, resolve, sep } = require('path')
+let { SourceMapConsumer, SourceMapGenerator } = require('source-map-js')
+let { pathToFileURL } = require('url')
+
+let Input = require('./input')
+
+let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator)
+let pathAvailable = Boolean(dirname && resolve && relative && sep)
+
+class MapGenerator {
+ constructor(stringify, root, opts, cssString) {
+ this.stringify = stringify
+ this.mapOpts = opts.map || {}
+ this.root = root
+ this.opts = opts
+ this.css = cssString
+ this.originalCSS = cssString
+ this.usesFileUrls = !this.mapOpts.from && this.mapOpts.absolute
+
+ this.memoizedFileURLs = new Map()
+ this.memoizedPaths = new Map()
+ this.memoizedURLs = new Map()
+ }
+
+ addAnnotation() {
+ let content
+
+ if (this.isInline()) {
+ content =
+ 'data:application/json;base64,' + this.toBase64(this.map.toString())
+ } else if (typeof this.mapOpts.annotation === 'string') {
+ content = this.mapOpts.annotation
+ } else if (typeof this.mapOpts.annotation === 'function') {
+ content = this.mapOpts.annotation(this.opts.to, this.root)
+ } else {
+ content = this.outputFile() + '.map'
+ }
+ let eol = '\n'
+ if (this.css.includes('\r\n')) eol = '\r\n'
+
+ this.css += eol + '/*# sourceMappingURL=' + content + ' */'
+ }
+
+ applyPrevMaps() {
+ for (let prev of this.previous()) {
+ let from = this.toUrl(this.path(prev.file))
+ let root = prev.root || dirname(prev.file)
+ let map
+
+ if (this.mapOpts.sourcesContent === false) {
+ map = new SourceMapConsumer(prev.text)
+ if (map.sourcesContent) {
+ map.sourcesContent = null
+ }
+ } else {
+ map = prev.consumer()
+ }
+
+ this.map.applySourceMap(map, from, this.toUrl(this.path(root)))
+ }
+ }
+
+ clearAnnotation() {
+ if (this.mapOpts.annotation === false) return
+
+ if (this.root) {
+ let node
+ for (let i = this.root.nodes.length - 1; i >= 0; i--) {
+ node = this.root.nodes[i]
+ if (node.type !== 'comment') continue
+ if (node.text.startsWith('# sourceMappingURL=')) {
+ this.root.removeChild(i)
+ }
+ }
+ } else if (this.css) {
+ this.css = this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm, '')
+ }
+ }
+
+ generate() {
+ this.clearAnnotation()
+ if (pathAvailable && sourceMapAvailable && this.isMap()) {
+ return this.generateMap()
+ } else {
+ let result = ''
+ this.stringify(this.root, i => {
+ result += i
+ })
+ return [result]
+ }
+ }
+
+ generateMap() {
+ if (this.root) {
+ this.generateString()
+ } else if (this.previous().length === 1) {
+ let prev = this.previous()[0].consumer()
+ prev.file = this.outputFile()
+ this.map = SourceMapGenerator.fromSourceMap(prev, {
+ ignoreInvalidMapping: true
+ })
+ } else {
+ this.map = new SourceMapGenerator({
+ file: this.outputFile(),
+ ignoreInvalidMapping: true
+ })
+ this.map.addMapping({
+ generated: { column: 0, line: 1 },
+ original: { column: 0, line: 1 },
+ source: this.opts.from
+ ? this.toUrl(this.path(this.opts.from))
+ : ''
+ })
+ }
+
+ if (this.isSourcesContent()) this.setSourcesContent()
+ if (this.root && this.previous().length > 0) this.applyPrevMaps()
+ if (this.isAnnotation()) this.addAnnotation()
+
+ if (this.isInline()) {
+ return [this.css]
+ } else {
+ return [this.css, this.map]
+ }
+ }
+
+ generateString() {
+ this.css = ''
+ this.map = new SourceMapGenerator({
+ file: this.outputFile(),
+ ignoreInvalidMapping: true
+ })
+
+ let line = 1
+ let column = 1
+
+ let noSource = ''
+ let mapping = {
+ generated: { column: 0, line: 0 },
+ original: { column: 0, line: 0 },
+ source: ''
+ }
+
+ let last, lines
+ this.stringify(this.root, (str, node, type) => {
+ this.css += str
+
+ if (node && type !== 'end') {
+ mapping.generated.line = line
+ mapping.generated.column = column - 1
+ if (node.source && node.source.start) {
+ mapping.source = this.sourcePath(node)
+ mapping.original.line = node.source.start.line
+ mapping.original.column = node.source.start.column - 1
+ this.map.addMapping(mapping)
+ } else {
+ mapping.source = noSource
+ mapping.original.line = 1
+ mapping.original.column = 0
+ this.map.addMapping(mapping)
+ }
+ }
+
+ lines = str.match(/\n/g)
+ if (lines) {
+ line += lines.length
+ last = str.lastIndexOf('\n')
+ column = str.length - last
+ } else {
+ column += str.length
+ }
+
+ if (node && type !== 'start') {
+ let p = node.parent || { raws: {} }
+ let childless =
+ node.type === 'decl' || (node.type === 'atrule' && !node.nodes)
+ if (!childless || node !== p.last || p.raws.semicolon) {
+ if (node.source && node.source.end) {
+ mapping.source = this.sourcePath(node)
+ mapping.original.line = node.source.end.line
+ mapping.original.column = node.source.end.column - 1
+ mapping.generated.line = line
+ mapping.generated.column = column - 2
+ this.map.addMapping(mapping)
+ } else {
+ mapping.source = noSource
+ mapping.original.line = 1
+ mapping.original.column = 0
+ mapping.generated.line = line
+ mapping.generated.column = column - 1
+ this.map.addMapping(mapping)
+ }
+ }
+ }
+ })
+ }
+
+ isAnnotation() {
+ if (this.isInline()) {
+ return true
+ }
+ if (typeof this.mapOpts.annotation !== 'undefined') {
+ return this.mapOpts.annotation
+ }
+ if (this.previous().length) {
+ return this.previous().some(i => i.annotation)
+ }
+ return true
+ }
+
+ isInline() {
+ if (typeof this.mapOpts.inline !== 'undefined') {
+ return this.mapOpts.inline
+ }
+
+ let annotation = this.mapOpts.annotation
+ if (typeof annotation !== 'undefined' && annotation !== true) {
+ return false
+ }
+
+ if (this.previous().length) {
+ return this.previous().some(i => i.inline)
+ }
+ return true
+ }
+
+ isMap() {
+ if (typeof this.opts.map !== 'undefined') {
+ return !!this.opts.map
+ }
+ return this.previous().length > 0
+ }
+
+ isSourcesContent() {
+ if (typeof this.mapOpts.sourcesContent !== 'undefined') {
+ return this.mapOpts.sourcesContent
+ }
+ if (this.previous().length) {
+ return this.previous().some(i => i.withContent())
+ }
+ return true
+ }
+
+ outputFile() {
+ if (this.opts.to) {
+ return this.path(this.opts.to)
+ } else if (this.opts.from) {
+ return this.path(this.opts.from)
+ } else {
+ return 'to.css'
+ }
+ }
+
+ path(file) {
+ if (this.mapOpts.absolute) return file
+ if (file.charCodeAt(0) === 60 /* `<` */) return file
+ if (/^\w+:\/\//.test(file)) return file
+ let cached = this.memoizedPaths.get(file)
+ if (cached) return cached
+
+ let from = this.opts.to ? dirname(this.opts.to) : '.'
+
+ if (typeof this.mapOpts.annotation === 'string') {
+ from = dirname(resolve(from, this.mapOpts.annotation))
+ }
+
+ let path = relative(from, file)
+ this.memoizedPaths.set(file, path)
+
+ return path
+ }
+
+ previous() {
+ if (!this.previousMaps) {
+ this.previousMaps = []
+ if (this.root) {
+ this.root.walk(node => {
+ if (node.source && node.source.input.map) {
+ let map = node.source.input.map
+ if (!this.previousMaps.includes(map)) {
+ this.previousMaps.push(map)
+ }
+ }
+ })
+ } else {
+ let input = new Input(this.originalCSS, this.opts)
+ if (input.map) this.previousMaps.push(input.map)
+ }
+ }
+
+ return this.previousMaps
+ }
+
+ setSourcesContent() {
+ let already = {}
+ if (this.root) {
+ this.root.walk(node => {
+ if (node.source) {
+ let from = node.source.input.from
+ if (from && !already[from]) {
+ already[from] = true
+ let fromUrl = this.usesFileUrls
+ ? this.toFileUrl(from)
+ : this.toUrl(this.path(from))
+ this.map.setSourceContent(fromUrl, node.source.input.css)
+ }
+ }
+ })
+ } else if (this.css) {
+ let from = this.opts.from
+ ? this.toUrl(this.path(this.opts.from))
+ : ''
+ this.map.setSourceContent(from, this.css)
+ }
+ }
+
+ sourcePath(node) {
+ if (this.mapOpts.from) {
+ return this.toUrl(this.mapOpts.from)
+ } else if (this.usesFileUrls) {
+ return this.toFileUrl(node.source.input.from)
+ } else {
+ return this.toUrl(this.path(node.source.input.from))
+ }
+ }
+
+ toBase64(str) {
+ if (Buffer) {
+ return Buffer.from(str).toString('base64')
+ } else {
+ return window.btoa(unescape(encodeURIComponent(str)))
+ }
+ }
+
+ toFileUrl(path) {
+ let cached = this.memoizedFileURLs.get(path)
+ if (cached) return cached
+
+ if (pathToFileURL) {
+ let fileURL = pathToFileURL(path).toString()
+ this.memoizedFileURLs.set(path, fileURL)
+
+ return fileURL
+ } else {
+ throw new Error(
+ '`map.absolute` option is not available in this PostCSS build'
+ )
+ }
+ }
+
+ toUrl(path) {
+ let cached = this.memoizedURLs.get(path)
+ if (cached) return cached
+
+ if (sep === '\\') {
+ path = path.replace(/\\/g, '/')
+ }
+
+ let url = encodeURI(path).replace(/[#?]/g, encodeURIComponent)
+ this.memoizedURLs.set(path, url)
+
+ return url
+ }
+}
+
+module.exports = MapGenerator
diff --git a/node_modules/postcss/lib/no-work-result.d.ts b/node_modules/postcss/lib/no-work-result.d.ts
new file mode 100644
index 0000000..094f30a
--- /dev/null
+++ b/node_modules/postcss/lib/no-work-result.d.ts
@@ -0,0 +1,46 @@
+import LazyResult from './lazy-result.js'
+import { SourceMap } from './postcss.js'
+import Processor from './processor.js'
+import Result, { Message, ResultOptions } from './result.js'
+import Root from './root.js'
+import Warning from './warning.js'
+
+declare namespace NoWorkResult {
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
+ export { NoWorkResult_ as default }
+}
+
+/**
+ * A Promise proxy for the result of PostCSS transformations.
+ * This lazy result instance doesn't parse css unless `NoWorkResult#root` or `Result#root`
+ * are accessed. See the example below for details.
+ * A `NoWork` instance is returned by `Processor#process` ONLY when no plugins defined.
+ *
+ * ```js
+ * const noWorkResult = postcss().process(css) // No plugins are defined.
+ * // CSS is not parsed
+ * let root = noWorkResult.root // now css is parsed because we accessed the root
+ * ```
+ */
+declare class NoWorkResult_ implements LazyResult {
+ catch: Promise>['catch']
+ finally: Promise>['finally']
+ then: Promise>['then']
+ get content(): string
+ get css(): string
+ get map(): SourceMap
+ get messages(): Message[]
+ get opts(): ResultOptions
+ get processor(): Processor
+ get root(): Root
+ get [Symbol.toStringTag](): string
+ constructor(processor: Processor, css: string, opts: ResultOptions)
+ async(): Promise>
+ sync(): Result
+ toString(): string
+ warnings(): Warning[]
+}
+
+declare class NoWorkResult extends NoWorkResult_ {}
+
+export = NoWorkResult
diff --git a/node_modules/postcss/lib/no-work-result.js b/node_modules/postcss/lib/no-work-result.js
new file mode 100644
index 0000000..dd46182
--- /dev/null
+++ b/node_modules/postcss/lib/no-work-result.js
@@ -0,0 +1,138 @@
+'use strict'
+
+let MapGenerator = require('./map-generator')
+let parse = require('./parse')
+const Result = require('./result')
+let stringify = require('./stringify')
+let warnOnce = require('./warn-once')
+
+class NoWorkResult {
+ get content() {
+ return this.result.css
+ }
+
+ get css() {
+ return this.result.css
+ }
+
+ get map() {
+ return this.result.map
+ }
+
+ get messages() {
+ return []
+ }
+
+ get opts() {
+ return this.result.opts
+ }
+
+ get processor() {
+ return this.result.processor
+ }
+
+ get root() {
+ if (this._root) {
+ return this._root
+ }
+
+ let root
+ let parser = parse
+
+ try {
+ root = parser(this._css, this._opts)
+ } catch (error) {
+ this.error = error
+ }
+
+ if (this.error) {
+ throw this.error
+ } else {
+ this._root = root
+ return root
+ }
+ }
+
+ get [Symbol.toStringTag]() {
+ return 'NoWorkResult'
+ }
+
+ constructor(processor, css, opts) {
+ css = css.toString()
+ this.stringified = false
+
+ this._processor = processor
+ this._css = css
+ this._opts = opts
+ this._map = undefined
+ let root
+
+ let str = stringify
+ this.result = new Result(this._processor, root, this._opts)
+ this.result.css = css
+
+ let self = this
+ Object.defineProperty(this.result, 'root', {
+ get() {
+ return self.root
+ }
+ })
+
+ let map = new MapGenerator(str, root, this._opts, css)
+ if (map.isMap()) {
+ let [generatedCSS, generatedMap] = map.generate()
+ if (generatedCSS) {
+ this.result.css = generatedCSS
+ }
+ if (generatedMap) {
+ this.result.map = generatedMap
+ }
+ } else {
+ map.clearAnnotation()
+ this.result.css = map.css
+ }
+ }
+
+ async() {
+ if (this.error) return Promise.reject(this.error)
+ return Promise.resolve(this.result)
+ }
+
+ catch(onRejected) {
+ return this.async().catch(onRejected)
+ }
+
+ finally(onFinally) {
+ return this.async().then(onFinally, onFinally)
+ }
+
+ sync() {
+ if (this.error) throw this.error
+ return this.result
+ }
+
+ then(onFulfilled, onRejected) {
+ if (process.env.NODE_ENV !== 'production') {
+ if (!('from' in this._opts)) {
+ warnOnce(
+ 'Without `from` option PostCSS could generate wrong source map ' +
+ 'and will not find Browserslist config. Set it to CSS file path ' +
+ 'or to `undefined` to prevent this warning.'
+ )
+ }
+ }
+
+ return this.async().then(onFulfilled, onRejected)
+ }
+
+ toString() {
+ return this._css
+ }
+
+ warnings() {
+ return []
+ }
+}
+
+module.exports = NoWorkResult
+NoWorkResult.default = NoWorkResult
diff --git a/node_modules/postcss/lib/node.d.ts b/node_modules/postcss/lib/node.d.ts
new file mode 100644
index 0000000..a09fe4d
--- /dev/null
+++ b/node_modules/postcss/lib/node.d.ts
@@ -0,0 +1,556 @@
+import AtRule = require('./at-rule.js')
+import { AtRuleProps } from './at-rule.js'
+import Comment, { CommentProps } from './comment.js'
+import Container, { NewChild } from './container.js'
+import CssSyntaxError from './css-syntax-error.js'
+import Declaration, { DeclarationProps } from './declaration.js'
+import Document from './document.js'
+import Input from './input.js'
+import { Stringifier, Syntax } from './postcss.js'
+import Result from './result.js'
+import Root from './root.js'
+import Rule, { RuleProps } from './rule.js'
+import Warning, { WarningOptions } from './warning.js'
+
+declare namespace Node {
+ export type ChildNode = AtRule.default | Comment | Declaration | Rule
+
+ export type AnyNode =
+ | AtRule.default
+ | Comment
+ | Declaration
+ | Document
+ | Root
+ | Rule
+
+ export type ChildProps =
+ | AtRuleProps
+ | CommentProps
+ | DeclarationProps
+ | RuleProps
+
+ export interface Position {
+ /**
+ * Source line in file. In contrast to `offset` it starts from 1.
+ */
+ column: number
+
+ /**
+ * Source column in file.
+ */
+ line: number
+
+ /**
+ * Source offset in file. It starts from 0.
+ */
+ offset: number
+ }
+
+ export interface Range {
+ /**
+ * End position, exclusive.
+ */
+ end: Position
+
+ /**
+ * Start position, inclusive.
+ */
+ start: Position
+ }
+
+ /**
+ * Source represents an interface for the {@link Node.source} property.
+ */
+ export interface Source {
+ /**
+ * The inclusive ending position for the source
+ * code of a node.
+ *
+ * However, `end.offset` of a non `Root` node is the exclusive position.
+ * See https://github.com/postcss/postcss/pull/1879 for details.
+ *
+ * ```js
+ * const root = postcss.parse('a { color: black }')
+ * const a = root.first
+ * const color = a.first
+ *
+ * // The offset of `Root` node is the inclusive position
+ * css.source.end // { line: 1, column: 19, offset: 18 }
+ *
+ * // The offset of non `Root` node is the exclusive position
+ * a.source.end // { line: 1, column: 18, offset: 18 }
+ * color.source.end // { line: 1, column: 16, offset: 16 }
+ * ```
+ */
+ end?: Position
+
+ /**
+ * The source file from where a node has originated.
+ */
+ input: Input
+
+ /**
+ * The inclusive starting position for the source
+ * code of a node.
+ */
+ start?: Position
+ }
+
+ /**
+ * Interface represents an interface for an object received
+ * as parameter by Node class constructor.
+ */
+ export interface NodeProps {
+ source?: Source
+ }
+
+ export interface NodeErrorOptions {
+ /**
+ * An ending index inside a node's string that should be highlighted as
+ * source of error.
+ */
+ endIndex?: number
+ /**
+ * An index inside a node's string that should be highlighted as source
+ * of error.
+ */
+ index?: number
+ /**
+ * Plugin name that created this error. PostCSS will set it automatically.
+ */
+ plugin?: string
+ /**
+ * A word inside a node's string, that should be highlighted as source
+ * of error.
+ */
+ word?: string
+ }
+
+ // eslint-disable-next-line @typescript-eslint/no-shadow
+ class Node extends Node_ {}
+ export { Node as default }
+}
+
+/**
+ * It represents an abstract class that handles common
+ * methods for other CSS abstract syntax tree nodes.
+ *
+ * Any node that represents CSS selector or value should
+ * not extend the `Node` class.
+ */
+declare abstract class Node_ {
+ /**
+ * It represents parent of the current node.
+ *
+ * ```js
+ * root.nodes[0].parent === root //=> true
+ * ```
+ */
+ parent: Container | Document | undefined
+
+ /**
+ * It represents unnecessary whitespace and characters present
+ * in the css source code.
+ *
+ * Information to generate byte-to-byte equal node string as it was
+ * in the origin input.
+ *
+ * The properties of the raws object are decided by parser,
+ * the default parser uses the following properties:
+ *
+ * * `before`: the space symbols before the node. It also stores `*`
+ * and `_` symbols before the declaration (IE hack).
+ * * `after`: the space symbols after the last child of the node
+ * to the end of the node.
+ * * `between`: the symbols between the property and value
+ * for declarations, selector and `{` for rules, or last parameter
+ * and `{` for at-rules.
+ * * `semicolon`: contains true if the last child has
+ * an (optional) semicolon.
+ * * `afterName`: the space between the at-rule name and its parameters.
+ * * `left`: the space symbols between `/*` and the commentโs text.
+ * * `right`: the space symbols between the commentโs text
+ * and */.
+ * - `important`: the content of the important statement,
+ * if it is not just `!important`.
+ *
+ * PostCSS filters out the comments inside selectors, declaration values
+ * and at-rule parameters but it stores the origin content in raws.
+ *
+ * ```js
+ * const root = postcss.parse('a {\n color:black\n}')
+ * root.first.first.raws //=> { before: '\n ', between: ':' }
+ * ```
+ */
+ raws: any
+
+ /**
+ * It represents information related to origin of a node and is required
+ * for generating source maps.
+ *
+ * The nodes that are created manually using the public APIs
+ * provided by PostCSS will have `source` undefined and
+ * will be absent in the source map.
+ *
+ * For this reason, the plugin developer should consider
+ * duplicating nodes as the duplicate node will have the
+ * same source as the original node by default or assign
+ * source to a node created manually.
+ *
+ * ```js
+ * decl.source.input.from //=> '/home/ai/source.css'
+ * decl.source.start //=> { line: 10, column: 2 }
+ * decl.source.end //=> { line: 10, column: 12 }
+ * ```
+ *
+ * ```js
+ * // Incorrect method, source not specified!
+ * const prefixed = postcss.decl({
+ * prop: '-moz-' + decl.prop,
+ * value: decl.value
+ * })
+ *
+ * // Correct method, source is inherited when duplicating.
+ * const prefixed = decl.clone({
+ * prop: '-moz-' + decl.prop
+ * })
+ * ```
+ *
+ * ```js
+ * if (atrule.name === 'add-link') {
+ * const rule = postcss.rule({
+ * selector: 'a',
+ * source: atrule.source
+ * })
+ *
+ * atrule.parent.insertBefore(atrule, rule)
+ * }
+ * ```
+ */
+ source?: Node.Source
+
+ /**
+ * It represents type of a node in
+ * an abstract syntax tree.
+ *
+ * A type of node helps in identification of a node
+ * and perform operation based on it's type.
+ *
+ * ```js
+ * const declaration = new Declaration({
+ * prop: 'color',
+ * value: 'black'
+ * })
+ *
+ * declaration.type //=> 'decl'
+ * ```
+ */
+ type: string
+
+ constructor(defaults?: object)
+
+ /**
+ * Insert new node after current node to current nodeโs parent.
+ *
+ * Just alias for `node.parent.insertAfter(node, add)`.
+ *
+ * ```js
+ * decl.after('color: black')
+ * ```
+ *
+ * @param newNode New node.
+ * @return This node for methods chain.
+ */
+ after(
+ newNode: Node | Node.ChildProps | readonly Node[] | string | undefined
+ ): this
+
+ /**
+ * It assigns properties to an existing node instance.
+ *
+ * ```js
+ * decl.assign({ prop: 'word-wrap', value: 'break-word' })
+ * ```
+ *
+ * @param overrides New properties to override the node.
+ *
+ * @return `this` for method chaining.
+ */
+ assign(overrides: object): this
+
+ /**
+ * Insert new node before current node to current nodeโs parent.
+ *
+ * Just alias for `node.parent.insertBefore(node, add)`.
+ *
+ * ```js
+ * decl.before('content: ""')
+ * ```
+ *
+ * @param newNode New node.
+ * @return This node for methods chain.
+ */
+ before(
+ newNode: Node | Node.ChildProps | readonly Node[] | string | undefined
+ ): this
+
+ /**
+ * Clear the code style properties for the node and its children.
+ *
+ * ```js
+ * node.raws.before //=> ' '
+ * node.cleanRaws()
+ * node.raws.before //=> undefined
+ * ```
+ *
+ * @param keepBetween Keep the `raws.between` symbols.
+ */
+ cleanRaws(keepBetween?: boolean): void
+
+ /**
+ * It creates clone of an existing node, which includes all the properties
+ * and their values, that includes `raws` but not `type`.
+ *
+ * ```js
+ * decl.raws.before //=> "\n "
+ * const cloned = decl.clone({ prop: '-moz-' + decl.prop })
+ * cloned.raws.before //=> "\n "
+ * cloned.toString() //=> -moz-transform: scale(0)
+ * ```
+ *
+ * @param overrides New properties to override in the clone.
+ *
+ * @return Duplicate of the node instance.
+ */
+ clone(overrides?: object): this
+
+ /**
+ * Shortcut to clone the node and insert the resulting cloned node
+ * after the current node.
+ *
+ * @param overrides New properties to override in the clone.
+ * @return New node.
+ */
+ cloneAfter(overrides?: object): this
+
+ /**
+ * Shortcut to clone the node and insert the resulting cloned node
+ * before the current node.
+ *
+ * ```js
+ * decl.cloneBefore({ prop: '-moz-' + decl.prop })
+ * ```
+ *
+ * @param overrides Mew properties to override in the clone.
+ *
+ * @return New node
+ */
+ cloneBefore(overrides?: object): this
+
+ /**
+ * It creates an instance of the class `CssSyntaxError` and parameters passed
+ * to this method are assigned to the error instance.
+ *
+ * The error instance will have description for the
+ * error, original position of the node in the
+ * source, showing line and column number.
+ *
+ * If any previous map is present, it would be used
+ * to get original position of the source.
+ *
+ * The Previous Map here is referred to the source map
+ * generated by previous compilation, example: Less,
+ * Stylus and Sass.
+ *
+ * This method returns the error instance instead of
+ * throwing it.
+ *
+ * ```js
+ * if (!variables[name]) {
+ * throw decl.error(`Unknown variable ${name}`, { word: name })
+ * // CssSyntaxError: postcss-vars:a.sass:4:3: Unknown variable $black
+ * // color: $black
+ * // a
+ * // ^
+ * // background: white
+ * }
+ * ```
+ *
+ * @param message Description for the error instance.
+ * @param options Options for the error instance.
+ *
+ * @return Error instance is returned.
+ */
+ error(message: string, options?: Node.NodeErrorOptions): CssSyntaxError
+
+ /**
+ * Returns the next child of the nodeโs parent.
+ * Returns `undefined` if the current node is the last child.
+ *
+ * ```js
+ * if (comment.text === 'delete next') {
+ * const next = comment.next()
+ * if (next) {
+ * next.remove()
+ * }
+ * }
+ * ```
+ *
+ * @return Next node.
+ */
+ next(): Node.ChildNode | undefined
+
+ /**
+ * Get the position for a word or an index inside the node.
+ *
+ * @param opts Options.
+ * @return Position.
+ */
+ positionBy(opts?: Pick): Node.Position
+
+ /**
+ * Convert string index to line/column.
+ *
+ * @param index The symbol number in the nodeโs string.
+ * @return Symbol position in file.
+ */
+ positionInside(index: number): Node.Position
+
+ /**
+ * Returns the previous child of the nodeโs parent.
+ * Returns `undefined` if the current node is the first child.
+ *
+ * ```js
+ * const annotation = decl.prev()
+ * if (annotation.type === 'comment') {
+ * readAnnotation(annotation.text)
+ * }
+ * ```
+ *
+ * @return Previous node.
+ */
+ prev(): Node.ChildNode | undefined
+
+ /**
+ * Get the range for a word or start and end index inside the node.
+ * The start index is inclusive; the end index is exclusive.
+ *
+ * @param opts Options.
+ * @return Range.
+ */
+ rangeBy(
+ opts?: Pick
+ ): Node.Range
+
+ /**
+ * Returns a `raws` value. If the node is missing
+ * the code style property (because the node was manually built or cloned),
+ * PostCSS will try to autodetect the code style property by looking
+ * at other nodes in the tree.
+ *
+ * ```js
+ * const root = postcss.parse('a { background: white }')
+ * root.nodes[0].append({ prop: 'color', value: 'black' })
+ * root.nodes[0].nodes[1].raws.before //=> undefined
+ * root.nodes[0].nodes[1].raw('before') //=> ' '
+ * ```
+ *
+ * @param prop Name of code style property.
+ * @param defaultType Name of default value, it can be missed
+ * if the value is the same as prop.
+ * @return {string} Code style value.
+ */
+ raw(prop: string, defaultType?: string): string
+
+ /**
+ * It removes the node from its parent and deletes its parent property.
+ *
+ * ```js
+ * if (decl.prop.match(/^-webkit-/)) {
+ * decl.remove()
+ * }
+ * ```
+ *
+ * @return `this` for method chaining.
+ */
+ remove(): this
+
+ /**
+ * Inserts node(s) before the current node and removes the current node.
+ *
+ * ```js
+ * AtRule: {
+ * mixin: atrule => {
+ * atrule.replaceWith(mixinRules[atrule.params])
+ * }
+ * }
+ * ```
+ *
+ * @param nodes Mode(s) to replace current one.
+ * @return Current node to methods chain.
+ */
+ replaceWith(...nodes: NewChild[]): this
+
+ /**
+ * Finds the Root instance of the nodeโs tree.
+ *
+ * ```js
+ * root.nodes[0].nodes[0].root() === root
+ * ```
+ *
+ * @return Root parent.
+ */
+ root(): Root
+
+ /**
+ * Fix circular links on `JSON.stringify()`.
+ *
+ * @return Cleaned object.
+ */
+ toJSON(): object
+
+ /**
+ * It compiles the node to browser readable cascading style sheets string
+ * depending on it's type.
+ *
+ * ```js
+ * new Rule({ selector: 'a' }).toString() //=> "a {}"
+ * ```
+ *
+ * @param stringifier A syntax to use in string generation.
+ * @return CSS string of this node.
+ */
+ toString(stringifier?: Stringifier | Syntax): string
+
+ /**
+ * It is a wrapper for {@link Result#warn}, providing convenient
+ * way of generating warnings.
+ *
+ * ```js
+ * Declaration: {
+ * bad: (decl, { result }) => {
+ * decl.warn(result, 'Deprecated property: bad')
+ * }
+ * }
+ * ```
+ *
+ * @param result The `Result` instance that will receive the warning.
+ * @param message Description for the warning.
+ * @param options Options for the warning.
+ *
+ * @return `Warning` instance is returned
+ */
+ warn(result: Result, message: string, options?: WarningOptions): Warning
+
+ /**
+ * If this node isn't already dirty, marks it and its ancestors as such. This
+ * indicates to the LazyResult processor that the {@link Root} has been
+ * modified by the current plugin and may need to be processed again by other
+ * plugins.
+ */
+ protected markDirty(): void
+}
+
+declare class Node extends Node_ {}
+
+export = Node
diff --git a/node_modules/postcss/lib/node.js b/node_modules/postcss/lib/node.js
new file mode 100644
index 0000000..b403b71
--- /dev/null
+++ b/node_modules/postcss/lib/node.js
@@ -0,0 +1,449 @@
+'use strict'
+
+let CssSyntaxError = require('./css-syntax-error')
+let Stringifier = require('./stringifier')
+let stringify = require('./stringify')
+let { isClean, my } = require('./symbols')
+
+function cloneNode(obj, parent) {
+ let cloned = new obj.constructor()
+
+ for (let i in obj) {
+ if (!Object.prototype.hasOwnProperty.call(obj, i)) {
+ /* c8 ignore next 2 */
+ continue
+ }
+ if (i === 'proxyCache') continue
+ let value = obj[i]
+ let type = typeof value
+
+ if (i === 'parent' && type === 'object') {
+ if (parent) cloned[i] = parent
+ } else if (i === 'source') {
+ cloned[i] = value
+ } else if (Array.isArray(value)) {
+ cloned[i] = value.map(j => cloneNode(j, cloned))
+ } else {
+ if (type === 'object' && value !== null) value = cloneNode(value)
+ cloned[i] = value
+ }
+ }
+
+ return cloned
+}
+
+function sourceOffset(inputCSS, position) {
+ // Not all custom syntaxes support `offset` in `source.start` and `source.end`
+ if (position && typeof position.offset !== 'undefined') {
+ return position.offset
+ }
+
+ let column = 1
+ let line = 1
+ let offset = 0
+
+ for (let i = 0; i < inputCSS.length; i++) {
+ if (line === position.line && column === position.column) {
+ offset = i
+ break
+ }
+
+ if (inputCSS[i] === '\n') {
+ column = 1
+ line += 1
+ } else {
+ column += 1
+ }
+ }
+
+ return offset
+}
+
+class Node {
+ get proxyOf() {
+ return this
+ }
+
+ constructor(defaults = {}) {
+ this.raws = {}
+ this[isClean] = false
+ this[my] = true
+
+ for (let name in defaults) {
+ if (name === 'nodes') {
+ this.nodes = []
+ for (let node of defaults[name]) {
+ if (typeof node.clone === 'function') {
+ this.append(node.clone())
+ } else {
+ this.append(node)
+ }
+ }
+ } else {
+ this[name] = defaults[name]
+ }
+ }
+ }
+
+ addToError(error) {
+ error.postcssNode = this
+ if (error.stack && this.source && /\n\s{4}at /.test(error.stack)) {
+ let s = this.source
+ error.stack = error.stack.replace(
+ /\n\s{4}at /,
+ `$&${s.input.from}:${s.start.line}:${s.start.column}$&`
+ )
+ }
+ return error
+ }
+
+ after(add) {
+ this.parent.insertAfter(this, add)
+ return this
+ }
+
+ assign(overrides = {}) {
+ for (let name in overrides) {
+ this[name] = overrides[name]
+ }
+ return this
+ }
+
+ before(add) {
+ this.parent.insertBefore(this, add)
+ return this
+ }
+
+ cleanRaws(keepBetween) {
+ delete this.raws.before
+ delete this.raws.after
+ if (!keepBetween) delete this.raws.between
+ }
+
+ clone(overrides = {}) {
+ let cloned = cloneNode(this)
+ for (let name in overrides) {
+ cloned[name] = overrides[name]
+ }
+ return cloned
+ }
+
+ cloneAfter(overrides = {}) {
+ let cloned = this.clone(overrides)
+ this.parent.insertAfter(this, cloned)
+ return cloned
+ }
+
+ cloneBefore(overrides = {}) {
+ let cloned = this.clone(overrides)
+ this.parent.insertBefore(this, cloned)
+ return cloned
+ }
+
+ error(message, opts = {}) {
+ if (this.source) {
+ let { end, start } = this.rangeBy(opts)
+ return this.source.input.error(
+ message,
+ { column: start.column, line: start.line },
+ { column: end.column, line: end.line },
+ opts
+ )
+ }
+ return new CssSyntaxError(message)
+ }
+
+ getProxyProcessor() {
+ return {
+ get(node, prop) {
+ if (prop === 'proxyOf') {
+ return node
+ } else if (prop === 'root') {
+ return () => node.root().toProxy()
+ } else {
+ return node[prop]
+ }
+ },
+
+ set(node, prop, value) {
+ if (node[prop] === value) return true
+ node[prop] = value
+ if (
+ prop === 'prop' ||
+ prop === 'value' ||
+ prop === 'name' ||
+ prop === 'params' ||
+ prop === 'important' ||
+ /* c8 ignore next */
+ prop === 'text'
+ ) {
+ node.markDirty()
+ }
+ return true
+ }
+ }
+ }
+
+ /* c8 ignore next 3 */
+ markClean() {
+ this[isClean] = true
+ }
+
+ markDirty() {
+ if (this[isClean]) {
+ this[isClean] = false
+ let next = this
+ while ((next = next.parent)) {
+ next[isClean] = false
+ }
+ }
+ }
+
+ next() {
+ if (!this.parent) return undefined
+ let index = this.parent.index(this)
+ return this.parent.nodes[index + 1]
+ }
+
+ positionBy(opts = {}) {
+ let pos = this.source.start
+ if (opts.index) {
+ pos = this.positionInside(opts.index)
+ } else if (opts.word) {
+ let inputString =
+ 'document' in this.source.input
+ ? this.source.input.document
+ : this.source.input.css
+ let stringRepresentation = inputString.slice(
+ sourceOffset(inputString, this.source.start),
+ sourceOffset(inputString, this.source.end)
+ )
+ let index = stringRepresentation.indexOf(opts.word)
+ if (index !== -1) pos = this.positionInside(index)
+ }
+ return pos
+ }
+
+ positionInside(index) {
+ let column = this.source.start.column
+ let line = this.source.start.line
+ let inputString =
+ 'document' in this.source.input
+ ? this.source.input.document
+ : this.source.input.css
+ let offset = sourceOffset(inputString, this.source.start)
+ let end = offset + index
+
+ for (let i = offset; i < end; i++) {
+ if (inputString[i] === '\n') {
+ column = 1
+ line += 1
+ } else {
+ column += 1
+ }
+ }
+
+ return { column, line, offset: end }
+ }
+
+ prev() {
+ if (!this.parent) return undefined
+ let index = this.parent.index(this)
+ return this.parent.nodes[index - 1]
+ }
+
+ rangeBy(opts = {}) {
+ let inputString =
+ 'document' in this.source.input
+ ? this.source.input.document
+ : this.source.input.css
+ let start = {
+ column: this.source.start.column,
+ line: this.source.start.line,
+ offset: sourceOffset(inputString, this.source.start)
+ }
+ let end = this.source.end
+ ? {
+ column: this.source.end.column + 1,
+ line: this.source.end.line,
+ offset:
+ typeof this.source.end.offset === 'number'
+ ? // `source.end.offset` is exclusive, so we don't need to add 1
+ this.source.end.offset
+ : // Since line/column in this.source.end is inclusive,
+ // the `sourceOffset(... , this.source.end)` returns an inclusive offset.
+ // So, we add 1 to convert it to exclusive.
+ sourceOffset(inputString, this.source.end) + 1
+ }
+ : {
+ column: start.column + 1,
+ line: start.line,
+ offset: start.offset + 1
+ }
+
+ if (opts.word) {
+ let stringRepresentation = inputString.slice(
+ sourceOffset(inputString, this.source.start),
+ sourceOffset(inputString, this.source.end)
+ )
+ let index = stringRepresentation.indexOf(opts.word)
+ if (index !== -1) {
+ start = this.positionInside(index)
+ end = this.positionInside(index + opts.word.length)
+ }
+ } else {
+ if (opts.start) {
+ start = {
+ column: opts.start.column,
+ line: opts.start.line,
+ offset: sourceOffset(inputString, opts.start)
+ }
+ } else if (opts.index) {
+ start = this.positionInside(opts.index)
+ }
+
+ if (opts.end) {
+ end = {
+ column: opts.end.column,
+ line: opts.end.line,
+ offset: sourceOffset(inputString, opts.end)
+ }
+ } else if (typeof opts.endIndex === 'number') {
+ end = this.positionInside(opts.endIndex)
+ } else if (opts.index) {
+ end = this.positionInside(opts.index + 1)
+ }
+ }
+
+ if (
+ end.line < start.line ||
+ (end.line === start.line && end.column <= start.column)
+ ) {
+ end = {
+ column: start.column + 1,
+ line: start.line,
+ offset: start.offset + 1
+ }
+ }
+
+ return { end, start }
+ }
+
+ raw(prop, defaultType) {
+ let str = new Stringifier()
+ return str.raw(this, prop, defaultType)
+ }
+
+ remove() {
+ if (this.parent) {
+ this.parent.removeChild(this)
+ }
+ this.parent = undefined
+ return this
+ }
+
+ replaceWith(...nodes) {
+ if (this.parent) {
+ let bookmark = this
+ let foundSelf = false
+ for (let node of nodes) {
+ if (node === this) {
+ foundSelf = true
+ } else if (foundSelf) {
+ this.parent.insertAfter(bookmark, node)
+ bookmark = node
+ } else {
+ this.parent.insertBefore(bookmark, node)
+ }
+ }
+
+ if (!foundSelf) {
+ this.remove()
+ }
+ }
+
+ return this
+ }
+
+ root() {
+ let result = this
+ while (result.parent && result.parent.type !== 'document') {
+ result = result.parent
+ }
+ return result
+ }
+
+ toJSON(_, inputs) {
+ let fixed = {}
+ let emitInputs = inputs == null
+ inputs = inputs || new Map()
+ let inputsNextIndex = 0
+
+ for (let name in this) {
+ if (!Object.prototype.hasOwnProperty.call(this, name)) {
+ /* c8 ignore next 2 */
+ continue
+ }
+ if (name === 'parent' || name === 'proxyCache') continue
+ let value = this[name]
+
+ if (Array.isArray(value)) {
+ fixed[name] = value.map(i => {
+ if (typeof i === 'object' && i.toJSON) {
+ return i.toJSON(null, inputs)
+ } else {
+ return i
+ }
+ })
+ } else if (typeof value === 'object' && value.toJSON) {
+ fixed[name] = value.toJSON(null, inputs)
+ } else if (name === 'source') {
+ if (value == null) continue
+ let inputId = inputs.get(value.input)
+ if (inputId == null) {
+ inputId = inputsNextIndex
+ inputs.set(value.input, inputsNextIndex)
+ inputsNextIndex++
+ }
+ fixed[name] = {
+ end: value.end,
+ inputId,
+ start: value.start
+ }
+ } else {
+ fixed[name] = value
+ }
+ }
+
+ if (emitInputs) {
+ fixed.inputs = [...inputs.keys()].map(input => input.toJSON())
+ }
+
+ return fixed
+ }
+
+ toProxy() {
+ if (!this.proxyCache) {
+ this.proxyCache = new Proxy(this, this.getProxyProcessor())
+ }
+ return this.proxyCache
+ }
+
+ toString(stringifier = stringify) {
+ if (stringifier.stringify) stringifier = stringifier.stringify
+ let result = ''
+ stringifier(this, i => {
+ result += i
+ })
+ return result
+ }
+
+ warn(result, text, opts = {}) {
+ let data = { node: this }
+ for (let i in opts) data[i] = opts[i]
+ return result.warn(text, data)
+ }
+}
+
+module.exports = Node
+Node.default = Node
diff --git a/node_modules/postcss/lib/parse.d.ts b/node_modules/postcss/lib/parse.d.ts
new file mode 100644
index 0000000..4c943a4
--- /dev/null
+++ b/node_modules/postcss/lib/parse.d.ts
@@ -0,0 +1,9 @@
+import { Parser } from './postcss.js'
+
+interface Parse extends Parser {
+ default: Parse
+}
+
+declare const parse: Parse
+
+export = parse
diff --git a/node_modules/postcss/lib/parse.js b/node_modules/postcss/lib/parse.js
new file mode 100644
index 0000000..00a1037
--- /dev/null
+++ b/node_modules/postcss/lib/parse.js
@@ -0,0 +1,42 @@
+'use strict'
+
+let Container = require('./container')
+let Input = require('./input')
+let Parser = require('./parser')
+
+function parse(css, opts) {
+ let input = new Input(css, opts)
+ let parser = new Parser(input)
+ try {
+ parser.parse()
+ } catch (e) {
+ if (process.env.NODE_ENV !== 'production') {
+ if (e.name === 'CssSyntaxError' && opts && opts.from) {
+ if (/\.scss$/i.test(opts.from)) {
+ e.message +=
+ '\nYou tried to parse SCSS with ' +
+ 'the standard CSS parser; ' +
+ 'try again with the postcss-scss parser'
+ } else if (/\.sass/i.test(opts.from)) {
+ e.message +=
+ '\nYou tried to parse Sass with ' +
+ 'the standard CSS parser; ' +
+ 'try again with the postcss-sass parser'
+ } else if (/\.less$/i.test(opts.from)) {
+ e.message +=
+ '\nYou tried to parse Less with ' +
+ 'the standard CSS parser; ' +
+ 'try again with the postcss-less parser'
+ }
+ }
+ }
+ throw e
+ }
+
+ return parser.root
+}
+
+module.exports = parse
+parse.default = parse
+
+Container.registerParse(parse)
diff --git a/node_modules/postcss/lib/parser.js b/node_modules/postcss/lib/parser.js
new file mode 100644
index 0000000..64fb5d8
--- /dev/null
+++ b/node_modules/postcss/lib/parser.js
@@ -0,0 +1,611 @@
+'use strict'
+
+let AtRule = require('./at-rule')
+let Comment = require('./comment')
+let Declaration = require('./declaration')
+let Root = require('./root')
+let Rule = require('./rule')
+let tokenizer = require('./tokenize')
+
+const SAFE_COMMENT_NEIGHBOR = {
+ empty: true,
+ space: true
+}
+
+function findLastWithPosition(tokens) {
+ for (let i = tokens.length - 1; i >= 0; i--) {
+ let token = tokens[i]
+ let pos = token[3] || token[2]
+ if (pos) return pos
+ }
+}
+
+class Parser {
+ constructor(input) {
+ this.input = input
+
+ this.root = new Root()
+ this.current = this.root
+ this.spaces = ''
+ this.semicolon = false
+
+ this.createTokenizer()
+ this.root.source = { input, start: { column: 1, line: 1, offset: 0 } }
+ }
+
+ atrule(token) {
+ let node = new AtRule()
+ node.name = token[1].slice(1)
+ if (node.name === '') {
+ this.unnamedAtrule(node, token)
+ }
+ this.init(node, token[2])
+
+ let type
+ let prev
+ let shift
+ let last = false
+ let open = false
+ let params = []
+ let brackets = []
+
+ while (!this.tokenizer.endOfFile()) {
+ token = this.tokenizer.nextToken()
+ type = token[0]
+
+ if (type === '(' || type === '[') {
+ brackets.push(type === '(' ? ')' : ']')
+ } else if (type === '{' && brackets.length > 0) {
+ brackets.push('}')
+ } else if (type === brackets[brackets.length - 1]) {
+ brackets.pop()
+ }
+
+ if (brackets.length === 0) {
+ if (type === ';') {
+ node.source.end = this.getPosition(token[2])
+ node.source.end.offset++
+ this.semicolon = true
+ break
+ } else if (type === '{') {
+ open = true
+ break
+ } else if (type === '}') {
+ if (params.length > 0) {
+ shift = params.length - 1
+ prev = params[shift]
+ while (prev && prev[0] === 'space') {
+ prev = params[--shift]
+ }
+ if (prev) {
+ node.source.end = this.getPosition(prev[3] || prev[2])
+ node.source.end.offset++
+ }
+ }
+ this.end(token)
+ break
+ } else {
+ params.push(token)
+ }
+ } else {
+ params.push(token)
+ }
+
+ if (this.tokenizer.endOfFile()) {
+ last = true
+ break
+ }
+ }
+
+ node.raws.between = this.spacesAndCommentsFromEnd(params)
+ if (params.length) {
+ node.raws.afterName = this.spacesAndCommentsFromStart(params)
+ this.raw(node, 'params', params)
+ if (last) {
+ token = params[params.length - 1]
+ node.source.end = this.getPosition(token[3] || token[2])
+ node.source.end.offset++
+ this.spaces = node.raws.between
+ node.raws.between = ''
+ }
+ } else {
+ node.raws.afterName = ''
+ node.params = ''
+ }
+
+ if (open) {
+ node.nodes = []
+ this.current = node
+ }
+ }
+
+ checkMissedSemicolon(tokens) {
+ let colon = this.colon(tokens)
+ if (colon === false) return
+
+ let founded = 0
+ let token
+ for (let j = colon - 1; j >= 0; j--) {
+ token = tokens[j]
+ if (token[0] !== 'space') {
+ founded += 1
+ if (founded === 2) break
+ }
+ }
+ // If the token is a word, e.g. `!important`, `red` or any other valid property's value.
+ // Then we need to return the colon after that word token. [3] is the "end" colon of that word.
+ // And because we need it after that one we do +1 to get the next one.
+ throw this.input.error(
+ 'Missed semicolon',
+ token[0] === 'word' ? token[3] + 1 : token[2]
+ )
+ }
+
+ colon(tokens) {
+ let brackets = 0
+ let prev, token, type
+ for (let [i, element] of tokens.entries()) {
+ token = element
+ type = token[0]
+
+ if (type === '(') {
+ brackets += 1
+ }
+ if (type === ')') {
+ brackets -= 1
+ }
+ if (brackets === 0 && type === ':') {
+ if (!prev) {
+ this.doubleColon(token)
+ } else if (prev[0] === 'word' && prev[1] === 'progid') {
+ continue
+ } else {
+ return i
+ }
+ }
+
+ prev = token
+ }
+ return false
+ }
+
+ comment(token) {
+ let node = new Comment()
+ this.init(node, token[2])
+ node.source.end = this.getPosition(token[3] || token[2])
+ node.source.end.offset++
+
+ let text = token[1].slice(2, -2)
+ if (/^\s*$/.test(text)) {
+ node.text = ''
+ node.raws.left = text
+ node.raws.right = ''
+ } else {
+ let match = text.match(/^(\s*)([^]*\S)(\s*)$/)
+ node.text = match[2]
+ node.raws.left = match[1]
+ node.raws.right = match[3]
+ }
+ }
+
+ createTokenizer() {
+ this.tokenizer = tokenizer(this.input)
+ }
+
+ decl(tokens, customProperty) {
+ let node = new Declaration()
+ this.init(node, tokens[0][2])
+
+ let last = tokens[tokens.length - 1]
+ if (last[0] === ';') {
+ this.semicolon = true
+ tokens.pop()
+ }
+
+ node.source.end = this.getPosition(
+ last[3] || last[2] || findLastWithPosition(tokens)
+ )
+ node.source.end.offset++
+
+ while (tokens[0][0] !== 'word') {
+ if (tokens.length === 1) this.unknownWord(tokens)
+ node.raws.before += tokens.shift()[1]
+ }
+ node.source.start = this.getPosition(tokens[0][2])
+
+ node.prop = ''
+ while (tokens.length) {
+ let type = tokens[0][0]
+ if (type === ':' || type === 'space' || type === 'comment') {
+ break
+ }
+ node.prop += tokens.shift()[1]
+ }
+
+ node.raws.between = ''
+
+ let token
+ while (tokens.length) {
+ token = tokens.shift()
+
+ if (token[0] === ':') {
+ node.raws.between += token[1]
+ break
+ } else {
+ if (token[0] === 'word' && /\w/.test(token[1])) {
+ this.unknownWord([token])
+ }
+ node.raws.between += token[1]
+ }
+ }
+
+ if (node.prop[0] === '_' || node.prop[0] === '*') {
+ node.raws.before += node.prop[0]
+ node.prop = node.prop.slice(1)
+ }
+
+ let firstSpaces = []
+ let next
+ while (tokens.length) {
+ next = tokens[0][0]
+ if (next !== 'space' && next !== 'comment') break
+ firstSpaces.push(tokens.shift())
+ }
+
+ this.precheckMissedSemicolon(tokens)
+
+ for (let i = tokens.length - 1; i >= 0; i--) {
+ token = tokens[i]
+ if (token[1].toLowerCase() === '!important') {
+ node.important = true
+ let string = this.stringFrom(tokens, i)
+ string = this.spacesFromEnd(tokens) + string
+ if (string !== ' !important') node.raws.important = string
+ break
+ } else if (token[1].toLowerCase() === 'important') {
+ let cache = tokens.slice(0)
+ let str = ''
+ for (let j = i; j > 0; j--) {
+ let type = cache[j][0]
+ if (str.trim().startsWith('!') && type !== 'space') {
+ break
+ }
+ str = cache.pop()[1] + str
+ }
+ if (str.trim().startsWith('!')) {
+ node.important = true
+ node.raws.important = str
+ tokens = cache
+ }
+ }
+
+ if (token[0] !== 'space' && token[0] !== 'comment') {
+ break
+ }
+ }
+
+ let hasWord = tokens.some(i => i[0] !== 'space' && i[0] !== 'comment')
+
+ if (hasWord) {
+ node.raws.between += firstSpaces.map(i => i[1]).join('')
+ firstSpaces = []
+ }
+ this.raw(node, 'value', firstSpaces.concat(tokens), customProperty)
+
+ if (node.value.includes(':') && !customProperty) {
+ this.checkMissedSemicolon(tokens)
+ }
+ }
+
+ doubleColon(token) {
+ throw this.input.error(
+ 'Double colon',
+ { offset: token[2] },
+ { offset: token[2] + token[1].length }
+ )
+ }
+
+ emptyRule(token) {
+ let node = new Rule()
+ this.init(node, token[2])
+ node.selector = ''
+ node.raws.between = ''
+ this.current = node
+ }
+
+ end(token) {
+ if (this.current.nodes && this.current.nodes.length) {
+ this.current.raws.semicolon = this.semicolon
+ }
+ this.semicolon = false
+
+ this.current.raws.after = (this.current.raws.after || '') + this.spaces
+ this.spaces = ''
+
+ if (this.current.parent) {
+ this.current.source.end = this.getPosition(token[2])
+ this.current.source.end.offset++
+ this.current = this.current.parent
+ } else {
+ this.unexpectedClose(token)
+ }
+ }
+
+ endFile() {
+ if (this.current.parent) this.unclosedBlock()
+ if (this.current.nodes && this.current.nodes.length) {
+ this.current.raws.semicolon = this.semicolon
+ }
+ this.current.raws.after = (this.current.raws.after || '') + this.spaces
+ this.root.source.end = this.getPosition(this.tokenizer.position())
+ }
+
+ freeSemicolon(token) {
+ this.spaces += token[1]
+ if (this.current.nodes) {
+ let prev = this.current.nodes[this.current.nodes.length - 1]
+ if (prev && prev.type === 'rule' && !prev.raws.ownSemicolon) {
+ prev.raws.ownSemicolon = this.spaces
+ this.spaces = ''
+ prev.source.end = this.getPosition(token[2])
+ prev.source.end.offset += prev.raws.ownSemicolon.length
+ }
+ }
+ }
+
+ // Helpers
+
+ getPosition(offset) {
+ let pos = this.input.fromOffset(offset)
+ return {
+ column: pos.col,
+ line: pos.line,
+ offset
+ }
+ }
+
+ init(node, offset) {
+ this.current.push(node)
+ node.source = {
+ input: this.input,
+ start: this.getPosition(offset)
+ }
+ node.raws.before = this.spaces
+ this.spaces = ''
+ if (node.type !== 'comment') this.semicolon = false
+ }
+
+ other(start) {
+ let end = false
+ let type = null
+ let colon = false
+ let bracket = null
+ let brackets = []
+ let customProperty = start[1].startsWith('--')
+
+ let tokens = []
+ let token = start
+ while (token) {
+ type = token[0]
+ tokens.push(token)
+
+ if (type === '(' || type === '[') {
+ if (!bracket) bracket = token
+ brackets.push(type === '(' ? ')' : ']')
+ } else if (customProperty && colon && type === '{') {
+ if (!bracket) bracket = token
+ brackets.push('}')
+ } else if (brackets.length === 0) {
+ if (type === ';') {
+ if (colon) {
+ this.decl(tokens, customProperty)
+ return
+ } else {
+ break
+ }
+ } else if (type === '{') {
+ this.rule(tokens)
+ return
+ } else if (type === '}') {
+ this.tokenizer.back(tokens.pop())
+ end = true
+ break
+ } else if (type === ':') {
+ colon = true
+ }
+ } else if (type === brackets[brackets.length - 1]) {
+ brackets.pop()
+ if (brackets.length === 0) bracket = null
+ }
+
+ token = this.tokenizer.nextToken()
+ }
+
+ if (this.tokenizer.endOfFile()) end = true
+ if (brackets.length > 0) this.unclosedBracket(bracket)
+
+ if (end && colon) {
+ if (!customProperty) {
+ while (tokens.length) {
+ token = tokens[tokens.length - 1][0]
+ if (token !== 'space' && token !== 'comment') break
+ this.tokenizer.back(tokens.pop())
+ }
+ }
+ this.decl(tokens, customProperty)
+ } else {
+ this.unknownWord(tokens)
+ }
+ }
+
+ parse() {
+ let token
+ while (!this.tokenizer.endOfFile()) {
+ token = this.tokenizer.nextToken()
+
+ switch (token[0]) {
+ case 'space':
+ this.spaces += token[1]
+ break
+
+ case ';':
+ this.freeSemicolon(token)
+ break
+
+ case '}':
+ this.end(token)
+ break
+
+ case 'comment':
+ this.comment(token)
+ break
+
+ case 'at-word':
+ this.atrule(token)
+ break
+
+ case '{':
+ this.emptyRule(token)
+ break
+
+ default:
+ this.other(token)
+ break
+ }
+ }
+ this.endFile()
+ }
+
+ precheckMissedSemicolon(/* tokens */) {
+ // Hook for Safe Parser
+ }
+
+ raw(node, prop, tokens, customProperty) {
+ let token, type
+ let length = tokens.length
+ let value = ''
+ let clean = true
+ let next, prev
+
+ for (let i = 0; i < length; i += 1) {
+ token = tokens[i]
+ type = token[0]
+ if (type === 'space' && i === length - 1 && !customProperty) {
+ clean = false
+ } else if (type === 'comment') {
+ prev = tokens[i - 1] ? tokens[i - 1][0] : 'empty'
+ next = tokens[i + 1] ? tokens[i + 1][0] : 'empty'
+ if (!SAFE_COMMENT_NEIGHBOR[prev] && !SAFE_COMMENT_NEIGHBOR[next]) {
+ if (value.slice(-1) === ',') {
+ clean = false
+ } else {
+ value += token[1]
+ }
+ } else {
+ clean = false
+ }
+ } else {
+ value += token[1]
+ }
+ }
+ if (!clean) {
+ let raw = tokens.reduce((all, i) => all + i[1], '')
+ node.raws[prop] = { raw, value }
+ }
+ node[prop] = value
+ }
+
+ rule(tokens) {
+ tokens.pop()
+
+ let node = new Rule()
+ this.init(node, tokens[0][2])
+
+ node.raws.between = this.spacesAndCommentsFromEnd(tokens)
+ this.raw(node, 'selector', tokens)
+ this.current = node
+ }
+
+ spacesAndCommentsFromEnd(tokens) {
+ let lastTokenType
+ let spaces = ''
+ while (tokens.length) {
+ lastTokenType = tokens[tokens.length - 1][0]
+ if (lastTokenType !== 'space' && lastTokenType !== 'comment') break
+ spaces = tokens.pop()[1] + spaces
+ }
+ return spaces
+ }
+
+ // Errors
+
+ spacesAndCommentsFromStart(tokens) {
+ let next
+ let spaces = ''
+ while (tokens.length) {
+ next = tokens[0][0]
+ if (next !== 'space' && next !== 'comment') break
+ spaces += tokens.shift()[1]
+ }
+ return spaces
+ }
+
+ spacesFromEnd(tokens) {
+ let lastTokenType
+ let spaces = ''
+ while (tokens.length) {
+ lastTokenType = tokens[tokens.length - 1][0]
+ if (lastTokenType !== 'space') break
+ spaces = tokens.pop()[1] + spaces
+ }
+ return spaces
+ }
+
+ stringFrom(tokens, from) {
+ let result = ''
+ for (let i = from; i < tokens.length; i++) {
+ result += tokens[i][1]
+ }
+ tokens.splice(from, tokens.length - from)
+ return result
+ }
+
+ unclosedBlock() {
+ let pos = this.current.source.start
+ throw this.input.error('Unclosed block', pos.line, pos.column)
+ }
+
+ unclosedBracket(bracket) {
+ throw this.input.error(
+ 'Unclosed bracket',
+ { offset: bracket[2] },
+ { offset: bracket[2] + 1 }
+ )
+ }
+
+ unexpectedClose(token) {
+ throw this.input.error(
+ 'Unexpected }',
+ { offset: token[2] },
+ { offset: token[2] + 1 }
+ )
+ }
+
+ unknownWord(tokens) {
+ throw this.input.error(
+ 'Unknown word ' + tokens[0][1],
+ { offset: tokens[0][2] },
+ { offset: tokens[0][2] + tokens[0][1].length }
+ )
+ }
+
+ unnamedAtrule(node, token) {
+ throw this.input.error(
+ 'At-rule without name',
+ { offset: token[2] },
+ { offset: token[2] + token[1].length }
+ )
+ }
+}
+
+module.exports = Parser
diff --git a/node_modules/postcss/lib/postcss.d.mts b/node_modules/postcss/lib/postcss.d.mts
new file mode 100644
index 0000000..d343f3c
--- /dev/null
+++ b/node_modules/postcss/lib/postcss.d.mts
@@ -0,0 +1,69 @@
+export {
+ // Type-only exports
+ AcceptedPlugin,
+
+ AnyNode,
+ atRule,
+ AtRule,
+ AtRuleProps,
+ Builder,
+ ChildNode,
+ ChildProps,
+ comment,
+ Comment,
+ CommentProps,
+ Container,
+ ContainerProps,
+ CssSyntaxError,
+ decl,
+ Declaration,
+ DeclarationProps,
+ // postcss function / namespace
+ default,
+ document,
+ Document,
+ DocumentProps,
+ FilePosition,
+ fromJSON,
+ Helpers,
+ Input,
+
+ JSONHydrator,
+ // This is a class, but itโs not re-exported. Thatโs why itโs exported as type-only here.
+ type LazyResult,
+ list,
+ Message,
+ Node,
+ NodeErrorOptions,
+ NodeProps,
+ OldPlugin,
+ parse,
+ Parser,
+ // @ts-expect-error This value exists, but itโs untyped.
+ plugin,
+ Plugin,
+ PluginCreator,
+ Position,
+ Postcss,
+ ProcessOptions,
+ Processor,
+ Result,
+ root,
+ Root,
+ RootProps,
+ rule,
+ Rule,
+ RuleProps,
+ Source,
+ SourceMap,
+ SourceMapOptions,
+ Stringifier,
+ // Value exports from postcss.mjs
+ stringify,
+ Syntax,
+ TransformCallback,
+ Transformer,
+ Warning,
+
+ WarningOptions
+} from './postcss.js'
diff --git a/node_modules/postcss/lib/postcss.d.ts b/node_modules/postcss/lib/postcss.d.ts
new file mode 100644
index 0000000..c5e3605
--- /dev/null
+++ b/node_modules/postcss/lib/postcss.d.ts
@@ -0,0 +1,458 @@
+import { RawSourceMap, SourceMapGenerator } from 'source-map-js'
+
+import AtRule, { AtRuleProps } from './at-rule.js'
+import Comment, { CommentProps } from './comment.js'
+import Container, { ContainerProps, NewChild } from './container.js'
+import CssSyntaxError from './css-syntax-error.js'
+import Declaration, { DeclarationProps } from './declaration.js'
+import Document, { DocumentProps } from './document.js'
+import Input, { FilePosition } from './input.js'
+import LazyResult from './lazy-result.js'
+import list from './list.js'
+import Node, {
+ AnyNode,
+ ChildNode,
+ ChildProps,
+ NodeErrorOptions,
+ NodeProps,
+ Position,
+ Source
+} from './node.js'
+import Processor from './processor.js'
+import Result, { Message } from './result.js'
+import Root, { RootProps } from './root.js'
+import Rule, { RuleProps } from './rule.js'
+import Warning, { WarningOptions } from './warning.js'
+
+type DocumentProcessor = (
+ document: Document,
+ helper: postcss.Helpers
+) => Promise | void
+type RootProcessor = (
+ root: Root,
+ helper: postcss.Helpers
+) => Promise | void
+type DeclarationProcessor = (
+ decl: Declaration,
+ helper: postcss.Helpers
+) => Promise | void
+type RuleProcessor = (
+ rule: Rule,
+ helper: postcss.Helpers
+) => Promise | void
+type AtRuleProcessor = (
+ atRule: AtRule,
+ helper: postcss.Helpers
+) => Promise | void
+type CommentProcessor = (
+ comment: Comment,
+ helper: postcss.Helpers
+) => Promise | void
+
+interface Processors {
+ /**
+ * Will be called on all`AtRule` nodes.
+ *
+ * Will be called again on node or children changes.
+ */
+ AtRule?: { [name: string]: AtRuleProcessor } | AtRuleProcessor
+
+ /**
+ * Will be called on all `AtRule` nodes, when all children will be processed.
+ *
+ * Will be called again on node or children changes.
+ */
+ AtRuleExit?: { [name: string]: AtRuleProcessor } | AtRuleProcessor
+
+ /**
+ * Will be called on all `Comment` nodes.
+ *
+ * Will be called again on node or children changes.
+ */
+ Comment?: CommentProcessor
+
+ /**
+ * Will be called on all `Comment` nodes after listeners
+ * for `Comment` event.
+ *
+ * Will be called again on node or children changes.
+ */
+ CommentExit?: CommentProcessor
+
+ /**
+ * Will be called on all `Declaration` nodes after listeners
+ * for `Declaration` event.
+ *
+ * Will be called again on node or children changes.
+ */
+ Declaration?: { [prop: string]: DeclarationProcessor } | DeclarationProcessor
+
+ /**
+ * Will be called on all `Declaration` nodes.
+ *
+ * Will be called again on node or children changes.
+ */
+ DeclarationExit?:
+ | { [prop: string]: DeclarationProcessor }
+ | DeclarationProcessor
+
+ /**
+ * Will be called on `Document` node.
+ *
+ * Will be called again on children changes.
+ */
+ Document?: DocumentProcessor
+
+ /**
+ * Will be called on `Document` node, when all children will be processed.
+ *
+ * Will be called again on children changes.
+ */
+ DocumentExit?: DocumentProcessor
+
+ /**
+ * Will be called on `Root` node once.
+ */
+ Once?: RootProcessor
+
+ /**
+ * Will be called on `Root` node once, when all children will be processed.
+ */
+ OnceExit?: RootProcessor
+
+ /**
+ * Will be called on `Root` node.
+ *
+ * Will be called again on children changes.
+ */
+ Root?: RootProcessor
+
+ /**
+ * Will be called on `Root` node, when all children will be processed.
+ *
+ * Will be called again on children changes.
+ */
+ RootExit?: RootProcessor
+
+ /**
+ * Will be called on all `Rule` nodes.
+ *
+ * Will be called again on node or children changes.
+ */
+ Rule?: RuleProcessor
+
+ /**
+ * Will be called on all `Rule` nodes, when all children will be processed.
+ *
+ * Will be called again on node or children changes.
+ */
+ RuleExit?: RuleProcessor
+}
+
+declare namespace postcss {
+ export {
+ AnyNode,
+ AtRule,
+ AtRuleProps,
+ ChildNode,
+ ChildProps,
+ Comment,
+ CommentProps,
+ Container,
+ ContainerProps,
+ CssSyntaxError,
+ Declaration,
+ DeclarationProps,
+ Document,
+ DocumentProps,
+ FilePosition,
+ Input,
+ LazyResult,
+ list,
+ Message,
+ NewChild,
+ Node,
+ NodeErrorOptions,
+ NodeProps,
+ Position,
+ Processor,
+ Result,
+ Root,
+ RootProps,
+ Rule,
+ RuleProps,
+ Source,
+ Warning,
+ WarningOptions
+ }
+
+ export type SourceMap = {
+ toJSON(): RawSourceMap
+ } & SourceMapGenerator
+
+ export type Helpers = { postcss: Postcss; result: Result } & Postcss
+
+ export interface Plugin extends Processors {
+ postcssPlugin: string
+ prepare?: (result: Result) => Processors
+ }
+
+ export interface PluginCreator {
+ (opts?: PluginOptions): Plugin | Processor
+ postcss: true
+ }
+
+ export interface Transformer extends TransformCallback {
+ postcssPlugin: string
+ postcssVersion: string
+ }
+
+ export interface TransformCallback {
+ (root: Root, result: Result): Promise | void
+ }
+
+ export interface OldPlugin extends Transformer {
+ (opts?: T): Transformer
+ postcss: Transformer
+ }
+
+ export type AcceptedPlugin =
+ | {
+ postcss: Processor | TransformCallback
+ }
+ | OldPlugin
+ | Plugin
+ | PluginCreator
+ | Processor
+ | TransformCallback
+
+ export interface Parser {
+ (
+ css: { toString(): string } | string,
+ opts?: Pick
+ ): RootNode
+ }
+
+ export interface Builder {
+ (part: string, node?: AnyNode, type?: 'end' | 'start'): void
+ }
+
+ export interface Stringifier {
+ (node: AnyNode, builder: Builder): void
+ }
+
+ export interface JSONHydrator {
+ (data: object): Node
+ (data: object[]): Node[]
+ }
+
+ export interface Syntax {
+ /**
+ * Function to generate AST by string.
+ */
+ parse?: Parser
+
+ /**
+ * Class to generate string by AST.
+ */
+ stringify?: Stringifier
+ }
+
+ export interface SourceMapOptions {
+ /**
+ * Use absolute path in generated source map.
+ */
+ absolute?: boolean
+
+ /**
+ * Indicates that PostCSS should add annotation comments to the CSS.
+ * By default, PostCSS will always add a comment with a path
+ * to the source map. PostCSS will not add annotations to CSS files
+ * that do not contain any comments.
+ *
+ * By default, PostCSS presumes that you want to save the source map as
+ * `opts.to + '.map'` and will use this path in the annotation comment.
+ * A different path can be set by providing a string value for annotation.
+ *
+ * If you have set `inline: true`, annotation cannot be disabled.
+ */
+ annotation?: ((file: string, root: Root) => string) | boolean | string
+
+ /**
+ * Override `from` in mapโs sources.
+ */
+ from?: string
+
+ /**
+ * Indicates that the source map should be embedded in the output CSS
+ * as a Base64-encoded comment. By default, it is `true`.
+ * But if all previous maps are external, not inline, PostCSS will not embed
+ * the map even if you do not set this option.
+ *
+ * If you have an inline source map, the result.map property will be empty,
+ * as the source map will be contained within the text of `result.css`.
+ */
+ inline?: boolean
+
+ /**
+ * Source map content from a previous processing step (e.g., Sass).
+ *
+ * PostCSS will try to read the previous source map
+ * automatically (based on comments within the source CSS), but you can use
+ * this option to identify it manually.
+ *
+ * If desired, you can omit the previous map with prev: `false`.
+ */
+ prev?: ((file: string) => string) | boolean | object | string
+
+ /**
+ * Indicates that PostCSS should set the origin content (e.g., Sass source)
+ * of the source map. By default, it is true. But if all previous maps do not
+ * contain sources content, PostCSS will also leave it out even if you
+ * do not set this option.
+ */
+ sourcesContent?: boolean
+ }
+
+ export interface ProcessOptions {
+ /**
+ * Input file if it is not simple CSS file, but HTML with
+
+ `;
+}
+
+const ERR_LOAD_URL = "ERR_LOAD_URL";
+const ERR_LOAD_PUBLIC_URL = "ERR_LOAD_PUBLIC_URL";
+const ERR_DENIED_ID = "ERR_DENIED_ID";
+const debugLoad = createDebugger("vite:load");
+const debugTransform = createDebugger("vite:transform");
+const debugCache$1 = createDebugger("vite:cache");
+function transformRequest(environment, url, options = {}) {
+ if (!options.ssr) {
+ options = { ...options, ssr: environment.config.consumer === "server" };
+ }
+ if (environment._closing && environment.config.dev.recoverable)
+ throwClosedServerError();
+ const cacheKey = `${options.html ? "html:" : ""}${url}`;
+ const timestamp = Date.now();
+ const pending = environment._pendingRequests.get(cacheKey);
+ if (pending) {
+ return environment.moduleGraph.getModuleByUrl(removeTimestampQuery(url)).then((module) => {
+ if (!module || pending.timestamp > module.lastInvalidationTimestamp) {
+ return pending.request;
+ } else {
+ pending.abort();
+ return transformRequest(environment, url, options);
+ }
+ });
+ }
+ const request = doTransform(environment, url, options, timestamp);
+ let cleared = false;
+ const clearCache = () => {
+ if (!cleared) {
+ environment._pendingRequests.delete(cacheKey);
+ cleared = true;
+ }
+ };
+ environment._pendingRequests.set(cacheKey, {
+ request,
+ timestamp,
+ abort: clearCache
+ });
+ return request.finally(clearCache);
+}
+async function doTransform(environment, url, options, timestamp) {
+ url = removeTimestampQuery(url);
+ const { pluginContainer } = environment;
+ let module = await environment.moduleGraph.getModuleByUrl(url);
+ if (module) {
+ const cached = await getCachedTransformResult(
+ environment,
+ url,
+ module,
+ timestamp
+ );
+ if (cached) return cached;
+ }
+ const resolved = module ? void 0 : await pluginContainer.resolveId(url, void 0) ?? void 0;
+ const id = module?.id ?? resolved?.id ?? url;
+ module ??= environment.moduleGraph.getModuleById(id);
+ if (module) {
+ await environment.moduleGraph._ensureEntryFromUrl(url, void 0, resolved);
+ const cached = await getCachedTransformResult(
+ environment,
+ url,
+ module,
+ timestamp
+ );
+ if (cached) return cached;
+ }
+ const result = loadAndTransform(
+ environment,
+ id,
+ url,
+ options,
+ timestamp,
+ module,
+ resolved
+ );
+ const { depsOptimizer } = environment;
+ if (!depsOptimizer?.isOptimizedDepFile(id)) {
+ environment._registerRequestProcessing(id, () => result);
+ }
+ return result;
+}
+async function getCachedTransformResult(environment, url, module, timestamp) {
+ const prettyUrl = debugCache$1 ? prettifyUrl(url, environment.config.root) : "";
+ const softInvalidatedTransformResult = await handleModuleSoftInvalidation(
+ environment,
+ module,
+ timestamp
+ );
+ if (softInvalidatedTransformResult) {
+ debugCache$1?.(`[memory-hmr] ${prettyUrl}`);
+ return softInvalidatedTransformResult;
+ }
+ const cached = module.transformResult;
+ if (cached) {
+ debugCache$1?.(`[memory] ${prettyUrl}`);
+ return cached;
+ }
+}
+async function loadAndTransform(environment, id, url, options, timestamp, mod, resolved) {
+ const { config, pluginContainer, logger } = environment;
+ const prettyUrl = debugLoad || debugTransform ? prettifyUrl(url, config.root) : "";
+ const moduleGraph = environment.moduleGraph;
+ if (options.allowId && !options.allowId(id)) {
+ const err = new Error(`Denied ID ${id}`);
+ err.code = ERR_DENIED_ID;
+ throw err;
+ }
+ let code = null;
+ let map = null;
+ const loadStart = debugLoad ? performance$1.now() : 0;
+ const loadResult = await pluginContainer.load(id);
+ if (loadResult == null) {
+ const file = cleanUrl(id);
+ if (options.html && !id.endsWith(".html")) {
+ return null;
+ }
+ if (environment.config.consumer === "server" || isFileLoadingAllowed(environment.getTopLevelConfig(), file)) {
+ try {
+ code = await fsp.readFile(file, "utf-8");
+ debugLoad?.(`${timeFrom(loadStart)} [fs] ${prettyUrl}`);
+ } catch (e) {
+ if (e.code !== "ENOENT") {
+ if (e.code === "EISDIR") {
+ e.message = `${e.message} ${file}`;
+ }
+ throw e;
+ }
+ }
+ if (code != null && environment.pluginContainer.watcher) {
+ ensureWatchedFile(
+ environment.pluginContainer.watcher,
+ file,
+ config.root
+ );
+ }
+ }
+ if (code) {
+ try {
+ const extracted = await extractSourcemapFromFile(code, file);
+ if (extracted) {
+ code = extracted.code;
+ map = extracted.map;
+ }
+ } catch (e) {
+ logger.warn(`Failed to load source map for ${file}.
+${e}`, {
+ timestamp: true
+ });
+ }
+ }
+ } else {
+ debugLoad?.(`${timeFrom(loadStart)} [plugin] ${prettyUrl}`);
+ if (isObject$1(loadResult)) {
+ code = loadResult.code;
+ map = loadResult.map;
+ } else {
+ code = loadResult;
+ }
+ }
+ if (code == null) {
+ const isPublicFile = checkPublicFile(url, environment.getTopLevelConfig());
+ let publicDirName = path$b.relative(config.root, config.publicDir);
+ if (publicDirName[0] !== ".") publicDirName = "/" + publicDirName;
+ const msg = isPublicFile ? `This file is in ${publicDirName} and will be copied as-is during build without going through the plugin transforms, and therefore should not be imported from source code. It can only be referenced via HTML tags.` : `Does the file exist?`;
+ const importerMod = moduleGraph.idToModuleMap.get(id)?.importers.values().next().value;
+ const importer = importerMod?.file || importerMod?.url;
+ const err = new Error(
+ `Failed to load url ${url} (resolved id: ${id})${importer ? ` in ${importer}` : ""}. ${msg}`
+ );
+ err.code = isPublicFile ? ERR_LOAD_PUBLIC_URL : ERR_LOAD_URL;
+ throw err;
+ }
+ if (environment._closing && environment.config.dev.recoverable)
+ throwClosedServerError();
+ mod ??= await moduleGraph._ensureEntryFromUrl(url, void 0, resolved);
+ const transformStart = debugTransform ? performance$1.now() : 0;
+ const transformResult = await pluginContainer.transform(code, id, {
+ inMap: map
+ });
+ const originalCode = code;
+ if (transformResult.code === originalCode) {
+ debugTransform?.(
+ timeFrom(transformStart) + colors$1.dim(` [skipped] ${prettyUrl}`)
+ );
+ } else {
+ debugTransform?.(`${timeFrom(transformStart)} ${prettyUrl}`);
+ code = transformResult.code;
+ map = transformResult.map;
+ }
+ let normalizedMap;
+ if (typeof map === "string") {
+ normalizedMap = JSON.parse(map);
+ } else if (map) {
+ normalizedMap = map;
+ } else {
+ normalizedMap = null;
+ }
+ if (normalizedMap && "version" in normalizedMap && mod.file) {
+ if (normalizedMap.mappings) {
+ await injectSourcesContent(normalizedMap, mod.file, logger);
+ }
+ const sourcemapPath = `${mod.file}.map`;
+ applySourcemapIgnoreList(
+ normalizedMap,
+ sourcemapPath,
+ config.server.sourcemapIgnoreList,
+ logger
+ );
+ if (path$b.isAbsolute(mod.file)) {
+ let modDirname;
+ for (let sourcesIndex = 0; sourcesIndex < normalizedMap.sources.length; ++sourcesIndex) {
+ const sourcePath = normalizedMap.sources[sourcesIndex];
+ if (sourcePath) {
+ if (path$b.isAbsolute(sourcePath)) {
+ modDirname ??= path$b.dirname(mod.file);
+ normalizedMap.sources[sourcesIndex] = path$b.relative(
+ modDirname,
+ sourcePath
+ );
+ }
+ }
+ }
+ }
+ }
+ if (environment._closing && environment.config.dev.recoverable)
+ throwClosedServerError();
+ const topLevelConfig = environment.getTopLevelConfig();
+ const result = environment.config.dev.moduleRunnerTransform ? await ssrTransform(code, normalizedMap, url, originalCode, {
+ json: {
+ stringify: topLevelConfig.json.stringify === true && topLevelConfig.json.namedExports !== true
+ }
+ }) : {
+ code,
+ map: normalizedMap,
+ etag: getEtag(code, { weak: true })
+ };
+ if (timestamp > mod.lastInvalidationTimestamp)
+ moduleGraph.updateModuleTransformResult(mod, result);
+ return result;
+}
+async function handleModuleSoftInvalidation(environment, mod, timestamp) {
+ const transformResult = mod.invalidationState;
+ mod.invalidationState = void 0;
+ if (!transformResult || transformResult === "HARD_INVALIDATED") return;
+ if (mod.transformResult) {
+ throw new Error(
+ `Internal server error: Soft-invalidated module "${mod.url}" should not have existing transform result`
+ );
+ }
+ let result;
+ if (transformResult.ssr) {
+ result = transformResult;
+ } else {
+ await init;
+ const source = transformResult.code;
+ const s = new MagicString(source);
+ const [imports] = parse$d(source, mod.id || void 0);
+ for (const imp of imports) {
+ let rawUrl = source.slice(imp.s, imp.e);
+ if (rawUrl === "import.meta") continue;
+ const hasQuotes = rawUrl[0] === '"' || rawUrl[0] === "'";
+ if (hasQuotes) {
+ rawUrl = rawUrl.slice(1, -1);
+ }
+ const urlWithoutTimestamp = removeTimestampQuery(rawUrl);
+ const hmrUrl = unwrapId$1(
+ stripBase(
+ removeImportQuery(urlWithoutTimestamp),
+ environment.config.base
+ )
+ );
+ for (const importedMod of mod.importedModules) {
+ if (importedMod.url !== hmrUrl) continue;
+ if (importedMod.lastHMRTimestamp > 0) {
+ const replacedUrl = injectQuery(
+ urlWithoutTimestamp,
+ `t=${importedMod.lastHMRTimestamp}`
+ );
+ const start = hasQuotes ? imp.s + 1 : imp.s;
+ const end = hasQuotes ? imp.e - 1 : imp.e;
+ s.overwrite(start, end, replacedUrl);
+ }
+ if (imp.d === -1 && environment.config.dev.preTransformRequests) {
+ environment.warmupRequest(hmrUrl);
+ }
+ break;
+ }
+ }
+ const code = s.toString();
+ result = {
+ ...transformResult,
+ code,
+ etag: getEtag(code, { weak: true })
+ };
+ }
+ if (timestamp > mod.lastInvalidationTimestamp)
+ environment.moduleGraph.updateModuleTransformResult(mod, result);
+ return result;
+}
+
+const ALLOWED_META_NAME = [
+ "msapplication-tileimage",
+ "msapplication-square70x70logo",
+ "msapplication-square150x150logo",
+ "msapplication-wide310x150logo",
+ "msapplication-square310x310logo",
+ "msapplication-config",
+ "twitter:image"
+];
+const ALLOWED_META_PROPERTY = [
+ "og:image",
+ "og:image:url",
+ "og:image:secure_url",
+ "og:audio",
+ "og:audio:secure_url",
+ "og:video",
+ "og:video:secure_url"
+];
+const DEFAULT_HTML_ASSET_SOURCES = {
+ audio: {
+ srcAttributes: ["src"]
+ },
+ embed: {
+ srcAttributes: ["src"]
+ },
+ img: {
+ srcAttributes: ["src"],
+ srcsetAttributes: ["srcset"]
+ },
+ image: {
+ srcAttributes: ["href", "xlink:href"]
+ },
+ input: {
+ srcAttributes: ["src"]
+ },
+ link: {
+ srcAttributes: ["href"],
+ srcsetAttributes: ["imagesrcset"]
+ },
+ object: {
+ srcAttributes: ["data"]
+ },
+ source: {
+ srcAttributes: ["src"],
+ srcsetAttributes: ["srcset"]
+ },
+ track: {
+ srcAttributes: ["src"]
+ },
+ use: {
+ srcAttributes: ["href", "xlink:href"]
+ },
+ video: {
+ srcAttributes: ["src", "poster"]
+ },
+ meta: {
+ srcAttributes: ["content"],
+ filter({ attributes }) {
+ if (attributes.name && ALLOWED_META_NAME.includes(attributes.name.trim().toLowerCase())) {
+ return true;
+ }
+ if (attributes.property && ALLOWED_META_PROPERTY.includes(attributes.property.trim().toLowerCase())) {
+ return true;
+ }
+ return false;
+ }
+ }
+};
+function getNodeAssetAttributes(node) {
+ const matched = DEFAULT_HTML_ASSET_SOURCES[node.nodeName];
+ if (!matched) return [];
+ const attributes = {};
+ for (const attr of node.attrs) {
+ attributes[getAttrKey(attr)] = attr.value;
+ }
+ if ("vite-ignore" in attributes) {
+ return [
+ {
+ type: "remove",
+ key: "vite-ignore",
+ value: "",
+ attributes,
+ location: node.sourceCodeLocation.attrs["vite-ignore"]
+ }
+ ];
+ }
+ const actions = [];
+ function handleAttributeKey(key, type) {
+ const value = attributes[key];
+ if (!value) return;
+ if (matched.filter && !matched.filter({ key, value, attributes })) return;
+ const location = node.sourceCodeLocation.attrs[key];
+ actions.push({ type, key, value, attributes, location });
+ }
+ matched.srcAttributes?.forEach((key) => handleAttributeKey(key, "src"));
+ matched.srcsetAttributes?.forEach((key) => handleAttributeKey(key, "srcset"));
+ return actions;
+}
+function getAttrKey(attr) {
+ return attr.prefix === void 0 ? attr.name : `${attr.prefix}:${attr.name}`;
+}
+
+const modulePreloadPolyfillId = "vite/modulepreload-polyfill";
+const resolvedModulePreloadPolyfillId = "\0" + modulePreloadPolyfillId + ".js";
+function modulePreloadPolyfillPlugin(config) {
+ let polyfillString;
+ return {
+ name: "vite:modulepreload-polyfill",
+ resolveId: {
+ handler(id) {
+ if (id === modulePreloadPolyfillId) {
+ return resolvedModulePreloadPolyfillId;
+ }
+ }
+ },
+ load: {
+ handler(id) {
+ if (id === resolvedModulePreloadPolyfillId) {
+ if (config.command !== "build" || this.environment.config.consumer !== "client") {
+ return "";
+ }
+ if (!polyfillString) {
+ polyfillString = `${isModernFlag}&&(${polyfill.toString()}());`;
+ }
+ return { code: polyfillString, moduleSideEffects: true };
+ }
+ }
+ }
+ };
+}
+function polyfill() {
+ const relList = document.createElement("link").relList;
+ if (relList && relList.supports && relList.supports("modulepreload")) {
+ return;
+ }
+ for (const link of document.querySelectorAll('link[rel="modulepreload"]')) {
+ processPreload(link);
+ }
+ new MutationObserver((mutations) => {
+ for (const mutation of mutations) {
+ if (mutation.type !== "childList") {
+ continue;
+ }
+ for (const node of mutation.addedNodes) {
+ if (node.tagName === "LINK" && node.rel === "modulepreload")
+ processPreload(node);
+ }
+ }
+ }).observe(document, { childList: true, subtree: true });
+ function getFetchOpts(link) {
+ const fetchOpts = {};
+ if (link.integrity) fetchOpts.integrity = link.integrity;
+ if (link.referrerPolicy) fetchOpts.referrerPolicy = link.referrerPolicy;
+ if (link.crossOrigin === "use-credentials")
+ fetchOpts.credentials = "include";
+ else if (link.crossOrigin === "anonymous") fetchOpts.credentials = "omit";
+ else fetchOpts.credentials = "same-origin";
+ return fetchOpts;
+ }
+ function processPreload(link) {
+ if (link.ep)
+ return;
+ link.ep = true;
+ const fetchOpts = getFetchOpts(link);
+ fetch(link.href, fetchOpts);
+ }
+}
+
+const htmlProxyRE$1 = /[?&]html-proxy=?(?:&inline-css)?(?:&style-attr)?&index=(\d+)\.(?:js|css)$/;
+const isHtmlProxyRE = /[?&]html-proxy\b/;
+const inlineCSSRE$1 = /__VITE_INLINE_CSS__([a-z\d]{8}_\d+)__/g;
+const inlineImportRE = /(?]*type\s*=\s*(?:"importmap"|'importmap'|importmap)[^>]*>.*?<\/script>/is;
+const moduleScriptRE = /[ \t]*