aboutsummaryrefslogtreecommitdiff
path: root/node_modules/cssnano/dist
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/cssnano/dist')
-rw-r--r--node_modules/cssnano/dist/index.js310
-rw-r--r--node_modules/cssnano/dist/lib/core.js46
-rw-r--r--node_modules/cssnano/dist/lib/evenValues.js8
-rw-r--r--node_modules/cssnano/dist/lib/filterOptimiser.js26
-rw-r--r--node_modules/cssnano/dist/lib/functionOptimiser.js46
-rw-r--r--node_modules/cssnano/dist/lib/getArguments.js15
-rw-r--r--node_modules/cssnano/dist/lib/getMatch.js14
-rw-r--r--node_modules/cssnano/dist/lib/normalizeString.js228
-rw-r--r--node_modules/cssnano/dist/lib/normalizeUnicode.js67
-rw-r--r--node_modules/cssnano/dist/lib/reduceBackgroundRepeat.js93
-rw-r--r--node_modules/cssnano/dist/lib/reduceDisplayValues.js55
-rw-r--r--node_modules/cssnano/dist/lib/reducePositions.js119
-rw-r--r--node_modules/cssnano/dist/lib/reduceTimingFunctions.js67
-rw-r--r--node_modules/cssnano/dist/lib/styleCache.js24
14 files changed, 1118 insertions, 0 deletions
diff --git a/node_modules/cssnano/dist/index.js b/node_modules/cssnano/dist/index.js
new file mode 100644
index 00000000..7f3b09b8
--- /dev/null
+++ b/node_modules/cssnano/dist/index.js
@@ -0,0 +1,310 @@
+'use strict';
+
+exports.__esModule = true;
+
+var _decamelize = require('decamelize');
+
+var _decamelize2 = _interopRequireDefault(_decamelize);
+
+var _defined = require('defined');
+
+var _defined2 = _interopRequireDefault(_defined);
+
+var _objectAssign = require('object-assign');
+
+var _objectAssign2 = _interopRequireDefault(_objectAssign);
+
+var _postcss = require('postcss');
+
+var _postcss2 = _interopRequireDefault(_postcss);
+
+var _postcssFilterPlugins2 = require('postcss-filter-plugins');
+
+var _postcssFilterPlugins3 = _interopRequireDefault(_postcssFilterPlugins2);
+
+var _postcssDiscardComments = require('postcss-discard-comments');
+
+var _postcssDiscardComments2 = _interopRequireDefault(_postcssDiscardComments);
+
+var _postcssReduceInitial = require('postcss-reduce-initial');
+
+var _postcssReduceInitial2 = _interopRequireDefault(_postcssReduceInitial);
+
+var _postcssMinifyGradients = require('postcss-minify-gradients');
+
+var _postcssMinifyGradients2 = _interopRequireDefault(_postcssMinifyGradients);
+
+var _postcssSvgo = require('postcss-svgo');
+
+var _postcssSvgo2 = _interopRequireDefault(_postcssSvgo);
+
+var _postcssReduceTransforms = require('postcss-reduce-transforms');
+
+var _postcssReduceTransforms2 = _interopRequireDefault(_postcssReduceTransforms);
+
+var _autoprefixer = require('autoprefixer');
+
+var _autoprefixer2 = _interopRequireDefault(_autoprefixer);
+
+var _postcssZindex = require('postcss-zindex');
+
+var _postcssZindex2 = _interopRequireDefault(_postcssZindex);
+
+var _postcssConvertValues = require('postcss-convert-values');
+
+var _postcssConvertValues2 = _interopRequireDefault(_postcssConvertValues);
+
+var _postcssCalc = require('postcss-calc');
+
+var _postcssCalc2 = _interopRequireDefault(_postcssCalc);
+
+var _postcssColormin = require('postcss-colormin');
+
+var _postcssColormin2 = _interopRequireDefault(_postcssColormin);
+
+var _postcssOrderedValues = require('postcss-ordered-values');
+
+var _postcssOrderedValues2 = _interopRequireDefault(_postcssOrderedValues);
+
+var _postcssMinifySelectors = require('postcss-minify-selectors');
+
+var _postcssMinifySelectors2 = _interopRequireDefault(_postcssMinifySelectors);
+
+var _postcssMinifyParams = require('postcss-minify-params');
+
+var _postcssMinifyParams2 = _interopRequireDefault(_postcssMinifyParams);
+
+var _postcssNormalizeCharset = require('postcss-normalize-charset');
+
+var _postcssNormalizeCharset2 = _interopRequireDefault(_postcssNormalizeCharset);
+
+var _postcssMinifyFontValues = require('postcss-minify-font-values');
+
+var _postcssMinifyFontValues2 = _interopRequireDefault(_postcssMinifyFontValues);
+
+var _postcssDiscardUnused = require('postcss-discard-unused');
+
+var _postcssDiscardUnused2 = _interopRequireDefault(_postcssDiscardUnused);
+
+var _postcssNormalizeUrl = require('postcss-normalize-url');
+
+var _postcssNormalizeUrl2 = _interopRequireDefault(_postcssNormalizeUrl);
+
+var _postcssMergeIdents = require('postcss-merge-idents');
+
+var _postcssMergeIdents2 = _interopRequireDefault(_postcssMergeIdents);
+
+var _postcssReduceIdents = require('postcss-reduce-idents');
+
+var _postcssReduceIdents2 = _interopRequireDefault(_postcssReduceIdents);
+
+var _postcssMergeLonghand = require('postcss-merge-longhand');
+
+var _postcssMergeLonghand2 = _interopRequireDefault(_postcssMergeLonghand);
+
+var _postcssDiscardDuplicates = require('postcss-discard-duplicates');
+
+var _postcssDiscardDuplicates2 = _interopRequireDefault(_postcssDiscardDuplicates);
+
+var _postcssDiscardOverridden = require('postcss-discard-overridden');
+
+var _postcssDiscardOverridden2 = _interopRequireDefault(_postcssDiscardOverridden);
+
+var _postcssMergeRules = require('postcss-merge-rules');
+
+var _postcssMergeRules2 = _interopRequireDefault(_postcssMergeRules);
+
+var _postcssDiscardEmpty = require('postcss-discard-empty');
+
+var _postcssDiscardEmpty2 = _interopRequireDefault(_postcssDiscardEmpty);
+
+var _postcssUniqueSelectors = require('postcss-unique-selectors');
+
+var _postcssUniqueSelectors2 = _interopRequireDefault(_postcssUniqueSelectors);
+
+var _functionOptimiser = require('./lib/functionOptimiser');
+
+var _functionOptimiser2 = _interopRequireDefault(_functionOptimiser);
+
+var _filterOptimiser = require('./lib/filterOptimiser');
+
+var _filterOptimiser2 = _interopRequireDefault(_filterOptimiser);
+
+var _normalizeString = require('./lib/normalizeString');
+
+var _normalizeString2 = _interopRequireDefault(_normalizeString);
+
+var _normalizeUnicode = require('./lib/normalizeUnicode');
+
+var _normalizeUnicode2 = _interopRequireDefault(_normalizeUnicode);
+
+var _reduceDisplayValues = require('./lib/reduceDisplayValues');
+
+var _reduceDisplayValues2 = _interopRequireDefault(_reduceDisplayValues);
+
+var _reduceBackgroundRepeat = require('./lib/reduceBackgroundRepeat');
+
+var _reduceBackgroundRepeat2 = _interopRequireDefault(_reduceBackgroundRepeat);
+
+var _reducePositions = require('./lib/reducePositions');
+
+var _reducePositions2 = _interopRequireDefault(_reducePositions);
+
+var _core = require('./lib/core');
+
+var _core2 = _interopRequireDefault(_core);
+
+var _reduceTimingFunctions = require('./lib/reduceTimingFunctions');
+
+var _reduceTimingFunctions2 = _interopRequireDefault(_reduceTimingFunctions);
+
+var _styleCache = require('./lib/styleCache');
+
+var _styleCache2 = _interopRequireDefault(_styleCache);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+// Processors
+var processors = {
+ postcssFilterPlugins: function postcssFilterPlugins() {
+ return (0, _postcssFilterPlugins3.default)({ silent: true });
+ },
+ postcssDiscardComments: _postcssDiscardComments2.default,
+ postcssMinifyGradients: _postcssMinifyGradients2.default,
+ postcssReduceInitial: _postcssReduceInitial2.default,
+ postcssSvgo: _postcssSvgo2.default,
+ reduceDisplayValues: _reduceDisplayValues2.default,
+ postcssReduceTransforms: _postcssReduceTransforms2.default,
+ autoprefixer: _autoprefixer2.default,
+ postcssZindex: _postcssZindex2.default,
+ postcssConvertValues: _postcssConvertValues2.default,
+ reduceTimingFunctions: _reduceTimingFunctions2.default,
+ postcssCalc: _postcssCalc2.default,
+ postcssColormin: _postcssColormin2.default,
+ postcssOrderedValues: _postcssOrderedValues2.default,
+ postcssMinifySelectors: _postcssMinifySelectors2.default,
+ postcssMinifyParams: _postcssMinifyParams2.default,
+ postcssNormalizeCharset: _postcssNormalizeCharset2.default,
+ postcssDiscardOverridden: _postcssDiscardOverridden2.default,
+ normalizeString: _normalizeString2.default,
+ normalizeUnicode: _normalizeUnicode2.default,
+ // minify-font-values should be run before discard-unused
+ postcssMinifyFontValues: _postcssMinifyFontValues2.default,
+ postcssDiscardUnused: _postcssDiscardUnused2.default,
+ postcssNormalizeUrl: _postcssNormalizeUrl2.default,
+ functionOptimiser: _functionOptimiser2.default,
+ filterOptimiser: _filterOptimiser2.default,
+ reduceBackgroundRepeat: _reduceBackgroundRepeat2.default,
+ reducePositions: _reducePositions2.default,
+ core: _core2.default,
+ // Optimisations after this are sensitive to previous optimisations in
+ // the pipe, such as whitespace normalising/selector re-ordering
+ postcssMergeIdents: _postcssMergeIdents2.default,
+ postcssReduceIdents: _postcssReduceIdents2.default,
+ postcssMergeLonghand: _postcssMergeLonghand2.default,
+ postcssDiscardDuplicates: _postcssDiscardDuplicates2.default,
+ postcssMergeRules: _postcssMergeRules2.default,
+ postcssDiscardEmpty: _postcssDiscardEmpty2.default,
+ postcssUniqueSelectors: _postcssUniqueSelectors2.default,
+ styleCache: _styleCache2.default
+};
+
+var defaultOptions = {
+ autoprefixer: {
+ add: false
+ },
+ postcssConvertValues: {
+ length: false
+ },
+ postcssNormalizeCharset: {
+ add: false
+ }
+};
+
+var safeOptions = {
+ postcssConvertValues: {
+ length: false
+ },
+ postcssDiscardUnused: {
+ disable: true
+ },
+ postcssMergeIdents: {
+ disable: true
+ },
+ postcssReduceIdents: {
+ counterStyle: false,
+ gridTemplate: false,
+ keyframes: false
+ },
+ postcssNormalizeUrl: {
+ stripWWW: false
+ },
+ postcssZindex: {
+ disable: true
+ }
+};
+
+var cssnano = _postcss2.default.plugin('cssnano', function () {
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+
+ // Prevent PostCSS from throwing when safe is defined
+ if (options.safe === true) {
+ options.isSafe = true;
+ options.safe = null;
+ }
+
+ var safe = options.isSafe;
+ var proc = (0, _postcss2.default)();
+ var warnings = [];
+
+ if (typeof options.fontFamily !== 'undefined' || typeof options.minifyFontWeight !== 'undefined') {
+ warnings.push('The fontFamily & minifyFontWeight options have been ' + 'consolidated into minifyFontValues, and are now deprecated.');
+ if (!options.minifyFontValues) {
+ options.minifyFontValues = options.fontFamily;
+ }
+ }
+
+ if (typeof options.singleCharset !== 'undefined') {
+ warnings.push('The singleCharset option has been renamed to ' + 'normalizeCharset, and is now deprecated.');
+ options.normalizeCharset = options.singleCharset;
+ }
+
+ if (warnings.length) {
+ proc.use(_postcss2.default.plugin('cssnano', function () {
+ return function (css, result) {
+ return warnings.forEach(function (w) {
+ return result.warn(w);
+ });
+ };
+ }));
+ }
+
+ Object.keys(processors).forEach(function (plugin) {
+ var shortName = plugin.replace('postcss', '');
+ shortName = shortName.slice(0, 1).toLowerCase() + shortName.slice(1);
+
+ var opts = (0, _defined2.default)(options[shortName], options[plugin], options[(0, _decamelize2.default)(plugin, '-')]);
+
+ if (opts === false) {
+ opts = { disable: true };
+ }
+
+ opts = (0, _objectAssign2.default)({}, defaultOptions[plugin], safe ? safeOptions[plugin] : null, opts);
+
+ if (!opts.disable) {
+ proc.use(processors[plugin](opts));
+ }
+ });
+
+ return proc;
+});
+
+cssnano.process = function (css) {
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+
+ options.map = options.map || (options.sourcemap ? true : null);
+ return (0, _postcss2.default)([cssnano(options)]).process(css, options);
+};
+
+exports.default = cssnano;
+module.exports = exports['default']; \ No newline at end of file
diff --git a/node_modules/cssnano/dist/lib/core.js b/node_modules/cssnano/dist/lib/core.js
new file mode 100644
index 00000000..bbf393d4
--- /dev/null
+++ b/node_modules/cssnano/dist/lib/core.js
@@ -0,0 +1,46 @@
+'use strict';
+
+exports.__esModule = true;
+
+var _postcss = require('postcss');
+
+var atrule = 'atrule';
+var decl = 'decl';
+var rule = 'rule';
+
+function minimiseWhitespace(node) {
+ var type = node.type;
+
+ if (~[decl, rule, atrule].indexOf(type) && node.raws.before) {
+ node.raws.before = node.raws.before.replace(/\s/g, '');
+ }
+ if (type === decl) {
+ // Ensure that !important values do not have any excess whitespace
+ if (node.important) {
+ node.raws.important = '!important';
+ }
+ // Remove whitespaces around ie 9 hack
+ node.value = node.value.replace(/\s*(\\9)\s*/, '$1');
+ // Remove extra semicolons and whitespace before the declaration
+ if (node.raws.before) {
+ var prev = node.prev();
+ if (prev && prev.type !== rule) {
+ node.raws.before = node.raws.before.replace(/;/g, '');
+ }
+ }
+ node.raws.between = ':';
+ node.raws.semicolon = false;
+ } else if (type === rule || type === atrule) {
+ node.raws.between = node.raws.after = '';
+ node.raws.semicolon = false;
+ }
+}
+
+exports.default = (0, _postcss.plugin)('cssnano-core', function () {
+ return function (css) {
+ css.walk(minimiseWhitespace);
+ // Remove final newline
+ css.raws.after = '';
+ };
+});
+module.exports = exports['default']; \ No newline at end of file
diff --git a/node_modules/cssnano/dist/lib/evenValues.js b/node_modules/cssnano/dist/lib/evenValues.js
new file mode 100644
index 00000000..4340aa59
--- /dev/null
+++ b/node_modules/cssnano/dist/lib/evenValues.js
@@ -0,0 +1,8 @@
+"use strict";
+
+exports.__esModule = true;
+exports.default = getEvenValues;
+function getEvenValues(list, index) {
+ return index % 2 === 0;
+}
+module.exports = exports["default"]; \ No newline at end of file
diff --git a/node_modules/cssnano/dist/lib/filterOptimiser.js b/node_modules/cssnano/dist/lib/filterOptimiser.js
new file mode 100644
index 00000000..2cb9793b
--- /dev/null
+++ b/node_modules/cssnano/dist/lib/filterOptimiser.js
@@ -0,0 +1,26 @@
+'use strict';
+
+exports.__esModule = true;
+
+var _postcss = require('postcss');
+
+var _postcssValueParser = require('postcss-value-parser');
+
+var _postcssValueParser2 = _interopRequireDefault(_postcssValueParser);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function filterOptimiser(decl) {
+ decl.value = (0, _postcssValueParser2.default)(decl.value).walk(function (node) {
+ if (node.type === 'function' || node.type === 'div' && node.value === ',') {
+ node.before = node.after = '';
+ }
+ }).toString();
+}
+
+exports.default = (0, _postcss.plugin)('cssnano-filter-optimiser', function () {
+ return function (css) {
+ return css.walkDecls(/filter/, filterOptimiser);
+ };
+});
+module.exports = exports['default']; \ No newline at end of file
diff --git a/node_modules/cssnano/dist/lib/functionOptimiser.js b/node_modules/cssnano/dist/lib/functionOptimiser.js
new file mode 100644
index 00000000..29ca07cf
--- /dev/null
+++ b/node_modules/cssnano/dist/lib/functionOptimiser.js
@@ -0,0 +1,46 @@
+'use strict';
+
+exports.__esModule = true;
+
+var _postcss = require('postcss');
+
+var _postcssValueParser = require('postcss-value-parser');
+
+var _postcssValueParser2 = _interopRequireDefault(_postcssValueParser);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function reduceCalcWhitespaces(node) {
+ if (node.type === 'space') {
+ node.value = ' ';
+ } else if (node.type === 'function') {
+ node.before = node.after = '';
+ }
+}
+
+function reduceWhitespaces(node) {
+ if (node.type === 'space') {
+ node.value = ' ';
+ } else if (node.type === 'div') {
+ node.before = node.after = '';
+ } else if (node.type === 'function') {
+ node.before = node.after = '';
+ if (node.value === 'calc') {
+ _postcssValueParser2.default.walk(node.nodes, reduceCalcWhitespaces);
+ return false;
+ }
+ }
+}
+
+function transformDecls(decl) {
+ if (!/filter/.test(decl.prop)) {
+ decl.value = (0, _postcssValueParser2.default)(decl.value).walk(reduceWhitespaces).toString();
+ }
+}
+
+exports.default = (0, _postcss.plugin)('cssnano-function-optimiser', function () {
+ return function (css) {
+ return css.walkDecls(transformDecls);
+ };
+});
+module.exports = exports['default']; \ No newline at end of file
diff --git a/node_modules/cssnano/dist/lib/getArguments.js b/node_modules/cssnano/dist/lib/getArguments.js
new file mode 100644
index 00000000..bcb5a427
--- /dev/null
+++ b/node_modules/cssnano/dist/lib/getArguments.js
@@ -0,0 +1,15 @@
+'use strict';
+
+exports.__esModule = true;
+exports.default = getArguments;
+function getArguments(node) {
+ return node.nodes.reduce(function (list, child) {
+ if (child.type !== 'div') {
+ list[list.length - 1].push(child);
+ } else {
+ list.push([]);
+ }
+ return list;
+ }, [[]]);
+}
+module.exports = exports['default']; \ No newline at end of file
diff --git a/node_modules/cssnano/dist/lib/getMatch.js b/node_modules/cssnano/dist/lib/getMatch.js
new file mode 100644
index 00000000..99cc0231
--- /dev/null
+++ b/node_modules/cssnano/dist/lib/getMatch.js
@@ -0,0 +1,14 @@
+"use strict";
+
+exports.__esModule = true;
+exports.default = getMatchFactory;
+function getMatchFactory(mappings) {
+ return function getMatch(args) {
+ return args.reduce(function (list, arg, i) {
+ return list.filter(function (keyword) {
+ return keyword[1][i] === arg;
+ });
+ }, mappings);
+ };
+}
+module.exports = exports["default"]; \ No newline at end of file
diff --git a/node_modules/cssnano/dist/lib/normalizeString.js b/node_modules/cssnano/dist/lib/normalizeString.js
new file mode 100644
index 00000000..67ce44aa
--- /dev/null
+++ b/node_modules/cssnano/dist/lib/normalizeString.js
@@ -0,0 +1,228 @@
+'use strict';
+
+exports.__esModule = true;
+
+var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
+
+var postcss = require('postcss');
+var valueParser = require('postcss-value-parser');
+
+/*
+ * Constants (parser usage)
+ */
+
+var SINGLE_QUOTE = 39;
+var DOUBLE_QUOTE = 34;
+var BACKSLASH = 92;
+var NEWLINE = 10;
+var SPACE = 32;
+var FEED = 12;
+var TAB = 9;
+var CR = 13;
+
+var WORD_END = /[ \n\t\r\f'"\\]/g;
+
+/*
+ * Constants (node type strings)
+ */
+
+var C_STRING = 'string';
+var C_ESCAPED_SINGLE_QUOTE = 'escapedSingleQuote';
+var C_ESCAPED_DOUBLE_QUOTE = 'escapedDoubleQuote';
+var C_SINGLE_QUOTE = 'singleQuote';
+var C_DOUBLE_QUOTE = 'doubleQuote';
+var C_NEWLINE = 'newline';
+var C_SINGLE = 'single';
+
+/*
+ * Literals
+ */
+
+var L_SINGLE_QUOTE = '\'';
+var L_DOUBLE_QUOTE = '"';
+var L_NEWLINE = '\\\n';
+
+/*
+ * Parser nodes
+ */
+
+var T_ESCAPED_SINGLE_QUOTE = { type: C_ESCAPED_SINGLE_QUOTE, value: '\\\'' };
+var T_ESCAPED_DOUBLE_QUOTE = { type: C_ESCAPED_DOUBLE_QUOTE, value: '\\"' };
+var T_SINGLE_QUOTE = { type: C_SINGLE_QUOTE, value: L_SINGLE_QUOTE };
+var T_DOUBLE_QUOTE = { type: C_DOUBLE_QUOTE, value: L_DOUBLE_QUOTE };
+var T_NEWLINE = { type: C_NEWLINE, value: L_NEWLINE };
+
+function stringify(ast) {
+ return ast.nodes.reduce(function (str, _ref) {
+ var value = _ref.value;
+
+ // Collapse multiple line strings automatically
+ if (value === L_NEWLINE) {
+ return str;
+ }
+ return str + value;
+ }, '');
+}
+
+function parse(str) {
+ var code = void 0,
+ next = void 0,
+ value = void 0;
+ var pos = 0;
+ var len = str.length;
+
+ var ast = {
+ nodes: [],
+ types: {
+ escapedSingleQuote: 0,
+ escapedDoubleQuote: 0,
+ singleQuote: 0,
+ doubleQuote: 0
+ },
+ quotes: false
+ };
+
+ while (pos < len) {
+ code = str.charCodeAt(pos);
+ switch (code) {
+ case SPACE:
+ case TAB:
+ case CR:
+ case FEED:
+ next = pos;
+ do {
+ next += 1;
+ code = str.charCodeAt(next);
+ } while (code === SPACE || code === NEWLINE || code === TAB || code === CR || code === FEED);
+
+ ast.nodes.push({
+ type: 'space',
+ value: str.slice(pos, next)
+ });
+ pos = next - 1;
+ break;
+ case SINGLE_QUOTE:
+ ast.nodes.push(T_SINGLE_QUOTE);
+ ast.types[C_SINGLE_QUOTE]++;
+ ast.quotes = true;
+ break;
+ case DOUBLE_QUOTE:
+ ast.nodes.push(T_DOUBLE_QUOTE);
+ ast.types[C_DOUBLE_QUOTE]++;
+ ast.quotes = true;
+ break;
+ case BACKSLASH:
+ next = pos + 1;
+ if (str.charCodeAt(next) === SINGLE_QUOTE) {
+ ast.nodes.push(T_ESCAPED_SINGLE_QUOTE);
+ ast.types[C_ESCAPED_SINGLE_QUOTE]++;
+ ast.quotes = true;
+ pos = next;
+ break;
+ } else if (str.charCodeAt(next) === DOUBLE_QUOTE) {
+ ast.nodes.push(T_ESCAPED_DOUBLE_QUOTE);
+ ast.types[C_ESCAPED_DOUBLE_QUOTE]++;
+ ast.quotes = true;
+ pos = next;
+ break;
+ } else if (str.charCodeAt(next) === NEWLINE) {
+ ast.nodes.push(T_NEWLINE);
+ pos = next;
+ break;
+ }
+ /*
+ * We need to fall through here to handle the token as
+ * a whole word. The missing 'break' is intentional.
+ */
+ default:
+ WORD_END.lastIndex = pos + 1;
+ WORD_END.test(str);
+
+ if (WORD_END.lastIndex === 0) {
+ next = len - 1;
+ } else {
+ next = WORD_END.lastIndex - 2;
+ }
+
+ value = str.slice(pos, next + 1);
+
+ ast.nodes.push({
+ type: C_STRING,
+ value: value
+ });
+
+ pos = next;
+ }
+ pos++;
+ }
+
+ return ast;
+}
+
+function changeWrappingQuotes(node, ast) {
+ var types = ast.types;
+
+ if (types[C_SINGLE_QUOTE] || types[C_DOUBLE_QUOTE]) {
+ return;
+ }
+
+ if (node.quote === L_SINGLE_QUOTE && types[C_ESCAPED_SINGLE_QUOTE] > 0 && !types[C_ESCAPED_DOUBLE_QUOTE]) {
+ node.quote = L_DOUBLE_QUOTE;
+ }
+
+ if (node.quote === L_DOUBLE_QUOTE && types[C_ESCAPED_DOUBLE_QUOTE] > 0 && !types[C_ESCAPED_SINGLE_QUOTE]) {
+ node.quote = L_SINGLE_QUOTE;
+ }
+
+ ast.nodes = ast.nodes.reduce(function (newAst, child) {
+ if (child.type === C_ESCAPED_DOUBLE_QUOTE && node.quote === L_SINGLE_QUOTE) {
+ return [].concat(newAst, [T_DOUBLE_QUOTE]);
+ }
+ if (child.type === C_ESCAPED_SINGLE_QUOTE && node.quote === L_DOUBLE_QUOTE) {
+ return [].concat(newAst, [T_SINGLE_QUOTE]);
+ }
+ return [].concat(newAst, [child]);
+ }, []);
+}
+
+function normalize(value, preferredQuote) {
+ if (!value || !value.length) {
+ return value;
+ }
+ return valueParser(value).walk(function (child) {
+ if (child.type !== C_STRING) {
+ return;
+ }
+ var ast = parse(child.value);
+ if (ast.quotes) {
+ changeWrappingQuotes(child, ast);
+ } else if (preferredQuote === C_SINGLE) {
+ child.quote = L_SINGLE_QUOTE;
+ } else {
+ child.quote = L_DOUBLE_QUOTE;
+ }
+ child.value = stringify(ast);
+ }).toString();
+}
+
+exports.default = postcss.plugin('cssnano-normalize-string', function (opts) {
+ var _preferredQuote$opts = _extends({
+ preferredQuote: 'double'
+ }, opts),
+ preferredQuote = _preferredQuote$opts.preferredQuote;
+
+ return function (css) {
+ css.walk(function (node) {
+ if (node.type === 'rule') {
+ node.selector = normalize(node.selector, preferredQuote);
+ }
+ if (node.type === 'decl') {
+ node.value = normalize(node.value, preferredQuote);
+ }
+ if (node.type === 'atrule') {
+ node.params = normalize(node.params, preferredQuote);
+ }
+ });
+ };
+});
+module.exports = exports['default']; \ No newline at end of file
diff --git a/node_modules/cssnano/dist/lib/normalizeUnicode.js b/node_modules/cssnano/dist/lib/normalizeUnicode.js
new file mode 100644
index 00000000..622afb79
--- /dev/null
+++ b/node_modules/cssnano/dist/lib/normalizeUnicode.js
@@ -0,0 +1,67 @@
+'use strict';
+
+exports.__esModule = true;
+
+var _postcss = require('postcss');
+
+var _postcss2 = _interopRequireDefault(_postcss);
+
+var _postcssValueParser = require('postcss-value-parser');
+
+var _postcssValueParser2 = _interopRequireDefault(_postcssValueParser);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function unicode(range) {
+ var values = range.slice(2).split('-');
+ if (values.length < 2) {
+ return range;
+ }
+ var left = values[0].split('');
+ var right = values[1].split('');
+
+ if (left.length !== right.length) {
+ return range;
+ }
+
+ var questionCounter = 0;
+
+ var merged = left.reduce(function (group, value, index) {
+ if (group === false) {
+ return false;
+ }
+ if (value === right[index] && !questionCounter) {
+ return group + value;
+ }
+ if (value === '0' && right[index] === 'f') {
+ questionCounter++;
+ return group + '?';
+ }
+ return false;
+ }, 'u+');
+
+ /*
+ * The maximum number of wildcard characters (?) for ranges is 5.
+ */
+
+ if (merged && questionCounter < 6) {
+ return merged;
+ }
+
+ return range;
+}
+
+exports.default = _postcss2.default.plugin('cssnano-normalize-unicode', function () {
+ return function (css) {
+ css.walkDecls(/^unicode-range$/i, function (node) {
+ node.prop = 'unicode-range';
+ node.value = (0, _postcssValueParser2.default)(node.value).walk(function (child) {
+ if (child.type === 'word') {
+ child.value = unicode(child.value.toLowerCase());
+ }
+ return false;
+ }).toString();
+ });
+ };
+});
+module.exports = exports['default']; \ No newline at end of file
diff --git a/node_modules/cssnano/dist/lib/reduceBackgroundRepeat.js b/node_modules/cssnano/dist/lib/reduceBackgroundRepeat.js
new file mode 100644
index 00000000..50709c5c
--- /dev/null
+++ b/node_modules/cssnano/dist/lib/reduceBackgroundRepeat.js
@@ -0,0 +1,93 @@
+'use strict';
+
+exports.__esModule = true;
+
+var _postcss = require('postcss');
+
+var _postcss2 = _interopRequireDefault(_postcss);
+
+var _postcssValueParser = require('postcss-value-parser');
+
+var _postcssValueParser2 = _interopRequireDefault(_postcssValueParser);
+
+var _evenValues = require('./evenValues');
+
+var _evenValues2 = _interopRequireDefault(_evenValues);
+
+var _getArguments = require('./getArguments');
+
+var _getArguments2 = _interopRequireDefault(_getArguments);
+
+var _getMatch = require('./getMatch');
+
+var _getMatch2 = _interopRequireDefault(_getMatch);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+var mappings = [['repeat-x', ['repeat', 'no-repeat']], ['repeat-y', ['no-repeat', 'repeat']], ['repeat', ['repeat', 'repeat']], ['space', ['space', 'space']], ['round', ['round', 'round']], ['no-repeat', ['no-repeat', 'no-repeat']]];
+
+var repeat = [mappings[0][0], mappings[1][0], mappings[2][0], mappings[3][0], mappings[4][0], mappings[5][0]];
+
+var getMatch = (0, _getMatch2.default)(mappings);
+
+function transform(decl) {
+ var values = (0, _postcssValueParser2.default)(decl.value);
+ if (values.nodes.length === 1) {
+ return;
+ }
+ var args = (0, _getArguments2.default)(values);
+ var relevant = [];
+ args.forEach(function (arg) {
+ relevant.push({
+ start: null,
+ end: null
+ });
+ arg.forEach(function (part, index) {
+ var isRepeat = ~repeat.indexOf(part.value);
+ var len = relevant.length - 1;
+ if (relevant[len].start === null && isRepeat) {
+ relevant[len].start = index;
+ relevant[len].end = index;
+ return;
+ }
+ if (relevant[len].start !== null) {
+ if (part.type === 'space') {
+ return;
+ } else if (isRepeat) {
+ relevant[len].end = index;
+ return;
+ }
+ return;
+ }
+ });
+ });
+ relevant.forEach(function (range, index) {
+ if (range.start === null) {
+ return;
+ }
+ var val = args[index].slice(range.start, range.end + 1);
+ if (val.length !== 3) {
+ return;
+ }
+ var match = getMatch(val.filter(_evenValues2.default).map(function (n) {
+ return n.value;
+ }));
+ if (match.length) {
+ args[index][range.start].value = match[0][0];
+ args[index][range.start + 1].value = '';
+ args[index][range.end].value = '';
+ }
+ });
+ decl.value = values.toString();
+}
+
+var plugin = _postcss2.default.plugin('cssnano-reduce-background-repeat', function () {
+ return function (css) {
+ return css.walkDecls(/background(-repeat|$)/, transform);
+ };
+});
+
+plugin.mappings = mappings;
+
+exports.default = plugin;
+module.exports = exports['default']; \ No newline at end of file
diff --git a/node_modules/cssnano/dist/lib/reduceDisplayValues.js b/node_modules/cssnano/dist/lib/reduceDisplayValues.js
new file mode 100644
index 00000000..aba6c43f
--- /dev/null
+++ b/node_modules/cssnano/dist/lib/reduceDisplayValues.js
@@ -0,0 +1,55 @@
+'use strict';
+
+exports.__esModule = true;
+
+var _postcss = require('postcss');
+
+var _postcss2 = _interopRequireDefault(_postcss);
+
+var _postcssValueParser = require('postcss-value-parser');
+
+var _postcssValueParser2 = _interopRequireDefault(_postcssValueParser);
+
+var _evenValues = require('./evenValues');
+
+var _evenValues2 = _interopRequireDefault(_evenValues);
+
+var _getMatch = require('./getMatch');
+
+var _getMatch2 = _interopRequireDefault(_getMatch);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Specification: https://drafts.csswg.org/css-display/#the-display-properties
+ */
+
+var mappings = [['block', ['block', 'flow']], ['flow-root', ['block', 'flow-root']], ['inline', ['inline', 'flow']], ['inline-block', ['inline', 'flow-root']], ['run-in', ['run-in', 'flow']], ['list-item', ['list-item', 'block', 'flow']], ['inline-list-item', ['list-item', 'inline', 'flow']], ['flex', ['block', 'flex']], ['inline-flex', ['inline', 'flex']], ['grid', ['block', 'grid']], ['inline-grid', ['inline', 'grid']], ['ruby', ['inline', 'ruby']], ['table', ['block', 'table']], ['inline-table', ['inline', 'table']], ['table-cell', ['table-cell', 'flow']], ['table-caption', ['table-caption', 'flow']], ['ruby-base', ['ruby-base', 'flow']], ['ruby-text', ['ruby-text', 'flow']]];
+
+var getMatch = (0, _getMatch2.default)(mappings);
+
+function transform(node) {
+ var _valueParser = (0, _postcssValueParser2.default)(node.value),
+ nodes = _valueParser.nodes;
+
+ if (nodes.length === 1) {
+ return;
+ }
+ var match = getMatch(nodes.filter(_evenValues2.default).map(function (n) {
+ return n.value;
+ }));
+ if (match.length) {
+ node.value = match[0][0];
+ }
+}
+
+var plugin = _postcss2.default.plugin('cssnano-reduce-display-values', function () {
+ return function (css) {
+ return css.walkDecls('display', transform);
+ };
+});
+
+plugin.mappings = mappings;
+
+exports.default = plugin;
+module.exports = exports['default']; \ No newline at end of file
diff --git a/node_modules/cssnano/dist/lib/reducePositions.js b/node_modules/cssnano/dist/lib/reducePositions.js
new file mode 100644
index 00000000..800857e1
--- /dev/null
+++ b/node_modules/cssnano/dist/lib/reducePositions.js
@@ -0,0 +1,119 @@
+'use strict';
+
+exports.__esModule = true;
+
+var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
+
+var _postcss = require('postcss');
+
+var _postcssValueParser = require('postcss-value-parser');
+
+var _postcssValueParser2 = _interopRequireDefault(_postcssValueParser);
+
+var _has = require('has');
+
+var _has2 = _interopRequireDefault(_has);
+
+var _getArguments = require('./getArguments');
+
+var _getArguments2 = _interopRequireDefault(_getArguments);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+var directions = ['top', 'right', 'bottom', 'left', 'center'];
+var properties = ['background', 'background-position', '-webkit-perspective-origin', 'perspective-origin'];
+
+var center = '50%';
+
+var horizontal = {
+ right: '100%',
+ left: '0'
+};
+
+var vertical = {
+ bottom: '100%',
+ top: '0'
+};
+
+function transform(decl) {
+ if (!~properties.indexOf(decl.prop)) {
+ return;
+ }
+ var values = (0, _postcssValueParser2.default)(decl.value);
+ var args = (0, _getArguments2.default)(values);
+ var relevant = [];
+ args.forEach(function (arg) {
+ relevant.push({
+ start: null,
+ end: null
+ });
+ arg.forEach(function (part, index) {
+ var isPosition = ~directions.indexOf(part.value) || (0, _postcssValueParser.unit)(part.value);
+ var len = relevant.length - 1;
+ if (relevant[len].start === null && isPosition) {
+ relevant[len].start = index;
+ relevant[len].end = index;
+ return;
+ }
+ if (relevant[len].start !== null) {
+ if (part.type === 'space') {
+ return;
+ } else if (isPosition) {
+ relevant[len].end = index;
+ return;
+ }
+ return;
+ }
+ });
+ });
+ relevant.forEach(function (range, index) {
+ if (range.start === null) {
+ return;
+ }
+ var position = args[index].slice(range.start, range.end + 1);
+ if (position.length > 3) {
+ return;
+ }
+ if (position.length === 1 || position[2].value === 'center') {
+ if (position[2]) {
+ position[2].value = position[1].value = '';
+ }
+ var value = position[0].value;
+
+ var map = _extends({}, horizontal, {
+ center: center
+ });
+ if ((0, _has2.default)(map, value)) {
+ position[0].value = map[value];
+ }
+ return;
+ }
+ if (position[0].value === 'center' && ~directions.indexOf(position[2].value)) {
+ position[0].value = position[1].value = '';
+ var _value = position[2].value;
+
+ if ((0, _has2.default)(horizontal, _value)) {
+ position[2].value = horizontal[_value];
+ }
+ return;
+ }
+ if ((0, _has2.default)(horizontal, position[0].value) && (0, _has2.default)(vertical, position[2].value)) {
+ position[0].value = horizontal[position[0].value];
+ position[2].value = vertical[position[2].value];
+ return;
+ } else if ((0, _has2.default)(vertical, position[0].value) && (0, _has2.default)(horizontal, position[2].value)) {
+ var first = position[0].value;
+ position[0].value = horizontal[position[2].value];
+ position[2].value = vertical[first];
+ return;
+ }
+ });
+ decl.value = values.toString();
+}
+
+exports.default = (0, _postcss.plugin)('cssnano-reduce-positions', function () {
+ return function (css) {
+ return css.walkDecls(transform);
+ };
+});
+module.exports = exports['default']; \ No newline at end of file
diff --git a/node_modules/cssnano/dist/lib/reduceTimingFunctions.js b/node_modules/cssnano/dist/lib/reduceTimingFunctions.js
new file mode 100644
index 00000000..77c09bef
--- /dev/null
+++ b/node_modules/cssnano/dist/lib/reduceTimingFunctions.js
@@ -0,0 +1,67 @@
+'use strict';
+
+exports.__esModule = true;
+
+var _postcss = require('postcss');
+
+var _postcssValueParser = require('postcss-value-parser');
+
+var _postcssValueParser2 = _interopRequireDefault(_postcssValueParser);
+
+var _evenValues = require('./evenValues');
+
+var _evenValues2 = _interopRequireDefault(_evenValues);
+
+var _getMatch = require('./getMatch');
+
+var _getMatch2 = _interopRequireDefault(_getMatch);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+var keywords = [['ease', [0.25, 0.1, 0.25, 1]], ['linear', [0, 0, 1, 1]], ['ease-in', [0.42, 0, 1, 1]], ['ease-out', [0, 0, 0.58, 1]], ['ease-in-out', [0.42, 0, 0.58, 1]]];
+
+var getValue = function getValue(node) {
+ return parseFloat(node.value);
+};
+var getMatch = (0, _getMatch2.default)(keywords);
+
+function reduce(node) {
+ if (node.type !== 'function') {
+ return false;
+ }
+ if (node.value === 'steps') {
+ // Don't bother checking the step-end case as it has the same length
+ // as steps(1)
+ if (getValue(node.nodes[0]) === 1 && node.nodes[2] && node.nodes[2].value === 'start') {
+ node.type = 'word';
+ node.value = 'step-start';
+ delete node.nodes;
+ return;
+ }
+ // The end case is actually the browser default, so it isn't required.
+ if (node.nodes[2] && node.nodes[2].value === 'end') {
+ node.nodes = [node.nodes[0]];
+ return;
+ }
+ return false;
+ }
+ if (node.value === 'cubic-bezier') {
+ var match = getMatch(node.nodes.filter(_evenValues2.default).map(getValue));
+
+ if (match.length) {
+ node.type = 'word';
+ node.value = match[0][0];
+ delete node.nodes;
+ return;
+ }
+ }
+}
+
+exports.default = (0, _postcss.plugin)('cssnano-reduce-timing-functions', function () {
+ return function (css) {
+ css.walkDecls(/(animation|transition)(-timing-function|$)/, function (decl) {
+ decl.value = (0, _postcssValueParser2.default)(decl.value).walk(reduce).toString();
+ });
+ };
+});
+module.exports = exports['default']; \ No newline at end of file
diff --git a/node_modules/cssnano/dist/lib/styleCache.js b/node_modules/cssnano/dist/lib/styleCache.js
new file mode 100644
index 00000000..75a7757c
--- /dev/null
+++ b/node_modules/cssnano/dist/lib/styleCache.js
@@ -0,0 +1,24 @@
+'use strict';
+
+exports.__esModule = true;
+
+var _postcss = require('postcss');
+
+exports.default = (0, _postcss.plugin)('cssnano-reset-stylecache', function () {
+ return function (css, result) {
+ result.root.rawCache = {
+ colon: ':',
+ indent: '',
+ beforeDecl: '',
+ beforeRule: '',
+ beforeOpen: '',
+ beforeClose: '',
+ beforeComment: '',
+ after: '',
+ emptyBody: '',
+ commentLeft: '',
+ commentRight: ''
+ };
+ };
+});
+module.exports = exports['default']; \ No newline at end of file