@react-email/tailwind
Version:
A React component to wrap emails with Tailwind CSS
1 lines • 676 kB
Source Map (JSON)
{"version":3,"file":"index.mjs","names":["String","Number","EOF","code","code","N","F","R","code","balancePair","FunctionToken","tokenType","tokenize","balanceStart","code","tokenNames","tokenize","getCharCode","offset","TYPE.Dimension","TYPE.Percentage","TYPE.Number","TYPE.Function","TYPE.Ident","TYPE.String","code","TYPE.BadString","TYPE.Url","TYPE.BadUrl","TYPE.WhiteSpace","TYPE.Hash","TYPE.Delim","TYPE.LeftParenthesis","TYPE.RightParenthesis","TYPE.Comma","TYPE.CDC","TYPE.Comment","TYPE.Colon","TYPE.Semicolon","TYPE.CDO","TYPE.AtKeyword","TYPE.LeftSquareBracket","TYPE.RightSquareBracket","TYPE.LeftCurlyBracket","TYPE.RightCurlyBracket","name","line","SyntaxError","EXCLAMATIONMARK","NUMBERSIGN","LEFTCURLYBRACKET","name","code","tokenType","FunctionToken","number","tokenNames","NumberToken","SyntaxError","parse","tokenize","number","zero","normalize","length","util","ArraySet","util","MappingList","SourceMapGenerator","name","sourceFile","SourceMapGenerator","PLUSSIGN","HYPHENMINUS","FunctionToken","NumberToken","StringToken","node","name","tokenBefore.safe","tokenBefore","noop","ensureFunction","structure","hasOwnProperty","name","walk","noop","generate","css","generate","HYPHENMINUS","keyword","name","property","descriptor","PLUSSIGN","HYPHENMINUS","N","DISALLOW_SIGN","ALLOW_SIGN","isDelim","code","checkInteger","consumeB","NumberToken","PLUSSIGN","HYPHENMINUS","QUESTIONMARK","U","code","startsWith","length","NumberToken","FunctionToken","length","name","NumberToken","StringToken","angle","decibel","frequency","flex","resolution","semitones","time","SyntaxError","TAB","N","F","R","SPACE","code","SyntaxError","N","SPACE","EXCLAMATIONMARK","NUMBERSIGN","AMPERSAND","APOSTROPHE","LEFTPARENTHESIS","RIGHTPARENTHESIS","ASTERISK","PLUSSIGN","LESSTHANSIGN","GREATERTHANSIGN","QUESTIONMARK","VERTICALLINE","readProperty","name","code","parse","walk","node","LEFTPARENTHESIS","RIGHTPARENTHESIS","name","parse","TYPE.Delim","TYPE.Comma","TYPE.Function","TYPE.LeftParenthesis","TYPE.LeftSquareBracket","TYPE.LeftCurlyBracket","TYPE.RightParenthesis","TYPE.RightSquareBracket","TYPE.RightCurlyBracket","TYPE.WhiteSpace","TYPE.Comment","name","hasOwnProperty","lastTokenIndex","TYPE.Ident","property","name","hasOwnProperty","structure","name","name","generate","trace","prepareTokens","lexer","units","structure","property","parse","syntax","names.keyword","names.property","isType","name","patch","parse","walk","generate","config","PLUSSIGN","HYPHENMINUS","code","Number","name","structure","parse","generate","consumeRaw","name","walkContext","structure","parse","generate","name","walkContext","structure","parse","generate","DOLLARSIGN","ASTERISK","EQUALSSIGN","VERTICALLINE","TILDE","code","name","structure","parse","StringToken","generate","AMPERSAND","consumeRaw","name","walkContext","structure","parse","generate","name","structure","parse","readSequence","generate","name","structure","parse","generate","name","structure","parse","generate","FULLSTOP","name","structure","parse","generate","PLUSSIGN","SOLIDUS","GREATERTHANSIGN","TILDE","name","structure","parse","generate","ASTERISK","SOLIDUS","name","structure","parse","generate","name","structure","parse","FunctionToken","generate","EXCLAMATIONMARK","NUMBERSIGN","AMPERSAND","ASTERISK","PLUSSIGN","SOLIDUS","name","walkContext","structure","parse","property","consumeRaw","generate","AMPERSAND","consumeRaw","name","structure","parse","generate","name","structure","parse","generate","SOLIDUS","name","structure","parse","Number","FunctionToken","generate","name","structure","parse","value","generate","FunctionToken","SOLIDUS","GREATERTHANSIGN","name","structure","Number","FunctionToken","parse","generate","name","walkContext","structure","parse","readSequence","generate","FunctionToken","name","structure","parse","FunctionToken","children","generate","name","structure","parse","generate","name","structure","parse","generate","name","structure","parse","generate","FULLSTOP","name","structure","parse","generate","name","structure","parse","generate","name","structure","parse","FunctionToken","generate","name","structure","parse","generate","AMPERSAND","name","structure","parse","generate","name","structure","parse","selector","nth","generate","name","structure","parse","NumberToken","generate","name","structure","parse","generate","name","structure","parse","readSequence","generate","name","structure","parse","generate","name","walkContext","structure","parse","FunctionToken","generate","name","walkContext","structure","parse","FunctionToken","generate","SOLIDUS","NumberToken","FunctionToken","name","structure","parse","generate","name","structure","parse","generate","consumeRaw","name","walkContext","structure","parse","generate","name","structure","parse","generate","name","structure","parse","generate","name","walkContext","structure","parse","generate","REVERSE_SOLIDUS","QUOTATION_MARK","APOSTROPHE","decode","code","encode","name","structure","parse","decode","StringToken","generate","encode","name","structure","parse","generate","name","structure","parse","generate","ASTERISK","VERTICALLINE","name","structure","parse","generate","PLUSSIGN","HYPHENMINUS","code","Number","name","structure","parse","generate","SPACE","code","name","structure","parse","url.decode","FunctionToken","string.decode","StringToken","generate","url.encode","name","structure","parse","generate","parse","generate","definitions","NUMBERSIGN","ASTERISK","PLUSSIGN","SOLIDUS","StringToken","NumberToken","FunctionToken","code","NumberToken","expressionFn","varFn","name","parse","StringToken","FunctionToken","fontFace","importAtrule","startingStyle","StringToken","createSyntax","lexerConfig","parserConfig","walkerConfig","syntax","selectorClasses: string[]","string.decode","syntax: Declaration | undefined","inherits: Declaration | undefined","initialValue: Declaration | undefined","styles: Record<string, string>","variableName: string | undefined","path: CssNode[]","node","name","l: number | undefined","c: number | undefined","h: number | undefined","a: number | undefined","r: number | undefined","g: number | undefined","b: number | undefined","color: CssNode | undefined","opacity: CssNode | undefined","state: PromiseState","node","string.decode","componentsToTreatAsElements: React.ReactElement['type'][]","propsToOverwrite: Partial<EmailElementProps>","residualClasses: string[]","rules: Rule[]","css","css","css","indexCss","preflightCss","themeCss","utilitiesCss","css: string","css","pixelBasedPreset: TailwindConfig","classesUsed: string[]","mappedChildren: React.ReactNode","React","nonInlineStyles: StyleSheet"],"sources":["../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/tokenizer/types.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/tokenizer/char-code-definitions.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/tokenizer/utils.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/tokenizer/names.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/tokenizer/adopt-buffer.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/tokenizer/OffsetToLocation.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/tokenizer/TokenStream.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/tokenizer/index.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/utils/List.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/utils/create-custom-error.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/parser/SyntaxError.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/parser/sequence.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/parser/create.js","../../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/base64.js","../../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/base64-vlq.js","../../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/util.js","../../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/array-set.js","../../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/mapping-list.js","../../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/source-map-generator.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/generator/sourceMap.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/generator/token-before.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/generator/create.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/convertor/create.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/walker/create.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/definition-syntax/generate.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/lexer/error.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/utils/names.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/lexer/generic-const.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/lexer/generic-an-plus-b.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/lexer/generic-urange.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/lexer/generic.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/lexer/units.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/definition-syntax/SyntaxError.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/definition-syntax/scanner.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/definition-syntax/parse.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/definition-syntax/walk.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/lexer/prepare-tokens.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/lexer/match-graph.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/lexer/match.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/lexer/trace.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/lexer/search.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/lexer/structure.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/lexer/Lexer.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/config/mix.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/create.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/data-patch.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/data.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/AnPlusB.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/Atrule.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/AtrulePrelude.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/AttributeSelector.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/Block.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/Brackets.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/CDC.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/CDO.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/ClassSelector.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/Combinator.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/Comment.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/Condition.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/Declaration.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/DeclarationList.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/Dimension.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/Feature.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/FeatureFunction.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/FeatureRange.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/Function.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/GeneralEnclosed.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/Hash.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/Identifier.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/IdSelector.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/Layer.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/LayerList.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/MediaQuery.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/MediaQueryList.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/NestingSelector.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/Nth.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/Number.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/Operator.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/Parentheses.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/Percentage.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/PseudoClassSelector.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/PseudoElementSelector.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/Ratio.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/Raw.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/Rule.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/Scope.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/Selector.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/SelectorList.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/utils/string.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/String.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/StyleSheet.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/SupportsDeclaration.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/TypeSelector.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/UnicodeRange.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/utils/url.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/Url.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/Value.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/WhiteSpace.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/index.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/config/lexer.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/scope/default.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/scope/atrulePrelude.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/scope/selector.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/function/expression.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/function/var.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/scope/value.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/scope/index.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/atrule/container.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/atrule/font-face.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/atrule/import.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/atrule/layer.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/atrule/media.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/atrule/nest.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/atrule/page.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/atrule/scope.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/atrule/starting-style.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/atrule/supports.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/atrule/index.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/pseudo/lang.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/pseudo/index.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/node/index-parse.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/config/parser.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/config/walker.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/syntax/index.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/version.js","../../../node_modules/.pnpm/css-tree@3.1.0/node_modules/css-tree/lib/index.js","../src/utils/css/is-rule-inlinable.ts","../src/utils/css/extract-rules-per-class.ts","../src/utils/css/get-custom-properties.ts","../src/utils/text/from-dash-case-to-camel-case.ts","../src/utils/compatibility/get-react-property.ts","../src/utils/css/unwrap-value.ts","../src/utils/css/make-inline-styles-for.ts","../src/inline-styles.ts","../src/utils/css/resolve-all-css-variables.ts","../src/utils/css/resolve-calc-expressions.ts","../src/utils/css/sanitize-declarations.ts","../src/sanitize-stylesheet.ts","../src/hooks/use-suspended-promise.ts","../src/utils/compatibility/sanitize-class-name.ts","../src/utils/css/sanitize-non-inlinable-rules.ts","../src/utils/react/is-component.ts","../src/utils/react/map-react-tree.ts","../src/utils/tailwindcss/clone-element-with-inlined-styles.ts","../src/utils/tailwindcss/tailwind-stylesheets/index.ts","../src/utils/tailwindcss/tailwind-stylesheets/preflight.ts","../src/utils/tailwindcss/tailwind-stylesheets/theme.ts","../src/utils/tailwindcss/tailwind-stylesheets/utilities.ts","../src/utils/tailwindcss/setup-tailwind.ts","../src/tailwind.tsx"],"sourcesContent":["// CSS Syntax Module Level 3\n// https://www.w3.org/TR/css-syntax-3/\nexport const EOF = 0; // <EOF-token>\nexport const Ident = 1; // <ident-token>\nexport const Function = 2; // <function-token>\nexport const AtKeyword = 3; // <at-keyword-token>\nexport const Hash = 4; // <hash-token>\nexport const String = 5; // <string-token>\nexport const BadString = 6; // <bad-string-token>\nexport const Url = 7; // <url-token>\nexport const BadUrl = 8; // <bad-url-token>\nexport const Delim = 9; // <delim-token>\nexport const Number = 10; // <number-token>\nexport const Percentage = 11; // <percentage-token>\nexport const Dimension = 12; // <dimension-token>\nexport const WhiteSpace = 13; // <whitespace-token>\nexport const CDO = 14; // <CDO-token>\nexport const CDC = 15; // <CDC-token>\nexport const Colon = 16; // <colon-token> :\nexport const Semicolon = 17; // <semicolon-token> ;\nexport const Comma = 18; // <comma-token> ,\nexport const LeftSquareBracket = 19; // <[-token>\nexport const RightSquareBracket = 20; // <]-token>\nexport const LeftParenthesis = 21; // <(-token>\nexport const RightParenthesis = 22; // <)-token>\nexport const LeftCurlyBracket = 23; // <{-token>\nexport const RightCurlyBracket = 24; // <}-token>\nexport const Comment = 25;\n","const EOF = 0;\n\n// https://drafts.csswg.org/css-syntax-3/\n// § 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 <control>.\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// § 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// § 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// § 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// § 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// §4.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 <ident-token>. 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// §4.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// § 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 <bad-url-token>. This is otherwise identical to\n // the \"anything else\" clause.\n offset = consumeEscaped(source, offset);\n }\n }\n\n return offset;\n}\n\n// § 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(source, startOffset, startLine, startColumn) {\n this.setSource(source, startOffset, startLine, startColumn);\n this.lines = null;\n this.columns = null;\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 Uint8Array(32); // 32b of memory ought to be enough for anyone (any number of tokens)\nbalancePair[FunctionToken] = RightParenthesis;\nbalancePair[LeftParenthesis] = RightParenthesis;\nbalancePair[LeftSquareBracket] = RightSquareBracket;\nbalancePair[LeftCurlyBracket] = RightCurlyBracket;\n\nfunction isBlockOpenerToken(tokenType) {\n return balancePair[tokenType] !== 0;\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 firstCharOffset = -1;\n let balanceCloseType = 0;\n let balanceStart = source.length;\n\n // capture buffers\n this.offsetAndType = null;\n this.balance = null;\n balance.fill(0);\n\n tokenize(source, (type, start, end) => {\n const index = tokenCount++;\n\n // type & offset\n offsetAndType[index] = (type << TYPE_SHIFT) | end;\n\n if (firstCharOffset === -1) {\n firstCharOffset = start;\n }\n\n // balance\n balance[index] = balanceStart;\n\n if (type === balanceCloseType) {\n const prevBalanceStart = balance[balanceStart];\n\n // set reference to balance end for a block opener\n balance[balanceStart] = index;\n\n // pop state\n balanceStart = prevBalanceStart;\n balanceCloseType = balancePair[offsetAndType[prevBalanceStart] >> TYPE_SHIFT];\n } else if (isBlockOpenerToken(type)) { // check for FunctionToken, <(-token>, <[-token> and <{-token>\n // push state\n balanceStart = index;\n balanceCloseType = balancePair[type];\n }\n });\n\n // finalize buffers\n offsetAndType[tokenCount] = (EOF << TYPE_SHIFT) | sourceLength; // <EOF-token>\n balance[tokenCount] = tokenCount; // prevents false positive balance match with any token\n\n // reverse references from balance start to end\n // tokens\n // token: a ( [ b c ] d e ) {\n // index: 0 1 2 3 4 5 6 7 8 9\n // before\n // balance: 0 8 5 2 2 2 1 1 1 0\n // - > > < < < < < < -\n // after\n // balance: 9 8 5 5 5 2 8 8 1 9\n // > > > > > < > > < >\n for (let i = 0; i < tokenCount; i++) {\n const balanceStart = balance[i];\n\n if (balanceStart <= i) {\n const balanceEnd = balance[balanceStart];\n\n if (balanceEnd !== i) {\n balance[i] = balanceEnd;\n }\n } else if (balanceStart > tokenCount) {\n balance[i] = tokenCount;\n }\n }\n\n // balance[0] = tokenCount;\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 // return this.balance[this.balance[pos]] !== this.tokenIndex;\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 = 0;\n let offset = 0;\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 for an open block tokens\n if (isBlockOpenerToken(this.offsetAndType[cursor] >> TYPE_SHIFT)) {\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 // § 4.3.3. Consume a numeric token\n function consumeNumericToken() {\n // Consume a nu