File: //usr/local/lib/node_modules/less/lib/less/parse-tree.js.map
{"version":3,"file":"parse-tree.js","sourceRoot":"","sources":["../../src/less/parse-tree.js"],"names":[],"mappings":";;;AAAA,oEAAqC;AACrC,4EAA6C;AAC7C,4DAA8B;AAE9B,mBAAwB,gBAAgB;IACpC;QACI,mBAAY,IAAI,EAAE,OAAO;YACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;YACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAC3B,CAAC;QAED,yBAAK,GAAL,UAAM,OAAO;YACT,IAAI,SAAS,CAAC;YACd,IAAM,MAAM,GAAG,EAAE,CAAC;YAClB,IAAI,gBAAgB,CAAC;YACrB,IAAI;gBACA,SAAS,GAAG,IAAA,wBAAa,EAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;aACjD;YAAC,OAAO,CAAC,EAAE;gBACR,MAAM,IAAI,oBAAS,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;aACxC;YAED,IAAI;gBACA,IAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;gBAC3C,IAAI,QAAQ,EAAE;oBACV,gBAAM,CAAC,IAAI,CAAC,2CAA2C;wBACnD,wFAAwF,CAAC,CAAC;iBACjG;gBAED,IAAM,YAAY,GAAG;oBACjB,QAAQ,UAAA;oBACR,+HAA+H;oBAC/H,eAAe,EAAE,OAAO,CAAC,eAAe;oBACxC,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC;oBACzC,YAAY,EAAE,CAAC;iBAAC,CAAC;gBAErB,IAAI,OAAO,CAAC,SAAS,EAAE;oBACnB,mEAAmE;oBACnE,IAAI,OAAO,CAAC,SAAS,KAAK,IAAI,EAAE;wBAC5B,OAAO,CAAC,SAAS,GAAG,EAAE,CAAC;qBAC1B;oBACD,IAAM,aAAa,GAAG,OAAO,CAAC,SAAS,CAAC;oBAExC,kEAAkE;oBAClE,IAAI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AC,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,gBAAgB,EAAE,OAAO,SAAA,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;iBACvH;aACJ;YACD,IAAI,OAAO,CAAC,SAAS,EAAE;gBACnB,MAAM,CAAC,GAAG,GAAG,gBAAgB,CAAC,oBAAoB,EAAE,CAAC;aACxD;YAED,MAAM,CAAC,OAAO,GAAG,EAAE,CAAC;YACpB,KAAK,IAAM,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE;gBACnC,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,IAAI,KAAK,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE;oBACtG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;iBAC7B;aACJ;YACD,OAAO,MAAM,CAAC;QAClB,CAAC;QACL,gBAAC;IAAD,CAAC,AAnHD,IAmHC;IAED,OAAO,SAAS,CAAC;AACrB,CAAC;AAvHD,4BAuHC","sourcesContent":["import LessError from './less-error';\nimport transformTree from './transform-tree';\nimport logger from './logger';\n\nexport default function(SourceMapBuilder) {\n class ParseTree {\n constructor(root, imports) {\n this.root = root;\n this.imports = imports;\n }\n\n toCSS(options) {\n let evaldRoot;\n const result = {};\n let sourceMapBuilder;\n try {\n evaldRoot = transformTree(this.root, options);\n } catch (e) {\n throw new LessError(e, this.imports);\n }\n\n try {\n const compress = Boolean(options.compress);\n if (compress) {\n logger.warn('The compress option has been deprecated. ' + \n 'We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css.');\n }\n\n const toCSSOptions = {\n compress,\n // @deprecated The dumpLineNumbers option is deprecated. Use sourcemaps instead. All modes will be removed in a future version.\n dumpLineNumbers: options.dumpLineNumbers,\n strictUnits: Boolean(options.strictUnits),\n numPrecision: 8};\n\n if (options.sourceMap) {\n // Normalize sourceMap option: if it's just true, convert to object\n if (options.sourceMap === true) {\n options.sourceMap = {};\n }\n const sourceMapOpts = options.sourceMap;\n \n // Set sourceMapInputFilename if not set and filename is available\n if (!sourceMapOpts.sourceMapInputFilename && options.filename) {\n sourceMapOpts.sourceMapInputFilename = options.filename;\n }\n \n // Default sourceMapBasepath to the input file's directory if not set\n // This matches the behavior documented and implemented in bin/lessc\n if (sourceMapOpts.sourceMapBasepath === undefined && options.filename) {\n // Get directory from filename using string manipulation (works cross-platform)\n const lastSlash = Math.max(options.filename.lastIndexOf('/'), options.filename.lastIndexOf('\\\\'));\n if (lastSlash >= 0) {\n sourceMapOpts.sourceMapBasepath = options.filename.substring(0, lastSlash);\n } else {\n // No directory separator found, use current directory\n sourceMapOpts.sourceMapBasepath = '.';\n }\n }\n \n // Handle sourceMapFullFilename (CLI-specific: --source-map=filename)\n // This is converted to sourceMapFilename and sourceMapOutputFilename\n if (sourceMapOpts.sourceMapFullFilename && !sourceMapOpts.sourceMapFileInline) {\n // This case is handled by lessc before calling render\n // We just need to ensure sourceMapFilename is set if sourceMapFullFilename is provided\n if (!sourceMapOpts.sourceMapFilename && !sourceMapOpts.sourceMapURL) {\n // Extract just the basename for the sourceMappingURL comment\n const mapBase = sourceMapOpts.sourceMapFullFilename.split(/[/\\\\]/).pop();\n sourceMapOpts.sourceMapFilename = mapBase;\n }\n } else if (!sourceMapOpts.sourceMapFilename && !sourceMapOpts.sourceMapURL) {\n // If sourceMapFilename is not set and sourceMapURL is not set,\n // derive it from the output filename (if available) or input filename\n if (sourceMapOpts.sourceMapOutputFilename) {\n // Use output filename + .map\n sourceMapOpts.sourceMapFilename = sourceMapOpts.sourceMapOutputFilename + '.map';\n } else if (options.filename) {\n // Fallback to input filename + .css.map\n const inputBase = options.filename.replace(/\\.[^/.]+$/, '');\n sourceMapOpts.sourceMapFilename = inputBase + '.css.map';\n }\n }\n \n // Default sourceMapOutputFilename if not set\n if (!sourceMapOpts.sourceMapOutputFilename) {\n if (options.filename) {\n const inputBase = options.filename.replace(/\\.[^/.]+$/, '');\n sourceMapOpts.sourceMapOutputFilename = inputBase + '.css';\n } else {\n sourceMapOpts.sourceMapOutputFilename = 'output.css';\n }\n }\n \n sourceMapBuilder = new SourceMapBuilder(sourceMapOpts);\n result.css = sourceMapBuilder.toCSS(evaldRoot, toCSSOptions, this.imports);\n } else {\n result.css = evaldRoot.toCSS(toCSSOptions);\n }\n } catch (e) {\n throw new LessError(e, this.imports);\n }\n\n if (options.pluginManager) {\n const postProcessors = options.pluginManager.getPostProcessors();\n for (let i = 0; i < postProcessors.length; i++) {\n result.css = postProcessors[i].process(result.css, { sourceMap: sourceMapBuilder, options, imports: this.imports });\n }\n }\n if (options.sourceMap) {\n result.map = sourceMapBuilder.getExternalSourceMap();\n }\n\n result.imports = [];\n for (const file in this.imports.files) {\n if (Object.prototype.hasOwnProperty.call(this.imports.files, file) && file !== this.imports.rootFilename) {\n result.imports.push(file);\n }\n }\n return result;\n }\n }\n\n return ParseTree;\n}\n"]}