/*:: type Options = { moduleDir: BsModuleFormat | 'js', inSource: boolean, suffix: string }
327336
function bsconfigToOptions(bsconfig) /*: Options */ {
  const bsSuffix = bsconfig.suffix
  const suffix = typeof bsSuffix === 'string' ? bsSuffix : '.js'

  if (!bsconfig['package-specs']) {
    const options /*: Options */ = {
      moduleDir: 'js',
      inSource: false,
      suffix,
    }
    return options
  }

  const packageSpecs = bsconfig['package-specs']
  const moduleSpec =
    packageSpecs instanceof Array ? packageSpecs[0] : packageSpecs
  const moduleDir /*: BsModuleFormat */ =
    typeof moduleSpec === 'string' ? moduleSpec : moduleSpec.module
  const inSource =
    typeof moduleSpec === 'string' ? false : moduleSpec['in-source']

  const options /*: Options */ = {moduleDir, inSource, suffix}
  return options
}
397778
function misc (options) {
  options.hash.scope = undefined
  options.hash['!kind'] = /module|constructor|external/
  options.hash['!isExported'] = true
  return handlebars.helpers.each(_identifiers(options), options)
}
1328244
function CompileModules(inputTree, options) {
  this.setInputTree(inputTree);
  this.setInputFiles(options.inputFiles);
  this.setResolvers(options.resolvers || []);
  this.setOutput(options.output);
  this.setFormatter(options.formatter);
  
  if (options.output) {
    this.description = 'CompileModules (' + options.output + ')';
  }
}
1049124
function(context, options) {
    if (!context) return '';
    var types_raw = context.split('|');
    var types_linked = options.fn(this).split('|');

    return types_raw.map(function(type, i) {
      if (/\[\]/.test(type)) {
        if (/<\/a>/.test(types_linked[i])) {
          return types_linked[i].replace('</a>', '[]</a>');
        } else {
          return types_linked[i].trim() + '[]';
        }
      } else {
        return types_linked[i];
      }
    }).join(' | ');
  }
882266
function(folder, cmd) {
		var argOption;
		var argValue;
		//define file type (layout, model, collection etc) and name from command
		for (var i = 0; i < config.generateOptions.length; i++) {
			var option = config.generateOptions[i];
			if (cmd[option]) {
				argOption = option;
				argValue = cmd[option];
				break;
			}
		}
		//generating file
		var sourceFile = argOption + '.js';
		var type = config.moduleType;
		var fileSrc = path.join(__dirname, 'generators', type, sourceFile);
		var fileName = argOption;
		//changing file name if it was set
		if (typeof argValue !== 'boolean') {
			fileName = argValue;
		}
		fileName = fileName + '.js';
		var newFileSrc;
		if (folder) {
			if (path.isAbsolute(folder)) {
				newFileSrc = path.join(folder, fileName);
			} else {
				newFileSrc = path.join(process.cwd(), folder, fileName);
			}
		} else {
			newFileSrc = path.join(process.cwd(), fileName);
		}
		fs.exists(newFileSrc, function(exists) {
			if (exists) {
				return console.log('File with name %s already exists', fileName);
			} else {
				switch(type) {
					case 'rjs':
					case 'cjs':
						helpers.rigger(fileSrc, newFileSrc);
						break;
					case 'es6':
						helpers.fileCopy(fileSrc, newFileSrc);
						break;
					default:
						return console.log('Wrong module type');
				}
			}
		});
	}
322346
function getAdditionalModulePaths(options = {}) {
  const baseUrl = options.baseUrl;

  // We need to explicitly check for null and undefined (and not a falsy value) because
  // TypeScript treats an empty string as `.`.
  if (baseUrl == null) {
    // If there's no baseUrl set we respect NODE_PATH
    // Note that NODE_PATH is deprecated and will be removed
    // in the next major release of create-react-app.

    const nodePath = process.env.NODE_PATH || '';
    return nodePath.split(path.delimiter).filter(Boolean);
  }

  const baseUrlResolved = path.resolve(paths.appPath, baseUrl);

  // We don't need to do anything if `baseUrl` is set to `node_modules`. This is
  // the default behavior.
  if (path.relative(paths.appNodeModules, baseUrlResolved) === '') {
    return null;
  }

  // Allow the user set the `baseUrl` to `appSrc`.
  if (path.relative(paths.appSrc, baseUrlResolved) === '') {
    return [paths.appSrc];
  }

  // Otherwise, throw an error.
  throw new Error(
    chalk.red.bold(
      "Your project's `baseUrl` can only be set to `src` or `node_modules`." +
        ' Create React App does not support other values at this time.'
    )
  );
}
382422
function withOptions(defaults) {

  // closure for a @use/it instance with provided `defaults`.
  // `plugin` is a string (path or package name), function, or an array of either.
  // `options` is an object.
  // `root` is the location (__dirname) of the script calling use()
  // allowing us to determine the correct path for require()'ing
  // a local plugin path.
  return function use(plugin, options, root) {

    // this holds the combined options/defaults.
    var opts

    // if we received an array then flatten it and call ourself on each.
    if (Array.isArray(plugin)) {

      plugin = flatten([plugin])

      for (var el of plugin) {
        this.use(el, options, root)
      }

      // return because we called this function on each array element.
      return
    }

    // if there are `options` then try to combine them with `defaults`
    // or create a copy of it.
    if (options) {
      if (defaults) {
        opts = Object.assign({}, defaults, options)
      }

      else {
        opts = Object.create(options)
      }
    }

    // otherwise, copy the defaults (which may be null).
    else {
      opts = Object.create(defaults)
    }

    // if the plugin is a package name or path to a file then we require() it.
    if (typeof(plugin) === 'string') {

      // if it starts with a dot and there's a `root` then join them
      if (plugin[0] === '.' && root) {
        plugin = join(root, plugin)
      }

      // now try to require the plugin function and call it with this @use/it
      // instance and the options (`opts`).
      try {
        // also, return the result which may contain an error result.
        return require(plugin).call(this, opts, this)
      } catch(error) {
        return {error: 'failed to require and call plugin', plugin: plugin, opts: opts}
      }
    }

    // otherwise, if it's a function then skip the require() and call it.
    else if (typeof(plugin) === 'function') {
      return plugin.call(this, opts, this)
    }

    // lastly, we didn't get a string or function so return an error.
    else {
      return { error: 'plugin must be string, function, or array', plugin: plugin }
    }
  }
}
530993
function configFactory(filename, options) {
    if (!_.isObject(options)) {
        options = {};
    }

    var config = WebpackConfig.loader.loadConfig(filename),
        isArray = _.isArray(config);

    if (!isArray) {
        config = [config];
    }

    config = _.map(config, function(x) {
        x.merge(options);
        x.defaults({
            output: {
                path: path.dirname(filename)
            }
        });

        return x;
    });

    return isArray ? config : _.first(config);
}
830262
function CompileModules(inputTree, options) {
    if (!(this instanceof CompileModules)) {
        return new CompileModules(inputTree, options);
    }

    options || (options = {});

    var formatter = options.formatter;

    if (!formatter) {
        formatter = transpiler.formatters.DEFAULT;
    }

    if (typeof formatter === 'string') {
        formatter = transpiler.formatters[formatter];
    }

    var resolverClasses = options.resolvers;

    if (!resolverClasses) {
        resolverClasses = [ FileResolver ];
    }

    this.inputTree       = inputTree;
    this.resolverClasses = resolverClasses;
    this.formatter       = formatter;
    this.output          = options.output || '.';
    this.basePath        = options.basePath;
    this.sourceRoot      = options.sourceRoot || '/';
    this.description     = options.description;

    this._cache = {};
}
1325312
function extras(src, js, options) {
		if (options.superword) {
			js = suber.pseudokeyword(
				js,
				getwords(options.superword, defaultoptions.superword),
				getwords(options.classword, defaultoptions.classword)
			);
		}
		return js;
	}
580269
function getOptions(options, cb) {
  options = options || {};
  options.sourceComments = options.sourceComments || false;
  options.data = options.data || null;
  options.file = getInputFile(options);
  options.outFile = getOutputFile(options);
  options.includePaths = (options.includePaths || []).join(path.delimiter);
  options.precision = parseInt(options.precision) || 5;
  options.sourceMap = getSourceMap(options);
  options.style = getStyle(options);
  options.indentWidth = getIndentWidth(options);
  options.indentType = getIndentType(options);
  options.linefeed = getLinefeed(options);

  // context object represents node-sass environment
  options.context = { options: options, callback: cb };

  options.result = {
    stats: getStats(options)
  };

  return options;
}
542061
function parse(src, module, makeModule, options) {
		// Find the first valid parser :
		debug('Find a parser for :', module.path)
		var result = _.find(parsers, function(def) {
			// debug('    Check parser match :', def.match)
			if(def.match instanceof RegExp) {
				return def.match.test(module.path);
			} else if ('string'   == typeof def.match) {
				return minimatch(module.path, def.match);
			} else if ('function' == typeof def.match) {
				return def.match(src, module, makeModule, options);
			} else {
				return false;
			}
		});
		if(!result) {
			debug('Warning: No valid parser found for %s. Json string is exported', module.path)
			return 'module.exports = ' + JSON.stringify(src);
		} else {
			debug('Ok parser match :', result.match);
			return result.parse(src, module, makeModule, options);
		}
	}
1334659
function(helpers, options) {
      if (typeof helpers === 'object') {
        this.visit('helper', helpers);
        return this;
      }

      if (lazy.isGlob(helpers)) {
        this.loader('helpers-glob', ['base-glob'], function (files) {
          return files.map(function (fp) {
            return require(path.resolve(fp));
          });
        });

        var res = this.compose('helpers-glob')(helpers, options);
        this.visit('helper', res);
        return this;
      }

      if (typeof helpers === 'string') {
        console.log('loading helpers from a string is not implemented yet.');
      }
      return this;
    }
985192
function parseOptions(options) {
    let functions = true;
    let classes = true;
    let variables = true;
    let typedefs = true;

    if (typeof options === "string") {
        functions = options !== "nofunc";
    } else if (typeof options === "object" && options !== null) {
        functions = options.functions !== false;
        classes = options.classes !== false;
        variables = options.variables !== false;
        typedefs = options.typedefs !== false;
    }

    return { functions, classes, variables, typedefs };
}
202484
function loadPluginsForType(type, options, version, compress) {
  // Start with default if available
  let plugins = type in allPlugins && allPlugins[type].default ? allPlugins[type].default.slice() : [];

  // Add plugins based on version presets
  plugins = version.reduce((plugins, preset) => {
    let presetPlugins;

    if ('string' == typeof preset) {
      preset = preset.toLowerCase();
      // Ignore generic
      if (RE_GENERIC_VERSION.test(preset)) return plugins;
      // Skip if babel version and type is postcss
      if (type == 'postcss' && preset in allPlugins.babel) return plugins;

      presetPlugins = allPlugins[type][preset];
      // Try and parse with browserslist if no match
      if (!presetPlugins) preset = { browsers: [preset] };
    }

    // Handle object ({ chrome: 5 }, { browsers: ['last 3'] })
    if (!presetPlugins && 'string' != typeof preset) {
      const key = Object.keys(preset)[0];
      const value = preset[key];

      if (key == 'browsers' && Array.isArray(value)) {
        if (type == 'postcss') {
          // Add Autoprefixer and pass-through
          presetPlugins = [['autoprefixer', preset]];
        } else if (type == 'babel') {
          try {
            // Add Babel plugins based on Autoprefixer-style config
            presetPlugins = resolvePluginsForBrowsers(
              browserslist(value).map(browser => {
                const [name, version] = browser.split(' ');

                return { [name]: version };
              })
            );
          } catch (err) {
            /* invalid browserslist value */
          }
        }
      } else {
        // See if concated key+value exists already
        presetPlugins =
          allPlugins[type][(key + value).toLowerCase()] || (type == 'babel' && resolvePluginsForBrowsers(preset));
      }
    }

    if (!presetPlugins) warn(`unable to resolve plugins for ${strong(preset)} version`, 1);

    return unique(plugins.concat(presetPlugins || []));
  }, plugins);

  // Add compression plugins
  if (compress && type in allPlugins && allPlugins[type].compress) {
    plugins.push(...allPlugins[type].compress);
  }

  // Add plugins defined in build (add before current plugins, but preserve order)
  for (let i = options.plugins.length - 1; i >= 0; i--) {
    const plugin = options.plugins[i];
    const pluginName = Array.isArray(plugin) ? plugin[0] : plugin;
    let exists = false;

    plugins.some((existingPlugin, idx) => {
      const existingPluginName = Array.isArray(existingPlugin) ? existingPlugin[0] : existingPlugin;

      // Overwrite if exists
      if (pluginName == existingPluginName) {
        plugins[idx] = plugin;
        exists = true;
      }

      return exists;
    });

    if (!exists) plugins.unshift(plugin);
  }
  options.plugins = plugins;
  // Store hash of plugin names
  options.fingerprint = md5(JSON.stringify(options));
  // Install missing dependencies
  dependencies.install(extractDependencyIds(options));
  resolveDependencyPaths(options);
}
1041039
function createInjector(options) {

  options = options || {};

  var configModule = {
    'config': ['value', options]
  };

  var modules = [ configModule, CoreModule ].concat(options.modules || []);

  return bootstrap(modules);
}
1007153
function main(opt) {
    var t = opt.types
    var template = opt.template

    return {
        manipulateOptions: function (rp) {
            var resolveModuleSource = rp.resolveModuleSource
            resolve =  resolveModuleSource || defaultResolve
        },

        visitor: {
            ImportDeclaration: {
                exit: function (curPath, state) {
                    var opts = state.opts
                    var file = state.file


                    var importPath = curPath.node.source.value
                    var jsFilename = file.opts.filename

                    if (importPath.endsWith('.css')) {
                        const env = process.env.BABEL_ENV || process.env.NODE_ENV || 'development'
                        if (env === 'development') {
                            devHandler(curPath, importPath, jsFilename)
                        } else {
                            prodHandler(curPath, opts, importPath, jsFilename, template, t)
                        }
                    }
                }
            }
        }
    }
}