diff --git a/dist/less.js b/dist/less.js index 91060dcd..bf9da897 100644 --- a/dist/less.js +++ b/dist/less.js @@ -1,5 +1,5 @@ /*! - * Less - Leaner CSS v3.0.0-alpha.1 + * Less - Leaner CSS v3.0.0-alpha.3 * http://lesscss.org * * Copyright (c) 2009-2017, Alexis Sellier @@ -66,15 +66,30 @@ module.exports = function(window, options) { * used in the browser distributed version of less * to kick-start less using the browser api */ -/*global window, document */ +/* global window, document */ -// TODO - consider switching this out for a recommendation for this polyfill: +// TODO - consider switching this out for a recommendation for this polyfill? // +// Browsers have good Promise support require("promise/polyfill"); -var options = window.less || {}; +var options = require('../less/default-options')(); + +if (window.less) { + for (key in window.less) { + if (window.less.hasOwnProperty(key)) { + options[key] = window.less[key]; + } + } +} require("./add-default-options")(window, options); +options.plugins = options.plugins || []; + +if (window.LESS_PLUGINS) { + options.plugins = options.plugins.concat(window.LESS_PLUGINS); +} + var less = module.exports = require("./index")(window, options); window.less = less; @@ -95,7 +110,7 @@ if (options.onReady) { if (/!watch/.test(window.location.hash)) { less.watch(); } - // Simulate synchronous stylesheet loading by blocking page rendering + // Simulate synchronous stylesheet loading by hiding page rendering if (!options.async) { css = 'body { display: none !important }'; head = document.head || document.getElementsByTagName('head')[0]; @@ -114,7 +129,7 @@ if (options.onReady) { less.pageLoadFinished = less.refresh(less.env === 'development').then(resolveOrReject, resolveOrReject); } -},{"./add-default-options":1,"./index":8,"promise/polyfill":101}],3:[function(require,module,exports){ +},{"../less/default-options":16,"./add-default-options":1,"./index":8,"promise/polyfill":102}],3:[function(require,module,exports){ var utils = require("./utils"); module.exports = { createCSS: function (document, styles, sheet) { @@ -201,7 +216,7 @@ module.exports = function(window, options, logger) { cache.setItem(path + ':vars', JSON.stringify(modifyVars)); } } catch (e) { - //TODO - could do with adding more robust error handling + // TODO - could do with adding more robust error handling logger.error('failed to save "' + path + '" to local storage for caching.'); } } @@ -339,7 +354,7 @@ module.exports = function(window, less, options) { } function removeErrorConsole(path) { - //no action + // no action } function removeError(path) { @@ -397,7 +412,7 @@ module.exports = function(window, less, options) { }; },{"./browser":3,"./utils":11}],6:[function(require,module,exports){ -/*global window, XMLHttpRequest */ +/* global window, XMLHttpRequest */ module.exports = function(options, logger) { @@ -405,7 +420,7 @@ module.exports = function(options, logger) { var fileCache = {}; - //TODOS - move log somewhere. pathDiff and doing something similar in node. use pathDiff in the other browser file for the initial load + // TODOS - move log somewhere. pathDiff and doing something similar in node. use pathDiff in the other browser file for the initial load var FileManager = function() { }; @@ -466,43 +481,50 @@ module.exports = function(options, logger) { fileCache = {}; }; - FileManager.prototype.loadFile = function loadFile(filename, currentDirectory, options, environment, callback) { + FileManager.prototype.loadFile = function loadFile(filename, currentDirectory, options, environment) { + // TODO: Add prefix support like less-node? + // What about multiple paths? + if (currentDirectory && !this.isPathAbsolute(filename)) { filename = currentDirectory + filename; } + filename = options.ext ? this.tryAppendExtension(filename, options.ext) : filename; + options = options || {}; // sheet may be set to the stylesheet for the initial load or a collection of properties including // some context variables for imports var hrefParts = this.extractUrlParts(filename, window.location.href); var href = hrefParts.url; - - if (options.useFileCache && fileCache[href]) { - try { - var lessText = fileCache[href]; - callback(null, { contents: lessText, filename: href, webInfo: { lastModified: new Date() }}); - } catch (e) { - callback({filename: href, message: "Error loading file " + href + " error was " + e.message}); + var self = this; + + return new Promise(function(resolve, reject) { + if (options.useFileCache && fileCache[href]) { + try { + var lessText = fileCache[href]; + return resolve({ contents: lessText, filename: href, webInfo: { lastModified: new Date() }}); + } catch (e) { + return reject({ filename: href, message: "Error loading file " + href + " error was " + e.message }); + } } - return; - } - this.doXHR(href, options.mime, function doXHRCallback(data, lastModified) { - // per file cache - fileCache[href] = data; + self.doXHR(href, options.mime, function doXHRCallback(data, lastModified) { + // per file cache + fileCache[href] = data; - // Use remote copy (re-parse) - callback(null, { contents: data, filename: href, webInfo: { lastModified: lastModified }}); - }, function doXHRError(status, url) { - callback({ type: 'File', message: "'" + url + "' wasn't found (" + status + ")", href: href }); + // Use remote copy (re-parse) + resolve({ contents: data, filename: href, webInfo: { lastModified: lastModified }}); + }, function doXHRError(status, url) { + reject({ type: 'File', message: "'" + url + "' wasn't found (" + status + ")", href: href }); + }); }); }; return FileManager; }; -},{"../less/environment/abstract-file-manager.js":16}],7:[function(require,module,exports){ +},{"../less/environment/abstract-file-manager.js":17}],7:[function(require,module,exports){ module.exports = function() { var functionRegistry = require("./../less/functions/function-registry"); @@ -532,7 +554,7 @@ module.exports = function() { functionRegistry.addMultiple(imageFunctions); }; -},{"./../less/functions/function-registry":24}],8:[function(require,module,exports){ +},{"./../less/functions/function-registry":26}],8:[function(require,module,exports){ // // index.js // Should expose the additional browser functions on to the less object @@ -557,7 +579,7 @@ module.exports = function(window, options) { var cache = less.cache = options.cache || require("./cache")(window, options, less.logger); require('./image-size')(less.environment); - //Setup user functions - Deprecate? + // Setup user functions - Deprecate? if (options.functions) { less.functions.functionRegistry.addMultiple(options.functions); } @@ -565,13 +587,7 @@ module.exports = function(window, options) { var typePattern = /^text\/(x-)?less$/; function clone(obj) { - var cloned = {}; - for (var prop in obj) { - if (obj.hasOwnProperty(prop)) { - cloned[prop] = obj[prop]; - } - } - return cloned; + return JSON.parse(JSON.stringify(obj || {})); } // only really needed for phantom @@ -595,7 +611,7 @@ module.exports = function(window, options) { var lessText = style.innerHTML || ''; instanceOptions.filename = document.location.href.replace(/#.*$/, ''); - /*jshint loopfunc:true */ + /* jshint loopfunc:true */ // use closure to store current style less.render(lessText, instanceOptions, bind(function(style, e, result) { @@ -651,7 +667,7 @@ module.exports = function(window, options) { } - //TODO add tests around how this behaves when reloading + // TODO add tests around how this behaves when reloading errors.remove(path); instanceOptions.rootFileInfo = newFileInfo; @@ -666,13 +682,14 @@ module.exports = function(window, options) { }); } - fileManager.loadFile(sheet.href, null, instanceOptions, environment, function(e, loadedFile) { - if (e) { - callback(e); - return; - } - loadInitialFileCallback(loadedFile); - }); + fileManager.loadFile(sheet.href, null, instanceOptions, environment) + .then(function(loadedFile) { + loadInitialFileCallback(loadedFile); + }).catch(function(err) { + console.log(err); + callback(err); + }); + } function loadStyleSheets(callback, reload, modifyVars) { @@ -812,7 +829,7 @@ module.exports = function(window, options) { return less; }; -},{"../less":33,"./browser":3,"./cache":4,"./error-reporting":5,"./file-manager":6,"./image-size":7,"./log-listener":9,"./plugin-loader":10,"./utils":11}],9:[function(require,module,exports){ +},{"../less":35,"./browser":3,"./cache":4,"./error-reporting":5,"./file-manager":6,"./image-size":7,"./log-listener":9,"./plugin-loader":10,"./utils":11}],9:[function(require,module,exports){ module.exports = function(less, options) { var logLevel_debug = 4, @@ -858,6 +875,7 @@ module.exports = function(less, options) { }; },{}],10:[function(require,module,exports){ +// TODO: Add tests for browser @plugin /*global window */ var AbstractPluginLoader = require("../less/environment/abstract-plugin-loader.js"); @@ -867,68 +885,23 @@ var AbstractPluginLoader = require("../less/environment/abstract-plugin-loader.j */ var PluginLoader = function(less) { this.less = less; + // shim for browser require? this.require = require; }; PluginLoader.prototype = new AbstractPluginLoader(); -PluginLoader.prototype.tryLoadPlugin = function(name, basePath, callback) { - var self = this; - var prefix = name.slice(0, 1); - var explicit = prefix === "." || prefix === "/" || name.slice(-3).toLowerCase() === ".js"; - this.tryLoadFromEnvironment(name, basePath, explicit, function(err, data) { - if (explicit) { - callback(err, data); - } - else { - if (!err) { - callback(null, data); - } - else { - self.tryLoadFromEnvironment('less-plugin-' + name, basePath, explicit, function(err2, data) { - callback(err, data); - }); - } - } - }); - -}; - -PluginLoader.prototype.tryLoadFromEnvironment = function(filename, basePath, explicit, callback) { - var fileManager = new this.less.FileManager(), - extract = fileManager.extractUrlParts; - - if (basePath) { - filename = (extract(filename, basePath)).url; - } - - if (extract(filename).hostPart !== extract(window.location.href).hostPart) { - callback({ message: 'Cross Site Scripting (XSS) plugins are not allowed'}); - } - - if (filename) { - - filename = fileManager.tryAppendExtension(filename, '.js'); - - var done = function(err, data) { - if (err) { - callback(err); - } else { - callback(null, data); - } - }; - fileManager.loadFile(filename, null, null, null, done); - - } - else { - callback({ message: 'Plugin could not be found.'}); - } +PluginLoader.prototype.loadPlugin = function(filename, basePath, context, environment, fileManager) { + return new Promise(function(fulfill, reject) { + fileManager.loadFile(filename, basePath, context, environment) + .then(fulfill).catch(reject); + }); }; module.exports = PluginLoader; -},{"../less/environment/abstract-plugin-loader.js":17}],11:[function(require,module,exports){ +},{"../less/environment/abstract-plugin-loader.js":18}],11:[function(require,module,exports){ module.exports = { extractId: function(href) { return href.replace(/^[a-z-]+:\/+?[^\/]+/, '') // Remove protocol & domain @@ -997,17 +970,17 @@ contexts.Parse = function(options) { }; var evalCopyProperties = [ - 'paths', // additional include paths - 'compress', // whether to compress - 'ieCompat', // whether to enforce IE compatibility (IE8 data-uri) - 'strictMath', // whether math has to be within parenthesis - 'strictUnits', // whether units need to evaluate correctly - 'sourceMap', // whether to output a source map - 'importMultiple', // whether we are currently importing multiple copies - 'urlArgs', // whether to add args into url tokens - 'javascriptEnabled',// option - whether Inline JavaScript is enabled. if undefined, defaults to false - 'pluginManager', // Used as the plugin manager for the session - 'importantScope' // used to bubble up !important statements + 'paths', // additional include paths + 'compress', // whether to compress + 'ieCompat', // whether to enforce IE compatibility (IE8 data-uri) + 'strictMath', // whether math has to be within parenthesis + 'strictUnits', // whether units need to evaluate correctly + 'sourceMap', // whether to output a source map + 'importMultiple', // whether we are currently importing multiple copies + 'urlArgs', // whether to add args into url tokens + 'javascriptEnabled', // option - whether Inline JavaScript is enabled. if undefined, defaults to false + 'pluginManager', // Used as the plugin manager for the session + 'importantScope' // used to bubble up !important statements ]; contexts.Eval = function(options, frames) { @@ -1065,7 +1038,7 @@ contexts.Eval.prototype.normalizePath = function( path ) { return path.join("/"); }; -//todo - do the same for the toCSS ? +// todo - do the same for the toCSS ? },{}],13:[function(require,module,exports){ module.exports = { @@ -1247,6 +1220,72 @@ module.exports = { } }; },{}],16:[function(require,module,exports){ +// Export a new default each time +module.exports = function() { + return { + /* Outputs a makefile import dependency list to stdout. */ + depends: false, + + /* 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 */ + relativeUrls: false, + + /* Compatibility with IE8. Used for limiting data-uri length */ + ieCompat: false, // true until 3.0 + + /* Without this option on, Less will try and process all math in your css */ + strictMath: false, + + /* 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: '' + } +} +},{}],17:[function(require,module,exports){ var abstractFileManager = function() { }; @@ -1325,7 +1364,7 @@ abstractFileManager.prototype.extractUrlParts = function extractUrlParts(url, ba var urlPartsRegex = /^((?:[a-z-]+:)?\/{2}(?:[^\/\?#]*\/)|([\/\\]))?((?:[^\/\\\?#]*[\/\\])*)([^\/\\\?#]*)([#\?].*)?$/i, urlParts = url.match(urlPartsRegex), - returner = {}, directories = [], i, baseUrlParts; + returner = {}, rawDirectories = [], directories = [], i, baseUrlParts; if (!urlParts) { throw new Error("Could not parse sheet href - '" + url + "'"); @@ -1344,26 +1383,24 @@ abstractFileManager.prototype.extractUrlParts = function extractUrlParts(url, ba } if (urlParts[3]) { - directories = urlParts[3].replace(/\\/g, "/").split("/"); + rawDirectories = urlParts[3].replace(/\\/g, "/").split("/"); - // extract out . before .. so .. doesn't absorb a non-directory - for (i = 0; i < directories.length; i++) { - if (directories[i] === ".") { - directories.splice(i, 1); - i -= 1; - } - } + // collapse '..' and skip '.' + for (i = 0; i < rawDirectories.length; i++) { - for (i = 0; i < directories.length; i++) { - if (directories[i] === ".." && i > 0) { - directories.splice(i - 1, 2); - i -= 2; + 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] || ""); @@ -1373,7 +1410,7 @@ abstractFileManager.prototype.extractUrlParts = function extractUrlParts(url, ba module.exports = abstractFileManager; -},{}],17:[function(require,module,exports){ +},{}],18:[function(require,module,exports){ var functionRegistry = require("../functions/function-registry"), LessError = require('../less-error'); @@ -1394,7 +1431,6 @@ AbstractPluginLoader.prototype.evalPlugin = function(contents, context, imports, registry, pluginObj, localModule, - localExports, pluginManager, filename; @@ -1432,7 +1468,6 @@ AbstractPluginLoader.prototype.evalPlugin = function(contents, context, imports, pluginManager: pluginManager, fileInfo: fileInfo }; - localExports = localModule.exports; registry = functionRegistry.create(); var registerPlugin = function(obj) { @@ -1443,7 +1478,7 @@ AbstractPluginLoader.prototype.evalPlugin = function(contents, context, imports, loader = new Function("module", "require", "registerPlugin", "functions", "tree", "less", "fileInfo", contents); loader(localModule, this.require, registerPlugin, registry, this.less.tree, this.less, fileInfo); } catch (e) { - return new this.less.LessError({ message: 'Parse error' }, imports, filename); + return new this.less.LessError(e, imports, filename); } if (!pluginObj) { @@ -1546,7 +1581,7 @@ AbstractPluginLoader.prototype.printUsage = function(plugins) { module.exports = AbstractPluginLoader; -},{"../functions/function-registry":24,"../less-error":34}],18:[function(require,module,exports){ +},{"../functions/function-registry":26,"../less-error":36}],19:[function(require,module,exports){ var logger = require("../logger"); var environment = function(externalEnvironment, fileManagers) { this.fileManagers = fileManagers || []; @@ -1599,7 +1634,24 @@ environment.prototype.clearFileManagers = function () { module.exports = environment; -},{"../logger":35}],19:[function(require,module,exports){ +},{"../logger":37}],20:[function(require,module,exports){ + +var functionRegistry = require("./function-registry"), + Anonymous = require("../tree/anonymous"), + Keyword = require("../tree/keyword"); + +functionRegistry.addMultiple({ + boolean: function(condition) { + return condition ? Keyword.True : Keyword.False; + }, + + 'if': function(condition, trueValue, falseValue) { + return condition ? trueValue + : (falseValue || new Anonymous); + } +}); + +},{"../tree/anonymous":48,"../tree/keyword":69,"./function-registry":26}],21:[function(require,module,exports){ var Color = require("../tree/color"), functionRegistry = require("./function-registry"); @@ -1675,7 +1727,7 @@ for (var f in colorBlendModeFunctions) { functionRegistry.addMultiple(colorBlend); -},{"../tree/color":52,"./function-registry":24}],20:[function(require,module,exports){ +},{"../tree/color":53,"./function-registry":26}],22:[function(require,module,exports){ var Dimension = require("../tree/dimension"), Color = require("../tree/color"), Quoted = require("../tree/quoted"), @@ -1944,43 +1996,73 @@ colorFunctions = { greyscale: function (color) { return colorFunctions.desaturate(color, new Dimension(100)); }, - 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. + 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 color1 === 'undefined') { - color1 = colorFunctions.rgba(0, 0, 0, 1.0); + if (typeof light === 'undefined') { + light = colorFunctions.rgba(255, 255, 255, 1.0); } - if (typeof color2 === 'undefined') { - color2 = colorFunctions.rgba(255, 255, 255, 1.0); + if (typeof dark === 'undefined') { + dark = colorFunctions.rgba(0, 0, 0, 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); + // 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 { - contrast1 = (luma1 + 0.05) / (luma + 0.05); + threshold = number(threshold); } - if (luma > luma2) { - contrast2 = (luma + 0.05) / (luma2 + 0.05); + if (color.luma() < threshold) { + return light; } else { - contrast2 = (luma2 + 0.05) / (luma + 0.05); - } - if (contrast1 > contrast2) { - return color1; - } else { - return color2; + 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(color.toARGB()); }, @@ -2007,10 +2089,11 @@ colorFunctions = { }; functionRegistry.addMultiple(colorFunctions); -},{"../tree/anonymous":47,"../tree/color":52,"../tree/dimension":59,"../tree/quoted":77,"./function-registry":24}],21:[function(require,module,exports){ +},{"../tree/anonymous":48,"../tree/color":53,"../tree/dimension":60,"../tree/quoted":78,"./function-registry":26}],23:[function(require,module,exports){ module.exports = function(environment) { var Quoted = require("../tree/quoted"), URL = require("../tree/url"), + utils = require('../utils'), functionRegistry = require("./function-registry"), fallback = function(functionThis, node) { return new URL(node, functionThis.index, functionThis.currentFileInfo).eval(functionThis.context); @@ -2036,8 +2119,10 @@ module.exports = function(environment) { fragment = filePath.slice(fragmentStart); filePath = filePath.slice(0, fragmentStart); } + var context = utils.clone(this.context); + context.rawBuffer = true; - var fileManager = environment.getFileManager(filePath, currentDirectory, this.context, environment, true); + var fileManager = environment.getFileManager(filePath, currentDirectory, context, environment, true); if (!fileManager) { return fallback(this, filePathNode); @@ -2063,7 +2148,7 @@ module.exports = function(environment) { useBase64 = /;base64$/.test(mimetype); } - var fileSync = fileManager.loadFileSync(filePath, currentDirectory, this.context, environment); + var fileSync = fileManager.loadFileSync(filePath, currentDirectory, context, environment); if (!fileSync.contents) { logger.warn("Skipped data-uri embedding of " + filePath + " because file not found"); return fallback(this, filePathNode || mimetypeNode); @@ -2094,7 +2179,7 @@ module.exports = function(environment) { }); }; -},{"../logger":35,"../tree/quoted":77,"../tree/url":84,"./function-registry":24}],22:[function(require,module,exports){ +},{"../logger":37,"../tree/quoted":78,"../tree/url":84,"../utils":88,"./function-registry":26}],24:[function(require,module,exports){ var Keyword = require("../tree/keyword"), functionRegistry = require("./function-registry"); @@ -2123,7 +2208,7 @@ functionRegistry.add("default", defaultFunc.eval.bind(defaultFunc)); module.exports = defaultFunc; -},{"../tree/keyword":68,"./function-registry":24}],23:[function(require,module,exports){ +},{"../tree/keyword":69,"./function-registry":26}],25:[function(require,module,exports){ var Expression = require("../tree/expression"); var functionCaller = function(name, context, index, currentFileInfo) { @@ -2171,7 +2256,7 @@ functionCaller.prototype.call = function(args) { module.exports = functionCaller; -},{"../tree/expression":62}],24:[function(require,module,exports){ +},{"../tree/expression":63}],26:[function(require,module,exports){ function makeRegistry( base ) { return { _data: {}, @@ -2181,7 +2266,7 @@ function makeRegistry( base ) { name = name.toLowerCase(); if (this._data.hasOwnProperty(name)) { - //TODO warn + // TODO warn } this._data[name] = func; }, @@ -2207,14 +2292,15 @@ function makeRegistry( base ) { } module.exports = makeRegistry( null ); -},{}],25:[function(require,module,exports){ +},{}],27:[function(require,module,exports){ module.exports = function(environment) { var functions = { functionRegistry: require("./function-registry"), functionCaller: require("./function-caller") }; - //register functions + // register functions + require("./boolean"); require("./default"); require("./color"); require("./color-blending"); @@ -2228,7 +2314,7 @@ module.exports = function(environment) { return functions; }; -},{"./color":20,"./color-blending":19,"./data-uri":21,"./default":22,"./function-caller":23,"./function-registry":24,"./math":27,"./number":28,"./string":29,"./svg":30,"./types":31}],26:[function(require,module,exports){ +},{"./boolean":20,"./color":22,"./color-blending":21,"./data-uri":23,"./default":24,"./function-caller":25,"./function-registry":26,"./math":29,"./number":30,"./string":31,"./svg":32,"./types":33}],28:[function(require,module,exports){ var Dimension = require("../tree/dimension"); var MathHelper = function() { @@ -2245,7 +2331,7 @@ MathHelper._math = function (fn, unit, n) { return new Dimension(fn(parseFloat(n.value)), unit); }; module.exports = MathHelper; -},{"../tree/dimension":59}],27:[function(require,module,exports){ +},{"../tree/dimension":60}],29:[function(require,module,exports){ var functionRegistry = require("./function-registry"), mathHelper = require("./math-helper.js"); @@ -2276,7 +2362,7 @@ mathFunctions.round = function (n, f) { functionRegistry.addMultiple(mathFunctions); -},{"./function-registry":24,"./math-helper.js":26}],28:[function(require,module,exports){ +},{"./function-registry":26,"./math-helper.js":28}],30:[function(require,module,exports){ var Dimension = require("../tree/dimension"), Anonymous = require("../tree/anonymous"), functionRegistry = require("./function-registry"), @@ -2359,7 +2445,7 @@ functionRegistry.addMultiple({ } }); -},{"../tree/anonymous":47,"../tree/dimension":59,"./function-registry":24,"./math-helper.js":26}],29:[function(require,module,exports){ +},{"../tree/anonymous":48,"../tree/dimension":60,"./function-registry":26,"./math-helper.js":28}],31:[function(require,module,exports){ var Quoted = require("../tree/quoted"), Anonymous = require("../tree/anonymous"), JavaScript = require("../tree/javascript"), @@ -2381,12 +2467,12 @@ functionRegistry.addMultiple({ result = result.replace(new RegExp(pattern.value, flags ? flags.value : ''), replacement); return new Quoted(string.quote || '', result, string.escaped); }, - '%': function (string /* arg, arg, ...*/) { + '%': function (string /* arg, arg, ... */) { var args = Array.prototype.slice.call(arguments, 1), result = string.value; for (var i = 0; i < args.length; i++) { - /*jshint loopfunc:true */ + /* 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(); @@ -2398,7 +2484,7 @@ functionRegistry.addMultiple({ } }); -},{"../tree/anonymous":47,"../tree/javascript":66,"../tree/quoted":77,"./function-registry":24}],30:[function(require,module,exports){ +},{"../tree/anonymous":48,"../tree/javascript":67,"../tree/quoted":78,"./function-registry":26}],32:[function(require,module,exports){ module.exports = function(environment) { var Dimension = require("../tree/dimension"), Color = require("../tree/color"), @@ -2488,7 +2574,7 @@ module.exports = function(environment) { }); }; -},{"../tree/color":52,"../tree/dimension":59,"../tree/expression":62,"../tree/quoted":77,"../tree/url":84,"./function-registry":24}],31:[function(require,module,exports){ +},{"../tree/color":53,"../tree/dimension":60,"../tree/expression":63,"../tree/quoted":78,"../tree/url":84,"./function-registry":26}],33:[function(require,module,exports){ var Keyword = require("../tree/keyword"), DetachedRuleset = require("../tree/detached-ruleset"), Dimension = require("../tree/dimension"), @@ -2579,10 +2665,12 @@ functionRegistry.addMultiple({ } }); -},{"../tree/anonymous":47,"../tree/color":52,"../tree/detached-ruleset":58,"../tree/dimension":59,"../tree/keyword":68,"../tree/operation":74,"../tree/quoted":77,"../tree/url":84,"./function-registry":24}],32:[function(require,module,exports){ +},{"../tree/anonymous":48,"../tree/color":53,"../tree/detached-ruleset":59,"../tree/dimension":60,"../tree/keyword":69,"../tree/operation":75,"../tree/quoted":78,"../tree/url":84,"./function-registry":26}],34:[function(require,module,exports){ var contexts = require("./contexts"), Parser = require('./parser/parser'), - LessError = require('./less-error'); + LessError = require('./less-error'), + utils = require('./utils'), + PromiseConstructor = typeof Promise === 'undefined' ? require('promise') : Promise; module.exports = function(environment) { @@ -2608,6 +2696,7 @@ module.exports = function(environment) { 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 @@ -2630,7 +2719,9 @@ module.exports = function(environment) { callback(null, {rules:[]}, false, null); } else { - importManager.files[fullPath] = root; + if (!importManager.files[fullPath]) { + importManager.files[fullPath] = { root: root, options: importOptions }; + } if (e && !importManager.error) { importManager.error = e; } callback(e, root, importedEqualsRoot, fullPath); } @@ -2650,10 +2741,6 @@ module.exports = function(environment) { return; } - if (tryAppendExtension) { - path = importOptions.isPlugin ? path : fileManager.tryAppendExtension(path, ".less"); - } - var loadFileCallback = function(loadedFile) { var plugin, resolvedFilename = loadedFile.filename, @@ -2699,39 +2786,50 @@ module.exports = function(environment) { } else if (importOptions.inline) { fileParsedFunc(null, contents, resolvedFilename); } else { - new Parser(newEnv, importManager, newFileInfo).parse(contents, function (e, root) { - fileParsedFunc(e, root, resolvedFilename); - }); - } - }; - var promise; - var done = function(err, loadedFile) { - if (err) { - fileParsedFunc(err); - } else { - loadFileCallback(loadedFile); + + // 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(newEnv, importManager, newFileInfo).parse(contents, function (e, root) { + fileParsedFunc(e, root, resolvedFilename); + }); + } } }; + var promise, context = utils.clone(this.context); + + if (tryAppendExtension) { + context.ext = importOptions.isPlugin ? ".js" : ".less"; + } + if (importOptions.isPlugin) { - try { - pluginLoader.tryLoadPlugin(path, currentFileInfo.currentDirectory, done); - } - catch (e) { - callback(e); - } + promise = pluginLoader.loadPlugin(path, currentFileInfo.currentDirectory, context, environment, fileManager); } else { - promise = fileManager.loadFile(path, currentFileInfo.currentDirectory, this.context, environment, done); - if (promise) { - promise.then(loadFileCallback, fileParsedFunc); - } + promise = fileManager.loadFile(path, currentFileInfo.currentDirectory, context, environment, + function(err, loadedFile) { + if (err) { + fileParsedFunc(err); + } else { + loadFileCallback(loadedFile); + } + }); } - + if (promise) { + promise.then(loadFileCallback, fileParsedFunc); + } + }; return ImportManager; }; -},{"./contexts":12,"./less-error":34,"./parser/parser":40}],33:[function(require,module,exports){ +},{"./contexts":12,"./less-error":36,"./parser/parser":42,"./utils":88,"promise":undefined}],35:[function(require,module,exports){ module.exports = function(environment, fileManagers) { var SourceMapOutput, SourceMapBuilder, ParseTree, ImportManager, Environment; @@ -2771,7 +2869,7 @@ module.exports = function(environment, fileManagers) { }; var t, api = Object.create(initial); for (var n in initial.tree) { - /*eslint guard-for-in: 0 */ + /* eslint guard-for-in: 0 */ t = initial.tree[n]; if (typeof t === "function") { api[n] = ctor(t); @@ -2779,7 +2877,7 @@ module.exports = function(environment, fileManagers) { else { api[n] = Object.create(null); for (var o in t) { - /*eslint guard-for-in: 0 */ + /* eslint guard-for-in: 0 */ api[n][o] = ctor(t[o]); } } @@ -2788,7 +2886,7 @@ module.exports = function(environment, fileManagers) { return api; }; -},{"./contexts":12,"./data":14,"./environment/abstract-file-manager":16,"./environment/abstract-plugin-loader":17,"./environment/environment":18,"./functions":25,"./import-manager":32,"./less-error":34,"./logger":35,"./parse":37,"./parse-tree":36,"./parser/parser":40,"./plugin-manager":41,"./render":42,"./source-map-builder":43,"./source-map-output":44,"./transform-tree":45,"./tree":65,"./utils":87,"./visitors":91}],34:[function(require,module,exports){ +},{"./contexts":12,"./data":14,"./environment/abstract-file-manager":17,"./environment/abstract-plugin-loader":18,"./environment/environment":19,"./functions":27,"./import-manager":34,"./less-error":36,"./logger":37,"./parse":39,"./parse-tree":38,"./parser/parser":42,"./plugin-manager":43,"./render":44,"./source-map-builder":45,"./source-map-output":46,"./transform-tree":47,"./tree":66,"./utils":88,"./visitors":92}],36:[function(require,module,exports){ var utils = require('./utils'); /** * This is a centralized class of any error that could be thrown internally (mostly by the parser). @@ -2931,7 +3029,7 @@ LessError.prototype.toString = function(options) { return message; }; -},{"./utils":87}],35:[function(require,module,exports){ +},{"./utils":88}],37:[function(require,module,exports){ module.exports = { error: function(msg) { this._fireEvent("error", msg); @@ -2967,7 +3065,7 @@ module.exports = { _listeners: [] }; -},{}],36:[function(require,module,exports){ +},{}],38:[function(require,module,exports){ var LessError = require('./less-error'), transformTree = require("./transform-tree"), logger = require("./logger"); @@ -3029,20 +3127,23 @@ module.exports = function(SourceMapBuilder) { return ParseTree; }; -},{"./less-error":34,"./logger":35,"./transform-tree":45}],37:[function(require,module,exports){ +},{"./less-error":36,"./logger":37,"./transform-tree":47}],39:[function(require,module,exports){ var PromiseConstructor, contexts = require("./contexts"), Parser = require('./parser/parser'), PluginManager = require('./plugin-manager'), - LessError = require('./less-error'); + LessError = require('./less-error'), + utils = require('./utils'); module.exports = function(environment, ParseTree, ImportManager) { var parse = function (input, options, callback) { - options = options || {}; if (typeof options === 'function') { callback = options; - options = {}; + options = utils.defaults(this.options, {}); + } + else { + options = utils.defaults(this.options, options || {}); } if (!callback) { @@ -3090,6 +3191,9 @@ module.exports = function(environment, ParseTree, ImportManager) { var imports = new ImportManager(this, context, rootFileInfo); this.importManager = imports; + // 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; @@ -3116,7 +3220,7 @@ module.exports = function(environment, ParseTree, ImportManager) { return parse; }; -},{"./contexts":12,"./less-error":34,"./parser/parser":40,"./plugin-manager":41,"promise":undefined}],38:[function(require,module,exports){ +},{"./contexts":12,"./less-error":36,"./parser/parser":42,"./plugin-manager":43,"./utils":88,"promise":undefined}],40:[function(require,module,exports){ // Split the input into chunks. module.exports = function (input, fail) { var len = input.length, level = 0, parenLevel = 0, @@ -3230,15 +3334,15 @@ module.exports = function (input, fail) { return chunks; }; -},{}],39:[function(require,module,exports){ +},{}],41:[function(require,module,exports){ var chunker = require('./chunker'); module.exports = function() { - var input, // LeSS input string + var input, // Less input string j, // current chunk saveStack = [], // holds state for backtracking furthest, // furthest index the parser has gone to - furthestPossibleErrorMessage,// if this is furthest we got to, this is the probably cause + furthestPossibleErrorMessage, // if this is furthest we got to, this is the probably cause chunks, // chunkified input current, // current chunk currentPos, // index of current chunk, in `input` @@ -3442,7 +3546,7 @@ module.exports = function() { parserInput.peekNotNumeric = function() { var c = input.charCodeAt(parserInput.i); - //Is the first char of the dimension 0-9, '.', '+' or '-' + // Is the first char of the dimension 0-9, '.', '+' or '-' return (c > CHARCODE_9 || c < CHARCODE_PLUS) || c === CHARCODE_FORWARD_SLASH || c === CHARCODE_COMMA; }; @@ -3491,7 +3595,7 @@ module.exports = function() { return parserInput; }; -},{"./chunker":38}],40:[function(require,module,exports){ +},{"./chunker":40}],42:[function(require,module,exports){ var LessError = require('../less-error'), tree = require("../tree"), visitors = require("../visitors"), @@ -3529,8 +3633,8 @@ var LessError = require('../less-error'), // Token matching is done with the `$` function, which either takes // a terminal string or regexp, or a non-terminal function to call. // It also takes care of moving all the indices forwards. -//` // + var Parser = function Parser(context, imports, fileInfo) { var parsers, parserInput = getParserInput(); @@ -3808,7 +3912,7 @@ var Parser = function Parser(context, imports, fileInfo) { } node = mixin.definition() || this.declaration() || this.ruleset() || - mixin.call() || this.rulesetCall() || this.entities.call() || this.atrule(); + mixin.call() || this.variableCall() || this.entities.call() || this.atrule(); if (node) { root.push(node); } else { @@ -3877,13 +3981,10 @@ var Parser = function Parser(context, imports, fileInfo) { // // rgb(255, 0, 255) // - // We also try to catch IE's `alpha()`, but let the `alpha` parser - // deal with the details. - // // The arguments are parsed with the `entities.arguments` parser. // call: function () { - var name, nameLC, args, alpha, index = parserInput.i; + var name, args, func, index = parserInput.i; // http://jsperf.com/case-insensitive-regex-vs-strtolower-then-regex/18 if (parserInput.peek(/^url\(/i)) { @@ -3893,20 +3994,22 @@ var Parser = function Parser(context, imports, fileInfo) { parserInput.save(); name = parserInput.$re(/^([\w-]+|%|progid:[\w\.]+)\(/); - if (!name) { parserInput.forget(); return; } + if (!name) { + parserInput.forget(); + return; + } name = name[1]; - nameLC = name.toLowerCase(); - - if (nameLC === 'alpha') { - alpha = parsers.alpha(); - if (alpha) { + func = this.customFuncCall(name); + if (func) { + args = func.parse(); + if (args && func.stop) { parserInput.forget(); - return alpha; + return args; } } - args = this.arguments(); + args = this.arguments(args); if (!parserInput.$char(')')) { parserInput.restore("Could not parse call arguments or missing ')'"); @@ -3916,47 +4019,72 @@ var Parser = function Parser(context, imports, fileInfo) { parserInput.forget(); return new(tree.Call)(name, args, index, fileInfo); }, - arguments: function () { - var argsSemiColon = [], argsComma = [], - expressions = [], - isSemiColonSeparated, value, arg; + + // + // Parsing rules for functions with non-standard args, e.g.: + // + // boolean(not(2 > 1)) + // + // This is a quick prototype, to be modified/improved when + // more custom-parsed funcs come (e.g. `selector(...)`) + // + + customFuncCall: function (name) { + /* Ideally the table is to be moved out of here for faster perf., + but it's quite tricky since it relies on all these `parsers` + and `expect` available only here */ + return { + alpha: f(parsers.ieAlpha, true), + boolean: f(condition), + 'if': f(condition) + }[name.toLowerCase()]; + + function f(parse, stop) { + return { + parse: parse, // parsing function + stop: stop // when true - stop after parse() and return its result, + // otherwise continue for plain args + }; + } + + function condition() { + return [expect(parsers.condition, 'expected condition')]; + } + }, + + arguments: function (prevArgs) { + var argsComma = prevArgs || [], + argsSemiColon = [], + isSemiColonSeparated, value; parserInput.save(); while (true) { + if (prevArgs) { + prevArgs = false; + } else { + value = parsers.detachedRuleset() || this.assignment() || parsers.expression(); + if (!value) { + break; + } - arg = parsers.detachedRuleset() || this.assignment() || parsers.expression(); + if (value.value && value.value.length == 1) { + value = value.value[0]; + } - if (!arg) { - break; + argsComma.push(value); } - value = arg; - - if (arg.value && arg.value.length == 1) { - value = arg.value[0]; - } - - if (value) { - expressions.push(value); - } - - argsComma.push(value); - if (parserInput.$char(',')) { continue; } if (parserInput.$char(';') || isSemiColonSeparated) { - isSemiColonSeparated = true; - - if (expressions.length > 1) { - value = new(tree.Value)(expressions); - } + value = (argsComma.length < 1) ? argsComma[0] + : new tree.Value(argsComma); argsSemiColon.push(value); - - expressions = []; + argsComma = []; } } @@ -4181,15 +4309,17 @@ var Parser = function Parser(context, imports, fileInfo) { }, // - // The variable part of a variable definition. Used in the `rule` parser + // Call a variable value // - // @fink(); + // @fink() // - rulesetCall: function () { + variableCall: function () { var name; - if (parserInput.currentChar() === '@' && (name = parserInput.$re(/^(@[\w-]+)\(\s*\)\s*;/))) { - return new tree.RulesetCall(name[1]); + if (parserInput.currentChar() === '@' + && (name = parserInput.$re(/^(@[\w-]+)\(\s*\)/)) + && parsers.end()) { + return new tree.VariableCall(name[1]); } }, @@ -4511,17 +4641,18 @@ var Parser = function Parser(context, imports, fileInfo) { // // alpha(opacity=88) // - alpha: function () { + ieAlpha: function () { var value; // http://jsperf.com/case-insensitive-regex-vs-strtolower-then-regex/18 if (!parserInput.$re(/^opacity=/i)) { return; } value = parserInput.$re(/^\d+/); if (!value) { - value = expect(this.entities.variable, "Could not parse alpha"); + value = expect(parsers.entities.variable, "Could not parse alpha"); + value = '@{' + value.name.slice(1) + '}'; } expectChar(')'); - return new(tree.Alpha)(value); + return new tree.Quoted('', 'alpha(opacity=' + value + ')'); }, // @@ -5463,7 +5594,7 @@ Parser.serializeVars = function(vars) { module.exports = Parser; -},{"../less-error":34,"../tree":65,"../utils":87,"../visitors":91,"./parser-input":39}],41:[function(require,module,exports){ +},{"../less-error":36,"../tree":66,"../utils":88,"../visitors":92,"./parser-input":41}],43:[function(require,module,exports){ var utils = require('./utils'); /** * Plugin Manager @@ -5642,14 +5773,18 @@ PluginManager.prototype.getFileManagers = function() { // module.exports = PluginManagerFactory; -},{"./utils":87}],42:[function(require,module,exports){ -var PromiseConstructor; +},{"./utils":88}],44:[function(require,module,exports){ +var PromiseConstructor, + utils = require('./utils'); module.exports = function(environment, ParseTree, ImportManager) { var render = function (input, options, callback) { if (typeof options === 'function') { callback = options; - options = {}; + options = utils.defaults(this.options, {}); + } + else { + options = utils.defaults(this.options, options || {}); } if (!callback) { @@ -5685,7 +5820,7 @@ module.exports = function(environment, ParseTree, ImportManager) { return render; }; -},{"promise":undefined}],43:[function(require,module,exports){ +},{"./utils":88,"promise":undefined}],45:[function(require,module,exports){ module.exports = function (SourceMapOutput, environment) { var SourceMapBuilder = function (options) { @@ -5759,7 +5894,7 @@ module.exports = function (SourceMapOutput, environment) { return SourceMapBuilder; }; -},{}],44:[function(require,module,exports){ +},{}],46:[function(require,module,exports){ module.exports = function (environment) { var SourceMapOutput = function (options) { @@ -5809,7 +5944,7 @@ module.exports = function (environment) { SourceMapOutput.prototype.add = function(chunk, fileInfo, index, mapLines) { - //ignore adding empty strings + // ignore adding empty strings if (!chunk) { return; } @@ -5904,7 +6039,7 @@ module.exports = function (environment) { return SourceMapOutput; }; -},{}],45:[function(require,module,exports){ +},{}],47:[function(require,module,exports){ var contexts = require("./contexts"), visitor = require("./visitors"), tree = require("./tree"); @@ -5979,37 +6114,7 @@ module.exports = function(root, options) { return evaldRoot; }; -},{"./contexts":12,"./tree":65,"./visitors":91}],46:[function(require,module,exports){ -var Node = require("./node"); - -var Alpha = function (val) { - this.value = val; -}; -Alpha.prototype = new Node(); -Alpha.prototype.type = "Alpha"; - -Alpha.prototype.accept = function (visitor) { - this.value = visitor.visit(this.value); -}; -Alpha.prototype.eval = function (context) { - if (this.value.eval) { return new Alpha(this.value.eval(context)); } - return this; -}; -Alpha.prototype.genCSS = function (context, output) { - output.add("alpha(opacity="); - - if (this.value.genCSS) { - this.value.genCSS(context, output); - } else { - output.add(this.value); - } - - output.add(")"); -}; - -module.exports = Alpha; - -},{"./node":73}],47:[function(require,module,exports){ +},{"./contexts":12,"./tree":66,"./visitors":92}],48:[function(require,module,exports){ var Node = require("./node"); var Anonymous = function (value, index, currentFileInfo, mapLines, rulesetLike, visibilityInfo) { @@ -6040,7 +6145,7 @@ Anonymous.prototype.genCSS = function (context, output) { }; module.exports = Anonymous; -},{"./node":73}],48:[function(require,module,exports){ +},{"./node":74}],49:[function(require,module,exports){ var Node = require("./node"); var Assignment = function (key, val) { @@ -6069,7 +6174,7 @@ Assignment.prototype.genCSS = function (context, output) { }; module.exports = Assignment; -},{"./node":73}],49:[function(require,module,exports){ +},{"./node":74}],50:[function(require,module,exports){ var Node = require("./node"), Selector = require("./selector"), Ruleset = require("./ruleset"), @@ -6133,11 +6238,11 @@ AtRule.prototype.genCSS = function (context, output) { AtRule.prototype.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 + // media stored inside other atrule should not bubble over it + // backpup media bubbling information mediaPathBackup = context.mediaPath; mediaBlocksBackup = context.mediaBlocks; - //deleted media bubbling information + // deleted media bubbling information context.mediaPath = []; context.mediaBlocks = []; @@ -6149,7 +6254,7 @@ AtRule.prototype.eval = function (context) { rules = [rules[0].eval(context)]; rules[0].root = true; } - //restore media bubbling information + // restore media bubbling information context.mediaPath = mediaPathBackup; context.mediaBlocks = mediaBlocksBackup; @@ -6207,7 +6312,7 @@ AtRule.prototype.outputRuleset = function (context, output, rules) { }; module.exports = AtRule; -},{"./anonymous":47,"./node":73,"./ruleset":80,"./selector":81}],50:[function(require,module,exports){ +},{"./anonymous":48,"./node":74,"./ruleset":80,"./selector":81}],51:[function(require,module,exports){ var Node = require("./node"); var Attribute = function (key, op, value) { @@ -6236,7 +6341,7 @@ Attribute.prototype.toCSS = function (context) { }; module.exports = Attribute; -},{"./node":73}],51:[function(require,module,exports){ +},{"./node":74}],52:[function(require,module,exports){ var Node = require("./node"), Anonymous = require("./anonymous"), FunctionCaller = require("../functions/function-caller"); @@ -6287,10 +6392,16 @@ Call.prototype.eval = function (context) { } if (result !== null && result !== undefined) { - // All returned results must be Nodes, - // so anything other than a Node is a null Node + // Results that that are not nodes are cast as Anonymous nodes + // Falsy values or booleans are returned as empty nodes if (!(result instanceof Node)) { - result = new Anonymous(null); + if (!result || result === true) { + result = new Anonymous(null); + } + else { + result = new Anonymous(result.toString()); + } + } result._index = this._index; result._fileInfo = this._fileInfo; @@ -6315,7 +6426,7 @@ Call.prototype.genCSS = function (context, output) { }; module.exports = Call; -},{"../functions/function-caller":23,"./anonymous":47,"./node":73}],52:[function(require,module,exports){ +},{"../functions/function-caller":25,"./anonymous":48,"./node":74}],53:[function(require,module,exports){ var Node = require("./node"), colors = require("../data/colors"); @@ -6450,7 +6561,7 @@ Color.prototype.toHSL = function () { } 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 +// Adapted from http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript Color.prototype.toHSV = function () { var r = this.rgb[0] / 255, g = this.rgb[1] / 255, @@ -6506,7 +6617,7 @@ Color.fromKeyword = function(keyword) { }; module.exports = Color; -},{"../data/colors":13,"./node":73}],53:[function(require,module,exports){ +},{"../data/colors":13,"./node":74}],54:[function(require,module,exports){ var Node = require("./node"); var Combinator = function (value) { @@ -6531,7 +6642,7 @@ Combinator.prototype.genCSS = function (context, output) { }; module.exports = Combinator; -},{"./node":73}],54:[function(require,module,exports){ +},{"./node":74}],55:[function(require,module,exports){ var Node = require("./node"), getDebugInfo = require("./debug-info"); @@ -6556,7 +6667,7 @@ Comment.prototype.isSilent = function(context) { }; module.exports = Comment; -},{"./debug-info":56,"./node":73}],55:[function(require,module,exports){ +},{"./debug-info":57,"./node":74}],56:[function(require,module,exports){ var Node = require("./node"); var Condition = function (op, l, r, i, negate) { @@ -6595,7 +6706,7 @@ Condition.prototype.eval = function (context) { }; module.exports = Condition; -},{"./node":73}],56:[function(require,module,exports){ +},{"./node":74}],57:[function(require,module,exports){ var debugInfo = function(context, ctx, lineSeparator) { var result = ""; if (context.dumpLineNumbers && !context.compress) { @@ -6635,7 +6746,7 @@ debugInfo.asMediaQuery = function(ctx) { module.exports = debugInfo; -},{}],57:[function(require,module,exports){ +},{}],58:[function(require,module,exports){ var Node = require("./node"), Value = require("./value"), Keyword = require("./keyword"), @@ -6734,7 +6845,7 @@ Declaration.prototype.makeImportant = function () { }; module.exports = Declaration; -},{"./anonymous":47,"./keyword":68,"./node":73,"./value":85}],58:[function(require,module,exports){ +},{"./anonymous":48,"./keyword":69,"./node":74,"./value":85}],59:[function(require,module,exports){ var Node = require("./node"), contexts = require("../contexts"), utils = require("../utils"); @@ -6759,7 +6870,7 @@ DetachedRuleset.prototype.callEval = function (context) { }; module.exports = DetachedRuleset; -},{"../contexts":12,"../utils":87,"./node":73}],59:[function(require,module,exports){ +},{"../contexts":12,"../utils":88,"./node":74}],60:[function(require,module,exports){ var Node = require("./node"), unitConversions = require("../data/unit-conversions"), Unit = require("./unit"), @@ -6770,6 +6881,9 @@ var Node = require("./node"), // var Dimension = function (value, unit) { this.value = parseFloat(value); + if (isNaN(this.value)) { + throw new Error("Dimension is not a number."); + } this.unit = (unit && unit instanceof Unit) ? unit : new Unit(unit ? [unit] : undefined); this.setParent(this.unit, this); @@ -6820,7 +6934,7 @@ Dimension.prototype.genCSS = function (context, output) { // we default to the first Dimension's unit, // so `1px + 2` will yield `3px`. Dimension.prototype.operate = function (context, op, other) { - /*jshint noempty:false */ + /* jshint noempty:false */ var value = this._operate(context, op, this.value, other.value), unit = this.unit.clone(); @@ -6919,7 +7033,7 @@ Dimension.prototype.convertTo = function (conversions) { }; module.exports = Dimension; -},{"../data/unit-conversions":15,"./color":52,"./node":73,"./unit":83}],60:[function(require,module,exports){ +},{"../data/unit-conversions":15,"./color":53,"./node":74,"./unit":83}],61:[function(require,module,exports){ // Backwards compatibility shim for Directive (AtRule) var AtRule = require("./atrule"); @@ -6932,7 +7046,7 @@ Directive.prototype = Object.create(AtRule.prototype); Directive.prototype.constructor = Directive; module.exports = Directive; -},{"./atrule":49}],61:[function(require,module,exports){ +},{"./atrule":50}],62:[function(require,module,exports){ var Node = require("./node"), Paren = require("./paren"), Combinator = require("./combinator"); @@ -6995,7 +7109,7 @@ Element.prototype.toCSS = function (context) { }; module.exports = Element; -},{"./combinator":53,"./node":73,"./paren":75}],62:[function(require,module,exports){ +},{"./combinator":54,"./node":74,"./paren":76}],63:[function(require,module,exports){ var Node = require("./node"), Paren = require("./paren"), Comment = require("./comment"); @@ -7053,7 +7167,7 @@ Expression.prototype.throwAwayComments = function () { }; module.exports = Expression; -},{"./comment":54,"./node":73,"./paren":75}],63:[function(require,module,exports){ +},{"./comment":55,"./node":74,"./paren":76}],64:[function(require,module,exports){ var Node = require("./node"), Selector = require("./selector"); @@ -7092,7 +7206,7 @@ Extend.prototype.eval = function (context) { Extend.prototype.clone = function (context) { return new Extend(this.selector, this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo()); }; -//it concatenates (joins) all selectors in selector array +// it concatenates (joins) all selectors in selector array Extend.prototype.findSelfSelectors = function (selectors) { var selfElements = [], i, @@ -7113,7 +7227,7 @@ Extend.prototype.findSelfSelectors = function (selectors) { }; module.exports = Extend; -},{"./node":73,"./selector":81}],64:[function(require,module,exports){ +},{"./node":74,"./selector":81}],65:[function(require,module,exports){ var Node = require("./node"), Media = require("./media"), URL = require("./url"), @@ -7295,11 +7409,10 @@ Import.prototype.doEval = function (context) { }; module.exports = Import; -},{"../less-error":34,"../utils":87,"./anonymous":47,"./media":69,"./node":73,"./quoted":77,"./ruleset":80,"./url":84}],65:[function(require,module,exports){ +},{"../less-error":36,"../utils":88,"./anonymous":48,"./media":70,"./node":74,"./quoted":78,"./ruleset":80,"./url":84}],66:[function(require,module,exports){ var tree = Object.create(null); tree.Node = require('./node'); -tree.Alpha = require('./alpha'); tree.Color = require('./color'); tree.AtRule = require('./atrule'); // Backwards compatibility @@ -7339,11 +7452,11 @@ tree.Media = require('./media'); tree.UnicodeDescriptor = require('./unicode-descriptor'); tree.Negative = require('./negative'); tree.Extend = require('./extend'); -tree.RulesetCall = require('./ruleset-call'); +tree.VariableCall = require('./variable-call'); module.exports = tree; -},{"./alpha":46,"./anonymous":47,"./assignment":48,"./atrule":49,"./attribute":50,"./call":51,"./color":52,"./combinator":53,"./comment":54,"./condition":55,"./declaration":57,"./detached-ruleset":58,"./dimension":59,"./directive":60,"./element":61,"./expression":62,"./extend":63,"./import":64,"./javascript":66,"./keyword":68,"./media":69,"./mixin-call":70,"./mixin-definition":71,"./negative":72,"./node":73,"./operation":74,"./paren":75,"./property":76,"./quoted":77,"./rule":78,"./ruleset":80,"./ruleset-call":79,"./selector":81,"./unicode-descriptor":82,"./unit":83,"./url":84,"./value":85,"./variable":86}],66:[function(require,module,exports){ +},{"./anonymous":48,"./assignment":49,"./atrule":50,"./attribute":51,"./call":52,"./color":53,"./combinator":54,"./comment":55,"./condition":56,"./declaration":58,"./detached-ruleset":59,"./dimension":60,"./directive":61,"./element":62,"./expression":63,"./extend":64,"./import":65,"./javascript":67,"./keyword":69,"./media":70,"./mixin-call":71,"./mixin-definition":72,"./negative":73,"./node":74,"./operation":75,"./paren":76,"./property":77,"./quoted":78,"./rule":79,"./ruleset":80,"./selector":81,"./unicode-descriptor":82,"./unit":83,"./url":84,"./value":85,"./variable":87,"./variable-call":86}],67:[function(require,module,exports){ var JsEvalNode = require("./js-eval-node"), Dimension = require("./dimension"), Quoted = require("./quoted"), @@ -7373,7 +7486,7 @@ JavaScript.prototype.eval = function(context) { module.exports = JavaScript; -},{"./anonymous":47,"./dimension":59,"./js-eval-node":67,"./quoted":77}],67:[function(require,module,exports){ +},{"./anonymous":48,"./dimension":60,"./js-eval-node":68,"./quoted":78}],68:[function(require,module,exports){ var Node = require("./node"), Variable = require("./variable"); @@ -7407,7 +7520,7 @@ JsEvalNode.prototype.evaluateJavaScript = function (expression, context) { var variables = context.frames[0].variables(); for (var k in variables) { if (variables.hasOwnProperty(k)) { - /*jshint loopfunc:true */ + /* jshint loopfunc:true */ evalContext[k.slice(1)] = { value: variables[k].value, toJS: function () { @@ -7436,7 +7549,7 @@ JsEvalNode.prototype.jsify = function (obj) { module.exports = JsEvalNode; -},{"./node":73,"./variable":86}],68:[function(require,module,exports){ +},{"./node":74,"./variable":87}],69:[function(require,module,exports){ var Node = require("./node"); var Keyword = function (value) { this.value = value; }; @@ -7452,7 +7565,7 @@ Keyword.False = new Keyword('false'); module.exports = Keyword; -},{"./node":73}],69:[function(require,module,exports){ +},{"./node":74}],70:[function(require,module,exports){ var Ruleset = require("./ruleset"), Value = require("./value"), Selector = require("./selector"), @@ -7503,19 +7616,8 @@ Media.prototype.eval = function (context) { this.rules[0].debugInfo = this.debugInfo; media.debugInfo = this.debugInfo; } - var strictMathBypass = false; - if (!context.strictMath) { - strictMathBypass = true; - context.strictMath = true; - } - try { - media.features = this.features.eval(context); - } - finally { - if (strictMathBypass) { - context.strictMath = false; - } - } + + media.features = this.features.eval(context); context.mediaPath.push(media); context.mediaBlocks.push(media); @@ -7606,7 +7708,7 @@ Media.prototype.bubbleSelectors = function (selectors) { }; module.exports = Media; -},{"../utils":87,"./anonymous":47,"./atrule":49,"./expression":62,"./ruleset":80,"./selector":81,"./value":85}],70:[function(require,module,exports){ +},{"../utils":88,"./anonymous":48,"./atrule":50,"./expression":63,"./ruleset":80,"./selector":81,"./value":85}],71:[function(require,module,exports){ var Node = require("./node"), Selector = require("./selector"), MixinDefinition = require("./mixin-definition"), @@ -7792,7 +7894,7 @@ MixinCall.prototype.format = function (args) { }; module.exports = MixinCall; -},{"../functions/default":22,"./mixin-definition":71,"./node":73,"./selector":81}],71:[function(require,module,exports){ +},{"../functions/default":24,"./mixin-definition":72,"./node":74,"./selector":81}],72:[function(require,module,exports){ var Selector = require("./selector"), Element = require("./element"), Ruleset = require("./ruleset"), @@ -7838,7 +7940,7 @@ Definition.prototype.accept = function (visitor) { } }; Definition.prototype.evalParams = function (context, mixinEnv, args, evaldArguments) { - /*jshint boss:true */ + /* jshint boss:true */ var frame = new Ruleset(null, null), varargs, arg, params = utils.copyArray(this.params), @@ -7951,7 +8053,7 @@ Definition.prototype.evalCall = function (context, args, important) { Definition.prototype.matchCondition = function (args, context) { if (this.condition && !this.condition.eval( new contexts.Eval(context, - [this.evalParams(context, /* the parameter variables*/ + [this.evalParams(context, /* the parameter variables */ new contexts.Eval(context, this.frames ? this.frames.concat(context.frames) : context.frames), args, [])] .concat(this.frames || []) // the parent namespace/mixin frames .concat(context.frames)))) { // the current environment frames @@ -7996,7 +8098,7 @@ Definition.prototype.matchArgs = function (args, context) { }; module.exports = Definition; -},{"../contexts":12,"../utils":87,"./declaration":57,"./element":61,"./expression":62,"./ruleset":80,"./selector":81}],72:[function(require,module,exports){ +},{"../contexts":12,"../utils":88,"./declaration":58,"./element":62,"./expression":63,"./ruleset":80,"./selector":81}],73:[function(require,module,exports){ var Node = require("./node"), Operation = require("./operation"), Dimension = require("./dimension"); @@ -8018,7 +8120,7 @@ Negative.prototype.eval = function (context) { }; module.exports = Negative; -},{"./dimension":59,"./node":73,"./operation":74}],73:[function(require,module,exports){ +},{"./dimension":60,"./node":74,"./operation":75}],74:[function(require,module,exports){ var Node = function() { this.parent = null; this.visibilityBlocks = undefined; @@ -8084,8 +8186,8 @@ Node.prototype._operate = function (context, op, a, b) { }; Node.prototype.fround = function(context, value) { var precision = context && context.numPrecision; - //add "epsilon" to ensure numbers like 1.000000005 (represented as 1.000000004999....) are properly rounded... - return (precision == null) ? value : Number((value + 2e-16).toFixed(precision)); + // add "epsilon" to ensure numbers like 1.000000005 (represented as 1.000000004999...) are properly rounded: + return (precision) ? Number((value + 2e-16).toFixed(precision)) : value; }; Node.compare = function (a, b) { /* returns: @@ -8145,13 +8247,13 @@ Node.prototype.removeVisibilityBlock = function () { } this.visibilityBlocks = this.visibilityBlocks - 1; }; -//Turns on node visibility - if called node will be shown in output regardless -//of whether it comes from import by reference or not +// Turns on node visibility - if called node will be shown in output regardless +// of whether it comes from import by reference or not Node.prototype.ensureVisibility = function () { this.nodeVisible = true; }; -//Turns off node visibility - if called node will NOT be shown in output regardless -//of whether it comes from import by reference or not +// Turns off node visibility - if called node will NOT be shown in output regardless +// of whether it comes from import by reference or not Node.prototype.ensureInvisibility = function () { this.nodeVisible = false; }; @@ -8177,7 +8279,7 @@ Node.prototype.copyVisibilityInfo = function(info) { }; module.exports = Node; -},{}],74:[function(require,module,exports){ +},{}],75:[function(require,module,exports){ var Node = require("./node"), Color = require("./color"), Dimension = require("./dimension"); @@ -8227,7 +8329,7 @@ Operation.prototype.genCSS = function (context, output) { module.exports = Operation; -},{"./color":52,"./dimension":59,"./node":73}],75:[function(require,module,exports){ +},{"./color":53,"./dimension":60,"./node":74}],76:[function(require,module,exports){ var Node = require("./node"); var Paren = function (node) { @@ -8245,7 +8347,7 @@ Paren.prototype.eval = function (context) { }; module.exports = Paren; -},{"./node":73}],76:[function(require,module,exports){ +},{"./node":74}],77:[function(require,module,exports){ var Node = require("./node"), Declaration = require("./declaration"); @@ -8317,7 +8419,7 @@ Property.prototype.find = function (obj, fun) { }; module.exports = Property; -},{"./declaration":57,"./node":73}],77:[function(require,module,exports){ +},{"./declaration":58,"./node":74}],78:[function(require,module,exports){ var Node = require("./node"), JsEvalNode = require("./js-eval-node"), Variable = require("./variable"), @@ -8330,7 +8432,7 @@ var Quoted = function (str, content, escaped, index, currentFileInfo) { this._index = index; this._fileInfo = currentFileInfo; }; -Quoted.prototype = new JsEvalNode(); +Quoted.prototype = new Node(); Quoted.prototype.type = "Quoted"; Quoted.prototype.genCSS = function (context, output) { if (!this.escaped) { @@ -8342,13 +8444,10 @@ Quoted.prototype.genCSS = function (context, output) { } }; Quoted.prototype.containsVariables = function() { - return this.value.match(/(`([^`]+)`)|@\{([\w-]+)\}/); + return this.value.match(/@\{([\w-]+)\}/); }; Quoted.prototype.eval = function (context) { var that = this, value = this.value; - var javascriptReplacement = function (_, exp) { - return String(that.evaluateJavaScript(exp, context)); - }; var variableReplacement = function (_, name) { var v = new Variable('@' + name, that.getIndex(), that.fileInfo()).eval(context, true); return (v instanceof Quoted) ? v.value : v.toCSS(); @@ -8365,7 +8464,6 @@ Quoted.prototype.eval = function (context) { } while (value !== evaluatedValue); return evaluatedValue; } - value = iterativeReplace(value, /`([^`]+)`/g, javascriptReplacement); value = iterativeReplace(value, /@\{([\w-]+)\}/g, variableReplacement); value = iterativeReplace(value, /\$\{([\w-]+)\}/g, propertyReplacement); return new Quoted(this.quote + value + this.quote, value, this.escaped, this.getIndex(), this.fileInfo()); @@ -8380,7 +8478,7 @@ Quoted.prototype.compare = function (other) { }; module.exports = Quoted; -},{"./js-eval-node":67,"./node":73,"./property":76,"./variable":86}],78:[function(require,module,exports){ +},{"./js-eval-node":68,"./node":74,"./property":77,"./variable":87}],79:[function(require,module,exports){ // Backwards compatibility shim for Rule (Declaration) var Declaration = require("./declaration"); @@ -8393,23 +8491,7 @@ Rule.prototype = Object.create(Declaration.prototype); Rule.prototype.constructor = Rule; module.exports = Rule; -},{"./declaration":57}],79:[function(require,module,exports){ -var Node = require("./node"), - Variable = require("./variable"); - -var RulesetCall = function (variable) { - this.variable = variable; - this.allowRoot = true; -}; -RulesetCall.prototype = new Node(); -RulesetCall.prototype.type = "RulesetCall"; -RulesetCall.prototype.eval = function (context) { - var detachedRuleset = new Variable(this.variable).eval(context); - return detachedRuleset.callEval(context); -}; -module.exports = RulesetCall; - -},{"./node":73,"./variable":86}],80:[function(require,module,exports){ +},{"./declaration":58}],80:[function(require,module,exports){ var Node = require("./node"), Declaration = require("./declaration"), Keyword = require("./keyword"), @@ -8534,7 +8616,7 @@ Ruleset.prototype.eval = function (context) { // Evaluate mixin calls. for (i = 0; (rule = rsRules[i]); i++) { if (rule.type === "MixinCall") { - /*jshint loopfunc:true */ + /* jshint loopfunc:true */ rules = rule.eval(context).filter(function(r) { if ((r instanceof Declaration) && r.variable) { // do not pollute the scope if the variable is @@ -8547,8 +8629,8 @@ Ruleset.prototype.eval = function (context) { rsRules.splice.apply(rsRules, [i, 1].concat(rules)); i += rules.length - 1; ruleset.resetCache(); - } else if (rule.type === "RulesetCall") { - /*jshint loopfunc:true */ + } else if (rule.type === "VariableCall") { + /* jshint loopfunc:true */ rules = rule.eval(context).rules.filter(function(r) { if ((r instanceof Declaration) && r.variable) { // do not pollute the scope at all @@ -8941,7 +9023,7 @@ Ruleset.prototype.joinSelector = function (paths, context, selector) { // our new selector path newSelectorPath = []; - //construct the joined selector - if & is the first thing this will be empty, + // construct the joined selector - if & is the first thing this will be empty, // if not newJoinedSelector will be the last set of elements in the selector if (beginningPath.length > 0) { newSelectorPath = utils.copyArray(beginningPath); @@ -8971,7 +9053,7 @@ Ruleset.prototype.joinSelector = function (paths, context, selector) { newSelectorPath.push(newJoinedSelector); } - //put together the parent selectors after the join (e.g. the rest of the parent) + // put together the parent selectors after the join (e.g. the rest of the parent) if (addPath.length > 1) { var restOfPath = addPath.slice(1); restOfPath = restOfPath.map(function (selector) { @@ -9066,7 +9148,7 @@ Ruleset.prototype.joinSelector = function (paths, context, selector) { var nestedPaths = [], replaced, replacedNewSelectors = []; replaced = replaceParentSelector(nestedPaths, context, nestedSelector); hadParentSelector = hadParentSelector || replaced; - //the nestedPaths array should have only one member - replaceParentSelector does not multiply selectors + // the nestedPaths array should have only one member - replaceParentSelector does not multiply selectors for (k = 0; k < nestedPaths.length; k++) { var replacementSelector = createSelector(createParenthesis(nestedPaths[k], el), el); addAllReplacementsIntoPath(newSelectors, [replacementSelector], el, inSelector, replacedNewSelectors); @@ -9169,7 +9251,7 @@ Ruleset.prototype.joinSelector = function (paths, context, selector) { }; module.exports = Ruleset; -},{"../contexts":12,"../functions/default":22,"../functions/function-registry":24,"../utils":87,"./anonymous":47,"./comment":54,"./debug-info":56,"./declaration":57,"./element":61,"./keyword":68,"./node":73,"./paren":75,"./selector":81}],81:[function(require,module,exports){ +},{"../contexts":12,"../functions/default":24,"../functions/function-registry":26,"../utils":88,"./anonymous":48,"./comment":55,"./debug-info":57,"./declaration":58,"./element":62,"./keyword":69,"./node":74,"./paren":76,"./selector":81}],81:[function(require,module,exports){ var Node = require("./node"), Element = require("./element"), LessError = require("../less-error"); @@ -9177,12 +9259,11 @@ var Node = require("./node"), var Selector = function (elements, extendList, condition, index, currentFileInfo, visibilityInfo) { this.extendList = extendList; this.condition = condition; + this.evaldCondition = !condition; this._index = index; this._fileInfo = currentFileInfo; this.elements = this.getElements(elements); - if (!condition) { - this.evaldCondition = true; - } + this.mixinElements_ = undefined; this.copyVisibilityInfo(visibilityInfo); this.setParent(this.elements, this); }; @@ -9201,10 +9282,9 @@ Selector.prototype.accept = function (visitor) { }; Selector.prototype.createDerived = function(elements, extendList, evaldCondition) { elements = this.getElements(elements); - var info = this.visibilityInfo(); - evaldCondition = (evaldCondition != null) ? evaldCondition : this.evaldCondition; - var newSelector = new Selector(elements, extendList || this.extendList, null, this.getIndex(), this.fileInfo(), info); - newSelector.evaldCondition = evaldCondition; + var newSelector = new Selector(elements, extendList || this.extendList, + null, this.getIndex(), this.fileInfo(), this.visibilityInfo()); + newSelector.evaldCondition = (evaldCondition != null) ? evaldCondition : this.evaldCondition; newSelector.mediaEmpty = this.mediaEmpty; return newSelector; }; @@ -9238,14 +9318,13 @@ Selector.prototype.match = function (other) { len = elements.length, olen, i; - other.cacheElements(); - - olen = other._elements.length; + other = other.mixinElements(); + olen = other.length; if (olen === 0 || len < olen) { return 0; } else { for (i = 0; i < olen; i++) { - if (elements[i].value !== other._elements[i]) { + if (elements[i].value !== other[i]) { return 0; } } @@ -9253,9 +9332,9 @@ Selector.prototype.match = function (other) { return olen; // return number of matched elements }; -Selector.prototype.cacheElements = function() { - if (this._elements) { - return; +Selector.prototype.mixinElements = function() { + if (this.mixinElements_) { + return this.mixinElements_; } var elements = this.elements.map( function(v) { @@ -9270,7 +9349,7 @@ Selector.prototype.cacheElements = function() { elements = []; } - this._elements = elements; + return (this.mixinElements_ = elements); }; Selector.prototype.isJustParentSelector = function() { return !this.mediaEmpty && @@ -9292,12 +9371,9 @@ Selector.prototype.genCSS = function (context, output) { if ((!context || !context.firstSelector) && this.elements[0].combinator.value === "") { output.add(' ', this.fileInfo(), this.getIndex()); } - if (!this._css) { - //TODO caching? speed comparison? - for (i = 0; i < this.elements.length; i++) { - element = this.elements[i]; - element.genCSS(context, output); - } + for (i = 0; i < this.elements.length; i++) { + element = this.elements[i]; + element.genCSS(context, output); } }; Selector.prototype.getIsOutput = function() { @@ -9305,7 +9381,7 @@ Selector.prototype.getIsOutput = function() { }; module.exports = Selector; -},{"../less-error":34,"./element":61,"./node":73}],82:[function(require,module,exports){ +},{"../less-error":36,"./element":62,"./node":74}],82:[function(require,module,exports){ var Node = require("./node"); var UnicodeDescriptor = function (value) { @@ -9316,7 +9392,7 @@ UnicodeDescriptor.prototype.type = "UnicodeDescriptor"; module.exports = UnicodeDescriptor; -},{"./node":73}],83:[function(require,module,exports){ +},{"./node":74}],83:[function(require,module,exports){ var Node = require("./node"), unitConversions = require("../data/unit-conversions"), utils = require("../utils"); @@ -9384,7 +9460,7 @@ Unit.prototype.usedUnits = function() { var group, result = {}, mapUnit, groupName; mapUnit = function (atomicUnit) { - /*jshint loopfunc:true */ + /* jshint loopfunc:true */ if (group.hasOwnProperty(atomicUnit) && !result[groupName]) { result[groupName] = atomicUnit; } @@ -9439,7 +9515,7 @@ Unit.prototype.cancel = function () { }; module.exports = Unit; -},{"../data/unit-conversions":15,"../utils":87,"./node":73}],84:[function(require,module,exports){ +},{"../data/unit-conversions":15,"../utils":88,"./node":74}],84:[function(require,module,exports){ var Node = require("./node"); var URL = function (val, index, currentFileInfo, isEvald) { @@ -9495,7 +9571,7 @@ URL.prototype.eval = function (context) { }; module.exports = URL; -},{"./node":73}],85:[function(require,module,exports){ +},{"./node":74}],85:[function(require,module,exports){ var Node = require("./node"); var Value = function (value) { @@ -9536,7 +9612,23 @@ Value.prototype.genCSS = function (context, output) { }; module.exports = Value; -},{"./node":73}],86:[function(require,module,exports){ +},{"./node":74}],86:[function(require,module,exports){ +var Node = require("./node"), + Variable = require("./variable"); + +var VariableCall = function (variable) { + this.variable = variable; + this.allowRoot = true; +}; +VariableCall.prototype = new Node(); +VariableCall.prototype.type = "VariableCall"; +VariableCall.prototype.eval = function (context) { + var detachedRuleset = new Variable(this.variable).eval(context); + return detachedRuleset.callEval(context); +}; +module.exports = VariableCall; + +},{"./node":74,"./variable":87}],87:[function(require,module,exports){ var Node = require("./node"); var Variable = function (name, index, currentFileInfo) { @@ -9591,7 +9683,7 @@ Variable.prototype.find = function (obj, fun) { }; module.exports = Variable; -},{"./node":73}],87:[function(require,module,exports){ +},{"./node":74}],88:[function(require,module,exports){ /* jshint proto: true */ module.exports = { getLocation: function(index, inputStream) { @@ -9621,6 +9713,45 @@ module.exports = { } return copy; }, + clone: function (obj) { + var cloned = {}; + for (var prop in obj) { + if (obj.hasOwnProperty(prop)) { + cloned[prop] = obj[prop]; + } + } + return cloned; + }, + defaults: function(obj1, obj2) { + if (!obj2._defaults || obj2._defaults !== obj1) { + for (var prop in obj1) { + if (obj1.hasOwnProperty(prop)) { + if (!obj2.hasOwnProperty(prop)) { + obj2[prop] = obj1[prop]; + } + else if (Array.isArray(obj1[prop]) + && Array.isArray(obj2[prop])) { + + obj1[prop].forEach(function(p) { + if (obj2[prop].indexOf(p) === -1) { + obj2[prop].push(p); + } + }); + } + } + } + } + obj2._defaults = obj1; + return obj2; + }, + merge: function(obj1, obj2) { + for (var prop in obj2) { + if (obj2.hasOwnProperty(prop)) { + obj1[prop] = obj2[prop]; + } + } + return obj1; + }, getPrototype: function(obj) { if (Object.getPrototypeOf) { return Object.getPrototypeOf(obj); @@ -9636,13 +9767,13 @@ module.exports = { } }; -},{}],88:[function(require,module,exports){ +},{}],89:[function(require,module,exports){ var tree = require("../tree"), Visitor = require("./visitor"), logger = require("../logger"), utils = require("../utils"); -/*jshint loopfunc:true */ +/* jshint loopfunc:true */ var ExtendFinderVisitor = function() { this._visitor = new Visitor(this); @@ -9776,7 +9907,7 @@ ProcessExtendsVisitor.prototype = { iterationCount = iterationCount || 0; - //loop through comparing every extend with every target extend. + // loop through comparing every extend with every target extend. // a target extend is the one on the ruleset we are looking at copy/edit/pasting in place // e.g. .a:extend(.b) {} and .b:extend(.c) {} then the first extend extends the second one // and the second is the target. @@ -10007,7 +10138,7 @@ ProcessExtendsVisitor.prototype = { }, extendSelector:function (matches, selectorPath, replacementSelector, isVisible) { - //for a set of matches, replace each match with the replacement selector + // for a set of matches, replace each match with the replacement selector var currentSelectorPathIndex = 0, currentSelectorPathElementIndex = 0, @@ -10099,7 +10230,7 @@ ProcessExtendsVisitor.prototype = { module.exports = ProcessExtendsVisitor; -},{"../logger":35,"../tree":65,"../utils":87,"./visitor":95}],89:[function(require,module,exports){ +},{"../logger":37,"../tree":66,"../utils":88,"./visitor":96}],90:[function(require,module,exports){ function ImportSequencer(onSequencerEmpty) { this.imports = []; this.variableImports = []; @@ -10155,7 +10286,7 @@ ImportSequencer.prototype.tryRun = function() { module.exports = ImportSequencer; -},{}],90:[function(require,module,exports){ +},{}],91:[function(require,module,exports){ var contexts = require("../contexts"), Visitor = require("./visitor"), ImportSequencer = require("./import-sequencer"), @@ -10347,7 +10478,7 @@ ImportVisitor.prototype = { }; module.exports = ImportVisitor; -},{"../contexts":12,"../utils":87,"./import-sequencer":89,"./visitor":95}],91:[function(require,module,exports){ +},{"../contexts":12,"../utils":88,"./import-sequencer":90,"./visitor":96}],92:[function(require,module,exports){ var visitors = { Visitor: require("./visitor"), ImportVisitor: require('./import-visitor'), @@ -10359,7 +10490,7 @@ var visitors = { module.exports = visitors; -},{"./extend-visitor":88,"./import-visitor":90,"./join-selector-visitor":92,"./set-tree-visibility-visitor":93,"./to-css-visitor":94,"./visitor":95}],92:[function(require,module,exports){ +},{"./extend-visitor":89,"./import-visitor":91,"./join-selector-visitor":93,"./set-tree-visibility-visitor":94,"./to-css-visitor":95,"./visitor":96}],93:[function(require,module,exports){ var Visitor = require("./visitor"); var JoinSelectorVisitor = function() { @@ -10412,7 +10543,7 @@ JoinSelectorVisitor.prototype = { module.exports = JoinSelectorVisitor; -},{"./visitor":95}],93:[function(require,module,exports){ +},{"./visitor":96}],94:[function(require,module,exports){ var SetTreeVisibilityVisitor = function(visible) { this.visible = visible; }; @@ -10451,7 +10582,7 @@ SetTreeVisibilityVisitor.prototype.visit = function(node) { return node; }; module.exports = SetTreeVisibilityVisitor; -},{}],94:[function(require,module,exports){ +},{}],95:[function(require,module,exports){ var tree = require("../tree"), Visitor = require("./visitor"); @@ -10463,14 +10594,14 @@ var CSSVisitorUtils = function(context) { CSSVisitorUtils.prototype = { containsSilentNonBlockedChild: function(bodyRules) { var rule; - if (bodyRules == null) { + if (!bodyRules) { return false; } for (var r = 0; r < bodyRules.length; r++) { rule = bodyRules[r]; if (rule.isSilent && rule.isSilent(this._context) && !rule.blocksVisibility()) { - //the atrule contains something that was referenced (likely by extend) - //therefore it needs to be shown in output too + // the atrule contains something that was referenced (likely by extend) + // therefore it needs to be shown in output too return true; } } @@ -10478,28 +10609,21 @@ CSSVisitorUtils.prototype = { }, keepOnlyVisibleChilds: function(owner) { - if (owner == null || owner.rules == null) { - return ; + if (owner && owner.rules) { + owner.rules = owner.rules.filter(function(thing) { + return thing.isVisible(); + }); } - - owner.rules = owner.rules.filter(function(thing) { - return thing.isVisible(); - } - ); }, isEmpty: function(owner) { - if (owner == null || owner.rules == null) { - return true; - } - return owner.rules.length === 0; + return (owner && owner.rules) + ? (owner.rules.length === 0) : true; }, hasVisibleSelector: function(rulesetNode) { - if (rulesetNode == null || rulesetNode.paths == null) { - return false; - } - return rulesetNode.paths.length > 0; + return (rulesetNode && rulesetNode.paths) + ? (rulesetNode.paths.length > 0) : false; }, resolveVisibility: function (node, originalRules) { @@ -10600,9 +10724,16 @@ ToCSSVisitor.prototype = { } }, + visitAnonymous: function(anonymousNode, visitArgs) { + if (!anonymousNode.blocksVisibility()) { + anonymousNode.accept(this._visitor); + return anonymousNode; + } + }, + visitAtRuleWithBody: function(atRuleNode, visitArgs) { - //if there is only one nested ruleset and that one has no path, then it is - //just fake ruleset + // if there is only one nested ruleset and that one has no path, then it is + // just fake ruleset function hasFakeRuleset(atRuleNode) { var bodyRules = atRuleNode.rules; return bodyRules.length === 1 && (!bodyRules[0].paths || bodyRules[0].paths.length === 0); @@ -10615,9 +10746,9 @@ ToCSSVisitor.prototype = { return nodeRules; } - //it is still true that it is only one ruleset in array - //this is last such moment - //process childs + // it is still true that it is only one ruleset in array + // this is last such moment + // process childs var originalRules = getBodyRules(atRuleNode); atRuleNode.accept(this._visitor); visitArgs.visitDeeper = false; @@ -10675,13 +10806,13 @@ ToCSSVisitor.prototype = { }, visitRuleset: function (rulesetNode, visitArgs) { - //at this point rulesets are nested into each other + // at this point rulesets are nested into each other var rule, rulesets = []; this.checkValidNodes(rulesetNode.rules, rulesetNode.firstRoot); if (!rulesetNode.root) { - //remove invisible paths + // remove invisible paths this._compileRulesetPaths(rulesetNode); // remove rulesets from this ruleset body and compile them separately @@ -10707,7 +10838,7 @@ ToCSSVisitor.prototype = { } visitArgs.visitDeeper = false; - } else { //if (! rulesetNode.root) { + } else { // if (! rulesetNode.root) { rulesetNode.accept(this._visitor); visitArgs.visitDeeper = false; } @@ -10717,7 +10848,7 @@ ToCSSVisitor.prototype = { this._removeDuplicateRules(rulesetNode.rules); } - //now decide whether we keep the ruleset + // now decide whether we keep the ruleset if (this.utils.isVisibleRuleset(rulesetNode)) { rulesetNode.ensureVisibility(); rulesets.splice(0, 0, rulesetNode); @@ -10775,78 +10906,45 @@ ToCSSVisitor.prototype = { } }, - _mergeRules: function (rules) { - if (!rules) { return; } - - var groups = {}, - parts, - rule, - key; + _mergeRules: function(rules) { + if (!rules) { + return; + } + var groups = {}, + groupsArr = []; + for (var i = 0; i < rules.length; i++) { - rule = rules[i]; - - if ((rule instanceof tree.Declaration) && rule.merge) { - key = [rule.name, - rule.important ? "!" : ""].join(","); - - if (!groups[key]) { - groups[key] = []; - } else { - rules.splice(i--, 1); - } - + var rule = rules[i]; + if (rule.merge) { + var key = rule.name; + groups[key] ? rules.splice(i--, 1) : + groupsArr.push(groups[key] = []); groups[key].push(rule); } } - Object.keys(groups).map(function (k) { - - function toExpression(values) { - return new (tree.Expression)(values.map(function (p) { - return p.value; - })); - } - - function toValue(values) { - return new (tree.Value)(values.map(function (p) { - return p; - })); - } - - parts = groups[k]; - - if (parts.length > 1) { - rule = parts[0]; - var spacedGroups = []; - var lastSpacedGroup = []; - parts.map(function (p) { - if (p.merge === "+") { - if (lastSpacedGroup.length > 0) { - spacedGroups.push(toExpression(lastSpacedGroup)); - } - lastSpacedGroup = []; + groupsArr.forEach(function(group) { + if (group.length > 0) { + var result = group[0], + space = [], + comma = [new tree.Expression(space)]; + group.forEach(function(rule) { + if ((rule.merge === '+') && (space.length > 0)) { + comma.push(new tree.Expression(space = [])); } - lastSpacedGroup.push(p); + space.push(rule.value); + result.important = result.important || rule.important; }); - spacedGroups.push(toExpression(lastSpacedGroup)); - rule.value = toValue(spacedGroups); + result.value = new tree.Value(comma); } }); - }, - - visitAnonymous: function(anonymousNode, visitArgs) { - if (anonymousNode.blocksVisibility()) { - return ; - } - anonymousNode.accept(this._visitor); - return anonymousNode; } }; module.exports = ToCSSVisitor; -},{"../tree":65,"./visitor":95}],95:[function(require,module,exports){ +},{"../tree":66,"./visitor":96}],96:[function(require,module,exports){ var tree = require("../tree"); var _visitArgs = { visitDeeper: true }, @@ -10860,7 +10958,7 @@ function indexNodeTypes(parent, ticker) { // add .typeIndex to tree node types for lookup table var key, child; for (key in parent) { - /*eslint guard-for-in: 0 */ + /* eslint guard-for-in: 0 */ child = parent[key]; switch (typeof child) { case "function": @@ -11000,7 +11098,7 @@ Visitor.prototype = { }; module.exports = Visitor; -},{"../tree":65}],96:[function(require,module,exports){ +},{"../tree":66}],97:[function(require,module,exports){ "use strict"; // rawAsap provides everything we need except exception management. @@ -11068,7 +11166,7 @@ RawTask.prototype.call = function () { } }; -},{"./raw":97}],97:[function(require,module,exports){ +},{"./raw":98}],98:[function(require,module,exports){ (function (global){ "use strict"; @@ -11148,9 +11246,12 @@ function flush() { // Safari 6 and 6.1 for desktop, iPad, and iPhone are the only browsers that // have WebKitMutationObserver but not un-prefixed MutationObserver. -// Must use `global` instead of `window` to work in both frames and web +// Must use `global` or `self` instead of `window` to work in both frames and web // workers. `global` is a provision of Browserify, Mr, Mrs, or Mop. -var BrowserMutationObserver = global.MutationObserver || global.WebKitMutationObserver; + +/* globals self */ +var scope = typeof global !== "undefined" ? global : self; +var BrowserMutationObserver = scope.MutationObserver || scope.WebKitMutationObserver; // MutationObservers are desirable because they have high priority and work // reliably everywhere they are implemented. @@ -11292,7 +11393,7 @@ rawAsap.makeRequestCallFromTimer = makeRequestCallFromTimer; // https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],98:[function(require,module,exports){ +},{}],99:[function(require,module,exports){ 'use strict'; var asap = require('asap/raw'); @@ -11351,17 +11452,17 @@ function Promise(fn) { throw new TypeError('Promises must be constructed via new'); } if (typeof fn !== 'function') { - throw new TypeError('not a function'); + throw new TypeError('Promise constructor\'s argument is not a function'); } - this._45 = 0; - this._81 = 0; - this._65 = null; - this._54 = null; + this._40 = 0; + this._65 = 0; + this._55 = null; + this._72 = null; if (fn === noop) return; doResolve(fn, this); } -Promise._10 = null; -Promise._97 = null; +Promise._37 = null; +Promise._87 = null; Promise._61 = noop; Promise.prototype.then = function(onFulfilled, onRejected) { @@ -11379,26 +11480,26 @@ function safeThen(self, onFulfilled, onRejected) { res.then(resolve, reject); handle(self, new Handler(onFulfilled, onRejected, res)); }); -}; +} function handle(self, deferred) { - while (self._81 === 3) { - self = self._65; + while (self._65 === 3) { + self = self._55; } - if (Promise._10) { - Promise._10(self); + if (Promise._37) { + Promise._37(self); } - if (self._81 === 0) { - if (self._45 === 0) { - self._45 = 1; - self._54 = deferred; + if (self._65 === 0) { + if (self._40 === 0) { + self._40 = 1; + self._72 = deferred; return; } - if (self._45 === 1) { - self._45 = 2; - self._54 = [self._54, deferred]; + if (self._40 === 1) { + self._40 = 2; + self._72 = [self._72, deferred]; return; } - self._54.push(deferred); + self._72.push(deferred); return; } handleResolved(self, deferred); @@ -11406,16 +11507,16 @@ function handle(self, deferred) { function handleResolved(self, deferred) { asap(function() { - var cb = self._81 === 1 ? deferred.onFulfilled : deferred.onRejected; + var cb = self._65 === 1 ? deferred.onFulfilled : deferred.onRejected; if (cb === null) { - if (self._81 === 1) { - resolve(deferred.promise, self._65); + if (self._65 === 1) { + resolve(deferred.promise, self._55); } else { - reject(deferred.promise, self._65); + reject(deferred.promise, self._55); } return; } - var ret = tryCallOne(cb, self._65); + var ret = tryCallOne(cb, self._55); if (ret === IS_ERROR) { reject(deferred.promise, LAST_ERROR); } else { @@ -11443,8 +11544,8 @@ function resolve(self, newValue) { then === self.then && newValue instanceof Promise ) { - self._81 = 3; - self._65 = newValue; + self._65 = 3; + self._55 = newValue; finale(self); return; } else if (typeof then === 'function') { @@ -11452,29 +11553,29 @@ function resolve(self, newValue) { return; } } - self._81 = 1; - self._65 = newValue; + self._65 = 1; + self._55 = newValue; finale(self); } function reject(self, newValue) { - self._81 = 2; - self._65 = newValue; - if (Promise._97) { - Promise._97(self, newValue); + self._65 = 2; + self._55 = newValue; + if (Promise._87) { + Promise._87(self, newValue); } finale(self); } function finale(self) { - if (self._45 === 1) { - handle(self, self._54); - self._54 = null; + if (self._40 === 1) { + handle(self, self._72); + self._72 = null; } - if (self._45 === 2) { - for (var i = 0; i < self._54.length; i++) { - handle(self, self._54[i]); + if (self._40 === 2) { + for (var i = 0; i < self._72.length; i++) { + handle(self, self._72[i]); } - self._54 = null; + self._72 = null; } } @@ -11500,14 +11601,14 @@ function doResolve(fn, promise) { if (done) return; done = true; reject(promise, reason); - }) + }); if (!done && res === IS_ERROR) { done = true; reject(promise, LAST_ERROR); } } -},{"asap/raw":97}],99:[function(require,module,exports){ +},{"asap/raw":98}],100:[function(require,module,exports){ 'use strict'; //This file contains the ES6 extensions to the core Promises/A+ API @@ -11527,8 +11628,8 @@ var EMPTYSTRING = valuePromise(''); function valuePromise(value) { var p = new Promise(Promise._61); - p._81 = 1; - p._65 = value; + p._65 = 1; + p._55 = value; return p; } Promise.resolve = function (value) { @@ -11565,11 +11666,11 @@ Promise.all = function (arr) { function res(i, val) { if (val && (typeof val === 'object' || typeof val === 'function')) { if (val instanceof Promise && val.then === Promise.prototype.then) { - while (val._81 === 3) { - val = val._65; + while (val._65 === 3) { + val = val._55; } - if (val._81 === 1) return res(i, val._65); - if (val._81 === 2) reject(val._65); + if (val._65 === 1) return res(i, val._55); + if (val._65 === 2) reject(val._55); val.then(function (val) { res(i, val); }, reject); @@ -11616,7 +11717,7 @@ Promise.prototype['catch'] = function (onRejected) { return this.then(null, onRejected); }; -},{"./core.js":98}],100:[function(require,module,exports){ +},{"./core.js":99}],101:[function(require,module,exports){ // should work in any browser without browserify if (typeof Promise.prototype.done !== 'function') { @@ -11629,7 +11730,7 @@ if (typeof Promise.prototype.done !== 'function') { }) } } -},{}],101:[function(require,module,exports){ +},{}],102:[function(require,module,exports){ // not "use strict" so we can declare global "Promise" var asap = require('asap'); @@ -11641,5 +11742,5 @@ if (typeof Promise === 'undefined') { require('./polyfill-done.js'); -},{"./lib/core.js":98,"./lib/es6-extensions.js":99,"./polyfill-done.js":100,"asap":96}]},{},[2])(2) +},{"./lib/core.js":99,"./lib/es6-extensions.js":100,"./polyfill-done.js":101,"asap":97}]},{},[2])(2) }); \ No newline at end of file diff --git a/dist/less.min.js b/dist/less.min.js index a4ddf9e1..0ab42469 100644 --- a/dist/less.min.js +++ b/dist/less.min.js @@ -1,5 +1,5 @@ /*! - * Less - Leaner CSS v3.0.0-alpha.1 + * Less - Leaner CSS v3.0.0-alpha.3 * http://lesscss.org * * Copyright (c) 2009-2017, Alexis Sellier @@ -10,8 +10,8 @@ /** * @license Apache-2.0 */ -!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.less=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g0||b.isFileProtocol?"development":"production");var c=/!dumpLineNumbers:(comments|mediaquery|all)/.exec(a.location.hash);c&&(b.dumpLineNumbers=c[1]),void 0===b.useFileCache&&(b.useFileCache=!0),void 0===b.onReady&&(b.onReady=!0),b.javascriptEnabled=!(!b.javascriptEnabled&&!b.inlineJavaScript)}},{"./browser":3,"./utils":11}],2:[function(a,b,c){function d(a){a.filename&&console.warn(a),e.async||h.removeChild(i)}a("promise/polyfill");var e=window.less||{};a("./add-default-options")(window,e);var f=b.exports=a("./index")(window,e);window.less=f;var g,h,i;e.onReady&&(/!watch/.test(window.location.hash)&&f.watch(),e.async||(g="body { display: none !important }",h=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style"),i.type="text/css",i.styleSheet?i.styleSheet.cssText=g:i.appendChild(document.createTextNode(g)),h.appendChild(i)),f.registerStylesheetsImmediately(),f.pageLoadFinished=f.refresh("development"===f.env).then(d,d))},{"./add-default-options":1,"./index":8,"promise/polyfill":101}],3:[function(a,b,c){var d=a("./utils");b.exports={createCSS:function(a,b,c){var e=c.href||"",f="less:"+(c.title||d.extractId(e)),g=a.getElementById(f),h=!1,i=a.createElement("style");i.setAttribute("type","text/css"),c.media&&i.setAttribute("media",c.media),i.id=f,i.styleSheet||(i.appendChild(a.createTextNode(b)),h=null!==g&&g.childNodes.length>0&&i.childNodes.length>0&&g.firstChild.nodeValue===i.firstChild.nodeValue);var j=a.getElementsByTagName("head")[0];if(null===g||h===!1){var k=c&&c.nextSibling||null;k?k.parentNode.insertBefore(i,k):j.appendChild(i)}if(g&&h===!1&&g.parentNode.removeChild(g),i.styleSheet)try{i.styleSheet.cssText=b}catch(l){throw new Error("Couldn't reassign styleSheet.cssText.")}},currentScript:function(a){var b=a.document;return b.currentScript||function(){var a=b.getElementsByTagName("script");return a[a.length-1]}()}}},{"./utils":11}],4:[function(a,b,c){b.exports=function(a,b,c){var d=null;if("development"!==b.env)try{d="undefined"==typeof a.localStorage?null:a.localStorage}catch(e){}return{setCSS:function(a,b,e,f){if(d){c.info("saving "+a+" to cache.");try{d.setItem(a,f),d.setItem(a+":timestamp",b),e&&d.setItem(a+":vars",JSON.stringify(e))}catch(g){c.error('failed to save "'+a+'" to local storage for caching.')}}},getCSS:function(a,b,c){var e=d&&d.getItem(a),f=d&&d.getItem(a+":timestamp"),g=d&&d.getItem(a+":vars");if(c=c||{},f&&b.lastModified&&new Date(b.lastModified).valueOf()===new Date(f).valueOf()&&(!c&&!g||JSON.stringify(c)===g))return e}}}},{}],5:[function(a,b,c){var d=a("./utils"),e=a("./browser");b.exports=function(a,b,c){function f(b,f){var g,h,i="less-error-message:"+d.extractId(f||""),j='
  • {content}
  • ',k=a.document.createElement("div"),l=[],m=b.filename||f,n=m.match(/([^\/]+(\?.*)?)$/)[1];k.id=i,k.className="less-error-message",h="

    "+(b.type||"Syntax")+"Error: "+(b.message||"There is an error in your .less file")+'

    in '+n+" ";var o=function(a,b,c){void 0!==a.extract[b]&&l.push(j.replace(/\{line\}/,(parseInt(a.line,10)||0)+(b-1)).replace(/\{class\}/,c).replace(/\{content\}/,a.extract[b]))};b.line&&(o(b,0,""),o(b,1,"line"),o(b,2,""),h+="on line "+b.line+", column "+(b.column+1)+":

      "+l.join("")+"
    "),b.stack&&(b.extract||c.logLevel>=4)&&(h+="
    Stack Trace
    "+b.stack.split("\n").slice(1).join("
    ")),k.innerHTML=h,e.createCSS(a.document,[".less-error-message ul, .less-error-message li {","list-style-type: none;","margin-right: 15px;","padding: 4px 0;","margin: 0;","}",".less-error-message label {","font-size: 12px;","margin-right: 15px;","padding: 4px 0;","color: #cc7777;","}",".less-error-message pre {","color: #dd6666;","padding: 4px 0;","margin: 0;","display: inline-block;","}",".less-error-message pre.line {","color: #ff0000;","}",".less-error-message h3 {","font-size: 20px;","font-weight: bold;","padding: 15px 0 5px 0;","margin: 0;","}",".less-error-message a {","color: #10a","}",".less-error-message .error {","color: red;","font-weight: bold;","padding-bottom: 2px;","border-bottom: 1px dashed red;","}"].join("\n"),{title:"error-message"}),k.style.cssText=["font-family: Arial, sans-serif","border: 1px solid #e00","background-color: #eee","border-radius: 5px","-webkit-border-radius: 5px","-moz-border-radius: 5px","color: #e00","padding: 15px","margin-bottom: 15px"].join(";"),"development"===c.env&&(g=setInterval(function(){var b=a.document,c=b.body;c&&(b.getElementById(i)?c.replaceChild(k,b.getElementById(i)):c.insertBefore(k,c.firstChild),clearInterval(g))},10))}function g(b){var c=a.document.getElementById("less-error-message:"+d.extractId(b));c&&c.parentNode.removeChild(c)}function h(a){}function i(a){c.errorReporting&&"html"!==c.errorReporting?"console"===c.errorReporting?h(a):"function"==typeof c.errorReporting&&c.errorReporting("remove",a):g(a)}function j(a,d){var e="{line} {content}",f=a.filename||d,g=[],h=(a.type||"Syntax")+"Error: "+(a.message||"There is an error in your .less file")+" in "+f,i=function(a,b,c){void 0!==a.extract[b]&&g.push(e.replace(/\{line\}/,(parseInt(a.line,10)||0)+(b-1)).replace(/\{class\}/,c).replace(/\{content\}/,a.extract[b]))};a.line&&(i(a,0,""),i(a,1,"line"),i(a,2,""),h+=" on line "+a.line+", column "+(a.column+1)+":\n"+g.join("\n")),a.stack&&(a.extract||c.logLevel>=4)&&(h+="\nStack Trace\n"+a.stack),b.logger.error(h)}function k(a,b){c.errorReporting&&"html"!==c.errorReporting?"console"===c.errorReporting?j(a,b):"function"==typeof c.errorReporting&&c.errorReporting("add",a,b):f(a,b)}return{add:k,remove:i}}},{"./browser":3,"./utils":11}],6:[function(a,b,c){b.exports=function(b,c){var d=a("../less/environment/abstract-file-manager.js"),e={},f=function(){};return f.prototype=new d,f.prototype.alwaysMakePathsAbsolute=function(){return!0},f.prototype.join=function(a,b){return a?this.extractUrlParts(b,a).path:b},f.prototype.doXHR=function(a,d,e,f){function g(b,c,d){b.status>=200&&b.status<300?c(b.responseText,b.getResponseHeader("Last-Modified")):"function"==typeof d&&d(b.status,a)}var h=new XMLHttpRequest,i=!b.isFileProtocol||b.fileAsync;"function"==typeof h.overrideMimeType&&h.overrideMimeType("text/css"),c.debug("XHR: Getting '"+a+"'"),h.open("GET",a,i),h.setRequestHeader("Accept",d||"text/x-less, text/css; q=0.9, */*; q=0.5"),h.send(null),b.isFileProtocol&&!b.fileAsync?0===h.status||h.status>=200&&h.status<300?e(h.responseText):f(h.status,a):i?h.onreadystatechange=function(){4==h.readyState&&g(h,e,f)}:g(h,e,f)},f.prototype.supports=function(a,b,c,d){return!0},f.prototype.clearFileCache=function(){e={}},f.prototype.loadFile=function(a,b,c,d,f){b&&!this.isPathAbsolute(a)&&(a=b+a),c=c||{};var g=this.extractUrlParts(a,window.location.href),h=g.url;if(c.useFileCache&&e[h])try{var i=e[h];f(null,{contents:i,filename:h,webInfo:{lastModified:new Date}})}catch(j){f({filename:h,message:"Error loading file "+h+" error was "+j.message})}else this.doXHR(h,c.mime,function(a,b){e[h]=a,f(null,{contents:a,filename:h,webInfo:{lastModified:b}})},function(a,b){f({type:"File",message:"'"+b+"' wasn't found ("+a+")",href:h})})},f}},{"../less/environment/abstract-file-manager.js":16}],7:[function(a,b,c){b.exports=function(){function b(){throw{type:"Runtime",message:"Image size functions are not supported in browser version of less"}}var c=a("./../less/functions/function-registry"),d={"image-size":function(a){return b(this,a),-1},"image-width":function(a){return b(this,a),-1},"image-height":function(a){return b(this,a),-1}};c.addMultiple(d)}},{"./../less/functions/function-registry":24}],8:[function(a,b,c){var d=a("./utils").addDataAttr,e=a("./browser");b.exports=function(b,c){function f(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function g(a,b){var c=Array.prototype.slice.call(arguments,2);return function(){var d=c.concat(Array.prototype.slice.call(arguments,0));return a.apply(b,d)}}function h(a){for(var b,d=l.getElementsByTagName("style"),e=0;e=c&&console.log(a)},info:function(a){b.logLevel>=d&&console.log(a)},warn:function(a){b.logLevel>=e&&console.warn(a)},error:function(a){b.logLevel>=f&&console.error(a)}}]);for(var g=0;g0&&(a=a.slice(0,b)),b=a.lastIndexOf("/"),b<0&&(b=a.lastIndexOf("\\")),b<0?"":a.slice(0,b+1)},d.prototype.tryAppendExtension=function(a,b){return/(\.[a-z]*$)|([\?;].*)$/.test(a)?a:a+b},d.prototype.tryAppendLessExtension=function(a){return this.tryAppendExtension(a,".less")},d.prototype.supportsSync=function(){return!1},d.prototype.alwaysMakePathsAbsolute=function(){return!1},d.prototype.isPathAbsolute=function(a){return/^(?:[a-z-]+:|\/|\\|#)/i.test(a)},d.prototype.join=function(a,b){return a?a+b:b},d.prototype.pathDiff=function(a,b){var c,d,e,f,g=this.extractUrlParts(a),h=this.extractUrlParts(b),i="";if(g.hostPart!==h.hostPart)return"";for(d=Math.max(h.directories.length,g.directories.length),c=0;c0&&(h.splice(c-1,2),c-=2)}return g.hostPart=f[1],g.directories=h,g.path=(f[1]||"")+h.join("/"),g.filename=f[4],g.fileUrl=g.path+(f[4]||""),g.url=g.fileUrl+(f[5]||""),g},b.exports=d},{}],17:[function(a,b,c){function d(a,b){throw new f({type:b||"Syntax",message:a})}var e=a("../functions/function-registry"),f=a("../less-error"),g=function(){};g.prototype.evalPlugin=function(a,b,c,d,f){var g,h,i,j,k,l,m;l=b.pluginManager,f&&(m="string"==typeof f?f:f.filename);var n=(new this.less.FileManager).extractUrlParts(m).filename;if(m&&(i=l.get(m))){this.trySetOptions(i,m,n,d);try{i.use&&i.use.call(this.context,i)}catch(o){return o.message="Error during @plugin call",new this.less.LessError(o,c,m)}return i}j={exports:{},pluginManager:l,fileInfo:f},k=j.exports,h=e.create();var p=function(a){i=a};try{g=new Function("module","require","registerPlugin","functions","tree","less","fileInfo",a),g(j,this.require,p,h,this.less.tree,this.less,f)}catch(o){return new this.less.LessError({message:"Parse error"},c,m)}if(i||(i=j.exports),i=this.validatePlugin(i,m,n),!i)return new this.less.LessError({message:"Not a valid plugin"});l.addPlugin(i,f.filename,h),i.functions=h.getLocalFunctions(),i.imports=c,i.filename=m,this.trySetOptions(i,m,n,d);try{i.use&&i.use.call(this.context,i)}catch(o){return o.message="Error during @plugin call",new this.less.LessError(o,c,m)}return i},g.prototype.trySetOptions=function(a,b,c,e){if(e){if(!a.setOptions)return d("Options have been provided but the plugin "+c+" does not support any options."),null;try{a.setOptions(e)}catch(f){return d("Error setting options on plugin "+c+"\n"+f.message),null}}},g.prototype.validatePlugin=function(a,b,c){return a?("function"==typeof a&&(a=new a),a.minVersion&&this.compareVersion(a.minVersion,this.less.version)<0?(d("Plugin "+c+" requires version "+this.versionToString(a.minVersion)),null):a):null},g.prototype.compareVersion=function(a,b){"string"==typeof a&&(a=a.match(/^(\d+)\.?(\d+)?\.?(\d+)?/),a.shift());for(var c=0;cparseInt(b[c])?-1:1;return 0},g.prototype.versionToString=function(a){for(var b="",c=0;c=0;h--){var i=g[h];if(i[f?"supportsSync":"supports"](a,b,c,e))return i}return null},e.prototype.addFileManager=function(a){this.fileManagers.push(a)},e.prototype.clearFileManagers=function(){this.fileManagers=[]},b.exports=e},{"../logger":35}],19:[function(a,b,c){function d(a,b,c){var d,f,g,h,i=b.alpha,j=c.alpha,k=[];g=j+i*(1-j);for(var l=0;l<3;l++)d=b.rgb[l]/255,f=c.rgb[l]/255,h=a(d,f),g&&(h=(j*f+i*(d-j*(d+f-h)))/g),k[l]=255*h;return new e(k,g)}var e=a("../tree/color"),f=a("./function-registry"),g={multiply:function(a,b){return a*b},screen:function(a,b){return a+b-a*b},overlay:function(a,b){return a*=2,a<=1?g.multiply(a,b):g.screen(a-1,b)},softlight:function(a,b){var c=1,d=a;return b>.5&&(d=1,c=a>.25?Math.sqrt(a):((16*a-12)*a+4)*a),a-(1-2*b)*d*(c-a)},hardlight:function(a,b){return g.overlay(b,a)},difference:function(a,b){return Math.abs(a-b)},exclusion:function(a,b){return a+b-2*a*b},average:function(a,b){return(a+b)/2},negation:function(a,b){return 1-Math.abs(a+b-1)}};for(var h in g)g.hasOwnProperty(h)&&(d[h]=d.bind(null,g[h]));f.addMultiple(d)},{"../tree/color":52,"./function-registry":24}],20:[function(a,b,c){function d(a){return Math.min(1,Math.max(0,a))}function e(a){return h.hsla(a.h,a.s,a.l,a.a)}function f(a){if(a instanceof i)return parseFloat(a.unit.is("%")?a.value/100:a.value);if("number"==typeof a)return a;throw{type:"Argument",message:"color functions take numbers as parameters"}}function g(a,b){return a instanceof i&&a.unit.is("%")?parseFloat(a.value*b/100):f(a)}var h,i=a("../tree/dimension"),j=a("../tree/color"),k=a("../tree/quoted"),l=a("../tree/anonymous"),m=a("./function-registry");h={rgb:function(a,b,c){return h.rgba(a,b,c,1)},rgba:function(a,b,c,d){var e=[a,b,c].map(function(a){return g(a,255)});return d=f(d),new j(e,d)},hsl:function(a,b,c){return h.hsla(a,b,c,1)},hsla:function(a,b,c,e){function g(a){return a=a<0?a+1:a>1?a-1:a,6*a<1?i+(j-i)*a*6:2*a<1?j:3*a<2?i+(j-i)*(2/3-a)*6:i}var i,j;return a=f(a)%360/360,b=d(f(b)),c=d(f(c)),e=d(f(e)),j=c<=.5?c*(b+1):c+b-c*b,i=2*c-j,h.rgba(255*g(a+1/3),255*g(a),255*g(a-1/3),e)},hsv:function(a,b,c){return h.hsva(a,b,c,1)},hsva:function(a,b,c,d){a=f(a)%360/360*360,b=f(b),c=f(c),d=f(d);var e,g;e=Math.floor(a/60%6),g=a/60-e;var i=[c,c*(1-b),c*(1-g*b),c*(1-(1-g)*b)],j=[[0,3,1],[2,0,1],[1,0,3],[1,2,0],[3,1,0],[0,1,2]];return h.rgba(255*i[j[e][0]],255*i[j[e][1]],255*i[j[e][2]],d)},hue:function(a){return new i(a.toHSL().h)},saturation:function(a){return new i(100*a.toHSL().s,"%")},lightness:function(a){return new i(100*a.toHSL().l,"%")},hsvhue:function(a){return new i(a.toHSV().h)},hsvsaturation:function(a){return new i(100*a.toHSV().s,"%")},hsvvalue:function(a){return new i(100*a.toHSV().v,"%")},red:function(a){return new i(a.rgb[0])},green:function(a){return new i(a.rgb[1])},blue:function(a){return new i(a.rgb[2])},alpha:function(a){return new i(a.toHSL().a)},luma:function(a){return new i(a.luma()*a.alpha*100,"%")},luminance:function(a){var b=.2126*a.rgb[0]/255+.7152*a.rgb[1]/255+.0722*a.rgb[2]/255;return new i(b*a.alpha*100,"%")},saturate:function(a,b,c){if(!a.rgb)return null;var f=a.toHSL();return f.s+="undefined"!=typeof c&&"relative"===c.value?f.s*b.value/100:b.value/100,f.s=d(f.s),e(f)},desaturate:function(a,b,c){var f=a.toHSL();return f.s-="undefined"!=typeof c&&"relative"===c.value?f.s*b.value/100:b.value/100,f.s=d(f.s),e(f)},lighten:function(a,b,c){var f=a.toHSL();return f.l+="undefined"!=typeof c&&"relative"===c.value?f.l*b.value/100:b.value/100,f.l=d(f.l),e(f)},darken:function(a,b,c){var f=a.toHSL();return f.l-="undefined"!=typeof c&&"relative"===c.value?f.l*b.value/100:b.value/100,f.l=d(f.l),e(f)},fadein:function(a,b,c){var f=a.toHSL();return f.a+="undefined"!=typeof c&&"relative"===c.value?f.a*b.value/100:b.value/100,f.a=d(f.a),e(f)},fadeout:function(a,b,c){var f=a.toHSL();return f.a-="undefined"!=typeof c&&"relative"===c.value?f.a*b.value/100:b.value/100,f.a=d(f.a),e(f)},fade:function(a,b){var c=a.toHSL();return c.a=b.value/100,c.a=d(c.a),e(c)},spin:function(a,b){var c=a.toHSL(),d=(c.h+b.value)%360;return c.h=d<0?360+d:d,e(c)},mix:function(a,b,c){a.toHSL&&b.toHSL||(console.log(b.type),console.dir(b)),c||(c=new i(50));var d=c.value/100,e=2*d-1,f=a.toHSL().a-b.toHSL().a,g=((e*f==-1?e:(e+f)/(1+e*f))+1)/2,h=1-g,k=[a.rgb[0]*g+b.rgb[0]*h,a.rgb[1]*g+b.rgb[1]*h,a.rgb[2]*g+b.rgb[2]*h],l=a.alpha*d+b.alpha*(1-d);return new j(k,l)},greyscale:function(a){return h.desaturate(a,new i(100))},contrast:function(a,b,c,d){if(!a.rgb)return null;"undefined"==typeof b&&(b=h.rgba(0,0,0,1)),"undefined"==typeof c&&(c=h.rgba(255,255,255,1));var e,f,g=a.luma(),i=b.luma(),j=c.luma();return e=g>i?(g+.05)/(i+.05):(i+.05)/(g+.05),f=g>j?(g+.05)/(j+.05):(j+.05)/(g+.05),e>f?b:c},argb:function(a){return new l(a.toARGB())},color:function(a){if(a instanceof k&&/^#([a-f0-9]{6}|[a-f0-9]{3})$/i.test(a.value))return new j(a.value.slice(1));if(a instanceof j||(a=j.fromKeyword(a.value)))return a.value=void 0,a;throw{type:"Argument",message:"argument must be a color keyword or 3/6 digit hex e.g. #FFF"}},tint:function(a,b){return h.mix(h.rgb(255,255,255),a,b)},shade:function(a,b){return h.mix(h.rgb(0,0,0),a,b)}},m.addMultiple(h)},{"../tree/anonymous":47,"../tree/color":52,"../tree/dimension":59,"../tree/quoted":77,"./function-registry":24}],21:[function(a,b,c){b.exports=function(b){var c=a("../tree/quoted"),d=a("../tree/url"),e=a("./function-registry"),f=function(a,b){return new d(b,a.index,a.currentFileInfo).eval(a.context)},g=a("../logger");e.add("data-uri",function(a,e){e||(e=a,a=null);var h=a&&a.value,i=e.value,j=this.currentFileInfo,k=j.relativeUrls?j.currentDirectory:j.entryPath,l=i.indexOf("#"),m="";l!==-1&&(m=i.slice(l),i=i.slice(0,l));var n=b.getFileManager(i,k,this.context,b,!0);if(!n)return f(this,e);var o=!1;if(a)o=/;base64$/.test(h);else{if(h=b.mimeLookup(i),"image/svg+xml"===h)o=!1;else{var p=b.charsetLookup(h);o=["US-ASCII","UTF-8"].indexOf(p)<0}o&&(h+=";base64")}var q=n.loadFileSync(i,k,this.context,b);if(!q.contents)return g.warn("Skipped data-uri embedding of "+i+" because file not found"),f(this,e||a);var r=q.contents;if(o&&!b.encodeBase64)return f(this,e);r=o?b.encodeBase64(r):encodeURIComponent(r);var s="data:"+h+","+r+m,t=32768;return s.length>=t&&this.context.ieCompat!==!1?(g.warn("Skipped data-uri embedding of "+i+" because its size ("+s.length+" characters) exceeds IE8-safe "+t+" characters!"),f(this,e||a)):new d(new c('"'+s+'"',s,(!1),this.index,this.currentFileInfo),this.index,this.currentFileInfo)})}},{"../logger":35,"../tree/quoted":77,"../tree/url":84,"./function-registry":24}],22:[function(a,b,c){var d=a("../tree/keyword"),e=a("./function-registry"),f={eval:function(){var a=this.value_,b=this.error_;if(b)throw b;if(null!=a)return a?d.True:d.False},value:function(a){this.value_=a},error:function(a){this.error_=a},reset:function(){this.value_=this.error_=null}};e.add("default",f.eval.bind(f)),b.exports=f},{"../tree/keyword":68,"./function-registry":24}],23:[function(a,b,c){var d=a("../tree/expression"),e=function(a,b,c,d){this.name=a.toLowerCase(),this.index=c,this.context=b,this.currentFileInfo=d,this.func=b.frames[0].functionRegistry.get(this.name)};e.prototype.isValid=function(){return Boolean(this.func)},e.prototype.call=function(a){return Array.isArray(a)&&(a=a.filter(function(a){return"Comment"!==a.type}).map(function(a){if("Expression"===a.type){var b=a.value.filter(function(a){return"Comment"!==a.type});return 1===b.length?b[0]:new d(b)}return a})),this.func.apply(this,a)},b.exports=e},{"../tree/expression":62}],24:[function(a,b,c){function d(a){return{_data:{},add:function(a,b){a=a.toLowerCase(),this._data.hasOwnProperty(a),this._data[a]=b},addMultiple:function(a){Object.keys(a).forEach(function(b){this.add(b,a[b])}.bind(this))},get:function(b){return this._data[b]||a&&a.get(b)},getLocalFunctions:function(){return this._data},inherit:function(){return d(this)},create:function(a){return d(a)}}}b.exports=d(null)},{}],25:[function(a,b,c){b.exports=function(b){var c={functionRegistry:a("./function-registry"),functionCaller:a("./function-caller")};return a("./default"),a("./color"),a("./color-blending"),a("./data-uri")(b),a("./math"),a("./number"),a("./string"),a("./svg")(b),a("./types"),c}},{"./color":20,"./color-blending":19,"./data-uri":21,"./default":22,"./function-caller":23,"./function-registry":24,"./math":27,"./number":28,"./string":29,"./svg":30,"./types":31}],26:[function(a,b,c){var d=a("../tree/dimension"),e=function(){};e._math=function(a,b,c){if(!(c instanceof d))throw{type:"Argument",message:"argument must be a number"};return null==b?b=c.unit:c=c.unify(),new d(a(parseFloat(c.value)),b)},b.exports=e},{"../tree/dimension":59}],27:[function(a,b,c){var d=a("./function-registry"),e=a("./math-helper.js"),f={ceil:null,floor:null,sqrt:null,abs:null,tan:"",sin:"",cos:"",atan:"rad",asin:"rad",acos:"rad" -};for(var g in f)f.hasOwnProperty(g)&&(f[g]=e._math.bind(null,Math[g],f[g]));f.round=function(a,b){var c="undefined"==typeof b?0:b.value;return e._math(function(a){return a.toFixed(c)},null,a)},d.addMultiple(f)},{"./function-registry":24,"./math-helper.js":26}],28:[function(a,b,c){var d=a("../tree/dimension"),e=a("../tree/anonymous"),f=a("./function-registry"),g=a("./math-helper.js"),h=function(a,b){switch(b=Array.prototype.slice.call(b),b.length){case 0:throw{type:"Argument",message:"one or more arguments required"}}var c,f,g,h,i,j,k,l,m=[],n={};for(c=0;ci.value)&&(m[f]=g);else{if(void 0!==k&&j!==k)throw{type:"Argument",message:"incompatible types"};n[j]=m.length,m.push(g)}else Array.isArray(b[c].value)&&Array.prototype.push.apply(b,Array.prototype.slice.call(b[c].value));return 1==m.length?m[0]:(b=m.map(function(a){return a.toCSS(this.context)}).join(this.context.compress?",":", "),new e((a?"min":"max")+"("+b+")"))};f.addMultiple({min:function(){return h(!0,arguments)},max:function(){return h(!1,arguments)},convert:function(a,b){return a.convertTo(b.value)},pi:function(){return new d(Math.PI)},mod:function(a,b){return new d(a.value%b.value,a.unit)},pow:function(a,b){if("number"==typeof a&&"number"==typeof b)a=new d(a),b=new d(b);else if(!(a instanceof d&&b instanceof d))throw{type:"Argument",message:"arguments must be numbers"};return new d(Math.pow(a.value,b.value),a.unit)},percentage:function(a){var b=g._math(function(a){return 100*a},"%",a);return b}})},{"../tree/anonymous":47,"../tree/dimension":59,"./function-registry":24,"./math-helper.js":26}],29:[function(a,b,c){var d=a("../tree/quoted"),e=a("../tree/anonymous"),f=a("../tree/javascript"),g=a("./function-registry");g.addMultiple({e:function(a){return new e(a instanceof f?a.evaluated:a.value)},escape:function(a){return new e(encodeURI(a.value).replace(/=/g,"%3D").replace(/:/g,"%3A").replace(/#/g,"%23").replace(/;/g,"%3B").replace(/\(/g,"%28").replace(/\)/g,"%29"))},replace:function(a,b,c,e){var f=a.value;return c="Quoted"===c.type?c.value:c.toCSS(),f=f.replace(new RegExp(b.value,e?e.value:""),c),new d(a.quote||"",f,a.escaped)},"%":function(a){for(var b=Array.prototype.slice.call(arguments,1),c=a.value,e=0;e",k=0;k";return j+="',j=encodeURIComponent(j),j="data:image/svg+xml,"+j,new g(new f("'"+j+"'",j,(!1),this.index,this.currentFileInfo),this.index,this.currentFileInfo)})}},{"../tree/color":52,"../tree/dimension":59,"../tree/expression":62,"../tree/quoted":77,"../tree/url":84,"./function-registry":24}],31:[function(a,b,c){var d=a("../tree/keyword"),e=a("../tree/detached-ruleset"),f=a("../tree/dimension"),g=a("../tree/color"),h=a("../tree/quoted"),i=a("../tree/anonymous"),j=a("../tree/url"),k=a("../tree/operation"),l=a("./function-registry"),m=function(a,b){return a instanceof b?d.True:d.False},n=function(a,b){if(void 0===b)throw{type:"Argument",message:"missing the required second argument to isunit."};if(b="string"==typeof b.value?b.value:b,"string"!=typeof b)throw{type:"Argument",message:"Second argument to isunit should be a unit or a string."};return a instanceof f&&a.unit.is(b)?d.True:d.False},o=function(a){var b=Array.isArray(a.value)?a.value:Array(a);return b};l.addMultiple({isruleset:function(a){return m(a,e)},iscolor:function(a){return m(a,g)},isnumber:function(a){return m(a,f)},isstring:function(a){return m(a,h)},iskeyword:function(a){return m(a,d)},isurl:function(a){return m(a,j)},ispixel:function(a){return n(a,"px")},ispercentage:function(a){return n(a,"%")},isem:function(a){return n(a,"em")},isunit:n,unit:function(a,b){if(!(a instanceof f))throw{type:"Argument",message:"the first argument to unit must be a number"+(a instanceof k?". Have you forgotten parenthesis?":"")};return b=b?b instanceof d?b.value:b.toCSS():"",new f(a.value,b)},"get-unit":function(a){return new i(a.unit)},extract:function(a,b){return b=b.value-1,o(a)[b]},length:function(a){return new f(o(a).length)}})},{"../tree/anonymous":47,"../tree/color":52,"../tree/detached-ruleset":58,"../tree/dimension":59,"../tree/keyword":68,"../tree/operation":74,"../tree/quoted":77,"../tree/url":84,"./function-registry":24}],32:[function(a,b,c){var d=a("./contexts"),e=a("./parser/parser"),f=a("./less-error");b.exports=function(a){var b=function(a,b,c){this.less=a,this.rootFilename=c.filename,this.paths=b.paths||[],this.contents={},this.contentsIgnoredChars={},this.mime=b.mime,this.error=null,this.context=b,this.queue=[],this.files={}};return b.prototype.push=function(b,c,g,h,i){var j=this,k=this.context.pluginManager.Loader;this.queue.push(b);var l=function(a,c,d){j.queue.splice(j.queue.indexOf(b),1);var e=d===j.rootFilename;h.optional&&a?i(null,{rules:[]},!1,null):(j.files[d]=c,a&&!j.error&&(j.error=a),i(a,c,e,d))},m={relativeUrls:this.context.relativeUrls,entryPath:g.entryPath,rootpath:g.rootpath,rootFilename:g.rootFilename},n=a.getFileManager(b,g.currentDirectory,this.context,a);if(!n)return void l({message:"Could not find a file-manager for "+b});c&&(b=h.isPlugin?b:n.tryAppendExtension(b,".less"));var o,p=function(a){var b,c=a.filename,i=a.contents.replace(/^\uFEFF/,"");m.currentDirectory=n.getPath(c),m.relativeUrls&&(m.rootpath=n.join(j.context.rootpath||"",n.pathDiff(m.currentDirectory,m.entryPath)),!n.isPathAbsolute(m.rootpath)&&n.alwaysMakePathsAbsolute()&&(m.rootpath=n.join(m.entryPath,m.rootpath))),m.filename=c;var o=new d.Parse(j.context);o.processImports=!1,j.contents[c]=i,(g.reference||h.reference)&&(m.reference=!0),h.isPlugin?(b=k.evalPlugin(i,o,j,h.pluginArgs,m),b instanceof f?l(b,null,c):l(null,b,c)):h.inline?l(null,i,c):new e(o,j,m).parse(i,function(a,b){l(a,b,c)})},q=function(a,b){a?l(a):p(b)};if(h.isPlugin)try{k.tryLoadPlugin(b,g.currentDirectory,q)}catch(r){i(r)}else o=n.loadFile(b,g.currentDirectory,this.context,a,q),o&&o.then(p,l)},b}},{"./contexts":12,"./less-error":34,"./parser/parser":40}],33:[function(a,b,c){b.exports=function(b,c){var d,e,f,g,h,i,j={version:[3,0,0],data:a("./data"),tree:a("./tree"),Environment:h=a("./environment/environment"),AbstractFileManager:a("./environment/abstract-file-manager"),AbstractPluginLoader:a("./environment/abstract-plugin-loader"),environment:b=new h(b,c),visitors:a("./visitors"),Parser:a("./parser/parser"),functions:a("./functions")(b),contexts:a("./contexts"),SourceMapOutput:d=a("./source-map-output")(b),SourceMapBuilder:e=a("./source-map-builder")(d,b),ParseTree:f=a("./parse-tree")(e),ImportManager:g=a("./import-manager")(b),render:a("./render")(b,f,g),parse:a("./parse")(b,f,g),LessError:a("./less-error"),transformTree:a("./transform-tree"),utils:a("./utils"),PluginManager:a("./plugin-manager"),logger:a("./logger")},k=function(a){return function(){var b=Object.create(a.prototype);return a.apply(b,Array.prototype.slice.call(arguments,0)),b}},l=Object.create(j);for(var m in j.tree)if(i=j.tree[m],"function"==typeof i)l[m]=k(i);else{l[m]=Object.create(null);for(var n in i)l[m][n]=k(i[n])}return l}},{"./contexts":12,"./data":14,"./environment/abstract-file-manager":16,"./environment/abstract-plugin-loader":17,"./environment/environment":18,"./functions":25,"./import-manager":32,"./less-error":34,"./logger":35,"./parse":37,"./parse-tree":36,"./parser/parser":40,"./plugin-manager":41,"./render":42,"./source-map-builder":43,"./source-map-output":44,"./transform-tree":45,"./tree":65,"./utils":87,"./visitors":91}],34:[function(a,b,c){var d=a("./utils"),e=b.exports=function(a,b,c){Error.call(this);var e=a.filename||c;if(this.message=a.message,this.stack=a.stack,b&&e){var f=b.contents[e],g=d.getLocation(a.index,f),h=g.line,i=g.column,j=a.call&&d.getLocation(a.call,f).line,k=f.split("\n");if(this.type=a.type||"Syntax",this.filename=e,this.index=a.index,this.line="number"==typeof h?h+1:null,this.column=i,!this.line&&this.stack){var l=this.stack.match(/(|Function):(\d+):(\d+)/);l&&(l[2]&&(this.line=parseInt(l[2])-2),l[3]&&(this.column=parseInt(l[3])))}this.callLine=j+1,this.callExtract=k[j],this.extract=[k[this.line-2],k[this.line-1],k[this.line]]}};if("undefined"==typeof Object.create){var f=function(){};f.prototype=Error.prototype,e.prototype=new f}else e.prototype=Object.create(Error.prototype);e.prototype.constructor=e,e.prototype.toString=function(a){a=a||{};var b="",c=this.extract||[],d=[],e=function(a){return a};if(a.stylize){var f=typeof a.stylize;if("function"!==f)throw Error("options.stylize should be a function, got a "+f+"!");e=a.stylize}if(null!==this.line){if("string"==typeof c[0]&&d.push(e(this.line-1+" "+c[0],"grey")),"string"==typeof c[1]){var g=this.line+" ";c[1]&&(g+=c[1].slice(0,this.column)+e(e(e(c[1].substr(this.column,1),"bold")+c[1].slice(this.column+1),"red"),"inverse")),d.push(g)}"string"==typeof c[2]&&d.push(e(this.line+1+" "+c[2],"grey")),d=d.join("\n")+e("","reset")+"\n"}return b+=e(this.type+"Error: "+this.message,"red"),this.filename&&(b+=e(" in ","red")+this.filename),this.line&&(b+=e(" on line "+this.line+", column "+(this.column+1)+":","grey")),b+="\n"+d,this.callLine&&(b+=e("from ","red")+(this.filename||"")+"/n",b+=e(this.callLine,"grey")+" "+this.callExtract+"/n"),b}},{"./utils":87}],35:[function(a,b,c){b.exports={error:function(a){this._fireEvent("error",a)},warn:function(a){this._fireEvent("warn",a)},info:function(a){this._fireEvent("info",a)},debug:function(a){this._fireEvent("debug",a)},addListener:function(a){this._listeners.push(a)},removeListener:function(a){for(var b=0;b=97&&j<=122||j<34))switch(j){case 40:o++,e=h;continue;case 41:if(--o<0)return b("missing opening `(`",h);continue;case 59:o||c();continue;case 123:n++,d=h;continue;case 125:if(--n<0)return b("missing opening `{`",h);n||o||c();continue;case 92:if(h96)){if(k==j){l=1;break}if(92==k){if(h==m-1)return b("unescaped `\\`",h);h++}}if(l)continue;return b("unmatched `"+String.fromCharCode(j)+"`",i);case 47:if(o||h==m-1)continue;if(k=a.charCodeAt(h+1),47==k)for(h+=2;hd&&g>f?b("missing closing `}` or `*/`",d):b("missing closing `}`",d):0!==o?b("missing closing `)`",e):(c(!0),p)}},{}],39:[function(a,b,c){var d=a("./chunker");b.exports=function(){function a(d){for(var e,f,j,p=k.i,q=c,s=k.i-i,t=k.i+h.length-s,u=k.i+=d,v=b;k.i=0){j={index:k.i,text:v.substr(k.i,x+2-k.i),isLineComment:!1},k.i+=j.text.length-1,k.commentStore.push(j);continue}}break}if(e!==l&&e!==n&&e!==m&&e!==o)break}if(h=h.slice(d+k.i-u+s),i=k.i,!h.length){if(ce||k.i===e&&a&&!f)&&(e=k.i,f=a);var b=j.pop();h=b.current,i=k.i=b.i,c=b.j},k.forget=function(){j.pop()},k.isWhitespace=function(a){var c=k.i+(a||0),d=b.charCodeAt(c);return d===l||d===o||d===m||d===n},k.$re=function(b){k.i>i&&(h=h.slice(k.i-i),i=k.i);var c=b.exec(h);return c?(a(c[0].length),"string"==typeof c?c:1===c.length?c[0]:c):null},k.$char=function(c){return b.charAt(k.i)!==c?null:(a(1),c)},k.$str=function(c){for(var d=c.length,e=0;es||a=b.length;return k.i=b.length-1,furthestChar:b[k.i]}},k}},{"./chunker":38}],40:[function(a,b,c){var d=a("../less-error"),e=a("../tree"),f=a("../visitors"),g=a("./parser-input"),h=a("../utils"),i=function j(a,b,c){function i(a,e){throw new d({index:p.i,filename:c.filename,type:e||"Syntax",message:a},b)}function k(a,b,c){var d=a instanceof Function?a.call(o):p.$re(a);return d?d:void i(b||("string"==typeof a?"expected '"+a+"' got '"+p.currentChar()+"'":"unexpected token"))}function l(a,b){return p.$char(a)?a:void i(b||"expected '"+a+"' got '"+p.currentChar()+"'")}function m(a){var b=c.filename;return{lineNumber:h.getLocation(a,p.getInput()).line+1,fileName:b}}function n(a,c,e,f,g){var h,i=[],j=p;try{j.start(a,!1,function(a,b){g({message:a,index:b+e})});for(var k,l,m=0;k=c[m];m++)l=j.i,h=o[k](),h?(h._index=l+e,h._fileInfo=f,i.push(h)):i.push(null);var n=j.end();n.isFinished?g(null,i):g(!0,null)}catch(q){throw new d({index:q.index+e,message:q.message},b,f.filename)}}var o,p=g();return{parserInput:p,imports:b,fileInfo:c,parseNode:n,parse:function(g,h,i){var k,l,m,n,o=null,q="";if(l=i&&i.globalVars?j.serializeVars(i.globalVars)+"\n":"",m=i&&i.modifyVars?"\n"+j.serializeVars(i.modifyVars):"",a.pluginManager)for(var r=a.pluginManager.getPreProcessors(),s=0;s1&&(b=new e.Value(g)),d.push(b),g=[])}return p.forget(),a?d:f},literal:function(){return this.dimension()||this.color()||this.quoted()||this.unicodeDescriptor()},assignment:function(){var a,b;return p.save(),(a=p.$re(/^\w+(?=\s?=)/i))&&p.$char("=")&&(b=o.entity())?(p.forget(),new e.Assignment(a,b)):void p.restore()},url:function(){var a,b=p.i;return p.autoCommentAbsorb=!1,p.$str("url(")?(a=this.quoted()||this.variable()||this.property()||p.$re(/^(?:(?:\\[\(\)'"])|[^\(\)'"])+/)||"",p.autoCommentAbsorb=!0,l(")"),new e.URL(null!=a.value||a instanceof e.Variable||a instanceof e.Property?a:new e.Anonymous(a,b),b,c)):void(p.autoCommentAbsorb=!0)},variable:function(){var a,b=p.i;if("@"===p.currentChar()&&(a=p.$re(/^@@?[\w-]+/)))return new e.Variable(a,b,c)},variableCurly:function(){var a,b=p.i;if("@"===p.currentChar()&&(a=p.$re(/^@\{([\w-]+)\}/)))return new e.Variable("@"+a[1],b,c)},property:function(){var a,b=p.i;if("$"===p.currentChar()&&(a=p.$re(/^\$[\w-]+/)))return new e.Property(a,b,c)},propertyCurly:function(){var a,b=p.i;if("$"===p.currentChar()&&(a=p.$re(/^\$\{([\w-]+)\}/)))return new e.Property("$"+a[1],b,c)},color:function(){var a;if("#"===p.currentChar()&&(a=p.$re(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/))){var b=a.input.match(/^#([\w]+).*/);return b=b[1],b.match(/^[A-Fa-f0-9]+$/)||i("Invalid HEX color code"),new e.Color(a[1],(void 0),"#"+b)}},colorKeyword:function(){p.save();var a=p.autoCommentAbsorb;p.autoCommentAbsorb=!1;var b=p.$re(/^[_A-Za-z-][_A-Za-z0-9-]+/);if(p.autoCommentAbsorb=a,!b)return void p.forget();p.restore();var c=e.Color.fromKeyword(b);return c?(p.$str(b),c):void 0},dimension:function(){if(!p.peekNotNumeric()){var a=p.$re(/^([+-]?\d*\.?\d+)(%|[a-z_]+)?/i);return a?new e.Dimension(a[1],a[2]):void 0}},unicodeDescriptor:function(){var a;if(a=p.$re(/^U\+[0-9a-fA-F?]+(\-[0-9a-fA-F?]+)?/))return new e.UnicodeDescriptor(a[0])},javascript:function(){var a,b=p.i;p.save();var d=p.$char("~"),f=p.$char("`");return f?(a=p.$re(/^[^`]*`/))?(p.forget(),new e.JavaScript(a.substr(0,a.length-1),Boolean(d),b,c)):void p.restore("invalid javascript definition"):void p.restore()}},variable:function(){var a;if("@"===p.currentChar()&&(a=p.$re(/^(@[\w-]+)\s*:/)))return a[1]},rulesetCall:function(){var a;if("@"===p.currentChar()&&(a=p.$re(/^(@[\w-]+)\(\s*\)\s*;/)))return new e.RulesetCall(a[1])},extend:function(a){var b,d,f,g,h,j=p.i;if(p.$str(a?"&:extend(":":extend(")){do{for(f=null,b=null;!(f=p.$re(/^(all)(?=\s*(\)|,))/))&&(d=this.element());)b?b.push(d):b=[d];f=f&&f[1],b||i("Missing target selector for :extend()."),h=new e.Extend(new e.Selector(b),f,j,c),g?g.push(h):g=[h]}while(p.$char(","));return k(/^\)/),a&&k(/^;/),g}},extendRule:function(){return this.extend(!0)},mixin:{call:function(){var a,b,d,f,g,h,i=p.currentChar(),j=!1,k=p.i;if("."===i||"#"===i){for(p.save();;){if(a=p.i,f=p.$re(/^[#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/),!f)break;d=new e.Element(g,f,a,c),b?b.push(d):b=[d],g=p.$char(">")}return b&&(p.$char("(")&&(h=this.args(!0).args,l(")")),o.important()&&(j=!0),o.end())?(p.forget(),new e.mixin.Call(b,h,k,c,j)):void p.restore()}},args:function(a){var b,c,d,f,g,h,j,k=o.entities,l={args:null,variadic:!1},m=[],n=[],q=[];for(p.save();;){if(a)h=o.detachedRuleset()||o.expression();else{if(p.commentStore.length=0,p.$str("...")){l.variadic=!0,p.$char(";")&&!b&&(b=!0),(b?n:q).push({variadic:!0});break}h=k.variable()||k.property()||k.literal()||k.keyword()}if(!h)break;f=null,h.throwAwayComments&&h.throwAwayComments(),g=h;var r=null;if(a?h.value&&1==h.value.length&&(r=h.value[0]):r=h,r&&(r instanceof e.Variable||r instanceof e.Property))if(p.$char(":")){if(m.length>0&&(b&&i("Cannot mix ; and , as delimiter types"),c=!0),g=o.detachedRuleset()||o.expression(),!g){if(!a)return p.restore(),l.args=[],l;i("could not understand value for named argument")}f=d=r.name}else if(p.$str("...")){if(!a){l.variadic=!0,p.$char(";")&&!b&&(b=!0),(b?n:q).push({name:h.name,variadic:!0});break}j=!0}else a||(d=f=r.name,g=null);g&&m.push(g),q.push({name:f,value:g,expand:j}),p.$char(",")||(p.$char(";")||b)&&(c&&i("Cannot mix ; and , as delimiter types"),b=!0,m.length>1&&(g=new e.Value(m)),n.push({name:d,value:g,expand:j}),d=null,m=[],c=!1)}return p.forget(),l.args=b?n:q,l},definition:function(){var a,b,c,d,f=[],g=!1;if(!("."!==p.currentChar()&&"#"!==p.currentChar()||p.peek(/^[^{]*\}/)))if(p.save(),b=p.$re(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/)){a=b[1];var h=this.args(!1);if(f=h.args,g=h.variadic,!p.$char(")"))return void p.restore("Missing closing ')'");if(p.commentStore.length=0,p.$str("when")&&(d=k(o.conditions,"expected condition")),c=o.block())return p.forget(),new e.mixin.Definition(a,f,c,d,g);p.restore()}else p.forget()}},entity:function(){var a=this.entities;return this.comment()||a.literal()||a.variable()||a.url()||a.property()||a.call()||a.keyword()||a.javascript()},end:function(){return p.$char(";")||p.peek("}")},alpha:function(){var a;if(p.$re(/^opacity=/i))return a=p.$re(/^\d+/),a||(a=k(this.entities.variable,"Could not parse alpha")),l(")"),new e.Alpha(a)},element:function(){var a,b,d,f=p.i;if(b=this.combinator(),a=p.$re(/^(?:\d+\.\d+|\d+)%/)||p.$re(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/)||p.$char("*")||p.$char("&")||this.attribute()||p.$re(/^\([^&()@]+\)/)||p.$re(/^[\.#:](?=@)/)||this.entities.variableCurly(),a||(p.save(),p.$char("(")?(d=this.selector(!1))&&p.$char(")")?(a=new e.Paren(d),p.forget()):p.restore("Missing closing ')'"):p.forget()),a)return new e.Element(b,a,f,c)},combinator:function(){var a=p.currentChar();if("/"===a){p.save();var b=p.$re(/^\/[a-z]+\//i);if(b)return p.forget(),new e.Combinator(b);p.restore()}if(">"===a||"+"===a||"~"===a||"|"===a||"^"===a){for(p.i++,"^"===a&&"^"===p.currentChar()&&(a="^^",p.i++);p.isWhitespace();)p.i++;return new e.Combinator(a)}return new e.Combinator(p.isWhitespace(-1)?" ":null)},selector:function(a){var b,d,f,g,h,j,l,m=p.i;for(a=a!==!1;(a&&(d=this.extend())||a&&(j=p.$str("when"))||(g=this.element()))&&(j?l=k(this.conditions,"expected condition"):l?i("CSS guard can only be used at the end of selector"):d?h=h?h.concat(d):d:(h&&i("Extend can only be used at the end of selector"),f=p.currentChar(),b?b.push(g):b=[g],g=null),"{"!==f&&"}"!==f&&";"!==f&&","!==f&&")"!==f););return b?new e.Selector(b,h,l,m,c):void(h&&i("Extend must be used to extend a selector, it cannot be used on its own"))},attribute:function(){if(p.$char("[")){var a,b,c,d=this.entities;return(a=d.variableCurly())||(a=k(/^(?:[_A-Za-z0-9-\*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/)),c=p.$re(/^[|~*$^]?=/),c&&(b=d.quoted()||p.$re(/^[0-9]+%/)||p.$re(/^[\w-]+/)||d.variableCurly()),l("]"),new e.Attribute(a,c,b)}},block:function(){var a;if(p.$char("{")&&(a=this.primary())&&p.$char("}"))return a},blockRuleset:function(){var a=this.block();return a&&(a=new e.Ruleset(null,a)),a},detachedRuleset:function(){var a=this.blockRuleset();if(a)return new e.DetachedRuleset(a)},ruleset:function(){var b,c,d,f;for(p.save(),a.dumpLineNumbers&&(f=m(p.i));;){if(c=this.selector(),!c)break;if(b?b.push(c):b=[c],p.commentStore.length=0,c.condition&&b.length>1&&i("Guards are only currently allowed on a single selector."),!p.$char(","))break;c.condition&&i("Guards are only currently allowed on a single selector."),p.commentStore.length=0}if(b&&(d=this.block())){p.forget();var g=new e.Ruleset(b,d,a.strictImports);return a.dumpLineNumbers&&(g.debugInfo=f),g}p.restore()},declaration:function(){var a,b,d,f,g,h=p.i,i=p.currentChar();if("."!==i&&"#"!==i&&"&"!==i&&":"!==i)if(p.save(),a=this.variable()||this.ruleProperty()){if(g="string"==typeof a,g&&(b=this.detachedRuleset()),p.commentStore.length=0,!b){if(f=!g&&a.length>1&&a.pop().value,b=this.anonymousValue())return p.forget(),new e.Declaration(a,b,(!1),f,h,c);b||(b=this.value()),d=this.important()}if(b&&this.end())return p.forget(),new e.Declaration(a,b,d,f,h,c);p.restore()}else p.restore()},anonymousValue:function(){var a=p.i,b=p.$re(/^([^@\$+\/'"*`(;{}-]*);/);if(b)return new e.Anonymous(b[1],a)},"import":function(){var a,b,d=p.i,f=p.$re(/^@import?\s+/);if(f){var g=(f?this.importOptions():null)||{};if(a=this.entities.quoted()||this.entities.url())return b=this.mediaFeatures(),p.$char(";")||(p.i=d,i("missing semi-colon or unrecognised media features on import")),b=b&&new e.Value(b),new e.Import(a,b,g,d,c);p.i=d,i("malformed import statement")}},importOptions:function(){var a,b,c,d={};if(!p.$char("("))return null;do if(a=this.importOption()){switch(b=a,c=!0,b){case"css":b="less",c=!1;break;case"once":b="multiple",c=!1}if(d[b]=c,!p.$char(","))break}while(a);return l(")"),d},importOption:function(){var a=p.$re(/^(less|css|multiple|once|inline|reference|optional)/);if(a)return a[1]},mediaFeature:function(){var a,b,d=this.entities,f=[];p.save();do a=d.keyword()||d.variable(),a?f.push(a):p.$char("(")&&(b=this.property(),a=this.value(),p.$char(")")?b&&a?f.push(new e.Paren(new e.Declaration(b,a,null,null,p.i,c,(!0)))):a?f.push(new e.Paren(a)):i("badly formed media feature definition"):i("Missing closing ')'","Parse"));while(a);if(p.forget(),f.length>0)return new e.Expression(f)},mediaFeatures:function(){var a,b=this.entities,c=[];do if(a=this.mediaFeature()){if(c.push(a),!p.$char(","))break}else if(a=b.variable(),a&&(c.push(a),!p.$char(",")))break;while(a);return c.length>0?c:null},media:function(){var b,d,f,g,h=p.i;return a.dumpLineNumbers&&(g=m(h)),p.save(),p.$str("@media")?(b=this.mediaFeatures(),d=this.block(),d||i("media definitions require block statements after any features"),p.forget(),f=new e.Media(d,b,h,c),a.dumpLineNumbers&&(f.debugInfo=g),f):void p.restore()},plugin:function(){var a,b,d,f=p.i,g=p.$re(/^@plugin?\s+/);if(g){if(b=this.pluginArgs(),d=b?{pluginArgs:b,isPlugin:!0}:{isPlugin:!0},a=this.entities.quoted()||this.entities.url())return p.$char(";")||(p.i=f,i("missing semi-colon on @plugin")),new e.Import(a,null,d,f,c);p.i=f,i("malformed @plugin statement")}},pluginArgs:function(){if(p.save(),!p.$char("("))return p.restore(),null;var a=p.$re(/^\s*([^\);]+)\)\s*/);return a[1]?(p.forget(),a[1].trim()):(p.restore(),null)},atrule:function(){var b,d,f,g,h,j,k,l=p.i,n=!0,o=!0;if("@"===p.currentChar()){if(d=this["import"]()||this.plugin()||this.media())return d;if(p.save(),b=p.$re(/^@[a-z-]+/)){switch(g=b,"-"==b.charAt(1)&&b.indexOf("-",2)>0&&(g="@"+b.slice(b.indexOf("-",2)+1)),g){case"@charset":h=!0,n=!1;break;case"@namespace":j=!0,n=!1;break;case"@keyframes":case"@counter-style":h=!0;break;case"@document":case"@supports":k=!0,o=!1;break;default:k=!0}return p.commentStore.length=0,h?(d=this.entity(), -d||i("expected "+b+" identifier")):j?(d=this.expression(),d||i("expected "+b+" expression")):k&&(d=(p.$re(/^[^{;]+/)||"").trim(),n="{"==p.currentChar(),d&&(d=new e.Anonymous(d))),n&&(f=this.blockRuleset()),f||!n&&d&&p.$char(";")?(p.forget(),new e.AtRule(b,d,f,l,c,a.dumpLineNumbers?m(l):null,o)):void p.restore("at-rule options not recognised")}}},value:function(){var a,b=[],c=p.i;do if(a=this.expression(),a&&(b.push(a),!p.$char(",")))break;while(a);if(b.length>0)return new e.Value(b,c)},important:function(){if("!"===p.currentChar())return p.$re(/^! *important/)},sub:function(){var a,b;return p.save(),p.$char("(")?(a=this.addition(),a&&p.$char(")")?(p.forget(),b=new e.Expression([a]),b.parens=!0,b):void p.restore("Expected ')'")):void p.restore()},multiplication:function(){var a,b,c,d,f;if(a=this.operand()){for(f=p.isWhitespace(-1);;){if(p.peek(/^\/[*\/]/))break;if(p.save(),c=p.$char("/")||p.$char("*"),!c){p.forget();break}if(b=this.operand(),!b){p.restore();break}p.forget(),a.parensInOp=!0,b.parensInOp=!0,d=new e.Operation(c,[d||a,b],f),f=p.isWhitespace(-1)}return d||a}},addition:function(){var a,b,c,d,f;if(a=this.multiplication()){for(f=p.isWhitespace(-1);;){if(c=p.$re(/^[-+]\s+/)||!f&&(p.$char("+")||p.$char("-")),!c)break;if(b=this.multiplication(),!b)break;a.parensInOp=!0,b.parensInOp=!0,d=new e.Operation(c,[d||a,b],f),f=p.isWhitespace(-1)}return d||a}},conditions:function(){var a,b,c,d=p.i;if(a=this.condition()){for(;;){if(!p.peek(/^,\s*(not\s*)?\(/)||!p.$char(","))break;if(b=this.condition(),!b)break;c=new e.Condition("or",c||a,b,d)}return c||a}},condition:function(){function a(){return p.$str("or")}var b,c,d;if(b=this.conditionAnd(this)){if(c=a()){if(d=this.condition(),!d)return;b=new e.Condition(c,b,d)}return b}},conditionAnd:function(){function a(a){return a.negatedCondition()||a.parenthesisCondition()}function b(){return p.$str("and")}var c,d,f;if(c=a(this)){if(d=b()){if(f=this.conditionAnd(),!f)return;c=new e.Condition(d,c,f)}return c}},negatedCondition:function(){if(p.$str("not")){var a=this.parenthesisCondition();return a&&(a.negate=!a.negate),a}},parenthesisCondition:function(){function a(a){var b;return p.save(),(b=a.condition())&&p.$char(")")?(p.forget(),b):void p.restore()}var b;return p.save(),p.$str("(")?(b=a(this))?(p.forget(),b):(b=this.atomicCondition())?p.$char(")")?(p.forget(),b):void p.restore("expected ')' got '"+p.currentChar()+"'"):void p.restore():void p.restore()},atomicCondition:function(){var a,b,c,d,f=this.entities,g=p.i;if(a=this.addition()||f.keyword()||f.quoted())return p.$char(">")?d=p.$char("=")?">=":">":p.$char("<")?d=p.$char("=")?"<=":"<":p.$char("=")&&(d=p.$char(">")?"=>":p.$char("<")?"=<":"="),d?(b=this.addition()||f.keyword()||f.quoted(),b?c=new e.Condition(d,a,b,g,(!1)):i("expected expression")):c=new e.Condition("=",a,new e.Keyword("true"),g,(!1)),c},operand:function(){var a,b=this.entities;p.peek(/^-[@\$\(]/)&&(a=p.$char("-"));var c=this.sub()||b.dimension()||b.color()||b.variable()||b.property()||b.call()||b.colorKeyword();return a&&(c.parensInOp=!0,c=new e.Negative(c)),c},expression:function(){var a,b,c=[],d=p.i;do a=this.comment(),a?c.push(a):(a=this.addition()||this.entity(),a&&(c.push(a),p.peek(/^\/[\/*]/)||(b=p.$char("/"),b&&c.push(new e.Anonymous(b,d)))));while(a);if(c.length>0)return new e.Expression(c)},property:function(){var a=p.$re(/^(\*?-?[_a-zA-Z0-9-]+)\s*:/);if(a)return a[1]},ruleProperty:function(){function a(a){var b=p.i,c=p.$re(a);if(c)return g.push(b),f.push(c[1])}var b,d,f=[],g=[];p.save();var h=p.$re(/^([_a-zA-Z0-9-]+)\s*:/);if(h)return f=[new e.Keyword(h[1])],p.forget(),f;for(a(/^(\*?)/);;)if(!a(/^((?:[\w-]+)|(?:[@\$]\{[\w-]+\}))/))break;if(f.length>1&&a(/^((?:\+_|\+)?)\s*:/)){for(p.forget(),""===f[0]&&(f.shift(),g.shift()),d=0;d=b);c++);this.preProcessors.splice(c,0,{preProcessor:a,priority:b})},g.prototype.addPostProcessor=function(a,b){var c;for(c=0;c=b);c++);this.postProcessors.splice(c,0,{postProcessor:a,priority:b})},g.prototype.addFileManager=function(a){this.fileManagers.push(a)},g.prototype.getPreProcessors=function(){for(var a=[],b=0;b0){var d,e=JSON.stringify(this._sourceMapGenerator.toJSON());this.sourceMapURL?d=this.sourceMapURL:this._sourceMapFilename&&(d=this._sourceMapFilename),this.sourceMapURL=d,this.sourceMap=e}return this._css.join("")},b}},{}],45:[function(a,b,c){var d=a("./contexts"),e=a("./visitors"),f=a("./tree");b.exports=function(a,b){b=b||{};var c,g=b.variables,h=new d.Eval(b);"object"!=typeof g||Array.isArray(g)||(g=Object.keys(g).map(function(a){var b=g[a];return b instanceof f.Value||(b instanceof f.Expression||(b=new f.Expression([b])),b=new f.Value([b])),new f.Declaration("@"+a,b,(!1),null,0)}),h.frames=[new f.Ruleset(null,g)]);var i,j,k=[new e.JoinSelectorVisitor,new e.MarkVisibleSelectorsVisitor((!0)),new e.ExtendVisitor,new e.ToCSSVisitor({compress:Boolean(b.compress)})];if(b.pluginManager)for(j=b.pluginManager.visitor(),j.first();i=j.get();)i.isPreEvalVisitor&&i.run(a);c=a.eval(h);for(var l=0;l.5?j/(2-g-h):j/(g+h),g){case c:a=(d-e)/j+(d="===a||"=<"===a||"<="===a;case 1:return">"===a||">="===a;default:return!1}}}(this.op,this.lvalue.eval(a),this.rvalue.eval(a));return this.negate?!b:b},b.exports=e},{"./node":73}],56:[function(a,b,c){var d=function(a,b,c){var e="";if(a.dumpLineNumbers&&!a.compress)switch(a.dumpLineNumbers){case"comments":e=d.asComment(b);break;case"mediaquery":e=d.asMediaQuery(b);break;case"all":e=d.asComment(b)+(c||"")+d.asMediaQuery(b)}return e};d.asComment=function(a){return"/* line "+a.debugInfo.lineNumber+", "+a.debugInfo.fileName+" */\n"},d.asMediaQuery=function(a){var b=a.debugInfo.fileName;return/^[a-z]+:\/\//i.test(b)||(b="file://"+b),"@media -sass-debug-info{filename{font-family:"+b.replace(/([.:\/\\])/g,function(a){return"\\"==a&&(a="/"),"\\"+a})+"}line{font-family:\\00003"+a.debugInfo.lineNumber+"}}\n"},b.exports=d},{}],57:[function(a,b,c){function d(a,b){var c,d="",e=b.length,f={add:function(a){d+=a}};for(c=0;c-1e-6&&(d=c.toFixed(20).replace(/0+$/,"")),a&&a.compress){if(0===c&&this.unit.isLength())return void b.add(d);c>0&&c<1&&(d=d.substr(1))}b.add(d),this.unit.genCSS(a,b)},h.prototype.operate=function(a,b,c){var d=this._operate(a,b,this.value,c.value),e=this.unit.clone();if("+"===b||"-"===b)if(0===e.numerator.length&&0===e.denominator.length)e=c.unit.clone(),this.unit.backupUnit&&(e.backupUnit=this.unit.backupUnit);else if(0===c.unit.numerator.length&&0===e.denominator.length);else{if(c=c.convertTo(this.unit.usedUnits()),a.strictUnits&&c.unit.toString()!==e.toString())throw new Error("Incompatible units. Change the units or use the unit function. Bad units: '"+e.toString()+"' and '"+c.unit.toString()+"'.");d=this._operate(a,b,this.value,c.value)}else"*"===b?(e.numerator=e.numerator.concat(c.unit.numerator).sort(),e.denominator=e.denominator.concat(c.unit.denominator).sort(),e.cancel()):"/"===b&&(e.numerator=e.numerator.concat(c.unit.denominator).sort(),e.denominator=e.denominator.concat(c.unit.numerator).sort(),e.cancel());return new h(d,e)},h.prototype.compare=function(a){var b,c;if(a instanceof h){if(this.unit.isEmpty()||a.unit.isEmpty())b=this,c=a;else if(b=this.unify(),c=a.unify(),0!==b.unit.compare(c.unit))return;return d.numericCompare(b.value,c.value)}},h.prototype.unify=function(){return this.convertTo({length:"px",duration:"s",angle:"rad"})},h.prototype.convertTo=function(a){var b,c,d,f,g,i=this.value,j=this.unit.clone(),k={};if("string"==typeof a){for(b in e)e[b].hasOwnProperty(a)&&(k={},k[b]=a);a=k}g=function(a,b){return d.hasOwnProperty(a)?(b?i/=d[a]/d[f]:i*=d[a]/d[f],f):a};for(c in a)a.hasOwnProperty(c)&&(f=a[c],d=e[c],j.map(g));return j.cancel(),new h(i,j)},b.exports=h},{"../data/unit-conversions":15,"./color":52,"./node":73,"./unit":83}],60:[function(a,b,c){var d=a("./atrule"),e=function(){var a=Array.prototype.slice.call(arguments);d.apply(this,a)};e.prototype=Object.create(d.prototype),e.prototype.constructor=e,b.exports=e},{"./atrule":49}],61:[function(a,b,c){var d=a("./node"),e=a("./paren"),f=a("./combinator"),g=function(a,b,c,d,e){this.combinator=a instanceof f?a:new f(a),this.value="string"==typeof b?b.trim():b?b:"",this._index=c,this._fileInfo=d,this.copyVisibilityInfo(e),this.setParent(this.combinator,this)};g.prototype=new d,g.prototype.type="Element",g.prototype.accept=function(a){var b=this.value;this.combinator=a.visit(this.combinator),"object"==typeof b&&(this.value=a.visit(b))},g.prototype.eval=function(a){return new g(this.combinator,this.value.eval?this.value.eval(a):this.value,this.getIndex(),this.fileInfo(),this.visibilityInfo())},g.prototype.clone=function(){return new g(this.combinator,this.value,this.getIndex(),this.fileInfo(),this.visibilityInfo())},g.prototype.genCSS=function(a,b){b.add(this.toCSS(a),this.fileInfo(),this.getIndex())},g.prototype.toCSS=function(a){a=a||{};var b=this.value,c=a.firstSelector;return b instanceof e&&(a.firstSelector=!0),b=b.toCSS?b.toCSS(a):b,a.firstSelector=c,""===b&&"&"===this.combinator.value.charAt(0)?"":this.combinator.toCSS(a)+b},b.exports=g},{"./combinator":53,"./node":73,"./paren":75}],62:[function(a,b,c){var d=a("./node"),e=a("./paren"),f=a("./comment"),g=function(a){if(this.value=a,!a)throw new Error("Expression requires an array parameter")};g.prototype=new d,g.prototype.type="Expression",g.prototype.accept=function(a){this.value=a.visitArray(this.value)},g.prototype.eval=function(a){var b,c=this.parens&&!this.parensInOp,d=!1;return c&&a.inParenthesis(),this.value.length>1?b=new g(this.value.map(function(b){return b.eval(a)})):1===this.value.length?(this.value[0].parens&&!this.value[0].parensInOp&&(d=!0),b=this.value[0].eval(a)):b=this,c&&a.outOfParenthesis(),this.parens&&this.parensInOp&&!a.isMathOn()&&!d&&(b=new e(b)),b},g.prototype.genCSS=function(a,b){for(var c=0;c0&&c.length&&""===c[0].combinator.value&&(c[0].combinator.value=" "),d=d.concat(a[b].elements);this.selfSelectors=[new e(d)],this.selfSelectors[0].copyVisibilityInfo(this.visibilityInfo())},b.exports=f},{"./node":73,"./selector":81}],64:[function(a,b,c){var d=a("./node"),e=a("./media"),f=a("./url"),g=a("./quoted"),h=a("./ruleset"),i=a("./anonymous"),j=a("../utils"),k=a("../less-error"),l=function(a,b,c,d,e,f){if(this.options=c,this._index=d,this._fileInfo=e,this.path=a,this.features=b,this.allowRoot=!0,void 0!==this.options.less||this.options.inline)this.css=!this.options.less||this.options.inline;else{var g=this.getPath();g&&/[#\.\&\?]css([\?;].*)?$/.test(g)&&(this.css=!0)}this.copyVisibilityInfo(f),this.setParent(this.features,this),this.setParent(this.path,this)};l.prototype=new d,l.prototype.type="Import",l.prototype.accept=function(a){this.features&&(this.features=a.visit(this.features)),this.path=a.visit(this.path),this.options.isPlugin||this.options.inline||!this.root||(this.root=a.visit(this.root))},l.prototype.genCSS=function(a,b){this.css&&void 0===this.path._fileInfo.reference&&(b.add("@import ",this._fileInfo,this._index),this.path.genCSS(a,b),this.features&&(b.add(" "),this.features.genCSS(a,b)),b.add(";"))},l.prototype.getPath=function(){return this.path instanceof f?this.path.value.value:this.path.value},l.prototype.isVariableImport=function(){var a=this.path;return a instanceof f&&(a=a.value),!(a instanceof g)||a.containsVariables()},l.prototype.evalForImport=function(a){var b=this.path;return b instanceof f&&(b=b.value),new l(b.eval(a),this.features,this.options,this._index,this._fileInfo,this.visibilityInfo())},l.prototype.evalPath=function(a){var b=this.path.eval(a),c=this._fileInfo&&this._fileInfo.rootpath;if(!(b instanceof f)){if(c){var d=b.value;d&&a.isPathRelative(d)&&(b.value=c+d)}b.value=a.normalizePath(b.value)}return b},l.prototype.eval=function(a){var b=this.doEval(a);return(this.options.reference||this.blocksVisibility())&&(b.length||0===b.length?b.forEach(function(a){a.addVisibilityBlock()}):b.addVisibilityBlock()),b},l.prototype.doEval=function(a){var b,c,d=this.features&&this.features.eval(a);if(this.options.isPlugin){if(this.root&&this.root.eval)try{this.root.eval(a)}catch(f){throw f.message="Plugin error during evaluation",new k(f,this.root.imports,this.root.filename); -}return c=a.frames[0]&&a.frames[0].functionRegistry,c&&this.root&&this.root.functions&&c.addMultiple(this.root.functions),[]}if(this.skip&&("function"==typeof this.skip&&(this.skip=this.skip()),this.skip))return[];if(this.options.inline){var g=new i(this.root,0,{filename:this.importedFilename,reference:this.path._fileInfo&&this.path._fileInfo.reference},(!0),(!0));return this.features?new e([g],this.features.value):[g]}if(this.css){var m=new l(this.evalPath(a),d,this.options,this._index);if(!m.css&&this.error)throw this.error;return m}return b=new h(null,j.copyArray(this.root.rules)),b.evalImports(a),this.features?new e(b.rules,this.features.value):b.rules},b.exports=l},{"../less-error":34,"../utils":87,"./anonymous":47,"./media":69,"./node":73,"./quoted":77,"./ruleset":80,"./url":84}],65:[function(a,b,c){var d=Object.create(null);d.Node=a("./node"),d.Alpha=a("./alpha"),d.Color=a("./color"),d.AtRule=a("./atrule"),d.Directive=a("./directive"),d.DetachedRuleset=a("./detached-ruleset"),d.Operation=a("./operation"),d.Dimension=a("./dimension"),d.Unit=a("./unit"),d.Keyword=a("./keyword"),d.Variable=a("./variable"),d.Property=a("./property"),d.Ruleset=a("./ruleset"),d.Element=a("./element"),d.Attribute=a("./attribute"),d.Combinator=a("./combinator"),d.Selector=a("./selector"),d.Quoted=a("./quoted"),d.Expression=a("./expression"),d.Declaration=a("./declaration"),d.Rule=a("./rule"),d.Call=a("./call"),d.URL=a("./url"),d.Import=a("./import"),d.mixin={Call:a("./mixin-call"),Definition:a("./mixin-definition")},d.Comment=a("./comment"),d.Anonymous=a("./anonymous"),d.Value=a("./value"),d.JavaScript=a("./javascript"),d.Assignment=a("./assignment"),d.Condition=a("./condition"),d.Paren=a("./paren"),d.Media=a("./media"),d.UnicodeDescriptor=a("./unicode-descriptor"),d.Negative=a("./negative"),d.Extend=a("./extend"),d.RulesetCall=a("./ruleset-call"),b.exports=d},{"./alpha":46,"./anonymous":47,"./assignment":48,"./atrule":49,"./attribute":50,"./call":51,"./color":52,"./combinator":53,"./comment":54,"./condition":55,"./declaration":57,"./detached-ruleset":58,"./dimension":59,"./directive":60,"./element":61,"./expression":62,"./extend":63,"./import":64,"./javascript":66,"./keyword":68,"./media":69,"./mixin-call":70,"./mixin-definition":71,"./negative":72,"./node":73,"./operation":74,"./paren":75,"./property":76,"./quoted":77,"./rule":78,"./ruleset":80,"./ruleset-call":79,"./selector":81,"./unicode-descriptor":82,"./unit":83,"./url":84,"./value":85,"./variable":86}],66:[function(a,b,c){var d=a("./js-eval-node"),e=a("./dimension"),f=a("./quoted"),g=a("./anonymous"),h=function(a,b,c,d){this.escaped=b,this.expression=a,this._index=c,this._fileInfo=d};h.prototype=new d,h.prototype.type="JavaScript",h.prototype.eval=function(a){var b=this.evaluateJavaScript(this.expression,a);return"number"==typeof b?new e(b):"string"==typeof b?new f('"'+b+'"',b,this.escaped,this._index):new g(Array.isArray(b)?b.join(", "):b)},b.exports=h},{"./anonymous":47,"./dimension":59,"./js-eval-node":67,"./quoted":77}],67:[function(a,b,c){var d=a("./node"),e=a("./variable"),f=function(){};f.prototype=new d,f.prototype.evaluateJavaScript=function(a,b){var c,d=this,f={};if(!b.javascriptEnabled)throw{message:"Inline JavaScript is not enabled. Is it set in your options?",filename:this.fileInfo().filename,index:this.getIndex()};a=a.replace(/@\{([\w-]+)\}/g,function(a,c){return d.jsify(new e("@"+c,d.getIndex(),d.fileInfo()).eval(b))});try{a=new Function("return ("+a+")")}catch(g){throw{message:"JavaScript evaluation error: "+g.message+" from `"+a+"`",filename:this.fileInfo().filename,index:this.getIndex()}}var h=b.frames[0].variables();for(var i in h)h.hasOwnProperty(i)&&(f[i.slice(1)]={value:h[i].value,toJS:function(){return this.value.eval(b).toCSS()}});try{c=a.call(f)}catch(g){throw{message:"JavaScript evaluation error: '"+g.name+": "+g.message.replace(/["]/g,"'")+"'",filename:this.fileInfo().filename,index:this.getIndex()}}return c},f.prototype.jsify=function(a){return Array.isArray(a.value)&&a.value.length>1?"["+a.value.map(function(a){return a.toCSS()}).join(", ")+"]":a.toCSS()},b.exports=f},{"./node":73,"./variable":86}],68:[function(a,b,c){var d=a("./node"),e=function(a){this.value=a};e.prototype=new d,e.prototype.type="Keyword",e.prototype.genCSS=function(a,b){if("%"===this.value)throw{type:"Syntax",message:"Invalid % without number"};b.add(this.value)},e.True=new e("true"),e.False=new e("false"),b.exports=e},{"./node":73}],69:[function(a,b,c){var d=a("./ruleset"),e=a("./value"),f=a("./selector"),g=a("./anonymous"),h=a("./expression"),i=a("./atrule"),j=a("../utils"),k=function(a,b,c,g,h){this._index=c,this._fileInfo=g;var i=new f([],null,null,this._index,this._fileInfo).createEmptySelectors();this.features=new e(b),this.rules=[new d(i,a)],this.rules[0].allowImports=!0,this.copyVisibilityInfo(h),this.allowRoot=!0,this.setParent(i,this),this.setParent(this.features,this),this.setParent(this.rules,this)};k.prototype=new i,k.prototype.type="Media",k.prototype.isRulesetLike=function(){return!0},k.prototype.accept=function(a){this.features&&(this.features=a.visit(this.features)),this.rules&&(this.rules=a.visitArray(this.rules))},k.prototype.genCSS=function(a,b){b.add("@media ",this._fileInfo,this._index),this.features.genCSS(a,b),this.outputRuleset(a,b,this.rules)},k.prototype.eval=function(a){a.mediaBlocks||(a.mediaBlocks=[],a.mediaPath=[]);var b=new k(null,[],this._index,this._fileInfo,this.visibilityInfo());this.debugInfo&&(this.rules[0].debugInfo=this.debugInfo,b.debugInfo=this.debugInfo);var c=!1;a.strictMath||(c=!0,a.strictMath=!0);try{b.features=this.features.eval(a)}finally{c&&(a.strictMath=!1)}return a.mediaPath.push(b),a.mediaBlocks.push(b),this.rules[0].functionRegistry=a.frames[0].functionRegistry.inherit(),a.frames.unshift(this.rules[0]),b.rules=[this.rules[0].eval(a)],a.frames.shift(),a.mediaPath.pop(),0===a.mediaPath.length?b.evalTop(a):b.evalNested(a)},k.prototype.evalTop=function(a){var b=this;if(a.mediaBlocks.length>1){var c=new f([],null,null,this.getIndex(),this.fileInfo()).createEmptySelectors();b=new d(c,a.mediaBlocks),b.multiMedia=!0,b.copyVisibilityInfo(this.visibilityInfo()),this.setParent(b,this)}return delete a.mediaBlocks,delete a.mediaPath,b},k.prototype.evalNested=function(a){var b,c,f=a.mediaPath.concat([this]);for(b=0;b0;b--)a.splice(b,0,new g("and"));return new h(a)})),this.setParent(this.features,this),new d([],[])},k.prototype.permute=function(a){if(0===a.length)return[];if(1===a.length)return a[0];for(var b=[],c=this.permute(a.slice(1)),d=0;d0){for(n=!0,k=0;k0)p=B;else if(p=A,q[A]+q[B]>1)throw{type:"Runtime",message:"Ambiguous use of `default()` found when matching for `"+this.format(t)+"`",index:this.getIndex(),filename:this.fileInfo().filename};for(k=0;kthis.params.length)return!1}c=Math.min(f,this.arity);for(var g=0;gb?1:void 0},d.prototype.blocksVisibility=function(){return null==this.visibilityBlocks&&(this.visibilityBlocks=0),0!==this.visibilityBlocks},d.prototype.addVisibilityBlock=function(){null==this.visibilityBlocks&&(this.visibilityBlocks=0),this.visibilityBlocks=this.visibilityBlocks+1},d.prototype.removeVisibilityBlock=function(){null==this.visibilityBlocks&&(this.visibilityBlocks=0),this.visibilityBlocks=this.visibilityBlocks-1},d.prototype.ensureVisibility=function(){this.nodeVisible=!0},d.prototype.ensureInvisibility=function(){this.nodeVisible=!1},d.prototype.isVisible=function(){return this.nodeVisible},d.prototype.visibilityInfo=function(){return{visibilityBlocks:this.visibilityBlocks,nodeVisible:this.nodeVisible}},d.prototype.copyVisibilityInfo=function(a){a&&(this.visibilityBlocks=a.visibilityBlocks,this.nodeVisible=a.nodeVisible)},b.exports=d},{}],74:[function(a,b,c){var d=a("./node"),e=a("./color"),f=a("./dimension"),g=function(a,b,c){this.op=a.trim(),this.operands=b,this.isSpaced=c};g.prototype=new d,g.prototype.type="Operation",g.prototype.accept=function(a){this.operands=a.visit(this.operands)},g.prototype.eval=function(a){var b=this.operands[0].eval(a),c=this.operands[1].eval(a);if(a.isMathOn()){if(b instanceof f&&c instanceof e&&(b=b.toColor()),c instanceof f&&b instanceof e&&(c=c.toColor()),!b.operate)throw{type:"Operation",message:"Operation on an invalid type"};return b.operate(a,this.op,c)}return new g(this.op,[b,c],this.isSpaced)},g.prototype.genCSS=function(a,b){this.operands[0].genCSS(a,b),this.isSpaced&&b.add(" "),b.add(this.op),this.isSpaced&&b.add(" "),this.operands[1].genCSS(a,b)},b.exports=g},{"./color":52,"./dimension":59,"./node":73}],75:[function(a,b,c){var d=a("./node"),e=function(a){this.value=a};e.prototype=new d,e.prototype.type="Paren",e.prototype.genCSS=function(a,b){b.add("("),this.value.genCSS(a,b),b.add(")")},e.prototype.eval=function(a){return new e(this.value.eval(a))},b.exports=e},{"./node":73}],76:[function(a,b,c){var d=a("./node"),e=a("./declaration"),f=function(a,b,c){this.name=a,this._index=b,this._fileInfo=c};f.prototype=new d,f.prototype.type="Property",f.prototype.eval=function(a){var b,c=this.name,d=a.pluginManager.less.visitors.ToCSSVisitor.prototype._mergeRules;if(this.evaluating)throw{type:"Name",message:"Recursive property reference for "+c,filename:this.fileInfo().filename,index:this.getIndex()};if(this.evaluating=!0,b=this.find(a.frames,function(b){var f,g=b.property(c);if(g){for(var h=0;hd){if(!c||c(g)){e=g.find(new i(a.elements.slice(d)),b,c);for(var j=0;j0&&b.add(k),a.firstSelector=!0,h[0].genCSS(a,b),a.firstSelector=!1,d=1;d0?(e=p.copyArray(a),f=e.pop(),g=d.createDerived(p.copyArray(f.elements))):g=d.createDerived([]),b.length>0){var h=c.combinator,i=b[0].elements[0];h.emptyOrWhitespace&&!i.combinator.emptyOrWhitespace&&(h=i.combinator),g.elements.push(new j(h,i.value,c._index,c._fileInfo)),g.elements=g.elements.concat(b[0].elements.slice(1))}if(0!==g.elements.length&&e.push(g),b.length>1){var k=b.slice(1);k=k.map(function(a){return a.createDerived(a.elements,[])}),e=e.concat(k)}return e}function g(a,b,c,d,e){var g;for(g=0;g0?d[d.length-1]=d[d.length-1].createDerived(d[d.length-1].elements.concat(a)):d.push(new i(a))}}function l(a,b,c){function m(a){var b;return a.value instanceof h?(b=a.value.value,b instanceof i?b:null):null}var n,o,p,q,r,s,t,u,v,w,x=!1;for(q=[],r=[[]],n=0;u=c.elements[n];n++)if("&"!==u.value){var y=m(u);if(null!=y){k(q,r);var z,A=[],B=[];for(z=l(A,b,y),x=x||z,p=0;p0&&t[0].elements.push(new j(u.combinator,"",u._index,u._fileInfo)),s.push(t);else for(p=0;p0&&(a.push(r[n]),w=r[n][v-1],r[n][v-1]=w.createDerived(w.elements,c.extendList));return x}function m(a,b){var c=b.createDerived(b.elements,b.extendList,b.evaldCondition);return c.copyVisibilityInfo(a),c}var n,o,q;if(o=[],q=l(o,b,c),!q)if(b.length>0)for(o=[],n=0;n0)for(b=0;b=0&&"\n"!==b.charAt(c);)e++;return"number"==typeof a&&(d=(b.slice(0,a).match(/\n/g)||"").length),{line:d,column:e}},copyArray:function(a){var b,c=a.length,d=new Array(c);for(b=0;b=0||(i=[k.selfSelectors[0]],g=n.findMatch(j,i),g.length&&(j.hasFoundMatches=!0,j.selfSelectors.forEach(function(a){var b=k.visibilityInfo();h=n.extendSelector(g,i,a,j.isVisible()),l=new d.Extend(k.selector,k.option,0,k.fileInfo(),b),l.selfSelectors=h,h[h.length-1].extendList=[l],m.push(l),l.ruleset=k.ruleset,l.parent_ids=l.parent_ids.concat(k.parent_ids,j.parent_ids),k.firstExtendOnThisSelectorPath&&(l.firstExtendOnThisSelectorPath=!0,k.ruleset.paths.push(h))})));if(m.length){if(this.extendChainCount++,c>100){var o="{unable to calculate}",p="{unable to calculate}";try{o=m[0].selfSelectors[0].toCSS(),p=m[0].selector.toCSS()}catch(q){}throw{message:"extend circular reference detected. One of the circular extends is currently:"+o+":extend("+p+")"}}return m.concat(n.doExtendChaining(m,b,c+1))}return m},visitDeclaration:function(a,b){b.visitDeeper=!1},visitMixinDefinition:function(a,b){b.visitDeeper=!1},visitSelector:function(a,b){b.visitDeeper=!1},visitRuleset:function(a,b){if(!a.root){var c,d,e,f,g=this.allExtendsStack[this.allExtendsStack.length-1],h=[],i=this;for(e=0;e0&&k[i.matched].combinator.value!==g?i=null:i.matched++,i&&(i.finished=i.matched===k.length,i.finished&&!a.allowAfter&&(e+1k&&l>0&&(m[m.length-1].elements=m[m.length-1].elements.concat(b[k].elements.slice(l)),l=0,k++),j=g.elements.slice(l,i.index).concat([h]).concat(c.elements.slice(1)),k===i.pathIndex&&f>0?m[m.length-1].elements=m[m.length-1].elements.concat(j):(m=m.concat(b.slice(k,i.pathIndex)),m.push(new d.Selector(j))),k=i.endPathIndex,l=i.endPathElementIndex,l>=b[k].elements.length&&(l=0,k++);return k0&&(m[m.length-1].elements=m[m.length-1].elements.concat(b[k].elements.slice(l)),k++),m=m.concat(b.slice(k,b.length)),m=m.map(function(a){var b=a.createDerived(a.elements);return e?b.ensureVisibility():b.ensureInvisibility(),b})},visitMedia:function(a,b){var c=a.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);c=c.concat(this.doExtendChaining(c,a.allExtends)),this.allExtendsStack.push(c)},visitMediaOut:function(a){var b=this.allExtendsStack.length-1;this.allExtendsStack.length=b},visitAtRule:function(a,b){var c=a.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);c=c.concat(this.doExtendChaining(c,a.allExtends)),this.allExtendsStack.push(c)},visitAtRuleOut:function(a){var b=this.allExtendsStack.length-1;this.allExtendsStack.length=b}},b.exports=i},{"../logger":35,"../tree":65,"../utils":87,"./visitor":95}],89:[function(a,b,c){function d(a){this.imports=[],this.variableImports=[],this._onSequencerEmpty=a,this._currentDepth=0}d.prototype.addImport=function(a){var b=this,c={callback:a,args:null,isReady:!1};return this.imports.push(c),function(){c.args=Array.prototype.slice.call(arguments,0),c.isReady=!0,b.tryRun()}},d.prototype.addVariableImport=function(a){this.variableImports.push(a)},d.prototype.tryRun=function(){this._currentDepth++;try{for(;;){for(;this.imports.length>0;){var a=this.imports[0];if(!a.isReady)return;this.imports=this.imports.slice(1),a.callback.apply(null,a.args)}if(0===this.variableImports.length)break;var b=this.variableImports[0];this.variableImports=this.variableImports.slice(1),b()}}finally{this._currentDepth--}0===this._currentDepth&&this._onSequencerEmpty&&this._onSequencerEmpty()},b.exports=d},{}],90:[function(a,b,c){var d=a("../contexts"),e=a("./visitor"),f=a("./import-sequencer"),g=a("../utils"),h=function(a,b){this._visitor=new e(this),this._importer=a,this._finish=b,this.context=new d.Eval,this.importCount=0,this.onceFileDetectionMap={},this.recursionDetector={},this._sequencer=new f(this._onSequencerEmpty.bind(this))};h.prototype={isReplacing:!1,run:function(a){try{this._visitor.visit(a)}catch(b){this.error=b}this.isFinished=!0,this._sequencer.tryRun()},_onSequencerEmpty:function(){this.isFinished&&this._finish(this.error)},visitImport:function(a,b){var c=a.options.inline;if(!a.css||c){var e=new d.Eval(this.context,g.copyArray(this.context.frames)),f=e.frames[0];this.importCount++,a.isVariableImport()?this._sequencer.addVariableImport(this.processImportNode.bind(this,a,e,f)):this.processImportNode(a,e,f)}b.visitDeeper=!1},processImportNode:function(a,b,c){var d,e=a.options.inline;try{d=a.evalForImport(b)}catch(f){f.filename||(f.index=a.getIndex(),f.filename=a.fileInfo().filename),a.css=!0,a.error=f}if(!d||d.css&&!e)this.importCount--,this.isFinished&&this._sequencer.tryRun();else{d.options.multiple&&(b.importMultiple=!0);for(var g=void 0===d.css,h=0;h0},resolveVisibility:function(a,b){if(!a.blocksVisibility()){if(this.isEmpty(a)&&!this.containsSilentNonBlockedChild(b))return;return a}var c=a.rules[0];if(this.keepOnlyVisibleChilds(c),!this.isEmpty(c))return a.ensureVisibility(),a.removeVisibilityBlock(),a},isVisibleRuleset:function(a){return!!a.firstRoot||!this.isEmpty(a)&&!(!a.root&&!this.hasVisibleSelector(a))}};var g=function(a){this._visitor=new e(this),this._context=a,this.utils=new f(a)};g.prototype={isReplacing:!0,run:function(a){return this._visitor.visit(a)},visitDeclaration:function(a,b){if(!a.blocksVisibility()&&!a.variable)return a},visitMixinDefinition:function(a,b){a.frames=[]},visitExtend:function(a,b){},visitComment:function(a,b){if(!a.blocksVisibility()&&!a.isSilent(this._context))return a},visitMedia:function(a,b){var c=a.rules[0].rules;return a.accept(this._visitor),b.visitDeeper=!1,this.utils.resolveVisibility(a,c)},visitImport:function(a,b){if(!a.blocksVisibility())return a},visitAtRule:function(a,b){return a.rules&&a.rules.length?this.visitAtRuleWithBody(a,b):this.visitAtRuleWithoutBody(a,b)},visitAtRuleWithBody:function(a,b){function c(a){var b=a.rules;return 1===b.length&&(!b[0].paths||0===b[0].paths.length)}function d(a){var b=a.rules;return c(a)?b[0].rules:b}var e=d(a);return a.accept(this._visitor),b.visitDeeper=!1,this.utils.isEmpty(a)||this._mergeRules(a.rules[0].rules),this.utils.resolveVisibility(a,e)},visitAtRuleWithoutBody:function(a,b){if(!a.blocksVisibility()){if("@charset"===a.name){if(this.charset){if(a.debugInfo){var c=new d.Comment("/* "+a.toCSS(this._context).replace(/\n/g,"")+" */\n");return c.debugInfo=a.debugInfo,this._visitor.visit(c)}return}this.charset=!0}return a}},checkValidNodes:function(a,b){if(a)for(var c=0;c0?a.accept(this._visitor):a.rules=null,b.visitDeeper=!1}return a.rules&&(this._mergeRules(a.rules),this._removeDuplicateRules(a.rules)),this.utils.isVisibleRuleset(a)&&(a.ensureVisibility(),d.splice(0,0,a)),1===d.length?d[0]:d},_compileRulesetPaths:function(a){a.paths&&(a.paths=a.paths.filter(function(a){var b;for(" "===a[0].elements[0].combinator.value&&(a[0].elements[0].combinator=new d.Combinator("")),b=0;b=0;e--)if(c=a[e],c instanceof d.Declaration)if(f[c.name]){b=f[c.name],b instanceof d.Declaration&&(b=f[c.name]=[f[c.name].toCSS(this._context)]);var g=c.toCSS(this._context);b.indexOf(g)!==-1?a.splice(e,1):b.push(g)}else f[c.name]=c}},_mergeRules:function(a){if(a){for(var b,c,e,f={},g=0;g1){c=b[0];var h=[],i=[];b.map(function(a){"+"===a.merge&&(i.length>0&&h.push(e(i)),i=[]),i.push(a)}),h.push(e(i)),c.value=g(h)}})}},visitAnonymous:function(a,b){if(!a.blocksVisibility())return a.accept(this._visitor),a}},b.exports=g},{"../tree":65,"./visitor":95}],95:[function(a,b,c){function d(a){return a}function e(a,b){var c,d;for(c in a)switch(d=a[c],typeof d){case"function":d.prototype&&d.prototype.type&&(d.prototype.typeIndex=b++);break;case"object":b=e(d,b)}return b}var f=a("../tree"),g={visitDeeper:!0},h=!1,i=function(a){this._implementation=a,this._visitFnCache=[],h||(e(f,1),h=!0)};i.prototype={visit:function(a){if(!a)return a;var b=a.typeIndex;if(!b)return a;var c,e=this._visitFnCache,f=this._implementation,h=b<<1,i=1|h,j=e[h],k=e[i],l=g;if(l.visitDeeper=!0,j||(c="visit"+a.type,j=f[c]||d,k=f[c+"Out"]||d,e[h]=j,e[i]=k),j!==d){var m=j.call(f,a,l);f.isReplacing&&(a=m)}return l.visitDeeper&&a&&a.accept&&a.accept(this),k!=d&&k.call(f,a),a},visitArray:function(a,b){if(!a)return a;var c,d=a.length;if(b||!this._implementation.isReplacing){for(c=0;ck){for(var b=0,c=h.length-j;b0||b.isFileProtocol?"development":"production");var c=/!dumpLineNumbers:(comments|mediaquery|all)/.exec(a.location.hash);c&&(b.dumpLineNumbers=c[1]),void 0===b.useFileCache&&(b.useFileCache=!0),void 0===b.onReady&&(b.onReady=!0),b.javascriptEnabled=!(!b.javascriptEnabled&&!b.inlineJavaScript)}},{"./browser":3,"./utils":11}],2:[function(a,b,c){function d(a){a.filename&&console.warn(a),e.async||h.removeChild(i)}a("promise/polyfill");var e=a("../less/default-options")();if(window.less)for(key in window.less)window.less.hasOwnProperty(key)&&(e[key]=window.less[key]);a("./add-default-options")(window,e),e.plugins=e.plugins||[],window.LESS_PLUGINS&&(e.plugins=e.plugins.concat(window.LESS_PLUGINS));var f=b.exports=a("./index")(window,e);window.less=f;var g,h,i;e.onReady&&(/!watch/.test(window.location.hash)&&f.watch(),e.async||(g="body { display: none !important }",h=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style"),i.type="text/css",i.styleSheet?i.styleSheet.cssText=g:i.appendChild(document.createTextNode(g)),h.appendChild(i)),f.registerStylesheetsImmediately(),f.pageLoadFinished=f.refresh("development"===f.env).then(d,d))},{"../less/default-options":16,"./add-default-options":1,"./index":8,"promise/polyfill":102}],3:[function(a,b,c){var d=a("./utils");b.exports={createCSS:function(a,b,c){var e=c.href||"",f="less:"+(c.title||d.extractId(e)),g=a.getElementById(f),h=!1,i=a.createElement("style");i.setAttribute("type","text/css"),c.media&&i.setAttribute("media",c.media),i.id=f,i.styleSheet||(i.appendChild(a.createTextNode(b)),h=null!==g&&g.childNodes.length>0&&i.childNodes.length>0&&g.firstChild.nodeValue===i.firstChild.nodeValue);var j=a.getElementsByTagName("head")[0];if(null===g||h===!1){var k=c&&c.nextSibling||null;k?k.parentNode.insertBefore(i,k):j.appendChild(i)}if(g&&h===!1&&g.parentNode.removeChild(g),i.styleSheet)try{i.styleSheet.cssText=b}catch(l){throw new Error("Couldn't reassign styleSheet.cssText.")}},currentScript:function(a){var b=a.document;return b.currentScript||function(){var a=b.getElementsByTagName("script");return a[a.length-1]}()}}},{"./utils":11}],4:[function(a,b,c){b.exports=function(a,b,c){var d=null;if("development"!==b.env)try{d="undefined"==typeof a.localStorage?null:a.localStorage}catch(e){}return{setCSS:function(a,b,e,f){if(d){c.info("saving "+a+" to cache.");try{d.setItem(a,f),d.setItem(a+":timestamp",b),e&&d.setItem(a+":vars",JSON.stringify(e))}catch(g){c.error('failed to save "'+a+'" to local storage for caching.')}}},getCSS:function(a,b,c){var e=d&&d.getItem(a),f=d&&d.getItem(a+":timestamp"),g=d&&d.getItem(a+":vars");if(c=c||{},f&&b.lastModified&&new Date(b.lastModified).valueOf()===new Date(f).valueOf()&&(!c&&!g||JSON.stringify(c)===g))return e}}}},{}],5:[function(a,b,c){var d=a("./utils"),e=a("./browser");b.exports=function(a,b,c){function f(b,f){var g,h,i="less-error-message:"+d.extractId(f||""),j='
  • {content}
  • ',k=a.document.createElement("div"),l=[],m=b.filename||f,n=m.match(/([^\/]+(\?.*)?)$/)[1];k.id=i,k.className="less-error-message",h="

    "+(b.type||"Syntax")+"Error: "+(b.message||"There is an error in your .less file")+'

    in '+n+" ";var o=function(a,b,c){void 0!==a.extract[b]&&l.push(j.replace(/\{line\}/,(parseInt(a.line,10)||0)+(b-1)).replace(/\{class\}/,c).replace(/\{content\}/,a.extract[b]))};b.line&&(o(b,0,""),o(b,1,"line"),o(b,2,""),h+="on line "+b.line+", column "+(b.column+1)+":

      "+l.join("")+"
    "),b.stack&&(b.extract||c.logLevel>=4)&&(h+="
    Stack Trace
    "+b.stack.split("\n").slice(1).join("
    ")),k.innerHTML=h,e.createCSS(a.document,[".less-error-message ul, .less-error-message li {","list-style-type: none;","margin-right: 15px;","padding: 4px 0;","margin: 0;","}",".less-error-message label {","font-size: 12px;","margin-right: 15px;","padding: 4px 0;","color: #cc7777;","}",".less-error-message pre {","color: #dd6666;","padding: 4px 0;","margin: 0;","display: inline-block;","}",".less-error-message pre.line {","color: #ff0000;","}",".less-error-message h3 {","font-size: 20px;","font-weight: bold;","padding: 15px 0 5px 0;","margin: 0;","}",".less-error-message a {","color: #10a","}",".less-error-message .error {","color: red;","font-weight: bold;","padding-bottom: 2px;","border-bottom: 1px dashed red;","}"].join("\n"),{title:"error-message"}),k.style.cssText=["font-family: Arial, sans-serif","border: 1px solid #e00","background-color: #eee","border-radius: 5px","-webkit-border-radius: 5px","-moz-border-radius: 5px","color: #e00","padding: 15px","margin-bottom: 15px"].join(";"),"development"===c.env&&(g=setInterval(function(){var b=a.document,c=b.body;c&&(b.getElementById(i)?c.replaceChild(k,b.getElementById(i)):c.insertBefore(k,c.firstChild),clearInterval(g))},10))}function g(b){var c=a.document.getElementById("less-error-message:"+d.extractId(b));c&&c.parentNode.removeChild(c)}function h(a){}function i(a){c.errorReporting&&"html"!==c.errorReporting?"console"===c.errorReporting?h(a):"function"==typeof c.errorReporting&&c.errorReporting("remove",a):g(a)}function j(a,d){var e="{line} {content}",f=a.filename||d,g=[],h=(a.type||"Syntax")+"Error: "+(a.message||"There is an error in your .less file")+" in "+f,i=function(a,b,c){void 0!==a.extract[b]&&g.push(e.replace(/\{line\}/,(parseInt(a.line,10)||0)+(b-1)).replace(/\{class\}/,c).replace(/\{content\}/,a.extract[b]))};a.line&&(i(a,0,""),i(a,1,"line"),i(a,2,""),h+=" on line "+a.line+", column "+(a.column+1)+":\n"+g.join("\n")),a.stack&&(a.extract||c.logLevel>=4)&&(h+="\nStack Trace\n"+a.stack),b.logger.error(h)}function k(a,b){c.errorReporting&&"html"!==c.errorReporting?"console"===c.errorReporting?j(a,b):"function"==typeof c.errorReporting&&c.errorReporting("add",a,b):f(a,b)}return{add:k,remove:i}}},{"./browser":3,"./utils":11}],6:[function(a,b,c){b.exports=function(b,c){var d=a("../less/environment/abstract-file-manager.js"),e={},f=function(){};return f.prototype=new d,f.prototype.alwaysMakePathsAbsolute=function(){return!0},f.prototype.join=function(a,b){return a?this.extractUrlParts(b,a).path:b},f.prototype.doXHR=function(a,d,e,f){function g(b,c,d){b.status>=200&&b.status<300?c(b.responseText,b.getResponseHeader("Last-Modified")):"function"==typeof d&&d(b.status,a)}var h=new XMLHttpRequest,i=!b.isFileProtocol||b.fileAsync;"function"==typeof h.overrideMimeType&&h.overrideMimeType("text/css"),c.debug("XHR: Getting '"+a+"'"),h.open("GET",a,i),h.setRequestHeader("Accept",d||"text/x-less, text/css; q=0.9, */*; q=0.5"),h.send(null),b.isFileProtocol&&!b.fileAsync?0===h.status||h.status>=200&&h.status<300?e(h.responseText):f(h.status,a):i?h.onreadystatechange=function(){4==h.readyState&&g(h,e,f)}:g(h,e,f)},f.prototype.supports=function(a,b,c,d){return!0},f.prototype.clearFileCache=function(){e={}},f.prototype.loadFile=function(a,b,c,d){b&&!this.isPathAbsolute(a)&&(a=b+a),a=c.ext?this.tryAppendExtension(a,c.ext):a,c=c||{};var f=this.extractUrlParts(a,window.location.href),g=f.url,h=this;return new Promise(function(a,b){if(c.useFileCache&&e[g])try{var d=e[g];return a({contents:d,filename:g,webInfo:{lastModified:new Date}})}catch(f){return b({filename:g,message:"Error loading file "+g+" error was "+f.message})}h.doXHR(g,c.mime,function(b,c){e[g]=b,a({contents:b,filename:g,webInfo:{lastModified:c}})},function(a,c){b({type:"File",message:"'"+c+"' wasn't found ("+a+")",href:g})})})},f}},{"../less/environment/abstract-file-manager.js":17}],7:[function(a,b,c){b.exports=function(){function b(){throw{type:"Runtime",message:"Image size functions are not supported in browser version of less"}}var c=a("./../less/functions/function-registry"),d={"image-size":function(a){return b(this,a),-1},"image-width":function(a){return b(this,a),-1},"image-height":function(a){return b(this,a),-1}};c.addMultiple(d)}},{"./../less/functions/function-registry":26}],8:[function(a,b,c){var d=a("./utils").addDataAttr,e=a("./browser");b.exports=function(b,c){function f(a){return JSON.parse(JSON.stringify(a||{}))}function g(a,b){var c=Array.prototype.slice.call(arguments,2);return function(){var d=c.concat(Array.prototype.slice.call(arguments,0));return a.apply(b,d)}}function h(a){for(var b,d=l.getElementsByTagName("style"),e=0;e=c&&console.log(a)},info:function(a){b.logLevel>=d&&console.log(a)},warn:function(a){b.logLevel>=e&&console.warn(a)},error:function(a){b.logLevel>=f&&console.error(a)}}]);for(var g=0;g0&&(a=a.slice(0,b)),b=a.lastIndexOf("/"),b<0&&(b=a.lastIndexOf("\\")),b<0?"":a.slice(0,b+1)},d.prototype.tryAppendExtension=function(a,b){return/(\.[a-z]*$)|([\?;].*)$/.test(a)?a:a+b},d.prototype.tryAppendLessExtension=function(a){return this.tryAppendExtension(a,".less")},d.prototype.supportsSync=function(){return!1},d.prototype.alwaysMakePathsAbsolute=function(){return!1},d.prototype.isPathAbsolute=function(a){return/^(?:[a-z-]+:|\/|\\|#)/i.test(a)},d.prototype.join=function(a,b){return a?a+b:b},d.prototype.pathDiff=function(a,b){var c,d,e,f,g=this.extractUrlParts(a),h=this.extractUrlParts(b),i="";if(g.hostPart!==h.hostPart)return"";for(d=Math.max(h.directories.length,g.directories.length),c=0;cparseInt(b[c])?-1:1;return 0},g.prototype.versionToString=function(a){for(var b="",c=0;c=0;h--){var i=g[h];if(i[f?"supportsSync":"supports"](a,b,c,e))return i}return null},e.prototype.addFileManager=function(a){this.fileManagers.push(a)},e.prototype.clearFileManagers=function(){this.fileManagers=[]},b.exports=e},{"../logger":37}],20:[function(a,b,c){var d=a("./function-registry"),e=a("../tree/anonymous"),f=a("../tree/keyword");d.addMultiple({"boolean":function(a){return a?f.True:f.False},"if":function(a,b,c){return a?b:c||new e}})},{"../tree/anonymous":48,"../tree/keyword":69,"./function-registry":26}],21:[function(a,b,c){function d(a,b,c){var d,f,g,h,i=b.alpha,j=c.alpha,k=[];g=j+i*(1-j);for(var l=0;l<3;l++)d=b.rgb[l]/255,f=c.rgb[l]/255,h=a(d,f),g&&(h=(j*f+i*(d-j*(d+f-h)))/g),k[l]=255*h;return new e(k,g)}var e=a("../tree/color"),f=a("./function-registry"),g={multiply:function(a,b){return a*b},screen:function(a,b){return a+b-a*b},overlay:function(a,b){return a*=2,a<=1?g.multiply(a,b):g.screen(a-1,b)},softlight:function(a,b){var c=1,d=a;return b>.5&&(d=1,c=a>.25?Math.sqrt(a):((16*a-12)*a+4)*a),a-(1-2*b)*d*(c-a)},hardlight:function(a,b){return g.overlay(b,a)},difference:function(a,b){return Math.abs(a-b)},exclusion:function(a,b){return a+b-2*a*b},average:function(a,b){return(a+b)/2},negation:function(a,b){return 1-Math.abs(a+b-1)}};for(var h in g)g.hasOwnProperty(h)&&(d[h]=d.bind(null,g[h]));f.addMultiple(d)},{"../tree/color":53,"./function-registry":26}],22:[function(a,b,c){function d(a){return Math.min(1,Math.max(0,a))}function e(a){return h.hsla(a.h,a.s,a.l,a.a)}function f(a){if(a instanceof i)return parseFloat(a.unit.is("%")?a.value/100:a.value);if("number"==typeof a)return a;throw{type:"Argument",message:"color functions take numbers as parameters"}}function g(a,b){return a instanceof i&&a.unit.is("%")?parseFloat(a.value*b/100):f(a)}var h,i=a("../tree/dimension"),j=a("../tree/color"),k=a("../tree/quoted"),l=a("../tree/anonymous"),m=a("./function-registry");h={rgb:function(a,b,c){return h.rgba(a,b,c,1)},rgba:function(a,b,c,d){var e=[a,b,c].map(function(a){return g(a,255)});return d=f(d),new j(e,d)},hsl:function(a,b,c){return h.hsla(a,b,c,1)},hsla:function(a,b,c,e){function g(a){return a=a<0?a+1:a>1?a-1:a,6*a<1?i+(j-i)*a*6:2*a<1?j:3*a<2?i+(j-i)*(2/3-a)*6:i}var i,j;return a=f(a)%360/360,b=d(f(b)),c=d(f(c)),e=d(f(e)),j=c<=.5?c*(b+1):c+b-c*b,i=2*c-j,h.rgba(255*g(a+1/3),255*g(a),255*g(a-1/3),e)},hsv:function(a,b,c){return h.hsva(a,b,c,1)},hsva:function(a,b,c,d){a=f(a)%360/360*360,b=f(b),c=f(c),d=f(d);var e,g;e=Math.floor(a/60%6),g=a/60-e;var i=[c,c*(1-b),c*(1-g*b),c*(1-(1-g)*b)],j=[[0,3,1],[2,0,1],[1,0,3],[1,2,0],[3,1,0],[0,1,2]];return h.rgba(255*i[j[e][0]],255*i[j[e][1]],255*i[j[e][2]],d)},hue:function(a){return new i(a.toHSL().h)},saturation:function(a){return new i(100*a.toHSL().s,"%")},lightness:function(a){return new i(100*a.toHSL().l,"%")},hsvhue:function(a){return new i(a.toHSV().h)},hsvsaturation:function(a){return new i(100*a.toHSV().s,"%")},hsvvalue:function(a){return new i(100*a.toHSV().v,"%")},red:function(a){return new i(a.rgb[0])},green:function(a){return new i(a.rgb[1])},blue:function(a){return new i(a.rgb[2])},alpha:function(a){return new i(a.toHSL().a)},luma:function(a){return new i(a.luma()*a.alpha*100,"%")},luminance:function(a){var b=.2126*a.rgb[0]/255+.7152*a.rgb[1]/255+.0722*a.rgb[2]/255;return new i(b*a.alpha*100,"%")},saturate:function(a,b,c){if(!a.rgb)return null;var f=a.toHSL();return f.s+="undefined"!=typeof c&&"relative"===c.value?f.s*b.value/100:b.value/100,f.s=d(f.s),e(f)},desaturate:function(a,b,c){var f=a.toHSL();return f.s-="undefined"!=typeof c&&"relative"===c.value?f.s*b.value/100:b.value/100,f.s=d(f.s),e(f)},lighten:function(a,b,c){var f=a.toHSL();return f.l+="undefined"!=typeof c&&"relative"===c.value?f.l*b.value/100:b.value/100,f.l=d(f.l),e(f)},darken:function(a,b,c){var f=a.toHSL();return f.l-="undefined"!=typeof c&&"relative"===c.value?f.l*b.value/100:b.value/100,f.l=d(f.l),e(f)},fadein:function(a,b,c){var f=a.toHSL();return f.a+="undefined"!=typeof c&&"relative"===c.value?f.a*b.value/100:b.value/100,f.a=d(f.a),e(f)},fadeout:function(a,b,c){var f=a.toHSL();return f.a-="undefined"!=typeof c&&"relative"===c.value?f.a*b.value/100:b.value/100,f.a=d(f.a),e(f)},fade:function(a,b){var c=a.toHSL();return c.a=b.value/100,c.a=d(c.a),e(c)},spin:function(a,b){var c=a.toHSL(),d=(c.h+b.value)%360;return c.h=d<0?360+d:d,e(c)},mix:function(a,b,c){a.toHSL&&b.toHSL||(console.log(b.type),console.dir(b)),c||(c=new i(50));var d=c.value/100,e=2*d-1,f=a.toHSL().a-b.toHSL().a,g=((e*f==-1?e:(e+f)/(1+e*f))+1)/2,h=1-g,k=[a.rgb[0]*g+b.rgb[0]*h,a.rgb[1]*g+b.rgb[1]*h,a.rgb[2]*g+b.rgb[2]*h],l=a.alpha*d+b.alpha*(1-d);return new j(k,l)},greyscale:function(a){return h.desaturate(a,new i(100))},contrast:function(a,b,c,d){if(!a.rgb)return null;if("undefined"==typeof c&&(c=h.rgba(255,255,255,1)),"undefined"==typeof b&&(b=h.rgba(0,0,0,1)),b.luma()>c.luma()){var e=c;c=b,b=e}return d="undefined"==typeof d?.43:f(d),a.luma()=v&&this.context.ieCompat!==!1?(h.warn("Skipped data-uri embedding of "+j+" because its size ("+u.length+" characters) exceeds IE8-safe "+v+" characters!"),g(this,f||a)):new d(new c('"'+u+'"',u,(!1),this.index,this.currentFileInfo),this.index,this.currentFileInfo)})}},{"../logger":37,"../tree/quoted":78,"../tree/url":84,"../utils":88,"./function-registry":26}],24:[function(a,b,c){var d=a("../tree/keyword"),e=a("./function-registry"),f={eval:function(){var a=this.value_,b=this.error_;if(b)throw b;if(null!=a)return a?d.True:d.False},value:function(a){this.value_=a},error:function(a){this.error_=a},reset:function(){this.value_=this.error_=null}};e.add("default",f.eval.bind(f)),b.exports=f},{"../tree/keyword":69,"./function-registry":26}],25:[function(a,b,c){var d=a("../tree/expression"),e=function(a,b,c,d){this.name=a.toLowerCase(),this.index=c,this.context=b,this.currentFileInfo=d,this.func=b.frames[0].functionRegistry.get(this.name)};e.prototype.isValid=function(){return Boolean(this.func)},e.prototype.call=function(a){return Array.isArray(a)&&(a=a.filter(function(a){return"Comment"!==a.type}).map(function(a){if("Expression"===a.type){var b=a.value.filter(function(a){return"Comment"!==a.type});return 1===b.length?b[0]:new d(b)}return a})),this.func.apply(this,a)},b.exports=e},{"../tree/expression":63}],26:[function(a,b,c){function d(a){return{_data:{},add:function(a,b){a=a.toLowerCase(),this._data.hasOwnProperty(a),this._data[a]=b},addMultiple:function(a){Object.keys(a).forEach(function(b){this.add(b,a[b])}.bind(this))},get:function(b){return this._data[b]||a&&a.get(b)},getLocalFunctions:function(){return this._data},inherit:function(){return d(this)},create:function(a){return d(a)}}}b.exports=d(null)},{}],27:[function(a,b,c){b.exports=function(b){var c={functionRegistry:a("./function-registry"),functionCaller:a("./function-caller")};return a("./boolean"),a("./default"),a("./color"),a("./color-blending"),a("./data-uri")(b),a("./math"),a("./number"),a("./string"),a("./svg")(b),a("./types"),c}},{"./boolean":20,"./color":22,"./color-blending":21,"./data-uri":23,"./default":24,"./function-caller":25,"./function-registry":26,"./math":29,"./number":30,"./string":31,"./svg":32,"./types":33}],28:[function(a,b,c){var d=a("../tree/dimension"),e=function(){};e._math=function(a,b,c){if(!(c instanceof d))throw{type:"Argument",message:"argument must be a number" +};return null==b?b=c.unit:c=c.unify(),new d(a(parseFloat(c.value)),b)},b.exports=e},{"../tree/dimension":60}],29:[function(a,b,c){var d=a("./function-registry"),e=a("./math-helper.js"),f={ceil:null,floor:null,sqrt:null,abs:null,tan:"",sin:"",cos:"",atan:"rad",asin:"rad",acos:"rad"};for(var g in f)f.hasOwnProperty(g)&&(f[g]=e._math.bind(null,Math[g],f[g]));f.round=function(a,b){var c="undefined"==typeof b?0:b.value;return e._math(function(a){return a.toFixed(c)},null,a)},d.addMultiple(f)},{"./function-registry":26,"./math-helper.js":28}],30:[function(a,b,c){var d=a("../tree/dimension"),e=a("../tree/anonymous"),f=a("./function-registry"),g=a("./math-helper.js"),h=function(a,b){switch(b=Array.prototype.slice.call(b),b.length){case 0:throw{type:"Argument",message:"one or more arguments required"}}var c,f,g,h,i,j,k,l,m=[],n={};for(c=0;ci.value)&&(m[f]=g);else{if(void 0!==k&&j!==k)throw{type:"Argument",message:"incompatible types"};n[j]=m.length,m.push(g)}else Array.isArray(b[c].value)&&Array.prototype.push.apply(b,Array.prototype.slice.call(b[c].value));return 1==m.length?m[0]:(b=m.map(function(a){return a.toCSS(this.context)}).join(this.context.compress?",":", "),new e((a?"min":"max")+"("+b+")"))};f.addMultiple({min:function(){return h(!0,arguments)},max:function(){return h(!1,arguments)},convert:function(a,b){return a.convertTo(b.value)},pi:function(){return new d(Math.PI)},mod:function(a,b){return new d(a.value%b.value,a.unit)},pow:function(a,b){if("number"==typeof a&&"number"==typeof b)a=new d(a),b=new d(b);else if(!(a instanceof d&&b instanceof d))throw{type:"Argument",message:"arguments must be numbers"};return new d(Math.pow(a.value,b.value),a.unit)},percentage:function(a){var b=g._math(function(a){return 100*a},"%",a);return b}})},{"../tree/anonymous":48,"../tree/dimension":60,"./function-registry":26,"./math-helper.js":28}],31:[function(a,b,c){var d=a("../tree/quoted"),e=a("../tree/anonymous"),f=a("../tree/javascript"),g=a("./function-registry");g.addMultiple({e:function(a){return new e(a instanceof f?a.evaluated:a.value)},escape:function(a){return new e(encodeURI(a.value).replace(/=/g,"%3D").replace(/:/g,"%3A").replace(/#/g,"%23").replace(/;/g,"%3B").replace(/\(/g,"%28").replace(/\)/g,"%29"))},replace:function(a,b,c,e){var f=a.value;return c="Quoted"===c.type?c.value:c.toCSS(),f=f.replace(new RegExp(b.value,e?e.value:""),c),new d(a.quote||"",f,a.escaped)},"%":function(a){for(var b=Array.prototype.slice.call(arguments,1),c=a.value,e=0;e",k=0;k";return j+="',j=encodeURIComponent(j),j="data:image/svg+xml,"+j,new g(new f("'"+j+"'",j,(!1),this.index,this.currentFileInfo),this.index,this.currentFileInfo)})}},{"../tree/color":53,"../tree/dimension":60,"../tree/expression":63,"../tree/quoted":78,"../tree/url":84,"./function-registry":26}],33:[function(a,b,c){var d=a("../tree/keyword"),e=a("../tree/detached-ruleset"),f=a("../tree/dimension"),g=a("../tree/color"),h=a("../tree/quoted"),i=a("../tree/anonymous"),j=a("../tree/url"),k=a("../tree/operation"),l=a("./function-registry"),m=function(a,b){return a instanceof b?d.True:d.False},n=function(a,b){if(void 0===b)throw{type:"Argument",message:"missing the required second argument to isunit."};if(b="string"==typeof b.value?b.value:b,"string"!=typeof b)throw{type:"Argument",message:"Second argument to isunit should be a unit or a string."};return a instanceof f&&a.unit.is(b)?d.True:d.False},o=function(a){var b=Array.isArray(a.value)?a.value:Array(a);return b};l.addMultiple({isruleset:function(a){return m(a,e)},iscolor:function(a){return m(a,g)},isnumber:function(a){return m(a,f)},isstring:function(a){return m(a,h)},iskeyword:function(a){return m(a,d)},isurl:function(a){return m(a,j)},ispixel:function(a){return n(a,"px")},ispercentage:function(a){return n(a,"%")},isem:function(a){return n(a,"em")},isunit:n,unit:function(a,b){if(!(a instanceof f))throw{type:"Argument",message:"the first argument to unit must be a number"+(a instanceof k?". Have you forgotten parenthesis?":"")};return b=b?b instanceof d?b.value:b.toCSS():"",new f(a.value,b)},"get-unit":function(a){return new i(a.unit)},extract:function(a,b){return b=b.value-1,o(a)[b]},length:function(a){return new f(o(a).length)}})},{"../tree/anonymous":48,"../tree/color":53,"../tree/detached-ruleset":59,"../tree/dimension":60,"../tree/keyword":69,"../tree/operation":75,"../tree/quoted":78,"../tree/url":84,"./function-registry":26}],34:[function(a,b,c){var d=a("./contexts"),e=a("./parser/parser"),f=a("./less-error"),g=a("./utils");"undefined"==typeof Promise?a("promise"):Promise;b.exports=function(a){var b=function(a,b,c){this.less=a,this.rootFilename=c.filename,this.paths=b.paths||[],this.contents={},this.contentsIgnoredChars={},this.mime=b.mime,this.error=null,this.context=b,this.queue=[],this.files={}};return b.prototype.push=function(b,c,h,i,j){var k=this,l=this.context.pluginManager.Loader;this.queue.push(b);var m=function(a,c,d){k.queue.splice(k.queue.indexOf(b),1);var e=d===k.rootFilename;i.optional&&a?j(null,{rules:[]},!1,null):(k.files[d]||(k.files[d]={root:c,options:i}),a&&!k.error&&(k.error=a),j(a,c,e,d))},n={relativeUrls:this.context.relativeUrls,entryPath:h.entryPath,rootpath:h.rootpath,rootFilename:h.rootFilename},o=a.getFileManager(b,h.currentDirectory,this.context,a);if(!o)return void m({message:"Could not find a file-manager for "+b});var p,q=function(a){var b,c=a.filename,g=a.contents.replace(/^\uFEFF/,"");n.currentDirectory=o.getPath(c),n.relativeUrls&&(n.rootpath=o.join(k.context.rootpath||"",o.pathDiff(n.currentDirectory,n.entryPath)),!o.isPathAbsolute(n.rootpath)&&o.alwaysMakePathsAbsolute()&&(n.rootpath=o.join(n.entryPath,n.rootpath))),n.filename=c;var j=new d.Parse(k.context);j.processImports=!1,k.contents[c]=g,(h.reference||i.reference)&&(n.reference=!0),i.isPlugin?(b=l.evalPlugin(g,j,k,i.pluginArgs,n),b instanceof f?m(b,null,c):m(null,b,c)):i.inline?m(null,g,c):!k.files[c]||k.files[c].options.multiple||i.multiple?new e(j,k,n).parse(g,function(a,b){m(a,b,c)}):m(null,k.files[c].root,c)},r=g.clone(this.context);c&&(r.ext=i.isPlugin?".js":".less"),p=i.isPlugin?l.loadPlugin(b,h.currentDirectory,r,a,o):o.loadFile(b,h.currentDirectory,r,a,function(a,b){a?m(a):q(b)}),p&&p.then(q,m)},b}},{"./contexts":12,"./less-error":36,"./parser/parser":42,"./utils":88,promise:void 0}],35:[function(a,b,c){b.exports=function(b,c){var d,e,f,g,h,i,j={version:[3,0,0],data:a("./data"),tree:a("./tree"),Environment:h=a("./environment/environment"),AbstractFileManager:a("./environment/abstract-file-manager"),AbstractPluginLoader:a("./environment/abstract-plugin-loader"),environment:b=new h(b,c),visitors:a("./visitors"),Parser:a("./parser/parser"),functions:a("./functions")(b),contexts:a("./contexts"),SourceMapOutput:d=a("./source-map-output")(b),SourceMapBuilder:e=a("./source-map-builder")(d,b),ParseTree:f=a("./parse-tree")(e),ImportManager:g=a("./import-manager")(b),render:a("./render")(b,f,g),parse:a("./parse")(b,f,g),LessError:a("./less-error"),transformTree:a("./transform-tree"),utils:a("./utils"),PluginManager:a("./plugin-manager"),logger:a("./logger")},k=function(a){return function(){var b=Object.create(a.prototype);return a.apply(b,Array.prototype.slice.call(arguments,0)),b}},l=Object.create(j);for(var m in j.tree)if(i=j.tree[m],"function"==typeof i)l[m]=k(i);else{l[m]=Object.create(null);for(var n in i)l[m][n]=k(i[n])}return l}},{"./contexts":12,"./data":14,"./environment/abstract-file-manager":17,"./environment/abstract-plugin-loader":18,"./environment/environment":19,"./functions":27,"./import-manager":34,"./less-error":36,"./logger":37,"./parse":39,"./parse-tree":38,"./parser/parser":42,"./plugin-manager":43,"./render":44,"./source-map-builder":45,"./source-map-output":46,"./transform-tree":47,"./tree":66,"./utils":88,"./visitors":92}],36:[function(a,b,c){var d=a("./utils"),e=b.exports=function(a,b,c){Error.call(this);var e=a.filename||c;if(this.message=a.message,this.stack=a.stack,b&&e){var f=b.contents[e],g=d.getLocation(a.index,f),h=g.line,i=g.column,j=a.call&&d.getLocation(a.call,f).line,k=f.split("\n");if(this.type=a.type||"Syntax",this.filename=e,this.index=a.index,this.line="number"==typeof h?h+1:null,this.column=i,!this.line&&this.stack){var l=this.stack.match(/(|Function):(\d+):(\d+)/);l&&(l[2]&&(this.line=parseInt(l[2])-2),l[3]&&(this.column=parseInt(l[3])))}this.callLine=j+1,this.callExtract=k[j],this.extract=[k[this.line-2],k[this.line-1],k[this.line]]}};if("undefined"==typeof Object.create){var f=function(){};f.prototype=Error.prototype,e.prototype=new f}else e.prototype=Object.create(Error.prototype);e.prototype.constructor=e,e.prototype.toString=function(a){a=a||{};var b="",c=this.extract||[],d=[],e=function(a){return a};if(a.stylize){var f=typeof a.stylize;if("function"!==f)throw Error("options.stylize should be a function, got a "+f+"!");e=a.stylize}if(null!==this.line){if("string"==typeof c[0]&&d.push(e(this.line-1+" "+c[0],"grey")),"string"==typeof c[1]){var g=this.line+" ";c[1]&&(g+=c[1].slice(0,this.column)+e(e(e(c[1].substr(this.column,1),"bold")+c[1].slice(this.column+1),"red"),"inverse")),d.push(g)}"string"==typeof c[2]&&d.push(e(this.line+1+" "+c[2],"grey")),d=d.join("\n")+e("","reset")+"\n"}return b+=e(this.type+"Error: "+this.message,"red"),this.filename&&(b+=e(" in ","red")+this.filename),this.line&&(b+=e(" on line "+this.line+", column "+(this.column+1)+":","grey")),b+="\n"+d,this.callLine&&(b+=e("from ","red")+(this.filename||"")+"/n",b+=e(this.callLine,"grey")+" "+this.callExtract+"/n"),b}},{"./utils":88}],37:[function(a,b,c){b.exports={error:function(a){this._fireEvent("error",a)},warn:function(a){this._fireEvent("warn",a)},info:function(a){this._fireEvent("info",a)},debug:function(a){this._fireEvent("debug",a)},addListener:function(a){this._listeners.push(a)},removeListener:function(a){for(var b=0;b=97&&j<=122||j<34))switch(j){case 40:o++,e=h;continue;case 41:if(--o<0)return b("missing opening `(`",h);continue;case 59:o||c();continue;case 123:n++,d=h;continue;case 125:if(--n<0)return b("missing opening `{`",h);n||o||c();continue;case 92:if(h96)){if(k==j){l=1;break}if(92==k){if(h==m-1)return b("unescaped `\\`",h);h++}}if(l)continue;return b("unmatched `"+String.fromCharCode(j)+"`",i);case 47:if(o||h==m-1)continue;if(k=a.charCodeAt(h+1),47==k)for(h+=2;hd&&g>f?b("missing closing `}` or `*/`",d):b("missing closing `}`",d):0!==o?b("missing closing `)`",e):(c(!0),p)}},{}],41:[function(a,b,c){var d=a("./chunker");b.exports=function(){function a(d){for(var e,f,j,p=k.i,q=c,s=k.i-i,t=k.i+h.length-s,u=k.i+=d,v=b;k.i=0){j={index:k.i,text:v.substr(k.i,x+2-k.i),isLineComment:!1},k.i+=j.text.length-1,k.commentStore.push(j);continue}}break}if(e!==l&&e!==n&&e!==m&&e!==o)break}if(h=h.slice(d+k.i-u+s),i=k.i,!h.length){if(ce||k.i===e&&a&&!f)&&(e=k.i,f=a);var b=j.pop();h=b.current,i=k.i=b.i,c=b.j},k.forget=function(){j.pop()},k.isWhitespace=function(a){var c=k.i+(a||0),d=b.charCodeAt(c);return d===l||d===o||d===m||d===n},k.$re=function(b){k.i>i&&(h=h.slice(k.i-i),i=k.i);var c=b.exec(h);return c?(a(c[0].length),"string"==typeof c?c:1===c.length?c[0]:c):null},k.$char=function(c){return b.charAt(k.i)!==c?null:(a(1),c)},k.$str=function(c){for(var d=c.length,e=0;es||a=b.length;return k.i=b.length-1,furthestChar:b[k.i]}},k}},{"./chunker":40}],42:[function(a,b,c){var d=a("../less-error"),e=a("../tree"),f=a("../visitors"),g=a("./parser-input"),h=a("../utils"),i=function j(a,b,c){function i(a,e){throw new d({index:p.i,filename:c.filename,type:e||"Syntax",message:a},b)}function k(a,b,c){var d=a instanceof Function?a.call(o):p.$re(a);return d?d:void i(b||("string"==typeof a?"expected '"+a+"' got '"+p.currentChar()+"'":"unexpected token"))}function l(a,b){return p.$char(a)?a:void i(b||"expected '"+a+"' got '"+p.currentChar()+"'")}function m(a){var b=c.filename;return{lineNumber:h.getLocation(a,p.getInput()).line+1,fileName:b}}function n(a,c,e,f,g){var h,i=[],j=p;try{j.start(a,!1,function(a,b){g({message:a,index:b+e})});for(var k,l,m=0;k=c[m];m++)l=j.i,h=o[k](),h?(h._index=l+e,h._fileInfo=f,i.push(h)):i.push(null);var n=j.end();n.isFinished?g(null,i):g(!0,null)}catch(q){throw new d({index:q.index+e,message:q.message},b,f.filename)}}var o,p=g();return{parserInput:p,imports:b,fileInfo:c,parseNode:n,parse:function(g,h,i){var k,l,m,n,o=null,q="";if(l=i&&i.globalVars?j.serializeVars(i.globalVars)+"\n":"",m=i&&i.modifyVars?"\n"+j.serializeVars(i.modifyVars):"",a.pluginManager)for(var r=a.pluginManager.getPreProcessors(),s=0;s")}return b&&(p.$char("(")&&(h=this.args(!0).args,l(")")),o.important()&&(j=!0),o.end())?(p.forget(),new e.mixin.Call(b,h,k,c,j)):void p.restore()}},args:function(a){var b,c,d,f,g,h,j,k=o.entities,l={args:null,variadic:!1},m=[],n=[],q=[];for(p.save();;){if(a)h=o.detachedRuleset()||o.expression();else{if(p.commentStore.length=0,p.$str("...")){l.variadic=!0,p.$char(";")&&!b&&(b=!0),(b?n:q).push({variadic:!0});break}h=k.variable()||k.property()||k.literal()||k.keyword()}if(!h)break;f=null,h.throwAwayComments&&h.throwAwayComments(),g=h;var r=null;if(a?h.value&&1==h.value.length&&(r=h.value[0]):r=h,r&&(r instanceof e.Variable||r instanceof e.Property))if(p.$char(":")){if(m.length>0&&(b&&i("Cannot mix ; and , as delimiter types"),c=!0),g=o.detachedRuleset()||o.expression(),!g){if(!a)return p.restore(),l.args=[],l;i("could not understand value for named argument")}f=d=r.name}else if(p.$str("...")){if(!a){l.variadic=!0,p.$char(";")&&!b&&(b=!0),(b?n:q).push({name:h.name,variadic:!0});break}j=!0}else a||(d=f=r.name,g=null);g&&m.push(g),q.push({name:f,value:g,expand:j}),p.$char(",")||(p.$char(";")||b)&&(c&&i("Cannot mix ; and , as delimiter types"),b=!0,m.length>1&&(g=new e.Value(m)),n.push({name:d,value:g,expand:j}),d=null,m=[],c=!1)}return p.forget(),l.args=b?n:q,l},definition:function(){var a,b,c,d,f=[],g=!1;if(!("."!==p.currentChar()&&"#"!==p.currentChar()||p.peek(/^[^{]*\}/)))if(p.save(),b=p.$re(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/)){a=b[1];var h=this.args(!1);if(f=h.args,g=h.variadic,!p.$char(")"))return void p.restore("Missing closing ')'");if(p.commentStore.length=0,p.$str("when")&&(d=k(o.conditions,"expected condition")),c=o.block())return p.forget(),new e.mixin.Definition(a,f,c,d,g);p.restore()}else p.forget()}},entity:function(){var a=this.entities;return this.comment()||a.literal()||a.variable()||a.url()||a.property()||a.call()||a.keyword()||a.javascript()},end:function(){return p.$char(";")||p.peek("}")},ieAlpha:function(){var a;if(p.$re(/^opacity=/i))return a=p.$re(/^\d+/),a||(a=k(o.entities.variable,"Could not parse alpha"),a="@{"+a.name.slice(1)+"}"),l(")"),new e.Quoted("","alpha(opacity="+a+")")},element:function(){var a,b,d,f=p.i;if(b=this.combinator(),a=p.$re(/^(?:\d+\.\d+|\d+)%/)||p.$re(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/)||p.$char("*")||p.$char("&")||this.attribute()||p.$re(/^\([^&()@]+\)/)||p.$re(/^[\.#:](?=@)/)||this.entities.variableCurly(),a||(p.save(),p.$char("(")?(d=this.selector(!1))&&p.$char(")")?(a=new e.Paren(d),p.forget()):p.restore("Missing closing ')'"):p.forget()),a)return new e.Element(b,a,f,c)},combinator:function(){var a=p.currentChar();if("/"===a){p.save();var b=p.$re(/^\/[a-z]+\//i);if(b)return p.forget(),new e.Combinator(b);p.restore()}if(">"===a||"+"===a||"~"===a||"|"===a||"^"===a){for(p.i++,"^"===a&&"^"===p.currentChar()&&(a="^^",p.i++);p.isWhitespace();)p.i++;return new e.Combinator(a)}return new e.Combinator(p.isWhitespace(-1)?" ":null)},selector:function(a){var b,d,f,g,h,j,l,m=p.i;for(a=a!==!1;(a&&(d=this.extend())||a&&(j=p.$str("when"))||(g=this.element()))&&(j?l=k(this.conditions,"expected condition"):l?i("CSS guard can only be used at the end of selector"):d?h=h?h.concat(d):d:(h&&i("Extend can only be used at the end of selector"),f=p.currentChar(),b?b.push(g):b=[g],g=null),"{"!==f&&"}"!==f&&";"!==f&&","!==f&&")"!==f););return b?new e.Selector(b,h,l,m,c):void(h&&i("Extend must be used to extend a selector, it cannot be used on its own"))},attribute:function(){if(p.$char("[")){var a,b,c,d=this.entities;return(a=d.variableCurly())||(a=k(/^(?:[_A-Za-z0-9-\*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/)),c=p.$re(/^[|~*$^]?=/),c&&(b=d.quoted()||p.$re(/^[0-9]+%/)||p.$re(/^[\w-]+/)||d.variableCurly()),l("]"),new e.Attribute(a,c,b)}},block:function(){var a;if(p.$char("{")&&(a=this.primary())&&p.$char("}"))return a},blockRuleset:function(){var a=this.block();return a&&(a=new e.Ruleset(null,a)),a},detachedRuleset:function(){var a=this.blockRuleset();if(a)return new e.DetachedRuleset(a)},ruleset:function(){var b,c,d,f;for(p.save(),a.dumpLineNumbers&&(f=m(p.i));;){if(c=this.selector(),!c)break;if(b?b.push(c):b=[c],p.commentStore.length=0,c.condition&&b.length>1&&i("Guards are only currently allowed on a single selector."),!p.$char(","))break;c.condition&&i("Guards are only currently allowed on a single selector."),p.commentStore.length=0}if(b&&(d=this.block())){p.forget();var g=new e.Ruleset(b,d,a.strictImports);return a.dumpLineNumbers&&(g.debugInfo=f),g}p.restore()},declaration:function(){var a,b,d,f,g,h=p.i,i=p.currentChar();if("."!==i&&"#"!==i&&"&"!==i&&":"!==i)if(p.save(),a=this.variable()||this.ruleProperty()){if(g="string"==typeof a,g&&(b=this.detachedRuleset()),p.commentStore.length=0,!b){if(f=!g&&a.length>1&&a.pop().value,b=this.anonymousValue())return p.forget(),new e.Declaration(a,b,(!1),f,h,c);b||(b=this.value()),d=this.important()}if(b&&this.end())return p.forget(),new e.Declaration(a,b,d,f,h,c);p.restore()}else p.restore()},anonymousValue:function(){var a=p.i,b=p.$re(/^([^@\$+\/'"*`(;{}-]*);/);if(b)return new e.Anonymous(b[1],a)},"import":function(){var a,b,d=p.i,f=p.$re(/^@import?\s+/);if(f){var g=(f?this.importOptions():null)||{};if(a=this.entities.quoted()||this.entities.url())return b=this.mediaFeatures(),p.$char(";")||(p.i=d,i("missing semi-colon or unrecognised media features on import")),b=b&&new e.Value(b),new e.Import(a,b,g,d,c);p.i=d,i("malformed import statement")}},importOptions:function(){var a,b,c,d={};if(!p.$char("("))return null;do if(a=this.importOption()){switch(b=a,c=!0,b){case"css":b="less",c=!1;break;case"once":b="multiple",c=!1}if(d[b]=c,!p.$char(","))break}while(a);return l(")"),d},importOption:function(){var a=p.$re(/^(less|css|multiple|once|inline|reference|optional)/);if(a)return a[1]},mediaFeature:function(){var a,b,d=this.entities,f=[];p.save();do a=d.keyword()||d.variable(),a?f.push(a):p.$char("(")&&(b=this.property(),a=this.value(),p.$char(")")?b&&a?f.push(new e.Paren(new e.Declaration(b,a,null,null,p.i,c,(!0)))):a?f.push(new e.Paren(a)):i("badly formed media feature definition"):i("Missing closing ')'","Parse"));while(a);if(p.forget(),f.length>0)return new e.Expression(f)},mediaFeatures:function(){var a,b=this.entities,c=[];do if(a=this.mediaFeature()){if(c.push(a),!p.$char(","))break}else if(a=b.variable(),a&&(c.push(a),!p.$char(",")))break;while(a);return c.length>0?c:null},media:function(){var b,d,f,g,h=p.i;return a.dumpLineNumbers&&(g=m(h)),p.save(),p.$str("@media")?(b=this.mediaFeatures(),d=this.block(),d||i("media definitions require block statements after any features"),p.forget(),f=new e.Media(d,b,h,c),a.dumpLineNumbers&&(f.debugInfo=g),f):void p.restore()},plugin:function(){var a,b,d,f=p.i,g=p.$re(/^@plugin?\s+/);if(g){if(b=this.pluginArgs(),d=b?{pluginArgs:b,isPlugin:!0}:{isPlugin:!0},a=this.entities.quoted()||this.entities.url())return p.$char(";")||(p.i=f, +i("missing semi-colon on @plugin")),new e.Import(a,null,d,f,c);p.i=f,i("malformed @plugin statement")}},pluginArgs:function(){if(p.save(),!p.$char("("))return p.restore(),null;var a=p.$re(/^\s*([^\);]+)\)\s*/);return a[1]?(p.forget(),a[1].trim()):(p.restore(),null)},atrule:function(){var b,d,f,g,h,j,k,l=p.i,n=!0,o=!0;if("@"===p.currentChar()){if(d=this["import"]()||this.plugin()||this.media())return d;if(p.save(),b=p.$re(/^@[a-z-]+/)){switch(g=b,"-"==b.charAt(1)&&b.indexOf("-",2)>0&&(g="@"+b.slice(b.indexOf("-",2)+1)),g){case"@charset":h=!0,n=!1;break;case"@namespace":j=!0,n=!1;break;case"@keyframes":case"@counter-style":h=!0;break;case"@document":case"@supports":k=!0,o=!1;break;default:k=!0}return p.commentStore.length=0,h?(d=this.entity(),d||i("expected "+b+" identifier")):j?(d=this.expression(),d||i("expected "+b+" expression")):k&&(d=(p.$re(/^[^{;]+/)||"").trim(),n="{"==p.currentChar(),d&&(d=new e.Anonymous(d))),n&&(f=this.blockRuleset()),f||!n&&d&&p.$char(";")?(p.forget(),new e.AtRule(b,d,f,l,c,a.dumpLineNumbers?m(l):null,o)):void p.restore("at-rule options not recognised")}}},value:function(){var a,b=[],c=p.i;do if(a=this.expression(),a&&(b.push(a),!p.$char(",")))break;while(a);if(b.length>0)return new e.Value(b,c)},important:function(){if("!"===p.currentChar())return p.$re(/^! *important/)},sub:function(){var a,b;return p.save(),p.$char("(")?(a=this.addition(),a&&p.$char(")")?(p.forget(),b=new e.Expression([a]),b.parens=!0,b):void p.restore("Expected ')'")):void p.restore()},multiplication:function(){var a,b,c,d,f;if(a=this.operand()){for(f=p.isWhitespace(-1);;){if(p.peek(/^\/[*\/]/))break;if(p.save(),c=p.$char("/")||p.$char("*"),!c){p.forget();break}if(b=this.operand(),!b){p.restore();break}p.forget(),a.parensInOp=!0,b.parensInOp=!0,d=new e.Operation(c,[d||a,b],f),f=p.isWhitespace(-1)}return d||a}},addition:function(){var a,b,c,d,f;if(a=this.multiplication()){for(f=p.isWhitespace(-1);;){if(c=p.$re(/^[-+]\s+/)||!f&&(p.$char("+")||p.$char("-")),!c)break;if(b=this.multiplication(),!b)break;a.parensInOp=!0,b.parensInOp=!0,d=new e.Operation(c,[d||a,b],f),f=p.isWhitespace(-1)}return d||a}},conditions:function(){var a,b,c,d=p.i;if(a=this.condition()){for(;;){if(!p.peek(/^,\s*(not\s*)?\(/)||!p.$char(","))break;if(b=this.condition(),!b)break;c=new e.Condition("or",c||a,b,d)}return c||a}},condition:function(){function a(){return p.$str("or")}var b,c,d;if(b=this.conditionAnd(this)){if(c=a()){if(d=this.condition(),!d)return;b=new e.Condition(c,b,d)}return b}},conditionAnd:function(){function a(a){return a.negatedCondition()||a.parenthesisCondition()}function b(){return p.$str("and")}var c,d,f;if(c=a(this)){if(d=b()){if(f=this.conditionAnd(),!f)return;c=new e.Condition(d,c,f)}return c}},negatedCondition:function(){if(p.$str("not")){var a=this.parenthesisCondition();return a&&(a.negate=!a.negate),a}},parenthesisCondition:function(){function a(a){var b;return p.save(),(b=a.condition())&&p.$char(")")?(p.forget(),b):void p.restore()}var b;return p.save(),p.$str("(")?(b=a(this))?(p.forget(),b):(b=this.atomicCondition())?p.$char(")")?(p.forget(),b):void p.restore("expected ')' got '"+p.currentChar()+"'"):void p.restore():void p.restore()},atomicCondition:function(){var a,b,c,d,f=this.entities,g=p.i;if(a=this.addition()||f.keyword()||f.quoted())return p.$char(">")?d=p.$char("=")?">=":">":p.$char("<")?d=p.$char("=")?"<=":"<":p.$char("=")&&(d=p.$char(">")?"=>":p.$char("<")?"=<":"="),d?(b=this.addition()||f.keyword()||f.quoted(),b?c=new e.Condition(d,a,b,g,(!1)):i("expected expression")):c=new e.Condition("=",a,new e.Keyword("true"),g,(!1)),c},operand:function(){var a,b=this.entities;p.peek(/^-[@\$\(]/)&&(a=p.$char("-"));var c=this.sub()||b.dimension()||b.color()||b.variable()||b.property()||b.call()||b.colorKeyword();return a&&(c.parensInOp=!0,c=new e.Negative(c)),c},expression:function(){var a,b,c=[],d=p.i;do a=this.comment(),a?c.push(a):(a=this.addition()||this.entity(),a&&(c.push(a),p.peek(/^\/[\/*]/)||(b=p.$char("/"),b&&c.push(new e.Anonymous(b,d)))));while(a);if(c.length>0)return new e.Expression(c)},property:function(){var a=p.$re(/^(\*?-?[_a-zA-Z0-9-]+)\s*:/);if(a)return a[1]},ruleProperty:function(){function a(a){var b=p.i,c=p.$re(a);if(c)return g.push(b),f.push(c[1])}var b,d,f=[],g=[];p.save();var h=p.$re(/^([_a-zA-Z0-9-]+)\s*:/);if(h)return f=[new e.Keyword(h[1])],p.forget(),f;for(a(/^(\*?)/);;)if(!a(/^((?:[\w-]+)|(?:[@\$]\{[\w-]+\}))/))break;if(f.length>1&&a(/^((?:\+_|\+)?)\s*:/)){for(p.forget(),""===f[0]&&(f.shift(),g.shift()),d=0;d=b);c++);this.preProcessors.splice(c,0,{preProcessor:a,priority:b})},g.prototype.addPostProcessor=function(a,b){var c;for(c=0;c=b);c++);this.postProcessors.splice(c,0,{postProcessor:a,priority:b})},g.prototype.addFileManager=function(a){this.fileManagers.push(a)},g.prototype.getPreProcessors=function(){for(var a=[],b=0;b0){var d,e=JSON.stringify(this._sourceMapGenerator.toJSON());this.sourceMapURL?d=this.sourceMapURL:this._sourceMapFilename&&(d=this._sourceMapFilename),this.sourceMapURL=d,this.sourceMap=e}return this._css.join("")},b}},{}],47:[function(a,b,c){var d=a("./contexts"),e=a("./visitors"),f=a("./tree");b.exports=function(a,b){b=b||{};var c,g=b.variables,h=new d.Eval(b);"object"!=typeof g||Array.isArray(g)||(g=Object.keys(g).map(function(a){var b=g[a];return b instanceof f.Value||(b instanceof f.Expression||(b=new f.Expression([b])),b=new f.Value([b])),new f.Declaration("@"+a,b,(!1),null,0)}),h.frames=[new f.Ruleset(null,g)]);var i,j,k=[new e.JoinSelectorVisitor,new e.MarkVisibleSelectorsVisitor((!0)),new e.ExtendVisitor,new e.ToCSSVisitor({compress:Boolean(b.compress)})];if(b.pluginManager)for(j=b.pluginManager.visitor(),j.first();i=j.get();)i.isPreEvalVisitor&&i.run(a);c=a.eval(h);for(var l=0;l.5?j/(2-g-h):j/(g+h),g){case c:a=(d-e)/j+(d="===a||"=<"===a||"<="===a;case 1:return">"===a||">="===a;default:return!1}}}(this.op,this.lvalue.eval(a),this.rvalue.eval(a));return this.negate?!b:b},b.exports=e},{"./node":74}],57:[function(a,b,c){var d=function(a,b,c){var e="";if(a.dumpLineNumbers&&!a.compress)switch(a.dumpLineNumbers){case"comments":e=d.asComment(b);break;case"mediaquery":e=d.asMediaQuery(b);break;case"all":e=d.asComment(b)+(c||"")+d.asMediaQuery(b)}return e};d.asComment=function(a){return"/* line "+a.debugInfo.lineNumber+", "+a.debugInfo.fileName+" */\n"},d.asMediaQuery=function(a){var b=a.debugInfo.fileName;return/^[a-z]+:\/\//i.test(b)||(b="file://"+b),"@media -sass-debug-info{filename{font-family:"+b.replace(/([.:\/\\])/g,function(a){return"\\"==a&&(a="/"),"\\"+a})+"}line{font-family:\\00003"+a.debugInfo.lineNumber+"}}\n"},b.exports=d},{}],58:[function(a,b,c){function d(a,b){var c,d="",e=b.length,f={add:function(a){d+=a}};for(c=0;c-1e-6&&(d=c.toFixed(20).replace(/0+$/,"")),a&&a.compress){if(0===c&&this.unit.isLength())return void b.add(d);c>0&&c<1&&(d=d.substr(1))}b.add(d),this.unit.genCSS(a,b)},h.prototype.operate=function(a,b,c){var d=this._operate(a,b,this.value,c.value),e=this.unit.clone();if("+"===b||"-"===b)if(0===e.numerator.length&&0===e.denominator.length)e=c.unit.clone(),this.unit.backupUnit&&(e.backupUnit=this.unit.backupUnit);else if(0===c.unit.numerator.length&&0===e.denominator.length);else{if(c=c.convertTo(this.unit.usedUnits()),a.strictUnits&&c.unit.toString()!==e.toString())throw new Error("Incompatible units. Change the units or use the unit function. Bad units: '"+e.toString()+"' and '"+c.unit.toString()+"'.");d=this._operate(a,b,this.value,c.value)}else"*"===b?(e.numerator=e.numerator.concat(c.unit.numerator).sort(),e.denominator=e.denominator.concat(c.unit.denominator).sort(),e.cancel()):"/"===b&&(e.numerator=e.numerator.concat(c.unit.denominator).sort(),e.denominator=e.denominator.concat(c.unit.numerator).sort(),e.cancel());return new h(d,e)},h.prototype.compare=function(a){var b,c;if(a instanceof h){if(this.unit.isEmpty()||a.unit.isEmpty())b=this,c=a;else if(b=this.unify(),c=a.unify(),0!==b.unit.compare(c.unit))return;return d.numericCompare(b.value,c.value)}},h.prototype.unify=function(){return this.convertTo({length:"px",duration:"s",angle:"rad"})},h.prototype.convertTo=function(a){var b,c,d,f,g,i=this.value,j=this.unit.clone(),k={};if("string"==typeof a){for(b in e)e[b].hasOwnProperty(a)&&(k={},k[b]=a);a=k}g=function(a,b){return d.hasOwnProperty(a)?(b?i/=d[a]/d[f]:i*=d[a]/d[f],f):a};for(c in a)a.hasOwnProperty(c)&&(f=a[c],d=e[c],j.map(g));return j.cancel(),new h(i,j)},b.exports=h},{"../data/unit-conversions":15,"./color":53,"./node":74,"./unit":83}],61:[function(a,b,c){var d=a("./atrule"),e=function(){var a=Array.prototype.slice.call(arguments);d.apply(this,a)};e.prototype=Object.create(d.prototype),e.prototype.constructor=e,b.exports=e},{"./atrule":50}],62:[function(a,b,c){var d=a("./node"),e=a("./paren"),f=a("./combinator"),g=function(a,b,c,d,e){this.combinator=a instanceof f?a:new f(a),this.value="string"==typeof b?b.trim():b?b:"",this._index=c,this._fileInfo=d,this.copyVisibilityInfo(e),this.setParent(this.combinator,this)};g.prototype=new d,g.prototype.type="Element",g.prototype.accept=function(a){var b=this.value;this.combinator=a.visit(this.combinator),"object"==typeof b&&(this.value=a.visit(b))},g.prototype.eval=function(a){return new g(this.combinator,this.value.eval?this.value.eval(a):this.value,this.getIndex(),this.fileInfo(),this.visibilityInfo())},g.prototype.clone=function(){return new g(this.combinator,this.value,this.getIndex(),this.fileInfo(),this.visibilityInfo())},g.prototype.genCSS=function(a,b){b.add(this.toCSS(a),this.fileInfo(),this.getIndex())},g.prototype.toCSS=function(a){a=a||{};var b=this.value,c=a.firstSelector;return b instanceof e&&(a.firstSelector=!0),b=b.toCSS?b.toCSS(a):b,a.firstSelector=c,""===b&&"&"===this.combinator.value.charAt(0)?"":this.combinator.toCSS(a)+b},b.exports=g},{"./combinator":54,"./node":74,"./paren":76}],63:[function(a,b,c){var d=a("./node"),e=a("./paren"),f=a("./comment"),g=function(a){if(this.value=a,!a)throw new Error("Expression requires an array parameter")};g.prototype=new d,g.prototype.type="Expression",g.prototype.accept=function(a){this.value=a.visitArray(this.value)},g.prototype.eval=function(a){var b,c=this.parens&&!this.parensInOp,d=!1;return c&&a.inParenthesis(),this.value.length>1?b=new g(this.value.map(function(b){return b.eval(a)})):1===this.value.length?(this.value[0].parens&&!this.value[0].parensInOp&&(d=!0),b=this.value[0].eval(a)):b=this,c&&a.outOfParenthesis(),this.parens&&this.parensInOp&&!a.isMathOn()&&!d&&(b=new e(b)),b},g.prototype.genCSS=function(a,b){for(var c=0;c0&&c.length&&""===c[0].combinator.value&&(c[0].combinator.value=" "),d=d.concat(a[b].elements);this.selfSelectors=[new e(d)],this.selfSelectors[0].copyVisibilityInfo(this.visibilityInfo())},b.exports=f},{"./node":74,"./selector":81}],65:[function(a,b,c){var d=a("./node"),e=a("./media"),f=a("./url"),g=a("./quoted"),h=a("./ruleset"),i=a("./anonymous"),j=a("../utils"),k=a("../less-error"),l=function(a,b,c,d,e,f){if(this.options=c,this._index=d,this._fileInfo=e,this.path=a,this.features=b,this.allowRoot=!0,void 0!==this.options.less||this.options.inline)this.css=!this.options.less||this.options.inline;else{var g=this.getPath();g&&/[#\.\&\?]css([\?;].*)?$/.test(g)&&(this.css=!0)}this.copyVisibilityInfo(f),this.setParent(this.features,this),this.setParent(this.path,this)};l.prototype=new d,l.prototype.type="Import",l.prototype.accept=function(a){this.features&&(this.features=a.visit(this.features)),this.path=a.visit(this.path),this.options.isPlugin||this.options.inline||!this.root||(this.root=a.visit(this.root))},l.prototype.genCSS=function(a,b){this.css&&void 0===this.path._fileInfo.reference&&(b.add("@import ",this._fileInfo,this._index),this.path.genCSS(a,b),this.features&&(b.add(" "),this.features.genCSS(a,b)),b.add(";"))},l.prototype.getPath=function(){return this.path instanceof f?this.path.value.value:this.path.value},l.prototype.isVariableImport=function(){var a=this.path;return a instanceof f&&(a=a.value),!(a instanceof g)||a.containsVariables()},l.prototype.evalForImport=function(a){var b=this.path;return b instanceof f&&(b=b.value),new l(b.eval(a),this.features,this.options,this._index,this._fileInfo,this.visibilityInfo())},l.prototype.evalPath=function(a){var b=this.path.eval(a),c=this._fileInfo&&this._fileInfo.rootpath;if(!(b instanceof f)){if(c){var d=b.value;d&&a.isPathRelative(d)&&(b.value=c+d); +}b.value=a.normalizePath(b.value)}return b},l.prototype.eval=function(a){var b=this.doEval(a);return(this.options.reference||this.blocksVisibility())&&(b.length||0===b.length?b.forEach(function(a){a.addVisibilityBlock()}):b.addVisibilityBlock()),b},l.prototype.doEval=function(a){var b,c,d=this.features&&this.features.eval(a);if(this.options.isPlugin){if(this.root&&this.root.eval)try{this.root.eval(a)}catch(f){throw f.message="Plugin error during evaluation",new k(f,this.root.imports,this.root.filename)}return c=a.frames[0]&&a.frames[0].functionRegistry,c&&this.root&&this.root.functions&&c.addMultiple(this.root.functions),[]}if(this.skip&&("function"==typeof this.skip&&(this.skip=this.skip()),this.skip))return[];if(this.options.inline){var g=new i(this.root,0,{filename:this.importedFilename,reference:this.path._fileInfo&&this.path._fileInfo.reference},(!0),(!0));return this.features?new e([g],this.features.value):[g]}if(this.css){var m=new l(this.evalPath(a),d,this.options,this._index);if(!m.css&&this.error)throw this.error;return m}return b=new h(null,j.copyArray(this.root.rules)),b.evalImports(a),this.features?new e(b.rules,this.features.value):b.rules},b.exports=l},{"../less-error":36,"../utils":88,"./anonymous":48,"./media":70,"./node":74,"./quoted":78,"./ruleset":80,"./url":84}],66:[function(a,b,c){var d=Object.create(null);d.Node=a("./node"),d.Color=a("./color"),d.AtRule=a("./atrule"),d.Directive=a("./directive"),d.DetachedRuleset=a("./detached-ruleset"),d.Operation=a("./operation"),d.Dimension=a("./dimension"),d.Unit=a("./unit"),d.Keyword=a("./keyword"),d.Variable=a("./variable"),d.Property=a("./property"),d.Ruleset=a("./ruleset"),d.Element=a("./element"),d.Attribute=a("./attribute"),d.Combinator=a("./combinator"),d.Selector=a("./selector"),d.Quoted=a("./quoted"),d.Expression=a("./expression"),d.Declaration=a("./declaration"),d.Rule=a("./rule"),d.Call=a("./call"),d.URL=a("./url"),d.Import=a("./import"),d.mixin={Call:a("./mixin-call"),Definition:a("./mixin-definition")},d.Comment=a("./comment"),d.Anonymous=a("./anonymous"),d.Value=a("./value"),d.JavaScript=a("./javascript"),d.Assignment=a("./assignment"),d.Condition=a("./condition"),d.Paren=a("./paren"),d.Media=a("./media"),d.UnicodeDescriptor=a("./unicode-descriptor"),d.Negative=a("./negative"),d.Extend=a("./extend"),d.VariableCall=a("./variable-call"),b.exports=d},{"./anonymous":48,"./assignment":49,"./atrule":50,"./attribute":51,"./call":52,"./color":53,"./combinator":54,"./comment":55,"./condition":56,"./declaration":58,"./detached-ruleset":59,"./dimension":60,"./directive":61,"./element":62,"./expression":63,"./extend":64,"./import":65,"./javascript":67,"./keyword":69,"./media":70,"./mixin-call":71,"./mixin-definition":72,"./negative":73,"./node":74,"./operation":75,"./paren":76,"./property":77,"./quoted":78,"./rule":79,"./ruleset":80,"./selector":81,"./unicode-descriptor":82,"./unit":83,"./url":84,"./value":85,"./variable":87,"./variable-call":86}],67:[function(a,b,c){var d=a("./js-eval-node"),e=a("./dimension"),f=a("./quoted"),g=a("./anonymous"),h=function(a,b,c,d){this.escaped=b,this.expression=a,this._index=c,this._fileInfo=d};h.prototype=new d,h.prototype.type="JavaScript",h.prototype.eval=function(a){var b=this.evaluateJavaScript(this.expression,a);return"number"==typeof b?new e(b):"string"==typeof b?new f('"'+b+'"',b,this.escaped,this._index):new g(Array.isArray(b)?b.join(", "):b)},b.exports=h},{"./anonymous":48,"./dimension":60,"./js-eval-node":68,"./quoted":78}],68:[function(a,b,c){var d=a("./node"),e=a("./variable"),f=function(){};f.prototype=new d,f.prototype.evaluateJavaScript=function(a,b){var c,d=this,f={};if(!b.javascriptEnabled)throw{message:"Inline JavaScript is not enabled. Is it set in your options?",filename:this.fileInfo().filename,index:this.getIndex()};a=a.replace(/@\{([\w-]+)\}/g,function(a,c){return d.jsify(new e("@"+c,d.getIndex(),d.fileInfo()).eval(b))});try{a=new Function("return ("+a+")")}catch(g){throw{message:"JavaScript evaluation error: "+g.message+" from `"+a+"`",filename:this.fileInfo().filename,index:this.getIndex()}}var h=b.frames[0].variables();for(var i in h)h.hasOwnProperty(i)&&(f[i.slice(1)]={value:h[i].value,toJS:function(){return this.value.eval(b).toCSS()}});try{c=a.call(f)}catch(g){throw{message:"JavaScript evaluation error: '"+g.name+": "+g.message.replace(/["]/g,"'")+"'",filename:this.fileInfo().filename,index:this.getIndex()}}return c},f.prototype.jsify=function(a){return Array.isArray(a.value)&&a.value.length>1?"["+a.value.map(function(a){return a.toCSS()}).join(", ")+"]":a.toCSS()},b.exports=f},{"./node":74,"./variable":87}],69:[function(a,b,c){var d=a("./node"),e=function(a){this.value=a};e.prototype=new d,e.prototype.type="Keyword",e.prototype.genCSS=function(a,b){if("%"===this.value)throw{type:"Syntax",message:"Invalid % without number"};b.add(this.value)},e.True=new e("true"),e.False=new e("false"),b.exports=e},{"./node":74}],70:[function(a,b,c){var d=a("./ruleset"),e=a("./value"),f=a("./selector"),g=a("./anonymous"),h=a("./expression"),i=a("./atrule"),j=a("../utils"),k=function(a,b,c,g,h){this._index=c,this._fileInfo=g;var i=new f([],null,null,this._index,this._fileInfo).createEmptySelectors();this.features=new e(b),this.rules=[new d(i,a)],this.rules[0].allowImports=!0,this.copyVisibilityInfo(h),this.allowRoot=!0,this.setParent(i,this),this.setParent(this.features,this),this.setParent(this.rules,this)};k.prototype=new i,k.prototype.type="Media",k.prototype.isRulesetLike=function(){return!0},k.prototype.accept=function(a){this.features&&(this.features=a.visit(this.features)),this.rules&&(this.rules=a.visitArray(this.rules))},k.prototype.genCSS=function(a,b){b.add("@media ",this._fileInfo,this._index),this.features.genCSS(a,b),this.outputRuleset(a,b,this.rules)},k.prototype.eval=function(a){a.mediaBlocks||(a.mediaBlocks=[],a.mediaPath=[]);var b=new k(null,[],this._index,this._fileInfo,this.visibilityInfo());return this.debugInfo&&(this.rules[0].debugInfo=this.debugInfo,b.debugInfo=this.debugInfo),b.features=this.features.eval(a),a.mediaPath.push(b),a.mediaBlocks.push(b),this.rules[0].functionRegistry=a.frames[0].functionRegistry.inherit(),a.frames.unshift(this.rules[0]),b.rules=[this.rules[0].eval(a)],a.frames.shift(),a.mediaPath.pop(),0===a.mediaPath.length?b.evalTop(a):b.evalNested(a)},k.prototype.evalTop=function(a){var b=this;if(a.mediaBlocks.length>1){var c=new f([],null,null,this.getIndex(),this.fileInfo()).createEmptySelectors();b=new d(c,a.mediaBlocks),b.multiMedia=!0,b.copyVisibilityInfo(this.visibilityInfo()),this.setParent(b,this)}return delete a.mediaBlocks,delete a.mediaPath,b},k.prototype.evalNested=function(a){var b,c,f=a.mediaPath.concat([this]);for(b=0;b0;b--)a.splice(b,0,new g("and"));return new h(a)})),this.setParent(this.features,this),new d([],[])},k.prototype.permute=function(a){if(0===a.length)return[];if(1===a.length)return a[0];for(var b=[],c=this.permute(a.slice(1)),d=0;d0){for(n=!0,k=0;k0)p=B;else if(p=A,q[A]+q[B]>1)throw{type:"Runtime",message:"Ambiguous use of `default()` found when matching for `"+this.format(t)+"`",index:this.getIndex(),filename:this.fileInfo().filename};for(k=0;kthis.params.length)return!1}c=Math.min(f,this.arity);for(var g=0;gb?1:void 0},d.prototype.blocksVisibility=function(){return null==this.visibilityBlocks&&(this.visibilityBlocks=0),0!==this.visibilityBlocks},d.prototype.addVisibilityBlock=function(){null==this.visibilityBlocks&&(this.visibilityBlocks=0),this.visibilityBlocks=this.visibilityBlocks+1},d.prototype.removeVisibilityBlock=function(){null==this.visibilityBlocks&&(this.visibilityBlocks=0),this.visibilityBlocks=this.visibilityBlocks-1},d.prototype.ensureVisibility=function(){this.nodeVisible=!0},d.prototype.ensureInvisibility=function(){this.nodeVisible=!1},d.prototype.isVisible=function(){return this.nodeVisible},d.prototype.visibilityInfo=function(){return{visibilityBlocks:this.visibilityBlocks,nodeVisible:this.nodeVisible}},d.prototype.copyVisibilityInfo=function(a){a&&(this.visibilityBlocks=a.visibilityBlocks,this.nodeVisible=a.nodeVisible)},b.exports=d},{}],75:[function(a,b,c){var d=a("./node"),e=a("./color"),f=a("./dimension"),g=function(a,b,c){this.op=a.trim(),this.operands=b,this.isSpaced=c};g.prototype=new d,g.prototype.type="Operation",g.prototype.accept=function(a){this.operands=a.visit(this.operands)},g.prototype.eval=function(a){var b=this.operands[0].eval(a),c=this.operands[1].eval(a);if(a.isMathOn()){if(b instanceof f&&c instanceof e&&(b=b.toColor()),c instanceof f&&b instanceof e&&(c=c.toColor()),!b.operate)throw{type:"Operation",message:"Operation on an invalid type"};return b.operate(a,this.op,c)}return new g(this.op,[b,c],this.isSpaced)},g.prototype.genCSS=function(a,b){this.operands[0].genCSS(a,b),this.isSpaced&&b.add(" "),b.add(this.op),this.isSpaced&&b.add(" "),this.operands[1].genCSS(a,b)},b.exports=g},{"./color":53,"./dimension":60,"./node":74}],76:[function(a,b,c){var d=a("./node"),e=function(a){this.value=a};e.prototype=new d,e.prototype.type="Paren",e.prototype.genCSS=function(a,b){b.add("("),this.value.genCSS(a,b),b.add(")")},e.prototype.eval=function(a){return new e(this.value.eval(a))},b.exports=e},{"./node":74}],77:[function(a,b,c){var d=a("./node"),e=a("./declaration"),f=function(a,b,c){this.name=a,this._index=b,this._fileInfo=c};f.prototype=new d,f.prototype.type="Property",f.prototype.eval=function(a){var b,c=this.name,d=a.pluginManager.less.visitors.ToCSSVisitor.prototype._mergeRules;if(this.evaluating)throw{type:"Name",message:"Recursive property reference for "+c,filename:this.fileInfo().filename,index:this.getIndex()};if(this.evaluating=!0,b=this.find(a.frames,function(b){var f,g=b.property(c);if(g){for(var h=0;hd){if(!c||c(g)){e=g.find(new i(a.elements.slice(d)),b,c);for(var j=0;j0&&b.add(k),a.firstSelector=!0,h[0].genCSS(a,b),a.firstSelector=!1,d=1;d0?(e=p.copyArray(a),f=e.pop(),g=d.createDerived(p.copyArray(f.elements))):g=d.createDerived([]),b.length>0){var h=c.combinator,i=b[0].elements[0];h.emptyOrWhitespace&&!i.combinator.emptyOrWhitespace&&(h=i.combinator),g.elements.push(new j(h,i.value,c._index,c._fileInfo)),g.elements=g.elements.concat(b[0].elements.slice(1))}if(0!==g.elements.length&&e.push(g),b.length>1){var k=b.slice(1);k=k.map(function(a){return a.createDerived(a.elements,[])}),e=e.concat(k)}return e}function g(a,b,c,d,e){var g;for(g=0;g0?d[d.length-1]=d[d.length-1].createDerived(d[d.length-1].elements.concat(a)):d.push(new i(a))}}function l(a,b,c){function m(a){var b;return a.value instanceof h?(b=a.value.value,b instanceof i?b:null):null}var n,o,p,q,r,s,t,u,v,w,x=!1;for(q=[],r=[[]],n=0;u=c.elements[n];n++)if("&"!==u.value){var y=m(u);if(null!=y){k(q,r);var z,A=[],B=[];for(z=l(A,b,y),x=x||z,p=0;p0&&t[0].elements.push(new j(u.combinator,"",u._index,u._fileInfo)),s.push(t);else for(p=0;p0&&(a.push(r[n]),w=r[n][v-1],r[n][v-1]=w.createDerived(w.elements,c.extendList));return x}function m(a,b){var c=b.createDerived(b.elements,b.extendList,b.evaldCondition);return c.copyVisibilityInfo(a),c}var n,o,q;if(o=[],q=l(o,b,c),!q)if(b.length>0)for(o=[],n=0;n0)for(b=0;b=0&&"\n"!==b.charAt(c);)e++;return"number"==typeof a&&(d=(b.slice(0,a).match(/\n/g)||"").length),{line:d,column:e}},copyArray:function(a){var b,c=a.length,d=new Array(c);for(b=0;b=0||(i=[k.selfSelectors[0]],g=n.findMatch(j,i),g.length&&(j.hasFoundMatches=!0,j.selfSelectors.forEach(function(a){var b=k.visibilityInfo();h=n.extendSelector(g,i,a,j.isVisible()),l=new d.Extend(k.selector,k.option,0,k.fileInfo(),b),l.selfSelectors=h,h[h.length-1].extendList=[l],m.push(l),l.ruleset=k.ruleset,l.parent_ids=l.parent_ids.concat(k.parent_ids,j.parent_ids),k.firstExtendOnThisSelectorPath&&(l.firstExtendOnThisSelectorPath=!0,k.ruleset.paths.push(h))})));if(m.length){if(this.extendChainCount++,c>100){var o="{unable to calculate}",p="{unable to calculate}";try{o=m[0].selfSelectors[0].toCSS(),p=m[0].selector.toCSS()}catch(q){}throw{message:"extend circular reference detected. One of the circular extends is currently:"+o+":extend("+p+")"}}return m.concat(n.doExtendChaining(m,b,c+1))}return m},visitDeclaration:function(a,b){b.visitDeeper=!1},visitMixinDefinition:function(a,b){b.visitDeeper=!1},visitSelector:function(a,b){b.visitDeeper=!1},visitRuleset:function(a,b){if(!a.root){var c,d,e,f,g=this.allExtendsStack[this.allExtendsStack.length-1],h=[],i=this;for(e=0;e0&&k[i.matched].combinator.value!==g?i=null:i.matched++,i&&(i.finished=i.matched===k.length,i.finished&&!a.allowAfter&&(e+1k&&l>0&&(m[m.length-1].elements=m[m.length-1].elements.concat(b[k].elements.slice(l)),l=0,k++),j=g.elements.slice(l,i.index).concat([h]).concat(c.elements.slice(1)),k===i.pathIndex&&f>0?m[m.length-1].elements=m[m.length-1].elements.concat(j):(m=m.concat(b.slice(k,i.pathIndex)),m.push(new d.Selector(j))),k=i.endPathIndex,l=i.endPathElementIndex,l>=b[k].elements.length&&(l=0,k++);return k0&&(m[m.length-1].elements=m[m.length-1].elements.concat(b[k].elements.slice(l)),k++),m=m.concat(b.slice(k,b.length)),m=m.map(function(a){var b=a.createDerived(a.elements);return e?b.ensureVisibility():b.ensureInvisibility(),b})},visitMedia:function(a,b){var c=a.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);c=c.concat(this.doExtendChaining(c,a.allExtends)),this.allExtendsStack.push(c)},visitMediaOut:function(a){var b=this.allExtendsStack.length-1;this.allExtendsStack.length=b},visitAtRule:function(a,b){var c=a.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);c=c.concat(this.doExtendChaining(c,a.allExtends)),this.allExtendsStack.push(c)},visitAtRuleOut:function(a){var b=this.allExtendsStack.length-1;this.allExtendsStack.length=b}},b.exports=i},{"../logger":37,"../tree":66,"../utils":88,"./visitor":96}],90:[function(a,b,c){function d(a){this.imports=[],this.variableImports=[],this._onSequencerEmpty=a,this._currentDepth=0}d.prototype.addImport=function(a){var b=this,c={callback:a,args:null,isReady:!1};return this.imports.push(c),function(){c.args=Array.prototype.slice.call(arguments,0),c.isReady=!0,b.tryRun()}},d.prototype.addVariableImport=function(a){this.variableImports.push(a)},d.prototype.tryRun=function(){this._currentDepth++;try{for(;;){for(;this.imports.length>0;){var a=this.imports[0];if(!a.isReady)return;this.imports=this.imports.slice(1),a.callback.apply(null,a.args)}if(0===this.variableImports.length)break;var b=this.variableImports[0];this.variableImports=this.variableImports.slice(1),b()}}finally{this._currentDepth--}0===this._currentDepth&&this._onSequencerEmpty&&this._onSequencerEmpty()},b.exports=d},{}],91:[function(a,b,c){var d=a("../contexts"),e=a("./visitor"),f=a("./import-sequencer"),g=a("../utils"),h=function(a,b){this._visitor=new e(this),this._importer=a,this._finish=b,this.context=new d.Eval,this.importCount=0,this.onceFileDetectionMap={},this.recursionDetector={},this._sequencer=new f(this._onSequencerEmpty.bind(this))};h.prototype={isReplacing:!1,run:function(a){try{this._visitor.visit(a)}catch(b){this.error=b}this.isFinished=!0,this._sequencer.tryRun()},_onSequencerEmpty:function(){this.isFinished&&this._finish(this.error)},visitImport:function(a,b){var c=a.options.inline;if(!a.css||c){var e=new d.Eval(this.context,g.copyArray(this.context.frames)),f=e.frames[0];this.importCount++,a.isVariableImport()?this._sequencer.addVariableImport(this.processImportNode.bind(this,a,e,f)):this.processImportNode(a,e,f)}b.visitDeeper=!1},processImportNode:function(a,b,c){var d,e=a.options.inline;try{d=a.evalForImport(b)}catch(f){f.filename||(f.index=a.getIndex(),f.filename=a.fileInfo().filename),a.css=!0,a.error=f}if(!d||d.css&&!e)this.importCount--,this.isFinished&&this._sequencer.tryRun();else{d.options.multiple&&(b.importMultiple=!0);for(var g=void 0===d.css,h=0;h0},resolveVisibility:function(a,b){if(!a.blocksVisibility()){if(this.isEmpty(a)&&!this.containsSilentNonBlockedChild(b))return;return a}var c=a.rules[0];if(this.keepOnlyVisibleChilds(c),!this.isEmpty(c))return a.ensureVisibility(),a.removeVisibilityBlock(),a},isVisibleRuleset:function(a){return!!a.firstRoot||!this.isEmpty(a)&&!(!a.root&&!this.hasVisibleSelector(a))}};var g=function(a){this._visitor=new e(this),this._context=a,this.utils=new f(a)};g.prototype={isReplacing:!0,run:function(a){return this._visitor.visit(a)},visitDeclaration:function(a,b){if(!a.blocksVisibility()&&!a.variable)return a},visitMixinDefinition:function(a,b){a.frames=[]},visitExtend:function(a,b){},visitComment:function(a,b){if(!a.blocksVisibility()&&!a.isSilent(this._context))return a},visitMedia:function(a,b){var c=a.rules[0].rules;return a.accept(this._visitor),b.visitDeeper=!1,this.utils.resolveVisibility(a,c)},visitImport:function(a,b){if(!a.blocksVisibility())return a},visitAtRule:function(a,b){return a.rules&&a.rules.length?this.visitAtRuleWithBody(a,b):this.visitAtRuleWithoutBody(a,b)},visitAnonymous:function(a,b){if(!a.blocksVisibility())return a.accept(this._visitor),a},visitAtRuleWithBody:function(a,b){function c(a){var b=a.rules;return 1===b.length&&(!b[0].paths||0===b[0].paths.length)}function d(a){var b=a.rules;return c(a)?b[0].rules:b}var e=d(a);return a.accept(this._visitor),b.visitDeeper=!1,this.utils.isEmpty(a)||this._mergeRules(a.rules[0].rules),this.utils.resolveVisibility(a,e)},visitAtRuleWithoutBody:function(a,b){if(!a.blocksVisibility()){if("@charset"===a.name){if(this.charset){if(a.debugInfo){var c=new d.Comment("/* "+a.toCSS(this._context).replace(/\n/g,"")+" */\n");return c.debugInfo=a.debugInfo,this._visitor.visit(c)}return}this.charset=!0}return a}},checkValidNodes:function(a,b){if(a)for(var c=0;c0?a.accept(this._visitor):a.rules=null,b.visitDeeper=!1}return a.rules&&(this._mergeRules(a.rules),this._removeDuplicateRules(a.rules)),this.utils.isVisibleRuleset(a)&&(a.ensureVisibility(),d.splice(0,0,a)),1===d.length?d[0]:d},_compileRulesetPaths:function(a){a.paths&&(a.paths=a.paths.filter(function(a){var b;for(" "===a[0].elements[0].combinator.value&&(a[0].elements[0].combinator=new d.Combinator("")),b=0;b=0;e--)if(c=a[e],c instanceof d.Declaration)if(f[c.name]){b=f[c.name],b instanceof d.Declaration&&(b=f[c.name]=[f[c.name].toCSS(this._context)]);var g=c.toCSS(this._context);b.indexOf(g)!==-1?a.splice(e,1):b.push(g)}else f[c.name]=c}},_mergeRules:function(a){if(a){for(var b={},c=[],e=0;e0){var b=a[0],c=[],e=[new d.Expression(c)];a.forEach(function(a){"+"===a.merge&&c.length>0&&e.push(new d.Expression(c=[])),c.push(a.value),b.important=b.important||a.important}),b.value=new d.Value(e)}})}}},b.exports=g},{"../tree":66,"./visitor":96}],96:[function(a,b,c){function d(a){return a}function e(a,b){var c,d;for(c in a)switch(d=a[c],typeof d){case"function":d.prototype&&d.prototype.type&&(d.prototype.typeIndex=b++);break;case"object":b=e(d,b)}return b}var f=a("../tree"),g={visitDeeper:!0},h=!1,i=function(a){this._implementation=a,this._visitFnCache=[],h||(e(f,1),h=!0)};i.prototype={visit:function(a){if(!a)return a;var b=a.typeIndex;if(!b)return a;var c,e=this._visitFnCache,f=this._implementation,h=b<<1,i=1|h,j=e[h],k=e[i],l=g;if(l.visitDeeper=!0,j||(c="visit"+a.type,j=f[c]||d,k=f[c+"Out"]||d,e[h]=j,e[i]=k),j!==d){var m=j.call(f,a,l);f.isReplacing&&(a=m)}return l.visitDeeper&&a&&a.accept&&a.accept(this),k!=d&&k.call(f,a),a},visitArray:function(a,b){if(!a)return a;var c,d=a.length;if(b||!this._implementation.isReplacing){for(c=0;ck){for(var b=0,c=h.length-j;b