| | |
| | | /** |
| | | * @vue/compiler-sfc v3.5.25 |
| | | * @vue/compiler-sfc v3.5.32 |
| | | * (c) 2018-present Yuxi (Evan) You and Vue contributors |
| | | * @license MIT |
| | | **/ |
| | |
| | | function isImportUsed(local, sfc) { |
| | | return resolveTemplateUsedIdentifiers(sfc).has(local); |
| | | } |
| | | const templateUsageCheckCache = createCache(); |
| | | const templateAnalysisCache = createCache(); |
| | | function resolveTemplateVModelIdentifiers(sfc) { |
| | | return resolveTemplateAnalysisResult(sfc, false).vModelIds; |
| | | } |
| | | function resolveTemplateUsedIdentifiers(sfc) { |
| | | return resolveTemplateAnalysisResult(sfc).usedIds; |
| | | } |
| | | function resolveTemplateAnalysisResult(sfc, collectUsedIds = true) { |
| | | const { content, ast } = sfc.template; |
| | | const cached = templateUsageCheckCache.get(content); |
| | | if (cached) { |
| | | const cached = templateAnalysisCache.get(content); |
| | | if (cached && (!collectUsedIds || cached.usedIds)) { |
| | | return cached; |
| | | } |
| | | const ids = /* @__PURE__ */ new Set(); |
| | | const ids = collectUsedIds ? /* @__PURE__ */ new Set() : void 0; |
| | | const vModelIds = /* @__PURE__ */ new Set(); |
| | | ast.children.forEach(walk); |
| | | function walk(node) { |
| | | var _a; |
| | |
| | | let tag = node.tag; |
| | | if (tag.includes(".")) tag = tag.split(".")[0].trim(); |
| | | if (!CompilerDOM.parserOptions.isNativeTag(tag) && !CompilerDOM.parserOptions.isBuiltInComponent(tag)) { |
| | | ids.add(shared.camelize(tag)); |
| | | ids.add(shared.capitalize(shared.camelize(tag))); |
| | | if (ids) { |
| | | ids.add(shared.camelize(tag)); |
| | | ids.add(shared.capitalize(shared.camelize(tag))); |
| | | } |
| | | } |
| | | for (let i = 0; i < node.props.length; i++) { |
| | | const prop = node.props[i]; |
| | | if (prop.type === 7) { |
| | | if (!shared.isBuiltInDirective(prop.name)) { |
| | | ids.add(`v${shared.capitalize(shared.camelize(prop.name))}`); |
| | | if (ids) { |
| | | if (!shared.isBuiltInDirective(prop.name)) { |
| | | ids.add(`v${shared.capitalize(shared.camelize(prop.name))}`); |
| | | } |
| | | } |
| | | if (prop.arg && !prop.arg.isStatic) { |
| | | if (prop.name === "model") { |
| | | const exp = prop.exp; |
| | | if (exp && exp.type === 4) { |
| | | const expString = exp.content.trim(); |
| | | if (CompilerDOM.isSimpleIdentifier(expString) && expString !== "undefined") { |
| | | vModelIds.add(expString); |
| | | } |
| | | } |
| | | } |
| | | if (ids && prop.arg && !prop.arg.isStatic) { |
| | | extractIdentifiers(ids, prop.arg); |
| | | } |
| | | if (prop.name === "for") { |
| | | extractIdentifiers(ids, prop.forParseResult.source); |
| | | } else if (prop.exp) { |
| | | extractIdentifiers(ids, prop.exp); |
| | | } else if (prop.name === "bind" && !prop.exp) { |
| | | ids.add(shared.camelize(prop.arg.content)); |
| | | if (ids) { |
| | | if (prop.name === "for") { |
| | | extractIdentifiers(ids, prop.forParseResult.source); |
| | | } else if (prop.exp) { |
| | | extractIdentifiers(ids, prop.exp); |
| | | } else if (prop.name === "bind" && !prop.exp) { |
| | | ids.add(shared.camelize(prop.arg.content)); |
| | | } |
| | | } |
| | | } |
| | | if (prop.type === 6 && prop.name === "ref" && ((_a = prop.value) == null ? void 0 : _a.content)) { |
| | | if (ids && prop.type === 6 && prop.name === "ref" && ((_a = prop.value) == null ? void 0 : _a.content)) { |
| | | ids.add(prop.value.content); |
| | | } |
| | | } |
| | | node.children.forEach(walk); |
| | | break; |
| | | case 5: |
| | | extractIdentifiers(ids, node.content); |
| | | if (ids) extractIdentifiers(ids, node.content); |
| | | break; |
| | | } |
| | | } |
| | | templateUsageCheckCache.set(content, ids); |
| | | return ids; |
| | | const result = { usedIds: ids, vModelIds }; |
| | | templateAnalysisCache.set(content, result); |
| | | return result; |
| | | } |
| | | function extractIdentifiers(ids, node) { |
| | | if (node.ast) { |
| | |
| | | |
| | | function isRelativeUrl(url) { |
| | | const firstChar = url.charAt(0); |
| | | return firstChar === "." || firstChar === "~" || firstChar === "@"; |
| | | return firstChar === "." || firstChar === "~" || firstChar === "@" || firstChar === "#"; |
| | | } |
| | | const externalRE = /^(?:https?:)?\/\//; |
| | | function isExternalUrl(url) { |
| | |
| | | const dataUrlRE = /^\s*data:/i; |
| | | function isDataUrl(url) { |
| | | return dataUrlRE.test(url); |
| | | } |
| | | function normalizeDecodedImportPath(source) { |
| | | try { |
| | | return decodeURIComponent(source); |
| | | } catch { |
| | | return source; |
| | | } |
| | | } |
| | | function parseUrl(url) { |
| | | const firstChar = url.charAt(0); |
| | |
| | | return url.parse(shared.isString(urlString) ? urlString : "", false, true); |
| | | } |
| | | |
| | | const resourceUrlTagConfig = { |
| | | video: ["src", "poster"], |
| | | source: ["src"], |
| | | img: ["src"], |
| | | image: ["xlink:href", "href"] |
| | | }; |
| | | const defaultAssetUrlOptions = { |
| | | base: null, |
| | | includeAbsolute: false, |
| | | tags: { |
| | | video: ["src", "poster"], |
| | | source: ["src"], |
| | | img: ["src"], |
| | | image: ["xlink:href", "href"], |
| | | ...resourceUrlTagConfig, |
| | | use: ["xlink:href", "href"] |
| | | } |
| | | }; |
| | |
| | | const createAssetUrlTransformWithOptions = (options) => { |
| | | return (node, context) => transformAssetUrl(node, context, options); |
| | | }; |
| | | function canTransformHashImport(tag, attrName) { |
| | | var _a; |
| | | return !!((_a = resourceUrlTagConfig[tag]) == null ? void 0 : _a.includes(attrName)); |
| | | } |
| | | const transformAssetUrl = (node, context, options = defaultAssetUrlOptions) => { |
| | | if (node.type === 1) { |
| | | if (!node.props.length) { |
| | |
| | | } |
| | | const assetAttrs = (attrs || []).concat(wildCardAttrs || []); |
| | | node.props.forEach((attr, index) => { |
| | | if (attr.type !== 6 || !assetAttrs.includes(attr.name) || !attr.value || isExternalUrl(attr.value.content) || isDataUrl(attr.value.content) || attr.value.content[0] === "#" || !options.includeAbsolute && !isRelativeUrl(attr.value.content)) { |
| | | if (attr.type !== 6 || !assetAttrs.includes(attr.name) || !attr.value) { |
| | | return; |
| | | } |
| | | const url = parseUrl(attr.value.content); |
| | | if (options.base && attr.value.content[0] === ".") { |
| | | const urlValue = attr.value.content; |
| | | const isHashOnlyValue = urlValue[0] === "#"; |
| | | if (isExternalUrl(urlValue) || isDataUrl(urlValue) || isHashOnlyValue && !canTransformHashImport(node.tag, attr.name) || !options.includeAbsolute && !isRelativeUrl(urlValue)) { |
| | | return; |
| | | } |
| | | const url = parseUrl(urlValue); |
| | | if (options.base && urlValue[0] === ".") { |
| | | const base = parseUrl(options.base); |
| | | const protocol = base.protocol || ""; |
| | | const host = base.host ? protocol + "//" + base.host : ""; |
| | |
| | | }); |
| | | } |
| | | }; |
| | | function resolveOrRegisterImport(source, loc, context) { |
| | | const normalizedSource = normalizeDecodedImportPath(source); |
| | | const existingIndex = context.imports.findIndex( |
| | | (i) => i.path === normalizedSource |
| | | ); |
| | | if (existingIndex > -1) { |
| | | return { |
| | | name: `_imports_${existingIndex}`, |
| | | exp: context.imports[existingIndex].exp |
| | | }; |
| | | } |
| | | const name = `_imports_${context.imports.length}`; |
| | | const exp = compilerCore.createSimpleExpression( |
| | | name, |
| | | false, |
| | | loc, |
| | | 3 |
| | | ); |
| | | context.imports.push({ |
| | | exp, |
| | | path: normalizedSource |
| | | }); |
| | | return { name, exp }; |
| | | } |
| | | function getImportsExpressionExp(path2, hash, loc, context) { |
| | | if (path2) { |
| | | let name; |
| | | let exp; |
| | | const existingIndex = context.imports.findIndex((i) => i.path === path2); |
| | | if (existingIndex > -1) { |
| | | name = `_imports_${existingIndex}`; |
| | | exp = context.imports[existingIndex].exp; |
| | | } else { |
| | | name = `_imports_${context.imports.length}`; |
| | | exp = compilerCore.createSimpleExpression( |
| | | name, |
| | | false, |
| | | loc, |
| | | 3 |
| | | ); |
| | | context.imports.push({ |
| | | exp, |
| | | path: decodeURIComponent(path2) |
| | | }); |
| | | } |
| | | if (!hash) { |
| | | return exp; |
| | | } |
| | | const hashExp = `${name} + '${hash}'`; |
| | | const finalExp = compilerCore.createSimpleExpression( |
| | | hashExp, |
| | | if (!path2 && !hash) { |
| | | return compilerCore.createSimpleExpression(`''`, false, loc, 3); |
| | | } |
| | | if (!path2 && hash) { |
| | | const { exp } = resolveOrRegisterImport(hash, loc, context); |
| | | return exp; |
| | | } |
| | | if (path2 && !hash) { |
| | | const { exp } = resolveOrRegisterImport(path2, loc, context); |
| | | return exp; |
| | | } |
| | | const { name } = resolveOrRegisterImport(path2, loc, context); |
| | | const hashExp = `${name} + '${hash}'`; |
| | | const finalExp = compilerCore.createSimpleExpression( |
| | | hashExp, |
| | | false, |
| | | loc, |
| | | 3 |
| | | ); |
| | | if (!context.hoistStatic) { |
| | | return finalExp; |
| | | } |
| | | const existingHoistIndex = context.hoists.findIndex((h) => { |
| | | return h && h.type === 4 && !h.isStatic && h.content === hashExp; |
| | | }); |
| | | if (existingHoistIndex > -1) { |
| | | return compilerCore.createSimpleExpression( |
| | | `_hoisted_${existingHoistIndex + 1}`, |
| | | false, |
| | | loc, |
| | | 3 |
| | | ); |
| | | if (!context.hoistStatic) { |
| | | return finalExp; |
| | | } |
| | | const existingHoistIndex = context.hoists.findIndex((h) => { |
| | | return h && h.type === 4 && !h.isStatic && h.content === hashExp; |
| | | }); |
| | | if (existingHoistIndex > -1) { |
| | | return compilerCore.createSimpleExpression( |
| | | `_hoisted_${existingHoistIndex + 1}`, |
| | | false, |
| | | loc, |
| | | 3 |
| | | ); |
| | | } |
| | | return context.hoist(finalExp); |
| | | } else { |
| | | return compilerCore.createSimpleExpression(`''`, false, loc, 3); |
| | | } |
| | | return context.hoist(finalExp); |
| | | } |
| | | |
| | | const srcsetTags = ["img", "source"]; |
| | |
| | | const compoundExpression = compilerCore.createCompoundExpression([], attr.loc); |
| | | imageCandidates.forEach(({ url, descriptor }, index2) => { |
| | | if (shouldProcessUrl(url)) { |
| | | const { path: path2 } = parseUrl(url); |
| | | let exp2; |
| | | if (path2) { |
| | | const { path: path2, hash } = parseUrl(url); |
| | | const source = path2 ? path2 : hash; |
| | | if (source) { |
| | | const normalizedSource = normalizeDecodedImportPath(source); |
| | | const existingImportsIndex = context.imports.findIndex( |
| | | (i) => i.path === path2 |
| | | (i) => i.path === normalizedSource |
| | | ); |
| | | let exp2; |
| | | if (existingImportsIndex > -1) { |
| | | exp2 = compilerCore.createSimpleExpression( |
| | | `_imports_${existingImportsIndex}`, |
| | |
| | | attr.loc, |
| | | 3 |
| | | ); |
| | | context.imports.push({ exp: exp2, path: path2 }); |
| | | context.imports.push({ exp: exp2, path: normalizedSource }); |
| | | } |
| | | if (path2 && hash) { |
| | | exp2 = compilerCore.createSimpleExpression( |
| | | `${exp2.content} + '${hash}'`, |
| | | false, |
| | | attr.loc, |
| | | 3 |
| | | ); |
| | | } |
| | | compoundExpression.children.push(exp2); |
| | | } |
| | |
| | | function requireConsolidate$1 () { |
| | | if (hasRequiredConsolidate$1) return consolidate$2.exports; |
| | | hasRequiredConsolidate$1 = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | /* |
| | | * Engines which do not support caching of their file contents |
| | | * should use the `read()` function defined in consolidate.js |
| | |
| | | * @api public |
| | | */ |
| | | |
| | | exports.clearCache = function() { |
| | | exports$1.clearCache = function() { |
| | | readCache = {}; |
| | | cacheStore = {}; |
| | | }; |
| | |
| | | opts.partials = partials; |
| | | if (err) return cb(err); |
| | | if (cache(opts)) { |
| | | exports[name].render('', opts, cb); |
| | | exports$1[name].render('', opts, cb); |
| | | } else { |
| | | read(path, opts, function(err, str) { |
| | | if (err) return cb(err); |
| | | exports[name].render(str, opts, cb); |
| | | exports$1[name].render(str, opts, cb); |
| | | }); |
| | | } |
| | | }); |
| | |
| | | * velocity support. |
| | | */ |
| | | |
| | | exports.velocityjs = fromStringRenderer('velocityjs'); |
| | | exports$1.velocityjs = fromStringRenderer('velocityjs'); |
| | | |
| | | /** |
| | | * velocity string support. |
| | | */ |
| | | |
| | | exports.velocityjs.render = function(str, options, cb) { |
| | | exports$1.velocityjs.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.velocityjs || (requires.velocityjs = require('velocityjs')); |
| | | try { |
| | |
| | | * Liquid support. |
| | | */ |
| | | |
| | | exports.liquid = fromStringRenderer('liquid'); |
| | | exports$1.liquid = fromStringRenderer('liquid'); |
| | | |
| | | /** |
| | | * Liquid string support. |
| | |
| | | tmpl(context, cb); |
| | | } |
| | | |
| | | exports.liquid.render = function(str, options, cb) { |
| | | exports$1.liquid.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.liquid; |
| | | var Liquid; |
| | |
| | | * Jade support. |
| | | */ |
| | | |
| | | exports.jade = function(path, options, cb) { |
| | | exports$1.jade = function(path, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.jade; |
| | | if (!engine) { |
| | |
| | | * Jade string support. |
| | | */ |
| | | |
| | | exports.jade.render = function(str, options, cb) { |
| | | exports$1.jade.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.jade; |
| | | if (!engine) { |
| | |
| | | * Dust support. |
| | | */ |
| | | |
| | | exports.dust = fromStringRenderer('dust'); |
| | | exports$1.dust = fromStringRenderer('dust'); |
| | | |
| | | /** |
| | | * Dust string support. |
| | | */ |
| | | |
| | | exports.dust.render = function(str, options, cb) { |
| | | exports$1.dust.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.dust; |
| | | if (!engine) { |
| | |
| | | * Swig support. |
| | | */ |
| | | |
| | | exports.swig = fromStringRenderer('swig'); |
| | | exports$1.swig = fromStringRenderer('swig'); |
| | | |
| | | /** |
| | | * Swig string support. |
| | | */ |
| | | |
| | | exports.swig.render = function(str, options, cb) { |
| | | exports$1.swig.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.swig; |
| | | if (!engine) { |
| | |
| | | * Razor support. |
| | | */ |
| | | |
| | | exports.razor = function(path, options, cb) { |
| | | exports$1.razor = function(path, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.razor; |
| | | if (!engine) { |
| | |
| | | * razor string support. |
| | | */ |
| | | |
| | | exports.razor.render = function(str, options, cb) { |
| | | exports$1.razor.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | |
| | | try { |
| | |
| | | * Atpl support. |
| | | */ |
| | | |
| | | exports.atpl = fromStringRenderer('atpl'); |
| | | exports$1.atpl = fromStringRenderer('atpl'); |
| | | |
| | | /** |
| | | * Atpl string support. |
| | | */ |
| | | |
| | | exports.atpl.render = function(str, options, cb) { |
| | | exports$1.atpl.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.atpl || (requires.atpl = require('atpl')); |
| | | try { |
| | |
| | | * Liquor support, |
| | | */ |
| | | |
| | | exports.liquor = fromStringRenderer('liquor'); |
| | | exports$1.liquor = fromStringRenderer('liquor'); |
| | | |
| | | /** |
| | | * Liquor string support. |
| | | */ |
| | | |
| | | exports.liquor.render = function(str, options, cb) { |
| | | exports$1.liquor.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.liquor || (requires.liquor = require('liquor')); |
| | | try { |
| | |
| | | * Twig support. |
| | | */ |
| | | |
| | | exports.twig = fromStringRenderer('twig'); |
| | | exports$1.twig = fromStringRenderer('twig'); |
| | | |
| | | /** |
| | | * Twig string support. |
| | | */ |
| | | |
| | | exports.twig.render = function(str, options, cb) { |
| | | exports$1.twig.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.twig || (requires.twig = require('twig').twig); |
| | | var templateData = { |
| | |
| | | * EJS support. |
| | | */ |
| | | |
| | | exports.ejs = fromStringRenderer('ejs'); |
| | | exports$1.ejs = fromStringRenderer('ejs'); |
| | | |
| | | /** |
| | | * EJS string support. |
| | | */ |
| | | |
| | | exports.ejs.render = function(str, options, cb) { |
| | | exports$1.ejs.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.ejs || (requires.ejs = require('ejs')); |
| | | try { |
| | |
| | | * Eco support. |
| | | */ |
| | | |
| | | exports.eco = fromStringRenderer('eco'); |
| | | exports$1.eco = fromStringRenderer('eco'); |
| | | |
| | | /** |
| | | * Eco string support. |
| | | */ |
| | | |
| | | exports.eco.render = function(str, options, cb) { |
| | | exports$1.eco.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.eco || (requires.eco = require('eco')); |
| | | try { |
| | |
| | | * Jazz support. |
| | | */ |
| | | |
| | | exports.jazz = fromStringRenderer('jazz'); |
| | | exports$1.jazz = fromStringRenderer('jazz'); |
| | | |
| | | /** |
| | | * Jazz string support. |
| | | */ |
| | | |
| | | exports.jazz.render = function(str, options, cb) { |
| | | exports$1.jazz.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.jazz || (requires.jazz = require('jazz')); |
| | | try { |
| | |
| | | * JQTPL support. |
| | | */ |
| | | |
| | | exports.jqtpl = fromStringRenderer('jqtpl'); |
| | | exports$1.jqtpl = fromStringRenderer('jqtpl'); |
| | | |
| | | /** |
| | | * JQTPL string support. |
| | | */ |
| | | |
| | | exports.jqtpl.render = function(str, options, cb) { |
| | | exports$1.jqtpl.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.jqtpl || (requires.jqtpl = require('jqtpl')); |
| | | try { |
| | |
| | | * Haml support. |
| | | */ |
| | | |
| | | exports.haml = fromStringRenderer('haml'); |
| | | exports$1.haml = fromStringRenderer('haml'); |
| | | |
| | | /** |
| | | * Haml string support. |
| | | */ |
| | | |
| | | exports.haml.render = function(str, options, cb) { |
| | | exports$1.haml.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.haml || (requires.haml = require('hamljs')); |
| | | try { |
| | |
| | | * Hamlet support. |
| | | */ |
| | | |
| | | exports.hamlet = fromStringRenderer('hamlet'); |
| | | exports$1.hamlet = fromStringRenderer('hamlet'); |
| | | |
| | | /** |
| | | * Hamlet string support. |
| | | */ |
| | | |
| | | exports.hamlet.render = function(str, options, cb) { |
| | | exports$1.hamlet.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.hamlet || (requires.hamlet = require('hamlet')); |
| | | try { |
| | |
| | | * Whiskers support. |
| | | */ |
| | | |
| | | exports.whiskers = function(path, options, cb) { |
| | | exports$1.whiskers = function(path, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.whiskers || (requires.whiskers = require('whiskers')); |
| | | engine.__express(path, options, cb); |
| | |
| | | * Whiskers string support. |
| | | */ |
| | | |
| | | exports.whiskers.render = function(str, options, cb) { |
| | | exports$1.whiskers.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.whiskers || (requires.whiskers = require('whiskers')); |
| | | try { |
| | |
| | | * Coffee-HAML support. |
| | | */ |
| | | |
| | | exports['haml-coffee'] = fromStringRenderer('haml-coffee'); |
| | | exports$1['haml-coffee'] = fromStringRenderer('haml-coffee'); |
| | | |
| | | /** |
| | | * Coffee-HAML string support. |
| | | */ |
| | | |
| | | exports['haml-coffee'].render = function(str, options, cb) { |
| | | exports$1['haml-coffee'].render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires['haml-coffee'] || (requires['haml-coffee'] = require('haml-coffee')); |
| | | try { |
| | |
| | | * Hogan support. |
| | | */ |
| | | |
| | | exports.hogan = fromStringRenderer('hogan'); |
| | | exports$1.hogan = fromStringRenderer('hogan'); |
| | | |
| | | /** |
| | | * Hogan string support. |
| | | */ |
| | | |
| | | exports.hogan.render = function(str, options, cb) { |
| | | exports$1.hogan.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.hogan || (requires.hogan = require('hogan.js')); |
| | | try { |
| | |
| | | * templayed.js support. |
| | | */ |
| | | |
| | | exports.templayed = fromStringRenderer('templayed'); |
| | | exports$1.templayed = fromStringRenderer('templayed'); |
| | | |
| | | /** |
| | | * templayed.js string support. |
| | | */ |
| | | |
| | | exports.templayed.render = function(str, options, cb) { |
| | | exports$1.templayed.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.templayed || (requires.templayed = require('templayed')); |
| | | try { |
| | |
| | | * Handlebars support. |
| | | */ |
| | | |
| | | exports.handlebars = fromStringRenderer('handlebars'); |
| | | exports$1.handlebars = fromStringRenderer('handlebars'); |
| | | |
| | | /** |
| | | * Handlebars string support. |
| | | */ |
| | | |
| | | exports.handlebars.render = function(str, options, cb) { |
| | | exports$1.handlebars.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.handlebars || (requires.handlebars = require('handlebars')); |
| | | try { |
| | |
| | | * Underscore support. |
| | | */ |
| | | |
| | | exports.underscore = fromStringRenderer('underscore'); |
| | | exports$1.underscore = fromStringRenderer('underscore'); |
| | | |
| | | /** |
| | | * Underscore string support. |
| | | */ |
| | | |
| | | exports.underscore.render = function(str, options, cb) { |
| | | exports$1.underscore.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.underscore || (requires.underscore = require('underscore')); |
| | | try { |
| | |
| | | * Lodash support. |
| | | */ |
| | | |
| | | exports.lodash = fromStringRenderer('lodash'); |
| | | exports$1.lodash = fromStringRenderer('lodash'); |
| | | |
| | | /** |
| | | * Lodash string support. |
| | | */ |
| | | |
| | | exports.lodash.render = function(str, options, cb) { |
| | | exports$1.lodash.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.lodash || (requires.lodash = require('lodash')); |
| | | try { |
| | |
| | | * Pug support. (formerly Jade) |
| | | */ |
| | | |
| | | exports.pug = function(path, options, cb) { |
| | | exports$1.pug = function(path, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.pug; |
| | | if (!engine) { |
| | |
| | | * Pug string support. |
| | | */ |
| | | |
| | | exports.pug.render = function(str, options, cb) { |
| | | exports$1.pug.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.pug; |
| | | if (!engine) { |
| | |
| | | * QEJS support. |
| | | */ |
| | | |
| | | exports.qejs = fromStringRenderer('qejs'); |
| | | exports$1.qejs = fromStringRenderer('qejs'); |
| | | |
| | | /** |
| | | * QEJS string support. |
| | | */ |
| | | |
| | | exports.qejs.render = function(str, options, cb) { |
| | | exports$1.qejs.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | try { |
| | | var engine = requires.qejs || (requires.qejs = require('qejs')); |
| | |
| | | * Walrus support. |
| | | */ |
| | | |
| | | exports.walrus = fromStringRenderer('walrus'); |
| | | exports$1.walrus = fromStringRenderer('walrus'); |
| | | |
| | | /** |
| | | * Walrus string support. |
| | | */ |
| | | |
| | | exports.walrus.render = function(str, options, cb) { |
| | | exports$1.walrus.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.walrus || (requires.walrus = require('walrus')); |
| | | try { |
| | |
| | | * Mustache support. |
| | | */ |
| | | |
| | | exports.mustache = fromStringRenderer('mustache'); |
| | | exports$1.mustache = fromStringRenderer('mustache'); |
| | | |
| | | /** |
| | | * Mustache string support. |
| | | */ |
| | | |
| | | exports.mustache.render = function(str, options, cb) { |
| | | exports$1.mustache.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.mustache || (requires.mustache = require('mustache')); |
| | | try { |
| | |
| | | * Just support. |
| | | */ |
| | | |
| | | exports.just = function(path, options, cb) { |
| | | exports$1.just = function(path, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.just; |
| | | if (!engine) { |
| | |
| | | * Just string support. |
| | | */ |
| | | |
| | | exports.just.render = function(str, options, cb) { |
| | | exports$1.just.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var JUST = require('just'); |
| | | var engine = new JUST({ root: { page: str }}); |
| | |
| | | * ECT support. |
| | | */ |
| | | |
| | | exports.ect = function(path, options, cb) { |
| | | exports$1.ect = function(path, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.ect; |
| | | if (!engine) { |
| | |
| | | * ECT string support. |
| | | */ |
| | | |
| | | exports.ect.render = function(str, options, cb) { |
| | | exports$1.ect.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var ECT = require('ect'); |
| | | var engine = new ECT({ root: { page: str }}); |
| | |
| | | * mote support. |
| | | */ |
| | | |
| | | exports.mote = fromStringRenderer('mote'); |
| | | exports$1.mote = fromStringRenderer('mote'); |
| | | |
| | | /** |
| | | * mote string support. |
| | | */ |
| | | |
| | | exports.mote.render = function(str, options, cb) { |
| | | exports$1.mote.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.mote || (requires.mote = require('mote')); |
| | | try { |
| | |
| | | * Toffee support. |
| | | */ |
| | | |
| | | exports.toffee = function(path, options, cb) { |
| | | exports$1.toffee = function(path, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var toffee = requires.toffee || (requires.toffee = require('toffee')); |
| | | toffee.__consolidate_engine_render(path, options, cb); |
| | |
| | | * Toffee string support. |
| | | */ |
| | | |
| | | exports.toffee.render = function(str, options, cb) { |
| | | exports$1.toffee.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.toffee || (requires.toffee = require('toffee')); |
| | | try { |
| | |
| | | * doT support. |
| | | */ |
| | | |
| | | exports.dot = fromStringRenderer('dot'); |
| | | exports$1.dot = fromStringRenderer('dot'); |
| | | |
| | | /** |
| | | * doT string support. |
| | | */ |
| | | |
| | | exports.dot.render = function(str, options, cb) { |
| | | exports$1.dot.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.dot || (requires.dot = require('dot')); |
| | | var extend = (requires.extend || (requires.extend = require$$2._extend)); |
| | |
| | | * bracket support. |
| | | */ |
| | | |
| | | exports.bracket = fromStringRenderer('bracket'); |
| | | exports$1.bracket = fromStringRenderer('bracket'); |
| | | |
| | | /** |
| | | * bracket string support. |
| | | */ |
| | | |
| | | exports.bracket.render = function(str, options, cb) { |
| | | exports$1.bracket.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.bracket || (requires.bracket = require('bracket-template')); |
| | | try { |
| | |
| | | * Ractive support. |
| | | */ |
| | | |
| | | exports.ractive = fromStringRenderer('ractive'); |
| | | exports$1.ractive = fromStringRenderer('ractive'); |
| | | |
| | | /** |
| | | * Ractive string support. |
| | | */ |
| | | |
| | | exports.ractive.render = function(str, options, cb) { |
| | | exports$1.ractive.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var Engine = requires.ractive || (requires.ractive = require('ractive')); |
| | | |
| | |
| | | * Nunjucks support. |
| | | */ |
| | | |
| | | exports.nunjucks = fromStringRenderer('nunjucks'); |
| | | exports$1.nunjucks = fromStringRenderer('nunjucks'); |
| | | |
| | | /** |
| | | * Nunjucks string support. |
| | | */ |
| | | |
| | | exports.nunjucks.render = function(str, options, cb) { |
| | | exports$1.nunjucks.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | |
| | | try { |
| | |
| | | * HTMLing support. |
| | | */ |
| | | |
| | | exports.htmling = fromStringRenderer('htmling'); |
| | | exports$1.htmling = fromStringRenderer('htmling'); |
| | | |
| | | /** |
| | | * HTMLing string support. |
| | | */ |
| | | |
| | | exports.htmling.render = function(str, options, cb) { |
| | | exports$1.htmling.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.htmling || (requires.htmling = require('htmling')); |
| | | try { |
| | |
| | | return module._compile(compiled, filename); |
| | | } |
| | | |
| | | exports.requireReact = requireReact; |
| | | exports$1.requireReact = requireReact; |
| | | |
| | | /** |
| | | * Converting a string into a node module. |
| | |
| | | * Plates Support. |
| | | */ |
| | | |
| | | exports.plates = fromStringRenderer('plates'); |
| | | exports$1.plates = fromStringRenderer('plates'); |
| | | |
| | | /** |
| | | * Plates string support. |
| | | */ |
| | | |
| | | exports.plates.render = function(str, options, cb) { |
| | | exports$1.plates.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.plates || (requires.plates = require('plates')); |
| | | var map = options.map || undefined; |
| | |
| | | /** |
| | | * React JS Support |
| | | */ |
| | | exports.react = reactRenderer('path'); |
| | | exports$1.react = reactRenderer('path'); |
| | | |
| | | /** |
| | | * React JS string support. |
| | | */ |
| | | exports.react.render = reactRenderer('string'); |
| | | exports$1.react.render = reactRenderer('string'); |
| | | |
| | | /** |
| | | * ARC-templates support. |
| | | */ |
| | | |
| | | exports['arc-templates'] = fromStringRenderer('arc-templates'); |
| | | exports$1['arc-templates'] = fromStringRenderer('arc-templates'); |
| | | |
| | | /** |
| | | * ARC-templates string support. |
| | | */ |
| | | |
| | | exports['arc-templates'].render = function(str, options, cb) { |
| | | exports$1['arc-templates'].render = function(str, options, cb) { |
| | | var readFileWithOptions = util.promisify(read); |
| | | var consolidateFileSystem = {}; |
| | | consolidateFileSystem.readFile = function(path) { |
| | |
| | | /** |
| | | * Vash support |
| | | */ |
| | | exports.vash = fromStringRenderer('vash'); |
| | | exports$1.vash = fromStringRenderer('vash'); |
| | | |
| | | /** |
| | | * Vash string support |
| | | */ |
| | | exports.vash.render = function(str, options, cb) { |
| | | exports$1.vash.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.vash || (requires.vash = require('vash')); |
| | | |
| | |
| | | * Slm support. |
| | | */ |
| | | |
| | | exports.slm = fromStringRenderer('slm'); |
| | | exports$1.slm = fromStringRenderer('slm'); |
| | | |
| | | /** |
| | | * Slm string support. |
| | | */ |
| | | |
| | | exports.slm.render = function(str, options, cb) { |
| | | exports$1.slm.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.slm || (requires.slm = require('slm')); |
| | | |
| | |
| | | * Marko support. |
| | | */ |
| | | |
| | | exports.marko = function(path, options, cb) { |
| | | exports$1.marko = function(path, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.marko || (requires.marko = require('marko')); |
| | | options.writeToDisk = !!options.cache; |
| | |
| | | * Marko string support. |
| | | */ |
| | | |
| | | exports.marko.render = function(str, options, cb) { |
| | | exports$1.marko.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.marko || (requires.marko = require('marko')); |
| | | options.writeToDisk = !!options.cache; |
| | |
| | | /** |
| | | * Teacup support. |
| | | */ |
| | | exports.teacup = function(path, options, cb) { |
| | | exports$1.teacup = function(path, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.teacup || (requires.teacup = require('teacup/lib/express')); |
| | | commonjsRequire.extensions['.teacup'] = commonjsRequire.extensions['.coffee']; |
| | |
| | | /** |
| | | * Teacup string support. |
| | | */ |
| | | exports.teacup.render = function(str, options, cb) { |
| | | exports$1.teacup.render = function(str, options, cb) { |
| | | var coffee = require('coffee-script'); |
| | | var vm = require('vm'); |
| | | var sandbox = { |
| | |
| | | * Squirrelly support. |
| | | */ |
| | | |
| | | exports.squirrelly = fromStringRenderer('squirrelly'); |
| | | exports$1.squirrelly = fromStringRenderer('squirrelly'); |
| | | |
| | | /** |
| | | * Squirrelly string support. |
| | | */ |
| | | |
| | | exports.squirrelly.render = function(str, options, cb) { |
| | | exports$1.squirrelly.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.squirrelly || (requires.squirrelly = require('squirrelly')); |
| | | try { |
| | |
| | | * Twing support. |
| | | */ |
| | | |
| | | exports.twing = fromStringRenderer('twing'); |
| | | exports$1.twing = fromStringRenderer('twing'); |
| | | |
| | | /** |
| | | * Twing string support. |
| | | */ |
| | | |
| | | exports.twing.render = function(str, options, cb) { |
| | | exports$1.twing.render = function(str, options, cb) { |
| | | return promisify(cb, function(cb) { |
| | | var engine = requires.twing || (requires.twing = require('twing')); |
| | | try { |
| | |
| | | /** |
| | | * expose the instance of the engine |
| | | */ |
| | | exports.requires = requires; |
| | | exports$1.requires = requires; |
| | | } (consolidate$2, consolidate$2.exports)); |
| | | return consolidate$2.exports; |
| | | } |
| | |
| | | function requireUnesc$1 () { |
| | | if (hasRequiredUnesc$1) return unesc$1.exports; |
| | | hasRequiredUnesc$1 = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = unesc; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = unesc; |
| | | // Many thanks for this post which made this migration much easier. |
| | | // https://mathiasbynens.be/notes/css-escapes |
| | | |
| | |
| | | } |
| | | return ret; |
| | | } |
| | | module.exports = exports.default; |
| | | module.exports = exports$1.default; |
| | | } (unesc$1, unesc$1.exports)); |
| | | return unesc$1.exports; |
| | | } |
| | |
| | | function requireGetProp$1 () { |
| | | if (hasRequiredGetProp$1) return getProp$1.exports; |
| | | hasRequiredGetProp$1 = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = getProp; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = getProp; |
| | | function getProp(obj) { |
| | | for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { |
| | | props[_key - 1] = arguments[_key]; |
| | |
| | | } |
| | | return obj; |
| | | } |
| | | module.exports = exports.default; |
| | | module.exports = exports$1.default; |
| | | } (getProp$1, getProp$1.exports)); |
| | | return getProp$1.exports; |
| | | } |
| | |
| | | function requireEnsureObject$1 () { |
| | | if (hasRequiredEnsureObject$1) return ensureObject$1.exports; |
| | | hasRequiredEnsureObject$1 = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = ensureObject; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = ensureObject; |
| | | function ensureObject(obj) { |
| | | for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { |
| | | props[_key - 1] = arguments[_key]; |
| | |
| | | obj = obj[prop]; |
| | | } |
| | | } |
| | | module.exports = exports.default; |
| | | module.exports = exports$1.default; |
| | | } (ensureObject$1, ensureObject$1.exports)); |
| | | return ensureObject$1.exports; |
| | | } |
| | |
| | | function requireStripComments$1 () { |
| | | if (hasRequiredStripComments$1) return stripComments$1.exports; |
| | | hasRequiredStripComments$1 = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = stripComments; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = stripComments; |
| | | function stripComments(str) { |
| | | var s = ""; |
| | | var commentStart = str.indexOf("/*"); |
| | |
| | | s = s + str.slice(lastEnd); |
| | | return s; |
| | | } |
| | | module.exports = exports.default; |
| | | module.exports = exports$1.default; |
| | | } (stripComments$1, stripComments$1.exports)); |
| | | return stripComments$1.exports; |
| | | } |
| | |
| | | function requireNode$2 () { |
| | | if (hasRequiredNode$2) return node$2.exports; |
| | | hasRequiredNode$2 = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | var _util = /*@__PURE__*/ requireUtil$2(); |
| | | function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } |
| | | function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } |
| | |
| | | }]); |
| | | return Node; |
| | | }(); |
| | | exports["default"] = Node; |
| | | module.exports = exports.default; |
| | | exports$1["default"] = Node; |
| | | module.exports = exports$1.default; |
| | | } (node$2, node$2.exports)); |
| | | return node$2.exports; |
| | | } |
| | |
| | | function requireContainer$1 () { |
| | | if (hasRequiredContainer$1) return container$1.exports; |
| | | hasRequiredContainer$1 = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | var _node = _interopRequireDefault(/*@__PURE__*/ requireNode$2()); |
| | | var types = _interopRequireWildcard(/*@__PURE__*/ requireTypes$1()); |
| | | function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } |
| | |
| | | }]); |
| | | return Container; |
| | | }(_node["default"]); |
| | | exports["default"] = Container; |
| | | module.exports = exports.default; |
| | | exports$1["default"] = Container; |
| | | module.exports = exports$1.default; |
| | | } (container$1, container$1.exports)); |
| | | return container$1.exports; |
| | | } |
| | |
| | | function requireRoot$1 () { |
| | | if (hasRequiredRoot$1) return root$1.exports; |
| | | hasRequiredRoot$1 = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | var _container = _interopRequireDefault(/*@__PURE__*/ requireContainer$1()); |
| | | var _types = /*@__PURE__*/ requireTypes$1(); |
| | | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } |
| | |
| | | }]); |
| | | return Root; |
| | | }(_container["default"]); |
| | | exports["default"] = Root; |
| | | module.exports = exports.default; |
| | | exports$1["default"] = Root; |
| | | module.exports = exports$1.default; |
| | | } (root$1, root$1.exports)); |
| | | return root$1.exports; |
| | | } |
| | |
| | | function requireSelector$1 () { |
| | | if (hasRequiredSelector$1) return selector$1.exports; |
| | | hasRequiredSelector$1 = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | var _container = _interopRequireDefault(/*@__PURE__*/ requireContainer$1()); |
| | | var _types = /*@__PURE__*/ requireTypes$1(); |
| | | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } |
| | |
| | | } |
| | | return Selector; |
| | | }(_container["default"]); |
| | | exports["default"] = Selector; |
| | | module.exports = exports.default; |
| | | exports$1["default"] = Selector; |
| | | module.exports = exports$1.default; |
| | | } (selector$1, selector$1.exports)); |
| | | return selector$1.exports; |
| | | } |
| | |
| | | function requireClassName$1 () { |
| | | if (hasRequiredClassName$1) return className$1.exports; |
| | | hasRequiredClassName$1 = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | var _cssesc = _interopRequireDefault(/*@__PURE__*/ requireCssesc()); |
| | | var _util = /*@__PURE__*/ requireUtil$2(); |
| | | var _node = _interopRequireDefault(/*@__PURE__*/ requireNode$2()); |
| | |
| | | }]); |
| | | return ClassName; |
| | | }(_node["default"]); |
| | | exports["default"] = ClassName; |
| | | module.exports = exports.default; |
| | | exports$1["default"] = ClassName; |
| | | module.exports = exports$1.default; |
| | | } (className$1, className$1.exports)); |
| | | return className$1.exports; |
| | | } |
| | |
| | | function requireComment$1 () { |
| | | if (hasRequiredComment$1) return comment$1.exports; |
| | | hasRequiredComment$1 = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | var _node = _interopRequireDefault(/*@__PURE__*/ requireNode$2()); |
| | | var _types = /*@__PURE__*/ requireTypes$1(); |
| | | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } |
| | |
| | | } |
| | | return Comment; |
| | | }(_node["default"]); |
| | | exports["default"] = Comment; |
| | | module.exports = exports.default; |
| | | exports$1["default"] = Comment; |
| | | module.exports = exports$1.default; |
| | | } (comment$1, comment$1.exports)); |
| | | return comment$1.exports; |
| | | } |
| | |
| | | function requireId$1 () { |
| | | if (hasRequiredId$1) return id$1.exports; |
| | | hasRequiredId$1 = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | var _node = _interopRequireDefault(/*@__PURE__*/ requireNode$2()); |
| | | var _types = /*@__PURE__*/ requireTypes$1(); |
| | | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } |
| | |
| | | }; |
| | | return ID; |
| | | }(_node["default"]); |
| | | exports["default"] = ID; |
| | | module.exports = exports.default; |
| | | exports$1["default"] = ID; |
| | | module.exports = exports$1.default; |
| | | } (id$1, id$1.exports)); |
| | | return id$1.exports; |
| | | } |
| | |
| | | function requireNamespace$1 () { |
| | | if (hasRequiredNamespace$1) return namespace$1.exports; |
| | | hasRequiredNamespace$1 = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | var _cssesc = _interopRequireDefault(/*@__PURE__*/ requireCssesc()); |
| | | var _util = /*@__PURE__*/ requireUtil$2(); |
| | | var _node = _interopRequireDefault(/*@__PURE__*/ requireNode$2()); |
| | |
| | | }]); |
| | | return Namespace; |
| | | }(_node["default"]); |
| | | exports["default"] = Namespace; |
| | | module.exports = exports.default; |
| | | exports$1["default"] = Namespace; |
| | | module.exports = exports$1.default; |
| | | } (namespace$1, namespace$1.exports)); |
| | | return namespace$1.exports; |
| | | } |
| | |
| | | function requireTag$1 () { |
| | | if (hasRequiredTag$1) return tag$1.exports; |
| | | hasRequiredTag$1 = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | var _namespace = _interopRequireDefault(/*@__PURE__*/ requireNamespace$1()); |
| | | var _types = /*@__PURE__*/ requireTypes$1(); |
| | | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } |
| | |
| | | } |
| | | return Tag; |
| | | }(_namespace["default"]); |
| | | exports["default"] = Tag; |
| | | module.exports = exports.default; |
| | | exports$1["default"] = Tag; |
| | | module.exports = exports$1.default; |
| | | } (tag$1, tag$1.exports)); |
| | | return tag$1.exports; |
| | | } |
| | |
| | | function requireString$1 () { |
| | | if (hasRequiredString$1) return string$1.exports; |
| | | hasRequiredString$1 = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | var _node = _interopRequireDefault(/*@__PURE__*/ requireNode$2()); |
| | | var _types = /*@__PURE__*/ requireTypes$1(); |
| | | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } |
| | |
| | | } |
| | | return String; |
| | | }(_node["default"]); |
| | | exports["default"] = String; |
| | | module.exports = exports.default; |
| | | exports$1["default"] = String; |
| | | module.exports = exports$1.default; |
| | | } (string$1, string$1.exports)); |
| | | return string$1.exports; |
| | | } |
| | |
| | | function requirePseudo$1 () { |
| | | if (hasRequiredPseudo$1) return pseudo$1.exports; |
| | | hasRequiredPseudo$1 = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | var _container = _interopRequireDefault(/*@__PURE__*/ requireContainer$1()); |
| | | var _types = /*@__PURE__*/ requireTypes$1(); |
| | | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } |
| | |
| | | }; |
| | | return Pseudo; |
| | | }(_container["default"]); |
| | | exports["default"] = Pseudo; |
| | | module.exports = exports.default; |
| | | exports$1["default"] = Pseudo; |
| | | module.exports = exports$1.default; |
| | | } (pseudo$1, pseudo$1.exports)); |
| | | return pseudo$1.exports; |
| | | } |
| | |
| | | function requireAttribute$1 () { |
| | | if (hasRequiredAttribute$1) return attribute$1; |
| | | hasRequiredAttribute$1 = 1; |
| | | (function (exports) { |
| | | (function (exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports.unescapeValue = unescapeValue; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | exports$1.unescapeValue = unescapeValue; |
| | | var _cssesc = _interopRequireDefault(/*@__PURE__*/ requireCssesc()); |
| | | var _unesc = _interopRequireDefault(/*@__PURE__*/ requireUnesc$1()); |
| | | var _namespace = _interopRequireDefault(/*@__PURE__*/ requireNamespace$1()); |
| | |
| | | }]); |
| | | return Attribute; |
| | | }(_namespace["default"]); |
| | | exports["default"] = Attribute; |
| | | exports$1["default"] = Attribute; |
| | | Attribute.NO_QUOTE = null; |
| | | Attribute.SINGLE_QUOTE = "'"; |
| | | Attribute.DOUBLE_QUOTE = '"'; |
| | |
| | | function requireUniversal$1 () { |
| | | if (hasRequiredUniversal$1) return universal$1.exports; |
| | | hasRequiredUniversal$1 = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | var _namespace = _interopRequireDefault(/*@__PURE__*/ requireNamespace$1()); |
| | | var _types = /*@__PURE__*/ requireTypes$1(); |
| | | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } |
| | |
| | | } |
| | | return Universal; |
| | | }(_namespace["default"]); |
| | | exports["default"] = Universal; |
| | | module.exports = exports.default; |
| | | exports$1["default"] = Universal; |
| | | module.exports = exports$1.default; |
| | | } (universal$1, universal$1.exports)); |
| | | return universal$1.exports; |
| | | } |
| | |
| | | function requireCombinator$1 () { |
| | | if (hasRequiredCombinator$1) return combinator$1.exports; |
| | | hasRequiredCombinator$1 = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | var _node = _interopRequireDefault(/*@__PURE__*/ requireNode$2()); |
| | | var _types = /*@__PURE__*/ requireTypes$1(); |
| | | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } |
| | |
| | | } |
| | | return Combinator; |
| | | }(_node["default"]); |
| | | exports["default"] = Combinator; |
| | | module.exports = exports.default; |
| | | exports$1["default"] = Combinator; |
| | | module.exports = exports$1.default; |
| | | } (combinator$1, combinator$1.exports)); |
| | | return combinator$1.exports; |
| | | } |
| | |
| | | function requireNesting$1 () { |
| | | if (hasRequiredNesting$1) return nesting$1.exports; |
| | | hasRequiredNesting$1 = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | var _node = _interopRequireDefault(/*@__PURE__*/ requireNode$2()); |
| | | var _types = /*@__PURE__*/ requireTypes$1(); |
| | | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } |
| | |
| | | } |
| | | return Nesting; |
| | | }(_node["default"]); |
| | | exports["default"] = Nesting; |
| | | module.exports = exports.default; |
| | | exports$1["default"] = Nesting; |
| | | module.exports = exports$1.default; |
| | | } (nesting$1, nesting$1.exports)); |
| | | return nesting$1.exports; |
| | | } |
| | |
| | | function requireSortAscending$1 () { |
| | | if (hasRequiredSortAscending$1) return sortAscending$1.exports; |
| | | hasRequiredSortAscending$1 = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = sortAscending; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = sortAscending; |
| | | function sortAscending(list) { |
| | | return list.sort(function (a, b) { |
| | | return a - b; |
| | | }); |
| | | } |
| | | module.exports = exports.default; |
| | | module.exports = exports$1.default; |
| | | } (sortAscending$1, sortAscending$1.exports)); |
| | | return sortAscending$1.exports; |
| | | } |
| | |
| | | function requireTokenize$1 () { |
| | | if (hasRequiredTokenize$1) return tokenize$1; |
| | | hasRequiredTokenize$1 = 1; |
| | | (function (exports) { |
| | | (function (exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports.FIELDS = void 0; |
| | | exports["default"] = tokenize; |
| | | exports$1.__esModule = true; |
| | | exports$1.FIELDS = void 0; |
| | | exports$1["default"] = tokenize; |
| | | var t = _interopRequireWildcard(/*@__PURE__*/ requireTokenTypes$1()); |
| | | var _unescapable, _wordDelimiters; |
| | | function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } |
| | |
| | | START_POS: 5, |
| | | END_POS: 6 |
| | | }; |
| | | exports.FIELDS = FIELDS; |
| | | exports$1.FIELDS = FIELDS; |
| | | function tokenize(input) { |
| | | var tokens = []; |
| | | var css = input.css.valueOf(); |
| | |
| | | function requireParser$2 () { |
| | | if (hasRequiredParser$2) return parser$1.exports; |
| | | hasRequiredParser$2 = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | var _root = _interopRequireDefault(/*@__PURE__*/ requireRoot$1()); |
| | | var _selector = _interopRequireDefault(/*@__PURE__*/ requireSelector$1()); |
| | | var _className = _interopRequireDefault(/*@__PURE__*/ requireClassName$1()); |
| | |
| | | if (_space2.endsWith(' ') && _rawSpace2.endsWith(' ')) { |
| | | spaces.before = _space2.slice(0, _space2.length - 1); |
| | | raws.spaces.before = _rawSpace2.slice(0, _rawSpace2.length - 1); |
| | | } else if (_space2.startsWith(' ') && _rawSpace2.startsWith(' ')) { |
| | | } else if (_space2[0] === ' ' && _rawSpace2[0] === ' ') { |
| | | spaces.after = _space2.slice(1); |
| | | raws.spaces.after = _rawSpace2.slice(1); |
| | | } else { |
| | |
| | | }]); |
| | | return Parser; |
| | | }(); |
| | | exports["default"] = Parser; |
| | | module.exports = exports.default; |
| | | exports$1["default"] = Parser; |
| | | module.exports = exports$1.default; |
| | | } (parser$1, parser$1.exports)); |
| | | return parser$1.exports; |
| | | } |
| | |
| | | function requireProcessor$1 () { |
| | | if (hasRequiredProcessor$1) return processor$1.exports; |
| | | hasRequiredProcessor$1 = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | var _parser = _interopRequireDefault(/*@__PURE__*/ requireParser$2()); |
| | | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } |
| | | var Processor = /*#__PURE__*/function () { |
| | |
| | | }; |
| | | return Processor; |
| | | }(); |
| | | exports["default"] = Processor; |
| | | module.exports = exports.default; |
| | | exports$1["default"] = Processor; |
| | | module.exports = exports$1.default; |
| | | } (processor$1, processor$1.exports)); |
| | | return processor$1.exports; |
| | | } |
| | |
| | | function requireSelectors$1 () { |
| | | if (hasRequiredSelectors$1) return selectors$1; |
| | | hasRequiredSelectors$1 = 1; |
| | | (function (exports) { |
| | | (function (exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports$1.__esModule = true; |
| | | var _types = /*@__PURE__*/ requireTypes$1(); |
| | | Object.keys(_types).forEach(function (key) { |
| | | if (key === "default" || key === "__esModule") return; |
| | | if (key in exports && exports[key] === _types[key]) return; |
| | | exports[key] = _types[key]; |
| | | if (key in exports$1 && exports$1[key] === _types[key]) return; |
| | | exports$1[key] = _types[key]; |
| | | }); |
| | | var _constructors = /*@__PURE__*/ requireConstructors$1(); |
| | | Object.keys(_constructors).forEach(function (key) { |
| | | if (key === "default" || key === "__esModule") return; |
| | | if (key in exports && exports[key] === _constructors[key]) return; |
| | | exports[key] = _constructors[key]; |
| | | if (key in exports$1 && exports$1[key] === _constructors[key]) return; |
| | | exports$1[key] = _constructors[key]; |
| | | }); |
| | | var _guards = /*@__PURE__*/ requireGuards$1(); |
| | | Object.keys(_guards).forEach(function (key) { |
| | | if (key === "default" || key === "__esModule") return; |
| | | if (key in exports && exports[key] === _guards[key]) return; |
| | | exports[key] = _guards[key]; |
| | | if (key in exports$1 && exports$1[key] === _guards[key]) return; |
| | | exports$1[key] = _guards[key]; |
| | | }); |
| | | } (selectors$1)); |
| | | return selectors$1; |
| | |
| | | function requireDist$1 () { |
| | | if (hasRequiredDist$1) return dist$1.exports; |
| | | hasRequiredDist$1 = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | var _processor = _interopRequireDefault(/*@__PURE__*/ requireProcessor$1()); |
| | | var selectors = _interopRequireWildcard(/*@__PURE__*/ requireSelectors$1()); |
| | | function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } |
| | |
| | | Object.assign(parser, selectors); |
| | | delete parser.__esModule; |
| | | var _default = parser; |
| | | exports["default"] = _default; |
| | | module.exports = exports.default; |
| | | exports$1["default"] = _default; |
| | | module.exports = exports$1.default; |
| | | } (dist$1, dist$1.exports)); |
| | | return dist$1.exports; |
| | | } |
| | |
| | | function requireUtil$1 () { |
| | | if (hasRequiredUtil$1) return util$1; |
| | | hasRequiredUtil$1 = 1; |
| | | (function (exports) { |
| | | (function (exports$1) { |
| | | /* |
| | | * Copyright 2011 Mozilla Foundation and contributors |
| | | * Licensed under the New BSD license. See LICENSE or: |
| | |
| | | throw new Error('"' + aName + '" is a required argument.'); |
| | | } |
| | | } |
| | | exports.getArg = getArg; |
| | | exports$1.getArg = getArg; |
| | | |
| | | var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; |
| | | var dataUrlRegexp = /^data:.+\,.+$/; |
| | |
| | | path: match[5] |
| | | }; |
| | | } |
| | | exports.urlParse = urlParse; |
| | | exports$1.urlParse = urlParse; |
| | | |
| | | function urlGenerate(aParsedUrl) { |
| | | var url = ''; |
| | |
| | | } |
| | | return url; |
| | | } |
| | | exports.urlGenerate = urlGenerate; |
| | | exports$1.urlGenerate = urlGenerate; |
| | | |
| | | /** |
| | | * Normalizes a path, or the path portion of a URL: |
| | |
| | | } |
| | | path = url.path; |
| | | } |
| | | var isAbsolute = exports.isAbsolute(path); |
| | | var isAbsolute = exports$1.isAbsolute(path); |
| | | |
| | | var parts = path.split(/\/+/); |
| | | for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { |
| | |
| | | } |
| | | return path; |
| | | } |
| | | exports.normalize = normalize; |
| | | exports$1.normalize = normalize; |
| | | |
| | | /** |
| | | * Joins two paths/URLs. |
| | |
| | | } |
| | | return joined; |
| | | } |
| | | exports.join = join; |
| | | exports$1.join = join; |
| | | |
| | | exports.isAbsolute = function (aPath) { |
| | | exports$1.isAbsolute = function (aPath) { |
| | | return aPath.charAt(0) === '/' || urlRegexp.test(aPath); |
| | | }; |
| | | |
| | |
| | | // Make sure we add a "../" for each component we removed from the root. |
| | | return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); |
| | | } |
| | | exports.relative = relative; |
| | | exports$1.relative = relative; |
| | | |
| | | var supportsNullProto = (function () { |
| | | var obj = Object.create(null); |
| | |
| | | |
| | | return aStr; |
| | | } |
| | | exports.toSetString = supportsNullProto ? identity : toSetString; |
| | | exports$1.toSetString = supportsNullProto ? identity : toSetString; |
| | | |
| | | function fromSetString(aStr) { |
| | | if (isProtoString(aStr)) { |
| | |
| | | |
| | | return aStr; |
| | | } |
| | | exports.fromSetString = supportsNullProto ? identity : fromSetString; |
| | | exports$1.fromSetString = supportsNullProto ? identity : fromSetString; |
| | | |
| | | function isProtoString(s) { |
| | | if (!s) { |
| | |
| | | |
| | | return strcmp(mappingA.name, mappingB.name); |
| | | } |
| | | exports.compareByOriginalPositions = compareByOriginalPositions; |
| | | exports$1.compareByOriginalPositions = compareByOriginalPositions; |
| | | |
| | | /** |
| | | * Comparator between two mappings with deflated source and name indices where |
| | |
| | | |
| | | return strcmp(mappingA.name, mappingB.name); |
| | | } |
| | | exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; |
| | | exports$1.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; |
| | | |
| | | function strcmp(aStr1, aStr2) { |
| | | if (aStr1 === aStr2) { |
| | |
| | | |
| | | return strcmp(mappingA.name, mappingB.name); |
| | | } |
| | | exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; |
| | | exports$1.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; |
| | | |
| | | /** |
| | | * Strip any JSON XSSI avoidance prefix from the string (as documented |
| | |
| | | function parseSourceMapInput(str) { |
| | | return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); |
| | | } |
| | | exports.parseSourceMapInput = parseSourceMapInput; |
| | | exports$1.parseSourceMapInput = parseSourceMapInput; |
| | | |
| | | /** |
| | | * Compute the URL of a source given the the source root, the source's |
| | |
| | | |
| | | return normalize(sourceURL); |
| | | } |
| | | exports.computeSourceURL = computeSourceURL; |
| | | exports$1.computeSourceURL = computeSourceURL; |
| | | } (util$1)); |
| | | return util$1; |
| | | } |
| | |
| | | function requireBinarySearch () { |
| | | if (hasRequiredBinarySearch) return binarySearch; |
| | | hasRequiredBinarySearch = 1; |
| | | (function (exports) { |
| | | (function (exports$1) { |
| | | /* |
| | | * Copyright 2011 Mozilla Foundation and contributors |
| | | * Licensed under the New BSD license. See LICENSE or: |
| | | * http://opensource.org/licenses/BSD-3-Clause |
| | | */ |
| | | |
| | | exports.GREATEST_LOWER_BOUND = 1; |
| | | exports.LEAST_UPPER_BOUND = 2; |
| | | exports$1.GREATEST_LOWER_BOUND = 1; |
| | | exports$1.LEAST_UPPER_BOUND = 2; |
| | | |
| | | /** |
| | | * Recursive implementation of binary search. |
| | |
| | | |
| | | // The exact needle element was not found in this haystack. Determine if |
| | | // we are in termination case (3) or (2) and return the appropriate thing. |
| | | if (aBias == exports.LEAST_UPPER_BOUND) { |
| | | if (aBias == exports$1.LEAST_UPPER_BOUND) { |
| | | return aHigh < aHaystack.length ? aHigh : -1; |
| | | } else { |
| | | return mid; |
| | |
| | | } |
| | | |
| | | // we are in termination case (3) or (2) and return the appropriate thing. |
| | | if (aBias == exports.LEAST_UPPER_BOUND) { |
| | | if (aBias == exports$1.LEAST_UPPER_BOUND) { |
| | | return mid; |
| | | } else { |
| | | return aLow < 0 ? -1 : aLow; |
| | |
| | | * searching for, respectively, if the exact element cannot be found. |
| | | * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. |
| | | */ |
| | | exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { |
| | | exports$1.search = function search(aNeedle, aHaystack, aCompare, aBias) { |
| | | if (aHaystack.length === 0) { |
| | | return -1; |
| | | } |
| | | |
| | | var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, |
| | | aCompare, aBias || exports.GREATEST_LOWER_BOUND); |
| | | aCompare, aBias || exports$1.GREATEST_LOWER_BOUND); |
| | | if (index < 0) { |
| | | return -1; |
| | | } |
| | |
| | | }); |
| | | }; |
| | | |
| | | const createExports = (exports, postcss, mode = "rule") => { |
| | | const declarations = Object.keys(exports).map((key) => |
| | | const createExports = (exports$1, postcss, mode = "rule") => { |
| | | const declarations = Object.keys(exports$1).map((key) => |
| | | postcss.decl({ |
| | | prop: key, |
| | | value: exports[key], |
| | | value: exports$1[key], |
| | | raws: { before: "\n " }, |
| | | }) |
| | | ); |
| | |
| | | return [rule]; |
| | | }; |
| | | |
| | | const createICSSRules = (imports, exports, postcss, mode) => [ |
| | | const createICSSRules = (imports, exports$1, postcss, mode) => [ |
| | | ...createImports(imports, postcss, mode), |
| | | ...createExports(exports, postcss, mode), |
| | | ...createExports(exports$1, postcss, mode), |
| | | ]; |
| | | |
| | | createICSSRules_1 = createICSSRules; |
| | |
| | | async fetchImport(importNode, relativeTo, depNr) { |
| | | const file = importNode.selector.match(importRegexp)[1]; |
| | | const depTrace = this.trace + String.fromCharCode(depNr); |
| | | const exports = await this.pathFetcher(file, relativeTo, depTrace); |
| | | const exports$1 = await this.pathFetcher(file, relativeTo, depTrace); |
| | | |
| | | try { |
| | | importNode.each(decl => { |
| | | if (decl.type == "decl") { |
| | | this.translations[decl.prop] = exports[decl.value]; |
| | | this.translations[decl.prop] = exports$1[decl.value]; |
| | | } |
| | | }); |
| | | importNode.remove(); |
| | |
| | | * @param {number} digestSize size of digest returned by wasm |
| | | */ |
| | | constructor(instance, instancesPool, chunkSize, digestSize) { |
| | | const exports = /** @type {any} */ (instance.exports); |
| | | const exports$1 = /** @type {any} */ (instance.exports); |
| | | |
| | | exports.init(); |
| | | exports$1.init(); |
| | | |
| | | this.exports = exports; |
| | | this.mem = Buffer.from(exports.memory.buffer, 0, 65536); |
| | | this.exports = exports$1; |
| | | this.mem = Buffer.from(exports$1.memory.buffer, 0, 65536); |
| | | this.buffered = 0; |
| | | this.instancesPool = instancesPool; |
| | | this.chunkSize = chunkSize; |
| | |
| | | * @returns {void} |
| | | */ |
| | | _updateWithShortString(data, encoding) { |
| | | const { exports, buffered, mem, chunkSize } = this; |
| | | const { exports: exports$1, buffered, mem, chunkSize } = this; |
| | | |
| | | let endPos; |
| | | |
| | |
| | | } else { |
| | | const l = endPos & ~(this.chunkSize - 1); |
| | | |
| | | exports.update(l); |
| | | exports$1.update(l); |
| | | |
| | | const newBuffered = endPos - l; |
| | | |
| | |
| | | * @returns {void} |
| | | */ |
| | | _updateWithBuffer(data) { |
| | | const { exports, buffered, mem } = this; |
| | | const { exports: exports$1, buffered, mem } = this; |
| | | const length = data.length; |
| | | |
| | | if (buffered + length < this.chunkSize) { |
| | |
| | | let i = 65536 - buffered; |
| | | |
| | | data.copy(mem, buffered, 0, i); |
| | | exports.update(65536); |
| | | exports$1.update(65536); |
| | | |
| | | const stop = l - buffered - 65536; |
| | | |
| | | while (i < stop) { |
| | | data.copy(mem, 0, i, i + 65536); |
| | | exports.update(65536); |
| | | exports$1.update(65536); |
| | | i += 65536; |
| | | } |
| | | |
| | | data.copy(mem, 0, i, l - buffered); |
| | | |
| | | exports.update(l - buffered - i); |
| | | exports$1.update(l - buffered - i); |
| | | } else { |
| | | data.copy(mem, buffered, 0, l - buffered); |
| | | |
| | | exports.update(l); |
| | | exports$1.update(l); |
| | | } |
| | | |
| | | const newBuffered = length + buffered - l; |
| | |
| | | } |
| | | |
| | | digest(type) { |
| | | const { exports, buffered, mem, digestSize } = this; |
| | | const { exports: exports$1, buffered, mem, digestSize } = this; |
| | | |
| | | exports.final(buffered); |
| | | exports$1.final(buffered); |
| | | |
| | | this.instancesPool.push(this); |
| | | |
| | |
| | | function requireUnesc () { |
| | | if (hasRequiredUnesc) return unesc.exports; |
| | | hasRequiredUnesc = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = unesc; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = unesc; |
| | | // Many thanks for this post which made this migration much easier. |
| | | // https://mathiasbynens.be/notes/css-escapes |
| | | |
| | |
| | | } |
| | | return ret; |
| | | } |
| | | module.exports = exports.default; |
| | | module.exports = exports$1.default; |
| | | } (unesc, unesc.exports)); |
| | | return unesc.exports; |
| | | } |
| | |
| | | function requireGetProp () { |
| | | if (hasRequiredGetProp) return getProp.exports; |
| | | hasRequiredGetProp = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = getProp; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = getProp; |
| | | function getProp(obj) { |
| | | for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { |
| | | props[_key - 1] = arguments[_key]; |
| | |
| | | } |
| | | return obj; |
| | | } |
| | | module.exports = exports.default; |
| | | module.exports = exports$1.default; |
| | | } (getProp, getProp.exports)); |
| | | return getProp.exports; |
| | | } |
| | |
| | | function requireEnsureObject () { |
| | | if (hasRequiredEnsureObject) return ensureObject.exports; |
| | | hasRequiredEnsureObject = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = ensureObject; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = ensureObject; |
| | | function ensureObject(obj) { |
| | | for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { |
| | | props[_key - 1] = arguments[_key]; |
| | |
| | | obj = obj[prop]; |
| | | } |
| | | } |
| | | module.exports = exports.default; |
| | | module.exports = exports$1.default; |
| | | } (ensureObject, ensureObject.exports)); |
| | | return ensureObject.exports; |
| | | } |
| | |
| | | function requireStripComments () { |
| | | if (hasRequiredStripComments) return stripComments.exports; |
| | | hasRequiredStripComments = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = stripComments; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = stripComments; |
| | | function stripComments(str) { |
| | | var s = ""; |
| | | var commentStart = str.indexOf("/*"); |
| | |
| | | s = s + str.slice(lastEnd); |
| | | return s; |
| | | } |
| | | module.exports = exports.default; |
| | | module.exports = exports$1.default; |
| | | } (stripComments, stripComments.exports)); |
| | | return stripComments.exports; |
| | | } |
| | |
| | | function requireNode () { |
| | | if (hasRequiredNode) return node.exports; |
| | | hasRequiredNode = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | var _util = /*@__PURE__*/ requireUtil(); |
| | | function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } |
| | | function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } |
| | |
| | | }]); |
| | | return Node; |
| | | }(); |
| | | exports["default"] = Node; |
| | | module.exports = exports.default; |
| | | exports$1["default"] = Node; |
| | | module.exports = exports$1.default; |
| | | } (node, node.exports)); |
| | | return node.exports; |
| | | } |
| | |
| | | function requireContainer () { |
| | | if (hasRequiredContainer) return container.exports; |
| | | hasRequiredContainer = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | var _node = _interopRequireDefault(/*@__PURE__*/ requireNode()); |
| | | var types = _interopRequireWildcard(/*@__PURE__*/ requireTypes()); |
| | | function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } |
| | |
| | | }]); |
| | | return Container; |
| | | }(_node["default"]); |
| | | exports["default"] = Container; |
| | | module.exports = exports.default; |
| | | exports$1["default"] = Container; |
| | | module.exports = exports$1.default; |
| | | } (container, container.exports)); |
| | | return container.exports; |
| | | } |
| | |
| | | function requireRoot () { |
| | | if (hasRequiredRoot) return root.exports; |
| | | hasRequiredRoot = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | var _container = _interopRequireDefault(/*@__PURE__*/ requireContainer()); |
| | | var _types = /*@__PURE__*/ requireTypes(); |
| | | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } |
| | |
| | | }]); |
| | | return Root; |
| | | }(_container["default"]); |
| | | exports["default"] = Root; |
| | | module.exports = exports.default; |
| | | exports$1["default"] = Root; |
| | | module.exports = exports$1.default; |
| | | } (root, root.exports)); |
| | | return root.exports; |
| | | } |
| | |
| | | function requireSelector () { |
| | | if (hasRequiredSelector) return selector.exports; |
| | | hasRequiredSelector = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | var _container = _interopRequireDefault(/*@__PURE__*/ requireContainer()); |
| | | var _types = /*@__PURE__*/ requireTypes(); |
| | | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } |
| | |
| | | } |
| | | return Selector; |
| | | }(_container["default"]); |
| | | exports["default"] = Selector; |
| | | module.exports = exports.default; |
| | | exports$1["default"] = Selector; |
| | | module.exports = exports$1.default; |
| | | } (selector, selector.exports)); |
| | | return selector.exports; |
| | | } |
| | |
| | | function requireClassName () { |
| | | if (hasRequiredClassName) return className.exports; |
| | | hasRequiredClassName = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | var _cssesc = _interopRequireDefault(/*@__PURE__*/ requireCssesc()); |
| | | var _util = /*@__PURE__*/ requireUtil(); |
| | | var _node = _interopRequireDefault(/*@__PURE__*/ requireNode()); |
| | |
| | | }]); |
| | | return ClassName; |
| | | }(_node["default"]); |
| | | exports["default"] = ClassName; |
| | | module.exports = exports.default; |
| | | exports$1["default"] = ClassName; |
| | | module.exports = exports$1.default; |
| | | } (className, className.exports)); |
| | | return className.exports; |
| | | } |
| | |
| | | function requireComment () { |
| | | if (hasRequiredComment) return comment.exports; |
| | | hasRequiredComment = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | var _node = _interopRequireDefault(/*@__PURE__*/ requireNode()); |
| | | var _types = /*@__PURE__*/ requireTypes(); |
| | | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } |
| | |
| | | } |
| | | return Comment; |
| | | }(_node["default"]); |
| | | exports["default"] = Comment; |
| | | module.exports = exports.default; |
| | | exports$1["default"] = Comment; |
| | | module.exports = exports$1.default; |
| | | } (comment, comment.exports)); |
| | | return comment.exports; |
| | | } |
| | |
| | | function requireId () { |
| | | if (hasRequiredId) return id.exports; |
| | | hasRequiredId = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | var _node = _interopRequireDefault(/*@__PURE__*/ requireNode()); |
| | | var _types = /*@__PURE__*/ requireTypes(); |
| | | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } |
| | |
| | | }; |
| | | return ID; |
| | | }(_node["default"]); |
| | | exports["default"] = ID; |
| | | module.exports = exports.default; |
| | | exports$1["default"] = ID; |
| | | module.exports = exports$1.default; |
| | | } (id, id.exports)); |
| | | return id.exports; |
| | | } |
| | |
| | | function requireNamespace () { |
| | | if (hasRequiredNamespace) return namespace.exports; |
| | | hasRequiredNamespace = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | var _cssesc = _interopRequireDefault(/*@__PURE__*/ requireCssesc()); |
| | | var _util = /*@__PURE__*/ requireUtil(); |
| | | var _node = _interopRequireDefault(/*@__PURE__*/ requireNode()); |
| | |
| | | }]); |
| | | return Namespace; |
| | | }(_node["default"]); |
| | | exports["default"] = Namespace; |
| | | module.exports = exports.default; |
| | | exports$1["default"] = Namespace; |
| | | module.exports = exports$1.default; |
| | | } (namespace, namespace.exports)); |
| | | return namespace.exports; |
| | | } |
| | |
| | | function requireTag () { |
| | | if (hasRequiredTag) return tag.exports; |
| | | hasRequiredTag = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | var _namespace = _interopRequireDefault(/*@__PURE__*/ requireNamespace()); |
| | | var _types = /*@__PURE__*/ requireTypes(); |
| | | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } |
| | |
| | | } |
| | | return Tag; |
| | | }(_namespace["default"]); |
| | | exports["default"] = Tag; |
| | | module.exports = exports.default; |
| | | exports$1["default"] = Tag; |
| | | module.exports = exports$1.default; |
| | | } (tag, tag.exports)); |
| | | return tag.exports; |
| | | } |
| | |
| | | function requireString () { |
| | | if (hasRequiredString) return string.exports; |
| | | hasRequiredString = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | var _node = _interopRequireDefault(/*@__PURE__*/ requireNode()); |
| | | var _types = /*@__PURE__*/ requireTypes(); |
| | | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } |
| | |
| | | } |
| | | return String; |
| | | }(_node["default"]); |
| | | exports["default"] = String; |
| | | module.exports = exports.default; |
| | | exports$1["default"] = String; |
| | | module.exports = exports$1.default; |
| | | } (string, string.exports)); |
| | | return string.exports; |
| | | } |
| | |
| | | function requirePseudo () { |
| | | if (hasRequiredPseudo) return pseudo.exports; |
| | | hasRequiredPseudo = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | var _container = _interopRequireDefault(/*@__PURE__*/ requireContainer()); |
| | | var _types = /*@__PURE__*/ requireTypes(); |
| | | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } |
| | |
| | | }; |
| | | return Pseudo; |
| | | }(_container["default"]); |
| | | exports["default"] = Pseudo; |
| | | module.exports = exports.default; |
| | | exports$1["default"] = Pseudo; |
| | | module.exports = exports$1.default; |
| | | } (pseudo, pseudo.exports)); |
| | | return pseudo.exports; |
| | | } |
| | |
| | | function requireAttribute () { |
| | | if (hasRequiredAttribute) return attribute; |
| | | hasRequiredAttribute = 1; |
| | | (function (exports) { |
| | | (function (exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports.unescapeValue = unescapeValue; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | exports$1.unescapeValue = unescapeValue; |
| | | var _cssesc = _interopRequireDefault(/*@__PURE__*/ requireCssesc()); |
| | | var _unesc = _interopRequireDefault(/*@__PURE__*/ requireUnesc()); |
| | | var _namespace = _interopRequireDefault(/*@__PURE__*/ requireNamespace()); |
| | |
| | | }]); |
| | | return Attribute; |
| | | }(_namespace["default"]); |
| | | exports["default"] = Attribute; |
| | | exports$1["default"] = Attribute; |
| | | Attribute.NO_QUOTE = null; |
| | | Attribute.SINGLE_QUOTE = "'"; |
| | | Attribute.DOUBLE_QUOTE = '"'; |
| | |
| | | function requireUniversal () { |
| | | if (hasRequiredUniversal) return universal.exports; |
| | | hasRequiredUniversal = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | var _namespace = _interopRequireDefault(/*@__PURE__*/ requireNamespace()); |
| | | var _types = /*@__PURE__*/ requireTypes(); |
| | | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } |
| | |
| | | } |
| | | return Universal; |
| | | }(_namespace["default"]); |
| | | exports["default"] = Universal; |
| | | module.exports = exports.default; |
| | | exports$1["default"] = Universal; |
| | | module.exports = exports$1.default; |
| | | } (universal, universal.exports)); |
| | | return universal.exports; |
| | | } |
| | |
| | | function requireCombinator () { |
| | | if (hasRequiredCombinator) return combinator.exports; |
| | | hasRequiredCombinator = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | var _node = _interopRequireDefault(/*@__PURE__*/ requireNode()); |
| | | var _types = /*@__PURE__*/ requireTypes(); |
| | | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } |
| | |
| | | } |
| | | return Combinator; |
| | | }(_node["default"]); |
| | | exports["default"] = Combinator; |
| | | module.exports = exports.default; |
| | | exports$1["default"] = Combinator; |
| | | module.exports = exports$1.default; |
| | | } (combinator, combinator.exports)); |
| | | return combinator.exports; |
| | | } |
| | |
| | | function requireNesting () { |
| | | if (hasRequiredNesting) return nesting.exports; |
| | | hasRequiredNesting = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | var _node = _interopRequireDefault(/*@__PURE__*/ requireNode()); |
| | | var _types = /*@__PURE__*/ requireTypes(); |
| | | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } |
| | |
| | | } |
| | | return Nesting; |
| | | }(_node["default"]); |
| | | exports["default"] = Nesting; |
| | | module.exports = exports.default; |
| | | exports$1["default"] = Nesting; |
| | | module.exports = exports$1.default; |
| | | } (nesting, nesting.exports)); |
| | | return nesting.exports; |
| | | } |
| | |
| | | function requireSortAscending () { |
| | | if (hasRequiredSortAscending) return sortAscending.exports; |
| | | hasRequiredSortAscending = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = sortAscending; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = sortAscending; |
| | | function sortAscending(list) { |
| | | return list.sort(function (a, b) { |
| | | return a - b; |
| | | }); |
| | | } |
| | | module.exports = exports.default; |
| | | module.exports = exports$1.default; |
| | | } (sortAscending, sortAscending.exports)); |
| | | return sortAscending.exports; |
| | | } |
| | |
| | | function requireTokenize () { |
| | | if (hasRequiredTokenize) return tokenize; |
| | | hasRequiredTokenize = 1; |
| | | (function (exports) { |
| | | (function (exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports.FIELDS = void 0; |
| | | exports["default"] = tokenize; |
| | | exports$1.__esModule = true; |
| | | exports$1.FIELDS = void 0; |
| | | exports$1["default"] = tokenize; |
| | | var t = _interopRequireWildcard(/*@__PURE__*/ requireTokenTypes()); |
| | | var _unescapable, _wordDelimiters; |
| | | function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } |
| | |
| | | START_POS: 5, |
| | | END_POS: 6 |
| | | }; |
| | | exports.FIELDS = FIELDS; |
| | | exports$1.FIELDS = FIELDS; |
| | | function tokenize(input) { |
| | | var tokens = []; |
| | | var css = input.css.valueOf(); |
| | |
| | | function requireParser () { |
| | | if (hasRequiredParser) return parser.exports; |
| | | hasRequiredParser = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | var _root = _interopRequireDefault(/*@__PURE__*/ requireRoot()); |
| | | var _selector = _interopRequireDefault(/*@__PURE__*/ requireSelector()); |
| | | var _className = _interopRequireDefault(/*@__PURE__*/ requireClassName()); |
| | |
| | | }]); |
| | | return Parser; |
| | | }(); |
| | | exports["default"] = Parser; |
| | | module.exports = exports.default; |
| | | exports$1["default"] = Parser; |
| | | module.exports = exports$1.default; |
| | | } (parser, parser.exports)); |
| | | return parser.exports; |
| | | } |
| | |
| | | function requireProcessor () { |
| | | if (hasRequiredProcessor) return processor.exports; |
| | | hasRequiredProcessor = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | var _parser = _interopRequireDefault(/*@__PURE__*/ requireParser()); |
| | | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } |
| | | var Processor = /*#__PURE__*/function () { |
| | |
| | | }; |
| | | return Processor; |
| | | }(); |
| | | exports["default"] = Processor; |
| | | module.exports = exports.default; |
| | | exports$1["default"] = Processor; |
| | | module.exports = exports$1.default; |
| | | } (processor, processor.exports)); |
| | | return processor.exports; |
| | | } |
| | |
| | | function requireSelectors () { |
| | | if (hasRequiredSelectors) return selectors; |
| | | hasRequiredSelectors = 1; |
| | | (function (exports) { |
| | | (function (exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports$1.__esModule = true; |
| | | var _types = /*@__PURE__*/ requireTypes(); |
| | | Object.keys(_types).forEach(function (key) { |
| | | if (key === "default" || key === "__esModule") return; |
| | | if (key in exports && exports[key] === _types[key]) return; |
| | | exports[key] = _types[key]; |
| | | if (key in exports$1 && exports$1[key] === _types[key]) return; |
| | | exports$1[key] = _types[key]; |
| | | }); |
| | | var _constructors = /*@__PURE__*/ requireConstructors(); |
| | | Object.keys(_constructors).forEach(function (key) { |
| | | if (key === "default" || key === "__esModule") return; |
| | | if (key in exports && exports[key] === _constructors[key]) return; |
| | | exports[key] = _constructors[key]; |
| | | if (key in exports$1 && exports$1[key] === _constructors[key]) return; |
| | | exports$1[key] = _constructors[key]; |
| | | }); |
| | | var _guards = /*@__PURE__*/ requireGuards(); |
| | | Object.keys(_guards).forEach(function (key) { |
| | | if (key === "default" || key === "__esModule") return; |
| | | if (key in exports && exports[key] === _guards[key]) return; |
| | | exports[key] = _guards[key]; |
| | | if (key in exports$1 && exports$1[key] === _guards[key]) return; |
| | | exports$1[key] = _guards[key]; |
| | | }); |
| | | } (selectors)); |
| | | return selectors; |
| | |
| | | function requireDist () { |
| | | if (hasRequiredDist) return dist.exports; |
| | | hasRequiredDist = 1; |
| | | (function (module, exports) { |
| | | (function (module, exports$1) { |
| | | |
| | | exports.__esModule = true; |
| | | exports["default"] = void 0; |
| | | exports$1.__esModule = true; |
| | | exports$1["default"] = void 0; |
| | | var _processor = _interopRequireDefault(/*@__PURE__*/ requireProcessor()); |
| | | var selectors = _interopRequireWildcard(/*@__PURE__*/ requireSelectors()); |
| | | function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } |
| | |
| | | Object.assign(parser, selectors); |
| | | delete parser.__esModule; |
| | | var _default = parser; |
| | | exports["default"] = _default; |
| | | module.exports = exports.default; |
| | | exports$1["default"] = _default; |
| | | module.exports = exports$1.default; |
| | | } (dist, dist.exports)); |
| | | return dist.exports; |
| | | } |
| | |
| | | return { |
| | | postcssPlugin: "postcss-modules-scope", |
| | | Once(root, { rule }) { |
| | | const exports = Object.create(null); |
| | | const exports$1 = Object.create(null); |
| | | |
| | | function exportScopedName(name, rawName, node) { |
| | | const scopedName = generateScopedName( |
| | |
| | | ); |
| | | const { key, value } = exportEntry; |
| | | |
| | | exports[key] = exports[key] || []; |
| | | exports$1[key] = exports$1[key] || []; |
| | | |
| | | if (exports[key].indexOf(value) < 0) { |
| | | exports[key].push(value); |
| | | if (exports$1[key].indexOf(value) < 0) { |
| | | exports$1[key].push(value); |
| | | } |
| | | |
| | | return scopedName; |
| | |
| | | case "id": |
| | | case "class": |
| | | if (exportGlobals) { |
| | | exports[node.value] = [node.value]; |
| | | exports$1[node.value] = [node.value]; |
| | | } |
| | | break; |
| | | } |
| | |
| | | |
| | | if (global) { |
| | | localNames.forEach((exportedName) => { |
| | | exports[exportedName].push(global[1]); |
| | | exports$1[exportedName].push(global[1]); |
| | | }); |
| | | } else if (hasOwnProperty.call(importedNames, className)) { |
| | | localNames.forEach((exportedName) => { |
| | | exports[exportedName].push(className); |
| | | exports$1[exportedName].push(className); |
| | | }); |
| | | } else if (hasOwnProperty.call(exports, className)) { |
| | | } else if (hasOwnProperty.call(exports$1, className)) { |
| | | localNames.forEach((exportedName) => { |
| | | exports[className].forEach((item) => { |
| | | exports[exportedName].push(item); |
| | | exports$1[className].forEach((item) => { |
| | | exports$1[exportedName].push(item); |
| | | }); |
| | | }); |
| | | } else { |
| | |
| | | }); |
| | | |
| | | // If we found any :locals, insert an :export rule |
| | | const exportedNames = Object.keys(exports); |
| | | const exportedNames = Object.keys(exports$1); |
| | | |
| | | if (exportedNames.length > 0) { |
| | | const exportRule = rule({ selector: ":export" }); |
| | |
| | | exportedNames.forEach((exportedName) => |
| | | exportRule.append({ |
| | | prop: exportedName, |
| | | value: exports[exportedName].join(" "), |
| | | value: exports$1[exportedName].join(" "), |
| | | raws: { before: "\n " }, |
| | | }) |
| | | ); |
| | |
| | | return []; |
| | | } |
| | | |
| | | var _a, _b; |
| | | var _a$1, _b; |
| | | class ScriptCompileContext { |
| | | constructor(descriptor, options) { |
| | | this.descriptor = descriptor; |
| | |
| | | this.source = this.descriptor.source; |
| | | this.filename = this.descriptor.filename; |
| | | this.s = new MagicString(this.source); |
| | | this.startOffset = (_a = this.descriptor.scriptSetup) == null ? void 0 : _a.loc.start.offset; |
| | | this.startOffset = (_a$1 = this.descriptor.scriptSetup) == null ? void 0 : _a$1.loc.start.offset; |
| | | this.endOffset = (_b = this.descriptor.scriptSetup) == null ? void 0 : _b.loc.end.offset; |
| | | this.userImports = /* @__PURE__ */ Object.create(null); |
| | | // macros presence check |
| | |
| | | } else if (userPlugins) { |
| | | userPlugins = userPlugins.filter((p) => p !== "jsx"); |
| | | } |
| | | if (lang === "ts" || lang === "mts" || lang === "tsx" || lang === "mtsx") { |
| | | if (lang === "ts" || lang === "mts" || lang === "tsx" || lang === "cts" || lang === "mtsx") { |
| | | plugins.push(["typescript", { dts }], "explicitResourceManagement"); |
| | | if (!userPlugins || !userPlugins.includes("decorators")) { |
| | | plugins.push("decorators-legacy"); |
| | |
| | | const openPattern = /\\{/g; |
| | | const closePattern = /\\}/g; |
| | | const commaPattern = /\\,/g; |
| | | const periodPattern = /\\./g; |
| | | const periodPattern = /\\\./g; |
| | | const EXPANSION_MAX = 100_000; |
| | | function numeric(str) { |
| | | return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0); |
| | | } |
| | |
| | | parts.push.apply(parts, p); |
| | | return parts; |
| | | } |
| | | function expand(str) { |
| | | function expand(str, options = {}) { |
| | | if (!str) { |
| | | return []; |
| | | } |
| | | const { max = EXPANSION_MAX } = options; |
| | | // I don't know why Bash 4.3 does this, but it does. |
| | | // Anything starting with {} will have the first two bytes preserved |
| | | // but *only* at the top level, so {},a}b will not expand to anything, |
| | |
| | | if (str.slice(0, 2) === '{}') { |
| | | str = '\\{\\}' + str.slice(2); |
| | | } |
| | | return expand_(escapeBraces(str), true).map(unescapeBraces); |
| | | return expand_(escapeBraces(str), max, true).map(unescapeBraces); |
| | | } |
| | | function embrace(str) { |
| | | return '{' + str + '}'; |
| | |
| | | function gte(i, y) { |
| | | return i >= y; |
| | | } |
| | | function expand_(str, isTop) { |
| | | function expand_(str, max, isTop) { |
| | | /** @type {string[]} */ |
| | | const expansions = []; |
| | | const m = balanced('{', '}', str); |
| | |
| | | return [str]; |
| | | // no need to expand pre, since it is guaranteed to be free of brace-sets |
| | | const pre = m.pre; |
| | | const post = m.post.length ? expand_(m.post, false) : ['']; |
| | | const post = m.post.length ? expand_(m.post, max, false) : ['']; |
| | | if (/\$$/.test(m.pre)) { |
| | | for (let k = 0; k < post.length; k++) { |
| | | for (let k = 0; k < post.length && k < max; k++) { |
| | | const expansion = pre + '{' + m.body + '}' + post[k]; |
| | | expansions.push(expansion); |
| | | } |
| | |
| | | // {a},b} |
| | | if (m.post.match(/,(?!,).*\}/)) { |
| | | str = m.pre + '{' + m.body + escClose + m.post; |
| | | return expand_(str); |
| | | return expand_(str, max, true); |
| | | } |
| | | return [str]; |
| | | } |
| | |
| | | n = parseCommaParts(m.body); |
| | | if (n.length === 1 && n[0] !== undefined) { |
| | | // x{{a,b}}y ==> x{a}y x{b}y |
| | | n = expand_(n[0], false).map(embrace); |
| | | n = expand_(n[0], max, false).map(embrace); |
| | | //XXX is this necessary? Can't seem to hit it in tests. |
| | | /* c8 ignore start */ |
| | | if (n.length === 1) { |
| | |
| | | else { |
| | | N = []; |
| | | for (let j = 0; j < n.length; j++) { |
| | | N.push.apply(N, expand_(n[j], false)); |
| | | N.push.apply(N, expand_(n[j], max, false)); |
| | | } |
| | | } |
| | | for (let j = 0; j < N.length; j++) { |
| | | for (let k = 0; k < post.length; k++) { |
| | | for (let k = 0; k < post.length && expansions.length < max; k++) { |
| | | const expansion = pre + N[j] + post[k]; |
| | | if (!isTop || isSequence || expansion) { |
| | | expansions.push(expansion); |
| | |
| | | } |
| | | const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']'; |
| | | const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']'; |
| | | const comb = ranges.length && negs.length |
| | | ? '(' + sranges + '|' + snegs + ')' |
| | | : ranges.length |
| | | ? sranges |
| | | const comb = ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')' |
| | | : ranges.length ? sranges |
| | | : snegs; |
| | | return [comb, uflag, endPos - pos, true]; |
| | | }; |
| | |
| | | */ |
| | | const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true, } = {}) => { |
| | | if (magicalBraces) { |
| | | return windowsPathsNoEscape |
| | | ? s.replace(/\[([^\/\\])\]/g, '$1') |
| | | return windowsPathsNoEscape ? |
| | | s.replace(/\[([^\/\\])\]/g, '$1') |
| | | : s |
| | | .replace(/((?!\\).|^)\[([^\/\\])\]/g, '$1$2') |
| | | .replace(/\\([^\/])/g, '$1'); |
| | | } |
| | | return windowsPathsNoEscape |
| | | ? s.replace(/\[([^\/\\{}])\]/g, '$1') |
| | | return windowsPathsNoEscape ? |
| | | s.replace(/\[([^\/\\{}])\]/g, '$1') |
| | | : s |
| | | .replace(/((?!\\).|^)\[([^\/\\{}])\]/g, '$1$2') |
| | | .replace(/\\([^\/{}])/g, '$1'); |
| | | }; |
| | | |
| | | // parse a single path portion |
| | | var _a; |
| | | const types = new Set(['!', '?', '+', '*', '@']); |
| | | const isExtglobType = (c) => types.has(c); |
| | | const isExtglobAST = (c) => isExtglobType(c.type); |
| | | // Map of which extglob types can adopt the children of a nested extglob |
| | | // |
| | | // anything but ! can adopt a matching type: |
| | | // +(a|+(b|c)|d) => +(a|b|c|d) |
| | | // *(a|*(b|c)|d) => *(a|b|c|d) |
| | | // @(a|@(b|c)|d) => @(a|b|c|d) |
| | | // ?(a|?(b|c)|d) => ?(a|b|c|d) |
| | | // |
| | | // * can adopt anything, because 0 or repetition is allowed |
| | | // *(a|?(b|c)|d) => *(a|b|c|d) |
| | | // *(a|+(b|c)|d) => *(a|b|c|d) |
| | | // *(a|@(b|c)|d) => *(a|b|c|d) |
| | | // |
| | | // + can adopt @, because 1 or repetition is allowed |
| | | // +(a|@(b|c)|d) => +(a|b|c|d) |
| | | // |
| | | // + and @ CANNOT adopt *, because 0 would be allowed |
| | | // +(a|*(b|c)|d) => would match "", on *(b|c) |
| | | // @(a|*(b|c)|d) => would match "", on *(b|c) |
| | | // |
| | | // + and @ CANNOT adopt ?, because 0 would be allowed |
| | | // +(a|?(b|c)|d) => would match "", on ?(b|c) |
| | | // @(a|?(b|c)|d) => would match "", on ?(b|c) |
| | | // |
| | | // ? can adopt @, because 0 or 1 is allowed |
| | | // ?(a|@(b|c)|d) => ?(a|b|c|d) |
| | | // |
| | | // ? and @ CANNOT adopt * or +, because >1 would be allowed |
| | | // ?(a|*(b|c)|d) => would match bbb on *(b|c) |
| | | // @(a|*(b|c)|d) => would match bbb on *(b|c) |
| | | // ?(a|+(b|c)|d) => would match bbb on +(b|c) |
| | | // @(a|+(b|c)|d) => would match bbb on +(b|c) |
| | | // |
| | | // ! CANNOT adopt ! (nothing else can either) |
| | | // !(a|!(b|c)|d) => !(a|b|c|d) would fail to match on b (not not b|c) |
| | | // |
| | | // ! can adopt @ |
| | | // !(a|@(b|c)|d) => !(a|b|c|d) |
| | | // |
| | | // ! CANNOT adopt * |
| | | // !(a|*(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed |
| | | // |
| | | // ! CANNOT adopt + |
| | | // !(a|+(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed |
| | | // |
| | | // ! CANNOT adopt ? |
| | | // x!(a|?(b|c)|d) => x!(a|b|c|d) would fail to match "x" |
| | | const adoptionMap = new Map([ |
| | | ['!', ['@']], |
| | | ['?', ['?', '@']], |
| | | ['@', ['@']], |
| | | ['*', ['*', '+', '?', '@']], |
| | | ['+', ['+', '@']], |
| | | ]); |
| | | // nested extglobs that can be adopted in, but with the addition of |
| | | // a blank '' element. |
| | | const adoptionWithSpaceMap = new Map([ |
| | | ['!', ['?']], |
| | | ['@', ['?']], |
| | | ['+', ['?', '*']], |
| | | ]); |
| | | // union of the previous two maps |
| | | const adoptionAnyMap = new Map([ |
| | | ['!', ['?', '@']], |
| | | ['?', ['?', '@']], |
| | | ['@', ['?', '@']], |
| | | ['*', ['*', '+', '?', '@']], |
| | | ['+', ['+', '@', '?', '*']], |
| | | ]); |
| | | // Extglobs that can take over their parent if they are the only child |
| | | // the key is parent, value maps child to resulting extglob parent type |
| | | // '@' is omitted because it's a special case. An `@` extglob with a single |
| | | // member can always be usurped by that subpattern. |
| | | const usurpMap = new Map([ |
| | | ['!', new Map([['!', '@']])], |
| | | [ |
| | | '?', |
| | | new Map([ |
| | | ['*', '*'], |
| | | ['+', '*'], |
| | | ]), |
| | | ], |
| | | [ |
| | | '@', |
| | | new Map([ |
| | | ['!', '!'], |
| | | ['?', '?'], |
| | | ['@', '@'], |
| | | ['*', '*'], |
| | | ['+', '+'], |
| | | ]), |
| | | ], |
| | | [ |
| | | '+', |
| | | new Map([ |
| | | ['?', '*'], |
| | | ['*', '*'], |
| | | ]), |
| | | ], |
| | | ]); |
| | | // Patterns that get prepended to bind to the start of either the |
| | | // entire string, or just a single path portion, to prevent dots |
| | | // and/or traversal patterns, when needed. |
| | |
| | | const starNoEmpty = qmark$1 + '+?'; |
| | | // remove the \ chars that we added if we end up doing a nonmagic compare |
| | | // const deslash = (s: string) => s.replace(/\\(.)/g, '$1') |
| | | let ID = 0; |
| | | class AST { |
| | | type; |
| | | #root; |
| | |
| | | // set to true if it's an extglob with no children |
| | | // (which really means one child of '') |
| | | #emptyExt = false; |
| | | id = ++ID; |
| | | get depth() { |
| | | return (this.#parent?.depth ?? -1) + 1; |
| | | } |
| | | [Symbol.for('nodejs.util.inspect.custom')]() { |
| | | return { |
| | | '@@type': 'AST', |
| | | id: this.id, |
| | | type: this.type, |
| | | root: this.#root.id, |
| | | parent: this.#parent?.id, |
| | | depth: this.depth, |
| | | partsLength: this.#parts.length, |
| | | parts: this.#parts, |
| | | }; |
| | | } |
| | | constructor(type, parent, options = {}) { |
| | | this.type = type; |
| | | // extglobs are inherently magical |
| | |
| | | if (p === '') |
| | | continue; |
| | | /* c8 ignore start */ |
| | | if (typeof p !== 'string' && !(p instanceof AST && p.#parent === this)) { |
| | | if (typeof p !== 'string' && |
| | | !(p instanceof _a && p.#parent === this)) { |
| | | throw new Error('invalid part: ' + p); |
| | | } |
| | | /* c8 ignore stop */ |
| | |
| | | } |
| | | } |
| | | toJSON() { |
| | | const ret = this.type === null |
| | | ? this.#parts.slice().map(p => (typeof p === 'string' ? p : p.toJSON())) |
| | | const ret = this.type === null ? |
| | | this.#parts |
| | | .slice() |
| | | .map(p => (typeof p === 'string' ? p : p.toJSON())) |
| | | : [this.type, ...this.#parts.map(p => p.toJSON())]; |
| | | if (this.isStart() && !this.type) |
| | | ret.unshift([]); |
| | |
| | | const p = this.#parent; |
| | | for (let i = 0; i < this.#parentIndex; i++) { |
| | | const pp = p.#parts[i]; |
| | | if (!(pp instanceof AST && pp.type === '!')) { |
| | | if (!(pp instanceof _a && pp.type === '!')) { |
| | | return false; |
| | | } |
| | | } |
| | |
| | | this.push(part.clone(this)); |
| | | } |
| | | clone(parent) { |
| | | const c = new AST(this.type, parent); |
| | | const c = new _a(this.type, parent); |
| | | for (const p of this.#parts) { |
| | | c.copyIn(p); |
| | | } |
| | | return c; |
| | | } |
| | | static #parseAST(str, ast, pos, opt) { |
| | | static #parseAST(str, ast, pos, opt, extDepth) { |
| | | const maxDepth = opt.maxExtglobRecursion ?? 2; |
| | | let escaping = false; |
| | | let inBrace = false; |
| | | let braceStart = -1; |
| | |
| | | acc += c; |
| | | continue; |
| | | } |
| | | if (!opt.noext && isExtglobType(c) && str.charAt(i) === '(') { |
| | | // we don't have to check for adoption here, because that's |
| | | // done at the other recursion point. |
| | | const doRecurse = !opt.noext && |
| | | isExtglobType(c) && |
| | | str.charAt(i) === '(' && |
| | | extDepth <= maxDepth; |
| | | if (doRecurse) { |
| | | ast.push(acc); |
| | | acc = ''; |
| | | const ext = new AST(c, ast); |
| | | i = AST.#parseAST(str, ext, i, opt); |
| | | const ext = new _a(c, ast); |
| | | i = _a.#parseAST(str, ext, i, opt, extDepth + 1); |
| | | ast.push(ext); |
| | | continue; |
| | | } |
| | |
| | | // some kind of extglob, pos is at the ( |
| | | // find the next | or ) |
| | | let i = pos + 1; |
| | | let part = new AST(null, ast); |
| | | let part = new _a(null, ast); |
| | | const parts = []; |
| | | let acc = ''; |
| | | while (i < str.length) { |
| | |
| | | acc += c; |
| | | continue; |
| | | } |
| | | if (isExtglobType(c) && str.charAt(i) === '(') { |
| | | const doRecurse = !opt.noext && |
| | | isExtglobType(c) && |
| | | str.charAt(i) === '(' && |
| | | /* c8 ignore start - the maxDepth is sufficient here */ |
| | | (extDepth <= maxDepth || (ast && ast.#canAdoptType(c))); |
| | | /* c8 ignore stop */ |
| | | if (doRecurse) { |
| | | const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1; |
| | | part.push(acc); |
| | | acc = ''; |
| | | const ext = new AST(c, part); |
| | | const ext = new _a(c, part); |
| | | part.push(ext); |
| | | i = AST.#parseAST(str, ext, i, opt); |
| | | i = _a.#parseAST(str, ext, i, opt, extDepth + depthAdd); |
| | | continue; |
| | | } |
| | | if (c === '|') { |
| | | part.push(acc); |
| | | acc = ''; |
| | | parts.push(part); |
| | | part = new AST(null, ast); |
| | | part = new _a(null, ast); |
| | | continue; |
| | | } |
| | | if (c === ')') { |
| | |
| | | ast.#parts = [str.substring(pos - 1)]; |
| | | return i; |
| | | } |
| | | #canAdoptWithSpace(child) { |
| | | return this.#canAdopt(child, adoptionWithSpaceMap); |
| | | } |
| | | #canAdopt(child, map = adoptionMap) { |
| | | if (!child || |
| | | typeof child !== 'object' || |
| | | child.type !== null || |
| | | child.#parts.length !== 1 || |
| | | this.type === null) { |
| | | return false; |
| | | } |
| | | const gc = child.#parts[0]; |
| | | if (!gc || typeof gc !== 'object' || gc.type === null) { |
| | | return false; |
| | | } |
| | | return this.#canAdoptType(gc.type, map); |
| | | } |
| | | #canAdoptType(c, map = adoptionAnyMap) { |
| | | return !!map.get(this.type)?.includes(c); |
| | | } |
| | | #adoptWithSpace(child, index) { |
| | | const gc = child.#parts[0]; |
| | | const blank = new _a(null, gc, this.options); |
| | | blank.#parts.push(''); |
| | | gc.push(blank); |
| | | this.#adopt(child, index); |
| | | } |
| | | #adopt(child, index) { |
| | | const gc = child.#parts[0]; |
| | | this.#parts.splice(index, 1, ...gc.#parts); |
| | | for (const p of gc.#parts) { |
| | | if (typeof p === 'object') |
| | | p.#parent = this; |
| | | } |
| | | this.#toString = undefined; |
| | | } |
| | | #canUsurpType(c) { |
| | | const m = usurpMap.get(this.type); |
| | | return !!(m?.has(c)); |
| | | } |
| | | #canUsurp(child) { |
| | | if (!child || |
| | | typeof child !== 'object' || |
| | | child.type !== null || |
| | | child.#parts.length !== 1 || |
| | | this.type === null || |
| | | this.#parts.length !== 1) { |
| | | return false; |
| | | } |
| | | const gc = child.#parts[0]; |
| | | if (!gc || typeof gc !== 'object' || gc.type === null) { |
| | | return false; |
| | | } |
| | | return this.#canUsurpType(gc.type); |
| | | } |
| | | #usurp(child) { |
| | | const m = usurpMap.get(this.type); |
| | | const gc = child.#parts[0]; |
| | | const nt = m?.get(gc.type); |
| | | /* c8 ignore start - impossible */ |
| | | if (!nt) |
| | | return false; |
| | | /* c8 ignore stop */ |
| | | this.#parts = gc.#parts; |
| | | for (const p of this.#parts) { |
| | | if (typeof p === 'object') { |
| | | p.#parent = this; |
| | | } |
| | | } |
| | | this.type = nt; |
| | | this.#toString = undefined; |
| | | this.#emptyExt = false; |
| | | } |
| | | static fromGlob(pattern, options = {}) { |
| | | const ast = new AST(null, undefined, options); |
| | | AST.#parseAST(pattern, ast, 0, options); |
| | | const ast = new _a(null, undefined, options); |
| | | _a.#parseAST(pattern, ast, 0, options, 0); |
| | | return ast; |
| | | } |
| | | // returns the regular expression if there's magic, or the unescaped |
| | |
| | | // or start or whatever) and prepend ^ or / at the Regexp construction. |
| | | toRegExpSource(allowDot) { |
| | | const dot = allowDot ?? !!this.#options.dot; |
| | | if (this.#root === this) |
| | | if (this.#root === this) { |
| | | this.#flatten(); |
| | | this.#fillNegs(); |
| | | if (!this.type) { |
| | | } |
| | | if (!isExtglobAST(this)) { |
| | | const noEmpty = this.isStart() && |
| | | this.isEnd() && |
| | | !this.#parts.some(s => typeof s !== 'string'); |
| | | const src = this.#parts |
| | | .map(p => { |
| | | const [re, _, hasMagic, uflag] = typeof p === 'string' |
| | | ? AST.#parseGlob(p, this.#hasMagic, noEmpty) |
| | | const [re, _, hasMagic, uflag] = typeof p === 'string' ? |
| | | _a.#parseGlob(p, this.#hasMagic, noEmpty) |
| | | : p.toRegExpSource(allowDot); |
| | | this.#hasMagic = this.#hasMagic || hasMagic; |
| | | this.#uflag = this.#uflag || uflag; |
| | |
| | | // no need to prevent dots if it can't match a dot, or if a |
| | | // sub-pattern will be preventing it anyway. |
| | | const needNoDot = !dot && !allowDot && aps.has(src.charAt(0)); |
| | | start = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : ''; |
| | | start = |
| | | needNoTrav ? startNoTraversal |
| | | : needNoDot ? startNoDot |
| | | : ''; |
| | | } |
| | | } |
| | | } |
| | |
| | | // invalid extglob, has to at least be *something* present, if it's |
| | | // the entire path portion. |
| | | const s = this.toString(); |
| | | this.#parts = [s]; |
| | | this.type = null; |
| | | this.#hasMagic = undefined; |
| | | const me = this; |
| | | me.#parts = [s]; |
| | | me.type = null; |
| | | me.#hasMagic = undefined; |
| | | return [s, unescape(this.toString()), false, false]; |
| | | } |
| | | // XXX abstract out this map method |
| | | let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot |
| | | ? '' |
| | | let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? |
| | | '' |
| | | : this.#partsToRegExp(true); |
| | | if (bodyDotAllowed === body) { |
| | | bodyDotAllowed = ''; |
| | |
| | | final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty; |
| | | } |
| | | else { |
| | | const close = this.type === '!' |
| | | ? // !() must match something,but !(x) can match '' |
| | | '))' + |
| | | (this.isStart() && !dot && !allowDot ? startNoDot : '') + |
| | | star$1 + |
| | | ')' |
| | | : this.type === '@' |
| | | ? ')' |
| | | : this.type === '?' |
| | | ? ')?' |
| | | : this.type === '+' && bodyDotAllowed |
| | | ? ')' |
| | | : this.type === '*' && bodyDotAllowed |
| | | ? `)?` |
| | | const close = this.type === '!' ? |
| | | // !() must match something,but !(x) can match '' |
| | | '))' + |
| | | (this.isStart() && !dot && !allowDot ? startNoDot : '') + |
| | | star$1 + |
| | | ')' |
| | | : this.type === '@' ? ')' |
| | | : this.type === '?' ? ')?' |
| | | : this.type === '+' && bodyDotAllowed ? ')' |
| | | : this.type === '*' && bodyDotAllowed ? `)?` |
| | | : `)${this.type}`; |
| | | final = start + body + close; |
| | | } |
| | |
| | | (this.#hasMagic = !!this.#hasMagic), |
| | | this.#uflag, |
| | | ]; |
| | | } |
| | | #flatten() { |
| | | if (!isExtglobAST(this)) { |
| | | for (const p of this.#parts) { |
| | | if (typeof p === 'object') { |
| | | p.#flatten(); |
| | | } |
| | | } |
| | | } |
| | | else { |
| | | // do up to 10 passes to flatten as much as possible |
| | | let iterations = 0; |
| | | let done = false; |
| | | do { |
| | | done = true; |
| | | for (let i = 0; i < this.#parts.length; i++) { |
| | | const c = this.#parts[i]; |
| | | if (typeof c === 'object') { |
| | | c.#flatten(); |
| | | if (this.#canAdopt(c)) { |
| | | done = false; |
| | | this.#adopt(c, i); |
| | | } |
| | | else if (this.#canAdoptWithSpace(c)) { |
| | | done = false; |
| | | this.#adoptWithSpace(c, i); |
| | | } |
| | | else if (this.#canUsurp(c)) { |
| | | done = false; |
| | | this.#usurp(c); |
| | | } |
| | | } |
| | | } |
| | | } while (!done && ++iterations < 10); |
| | | } |
| | | this.#toString = undefined; |
| | | } |
| | | #partsToRegExp(dot) { |
| | | return this.#parts |
| | |
| | | let escaping = false; |
| | | let re = ''; |
| | | let uflag = false; |
| | | // multiple stars that aren't globstars coalesce into one * |
| | | let inStar = false; |
| | | for (let i = 0; i < glob.length; i++) { |
| | | const c = glob.charAt(i); |
| | | if (escaping) { |
| | | escaping = false; |
| | | re += (reSpecials.has(c) ? '\\' : '') + c; |
| | | continue; |
| | | } |
| | | if (c === '*') { |
| | | if (inStar) |
| | | continue; |
| | | inStar = true; |
| | | re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star$1; |
| | | hasMagic = true; |
| | | continue; |
| | | } |
| | | else { |
| | | inStar = false; |
| | | } |
| | | if (c === '\\') { |
| | | if (i === glob.length - 1) { |
| | |
| | | continue; |
| | | } |
| | | } |
| | | if (c === '*') { |
| | | re += noEmpty && glob === '*' ? starNoEmpty : star$1; |
| | | hasMagic = true; |
| | | continue; |
| | | } |
| | | if (c === '?') { |
| | | re += qmark$1; |
| | | hasMagic = true; |
| | |
| | | return [re, unescape(glob), !!hasMagic, uflag]; |
| | | } |
| | | } |
| | | _a = AST; |
| | | |
| | | /** |
| | | * Escape all magic characters in a glob pattern. |
| | |
| | | // that make those magic, and escaping ! as [!] isn't valid, |
| | | // because [!]] is a valid glob class meaning not ']'. |
| | | if (magicalBraces) { |
| | | return windowsPathsNoEscape |
| | | ? s.replace(/[?*()[\]{}]/g, '[$&]') |
| | | return windowsPathsNoEscape ? |
| | | s.replace(/[?*()[\]{}]/g, '[$&]') |
| | | : s.replace(/[?*()[\]\\{}]/g, '\\$&'); |
| | | } |
| | | return windowsPathsNoEscape |
| | | ? s.replace(/[?*()[\]]/g, '[$&]') |
| | | return windowsPathsNoEscape ? |
| | | s.replace(/[?*()[\]]/g, '[$&]') |
| | | : s.replace(/[?*()[\]\\]/g, '\\$&'); |
| | | }; |
| | | |
| | |
| | | return (f) => f.length === len && f !== '.' && f !== '..'; |
| | | }; |
| | | /* c8 ignore start */ |
| | | const defaultPlatform = (typeof process === 'object' && process |
| | | ? (typeof process.env === 'object' && |
| | | const defaultPlatform = (typeof process === 'object' && process ? |
| | | (typeof process.env === 'object' && |
| | | process.env && |
| | | process.env.__MINIMATCH_TESTING_PLATFORM__) || |
| | | process.platform |
| | |
| | | // shortcut. no need to expand. |
| | | return [pattern]; |
| | | } |
| | | return expand(pattern); |
| | | return expand(pattern, { max: options.braceExpandMax }); |
| | | }; |
| | | minimatch.braceExpand = braceExpand; |
| | | // parse a component of the expanded set. |
| | |
| | | isWindows; |
| | | platform; |
| | | windowsNoMagicRoot; |
| | | maxGlobstarRecursion; |
| | | regexp; |
| | | constructor(pattern, options = {}) { |
| | | assertValidPattern(pattern); |
| | | options = options || {}; |
| | | this.options = options; |
| | | this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200; |
| | | this.pattern = pattern; |
| | | this.platform = options.platform || defaultPlatform; |
| | | this.isWindows = this.platform === 'win32'; |
| | | // avoid the annoying deprecation flag lol |
| | | const awe = ('allowWindow' + 'sEscape'); |
| | | this.windowsPathsNoEscape = |
| | | !!options.windowsPathsNoEscape || options.allowWindowsEscape === false; |
| | | !!options.windowsPathsNoEscape || options[awe] === false; |
| | | if (this.windowsPathsNoEscape) { |
| | | this.pattern = this.pattern.replace(/\\/g, '/'); |
| | | } |
| | |
| | | this.partial = !!options.partial; |
| | | this.nocase = !!this.options.nocase; |
| | | this.windowsNoMagicRoot = |
| | | options.windowsNoMagicRoot !== undefined |
| | | ? options.windowsNoMagicRoot |
| | | options.windowsNoMagicRoot !== undefined ? |
| | | options.windowsNoMagicRoot |
| | | : !!(this.isWindows && this.nocase); |
| | | this.globSet = []; |
| | | this.globParts = []; |
| | |
| | | !globMagic.test(s[3]); |
| | | const isDrive = /^[a-z]:/i.test(s[0]); |
| | | if (isUNC) { |
| | | return [...s.slice(0, 4), ...s.slice(4).map(ss => this.parse(ss))]; |
| | | return [ |
| | | ...s.slice(0, 4), |
| | | ...s.slice(4).map(ss => this.parse(ss)), |
| | | ]; |
| | | } |
| | | else if (isDrive) { |
| | | return [s[0], ...s.slice(1).map(ss => this.parse(ss))]; |
| | |
| | | // to the right as possible, even if it increases the number |
| | | // of patterns that we have to process. |
| | | preprocess(globParts) { |
| | | // if we're not in globstar mode, then turn all ** into * |
| | | // if we're not in globstar mode, then turn ** into * |
| | | if (this.options.noglobstar) { |
| | | for (let i = 0; i < globParts.length; i++) { |
| | | for (let j = 0; j < globParts[i].length; j++) { |
| | |
| | | // out of pattern, then that's fine, as long as all |
| | | // the parts match. |
| | | matchOne(file, pattern, partial = false) { |
| | | const options = this.options; |
| | | let fileStartIndex = 0; |
| | | let patternStartIndex = 0; |
| | | // UNC paths like //?/X:/... can match X:/... and vice versa |
| | | // Drive letters in absolute drive or unc paths are always compared |
| | | // case-insensitively. |
| | |
| | | pattern[2] === '?' && |
| | | typeof pattern[3] === 'string' && |
| | | /^[a-z]:$/i.test(pattern[3]); |
| | | const fdi = fileUNC ? 3 : fileDrive ? 0 : undefined; |
| | | const pdi = patternUNC ? 3 : patternDrive ? 0 : undefined; |
| | | const fdi = fileUNC ? 3 |
| | | : fileDrive ? 0 |
| | | : undefined; |
| | | const pdi = patternUNC ? 3 |
| | | : patternDrive ? 0 |
| | | : undefined; |
| | | if (typeof fdi === 'number' && typeof pdi === 'number') { |
| | | const [fd, pd] = [file[fdi], pattern[pdi]]; |
| | | const [fd, pd] = [ |
| | | file[fdi], |
| | | pattern[pdi], |
| | | ]; |
| | | // start matching at the drive letter index of each |
| | | if (fd.toLowerCase() === pd.toLowerCase()) { |
| | | pattern[pdi] = fd; |
| | | if (pdi > fdi) { |
| | | pattern = pattern.slice(pdi); |
| | | } |
| | | else if (fdi > pdi) { |
| | | file = file.slice(fdi); |
| | | } |
| | | patternStartIndex = pdi; |
| | | fileStartIndex = fdi; |
| | | } |
| | | } |
| | | } |
| | |
| | | if (optimizationLevel >= 2) { |
| | | file = this.levelTwoFileOptimize(file); |
| | | } |
| | | this.debug('matchOne', this, { file, pattern }); |
| | | this.debug('matchOne', file.length, pattern.length); |
| | | for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { |
| | | if (pattern.includes(GLOBSTAR)) { |
| | | return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex); |
| | | } |
| | | return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex); |
| | | } |
| | | #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) { |
| | | // split the pattern into head, tail, and middle of ** delimited parts |
| | | const firstgs = pattern.indexOf(GLOBSTAR, patternIndex); |
| | | const lastgs = pattern.lastIndexOf(GLOBSTAR); |
| | | // split the pattern up into globstar-delimited sections |
| | | // the tail has to be at the end, and the others just have |
| | | // to be found in order from the head. |
| | | const [head, body, tail] = partial ? [ |
| | | pattern.slice(patternIndex, firstgs), |
| | | pattern.slice(firstgs + 1), |
| | | [], |
| | | ] : [ |
| | | pattern.slice(patternIndex, firstgs), |
| | | pattern.slice(firstgs + 1, lastgs), |
| | | pattern.slice(lastgs + 1), |
| | | ]; |
| | | // check the head, from the current file/pattern index. |
| | | if (head.length) { |
| | | const fileHead = file.slice(fileIndex, fileIndex + head.length); |
| | | if (!this.#matchOne(fileHead, head, partial, 0, 0)) { |
| | | return false; |
| | | } |
| | | fileIndex += head.length; |
| | | patternIndex += head.length; |
| | | } |
| | | // now we know the head matches! |
| | | // if the last portion is not empty, it MUST match the end |
| | | // check the tail |
| | | let fileTailMatch = 0; |
| | | if (tail.length) { |
| | | // if head + tail > file, then we cannot possibly match |
| | | if (tail.length + fileIndex > file.length) |
| | | return false; |
| | | // try to match the tail |
| | | let tailStart = file.length - tail.length; |
| | | if (this.#matchOne(file, tail, partial, tailStart, 0)) { |
| | | fileTailMatch = tail.length; |
| | | } |
| | | else { |
| | | // affordance for stuff like a/**/* matching a/b/ |
| | | // if the last file portion is '', and there's more to the pattern |
| | | // then try without the '' bit. |
| | | if (file[file.length - 1] !== '' || |
| | | fileIndex + tail.length === file.length) { |
| | | return false; |
| | | } |
| | | tailStart--; |
| | | if (!this.#matchOne(file, tail, partial, tailStart, 0)) { |
| | | return false; |
| | | } |
| | | fileTailMatch = tail.length + 1; |
| | | } |
| | | } |
| | | // now we know the tail matches! |
| | | // the middle is zero or more portions wrapped in **, possibly |
| | | // containing more ** sections. |
| | | // so a/**/b/**/c/**/d has become **/b/**/c/** |
| | | // if it's empty, it means a/**/b, just verify we have no bad dots |
| | | // if there's no tail, so it ends on /**, then we must have *something* |
| | | // after the head, or it's not a matc |
| | | if (!body.length) { |
| | | let sawSome = !!fileTailMatch; |
| | | for (let i = fileIndex; i < file.length - fileTailMatch; i++) { |
| | | const f = String(file[i]); |
| | | sawSome = true; |
| | | if (f === '.' || |
| | | f === '..' || |
| | | (!this.options.dot && f.startsWith('.'))) { |
| | | return false; |
| | | } |
| | | } |
| | | // in partial mode, we just need to get past all file parts |
| | | return partial || sawSome; |
| | | } |
| | | // now we know that there's one or more body sections, which can |
| | | // be matched anywhere from the 0 index (because the head was pruned) |
| | | // through to the length-fileTailMatch index. |
| | | // split the body up into sections, and note the minimum index it can |
| | | // be found at (start with the length of all previous segments) |
| | | // [section, before, after] |
| | | const bodySegments = [[[], 0]]; |
| | | let currentBody = bodySegments[0]; |
| | | let nonGsParts = 0; |
| | | const nonGsPartsSums = [0]; |
| | | for (const b of body) { |
| | | if (b === GLOBSTAR) { |
| | | nonGsPartsSums.push(nonGsParts); |
| | | currentBody = [[], 0]; |
| | | bodySegments.push(currentBody); |
| | | } |
| | | else { |
| | | currentBody[0].push(b); |
| | | nonGsParts++; |
| | | } |
| | | } |
| | | let i = bodySegments.length - 1; |
| | | const fileLength = file.length - fileTailMatch; |
| | | for (const b of bodySegments) { |
| | | b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length); |
| | | } |
| | | return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch); |
| | | } |
| | | // return false for "nope, not matching" |
| | | // return null for "not matching, cannot keep trying" |
| | | #matchGlobStarBodySections(file, |
| | | // pattern section, last possible position for it |
| | | bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) { |
| | | // take the first body segment, and walk from fileIndex to its "after" |
| | | // value at the end |
| | | // If it doesn't match at that position, we increment, until we hit |
| | | // that final possible position, and give up. |
| | | // If it does match, then advance and try to rest. |
| | | // If any of them fail we keep walking forward. |
| | | // this is still a bit recursively painful, but it's more constrained |
| | | // than previous implementations, because we never test something that |
| | | // can't possibly be a valid matching condition. |
| | | const bs = bodySegments[bodyIndex]; |
| | | if (!bs) { |
| | | // just make sure that there's no bad dots |
| | | for (let i = fileIndex; i < file.length; i++) { |
| | | sawTail = true; |
| | | const f = file[i]; |
| | | if (f === '.' || |
| | | f === '..' || |
| | | (!this.options.dot && f.startsWith('.'))) { |
| | | return false; |
| | | } |
| | | } |
| | | return sawTail; |
| | | } |
| | | // have a non-globstar body section to test |
| | | const [body, after] = bs; |
| | | while (fileIndex <= after) { |
| | | const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0); |
| | | // if limit exceeded, no match. intentional false negative, |
| | | // acceptable break in correctness for security. |
| | | if (m && globStarDepth < this.maxGlobstarRecursion) { |
| | | // match! see if the rest match. if so, we're done! |
| | | const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail); |
| | | if (sub !== false) { |
| | | return sub; |
| | | } |
| | | } |
| | | const f = file[fileIndex]; |
| | | if (f === '.' || |
| | | f === '..' || |
| | | (!this.options.dot && f.startsWith('.'))) { |
| | | return false; |
| | | } |
| | | fileIndex++; |
| | | } |
| | | // walked off. no point continuing |
| | | return partial || null; |
| | | } |
| | | #matchOne(file, pattern, partial, fileIndex, patternIndex) { |
| | | let fi; |
| | | let pi; |
| | | let pl; |
| | | let fl; |
| | | for (fi = fileIndex, |
| | | pi = patternIndex, |
| | | fl = file.length, |
| | | pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { |
| | | this.debug('matchOne loop'); |
| | | var p = pattern[pi]; |
| | | var f = file[fi]; |
| | | let p = pattern[pi]; |
| | | let f = file[fi]; |
| | | this.debug(pattern, p, f); |
| | | // should be impossible. |
| | | // some invalid regexp stuff in the set. |
| | | /* c8 ignore start */ |
| | | if (p === false) { |
| | | if (p === false || p === GLOBSTAR) { |
| | | return false; |
| | | } |
| | | /* c8 ignore stop */ |
| | | if (p === GLOBSTAR) { |
| | | this.debug('GLOBSTAR', [pattern, p, f]); |
| | | // "**" |
| | | // a/**/b/**/c would match the following: |
| | | // a/b/x/y/z/c |
| | | // a/x/y/z/b/c |
| | | // a/b/x/b/x/c |
| | | // a/b/c |
| | | // To do this, take the rest of the pattern after |
| | | // the **, and see if it would match the file remainder. |
| | | // If so, return success. |
| | | // If not, the ** "swallows" a segment, and try again. |
| | | // This is recursively awful. |
| | | // |
| | | // a/**/b/**/c matching a/b/x/y/z/c |
| | | // - a matches a |
| | | // - doublestar |
| | | // - matchOne(b/x/y/z/c, b/**/c) |
| | | // - b matches b |
| | | // - doublestar |
| | | // - matchOne(x/y/z/c, c) -> no |
| | | // - matchOne(y/z/c, c) -> no |
| | | // - matchOne(z/c, c) -> no |
| | | // - matchOne(c, c) yes, hit |
| | | var fr = fi; |
| | | var pr = pi + 1; |
| | | if (pr === pl) { |
| | | this.debug('** at the end'); |
| | | // a ** at the end will just swallow the rest. |
| | | // We have found a match. |
| | | // however, it will not swallow /.x, unless |
| | | // options.dot is set. |
| | | // . and .. are *never* matched by **, for explosively |
| | | // exponential reasons. |
| | | for (; fi < fl; fi++) { |
| | | if (file[fi] === '.' || |
| | | file[fi] === '..' || |
| | | (!options.dot && file[fi].charAt(0) === '.')) |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | // ok, let's see if we can swallow whatever we can. |
| | | while (fr < fl) { |
| | | var swallowee = file[fr]; |
| | | this.debug('\nglobstar while', file, fr, pattern, pr, swallowee); |
| | | // XXX remove this slice. Just pass the start index. |
| | | if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { |
| | | this.debug('globstar found match!', fr, fl, swallowee); |
| | | // found a match. |
| | | return true; |
| | | } |
| | | else { |
| | | // can't swallow "." or ".." ever. |
| | | // can only swallow ".foo" when explicitly asked. |
| | | if (swallowee === '.' || |
| | | swallowee === '..' || |
| | | (!options.dot && swallowee.charAt(0) === '.')) { |
| | | this.debug('dot detected!', file, fr, pattern, pr); |
| | | break; |
| | | } |
| | | // ** swallows a segment, and continue. |
| | | this.debug('globstar swallow a segment, and continue'); |
| | | fr++; |
| | | } |
| | | } |
| | | // no match was found. |
| | | // However, in partial mode, we can't say this is necessarily over. |
| | | /* c8 ignore start */ |
| | | if (partial) { |
| | | // ran out of file |
| | | this.debug('\n>>> no match, partial?', file, fr, pattern, pr); |
| | | if (fr === fl) { |
| | | return true; |
| | | } |
| | | } |
| | | /* c8 ignore stop */ |
| | | return false; |
| | | } |
| | | // something other than ** |
| | | // non-magic patterns just have to match exactly |
| | | // patterns with magic have been turned into regexps. |
| | |
| | | fastTest = options.dot ? starTestDot : starTest; |
| | | } |
| | | else if ((m = pattern.match(starDotExtRE))) { |
| | | fastTest = (options.nocase |
| | | ? options.dot |
| | | ? starDotExtTestNocaseDot |
| | | fastTest = (options.nocase ? |
| | | options.dot ? |
| | | starDotExtTestNocaseDot |
| | | : starDotExtTestNocase |
| | | : options.dot |
| | | ? starDotExtTestDot |
| | | : options.dot ? starDotExtTestDot |
| | | : starDotExtTest)(m[1]); |
| | | } |
| | | else if ((m = pattern.match(qmarksRE))) { |
| | | fastTest = (options.nocase |
| | | ? options.dot |
| | | ? qmarksTestNocaseDot |
| | | fastTest = (options.nocase ? |
| | | options.dot ? |
| | | qmarksTestNocaseDot |
| | | : qmarksTestNocase |
| | | : options.dot |
| | | ? qmarksTestDot |
| | | : options.dot ? qmarksTestDot |
| | | : qmarksTest)(m); |
| | | } |
| | | else if ((m = pattern.match(starDotStarRE))) { |
| | |
| | | return this.regexp; |
| | | } |
| | | const options = this.options; |
| | | const twoStar = options.noglobstar |
| | | ? star |
| | | : options.dot |
| | | ? twoStarDot |
| | | const twoStar = options.noglobstar ? star |
| | | : options.dot ? twoStarDot |
| | | : twoStarNoDot; |
| | | const flags = new Set(options.nocase ? ['i'] : []); |
| | | // regexpify non-globstar patterns |
| | |
| | | for (const f of p.flags.split('')) |
| | | flags.add(f); |
| | | } |
| | | return typeof p === 'string' |
| | | ? regExpEscape(p) |
| | | : p === GLOBSTAR |
| | | ? GLOBSTAR |
| | | : p._src; |
| | | return (typeof p === 'string' ? regExpEscape(p) |
| | | : p === GLOBSTAR ? GLOBSTAR |
| | | : p._src); |
| | | }); |
| | | pp.forEach((p, i) => { |
| | | const next = pp[i + 1]; |
| | |
| | | (base.calls || (base.calls = [])).push(...calls); |
| | | } |
| | | } catch (e) { |
| | | ctx.error( |
| | | `Failed to resolve extends base type. |
| | | if (!ctx.silentOnExtendsFailure) { |
| | | ctx.error( |
| | | `Failed to resolve extends base type. |
| | | If this previously worked in 3.2, you can instruct the compiler to ignore this extend by adding /* @vue-ignore */ before it, for example: |
| | | |
| | | interface Props extends /* @vue-ignore */ Base {} |
| | | |
| | | Note: both in 3.2 or with the ignore, the properties in the base type are treated as fallthrough attrs at runtime.`, |
| | | ext, |
| | | scope |
| | | ); |
| | | ext, |
| | | scope |
| | | ); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | function resolveExt(filename, fs) { |
| | | filename = filename.replace(/\.js$/, ""); |
| | | let moduleType = "u"; |
| | | if (filename.endsWith(".mjs")) { |
| | | moduleType = "m"; |
| | | } else if (filename.endsWith(".cjs")) { |
| | | moduleType = "c"; |
| | | } |
| | | filename = filename.replace(/\.[cm]?jsx?$/, ""); |
| | | const tryResolve = (filename2) => { |
| | | if (fs.fileExists(filename2)) return filename2; |
| | | }; |
| | | return tryResolve(filename) || tryResolve(filename + `.ts`) || tryResolve(filename + `.tsx`) || tryResolve(filename + `.d.ts`) || tryResolve(joinPaths(filename, `index.ts`)) || tryResolve(joinPaths(filename, `index.tsx`)) || tryResolve(joinPaths(filename, `index.d.ts`)); |
| | | const resolveTs = () => tryResolve(filename + `.ts`) || tryResolve(filename + `.tsx`) || tryResolve(filename + `.d.ts`); |
| | | const resolveMts = () => tryResolve(filename + `.mts`) || tryResolve(filename + `.d.mts`); |
| | | const resolveCts = () => tryResolve(filename + `.cts`) || tryResolve(filename + `.d.cts`); |
| | | return tryResolve(filename) || // For explicit .mjs/.cjs imports, prefer .mts/.cts declarations first. |
| | | (moduleType === "m" ? resolveMts() || resolveTs() : moduleType === "c" ? resolveCts() || resolveTs() : resolveTs() || resolveMts() || resolveCts()) || tryResolve(joinPaths(filename, `index.ts`)) || tryResolve(joinPaths(filename, `index.tsx`)) || tryResolve(joinPaths(filename, `index.d.ts`)); |
| | | } |
| | | const tsConfigCache = createCache(); |
| | | const tsConfigRefMap = /* @__PURE__ */ new Map(); |
| | |
| | | } |
| | | function parseFile(filename, content, fs, parserPlugins) { |
| | | const ext = path$1.extname(filename); |
| | | if (ext === ".ts" || ext === ".mts" || ext === ".tsx" || ext === ".mtsx") { |
| | | if (ext === ".ts" || ext === ".mts" || ext === ".tsx" || ext === ".cts" || ext === ".mtsx") { |
| | | return parser$2.parse(content, { |
| | | plugins: resolveParserPlugins( |
| | | ext.slice(1), |
| | | parserPlugins, |
| | | /\.d\.m?ts$/.test(filename) |
| | | /\.d\.[cm]?ts$/.test(filename) |
| | | ), |
| | | sourceType: "module" |
| | | }).program.body; |
| | |
| | | case "TSInterfaceDeclaration": |
| | | case "TSEnumDeclaration": |
| | | case "TSModuleDeclaration": { |
| | | if (node.type === "TSModuleDeclaration" && node.global) { |
| | | const body = node.body; |
| | | for (const s of body.body) { |
| | | if (s.type === "ExportNamedDeclaration" && s.declaration) { |
| | | recordType(s.declaration, types, declares); |
| | | } else { |
| | | recordType(s, types, declares); |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | const id = overwriteId || getId(node.id); |
| | | let existing = types[id]; |
| | | if (existing) { |
| | |
| | | if (node.leadingComments && node.leadingComments.some((c) => c.value.includes("@vue-ignore"))) { |
| | | return [UNKNOWN_TYPE]; |
| | | } |
| | | const prevSilent = ctx.silentOnExtendsFailure; |
| | | ctx.silentOnExtendsFailure = true; |
| | | try { |
| | | switch (node.type) { |
| | | case "TSStringKeyword": |
| | |
| | | } |
| | | } |
| | | } catch (e) { |
| | | } finally { |
| | | ctx.silentOnExtendsFailure = prevSilent; |
| | | } |
| | | return [UNKNOWN_TYPE]; |
| | | } |
| | | function flattenTypes(ctx, types, scope, isKeyOf = false, typeParameters = void 0) { |
| | | if (types.length === 1) { |
| | | return inferRuntimeType(ctx, types[0], scope, isKeyOf, typeParameters); |
| | | return inferRuntimeType( |
| | | ctx, |
| | | types[0], |
| | | types[0]._ownerScope || scope, |
| | | isKeyOf, |
| | | typeParameters |
| | | ); |
| | | } |
| | | return [ |
| | | ...new Set( |
| | | [].concat( |
| | | ...types.map( |
| | | (t) => inferRuntimeType(ctx, t, scope, isKeyOf, typeParameters) |
| | | (t) => inferRuntimeType( |
| | | ctx, |
| | | t, |
| | | t._ownerScope || scope, |
| | | isKeyOf, |
| | | typeParameters |
| | | ) |
| | | ) |
| | | ) |
| | | ) |
| | |
| | | let modelName; |
| | | let options; |
| | | const arg0 = node.arguments[0] && CompilerDOM.unwrapTSNode(node.arguments[0]); |
| | | const hasName = arg0 && arg0.type === "StringLiteral"; |
| | | const hasName = arg0 && (arg0.type === "StringLiteral" || arg0.type === "TemplateLiteral" && arg0.expressions.length === 0); |
| | | if (hasName) { |
| | | modelName = arg0.value; |
| | | modelName = arg0.type === "StringLiteral" ? arg0.value : arg0.quasis[0].value.cooked; |
| | | options = node.arguments[1]; |
| | | } else { |
| | | modelName = "modelValue"; |
| | |
| | | if (prop.type === "ObjectProperty") { |
| | | defaultString = `default: ${ctx.getString(prop.value)}`; |
| | | } else { |
| | | defaultString = `${prop.async ? "async " : ""}${prop.kind !== "method" ? `${prop.kind} ` : ""}default() ${ctx.getString(prop.body)}`; |
| | | let paramsString = ""; |
| | | if (prop.params.length) { |
| | | const start = prop.params[0].start; |
| | | const end = prop.params[prop.params.length - 1].end; |
| | | paramsString = ctx.getString({ start, end }); |
| | | } |
| | | defaultString = `${prop.async ? "async " : ""}${prop.kind !== "method" ? `${prop.kind} ` : ""}default(${paramsString}) ${ctx.getString(prop.body)}`; |
| | | } |
| | | } |
| | | } |
| | |
| | | } else if (stmt.type === "FunctionDeclaration" || stmt.type === "ClassDeclaration") { |
| | | if (stmt.declare || !stmt.id) continue; |
| | | registerLocalBinding(stmt.id); |
| | | } else if ((stmt.type === "ForOfStatement" || stmt.type === "ForInStatement") && stmt.left.type === "VariableDeclaration") { |
| | | walkVariableDeclaration(stmt.left); |
| | | } else if (stmt.type === "ExportNamedDeclaration" && stmt.declaration && stmt.declaration.type === "VariableDeclaration") { |
| | | walkVariableDeclaration(stmt.declaration, isRoot); |
| | | } else if (stmt.type === "LabeledStatement" && stmt.body.type === "VariableDeclaration") { |
| | |
| | | walkScope(node.body); |
| | | return; |
| | | } |
| | | if (node.type === "ForOfStatement" || node.type === "ForInStatement" || node.type === "ForStatement") { |
| | | pushScope(); |
| | | const varDecl = node.type === "ForStatement" ? node.init : node.left; |
| | | if (varDecl && varDecl.type === "VariableDeclaration") { |
| | | walkVariableDeclaration(varDecl); |
| | | } |
| | | if (node.body.type === "BlockStatement") { |
| | | walkScope(node.body); |
| | | } |
| | | return; |
| | | } |
| | | if (node.type === "BlockStatement" && !CompilerDOM.isFunctionType(parent)) { |
| | | pushScope(); |
| | | walkScope(node); |
| | |
| | | }, |
| | | leave(node, parent) { |
| | | parent && parentStack.pop(); |
| | | if (node.type === "BlockStatement" && !CompilerDOM.isFunctionType(parent) || CompilerDOM.isFunctionType(node) || node.type === "CatchClause") { |
| | | if (node.type === "BlockStatement" && !CompilerDOM.isFunctionType(parent) || CompilerDOM.isFunctionType(node) || node.type === "CatchClause" || node.type === "ForOfStatement" || node.type === "ForInStatement" || node.type === "ForStatement") { |
| | | popScope(); |
| | | } |
| | | } |
| | |
| | | for (const key in setupBindings) { |
| | | ctx.bindingMetadata[key] = setupBindings[key]; |
| | | } |
| | | if (sfc.template && !sfc.template.src && sfc.template.ast) { |
| | | const vModelIds = resolveTemplateVModelIdentifiers(sfc); |
| | | if (vModelIds.size) { |
| | | const toDemote = /* @__PURE__ */ new Set(); |
| | | for (const id of vModelIds) { |
| | | if (setupBindings[id] === "setup-reactive-const") { |
| | | toDemote.add(id); |
| | | } |
| | | } |
| | | if (toDemote.size) { |
| | | for (const node of scriptSetupAst.body) { |
| | | if (node.type === "VariableDeclaration" && node.kind === "const" && !node.declare) { |
| | | const demotedInDecl = []; |
| | | for (const decl of node.declarations) { |
| | | if (decl.id.type === "Identifier" && toDemote.has(decl.id.name)) { |
| | | demotedInDecl.push(decl.id.name); |
| | | } |
| | | } |
| | | if (demotedInDecl.length) { |
| | | ctx.s.overwrite( |
| | | node.start + startOffset, |
| | | node.start + startOffset + "const".length, |
| | | "let" |
| | | ); |
| | | for (const id of demotedInDecl) { |
| | | setupBindings[id] = "setup-let"; |
| | | ctx.bindingMetadata[id] = "setup-let"; |
| | | warnOnce( |
| | | `\`v-model\` cannot update a \`const\` reactive binding \`${id}\`. The compiler has transformed it to \`let\` to make the update work.` |
| | | ); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (sfc.cssVars.length && // no need to do this when targeting SSR |
| | | !((_a = options.templateOptions) == null ? void 0 : _a.ssr)) { |
| | | ctx.helperImports.add(CSS_VARS_HELPER); |
| | |
| | | return generator.toJSON(); |
| | | } |
| | | |
| | | const version = "3.5.25"; |
| | | const version = "3.5.32"; |
| | | const parseCache = parseCache$1; |
| | | const errorMessages = { |
| | | ...CompilerDOM.errorMessages, |