https://gist.github.com/WebReflection/4327762cb87a8c634a29
186182
function slice() {
  for (var
    o = +this,                // offset
    i = o,                    // start index
    l = arguments.length,     // length
    n = l - o,                // new length
    a = Array(n < 0 ? 0 : n); // new Array
    i < l; i++
  ) a[i - o] = arguments[i];
  return a;
}
373386
function substArguments(str, args, key) {
        var reArgs = /\{\{\s*(.+?)\s*\}\}/g;
        return str.replace(reArgs, function(matched_text, arg) {
            if (args && arg in args) {
                return args[arg];
            }
            if (arg in gL10nData) {
                return gL10nData[arg];
            }
            console.log("argument {{" + arg + "}} for #" + key + " is undefined.");
            return matched_text;
        });
    }
160426
function( hsl ){
      var ret;
      var number = $$.util.regex.number;
      var h, s, l, a, r, g, b;
      function hue2rgb(p, q, t){
        if(t < 0) t += 1;
        if(t > 1) t -= 1;
        if(t < 1/6) return p + (q - p) * 6 * t;
        if(t < 1/2) return q;
        if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;
        return p;
      }

      var m = new RegExp("^" + $$.util.regex.hsla + "$").exec(hsl);
      if( m ){

        // get hue
        h = parseInt( m[1] ); 
        if( h < 0 ){
          h = ( 360 - (-1*h % 360) ) % 360;
        } else if( h > 360 ){
          h = h % 360;
        }
        h /= 360; // normalise on [0, 1]

        s = parseFloat( m[2] );
        if( s < 0 || s > 100 ){ return; } // saturation is [0, 100]
        s = s/100; // normalise on [0, 1]

        l = parseFloat( m[3] );
        if( l < 0 || l > 100 ){ return; } // lightness is [0, 100]
        l = l/100; // normalise on [0, 1]

        a = m[4];
        if( a !== undefined ){
          a = parseFloat( a );

          if( a < 0 || a > 1 ){ return; } // alpha is [0, 1]
        }

        // now, convert to rgb
        // code from http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript
        if( s === 0 ){
          r = g = b = Math.round(l * 255); // achromatic
        } else {
          var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
          var p = 2 * l - q;
          r = Math.round( 255 * hue2rgb(p, q, h + 1/3) );
          g = Math.round( 255 * hue2rgb(p, q, h) );
          b = Math.round( 255 * hue2rgb(p, q, h - 1/3) );
        }

        ret = [r, g, b, a];
      }

      return ret;
    }
136393
function _hsv2rgb(data, addr, H,S,V) {
	if (V < 0.0001) {
		data[addr] = data[addr+1] = data[addr+2] = 0;
		return;
	}

	if (V>1) V = 1;

	if (S == 0) {
		data[addr] = data[addr+1] = data[addr+2] = v2b(V);
		return;
	}

	if (S>1) S = 1;

	var hue = H < 0 ? (H + 360) : (H >= 360 ? H - 360 : H),
	    st = (hue/60),
	    oct = st-(st|0), // [0...1]
	    y = hsv_angle_correction ? /* istanbul ignore next */ Math.sin((oct-.5)*1.0471975512)+.5 : oct,
	    s = S*V,
	    ns = V - s,
	    _ns = v2b(ns),
	    _v = v2b(V);

	switch (st|0) {
	case 0: data[addr] = _v;          data[addr+1] = v2b(ns+s*y); data[addr+2] = _ns;         return;
	case 1: data[addr] = v2b(V-s*y);  data[addr+1] = _v;          data[addr+2] = _ns;         return;
	case 2: data[addr] = _ns;         data[addr+1] = _v;          data[addr+2] = v2b(ns+s*y); return;
	case 3: data[addr] = _ns;         data[addr+1] = v2b(V-s*y);  data[addr+2] = _v;          return;
	case 4: data[addr] = v2b(ns+s*y); data[addr+1] = _ns;         data[addr+2] = _v;          return;
	}
	/*   5: */
	        data[addr] = _v;          data[addr+1] = _ns;         data[addr+2] = v2b(V-s*y);
}
1196573
function getUrlToken({ tokens, intEmphasis, num }) {
  const urlContent = `(${getAttr(tokens[num].attrs, 'href')})`;
  const urlLength = urlContent.length;
  const punctuation1 = {
    type: "punctuation",
    content: "[",
    length: 1
  };
  const punctuation2 = {
    type: "punctuation",
    content: "]",
    length: 1
  };
  const urlContentObj = {
    type: "punctuation",
    content: urlContent,
    length: urlLength
  };
  const content = Array.isArray(intEmphasis) ?
    [punctuation1, ...intEmphasis, punctuation2, urlContentObj] :
    [punctuation1, intEmphasis, punctuation2, urlContentObj];
  return {
    type: "url",
    content,
    length: Array.isArray(intEmphasis) ? getTokensLength(content) : 1 + intEmphasis.length + 1 + urlLength
  };
}
1022157
function fromStackProperty(stackString) {
  let chrome = /^\s*at (?:((?:\[object object\])?\S+(?: \[as \S+\])?) )?\(?((?:file|http|https):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
  let gecko = /^\s*(\S*)(?:\((.*?)\))?@((?:file|http|https).*?):(\d+)(?::(\d+))?\s*$/i;
  let lines = stackString.split('\n');
  let stack = [];
  let parts;

  for (let i = 0, j = lines.length; i < j; ++i) {
    if ((parts = gecko.exec(lines[i]))) {
      stack.push({
        url: parts[3],
        func: parts[1] || UNKNOWN_FUNCTION,
        args: parts[2] ? parts[2].split(',') : '',
        line: +parts[4],
        column: parts[5] ? +parts[5] : null
      });
    } else if ((parts = chrome.exec(lines[i]))) {
      stack.push({
        url: parts[2],
        func: parts[1] || UNKNOWN_FUNCTION,
        line: +parts[3],
        column: parts[4] ? +parts[4] : null
      });
    }
  }

  return stack.length ? stack : null;
}
758165
function shadeBlendConvert(p, from, to) {
    if (typeof (p) != "number" || p < -1 || p > 1 || typeof (from) != "string" || (from[0] != 'r' && from[0] != '#') || (typeof (to) != "string" && typeof (to) != "undefined")) {
        return null; //ErrorCheck
    }
    var sbcRip = function (d) {
        var l = d.length, RGB = new Object();
        if (l > 9) {
            d = d.split(",");
            if (d.length < 3 || d.length > 4)
                return null; //ErrorCheck
            RGB[0] = i(d[0].slice(4)), RGB[1] = i(d[1]), RGB[2] = i(d[2]), RGB[3] = d[3] ? parseFloat(d[3]) : -1;
        }
        else {
            switch (l) {
                case 8:
                case 6:
                case 3:
                case 2:
                case 1: return null;
            } //ErrorCheck
            if (l < 6)
                d = "#" + d[1] + d[1] + d[2] + d[2] + d[3] + d[3] + (l > 4 ? d[4] + "" + d[4] : ""); //3 digit
            d = i(d.slice(1), 16), RGB[0] = d >> 16 & 255, RGB[1] = d >> 8 & 255, RGB[2] = d & 255, RGB[3] = l == 9 || l == 5 ? r(((d >> 24 & 255) / 255) * 10000) / 10000 : -1;
        }
        return RGB;
    };
    var i = parseInt, r = Math.round, h = from.length > 9, h = typeof (to) == "string" ? to.length > 9 ? true : to == "c" ? !h : false : h, b = p < 0, p = b ? p * -1 : p, to = to && to != "c" ? to : b ? "#000000" : "#FFFFFF", f = sbcRip(from), t = sbcRip(to);
    if (!f || !t)
        return null; //ErrorCheck
    if (h)
        return "rgb(" + r((t[0] - f[0]) * p + f[0]) + "," + r((t[1] - f[1]) * p + f[1]) + "," + r((t[2] - f[2]) * p + f[2]) + (f[3] < 0 && t[3] < 0 ? ")" : "," + (f[3] > -1 && t[3] > -1 ? r(((t[3] - f[3]) * p + f[3]) * 10000) / 10000 : t[3] < 0 ? f[3] : t[3]) + ")");
    else
        return "#" + (0x100000000 + (f[3] > -1 && t[3] > -1 ? r(((t[3] - f[3]) * p + f[3]) * 255) : t[3] > -1 ? r(t[3] * 255) : f[3] > -1 ? r(f[3] * 255) : 255) * 0x1000000 + r((t[0] - f[0]) * p + f[0]) * 0x10000 + r((t[1] - f[1]) * p + f[1]) * 0x100 + r((t[2] - f[2]) * p + f[2])).toString(16).slice(f[3] > -1 || t[3] > -1 ? 1 : 3);
}
712042
function() {
            this._styleCache = {};

            // -----------------------------------------------------------------

            this.ua = "";

            this.name = "";
            this.version = "";

            this.majorVersion = 0;
            /* BACKWARD-COMPATIBILITY-BEGIN (GitHub #1397) */
            this._browserType = "";
            this._browserVersion = "";
            /* BACKWARD-COMPATIBILITY-END (GitHub #1397) */
            this.isIE = false;
            /* BACKWARD-COMPATIBILITY-BEGIN (GitHub #1397) */
            this._isIE6 = false;
            /* BACKWARD-COMPATIBILITY-END (GitHub #1397) */
            this.isIE7 = false;
            this.isIE8 = false;
            this.isIE9 = false;
            this.isIE10 = false;
            this.isIE11 = false;
            this.isOldIE = false;
            this.isModernIE = false;
            this.isEdge = false;
            this.isFirefox = false;
            /* BACKWARD-COMPATIBILITY-BEGIN (GitHub #1397) */
            this._isFF = false;
            /* BACKWARD-COMPATIBILITY-END (GitHub #1397) */
            this.isChrome = false;
            this.isSafari = false;
            this.isOpera = false;
            this.isBlackBerryBrowser = false;
            this.isAndroidBrowser = false;
            this.isSafariMobile = false;
            this.isIEMobile = false;
            this.isOperaMobile = false;
            this.isOperaMini = false;
            this.isS60 = false;
            this.isPhantomJS = false;
            this.isOtherBrowser = false;

            this.isWebkit = false;
            this.isGecko = false;

            this.osName = "";
            this.osVersion = "";
            /* BACKWARD-COMPATIBILITY-BEGIN (GitHub #1397) */
            this._environment = "";
            /* BACKWARD-COMPATIBILITY-END (GitHub #1397) */
            this.isWindows = false;
            this.isMac = false;
            this.isIOS = false;
            this.isAndroid = false;
            this.isWindowsPhone = false;
            this.isBlackBerry = false;
            this.isSymbian = false;
            this.isOtherOS = false;
            /* BACKWARD-COMPATIBILITY-BEGIN (GitHub #1397) */
            this._isOtherMobile = false;
            /* BACKWARD-COMPATIBILITY-END (GitHub #1397) */

            this.isMobileView = false;
            this.isDesktopView = false;
            /* BACKWARD-COMPATIBILITY-BEGIN (GitHub #1397) */
            this._DesktopView = false;
            /* BACKWARD-COMPATIBILITY-END (GitHub #1397) */

            /* BACKWARD-COMPATIBILITY-BEGIN (GitHub #1397) */
            this._isPhone = false;
            this._isTablet = false;
            this._deviceName = "";
            /* BACKWARD-COMPATIBILITY-END (GitHub #1397) */
        }
1342379
function parse_BrtColor(data/*::, length*/) {
	var out = {};
	var d = data.read_shift(1);

	//var fValidRGB = d & 1;
	var xColorType = d >>> 1;

	var index = data.read_shift(1);
	var nTS = data.read_shift(2, 'i');
	var bR = data.read_shift(1);
	var bG = data.read_shift(1);
	var bB = data.read_shift(1);
	data.l++; //var bAlpha = data.read_shift(1);

	switch(xColorType) {
		case 0: out.auto = 1; break;
		case 1:
			out.index = index;
			var icv = XLSIcv[index];
			/* automatic pseudo index 81 */
			if(icv) out.rgb = rgb2Hex(icv);
			break;
		case 2:
			/* if(!fValidRGB) throw new Error("invalid"); */
			out.rgb = rgb2Hex([bR, bG, bB]);
			break;
		case 3: out.theme = index; break;
	}
	if(nTS != 0) out.tint = nTS > 0 ? nTS / 32767 : nTS / 32768;

	return out;
}
1203567
function parseBrowserPackOutput(buf) {
  const m = /\n\/\/# sourceMappingURL=data:application\/json;charset=utf-8;base64,([^\s]+)\n?$/.exec(buf)
  if (!m) throw new Error('browser-pack did not insert source-map data URL in output: ' + buf.toString('utf-8'))
  const javascript = buf.slice(0, m.index)
  const sourceMap = JSON.parse(Buffer.from(m[1], 'base64'))
  return {
    javascript: javascript,
    sourceMap: sourceMap
  }
}
144627
function wrapLoseContextExtension(ctx, proto) {
    /**
     * @param {string} signature Event signature.
     * @param {Function=} opt_generator Generator function.
     */
    function wrapLoseContextMethod(signature, opt_generator) {
      wrapMethod(
          proto, 'WebGLLoseContext',
          signature, opt_generator);
    };

    // http://www.khronos.org/registry/webgl/extensions/WEBGL_lose_context/

    wrapLoseContextMethod(
        'loseContext()',
        function(fn, eventType) {
          return function loseContext() {
            setCurrentContext(ctx);
            var scope = eventType.apply(this, arguments);
            return leaveScope(scope, fn.apply(this, arguments));
          };
        });
    wrapLoseContextMethod(
        'restoreContext()',
        function(fn, eventType) {
          return function restoreContext() {
            setCurrentContext(ctx);
            var scope = eventType.apply(this, arguments);
            return leaveScope(scope, fn.apply(this, arguments));
          };
        });
  }
1244913
function parse_clrScheme(t, themes, opts) {
	themes.themeElements.clrScheme = [];
	var color = {};
	(t[0].match(tagregex)||[]).forEach(function(x) {
		var y = parsexmltag(x);
		switch(y[0]) {
			/* 20.1.6.2 clrScheme (Color Scheme) CT_ColorScheme */
			case '<a:clrScheme': case '</a:clrScheme>': break;

			/* 20.1.2.3.32 srgbClr CT_SRgbColor */
			case '<a:srgbClr':
				color.rgb = y.val; break;

			/* 20.1.2.3.33 sysClr CT_SystemColor */
			case '<a:sysClr':
				color.rgb = y.lastClr; break;

			/* 20.1.4.1.1 accent1 (Accent 1) */
			/* 20.1.4.1.2 accent2 (Accent 2) */
			/* 20.1.4.1.3 accent3 (Accent 3) */
			/* 20.1.4.1.4 accent4 (Accent 4) */
			/* 20.1.4.1.5 accent5 (Accent 5) */
			/* 20.1.4.1.6 accent6 (Accent 6) */
			/* 20.1.4.1.9 dk1 (Dark 1) */
			/* 20.1.4.1.10 dk2 (Dark 2) */
			/* 20.1.4.1.15 folHlink (Followed Hyperlink) */
			/* 20.1.4.1.19 hlink (Hyperlink) */
			/* 20.1.4.1.22 lt1 (Light 1) */
			/* 20.1.4.1.23 lt2 (Light 2) */
			case '<a:dk1>': case '</a:dk1>':
			case '<a:lt1>': case '</a:lt1>':
			case '<a:dk2>': case '</a:dk2>':
			case '<a:lt2>': case '</a:lt2>':
			case '<a:accent1>': case '</a:accent1>':
			case '<a:accent2>': case '</a:accent2>':
			case '<a:accent3>': case '</a:accent3>':
			case '<a:accent4>': case '</a:accent4>':
			case '<a:accent5>': case '</a:accent5>':
			case '<a:accent6>': case '</a:accent6>':
			case '<a:hlink>': case '</a:hlink>':
			case '<a:folHlink>': case '</a:folHlink>':
				if (y[0].charAt(1) === '/') {
					themes.themeElements.clrScheme.push(color);
					color = {};
				} else {
					color.name = y[0].substring(3, y[0].length - 1);
				}
				break;

			default: if(opts && opts.WTF) throw new Error('Unrecognized ' + y[0] + ' in clrScheme');
		}
	});
}
721456
function parseRuleAttrs(rule) {
  // eslint-disable-line complexity
  var styleAttrs;
  var isStyleMap = !!rule.styleMap;

  if (!isStyleMap) {
    if (!rule.style) return;
    var props = (0, _toConsumableArray2.default)(rule.style).map(function (key) {
      return [key, rule.style[key]];
    }).filter(function (_ref) {
      var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
          key = _ref2[0],
          value = _ref2[1];

      return value != null;
    });
    var matched = rule.cssText.match(/--sprite-[\w-]+\s*:\s*.+?(;|$)/img);

    if (matched) {
      matched.forEach(function (rule) {
        var _rule$split = rule.split(':'),
            _rule$split2 = (0, _slicedToArray2.default)(_rule$split, 2),
            key = _rule$split2[0],
            value = _rule$split2[1];

        props.push([key, value.trim().replace(/;$/, '')]);
      });
    }

    var isIgnore = props['--sprite-ignore'];

    if (isIgnore && isIgnore !== 'false' && isIgnore !== '0') {
      return;
    }

    styleAttrs = props;
  }

  if (rule.styleMap && rule.styleMap.has('--sprite-ignore')) {
    var _isIgnore = rule.styleMap.get('--sprite-ignore')[0].trim();

    if (_isIgnore !== 'false' && _isIgnore !== '0' && _isIgnore !== '') {
      return;
    }
  }

  if (rule.styleMap) {
    styleAttrs = (0, _toConsumableArray2.default)(rule.styleMap);
  }

  var attrs = {},
      reserved = {};
  var borderRadius = null;
  var transition = null;
  var gradient = {};
  styleAttrs.forEach(function (_ref3) {
    var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
        key = _ref4[0],
        value = _ref4[1];

    // eslint-disable-line complexity
    if (key === '--sprite-transition') {
      throw new Error('Not support --sprite-transition, instead use transition.');
    }

    if (key === '--sprite-animation') {
      throw new Error('Not support --sprite-animation, instead use animation.');
    }

    if (key.indexOf('--sprite-') === 0) {
      key = key.replace('--sprite-', '');
      key = toCamel(key);
      if (isStyleMap) value = value[0][0].trim();

      if (key === 'gradient') {
        // --sprite-gradient: bgcolor,color vector(0, 150, 150, 0) 0,#fff 0.5,rgba(33, 33, 77, 0.7) 1,rgba(128, 45, 88, 0.5)
        var _matched = value.match(/(.+?)vector\((.+?)\)(.+)/);

        if (_matched) {
          var properties = _matched[1].trim().split(/\s*,\s*/g),
              vector = _matched[2].split(',').map(function (s) {
            return Number(s.trim());
          }),
              colors = _matched[3].trim().split(/\s+/).map(function (s) {
            var m = s.match(/^([\d.]+),(.*)/);

            if (m) {
              return {
                offset: Number(m[1].trim()),
                color: m[2].trim()
              };
            }

            return null;
          }).filter(function (c) {
            return c != null;
          });

          properties.forEach(function (prop) {
            gradient[prop] = {
              vector: vector,
              colors: colors
            };
          });
        }
      }

      if (key === 'border') {
        var values = value.split(/\s+/);

        var _values = (0, _slicedToArray2.default)(values, 3),
            style = _values[0],
            width = _values[1],
            color = _values[2];

        reserved.border = {
          style: style,
          width: width,
          color: color
        };
      } else {
        if (key !== 'fontSize' && typeof value === 'string') {
          if (/,/.test(value)) {
            var _values2 = value.split(',');

            value = _values2.map(function (v) {
              return toPxValue(v.trim());
            });
          } else {
            value = toPxValue(value);
          }
        }

        reserved[key] = value;
      }
    } else {
      key = toCamel(key);

      if (key in CSSGetter) {
        if (typeof CSSGetter[key] === 'function') {
          value = CSSGetter[key](value);
        } else {
          if (isStyleMap) {
            value = value[0].toString();
          }

          if (key !== 'fontSize') {
            value = toPxValue(value);
          }
        }

        if (/^animation/.test(key)) {
          attrs.animation = attrs.animation || {};
          attrs.animation[key] = value;
          return;
        }

        if (value === 'initial') return;
        if (key === 'backgroundColor') key = 'bgcolor';
        if (key === 'fontVariantCaps') key = 'fontVariant';
        if (key === 'lineHeight' && value === 'normal') value = '';

        if (/Radius$/.test(key)) {
          if (typeof value === 'string') {
            value = value.split(/\s+/).map(function (v) {
              return toPxValue(v);
            });
          } else {
            value = [value, value];
          }

          borderRadius = borderRadius || [0, 0, 0, 0, 0, 0, 0, 0];

          if (key === 'borderTopLeftRadius') {
            borderRadius[0] = value[0];
            borderRadius[1] = value[1];
          } else if (key === 'borderTopRightRadius') {
            borderRadius[2] = value[0];
            borderRadius[3] = value[1];
          } else if (key === 'borderBottomRightRadius') {
            borderRadius[4] = value[0];
            borderRadius[5] = value[1];
          } else if (key === 'borderBottomLeftRadius') {
            borderRadius[6] = value[0];
            borderRadius[7] = value[1];
          }
        } else if (/^border(Left|Right|Top|Bottom)\w+/.test(key)) {
          if (/Color$/.test(key)) {
            attrs.borderColor = value;
          } else if (/Style$/.test(key)) {
            attrs.borderStyle = value;
          } else if (/Width$/.test(key)) {
            attrs.borderWidth = value;
          }
        } else if (key === 'transitionDelay') {
          transition = transition || {};
          transition.delay = value;
        } else if (key === 'transitionDuration') {
          transition = transition || {};
          transition.duration = value;
        } else if (key === 'transitionTimingFunction') {
          transition = transition || {};
          transition.easing = value;
        } else if (key === 'transitionProperty') {
          transition = transition || {};
          transition.properties = value;
        } else {
          attrs[key] = value;
        }
      }
    }
  });

  if (borderRadius) {
    attrs.borderRadius = borderRadius;
  }

  Object.assign(attrs, reserved, gradient);

  if (transition) {
    transition.properties = transition.properties || 'all';
    transition.delay = transition.delay || [0];
    transition.duration = transition.duration || [0];
    transition.easing = transition.easing || ['ease'];
    attrs.transitions = [];
    var properties = transition.properties.split(',').map(function (p) {
      return p.trim();
    });
    properties.forEach(function (key, i) {
      var _attrs = null;

      if (key.indexOf('--sprite-') === 0) {
        key = key.replace('--sprite-', '');
      }

      key = toCamel(key);

      if (key !== 'borderRadius' && /^border/.test(key)) {
        key = 'border';
      }

      if (key === 'backgroundColor' || key === 'background') key = 'bgcolor';
      if (key === 'fontVariantCaps') key = 'fontVariant';

      if (key === 'all') {
        _attrs = Object.assign({}, attrs);
        delete _attrs.transitions;
        delete _attrs.animation;
      } else if (key in attrs) {
        _attrs = (0, _defineProperty2.default)({}, key, attrs[key]);
      }

      if (_attrs) {
        attrs.transitions.push({
          easing: transition.easing[i],
          attrs: _attrs,
          delay: transition.delay[i],
          duration: transition.duration[i]
        });
      }
    });
  }

  if ('fontSize' in attrs || 'fontFamily' in attrs || 'fontStyle' in attrs || 'fontVariant' in attrs || 'fontWeight' in attrs) {
    // for font inherit
    var font = attrs.font || 'normal normal normal 16px Arial';

    var _parseFont = (0, _utils.parseFont)(font),
        style = _parseFont.style,
        variant = _parseFont.variant,
        weight = _parseFont.weight,
        family = _parseFont.family,
        size = _parseFont.size,
        unit = _parseFont.unit;

    attrs.font = "".concat(attrs.fontStyle || style, " ").concat(attrs.fontVariant || variant, " ").concat(attrs.fontWeight || weight, " ").concat(attrs.fontSize || size + unit, " ").concat(attrs.fontFamily || family);
    delete attrs.fontSize;
    delete attrs.fontFamily;
    delete attrs.fontVariant;
    delete attrs.fontWeight;
    delete attrs.fontStyle;
  }

  return attrs;
}
642322
function analyzeDiff (diff, sha, conf) {
  var options = _.merge({
    "onProgress": function onProgress (err, result, todo) {
      if (err) {
        console.error("[Github-Todos] Error", err);
      } else if (result && result.type === "comment") {
        console.log("[Github-Todos] Added comment to issue #%s (%s) - %s", result.issue, result.title, result.url);
      } else if (result && result.type === "issue") {
        console.log("[Github-Todos] Created issue #%s (%s) - %s", result.number, result.title, result.url);
      } else if (!result) {
        console.log("[Github-Todos] Skipped - \"%s\"", todo.title);
      } else {
        console.error("[Github-Todos] Unknown result", result);
      }
      if (result && result.url && conf["open-url"]) {
        open(result.url);
      }
    }
  }, conf);

  function done (/* injectedIssues */) {
    if (process.env.DRY_RUN) {
      console.error("[Github-Todos] Dry Run: Aborting git push");
      process.exit(123);
    } else {
      console.log("[Github-Todos] OK.");
    }
  }

  return todos.fromDiff(conf.repo, diff, sha, options).spread(function (results, todos) {
    if (!conf["inject-issue"]) {
      return false;
    }

    console.log("[Github-Todos] Injecting issue numbers to files…");

    return git.dirty().then(null, function (err) {
      // Ignore error but warn user
      if (process.env.DEBUG) {
        console.error(err.stack || err);
      }
      console.error("[Github-Todos] Warning: could not check if repository is dirty");
      return false;
    }).then(function (dirty) {
      var injects = generateInjects(todos, results);

      if (process.env.DRY_RUN) {
        throw new Error("Simulated execution (DRY_RUN set)");
      }

      return stash(dirty)()
        .then(injectIssues(injects))
        .then(add)
        .then(commit)
        .then(unstash(dirty))
        .then(null, function (err) {
          console.error("[Github-Todos] Warning: failed injecting issues, you may need to do it manually in following files:");
          console.error("[Github-Todos] %s", err);
          _.each(injects, function (inject) {
            console.log("[Github-Todos]  * %s, line %s: Issue #%s", inject.file, inject.line, inject.issue);
          });
        });
    });
  }).then(done);
}
840971
function parseClipRect(cr) {
    const params = (cr || '').match(REGEXP_CLIP_RECT);
    if (params && (params.length === 5)) {
        return {
            top: parseInt(params[1]),
            left: parseInt(params[2]),
            width: parseInt(params[3]),
            height: parseInt(params[4])
        };
    }
    return null;
}
1217130
function (str, callback) {
            var root, start, end, zone, line, lines, buff = [], c, error = null;

            i = j = current = furthest = 0;
            input = str.replace(/\r\n/g, '\n');

            // Remove potential UTF Byte Order Mark
            input = input.replace(/^\uFEFF/, '');

            // Split the input into chunks.
            chunks = (function (chunks) {
                var j = 0,
                    skip = /(?:@\{[\w-]+\}|[^"'`\{\}\/\(\)\\])+/g,
                    comment = /\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,
                    string = /"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`]|\\.)*)`/g,
                    level = 0,
                    match,
                    chunk = chunks[0],
                    inParam;

                for (var i = 0, c, cc; i < input.length;) {
                    skip.lastIndex = i;
                    if (match = skip.exec(input)) {
                        if (match.index === i) {
                            i += match[0].length;
                            chunk.push(match[0]);
                        }
                    }
                    c = input.charAt(i);
                    comment.lastIndex = string.lastIndex = i;

                    if (match = string.exec(input)) {
                        if (match.index === i) {
                            i += match[0].length;
                            chunk.push(match[0]);
                            continue;
                        }
                    }

                    if (!inParam && c === '/') {
                        cc = input.charAt(i + 1);
                        if (cc === '/' || cc === '*') {
                            if (match = comment.exec(input)) {
                                if (match.index === i) {
                                    i += match[0].length;
                                    chunk.push(match[0]);
                                    continue;
                                }
                            }
                        }
                    }
                    
                    switch (c) {
                        case '{': if (! inParam) { level ++;        chunk.push(c);                           break }
                        case '}': if (! inParam) { level --;        chunk.push(c); chunks[++j] = chunk = []; break }
                        case '(': if (! inParam) { inParam = true;  chunk.push(c);                           break }
                        case ')': if (  inParam) { inParam = false; chunk.push(c);                           break }
                        default:                                    chunk.push(c);
                    }
                    
                    i++;
                }
                if (level != 0) {
                    error = new(LessError)({
                        index: i-1,
                        type: 'Parse',
                        message: (level > 0) ? "missing closing `}`" : "missing opening `{`",
                        filename: env.filename
                    }, env);
                }

                return chunks.map(function (c) { return c.join('') });;
            })([[]]);

            if (error) {
                return callback(error, env);
            }

            // Start with the primary rule.
            // The whole syntax tree is held under a Ruleset node,
            // with the `root` property set to true, so no `{}` are
            // output. The callback is called when the input is parsed.
            try {
                root = new(tree.Ruleset)([], $(this.parsers.primary));
                root.root = true;
            } catch (e) {
                return callback(new(LessError)(e, env));
            }

            root.toCSS = (function (evaluate) {
                var line, lines, column;

                return function (options, variables) {
                    var frames = [], importError;

                    options = options || {};
                    //
                    // Allows setting variables with a hash, so:
                    //
                    //   `{ color: new(tree.Color)('#f01') }` will become:
                    //
                    //   new(tree.Rule)('@color',
                    //     new(tree.Value)([
                    //       new(tree.Expression)([
                    //         new(tree.Color)('#f01')
                    //       ])
                    //     ])
                    //   )
                    //
                    if (typeof(variables) === 'object' && !Array.isArray(variables)) {
                        variables = Object.keys(variables).map(function (k) {
                            var value = variables[k];

                            if (! (value instanceof tree.Value)) {
                                if (! (value instanceof tree.Expression)) {
                                    value = new(tree.Expression)([value]);
                                }
                                value = new(tree.Value)([value]);
                            }
                            return new(tree.Rule)('@' + k, value, false, 0);
                        });
                        frames = [new(tree.Ruleset)(null, variables)];
                    }

                    try {
                        var css = evaluate.call(this, { frames: frames })
                                          .toCSS([], { compress: options.compress || false, dumpLineNumbers: env.dumpLineNumbers });
                    } catch (e) {
                        throw new(LessError)(e, env);
                    }

                    if ((importError = parser.imports.error)) { // Check if there was an error during importing
                        if (importError instanceof LessError) throw importError;
                        else                                  throw new(LessError)(importError, env);
                    }

                    if (options.yuicompress && less.mode === 'node') {
                        return require('ycssmin').cssmin(css);
                    } else if (options.compress) {
                        return css.replace(/(\s)+/g, "$1");
                    } else {
                        return css;
                    }
                };
            })(root.eval);

            // If `i` is smaller than the `input.length - 1`,
            // it means the parser wasn't able to parse the whole
            // string, so we've got a parsing error.
            //
            // We try to extract a \n delimited string,
            // showing the line where the parse error occured.
            // We split it up into two parts (the part which parsed,
            // and the part which didn't), so we can color them differently.
            if (i < input.length - 1) {
                i = furthest;
                lines = input.split('\n');
                line = (input.slice(0, i).match(/\n/g) || "").length + 1;

                for (var n = i, column = -1; n >= 0 && input.charAt(n) !== '\n'; n--) { column++ }

                error = {
                    type: "Parse",
                    message: "Syntax Error on line " + line,
                    index: i,
                    filename: env.filename,
                    line: line,
                    column: column,
                    extract: [
                        lines[line - 2],
                        lines[line - 1],
                        lines[line]
                    ]
                };
            }

            if (this.imports.queue.length > 0) {
                finish = function (e) {
                    e = error || e;
                    if (e) callback(e);
                    else callback(null, root);
                };
            } else {
                callback(error, root);
            }
        }
159586
function bg_w_grad($el, url){
  var c = '230,230,230';//'231,229,224';
  var s = 'linear-gradient(-90deg, rgba('+c+',1) 10%, rgba('+c+',.55) 70%, rgba('+c+',0) 90%, rgba('+c+',0) 100%)';
  $el.css({'background-image': vendor_prefix.css+s+'', 'background-repeat':'no-repeat'}); //, url('+url+')
}