module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};

/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {

/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId])
/******/ 			return installedModules[moduleId].exports;

/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			i: moduleId,
/******/ 			l: false,
/******/ 			exports: {}
/******/ 		};

/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);

/******/ 		// Flag the module as loaded
/******/ 		module.l = true;

/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}


/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;

/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;

/******/ 	// identity function for calling harmory imports with the correct context
/******/ 	__webpack_require__.i = function(value) { return value; };

/******/ 	// define getter function for harmory exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		Object.defineProperty(exports, name, {
/******/ 			configurable: false,
/******/ 			enumerable: true,
/******/ 			get: getter
/******/ 		});
/******/ 	};

/******/ 	// getDefaultExport function for compatibility with non-harmony modules
/******/ 	__webpack_require__.n = function(module) {
/******/ 		var getter = module && module.__esModule ?
/******/ 			function getDefault() { return module['default']; } :
/******/ 			function getModuleExports() { return module; };
/******/ 		__webpack_require__.d(getter, 'a', getter);
/******/ 		return getter;
/******/ 	};

/******/ 	// Object.prototype.hasOwnProperty.call
/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };

/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "";

/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = 2);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports) {

module.exports = require("assert");

/***/ },
/* 1 */
/***/ function(module, exports) {

module.exports = require("lodash");

/***/ },
/* 2 */
/***/ function(module, exports, __webpack_require__) {

"use strict";
"use strict";
var assert = __webpack_require__(0);
var lodash_1 = __webpack_require__(1);
var DEV_RULES = ['dev', 'development'];
var PROD_RULES = ['prod', 'production'];
function _buildExtras(args) {
    if (args === void 0) { args = []; }
    if (!args.length) {
        return [];
    }
    // string
    if (lodash_1.isString(args[0]) && !lodash_1.isEmpty(args[0])) {
        assert(args.slice(1).reduce(function (count, env) {
            return count += (lodash_1.isString(env) && !lodash_1.isEmpty(env)) ? 0 : 1;
        }, 0) === 0, 'When the first argument is a non-empty string, then the rest should all be non-empty strings.');
        return args.map(function (env) {
            return {
                env: env,
                rules: [env.toLowerCase()]
            };
        });
    }
    // array
    if (Array.isArray(args[0])) {
        assert(args.length === 1, 'When the first argument is an array, arguments.length should be 1.');
        assert(args[0].reduce(function (count, env) {
            return count += (lodash_1.isString(env) && !lodash_1.isEmpty(env)) ? 0 : 1;
        }, 0) === 0, 'When the first argument is an array, all its elements should be non-empty strings.');
        return args[0].map(function (env) {
            return {
                env: env,
                rules: [env.toLowerCase()]
            };
        });
    }
    // object
    if (lodash_1.isPlainObject(args[0])) {
        assert(args.length === 1, 'When the first argument is a plain object, arguments.length should be 1.');
        var extras = [];
        for (var _i = 0, _a = lodash_1.toPairs(args[0]); _i < _a.length; _i++) {
            var _b = _a[_i], env = _b[0], rules = _b[1];
            assert((lodash_1.isString(rules) && !lodash_1.isEmpty(rules)) || (Array.isArray(rules) && rules.reduce(function (count, rule) {
                return count += (lodash_1.isString(rule) && !lodash_1.isEmpty(rule)) ? 0 : 1;
            }, 0) === 0), 'Rules of a plain object should be a non-empty string or an array of non-empty strings.');
            if (lodash_1.isString(rules) && !lodash_1.isEmpty(rules)) {
                extras.push({
                    env: env,
                    rules: [rules.toLowerCase()]
                });
            }
            else {
                extras.push({
                    env: env,
                    rules: rules.map(function (rule) { return rule.toLowerCase(); })
                });
            }
        }
        return extras;
    }
    throw new Error('Arguments must be non-empty string, array, or a plain object.');
}
module.exports = function () {
    var args = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        args[_i - 0] = arguments[_i];
    }
    var extras = _buildExtras(args);
    var nodeEnv = (process.env.NODE_ENV || '').toLowerCase();
    for (var i = 0; i < extras.length; ++i) {
        var extra = extras[i];
        if (lodash_1.includes(extra.rules, nodeEnv)) {
            return extra.env;
        }
    }
    if (lodash_1.includes(PROD_RULES, nodeEnv)) {
        return 'prod';
    }
    if (lodash_1.includes(DEV_RULES, nodeEnv) || nodeEnv === '') {
        return 'dev';
    }
    throw new Error("Unknown environment name: NODE_ENV=" + nodeEnv);
};


/***/ }
/******/ ]);