Addnew sheets (armor, weapons, malefica) and v13 support

This commit is contained in:
2025-05-18 23:51:26 +02:00
parent 7672f861ff
commit 995d61e1c6
4478 changed files with 667857 additions and 620 deletions

15
node_modules/less/lib/less/constants.js generated vendored Normal file
View File

@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RewriteUrls = exports.Math = void 0;
exports.Math = {
ALWAYS: 0,
PARENS_DIVISION: 1,
PARENS: 2
// removed - STRICT_LEGACY: 3
};
exports.RewriteUrls = {
OFF: 0,
LOCAL: 1,
ALL: 2
};
//# sourceMappingURL=constants.js.map

1
node_modules/less/lib/less/constants.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/less/constants.js"],"names":[],"mappings":";;;AACa,QAAA,IAAI,GAAG;IAChB,MAAM,EAAE,CAAC;IACT,eAAe,EAAE,CAAC;IAClB,MAAM,EAAE,CAAC;IACT,6BAA6B;CAChC,CAAC;AAEW,QAAA,WAAW,GAAG;IACvB,GAAG,EAAE,CAAC;IACN,KAAK,EAAE,CAAC;IACR,GAAG,EAAE,CAAC;CACT,CAAC","sourcesContent":["\nexport const Math = {\n ALWAYS: 0,\n PARENS_DIVISION: 1,\n PARENS: 2\n // removed - STRICT_LEGACY: 3\n};\n\nexport const RewriteUrls = {\n OFF: 0,\n LOCAL: 1,\n ALL: 2\n};"]}

149
node_modules/less/lib/less/contexts.js generated vendored Normal file
View File

@@ -0,0 +1,149 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var contexts = {};
exports.default = contexts;
var Constants = tslib_1.__importStar(require("./constants"));
var copyFromOriginal = function copyFromOriginal(original, destination, propertiesToCopy) {
if (!original) {
return;
}
for (var i = 0; i < propertiesToCopy.length; i++) {
if (Object.prototype.hasOwnProperty.call(original, propertiesToCopy[i])) {
destination[propertiesToCopy[i]] = original[propertiesToCopy[i]];
}
}
};
/*
parse is used whilst parsing
*/
var parseCopyProperties = [
// options
'paths',
'rewriteUrls',
'rootpath',
'strictImports',
'insecure',
'dumpLineNumbers',
'compress',
'syncImport',
'chunkInput',
'mime',
'useFileCache',
// context
'processImports',
// Used by the import manager to stop multiple import visitors being created.
'pluginManager' // Used as the plugin manager for the session
];
contexts.Parse = function (options) {
copyFromOriginal(options, this, parseCopyProperties);
if (typeof this.paths === 'string') {
this.paths = [this.paths];
}
};
var evalCopyProperties = [
'paths',
'compress',
'math',
'strictUnits',
'sourceMap',
'importMultiple',
'urlArgs',
'javascriptEnabled',
'pluginManager',
'importantScope',
'rewriteUrls' // option - whether to adjust URL's to be relative
];
contexts.Eval = function (options, frames) {
copyFromOriginal(options, this, evalCopyProperties);
if (typeof this.paths === 'string') {
this.paths = [this.paths];
}
this.frames = frames || [];
this.importantScope = this.importantScope || [];
};
contexts.Eval.prototype.enterCalc = function () {
if (!this.calcStack) {
this.calcStack = [];
}
this.calcStack.push(true);
this.inCalc = true;
};
contexts.Eval.prototype.exitCalc = function () {
this.calcStack.pop();
if (!this.calcStack.length) {
this.inCalc = false;
}
};
contexts.Eval.prototype.inParenthesis = function () {
if (!this.parensStack) {
this.parensStack = [];
}
this.parensStack.push(true);
};
contexts.Eval.prototype.outOfParenthesis = function () {
this.parensStack.pop();
};
contexts.Eval.prototype.inCalc = false;
contexts.Eval.prototype.mathOn = true;
contexts.Eval.prototype.isMathOn = function (op) {
if (!this.mathOn) {
return false;
}
if (op === '/' && this.math !== Constants.Math.ALWAYS && (!this.parensStack || !this.parensStack.length)) {
return false;
}
if (this.math > Constants.Math.PARENS_DIVISION) {
return this.parensStack && this.parensStack.length;
}
return true;
};
contexts.Eval.prototype.pathRequiresRewrite = function (path) {
var isRelative = this.rewriteUrls === Constants.RewriteUrls.LOCAL ? isPathLocalRelative : isPathRelative;
return isRelative(path);
};
contexts.Eval.prototype.rewritePath = function (path, rootpath) {
var newPath;
rootpath = rootpath || '';
newPath = this.normalizePath(rootpath + path);
// If a path was explicit relative and the rootpath was not an absolute path
// we must ensure that the new path is also explicit relative.
if (isPathLocalRelative(path) &&
isPathRelative(rootpath) &&
isPathLocalRelative(newPath) === false) {
newPath = "./".concat(newPath);
}
return newPath;
};
contexts.Eval.prototype.normalizePath = function (path) {
var segments = path.split('/').reverse();
var segment;
path = [];
while (segments.length !== 0) {
segment = segments.pop();
switch (segment) {
case '.':
break;
case '..':
if ((path.length === 0) || (path[path.length - 1] === '..')) {
path.push(segment);
}
else {
path.pop();
}
break;
default:
path.push(segment);
break;
}
}
return path.join('/');
};
function isPathRelative(path) {
return !/^(?:[a-z-]+:|\/|#)/i.test(path);
}
function isPathLocalRelative(path) {
return path.charAt(0) === '.';
}
// todo - do the same for the toCSS ?
//# sourceMappingURL=contexts.js.map

1
node_modules/less/lib/less/contexts.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

153
node_modules/less/lib/less/data/colors.js generated vendored Normal file
View File

@@ -0,0 +1,153 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
'aliceblue': '#f0f8ff',
'antiquewhite': '#faebd7',
'aqua': '#00ffff',
'aquamarine': '#7fffd4',
'azure': '#f0ffff',
'beige': '#f5f5dc',
'bisque': '#ffe4c4',
'black': '#000000',
'blanchedalmond': '#ffebcd',
'blue': '#0000ff',
'blueviolet': '#8a2be2',
'brown': '#a52a2a',
'burlywood': '#deb887',
'cadetblue': '#5f9ea0',
'chartreuse': '#7fff00',
'chocolate': '#d2691e',
'coral': '#ff7f50',
'cornflowerblue': '#6495ed',
'cornsilk': '#fff8dc',
'crimson': '#dc143c',
'cyan': '#00ffff',
'darkblue': '#00008b',
'darkcyan': '#008b8b',
'darkgoldenrod': '#b8860b',
'darkgray': '#a9a9a9',
'darkgrey': '#a9a9a9',
'darkgreen': '#006400',
'darkkhaki': '#bdb76b',
'darkmagenta': '#8b008b',
'darkolivegreen': '#556b2f',
'darkorange': '#ff8c00',
'darkorchid': '#9932cc',
'darkred': '#8b0000',
'darksalmon': '#e9967a',
'darkseagreen': '#8fbc8f',
'darkslateblue': '#483d8b',
'darkslategray': '#2f4f4f',
'darkslategrey': '#2f4f4f',
'darkturquoise': '#00ced1',
'darkviolet': '#9400d3',
'deeppink': '#ff1493',
'deepskyblue': '#00bfff',
'dimgray': '#696969',
'dimgrey': '#696969',
'dodgerblue': '#1e90ff',
'firebrick': '#b22222',
'floralwhite': '#fffaf0',
'forestgreen': '#228b22',
'fuchsia': '#ff00ff',
'gainsboro': '#dcdcdc',
'ghostwhite': '#f8f8ff',
'gold': '#ffd700',
'goldenrod': '#daa520',
'gray': '#808080',
'grey': '#808080',
'green': '#008000',
'greenyellow': '#adff2f',
'honeydew': '#f0fff0',
'hotpink': '#ff69b4',
'indianred': '#cd5c5c',
'indigo': '#4b0082',
'ivory': '#fffff0',
'khaki': '#f0e68c',
'lavender': '#e6e6fa',
'lavenderblush': '#fff0f5',
'lawngreen': '#7cfc00',
'lemonchiffon': '#fffacd',
'lightblue': '#add8e6',
'lightcoral': '#f08080',
'lightcyan': '#e0ffff',
'lightgoldenrodyellow': '#fafad2',
'lightgray': '#d3d3d3',
'lightgrey': '#d3d3d3',
'lightgreen': '#90ee90',
'lightpink': '#ffb6c1',
'lightsalmon': '#ffa07a',
'lightseagreen': '#20b2aa',
'lightskyblue': '#87cefa',
'lightslategray': '#778899',
'lightslategrey': '#778899',
'lightsteelblue': '#b0c4de',
'lightyellow': '#ffffe0',
'lime': '#00ff00',
'limegreen': '#32cd32',
'linen': '#faf0e6',
'magenta': '#ff00ff',
'maroon': '#800000',
'mediumaquamarine': '#66cdaa',
'mediumblue': '#0000cd',
'mediumorchid': '#ba55d3',
'mediumpurple': '#9370d8',
'mediumseagreen': '#3cb371',
'mediumslateblue': '#7b68ee',
'mediumspringgreen': '#00fa9a',
'mediumturquoise': '#48d1cc',
'mediumvioletred': '#c71585',
'midnightblue': '#191970',
'mintcream': '#f5fffa',
'mistyrose': '#ffe4e1',
'moccasin': '#ffe4b5',
'navajowhite': '#ffdead',
'navy': '#000080',
'oldlace': '#fdf5e6',
'olive': '#808000',
'olivedrab': '#6b8e23',
'orange': '#ffa500',
'orangered': '#ff4500',
'orchid': '#da70d6',
'palegoldenrod': '#eee8aa',
'palegreen': '#98fb98',
'paleturquoise': '#afeeee',
'palevioletred': '#d87093',
'papayawhip': '#ffefd5',
'peachpuff': '#ffdab9',
'peru': '#cd853f',
'pink': '#ffc0cb',
'plum': '#dda0dd',
'powderblue': '#b0e0e6',
'purple': '#800080',
'rebeccapurple': '#663399',
'red': '#ff0000',
'rosybrown': '#bc8f8f',
'royalblue': '#4169e1',
'saddlebrown': '#8b4513',
'salmon': '#fa8072',
'sandybrown': '#f4a460',
'seagreen': '#2e8b57',
'seashell': '#fff5ee',
'sienna': '#a0522d',
'silver': '#c0c0c0',
'skyblue': '#87ceeb',
'slateblue': '#6a5acd',
'slategray': '#708090',
'slategrey': '#708090',
'snow': '#fffafa',
'springgreen': '#00ff7f',
'steelblue': '#4682b4',
'tan': '#d2b48c',
'teal': '#008080',
'thistle': '#d8bfd8',
'tomato': '#ff6347',
'turquoise': '#40e0d0',
'violet': '#ee82ee',
'wheat': '#f5deb3',
'white': '#ffffff',
'whitesmoke': '#f5f5f5',
'yellow': '#ffff00',
'yellowgreen': '#9acd32'
};
//# sourceMappingURL=colors.js.map

1
node_modules/less/lib/less/data/colors.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

7
node_modules/less/lib/less/data/index.js generated vendored Normal file
View File

@@ -0,0 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var colors_1 = tslib_1.__importDefault(require("./colors"));
var unit_conversions_1 = tslib_1.__importDefault(require("./unit-conversions"));
exports.default = { colors: colors_1.default, unitConversions: unit_conversions_1.default };
//# sourceMappingURL=index.js.map

1
node_modules/less/lib/less/data/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/less/data/index.js"],"names":[],"mappings":";;;AAAA,4DAA8B;AAC9B,gFAAiD;AAEjD,kBAAe,EAAE,MAAM,kBAAA,EAAE,eAAe,4BAAA,EAAE,CAAC","sourcesContent":["import colors from './colors';\nimport unitConversions from './unit-conversions';\n\nexport default { colors, unitConversions };\n"]}

24
node_modules/less/lib/less/data/unit-conversions.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
length: {
'm': 1,
'cm': 0.01,
'mm': 0.001,
'in': 0.0254,
'px': 0.0254 / 96,
'pt': 0.0254 / 72,
'pc': 0.0254 / 72 * 12
},
duration: {
's': 1,
'ms': 0.001
},
angle: {
'rad': 1 / (2 * Math.PI),
'deg': 1 / 360,
'grad': 1 / 400,
'turn': 1
}
};
//# sourceMappingURL=unit-conversions.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"unit-conversions.js","sourceRoot":"","sources":["../../../src/less/data/unit-conversions.js"],"names":[],"mappings":";;AAAA,kBAAe;IACX,MAAM,EAAE;QACJ,GAAG,EAAE,CAAC;QACN,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,MAAM,GAAG,EAAE;QACjB,IAAI,EAAE,MAAM,GAAG,EAAE;QACjB,IAAI,EAAE,MAAM,GAAG,EAAE,GAAG,EAAE;KACzB;IACD,QAAQ,EAAE;QACN,GAAG,EAAE,CAAC;QACN,IAAI,EAAE,KAAK;KACd;IACD,KAAK,EAAE;QACH,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;QACxB,KAAK,EAAE,CAAC,GAAG,GAAG;QACd,MAAM,EAAE,CAAC,GAAG,GAAG;QACf,MAAM,EAAE,CAAC;KACZ;CACJ,CAAC","sourcesContent":["export default {\n length: {\n 'm': 1,\n 'cm': 0.01,\n 'mm': 0.001,\n 'in': 0.0254,\n 'px': 0.0254 / 96,\n 'pt': 0.0254 / 72,\n 'pc': 0.0254 / 72 * 12\n },\n duration: {\n 's': 1,\n 'ms': 0.001\n },\n angle: {\n 'rad': 1 / (2 * Math.PI),\n 'deg': 1 / 360,\n 'grad': 1 / 400,\n 'turn': 1\n }\n};"]}

60
node_modules/less/lib/less/default-options.js generated vendored Normal file
View File

@@ -0,0 +1,60 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// Export a new default each time
function default_1() {
return {
/* Inline Javascript - @plugin still allowed */
javascriptEnabled: false,
/* Outputs a makefile import dependency list to stdout. */
depends: false,
/* (DEPRECATED) Compress using less built-in compression.
* This does an okay job but does not utilise all the tricks of
* dedicated css compression. */
compress: false,
/* Runs the less parser and just reports errors without any output. */
lint: false,
/* Sets available include paths.
* If the file in an @import rule does not exist at that exact location,
* less will look for it at the location(s) passed to this option.
* You might use this for instance to specify a path to a library which
* you want to be referenced simply and relatively in the less files. */
paths: [],
/* color output in the terminal */
color: true,
/* The strictImports controls whether the compiler will allow an @import inside of either
* @media blocks or (a later addition) other selector blocks.
* See: https://github.com/less/less.js/issues/656 */
strictImports: false,
/* Allow Imports from Insecure HTTPS Hosts */
insecure: false,
/* Allows you to add a path to every generated import and url in your css.
* This does not affect less import statements that are processed, just ones
* that are left in the output css. */
rootpath: '',
/* By default URLs are kept as-is, so if you import a file in a sub-directory
* that references an image, exactly the same URL will be output in the css.
* This option allows you to re-write URL's in imported files so that the
* URL is always relative to the base imported file */
rewriteUrls: false,
/* How to process math
* 0 always - eagerly try to solve all operations
* 1 parens-division - require parens for division "/"
* 2 parens | strict - require parens for all operations
* 3 strict-legacy - legacy strict behavior (super-strict)
*/
math: 1,
/* Without this option, less attempts to guess at the output unit when it does maths. */
strictUnits: false,
/* Effectively the declaration is put at the top of your base Less file,
* meaning it can be used but it also can be overridden if this variable
* is defined in the file. */
globalVars: null,
/* As opposed to the global variable option, this puts the declaration at the
* end of your base file, meaning it will override anything defined in your Less file. */
modifyVars: null,
/* This option allows you to specify a argument to go on to every URL. */
urlArgs: ''
};
}
exports.default = default_1;
//# sourceMappingURL=default-options.js.map

1
node_modules/less/lib/less/default-options.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"default-options.js","sourceRoot":"","sources":["../../src/less/default-options.js"],"names":[],"mappings":";;AAAA,iCAAiC;AACjC;IACI,OAAO;QACH,+CAA+C;QAC/C,iBAAiB,EAAE,KAAK;QAExB,0DAA0D;QAC1D,OAAO,EAAE,KAAK;QAEd;;wCAEgC;QAChC,QAAQ,EAAE,KAAK;QAEf,sEAAsE;QACtE,IAAI,EAAE,KAAK;QAEX;;;;gFAIwE;QACxE,KAAK,EAAE,EAAE;QAET,kCAAkC;QAClC,KAAK,EAAE,IAAI;QAEX;;6DAEqD;QACrD,aAAa,EAAE,KAAK;QAEpB,6CAA6C;QAC7C,QAAQ,EAAE,KAAK;QAEf;;8CAEsC;QACtC,QAAQ,EAAE,EAAE;QAEZ;;;8DAGsD;QACtD,WAAW,EAAE,KAAK;QAElB;;;;;WAKG;QACH,IAAI,EAAE,CAAC;QAEP,wFAAwF;QACxF,WAAW,EAAE,KAAK;QAElB;;qCAE6B;QAC7B,UAAU,EAAE,IAAI;QAEhB;iGACyF;QACzF,UAAU,EAAE,IAAI;QAEhB,0EAA0E;QAC1E,OAAO,EAAE,EAAE;KACd,CAAA;AACL,CAAC;AApED,4BAoEC","sourcesContent":["// Export a new default each time\nexport default function() {\n return {\n /* Inline Javascript - @plugin still allowed */\n javascriptEnabled: false,\n\n /* Outputs a makefile import dependency list to stdout. */\n depends: false,\n\n /* (DEPRECATED) Compress using less built-in compression. \n * This does an okay job but does not utilise all the tricks of \n * dedicated css compression. */\n compress: false,\n\n /* Runs the less parser and just reports errors without any output. */\n lint: false,\n\n /* Sets available include paths.\n * If the file in an @import rule does not exist at that exact location, \n * less will look for it at the location(s) passed to this option. \n * You might use this for instance to specify a path to a library which \n * you want to be referenced simply and relatively in the less files. */\n paths: [],\n\n /* color output in the terminal */\n color: true,\n\n /* The strictImports controls whether the compiler will allow an @import inside of either \n * @media blocks or (a later addition) other selector blocks.\n * See: https://github.com/less/less.js/issues/656 */\n strictImports: false,\n\n /* Allow Imports from Insecure HTTPS Hosts */\n insecure: false,\n\n /* Allows you to add a path to every generated import and url in your css. \n * This does not affect less import statements that are processed, just ones \n * that are left in the output css. */\n rootpath: '',\n\n /* By default URLs are kept as-is, so if you import a file in a sub-directory \n * that references an image, exactly the same URL will be output in the css. \n * This option allows you to re-write URL's in imported files so that the \n * URL is always relative to the base imported file */\n rewriteUrls: false,\n\n /* How to process math \n * 0 always - eagerly try to solve all operations\n * 1 parens-division - require parens for division \"/\"\n * 2 parens | strict - require parens for all operations\n * 3 strict-legacy - legacy strict behavior (super-strict)\n */\n math: 1,\n\n /* Without this option, less attempts to guess at the output unit when it does maths. */\n strictUnits: false,\n\n /* Effectively the declaration is put at the top of your base Less file, \n * meaning it can be used but it also can be overridden if this variable \n * is defined in the file. */\n globalVars: null,\n\n /* As opposed to the global variable option, this puts the declaration at the\n * end of your base file, meaning it will override anything defined in your Less file. */\n modifyVars: null,\n\n /* This option allows you to specify a argument to go on to every URL. */\n urlArgs: ''\n }\n}"]}

View File

@@ -0,0 +1,128 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var AbstractFileManager = /** @class */ (function () {
function AbstractFileManager() {
}
AbstractFileManager.prototype.getPath = function (filename) {
var j = filename.lastIndexOf('?');
if (j > 0) {
filename = filename.slice(0, j);
}
j = filename.lastIndexOf('/');
if (j < 0) {
j = filename.lastIndexOf('\\');
}
if (j < 0) {
return '';
}
return filename.slice(0, j + 1);
};
AbstractFileManager.prototype.tryAppendExtension = function (path, ext) {
return /(\.[a-z]*$)|([?;].*)$/.test(path) ? path : path + ext;
};
AbstractFileManager.prototype.tryAppendLessExtension = function (path) {
return this.tryAppendExtension(path, '.less');
};
AbstractFileManager.prototype.supportsSync = function () {
return false;
};
AbstractFileManager.prototype.alwaysMakePathsAbsolute = function () {
return false;
};
AbstractFileManager.prototype.isPathAbsolute = function (filename) {
return (/^(?:[a-z-]+:|\/|\\|#)/i).test(filename);
};
// TODO: pull out / replace?
AbstractFileManager.prototype.join = function (basePath, laterPath) {
if (!basePath) {
return laterPath;
}
return basePath + laterPath;
};
AbstractFileManager.prototype.pathDiff = function (url, baseUrl) {
// diff between two paths to create a relative path
var urlParts = this.extractUrlParts(url);
var baseUrlParts = this.extractUrlParts(baseUrl);
var i;
var max;
var urlDirectories;
var baseUrlDirectories;
var diff = '';
if (urlParts.hostPart !== baseUrlParts.hostPart) {
return '';
}
max = Math.max(baseUrlParts.directories.length, urlParts.directories.length);
for (i = 0; i < max; i++) {
if (baseUrlParts.directories[i] !== urlParts.directories[i]) {
break;
}
}
baseUrlDirectories = baseUrlParts.directories.slice(i);
urlDirectories = urlParts.directories.slice(i);
for (i = 0; i < baseUrlDirectories.length - 1; i++) {
diff += '../';
}
for (i = 0; i < urlDirectories.length - 1; i++) {
diff += "".concat(urlDirectories[i], "/");
}
return diff;
};
/**
* Helper function, not part of API.
* This should be replaceable by newer Node / Browser APIs
*
* @param {string} url
* @param {string} baseUrl
*/
AbstractFileManager.prototype.extractUrlParts = function (url, baseUrl) {
// urlParts[1] = protocol://hostname/ OR /
// urlParts[2] = / if path relative to host base
// urlParts[3] = directories
// urlParts[4] = filename
// urlParts[5] = parameters
var urlPartsRegex = /^((?:[a-z-]+:)?\/{2}(?:[^/?#]*\/)|([/\\]))?((?:[^/\\?#]*[/\\])*)([^/\\?#]*)([#?].*)?$/i;
var urlParts = url.match(urlPartsRegex);
var returner = {};
var rawDirectories = [];
var directories = [];
var i;
var baseUrlParts;
if (!urlParts) {
throw new Error("Could not parse sheet href - '".concat(url, "'"));
}
// Stylesheets in IE don't always return the full path
if (baseUrl && (!urlParts[1] || urlParts[2])) {
baseUrlParts = baseUrl.match(urlPartsRegex);
if (!baseUrlParts) {
throw new Error("Could not parse page url - '".concat(baseUrl, "'"));
}
urlParts[1] = urlParts[1] || baseUrlParts[1] || '';
if (!urlParts[2]) {
urlParts[3] = baseUrlParts[3] + urlParts[3];
}
}
if (urlParts[3]) {
rawDirectories = urlParts[3].replace(/\\/g, '/').split('/');
// collapse '..' and skip '.'
for (i = 0; i < rawDirectories.length; i++) {
if (rawDirectories[i] === '..') {
directories.pop();
}
else if (rawDirectories[i] !== '.') {
directories.push(rawDirectories[i]);
}
}
}
returner.hostPart = urlParts[1];
returner.directories = directories;
returner.rawPath = (urlParts[1] || '') + rawDirectories.join('/');
returner.path = (urlParts[1] || '') + directories.join('/');
returner.filename = urlParts[4];
returner.fileUrl = returner.path + (urlParts[4] || '');
returner.url = returner.fileUrl + (urlParts[5] || '');
return returner;
};
return AbstractFileManager;
}());
exports.default = AbstractFileManager;
//# sourceMappingURL=abstract-file-manager.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,162 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var function_registry_1 = tslib_1.__importDefault(require("../functions/function-registry"));
var less_error_1 = tslib_1.__importDefault(require("../less-error"));
var AbstractPluginLoader = /** @class */ (function () {
function AbstractPluginLoader() {
// Implemented by Node.js plugin loader
this.require = function () {
return null;
};
}
AbstractPluginLoader.prototype.evalPlugin = function (contents, context, imports, pluginOptions, fileInfo) {
var loader, registry, pluginObj, localModule, pluginManager, filename, result;
pluginManager = context.pluginManager;
if (fileInfo) {
if (typeof fileInfo === 'string') {
filename = fileInfo;
}
else {
filename = fileInfo.filename;
}
}
var shortname = (new this.less.FileManager()).extractUrlParts(filename).filename;
if (filename) {
pluginObj = pluginManager.get(filename);
if (pluginObj) {
result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions);
if (result) {
return result;
}
try {
if (pluginObj.use) {
pluginObj.use.call(this.context, pluginObj);
}
}
catch (e) {
e.message = e.message || 'Error during @plugin call';
return new less_error_1.default(e, imports, filename);
}
return pluginObj;
}
}
localModule = {
exports: {},
pluginManager: pluginManager,
fileInfo: fileInfo
};
registry = function_registry_1.default.create();
var registerPlugin = function (obj) {
pluginObj = obj;
};
try {
loader = new Function('module', 'require', 'registerPlugin', 'functions', 'tree', 'less', 'fileInfo', contents);
loader(localModule, this.require(filename), registerPlugin, registry, this.less.tree, this.less, fileInfo);
}
catch (e) {
return new less_error_1.default(e, imports, filename);
}
if (!pluginObj) {
pluginObj = localModule.exports;
}
pluginObj = this.validatePlugin(pluginObj, filename, shortname);
if (pluginObj instanceof less_error_1.default) {
return pluginObj;
}
if (pluginObj) {
pluginObj.imports = imports;
pluginObj.filename = filename;
// For < 3.x (or unspecified minVersion) - setOptions() before install()
if (!pluginObj.minVersion || this.compareVersion('3.0.0', pluginObj.minVersion) < 0) {
result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions);
if (result) {
return result;
}
}
// Run on first load
pluginManager.addPlugin(pluginObj, fileInfo.filename, registry);
pluginObj.functions = registry.getLocalFunctions();
// Need to call setOptions again because the pluginObj might have functions
result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions);
if (result) {
return result;
}
// Run every @plugin call
try {
if (pluginObj.use) {
pluginObj.use.call(this.context, pluginObj);
}
}
catch (e) {
e.message = e.message || 'Error during @plugin call';
return new less_error_1.default(e, imports, filename);
}
}
else {
return new less_error_1.default({ message: 'Not a valid plugin' }, imports, filename);
}
return pluginObj;
};
AbstractPluginLoader.prototype.trySetOptions = function (plugin, filename, name, options) {
if (options && !plugin.setOptions) {
return new less_error_1.default({
message: "Options have been provided but the plugin ".concat(name, " does not support any options.")
});
}
try {
plugin.setOptions && plugin.setOptions(options);
}
catch (e) {
return new less_error_1.default(e);
}
};
AbstractPluginLoader.prototype.validatePlugin = function (plugin, filename, name) {
if (plugin) {
// support plugins being a function
// so that the plugin can be more usable programmatically
if (typeof plugin === 'function') {
plugin = new plugin();
}
if (plugin.minVersion) {
if (this.compareVersion(plugin.minVersion, this.less.version) < 0) {
return new less_error_1.default({
message: "Plugin ".concat(name, " requires version ").concat(this.versionToString(plugin.minVersion))
});
}
}
return plugin;
}
return null;
};
AbstractPluginLoader.prototype.compareVersion = function (aVersion, bVersion) {
if (typeof aVersion === 'string') {
aVersion = aVersion.match(/^(\d+)\.?(\d+)?\.?(\d+)?/);
aVersion.shift();
}
for (var i = 0; i < aVersion.length; i++) {
if (aVersion[i] !== bVersion[i]) {
return parseInt(aVersion[i]) > parseInt(bVersion[i]) ? -1 : 1;
}
}
return 0;
};
AbstractPluginLoader.prototype.versionToString = function (version) {
var versionString = '';
for (var i = 0; i < version.length; i++) {
versionString += (versionString ? '.' : '') + version[i];
}
return versionString;
};
AbstractPluginLoader.prototype.printUsage = function (plugins) {
for (var i = 0; i < plugins.length; i++) {
var plugin = plugins[i];
if (plugin.printUsage) {
plugin.printUsage();
}
}
};
return AbstractPluginLoader;
}());
exports.default = AbstractPluginLoader;
//# sourceMappingURL=abstract-plugin-loader.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=environment-api.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"environment-api.js","sourceRoot":"","sources":["../../../src/less/environment/environment-api.ts"],"names":[],"mappings":"","sourcesContent":["export interface Environment {\n /**\n * Converts a string to a base 64 string\n */\n encodeBase64(str: string): string\n /**\n * Lookup the mime-type of a filename\n */\n mimeLookup(filename: string): string\n /**\n * Look up the charset of a mime type\n * @param mime\n */\n charsetLookup(mime: string): string\n /**\n * Gets a source map generator\n *\n * @todo - Figure out precise type\n */\n getSourceMapGenerator(): any\n}\n"]}

55
node_modules/less/lib/less/environment/environment.js generated vendored Normal file
View File

@@ -0,0 +1,55 @@
"use strict";
/**
* @todo Document why this abstraction exists, and the relationship between
* environment, file managers, and plugin manager
*/
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var logger_1 = tslib_1.__importDefault(require("../logger"));
var Environment = /** @class */ (function () {
function Environment(externalEnvironment, fileManagers) {
this.fileManagers = fileManagers || [];
externalEnvironment = externalEnvironment || {};
var optionalFunctions = ['encodeBase64', 'mimeLookup', 'charsetLookup', 'getSourceMapGenerator'];
var requiredFunctions = [];
var functions = requiredFunctions.concat(optionalFunctions);
for (var i = 0; i < functions.length; i++) {
var propName = functions[i];
var environmentFunc = externalEnvironment[propName];
if (environmentFunc) {
this[propName] = environmentFunc.bind(externalEnvironment);
}
else if (i < requiredFunctions.length) {
this.warn("missing required function in environment - ".concat(propName));
}
}
}
Environment.prototype.getFileManager = function (filename, currentDirectory, options, environment, isSync) {
if (!filename) {
logger_1.default.warn('getFileManager called with no filename.. Please report this issue. continuing.');
}
if (currentDirectory === undefined) {
logger_1.default.warn('getFileManager called with null directory.. Please report this issue. continuing.');
}
var fileManagers = this.fileManagers;
if (options.pluginManager) {
fileManagers = [].concat(fileManagers).concat(options.pluginManager.getFileManagers());
}
for (var i = fileManagers.length - 1; i >= 0; i--) {
var fileManager = fileManagers[i];
if (fileManager[isSync ? 'supportsSync' : 'supports'](filename, currentDirectory, options, environment)) {
return fileManager;
}
}
return null;
};
Environment.prototype.addFileManager = function (fileManager) {
this.fileManagers.push(fileManager);
};
Environment.prototype.clearFileManagers = function () {
this.fileManagers = [];
};
return Environment;
}());
exports.default = Environment;
//# sourceMappingURL=environment.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../../../src/less/environment/environment.js"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6DAA+B;AAE/B;IACI,qBAAY,mBAAmB,EAAE,YAAY;QACzC,IAAI,CAAC,YAAY,GAAG,YAAY,IAAI,EAAE,CAAC;QACvC,mBAAmB,GAAG,mBAAmB,IAAI,EAAE,CAAC;QAEhD,IAAM,iBAAiB,GAAG,CAAC,cAAc,EAAE,YAAY,EAAE,eAAe,EAAE,uBAAuB,CAAC,CAAC;QACnG,IAAM,iBAAiB,GAAG,EAAE,CAAC;QAC7B,IAAM,SAAS,GAAG,iBAAiB,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;QAE9D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACvC,IAAM,QAAQ,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;YAC9B,IAAM,eAAe,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;YACtD,IAAI,eAAe,EAAE;gBACjB,IAAI,CAAC,QAAQ,CAAC,GAAG,eAAe,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;aAC9D;iBAAM,IAAI,CAAC,GAAG,iBAAiB,CAAC,MAAM,EAAE;gBACrC,IAAI,CAAC,IAAI,CAAC,qDAA8C,QAAQ,CAAE,CAAC,CAAC;aACvE;SACJ;IACL,CAAC;IAED,oCAAc,GAAd,UAAe,QAAQ,EAAE,gBAAgB,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM;QAEnE,IAAI,CAAC,QAAQ,EAAE;YACX,gBAAM,CAAC,IAAI,CAAC,gFAAgF,CAAC,CAAC;SACjG;QACD,IAAI,gBAAgB,KAAK,SAAS,EAAE;YAChC,gBAAM,CAAC,IAAI,CAAC,mFAAmF,CAAC,CAAC;SACpG;QAED,IAAI,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;QACrC,IAAI,OAAO,CAAC,aAAa,EAAE;YACvB,YAAY,GAAG,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,eAAe,EAAE,CAAC,CAAC;SAC1F;QACD,KAAK,IAAI,CAAC,GAAG,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAG,CAAC,EAAE,EAAE;YAChD,IAAM,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;YACpC,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE,gBAAgB,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE;gBACrG,OAAO,WAAW,CAAC;aACtB;SACJ;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,oCAAc,GAAd,UAAe,WAAW;QACtB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACxC,CAAC;IAED,uCAAiB,GAAjB;QACI,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;IAC3B,CAAC;IACL,kBAAC;AAAD,CAAC,AAjDD,IAiDC;AAED,kBAAe,WAAW,CAAC","sourcesContent":["/**\n * @todo Document why this abstraction exists, and the relationship between\n * environment, file managers, and plugin manager\n */\n\nimport logger from '../logger';\n\nclass Environment {\n constructor(externalEnvironment, fileManagers) {\n this.fileManagers = fileManagers || [];\n externalEnvironment = externalEnvironment || {};\n\n const optionalFunctions = ['encodeBase64', 'mimeLookup', 'charsetLookup', 'getSourceMapGenerator'];\n const requiredFunctions = [];\n const functions = requiredFunctions.concat(optionalFunctions);\n\n for (let i = 0; i < functions.length; i++) {\n const propName = functions[i];\n const environmentFunc = externalEnvironment[propName];\n if (environmentFunc) {\n this[propName] = environmentFunc.bind(externalEnvironment);\n } else if (i < requiredFunctions.length) {\n this.warn(`missing required function in environment - ${propName}`);\n }\n }\n }\n\n getFileManager(filename, currentDirectory, options, environment, isSync) {\n\n if (!filename) {\n logger.warn('getFileManager called with no filename.. Please report this issue. continuing.');\n }\n if (currentDirectory === undefined) {\n logger.warn('getFileManager called with null directory.. Please report this issue. continuing.');\n }\n\n let fileManagers = this.fileManagers;\n if (options.pluginManager) {\n fileManagers = [].concat(fileManagers).concat(options.pluginManager.getFileManagers());\n }\n for (let i = fileManagers.length - 1; i >= 0 ; i--) {\n const fileManager = fileManagers[i];\n if (fileManager[isSync ? 'supportsSync' : 'supports'](filename, currentDirectory, options, environment)) {\n return fileManager;\n }\n }\n return null;\n }\n\n addFileManager(fileManager) {\n this.fileManagers.push(fileManager);\n }\n\n clearFileManagers() {\n this.fileManagers = [];\n }\n}\n\nexport default Environment;\n"]}

View File

@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=file-manager-api.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"file-manager-api.js","sourceRoot":"","sources":["../../../src/less/environment/file-manager-api.ts"],"names":[],"mappings":"","sourcesContent":["import type { Environment } from './environment-api'\n\nexport interface FileManager {\n /**\n * Given the full path to a file, return the path component\n * Provided by AbstractFileManager\n */\n getPath(filename: string): string\n /**\n * Append a .less extension if appropriate. Only called if less thinks one could be added.\n * Provided by AbstractFileManager\n */\n tryAppendLessExtension(filename: string): string\n /**\n * Whether the rootpath should be converted to be absolute.\n * The browser ovverides this to return true because urls must be absolute.\n * Provided by AbstractFileManager (returns false)\n */\n alwaysMakePathsAbsolute(): boolean\n /**\n * Returns whether a path is absolute\n * Provided by AbstractFileManager\n */\n isPathAbsolute(path: string): boolean\n /**\n * joins together 2 paths\n * Provided by AbstractFileManager\n */\n join(basePath: string, laterPath: string): string\n /**\n * Returns the difference between 2 paths\n * E.g. url = a/ baseUrl = a/b/ returns ../\n * url = a/b/ baseUrl = a/ returns b/\n * Provided by AbstractFileManager\n */\n pathDiff(url: string, baseUrl: string): string\n /**\n * Returns whether this file manager supports this file for syncronous file retrieval\n * If true is returned, loadFileSync will then be called with the file.\n * Provided by AbstractFileManager (returns false)\n * \n * @todo - Narrow Options type\n */\n supportsSync(\n filename: string,\n currentDirectory: string,\n options: Record<string, any>,\n environment: Environment\n ): boolean\n /**\n * If file manager supports async file retrieval for this file type\n */\n supports(\n filename: string,\n currentDirectory: string,\n options: Record<string, any>,\n environment: Environment\n ): boolean\n /**\n * Loads a file asynchronously.\n */\n loadFile(\n filename: string,\n currentDirectory: string,\n options: Record<string, any>,\n environment: Environment\n ): Promise<{ filename: string, contents: string }>\n /**\n * Loads a file synchronously. Expects an immediate return with an object\n */\n loadFileSync(\n filename: string,\n currentDirectory: string,\n options: Record<string, any>,\n environment: Environment\n ): { error?: unknown, filename: string, contents: string }\n}\n"]}

29
node_modules/less/lib/less/functions/boolean.js generated vendored Normal file
View File

@@ -0,0 +1,29 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var anonymous_1 = tslib_1.__importDefault(require("../tree/anonymous"));
var keyword_1 = tslib_1.__importDefault(require("../tree/keyword"));
function boolean(condition) {
return condition ? keyword_1.default.True : keyword_1.default.False;
}
/**
* Functions with evalArgs set to false are sent context
* as the first argument.
*/
function If(context, condition, trueValue, falseValue) {
return condition.eval(context) ? trueValue.eval(context)
: (falseValue ? falseValue.eval(context) : new anonymous_1.default);
}
If.evalArgs = false;
function isdefined(context, variable) {
try {
variable.eval(context);
return keyword_1.default.True;
}
catch (e) {
return keyword_1.default.False;
}
}
isdefined.evalArgs = false;
exports.default = { isdefined: isdefined, boolean: boolean, 'if': If };
//# sourceMappingURL=boolean.js.map

1
node_modules/less/lib/less/functions/boolean.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"boolean.js","sourceRoot":"","sources":["../../../src/less/functions/boolean.js"],"names":[],"mappings":";;;AAAA,wEAA0C;AAC1C,oEAAsC;AAEtC,SAAS,OAAO,CAAC,SAAS;IACtB,OAAO,SAAS,CAAC,CAAC,CAAC,iBAAO,CAAC,IAAI,CAAC,CAAC,CAAC,iBAAO,CAAC,KAAK,CAAC;AACpD,CAAC;AAED;;;GAGG;AACH,SAAS,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU;IACjD,OAAO,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC;QACpD,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,mBAAS,CAAC,CAAC;AAClE,CAAC;AACD,EAAE,CAAC,QAAQ,GAAG,KAAK,CAAC;AAEpB,SAAS,SAAS,CAAC,OAAO,EAAE,QAAQ;IAChC,IAAI;QACA,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,OAAO,iBAAO,CAAC,IAAI,CAAC;KACvB;IAAC,OAAO,CAAC,EAAE;QACR,OAAO,iBAAO,CAAC,KAAK,CAAC;KACxB;AACL,CAAC;AAED,SAAS,CAAC,QAAQ,GAAG,KAAK,CAAC;AAE3B,kBAAe,EAAE,SAAS,WAAA,EAAE,OAAO,SAAA,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC","sourcesContent":["import Anonymous from '../tree/anonymous';\nimport Keyword from '../tree/keyword';\n\nfunction boolean(condition) {\n return condition ? Keyword.True : Keyword.False;\n}\n\n/**\n * Functions with evalArgs set to false are sent context\n * as the first argument.\n */\nfunction If(context, condition, trueValue, falseValue) {\n return condition.eval(context) ? trueValue.eval(context)\n : (falseValue ? falseValue.eval(context) : new Anonymous);\n}\nIf.evalArgs = false;\n\nfunction isdefined(context, variable) {\n try {\n variable.eval(context);\n return Keyword.True;\n } catch (e) {\n return Keyword.False;\n }\n}\n\nisdefined.evalArgs = false;\n\nexport default { isdefined, boolean, 'if': If };\n"]}

77
node_modules/less/lib/less/functions/color-blending.js generated vendored Normal file
View File

@@ -0,0 +1,77 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var color_1 = tslib_1.__importDefault(require("../tree/color"));
// Color Blending
// ref: http://www.w3.org/TR/compositing-1
function colorBlend(mode, color1, color2) {
var ab = color1.alpha; // result
var // backdrop
cb;
var as = color2.alpha;
var // source
cs;
var ar;
var cr;
var r = [];
ar = as + ab * (1 - as);
for (var i = 0; i < 3; i++) {
cb = color1.rgb[i] / 255;
cs = color2.rgb[i] / 255;
cr = mode(cb, cs);
if (ar) {
cr = (as * cs + ab * (cb -
as * (cb + cs - cr))) / ar;
}
r[i] = cr * 255;
}
return new color_1.default(r, ar);
}
var colorBlendModeFunctions = {
multiply: function (cb, cs) {
return cb * cs;
},
screen: function (cb, cs) {
return cb + cs - cb * cs;
},
overlay: function (cb, cs) {
cb *= 2;
return (cb <= 1) ?
colorBlendModeFunctions.multiply(cb, cs) :
colorBlendModeFunctions.screen(cb - 1, cs);
},
softlight: function (cb, cs) {
var d = 1;
var e = cb;
if (cs > 0.5) {
e = 1;
d = (cb > 0.25) ? Math.sqrt(cb)
: ((16 * cb - 12) * cb + 4) * cb;
}
return cb - (1 - 2 * cs) * e * (d - cb);
},
hardlight: function (cb, cs) {
return colorBlendModeFunctions.overlay(cs, cb);
},
difference: function (cb, cs) {
return Math.abs(cb - cs);
},
exclusion: function (cb, cs) {
return cb + cs - 2 * cb * cs;
},
// non-w3c functions:
average: function (cb, cs) {
return (cb + cs) / 2;
},
negation: function (cb, cs) {
return 1 - Math.abs(cb + cs - 1);
}
};
for (var f in colorBlendModeFunctions) {
// eslint-disable-next-line no-prototype-builtins
if (colorBlendModeFunctions.hasOwnProperty(f)) {
colorBlend[f] = colorBlend.bind(null, colorBlendModeFunctions[f]);
}
}
exports.default = colorBlend;
//# sourceMappingURL=color-blending.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"color-blending.js","sourceRoot":"","sources":["../../../src/less/functions/color-blending.js"],"names":[],"mappings":";;;AAAA,gEAAkC;AAElC,iBAAiB;AACjB,0CAA0C;AAE1C,SAAS,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM;IACpC,IAAM,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,CAAQ,SAAS;IAEzC,IAAI,WAAW;IACX,EAAE,CAAC;IAEP,IAAM,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC;IAExB,IAAI,SAAS;IACT,EAAE,CAAC;IAEP,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,IAAM,CAAC,GAAG,EAAE,CAAC;IAEb,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IACxB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;QACxB,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;QACzB,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;QACzB,EAAE,GAAG,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QAClB,IAAI,EAAE,EAAE;YACJ,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE;gBAClB,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;SACpC;QACD,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,GAAG,CAAC;KACnB;IAED,OAAO,IAAI,eAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAC5B,CAAC;AAED,IAAM,uBAAuB,GAAG;IAC5B,QAAQ,EAAE,UAAS,EAAE,EAAE,EAAE;QACrB,OAAO,EAAE,GAAG,EAAE,CAAC;IACnB,CAAC;IACD,MAAM,EAAE,UAAS,EAAE,EAAE,EAAE;QACnB,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;IAC7B,CAAC;IACD,OAAO,EAAE,UAAS,EAAE,EAAE,EAAE;QACpB,EAAE,IAAI,CAAC,CAAC;QACR,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;YACd,uBAAuB,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;YAC1C,uBAAuB,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;IACnD,CAAC;IACD,SAAS,EAAE,UAAS,EAAE,EAAE,EAAE;QACtB,IAAI,CAAC,GAAG,CAAC,CAAC;QACV,IAAI,CAAC,GAAG,EAAE,CAAC;QACX,IAAI,EAAE,GAAG,GAAG,EAAE;YACV,CAAC,GAAG,CAAC,CAAC;YACN,CAAC,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC3B,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;SACxC;QACD,OAAO,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IAC5C,CAAC;IACD,SAAS,EAAE,UAAS,EAAE,EAAE,EAAE;QACtB,OAAO,uBAAuB,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IACnD,CAAC;IACD,UAAU,EAAE,UAAS,EAAE,EAAE,EAAE;QACvB,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;IAC7B,CAAC;IACD,SAAS,EAAE,UAAS,EAAE,EAAE,EAAE;QACtB,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC;IACjC,CAAC;IAED,qBAAqB;IACrB,OAAO,EAAE,UAAS,EAAE,EAAE,EAAE;QACpB,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IACD,QAAQ,EAAE,UAAS,EAAE,EAAE,EAAE;QACrB,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IACrC,CAAC;CACJ,CAAC;AAEF,KAAK,IAAM,CAAC,IAAI,uBAAuB,EAAE;IACrC,iDAAiD;IACjD,IAAI,uBAAuB,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE;QAC3C,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC;KACrE;CACJ;AAED,kBAAe,UAAU,CAAC","sourcesContent":["import Color from '../tree/color';\n\n// Color Blending\n// ref: http://www.w3.org/TR/compositing-1\n\nfunction colorBlend(mode, color1, color2) {\n const ab = color1.alpha; // result\n\n let // backdrop\n cb;\n\n const as = color2.alpha;\n\n let // source\n cs;\n\n let ar;\n let cr;\n const r = [];\n\n ar = as + ab * (1 - as);\n for (let i = 0; i < 3; i++) {\n cb = color1.rgb[i] / 255;\n cs = color2.rgb[i] / 255;\n cr = mode(cb, cs);\n if (ar) {\n cr = (as * cs + ab * (cb -\n as * (cb + cs - cr))) / ar;\n }\n r[i] = cr * 255;\n }\n\n return new Color(r, ar);\n}\n\nconst colorBlendModeFunctions = {\n multiply: function(cb, cs) {\n return cb * cs;\n },\n screen: function(cb, cs) {\n return cb + cs - cb * cs;\n },\n overlay: function(cb, cs) {\n cb *= 2;\n return (cb <= 1) ?\n colorBlendModeFunctions.multiply(cb, cs) :\n colorBlendModeFunctions.screen(cb - 1, cs);\n },\n softlight: function(cb, cs) {\n let d = 1;\n let e = cb;\n if (cs > 0.5) {\n e = 1;\n d = (cb > 0.25) ? Math.sqrt(cb)\n : ((16 * cb - 12) * cb + 4) * cb;\n }\n return cb - (1 - 2 * cs) * e * (d - cb);\n },\n hardlight: function(cb, cs) {\n return colorBlendModeFunctions.overlay(cs, cb);\n },\n difference: function(cb, cs) {\n return Math.abs(cb - cs);\n },\n exclusion: function(cb, cs) {\n return cb + cs - 2 * cb * cs;\n },\n\n // non-w3c functions:\n average: function(cb, cs) {\n return (cb + cs) / 2;\n },\n negation: function(cb, cs) {\n return 1 - Math.abs(cb + cs - 1);\n }\n};\n\nfor (const f in colorBlendModeFunctions) {\n // eslint-disable-next-line no-prototype-builtins\n if (colorBlendModeFunctions.hasOwnProperty(f)) {\n colorBlend[f] = colorBlend.bind(null, colorBlendModeFunctions[f]);\n }\n}\n\nexport default colorBlend;\n"]}

436
node_modules/less/lib/less/functions/color.js generated vendored Normal file
View File

@@ -0,0 +1,436 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var dimension_1 = tslib_1.__importDefault(require("../tree/dimension"));
var color_1 = tslib_1.__importDefault(require("../tree/color"));
var quoted_1 = tslib_1.__importDefault(require("../tree/quoted"));
var anonymous_1 = tslib_1.__importDefault(require("../tree/anonymous"));
var expression_1 = tslib_1.__importDefault(require("../tree/expression"));
var operation_1 = tslib_1.__importDefault(require("../tree/operation"));
var colorFunctions;
function clamp(val) {
return Math.min(1, Math.max(0, val));
}
function hsla(origColor, hsl) {
var color = colorFunctions.hsla(hsl.h, hsl.s, hsl.l, hsl.a);
if (color) {
if (origColor.value &&
/^(rgb|hsl)/.test(origColor.value)) {
color.value = origColor.value;
}
else {
color.value = 'rgb';
}
return color;
}
}
function toHSL(color) {
if (color.toHSL) {
return color.toHSL();
}
else {
throw new Error('Argument cannot be evaluated to a color');
}
}
function toHSV(color) {
if (color.toHSV) {
return color.toHSV();
}
else {
throw new Error('Argument cannot be evaluated to a color');
}
}
function number(n) {
if (n instanceof dimension_1.default) {
return parseFloat(n.unit.is('%') ? n.value / 100 : n.value);
}
else if (typeof n === 'number') {
return n;
}
else {
throw {
type: 'Argument',
message: 'color functions take numbers as parameters'
};
}
}
function scaled(n, size) {
if (n instanceof dimension_1.default && n.unit.is('%')) {
return parseFloat(n.value * size / 100);
}
else {
return number(n);
}
}
colorFunctions = {
rgb: function (r, g, b) {
var a = 1;
/**
* Comma-less syntax
* e.g. rgb(0 128 255 / 50%)
*/
if (r instanceof expression_1.default) {
var val = r.value;
r = val[0];
g = val[1];
b = val[2];
/**
* @todo - should this be normalized in
* function caller? Or parsed differently?
*/
if (b instanceof operation_1.default) {
var op = b;
b = op.operands[0];
a = op.operands[1];
}
}
var color = colorFunctions.rgba(r, g, b, a);
if (color) {
color.value = 'rgb';
return color;
}
},
rgba: function (r, g, b, a) {
try {
if (r instanceof color_1.default) {
if (g) {
a = number(g);
}
else {
a = r.alpha;
}
return new color_1.default(r.rgb, a, 'rgba');
}
var rgb = [r, g, b].map(function (c) { return scaled(c, 255); });
a = number(a);
return new color_1.default(rgb, a, 'rgba');
}
catch (e) { }
},
hsl: function (h, s, l) {
var a = 1;
if (h instanceof expression_1.default) {
var val = h.value;
h = val[0];
s = val[1];
l = val[2];
if (l instanceof operation_1.default) {
var op = l;
l = op.operands[0];
a = op.operands[1];
}
}
var color = colorFunctions.hsla(h, s, l, a);
if (color) {
color.value = 'hsl';
return color;
}
},
hsla: function (h, s, l, a) {
var m1;
var m2;
function hue(h) {
h = h < 0 ? h + 1 : (h > 1 ? h - 1 : h);
if (h * 6 < 1) {
return m1 + (m2 - m1) * h * 6;
}
else if (h * 2 < 1) {
return m2;
}
else if (h * 3 < 2) {
return m1 + (m2 - m1) * (2 / 3 - h) * 6;
}
else {
return m1;
}
}
try {
if (h instanceof color_1.default) {
if (s) {
a = number(s);
}
else {
a = h.alpha;
}
return new color_1.default(h.rgb, a, 'hsla');
}
h = (number(h) % 360) / 360;
s = clamp(number(s));
l = clamp(number(l));
a = clamp(number(a));
m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;
m1 = l * 2 - m2;
var rgb = [
hue(h + 1 / 3) * 255,
hue(h) * 255,
hue(h - 1 / 3) * 255
];
a = number(a);
return new color_1.default(rgb, a, 'hsla');
}
catch (e) { }
},
hsv: function (h, s, v) {
return colorFunctions.hsva(h, s, v, 1.0);
},
hsva: function (h, s, v, a) {
h = ((number(h) % 360) / 360) * 360;
s = number(s);
v = number(v);
a = number(a);
var i;
var f;
i = Math.floor((h / 60) % 6);
f = (h / 60) - i;
var vs = [v,
v * (1 - s),
v * (1 - f * s),
v * (1 - (1 - f) * s)];
var perm = [[0, 3, 1],
[2, 0, 1],
[1, 0, 3],
[1, 2, 0],
[3, 1, 0],
[0, 1, 2]];
return colorFunctions.rgba(vs[perm[i][0]] * 255, vs[perm[i][1]] * 255, vs[perm[i][2]] * 255, a);
},
hue: function (color) {
return new dimension_1.default(toHSL(color).h);
},
saturation: function (color) {
return new dimension_1.default(toHSL(color).s * 100, '%');
},
lightness: function (color) {
return new dimension_1.default(toHSL(color).l * 100, '%');
},
hsvhue: function (color) {
return new dimension_1.default(toHSV(color).h);
},
hsvsaturation: function (color) {
return new dimension_1.default(toHSV(color).s * 100, '%');
},
hsvvalue: function (color) {
return new dimension_1.default(toHSV(color).v * 100, '%');
},
red: function (color) {
return new dimension_1.default(color.rgb[0]);
},
green: function (color) {
return new dimension_1.default(color.rgb[1]);
},
blue: function (color) {
return new dimension_1.default(color.rgb[2]);
},
alpha: function (color) {
return new dimension_1.default(toHSL(color).a);
},
luma: function (color) {
return new dimension_1.default(color.luma() * color.alpha * 100, '%');
},
luminance: function (color) {
var luminance = (0.2126 * color.rgb[0] / 255) +
(0.7152 * color.rgb[1] / 255) +
(0.0722 * color.rgb[2] / 255);
return new dimension_1.default(luminance * color.alpha * 100, '%');
},
saturate: function (color, amount, method) {
// filter: saturate(3.2);
// should be kept as is, so check for color
if (!color.rgb) {
return null;
}
var hsl = toHSL(color);
if (typeof method !== 'undefined' && method.value === 'relative') {
hsl.s += hsl.s * amount.value / 100;
}
else {
hsl.s += amount.value / 100;
}
hsl.s = clamp(hsl.s);
return hsla(color, hsl);
},
desaturate: function (color, amount, method) {
var hsl = toHSL(color);
if (typeof method !== 'undefined' && method.value === 'relative') {
hsl.s -= hsl.s * amount.value / 100;
}
else {
hsl.s -= amount.value / 100;
}
hsl.s = clamp(hsl.s);
return hsla(color, hsl);
},
lighten: function (color, amount, method) {
var hsl = toHSL(color);
if (typeof method !== 'undefined' && method.value === 'relative') {
hsl.l += hsl.l * amount.value / 100;
}
else {
hsl.l += amount.value / 100;
}
hsl.l = clamp(hsl.l);
return hsla(color, hsl);
},
darken: function (color, amount, method) {
var hsl = toHSL(color);
if (typeof method !== 'undefined' && method.value === 'relative') {
hsl.l -= hsl.l * amount.value / 100;
}
else {
hsl.l -= amount.value / 100;
}
hsl.l = clamp(hsl.l);
return hsla(color, hsl);
},
fadein: function (color, amount, method) {
var hsl = toHSL(color);
if (typeof method !== 'undefined' && method.value === 'relative') {
hsl.a += hsl.a * amount.value / 100;
}
else {
hsl.a += amount.value / 100;
}
hsl.a = clamp(hsl.a);
return hsla(color, hsl);
},
fadeout: function (color, amount, method) {
var hsl = toHSL(color);
if (typeof method !== 'undefined' && method.value === 'relative') {
hsl.a -= hsl.a * amount.value / 100;
}
else {
hsl.a -= amount.value / 100;
}
hsl.a = clamp(hsl.a);
return hsla(color, hsl);
},
fade: function (color, amount) {
var hsl = toHSL(color);
hsl.a = amount.value / 100;
hsl.a = clamp(hsl.a);
return hsla(color, hsl);
},
spin: function (color, amount) {
var hsl = toHSL(color);
var hue = (hsl.h + amount.value) % 360;
hsl.h = hue < 0 ? 360 + hue : hue;
return hsla(color, hsl);
},
//
// Copyright (c) 2006-2009 Hampton Catlin, Natalie Weizenbaum, and Chris Eppstein
// http://sass-lang.com
//
mix: function (color1, color2, weight) {
if (!weight) {
weight = new dimension_1.default(50);
}
var p = weight.value / 100.0;
var w = p * 2 - 1;
var a = toHSL(color1).a - toHSL(color2).a;
var w1 = (((w * a == -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;
var w2 = 1 - w1;
var rgb = [color1.rgb[0] * w1 + color2.rgb[0] * w2,
color1.rgb[1] * w1 + color2.rgb[1] * w2,
color1.rgb[2] * w1 + color2.rgb[2] * w2];
var alpha = color1.alpha * p + color2.alpha * (1 - p);
return new color_1.default(rgb, alpha);
},
greyscale: function (color) {
return colorFunctions.desaturate(color, new dimension_1.default(100));
},
contrast: function (color, dark, light, threshold) {
// filter: contrast(3.2);
// should be kept as is, so check for color
if (!color.rgb) {
return null;
}
if (typeof light === 'undefined') {
light = colorFunctions.rgba(255, 255, 255, 1.0);
}
if (typeof dark === 'undefined') {
dark = colorFunctions.rgba(0, 0, 0, 1.0);
}
// Figure out which is actually light and dark:
if (dark.luma() > light.luma()) {
var t = light;
light = dark;
dark = t;
}
if (typeof threshold === 'undefined') {
threshold = 0.43;
}
else {
threshold = number(threshold);
}
if (color.luma() < threshold) {
return light;
}
else {
return dark;
}
},
// Changes made in 2.7.0 - Reverted in 3.0.0
// contrast: function (color, color1, color2, threshold) {
// // Return which of `color1` and `color2` has the greatest contrast with `color`
// // according to the standard WCAG contrast ratio calculation.
// // http://www.w3.org/TR/WCAG20/#contrast-ratiodef
// // The threshold param is no longer used, in line with SASS.
// // filter: contrast(3.2);
// // should be kept as is, so check for color
// if (!color.rgb) {
// return null;
// }
// if (typeof color1 === 'undefined') {
// color1 = colorFunctions.rgba(0, 0, 0, 1.0);
// }
// if (typeof color2 === 'undefined') {
// color2 = colorFunctions.rgba(255, 255, 255, 1.0);
// }
// var contrast1, contrast2;
// var luma = color.luma();
// var luma1 = color1.luma();
// var luma2 = color2.luma();
// // Calculate contrast ratios for each color
// if (luma > luma1) {
// contrast1 = (luma + 0.05) / (luma1 + 0.05);
// } else {
// contrast1 = (luma1 + 0.05) / (luma + 0.05);
// }
// if (luma > luma2) {
// contrast2 = (luma + 0.05) / (luma2 + 0.05);
// } else {
// contrast2 = (luma2 + 0.05) / (luma + 0.05);
// }
// if (contrast1 > contrast2) {
// return color1;
// } else {
// return color2;
// }
// },
argb: function (color) {
return new anonymous_1.default(color.toARGB());
},
color: function (c) {
if ((c instanceof quoted_1.default) &&
(/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3,4})$/i.test(c.value))) {
var val = c.value.slice(1);
return new color_1.default(val, undefined, "#".concat(val));
}
if ((c instanceof color_1.default) || (c = color_1.default.fromKeyword(c.value))) {
c.value = undefined;
return c;
}
throw {
type: 'Argument',
message: 'argument must be a color keyword or 3|4|6|8 digit hex e.g. #FFF'
};
},
tint: function (color, amount) {
return colorFunctions.mix(colorFunctions.rgb(255, 255, 255), color, amount);
},
shade: function (color, amount) {
return colorFunctions.mix(colorFunctions.rgb(0, 0, 0), color, amount);
}
};
exports.default = colorFunctions;
//# sourceMappingURL=color.js.map

1
node_modules/less/lib/less/functions/color.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

65
node_modules/less/lib/less/functions/data-uri.js generated vendored Normal file
View File

@@ -0,0 +1,65 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var quoted_1 = tslib_1.__importDefault(require("../tree/quoted"));
var url_1 = tslib_1.__importDefault(require("../tree/url"));
var utils = tslib_1.__importStar(require("../utils"));
var logger_1 = tslib_1.__importDefault(require("../logger"));
exports.default = (function (environment) {
var fallback = function (functionThis, node) { return new url_1.default(node, functionThis.index, functionThis.currentFileInfo).eval(functionThis.context); };
return { 'data-uri': function (mimetypeNode, filePathNode) {
if (!filePathNode) {
filePathNode = mimetypeNode;
mimetypeNode = null;
}
var mimetype = mimetypeNode && mimetypeNode.value;
var filePath = filePathNode.value;
var currentFileInfo = this.currentFileInfo;
var currentDirectory = currentFileInfo.rewriteUrls ?
currentFileInfo.currentDirectory : currentFileInfo.entryPath;
var fragmentStart = filePath.indexOf('#');
var fragment = '';
if (fragmentStart !== -1) {
fragment = filePath.slice(fragmentStart);
filePath = filePath.slice(0, fragmentStart);
}
var context = utils.clone(this.context);
context.rawBuffer = true;
var fileManager = environment.getFileManager(filePath, currentDirectory, context, environment, true);
if (!fileManager) {
return fallback(this, filePathNode);
}
var useBase64 = false;
// detect the mimetype if not given
if (!mimetypeNode) {
mimetype = environment.mimeLookup(filePath);
if (mimetype === 'image/svg+xml') {
useBase64 = false;
}
else {
// use base 64 unless it's an ASCII or UTF-8 format
var charset = environment.charsetLookup(mimetype);
useBase64 = ['US-ASCII', 'UTF-8'].indexOf(charset) < 0;
}
if (useBase64) {
mimetype += ';base64';
}
}
else {
useBase64 = /;base64$/.test(mimetype);
}
var fileSync = fileManager.loadFileSync(filePath, currentDirectory, context, environment);
if (!fileSync.contents) {
logger_1.default.warn("Skipped data-uri embedding of ".concat(filePath, " because file not found"));
return fallback(this, filePathNode || mimetypeNode);
}
var buf = fileSync.contents;
if (useBase64 && !environment.encodeBase64) {
return fallback(this, filePathNode);
}
buf = useBase64 ? environment.encodeBase64(buf) : encodeURIComponent(buf);
var uri = "data:".concat(mimetype, ",").concat(buf).concat(fragment);
return new url_1.default(new quoted_1.default("\"".concat(uri, "\""), uri, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo);
} };
});
//# sourceMappingURL=data-uri.js.map

1
node_modules/less/lib/less/functions/data-uri.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

28
node_modules/less/lib/less/functions/default.js generated vendored Normal file
View File

@@ -0,0 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var keyword_1 = tslib_1.__importDefault(require("../tree/keyword"));
var utils = tslib_1.__importStar(require("../utils"));
var defaultFunc = {
eval: function () {
var v = this.value_;
var e = this.error_;
if (e) {
throw e;
}
if (!utils.isNullOrUndefined(v)) {
return v ? keyword_1.default.True : keyword_1.default.False;
}
},
value: function (v) {
this.value_ = v;
},
error: function (e) {
this.error_ = e;
},
reset: function () {
this.value_ = this.error_ = null;
}
};
exports.default = defaultFunc;
//# sourceMappingURL=default.js.map

1
node_modules/less/lib/less/functions/default.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"default.js","sourceRoot":"","sources":["../../../src/less/functions/default.js"],"names":[],"mappings":";;;AAAA,oEAAsC;AACtC,sDAAkC;AAElC,IAAM,WAAW,GAAG;IAChB,IAAI,EAAE;QACF,IAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QACtB,IAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QACtB,IAAI,CAAC,EAAE;YACH,MAAM,CAAC,CAAC;SACX;QACD,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE;YAC7B,OAAO,CAAC,CAAC,CAAC,CAAC,iBAAO,CAAC,IAAI,CAAC,CAAC,CAAC,iBAAO,CAAC,KAAK,CAAC;SAC3C;IACL,CAAC;IACD,KAAK,EAAE,UAAU,CAAC;QACd,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IACpB,CAAC;IACD,KAAK,EAAE,UAAU,CAAC;QACd,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IACpB,CAAC;IACD,KAAK,EAAE;QACH,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACrC,CAAC;CACJ,CAAC;AAEF,kBAAe,WAAW,CAAC","sourcesContent":["import Keyword from '../tree/keyword';\nimport * as utils from '../utils';\n\nconst defaultFunc = {\n eval: function () {\n const v = this.value_;\n const e = this.error_;\n if (e) {\n throw e;\n }\n if (!utils.isNullOrUndefined(v)) {\n return v ? Keyword.True : Keyword.False;\n }\n },\n value: function (v) {\n this.value_ = v;\n },\n error: function (e) {\n this.error_ = e;\n },\n reset: function () {\n this.value_ = this.error_ = null;\n }\n};\n\nexport default defaultFunc;\n"]}

View File

@@ -0,0 +1,54 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var expression_1 = tslib_1.__importDefault(require("../tree/expression"));
var functionCaller = /** @class */ (function () {
function functionCaller(name, context, index, currentFileInfo) {
this.name = name.toLowerCase();
this.index = index;
this.context = context;
this.currentFileInfo = currentFileInfo;
this.func = context.frames[0].functionRegistry.get(this.name);
}
functionCaller.prototype.isValid = function () {
return Boolean(this.func);
};
functionCaller.prototype.call = function (args) {
var _this = this;
if (!(Array.isArray(args))) {
args = [args];
}
var evalArgs = this.func.evalArgs;
if (evalArgs !== false) {
args = args.map(function (a) { return a.eval(_this.context); });
}
var commentFilter = function (item) { return !(item.type === 'Comment'); };
// This code is terrible and should be replaced as per this issue...
// https://github.com/less/less.js/issues/2477
args = args
.filter(commentFilter)
.map(function (item) {
if (item.type === 'Expression') {
var subNodes = item.value.filter(commentFilter);
if (subNodes.length === 1) {
// https://github.com/less/less.js/issues/3616
if (item.parens && subNodes[0].op === '/') {
return item;
}
return subNodes[0];
}
else {
return new expression_1.default(subNodes);
}
}
return item;
});
if (evalArgs === false) {
return this.func.apply(this, tslib_1.__spreadArray([this.context], args, false));
}
return this.func.apply(this, args);
};
return functionCaller;
}());
exports.default = functionCaller;
//# sourceMappingURL=function-caller.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"function-caller.js","sourceRoot":"","sources":["../../../src/less/functions/function-caller.js"],"names":[],"mappings":";;;AAAA,0EAA4C;AAE5C;IACI,wBAAY,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe;QAC7C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QAC/B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QAEvC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClE,CAAC;IAED,gCAAO,GAAP;QACI,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED,6BAAI,GAAJ,UAAK,IAAI;QAAT,iBAmCC;QAlCG,IAAI,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE;YACxB,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC;SACjB;QACD,IAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;QACpC,IAAI,QAAQ,KAAK,KAAK,EAAE;YACpB,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,IAAI,CAAC,KAAI,CAAC,OAAO,CAAC,EAApB,CAAoB,CAAC,CAAC;SAC9C;QACD,IAAM,aAAa,GAAG,UAAA,IAAI,IAAI,OAAA,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,EAA1B,CAA0B,CAAC;QAEzD,oEAAoE;QACpE,8CAA8C;QAC9C,IAAI,GAAG,IAAI;aACN,MAAM,CAAC,aAAa,CAAC;aACrB,GAAG,CAAC,UAAA,IAAI;YACL,IAAI,IAAI,CAAC,IAAI,KAAK,YAAY,EAAE;gBAC5B,IAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;gBAClD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;oBACvB,8CAA8C;oBAC9C,IAAI,IAAI,CAAC,MAAM,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,GAAG,EAAE;wBACvC,OAAO,IAAI,CAAC;qBACf;oBACD,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC;iBACtB;qBAAM;oBACH,OAAO,IAAI,oBAAU,CAAC,QAAQ,CAAC,CAAC;iBACnC;aACJ;YACD,OAAO,IAAI,CAAC;QAChB,CAAC,CAAC,CAAC;QAEP,IAAI,QAAQ,KAAK,KAAK,EAAE;YACpB,OAAO,IAAI,CAAC,IAAI,OAAT,IAAI,yBAAM,IAAI,CAAC,OAAO,GAAK,IAAI,UAAE;SAC3C;QAED,OAAO,IAAI,CAAC,IAAI,OAAT,IAAI,EAAS,IAAI,EAAE;IAC9B,CAAC;IACL,qBAAC;AAAD,CAAC,AAlDD,IAkDC;AAED,kBAAe,cAAc,CAAC","sourcesContent":["import Expression from '../tree/expression';\n\nclass functionCaller {\n constructor(name, context, index, currentFileInfo) {\n this.name = name.toLowerCase();\n this.index = index;\n this.context = context;\n this.currentFileInfo = currentFileInfo;\n\n this.func = context.frames[0].functionRegistry.get(this.name);\n }\n\n isValid() {\n return Boolean(this.func);\n }\n\n call(args) {\n if (!(Array.isArray(args))) {\n args = [args];\n }\n const evalArgs = this.func.evalArgs;\n if (evalArgs !== false) {\n args = args.map(a => a.eval(this.context));\n }\n const commentFilter = item => !(item.type === 'Comment');\n\n // This code is terrible and should be replaced as per this issue...\n // https://github.com/less/less.js/issues/2477\n args = args\n .filter(commentFilter)\n .map(item => {\n if (item.type === 'Expression') {\n const subNodes = item.value.filter(commentFilter);\n if (subNodes.length === 1) {\n // https://github.com/less/less.js/issues/3616\n if (item.parens && subNodes[0].op === '/') {\n return item;\n }\n return subNodes[0];\n } else {\n return new Expression(subNodes);\n }\n }\n return item;\n });\n\n if (evalArgs === false) {\n return this.func(this.context, ...args);\n }\n\n return this.func(...args);\n }\n}\n\nexport default functionCaller;\n"]}

View File

@@ -0,0 +1,37 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function makeRegistry(base) {
return {
_data: {},
add: function (name, func) {
// precautionary case conversion, as later querying of
// the registry by function-caller uses lower case as well.
name = name.toLowerCase();
// eslint-disable-next-line no-prototype-builtins
if (this._data.hasOwnProperty(name)) {
// TODO warn
}
this._data[name] = func;
},
addMultiple: function (functions) {
var _this = this;
Object.keys(functions).forEach(function (name) {
_this.add(name, functions[name]);
});
},
get: function (name) {
return this._data[name] || (base && base.get(name));
},
getLocalFunctions: function () {
return this._data;
},
inherit: function () {
return makeRegistry(this);
},
create: function (base) {
return makeRegistry(base);
}
};
}
exports.default = makeRegistry(null);
//# sourceMappingURL=function-registry.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"function-registry.js","sourceRoot":"","sources":["../../../src/less/functions/function-registry.js"],"names":[],"mappings":";;AAAA,SAAS,YAAY,CAAE,IAAI;IACvB,OAAO;QACH,KAAK,EAAE,EAAE;QACT,GAAG,EAAE,UAAS,IAAI,EAAE,IAAI;YACpB,sDAAsD;YACtD,2DAA2D;YAC3D,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;YAE1B,iDAAiD;YACjD,IAAI,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE;gBACjC,YAAY;aACf;YACD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;QAC5B,CAAC;QACD,WAAW,EAAE,UAAS,SAAS;YAAlB,iBAKZ;YAJG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,CAC1B,UAAA,IAAI;gBACA,KAAI,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;YACpC,CAAC,CAAC,CAAC;QACX,CAAC;QACD,GAAG,EAAE,UAAS,IAAI;YACd,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAE,IAAI,IAAI,IAAI,CAAC,GAAG,CAAE,IAAI,CAAE,CAAC,CAAC;QAC3D,CAAC;QACD,iBAAiB,EAAE;YACf,OAAO,IAAI,CAAC,KAAK,CAAC;QACtB,CAAC;QACD,OAAO,EAAE;YACL,OAAO,YAAY,CAAE,IAAI,CAAE,CAAC;QAChC,CAAC;QACD,MAAM,EAAE,UAAS,IAAI;YACjB,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC;KACJ,CAAC;AACN,CAAC;AAED,kBAAe,YAAY,CAAE,IAAI,CAAE,CAAC","sourcesContent":["function makeRegistry( base ) {\n return {\n _data: {},\n add: function(name, func) {\n // precautionary case conversion, as later querying of\n // the registry by function-caller uses lower case as well.\n name = name.toLowerCase();\n\n // eslint-disable-next-line no-prototype-builtins\n if (this._data.hasOwnProperty(name)) {\n // TODO warn\n }\n this._data[name] = func;\n },\n addMultiple: function(functions) {\n Object.keys(functions).forEach(\n name => {\n this.add(name, functions[name]);\n });\n },\n get: function(name) {\n return this._data[name] || ( base && base.get( name ));\n },\n getLocalFunctions: function() {\n return this._data;\n },\n inherit: function() {\n return makeRegistry( this );\n },\n create: function(base) {\n return makeRegistry(base);\n }\n };\n}\n\nexport default makeRegistry( null );"]}

35
node_modules/less/lib/less/functions/index.js generated vendored Normal file
View File

@@ -0,0 +1,35 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var function_registry_1 = tslib_1.__importDefault(require("./function-registry"));
var function_caller_1 = tslib_1.__importDefault(require("./function-caller"));
var boolean_1 = tslib_1.__importDefault(require("./boolean"));
var default_1 = tslib_1.__importDefault(require("./default"));
var color_1 = tslib_1.__importDefault(require("./color"));
var color_blending_1 = tslib_1.__importDefault(require("./color-blending"));
var data_uri_1 = tslib_1.__importDefault(require("./data-uri"));
var list_1 = tslib_1.__importDefault(require("./list"));
var math_1 = tslib_1.__importDefault(require("./math"));
var number_1 = tslib_1.__importDefault(require("./number"));
var string_1 = tslib_1.__importDefault(require("./string"));
var svg_1 = tslib_1.__importDefault(require("./svg"));
var types_1 = tslib_1.__importDefault(require("./types"));
var style_1 = tslib_1.__importDefault(require("./style"));
exports.default = (function (environment) {
var functions = { functionRegistry: function_registry_1.default, functionCaller: function_caller_1.default };
// register functions
function_registry_1.default.addMultiple(boolean_1.default);
function_registry_1.default.add('default', default_1.default.eval.bind(default_1.default));
function_registry_1.default.addMultiple(color_1.default);
function_registry_1.default.addMultiple(color_blending_1.default);
function_registry_1.default.addMultiple((0, data_uri_1.default)(environment));
function_registry_1.default.addMultiple(list_1.default);
function_registry_1.default.addMultiple(math_1.default);
function_registry_1.default.addMultiple(number_1.default);
function_registry_1.default.addMultiple(string_1.default);
function_registry_1.default.addMultiple((0, svg_1.default)(environment));
function_registry_1.default.addMultiple(types_1.default);
function_registry_1.default.addMultiple(style_1.default);
return functions;
});
//# sourceMappingURL=index.js.map

1
node_modules/less/lib/less/functions/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/less/functions/index.js"],"names":[],"mappings":";;;AAAA,kFAAmD;AACnD,8EAA+C;AAE/C,8DAAgC;AAChC,8DAAoC;AACpC,0DAA4B;AAC5B,4EAA6C;AAC7C,gEAAiC;AACjC,wDAA0B;AAC1B,wDAA0B;AAC1B,4DAA8B;AAC9B,4DAA8B;AAC9B,sDAAwB;AACxB,0DAA4B;AAC5B,0DAA4B;AAE5B,mBAAe,UAAA,WAAW;IACtB,IAAM,SAAS,GAAG,EAAE,gBAAgB,6BAAA,EAAE,cAAc,2BAAA,EAAE,CAAC;IAEvD,qBAAqB;IACrB,2BAAgB,CAAC,WAAW,CAAC,iBAAO,CAAC,CAAC;IACtC,2BAAgB,CAAC,GAAG,CAAC,SAAS,EAAE,iBAAW,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAW,CAAC,CAAC,CAAC;IACpE,2BAAgB,CAAC,WAAW,CAAC,eAAK,CAAC,CAAC;IACpC,2BAAgB,CAAC,WAAW,CAAC,wBAAa,CAAC,CAAC;IAC5C,2BAAgB,CAAC,WAAW,CAAC,IAAA,kBAAO,EAAC,WAAW,CAAC,CAAC,CAAC;IACnD,2BAAgB,CAAC,WAAW,CAAC,cAAI,CAAC,CAAC;IACnC,2BAAgB,CAAC,WAAW,CAAC,cAAI,CAAC,CAAC;IACnC,2BAAgB,CAAC,WAAW,CAAC,gBAAM,CAAC,CAAC;IACrC,2BAAgB,CAAC,WAAW,CAAC,gBAAM,CAAC,CAAC;IACrC,2BAAgB,CAAC,WAAW,CAAC,IAAA,aAAG,EAAC,WAAW,CAAC,CAAC,CAAC;IAC/C,2BAAgB,CAAC,WAAW,CAAC,eAAK,CAAC,CAAC;IACpC,2BAAgB,CAAC,WAAW,CAAC,eAAK,CAAC,CAAC;IAEpC,OAAO,SAAS,CAAC;AACrB,CAAC,EAAC","sourcesContent":["import functionRegistry from './function-registry';\nimport functionCaller from './function-caller';\n\nimport boolean from './boolean';\nimport defaultFunc from './default';\nimport color from './color';\nimport colorBlending from './color-blending';\nimport dataUri from './data-uri';\nimport list from './list';\nimport math from './math';\nimport number from './number';\nimport string from './string';\nimport svg from './svg';\nimport types from './types';\nimport style from './style';\n\nexport default environment => {\n const functions = { functionRegistry, functionCaller };\n\n // register functions\n functionRegistry.addMultiple(boolean);\n functionRegistry.add('default', defaultFunc.eval.bind(defaultFunc));\n functionRegistry.addMultiple(color);\n functionRegistry.addMultiple(colorBlending);\n functionRegistry.addMultiple(dataUri(environment));\n functionRegistry.addMultiple(list);\n functionRegistry.addMultiple(math);\n functionRegistry.addMultiple(number);\n functionRegistry.addMultiple(string);\n functionRegistry.addMultiple(svg(environment));\n functionRegistry.addMultiple(types);\n functionRegistry.addMultiple(style);\n\n return functions;\n};\n"]}

145
node_modules/less/lib/less/functions/list.js generated vendored Normal file
View File

@@ -0,0 +1,145 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var comment_1 = tslib_1.__importDefault(require("../tree/comment"));
var node_1 = tslib_1.__importDefault(require("../tree/node"));
var dimension_1 = tslib_1.__importDefault(require("../tree/dimension"));
var declaration_1 = tslib_1.__importDefault(require("../tree/declaration"));
var expression_1 = tslib_1.__importDefault(require("../tree/expression"));
var ruleset_1 = tslib_1.__importDefault(require("../tree/ruleset"));
var selector_1 = tslib_1.__importDefault(require("../tree/selector"));
var element_1 = tslib_1.__importDefault(require("../tree/element"));
var quoted_1 = tslib_1.__importDefault(require("../tree/quoted"));
var value_1 = tslib_1.__importDefault(require("../tree/value"));
var getItemsFromNode = function (node) {
// handle non-array values as an array of length 1
// return 'undefined' if index is invalid
var items = Array.isArray(node.value) ?
node.value : Array(node);
return items;
};
exports.default = {
_SELF: function (n) {
return n;
},
'~': function () {
var expr = [];
for (var _i = 0; _i < arguments.length; _i++) {
expr[_i] = arguments[_i];
}
if (expr.length === 1) {
return expr[0];
}
return new value_1.default(expr);
},
extract: function (values, index) {
// (1-based index)
index = index.value - 1;
return getItemsFromNode(values)[index];
},
length: function (values) {
return new dimension_1.default(getItemsFromNode(values).length);
},
/**
* Creates a Less list of incremental values.
* Modeled after Lodash's range function, also exists natively in PHP
*
* @param {Dimension} [start=1]
* @param {Dimension} end - e.g. 10 or 10px - unit is added to output
* @param {Dimension} [step=1]
*/
range: function (start, end, step) {
var from;
var to;
var stepValue = 1;
var list = [];
if (end) {
to = end;
from = start.value;
if (step) {
stepValue = step.value;
}
}
else {
from = 1;
to = start;
}
for (var i = from; i <= to.value; i += stepValue) {
list.push(new dimension_1.default(i, to.unit));
}
return new expression_1.default(list);
},
each: function (list, rs) {
var _this = this;
var rules = [];
var newRules;
var iterator;
var tryEval = function (val) {
if (val instanceof node_1.default) {
return val.eval(_this.context);
}
return val;
};
if (list.value && !(list instanceof quoted_1.default)) {
if (Array.isArray(list.value)) {
iterator = list.value.map(tryEval);
}
else {
iterator = [tryEval(list.value)];
}
}
else if (list.ruleset) {
iterator = tryEval(list.ruleset).rules;
}
else if (list.rules) {
iterator = list.rules.map(tryEval);
}
else if (Array.isArray(list)) {
iterator = list.map(tryEval);
}
else {
iterator = [tryEval(list)];
}
var valueName = '@value';
var keyName = '@key';
var indexName = '@index';
if (rs.params) {
valueName = rs.params[0] && rs.params[0].name;
keyName = rs.params[1] && rs.params[1].name;
indexName = rs.params[2] && rs.params[2].name;
rs = rs.rules;
}
else {
rs = rs.ruleset;
}
for (var i = 0; i < iterator.length; i++) {
var key = void 0;
var value = void 0;
var item = iterator[i];
if (item instanceof declaration_1.default) {
key = typeof item.name === 'string' ? item.name : item.name[0].value;
value = item.value;
}
else {
key = new dimension_1.default(i + 1);
value = item;
}
if (item instanceof comment_1.default) {
continue;
}
newRules = rs.rules.slice(0);
if (valueName) {
newRules.push(new declaration_1.default(valueName, value, false, false, this.index, this.currentFileInfo));
}
if (indexName) {
newRules.push(new declaration_1.default(indexName, new dimension_1.default(i + 1), false, false, this.index, this.currentFileInfo));
}
if (keyName) {
newRules.push(new declaration_1.default(keyName, key, false, false, this.index, this.currentFileInfo));
}
rules.push(new ruleset_1.default([new (selector_1.default)([new element_1.default('', '&')])], newRules, rs.strictImports, rs.visibilityInfo()));
}
return new ruleset_1.default([new (selector_1.default)([new element_1.default('', '&')])], rules, rs.strictImports, rs.visibilityInfo()).eval(this.context);
}
};
//# sourceMappingURL=list.js.map

1
node_modules/less/lib/less/functions/list.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

18
node_modules/less/lib/less/functions/math-helper.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var dimension_1 = tslib_1.__importDefault(require("../tree/dimension"));
var MathHelper = function (fn, unit, n) {
if (!(n instanceof dimension_1.default)) {
throw { type: 'Argument', message: 'argument must be a number' };
}
if (unit === null) {
unit = n.unit;
}
else {
n = n.unify();
}
return new dimension_1.default(fn(parseFloat(n.value)), unit);
};
exports.default = MathHelper;
//# sourceMappingURL=math-helper.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"math-helper.js","sourceRoot":"","sources":["../../../src/less/functions/math-helper.js"],"names":[],"mappings":";;;AAAA,wEAA0C;AAE1C,IAAM,UAAU,GAAG,UAAC,EAAE,EAAE,IAAI,EAAE,CAAC;IAC3B,IAAI,CAAC,CAAC,CAAC,YAAY,mBAAS,CAAC,EAAE;QAC3B,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,2BAA2B,EAAE,CAAC;KACpE;IACD,IAAI,IAAI,KAAK,IAAI,EAAE;QACf,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC;KACjB;SAAM;QACH,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC;KACjB;IACD,OAAO,IAAI,mBAAS,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;AACxD,CAAC,CAAC;AAEF,kBAAe,UAAU,CAAC","sourcesContent":["import Dimension from '../tree/dimension';\n\nconst MathHelper = (fn, unit, n) => {\n if (!(n instanceof Dimension)) {\n throw { type: 'Argument', message: 'argument must be a number' };\n }\n if (unit === null) {\n unit = n.unit;\n } else {\n n = n.unify();\n }\n return new Dimension(fn(parseFloat(n.value)), unit);\n};\n\nexport default MathHelper;"]}

29
node_modules/less/lib/less/functions/math.js generated vendored Normal file
View File

@@ -0,0 +1,29 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var math_helper_js_1 = tslib_1.__importDefault(require("./math-helper.js"));
var mathFunctions = {
// name, unit
ceil: null,
floor: null,
sqrt: null,
abs: null,
tan: '',
sin: '',
cos: '',
atan: 'rad',
asin: 'rad',
acos: 'rad'
};
for (var f in mathFunctions) {
// eslint-disable-next-line no-prototype-builtins
if (mathFunctions.hasOwnProperty(f)) {
mathFunctions[f] = math_helper_js_1.default.bind(null, Math[f], mathFunctions[f]);
}
}
mathFunctions.round = function (n, f) {
var fraction = typeof f === 'undefined' ? 0 : f.value;
return (0, math_helper_js_1.default)(function (num) { return num.toFixed(fraction); }, null, n);
};
exports.default = mathFunctions;
//# sourceMappingURL=math.js.map

1
node_modules/less/lib/less/functions/math.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"math.js","sourceRoot":"","sources":["../../../src/less/functions/math.js"],"names":[],"mappings":";;;AAAA,4EAA0C;AAE1C,IAAM,aAAa,GAAG;IAClB,cAAc;IACd,IAAI,EAAG,IAAI;IACX,KAAK,EAAE,IAAI;IACX,IAAI,EAAG,IAAI;IACX,GAAG,EAAI,IAAI;IACX,GAAG,EAAI,EAAE;IACT,GAAG,EAAI,EAAE;IACT,GAAG,EAAI,EAAE;IACT,IAAI,EAAG,KAAK;IACZ,IAAI,EAAG,KAAK;IACZ,IAAI,EAAG,KAAK;CACf,CAAC;AAEF,KAAK,IAAM,CAAC,IAAI,aAAa,EAAE;IAC3B,iDAAiD;IACjD,IAAI,aAAa,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE;QACjC,aAAa,CAAC,CAAC,CAAC,GAAG,wBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;KACvE;CACJ;AAED,aAAa,CAAC,KAAK,GAAG,UAAC,CAAC,EAAE,CAAC;IACvB,IAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACxD,OAAO,IAAA,wBAAU,EAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,EAArB,CAAqB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC7D,CAAC,CAAC;AAEF,kBAAe,aAAa,CAAC","sourcesContent":["import mathHelper from './math-helper.js';\n\nconst mathFunctions = {\n // name, unit\n ceil: null,\n floor: null,\n sqrt: null,\n abs: null,\n tan: '',\n sin: '',\n cos: '',\n atan: 'rad',\n asin: 'rad',\n acos: 'rad'\n};\n\nfor (const f in mathFunctions) {\n // eslint-disable-next-line no-prototype-builtins\n if (mathFunctions.hasOwnProperty(f)) {\n mathFunctions[f] = mathHelper.bind(null, Math[f], mathFunctions[f]);\n }\n}\n\nmathFunctions.round = (n, f) => {\n const fraction = typeof f === 'undefined' ? 0 : f.value;\n return mathHelper(num => num.toFixed(fraction), null, n);\n};\n\nexport default mathFunctions;\n"]}

106
node_modules/less/lib/less/functions/number.js generated vendored Normal file
View File

@@ -0,0 +1,106 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var dimension_1 = tslib_1.__importDefault(require("../tree/dimension"));
var anonymous_1 = tslib_1.__importDefault(require("../tree/anonymous"));
var math_helper_js_1 = tslib_1.__importDefault(require("./math-helper.js"));
var minMax = function (isMin, args) {
var _this = this;
args = Array.prototype.slice.call(args);
switch (args.length) {
case 0: throw { type: 'Argument', message: 'one or more arguments required' };
}
var i; // key is the unit.toString() for unified Dimension values,
var j;
var current;
var currentUnified;
var referenceUnified;
var unit;
var unitStatic;
var unitClone;
var // elems only contains original argument values.
order = [];
var values = {};
// value is the index into the order array.
for (i = 0; i < args.length; i++) {
current = args[i];
if (!(current instanceof dimension_1.default)) {
if (Array.isArray(args[i].value)) {
Array.prototype.push.apply(args, Array.prototype.slice.call(args[i].value));
continue;
}
else {
throw { type: 'Argument', message: 'incompatible types' };
}
}
currentUnified = current.unit.toString() === '' && unitClone !== undefined ? new dimension_1.default(current.value, unitClone).unify() : current.unify();
unit = currentUnified.unit.toString() === '' && unitStatic !== undefined ? unitStatic : currentUnified.unit.toString();
unitStatic = unit !== '' && unitStatic === undefined || unit !== '' && order[0].unify().unit.toString() === '' ? unit : unitStatic;
unitClone = unit !== '' && unitClone === undefined ? current.unit.toString() : unitClone;
j = values[''] !== undefined && unit !== '' && unit === unitStatic ? values[''] : values[unit];
if (j === undefined) {
if (unitStatic !== undefined && unit !== unitStatic) {
throw { type: 'Argument', message: 'incompatible types' };
}
values[unit] = order.length;
order.push(current);
continue;
}
referenceUnified = order[j].unit.toString() === '' && unitClone !== undefined ? new dimension_1.default(order[j].value, unitClone).unify() : order[j].unify();
if (isMin && currentUnified.value < referenceUnified.value ||
!isMin && currentUnified.value > referenceUnified.value) {
order[j] = current;
}
}
if (order.length == 1) {
return order[0];
}
args = order.map(function (a) { return a.toCSS(_this.context); }).join(this.context.compress ? ',' : ', ');
return new anonymous_1.default("".concat(isMin ? 'min' : 'max', "(").concat(args, ")"));
};
exports.default = {
min: function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
try {
return minMax.call(this, true, args);
}
catch (e) { }
},
max: function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
try {
return minMax.call(this, false, args);
}
catch (e) { }
},
convert: function (val, unit) {
return val.convertTo(unit.value);
},
pi: function () {
return new dimension_1.default(Math.PI);
},
mod: function (a, b) {
return new dimension_1.default(a.value % b.value, a.unit);
},
pow: function (x, y) {
if (typeof x === 'number' && typeof y === 'number') {
x = new dimension_1.default(x);
y = new dimension_1.default(y);
}
else if (!(x instanceof dimension_1.default) || !(y instanceof dimension_1.default)) {
throw { type: 'Argument', message: 'arguments must be numbers' };
}
return new dimension_1.default(Math.pow(x.value, y.value), x.unit);
},
percentage: function (n) {
var result = (0, math_helper_js_1.default)(function (num) { return num * 100; }, '%', n);
return result;
}
};
//# sourceMappingURL=number.js.map

1
node_modules/less/lib/less/functions/number.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

40
node_modules/less/lib/less/functions/string.js generated vendored Normal file
View File

@@ -0,0 +1,40 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var quoted_1 = tslib_1.__importDefault(require("../tree/quoted"));
var anonymous_1 = tslib_1.__importDefault(require("../tree/anonymous"));
var javascript_1 = tslib_1.__importDefault(require("../tree/javascript"));
exports.default = {
e: function (str) {
return new quoted_1.default('"', str instanceof javascript_1.default ? str.evaluated : str.value, true);
},
escape: function (str) {
return new anonymous_1.default(encodeURI(str.value).replace(/=/g, '%3D').replace(/:/g, '%3A').replace(/#/g, '%23').replace(/;/g, '%3B')
.replace(/\(/g, '%28').replace(/\)/g, '%29'));
},
replace: function (string, pattern, replacement, flags) {
var result = string.value;
replacement = (replacement.type === 'Quoted') ?
replacement.value : replacement.toCSS();
result = result.replace(new RegExp(pattern.value, flags ? flags.value : ''), replacement);
return new quoted_1.default(string.quote || '', result, string.escaped);
},
'%': function (string /* arg, arg, ... */) {
var args = Array.prototype.slice.call(arguments, 1);
var result = string.value;
var _loop_1 = function (i) {
/* jshint loopfunc:true */
result = result.replace(/%[sda]/i, function (token) {
var value = ((args[i].type === 'Quoted') &&
token.match(/s/i)) ? args[i].value : args[i].toCSS();
return token.match(/[A-Z]$/) ? encodeURIComponent(value) : value;
});
};
for (var i = 0; i < args.length; i++) {
_loop_1(i);
}
result = result.replace(/%%/g, '%');
return new quoted_1.default(string.quote || '', result, string.escaped);
}
};
//# sourceMappingURL=string.js.map

1
node_modules/less/lib/less/functions/string.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"string.js","sourceRoot":"","sources":["../../../src/less/functions/string.js"],"names":[],"mappings":";;;AAAA,kEAAoC;AACpC,wEAA0C;AAC1C,0EAA4C;AAE5C,kBAAe;IACX,CAAC,EAAE,UAAU,GAAG;QACZ,OAAO,IAAI,gBAAM,CAAC,GAAG,EAAE,GAAG,YAAY,oBAAU,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACxF,CAAC;IACD,MAAM,EAAE,UAAU,GAAG;QACjB,OAAO,IAAI,mBAAS,CAChB,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;aACnG,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;IAC1D,CAAC;IACD,OAAO,EAAE,UAAU,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK;QAClD,IAAI,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC;QAC1B,WAAW,GAAG,CAAC,WAAW,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC;YAC3C,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;QAC5C,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC;QAC1F,OAAO,IAAI,gBAAM,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IAClE,CAAC;IACD,GAAG,EAAE,UAAU,MAAM,CAAC,mBAAmB;QACrC,IAAM,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;QACtD,IAAI,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC;gCAEjB,CAAC;YACN,0BAA0B;YAC1B,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,UAAA,KAAK;gBACpC,IAAM,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC;oBACtC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;gBACzD,OAAO,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;YACrE,CAAC,CAAC,CAAC;;QANP,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE;oBAA3B,CAAC;SAOT;QACD,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QACpC,OAAO,IAAI,gBAAM,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IAClE,CAAC;CACJ,CAAC","sourcesContent":["import Quoted from '../tree/quoted';\nimport Anonymous from '../tree/anonymous';\nimport JavaScript from '../tree/javascript';\n\nexport default {\n e: function (str) {\n return new Quoted('\"', str instanceof JavaScript ? str.evaluated : str.value, true);\n },\n escape: function (str) {\n return new Anonymous(\n encodeURI(str.value).replace(/=/g, '%3D').replace(/:/g, '%3A').replace(/#/g, '%23').replace(/;/g, '%3B')\n .replace(/\\(/g, '%28').replace(/\\)/g, '%29'));\n },\n replace: function (string, pattern, replacement, flags) {\n let result = string.value;\n replacement = (replacement.type === 'Quoted') ?\n replacement.value : replacement.toCSS();\n result = result.replace(new RegExp(pattern.value, flags ? flags.value : ''), replacement);\n return new Quoted(string.quote || '', result, string.escaped);\n },\n '%': function (string /* arg, arg, ... */) {\n const args = Array.prototype.slice.call(arguments, 1);\n let result = string.value;\n\n for (let i = 0; i < args.length; i++) {\n /* jshint loopfunc:true */\n result = result.replace(/%[sda]/i, token => {\n const value = ((args[i].type === 'Quoted') &&\n token.match(/s/i)) ? args[i].value : args[i].toCSS();\n return token.match(/[A-Z]$/) ? encodeURIComponent(value) : value;\n });\n }\n result = result.replace(/%%/g, '%');\n return new Quoted(string.quote || '', result, string.escaped);\n }\n};\n"]}

28
node_modules/less/lib/less/functions/style.js generated vendored Normal file
View File

@@ -0,0 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var variable_1 = tslib_1.__importDefault(require("../tree/variable"));
var variable_2 = tslib_1.__importDefault(require("../tree/variable"));
var styleExpression = function (args) {
var _this = this;
args = Array.prototype.slice.call(args);
switch (args.length) {
case 0: throw { type: 'Argument', message: 'one or more arguments required' };
}
var entityList = [new variable_1.default(args[0].value, this.index, this.currentFileInfo).eval(this.context)];
args = entityList.map(function (a) { return a.toCSS(_this.context); }).join(this.context.compress ? ',' : ', ');
return new variable_2.default("style(".concat(args, ")"));
};
exports.default = {
style: function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
try {
return styleExpression.call(this, args);
}
catch (e) { }
},
};
//# sourceMappingURL=style.js.map

1
node_modules/less/lib/less/functions/style.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"style.js","sourceRoot":"","sources":["../../../src/less/functions/style.js"],"names":[],"mappings":";;;AAAA,sEAAwC;AACxC,sEAAyC;AAEzC,IAAM,eAAe,GAAG,UAAU,IAAI;IAAd,iBAWvB;IAVG,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxC,QAAQ,IAAI,CAAC,MAAM,EAAE;QACjB,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,gCAAgC,EAAE,CAAC;KACjF;IAED,IAAM,UAAU,GAAG,CAAC,IAAI,kBAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAEtG,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC,UAAA,CAAC,IAAM,OAAO,CAAC,CAAC,KAAK,CAAC,KAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAEvG,OAAO,IAAI,kBAAS,CAAC,gBAAS,IAAI,MAAG,CAAC,CAAC;AAC3C,CAAC,CAAC;AAEF,kBAAe;IACX,KAAK,EAAE;QAAS,cAAO;aAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,yBAAO;;QACnB,IAAI;YACA,OAAO,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;SAC3C;QAAC,OAAO,CAAC,EAAE,GAAE;IAClB,CAAC;CACJ,CAAC","sourcesContent":["import Variable from '../tree/variable';\nimport Anonymous from '../tree/variable';\n\nconst styleExpression = function (args) {\n args = Array.prototype.slice.call(args);\n switch (args.length) {\n case 0: throw { type: 'Argument', message: 'one or more arguments required' };\n }\n \n const entityList = [new Variable(args[0].value, this.index, this.currentFileInfo).eval(this.context)];\n \n args = entityList.map(a => { return a.toCSS(this.context); }).join(this.context.compress ? ',' : ', ');\n \n return new Anonymous(`style(${args})`);\n};\n\nexport default {\n style: function(...args) {\n try {\n return styleExpression.call(this, args);\n } catch (e) {}\n },\n};\n"]}

86
node_modules/less/lib/less/functions/svg.js generated vendored Normal file
View File

@@ -0,0 +1,86 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var dimension_1 = tslib_1.__importDefault(require("../tree/dimension"));
var color_1 = tslib_1.__importDefault(require("../tree/color"));
var expression_1 = tslib_1.__importDefault(require("../tree/expression"));
var quoted_1 = tslib_1.__importDefault(require("../tree/quoted"));
var url_1 = tslib_1.__importDefault(require("../tree/url"));
exports.default = (function () {
return { 'svg-gradient': function (direction) {
var stops;
var gradientDirectionSvg;
var gradientType = 'linear';
var rectangleDimension = 'x="0" y="0" width="1" height="1"';
var renderEnv = { compress: false };
var returner;
var directionValue = direction.toCSS(renderEnv);
var i;
var color;
var position;
var positionValue;
var alpha;
function throwArgumentDescriptor() {
throw { type: 'Argument',
message: 'svg-gradient expects direction, start_color [start_position], [color position,]...,' +
' end_color [end_position] or direction, color list' };
}
if (arguments.length == 2) {
if (arguments[1].value.length < 2) {
throwArgumentDescriptor();
}
stops = arguments[1].value;
}
else if (arguments.length < 3) {
throwArgumentDescriptor();
}
else {
stops = Array.prototype.slice.call(arguments, 1);
}
switch (directionValue) {
case 'to bottom':
gradientDirectionSvg = 'x1="0%" y1="0%" x2="0%" y2="100%"';
break;
case 'to right':
gradientDirectionSvg = 'x1="0%" y1="0%" x2="100%" y2="0%"';
break;
case 'to bottom right':
gradientDirectionSvg = 'x1="0%" y1="0%" x2="100%" y2="100%"';
break;
case 'to top right':
gradientDirectionSvg = 'x1="0%" y1="100%" x2="100%" y2="0%"';
break;
case 'ellipse':
case 'ellipse at center':
gradientType = 'radial';
gradientDirectionSvg = 'cx="50%" cy="50%" r="75%"';
rectangleDimension = 'x="-50" y="-50" width="101" height="101"';
break;
default:
throw { type: 'Argument', message: 'svg-gradient direction must be \'to bottom\', \'to right\',' +
' \'to bottom right\', \'to top right\' or \'ellipse at center\'' };
}
returner = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1 1\"><".concat(gradientType, "Gradient id=\"g\" ").concat(gradientDirectionSvg, ">");
for (i = 0; i < stops.length; i += 1) {
if (stops[i] instanceof expression_1.default) {
color = stops[i].value[0];
position = stops[i].value[1];
}
else {
color = stops[i];
position = undefined;
}
if (!(color instanceof color_1.default) || (!((i === 0 || i + 1 === stops.length) && position === undefined) && !(position instanceof dimension_1.default))) {
throwArgumentDescriptor();
}
positionValue = position ? position.toCSS(renderEnv) : i === 0 ? '0%' : '100%';
alpha = color.alpha;
returner += "<stop offset=\"".concat(positionValue, "\" stop-color=\"").concat(color.toRGB(), "\"").concat(alpha < 1 ? " stop-opacity=\"".concat(alpha, "\"") : '', "/>");
}
returner += "</".concat(gradientType, "Gradient><rect ").concat(rectangleDimension, " fill=\"url(#g)\" /></svg>");
returner = encodeURIComponent(returner);
returner = "data:image/svg+xml,".concat(returner);
return new url_1.default(new quoted_1.default("'".concat(returner, "'"), returner, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo);
} };
});
//# sourceMappingURL=svg.js.map

1
node_modules/less/lib/less/functions/svg.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

74
node_modules/less/lib/less/functions/types.js generated vendored Normal file
View File

@@ -0,0 +1,74 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var keyword_1 = tslib_1.__importDefault(require("../tree/keyword"));
var detached_ruleset_1 = tslib_1.__importDefault(require("../tree/detached-ruleset"));
var dimension_1 = tslib_1.__importDefault(require("../tree/dimension"));
var color_1 = tslib_1.__importDefault(require("../tree/color"));
var quoted_1 = tslib_1.__importDefault(require("../tree/quoted"));
var anonymous_1 = tslib_1.__importDefault(require("../tree/anonymous"));
var url_1 = tslib_1.__importDefault(require("../tree/url"));
var operation_1 = tslib_1.__importDefault(require("../tree/operation"));
var isa = function (n, Type) { return (n instanceof Type) ? keyword_1.default.True : keyword_1.default.False; };
var isunit = function (n, unit) {
if (unit === undefined) {
throw { type: 'Argument', message: 'missing the required second argument to isunit.' };
}
unit = typeof unit.value === 'string' ? unit.value : unit;
if (typeof unit !== 'string') {
throw { type: 'Argument', message: 'Second argument to isunit should be a unit or a string.' };
}
return (n instanceof dimension_1.default) && n.unit.is(unit) ? keyword_1.default.True : keyword_1.default.False;
};
exports.default = {
isruleset: function (n) {
return isa(n, detached_ruleset_1.default);
},
iscolor: function (n) {
return isa(n, color_1.default);
},
isnumber: function (n) {
return isa(n, dimension_1.default);
},
isstring: function (n) {
return isa(n, quoted_1.default);
},
iskeyword: function (n) {
return isa(n, keyword_1.default);
},
isurl: function (n) {
return isa(n, url_1.default);
},
ispixel: function (n) {
return isunit(n, 'px');
},
ispercentage: function (n) {
return isunit(n, '%');
},
isem: function (n) {
return isunit(n, 'em');
},
isunit: isunit,
unit: function (val, unit) {
if (!(val instanceof dimension_1.default)) {
throw { type: 'Argument',
message: "the first argument to unit must be a number".concat(val instanceof operation_1.default ? '. Have you forgotten parenthesis?' : '') };
}
if (unit) {
if (unit instanceof keyword_1.default) {
unit = unit.value;
}
else {
unit = unit.toCSS();
}
}
else {
unit = '';
}
return new dimension_1.default(val.value, unit);
},
'get-unit': function (n) {
return new anonymous_1.default(n.unit);
}
};
//# sourceMappingURL=types.js.map

1
node_modules/less/lib/less/functions/types.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/less/functions/types.js"],"names":[],"mappings":";;;AAAA,oEAAsC;AACtC,sFAAuD;AACvD,wEAA0C;AAC1C,gEAAkC;AAClC,kEAAoC;AACpC,wEAA0C;AAC1C,4DAA8B;AAC9B,wEAA0C;AAE1C,IAAM,GAAG,GAAG,UAAC,CAAC,EAAE,IAAI,IAAK,OAAA,CAAC,CAAC,YAAY,IAAI,CAAC,CAAC,CAAC,CAAC,iBAAO,CAAC,IAAI,CAAC,CAAC,CAAC,iBAAO,CAAC,KAAK,EAAlD,CAAkD,CAAC;AAC5E,IAAM,MAAM,GAAG,UAAC,CAAC,EAAE,IAAI;IACnB,IAAI,IAAI,KAAK,SAAS,EAAE;QACpB,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,iDAAiD,EAAE,CAAC;KAC1F;IACD,IAAI,GAAG,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;IAC1D,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC1B,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,yDAAyD,EAAE,CAAC;KAClG;IACD,OAAO,CAAC,CAAC,YAAY,mBAAS,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,iBAAO,CAAC,IAAI,CAAC,CAAC,CAAC,iBAAO,CAAC,KAAK,CAAC;AACtF,CAAC,CAAC;AAEF,kBAAe;IACX,SAAS,EAAE,UAAU,CAAC;QAClB,OAAO,GAAG,CAAC,CAAC,EAAE,0BAAe,CAAC,CAAC;IACnC,CAAC;IACD,OAAO,EAAE,UAAU,CAAC;QAChB,OAAO,GAAG,CAAC,CAAC,EAAE,eAAK,CAAC,CAAC;IACzB,CAAC;IACD,QAAQ,EAAE,UAAU,CAAC;QACjB,OAAO,GAAG,CAAC,CAAC,EAAE,mBAAS,CAAC,CAAC;IAC7B,CAAC;IACD,QAAQ,EAAE,UAAU,CAAC;QACjB,OAAO,GAAG,CAAC,CAAC,EAAE,gBAAM,CAAC,CAAC;IAC1B,CAAC;IACD,SAAS,EAAE,UAAU,CAAC;QAClB,OAAO,GAAG,CAAC,CAAC,EAAE,iBAAO,CAAC,CAAC;IAC3B,CAAC;IACD,KAAK,EAAE,UAAU,CAAC;QACd,OAAO,GAAG,CAAC,CAAC,EAAE,aAAG,CAAC,CAAC;IACvB,CAAC;IACD,OAAO,EAAE,UAAU,CAAC;QAChB,OAAO,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IAC3B,CAAC;IACD,YAAY,EAAE,UAAU,CAAC;QACrB,OAAO,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC1B,CAAC;IACD,IAAI,EAAE,UAAU,CAAC;QACb,OAAO,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IAC3B,CAAC;IACD,MAAM,QAAA;IACN,IAAI,EAAE,UAAU,GAAG,EAAE,IAAI;QACrB,IAAI,CAAC,CAAC,GAAG,YAAY,mBAAS,CAAC,EAAE;YAC7B,MAAM,EAAE,IAAI,EAAE,UAAU;gBACpB,OAAO,EAAE,qDAA8C,GAAG,YAAY,mBAAS,CAAC,CAAC,CAAC,mCAAmC,CAAC,CAAC,CAAC,EAAE,CAAE,EAAE,CAAC;SACtI;QACD,IAAI,IAAI,EAAE;YACN,IAAI,IAAI,YAAY,iBAAO,EAAE;gBACzB,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC;aACrB;iBAAM;gBACH,IAAI,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;aACvB;SACJ;aAAM;YACH,IAAI,GAAG,EAAE,CAAC;SACb;QACD,OAAO,IAAI,mBAAS,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC1C,CAAC;IACD,UAAU,EAAE,UAAU,CAAC;QACnB,OAAO,IAAI,mBAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;CACJ,CAAC","sourcesContent":["import Keyword from '../tree/keyword';\nimport DetachedRuleset from '../tree/detached-ruleset';\nimport Dimension from '../tree/dimension';\nimport Color from '../tree/color';\nimport Quoted from '../tree/quoted';\nimport Anonymous from '../tree/anonymous';\nimport URL from '../tree/url';\nimport Operation from '../tree/operation';\n\nconst isa = (n, Type) => (n instanceof Type) ? Keyword.True : Keyword.False;\nconst isunit = (n, unit) => {\n if (unit === undefined) {\n throw { type: 'Argument', message: 'missing the required second argument to isunit.' };\n }\n unit = typeof unit.value === 'string' ? unit.value : unit;\n if (typeof unit !== 'string') {\n throw { type: 'Argument', message: 'Second argument to isunit should be a unit or a string.' };\n }\n return (n instanceof Dimension) && n.unit.is(unit) ? Keyword.True : Keyword.False;\n};\n\nexport default {\n isruleset: function (n) {\n return isa(n, DetachedRuleset);\n },\n iscolor: function (n) {\n return isa(n, Color);\n },\n isnumber: function (n) {\n return isa(n, Dimension);\n },\n isstring: function (n) {\n return isa(n, Quoted);\n },\n iskeyword: function (n) {\n return isa(n, Keyword);\n },\n isurl: function (n) {\n return isa(n, URL);\n },\n ispixel: function (n) {\n return isunit(n, 'px');\n },\n ispercentage: function (n) {\n return isunit(n, '%');\n },\n isem: function (n) {\n return isunit(n, 'em');\n },\n isunit,\n unit: function (val, unit) {\n if (!(val instanceof Dimension)) {\n throw { type: 'Argument',\n message: `the first argument to unit must be a number${val instanceof Operation ? '. Have you forgotten parenthesis?' : ''}` };\n }\n if (unit) {\n if (unit instanceof Keyword) {\n unit = unit.value;\n } else {\n unit = unit.toCSS();\n }\n } else {\n unit = '';\n }\n return new Dimension(val.value, unit);\n },\n 'get-unit': function (n) {\n return new Anonymous(n.unit);\n }\n};\n"]}

174
node_modules/less/lib/less/import-manager.js generated vendored Normal file
View File

@@ -0,0 +1,174 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var contexts_1 = tslib_1.__importDefault(require("./contexts"));
var parser_1 = tslib_1.__importDefault(require("./parser/parser"));
var less_error_1 = tslib_1.__importDefault(require("./less-error"));
var utils = tslib_1.__importStar(require("./utils"));
var logger_1 = tslib_1.__importDefault(require("./logger"));
function default_1(environment) {
// FileInfo = {
// 'rewriteUrls' - option - whether to adjust URL's to be relative
// 'filename' - full resolved filename of current file
// 'rootpath' - path to append to normal URLs for this node
// 'currentDirectory' - path to the current file, absolute
// 'rootFilename' - filename of the base file
// 'entryPath' - absolute path to the entry file
// 'reference' - whether the file should not be output and only output parts that are referenced
var ImportManager = /** @class */ (function () {
function ImportManager(less, context, rootFileInfo) {
this.less = less;
this.rootFilename = rootFileInfo.filename;
this.paths = context.paths || []; // Search paths, when importing
this.contents = {}; // map - filename to contents of all the files
this.contentsIgnoredChars = {}; // map - filename to lines at the beginning of each file to ignore
this.mime = context.mime;
this.error = null;
this.context = context;
// Deprecated? Unused outside of here, could be useful.
this.queue = []; // Files which haven't been imported yet
this.files = {}; // Holds the imported parse trees.
}
/**
* Add an import to be imported
* @param path - the raw path
* @param tryAppendExtension - whether to try appending a file extension (.less or .js if the path has no extension)
* @param currentFileInfo - the current file info (used for instance to work out relative paths)
* @param importOptions - import options
* @param callback - callback for when it is imported
*/
ImportManager.prototype.push = function (path, tryAppendExtension, currentFileInfo, importOptions, callback) {
var importManager = this, pluginLoader = this.context.pluginManager.Loader;
this.queue.push(path);
var fileParsedFunc = function (e, root, fullPath) {
importManager.queue.splice(importManager.queue.indexOf(path), 1); // Remove the path from the queue
var importedEqualsRoot = fullPath === importManager.rootFilename;
if (importOptions.optional && e) {
callback(null, { rules: [] }, false, null);
logger_1.default.info("The file ".concat(fullPath, " was skipped because it was not found and the import was marked optional."));
}
else {
// Inline imports aren't cached here.
// If we start to cache them, please make sure they won't conflict with non-inline imports of the
// same name as they used to do before this comment and the condition below have been added.
if (!importManager.files[fullPath] && !importOptions.inline) {
importManager.files[fullPath] = { root: root, options: importOptions };
}
if (e && !importManager.error) {
importManager.error = e;
}
callback(e, root, importedEqualsRoot, fullPath);
}
};
var newFileInfo = {
rewriteUrls: this.context.rewriteUrls,
entryPath: currentFileInfo.entryPath,
rootpath: currentFileInfo.rootpath,
rootFilename: currentFileInfo.rootFilename
};
var fileManager = environment.getFileManager(path, currentFileInfo.currentDirectory, this.context, environment);
if (!fileManager) {
fileParsedFunc({ message: "Could not find a file-manager for ".concat(path) });
return;
}
var loadFileCallback = function (loadedFile) {
var plugin;
var resolvedFilename = loadedFile.filename;
var contents = loadedFile.contents.replace(/^\uFEFF/, '');
// Pass on an updated rootpath if path of imported file is relative and file
// is in a (sub|sup) directory
//
// Examples:
// - If path of imported file is 'module/nav/nav.less' and rootpath is 'less/',
// then rootpath should become 'less/module/nav/'
// - If path of imported file is '../mixins.less' and rootpath is 'less/',
// then rootpath should become 'less/../'
newFileInfo.currentDirectory = fileManager.getPath(resolvedFilename);
if (newFileInfo.rewriteUrls) {
newFileInfo.rootpath = fileManager.join((importManager.context.rootpath || ''), fileManager.pathDiff(newFileInfo.currentDirectory, newFileInfo.entryPath));
if (!fileManager.isPathAbsolute(newFileInfo.rootpath) && fileManager.alwaysMakePathsAbsolute()) {
newFileInfo.rootpath = fileManager.join(newFileInfo.entryPath, newFileInfo.rootpath);
}
}
newFileInfo.filename = resolvedFilename;
var newEnv = new contexts_1.default.Parse(importManager.context);
newEnv.processImports = false;
importManager.contents[resolvedFilename] = contents;
if (currentFileInfo.reference || importOptions.reference) {
newFileInfo.reference = true;
}
if (importOptions.isPlugin) {
plugin = pluginLoader.evalPlugin(contents, newEnv, importManager, importOptions.pluginArgs, newFileInfo);
if (plugin instanceof less_error_1.default) {
fileParsedFunc(plugin, null, resolvedFilename);
}
else {
fileParsedFunc(null, plugin, resolvedFilename);
}
}
else if (importOptions.inline) {
fileParsedFunc(null, contents, resolvedFilename);
}
else {
// import (multiple) parse trees apparently get altered and can't be cached.
// TODO: investigate why this is
if (importManager.files[resolvedFilename]
&& !importManager.files[resolvedFilename].options.multiple
&& !importOptions.multiple) {
fileParsedFunc(null, importManager.files[resolvedFilename].root, resolvedFilename);
}
else {
new parser_1.default(newEnv, importManager, newFileInfo).parse(contents, function (e, root) {
fileParsedFunc(e, root, resolvedFilename);
});
}
}
};
var loadedFile;
var promise;
var context = utils.clone(this.context);
if (tryAppendExtension) {
context.ext = importOptions.isPlugin ? '.js' : '.less';
}
if (importOptions.isPlugin) {
context.mime = 'application/javascript';
if (context.syncImport) {
loadedFile = pluginLoader.loadPluginSync(path, currentFileInfo.currentDirectory, context, environment, fileManager);
}
else {
promise = pluginLoader.loadPlugin(path, currentFileInfo.currentDirectory, context, environment, fileManager);
}
}
else {
if (context.syncImport) {
loadedFile = fileManager.loadFileSync(path, currentFileInfo.currentDirectory, context, environment);
}
else {
promise = fileManager.loadFile(path, currentFileInfo.currentDirectory, context, environment, function (err, loadedFile) {
if (err) {
fileParsedFunc(err);
}
else {
loadFileCallback(loadedFile);
}
});
}
}
if (loadedFile) {
if (!loadedFile.filename) {
fileParsedFunc(loadedFile);
}
else {
loadFileCallback(loadedFile);
}
}
else if (promise) {
promise.then(loadFileCallback, fileParsedFunc);
}
};
return ImportManager;
}());
return ImportManager;
}
exports.default = default_1;
//# sourceMappingURL=import-manager.js.map

1
node_modules/less/lib/less/import-manager.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

95
node_modules/less/lib/less/index.js generated vendored Normal file
View File

@@ -0,0 +1,95 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var environment_1 = tslib_1.__importDefault(require("./environment/environment"));
var data_1 = tslib_1.__importDefault(require("./data"));
var tree_1 = tslib_1.__importDefault(require("./tree"));
var abstract_file_manager_1 = tslib_1.__importDefault(require("./environment/abstract-file-manager"));
var abstract_plugin_loader_1 = tslib_1.__importDefault(require("./environment/abstract-plugin-loader"));
var visitors_1 = tslib_1.__importDefault(require("./visitors"));
var parser_1 = tslib_1.__importDefault(require("./parser/parser"));
var functions_1 = tslib_1.__importDefault(require("./functions"));
var contexts_1 = tslib_1.__importDefault(require("./contexts"));
var less_error_1 = tslib_1.__importDefault(require("./less-error"));
var transform_tree_1 = tslib_1.__importDefault(require("./transform-tree"));
var utils = tslib_1.__importStar(require("./utils"));
var plugin_manager_1 = tslib_1.__importDefault(require("./plugin-manager"));
var logger_1 = tslib_1.__importDefault(require("./logger"));
var source_map_output_1 = tslib_1.__importDefault(require("./source-map-output"));
var source_map_builder_1 = tslib_1.__importDefault(require("./source-map-builder"));
var parse_tree_1 = tslib_1.__importDefault(require("./parse-tree"));
var import_manager_1 = tslib_1.__importDefault(require("./import-manager"));
var parse_1 = tslib_1.__importDefault(require("./parse"));
var render_1 = tslib_1.__importDefault(require("./render"));
var package_json_1 = require("../../package.json");
var parse_node_version_1 = tslib_1.__importDefault(require("parse-node-version"));
function default_1(environment, fileManagers) {
var sourceMapOutput, sourceMapBuilder, parseTree, importManager;
environment = new environment_1.default(environment, fileManagers);
sourceMapOutput = (0, source_map_output_1.default)(environment);
sourceMapBuilder = (0, source_map_builder_1.default)(sourceMapOutput, environment);
parseTree = (0, parse_tree_1.default)(sourceMapBuilder);
importManager = (0, import_manager_1.default)(environment);
var render = (0, render_1.default)(environment, parseTree, importManager);
var parse = (0, parse_1.default)(environment, parseTree, importManager);
var v = (0, parse_node_version_1.default)("v".concat(package_json_1.version));
var initial = {
version: [v.major, v.minor, v.patch],
data: data_1.default,
tree: tree_1.default,
Environment: environment_1.default,
AbstractFileManager: abstract_file_manager_1.default,
AbstractPluginLoader: abstract_plugin_loader_1.default,
environment: environment,
visitors: visitors_1.default,
Parser: parser_1.default,
functions: (0, functions_1.default)(environment),
contexts: contexts_1.default,
SourceMapOutput: sourceMapOutput,
SourceMapBuilder: sourceMapBuilder,
ParseTree: parseTree,
ImportManager: importManager,
render: render,
parse: parse,
LessError: less_error_1.default,
transformTree: transform_tree_1.default,
utils: utils,
PluginManager: plugin_manager_1.default,
logger: logger_1.default
};
// Create a public API
var ctor = function (t) {
return function () {
var obj = Object.create(t.prototype);
t.apply(obj, Array.prototype.slice.call(arguments, 0));
return obj;
};
};
var t;
var api = Object.create(initial);
for (var n in initial.tree) {
/* eslint guard-for-in: 0 */
t = initial.tree[n];
if (typeof t === 'function') {
api[n.toLowerCase()] = ctor(t);
}
else {
api[n] = Object.create(null);
for (var o in t) {
/* eslint guard-for-in: 0 */
api[n][o.toLowerCase()] = ctor(t[o]);
}
}
}
/**
* Some of the functions assume a `this` context of the API object,
* which causes it to fail when wrapped for ES6 imports.
*
* An assumed `this` should be removed in the future.
*/
initial.parse = initial.parse.bind(api);
initial.render = initial.render.bind(api);
return api;
}
exports.default = default_1;
//# sourceMappingURL=index.js.map

1
node_modules/less/lib/less/index.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

143
node_modules/less/lib/less/less-error.js generated vendored Normal file
View File

@@ -0,0 +1,143 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var utils = tslib_1.__importStar(require("./utils"));
var anonymousFunc = /(<anonymous>|Function):(\d+):(\d+)/;
/**
* This is a centralized class of any error that could be thrown internally (mostly by the parser).
* Besides standard .message it keeps some additional data like a path to the file where the error
* occurred along with line and column numbers.
*
* @class
* @extends Error
* @type {module.LessError}
*
* @prop {string} type
* @prop {string} filename
* @prop {number} index
* @prop {number} line
* @prop {number} column
* @prop {number} callLine
* @prop {number} callExtract
* @prop {string[]} extract
*
* @param {Object} e - An error object to wrap around or just a descriptive object
* @param {Object} fileContentMap - An object with file contents in 'contents' property (like importManager) @todo - move to fileManager?
* @param {string} [currentFilename]
*/
var LessError = function (e, fileContentMap, currentFilename) {
Error.call(this);
var filename = e.filename || currentFilename;
this.message = e.message;
this.stack = e.stack;
if (fileContentMap && filename) {
var input = fileContentMap.contents[filename];
var loc = utils.getLocation(e.index, input);
var line = loc.line;
var col = loc.column;
var callLine = e.call && utils.getLocation(e.call, input).line;
var lines = input ? input.split('\n') : '';
this.type = e.type || 'Syntax';
this.filename = filename;
this.index = e.index;
this.line = typeof line === 'number' ? line + 1 : null;
this.column = col;
if (!this.line && this.stack) {
var found = this.stack.match(anonymousFunc);
/**
* We have to figure out how this environment stringifies anonymous functions
* so we can correctly map plugin errors.
*
* Note, in Node 8, the output of anonymous funcs varied based on parameters
* being present or not, so we inject dummy params.
*/
var func = new Function('a', 'throw new Error()');
var lineAdjust = 0;
try {
func();
}
catch (e) {
var match = e.stack.match(anonymousFunc);
lineAdjust = 1 - parseInt(match[2]);
}
if (found) {
if (found[2]) {
this.line = parseInt(found[2]) + lineAdjust;
}
if (found[3]) {
this.column = parseInt(found[3]);
}
}
}
this.callLine = callLine + 1;
this.callExtract = lines[callLine];
this.extract = [
lines[this.line - 2],
lines[this.line - 1],
lines[this.line]
];
}
};
if (typeof Object.create === 'undefined') {
var F = function () { };
F.prototype = Error.prototype;
LessError.prototype = new F();
}
else {
LessError.prototype = Object.create(Error.prototype);
}
LessError.prototype.constructor = LessError;
/**
* An overridden version of the default Object.prototype.toString
* which uses additional information to create a helpful message.
*
* @param {Object} options
* @returns {string}
*/
LessError.prototype.toString = function (options) {
options = options || {};
var message = '';
var extract = this.extract || [];
var error = [];
var stylize = function (str) { return str; };
if (options.stylize) {
var type = typeof options.stylize;
if (type !== 'function') {
throw Error("options.stylize should be a function, got a ".concat(type, "!"));
}
stylize = options.stylize;
}
if (this.line !== null) {
if (typeof extract[0] === 'string') {
error.push(stylize("".concat(this.line - 1, " ").concat(extract[0]), 'grey'));
}
if (typeof extract[1] === 'string') {
var errorTxt = "".concat(this.line, " ");
if (extract[1]) {
errorTxt += extract[1].slice(0, this.column) +
stylize(stylize(stylize(extract[1].substr(this.column, 1), 'bold') +
extract[1].slice(this.column + 1), 'red'), 'inverse');
}
error.push(errorTxt);
}
if (typeof extract[2] === 'string') {
error.push(stylize("".concat(this.line + 1, " ").concat(extract[2]), 'grey'));
}
error = "".concat(error.join('\n') + stylize('', 'reset'), "\n");
}
message += stylize("".concat(this.type, "Error: ").concat(this.message), 'red');
if (this.filename) {
message += stylize(' in ', 'red') + this.filename;
}
if (this.line) {
message += stylize(" on line ".concat(this.line, ", column ").concat(this.column + 1, ":"), 'grey');
}
message += "\n".concat(error);
if (this.callLine) {
message += "".concat(stylize('from ', 'red') + (this.filename || ''), "/n");
message += "".concat(stylize(this.callLine, 'grey'), " ").concat(this.callExtract, "/n");
}
return message;
};
exports.default = LessError;
//# sourceMappingURL=less-error.js.map

1
node_modules/less/lib/less/less-error.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

37
node_modules/less/lib/less/logger.js generated vendored Normal file
View File

@@ -0,0 +1,37 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
error: function (msg) {
this._fireEvent('error', msg);
},
warn: function (msg) {
this._fireEvent('warn', msg);
},
info: function (msg) {
this._fireEvent('info', msg);
},
debug: function (msg) {
this._fireEvent('debug', msg);
},
addListener: function (listener) {
this._listeners.push(listener);
},
removeListener: function (listener) {
for (var i = 0; i < this._listeners.length; i++) {
if (this._listeners[i] === listener) {
this._listeners.splice(i, 1);
return;
}
}
},
_fireEvent: function (type, msg) {
for (var i = 0; i < this._listeners.length; i++) {
var logFunction = this._listeners[i][type];
if (logFunction) {
logFunction(msg);
}
}
},
_listeners: []
};
//# sourceMappingURL=logger.js.map

1
node_modules/less/lib/less/logger.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/less/logger.js"],"names":[],"mappings":";;AAAA,kBAAe;IACX,KAAK,EAAE,UAAS,GAAG;QACf,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IAClC,CAAC;IACD,IAAI,EAAE,UAAS,GAAG;QACd,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,CAAC;IACD,IAAI,EAAE,UAAS,GAAG;QACd,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,CAAC;IACD,KAAK,EAAE,UAAS,GAAG;QACf,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IAClC,CAAC;IACD,WAAW,EAAE,UAAS,QAAQ;QAC1B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACnC,CAAC;IACD,cAAc,EAAE,UAAS,QAAQ;QAC7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC7C,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE;gBACjC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;gBAC7B,OAAO;aACV;SACJ;IACL,CAAC;IACD,UAAU,EAAE,UAAS,IAAI,EAAE,GAAG;QAC1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC7C,IAAM,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YAC7C,IAAI,WAAW,EAAE;gBACb,WAAW,CAAC,GAAG,CAAC,CAAC;aACpB;SACJ;IACL,CAAC;IACD,UAAU,EAAE,EAAE;CACjB,CAAC","sourcesContent":["export default {\n error: function(msg) {\n this._fireEvent('error', msg);\n },\n warn: function(msg) {\n this._fireEvent('warn', msg);\n },\n info: function(msg) {\n this._fireEvent('info', msg);\n },\n debug: function(msg) {\n this._fireEvent('debug', msg);\n },\n addListener: function(listener) {\n this._listeners.push(listener);\n },\n removeListener: function(listener) {\n for (let i = 0; i < this._listeners.length; i++) {\n if (this._listeners[i] === listener) {\n this._listeners.splice(i, 1);\n return;\n }\n }\n },\n _fireEvent: function(type, msg) {\n for (let i = 0; i < this._listeners.length; i++) {\n const logFunction = this._listeners[i][type];\n if (logFunction) {\n logFunction(msg);\n }\n }\n },\n _listeners: []\n};\n"]}

68
node_modules/less/lib/less/parse-tree.js generated vendored Normal file
View File

@@ -0,0 +1,68 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var less_error_1 = tslib_1.__importDefault(require("./less-error"));
var transform_tree_1 = tslib_1.__importDefault(require("./transform-tree"));
var logger_1 = tslib_1.__importDefault(require("./logger"));
function default_1(SourceMapBuilder) {
var ParseTree = /** @class */ (function () {
function ParseTree(root, imports) {
this.root = root;
this.imports = imports;
}
ParseTree.prototype.toCSS = function (options) {
var evaldRoot;
var result = {};
var sourceMapBuilder;
try {
evaldRoot = (0, transform_tree_1.default)(this.root, options);
}
catch (e) {
throw new less_error_1.default(e, this.imports);
}
try {
var compress = Boolean(options.compress);
if (compress) {
logger_1.default.warn('The compress option has been deprecated. ' +
'We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css.');
}
var toCSSOptions = {
compress: compress,
dumpLineNumbers: options.dumpLineNumbers,
strictUnits: Boolean(options.strictUnits),
numPrecision: 8
};
if (options.sourceMap) {
sourceMapBuilder = new SourceMapBuilder(options.sourceMap);
result.css = sourceMapBuilder.toCSS(evaldRoot, toCSSOptions, this.imports);
}
else {
result.css = evaldRoot.toCSS(toCSSOptions);
}
}
catch (e) {
throw new less_error_1.default(e, this.imports);
}
if (options.pluginManager) {
var postProcessors = options.pluginManager.getPostProcessors();
for (var i = 0; i < postProcessors.length; i++) {
result.css = postProcessors[i].process(result.css, { sourceMap: sourceMapBuilder, options: options, imports: this.imports });
}
}
if (options.sourceMap) {
result.map = sourceMapBuilder.getExternalSourceMap();
}
result.imports = [];
for (var file in this.imports.files) {
if (Object.prototype.hasOwnProperty.call(this.imports.files, file) && file !== this.imports.rootFilename) {
result.imports.push(file);
}
}
return result;
};
return ParseTree;
}());
return ParseTree;
}
exports.default = default_1;
//# sourceMappingURL=parse-tree.js.map

1
node_modules/less/lib/less/parse-tree.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"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,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,gBAAgB,GAAG,IAAI,gBAAgB,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;oBAC3D,MAAM,CAAC,GAAG,GAAG,gBAAgB,CAAC,KAAK,CAAC,SAAS,EAAE,YAAY,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;iBAC9E;qBAAM;oBACH,MAAM,CAAC,GAAG,GAAG,SAAS,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;iBAC9C;aACJ;YAAC,OAAO,CAAC,EAAE;gBACR,MAAM,IAAI,oBAAS,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;aACxC;YAED,IAAI,OAAO,CAAC,aAAa,EAAE;gBACvB,IAAM,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,iBAAiB,EAAE,CAAC;gBACjE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;oBAC5C,MAAM,CAAC,GAAG,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,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,AAzDD,IAyDC;IAED,OAAO,SAAS,CAAC;AACrB,CAAC;AA7DD,4BA6DC","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 dumpLineNumbers: options.dumpLineNumbers,\n strictUnits: Boolean(options.strictUnits),\n numPrecision: 8};\n\n if (options.sourceMap) {\n sourceMapBuilder = new SourceMapBuilder(options.sourceMap);\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"]}

87
node_modules/less/lib/less/parse.js generated vendored Normal file
View File

@@ -0,0 +1,87 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var contexts_1 = tslib_1.__importDefault(require("./contexts"));
var parser_1 = tslib_1.__importDefault(require("./parser/parser"));
var plugin_manager_1 = tslib_1.__importDefault(require("./plugin-manager"));
var less_error_1 = tslib_1.__importDefault(require("./less-error"));
var utils = tslib_1.__importStar(require("./utils"));
function default_1(environment, ParseTree, ImportManager) {
var parse = function (input, options, callback) {
if (typeof options === 'function') {
callback = options;
options = utils.copyOptions(this.options, {});
}
else {
options = utils.copyOptions(this.options, options || {});
}
if (!callback) {
var self_1 = this;
return new Promise(function (resolve, reject) {
parse.call(self_1, input, options, function (err, output) {
if (err) {
reject(err);
}
else {
resolve(output);
}
});
});
}
else {
var context_1;
var rootFileInfo = void 0;
var pluginManager_1 = new plugin_manager_1.default(this, !options.reUsePluginManager);
options.pluginManager = pluginManager_1;
context_1 = new contexts_1.default.Parse(options);
if (options.rootFileInfo) {
rootFileInfo = options.rootFileInfo;
}
else {
var filename = options.filename || 'input';
var entryPath = filename.replace(/[^/\\]*$/, '');
rootFileInfo = {
filename: filename,
rewriteUrls: context_1.rewriteUrls,
rootpath: context_1.rootpath || '',
currentDirectory: entryPath,
entryPath: entryPath,
rootFilename: filename
};
// add in a missing trailing slash
if (rootFileInfo.rootpath && rootFileInfo.rootpath.slice(-1) !== '/') {
rootFileInfo.rootpath += '/';
}
}
var imports_1 = new ImportManager(this, context_1, rootFileInfo);
this.importManager = imports_1;
// TODO: allow the plugins to be just a list of paths or names
// Do an async plugin queue like lessc
if (options.plugins) {
options.plugins.forEach(function (plugin) {
var evalResult, contents;
if (plugin.fileContent) {
contents = plugin.fileContent.replace(/^\uFEFF/, '');
evalResult = pluginManager_1.Loader.evalPlugin(contents, context_1, imports_1, plugin.options, plugin.filename);
if (evalResult instanceof less_error_1.default) {
return callback(evalResult);
}
}
else {
pluginManager_1.addPlugin(plugin);
}
});
}
new parser_1.default(context_1, imports_1, rootFileInfo)
.parse(input, function (e, root) {
if (e) {
return callback(e);
}
callback(null, root, imports_1, options);
}, options);
}
};
return parse;
}
exports.default = default_1;
//# sourceMappingURL=parse.js.map

1
node_modules/less/lib/less/parse.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

148
node_modules/less/lib/less/parser/chunker.js generated vendored Normal file
View File

@@ -0,0 +1,148 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// Split the input into chunks.
function default_1(input, fail) {
var len = input.length;
var level = 0;
var parenLevel = 0;
var lastOpening;
var lastOpeningParen;
var lastMultiComment;
var lastMultiCommentEndBrace;
var chunks = [];
var emitFrom = 0;
var chunkerCurrentIndex;
var currentChunkStartIndex;
var cc;
var cc2;
var matched;
function emitChunk(force) {
var len = chunkerCurrentIndex - emitFrom;
if (((len < 512) && !force) || !len) {
return;
}
chunks.push(input.slice(emitFrom, chunkerCurrentIndex + 1));
emitFrom = chunkerCurrentIndex + 1;
}
for (chunkerCurrentIndex = 0; chunkerCurrentIndex < len; chunkerCurrentIndex++) {
cc = input.charCodeAt(chunkerCurrentIndex);
if (((cc >= 97) && (cc <= 122)) || (cc < 34)) {
// a-z or whitespace
continue;
}
switch (cc) {
case 40: // (
parenLevel++;
lastOpeningParen = chunkerCurrentIndex;
continue;
case 41: // )
if (--parenLevel < 0) {
return fail('missing opening `(`', chunkerCurrentIndex);
}
continue;
case 59: // ;
if (!parenLevel) {
emitChunk();
}
continue;
case 123: // {
level++;
lastOpening = chunkerCurrentIndex;
continue;
case 125: // }
if (--level < 0) {
return fail('missing opening `{`', chunkerCurrentIndex);
}
if (!level && !parenLevel) {
emitChunk();
}
continue;
case 92: // \
if (chunkerCurrentIndex < len - 1) {
chunkerCurrentIndex++;
continue;
}
return fail('unescaped `\\`', chunkerCurrentIndex);
case 34:
case 39:
case 96: // ", ' and `
matched = 0;
currentChunkStartIndex = chunkerCurrentIndex;
for (chunkerCurrentIndex = chunkerCurrentIndex + 1; chunkerCurrentIndex < len; chunkerCurrentIndex++) {
cc2 = input.charCodeAt(chunkerCurrentIndex);
if (cc2 > 96) {
continue;
}
if (cc2 == cc) {
matched = 1;
break;
}
if (cc2 == 92) { // \
if (chunkerCurrentIndex == len - 1) {
return fail('unescaped `\\`', chunkerCurrentIndex);
}
chunkerCurrentIndex++;
}
}
if (matched) {
continue;
}
return fail("unmatched `".concat(String.fromCharCode(cc), "`"), currentChunkStartIndex);
case 47: // /, check for comment
if (parenLevel || (chunkerCurrentIndex == len - 1)) {
continue;
}
cc2 = input.charCodeAt(chunkerCurrentIndex + 1);
if (cc2 == 47) {
// //, find lnfeed
for (chunkerCurrentIndex = chunkerCurrentIndex + 2; chunkerCurrentIndex < len; chunkerCurrentIndex++) {
cc2 = input.charCodeAt(chunkerCurrentIndex);
if ((cc2 <= 13) && ((cc2 == 10) || (cc2 == 13))) {
break;
}
}
}
else if (cc2 == 42) {
// /*, find */
lastMultiComment = currentChunkStartIndex = chunkerCurrentIndex;
for (chunkerCurrentIndex = chunkerCurrentIndex + 2; chunkerCurrentIndex < len - 1; chunkerCurrentIndex++) {
cc2 = input.charCodeAt(chunkerCurrentIndex);
if (cc2 == 125) {
lastMultiCommentEndBrace = chunkerCurrentIndex;
}
if (cc2 != 42) {
continue;
}
if (input.charCodeAt(chunkerCurrentIndex + 1) == 47) {
break;
}
}
if (chunkerCurrentIndex == len - 1) {
return fail('missing closing `*/`', currentChunkStartIndex);
}
chunkerCurrentIndex++;
}
continue;
case 42: // *, check for unmatched */
if ((chunkerCurrentIndex < len - 1) && (input.charCodeAt(chunkerCurrentIndex + 1) == 47)) {
return fail('unmatched `/*`', chunkerCurrentIndex);
}
continue;
}
}
if (level !== 0) {
if ((lastMultiComment > lastOpening) && (lastMultiCommentEndBrace > lastMultiComment)) {
return fail('missing closing `}` or `*/`', lastOpening);
}
else {
return fail('missing closing `}`', lastOpening);
}
}
else if (parenLevel !== 0) {
return fail('missing closing `)`', lastOpeningParen);
}
emitChunk(true);
return chunks;
}
exports.default = default_1;
//# sourceMappingURL=chunker.js.map

1
node_modules/less/lib/less/parser/chunker.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

359
node_modules/less/lib/less/parser/parser-input.js generated vendored Normal file
View File

@@ -0,0 +1,359 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var chunker_1 = tslib_1.__importDefault(require("./chunker"));
exports.default = (function () {
var // Less input string
input;
var // current chunk
j;
var // holds state for backtracking
saveStack = [];
var // furthest index the parser has gone to
furthest;
var // if this is furthest we got to, this is the probably cause
furthestPossibleErrorMessage;
var // chunkified input
chunks;
var // current chunk
current;
var // index of current chunk, in `input`
currentPos;
var parserInput = {};
var CHARCODE_SPACE = 32;
var CHARCODE_TAB = 9;
var CHARCODE_LF = 10;
var CHARCODE_CR = 13;
var CHARCODE_PLUS = 43;
var CHARCODE_COMMA = 44;
var CHARCODE_FORWARD_SLASH = 47;
var CHARCODE_9 = 57;
function skipWhitespace(length) {
var oldi = parserInput.i;
var oldj = j;
var curr = parserInput.i - currentPos;
var endIndex = parserInput.i + current.length - curr;
var mem = (parserInput.i += length);
var inp = input;
var c;
var nextChar;
var comment;
for (; parserInput.i < endIndex; parserInput.i++) {
c = inp.charCodeAt(parserInput.i);
if (parserInput.autoCommentAbsorb && c === CHARCODE_FORWARD_SLASH) {
nextChar = inp.charAt(parserInput.i + 1);
if (nextChar === '/') {
comment = { index: parserInput.i, isLineComment: true };
var nextNewLine = inp.indexOf('\n', parserInput.i + 2);
if (nextNewLine < 0) {
nextNewLine = endIndex;
}
parserInput.i = nextNewLine;
comment.text = inp.substr(comment.index, parserInput.i - comment.index);
parserInput.commentStore.push(comment);
continue;
}
else if (nextChar === '*') {
var nextStarSlash = inp.indexOf('*/', parserInput.i + 2);
if (nextStarSlash >= 0) {
comment = {
index: parserInput.i,
text: inp.substr(parserInput.i, nextStarSlash + 2 - parserInput.i),
isLineComment: false
};
parserInput.i += comment.text.length - 1;
parserInput.commentStore.push(comment);
continue;
}
}
break;
}
if ((c !== CHARCODE_SPACE) && (c !== CHARCODE_LF) && (c !== CHARCODE_TAB) && (c !== CHARCODE_CR)) {
break;
}
}
current = current.slice(length + parserInput.i - mem + curr);
currentPos = parserInput.i;
if (!current.length) {
if (j < chunks.length - 1) {
current = chunks[++j];
skipWhitespace(0); // skip space at the beginning of a chunk
return true; // things changed
}
parserInput.finished = true;
}
return oldi !== parserInput.i || oldj !== j;
}
parserInput.save = function () {
currentPos = parserInput.i;
saveStack.push({ current: current, i: parserInput.i, j: j });
};
parserInput.restore = function (possibleErrorMessage) {
if (parserInput.i > furthest || (parserInput.i === furthest && possibleErrorMessage && !furthestPossibleErrorMessage)) {
furthest = parserInput.i;
furthestPossibleErrorMessage = possibleErrorMessage;
}
var state = saveStack.pop();
current = state.current;
currentPos = parserInput.i = state.i;
j = state.j;
};
parserInput.forget = function () {
saveStack.pop();
};
parserInput.isWhitespace = function (offset) {
var pos = parserInput.i + (offset || 0);
var code = input.charCodeAt(pos);
return (code === CHARCODE_SPACE || code === CHARCODE_CR || code === CHARCODE_TAB || code === CHARCODE_LF);
};
// Specialization of $(tok)
parserInput.$re = function (tok) {
if (parserInput.i > currentPos) {
current = current.slice(parserInput.i - currentPos);
currentPos = parserInput.i;
}
var m = tok.exec(current);
if (!m) {
return null;
}
skipWhitespace(m[0].length);
if (typeof m === 'string') {
return m;
}
return m.length === 1 ? m[0] : m;
};
parserInput.$char = function (tok) {
if (input.charAt(parserInput.i) !== tok) {
return null;
}
skipWhitespace(1);
return tok;
};
parserInput.$peekChar = function (tok) {
if (input.charAt(parserInput.i) !== tok) {
return null;
}
return tok;
};
parserInput.$str = function (tok) {
var tokLength = tok.length;
// https://jsperf.com/string-startswith/21
for (var i = 0; i < tokLength; i++) {
if (input.charAt(parserInput.i + i) !== tok.charAt(i)) {
return null;
}
}
skipWhitespace(tokLength);
return tok;
};
parserInput.$quoted = function (loc) {
var pos = loc || parserInput.i;
var startChar = input.charAt(pos);
if (startChar !== '\'' && startChar !== '"') {
return;
}
var length = input.length;
var currentPosition = pos;
for (var i = 1; i + currentPosition < length; i++) {
var nextChar = input.charAt(i + currentPosition);
switch (nextChar) {
case '\\':
i++;
continue;
case '\r':
case '\n':
break;
case startChar: {
var str = input.substr(currentPosition, i + 1);
if (!loc && loc !== 0) {
skipWhitespace(i + 1);
return str;
}
return [startChar, str];
}
default:
}
}
return null;
};
/**
* Permissive parsing. Ignores everything except matching {} [] () and quotes
* until matching token (outside of blocks)
*/
parserInput.$parseUntil = function (tok) {
var quote = '';
var returnVal = null;
var inComment = false;
var blockDepth = 0;
var blockStack = [];
var parseGroups = [];
var length = input.length;
var startPos = parserInput.i;
var lastPos = parserInput.i;
var i = parserInput.i;
var loop = true;
var testChar;
if (typeof tok === 'string') {
testChar = function (char) { return char === tok; };
}
else {
testChar = function (char) { return tok.test(char); };
}
do {
var nextChar = input.charAt(i);
if (blockDepth === 0 && testChar(nextChar)) {
returnVal = input.substr(lastPos, i - lastPos);
if (returnVal) {
parseGroups.push(returnVal);
}
else {
parseGroups.push(' ');
}
returnVal = parseGroups;
skipWhitespace(i - startPos);
loop = false;
}
else {
if (inComment) {
if (nextChar === '*' &&
input.charAt(i + 1) === '/') {
i++;
blockDepth--;
inComment = false;
}
i++;
continue;
}
switch (nextChar) {
case '\\':
i++;
nextChar = input.charAt(i);
parseGroups.push(input.substr(lastPos, i - lastPos + 1));
lastPos = i + 1;
break;
case '/':
if (input.charAt(i + 1) === '*') {
i++;
inComment = true;
blockDepth++;
}
break;
case '\'':
case '"':
quote = parserInput.$quoted(i);
if (quote) {
parseGroups.push(input.substr(lastPos, i - lastPos), quote);
i += quote[1].length - 1;
lastPos = i + 1;
}
else {
skipWhitespace(i - startPos);
returnVal = nextChar;
loop = false;
}
break;
case '{':
blockStack.push('}');
blockDepth++;
break;
case '(':
blockStack.push(')');
blockDepth++;
break;
case '[':
blockStack.push(']');
blockDepth++;
break;
case '}':
case ')':
case ']': {
var expected = blockStack.pop();
if (nextChar === expected) {
blockDepth--;
}
else {
// move the parser to the error and return expected
skipWhitespace(i - startPos);
returnVal = expected;
loop = false;
}
}
}
i++;
if (i > length) {
loop = false;
}
}
} while (loop);
return returnVal ? returnVal : null;
};
parserInput.autoCommentAbsorb = true;
parserInput.commentStore = [];
parserInput.finished = false;
// Same as $(), but don't change the state of the parser,
// just return the match.
parserInput.peek = function (tok) {
if (typeof tok === 'string') {
// https://jsperf.com/string-startswith/21
for (var i = 0; i < tok.length; i++) {
if (input.charAt(parserInput.i + i) !== tok.charAt(i)) {
return false;
}
}
return true;
}
else {
return tok.test(current);
}
};
// Specialization of peek()
// TODO remove or change some currentChar calls to peekChar
parserInput.peekChar = function (tok) { return input.charAt(parserInput.i) === tok; };
parserInput.currentChar = function () { return input.charAt(parserInput.i); };
parserInput.prevChar = function () { return input.charAt(parserInput.i - 1); };
parserInput.getInput = function () { return input; };
parserInput.peekNotNumeric = function () {
var c = input.charCodeAt(parserInput.i);
// Is the first char of the dimension 0-9, '.', '+' or '-'
return (c > CHARCODE_9 || c < CHARCODE_PLUS) || c === CHARCODE_FORWARD_SLASH || c === CHARCODE_COMMA;
};
parserInput.start = function (str, chunkInput, failFunction) {
input = str;
parserInput.i = j = currentPos = furthest = 0;
// chunking apparently makes things quicker (but my tests indicate
// it might actually make things slower in node at least)
// and it is a non-perfect parse - it can't recognise
// unquoted urls, meaning it can't distinguish comments
// meaning comments with quotes or {}() in them get 'counted'
// and then lead to parse errors.
// In addition if the chunking chunks in the wrong place we might
// not be able to parse a parser statement in one go
// this is officially deprecated but can be switched on via an option
// in the case it causes too much performance issues.
if (chunkInput) {
chunks = (0, chunker_1.default)(str, failFunction);
}
else {
chunks = [str];
}
current = chunks[0];
skipWhitespace(0);
};
parserInput.end = function () {
var message;
var isFinished = parserInput.i >= input.length;
if (parserInput.i < furthest) {
message = furthestPossibleErrorMessage;
parserInput.i = furthest;
}
return {
isFinished: isFinished,
furthest: parserInput.i,
furthestPossibleErrorMessage: message,
furthestReachedEnd: parserInput.i >= input.length - 1,
furthestChar: input[parserInput.i]
};
};
return parserInput;
});
//# sourceMappingURL=parser-input.js.map

File diff suppressed because one or more lines are too long

2305
node_modules/less/lib/less/parser/parser.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

1
node_modules/less/lib/less/parser/parser.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

157
node_modules/less/lib/less/plugin-manager.js generated vendored Normal file
View File

@@ -0,0 +1,157 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Plugin Manager
*/
var PluginManager = /** @class */ (function () {
function PluginManager(less) {
this.less = less;
this.visitors = [];
this.preProcessors = [];
this.postProcessors = [];
this.installedPlugins = [];
this.fileManagers = [];
this.iterator = -1;
this.pluginCache = {};
this.Loader = new less.PluginLoader(less);
}
/**
* Adds all the plugins in the array
* @param {Array} plugins
*/
PluginManager.prototype.addPlugins = function (plugins) {
if (plugins) {
for (var i = 0; i < plugins.length; i++) {
this.addPlugin(plugins[i]);
}
}
};
/**
*
* @param plugin
* @param {String} filename
*/
PluginManager.prototype.addPlugin = function (plugin, filename, functionRegistry) {
this.installedPlugins.push(plugin);
if (filename) {
this.pluginCache[filename] = plugin;
}
if (plugin.install) {
plugin.install(this.less, this, functionRegistry || this.less.functions.functionRegistry);
}
};
/**
*
* @param filename
*/
PluginManager.prototype.get = function (filename) {
return this.pluginCache[filename];
};
/**
* Adds a visitor. The visitor object has options on itself to determine
* when it should run.
* @param visitor
*/
PluginManager.prototype.addVisitor = function (visitor) {
this.visitors.push(visitor);
};
/**
* Adds a pre processor object
* @param {object} preProcessor
* @param {number} priority - guidelines 1 = before import, 1000 = import, 2000 = after import
*/
PluginManager.prototype.addPreProcessor = function (preProcessor, priority) {
var indexToInsertAt;
for (indexToInsertAt = 0; indexToInsertAt < this.preProcessors.length; indexToInsertAt++) {
if (this.preProcessors[indexToInsertAt].priority >= priority) {
break;
}
}
this.preProcessors.splice(indexToInsertAt, 0, { preProcessor: preProcessor, priority: priority });
};
/**
* Adds a post processor object
* @param {object} postProcessor
* @param {number} priority - guidelines 1 = before compression, 1000 = compression, 2000 = after compression
*/
PluginManager.prototype.addPostProcessor = function (postProcessor, priority) {
var indexToInsertAt;
for (indexToInsertAt = 0; indexToInsertAt < this.postProcessors.length; indexToInsertAt++) {
if (this.postProcessors[indexToInsertAt].priority >= priority) {
break;
}
}
this.postProcessors.splice(indexToInsertAt, 0, { postProcessor: postProcessor, priority: priority });
};
/**
*
* @param manager
*/
PluginManager.prototype.addFileManager = function (manager) {
this.fileManagers.push(manager);
};
/**
*
* @returns {Array}
* @private
*/
PluginManager.prototype.getPreProcessors = function () {
var preProcessors = [];
for (var i = 0; i < this.preProcessors.length; i++) {
preProcessors.push(this.preProcessors[i].preProcessor);
}
return preProcessors;
};
/**
*
* @returns {Array}
* @private
*/
PluginManager.prototype.getPostProcessors = function () {
var postProcessors = [];
for (var i = 0; i < this.postProcessors.length; i++) {
postProcessors.push(this.postProcessors[i].postProcessor);
}
return postProcessors;
};
/**
*
* @returns {Array}
* @private
*/
PluginManager.prototype.getVisitors = function () {
return this.visitors;
};
PluginManager.prototype.visitor = function () {
var self = this;
return {
first: function () {
self.iterator = -1;
return self.visitors[self.iterator];
},
get: function () {
self.iterator += 1;
return self.visitors[self.iterator];
}
};
};
/**
*
* @returns {Array}
* @private
*/
PluginManager.prototype.getFileManagers = function () {
return this.fileManagers;
};
return PluginManager;
}());
var pm;
var PluginManagerFactory = function (less, newFactory) {
if (newFactory || !pm) {
pm = new PluginManager(less);
}
return pm;
};
//
exports.default = PluginManagerFactory;
//# sourceMappingURL=plugin-manager.js.map

1
node_modules/less/lib/less/plugin-manager.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

47
node_modules/less/lib/less/render.js generated vendored Normal file
View File

@@ -0,0 +1,47 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var utils = tslib_1.__importStar(require("./utils"));
function default_1(environment, ParseTree) {
var render = function (input, options, callback) {
if (typeof options === 'function') {
callback = options;
options = utils.copyOptions(this.options, {});
}
else {
options = utils.copyOptions(this.options, options || {});
}
if (!callback) {
var self_1 = this;
return new Promise(function (resolve, reject) {
render.call(self_1, input, options, function (err, output) {
if (err) {
reject(err);
}
else {
resolve(output);
}
});
});
}
else {
this.parse(input, options, function (err, root, imports, options) {
if (err) {
return callback(err);
}
var result;
try {
var parseTree = new ParseTree(root, imports);
result = parseTree.toCSS(options);
}
catch (err) {
return callback(err);
}
callback(null, result);
});
}
};
return render;
}
exports.default = default_1;
//# sourceMappingURL=render.js.map

1
node_modules/less/lib/less/render.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"render.js","sourceRoot":"","sources":["../../src/less/render.js"],"names":[],"mappings":";;;AAAA,qDAAiC;AAEjC,mBAAwB,WAAW,EAAE,SAAS;IAC1C,IAAM,MAAM,GAAG,UAAU,KAAK,EAAE,OAAO,EAAE,QAAQ;QAC7C,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;YAC/B,QAAQ,GAAG,OAAO,CAAC;YACnB,OAAO,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;SACjD;aACI;YACD,OAAO,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC;SAC5D;QAED,IAAI,CAAC,QAAQ,EAAE;YACX,IAAM,MAAI,GAAG,IAAI,CAAC;YAClB,OAAO,IAAI,OAAO,CAAC,UAAU,OAAO,EAAE,MAAM;gBACxC,MAAM,CAAC,IAAI,CAAC,MAAI,EAAE,KAAK,EAAE,OAAO,EAAE,UAAS,GAAG,EAAE,MAAM;oBAClD,IAAI,GAAG,EAAE;wBACL,MAAM,CAAC,GAAG,CAAC,CAAC;qBACf;yBAAM;wBACH,OAAO,CAAC,MAAM,CAAC,CAAC;qBACnB;gBACL,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;SACN;aAAM;YACH,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,UAAS,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO;gBAC3D,IAAI,GAAG,EAAE;oBAAE,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;iBAAE;gBAElC,IAAI,MAAM,CAAC;gBACX,IAAI;oBACA,IAAM,SAAS,GAAG,IAAI,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;oBAC/C,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;iBACrC;gBACD,OAAO,GAAG,EAAE;oBAAE,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;iBAAE;gBAErC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YAC3B,CAAC,CAAC,CAAC;SACN;IACL,CAAC,CAAC;IAEF,OAAO,MAAM,CAAC;AAClB,CAAC;AAtCD,4BAsCC","sourcesContent":["import * as utils from './utils';\n\nexport default function(environment, ParseTree) {\n const render = function (input, options, callback) {\n if (typeof options === 'function') {\n callback = options;\n options = utils.copyOptions(this.options, {});\n }\n else {\n options = utils.copyOptions(this.options, options || {});\n }\n\n if (!callback) {\n const self = this;\n return new Promise(function (resolve, reject) {\n render.call(self, input, options, function(err, output) {\n if (err) {\n reject(err);\n } else {\n resolve(output);\n }\n });\n });\n } else {\n this.parse(input, options, function(err, root, imports, options) {\n if (err) { return callback(err); }\n\n let result;\n try {\n const parseTree = new ParseTree(root, imports);\n result = parseTree.toCSS(options);\n }\n catch (err) { return callback(err); }\n\n callback(null, result);\n });\n }\n };\n\n return render;\n}\n"]}

73
node_modules/less/lib/less/source-map-builder.js generated vendored Normal file
View File

@@ -0,0 +1,73 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function default_1(SourceMapOutput, environment) {
var SourceMapBuilder = /** @class */ (function () {
function SourceMapBuilder(options) {
this.options = options;
}
SourceMapBuilder.prototype.toCSS = function (rootNode, options, imports) {
var sourceMapOutput = new SourceMapOutput({
contentsIgnoredCharsMap: imports.contentsIgnoredChars,
rootNode: rootNode,
contentsMap: imports.contents,
sourceMapFilename: this.options.sourceMapFilename,
sourceMapURL: this.options.sourceMapURL,
outputFilename: this.options.sourceMapOutputFilename,
sourceMapBasepath: this.options.sourceMapBasepath,
sourceMapRootpath: this.options.sourceMapRootpath,
outputSourceFiles: this.options.outputSourceFiles,
sourceMapGenerator: this.options.sourceMapGenerator,
sourceMapFileInline: this.options.sourceMapFileInline,
disableSourcemapAnnotation: this.options.disableSourcemapAnnotation
});
var css = sourceMapOutput.toCSS(options);
this.sourceMap = sourceMapOutput.sourceMap;
this.sourceMapURL = sourceMapOutput.sourceMapURL;
if (this.options.sourceMapInputFilename) {
this.sourceMapInputFilename = sourceMapOutput.normalizeFilename(this.options.sourceMapInputFilename);
}
if (this.options.sourceMapBasepath !== undefined && this.sourceMapURL !== undefined) {
this.sourceMapURL = sourceMapOutput.removeBasepath(this.sourceMapURL);
}
return css + this.getCSSAppendage();
};
SourceMapBuilder.prototype.getCSSAppendage = function () {
var sourceMapURL = this.sourceMapURL;
if (this.options.sourceMapFileInline) {
if (this.sourceMap === undefined) {
return '';
}
sourceMapURL = "data:application/json;base64,".concat(environment.encodeBase64(this.sourceMap));
}
if (this.options.disableSourcemapAnnotation) {
return '';
}
if (sourceMapURL) {
return "/*# sourceMappingURL=".concat(sourceMapURL, " */");
}
return '';
};
SourceMapBuilder.prototype.getExternalSourceMap = function () {
return this.sourceMap;
};
SourceMapBuilder.prototype.setExternalSourceMap = function (sourceMap) {
this.sourceMap = sourceMap;
};
SourceMapBuilder.prototype.isInline = function () {
return this.options.sourceMapFileInline;
};
SourceMapBuilder.prototype.getSourceMapURL = function () {
return this.sourceMapURL;
};
SourceMapBuilder.prototype.getOutputFilename = function () {
return this.options.sourceMapOutputFilename;
};
SourceMapBuilder.prototype.getInputFilename = function () {
return this.sourceMapInputFilename;
};
return SourceMapBuilder;
}());
return SourceMapBuilder;
}
exports.default = default_1;
//# sourceMappingURL=source-map-builder.js.map

1
node_modules/less/lib/less/source-map-builder.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

138
node_modules/less/lib/less/source-map-output.js generated vendored Normal file
View File

@@ -0,0 +1,138 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function default_1(environment) {
var SourceMapOutput = /** @class */ (function () {
function SourceMapOutput(options) {
this._css = [];
this._rootNode = options.rootNode;
this._contentsMap = options.contentsMap;
this._contentsIgnoredCharsMap = options.contentsIgnoredCharsMap;
if (options.sourceMapFilename) {
this._sourceMapFilename = options.sourceMapFilename.replace(/\\/g, '/');
}
this._outputFilename = options.outputFilename;
this.sourceMapURL = options.sourceMapURL;
if (options.sourceMapBasepath) {
this._sourceMapBasepath = options.sourceMapBasepath.replace(/\\/g, '/');
}
if (options.sourceMapRootpath) {
this._sourceMapRootpath = options.sourceMapRootpath.replace(/\\/g, '/');
if (this._sourceMapRootpath.charAt(this._sourceMapRootpath.length - 1) !== '/') {
this._sourceMapRootpath += '/';
}
}
else {
this._sourceMapRootpath = '';
}
this._outputSourceFiles = options.outputSourceFiles;
this._sourceMapGeneratorConstructor = environment.getSourceMapGenerator();
this._lineNumber = 0;
this._column = 0;
}
SourceMapOutput.prototype.removeBasepath = function (path) {
if (this._sourceMapBasepath && path.indexOf(this._sourceMapBasepath) === 0) {
path = path.substring(this._sourceMapBasepath.length);
if (path.charAt(0) === '\\' || path.charAt(0) === '/') {
path = path.substring(1);
}
}
return path;
};
SourceMapOutput.prototype.normalizeFilename = function (filename) {
filename = filename.replace(/\\/g, '/');
filename = this.removeBasepath(filename);
return (this._sourceMapRootpath || '') + filename;
};
SourceMapOutput.prototype.add = function (chunk, fileInfo, index, mapLines) {
// ignore adding empty strings
if (!chunk) {
return;
}
var lines, sourceLines, columns, sourceColumns, i;
if (fileInfo && fileInfo.filename) {
var inputSource = this._contentsMap[fileInfo.filename];
// remove vars/banner added to the top of the file
if (this._contentsIgnoredCharsMap[fileInfo.filename]) {
// adjust the index
index -= this._contentsIgnoredCharsMap[fileInfo.filename];
if (index < 0) {
index = 0;
}
// adjust the source
inputSource = inputSource.slice(this._contentsIgnoredCharsMap[fileInfo.filename]);
}
/**
* ignore empty content, or failsafe
* if contents map is incorrect
*/
if (inputSource === undefined) {
this._css.push(chunk);
return;
}
inputSource = inputSource.substring(0, index);
sourceLines = inputSource.split('\n');
sourceColumns = sourceLines[sourceLines.length - 1];
}
lines = chunk.split('\n');
columns = lines[lines.length - 1];
if (fileInfo && fileInfo.filename) {
if (!mapLines) {
this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + 1, column: this._column },
original: { line: sourceLines.length, column: sourceColumns.length },
source: this.normalizeFilename(fileInfo.filename) });
}
else {
for (i = 0; i < lines.length; i++) {
this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + i + 1, column: i === 0 ? this._column : 0 },
original: { line: sourceLines.length + i, column: i === 0 ? sourceColumns.length : 0 },
source: this.normalizeFilename(fileInfo.filename) });
}
}
}
if (lines.length === 1) {
this._column += columns.length;
}
else {
this._lineNumber += lines.length - 1;
this._column = columns.length;
}
this._css.push(chunk);
};
SourceMapOutput.prototype.isEmpty = function () {
return this._css.length === 0;
};
SourceMapOutput.prototype.toCSS = function (context) {
this._sourceMapGenerator = new this._sourceMapGeneratorConstructor({ file: this._outputFilename, sourceRoot: null });
if (this._outputSourceFiles) {
for (var filename in this._contentsMap) {
// eslint-disable-next-line no-prototype-builtins
if (this._contentsMap.hasOwnProperty(filename)) {
var source = this._contentsMap[filename];
if (this._contentsIgnoredCharsMap[filename]) {
source = source.slice(this._contentsIgnoredCharsMap[filename]);
}
this._sourceMapGenerator.setSourceContent(this.normalizeFilename(filename), source);
}
}
}
this._rootNode.genCSS(context, this);
if (this._css.length > 0) {
var sourceMapURL = void 0;
var sourceMapContent = JSON.stringify(this._sourceMapGenerator.toJSON());
if (this.sourceMapURL) {
sourceMapURL = this.sourceMapURL;
}
else if (this._sourceMapFilename) {
sourceMapURL = this._sourceMapFilename;
}
this.sourceMapURL = sourceMapURL;
this.sourceMap = sourceMapContent;
}
return this._css.join('');
};
return SourceMapOutput;
}());
return SourceMapOutput;
}
exports.default = default_1;
//# sourceMappingURL=source-map-output.js.map

1
node_modules/less/lib/less/source-map-output.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

92
node_modules/less/lib/less/transform-tree.js generated vendored Normal file
View File

@@ -0,0 +1,92 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var contexts_1 = tslib_1.__importDefault(require("./contexts"));
var visitors_1 = tslib_1.__importDefault(require("./visitors"));
var tree_1 = tslib_1.__importDefault(require("./tree"));
function default_1(root, options) {
options = options || {};
var evaldRoot;
var variables = options.variables;
var evalEnv = new contexts_1.default.Eval(options);
//
// Allows setting variables with a hash, so:
//
// `{ color: new tree.Color('#f01') }` will become:
//
// new tree.Declaration('@color',
// new tree.Value([
// new tree.Expression([
// new tree.Color('#f01')
// ])
// ])
// )
//
if (typeof variables === 'object' && !Array.isArray(variables)) {
variables = Object.keys(variables).map(function (k) {
var value = variables[k];
if (!(value instanceof tree_1.default.Value)) {
if (!(value instanceof tree_1.default.Expression)) {
value = new tree_1.default.Expression([value]);
}
value = new tree_1.default.Value([value]);
}
return new tree_1.default.Declaration("@".concat(k), value, false, null, 0);
});
evalEnv.frames = [new tree_1.default.Ruleset(null, variables)];
}
var visitors = [
new visitors_1.default.JoinSelectorVisitor(),
new visitors_1.default.MarkVisibleSelectorsVisitor(true),
new visitors_1.default.ExtendVisitor(),
new visitors_1.default.ToCSSVisitor({ compress: Boolean(options.compress) })
];
var preEvalVisitors = [];
var v;
var visitorIterator;
/**
* first() / get() allows visitors to be added while visiting
*
* @todo Add scoping for visitors just like functions for @plugin; right now they're global
*/
if (options.pluginManager) {
visitorIterator = options.pluginManager.visitor();
for (var i = 0; i < 2; i++) {
visitorIterator.first();
while ((v = visitorIterator.get())) {
if (v.isPreEvalVisitor) {
if (i === 0 || preEvalVisitors.indexOf(v) === -1) {
preEvalVisitors.push(v);
v.run(root);
}
}
else {
if (i === 0 || visitors.indexOf(v) === -1) {
if (v.isPreVisitor) {
visitors.unshift(v);
}
else {
visitors.push(v);
}
}
}
}
}
}
evaldRoot = root.eval(evalEnv);
for (var i = 0; i < visitors.length; i++) {
visitors[i].run(evaldRoot);
}
// Run any remaining visitors added after eval pass
if (options.pluginManager) {
visitorIterator.first();
while ((v = visitorIterator.get())) {
if (visitors.indexOf(v) === -1 && preEvalVisitors.indexOf(v) === -1) {
v.run(evaldRoot);
}
}
}
return evaldRoot;
}
exports.default = default_1;
//# sourceMappingURL=transform-tree.js.map

1
node_modules/less/lib/less/transform-tree.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

33
node_modules/less/lib/less/tree/anonymous.js generated vendored Normal file
View File

@@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var node_1 = tslib_1.__importDefault(require("./node"));
var Anonymous = function (value, index, currentFileInfo, mapLines, rulesetLike, visibilityInfo) {
this.value = value;
this._index = index;
this._fileInfo = currentFileInfo;
this.mapLines = mapLines;
this.rulesetLike = (typeof rulesetLike === 'undefined') ? false : rulesetLike;
this.allowRoot = true;
this.copyVisibilityInfo(visibilityInfo);
};
Anonymous.prototype = Object.assign(new node_1.default(), {
type: 'Anonymous',
eval: function () {
return new Anonymous(this.value, this._index, this._fileInfo, this.mapLines, this.rulesetLike, this.visibilityInfo());
},
compare: function (other) {
return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined;
},
isRulesetLike: function () {
return this.rulesetLike;
},
genCSS: function (context, output) {
this.nodeVisible = Boolean(this.value);
if (this.nodeVisible) {
output.add(this.value, this._fileInfo, this._index, this.mapLines);
}
}
});
exports.default = Anonymous;
//# sourceMappingURL=anonymous.js.map

1
node_modules/less/lib/less/tree/anonymous.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"anonymous.js","sourceRoot":"","sources":["../../../src/less/tree/anonymous.js"],"names":[],"mappings":";;;AAAA,wDAA0B;AAE1B,IAAM,SAAS,GAAG,UAAS,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc;IAC3F,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACnB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACpB,IAAI,CAAC,SAAS,GAAG,eAAe,CAAC;IACjC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IACzB,IAAI,CAAC,WAAW,GAAG,CAAC,OAAO,WAAW,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC;IAC9E,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IACtB,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAC;AAC5C,CAAC,CAAA;AAED,SAAS,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,cAAI,EAAE,EAAE;IAC5C,IAAI,EAAE,WAAW;IACjB,IAAI;QACA,OAAO,IAAI,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;IAC1H,CAAC;IACD,OAAO,YAAC,KAAK;QACT,OAAO,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,EAAE,KAAK,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACzE,CAAC;IACD,aAAa;QACT,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IACD,MAAM,YAAC,OAAO,EAAE,MAAM;QAClB,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACvC,IAAI,IAAI,CAAC,WAAW,EAAE;YAClB,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;SACtE;IACL,CAAC;CACJ,CAAC,CAAA;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["import Node from './node';\n\nconst Anonymous = function(value, index, currentFileInfo, mapLines, rulesetLike, visibilityInfo) {\n this.value = value;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.mapLines = mapLines;\n this.rulesetLike = (typeof rulesetLike === 'undefined') ? false : rulesetLike;\n this.allowRoot = true;\n this.copyVisibilityInfo(visibilityInfo);\n}\n\nAnonymous.prototype = Object.assign(new Node(), {\n type: 'Anonymous',\n eval() {\n return new Anonymous(this.value, this._index, this._fileInfo, this.mapLines, this.rulesetLike, this.visibilityInfo());\n },\n compare(other) {\n return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined;\n },\n isRulesetLike() {\n return this.rulesetLike;\n },\n genCSS(context, output) {\n this.nodeVisible = Boolean(this.value);\n if (this.nodeVisible) {\n output.add(this.value, this._fileInfo, this._index, this.mapLines);\n }\n }\n})\n\nexport default Anonymous;\n"]}

31
node_modules/less/lib/less/tree/assignment.js generated vendored Normal file
View File

@@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var node_1 = tslib_1.__importDefault(require("./node"));
var Assignment = function (key, val) {
this.key = key;
this.value = val;
};
Assignment.prototype = Object.assign(new node_1.default(), {
type: 'Assignment',
accept: function (visitor) {
this.value = visitor.visit(this.value);
},
eval: function (context) {
if (this.value.eval) {
return new Assignment(this.key, this.value.eval(context));
}
return this;
},
genCSS: function (context, output) {
output.add("".concat(this.key, "="));
if (this.value.genCSS) {
this.value.genCSS(context, output);
}
else {
output.add(this.value);
}
}
});
exports.default = Assignment;
//# sourceMappingURL=assignment.js.map

1
node_modules/less/lib/less/tree/assignment.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"assignment.js","sourceRoot":"","sources":["../../../src/less/tree/assignment.js"],"names":[],"mappings":";;;AAAA,wDAA0B;AAE1B,IAAM,UAAU,GAAG,UAAS,GAAG,EAAE,GAAG;IAChC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACf,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC;AACrB,CAAC,CAAA;AAED,UAAU,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,cAAI,EAAE,EAAE;IAC7C,IAAI,EAAE,YAAY;IAElB,MAAM,YAAC,OAAO;QACV,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IAED,IAAI,YAAC,OAAO;QACR,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;YACjB,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;SAC7D;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,MAAM,YAAC,OAAO,EAAE,MAAM;QAClB,MAAM,CAAC,GAAG,CAAC,UAAG,IAAI,CAAC,GAAG,MAAG,CAAC,CAAC;QAC3B,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;YACnB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;SACtC;aAAM;YACH,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAC1B;IACL,CAAC;CACJ,CAAC,CAAC;AAEH,kBAAe,UAAU,CAAC","sourcesContent":["import Node from './node';\n\nconst Assignment = function(key, val) {\n this.key = key;\n this.value = val;\n}\n\nAssignment.prototype = Object.assign(new Node(), {\n type: 'Assignment',\n\n accept(visitor) {\n this.value = visitor.visit(this.value);\n },\n\n eval(context) {\n if (this.value.eval) {\n return new Assignment(this.key, this.value.eval(context));\n }\n return this;\n },\n\n genCSS(context, output) {\n output.add(`${this.key}=`);\n if (this.value.genCSS) {\n this.value.genCSS(context, output);\n } else {\n output.add(this.value);\n }\n }\n});\n\nexport default Assignment;\n"]}

10
node_modules/less/lib/less/tree/atrule-syntax.js generated vendored Normal file
View File

@@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ContainerSyntaxOptions = exports.MediaSyntaxOptions = void 0;
exports.MediaSyntaxOptions = {
queryInParens: true
};
exports.ContainerSyntaxOptions = {
queryInParens: true
};
//# sourceMappingURL=atrule-syntax.js.map

1
node_modules/less/lib/less/tree/atrule-syntax.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"atrule-syntax.js","sourceRoot":"","sources":["../../../src/less/tree/atrule-syntax.js"],"names":[],"mappings":";;;AAAa,QAAA,kBAAkB,GAAG;IAC9B,aAAa,EAAE,IAAI;CACtB,CAAC;AAEW,QAAA,sBAAsB,GAAG;IAClC,aAAa,EAAE,IAAI;CACtB,CAAC","sourcesContent":["export const MediaSyntaxOptions = {\n queryInParens: true\n};\n\nexport const ContainerSyntaxOptions = {\n queryInParens: true\n};\n"]}

135
node_modules/less/lib/less/tree/atrule.js generated vendored Normal file
View File

@@ -0,0 +1,135 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var node_1 = tslib_1.__importDefault(require("./node"));
var selector_1 = tslib_1.__importDefault(require("./selector"));
var ruleset_1 = tslib_1.__importDefault(require("./ruleset"));
var anonymous_1 = tslib_1.__importDefault(require("./anonymous"));
var AtRule = function (name, value, rules, index, currentFileInfo, debugInfo, isRooted, visibilityInfo) {
var i;
this.name = name;
this.value = (value instanceof node_1.default) ? value : (value ? new anonymous_1.default(value) : value);
if (rules) {
if (Array.isArray(rules)) {
this.rules = rules;
}
else {
this.rules = [rules];
this.rules[0].selectors = (new selector_1.default([], null, null, index, currentFileInfo)).createEmptySelectors();
}
for (i = 0; i < this.rules.length; i++) {
this.rules[i].allowImports = true;
}
this.setParent(this.rules, this);
}
this._index = index;
this._fileInfo = currentFileInfo;
this.debugInfo = debugInfo;
this.isRooted = isRooted || false;
this.copyVisibilityInfo(visibilityInfo);
this.allowRoot = true;
};
AtRule.prototype = Object.assign(new node_1.default(), {
type: 'AtRule',
accept: function (visitor) {
var value = this.value, rules = this.rules;
if (rules) {
this.rules = visitor.visitArray(rules);
}
if (value) {
this.value = visitor.visit(value);
}
},
isRulesetLike: function () {
return this.rules || !this.isCharset();
},
isCharset: function () {
return '@charset' === this.name;
},
genCSS: function (context, output) {
var value = this.value, rules = this.rules;
output.add(this.name, this.fileInfo(), this.getIndex());
if (value) {
output.add(' ');
value.genCSS(context, output);
}
if (rules) {
this.outputRuleset(context, output, rules);
}
else {
output.add(';');
}
},
eval: function (context) {
var mediaPathBackup, mediaBlocksBackup, value = this.value, rules = this.rules;
// media stored inside other atrule should not bubble over it
// backpup media bubbling information
mediaPathBackup = context.mediaPath;
mediaBlocksBackup = context.mediaBlocks;
// deleted media bubbling information
context.mediaPath = [];
context.mediaBlocks = [];
if (value) {
value = value.eval(context);
}
if (rules) {
// assuming that there is only one rule at this point - that is how parser constructs the rule
rules = [rules[0].eval(context)];
rules[0].root = true;
}
// restore media bubbling information
context.mediaPath = mediaPathBackup;
context.mediaBlocks = mediaBlocksBackup;
return new AtRule(this.name, value, rules, this.getIndex(), this.fileInfo(), this.debugInfo, this.isRooted, this.visibilityInfo());
},
variable: function (name) {
if (this.rules) {
// assuming that there is only one rule at this point - that is how parser constructs the rule
return ruleset_1.default.prototype.variable.call(this.rules[0], name);
}
},
find: function () {
if (this.rules) {
// assuming that there is only one rule at this point - that is how parser constructs the rule
return ruleset_1.default.prototype.find.apply(this.rules[0], arguments);
}
},
rulesets: function () {
if (this.rules) {
// assuming that there is only one rule at this point - that is how parser constructs the rule
return ruleset_1.default.prototype.rulesets.apply(this.rules[0]);
}
},
outputRuleset: function (context, output, rules) {
var ruleCnt = rules.length;
var i;
context.tabLevel = (context.tabLevel | 0) + 1;
// Compressed
if (context.compress) {
output.add('{');
for (i = 0; i < ruleCnt; i++) {
rules[i].genCSS(context, output);
}
output.add('}');
context.tabLevel--;
return;
}
// Non-compressed
var tabSetStr = "\n".concat(Array(context.tabLevel).join(' ')), tabRuleStr = "".concat(tabSetStr, " ");
if (!ruleCnt) {
output.add(" {".concat(tabSetStr, "}"));
}
else {
output.add(" {".concat(tabRuleStr));
rules[0].genCSS(context, output);
for (i = 1; i < ruleCnt; i++) {
output.add(tabRuleStr);
rules[i].genCSS(context, output);
}
output.add("".concat(tabSetStr, "}"));
}
context.tabLevel--;
}
});
exports.default = AtRule;
//# sourceMappingURL=atrule.js.map

1
node_modules/less/lib/less/tree/atrule.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

32
node_modules/less/lib/less/tree/attribute.js generated vendored Normal file
View File

@@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var node_1 = tslib_1.__importDefault(require("./node"));
var Attribute = function (key, op, value, cif) {
this.key = key;
this.op = op;
this.value = value;
this.cif = cif;
};
Attribute.prototype = Object.assign(new node_1.default(), {
type: 'Attribute',
eval: function (context) {
return new Attribute(this.key.eval ? this.key.eval(context) : this.key, this.op, (this.value && this.value.eval) ? this.value.eval(context) : this.value, this.cif);
},
genCSS: function (context, output) {
output.add(this.toCSS(context));
},
toCSS: function (context) {
var value = this.key.toCSS ? this.key.toCSS(context) : this.key;
if (this.op) {
value += this.op;
value += (this.value.toCSS ? this.value.toCSS(context) : this.value);
}
if (this.cif) {
value = value + ' ' + this.cif;
}
return "[".concat(value, "]");
}
});
exports.default = Attribute;
//# sourceMappingURL=attribute.js.map

1
node_modules/less/lib/less/tree/attribute.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"attribute.js","sourceRoot":"","sources":["../../../src/less/tree/attribute.js"],"names":[],"mappings":";;;AAAA,wDAA0B;AAE1B,IAAM,SAAS,GAAG,UAAS,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG;IAC1C,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACf,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACb,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACnB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;AACnB,CAAC,CAAA;AAED,SAAS,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,cAAI,EAAE,EAAE;IAC5C,IAAI,EAAE,WAAW;IAEjB,IAAI,YAAC,OAAO;QACR,OAAO,IAAI,SAAS,CAChB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EACjD,IAAI,CAAC,EAAE,EACP,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,EACvE,IAAI,CAAC,GAAG,CACX,CAAC;IACN,CAAC;IAED,MAAM,YAAC,OAAO,EAAE,MAAM;QAClB,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IACpC,CAAC;IAED,KAAK,YAAC,OAAO;QACT,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAEhE,IAAI,IAAI,CAAC,EAAE,EAAE;YACT,KAAK,IAAI,IAAI,CAAC,EAAE,CAAC;YACjB,KAAK,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACxE;QAED,IAAI,IAAI,CAAC,GAAG,EAAE;YACV,KAAK,GAAG,KAAK,GAAG,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;SAClC;QAED,OAAO,WAAI,KAAK,MAAG,CAAC;IACxB,CAAC;CACJ,CAAC,CAAC;AAEH,kBAAe,SAAS,CAAC","sourcesContent":["import Node from './node';\n\nconst Attribute = function(key, op, value, cif) {\n this.key = key;\n this.op = op;\n this.value = value;\n this.cif = cif;\n}\n\nAttribute.prototype = Object.assign(new Node(), {\n type: 'Attribute',\n\n eval(context) {\n return new Attribute(\n this.key.eval ? this.key.eval(context) : this.key,\n this.op,\n (this.value && this.value.eval) ? this.value.eval(context) : this.value,\n this.cif\n );\n },\n\n genCSS(context, output) {\n output.add(this.toCSS(context));\n },\n\n toCSS(context) {\n let value = this.key.toCSS ? this.key.toCSS(context) : this.key;\n\n if (this.op) {\n value += this.op;\n value += (this.value.toCSS ? this.value.toCSS(context) : this.value);\n }\n\n if (this.cif) {\n value = value + ' ' + this.cif;\n }\n\n return `[${value}]`;\n }\n});\n\nexport default Attribute;\n"]}

104
node_modules/less/lib/less/tree/call.js generated vendored Normal file
View File

@@ -0,0 +1,104 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var node_1 = tslib_1.__importDefault(require("./node"));
var anonymous_1 = tslib_1.__importDefault(require("./anonymous"));
var function_caller_1 = tslib_1.__importDefault(require("../functions/function-caller"));
//
// A function call node.
//
var Call = function (name, args, index, currentFileInfo) {
this.name = name;
this.args = args;
this.calc = name === 'calc';
this._index = index;
this._fileInfo = currentFileInfo;
};
Call.prototype = Object.assign(new node_1.default(), {
type: 'Call',
accept: function (visitor) {
if (this.args) {
this.args = visitor.visitArray(this.args);
}
},
//
// When evaluating a function call,
// we either find the function in the functionRegistry,
// in which case we call it, passing the evaluated arguments,
// if this returns null or we cannot find the function, we
// simply print it out as it appeared originally [2].
//
// The reason why we evaluate the arguments, is in the case where
// we try to pass a variable to a function, like: `saturate(@color)`.
// The function should receive the value, not the variable.
//
eval: function (context) {
var _this = this;
/**
* Turn off math for calc(), and switch back on for evaluating nested functions
*/
var currentMathContext = context.mathOn;
context.mathOn = !this.calc;
if (this.calc || context.inCalc) {
context.enterCalc();
}
var exitCalc = function () {
if (_this.calc || context.inCalc) {
context.exitCalc();
}
context.mathOn = currentMathContext;
};
var result;
var funcCaller = new function_caller_1.default(this.name, context, this.getIndex(), this.fileInfo());
if (funcCaller.isValid()) {
try {
result = funcCaller.call(this.args);
exitCalc();
}
catch (e) {
// eslint-disable-next-line no-prototype-builtins
if (e.hasOwnProperty('line') && e.hasOwnProperty('column')) {
throw e;
}
throw {
type: e.type || 'Runtime',
message: "Error evaluating function `".concat(this.name, "`").concat(e.message ? ": ".concat(e.message) : ''),
index: this.getIndex(),
filename: this.fileInfo().filename,
line: e.lineNumber,
column: e.columnNumber
};
}
}
if (result !== null && result !== undefined) {
// Results that that are not nodes are cast as Anonymous nodes
// Falsy values or booleans are returned as empty nodes
if (!(result instanceof node_1.default)) {
if (!result || result === true) {
result = new anonymous_1.default(null);
}
else {
result = new anonymous_1.default(result.toString());
}
}
result._index = this._index;
result._fileInfo = this._fileInfo;
return result;
}
var args = this.args.map(function (a) { return a.eval(context); });
exitCalc();
return new Call(this.name, args, this.getIndex(), this.fileInfo());
},
genCSS: function (context, output) {
output.add("".concat(this.name, "("), this.fileInfo(), this.getIndex());
for (var i = 0; i < this.args.length; i++) {
this.args[i].genCSS(context, output);
if (i + 1 < this.args.length) {
output.add(', ');
}
}
output.add(')');
}
});
exports.default = Call;
//# sourceMappingURL=call.js.map

1
node_modules/less/lib/less/tree/call.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

236
node_modules/less/lib/less/tree/color.js generated vendored Normal file
View File

@@ -0,0 +1,236 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var node_1 = tslib_1.__importDefault(require("./node"));
var colors_1 = tslib_1.__importDefault(require("../data/colors"));
//
// RGB Colors - #ff0014, #eee
//
var Color = function (rgb, a, originalForm) {
var self = this;
//
// The end goal here, is to parse the arguments
// into an integer triplet, such as `128, 255, 0`
//
// This facilitates operations and conversions.
//
if (Array.isArray(rgb)) {
this.rgb = rgb;
}
else if (rgb.length >= 6) {
this.rgb = [];
rgb.match(/.{2}/g).map(function (c, i) {
if (i < 3) {
self.rgb.push(parseInt(c, 16));
}
else {
self.alpha = (parseInt(c, 16)) / 255;
}
});
}
else {
this.rgb = [];
rgb.split('').map(function (c, i) {
if (i < 3) {
self.rgb.push(parseInt(c + c, 16));
}
else {
self.alpha = (parseInt(c + c, 16)) / 255;
}
});
}
this.alpha = this.alpha || (typeof a === 'number' ? a : 1);
if (typeof originalForm !== 'undefined') {
this.value = originalForm;
}
};
Color.prototype = Object.assign(new node_1.default(), {
type: 'Color',
luma: function () {
var r = this.rgb[0] / 255, g = this.rgb[1] / 255, b = this.rgb[2] / 255;
r = (r <= 0.03928) ? r / 12.92 : Math.pow(((r + 0.055) / 1.055), 2.4);
g = (g <= 0.03928) ? g / 12.92 : Math.pow(((g + 0.055) / 1.055), 2.4);
b = (b <= 0.03928) ? b / 12.92 : Math.pow(((b + 0.055) / 1.055), 2.4);
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
},
genCSS: function (context, output) {
output.add(this.toCSS(context));
},
toCSS: function (context, doNotCompress) {
var compress = context && context.compress && !doNotCompress;
var color;
var alpha;
var colorFunction;
var args = [];
// `value` is set if this color was originally
// converted from a named color string so we need
// to respect this and try to output named color too.
alpha = this.fround(context, this.alpha);
if (this.value) {
if (this.value.indexOf('rgb') === 0) {
if (alpha < 1) {
colorFunction = 'rgba';
}
}
else if (this.value.indexOf('hsl') === 0) {
if (alpha < 1) {
colorFunction = 'hsla';
}
else {
colorFunction = 'hsl';
}
}
else {
return this.value;
}
}
else {
if (alpha < 1) {
colorFunction = 'rgba';
}
}
switch (colorFunction) {
case 'rgba':
args = this.rgb.map(function (c) {
return clamp(Math.round(c), 255);
}).concat(clamp(alpha, 1));
break;
case 'hsla':
args.push(clamp(alpha, 1));
// eslint-disable-next-line no-fallthrough
case 'hsl':
color = this.toHSL();
args = [
this.fround(context, color.h),
"".concat(this.fround(context, color.s * 100), "%"),
"".concat(this.fround(context, color.l * 100), "%")
].concat(args);
}
if (colorFunction) {
// Values are capped between `0` and `255`, rounded and zero-padded.
return "".concat(colorFunction, "(").concat(args.join(",".concat(compress ? '' : ' ')), ")");
}
color = this.toRGB();
if (compress) {
var splitcolor = color.split('');
// Convert color to short format
if (splitcolor[1] === splitcolor[2] && splitcolor[3] === splitcolor[4] && splitcolor[5] === splitcolor[6]) {
color = "#".concat(splitcolor[1]).concat(splitcolor[3]).concat(splitcolor[5]);
}
}
return color;
},
//
// Operations have to be done per-channel, if not,
// channels will spill onto each other. Once we have
// our result, in the form of an integer triplet,
// we create a new Color node to hold the result.
//
operate: function (context, op, other) {
var rgb = new Array(3);
var alpha = this.alpha * (1 - other.alpha) + other.alpha;
for (var c = 0; c < 3; c++) {
rgb[c] = this._operate(context, op, this.rgb[c], other.rgb[c]);
}
return new Color(rgb, alpha);
},
toRGB: function () {
return toHex(this.rgb);
},
toHSL: function () {
var r = this.rgb[0] / 255, g = this.rgb[1] / 255, b = this.rgb[2] / 255, a = this.alpha;
var max = Math.max(r, g, b), min = Math.min(r, g, b);
var h;
var s;
var l = (max + min) / 2;
var d = max - min;
if (max === min) {
h = s = 0;
}
else {
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
switch (max) {
case r:
h = (g - b) / d + (g < b ? 6 : 0);
break;
case g:
h = (b - r) / d + 2;
break;
case b:
h = (r - g) / d + 4;
break;
}
h /= 6;
}
return { h: h * 360, s: s, l: l, a: a };
},
// Adapted from http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript
toHSV: function () {
var r = this.rgb[0] / 255, g = this.rgb[1] / 255, b = this.rgb[2] / 255, a = this.alpha;
var max = Math.max(r, g, b), min = Math.min(r, g, b);
var h;
var s;
var v = max;
var d = max - min;
if (max === 0) {
s = 0;
}
else {
s = d / max;
}
if (max === min) {
h = 0;
}
else {
switch (max) {
case r:
h = (g - b) / d + (g < b ? 6 : 0);
break;
case g:
h = (b - r) / d + 2;
break;
case b:
h = (r - g) / d + 4;
break;
}
h /= 6;
}
return { h: h * 360, s: s, v: v, a: a };
},
toARGB: function () {
return toHex([this.alpha * 255].concat(this.rgb));
},
compare: function (x) {
return (x.rgb &&
x.rgb[0] === this.rgb[0] &&
x.rgb[1] === this.rgb[1] &&
x.rgb[2] === this.rgb[2] &&
x.alpha === this.alpha) ? 0 : undefined;
}
});
Color.fromKeyword = function (keyword) {
var c;
var key = keyword.toLowerCase();
// eslint-disable-next-line no-prototype-builtins
if (colors_1.default.hasOwnProperty(key)) {
c = new Color(colors_1.default[key].slice(1));
}
else if (key === 'transparent') {
c = new Color([0, 0, 0], 0);
}
if (c) {
c.value = keyword;
return c;
}
};
function clamp(v, max) {
return Math.min(Math.max(v, 0), max);
}
function toHex(v) {
return "#".concat(v.map(function (c) {
c = clamp(Math.round(c), 255);
return (c < 16 ? '0' : '') + c.toString(16);
}).join(''));
}
exports.default = Color;
//# sourceMappingURL=color.js.map

1
node_modules/less/lib/less/tree/color.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

28
node_modules/less/lib/less/tree/combinator.js generated vendored Normal file
View File

@@ -0,0 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var node_1 = tslib_1.__importDefault(require("./node"));
var _noSpaceCombinators = {
'': true,
' ': true,
'|': true
};
var Combinator = function (value) {
if (value === ' ') {
this.value = ' ';
this.emptyOrWhitespace = true;
}
else {
this.value = value ? value.trim() : '';
this.emptyOrWhitespace = this.value === '';
}
};
Combinator.prototype = Object.assign(new node_1.default(), {
type: 'Combinator',
genCSS: function (context, output) {
var spaceOrEmpty = (context.compress || _noSpaceCombinators[this.value]) ? '' : ' ';
output.add(spaceOrEmpty + this.value + spaceOrEmpty);
}
});
exports.default = Combinator;
//# sourceMappingURL=combinator.js.map

1
node_modules/less/lib/less/tree/combinator.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"combinator.js","sourceRoot":"","sources":["../../../src/less/tree/combinator.js"],"names":[],"mappings":";;;AAAA,wDAA0B;AAC1B,IAAM,mBAAmB,GAAG;IACxB,EAAE,EAAE,IAAI;IACR,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;CACZ,CAAC;AAEF,IAAM,UAAU,GAAG,UAAS,KAAK;IAC7B,IAAI,KAAK,KAAK,GAAG,EAAE;QACf,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC;QACjB,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;KACjC;SAAM;QACH,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACvC,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,KAAK,KAAK,EAAE,CAAC;KAC9C;AACL,CAAC,CAAA;AAED,UAAU,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,cAAI,EAAE,EAAE;IAC7C,IAAI,EAAE,YAAY;IAElB,MAAM,YAAC,OAAO,EAAE,MAAM;QAClB,IAAM,YAAY,GAAG,CAAC,OAAO,CAAC,QAAQ,IAAI,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;QACtF,MAAM,CAAC,GAAG,CAAC,YAAY,GAAG,IAAI,CAAC,KAAK,GAAG,YAAY,CAAC,CAAC;IACzD,CAAC;CACJ,CAAC,CAAC;AAEH,kBAAe,UAAU,CAAC","sourcesContent":["import Node from './node';\nconst _noSpaceCombinators = {\n '': true,\n ' ': true,\n '|': true\n};\n\nconst Combinator = function(value) {\n if (value === ' ') {\n this.value = ' ';\n this.emptyOrWhitespace = true;\n } else {\n this.value = value ? value.trim() : '';\n this.emptyOrWhitespace = this.value === '';\n }\n}\n\nCombinator.prototype = Object.assign(new Node(), {\n type: 'Combinator',\n\n genCSS(context, output) {\n const spaceOrEmpty = (context.compress || _noSpaceCombinators[this.value]) ? '' : ' ';\n output.add(spaceOrEmpty + this.value + spaceOrEmpty);\n }\n});\n\nexport default Combinator;\n"]}

27
node_modules/less/lib/less/tree/comment.js generated vendored Normal file
View File

@@ -0,0 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var node_1 = tslib_1.__importDefault(require("./node"));
var debug_info_1 = tslib_1.__importDefault(require("./debug-info"));
var Comment = function (value, isLineComment, index, currentFileInfo) {
this.value = value;
this.isLineComment = isLineComment;
this._index = index;
this._fileInfo = currentFileInfo;
this.allowRoot = true;
};
Comment.prototype = Object.assign(new node_1.default(), {
type: 'Comment',
genCSS: function (context, output) {
if (this.debugInfo) {
output.add((0, debug_info_1.default)(context, this), this.fileInfo(), this.getIndex());
}
output.add(this.value);
},
isSilent: function (context) {
var isCompressed = context.compress && this.value[2] !== '!';
return this.isLineComment || isCompressed;
}
});
exports.default = Comment;
//# sourceMappingURL=comment.js.map

1
node_modules/less/lib/less/tree/comment.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"comment.js","sourceRoot":"","sources":["../../../src/less/tree/comment.js"],"names":[],"mappings":";;;AAAA,wDAA0B;AAC1B,oEAAwC;AAExC,IAAM,OAAO,GAAG,UAAS,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,eAAe;IACjE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACnB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACnC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACpB,IAAI,CAAC,SAAS,GAAG,eAAe,CAAC;IACjC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;AAC1B,CAAC,CAAA;AAED,OAAO,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,cAAI,EAAE,EAAE;IAC1C,IAAI,EAAE,SAAS;IAEf,MAAM,YAAC,OAAO,EAAE,MAAM;QAClB,IAAI,IAAI,CAAC,SAAS,EAAE;YAChB,MAAM,CAAC,GAAG,CAAC,IAAA,oBAAY,EAAC,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;SAC7E;QACD,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,QAAQ,YAAC,OAAO;QACZ,IAAM,YAAY,GAAG,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC;QAC/D,OAAO,IAAI,CAAC,aAAa,IAAI,YAAY,CAAC;IAC9C,CAAC;CACJ,CAAC,CAAC;AAEH,kBAAe,OAAO,CAAC","sourcesContent":["import Node from './node';\nimport getDebugInfo from './debug-info';\n\nconst Comment = function(value, isLineComment, index, currentFileInfo) {\n this.value = value;\n this.isLineComment = isLineComment;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.allowRoot = true;\n}\n\nComment.prototype = Object.assign(new Node(), {\n type: 'Comment',\n\n genCSS(context, output) {\n if (this.debugInfo) {\n output.add(getDebugInfo(context, this), this.fileInfo(), this.getIndex());\n }\n output.add(this.value);\n },\n\n isSilent(context) {\n const isCompressed = context.compress && this.value[2] !== '!';\n return this.isLineComment || isCompressed;\n }\n});\n\nexport default Comment;\n"]}

Some files were not shown because too many files have changed in this diff Show More