/* eslint-disable-next-line no-inner-declarations
487590
function step() {
          const f = files.pop();
          if (f) {
            console.error('Ractive: compiling component ' + path.join(opts.directory, f));
            util
              .readToString(fs.createReadStream(path.join(opts.directory, f)))
              .then(string => {
                return component
                  .build(string, opts, mkReadFile(path.join(opts.directory, f)))
                  .then(string => {
                    const file = path.join(
                      opts.output,
                      f.replace(ext, opts.outputExtension || '.js')
                    );
                    util.mkdirp(path.dirname(file));
                    util.writeToStream(fs.createWriteStream(file), string);
                  });
              })
              .then(step, err => {
                console.error(err && typeof err === 'object' ? err.stack : err);
                process.exit(1);
              });
          }
        }
1266325
function innerRender(from, template, data, callback) {
    var args, proc, out = '',
        err = '',
        base,
        strData;

    if (arguments.length < 4) {
        callback = data;
        data = {};
    }

    if (!template || template.constructor !== String) {
        return callback(new Error('"template" requires a non-empty string'));
    }

    if ('function' !== typeof callback) {
        throw new Error('"callback" requires a function');
    }

    try {
        //Make sure mock data could be stringified
        strData = JSON.stringify(data);
    } catch (e) {
        return callback(e);
    }

    base = gConfigurations.template_dirs;
    //If no template_dirs defined and is rendering a file,
    //we reset the template_dirs to the dirname of the file,
    //and set template as its basename
    //
    //e.g,
    //
    //django.configure({
    //  template_dirs: null
    // });
    //django.renderFile('test/case/index.html');
    //
    //equals
    //
    //django.configure({
    //  template_dirs: 'test/case'
    // });
    //django.renderFile('index.html')
    //
    //That affects @include tag in Django,
    //see https://docs.djangoproject.com/en/1.7/ref/templates/builtins/#include
    //
    if (('file' === from) && !base) {

        base = path.resolve(path.dirname(template));
        template = path.basename(template);
    } 

    args = (('source' === from) ? [PYTHON] : [PYTHON, base, template]).map(function(item, idx) {
        return idx ? encodeURIComponent(item) : item;
    });

    proc = childProcess.spawn('python', args);
    //We use stdin to pass the mock data to avoid long shell arguments
    proc.stdin.write(('source' === from ? (encodeURIComponent(template) +
        '\n') : '') + strData + '\n'); //For python reading a line.

    proc.stdout.on('data', function(data) {
        //Here we get no string but buffer
        out += data.toString('utf-8');
    });
    proc.stderr.on('data', function(data) {
        err += data.toString('utf-8');
    });
    //What if blocked? We ignored it because this is not for production.
    proc.on('exit', function() {
        if (err) {
            return callback(new Error(err));
        } else {
            return callback(null, out.replace(/\r(?=\r\n)/mg, '')); //A \r will always be prepend to \r\n
        }
    });
}
783007
function(object) {
      if (arguments.length > 1)
        return map(toArray(arguments), function(arg){
          return puts(arg)
        }).join(', ')
      if (object === undefined) return 'undefined'
      if (object === null) return 'null'
      if (object === true) return 'true'
      if (object === false) return 'false'
      if (object.an_instance_of) return 'an instance of ' + object.an_instance_of.name
      if (object.jquery && object.selector.length > 0) return 'selector ' + puts(object.selector)
      if (object.jquery) return object.get(0).outerHTML
      if (object.nodeName) return object.outerHTML
      switch (object.constructor) {
        case Function: return object.name || object 
        case String: 
          return '"' + object
            .replace(/"/g,  '\\"')
            .replace(/\n/g, '\\n')
            .replace(/\t/g, '\\t')
            + '"'
        case Array: 
          return inject(object, '[', function(b, v){
            return b + ', ' + puts(v)
          }).replace('[,', '[') + ' ]'
        case Object:
          object.__hit__ = true
          return inject(object, '{', function(b, k, v) {
            if (k == '__hit__') return b
            return b + ', ' + k + ': ' + (v && v.__hit__ ? '<circular reference>' : puts(v))
          }).replace('{,', '{') + ' }'
        default: 
          return object.toString()
      }
    }
794857
function(key, ctx, partials, returnFound) {
      var val = false,
          v = null,
          found = false;

      for (var i = ctx.length - 1; i >= 0; i--) {
        v = ctx[i];
        if (v && typeof v == 'object' && key in v) {
          val = v[key];
          found = true;
          break;
        }
      }

      if (!found) {
        return (returnFound) ? false : "";
      }

      if (!returnFound && typeof val == 'function') {
        val = this.lv(val, ctx, partials);
      }

      return val;
    }
19398
async function nResolve(id: string, options?: Options): Promise<string> { // eslint-disable-line no-use-before-define
	assert(typeof id === 'string' && id.length > 0, '<id> has to be a non-empty string');
	assert(typeof options === 'object' && !Array.isArray(options), '[options] has to be an object');

	const s = getSettings(options);
	assert(nonEmpty(s.base), 'options.base has to be a non-empty string');
	assert(nonEmpty(s.index), 'options.index has to be a non-empty string');
	assert(nonEmpty(s.resolveKey), 'options.resolveKey has to be a non-empty string');
	assert(plain(s.package), 'options.package has to be an object');
	assert(plain(s.modules), 'options.modules has to be an object');

	if (s.modules[id]) {
		return s.modules[id];
	}

	if (isBuiltin(id)) {
		return id;
	}

	const [name, ...rest] = id.split('/').filter(Boolean);
	const isRelative = name === '.' || name === '..';

	const modulePath = isRelative ?
		path.resolve(s.base, name) :
		await getModulePath(name, s);

	const relativeBase = s.filename ?
		path.dirname(s.filename) :
		s.base;

	const relativePath = rest.length ?
		path.resolve(relativeBase, ...rest) :
		await getMainPath(modulePath, s);

	const moduleRelativePath = path.extname(relativePath) === '' ?
		`${relativePath}.js` : relativePath;

	const moduleFilePath = path.resolve(modulePath, moduleRelativePath);

	if (!(await exists(moduleFilePath))) {
		const nameDesc = isRelative ? '' : ` in ${name}`;
		throw new Error(`Could not find ${moduleFilePath}${nameDesc} at ${modulePath}`);
	}

	const parsed = path.parse(moduleFilePath);
	const ext = parsed.ext === '.js' ? '' : parsed.ext;

	return path.format({
		dir: parsed.dir,
		base: `${parsed.name}${ext}`
	});
}
728714
function globals() {
		extend(window, {
			console: {
				log: function() {},
				debug: function() {},
				warn: function() {},
				error: function() {}
			},
			Map: (function() {
				function Map() {
					this._map = Object.create(null);
				}
				Map.prototype = {
					isNative: false,
					get: function get(key) {
						return this._map[key];
					},
					set: function set(key, val) {
						this._map[key] = val;
					},
					has: function has(key) {
						return this._map[key] !== undefined;
					},
					"delete": function get(key) {
						delete this._map[key];
					},
					size: function() {
						return Object.keys(this._map).length;
					}
				};
				return Map;
			})(),
			Set: (function() {
				function Set() {
					this._map = Object.create(null);
				}
				Set.prototype = {
					isNative: false,
					add: function set(key) {
						this._map[key] = true;
					},
					has: function has(key) {
						return this._map[key] === true;
					},
					"delete": function get(key) {
						delete this._map[key];
					},
					size: function() {
						return Object.keys(this._map).length;
					}
				};
				return Set;
			})(),
			WeakMap: (function() { // TODO: clean this up
				function WeakMap() {
					var keys = [],
						values = [];

					function del(key) {
						if (has(key)) {
							keys.splice(i, 1);
							values.splice(i, 1);
						}
						return -1 < i;
					}

					function get(key, d3fault) {
						return has(key) ? values[i] : d3fault;
					}

					function has(key) {
						i = indexOf.call(keys, key);
						return -1 < i;
					}

					function set(key, value) {
						if (has(key)) {
							values[i] = value;
						} else {
							values[keys.push(key) - 1] = value;
						}
					}
					return create(WeakMapPrototype, {
						isNative: {
							value: false
						},
						"delete": {
							value: del
						},
						del: {
							value: del
						},
						get: {
							value: get
						},
						has: {
							value: has
						},
						set: {
							value: set
						}
					});
				}

				function WeakMapInstance() {}
				var WeakMapPrototype = WeakMap.prototype,
					create = Object.create,
					indexOf = [].indexOf,
					i;
				// used to follow FF behavior where WeakMap.prototype is WeakMap itself
				WeakMap.prototype = 
					WeakMapInstance.prototype = 
					WeakMapPrototype = 
					new WeakMap();
				return WeakMap;
			})()
		});
	}
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;
        });
    }
1244543
function (key) {
        'use strict';
        var parts = key.split('.'),
            body = new Array(parts.length),
            last = parts.pop(),
            len = parts.length,
            fn;
        for (var i = 0; i < len; i += 1) {
            body[i] = "if (typeof (o = o." + parts[i] + ") === 'undefined') return o;";
        }
        body[i] = "return o." + last + ";";
        fn = Function("o", body.join('\n'));
        return fn;
    }
1084715
function lint() {
    return gulp.src(srcDir + '**/*.js')
        .pipe($$.excludeGitignore())
        .pipe($$.eslint())
        .pipe($$.eslint.format())
        .pipe($$.eslint.failAfterError());
}
788338
function (type) {
  var args = [], len = arguments.length - 1;
  while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];

  args.unshift('[riotx]');
  try {
    console.log.apply(console, args); // eslint-disable-line
  } catch (e) {
    console.log(args); // eslint-disable-line
  }
}
1073100
function (obj, fn, context) {
            for (var key in obj) {
                if (hasOwnProp.call(obj, key)) {
                    //inx,element
                    fn.call(context || this, key, obj[key]);
                }
            }
        }
155172
function interpolateStyle(styles, attr, subattr = '') {
  // Title-case the sub-attribute.
  if (subattr) {
    /* eslint-disable-next-line no-param-reassign */
    subattr = subattr.replace(subattr[0], subattr[0].toUpperCase());
  }

  return ['Top', 'Right', 'Bottom', 'Left']
    .map((dir) => styles[attr + dir + subattr])
    .join(' ');
}
195178
function ErrorStackParser$$parseOpera11(error) {
	            var filtered = _filter(error.stack.split('\n'), function (line) {
	                return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) &&
	                    !line.match(/^Error created at/);
	            }, this);
	
	            return _map(filtered, function (line) {
	                var tokens = line.split('@');
	                var locationParts = this.extractLocation(tokens.pop());
	                var functionCall = (tokens.shift() || '');
	                var functionName = functionCall
	                        .replace(/<anonymous function(: (\w+))?>/, '$2')
	                        .replace(/\([^\)]*\)/g, '') || undefined;
	                var argsRaw;
	                if (functionCall.match(/\(([^\)]*)\)/)) {
	                    argsRaw = functionCall.replace(/^[^\(]+\(([^\)]*)\)$/, '$1');
	                }
	                var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ? undefined : argsRaw.split(',');
	                return new StackFrame(functionName, args, locationParts[0], locationParts[1], locationParts[2], line);
	            }, this);
	        }
293586
function compileTokens(tokens) {
    var subRenders = {};

    function subRender(i, tokens, template) {
      if (!subRenders[i]) {
        var fn = compileTokens(tokens);
        subRenders[i] = function (writer, context) {
          return fn(writer, context, template);
        };
      }

      return subRenders[i];
    }

    return function (writer, context, template) {
      var buffer = "";
      var token, sectionText;

      for (var i = 0, len = tokens.length; i < len; ++i) {
        token = tokens[i];

        switch (token[0]) {
        case "#":
          sectionText = template.slice.apply(template, sectionBounds(token));
          buffer += writer._section(token[1], context, sectionText, subRender(i, token[4], template));
          break;
        case "^":
          buffer += writer._inverted(token[1], context, subRender(i, token[4], template));
          break;
        case ">":
          buffer += writer._partial(token[1], context);
          break;
        case "&":
          buffer += writer._name(token[1], context);
          break;
        case "name":
          buffer += writer._escaped(token[1], context);
          break;
        case "text":
          buffer += token[1];
          break;
        }
      }

      return buffer;
    };
  }
580945
function dictsort(val, caseSensitive, by) {
  if (!lib.isObject(val)) {
    throw new lib.TemplateError('dictsort filter: val must be an object');
  }

  let array = [];
  // deliberately include properties from the object's prototype
  for (let k in val) { // eslint-disable-line guard-for-in, no-restricted-syntax
    array.push([k, val[k]]);
  }

  let si;
  if (by === undefined || by === 'key') {
    si = 0;
  } else if (by === 'value') {
    si = 1;
  } else {
    throw new lib.TemplateError(
      'dictsort filter: You can only sort by either key or value');
  }

  array.sort((t1, t2) => {
    var a = t1[si];
    var b = t2[si];

    if (!caseSensitive) {
      if (lib.isString(a)) {
        a = a.toUpperCase();
      }
      if (lib.isString(b)) {
        b = b.toUpperCase();
      }
    }

    return a > b ? 1 : (a === b ? 0 : -1); // eslint-disable-line no-nested-ternary
  });

  return array;
}
661081
function bindAll(self: Object, fnNames: Array<string>) {
  fnNames.forEach(name => {
    /* eslint-disable no-param-reassign */
    self[name] = self[name].bind(self);
    /* eslint-enable no-param-reassign */
  });
}
1231322
function() {
         /* eslint-disable eqeqeq, no-self-compare */
         return [].reduce.call(arguments, function(soFar, x) {
            return soFar || x != x || typeof x != 'number';
         }, false);
         /* eslint-enable eqeqeq, no-self-compare */
      }