{ "version": 3, "sources": ["../node_modules/source-map-js/lib/base64.js", "../node_modules/source-map-js/lib/base64-vlq.js", "../node_modules/source-map-js/lib/util.js", "../node_modules/source-map-js/lib/array-set.js", "../node_modules/source-map-js/lib/mapping-list.js", "../node_modules/source-map-js/lib/source-map-generator.js", "../src/index.js", "../node_modules/css-tree/lib/tokenizer/char-code-definitions.js", "../node_modules/css-tree/lib/tokenizer/utils.js", "../node_modules/css-tree/lib/tokenizer/names.js", "../node_modules/css-tree/lib/tokenizer/adopt-buffer.js", "../node_modules/css-tree/lib/tokenizer/OffsetToLocation.js", "../node_modules/css-tree/lib/tokenizer/TokenStream.js", "../node_modules/css-tree/lib/tokenizer/index.js", "../node_modules/css-tree/lib/generator/sourceMap.js", "../node_modules/css-tree/lib/generator/token-before.js", "../node_modules/css-tree/lib/generator/create.js", "../node_modules/css-tree/lib/syntax/node/index-generate.js", "../node_modules/css-tree/lib/syntax/node/AnPlusB.js", "../node_modules/css-tree/lib/syntax/node/Atrule.js", "../node_modules/css-tree/lib/syntax/node/AtrulePrelude.js", "../node_modules/css-tree/lib/syntax/node/AttributeSelector.js", "../node_modules/css-tree/lib/syntax/node/Block.js", "../node_modules/css-tree/lib/syntax/node/Brackets.js", "../node_modules/css-tree/lib/syntax/node/CDC.js", "../node_modules/css-tree/lib/syntax/node/CDO.js", "../node_modules/css-tree/lib/syntax/node/ClassSelector.js", "../node_modules/css-tree/lib/syntax/node/Combinator.js", "../node_modules/css-tree/lib/syntax/node/Comment.js", "../node_modules/css-tree/lib/syntax/node/Condition.js", "../node_modules/css-tree/lib/syntax/node/Declaration.js", "../node_modules/css-tree/lib/syntax/node/DeclarationList.js", "../node_modules/css-tree/lib/syntax/node/Dimension.js", "../node_modules/css-tree/lib/syntax/node/Feature.js", "../node_modules/css-tree/lib/syntax/node/FeatureFunction.js", "../node_modules/css-tree/lib/syntax/node/FeatureRange.js", "../node_modules/css-tree/lib/syntax/node/Function.js", "../node_modules/css-tree/lib/syntax/node/GeneralEnclosed.js", "../node_modules/css-tree/lib/syntax/node/Hash.js", "../node_modules/css-tree/lib/syntax/node/Identifier.js", "../node_modules/css-tree/lib/syntax/node/IdSelector.js", "../node_modules/css-tree/lib/syntax/node/Layer.js", "../node_modules/css-tree/lib/syntax/node/LayerList.js", "../node_modules/css-tree/lib/syntax/node/MediaQuery.js", "../node_modules/css-tree/lib/syntax/node/MediaQueryList.js", "../node_modules/css-tree/lib/syntax/node/NestingSelector.js", "../node_modules/css-tree/lib/syntax/node/Nth.js", "../node_modules/css-tree/lib/syntax/node/Number.js", "../node_modules/css-tree/lib/syntax/node/Operator.js", "../node_modules/css-tree/lib/syntax/node/Parentheses.js", "../node_modules/css-tree/lib/syntax/node/Percentage.js", "../node_modules/css-tree/lib/syntax/node/PseudoClassSelector.js", "../node_modules/css-tree/lib/syntax/node/PseudoElementSelector.js", "../node_modules/css-tree/lib/syntax/node/Ratio.js", "../node_modules/css-tree/lib/syntax/node/Raw.js", "../node_modules/css-tree/lib/syntax/node/Rule.js", "../node_modules/css-tree/lib/syntax/node/Scope.js", "../node_modules/css-tree/lib/syntax/node/Selector.js", "../node_modules/css-tree/lib/syntax/node/SelectorList.js", "../node_modules/css-tree/lib/utils/string.js", "../node_modules/css-tree/lib/syntax/node/String.js", "../node_modules/css-tree/lib/syntax/node/StyleSheet.js", "../node_modules/css-tree/lib/syntax/node/SupportsDeclaration.js", "../node_modules/css-tree/lib/syntax/node/TypeSelector.js", "../node_modules/css-tree/lib/syntax/node/UnicodeRange.js", "../node_modules/css-tree/lib/utils/url.js", "../node_modules/css-tree/lib/syntax/node/Url.js", "../node_modules/css-tree/lib/syntax/node/Value.js", "../node_modules/css-tree/lib/syntax/node/WhiteSpace.js", "../node_modules/css-tree/lib/syntax/config/generator.js", "../node_modules/css-tree/lib/generator/index.js", "../node_modules/css-tree/lib/utils/List.js", "../node_modules/css-tree/lib/utils/create-custom-error.js", "../node_modules/css-tree/lib/parser/SyntaxError.js", "../node_modules/css-tree/lib/parser/sequence.js", "../node_modules/css-tree/lib/parser/create.js", "../node_modules/css-tree/lib/syntax/scope/selector.js", "../node_modules/css-tree/lib/syntax/pseudo/lang.js", "../node_modules/css-tree/lib/syntax/pseudo/index.js", "../node_modules/css-tree/lib/syntax/node/index-parse-selector.js", "../node_modules/css-tree/lib/syntax/config/parser-selector.js", "../node_modules/css-tree/lib/parser/parse-selector.js", "../src/util/compare.js", "../src/util/sort.js", "../src/util/filter.js", "../src/core/calculate.js"], "sourcesContent": ["/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');\n\n/**\n * Encode an integer in the range of 0 to 63 to a single base 64 digit.\n */\nexports.encode = function (number) {\n if (0 <= number && number < intToCharMap.length) {\n return intToCharMap[number];\n }\n throw new TypeError(\"Must be between 0 and 63: \" + number);\n};\n\n/**\n * Decode a single base 64 character code digit to an integer. Returns -1 on\n * failure.\n */\nexports.decode = function (charCode) {\n var bigA = 65; // 'A'\n var bigZ = 90; // 'Z'\n\n var littleA = 97; // 'a'\n var littleZ = 122; // 'z'\n\n var zero = 48; // '0'\n var nine = 57; // '9'\n\n var plus = 43; // '+'\n var slash = 47; // '/'\n\n var littleOffset = 26;\n var numberOffset = 52;\n\n // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ\n if (bigA <= charCode && charCode <= bigZ) {\n return (charCode - bigA);\n }\n\n // 26 - 51: abcdefghijklmnopqrstuvwxyz\n if (littleA <= charCode && charCode <= littleZ) {\n return (charCode - littleA + littleOffset);\n }\n\n // 52 - 61: 0123456789\n if (zero <= charCode && charCode <= nine) {\n return (charCode - zero + numberOffset);\n }\n\n // 62: +\n if (charCode == plus) {\n return 62;\n }\n\n // 63: /\n if (charCode == slash) {\n return 63;\n }\n\n // Invalid base64 digit.\n return -1;\n};\n", "/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * Based on the Base 64 VLQ implementation in Closure Compiler:\n * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java\n *\n * Copyright 2011 The Closure Compiler Authors. All rights reserved.\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following\n * disclaimer in the documentation and/or other materials provided\n * with the distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar base64 = require('./base64');\n\n// A single base 64 digit can contain 6 bits of data. For the base 64 variable\n// length quantities we use in the source map spec, the first bit is the sign,\n// the next four bits are the actual value, and the 6th bit is the\n// continuation bit. The continuation bit tells us whether there are more\n// digits in this value following this digit.\n//\n// Continuation\n// | Sign\n// | |\n// V V\n// 101011\n\nvar VLQ_BASE_SHIFT = 5;\n\n// binary: 100000\nvar VLQ_BASE = 1 << VLQ_BASE_SHIFT;\n\n// binary: 011111\nvar VLQ_BASE_MASK = VLQ_BASE - 1;\n\n// binary: 100000\nvar VLQ_CONTINUATION_BIT = VLQ_BASE;\n\n/**\n * Converts from a two-complement value to a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)\n * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)\n */\nfunction toVLQSigned(aValue) {\n return aValue < 0\n ? ((-aValue) << 1) + 1\n : (aValue << 1) + 0;\n}\n\n/**\n * Converts to a two-complement value from a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1\n * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2\n */\nfunction fromVLQSigned(aValue) {\n var isNegative = (aValue & 1) === 1;\n var shifted = aValue >> 1;\n return isNegative\n ? -shifted\n : shifted;\n}\n\n/**\n * Returns the base 64 VLQ encoded value.\n */\nexports.encode = function base64VLQ_encode(aValue) {\n var encoded = \"\";\n var digit;\n\n var vlq = toVLQSigned(aValue);\n\n do {\n digit = vlq & VLQ_BASE_MASK;\n vlq >>>= VLQ_BASE_SHIFT;\n if (vlq > 0) {\n // There are still more digits in this value, so we must make sure the\n // continuation bit is marked.\n digit |= VLQ_CONTINUATION_BIT;\n }\n encoded += base64.encode(digit);\n } while (vlq > 0);\n\n return encoded;\n};\n\n/**\n * Decodes the next base 64 VLQ value from the given string and returns the\n * value and the rest of the string via the out parameter.\n */\nexports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {\n var strLen = aStr.length;\n var result = 0;\n var shift = 0;\n var continuation, digit;\n\n do {\n if (aIndex >= strLen) {\n throw new Error(\"Expected more digits in base 64 VLQ value.\");\n }\n\n digit = base64.decode(aStr.charCodeAt(aIndex++));\n if (digit === -1) {\n throw new Error(\"Invalid base64 digit: \" + aStr.charAt(aIndex - 1));\n }\n\n continuation = !!(digit & VLQ_CONTINUATION_BIT);\n digit &= VLQ_BASE_MASK;\n result = result + (digit << shift);\n shift += VLQ_BASE_SHIFT;\n } while (continuation);\n\n aOutParam.value = fromVLQSigned(result);\n aOutParam.rest = aIndex;\n};\n", "/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n/**\n * This is a helper function for getting values from parameter/options\n * objects.\n *\n * @param args The object we are extracting values from\n * @param name The name of the property we are getting.\n * @param defaultValue An optional value to return if the property is missing\n * from the object. If this is not specified and the property is missing, an\n * error will be thrown.\n */\nfunction getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}\nexports.getArg = getArg;\n\nvar urlRegexp = /^(?:([\\w+\\-.]+):)?\\/\\/(?:(\\w+:\\w+)@)?([\\w.-]*)(?::(\\d+))?(.*)$/;\nvar dataUrlRegexp = /^data:.+\\,.+$/;\n\nfunction urlParse(aUrl) {\n var match = aUrl.match(urlRegexp);\n if (!match) {\n return null;\n }\n return {\n scheme: match[1],\n auth: match[2],\n host: match[3],\n port: match[4],\n path: match[5]\n };\n}\nexports.urlParse = urlParse;\n\nfunction urlGenerate(aParsedUrl) {\n var url = '';\n if (aParsedUrl.scheme) {\n url += aParsedUrl.scheme + ':';\n }\n url += '//';\n if (aParsedUrl.auth) {\n url += aParsedUrl.auth + '@';\n }\n if (aParsedUrl.host) {\n url += aParsedUrl.host;\n }\n if (aParsedUrl.port) {\n url += \":\" + aParsedUrl.port\n }\n if (aParsedUrl.path) {\n url += aParsedUrl.path;\n }\n return url;\n}\nexports.urlGenerate = urlGenerate;\n\nvar MAX_CACHED_INPUTS = 32;\n\n/**\n * Takes some function `f(input) -> result` and returns a memoized version of\n * `f`.\n *\n * We keep at most `MAX_CACHED_INPUTS` memoized results of `f` alive. The\n * memoization is a dumb-simple, linear least-recently-used cache.\n */\nfunction lruMemoize(f) {\n var cache = [];\n\n return function(input) {\n for (var i = 0; i < cache.length; i++) {\n if (cache[i].input === input) {\n var temp = cache[0];\n cache[0] = cache[i];\n cache[i] = temp;\n return cache[0].result;\n }\n }\n\n var result = f(input);\n\n cache.unshift({\n input,\n result,\n });\n\n if (cache.length > MAX_CACHED_INPUTS) {\n cache.pop();\n }\n\n return result;\n };\n}\n\n/**\n * Normalizes a path, or the path portion of a URL:\n *\n * - Replaces consecutive slashes with one slash.\n * - Removes unnecessary '.' parts.\n * - Removes unnecessary '/..' parts.\n *\n * Based on code in the Node.js 'path' core module.\n *\n * @param aPath The path or url to normalize.\n */\nvar normalize = lruMemoize(function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n // Split the path into parts between `/` characters. This is much faster than\n // using `.split(/\\/+/g)`.\n var parts = [];\n var start = 0;\n var i = 0;\n while (true) {\n start = i;\n i = path.indexOf(\"/\", start);\n if (i === -1) {\n parts.push(path.slice(start));\n break;\n } else {\n parts.push(path.slice(start, i));\n while (i < path.length && path[i] === \"/\") {\n i++;\n }\n }\n }\n\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n});\nexports.normalize = normalize;\n\n/**\n * Joins two paths/URLs.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be joined with the root.\n *\n * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a\n * scheme-relative URL: Then the scheme of aRoot, if any, is prepended\n * first.\n * - Otherwise aPath is a path. If aRoot is a URL, then its path portion\n * is updated with the result and aRoot is returned. Otherwise the result\n * is returned.\n * - If aPath is absolute, the result is aPath.\n * - Otherwise the two paths are joined with a slash.\n * - Joining for example 'http://' and 'www.example.com' is also supported.\n */\nfunction join(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n if (aPath === \"\") {\n aPath = \".\";\n }\n var aPathUrl = urlParse(aPath);\n var aRootUrl = urlParse(aRoot);\n if (aRootUrl) {\n aRoot = aRootUrl.path || '/';\n }\n\n // `join(foo, '//www.example.org')`\n if (aPathUrl && !aPathUrl.scheme) {\n if (aRootUrl) {\n aPathUrl.scheme = aRootUrl.scheme;\n }\n return urlGenerate(aPathUrl);\n }\n\n if (aPathUrl || aPath.match(dataUrlRegexp)) {\n return aPath;\n }\n\n // `join('http://', 'www.example.com')`\n if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {\n aRootUrl.host = aPath;\n return urlGenerate(aRootUrl);\n }\n\n var joined = aPath.charAt(0) === '/'\n ? aPath\n : normalize(aRoot.replace(/\\/+$/, '') + '/' + aPath);\n\n if (aRootUrl) {\n aRootUrl.path = joined;\n return urlGenerate(aRootUrl);\n }\n return joined;\n}\nexports.join = join;\n\nexports.isAbsolute = function (aPath) {\n return aPath.charAt(0) === '/' || urlRegexp.test(aPath);\n};\n\n/**\n * Make a path relative to a URL or another path.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be made relative to aRoot.\n */\nfunction relative(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n\n aRoot = aRoot.replace(/\\/$/, '');\n\n // It is possible for the path to be above the root. In this case, simply\n // checking whether the root is a prefix of the path won't work. Instead, we\n // need to remove components from the root one by one, until either we find\n // a prefix that fits, or we run out of components to remove.\n var level = 0;\n while (aPath.indexOf(aRoot + '/') !== 0) {\n var index = aRoot.lastIndexOf(\"/\");\n if (index < 0) {\n return aPath;\n }\n\n // If the only part of the root that is left is the scheme (i.e. http://,\n // file:///, etc.), one or more slashes (/), or simply nothing at all, we\n // have exhausted all components, so the path is not relative to the root.\n aRoot = aRoot.slice(0, index);\n if (aRoot.match(/^([^\\/]+:\\/)?\\/*$/)) {\n return aPath;\n }\n\n ++level;\n }\n\n // Make sure we add a \"../\" for each component we removed from the root.\n return Array(level + 1).join(\"../\") + aPath.substr(aRoot.length + 1);\n}\nexports.relative = relative;\n\nvar supportsNullProto = (function () {\n var obj = Object.create(null);\n return !('__proto__' in obj);\n}());\n\nfunction identity (s) {\n return s;\n}\n\n/**\n * Because behavior goes wacky when you set `__proto__` on objects, we\n * have to prefix all the strings in our set with an arbitrary character.\n *\n * See https://github.com/mozilla/source-map/pull/31 and\n * https://github.com/mozilla/source-map/issues/30\n *\n * @param String aStr\n */\nfunction toSetString(aStr) {\n if (isProtoString(aStr)) {\n return '$' + aStr;\n }\n\n return aStr;\n}\nexports.toSetString = supportsNullProto ? identity : toSetString;\n\nfunction fromSetString(aStr) {\n if (isProtoString(aStr)) {\n return aStr.slice(1);\n }\n\n return aStr;\n}\nexports.fromSetString = supportsNullProto ? identity : fromSetString;\n\nfunction isProtoString(s) {\n if (!s) {\n return false;\n }\n\n var length = s.length;\n\n if (length < 9 /* \"__proto__\".length */) {\n return false;\n }\n\n if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||\n s.charCodeAt(length - 2) !== 95 /* '_' */ ||\n s.charCodeAt(length - 3) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 4) !== 116 /* 't' */ ||\n s.charCodeAt(length - 5) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 6) !== 114 /* 'r' */ ||\n s.charCodeAt(length - 7) !== 112 /* 'p' */ ||\n s.charCodeAt(length - 8) !== 95 /* '_' */ ||\n s.charCodeAt(length - 9) !== 95 /* '_' */) {\n return false;\n }\n\n for (var i = length - 10; i >= 0; i--) {\n if (s.charCodeAt(i) !== 36 /* '$' */) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Comparator between two mappings where the original positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same original source/line/column, but different generated\n * line and column the same. Useful when searching for a mapping with a\n * stubbed out mapping.\n */\nfunction compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {\n var cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0 || onlyCompareOriginal) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByOriginalPositions = compareByOriginalPositions;\n\nfunction compareByOriginalPositionsNoSource(mappingA, mappingB, onlyCompareOriginal) {\n var cmp\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0 || onlyCompareOriginal) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByOriginalPositionsNoSource = compareByOriginalPositionsNoSource;\n\n/**\n * Comparator between two mappings with deflated source and name indices where\n * the generated positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same generated line and column, but different\n * source/name/original line and column the same. Useful when searching for a\n * mapping with a stubbed out mapping.\n */\nfunction compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0 || onlyCompareGenerated) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;\n\nfunction compareByGeneratedPositionsDeflatedNoLine(mappingA, mappingB, onlyCompareGenerated) {\n var cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0 || onlyCompareGenerated) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsDeflatedNoLine = compareByGeneratedPositionsDeflatedNoLine;\n\nfunction strcmp(aStr1, aStr2) {\n if (aStr1 === aStr2) {\n return 0;\n }\n\n if (aStr1 === null) {\n return 1; // aStr2 !== null\n }\n\n if (aStr2 === null) {\n return -1; // aStr1 !== null\n }\n\n if (aStr1 > aStr2) {\n return 1;\n }\n\n return -1;\n}\n\n/**\n * Comparator between two mappings with inflated source and name strings where\n * the generated positions are compared.\n */\nfunction compareByGeneratedPositionsInflated(mappingA, mappingB) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;\n\n/**\n * Strip any JSON XSSI avoidance prefix from the string (as documented\n * in the source maps specification), and then parse the string as\n * JSON.\n */\nfunction parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}\nexports.parseSourceMapInput = parseSourceMapInput;\n\n/**\n * Compute the URL of a source given the the source root, the source's\n * URL, and the source map's URL.\n */\nfunction computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {\n sourceURL = sourceURL || '';\n\n if (sourceRoot) {\n // This follows what Chrome does.\n if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {\n sourceRoot += '/';\n }\n // The spec says:\n // Line 4: An optional source root, useful for relocating source\n // files on a server or removing repeated values in the\n // \u201Csources\u201D entry. This value is prepended to the individual\n // entries in the \u201Csource\u201D field.\n sourceURL = sourceRoot + sourceURL;\n }\n\n // Historically, SourceMapConsumer did not take the sourceMapURL as\n // a parameter. This mode is still somewhat supported, which is why\n // this code block is conditional. However, it's preferable to pass\n // the source map URL to SourceMapConsumer, so that this function\n // can implement the source URL resolution algorithm as outlined in\n // the spec. This block is basically the equivalent of:\n // new URL(sourceURL, sourceMapURL).toString()\n // ... except it avoids using URL, which wasn't available in the\n // older releases of node still supported by this library.\n //\n // The spec says:\n // If the sources are not absolute URLs after prepending of the\n // \u201CsourceRoot\u201D, the sources are resolved relative to the\n // SourceMap (like resolving script src in a html document).\n if (sourceMapURL) {\n var parsed = urlParse(sourceMapURL);\n if (!parsed) {\n throw new Error(\"sourceMapURL could not be parsed\");\n }\n if (parsed.path) {\n // Strip the last path component, but keep the \"/\".\n var index = parsed.path.lastIndexOf('/');\n if (index >= 0) {\n parsed.path = parsed.path.substring(0, index + 1);\n }\n }\n sourceURL = join(urlGenerate(parsed), sourceURL);\n }\n\n return normalize(sourceURL);\n}\nexports.computeSourceURL = computeSourceURL;\n", "/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar has = Object.prototype.hasOwnProperty;\nvar hasNativeMap = typeof Map !== \"undefined\";\n\n/**\n * A data structure which is a combination of an array and a set. Adding a new\n * member is O(1), testing for membership is O(1), and finding the index of an\n * element is O(1). Removing elements from the set is not supported. Only\n * strings are supported for membership.\n */\nfunction ArraySet() {\n this._array = [];\n this._set = hasNativeMap ? new Map() : Object.create(null);\n}\n\n/**\n * Static method for creating ArraySet instances from an existing array.\n */\nArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {\n var set = new ArraySet();\n for (var i = 0, len = aArray.length; i < len; i++) {\n set.add(aArray[i], aAllowDuplicates);\n }\n return set;\n};\n\n/**\n * Return how many unique items are in this ArraySet. If duplicates have been\n * added, than those do not count towards the size.\n *\n * @returns Number\n */\nArraySet.prototype.size = function ArraySet_size() {\n return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;\n};\n\n/**\n * Add the given string to this set.\n *\n * @param String aStr\n */\nArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {\n var sStr = hasNativeMap ? aStr : util.toSetString(aStr);\n var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);\n var idx = this._array.length;\n if (!isDuplicate || aAllowDuplicates) {\n this._array.push(aStr);\n }\n if (!isDuplicate) {\n if (hasNativeMap) {\n this._set.set(aStr, idx);\n } else {\n this._set[sStr] = idx;\n }\n }\n};\n\n/**\n * Is the given string a member of this set?\n *\n * @param String aStr\n */\nArraySet.prototype.has = function ArraySet_has(aStr) {\n if (hasNativeMap) {\n return this._set.has(aStr);\n } else {\n var sStr = util.toSetString(aStr);\n return has.call(this._set, sStr);\n }\n};\n\n/**\n * What is the index of the given string in the array?\n *\n * @param String aStr\n */\nArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {\n if (hasNativeMap) {\n var idx = this._set.get(aStr);\n if (idx >= 0) {\n return idx;\n }\n } else {\n var sStr = util.toSetString(aStr);\n if (has.call(this._set, sStr)) {\n return this._set[sStr];\n }\n }\n\n throw new Error('\"' + aStr + '\" is not in the set.');\n};\n\n/**\n * What is the element at the given index?\n *\n * @param Number aIdx\n */\nArraySet.prototype.at = function ArraySet_at(aIdx) {\n if (aIdx >= 0 && aIdx < this._array.length) {\n return this._array[aIdx];\n }\n throw new Error('No element indexed by ' + aIdx);\n};\n\n/**\n * Returns the array representation of this set (which has the proper indices\n * indicated by indexOf). Note that this is a copy of the internal array used\n * for storing the members so that no one can mess with internal state.\n */\nArraySet.prototype.toArray = function ArraySet_toArray() {\n return this._array.slice();\n};\n\nexports.ArraySet = ArraySet;\n", "/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2014 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\n\n/**\n * Determine whether mappingB is after mappingA with respect to generated\n * position.\n */\nfunction generatedPositionAfter(mappingA, mappingB) {\n // Optimized for most common case\n var lineA = mappingA.generatedLine;\n var lineB = mappingB.generatedLine;\n var columnA = mappingA.generatedColumn;\n var columnB = mappingB.generatedColumn;\n return lineB > lineA || lineB == lineA && columnB >= columnA ||\n util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;\n}\n\n/**\n * A data structure to provide a sorted view of accumulated mappings in a\n * performance conscious manner. It trades a neglibable overhead in general\n * case for a large speedup in case of mappings being added in order.\n */\nfunction MappingList() {\n this._array = [];\n this._sorted = true;\n // Serves as infimum\n this._last = {generatedLine: -1, generatedColumn: 0};\n}\n\n/**\n * Iterate through internal items. This method takes the same arguments that\n * `Array.prototype.forEach` takes.\n *\n * NOTE: The order of the mappings is NOT guaranteed.\n */\nMappingList.prototype.unsortedForEach =\n function MappingList_forEach(aCallback, aThisArg) {\n this._array.forEach(aCallback, aThisArg);\n };\n\n/**\n * Add the given source mapping.\n *\n * @param Object aMapping\n */\nMappingList.prototype.add = function MappingList_add(aMapping) {\n if (generatedPositionAfter(this._last, aMapping)) {\n this._last = aMapping;\n this._array.push(aMapping);\n } else {\n this._sorted = false;\n this._array.push(aMapping);\n }\n};\n\n/**\n * Returns the flat, sorted array of mappings. The mappings are sorted by\n * generated position.\n *\n * WARNING: This method returns internal data without copying, for\n * performance. The return value must NOT be mutated, and should be treated as\n * an immutable borrow. If you want to take ownership, you must make your own\n * copy.\n */\nMappingList.prototype.toArray = function MappingList_toArray() {\n if (!this._sorted) {\n this._array.sort(util.compareByGeneratedPositionsInflated);\n this._sorted = true;\n }\n return this._array;\n};\n\nexports.MappingList = MappingList;\n", "/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar base64VLQ = require('./base64-vlq');\nvar util = require('./util');\nvar ArraySet = require('./array-set').ArraySet;\nvar MappingList = require('./mapping-list').MappingList;\n\n/**\n * An instance of the SourceMapGenerator represents a source map which is\n * being built incrementally. You may pass an object with the following\n * properties:\n *\n * - file: The filename of the generated source.\n * - sourceRoot: A root for all relative URLs in this source map.\n */\nfunction SourceMapGenerator(aArgs) {\n if (!aArgs) {\n aArgs = {};\n }\n this._file = util.getArg(aArgs, 'file', null);\n this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);\n this._skipValidation = util.getArg(aArgs, 'skipValidation', false);\n this._sources = new ArraySet();\n this._names = new ArraySet();\n this._mappings = new MappingList();\n this._sourcesContents = null;\n}\n\nSourceMapGenerator.prototype._version = 3;\n\n/**\n * Creates a new SourceMapGenerator based on a SourceMapConsumer\n *\n * @param aSourceMapConsumer The SourceMap.\n */\nSourceMapGenerator.fromSourceMap =\n function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {\n var sourceRoot = aSourceMapConsumer.sourceRoot;\n var generator = new SourceMapGenerator({\n file: aSourceMapConsumer.file,\n sourceRoot: sourceRoot\n });\n aSourceMapConsumer.eachMapping(function (mapping) {\n var newMapping = {\n generated: {\n line: mapping.generatedLine,\n column: mapping.generatedColumn\n }\n };\n\n if (mapping.source != null) {\n newMapping.source = mapping.source;\n if (sourceRoot != null) {\n newMapping.source = util.relative(sourceRoot, newMapping.source);\n }\n\n newMapping.original = {\n line: mapping.originalLine,\n column: mapping.originalColumn\n };\n\n if (mapping.name != null) {\n newMapping.name = mapping.name;\n }\n }\n\n generator.addMapping(newMapping);\n });\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var sourceRelative = sourceFile;\n if (sourceRoot !== null) {\n sourceRelative = util.relative(sourceRoot, sourceFile);\n }\n\n if (!generator._sources.has(sourceRelative)) {\n generator._sources.add(sourceRelative);\n }\n\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n generator.setSourceContent(sourceFile, content);\n }\n });\n return generator;\n };\n\n/**\n * Add a single mapping from original source line and column to the generated\n * source's line and column for this source map being created. The mapping\n * object should have the following properties:\n *\n * - generated: An object with the generated line and column positions.\n * - original: An object with the original line and column positions.\n * - source: The original source file (relative to the sourceRoot).\n * - name: An optional original token name for this mapping.\n */\nSourceMapGenerator.prototype.addMapping =\n function SourceMapGenerator_addMapping(aArgs) {\n var generated = util.getArg(aArgs, 'generated');\n var original = util.getArg(aArgs, 'original', null);\n var source = util.getArg(aArgs, 'source', null);\n var name = util.getArg(aArgs, 'name', null);\n\n if (!this._skipValidation) {\n this._validateMapping(generated, original, source, name);\n }\n\n if (source != null) {\n source = String(source);\n if (!this._sources.has(source)) {\n this._sources.add(source);\n }\n }\n\n if (name != null) {\n name = String(name);\n if (!this._names.has(name)) {\n this._names.add(name);\n }\n }\n\n this._mappings.add({\n generatedLine: generated.line,\n generatedColumn: generated.column,\n originalLine: original != null && original.line,\n originalColumn: original != null && original.column,\n source: source,\n name: name\n });\n };\n\n/**\n * Set the source content for a source file.\n */\nSourceMapGenerator.prototype.setSourceContent =\n function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {\n var source = aSourceFile;\n if (this._sourceRoot != null) {\n source = util.relative(this._sourceRoot, source);\n }\n\n if (aSourceContent != null) {\n // Add the source content to the _sourcesContents map.\n // Create a new _sourcesContents map if the property is null.\n if (!this._sourcesContents) {\n this._sourcesContents = Object.create(null);\n }\n this._sourcesContents[util.toSetString(source)] = aSourceContent;\n } else if (this._sourcesContents) {\n // Remove the source file from the _sourcesContents map.\n // If the _sourcesContents map is empty, set the property to null.\n delete this._sourcesContents[util.toSetString(source)];\n if (Object.keys(this._sourcesContents).length === 0) {\n this._sourcesContents = null;\n }\n }\n };\n\n/**\n * Applies the mappings of a sub-source-map for a specific source file to the\n * source map being generated. Each mapping to the supplied source file is\n * rewritten using the supplied source map. Note: The resolution for the\n * resulting mappings is the minimium of this map and the supplied map.\n *\n * @param aSourceMapConsumer The source map to be applied.\n * @param aSourceFile Optional. The filename of the source file.\n * If omitted, SourceMapConsumer's file property will be used.\n * @param aSourceMapPath Optional. The dirname of the path to the source map\n * to be applied. If relative, it is relative to the SourceMapConsumer.\n * This parameter is needed when the two source maps aren't in the same\n * directory, and the source map to be applied contains relative source\n * paths. If so, those relative source paths need to be rewritten\n * relative to the SourceMapGenerator.\n */\nSourceMapGenerator.prototype.applySourceMap =\n function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {\n var sourceFile = aSourceFile;\n // If aSourceFile is omitted, we will use the file property of the SourceMap\n if (aSourceFile == null) {\n if (aSourceMapConsumer.file == null) {\n throw new Error(\n 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +\n 'or the source map\\'s \"file\" property. Both were omitted.'\n );\n }\n sourceFile = aSourceMapConsumer.file;\n }\n var sourceRoot = this._sourceRoot;\n // Make \"sourceFile\" relative if an absolute Url is passed.\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n // Applying the SourceMap can add and remove items from the sources and\n // the names array.\n var newSources = new ArraySet();\n var newNames = new ArraySet();\n\n // Find mappings for the \"sourceFile\"\n this._mappings.unsortedForEach(function (mapping) {\n if (mapping.source === sourceFile && mapping.originalLine != null) {\n // Check if it can be mapped by the source map, then update the mapping.\n var original = aSourceMapConsumer.originalPositionFor({\n line: mapping.originalLine,\n column: mapping.originalColumn\n });\n if (original.source != null) {\n // Copy mapping\n mapping.source = original.source;\n if (aSourceMapPath != null) {\n mapping.source = util.join(aSourceMapPath, mapping.source)\n }\n if (sourceRoot != null) {\n mapping.source = util.relative(sourceRoot, mapping.source);\n }\n mapping.originalLine = original.line;\n mapping.originalColumn = original.column;\n if (original.name != null) {\n mapping.name = original.name;\n }\n }\n }\n\n var source = mapping.source;\n if (source != null && !newSources.has(source)) {\n newSources.add(source);\n }\n\n var name = mapping.name;\n if (name != null && !newNames.has(name)) {\n newNames.add(name);\n }\n\n }, this);\n this._sources = newSources;\n this._names = newNames;\n\n // Copy sourcesContents of applied map.\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n if (aSourceMapPath != null) {\n sourceFile = util.join(aSourceMapPath, sourceFile);\n }\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n this.setSourceContent(sourceFile, content);\n }\n }, this);\n };\n\n/**\n * A mapping can have one of the three levels of data:\n *\n * 1. Just the generated position.\n * 2. The Generated position, original position, and original source.\n * 3. Generated and original position, original source, as well as a name\n * token.\n *\n * To maintain consistency, we validate that any new mapping being added falls\n * in to one of these categories.\n */\nSourceMapGenerator.prototype._validateMapping =\n function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,\n aName) {\n // When aOriginal is truthy but has empty values for .line and .column,\n // it is most likely a programmer error. In this case we throw a very\n // specific error message to try to guide them the right way.\n // For example: https://github.com/Polymer/polymer-bundler/pull/519\n if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {\n throw new Error(\n 'original.line and original.column are not numbers -- you probably meant to omit ' +\n 'the original mapping entirely and only map the generated position. If so, pass ' +\n 'null for the original mapping instead of an object with empty or null values.'\n );\n }\n\n if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aGenerated.line > 0 && aGenerated.column >= 0\n && !aOriginal && !aSource && !aName) {\n // Case 1.\n return;\n }\n else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aOriginal && 'line' in aOriginal && 'column' in aOriginal\n && aGenerated.line > 0 && aGenerated.column >= 0\n && aOriginal.line > 0 && aOriginal.column >= 0\n && aSource) {\n // Cases 2 and 3.\n return;\n }\n else {\n throw new Error('Invalid mapping: ' + JSON.stringify({\n generated: aGenerated,\n source: aSource,\n original: aOriginal,\n name: aName\n }));\n }\n };\n\n/**\n * Serialize the accumulated mappings in to the stream of base 64 VLQs\n * specified by the source map format.\n */\nSourceMapGenerator.prototype._serializeMappings =\n function SourceMapGenerator_serializeMappings() {\n var previousGeneratedColumn = 0;\n var previousGeneratedLine = 1;\n var previousOriginalColumn = 0;\n var previousOriginalLine = 0;\n var previousName = 0;\n var previousSource = 0;\n var result = '';\n var next;\n var mapping;\n var nameIdx;\n var sourceIdx;\n\n var mappings = this._mappings.toArray();\n for (var i = 0, len = mappings.length; i < len; i++) {\n mapping = mappings[i];\n next = ''\n\n if (mapping.generatedLine !== previousGeneratedLine) {\n previousGeneratedColumn = 0;\n while (mapping.generatedLine !== previousGeneratedLine) {\n next += ';';\n previousGeneratedLine++;\n }\n }\n else {\n if (i > 0) {\n if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {\n continue;\n }\n next += ',';\n }\n }\n\n next += base64VLQ.encode(mapping.generatedColumn\n - previousGeneratedColumn);\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (mapping.source != null) {\n sourceIdx = this._sources.indexOf(mapping.source);\n next += base64VLQ.encode(sourceIdx - previousSource);\n previousSource = sourceIdx;\n\n // lines are stored 0-based in SourceMap spec version 3\n next += base64VLQ.encode(mapping.originalLine - 1\n - previousOriginalLine);\n previousOriginalLine = mapping.originalLine - 1;\n\n next += base64VLQ.encode(mapping.originalColumn\n - previousOriginalColumn);\n previousOriginalColumn = mapping.originalColumn;\n\n if (mapping.name != null) {\n nameIdx = this._names.indexOf(mapping.name);\n next += base64VLQ.encode(nameIdx - previousName);\n previousName = nameIdx;\n }\n }\n\n result += next;\n }\n\n return result;\n };\n\nSourceMapGenerator.prototype._generateSourcesContent =\n function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {\n return aSources.map(function (source) {\n if (!this._sourcesContents) {\n return null;\n }\n if (aSourceRoot != null) {\n source = util.relative(aSourceRoot, source);\n }\n var key = util.toSetString(source);\n return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)\n ? this._sourcesContents[key]\n : null;\n }, this);\n };\n\n/**\n * Externalize the source map.\n */\nSourceMapGenerator.prototype.toJSON =\n function SourceMapGenerator_toJSON() {\n var map = {\n version: this._version,\n sources: this._sources.toArray(),\n names: this._names.toArray(),\n mappings: this._serializeMappings()\n };\n if (this._file != null) {\n map.file = this._file;\n }\n if (this._sourceRoot != null) {\n map.sourceRoot = this._sourceRoot;\n }\n if (this._sourcesContents) {\n map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);\n }\n\n return map;\n };\n\n/**\n * Render the source map being generated to a string.\n */\nSourceMapGenerator.prototype.toString =\n function SourceMapGenerator_toString() {\n return JSON.stringify(this.toJSON());\n };\n\nexports.SourceMapGenerator = SourceMapGenerator;\n", "import generate from 'css-tree/generator';\n\nimport { calculate, calculateForAST } from './core/index.js';\nimport { compare, equals, greaterThan, lessThan } from './util/compare.js';\nimport { min, max } from './util/filter.js';\nimport { sortAsc, sortDesc } from './util/sort.js';\n\nclass NotAllowedError extends Error {\n constructor() {\n super('Manipulating a Specificity instance is not allowed. Instead, create a new Specificity()');\n }\n}\n\nclass Specificity {\n constructor(value, selector = null) {\n this.value = value;\n this.selector = selector;\n }\n\n get a() {\n return this.value.a;\n }\n\n set a(val) {\n throw new NotAllowedError();\n }\n\n get b() {\n return this.value.b;\n }\n\n set b(val) {\n throw new NotAllowedError();\n }\n\n get c() {\n return this.value.c;\n }\n\n set c(val) {\n throw new NotAllowedError();\n }\n\n selectorString() {\n // this.selector already is a String\n if (typeof this.selector === 'string' || this.selector instanceof String) {\n return this.selector;\n }\n\n // this.selector is a Selector as parsed by CSSTree\n if (this.selector instanceof Object) {\n if (this.selector.type === 'Selector') {\n return generate(this.selector);\n }\n }\n\n // this.selector is something else \u2026\n return '';\n }\n\n toObject() {\n return this.value;\n }\n\n toArray() {\n return [this.value.a, this.value.b, this.value.c];\n }\n\n toString() {\n return `(${this.value.a},${this.value.b},${this.value.c})`;\n }\n\n toJSON() {\n return {\n selector: this.selectorString(),\n asObject: this.toObject(),\n asArray: this.toArray(),\n asString: this.toString(),\n };\n }\n\n isEqualTo(otherSpecificity) {\n return equals(this, otherSpecificity);\n }\n\n isGreaterThan(otherSpecificity) {\n return greaterThan(this, otherSpecificity);\n }\n\n isLessThan(otherSpecificity) {\n return lessThan(this, otherSpecificity);\n }\n\n static calculate(selector) {\n return calculate(selector);\n }\n\n static calculateForAST(selector) {\n return calculateForAST(selector);\n }\n\n static compare(s1, s2) {\n return compare(s1, s2);\n }\n\n static equals(s1, s2) {\n return equals(s1, s2);\n }\n\n static lessThan(s1, s2) {\n return lessThan(s1, s2);\n }\n\n static greaterThan(s1, s2) {\n return greaterThan(s1, s2);\n }\n\n static min(...specificities) {\n return min(...specificities);\n }\n\n static max(...specificities) {\n return max(...specificities);\n }\n\n static sortAsc(...specificities) {\n return sortAsc(...specificities);\n }\n\n static sortDesc(...specificities) {\n return sortDesc(...specificities);\n }\n}\n\nexport default Specificity;\n", "const EOF = 0;\n\n// https://drafts.csswg.org/css-syntax-3/\n// \u00A7 4.2. Definitions\n\n// digit\n// A code point between U+0030 DIGIT ZERO (0) and U+0039 DIGIT NINE (9).\nexport function isDigit(code) {\n return code >= 0x0030 && code <= 0x0039;\n}\n\n// hex digit\n// A digit, or a code point between U+0041 LATIN CAPITAL LETTER A (A) and U+0046 LATIN CAPITAL LETTER F (F),\n// or a code point between U+0061 LATIN SMALL LETTER A (a) and U+0066 LATIN SMALL LETTER F (f).\nexport function isHexDigit(code) {\n return (\n isDigit(code) || // 0 .. 9\n (code >= 0x0041 && code <= 0x0046) || // A .. F\n (code >= 0x0061 && code <= 0x0066) // a .. f\n );\n}\n\n// uppercase letter\n// A code point between U+0041 LATIN CAPITAL LETTER A (A) and U+005A LATIN CAPITAL LETTER Z (Z).\nexport function isUppercaseLetter(code) {\n return code >= 0x0041 && code <= 0x005A;\n}\n\n// lowercase letter\n// A code point between U+0061 LATIN SMALL LETTER A (a) and U+007A LATIN SMALL LETTER Z (z).\nexport function isLowercaseLetter(code) {\n return code >= 0x0061 && code <= 0x007A;\n}\n\n// letter\n// An uppercase letter or a lowercase letter.\nexport function isLetter(code) {\n return isUppercaseLetter(code) || isLowercaseLetter(code);\n}\n\n// non-ASCII code point\n// A code point with a value equal to or greater than U+0080 .\n//\n// 2024-09-02: The latest spec narrows the range for non-ASCII characters (see https://github.com/csstree/csstree/issues/188).\n// However, all modern browsers support a wider range, and strictly following the latest spec could result\n// in some CSS being parsed incorrectly, even though it works in the browser. Therefore, this function adheres\n// to the previous, broader definition of non-ASCII characters.\nexport function isNonAscii(code) {\n return code >= 0x0080;\n}\n\n// name-start code point\n// A letter, a non-ASCII code point, or U+005F LOW LINE (_).\nexport function isNameStart(code) {\n return isLetter(code) || isNonAscii(code) || code === 0x005F;\n}\n\n// name code point\n// A name-start code point, a digit, or U+002D HYPHEN-MINUS (-).\nexport function isName(code) {\n return isNameStart(code) || isDigit(code) || code === 0x002D;\n}\n\n// non-printable code point\n// A code point between U+0000 NULL and U+0008 BACKSPACE, or U+000B LINE TABULATION,\n// or a code point between U+000E SHIFT OUT and U+001F INFORMATION SEPARATOR ONE, or U+007F DELETE.\nexport function isNonPrintable(code) {\n return (\n (code >= 0x0000 && code <= 0x0008) ||\n (code === 0x000B) ||\n (code >= 0x000E && code <= 0x001F) ||\n (code === 0x007F)\n );\n}\n\n// newline\n// U+000A LINE FEED. Note that U+000D CARRIAGE RETURN and U+000C FORM FEED are not included in this definition,\n// as they are converted to U+000A LINE FEED during preprocessing.\n// TODO: we doesn't do a preprocessing, so check a code point for U+000D CARRIAGE RETURN and U+000C FORM FEED\nexport function isNewline(code) {\n return code === 0x000A || code === 0x000D || code === 0x000C;\n}\n\n// whitespace\n// A newline, U+0009 CHARACTER TABULATION, or U+0020 SPACE.\nexport function isWhiteSpace(code) {\n return isNewline(code) || code === 0x0020 || code === 0x0009;\n}\n\n// \u00A7 4.3.8. Check if two code points are a valid escape\nexport function isValidEscape(first, second) {\n // If the first code point is not U+005C REVERSE SOLIDUS (\\), return false.\n if (first !== 0x005C) {\n return false;\n }\n\n // Otherwise, if the second code point is a newline or EOF, return false.\n if (isNewline(second) || second === EOF) {\n return false;\n }\n\n // Otherwise, return true.\n return true;\n}\n\n// \u00A7 4.3.9. Check if three code points would start an identifier\nexport function isIdentifierStart(first, second, third) {\n // Look at the first code point:\n\n // U+002D HYPHEN-MINUS\n if (first === 0x002D) {\n // If the second code point is a name-start code point or a U+002D HYPHEN-MINUS,\n // or the second and third code points are a valid escape, return true. Otherwise, return false.\n return (\n isNameStart(second) ||\n second === 0x002D ||\n isValidEscape(second, third)\n );\n }\n\n // name-start code point\n if (isNameStart(first)) {\n // Return true.\n return true;\n }\n\n // U+005C REVERSE SOLIDUS (\\)\n if (first === 0x005C) {\n // If the first and second code points are a valid escape, return true. Otherwise, return false.\n return isValidEscape(first, second);\n }\n\n // anything else\n // Return false.\n return false;\n}\n\n// \u00A7 4.3.10. Check if three code points would start a number\nexport function isNumberStart(first, second, third) {\n // Look at the first code point:\n\n // U+002B PLUS SIGN (+)\n // U+002D HYPHEN-MINUS (-)\n if (first === 0x002B || first === 0x002D) {\n // If the second code point is a digit, return true.\n if (isDigit(second)) {\n return 2;\n }\n\n // Otherwise, if the second code point is a U+002E FULL STOP (.)\n // and the third code point is a digit, return true.\n // Otherwise, return false.\n return second === 0x002E && isDigit(third) ? 3 : 0;\n }\n\n // U+002E FULL STOP (.)\n if (first === 0x002E) {\n // If the second code point is a digit, return true. Otherwise, return false.\n return isDigit(second) ? 2 : 0;\n }\n\n // digit\n if (isDigit(first)) {\n // Return true.\n return 1;\n }\n\n // anything else\n // Return false.\n return 0;\n}\n\n//\n// Misc\n//\n\n// detect BOM (https://en.wikipedia.org/wiki/Byte_order_mark)\nexport function isBOM(code) {\n // UTF-16BE\n if (code === 0xFEFF) {\n return 1;\n }\n\n // UTF-16LE\n if (code === 0xFFFE) {\n return 1;\n }\n\n return 0;\n}\n\n// Fast code category\n// Only ASCII code points has a special meaning, that's why we define a maps for 0..127 codes only\nconst CATEGORY = new Array(0x80);\nexport const EofCategory = 0x80;\nexport const WhiteSpaceCategory = 0x82;\nexport const DigitCategory = 0x83;\nexport const NameStartCategory = 0x84;\nexport const NonPrintableCategory = 0x85;\n\nfor (let i = 0; i < CATEGORY.length; i++) {\n CATEGORY[i] =\n isWhiteSpace(i) && WhiteSpaceCategory ||\n isDigit(i) && DigitCategory ||\n isNameStart(i) && NameStartCategory ||\n isNonPrintable(i) && NonPrintableCategory ||\n i || EofCategory;\n}\n\nexport function charCodeCategory(code) {\n return code < 0x80 ? CATEGORY[code] : NameStartCategory;\n}\n", "import {\n isDigit,\n isHexDigit,\n isUppercaseLetter,\n isName,\n isWhiteSpace,\n isValidEscape\n} from './char-code-definitions.js';\n\nfunction getCharCode(source, offset) {\n return offset < source.length ? source.charCodeAt(offset) : 0;\n}\n\nexport function getNewlineLength(source, offset, code) {\n if (code === 13 /* \\r */ && getCharCode(source, offset + 1) === 10 /* \\n */) {\n return 2;\n }\n\n return 1;\n}\n\nexport function cmpChar(testStr, offset, referenceCode) {\n let code = testStr.charCodeAt(offset);\n\n // code.toLowerCase() for A..Z\n if (isUppercaseLetter(code)) {\n code = code | 32;\n }\n\n return code === referenceCode;\n}\n\nexport function cmpStr(testStr, start, end, referenceStr) {\n if (end - start !== referenceStr.length) {\n return false;\n }\n\n if (start < 0 || end > testStr.length) {\n return false;\n }\n\n for (let i = start; i < end; i++) {\n const referenceCode = referenceStr.charCodeAt(i - start);\n let testCode = testStr.charCodeAt(i);\n\n // testCode.toLowerCase() for A..Z\n if (isUppercaseLetter(testCode)) {\n testCode = testCode | 32;\n }\n\n if (testCode !== referenceCode) {\n return false;\n }\n }\n\n return true;\n}\n\nexport function findWhiteSpaceStart(source, offset) {\n for (; offset >= 0; offset--) {\n if (!isWhiteSpace(source.charCodeAt(offset))) {\n break;\n }\n }\n\n return offset + 1;\n}\n\nexport function findWhiteSpaceEnd(source, offset) {\n for (; offset < source.length; offset++) {\n if (!isWhiteSpace(source.charCodeAt(offset))) {\n break;\n }\n }\n\n return offset;\n}\n\nexport function findDecimalNumberEnd(source, offset) {\n for (; offset < source.length; offset++) {\n if (!isDigit(source.charCodeAt(offset))) {\n break;\n }\n }\n\n return offset;\n}\n\n// \u00A7 4.3.7. Consume an escaped code point\nexport function consumeEscaped(source, offset) {\n // It assumes that the U+005C REVERSE SOLIDUS (\\) has already been consumed and\n // that the next input code point has already been verified to be part of a valid escape.\n offset += 2;\n\n // hex digit\n if (isHexDigit(getCharCode(source, offset - 1))) {\n // Consume as many hex digits as possible, but no more than 5.\n // Note that this means 1-6 hex digits have been consumed in total.\n for (const maxOffset = Math.min(source.length, offset + 5); offset < maxOffset; offset++) {\n if (!isHexDigit(getCharCode(source, offset))) {\n break;\n }\n }\n\n // If the next input code point is whitespace, consume it as well.\n const code = getCharCode(source, offset);\n if (isWhiteSpace(code)) {\n offset += getNewlineLength(source, offset, code);\n }\n }\n\n return offset;\n}\n\n// \u00A74.3.11. Consume a name\n// Note: This algorithm does not do the verification of the first few code points that are necessary\n// to ensure the returned code points would constitute an . If that is the intended use,\n// ensure that the stream starts with an identifier before calling this algorithm.\nexport function consumeName(source, offset) {\n // Let result initially be an empty string.\n // Repeatedly consume the next input code point from the stream:\n for (; offset < source.length; offset++) {\n const code = source.charCodeAt(offset);\n\n // name code point\n if (isName(code)) {\n // Append the code point to result.\n continue;\n }\n\n // the stream starts with a valid escape\n if (isValidEscape(code, getCharCode(source, offset + 1))) {\n // Consume an escaped code point. Append the returned code point to result.\n offset = consumeEscaped(source, offset) - 1;\n continue;\n }\n\n // anything else\n // Reconsume the current input code point. Return result.\n break;\n }\n\n return offset;\n}\n\n// \u00A74.3.12. Consume a number\nexport function consumeNumber(source, offset) {\n let code = source.charCodeAt(offset);\n\n // 2. If the next input code point is U+002B PLUS SIGN (+) or U+002D HYPHEN-MINUS (-),\n // consume it and append it to repr.\n if (code === 0x002B || code === 0x002D) {\n code = source.charCodeAt(offset += 1);\n }\n\n // 3. While the next input code point is a digit, consume it and append it to repr.\n if (isDigit(code)) {\n offset = findDecimalNumberEnd(source, offset + 1);\n code = source.charCodeAt(offset);\n }\n\n // 4. If the next 2 input code points are U+002E FULL STOP (.) followed by a digit, then:\n if (code === 0x002E && isDigit(source.charCodeAt(offset + 1))) {\n // 4.1 Consume them.\n // 4.2 Append them to repr.\n offset += 2;\n\n // 4.3 Set type to \"number\".\n // TODO\n\n // 4.4 While the next input code point is a digit, consume it and append it to repr.\n\n offset = findDecimalNumberEnd(source, offset);\n }\n\n // 5. If the next 2 or 3 input code points are U+0045 LATIN CAPITAL LETTER E (E)\n // or U+0065 LATIN SMALL LETTER E (e), ... , followed by a digit, then:\n if (cmpChar(source, offset, 101 /* e */)) {\n let sign = 0;\n code = source.charCodeAt(offset + 1);\n\n // ... optionally followed by U+002D HYPHEN-MINUS (-) or U+002B PLUS SIGN (+) ...\n if (code === 0x002D || code === 0x002B) {\n sign = 1;\n code = source.charCodeAt(offset + 2);\n }\n\n // ... followed by a digit\n if (isDigit(code)) {\n // 5.1 Consume them.\n // 5.2 Append them to repr.\n\n // 5.3 Set type to \"number\".\n // TODO\n\n // 5.4 While the next input code point is a digit, consume it and append it to repr.\n offset = findDecimalNumberEnd(source, offset + 1 + sign + 1);\n }\n }\n\n return offset;\n}\n\n// \u00A7 4.3.14. Consume the remnants of a bad url\n// ... its sole use is to consume enough of the input stream to reach a recovery point\n// where normal tokenizing can resume.\nexport function consumeBadUrlRemnants(source, offset) {\n // Repeatedly consume the next input code point from the stream:\n for (; offset < source.length; offset++) {\n const code = source.charCodeAt(offset);\n\n // U+0029 RIGHT PARENTHESIS ())\n // EOF\n if (code === 0x0029) {\n // Return.\n offset++;\n break;\n }\n\n if (isValidEscape(code, getCharCode(source, offset + 1))) {\n // Consume an escaped code point.\n // Note: This allows an escaped right parenthesis (\"\\)\") to be encountered\n // without ending the . This is otherwise identical to\n // the \"anything else\" clause.\n offset = consumeEscaped(source, offset);\n }\n }\n\n return offset;\n}\n\n// \u00A7 4.3.7. Consume an escaped code point\n// Note: This algorithm assumes that escaped is valid without leading U+005C REVERSE SOLIDUS (\\)\nexport function decodeEscaped(escaped) {\n // Single char escaped that's not a hex digit\n if (escaped.length === 1 && !isHexDigit(escaped.charCodeAt(0))) {\n return escaped[0];\n }\n\n // Interpret the hex digits as a hexadecimal number.\n let code = parseInt(escaped, 16);\n\n if (\n (code === 0) || // If this number is zero,\n (code >= 0xD800 && code <= 0xDFFF) || // or is for a surrogate,\n (code > 0x10FFFF) // or is greater than the maximum allowed code point\n ) {\n // ... return U+FFFD REPLACEMENT CHARACTER\n code = 0xFFFD;\n }\n\n // Otherwise, return the code point with that value.\n return String.fromCodePoint(code);\n}\n", "export default [\n 'EOF-token',\n 'ident-token',\n 'function-token',\n 'at-keyword-token',\n 'hash-token',\n 'string-token',\n 'bad-string-token',\n 'url-token',\n 'bad-url-token',\n 'delim-token',\n 'number-token',\n 'percentage-token',\n 'dimension-token',\n 'whitespace-token',\n 'CDO-token',\n 'CDC-token',\n 'colon-token',\n 'semicolon-token',\n 'comma-token',\n '[-token',\n ']-token',\n '(-token',\n ')-token',\n '{-token',\n '}-token',\n 'comment-token'\n];\n", "const MIN_SIZE = 16 * 1024;\n\nexport function adoptBuffer(buffer = null, size) {\n if (buffer === null || buffer.length < size) {\n return new Uint32Array(Math.max(size + 1024, MIN_SIZE));\n }\n\n return buffer;\n};\n", "import { adoptBuffer } from './adopt-buffer.js';\nimport { isBOM } from './char-code-definitions.js';\n\nconst N = 10;\nconst F = 12;\nconst R = 13;\n\nfunction computeLinesAndColumns(host) {\n const source = host.source;\n const sourceLength = source.length;\n const startOffset = source.length > 0 ? isBOM(source.charCodeAt(0)) : 0;\n const lines = adoptBuffer(host.lines, sourceLength);\n const columns = adoptBuffer(host.columns, sourceLength);\n let line = host.startLine;\n let column = host.startColumn;\n\n for (let i = startOffset; i < sourceLength; i++) {\n const code = source.charCodeAt(i);\n\n lines[i] = line;\n columns[i] = column++;\n\n if (code === N || code === R || code === F) {\n if (code === R && i + 1 < sourceLength && source.charCodeAt(i + 1) === N) {\n i++;\n lines[i] = line;\n columns[i] = column;\n }\n\n line++;\n column = 1;\n }\n }\n\n lines[sourceLength] = line;\n columns[sourceLength] = column;\n\n host.lines = lines;\n host.columns = columns;\n host.computed = true;\n}\n\nexport class OffsetToLocation {\n constructor() {\n this.lines = null;\n this.columns = null;\n this.computed = false;\n }\n setSource(source, startOffset = 0, startLine = 1, startColumn = 1) {\n this.source = source;\n this.startOffset = startOffset;\n this.startLine = startLine;\n this.startColumn = startColumn;\n this.computed = false;\n }\n getLocation(offset, filename) {\n if (!this.computed) {\n computeLinesAndColumns(this);\n }\n\n return {\n source: filename,\n offset: this.startOffset + offset,\n line: this.lines[offset],\n column: this.columns[offset]\n };\n }\n getLocationRange(start, end, filename) {\n if (!this.computed) {\n computeLinesAndColumns(this);\n }\n\n return {\n source: filename,\n start: {\n offset: this.startOffset + start,\n line: this.lines[start],\n column: this.columns[start]\n },\n end: {\n offset: this.startOffset + end,\n line: this.lines[end],\n column: this.columns[end]\n }\n };\n }\n};\n", "import { adoptBuffer } from './adopt-buffer.js';\nimport { cmpStr } from './utils.js';\nimport tokenNames from './names.js';\nimport {\n WhiteSpace,\n Comment,\n Delim,\n EOF,\n Function as FunctionToken,\n LeftParenthesis,\n RightParenthesis,\n LeftSquareBracket,\n RightSquareBracket,\n LeftCurlyBracket,\n RightCurlyBracket\n} from './types.js';\n\nconst OFFSET_MASK = 0x00FFFFFF;\nconst TYPE_SHIFT = 24;\nconst balancePair = new Map([\n [FunctionToken, RightParenthesis],\n [LeftParenthesis, RightParenthesis],\n [LeftSquareBracket, RightSquareBracket],\n [LeftCurlyBracket, RightCurlyBracket]\n]);\n\nexport class TokenStream {\n constructor(source, tokenize) {\n this.setSource(source, tokenize);\n }\n reset() {\n this.eof = false;\n this.tokenIndex = -1;\n this.tokenType = 0;\n this.tokenStart = this.firstCharOffset;\n this.tokenEnd = this.firstCharOffset;\n }\n setSource(source = '', tokenize = () => {}) {\n source = String(source || '');\n\n const sourceLength = source.length;\n const offsetAndType = adoptBuffer(this.offsetAndType, source.length + 1); // +1 because of eof-token\n const balance = adoptBuffer(this.balance, source.length + 1);\n let tokenCount = 0;\n let balanceCloseType = 0;\n let balanceStart = 0;\n let firstCharOffset = -1;\n\n // capture buffers\n this.offsetAndType = null;\n this.balance = null;\n\n tokenize(source, (type, start, end) => {\n switch (type) {\n default:\n balance[tokenCount] = sourceLength;\n break;\n\n case balanceCloseType: {\n let balancePrev = balanceStart & OFFSET_MASK;\n balanceStart = balance[balancePrev];\n balanceCloseType = balanceStart >> TYPE_SHIFT;\n balance[tokenCount] = balancePrev;\n balance[balancePrev++] = tokenCount;\n for (; balancePrev < tokenCount; balancePrev++) {\n if (balance[balancePrev] === sourceLength) {\n balance[balancePrev] = tokenCount;\n }\n }\n break;\n }\n\n case LeftParenthesis:\n case FunctionToken:\n case LeftSquareBracket:\n case LeftCurlyBracket:\n balance[tokenCount] = balanceStart;\n balanceCloseType = balancePair.get(type);\n balanceStart = (balanceCloseType << TYPE_SHIFT) | tokenCount;\n break;\n }\n\n offsetAndType[tokenCount++] = (type << TYPE_SHIFT) | end;\n if (firstCharOffset === -1) {\n firstCharOffset = start;\n }\n });\n\n // finalize buffers\n offsetAndType[tokenCount] = (EOF << TYPE_SHIFT) | sourceLength; // \n balance[tokenCount] = sourceLength;\n balance[sourceLength] = sourceLength; // prevents false positive balance match with any token\n while (balanceStart !== 0) {\n const balancePrev = balanceStart & OFFSET_MASK;\n balanceStart = balance[balancePrev];\n balance[balancePrev] = sourceLength;\n }\n\n this.source = source;\n this.firstCharOffset = firstCharOffset === -1 ? 0 : firstCharOffset;\n this.tokenCount = tokenCount;\n this.offsetAndType = offsetAndType;\n this.balance = balance;\n\n this.reset();\n this.next();\n }\n\n lookupType(offset) {\n offset += this.tokenIndex;\n\n if (offset < this.tokenCount) {\n return this.offsetAndType[offset] >> TYPE_SHIFT;\n }\n\n return EOF;\n }\n lookupTypeNonSC(idx) {\n for (let offset = this.tokenIndex; offset < this.tokenCount; offset++) {\n const tokenType = this.offsetAndType[offset] >> TYPE_SHIFT;\n\n if (tokenType !== WhiteSpace && tokenType !== Comment) {\n if (idx-- === 0) {\n return tokenType;\n }\n }\n }\n\n return EOF;\n }\n lookupOffset(offset) {\n offset += this.tokenIndex;\n\n if (offset < this.tokenCount) {\n return this.offsetAndType[offset - 1] & OFFSET_MASK;\n }\n\n return this.source.length;\n }\n lookupOffsetNonSC(idx) {\n for (let offset = this.tokenIndex; offset < this.tokenCount; offset++) {\n const tokenType = this.offsetAndType[offset] >> TYPE_SHIFT;\n\n if (tokenType !== WhiteSpace && tokenType !== Comment) {\n if (idx-- === 0) {\n return offset - this.tokenIndex;\n }\n }\n }\n\n return EOF;\n }\n lookupValue(offset, referenceStr) {\n offset += this.tokenIndex;\n\n if (offset < this.tokenCount) {\n return cmpStr(\n this.source,\n this.offsetAndType[offset - 1] & OFFSET_MASK,\n this.offsetAndType[offset] & OFFSET_MASK,\n referenceStr\n );\n }\n\n return false;\n }\n getTokenStart(tokenIndex) {\n if (tokenIndex === this.tokenIndex) {\n return this.tokenStart;\n }\n\n if (tokenIndex > 0) {\n return tokenIndex < this.tokenCount\n ? this.offsetAndType[tokenIndex - 1] & OFFSET_MASK\n : this.offsetAndType[this.tokenCount] & OFFSET_MASK;\n }\n\n return this.firstCharOffset;\n }\n substrToCursor(start) {\n return this.source.substring(start, this.tokenStart);\n }\n\n isBalanceEdge(pos) {\n return this.balance[this.tokenIndex] < pos;\n }\n isDelim(code, offset) {\n if (offset) {\n return (\n this.lookupType(offset) === Delim &&\n this.source.charCodeAt(this.lookupOffset(offset)) === code\n );\n }\n\n return (\n this.tokenType === Delim &&\n this.source.charCodeAt(this.tokenStart) === code\n );\n }\n\n skip(tokenCount) {\n let next = this.tokenIndex + tokenCount;\n\n if (next < this.tokenCount) {\n this.tokenIndex = next;\n this.tokenStart = this.offsetAndType[next - 1] & OFFSET_MASK;\n next = this.offsetAndType[next];\n this.tokenType = next >> TYPE_SHIFT;\n this.tokenEnd = next & OFFSET_MASK;\n } else {\n this.tokenIndex = this.tokenCount;\n this.next();\n }\n }\n next() {\n let next = this.tokenIndex + 1;\n\n if (next < this.tokenCount) {\n this.tokenIndex = next;\n this.tokenStart = this.tokenEnd;\n next = this.offsetAndType[next];\n this.tokenType = next >> TYPE_SHIFT;\n this.tokenEnd = next & OFFSET_MASK;\n } else {\n this.eof = true;\n this.tokenIndex = this.tokenCount;\n this.tokenType = EOF;\n this.tokenStart = this.tokenEnd = this.source.length;\n }\n }\n skipSC() {\n while (this.tokenType === WhiteSpace || this.tokenType === Comment) {\n this.next();\n }\n }\n skipUntilBalanced(startToken, stopConsume) {\n let cursor = startToken;\n let balanceEnd;\n let offset;\n\n loop:\n for (; cursor < this.tokenCount; cursor++) {\n balanceEnd = this.balance[cursor];\n\n // stop scanning on balance edge that points to offset before start token\n if (balanceEnd < startToken) {\n break loop;\n }\n\n offset = cursor > 0 ? this.offsetAndType[cursor - 1] & OFFSET_MASK : this.firstCharOffset;\n\n // check stop condition\n switch (stopConsume(this.source.charCodeAt(offset))) {\n case 1: // just stop\n break loop;\n\n case 2: // stop & included\n cursor++;\n break loop;\n\n default:\n // fast forward to the end of balanced block\n if (this.balance[balanceEnd] === cursor) {\n cursor = balanceEnd;\n }\n }\n }\n\n this.skip(cursor - this.tokenIndex);\n }\n\n forEachToken(fn) {\n for (let i = 0, offset = this.firstCharOffset; i < this.tokenCount; i++) {\n const start = offset;\n const item = this.offsetAndType[i];\n const end = item & OFFSET_MASK;\n const type = item >> TYPE_SHIFT;\n\n offset = end;\n\n fn(type, start, end, i);\n }\n }\n dump() {\n const tokens = new Array(this.tokenCount);\n\n this.forEachToken((type, start, end, index) => {\n tokens[index] = {\n idx: index,\n type: tokenNames[type],\n chunk: this.source.substring(start, end),\n balance: this.balance[index]\n };\n });\n\n return tokens;\n }\n};\n", "import * as TYPE from './types.js';\nimport {\n isNewline,\n isName,\n isValidEscape,\n isNumberStart,\n isIdentifierStart,\n isBOM,\n charCodeCategory,\n WhiteSpaceCategory,\n DigitCategory,\n NameStartCategory,\n NonPrintableCategory\n} from './char-code-definitions.js';\nimport {\n cmpStr,\n getNewlineLength,\n findWhiteSpaceEnd,\n consumeEscaped,\n consumeName,\n consumeNumber,\n consumeBadUrlRemnants\n} from './utils.js';\n\nexport function tokenize(source, onToken) {\n function getCharCode(offset) {\n return offset < sourceLength ? source.charCodeAt(offset) : 0;\n }\n\n // \u00A7 4.3.3. Consume a numeric token\n function consumeNumericToken() {\n // Consume a number and let number be the result.\n offset = consumeNumber(source, offset);\n\n // If the next 3 input code points would start an identifier, then:\n if (isIdentifierStart(getCharCode(offset), getCharCode(offset + 1), getCharCode(offset + 2))) {\n // Create a with the same value and type flag as number, and a unit set initially to the empty string.\n // Consume a name. Set the \u2019s unit to the returned value.\n // Return the .\n type = TYPE.Dimension;\n offset = consumeName(source, offset);\n return;\n }\n\n // Otherwise, if the next input code point is U+0025 PERCENTAGE SIGN (%), consume it.\n if (getCharCode(offset) === 0x0025) {\n // Create a with the same value as number, and return it.\n type = TYPE.Percentage;\n offset++;\n return;\n }\n\n // Otherwise, create a with the same value and type flag as number, and return it.\n type = TYPE.Number;\n }\n\n // \u00A7 4.3.4. Consume an ident-like token\n function consumeIdentLikeToken() {\n const nameStartOffset = offset;\n\n // Consume a name, and let string be the result.\n offset = consumeName(source, offset);\n\n // If string\u2019s value is an ASCII case-insensitive match for \"url\",\n // and the next input code point is U+0028 LEFT PARENTHESIS ((), consume it.\n if (cmpStr(source, nameStartOffset, offset, 'url') && getCharCode(offset) === 0x0028) {\n // While the next two input code points are whitespace, consume the next input code point.\n offset = findWhiteSpaceEnd(source, offset + 1);\n\n // If the next one or two input code points are U+0022 QUOTATION MARK (\"), U+0027 APOSTROPHE ('),\n // or whitespace followed by U+0022 QUOTATION MARK (\") or U+0027 APOSTROPHE ('),\n // then create a with its value set to string and return it.\n if (getCharCode(offset) === 0x0022 ||\n getCharCode(offset) === 0x0027) {\n type = TYPE.Function;\n offset = nameStartOffset + 4;\n return;\n }\n\n // Otherwise, consume a url token, and return it.\n consumeUrlToken();\n return;\n }\n\n // Otherwise, if the next input code point is U+0028 LEFT PARENTHESIS ((), consume it.\n // Create a with its value set to string and return it.\n if (getCharCode(offset) === 0x0028) {\n type = TYPE.Function;\n offset++;\n return;\n }\n\n // Otherwise, create an with its value set to string and return it.\n type = TYPE.Ident;\n }\n\n // \u00A7 4.3.5. Consume a string token\n function consumeStringToken(endingCodePoint) {\n // This algorithm may be called with an ending code point, which denotes the code point\n // that ends the string. If an ending code point is not specified,\n // the current input code point is used.\n if (!endingCodePoint) {\n endingCodePoint = getCharCode(offset++);\n }\n\n // Initially create a with its value set to the empty string.\n type = TYPE.String;\n\n // Repeatedly consume the next input code point from the stream:\n for (; offset < source.length; offset++) {\n const code = source.charCodeAt(offset);\n\n switch (charCodeCategory(code)) {\n // ending code point\n case endingCodePoint:\n // Return the .\n offset++;\n return;\n\n // EOF\n // case EofCategory:\n // This is a parse error. Return the .\n // return;\n\n // newline\n case WhiteSpaceCategory:\n if (isNewline(code)) {\n // This is a parse error. Reconsume the current input code point,\n // create a , and return it.\n offset += getNewlineLength(source, offset, code);\n type = TYPE.BadString;\n return;\n }\n break;\n\n // U+005C REVERSE SOLIDUS (\\)\n case 0x005C:\n // If the next input code point is EOF, do nothing.\n if (offset === source.length - 1) {\n break;\n }\n\n const nextCode = getCharCode(offset + 1);\n\n // Otherwise, if the next input code point is a newline, consume it.\n if (isNewline(nextCode)) {\n offset += getNewlineLength(source, offset + 1, nextCode);\n } else if (isValidEscape(code, nextCode)) {\n // Otherwise, (the stream starts with a valid escape) consume\n // an escaped code point and append the returned code point to\n // the \u2019s value.\n offset = consumeEscaped(source, offset) - 1;\n }\n break;\n\n // anything else\n // Append the current input code point to the \u2019s value.\n }\n }\n }\n\n // \u00A7 4.3.6. Consume a url token\n // Note: This algorithm assumes that the initial \"url(\" has already been consumed.\n // This algorithm also assumes that it\u2019s being called to consume an \"unquoted\" value, like url(foo).\n // A quoted value, like url(\"foo\"), is parsed as a . Consume an ident-like token\n // automatically handles this distinction; this algorithm shouldn\u2019t be called directly otherwise.\n function consumeUrlToken() {\n // Initially create a with its value set to the empty string.\n type = TYPE.Url;\n\n // Consume as much whitespace as possible.\n offset = findWhiteSpaceEnd(source, offset);\n\n // Repeatedly consume the next input code point from the stream:\n for (; offset < source.length; offset++) {\n const code = source.charCodeAt(offset);\n\n switch (charCodeCategory(code)) {\n // U+0029 RIGHT PARENTHESIS ())\n case 0x0029:\n // Return the .\n offset++;\n return;\n\n // EOF\n // case EofCategory:\n // This is a parse error. Return the .\n // return;\n\n // whitespace\n case WhiteSpaceCategory:\n // Consume as much whitespace as possible.\n offset = findWhiteSpaceEnd(source, offset);\n\n // If the next input code point is U+0029 RIGHT PARENTHESIS ()) or EOF,\n // consume it and return the \n // (if EOF was encountered, this is a parse error);\n if (getCharCode(offset) === 0x0029 || offset >= source.length) {\n if (offset < source.length) {\n offset++;\n }\n return;\n }\n\n // otherwise, consume the remnants of a bad url, create a ,\n // and return it.\n offset = consumeBadUrlRemnants(source, offset);\n type = TYPE.BadUrl;\n return;\n\n // U+0022 QUOTATION MARK (\")\n // U+0027 APOSTROPHE (')\n // U+0028 LEFT PARENTHESIS (()\n // non-printable code point\n case 0x0022:\n case 0x0027:\n case 0x0028:\n case NonPrintableCategory:\n // This is a parse error. Consume the remnants of a bad url,\n // create a , and return it.\n offset = consumeBadUrlRemnants(source, offset);\n type = TYPE.BadUrl;\n return;\n\n // U+005C REVERSE SOLIDUS (\\)\n case 0x005C:\n // If the stream starts with a valid escape, consume an escaped code point and\n // append the returned code point to the \u2019s value.\n if (isValidEscape(code, getCharCode(offset + 1))) {\n offset = consumeEscaped(source, offset) - 1;\n break;\n }\n\n // Otherwise, this is a parse error. Consume the remnants of a bad url,\n // create a , and return it.\n offset = consumeBadUrlRemnants(source, offset);\n type = TYPE.BadUrl;\n return;\n\n // anything else\n // Append the current input code point to the \u2019s value.\n }\n }\n }\n\n // ensure source is a string\n source = String(source || '');\n\n const sourceLength = source.length;\n let start = isBOM(getCharCode(0));\n let offset = start;\n let type;\n\n // https://drafts.csswg.org/css-syntax-3/#consume-token\n // \u00A7 4.3.1. Consume a token\n while (offset < sourceLength) {\n const code = source.charCodeAt(offset);\n\n switch (charCodeCategory(code)) {\n // whitespace\n case WhiteSpaceCategory:\n // Consume as much whitespace as possible. Return a .\n type = TYPE.WhiteSpace;\n offset = findWhiteSpaceEnd(source, offset + 1);\n break;\n\n // U+0022 QUOTATION MARK (\")\n case 0x0022:\n // Consume a string token and return it.\n consumeStringToken();\n break;\n\n // U+0023 NUMBER SIGN (#)\n case 0x0023:\n // If the next input code point is a name code point or the next two input code points are a valid escape, then:\n if (isName(getCharCode(offset + 1)) || isValidEscape(getCharCode(offset + 1), getCharCode(offset + 2))) {\n // Create a .\n type = TYPE.Hash;\n\n // If the next 3 input code points would start an identifier, set the \u2019s type flag to \"id\".\n // if (isIdentifierStart(getCharCode(offset + 1), getCharCode(offset + 2), getCharCode(offset + 3))) {\n // // TODO: set id flag\n // }\n\n // Consume a name, and set the \u2019s value to the returned string.\n offset = consumeName(source, offset + 1);\n\n // Return the .\n } else {\n // Otherwise, return a with its value set to the current input code point.\n type = TYPE.Delim;\n offset++;\n }\n\n break;\n\n // U+0027 APOSTROPHE (')\n case 0x0027:\n // Consume a string token and return it.\n consumeStringToken();\n break;\n\n // U+0028 LEFT PARENTHESIS (()\n case 0x0028:\n // Return a <(-token>.\n type = TYPE.LeftParenthesis;\n offset++;\n break;\n\n // U+0029 RIGHT PARENTHESIS ())\n case 0x0029:\n // Return a <)-token>.\n type = TYPE.RightParenthesis;\n offset++;\n break;\n\n // U+002B PLUS SIGN (+)\n case 0x002B:\n // If the input stream starts with a number, ...\n if (isNumberStart(code, getCharCode(offset + 1), getCharCode(offset + 2))) {\n // ... reconsume the current input code point, consume a numeric token, and return it.\n consumeNumericToken();\n } else {\n // Otherwise, return a with its value set to the current input code point.\n type = TYPE.Delim;\n offset++;\n }\n break;\n\n // U+002C COMMA (,)\n case 0x002C:\n // Return a .\n type = TYPE.Comma;\n offset++;\n break;\n\n // U+002D HYPHEN-MINUS (-)\n case 0x002D:\n // If the input stream starts with a number, reconsume the current input code point, consume a numeric token, and return it.\n if (isNumberStart(code, getCharCode(offset + 1), getCharCode(offset + 2))) {\n consumeNumericToken();\n } else {\n // Otherwise, if the next 2 input code points are U+002D HYPHEN-MINUS U+003E GREATER-THAN SIGN (->), consume them and return a .\n if (getCharCode(offset + 1) === 0x002D &&\n getCharCode(offset + 2) === 0x003E) {\n type = TYPE.CDC;\n offset = offset + 3;\n } else {\n // Otherwise, if the input stream starts with an identifier, ...\n if (isIdentifierStart(code, getCharCode(offset + 1), getCharCode(offset + 2))) {\n // ... reconsume the current input code point, consume an ident-like token, and return it.\n consumeIdentLikeToken();\n } else {\n // Otherwise, return a with its value set to the current input code point.\n type = TYPE.Delim;\n offset++;\n }\n }\n }\n break;\n\n // U+002E FULL STOP (.)\n case 0x002E:\n // If the input stream starts with a number, ...\n if (isNumberStart(code, getCharCode(offset + 1), getCharCode(offset + 2))) {\n // ... reconsume the current input code point, consume a numeric token, and return it.\n consumeNumericToken();\n } else {\n // Otherwise, return a with its value set to the current input code point.\n type = TYPE.Delim;\n offset++;\n }\n\n break;\n\n // U+002F SOLIDUS (/)\n case 0x002F:\n // If the next two input code point are U+002F SOLIDUS (/) followed by a U+002A ASTERISK (*),\n if (getCharCode(offset + 1) === 0x002A) {\n // ... consume them and all following code points up to and including the first U+002A ASTERISK (*)\n // followed by a U+002F SOLIDUS (/), or up to an EOF code point.\n type = TYPE.Comment;\n offset = source.indexOf('*/', offset + 2);\n offset = offset === -1 ? source.length : offset + 2;\n } else {\n type = TYPE.Delim;\n offset++;\n }\n break;\n\n // U+003A COLON (:)\n case 0x003A:\n // Return a .\n type = TYPE.Colon;\n offset++;\n break;\n\n // U+003B SEMICOLON (;)\n case 0x003B:\n // Return a .\n type = TYPE.Semicolon;\n offset++;\n break;\n\n // U+003C LESS-THAN SIGN (<)\n case 0x003C:\n // If the next 3 input code points are U+0021 EXCLAMATION MARK U+002D HYPHEN-MINUS U+002D HYPHEN-MINUS (!--), ...\n if (getCharCode(offset + 1) === 0x0021 &&\n getCharCode(offset + 2) === 0x002D &&\n getCharCode(offset + 3) === 0x002D) {\n // ... consume them and return a .\n type = TYPE.CDO;\n offset = offset + 4;\n } else {\n // Otherwise, return a with its value set to the current input code point.\n type = TYPE.Delim;\n offset++;\n }\n\n break;\n\n // U+0040 COMMERCIAL AT (@)\n case 0x0040:\n // If the next 3 input code points would start an identifier, ...\n if (isIdentifierStart(getCharCode(offset + 1), getCharCode(offset + 2), getCharCode(offset + 3))) {\n // ... consume a name, create an with its value set to the returned value, and return it.\n type = TYPE.AtKeyword;\n offset = consumeName(source, offset + 1);\n } else {\n // Otherwise, return a with its value set to the current input code point.\n type = TYPE.Delim;\n offset++;\n }\n\n break;\n\n // U+005B LEFT SQUARE BRACKET ([)\n case 0x005B:\n // Return a <[-token>.\n type = TYPE.LeftSquareBracket;\n offset++;\n break;\n\n // U+005C REVERSE SOLIDUS (\\)\n case 0x005C:\n // If the input stream starts with a valid escape, ...\n if (isValidEscape(code, getCharCode(offset + 1))) {\n // ... reconsume the current input code point, consume an ident-like token, and return it.\n consumeIdentLikeToken();\n } else {\n // Otherwise, this is a parse error. Return a with its value set to the current input code point.\n type = TYPE.Delim;\n offset++;\n }\n break;\n\n // U+005D RIGHT SQUARE BRACKET (])\n case 0x005D:\n // Return a <]-token>.\n type = TYPE.RightSquareBracket;\n offset++;\n break;\n\n // U+007B LEFT CURLY BRACKET ({)\n case 0x007B:\n // Return a <{-token>.\n type = TYPE.LeftCurlyBracket;\n offset++;\n break;\n\n // U+007D RIGHT CURLY BRACKET (})\n case 0x007D:\n // Return a <}-token>.\n type = TYPE.RightCurlyBracket;\n offset++;\n break;\n\n // digit\n case DigitCategory:\n // Reconsume the current input code point, consume a numeric token, and return it.\n consumeNumericToken();\n break;\n\n // name-start code point\n case NameStartCategory:\n // Reconsume the current input code point, consume an ident-like token, and return it.\n consumeIdentLikeToken();\n break;\n\n // EOF\n // case EofCategory:\n // Return an .\n // break;\n\n // anything else\n default:\n // Return a with its value set to the current input code point.\n type = TYPE.Delim;\n offset++;\n }\n\n // put token to stream\n onToken(type, start, start = offset);\n }\n}\n\nexport * from './types.js';\nexport * as tokenTypes from './types.js';\nexport { default as tokenNames } from './names.js';\nexport * from './char-code-definitions.js';\nexport * from './utils.js';\nexport * from './OffsetToLocation.js';\nexport * from './TokenStream.js';\n", "import { SourceMapGenerator } from 'source-map-js/lib/source-map-generator.js';\n\nconst trackNodes = new Set(['Atrule', 'Selector', 'Declaration']);\n\nexport function generateSourceMap(handlers) {\n const map = new SourceMapGenerator();\n const generated = {\n line: 1,\n column: 0\n };\n const original = {\n line: 0, // should be zero to add first mapping\n column: 0\n };\n const activatedGenerated = {\n line: 1,\n column: 0\n };\n const activatedMapping = {\n generated: activatedGenerated\n };\n let line = 1;\n let column = 0;\n let sourceMappingActive = false;\n\n const origHandlersNode = handlers.node;\n handlers.node = function(node) {\n if (node.loc && node.loc.start && trackNodes.has(node.type)) {\n const nodeLine = node.loc.start.line;\n const nodeColumn = node.loc.start.column - 1;\n\n if (original.line !== nodeLine ||\n original.column !== nodeColumn) {\n original.line = nodeLine;\n original.column = nodeColumn;\n\n generated.line = line;\n generated.column = column;\n\n if (sourceMappingActive) {\n sourceMappingActive = false;\n if (generated.line !== activatedGenerated.line ||\n generated.column !== activatedGenerated.column) {\n map.addMapping(activatedMapping);\n }\n }\n\n sourceMappingActive = true;\n map.addMapping({\n source: node.loc.source,\n original,\n generated\n });\n }\n }\n\n origHandlersNode.call(this, node);\n\n if (sourceMappingActive && trackNodes.has(node.type)) {\n activatedGenerated.line = line;\n activatedGenerated.column = column;\n }\n };\n\n const origHandlersEmit = handlers.emit;\n handlers.emit = function(value, type, auto) {\n for (let i = 0; i < value.length; i++) {\n if (value.charCodeAt(i) === 10) { // \\n\n line++;\n column = 0;\n } else {\n column++;\n }\n }\n\n origHandlersEmit(value, type, auto);\n };\n\n const origHandlersResult = handlers.result;\n handlers.result = function() {\n if (sourceMappingActive) {\n map.addMapping(activatedMapping);\n }\n\n return {\n css: origHandlersResult(),\n map\n };\n };\n\n return handlers;\n};\n", "import {\n WhiteSpace,\n Delim,\n Ident,\n Function as FunctionToken,\n Url,\n BadUrl,\n AtKeyword,\n Hash,\n Percentage,\n Dimension,\n Number as NumberToken,\n String as StringToken,\n Colon,\n LeftParenthesis,\n RightParenthesis,\n CDC\n} from '../tokenizer/index.js';\n\nconst PLUSSIGN = 0x002B; // U+002B PLUS SIGN (+)\nconst HYPHENMINUS = 0x002D; // U+002D HYPHEN-MINUS (-)\n\nconst code = (type, value) => {\n if (type === Delim) {\n type = value;\n }\n\n if (typeof type === 'string') {\n const charCode = type.charCodeAt(0);\n return charCode > 0x7F ? 0x8000 : charCode << 8;\n }\n\n return type;\n};\n\n// https://www.w3.org/TR/css-syntax-3/#serialization\n// The only requirement for serialization is that it must \"round-trip\" with parsing,\n// that is, parsing the stylesheet must produce the same data structures as parsing,\n// serializing, and parsing again, except for consecutive s,\n// which may be collapsed into a single token.\n\nconst specPairs = [\n [Ident, Ident],\n [Ident, FunctionToken],\n [Ident, Url],\n [Ident, BadUrl],\n [Ident, '-'],\n [Ident, NumberToken],\n [Ident, Percentage],\n [Ident, Dimension],\n [Ident, CDC],\n [Ident, LeftParenthesis],\n\n [AtKeyword, Ident],\n [AtKeyword, FunctionToken],\n [AtKeyword, Url],\n [AtKeyword, BadUrl],\n [AtKeyword, '-'],\n [AtKeyword, NumberToken],\n [AtKeyword, Percentage],\n [AtKeyword, Dimension],\n [AtKeyword, CDC],\n\n [Hash, Ident],\n [Hash, FunctionToken],\n [Hash, Url],\n [Hash, BadUrl],\n [Hash, '-'],\n [Hash, NumberToken],\n [Hash, Percentage],\n [Hash, Dimension],\n [Hash, CDC],\n\n [Dimension, Ident],\n [Dimension, FunctionToken],\n [Dimension, Url],\n [Dimension, BadUrl],\n [Dimension, '-'],\n [Dimension, NumberToken],\n [Dimension, Percentage],\n [Dimension, Dimension],\n [Dimension, CDC],\n\n ['#', Ident],\n ['#', FunctionToken],\n ['#', Url],\n ['#', BadUrl],\n ['#', '-'],\n ['#', NumberToken],\n ['#', Percentage],\n ['#', Dimension],\n ['#', CDC], // https://github.com/w3c/csswg-drafts/pull/6874\n\n ['-', Ident],\n ['-', FunctionToken],\n ['-', Url],\n ['-', BadUrl],\n ['-', '-'],\n ['-', NumberToken],\n ['-', Percentage],\n ['-', Dimension],\n ['-', CDC], // https://github.com/w3c/csswg-drafts/pull/6874\n\n [NumberToken, Ident],\n [NumberToken, FunctionToken],\n [NumberToken, Url],\n [NumberToken, BadUrl],\n [NumberToken, NumberToken],\n [NumberToken, Percentage],\n [NumberToken, Dimension],\n [NumberToken, '%'],\n [NumberToken, CDC], // https://github.com/w3c/csswg-drafts/pull/6874\n\n ['@', Ident],\n ['@', FunctionToken],\n ['@', Url],\n ['@', BadUrl],\n ['@', '-'],\n ['@', CDC], // https://github.com/w3c/csswg-drafts/pull/6874\n\n ['.', NumberToken],\n ['.', Percentage],\n ['.', Dimension],\n\n ['+', NumberToken],\n ['+', Percentage],\n ['+', Dimension],\n\n ['/', '*']\n];\n// validate with scripts/generate-safe\nconst safePairs = specPairs.concat([\n [Ident, Hash],\n\n [Dimension, Hash],\n\n [Hash, Hash],\n\n [AtKeyword, LeftParenthesis],\n [AtKeyword, StringToken],\n [AtKeyword, Colon],\n\n [Percentage, Percentage],\n [Percentage, Dimension],\n [Percentage, FunctionToken],\n [Percentage, '-'],\n\n [RightParenthesis, Ident],\n [RightParenthesis, FunctionToken],\n [RightParenthesis, Percentage],\n [RightParenthesis, Dimension],\n [RightParenthesis, Hash],\n [RightParenthesis, '-']\n]);\n\nfunction createMap(pairs) {\n const isWhiteSpaceRequired = new Set(\n pairs.map(([prev, next]) => (code(prev) << 16 | code(next)))\n );\n\n return function(prevCode, type, value) {\n const nextCode = code(type, value);\n const nextCharCode = value.charCodeAt(0);\n const emitWs =\n (nextCharCode === HYPHENMINUS &&\n type !== Ident &&\n type !== FunctionToken &&\n type !== CDC) ||\n (nextCharCode === PLUSSIGN)\n ? isWhiteSpaceRequired.has(prevCode << 16 | nextCharCode << 8)\n : isWhiteSpaceRequired.has(prevCode << 16 | nextCode);\n\n if (emitWs) {\n this.emit(' ', WhiteSpace, true);\n }\n\n return nextCode;\n };\n}\n\nexport const spec = createMap(specPairs);\nexport const safe = createMap(safePairs);\n", "import { tokenize, Delim, WhiteSpace } from '../tokenizer/index.js';\nimport { generateSourceMap } from './sourceMap.js';\nimport * as tokenBefore from './token-before.js';\n\nconst REVERSESOLIDUS = 0x005c; // U+005C REVERSE SOLIDUS (\\)\n\nfunction processChildren(node, delimeter) {\n if (typeof delimeter === 'function') {\n let prev = null;\n\n node.children.forEach(node => {\n if (prev !== null) {\n delimeter.call(this, prev);\n }\n\n this.node(node);\n prev = node;\n });\n\n return;\n }\n\n node.children.forEach(this.node, this);\n}\n\nfunction processChunk(chunk) {\n tokenize(chunk, (type, start, end) => {\n this.token(type, chunk.slice(start, end));\n });\n}\n\nexport function createGenerator(config) {\n const types = new Map();\n\n for (let [name, item] of Object.entries(config.node)) {\n const fn = item.generate || item;\n\n if (typeof fn === 'function') {\n types.set(name, item.generate || item);\n }\n }\n\n return function(node, options) {\n let buffer = '';\n let prevCode = 0;\n let handlers = {\n node(node) {\n if (types.has(node.type)) {\n types.get(node.type).call(publicApi, node);\n } else {\n throw new Error('Unknown node type: ' + node.type);\n }\n },\n tokenBefore: tokenBefore.safe,\n token(type, value) {\n prevCode = this.tokenBefore(prevCode, type, value);\n\n this.emit(value, type, false);\n\n if (type === Delim && value.charCodeAt(0) === REVERSESOLIDUS) {\n this.emit('\\n', WhiteSpace, true);\n }\n },\n emit(value) {\n buffer += value;\n },\n result() {\n return buffer;\n }\n };\n\n if (options) {\n if (typeof options.decorator === 'function') {\n handlers = options.decorator(handlers);\n }\n\n if (options.sourceMap) {\n handlers = generateSourceMap(handlers);\n }\n\n if (options.mode in tokenBefore) {\n handlers.tokenBefore = tokenBefore[options.mode];\n }\n }\n\n const publicApi = {\n node: (node) => handlers.node(node),\n children: processChildren,\n token: (type, value) => handlers.token(type, value),\n tokenize: processChunk\n };\n\n handlers.node(node);\n\n return handlers.result();\n };\n};\n", "export { generate as AnPlusB } from './AnPlusB.js';\nexport { generate as Atrule } from './Atrule.js';\nexport { generate as AtrulePrelude } from './AtrulePrelude.js';\nexport { generate as AttributeSelector } from './AttributeSelector.js';\nexport { generate as Block } from './Block.js';\nexport { generate as Brackets } from './Brackets.js';\nexport { generate as CDC } from './CDC.js';\nexport { generate as CDO } from './CDO.js';\nexport { generate as ClassSelector } from './ClassSelector.js';\nexport { generate as Combinator } from './Combinator.js';\nexport { generate as Comment } from './Comment.js';\nexport { generate as Condition } from './Condition.js';\nexport { generate as Declaration } from './Declaration.js';\nexport { generate as DeclarationList } from './DeclarationList.js';\nexport { generate as Dimension } from './Dimension.js';\nexport { generate as Feature } from './Feature.js';\nexport { generate as FeatureFunction } from './FeatureFunction.js';\nexport { generate as FeatureRange } from './FeatureRange.js';\nexport { generate as Function } from './Function.js';\nexport { generate as GeneralEnclosed } from './GeneralEnclosed.js';\nexport { generate as Hash } from './Hash.js';\nexport { generate as Identifier } from './Identifier.js';\nexport { generate as IdSelector } from './IdSelector.js';\nexport { generate as Layer } from './Layer.js';\nexport { generate as LayerList } from './LayerList.js';\nexport { generate as MediaQuery } from './MediaQuery.js';\nexport { generate as MediaQueryList } from './MediaQueryList.js';\nexport { generate as NestingSelector } from './NestingSelector.js';\nexport { generate as Nth } from './Nth.js';\nexport { generate as Number } from './Number.js';\nexport { generate as Operator } from './Operator.js';\nexport { generate as Parentheses } from './Parentheses.js';\nexport { generate as Percentage } from './Percentage.js';\nexport { generate as PseudoClassSelector } from './PseudoClassSelector.js';\nexport { generate as PseudoElementSelector } from './PseudoElementSelector.js';\nexport { generate as Ratio } from './Ratio.js';\nexport { generate as Raw } from './Raw.js';\nexport { generate as Rule } from './Rule.js';\nexport { generate as Scope } from './Scope.js';\nexport { generate as Selector } from './Selector.js';\nexport { generate as SelectorList } from './SelectorList.js';\nexport { generate as String } from './String.js';\nexport { generate as StyleSheet } from './StyleSheet.js';\nexport { generate as SupportsDeclaration } from './SupportsDeclaration.js';\nexport { generate as TypeSelector } from './TypeSelector.js';\nexport { generate as UnicodeRange } from './UnicodeRange.js';\nexport { generate as Url } from './Url.js';\nexport { generate as Value } from './Value.js';\nexport { generate as WhiteSpace } from './WhiteSpace.js';\n", "import {\n isDigit,\n WhiteSpace,\n Comment,\n Ident,\n Number,\n Dimension\n} from '../../tokenizer/index.js';\n\nconst PLUSSIGN = 0x002B; // U+002B PLUS SIGN (+)\nconst HYPHENMINUS = 0x002D; // U+002D HYPHEN-MINUS (-)\nconst N = 0x006E; // U+006E LATIN SMALL LETTER N (n)\nconst DISALLOW_SIGN = true;\nconst ALLOW_SIGN = false;\n\nfunction checkInteger(offset, disallowSign) {\n let pos = this.tokenStart + offset;\n const code = this.charCodeAt(pos);\n\n if (code === PLUSSIGN || code === HYPHENMINUS) {\n if (disallowSign) {\n this.error('Number sign is not allowed');\n }\n pos++;\n }\n\n for (; pos < this.tokenEnd; pos++) {\n if (!isDigit(this.charCodeAt(pos))) {\n this.error('Integer is expected', pos);\n }\n }\n}\n\nfunction checkTokenIsInteger(disallowSign) {\n return checkInteger.call(this, 0, disallowSign);\n}\n\nfunction expectCharCode(offset, code) {\n if (!this.cmpChar(this.tokenStart + offset, code)) {\n let msg = '';\n\n switch (code) {\n case N:\n msg = 'N is expected';\n break;\n case HYPHENMINUS:\n msg = 'HyphenMinus is expected';\n break;\n }\n\n this.error(msg, this.tokenStart + offset);\n }\n}\n\n// ... \n// ... ['+' | '-'] \nfunction consumeB() {\n let offset = 0;\n let sign = 0;\n let type = this.tokenType;\n\n while (type === WhiteSpace || type === Comment) {\n type = this.lookupType(++offset);\n }\n\n if (type !== Number) {\n if (this.isDelim(PLUSSIGN, offset) ||\n this.isDelim(HYPHENMINUS, offset)) {\n sign = this.isDelim(PLUSSIGN, offset) ? PLUSSIGN : HYPHENMINUS;\n\n do {\n type = this.lookupType(++offset);\n } while (type === WhiteSpace || type === Comment);\n\n if (type !== Number) {\n this.skip(offset);\n checkTokenIsInteger.call(this, DISALLOW_SIGN);\n }\n } else {\n return null;\n }\n }\n\n if (offset > 0) {\n this.skip(offset);\n }\n\n if (sign === 0) {\n type = this.charCodeAt(this.tokenStart);\n if (type !== PLUSSIGN && type !== HYPHENMINUS) {\n this.error('Number sign is expected');\n }\n }\n\n checkTokenIsInteger.call(this, sign !== 0);\n return sign === HYPHENMINUS ? '-' + this.consume(Number) : this.consume(Number);\n}\n\n// An+B microsyntax https://www.w3.org/TR/css-syntax-3/#anb\nexport const name = 'AnPlusB';\nexport const structure = {\n a: [String, null],\n b: [String, null]\n};\n\nexport function parse() {\n /* eslint-disable brace-style*/\n const start = this.tokenStart;\n let a = null;\n let b = null;\n\n // \n if (this.tokenType === Number) {\n checkTokenIsInteger.call(this, ALLOW_SIGN);\n b = this.consume(Number);\n }\n\n // -n\n // -n \n // -n ['+' | '-'] \n // -n- \n // \n else if (this.tokenType === Ident && this.cmpChar(this.tokenStart, HYPHENMINUS)) {\n a = '-1';\n\n expectCharCode.call(this, 1, N);\n\n switch (this.tokenEnd - this.tokenStart) {\n // -n\n // -n \n // -n ['+' | '-'] \n case 2:\n this.next();\n b = consumeB.call(this);\n break;\n\n // -n- \n case 3:\n expectCharCode.call(this, 2, HYPHENMINUS);\n\n this.next();\n this.skipSC();\n\n checkTokenIsInteger.call(this, DISALLOW_SIGN);\n\n b = '-' + this.consume(Number);\n break;\n\n // \n default:\n expectCharCode.call(this, 2, HYPHENMINUS);\n checkInteger.call(this, 3, DISALLOW_SIGN);\n this.next();\n\n b = this.substrToCursor(start + 2);\n }\n }\n\n // '+'? n\n // '+'? n \n // '+'? n ['+' | '-'] \n // '+'? n- \n // '+'? \n else if (this.tokenType === Ident || (this.isDelim(PLUSSIGN) && this.lookupType(1) === Ident)) {\n let sign = 0;\n a = '1';\n\n // just ignore a plus\n if (this.isDelim(PLUSSIGN)) {\n sign = 1;\n this.next();\n }\n\n expectCharCode.call(this, 0, N);\n\n switch (this.tokenEnd - this.tokenStart) {\n // '+'? n\n // '+'? n \n // '+'? n ['+' | '-'] \n case 1:\n this.next();\n b = consumeB.call(this);\n break;\n\n // '+'? n- \n case 2:\n expectCharCode.call(this, 1, HYPHENMINUS);\n\n this.next();\n this.skipSC();\n\n checkTokenIsInteger.call(this, DISALLOW_SIGN);\n\n b = '-' + this.consume(Number);\n break;\n\n // '+'? \n default:\n expectCharCode.call(this, 1, HYPHENMINUS);\n checkInteger.call(this, 2, DISALLOW_SIGN);\n this.next();\n\n b = this.substrToCursor(start + sign + 1);\n }\n }\n\n // \n // \n // \n // \n // ['+' | '-'] \n else if (this.tokenType === Dimension) {\n const code = this.charCodeAt(this.tokenStart);\n const sign = code === PLUSSIGN || code === HYPHENMINUS;\n let i = this.tokenStart + sign;\n\n for (; i < this.tokenEnd; i++) {\n if (!isDigit(this.charCodeAt(i))) {\n break;\n }\n }\n\n if (i === this.tokenStart + sign) {\n this.error('Integer is expected', this.tokenStart + sign);\n }\n\n expectCharCode.call(this, i - this.tokenStart, N);\n a = this.substring(start, i);\n\n // \n // \n // ['+' | '-'] \n if (i + 1 === this.tokenEnd) {\n this.next();\n b = consumeB.call(this);\n } else {\n expectCharCode.call(this, i - this.tokenStart + 1, HYPHENMINUS);\n\n // \n if (i + 2 === this.tokenEnd) {\n this.next();\n this.skipSC();\n checkTokenIsInteger.call(this, DISALLOW_SIGN);\n b = '-' + this.consume(Number);\n }\n // \n else {\n checkInteger.call(this, i - this.tokenStart + 2, DISALLOW_SIGN);\n this.next();\n b = this.substrToCursor(i + 1);\n }\n }\n } else {\n this.error();\n }\n\n if (a !== null && a.charCodeAt(0) === PLUSSIGN) {\n a = a.substr(1);\n }\n\n if (b !== null && b.charCodeAt(0) === PLUSSIGN) {\n b = b.substr(1);\n }\n\n return {\n type: 'AnPlusB',\n loc: this.getLocation(start, this.tokenStart),\n a,\n b\n };\n}\n\nexport function generate(node) {\n if (node.a) {\n const a =\n node.a === '+1' && 'n' ||\n node.a === '1' && 'n' ||\n node.a === '-1' && '-n' ||\n node.a + 'n';\n\n if (node.b) {\n const b = node.b[0] === '-' || node.b[0] === '+'\n ? node.b\n : '+' + node.b;\n this.tokenize(a + b);\n } else {\n this.tokenize(a);\n }\n } else {\n this.tokenize(node.b);\n }\n}\n", "import {\n AtKeyword,\n Semicolon,\n LeftCurlyBracket,\n RightCurlyBracket\n} from '../../tokenizer/index.js';\n\nfunction consumeRaw() {\n return this.Raw(this.consumeUntilLeftCurlyBracketOrSemicolon, true);\n}\n\nfunction isDeclarationBlockAtrule() {\n for (let offset = 1, type; type = this.lookupType(offset); offset++) {\n if (type === RightCurlyBracket) {\n return true;\n }\n\n if (type === LeftCurlyBracket ||\n type === AtKeyword) {\n return false;\n }\n }\n\n return false;\n}\n\n\nexport const name = 'Atrule';\nexport const walkContext = 'atrule';\nexport const structure = {\n name: String,\n prelude: ['AtrulePrelude', 'Raw', null],\n block: ['Block', null]\n};\n\nexport function parse(isDeclaration = false) {\n const start = this.tokenStart;\n let name;\n let nameLowerCase;\n let prelude = null;\n let block = null;\n\n this.eat(AtKeyword);\n\n name = this.substrToCursor(start + 1);\n nameLowerCase = name.toLowerCase();\n this.skipSC();\n\n // parse prelude\n if (this.eof === false &&\n this.tokenType !== LeftCurlyBracket &&\n this.tokenType !== Semicolon) {\n if (this.parseAtrulePrelude) {\n prelude = this.parseWithFallback(this.AtrulePrelude.bind(this, name, isDeclaration), consumeRaw);\n } else {\n prelude = consumeRaw.call(this, this.tokenIndex);\n }\n\n this.skipSC();\n }\n\n switch (this.tokenType) {\n case Semicolon:\n this.next();\n break;\n\n case LeftCurlyBracket:\n this.eat(LeftCurlyBracket);\n\n if (hasOwnProperty.call(this.atrule, nameLowerCase) &&\n typeof this.atrule[nameLowerCase].block === 'function') {\n block = this.atrule[nameLowerCase].block.call(this, isDeclaration);\n } else {\n // TODO: should consume block content as Raw?\n block = this.Block(isDeclarationBlockAtrule.call(this));\n }\n\n if (!this.eof) {\n this.eat(RightCurlyBracket);\n }\n\n break;\n }\n\n return {\n type: 'Atrule',\n loc: this.getLocation(start, this.tokenStart),\n name,\n prelude,\n block\n };\n}\n\nexport function generate(node) {\n this.token(AtKeyword, '@' + node.name);\n\n if (node.prelude !== null) {\n this.node(node.prelude);\n }\n\n if (node.block) {\n this.token(LeftCurlyBracket, '{');\n this.node(node.block);\n this.token(RightCurlyBracket, '}');\n } else {\n this.token(Semicolon, ';');\n }\n}\n", "import {\n Semicolon,\n LeftCurlyBracket\n} from '../../tokenizer/index.js';\n\nexport const name = 'AtrulePrelude';\nexport const walkContext = 'atrulePrelude';\nexport const structure = {\n children: [[]]\n};\n\nexport function parse(name) {\n let children = null;\n\n if (name !== null) {\n name = name.toLowerCase();\n }\n\n this.skipSC();\n\n if (hasOwnProperty.call(this.atrule, name) &&\n typeof this.atrule[name].prelude === 'function') {\n // custom consumer\n children = this.atrule[name].prelude.call(this);\n } else {\n // default consumer\n children = this.readSequence(this.scope.AtrulePrelude);\n }\n\n this.skipSC();\n\n if (this.eof !== true &&\n this.tokenType !== LeftCurlyBracket &&\n this.tokenType !== Semicolon) {\n this.error('Semicolon or block is expected');\n }\n\n return {\n type: 'AtrulePrelude',\n loc: this.getLocationFromList(children),\n children\n };\n}\n\nexport function generate(node) {\n this.children(node);\n}\n", "import {\n Ident,\n String as StringToken,\n Delim,\n LeftSquareBracket,\n RightSquareBracket\n} from '../../tokenizer/index.js';\n\nconst DOLLARSIGN = 0x0024; // U+0024 DOLLAR SIGN ($)\nconst ASTERISK = 0x002A; // U+002A ASTERISK (*)\nconst EQUALSSIGN = 0x003D; // U+003D EQUALS SIGN (=)\nconst CIRCUMFLEXACCENT = 0x005E; // U+005E (^)\nconst VERTICALLINE = 0x007C; // U+007C VERTICAL LINE (|)\nconst TILDE = 0x007E; // U+007E TILDE (~)\n\nfunction getAttributeName() {\n if (this.eof) {\n this.error('Unexpected end of input');\n }\n\n const start = this.tokenStart;\n let expectIdent = false;\n\n if (this.isDelim(ASTERISK)) {\n expectIdent = true;\n this.next();\n } else if (!this.isDelim(VERTICALLINE)) {\n this.eat(Ident);\n }\n\n if (this.isDelim(VERTICALLINE)) {\n if (this.charCodeAt(this.tokenStart + 1) !== EQUALSSIGN) {\n this.next();\n this.eat(Ident);\n } else if (expectIdent) {\n this.error('Identifier is expected', this.tokenEnd);\n }\n } else if (expectIdent) {\n this.error('Vertical line is expected');\n }\n\n return {\n type: 'Identifier',\n loc: this.getLocation(start, this.tokenStart),\n name: this.substrToCursor(start)\n };\n}\n\nfunction getOperator() {\n const start = this.tokenStart;\n const code = this.charCodeAt(start);\n\n if (code !== EQUALSSIGN && // =\n code !== TILDE && // ~=\n code !== CIRCUMFLEXACCENT && // ^=\n code !== DOLLARSIGN && // $=\n code !== ASTERISK && // *=\n code !== VERTICALLINE // |=\n ) {\n this.error('Attribute selector (=, ~=, ^=, $=, *=, |=) is expected');\n }\n\n this.next();\n\n if (code !== EQUALSSIGN) {\n if (!this.isDelim(EQUALSSIGN)) {\n this.error('Equal sign is expected');\n }\n\n this.next();\n }\n\n return this.substrToCursor(start);\n}\n\n// '[' ']'\n// '[' [ | ] ? ']'\nexport const name = 'AttributeSelector';\nexport const structure = {\n name: 'Identifier',\n matcher: [String, null],\n value: ['String', 'Identifier', null],\n flags: [String, null]\n};\n\nexport function parse() {\n const start = this.tokenStart;\n let name;\n let matcher = null;\n let value = null;\n let flags = null;\n\n this.eat(LeftSquareBracket);\n this.skipSC();\n\n name = getAttributeName.call(this);\n this.skipSC();\n\n if (this.tokenType !== RightSquareBracket) {\n // avoid case `[name i]`\n if (this.tokenType !== Ident) {\n matcher = getOperator.call(this);\n\n this.skipSC();\n\n value = this.tokenType === StringToken\n ? this.String()\n : this.Identifier();\n\n this.skipSC();\n }\n\n // attribute flags\n if (this.tokenType === Ident) {\n flags = this.consume(Ident);\n\n this.skipSC();\n }\n }\n\n this.eat(RightSquareBracket);\n\n return {\n type: 'AttributeSelector',\n loc: this.getLocation(start, this.tokenStart),\n name,\n matcher,\n value,\n flags\n };\n}\n\nexport function generate(node) {\n this.token(Delim, '[');\n this.node(node.name);\n\n if (node.matcher !== null) {\n this.tokenize(node.matcher);\n this.node(node.value);\n }\n\n if (node.flags !== null) {\n this.token(Ident, node.flags);\n }\n\n this.token(Delim, ']');\n}\n", "import {\n WhiteSpace,\n Comment,\n Semicolon,\n AtKeyword,\n RightCurlyBracket\n} from '../../tokenizer/index.js';\n\nconst AMPERSAND = 0x0026; // U+0026 AMPERSAND (&)\n\nfunction consumeRaw() {\n return this.Raw(null, true);\n}\nfunction consumeRule() {\n return this.parseWithFallback(this.Rule, consumeRaw);\n}\nfunction consumeRawDeclaration() {\n return this.Raw(this.consumeUntilSemicolonIncluded, true);\n}\nfunction consumeDeclaration() {\n if (this.tokenType === Semicolon) {\n return consumeRawDeclaration.call(this, this.tokenIndex);\n }\n\n const node = this.parseWithFallback(this.Declaration, consumeRawDeclaration);\n\n if (this.tokenType === Semicolon) {\n this.next();\n }\n\n return node;\n}\n\nexport const name = 'Block';\nexport const walkContext = 'block';\nexport const structure = {\n children: [[\n 'Atrule',\n 'Rule',\n 'Declaration'\n ]]\n};\n\nexport function parse(isStyleBlock) {\n const consumer = isStyleBlock ? consumeDeclaration : consumeRule;\n const start = this.tokenStart;\n let children = this.createList();\n\n scan:\n while (!this.eof) {\n switch (this.tokenType) {\n case RightCurlyBracket:\n break scan;\n\n case WhiteSpace:\n case Comment:\n this.next();\n break;\n\n case AtKeyword:\n children.push(this.parseWithFallback(this.Atrule.bind(this, isStyleBlock), consumeRaw));\n break;\n\n default:\n if (isStyleBlock && this.isDelim(AMPERSAND)) {\n children.push(consumeRule.call(this));\n } else {\n children.push(consumer.call(this));\n }\n }\n }\n\n return {\n type: 'Block',\n loc: this.getLocation(start, this.tokenStart),\n children\n };\n}\n\nexport function generate(node) {\n this.children(node, prev => {\n if (prev.type === 'Declaration') {\n this.token(Semicolon, ';');\n }\n });\n}\n", "import {\n Delim,\n LeftSquareBracket,\n RightSquareBracket\n} from '../../tokenizer/index.js';\n\nexport const name = 'Brackets';\nexport const structure = {\n children: [[]]\n};\n\nexport function parse(readSequence, recognizer) {\n const start = this.tokenStart;\n let children = null;\n\n this.eat(LeftSquareBracket);\n\n children = readSequence.call(this, recognizer);\n\n if (!this.eof) {\n this.eat(RightSquareBracket);\n }\n\n return {\n type: 'Brackets',\n loc: this.getLocation(start, this.tokenStart),\n children\n };\n}\n\nexport function generate(node) {\n this.token(Delim, '[');\n this.children(node);\n this.token(Delim, ']');\n}\n", "import { CDC } from '../../tokenizer/index.js';\n\nexport const name = 'CDC';\nexport const structure = [];\n\nexport function parse() {\n const start = this.tokenStart;\n\n this.eat(CDC); // -->\n\n return {\n type: 'CDC',\n loc: this.getLocation(start, this.tokenStart)\n };\n}\n\nexport function generate() {\n this.token(CDC, '-->');\n}\n", "import { CDO } from '../../tokenizer/index.js';\n\nexport const name = 'CDO';\nexport const structure = [];\n\nexport function parse() {\n const start = this.tokenStart;\n\n this.eat(CDO); // \n child = this.CDC();\n break;\n\n // CSS Syntax Module Level 3\n // \u00A72.2 Error handling\n // At the \"top level\" of a stylesheet, an starts an at-rule.\n case AtKeyword:\n child = this.parseWithFallback(this.Atrule, consumeRaw);\n break;\n\n // Anything else starts a qualified rule ...\n default:\n child = this.parseWithFallback(this.Rule, consumeRaw);\n }\n\n children.push(child);\n }\n\n return {\n type: 'StyleSheet',\n loc: this.getLocation(start, this.tokenStart),\n children\n };\n}\n\nexport function generate(node) {\n this.children(node);\n}\n", "import {\n LeftParenthesis,\n RightParenthesis\n} from '../../tokenizer/index.js';\n\nexport const name = 'SupportsDeclaration';\nexport const structure = {\n declaration: 'Declaration'\n};\n\nexport function parse() {\n const start = this.tokenStart;\n\n this.eat(LeftParenthesis);\n this.skipSC();\n\n const declaration = this.Declaration();\n\n if (!this.eof) {\n this.eat(RightParenthesis);\n }\n\n return {\n type: 'SupportsDeclaration',\n loc: this.getLocation(start, this.tokenStart),\n declaration\n };\n}\n\nexport function generate(node) {\n this.token(LeftParenthesis, '(');\n this.node(node.declaration);\n this.token(RightParenthesis, ')');\n}\n", "import { Ident } from '../../tokenizer/index.js';\n\nconst ASTERISK = 0x002A; // U+002A ASTERISK (*)\nconst VERTICALLINE = 0x007C; // U+007C VERTICAL LINE (|)\n\nfunction eatIdentifierOrAsterisk() {\n if (this.tokenType !== Ident &&\n this.isDelim(ASTERISK) === false) {\n this.error('Identifier or asterisk is expected');\n }\n\n this.next();\n}\n\nexport const name = 'TypeSelector';\nexport const structure = {\n name: String\n};\n\n// ident\n// ident|ident\n// ident|*\n// *\n// *|ident\n// *|*\n// |ident\n// |*\nexport function parse() {\n const start = this.tokenStart;\n\n if (this.isDelim(VERTICALLINE)) {\n this.next();\n eatIdentifierOrAsterisk.call(this);\n } else {\n eatIdentifierOrAsterisk.call(this);\n\n if (this.isDelim(VERTICALLINE)) {\n this.next();\n eatIdentifierOrAsterisk.call(this);\n }\n }\n\n return {\n type: 'TypeSelector',\n loc: this.getLocation(start, this.tokenStart),\n name: this.substrToCursor(start)\n };\n}\n\nexport function generate(node) {\n this.tokenize(node.name);\n}\n", "import {\n isHexDigit,\n Ident,\n Number,\n Dimension\n} from '../../tokenizer/index.js';\n\nconst PLUSSIGN = 0x002B; // U+002B PLUS SIGN (+)\nconst HYPHENMINUS = 0x002D; // U+002D HYPHEN-MINUS (-)\nconst QUESTIONMARK = 0x003F; // U+003F QUESTION MARK (?)\n\nfunction eatHexSequence(offset, allowDash) {\n let len = 0;\n\n for (let pos = this.tokenStart + offset; pos < this.tokenEnd; pos++) {\n const code = this.charCodeAt(pos);\n\n if (code === HYPHENMINUS && allowDash && len !== 0) {\n eatHexSequence.call(this, offset + len + 1, false);\n return -1;\n }\n\n if (!isHexDigit(code)) {\n this.error(\n allowDash && len !== 0\n ? 'Hyphen minus' + (len < 6 ? ' or hex digit' : '') + ' is expected'\n : (len < 6 ? 'Hex digit is expected' : 'Unexpected input'),\n pos\n );\n }\n\n if (++len > 6) {\n this.error('Too many hex digits', pos);\n };\n }\n\n this.next();\n return len;\n}\n\nfunction eatQuestionMarkSequence(max) {\n let count = 0;\n\n while (this.isDelim(QUESTIONMARK)) {\n if (++count > max) {\n this.error('Too many question marks');\n }\n\n this.next();\n }\n}\n\nfunction startsWith(code) {\n if (this.charCodeAt(this.tokenStart) !== code) {\n this.error((code === PLUSSIGN ? 'Plus sign' : 'Hyphen minus') + ' is expected');\n }\n}\n\n// https://drafts.csswg.org/css-syntax/#urange\n// Informally, the production has three forms:\n// U+0001\n// Defines a range consisting of a single code point, in this case the code point \"1\".\n// U+0001-00ff\n// Defines a range of codepoints between the first and the second value, in this case\n// the range between \"1\" and \"ff\" (255 in decimal) inclusive.\n// U+00??\n// Defines a range of codepoints where the \"?\" characters range over all hex digits,\n// in this case defining the same as the value U+0000-00ff.\n// In each form, a maximum of 6 digits is allowed for each hexadecimal number (if you treat \"?\" as a hexadecimal digit).\n//\n// =\n// u '+' '?'* |\n// u '?'* |\n// u '?'* |\n// u |\n// u |\n// u '+' '?'+\nfunction scanUnicodeRange() {\n let hexLength = 0;\n\n switch (this.tokenType) {\n case Number:\n // u '?'*\n // u \n // u \n hexLength = eatHexSequence.call(this, 1, true);\n\n if (this.isDelim(QUESTIONMARK)) {\n eatQuestionMarkSequence.call(this, 6 - hexLength);\n break;\n }\n\n if (this.tokenType === Dimension ||\n this.tokenType === Number) {\n startsWith.call(this, HYPHENMINUS);\n eatHexSequence.call(this, 1, false);\n break;\n }\n\n break;\n\n case Dimension:\n // u '?'*\n hexLength = eatHexSequence.call(this, 1, true);\n\n if (hexLength > 0) {\n eatQuestionMarkSequence.call(this, 6 - hexLength);\n }\n\n break;\n\n default:\n // u '+' '?'*\n // u '+' '?'+\n this.eatDelim(PLUSSIGN);\n\n if (this.tokenType === Ident) {\n hexLength = eatHexSequence.call(this, 0, true);\n if (hexLength > 0) {\n eatQuestionMarkSequence.call(this, 6 - hexLength);\n }\n break;\n }\n\n if (this.isDelim(QUESTIONMARK)) {\n this.next();\n eatQuestionMarkSequence.call(this, 5);\n break;\n }\n\n this.error('Hex digit or question mark is expected');\n }\n}\n\nexport const name = 'UnicodeRange';\nexport const structure = {\n value: String\n};\n\nexport function parse() {\n const start = this.tokenStart;\n\n // U or u\n this.eatIdent('u');\n scanUnicodeRange.call(this);\n\n return {\n type: 'UnicodeRange',\n loc: this.getLocation(start, this.tokenStart),\n value: this.substrToCursor(start)\n };\n}\n\nexport function generate(node) {\n this.tokenize(node.value);\n}\n", "import {\n isHexDigit,\n isWhiteSpace,\n isValidEscape,\n consumeEscaped,\n decodeEscaped\n} from '../tokenizer/index.js';\n\nconst SPACE = 0x0020; // U+0020 SPACE\nconst REVERSE_SOLIDUS = 0x005c; // U+005C REVERSE SOLIDUS (\\)\nconst QUOTATION_MARK = 0x0022; // \"\nconst APOSTROPHE = 0x0027; // '\nconst LEFTPARENTHESIS = 0x0028; // U+0028 LEFT PARENTHESIS (()\nconst RIGHTPARENTHESIS = 0x0029; // U+0029 RIGHT PARENTHESIS ())\n\nexport function decode(str) {\n const len = str.length;\n let start = 4; // length of \"url(\"\n let end = str.charCodeAt(len - 1) === RIGHTPARENTHESIS ? len - 2 : len - 1;\n let decoded = '';\n\n while (start < end && isWhiteSpace(str.charCodeAt(start))) {\n start++;\n }\n\n while (start < end && isWhiteSpace(str.charCodeAt(end))) {\n end--;\n }\n\n for (let i = start; i <= end; i++) {\n let code = str.charCodeAt(i);\n\n if (code === REVERSE_SOLIDUS) {\n // special case at the ending\n if (i === end) {\n // if the next input code point is EOF, do nothing\n // otherwise include last left parenthesis as escaped\n if (i !== len - 1) {\n decoded = str.substr(i + 1);\n }\n break;\n }\n\n code = str.charCodeAt(++i);\n\n // consume escaped\n if (isValidEscape(REVERSE_SOLIDUS, code)) {\n const escapeStart = i - 1;\n const escapeEnd = consumeEscaped(str, escapeStart);\n\n i = escapeEnd - 1;\n decoded += decodeEscaped(str.substring(escapeStart + 1, escapeEnd));\n } else {\n // \\r\\n\n if (code === 0x000d && str.charCodeAt(i + 1) === 0x000a) {\n i++;\n }\n }\n } else {\n decoded += str[i];\n }\n }\n\n return decoded;\n}\n\nexport function encode(str) {\n let encoded = '';\n let wsBeforeHexIsNeeded = false;\n\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n\n // If the character is NULL (U+0000), then the REPLACEMENT CHARACTER (U+FFFD).\n if (code === 0x0000) {\n encoded += '\\uFFFD';\n continue;\n }\n\n // If the character is in the range [\\1-\\1f] (U+0001 to U+001F) or is U+007F,\n // the character escaped as code point.\n // Note: Do not compare with 0x0001 since 0x0000 is precessed before\n if (code <= 0x001f || code === 0x007F) {\n encoded += '\\\\' + code.toString(16);\n wsBeforeHexIsNeeded = true;\n continue;\n }\n\n if (code === SPACE ||\n code === REVERSE_SOLIDUS ||\n code === QUOTATION_MARK ||\n code === APOSTROPHE ||\n code === LEFTPARENTHESIS ||\n code === RIGHTPARENTHESIS) {\n encoded += '\\\\' + str.charAt(i);\n wsBeforeHexIsNeeded = false;\n } else {\n if (wsBeforeHexIsNeeded && isHexDigit(code)) {\n encoded += ' ';\n }\n\n encoded += str.charAt(i);\n wsBeforeHexIsNeeded = false;\n }\n }\n\n return 'url(' + encoded + ')';\n}\n", "import * as url from '../../utils/url.js';\nimport * as string from '../../utils/string.js';\nimport {\n Function as FunctionToken,\n String as StringToken,\n Url,\n RightParenthesis\n} from '../../tokenizer/index.js';\n\nexport const name = 'Url';\nexport const structure = {\n value: String\n};\n\n// | )\nexport function parse() {\n const start = this.tokenStart;\n let value;\n\n switch (this.tokenType) {\n case Url:\n value = url.decode(this.consume(Url));\n break;\n\n case FunctionToken:\n if (!this.cmpStr(this.tokenStart, this.tokenEnd, 'url(')) {\n this.error('Function name must be `url`');\n }\n\n this.eat(FunctionToken);\n this.skipSC();\n value = string.decode(this.consume(StringToken));\n this.skipSC();\n if (!this.eof) {\n this.eat(RightParenthesis);\n }\n break;\n\n default:\n this.error('Url or Function is expected');\n }\n\n return {\n type: 'Url',\n loc: this.getLocation(start, this.tokenStart),\n value\n };\n}\n\nexport function generate(node) {\n this.token(Url, url.encode(node.value));\n}\n", "export const name = 'Value';\nexport const structure = {\n children: [[]]\n};\n\nexport function parse() {\n const start = this.tokenStart;\n const children = this.readSequence(this.scope.Value);\n\n return {\n type: 'Value',\n loc: this.getLocation(start, this.tokenStart),\n children\n };\n}\n\nexport function generate(node) {\n this.children(node);\n}\n", "import { WhiteSpace } from '../../tokenizer/index.js';\n\nconst SPACE = Object.freeze({\n type: 'WhiteSpace',\n loc: null,\n value: ' '\n});\n\nexport const name = 'WhiteSpace';\nexport const structure = {\n value: String\n};\n\nexport function parse() {\n this.eat(WhiteSpace);\n return SPACE;\n\n // return {\n // type: 'WhiteSpace',\n // loc: this.getLocation(this.tokenStart, this.tokenEnd),\n // value: this.consume(WHITESPACE)\n // };\n}\n\nexport function generate(node) {\n this.token(WhiteSpace, node.value);\n}\n", "import * as node from '../node/index-generate.js';\n\nexport default {\n node\n};\n", "import { createGenerator } from './create.js';\nimport config from '../syntax/config/generator.js';\n\nexport default createGenerator(config);\n", "//\n// list\n// \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n// \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500head \u2502\n// \u2502 \u2502 tail\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n// \u2502 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2502\n// \u25BC \u25BC\n// item item item item\n// \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n// null \u25C0\u2500\u2500\u253C\u2500prev \u2502\u25C0\u2500\u2500\u2500\u253C\u2500prev \u2502\u25C0\u2500\u2500\u2500\u253C\u2500prev \u2502\u25C0\u2500\u2500\u2500\u253C\u2500prev \u2502\n// \u2502 next\u2500\u253C\u2500\u2500\u2500\u25B6\u2502 next\u2500\u253C\u2500\u2500\u2500\u25B6\u2502 next\u2500\u253C\u2500\u2500\u2500\u25B6\u2502 next\u2500\u253C\u2500\u2500\u25B6 null\n// \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n// \u2502 data \u2502 \u2502 data \u2502 \u2502 data \u2502 \u2502 data \u2502\n// \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n//\n\nlet releasedCursors = null;\n\nexport class List {\n static createItem(data) {\n return {\n prev: null,\n next: null,\n data\n };\n }\n\n constructor() {\n this.head = null;\n this.tail = null;\n this.cursor = null;\n }\n createItem(data) {\n return List.createItem(data);\n }\n\n // cursor helpers\n allocateCursor(prev, next) {\n let cursor;\n\n if (releasedCursors !== null) {\n cursor = releasedCursors;\n releasedCursors = releasedCursors.cursor;\n cursor.prev = prev;\n cursor.next = next;\n cursor.cursor = this.cursor;\n } else {\n cursor = {\n prev,\n next,\n cursor: this.cursor\n };\n }\n\n this.cursor = cursor;\n\n return cursor;\n }\n releaseCursor() {\n const { cursor } = this;\n\n this.cursor = cursor.cursor;\n cursor.prev = null;\n cursor.next = null;\n cursor.cursor = releasedCursors;\n releasedCursors = cursor;\n }\n updateCursors(prevOld, prevNew, nextOld, nextNew) {\n let { cursor } = this;\n\n while (cursor !== null) {\n if (cursor.prev === prevOld) {\n cursor.prev = prevNew;\n }\n\n if (cursor.next === nextOld) {\n cursor.next = nextNew;\n }\n\n cursor = cursor.cursor;\n }\n }\n *[Symbol.iterator]() {\n for (let cursor = this.head; cursor !== null; cursor = cursor.next) {\n yield cursor.data;\n }\n }\n\n // getters\n get size() {\n let size = 0;\n\n for (let cursor = this.head; cursor !== null; cursor = cursor.next) {\n size++;\n }\n\n return size;\n }\n get isEmpty() {\n return this.head === null;\n }\n get first() {\n return this.head && this.head.data;\n }\n get last() {\n return this.tail && this.tail.data;\n }\n\n // convertors\n fromArray(array) {\n let cursor = null;\n this.head = null;\n\n for (let data of array) {\n const item = List.createItem(data);\n\n if (cursor !== null) {\n cursor.next = item;\n } else {\n this.head = item;\n }\n\n item.prev = cursor;\n cursor = item;\n }\n\n this.tail = cursor;\n return this;\n }\n toArray() {\n return [...this];\n }\n toJSON() {\n return [...this];\n }\n\n // array-like methods\n forEach(fn, thisArg = this) {\n // push cursor\n const cursor = this.allocateCursor(null, this.head);\n\n while (cursor.next !== null) {\n const item = cursor.next;\n cursor.next = item.next;\n fn.call(thisArg, item.data, item, this);\n }\n\n // pop cursor\n this.releaseCursor();\n }\n forEachRight(fn, thisArg = this) {\n // push cursor\n const cursor = this.allocateCursor(this.tail, null);\n\n while (cursor.prev !== null) {\n const item = cursor.prev;\n cursor.prev = item.prev;\n fn.call(thisArg, item.data, item, this);\n }\n\n // pop cursor\n this.releaseCursor();\n }\n reduce(fn, initialValue, thisArg = this) {\n // push cursor\n let cursor = this.allocateCursor(null, this.head);\n let acc = initialValue;\n let item;\n\n while (cursor.next !== null) {\n item = cursor.next;\n cursor.next = item.next;\n\n acc = fn.call(thisArg, acc, item.data, item, this);\n }\n\n // pop cursor\n this.releaseCursor();\n\n return acc;\n }\n reduceRight(fn, initialValue, thisArg = this) {\n // push cursor\n let cursor = this.allocateCursor(this.tail, null);\n let acc = initialValue;\n let item;\n\n while (cursor.prev !== null) {\n item = cursor.prev;\n cursor.prev = item.prev;\n\n acc = fn.call(thisArg, acc, item.data, item, this);\n }\n\n // pop cursor\n this.releaseCursor();\n\n return acc;\n }\n some(fn, thisArg = this) {\n for (let cursor = this.head; cursor !== null; cursor = cursor.next) {\n if (fn.call(thisArg, cursor.data, cursor, this)) {\n return true;\n }\n }\n\n return false;\n }\n map(fn, thisArg = this) {\n const result = new List();\n\n for (let cursor = this.head; cursor !== null; cursor = cursor.next) {\n result.appendData(fn.call(thisArg, cursor.data, cursor, this));\n }\n\n return result;\n }\n filter(fn, thisArg = this) {\n const result = new List();\n\n for (let cursor = this.head; cursor !== null; cursor = cursor.next) {\n if (fn.call(thisArg, cursor.data, cursor, this)) {\n result.appendData(cursor.data);\n }\n }\n\n return result;\n }\n\n nextUntil(start, fn, thisArg = this) {\n if (start === null) {\n return;\n }\n\n // push cursor\n const cursor = this.allocateCursor(null, start);\n\n while (cursor.next !== null) {\n const item = cursor.next;\n cursor.next = item.next;\n if (fn.call(thisArg, item.data, item, this)) {\n break;\n }\n }\n\n // pop cursor\n this.releaseCursor();\n }\n prevUntil(start, fn, thisArg = this) {\n if (start === null) {\n return;\n }\n\n // push cursor\n const cursor = this.allocateCursor(start, null);\n\n while (cursor.prev !== null) {\n const item = cursor.prev;\n cursor.prev = item.prev;\n if (fn.call(thisArg, item.data, item, this)) {\n break;\n }\n }\n\n // pop cursor\n this.releaseCursor();\n }\n\n // mutation\n clear() {\n this.head = null;\n this.tail = null;\n }\n copy() {\n const result = new List();\n\n for (let data of this) {\n result.appendData(data);\n }\n\n return result;\n }\n prepend(item) {\n // head\n // ^\n // item\n this.updateCursors(null, item, this.head, item);\n\n // insert to the beginning of the list\n if (this.head !== null) {\n // new item <- first item\n this.head.prev = item;\n // new item -> first item\n item.next = this.head;\n } else {\n // if list has no head, then it also has no tail\n // in this case tail points to the new item\n this.tail = item;\n }\n\n // head always points to new item\n this.head = item;\n return this;\n }\n prependData(data) {\n return this.prepend(List.createItem(data));\n }\n append(item) {\n return this.insert(item);\n }\n appendData(data) {\n return this.insert(List.createItem(data));\n }\n insert(item, before = null) {\n if (before !== null) {\n // prev before\n // ^\n // item\n this.updateCursors(before.prev, item, before, item);\n\n if (before.prev === null) {\n // insert to the beginning of list\n if (this.head !== before) {\n throw new Error('before doesn\\'t belong to list');\n }\n // since head points to before therefore list doesn't empty\n // no need to check tail\n this.head = item;\n before.prev = item;\n item.next = before;\n this.updateCursors(null, item);\n } else {\n // insert between two items\n before.prev.next = item;\n item.prev = before.prev;\n before.prev = item;\n item.next = before;\n }\n } else {\n // tail\n // ^\n // item\n this.updateCursors(this.tail, item, null, item);\n\n // insert to the ending of the list\n if (this.tail !== null) {\n // last item -> new item\n this.tail.next = item;\n // last item <- new item\n item.prev = this.tail;\n } else {\n // if list has no tail, then it also has no head\n // in this case head points to new item\n this.head = item;\n }\n\n // tail always points to new item\n this.tail = item;\n }\n\n return this;\n }\n insertData(data, before) {\n return this.insert(List.createItem(data), before);\n }\n remove(item) {\n // item\n // ^\n // prev next\n this.updateCursors(item, item.prev, item, item.next);\n\n if (item.prev !== null) {\n item.prev.next = item.next;\n } else {\n if (this.head !== item) {\n throw new Error('item doesn\\'t belong to list');\n }\n\n this.head = item.next;\n }\n\n if (item.next !== null) {\n item.next.prev = item.prev;\n } else {\n if (this.tail !== item) {\n throw new Error('item doesn\\'t belong to list');\n }\n\n this.tail = item.prev;\n }\n\n item.prev = null;\n item.next = null;\n\n return item;\n }\n push(data) {\n this.insert(List.createItem(data));\n }\n pop() {\n return this.tail !== null ? this.remove(this.tail) : null;\n }\n unshift(data) {\n this.prepend(List.createItem(data));\n }\n shift() {\n return this.head !== null ? this.remove(this.head) : null;\n }\n prependList(list) {\n return this.insertList(list, this.head);\n }\n appendList(list) {\n return this.insertList(list);\n }\n insertList(list, before) {\n // ignore empty lists\n if (list.head === null) {\n return this;\n }\n\n if (before !== undefined && before !== null) {\n this.updateCursors(before.prev, list.tail, before, list.head);\n\n // insert in the middle of dist list\n if (before.prev !== null) {\n // before.prev <-> list.head\n before.prev.next = list.head;\n list.head.prev = before.prev;\n } else {\n this.head = list.head;\n }\n\n before.prev = list.tail;\n list.tail.next = before;\n } else {\n this.updateCursors(this.tail, list.tail, null, list.head);\n\n // insert to end of the list\n if (this.tail !== null) {\n // if destination list has a tail, then it also has a head,\n // but head doesn't change\n // dest tail -> source head\n this.tail.next = list.head;\n // dest tail <- source head\n list.head.prev = this.tail;\n } else {\n // if list has no a tail, then it also has no a head\n // in this case points head to new item\n this.head = list.head;\n }\n\n // tail always start point to new item\n this.tail = list.tail;\n }\n\n list.head = null;\n list.tail = null;\n return this;\n }\n replace(oldItem, newItemOrList) {\n if ('head' in newItemOrList) {\n this.insertList(newItemOrList, oldItem);\n } else {\n this.insert(newItemOrList, oldItem);\n }\n\n this.remove(oldItem);\n }\n}\n", "export function createCustomError(name, message) {\n // use Object.create(), because some VMs prevent setting line/column otherwise\n // (iOS Safari 10 even throws an exception)\n const error = Object.create(SyntaxError.prototype);\n const errorStack = new Error();\n\n return Object.assign(error, {\n name,\n message,\n get stack() {\n return (errorStack.stack || '').replace(/^(.+\\n){1,3}/, `${name}: ${message}\\n`);\n }\n });\n};\n", "import { createCustomError } from '../utils/create-custom-error.js';\n\nconst MAX_LINE_LENGTH = 100;\nconst OFFSET_CORRECTION = 60;\nconst TAB_REPLACEMENT = ' ';\n\nfunction sourceFragment({ source, line, column, baseLine, baseColumn }, extraLines) {\n function processLines(start, end) {\n return lines\n .slice(start, end)\n .map((line, idx) =>\n String(start + idx + 1).padStart(maxNumLength) + ' |' + line\n ).join('\\n');\n }\n\n const prelines = '\\n'.repeat(Math.max(baseLine - 1, 0));\n const precolumns = ' '.repeat(Math.max(baseColumn - 1, 0));\n const lines = (prelines + precolumns + source).split(/\\r\\n?|\\n|\\f/);\n const startLine = Math.max(1, line - extraLines) - 1;\n const endLine = Math.min(line + extraLines, lines.length + 1);\n const maxNumLength = Math.max(4, String(endLine).length) + 1;\n let cutLeft = 0;\n\n // column correction according to replaced tab before column\n column += (TAB_REPLACEMENT.length - 1) * (lines[line - 1].substr(0, column - 1).match(/\\t/g) || []).length;\n\n if (column > MAX_LINE_LENGTH) {\n cutLeft = column - OFFSET_CORRECTION + 3;\n column = OFFSET_CORRECTION - 2;\n }\n\n for (let i = startLine; i <= endLine; i++) {\n if (i >= 0 && i < lines.length) {\n lines[i] = lines[i].replace(/\\t/g, TAB_REPLACEMENT);\n lines[i] =\n (cutLeft > 0 && lines[i].length > cutLeft ? '\\u2026' : '') +\n lines[i].substr(cutLeft, MAX_LINE_LENGTH - 2) +\n (lines[i].length > cutLeft + MAX_LINE_LENGTH - 1 ? '\\u2026' : '');\n }\n }\n\n return [\n processLines(startLine, line),\n new Array(column + maxNumLength + 2).join('-') + '^',\n processLines(line, endLine)\n ].filter(Boolean)\n .join('\\n')\n .replace(/^(\\s+\\d+\\s+\\|\\n)+/, '')\n .replace(/\\n(\\s+\\d+\\s+\\|)+$/, '');\n}\n\nexport function SyntaxError(message, source, offset, line, column, baseLine = 1, baseColumn = 1) {\n const error = Object.assign(createCustomError('SyntaxError', message), {\n source,\n offset,\n line,\n column,\n sourceFragment(extraLines) {\n return sourceFragment({ source, line, column, baseLine, baseColumn }, isNaN(extraLines) ? 0 : extraLines);\n },\n get formattedMessage() {\n return (\n `Parse error: ${message}\\n` +\n sourceFragment({ source, line, column, baseLine, baseColumn }, 2)\n );\n }\n });\n\n return error;\n}\n", "import { WhiteSpace, Comment } from '../tokenizer/index.js';\n\nexport function readSequence(recognizer) {\n const children = this.createList();\n let space = false;\n const context = {\n recognizer\n };\n\n while (!this.eof) {\n switch (this.tokenType) {\n case Comment:\n this.next();\n continue;\n\n case WhiteSpace:\n space = true;\n this.next();\n continue;\n }\n\n let child = recognizer.getNode.call(this, context);\n\n if (child === undefined) {\n break;\n }\n\n if (space) {\n if (recognizer.onWhiteSpace) {\n recognizer.onWhiteSpace.call(this, child, children, context);\n }\n space = false;\n }\n\n children.push(child);\n }\n\n if (space && recognizer.onWhiteSpace) {\n recognizer.onWhiteSpace.call(this, null, children, context);\n }\n\n return children;\n};\n", "import { List } from '../utils/List.js';\nimport { SyntaxError } from './SyntaxError.js';\nimport {\n tokenize,\n OffsetToLocation,\n TokenStream,\n tokenNames,\n\n consumeNumber,\n findWhiteSpaceStart,\n cmpChar,\n cmpStr,\n\n WhiteSpace,\n Comment,\n Ident,\n Function as FunctionToken,\n Url,\n Hash,\n Percentage,\n Number as NumberToken\n} from '../tokenizer/index.js';\nimport { readSequence } from './sequence.js';\n\nconst NOOP = () => {};\nconst EXCLAMATIONMARK = 0x0021; // U+0021 EXCLAMATION MARK (!)\nconst NUMBERSIGN = 0x0023; // U+0023 NUMBER SIGN (#)\nconst SEMICOLON = 0x003B; // U+003B SEMICOLON (;)\nconst LEFTCURLYBRACKET = 0x007B; // U+007B LEFT CURLY BRACKET ({)\nconst NULL = 0;\n\nfunction createParseContext(name) {\n return function() {\n return this[name]();\n };\n}\n\nfunction fetchParseValues(dict) {\n const result = Object.create(null);\n\n for (const name of Object.keys(dict)) {\n const item = dict[name];\n const fn = item.parse || item;\n\n if (fn) {\n result[name] = fn;\n }\n }\n\n return result;\n}\n\nfunction processConfig(config) {\n const parseConfig = {\n context: Object.create(null),\n features: Object.assign(Object.create(null), config.features),\n scope: Object.assign(Object.create(null), config.scope),\n atrule: fetchParseValues(config.atrule),\n pseudo: fetchParseValues(config.pseudo),\n node: fetchParseValues(config.node)\n };\n\n for (const [name, context] of Object.entries(config.parseContext)) {\n switch (typeof context) {\n case 'function':\n parseConfig.context[name] = context;\n break;\n\n case 'string':\n parseConfig.context[name] = createParseContext(context);\n break;\n }\n }\n\n return {\n config: parseConfig,\n ...parseConfig,\n ...parseConfig.node\n };\n}\n\nexport function createParser(config) {\n let source = '';\n let filename = '';\n let needPositions = false;\n let onParseError = NOOP;\n let onParseErrorThrow = false;\n\n const locationMap = new OffsetToLocation();\n const parser = Object.assign(new TokenStream(), processConfig(config || {}), {\n parseAtrulePrelude: true,\n parseRulePrelude: true,\n parseValue: true,\n parseCustomProperty: false,\n\n readSequence,\n\n consumeUntilBalanceEnd: () => 0,\n consumeUntilLeftCurlyBracket(code) {\n return code === LEFTCURLYBRACKET ? 1 : 0;\n },\n consumeUntilLeftCurlyBracketOrSemicolon(code) {\n return code === LEFTCURLYBRACKET || code === SEMICOLON ? 1 : 0;\n },\n consumeUntilExclamationMarkOrSemicolon(code) {\n return code === EXCLAMATIONMARK || code === SEMICOLON ? 1 : 0;\n },\n consumeUntilSemicolonIncluded(code) {\n return code === SEMICOLON ? 2 : 0;\n },\n\n createList() {\n return new List();\n },\n createSingleNodeList(node) {\n return new List().appendData(node);\n },\n getFirstListNode(list) {\n return list && list.first;\n },\n getLastListNode(list) {\n return list && list.last;\n },\n\n parseWithFallback(consumer, fallback) {\n const startIndex = this.tokenIndex;\n\n try {\n return consumer.call(this);\n } catch (e) {\n if (onParseErrorThrow) {\n throw e;\n }\n\n this.skip(startIndex - this.tokenIndex);\n const fallbackNode = fallback.call(this);\n\n onParseErrorThrow = true;\n onParseError(e, fallbackNode);\n onParseErrorThrow = false;\n\n return fallbackNode;\n }\n },\n\n lookupNonWSType(offset) {\n let type;\n\n do {\n type = this.lookupType(offset++);\n if (type !== WhiteSpace && type !== Comment) {\n return type;\n }\n } while (type !== NULL);\n\n return NULL;\n },\n\n charCodeAt(offset) {\n return offset >= 0 && offset < source.length ? source.charCodeAt(offset) : 0;\n },\n substring(offsetStart, offsetEnd) {\n return source.substring(offsetStart, offsetEnd);\n },\n substrToCursor(start) {\n return this.source.substring(start, this.tokenStart);\n },\n\n cmpChar(offset, charCode) {\n return cmpChar(source, offset, charCode);\n },\n cmpStr(offsetStart, offsetEnd, str) {\n return cmpStr(source, offsetStart, offsetEnd, str);\n },\n\n consume(tokenType) {\n const start = this.tokenStart;\n\n this.eat(tokenType);\n\n return this.substrToCursor(start);\n },\n consumeFunctionName() {\n const name = source.substring(this.tokenStart, this.tokenEnd - 1);\n\n this.eat(FunctionToken);\n\n return name;\n },\n consumeNumber(type) {\n const number = source.substring(this.tokenStart, consumeNumber(source, this.tokenStart));\n\n this.eat(type);\n\n return number;\n },\n\n eat(tokenType) {\n if (this.tokenType !== tokenType) {\n const tokenName = tokenNames[tokenType].slice(0, -6).replace(/-/g, ' ').replace(/^./, m => m.toUpperCase());\n let message = `${/[[\\](){}]/.test(tokenName) ? `\"${tokenName}\"` : tokenName} is expected`;\n let offset = this.tokenStart;\n\n // tweak message and offset\n switch (tokenType) {\n case Ident:\n // when identifier is expected but there is a function or url\n if (this.tokenType === FunctionToken || this.tokenType === Url) {\n offset = this.tokenEnd - 1;\n message = 'Identifier is expected but function found';\n } else {\n message = 'Identifier is expected';\n }\n break;\n\n case Hash:\n if (this.isDelim(NUMBERSIGN)) {\n this.next();\n offset++;\n message = 'Name is expected';\n }\n break;\n\n case Percentage:\n if (this.tokenType === NumberToken) {\n offset = this.tokenEnd;\n message = 'Percent sign is expected';\n }\n break;\n }\n\n this.error(message, offset);\n }\n\n this.next();\n },\n eatIdent(name) {\n if (this.tokenType !== Ident || this.lookupValue(0, name) === false) {\n this.error(`Identifier \"${name}\" is expected`);\n }\n\n this.next();\n },\n eatDelim(code) {\n if (!this.isDelim(code)) {\n this.error(`Delim \"${String.fromCharCode(code)}\" is expected`);\n }\n\n this.next();\n },\n\n getLocation(start, end) {\n if (needPositions) {\n return locationMap.getLocationRange(\n start,\n end,\n filename\n );\n }\n\n return null;\n },\n getLocationFromList(list) {\n if (needPositions) {\n const head = this.getFirstListNode(list);\n const tail = this.getLastListNode(list);\n return locationMap.getLocationRange(\n head !== null ? head.loc.start.offset - locationMap.startOffset : this.tokenStart,\n tail !== null ? tail.loc.end.offset - locationMap.startOffset : this.tokenStart,\n filename\n );\n }\n\n return null;\n },\n\n error(message, offset) {\n const location = typeof offset !== 'undefined' && offset < source.length\n ? locationMap.getLocation(offset)\n : this.eof\n ? locationMap.getLocation(findWhiteSpaceStart(source, source.length - 1))\n : locationMap.getLocation(this.tokenStart);\n\n throw new SyntaxError(\n message || 'Unexpected input',\n source,\n location.offset,\n location.line,\n location.column,\n locationMap.startLine,\n locationMap.startColumn\n );\n }\n });\n\n const parse = function(source_, options) {\n source = source_;\n options = options || {};\n\n parser.setSource(source, tokenize);\n locationMap.setSource(\n source,\n options.offset,\n options.line,\n options.column\n );\n\n filename = options.filename || '';\n needPositions = Boolean(options.positions);\n onParseError = typeof options.onParseError === 'function' ? options.onParseError : NOOP;\n onParseErrorThrow = false;\n\n parser.parseAtrulePrelude = 'parseAtrulePrelude' in options ? Boolean(options.parseAtrulePrelude) : true;\n parser.parseRulePrelude = 'parseRulePrelude' in options ? Boolean(options.parseRulePrelude) : true;\n parser.parseValue = 'parseValue' in options ? Boolean(options.parseValue) : true;\n parser.parseCustomProperty = 'parseCustomProperty' in options ? Boolean(options.parseCustomProperty) : false;\n\n const { context = 'default', onComment } = options;\n\n if (context in parser.context === false) {\n throw new Error('Unknown context `' + context + '`');\n }\n\n if (typeof onComment === 'function') {\n parser.forEachToken((type, start, end) => {\n if (type === Comment) {\n const loc = parser.getLocation(start, end);\n const value = cmpStr(source, end - 2, end, '*/')\n ? source.slice(start + 2, end - 2)\n : source.slice(start + 2, end);\n\n onComment(value, loc);\n }\n });\n }\n\n const ast = parser.context[context].call(parser, options);\n\n if (!parser.eof) {\n parser.error();\n }\n\n return ast;\n };\n\n return Object.assign(parse, {\n SyntaxError,\n config: parser.config\n });\n};\n", "import {\n Delim,\n Ident,\n Dimension,\n Percentage,\n Number as NumberToken,\n Hash,\n Colon,\n LeftSquareBracket\n} from '../../tokenizer/index.js';\n\nconst NUMBERSIGN = 0x0023; // U+0023 NUMBER SIGN (#)\nconst AMPERSAND = 0x0026; // U+0026 AMPERSAND (&)\nconst ASTERISK = 0x002A; // U+002A ASTERISK (*)\nconst PLUSSIGN = 0x002B; // U+002B PLUS SIGN (+)\nconst SOLIDUS = 0x002F; // U+002F SOLIDUS (/)\nconst FULLSTOP = 0x002E; // U+002E FULL STOP (.)\nconst GREATERTHANSIGN = 0x003E; // U+003E GREATER-THAN SIGN (>)\nconst VERTICALLINE = 0x007C; // U+007C VERTICAL LINE (|)\nconst TILDE = 0x007E; // U+007E TILDE (~)\n\nfunction onWhiteSpace(next, children) {\n if (children.last !== null && children.last.type !== 'Combinator' &&\n next !== null && next.type !== 'Combinator') {\n children.push({ // FIXME: this.Combinator() should be used instead\n type: 'Combinator',\n loc: null,\n name: ' '\n });\n }\n}\n\nfunction getNode() {\n switch (this.tokenType) {\n case LeftSquareBracket:\n return this.AttributeSelector();\n\n case Hash:\n return this.IdSelector();\n\n case Colon:\n if (this.lookupType(1) === Colon) {\n return this.PseudoElementSelector();\n } else {\n return this.PseudoClassSelector();\n }\n\n case Ident:\n return this.TypeSelector();\n\n case NumberToken:\n case Percentage:\n return this.Percentage();\n\n case Dimension:\n // throws when .123ident\n if (this.charCodeAt(this.tokenStart) === FULLSTOP) {\n this.error('Identifier is expected', this.tokenStart + 1);\n }\n break;\n\n case Delim: {\n const code = this.charCodeAt(this.tokenStart);\n\n switch (code) {\n case PLUSSIGN:\n case GREATERTHANSIGN:\n case TILDE:\n case SOLIDUS: // /deep/\n return this.Combinator();\n\n case FULLSTOP:\n return this.ClassSelector();\n\n case ASTERISK:\n case VERTICALLINE:\n return this.TypeSelector();\n\n case NUMBERSIGN:\n return this.IdSelector();\n\n case AMPERSAND:\n return this.NestingSelector();\n }\n\n break;\n }\n }\n};\n\nexport default {\n onWhiteSpace,\n getNode\n};\n", "import { Comma, String as StringToken, Ident, RightParenthesis } from '../../tokenizer/index.js';\n\nexport function parseLanguageRangeList() {\n const children = this.createList();\n\n this.skipSC();\n\n loop: while (!this.eof) {\n switch (this.tokenType) {\n case Ident:\n children.push(this.Identifier());\n break;\n\n case StringToken:\n children.push(this.String());\n break;\n\n case Comma:\n children.push(this.Operator());\n break;\n\n case RightParenthesis:\n break loop;\n\n default:\n this.error('Identifier, string or comma is expected');\n }\n\n this.skipSC();\n }\n\n return children;\n}\n", "import { parseLanguageRangeList } from './lang.js';\n\nconst selectorList = {\n parse() {\n return this.createSingleNodeList(\n this.SelectorList()\n );\n }\n};\n\nconst selector = {\n parse() {\n return this.createSingleNodeList(\n this.Selector()\n );\n }\n};\n\nconst identList = {\n parse() {\n return this.createSingleNodeList(\n this.Identifier()\n );\n }\n};\n\nconst langList = {\n parse: parseLanguageRangeList\n};\n\nconst nth = {\n parse() {\n return this.createSingleNodeList(\n this.Nth()\n );\n }\n};\n\nexport default {\n 'dir': identList,\n 'has': selectorList,\n 'lang': langList,\n 'matches': selectorList,\n 'is': selectorList,\n '-moz-any': selectorList,\n '-webkit-any': selectorList,\n 'where': selectorList,\n 'not': selectorList,\n 'nth-child': nth,\n 'nth-last-child': nth,\n 'nth-last-of-type': nth,\n 'nth-of-type': nth,\n 'slotted': selector,\n 'host': selector,\n 'host-context': selector\n};\n", "export { parse as AnPlusB } from './AnPlusB.js';\nexport { parse as AttributeSelector } from './AttributeSelector.js';\nexport { parse as ClassSelector } from './ClassSelector.js';\nexport { parse as Combinator } from './Combinator.js';\nexport { parse as Identifier } from './Identifier.js';\nexport { parse as IdSelector } from './IdSelector.js';\nexport { parse as NestingSelector } from './NestingSelector.js';\nexport { parse as Nth } from './Nth.js';\nexport { parse as Operator } from './Operator.js';\nexport { parse as Percentage } from './Percentage.js';\nexport { parse as PseudoClassSelector } from './PseudoClassSelector.js';\nexport { parse as PseudoElementSelector } from './PseudoElementSelector.js';\nexport { parse as Raw } from './Raw.js';\nexport { parse as Selector } from './Selector.js';\nexport { parse as SelectorList } from './SelectorList.js';\nexport { parse as String } from './String.js';\nexport { parse as TypeSelector } from './TypeSelector.js';\n", "import { Selector } from '../scope/index.js';\nimport pseudo from '../pseudo/index.js';\nimport * as node from '../node/index-parse-selector.js';\n\nexport default {\n parseContext: {\n default: 'SelectorList',\n selectorList: 'SelectorList',\n selector: 'Selector'\n },\n scope: { Selector },\n atrule: {},\n pseudo,\n node\n};\n", "import { createParser } from './create.js';\nimport config from '../syntax/config/parser-selector.js';\n\nexport default createParser(config);\n", "const compare = (s1, s2) => {\n if (s1.a === s2.a) {\n if (s1.b === s2.b) {\n return s1.c - s2.c;\n }\n return s1.b - s2.b;\n }\n return s1.a - s2.a;\n};\n\nconst equals = (s1, s2) => {\n return compare(s1, s2) === 0;\n};\n\nconst greaterThan = (s1, s2) => {\n return compare(s1, s2) > 0;\n};\n\nconst lessThan = (s1, s2) => {\n return compare(s1, s2) < 0;\n};\n\nexport { compare, equals, greaterThan, lessThan };\n", "import { compare } from './compare.js';\n\nconst sort = (specificities, order = 'ASC') => {\n const sorted = specificities.sort(compare);\n\n if (order === 'DESC') {\n return sorted.reverse();\n }\n\n return sorted;\n};\n\nconst sortAsc = (...specificities) => {\n return sort(specificities, 'ASC');\n};\n\nconst sortDesc = (...specificities) => {\n return sort(specificities, 'DESC');\n};\n\nexport { sortAsc, sortDesc };\n", "import { sortAsc, sortDesc } from './sort.js';\n\nconst max = (...specificities) => {\n const sorted = sortDesc(...specificities);\n return sorted[0];\n};\n\nconst min = (...specificities) => {\n const sorted = sortAsc(...specificities);\n return sorted[0];\n};\n\nexport { max, min };\n", "import parse from 'css-tree/selector-parser';\nimport Specificity from '../index.js';\nimport { max } from './../util/index.js';\n\n/** @param {import('css-tree').Selector} selectorAST */\nconst calculateForAST = (selectorAST) => {\n // Quit while you're ahead\n if (!selectorAST || selectorAST.type !== 'Selector') {\n throw new TypeError(`Passed in source is not a Selector AST`);\n }\n\n // https://www.w3.org/TR/selectors-4/#specificity-rules\n let a = 0; /* ID Selectors */\n let b = 0; /* Class selectors, Attributes selectors, and Pseudo-classes */\n let c = 0; /* Type selectors and Pseudo-elements */\n\n selectorAST.children.forEach((child) => {\n switch (child.type) {\n case 'IdSelector':\n a += 1;\n break;\n\n case 'AttributeSelector':\n case 'ClassSelector':\n b += 1;\n break;\n\n case 'PseudoClassSelector':\n switch (child.name.toLowerCase()) {\n // \u201CThe specificity of a :where() pseudo-class is replaced by zero.\u201D\n case 'where':\n // Noop :)\n break;\n\n case '-webkit-any':\n case 'any':\n if (child.children?.first) {\n b += 1;\n }\n break;\n\n // \u201CThe specificity of an :is(), :not(), or :has() pseudo-class is replaced by the specificity of the most specific complex selector in its selector list argument.\u201C\n case '-moz-any':\n case 'is':\n case 'matches':\n case 'not':\n case 'has':\n if (child.children?.first) {\n // Calculate Specificity from nested SelectorList\n const max1 = max(...calculate(child.children.first));\n\n // Adjust orig specificity\n a += max1.a;\n b += max1.b;\n c += max1.c;\n }\n\n break;\n\n // \u201CThe specificity of an :nth-child() or :nth-last-child() selector is the specificity of the pseudo class itself (counting as one pseudo-class selector) plus the specificity of the most specific complex selector in its selector list argument\u201D\n case 'nth-child':\n case 'nth-last-child':\n b += 1;\n\n if (child.children?.first?.selector) {\n // Calculate Specificity from SelectorList\n const max2 = max(...calculate(child.children.first.selector));\n\n // Adjust orig specificity\n a += max2.a;\n b += max2.b;\n c += max2.c;\n }\n break;\n\n // \u201CThe specificity of :host is that of a pseudo-class. The specificity of :host() is that of a pseudo-class, plus the specificity of its argument.\u201D\n // \u201CThe specificity of :host-context() is that of a pseudo-class, plus the specificity of its argument.\u201D\n case 'host-context':\n case 'host':\n b += 1;\n\n if (child.children?.first?.children) {\n // Workaround to a css-tree bug in which it allows complex selectors instead of only compound selectors\n // We work around it by filtering out any Combinator and successive Selectors\n const childAST = { type: 'Selector', children: [] };\n let foundCombinator = false;\n child.children.first.children.forEach((entry) => {\n if (foundCombinator) return false;\n if (entry.type === 'Combinator') {\n foundCombinator = true;\n return false;\n }\n childAST.children.push(entry);\n });\n\n // Calculate Specificity from Selector\n const childSpecificity = calculate(childAST)[0];\n\n // Adjust orig specificity\n a += childSpecificity.a;\n b += childSpecificity.b;\n c += childSpecificity.c;\n }\n break;\n\n // Improper use of Pseudo-Class Selectors instead of a Pseudo-Element\n // @ref https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements#index\n case 'after':\n case 'before':\n case 'first-letter':\n case 'first-line':\n c += 1;\n break;\n\n default:\n b += 1;\n break;\n }\n break;\n\n case 'PseudoElementSelector':\n switch (child.name) {\n // \u201CThe specificity of ::slotted() is that of a pseudo-element, plus the specificity of its argument.\u201D\n case 'slotted':\n c += 1;\n\n if (child.children?.first?.children) {\n // Workaround to a css-tree bug in which it allows complex selectors instead of only compound selectors\n // We work around it by filtering out any Combinator and successive Selectors\n const childAST = { type: 'Selector', children: [] };\n let foundCombinator = false;\n child.children.first.children.forEach((entry) => {\n if (foundCombinator) return false;\n if (entry.type === 'Combinator') {\n foundCombinator = true;\n return false;\n }\n childAST.children.push(entry);\n });\n\n // Calculate Specificity from Selector\n const childSpecificity = calculate(childAST)[0];\n\n // Adjust orig specificity\n a += childSpecificity.a;\n b += childSpecificity.b;\n c += childSpecificity.c;\n }\n break;\n\n case 'view-transition-group':\n case 'view-transition-image-pair':\n case 'view-transition-old':\n case 'view-transition-new':\n // The specificity of a view-transition selector with a * argument is zero.\n if (child.children?.first?.value === '*') {\n break;\n }\n // The specificity of a view-transition selector with an argument is the same\n // as for other pseudo - elements, and is equivalent to a type selector.\n c += 1;\n break;\n\n default:\n c += 1;\n break;\n }\n break;\n\n case 'TypeSelector':\n // Omit namespace\n let typeSelector = child.name;\n if (typeSelector.includes('|')) {\n typeSelector = typeSelector.split('|')[1];\n }\n\n // \u201CIgnore the universal selector\u201D\n if (typeSelector !== '*') {\n c += 1;\n }\n break;\n\n default:\n // NOOP\n break;\n }\n });\n\n return new Specificity({ a, b, c }, selectorAST);\n};\n\nconst convertToAST = (source) => {\n // The passed in argument was a String.\n // ~> Let's try and parse to an AST\n if (typeof source === 'string' || source instanceof String) {\n try {\n return parse(source, {\n context: 'selectorList',\n });\n } catch (e) {\n throw new TypeError(`Could not convert passed in source '${source}' to SelectorList: ${e.message}`);\n }\n }\n\n // The passed in argument was an Object.\n // ~> Let's verify if it's a AST of the type Selector or SelectorList\n if (source instanceof Object) {\n if (source.type && ['Selector', 'SelectorList'].includes(source.type)) {\n return source;\n }\n\n // Manually parsing subtree when the child is of the type Raw, most likely due to https://github.com/csstree/csstree/issues/151\n if (source.type && source.type === 'Raw') {\n try {\n return parse(source.value, {\n context: 'selectorList',\n });\n } catch (e) {\n throw new TypeError(`Could not convert passed in source to SelectorList: ${e.message}`);\n }\n }\n\n throw new TypeError(`Passed in source is an Object but no AST / AST of the type Selector or SelectorList`);\n }\n\n throw new TypeError(`Passed in source is not a String nor an Object. I don't know what to do with it.`);\n};\n\n/**\n * @param {string} selector\n * @returns {Specificity[]}\n */\nconst calculate = (selector) => {\n // Quit while you're ahead\n if (!selector) {\n return [];\n }\n\n // Make sure we have a SelectorList AST\n // If not, an exception will be thrown\n const ast = convertToAST(selector);\n\n // Selector?\n if (ast.type === 'Selector') {\n return [calculateForAST(selector)];\n }\n\n // SelectorList?\n // ~> Calculate Specificity for each contained Selector\n if (ast.type === 'SelectorList') {\n const specificities = [];\n ast.children.forEach((childAST) => {\n const specificity = calculateForAST(childAST);\n specificities.push(specificity);\n });\n return specificities;\n }\n};\n\nexport { calculate, calculateForAST };\n"], "mappings": "wwBAAA,eAOA,GAAI,IAAe,mEAAmE,MAAM,IAK5F,GAAQ,OAAS,SAAU,EAAQ,CACjC,GAAI,GAAK,GAAU,EAAS,GAAa,OACvC,MAAO,IAAa,GAEtB,KAAM,IAAI,WAAU,6BAA+B,IAOrD,GAAQ,OAAS,SAAU,EAAU,CACnC,GAAI,GAAO,GACP,EAAO,GAEP,EAAU,GACV,EAAU,IAEV,EAAO,GACP,EAAO,GAEP,EAAO,GACP,EAAQ,GAER,EAAe,GACf,EAAe,GAGnB,MAAI,IAAQ,GAAY,GAAY,EAC1B,EAAW,EAIjB,GAAW,GAAY,GAAY,EAC7B,EAAW,EAAU,EAI3B,GAAQ,GAAY,GAAY,EAC1B,EAAW,EAAO,EAIxB,GAAY,EACP,GAIL,GAAY,EACP,GAIF,MCjET,eAqCA,GAAI,IAAS,KAcT,GAAiB,EAGjB,GAAW,GAAK,GAGhB,GAAgB,GAAW,EAG3B,GAAuB,GAQ3B,YAAqB,EAAQ,CAC3B,MAAO,GAAS,EACV,EAAC,GAAW,GAAK,EAClB,IAAU,GAAK,EAStB,YAAuB,EAAQ,CAC7B,GAAI,GAAc,GAAS,KAAO,EAC9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