Skip to content
Snippets Groups Projects
index.js 8.95 MiB
Newer Older
  • Learn to ignore specific revisions
  •  * @static
     * @memberOf _
     * @since 0.1.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a function, else `false`.
     * @example
     *
     * _.isFunction(_);
     * // => true
     *
     * _.isFunction(/abc/);
     * // => false
     */
    function isFunction(value) {
      if (!isObject(value)) {
        return false;
      }
      // The use of `Object#toString` avoids issues with the `typeof` operator
      // in Safari 9 which returns 'object' for typed arrays and other constructors.
      var tag = baseGetTag(value);
      return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
    }
    
    module.exports = isFunction;
    
    /***/ }),
    /* 46 */
    /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
    
    var Symbol = __webpack_require__(47),
        getRawTag = __webpack_require__(50),
        objectToString = __webpack_require__(51);
    
    /** `Object#toString` result references. */
    var nullTag = '[object Null]',
        undefinedTag = '[object Undefined]';
    
    /** Built-in value references. */
    var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
    
    /**
     * The base implementation of `getTag` without fallbacks for buggy environments.
     *
     * @private
     * @param {*} value The value to query.
     * @returns {string} Returns the `toStringTag`.
     */
    function baseGetTag(value) {
      if (value == null) {
        return value === undefined ? undefinedTag : nullTag;
      }
      return (symToStringTag && symToStringTag in Object(value))
        ? getRawTag(value)
        : objectToString(value);
    }
    
    module.exports = baseGetTag;
    
    
    /***/ }),
    /* 47 */
    /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
    
    var root = __webpack_require__(48);
    
    /** Built-in value references. */
    var Symbol = root.Symbol;
    
    module.exports = Symbol;
    
    /* 48 */
    /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
    
    var freeGlobal = __webpack_require__(49);
    
    /** Detect free variable `self`. */
    var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
    
    /** Used as a reference to the global object. */
    var root = freeGlobal || freeSelf || Function('return this')();
    
    module.exports = root;
    
    /***/ }),
    /* 49 */
    /***/ ((module) => {
    
    /** Detect free variable `global` from Node.js. */
    var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    module.exports = freeGlobal;
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    
    /***/ }),
    /* 50 */
    /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    var Symbol = __webpack_require__(47);
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    /** Used for built-in method references. */
    var objectProto = Object.prototype;
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    /** Used to check objects for own properties. */
    var hasOwnProperty = objectProto.hasOwnProperty;
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    /**
     * Used to resolve the
     * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
     * of values.
     */
    var nativeObjectToString = objectProto.toString;
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    /** Built-in value references. */
    var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
    
    /**
     * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
     *
     * @private
     * @param {*} value The value to query.
     * @returns {string} Returns the raw `toStringTag`.
     */
    function getRawTag(value) {
      var isOwn = hasOwnProperty.call(value, symToStringTag),
          tag = value[symToStringTag];
    
      try {
        value[symToStringTag] = undefined;
        var unmasked = true;
      } catch (e) {}
    
      var result = nativeObjectToString.call(value);
      if (unmasked) {
        if (isOwn) {
          value[symToStringTag] = tag;
        } else {
          delete value[symToStringTag];
    
    module.exports = getRawTag;
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    
    /***/ }),
    
    /* 51 */
    /***/ ((module) => {
    
    /** Used for built-in method references. */
    var objectProto = Object.prototype;
    
    /**
     * Used to resolve the
     * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
     * of values.
     */
    var nativeObjectToString = objectProto.toString;
    
    /**
     * Converts `value` to a string using `Object.prototype.toString`.
     *
     * @private
     * @param {*} value The value to convert.
     * @returns {string} Returns the converted string.
     */
    function objectToString(value) {
      return nativeObjectToString.call(value);
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    module.exports = objectToString;
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    
    /***/ }),
    /* 52 */
    /***/ ((module) => {
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    /**
     * Checks if `value` is the
     * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
     * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is an object, else `false`.
     * @example
     *
     * _.isObject({});
     * // => true
     *
     * _.isObject([1, 2, 3]);
     * // => true
     *
     * _.isObject(_.noop);
     * // => true
     *
     * _.isObject(null);
     * // => false
     */
    function isObject(value) {
      var type = typeof value;
      return value != null && (type == 'object' || type == 'function');
    }
    
    module.exports = isObject;
    
    /***/ }),
    /* 53 */
    /***/ ((module) => {
    
    /**
     * Checks if `value` is object-like. A value is object-like if it's not `null`
     * and has a `typeof` result of "object".
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
     * @example
     *
     * _.isObjectLike({});
     * // => true
     *
     * _.isObjectLike([1, 2, 3]);
     * // => true
     *
     * _.isObjectLike(_.noop);
     * // => false
     *
     * _.isObjectLike(null);
     * // => false
     */
    function isObjectLike(value) {
      return value != null && typeof value == 'object';
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    module.exports = isObjectLike;
    
    
    /***/ }),
    /* 54 */
    /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
    
    var baseGetTag = __webpack_require__(46),
        isArray = __webpack_require__(55),
        isObjectLike = __webpack_require__(53);
    
    /** `Object#toString` result references. */
    var stringTag = '[object String]';
    
    /**
     * Checks if `value` is classified as a `String` primitive or object.
     *
     * @static
     * @since 0.1.0
     * @memberOf _
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a string, else `false`.
     * @example
     *
     * _.isString('abc');
     * // => true
     *
     * _.isString(1);
     * // => false
     */
    function isString(value) {
      return typeof value == 'string' ||
        (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
    
    
    module.exports = isString;
    
    
    /***/ }),
    /* 55 */
    /***/ ((module) => {
    
    /**
     * Checks if `value` is classified as an `Array` object.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is an array, else `false`.
     * @example
     *
     * _.isArray([1, 2, 3]);
     * // => true
     *
     * _.isArray(document.body.children);
     * // => false
     *
     * _.isArray('abc');
     * // => false
     *
     * _.isArray(_.noop);
     * // => false
     */
    var isArray = Array.isArray;
    
    module.exports = isArray;
    
    
    /***/ }),
    /* 56 */
    /***/ ((module) => {
    
    /**
     * Checks if `value` is `undefined`.
     *
     * @static
     * @since 0.1.0
     * @memberOf _
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
     * @example
     *
     * _.isUndefined(void 0);
     * // => true
     *
     * _.isUndefined(null);
     * // => false
     */
    function isUndefined(value) {
      return value === undefined;
    
    
    module.exports = isUndefined;
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    
    /* 57 */
    /***/ ((module) => {
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    var isNative = /\.node$/;
    
    function forEach(obj, callback) {
        for ( var key in obj ) {
            if (!Object.prototype.hasOwnProperty.call(obj, key)) {
                continue;
    
            callback(key);
    
    Romain CREY's avatar
    Romain CREY committed
    }
    
    
    function assign(target, source) {
        forEach(source, function (key) {
            target[key] = source[key];
        });
        return target;
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    function clearCache(requireCache) {
        forEach(requireCache, function (resolvedPath) {
            if (!isNative.test(resolvedPath)) {
                delete requireCache[resolvedPath];
            }
        });
    }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    module.exports = function (requireCache, callback, callbackForModulesToKeep, module) {
    
    Romain CREY's avatar
    Romain CREY committed
    
    
        var originalCache = assign({}, requireCache);
        clearCache(requireCache);
    
    Romain CREY's avatar
    Romain CREY committed
    
    
        if (callbackForModulesToKeep) {
    
    Romain CREY's avatar
    Romain CREY committed
    
    
            var originalModuleChildren = module.children ? module.children.slice() : false; // Creates a shallow copy of module.children
    
    Romain CREY's avatar
    Romain CREY committed
    
    
            callbackForModulesToKeep();
    
    Romain CREY's avatar
    Romain CREY committed
    
    
            // Lists the cache entries made by callbackForModulesToKeep()
            var modulesToKeep = [];
            forEach(requireCache, function (key) {
                modulesToKeep.push(key);
            });
    
    Romain CREY's avatar
    Romain CREY committed
    
    
            // Discards the modules required in callbackForModulesToKeep()
            clearCache(requireCache);
    
    Romain CREY's avatar
    Romain CREY committed
    
    
            if (module.children) { // Only true for node.js
                module.children = originalModuleChildren; // Removes last references to modules required in callbackForModulesToKeep() -> No memory leak
            }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
            // Takes the cache entries of the original cache in case the modules where required before
            for ( var i = 0; i < modulesToKeep.length; i+=1 ) {
                if (originalCache[modulesToKeep[i]]) {
                    requireCache[modulesToKeep[i]] = originalCache[modulesToKeep[i]];
                }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
        var freshModule = callback();
    
        var stealthCache = callbackForModulesToKeep ? assign({}, requireCache) : false;
    
        clearCache(requireCache);
    
        if (callbackForModulesToKeep) {
            // In case modules to keep were required inside the stealthy require for the first time, copy them to the restored cache
            for ( var k = 0; k < modulesToKeep.length; k+=1 ) {
                if (stealthCache[modulesToKeep[k]]) {
                    requireCache[modulesToKeep[k]] = stealthCache[modulesToKeep[k]];
    
    Romain CREY's avatar
    Romain CREY committed
    
    
        assign(requireCache, originalCache);
    
    Romain CREY's avatar
    Romain CREY committed
    
    
        return freshModule;
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    
    /***/ }),
    
    /* 58 */
    /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
    
    
    "use strict";
    
    // Copyright 2010-2012 Mikeal Rogers
    //
    //    Licensed under the Apache License, Version 2.0 (the "License");
    //    you may not use this file except in compliance with the License.
    //    You may obtain a copy of the License at
    //
    //        http://www.apache.org/licenses/LICENSE-2.0
    //
    //    Unless required by applicable law or agreed to in writing, software
    //    distributed under the License is distributed on an "AS IS" BASIS,
    //    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    //    See the License for the specific language governing permissions and
    //    limitations under the License.
    
    
    var extend = __webpack_require__(59)
    var cookies = __webpack_require__(60)
    var helpers = __webpack_require__(74)
    
    var paramsHaveRequestBody = helpers.paramsHaveRequestBody
    
    // organize params for patch, post, put, head, del
    function initParams (uri, options, callback) {
      if (typeof options === 'function') {
        callback = options
      }
    
      var params = {}
      if (options !== null && typeof options === 'object') {
        extend(params, options, {uri: uri})
      } else if (typeof uri === 'string') {
        extend(params, {uri: uri})
      } else {
        extend(params, uri)
      }
    
      params.callback = callback || params.callback
      return params
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    function request (uri, options, callback) {
      if (typeof uri === 'undefined') {
        throw new Error('undefined is not a valid uri or options object.')
      }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
      var params = initParams(uri, options, callback)
    
    Romain CREY's avatar
    Romain CREY committed
    
    
      if (params.method === 'HEAD' && paramsHaveRequestBody(params)) {
        throw new Error('HTTP HEAD requests MUST NOT include a request body.')
      }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
      return new request.Request(params)
    }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    function verbFunc (verb) {
      var method = verb.toUpperCase()
      return function (uri, options, callback) {
        var params = initParams(uri, options, callback)
        params.method = method
        return request(params, params.callback)
      }
    }
    
    // define like this to please codeintel/intellisense IDEs
    request.get = verbFunc('get')
    request.head = verbFunc('head')
    request.options = verbFunc('options')
    request.post = verbFunc('post')
    request.put = verbFunc('put')
    request.patch = verbFunc('patch')
    request.del = verbFunc('delete')
    request['delete'] = verbFunc('delete')
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    request.jar = function (store) {
      return cookies.jar(store)
    }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    request.cookie = function (str) {
      return cookies.parse(str)
    }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    function wrapRequestMethod (method, options, requester, verb) {
      return function (uri, opts, callback) {
        var params = initParams(uri, opts, callback)
    
        var target = {}
        extend(true, target, options, params)
    
        target.pool = params.pool || options.pool
    
        if (verb) {
          target.method = verb.toUpperCase()
    
    Romain CREY's avatar
    Romain CREY committed
    
    
        if (typeof requester === 'function') {
          method = requester
    
        return method(target, target.callback)
      }
    }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    request.defaults = function (options, requester) {
      var self = this
    
    Romain CREY's avatar
    Romain CREY committed
    
    
      options = options || {}
    
      if (typeof options === 'function') {
        requester = options
        options = {}
      }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
      var defaults = wrapRequestMethod(self, options, requester)
    
    Romain CREY's avatar
    Romain CREY committed
    
    
      var verbs = ['get', 'head', 'post', 'put', 'patch', 'del', 'delete']
      verbs.forEach(function (verb) {
        defaults[verb] = wrapRequestMethod(self[verb], options, requester, verb)
      })
    
    Romain CREY's avatar
    Romain CREY committed
    
    
      defaults.cookie = wrapRequestMethod(self.cookie, options, requester)
      defaults.jar = self.jar
      defaults.defaults = self.defaults
      return defaults
    }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    request.forever = function (agentOptions, optionsArg) {
      var options = {}
      if (optionsArg) {
        extend(options, optionsArg)
      }
      if (agentOptions) {
        options.agentOptions = agentOptions
      }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
      options.forever = true
      return request.defaults(options)
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    module.exports = request
    request.Request = __webpack_require__(79)
    request.initParams = initParams
    
    // Backwards compatibility for request.debug
    Object.defineProperty(request, 'debug', {
      enumerable: true,
      get: function () {
        return request.Request.debug
      },
      set: function (debug) {
        request.Request.debug = debug
      }
    })
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    
    /***/ }),
    
    /* 59 */
    /***/ ((module) => {
    
    "use strict";
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    
    var hasOwn = Object.prototype.hasOwnProperty;
    var toStr = Object.prototype.toString;
    var defineProperty = Object.defineProperty;
    var gOPD = Object.getOwnPropertyDescriptor;
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    var isArray = function isArray(arr) {
    	if (typeof Array.isArray === 'function') {
    		return Array.isArray(arr);
    	}
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    	return toStr.call(arr) === '[object Array]';
    };
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    var isPlainObject = function isPlainObject(obj) {
    	if (!obj || toStr.call(obj) !== '[object Object]') {
    		return false;
    	}
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    	var hasOwnConstructor = hasOwn.call(obj, 'constructor');
    	var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');
    	// Not own constructor property must be Object
    	if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {
    		return false;
    	}
    
    	// Own properties are enumerated firstly, so to speed up,
    	// if last one is own, then all properties are own.
    	var key;
    	for (key in obj) { /**/ }
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    	return typeof key === 'undefined' || hasOwn.call(obj, key);
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    // If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target
    var setProperty = function setProperty(target, options) {
    	if (defineProperty && options.name === '__proto__') {
    		defineProperty(target, options.name, {
    			enumerable: true,
    			configurable: true,
    			value: options.newValue,
    			writable: true
    		});
    	} else {
    		target[options.name] = options.newValue;
    	}
    
    // Return undefined instead of __proto__ if '__proto__' is not an own property
    var getProperty = function getProperty(obj, name) {
    	if (name === '__proto__') {
    		if (!hasOwn.call(obj, name)) {
    			return void 0;
    		} else if (gOPD) {
    			// In early versions of node, obj['__proto__'] is buggy when obj has
    			// __proto__ as an own property. Object.getOwnPropertyDescriptor() works.
    			return gOPD(obj, name).value;
    		}
    	}
    
    	return obj[name];
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    module.exports = function extend() {
    	var options, name, src, copy, copyIsArray, clone;
    	var target = arguments[0];
    	var i = 1;
    	var length = arguments.length;
    	var deep = false;
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    	// Handle a deep copy situation
    	if (typeof target === 'boolean') {
    		deep = target;
    		target = arguments[1] || {};
    		// skip the boolean and the target
    		i = 2;
    	}
    	if (target == null || (typeof target !== 'object' && typeof target !== 'function')) {
    		target = {};
    	}
    
    Romain CREY's avatar
    Romain CREY committed
    
    
    	for (; i < length; ++i) {
    		options = arguments[i];
    		// Only deal with non-null/undefined values
    		if (options != null) {
    			// Extend the base object
    			for (name in options) {
    				src = getProperty(target, name);
    				copy = getProperty(options, name);
    
    				// Prevent never-ending loop
    				if (target !== copy) {
    					// Recurse if we're merging plain objects or arrays
    					if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {
    						if (copyIsArray) {
    							copyIsArray = false;
    							clone = src && isArray(src) ? src : [];
    						} else {
    							clone = src && isPlainObject(src) ? src : {};
    						}
    
    						// Never move original objects, clone them
    						setProperty(target, { name: name, newValue: extend(deep, clone, copy) });
    
    					// Don't bring in undefined values
    					} else if (typeof copy !== 'undefined') {
    						setProperty(target, { name: name, newValue: copy });
    					}
    				}
    			}
    		}
    	}
    
    	// Return the modified object
    	return target;
    };
    
    /***/ }),
    /* 60 */
    /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
    
    var tough = __webpack_require__(61)
    
    var Cookie = tough.Cookie
    var CookieJar = tough.CookieJar
    
    exports.parse = function (str) {
      if (str && str.uri) {
        str = str.uri
      }
      if (typeof str !== 'string') {
        throw new Error('The cookie function only accepts STRING as param')
      }
      return Cookie.parse(str, {loose: true})
    }
    
    // Adapt the sometimes-Async api of tough.CookieJar to our requirements
    function RequestJar (store) {
      var self = this
      self._jar = new CookieJar(store, {looseMode: true})
    }
    RequestJar.prototype.setCookie = function (cookieOrStr, uri, options) {
      var self = this
      return self._jar.setCookieSync(cookieOrStr, uri, options || {})
    }
    RequestJar.prototype.getCookieString = function (uri) {
      var self = this
      return self._jar.getCookieStringSync(uri)
    }
    RequestJar.prototype.getCookies = function (uri) {
      var self = this
      return self._jar.getCookiesSync(uri)
    }
    
    exports.jar = function (store) {
      return new RequestJar(store)
    }
    
    /***/ }),
    
    /* 61 */
    /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
    
    "use strict";
    
    /*!
     * Copyright (c) 2015, Salesforce.com, Inc.
     * All rights reserved.
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions are met:
     *
     * 1. Redistributions of source code must retain the above copyright notice,
     * this list of conditions and the following disclaimer.
     *
     * 2. Redistributions in binary form must reproduce the above copyright notice,
     * this list of conditions and the following disclaimer in the documentation
     * and/or other materials provided with the distribution.
     *
     * 3. Neither the name of Salesforce.com nor the names of its contributors may
     * be used to endorse or promote products derived from this software without
     * specific prior written permission.
     *
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
     * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     * POSSIBILITY OF SUCH DAMAGE.
     */
    
    var net = __webpack_require__(62);
    
    var urlParse = (__webpack_require__(63).parse);
    
    var util = __webpack_require__(64);
    var pubsuffix = __webpack_require__(65);
    
    var Store = (__webpack_require__(69).Store);
    var MemoryCookieStore = (__webpack_require__(70).MemoryCookieStore);
    var pathMatch = (__webpack_require__(72).pathMatch);
    
    var VERSION = __webpack_require__(73);
    
    var punycode;
    try {
      punycode = __webpack_require__(67);
    } catch(e) {
      console.warn("tough-cookie: can't load punycode; won't use punycode for domain normalization");
    
    // From RFC6265 S4.1.1
    // note that it excludes \x3B ";"
    var COOKIE_OCTETS = /^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]+$/;
    
    var CONTROL_CHARS = /[\x00-\x1F]/;
    
    // From Chromium // '\r', '\n' and '\0' should be treated as a terminator in
    // the "relaxed" mode, see:
    // https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L60
    var TERMINATORS = ['\n', '\r', '\0'];
    
    // RFC6265 S4.1.1 defines path value as 'any CHAR except CTLs or ";"'
    // Note ';' is \x3B
    var PATH_VALUE = /[\x20-\x3A\x3C-\x7E]+/;
    
    // date-time parsing constants (RFC6265 S5.1.1)
    
    var DATE_DELIM = /[\x09\x20-\x2F\x3B-\x40\x5B-\x60\x7B-\x7E]/;
    
    var MONTH_TO_NUM = {
      jan:0, feb:1, mar:2, apr:3, may:4, jun:5,
      jul:6, aug:7, sep:8, oct:9, nov:10, dec:11
    
    var NUM_TO_MONTH = [
      'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'
    ];
    var NUM_TO_DAY = [
      'Sun','Mon','Tue','Wed','Thu','Fri','Sat'
    ];
    
    var MAX_TIME = 2147483647000; // 31-bit max
    var MIN_TIME = 0; // 31-bit min
    
    /*
     * Parses a Natural number (i.e., non-negative integer) with either the
     *    <min>*<max>DIGIT ( non-digit *OCTET )
     * or
     *    <min>*<max>DIGIT
     * grammar (RFC6265 S5.1.1).
     *
     * The "trailingOK" boolean controls if the grammar accepts a
     * "( non-digit *OCTET )" trailer.
     */
    function parseDigits(token, minDigits, maxDigits, trailingOK) {
      var count = 0;
      while (count < token.length) {
        var c = token.charCodeAt(count);
        // "non-digit = %x00-2F / %x3A-FF"
        if (c <= 0x2F || c >= 0x3A) {
          break;
        }
        count++;
      }
    
      // constrain to a minimum and maximum number of digits.
      if (count < minDigits || count > maxDigits) {
        return null;
      }
    
      if (!trailingOK && count != token.length) {
        return null;
      }
    
      return parseInt(token.substr(0,count), 10);
    }
    
    function parseTime(token) {
      var parts = token.split(':');
      var result = [0,0,0];
    
      /* RF6256 S5.1.1:
       *      time            = hms-time ( non-digit *OCTET )
       *      hms-time        = time-field ":" time-field ":" time-field
       *      time-field      = 1*2DIGIT
       */
    
      if (parts.length !== 3) {
        return null;
      }
    
      for (var i = 0; i < 3; i++) {
        // "time-field" must be strictly "1*2DIGIT", HOWEVER, "hms-time" can be
        // followed by "( non-digit *OCTET )" so therefore the last time-field can
        // have a trailer
        var trailingOK = (i == 2);
        var num = parseDigits(parts[i], 1, 2, trailingOK);
        if (num === null) {
          return null;
    
      return result;
    
    function parseMonth(token) {
      token = String(token).substr(0,3).toLowerCase();
      var num = MONTH_TO_NUM[token];
      return num >= 0 ? num : null;
    }
    
    /*
     * RFC6265 S5.1.1 date parser (see RFC for full grammar)
     */
    function parseDate(str) {
      if (!str) {
        return;
      }
    
      /* RFC6265 S5.1.1:
       * 2. Process each date-token sequentially in the order the date-tokens
       * appear in the cookie-date
       */
      var tokens = str.split(DATE_DELIM);
      if (!tokens) {
        return;
      }
    
      var hour = null;
      var minute = null;
      var second = null;
      var dayOfMonth = null;
      var month = null;
      var year = null;
    
      for (var i=0; i<tokens.length; i++) {
        var token = tokens[i].trim();
        if (!token.length) {
          continue;
        }
    
        /* 2.1. If the found-time flag is not set and the token matches the time
         * production, set the found-time flag and set the hour- value,
         * minute-value, and second-value to the numbers denoted by the digits in
         * the date-token, respectively.  Skip the remaining sub-steps and continue
         * to the next date-token.
         */
        if (second === null) {
          result = parseTime(token);
          if (result) {
            hour = result[0];
            minute = result[1];
            second = result[2];
            continue;
          }
    
        /* 2.2. If the found-day-of-month flag is not set and the date-token matches
         * the day-of-month production, set the found-day-of- month flag and set
         * the day-of-month-value to the number denoted by the date-token.  Skip
         * the remaining sub-steps and continue to the next date-token.
         */
        if (dayOfMonth === null) {
          // "day-of-month = 1*2DIGIT ( non-digit *OCTET )"
          result = parseDigits(token, 1, 2, true);
          if (result !== null) {
            dayOfMonth = result;
            continue;
          }
    
        /* 2.3. If the found-month flag is not set and the date-token matches the
         * month production, set the found-month flag and set the month-value to
         * the month denoted by the date-token.  Skip the remaining sub-steps and
         * continue to the next date-token.
         */
        if (month === null) {
          result = parseMonth(token);
          if (result !== null) {
            month = result;
            continue;
          }
    
        /* 2.4. If the found-year flag is not set and the date-token matches the
         * year production, set the found-year flag and set the year-value to the
         * number denoted by the date-token.  Skip the remaining sub-steps and
         * continue to the next date-token.
         */
        if (year === null) {
          // "year = 2*4DIGIT ( non-digit *OCTET )"