|
@@ -0,0 +1,2502 @@
|
|
|
+(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
|
|
|
+/**
|
|
|
+ * lodash 3.0.0 (Custom Build) <https://lodash.com/>
|
|
|
+ * Build: `lodash modern modularize exports="npm" -o ./`
|
|
|
+ * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
|
|
|
+ * Based on Underscore.js 1.7.0 <http://underscorejs.org/LICENSE>
|
|
|
+ * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
|
+ * Available under MIT license <https://lodash.com/license>
|
|
|
+ */
|
|
|
+
|
|
|
+/**
|
|
|
+ * A specialized version of `_.map` for arrays without support for callback
|
|
|
+ * shorthands or `this` binding.
|
|
|
+ *
|
|
|
+ * @private
|
|
|
+ * @param {Array} array The array to iterate over.
|
|
|
+ * @param {Function} iteratee The function invoked per iteration.
|
|
|
+ * @returns {Array} Returns the new mapped array.
|
|
|
+ */
|
|
|
+function arrayMap(array, iteratee) {
|
|
|
+ var index = -1,
|
|
|
+ length = array.length,
|
|
|
+ result = Array(length);
|
|
|
+
|
|
|
+ while (++index < length) {
|
|
|
+ result[index] = iteratee(array[index], index, array);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+}
|
|
|
+
|
|
|
+module.exports = arrayMap;
|
|
|
+
|
|
|
+},{}],2:[function(require,module,exports){
|
|
|
+/**
|
|
|
+ * lodash 3.0.0 (Custom Build) <https://lodash.com/>
|
|
|
+ * Build: `lodash modern modularize exports="npm" -o ./`
|
|
|
+ * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
|
|
|
+ * Based on Underscore.js 1.7.0 <http://underscorejs.org/LICENSE>
|
|
|
+ * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
|
+ * Available under MIT license <https://lodash.com/license>
|
|
|
+ */
|
|
|
+
|
|
|
+/** Used to match template delimiters. */
|
|
|
+var reInterpolate = /<%=([\s\S]+?)%>/g;
|
|
|
+
|
|
|
+module.exports = reInterpolate;
|
|
|
+
|
|
|
+},{}],3:[function(require,module,exports){
|
|
|
+(function (global){
|
|
|
+/**
|
|
|
+ * lodash 4.0.0 (Custom Build) <https://lodash.com/>
|
|
|
+ * Build: `lodash modularize exports="npm" -o ./`
|
|
|
+ * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
|
|
|
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
|
+ * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
|
+ * Available under MIT license <https://lodash.com/license>
|
|
|
+ */
|
|
|
+var keysIn = require('lodash.keysin'),
|
|
|
+ rest = require('lodash.rest');
|
|
|
+
|
|
|
+/** Used as references for various `Number` constants. */
|
|
|
+var MAX_SAFE_INTEGER = 9007199254740991;
|
|
|
+
|
|
|
+/** `Object#toString` result references. */
|
|
|
+var funcTag = '[object Function]',
|
|
|
+ genTag = '[object GeneratorFunction]';
|
|
|
+
|
|
|
+/** Used to detect unsigned integer values. */
|
|
|
+var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if `value` is a valid array-like index.
|
|
|
+ *
|
|
|
+ * @private
|
|
|
+ * @param {*} value The value to check.
|
|
|
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
|
|
|
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
|
|
|
+ */
|
|
|
+function isIndex(value, length) {
|
|
|
+ value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
|
|
|
+ length = length == null ? MAX_SAFE_INTEGER : length;
|
|
|
+ return value > -1 && value % 1 == 0 && value < length;
|
|
|
+}
|
|
|
+
|
|
|
+/** Used for built-in method references. */
|
|
|
+var objectProto = global.Object.prototype;
|
|
|
+
|
|
|
+/** Used to check objects for own properties. */
|
|
|
+var hasOwnProperty = objectProto.hasOwnProperty;
|
|
|
+
|
|
|
+/**
|
|
|
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
|
|
+ * of values.
|
|
|
+ */
|
|
|
+var objectToString = objectProto.toString;
|
|
|
+
|
|
|
+/**
|
|
|
+ * Assigns `value` to `key` of `object` if the existing value is not equivalent
|
|
|
+ * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
|
|
|
+ * for equality comparisons.
|
|
|
+ *
|
|
|
+ * @private
|
|
|
+ * @param {Object} object The object to modify.
|
|
|
+ * @param {string} key The key of the property to assign.
|
|
|
+ * @param {*} value The value to assign.
|
|
|
+ */
|
|
|
+function assignValue(object, key, value) {
|
|
|
+ var objValue = object[key];
|
|
|
+ if ((!eq(objValue, value) ||
|
|
|
+ (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) ||
|
|
|
+ (value === undefined && !(key in object))) {
|
|
|
+ object[key] = value;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * The base implementation of `_.property` without support for deep paths.
|
|
|
+ *
|
|
|
+ * @private
|
|
|
+ * @param {string} key The key of the property to get.
|
|
|
+ * @returns {Function} Returns the new function.
|
|
|
+ */
|
|
|
+function baseProperty(key) {
|
|
|
+ return function(object) {
|
|
|
+ return object == null ? undefined : object[key];
|
|
|
+ };
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * This function is like `copyObject` except that it accepts a function to
|
|
|
+ * customize copied values.
|
|
|
+ *
|
|
|
+ * @private
|
|
|
+ * @param {Object} source The object to copy properties from.
|
|
|
+ * @param {Array} props The property names to copy.
|
|
|
+ * @param {Object} [object={}] The object to copy properties to.
|
|
|
+ * @param {Function} [customizer] The function to customize copied values.
|
|
|
+ * @returns {Object} Returns `object`.
|
|
|
+ */
|
|
|
+function copyObjectWith(source, props, object, customizer) {
|
|
|
+ object || (object = {});
|
|
|
+
|
|
|
+ var index = -1,
|
|
|
+ length = props.length;
|
|
|
+
|
|
|
+ while (++index < length) {
|
|
|
+ var key = props[index],
|
|
|
+ newValue = customizer ? customizer(object[key], source[key], key, object, source) : source[key];
|
|
|
+
|
|
|
+ assignValue(object, key, newValue);
|
|
|
+ }
|
|
|
+ return object;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Creates a function like `_.assign`.
|
|
|
+ *
|
|
|
+ * @private
|
|
|
+ * @param {Function} assigner The function to assign values.
|
|
|
+ * @returns {Function} Returns the new assigner function.
|
|
|
+ */
|
|
|
+function createAssigner(assigner) {
|
|
|
+ return rest(function(object, sources) {
|
|
|
+ var index = -1,
|
|
|
+ length = sources.length,
|
|
|
+ customizer = length > 1 ? sources[length - 1] : undefined,
|
|
|
+ guard = length > 2 ? sources[2] : undefined;
|
|
|
+
|
|
|
+ customizer = typeof customizer == 'function' ? (length--, customizer) : undefined;
|
|
|
+ if (guard && isIterateeCall(sources[0], sources[1], guard)) {
|
|
|
+ customizer = length < 3 ? undefined : customizer;
|
|
|
+ length = 1;
|
|
|
+ }
|
|
|
+ object = Object(object);
|
|
|
+ while (++index < length) {
|
|
|
+ var source = sources[index];
|
|
|
+ if (source) {
|
|
|
+ assigner(object, source, customizer);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return object;
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Gets the "length" property value of `object`.
|
|
|
+ *
|
|
|
+ * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
|
|
|
+ * that affects Safari on at least iOS 8.1-8.3 ARM64.
|
|
|
+ *
|
|
|
+ * @private
|
|
|
+ * @param {Object} object The object to query.
|
|
|
+ * @returns {*} Returns the "length" value.
|
|
|
+ */
|
|
|
+var getLength = baseProperty('length');
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if the provided arguments are from an iteratee call.
|
|
|
+ *
|
|
|
+ * @private
|
|
|
+ * @param {*} value The potential iteratee value argument.
|
|
|
+ * @param {*} index The potential iteratee index or key argument.
|
|
|
+ * @param {*} object The potential iteratee object argument.
|
|
|
+ * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.
|
|
|
+ */
|
|
|
+function isIterateeCall(value, index, object) {
|
|
|
+ if (!isObject(object)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ var type = typeof index;
|
|
|
+ if (type == 'number'
|
|
|
+ ? (isArrayLike(object) && isIndex(index, object.length))
|
|
|
+ : (type == 'string' && index in object)) {
|
|
|
+ return eq(object[index], value);
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
|
|
|
+ * comparison between two values to determine if they are equivalent.
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @category Lang
|
|
|
+ * @param {*} value The value to compare.
|
|
|
+ * @param {*} other The other value to compare.
|
|
|
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * var object = { 'user': 'fred' };
|
|
|
+ * var other = { 'user': 'fred' };
|
|
|
+ *
|
|
|
+ * _.eq(object, object);
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.eq(object, other);
|
|
|
+ * // => false
|
|
|
+ *
|
|
|
+ * _.eq('a', 'a');
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.eq('a', Object('a'));
|
|
|
+ * // => false
|
|
|
+ *
|
|
|
+ * _.eq(NaN, NaN);
|
|
|
+ * // => true
|
|
|
+ */
|
|
|
+function eq(value, other) {
|
|
|
+ return value === other || (value !== value && other !== other);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if `value` is array-like. A value is considered array-like if it's
|
|
|
+ * not a function and has a `value.length` that's an integer greater than or
|
|
|
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @type Function
|
|
|
+ * @category Lang
|
|
|
+ * @param {*} value The value to check.
|
|
|
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * _.isArrayLike([1, 2, 3]);
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.isArrayLike(document.body.children);
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.isArrayLike('abc');
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.isArrayLike(_.noop);
|
|
|
+ * // => false
|
|
|
+ */
|
|
|
+function isArrayLike(value) {
|
|
|
+ return value != null &&
|
|
|
+ !(typeof value == 'function' && isFunction(value)) && isLength(getLength(value));
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if `value` is classified as a `Function` object.
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @category Lang
|
|
|
+ * @param {*} value The value to check.
|
|
|
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * _.isFunction(_);
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.isFunction(/abc/);
|
|
|
+ * // => false
|
|
|
+ */
|
|
|
+function isFunction(value) {
|
|
|
+ // The use of `Object#toString` avoids issues with the `typeof` operator
|
|
|
+ // in Safari 8 which returns 'object' for typed array constructors, and
|
|
|
+ // PhantomJS 1.9 which returns 'function' for `NodeList` instances.
|
|
|
+ var tag = isObject(value) ? objectToString.call(value) : '';
|
|
|
+ return tag == funcTag || tag == genTag;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if `value` is a valid array-like length.
|
|
|
+ *
|
|
|
+ * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @category Lang
|
|
|
+ * @param {*} value The value to check.
|
|
|
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * _.isLength(3);
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.isLength(Number.MIN_VALUE);
|
|
|
+ * // => false
|
|
|
+ *
|
|
|
+ * _.isLength(Infinity);
|
|
|
+ * // => false
|
|
|
+ *
|
|
|
+ * _.isLength('3');
|
|
|
+ * // => false
|
|
|
+ */
|
|
|
+function isLength(value) {
|
|
|
+ return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
|
|
|
+ * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @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) {
|
|
|
+ // Avoid a V8 JIT bug in Chrome 19-20.
|
|
|
+ // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
|
|
|
+ var type = typeof value;
|
|
|
+ return !!value && (type == 'object' || type == 'function');
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * This method is like `_.assignIn` except that it accepts `customizer` which
|
|
|
+ * is invoked to produce the assigned values. If `customizer` returns `undefined`
|
|
|
+ * assignment is handled by the method instead. The `customizer` is invoked
|
|
|
+ * with five arguments: (objValue, srcValue, key, object, source).
|
|
|
+ *
|
|
|
+ * **Note:** This method mutates `object`.
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @alias extendWith
|
|
|
+ * @category Object
|
|
|
+ * @param {Object} object The destination object.
|
|
|
+ * @param {...Object} sources The source objects.
|
|
|
+ * @param {Function} [customizer] The function to customize assigned values.
|
|
|
+ * @returns {Object} Returns `object`.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * function customizer(objValue, srcValue) {
|
|
|
+ * return _.isUndefined(objValue) ? srcValue : objValue;
|
|
|
+ * }
|
|
|
+ *
|
|
|
+ * var defaults = _.partialRight(_.assignInWith, customizer);
|
|
|
+ *
|
|
|
+ * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
|
|
|
+ * // => { 'a': 1, 'b': 2 }
|
|
|
+ */
|
|
|
+var assignInWith = createAssigner(function(object, source, customizer) {
|
|
|
+ copyObjectWith(source, keysIn(source), object, customizer);
|
|
|
+});
|
|
|
+
|
|
|
+module.exports = assignInWith;
|
|
|
+
|
|
|
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
|
+},{"lodash.keysin":6,"lodash.rest":7}],4:[function(require,module,exports){
|
|
|
+(function (global){
|
|
|
+/**
|
|
|
+ * lodash 3.1.0 (Custom Build) <https://lodash.com/>
|
|
|
+ * Build: `lodash modularize exports="npm" -o ./`
|
|
|
+ * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
|
|
|
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
|
+ * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
|
+ * Available under MIT license <https://lodash.com/license>
|
|
|
+ */
|
|
|
+
|
|
|
+/** Used as references for various `Number` constants. */
|
|
|
+var INFINITY = 1 / 0;
|
|
|
+
|
|
|
+/** `Object#toString` result references. */
|
|
|
+var symbolTag = '[object Symbol]';
|
|
|
+
|
|
|
+/** Used to match HTML entities and HTML characters. */
|
|
|
+var reUnescapedHtml = /[&<>"'`]/g,
|
|
|
+ reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
|
|
|
+
|
|
|
+/** Used to map characters to HTML entities. */
|
|
|
+var htmlEscapes = {
|
|
|
+ '&': '&',
|
|
|
+ '<': '<',
|
|
|
+ '>': '>',
|
|
|
+ '"': '"',
|
|
|
+ "'": ''',
|
|
|
+ '`': '`'
|
|
|
+};
|
|
|
+
|
|
|
+/**
|
|
|
+ * Used by `_.escape` to convert characters to HTML entities.
|
|
|
+ *
|
|
|
+ * @private
|
|
|
+ * @param {string} chr The matched character to escape.
|
|
|
+ * @returns {string} Returns the escaped character.
|
|
|
+ */
|
|
|
+function escapeHtmlChar(chr) {
|
|
|
+ return htmlEscapes[chr];
|
|
|
+}
|
|
|
+
|
|
|
+/** Used for built-in method references. */
|
|
|
+var objectProto = global.Object.prototype;
|
|
|
+
|
|
|
+/**
|
|
|
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
|
|
+ * of values.
|
|
|
+ */
|
|
|
+var objectToString = objectProto.toString;
|
|
|
+
|
|
|
+/** Built-in value references. */
|
|
|
+var _Symbol = global.Symbol;
|
|
|
+
|
|
|
+/** Used to convert symbols to primitives and strings. */
|
|
|
+var symbolProto = _Symbol ? _Symbol.prototype : undefined,
|
|
|
+ symbolToString = _Symbol ? symbolProto.toString : undefined;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 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 _
|
|
|
+ * @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 && typeof value == 'object';
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if `value` is classified as a `Symbol` primitive or object.
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @category Lang
|
|
|
+ * @param {*} value The value to check.
|
|
|
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * _.isSymbol(Symbol.iterator);
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.isSymbol('abc');
|
|
|
+ * // => false
|
|
|
+ */
|
|
|
+function isSymbol(value) {
|
|
|
+ return typeof value == 'symbol' ||
|
|
|
+ (isObjectLike(value) && objectToString.call(value) == symbolTag);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Converts `value` to a string if it's not one. An empty string is returned
|
|
|
+ * for `null` and `undefined` values. The sign of `-0` is preserved.
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @category Lang
|
|
|
+ * @param {*} value The value to process.
|
|
|
+ * @returns {string} Returns the string.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * _.toString(null);
|
|
|
+ * // => ''
|
|
|
+ *
|
|
|
+ * _.toString(-0);
|
|
|
+ * // => '-0'
|
|
|
+ *
|
|
|
+ * _.toString([1, 2, 3]);
|
|
|
+ * // => '1,2,3'
|
|
|
+ */
|
|
|
+function toString(value) {
|
|
|
+ // Exit early for strings to avoid a performance hit in some environments.
|
|
|
+ if (typeof value == 'string') {
|
|
|
+ return value;
|
|
|
+ }
|
|
|
+ if (value == null) {
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+ if (isSymbol(value)) {
|
|
|
+ return _Symbol ? symbolToString.call(value) : '';
|
|
|
+ }
|
|
|
+ var result = (value + '');
|
|
|
+ return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Converts the characters "&", "<", ">", '"', "'", and "\`" in `string` to
|
|
|
+ * their corresponding HTML entities.
|
|
|
+ *
|
|
|
+ * **Note:** No other characters are escaped. To escape additional
|
|
|
+ * characters use a third-party library like [_he_](https://mths.be/he).
|
|
|
+ *
|
|
|
+ * Though the ">" character is escaped for symmetry, characters like
|
|
|
+ * ">" and "/" don't need escaping in HTML and have no special meaning
|
|
|
+ * unless they're part of a tag or unquoted attribute value.
|
|
|
+ * See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
|
|
|
+ * (under "semi-related fun fact") for more details.
|
|
|
+ *
|
|
|
+ * Backticks are escaped because in IE < 9, they can break out of
|
|
|
+ * attribute values or HTML comments. See [#59](https://html5sec.org/#59),
|
|
|
+ * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and
|
|
|
+ * [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/)
|
|
|
+ * for more details.
|
|
|
+ *
|
|
|
+ * When working with HTML you should always [quote attribute values](http://wonko.com/post/html-escaping)
|
|
|
+ * to reduce XSS vectors.
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @category String
|
|
|
+ * @param {string} [string=''] The string to escape.
|
|
|
+ * @returns {string} Returns the escaped string.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * _.escape('fred, barney, & pebbles');
|
|
|
+ * // => 'fred, barney, & pebbles'
|
|
|
+ */
|
|
|
+function escape(string) {
|
|
|
+ string = toString(string);
|
|
|
+ return (string && reHasUnescapedHtml.test(string))
|
|
|
+ ? string.replace(reUnescapedHtml, escapeHtmlChar)
|
|
|
+ : string;
|
|
|
+}
|
|
|
+
|
|
|
+module.exports = escape;
|
|
|
+
|
|
|
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
|
+},{}],5:[function(require,module,exports){
|
|
|
+(function (global){
|
|
|
+/**
|
|
|
+ * lodash 4.0.0 (Custom Build) <https://lodash.com/>
|
|
|
+ * Build: `lodash modularize exports="npm" -o ./`
|
|
|
+ * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
|
|
|
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
|
+ * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
|
+ * Available under MIT license <https://lodash.com/license>
|
|
|
+ */
|
|
|
+
|
|
|
+/** Used as references for various `Number` constants. */
|
|
|
+var MAX_SAFE_INTEGER = 9007199254740991;
|
|
|
+
|
|
|
+/** `Object#toString` result references. */
|
|
|
+var argsTag = '[object Arguments]',
|
|
|
+ funcTag = '[object Function]',
|
|
|
+ genTag = '[object GeneratorFunction]',
|
|
|
+ stringTag = '[object String]';
|
|
|
+
|
|
|
+/** Used to detect unsigned integer values. */
|
|
|
+var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
|
+
|
|
|
+/**
|
|
|
+ * The base implementation of `_.times` without support for iteratee shorthands
|
|
|
+ * or max array length checks.
|
|
|
+ *
|
|
|
+ * @private
|
|
|
+ * @param {number} n The number of times to invoke `iteratee`.
|
|
|
+ * @param {Function} iteratee The function invoked per iteration.
|
|
|
+ * @returns {Array} Returns the array of results.
|
|
|
+ */
|
|
|
+function baseTimes(n, iteratee) {
|
|
|
+ var index = -1,
|
|
|
+ result = Array(n);
|
|
|
+
|
|
|
+ while (++index < n) {
|
|
|
+ result[index] = iteratee(index);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if `value` is a valid array-like index.
|
|
|
+ *
|
|
|
+ * @private
|
|
|
+ * @param {*} value The value to check.
|
|
|
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
|
|
|
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
|
|
|
+ */
|
|
|
+function isIndex(value, length) {
|
|
|
+ value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
|
|
|
+ length = length == null ? MAX_SAFE_INTEGER : length;
|
|
|
+ return value > -1 && value % 1 == 0 && value < length;
|
|
|
+}
|
|
|
+
|
|
|
+/** Used for built-in method references. */
|
|
|
+var objectProto = global.Object.prototype;
|
|
|
+
|
|
|
+/** Used to check objects for own properties. */
|
|
|
+var hasOwnProperty = objectProto.hasOwnProperty;
|
|
|
+
|
|
|
+/**
|
|
|
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
|
|
+ * of values.
|
|
|
+ */
|
|
|
+var objectToString = objectProto.toString;
|
|
|
+
|
|
|
+/** Built-in value references. */
|
|
|
+var getPrototypeOf = Object.getPrototypeOf,
|
|
|
+ propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
|
|
+
|
|
|
+/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
|
+var nativeKeys = Object.keys;
|
|
|
+
|
|
|
+/**
|
|
|
+ * The base implementation of `_.has` without support for deep paths.
|
|
|
+ *
|
|
|
+ * @private
|
|
|
+ * @param {Object} object The object to query.
|
|
|
+ * @param {Array|string} key The key to check.
|
|
|
+ * @returns {boolean} Returns `true` if `key` exists, else `false`.
|
|
|
+ */
|
|
|
+function baseHas(object, key) {
|
|
|
+ // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
|
|
|
+ // that are composed entirely of index properties, return `false` for
|
|
|
+ // `hasOwnProperty` checks of them.
|
|
|
+ return hasOwnProperty.call(object, key) ||
|
|
|
+ (typeof object == 'object' && key in object && getPrototypeOf(object) === null);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * The base implementation of `_.keys` which doesn't skip the constructor
|
|
|
+ * property of prototypes or treat sparse arrays as dense.
|
|
|
+ *
|
|
|
+ * @private
|
|
|
+ * @type Function
|
|
|
+ * @param {Object} object The object to query.
|
|
|
+ * @returns {Array} Returns the array of property names.
|
|
|
+ */
|
|
|
+function baseKeys(object) {
|
|
|
+ return nativeKeys(Object(object));
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * The base implementation of `_.property` without support for deep paths.
|
|
|
+ *
|
|
|
+ * @private
|
|
|
+ * @param {string} key The key of the property to get.
|
|
|
+ * @returns {Function} Returns the new function.
|
|
|
+ */
|
|
|
+function baseProperty(key) {
|
|
|
+ return function(object) {
|
|
|
+ return object == null ? undefined : object[key];
|
|
|
+ };
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Gets the "length" property value of `object`.
|
|
|
+ *
|
|
|
+ * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
|
|
|
+ * that affects Safari on at least iOS 8.1-8.3 ARM64.
|
|
|
+ *
|
|
|
+ * @private
|
|
|
+ * @param {Object} object The object to query.
|
|
|
+ * @returns {*} Returns the "length" value.
|
|
|
+ */
|
|
|
+var getLength = baseProperty('length');
|
|
|
+
|
|
|
+/**
|
|
|
+ * Creates an array of index keys for `object` values of arrays,
|
|
|
+ * `arguments` objects, and strings, otherwise `null` is returned.
|
|
|
+ *
|
|
|
+ * @private
|
|
|
+ * @param {Object} object The object to query.
|
|
|
+ * @returns {Array|null} Returns index keys, else `null`.
|
|
|
+ */
|
|
|
+function indexKeys(object) {
|
|
|
+ var length = object ? object.length : undefined;
|
|
|
+ return (isLength(length) && (isArray(object) || isString(object) || isArguments(object)))
|
|
|
+ ? baseTimes(length, String)
|
|
|
+ : null;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if `value` is likely a prototype object.
|
|
|
+ *
|
|
|
+ * @private
|
|
|
+ * @param {*} value The value to check.
|
|
|
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
|
|
|
+ */
|
|
|
+function isPrototype(value) {
|
|
|
+ var Ctor = value && value.constructor,
|
|
|
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
|
|
|
+
|
|
|
+ return value === proto;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if `value` is likely an `arguments` object.
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @category Lang
|
|
|
+ * @param {*} value The value to check.
|
|
|
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * _.isArguments(function() { return arguments; }());
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.isArguments([1, 2, 3]);
|
|
|
+ * // => false
|
|
|
+ */
|
|
|
+function isArguments(value) {
|
|
|
+ // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode.
|
|
|
+ return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
|
|
|
+ (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if `value` is classified as an `Array` object.
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @type Function
|
|
|
+ * @category Lang
|
|
|
+ * @param {*} value The value to check.
|
|
|
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * _.isArray([1, 2, 3]);
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.isArray(document.body.children);
|
|
|
+ * // => false
|
|
|
+ *
|
|
|
+ * _.isArray('abc');
|
|
|
+ * // => false
|
|
|
+ *
|
|
|
+ * _.isArray(_.noop);
|
|
|
+ * // => false
|
|
|
+ */
|
|
|
+var isArray = Array.isArray;
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if `value` is array-like. A value is considered array-like if it's
|
|
|
+ * not a function and has a `value.length` that's an integer greater than or
|
|
|
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @type Function
|
|
|
+ * @category Lang
|
|
|
+ * @param {*} value The value to check.
|
|
|
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * _.isArrayLike([1, 2, 3]);
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.isArrayLike(document.body.children);
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.isArrayLike('abc');
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.isArrayLike(_.noop);
|
|
|
+ * // => false
|
|
|
+ */
|
|
|
+function isArrayLike(value) {
|
|
|
+ return value != null &&
|
|
|
+ !(typeof value == 'function' && isFunction(value)) && isLength(getLength(value));
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * This method is like `_.isArrayLike` except that it also checks if `value`
|
|
|
+ * is an object.
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @type Function
|
|
|
+ * @category Lang
|
|
|
+ * @param {*} value The value to check.
|
|
|
+ * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * _.isArrayLikeObject([1, 2, 3]);
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.isArrayLikeObject(document.body.children);
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.isArrayLikeObject('abc');
|
|
|
+ * // => false
|
|
|
+ *
|
|
|
+ * _.isArrayLikeObject(_.noop);
|
|
|
+ * // => false
|
|
|
+ */
|
|
|
+function isArrayLikeObject(value) {
|
|
|
+ return isObjectLike(value) && isArrayLike(value);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if `value` is classified as a `Function` object.
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @category Lang
|
|
|
+ * @param {*} value The value to check.
|
|
|
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * _.isFunction(_);
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.isFunction(/abc/);
|
|
|
+ * // => false
|
|
|
+ */
|
|
|
+function isFunction(value) {
|
|
|
+ // The use of `Object#toString` avoids issues with the `typeof` operator
|
|
|
+ // in Safari 8 which returns 'object' for typed array constructors, and
|
|
|
+ // PhantomJS 1.9 which returns 'function' for `NodeList` instances.
|
|
|
+ var tag = isObject(value) ? objectToString.call(value) : '';
|
|
|
+ return tag == funcTag || tag == genTag;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if `value` is a valid array-like length.
|
|
|
+ *
|
|
|
+ * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @category Lang
|
|
|
+ * @param {*} value The value to check.
|
|
|
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * _.isLength(3);
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.isLength(Number.MIN_VALUE);
|
|
|
+ * // => false
|
|
|
+ *
|
|
|
+ * _.isLength(Infinity);
|
|
|
+ * // => false
|
|
|
+ *
|
|
|
+ * _.isLength('3');
|
|
|
+ * // => false
|
|
|
+ */
|
|
|
+function isLength(value) {
|
|
|
+ return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
|
|
|
+ * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @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) {
|
|
|
+ // Avoid a V8 JIT bug in Chrome 19-20.
|
|
|
+ // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
|
|
|
+ var type = typeof value;
|
|
|
+ return !!value && (type == 'object' || type == 'function');
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 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 _
|
|
|
+ * @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 && typeof value == 'object';
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if `value` is classified as a `String` primitive or object.
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @category Lang
|
|
|
+ * @param {*} value The value to check.
|
|
|
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * _.isString('abc');
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.isString(1);
|
|
|
+ * // => false
|
|
|
+ */
|
|
|
+function isString(value) {
|
|
|
+ return typeof value == 'string' ||
|
|
|
+ (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Creates an array of the own enumerable property names of `object`.
|
|
|
+ *
|
|
|
+ * **Note:** Non-object values are coerced to objects. See the
|
|
|
+ * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)
|
|
|
+ * for more details.
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @category Object
|
|
|
+ * @param {Object} object The object to query.
|
|
|
+ * @returns {Array} Returns the array of property names.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * function Foo() {
|
|
|
+ * this.a = 1;
|
|
|
+ * this.b = 2;
|
|
|
+ * }
|
|
|
+ *
|
|
|
+ * Foo.prototype.c = 3;
|
|
|
+ *
|
|
|
+ * _.keys(new Foo);
|
|
|
+ * // => ['a', 'b'] (iteration order is not guaranteed)
|
|
|
+ *
|
|
|
+ * _.keys('hi');
|
|
|
+ * // => ['0', '1']
|
|
|
+ */
|
|
|
+function keys(object) {
|
|
|
+ var isProto = isPrototype(object);
|
|
|
+ if (!(isProto || isArrayLike(object))) {
|
|
|
+ return baseKeys(object);
|
|
|
+ }
|
|
|
+ var indexes = indexKeys(object),
|
|
|
+ skipIndexes = !!indexes,
|
|
|
+ result = indexes || [],
|
|
|
+ length = result.length;
|
|
|
+
|
|
|
+ for (var key in object) {
|
|
|
+ if (baseHas(object, key) &&
|
|
|
+ !(skipIndexes && (key == 'length' || isIndex(key, length))) &&
|
|
|
+ !(isProto && key == 'constructor')) {
|
|
|
+ result.push(key);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+}
|
|
|
+
|
|
|
+module.exports = keys;
|
|
|
+
|
|
|
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
|
+},{}],6:[function(require,module,exports){
|
|
|
+(function (global){
|
|
|
+/**
|
|
|
+ * lodash 4.0.0 (Custom Build) <https://lodash.com/>
|
|
|
+ * Build: `lodash modularize exports="npm" -o ./`
|
|
|
+ * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
|
|
|
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
|
+ * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
|
+ * Available under MIT license <https://lodash.com/license>
|
|
|
+ */
|
|
|
+
|
|
|
+/** Used as references for various `Number` constants. */
|
|
|
+var MAX_SAFE_INTEGER = 9007199254740991;
|
|
|
+
|
|
|
+/** `Object#toString` result references. */
|
|
|
+var argsTag = '[object Arguments]',
|
|
|
+ funcTag = '[object Function]',
|
|
|
+ genTag = '[object GeneratorFunction]',
|
|
|
+ stringTag = '[object String]';
|
|
|
+
|
|
|
+/** Used to detect unsigned integer values. */
|
|
|
+var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
|
+
|
|
|
+/**
|
|
|
+ * The base implementation of `_.times` without support for iteratee shorthands
|
|
|
+ * or max array length checks.
|
|
|
+ *
|
|
|
+ * @private
|
|
|
+ * @param {number} n The number of times to invoke `iteratee`.
|
|
|
+ * @param {Function} iteratee The function invoked per iteration.
|
|
|
+ * @returns {Array} Returns the array of results.
|
|
|
+ */
|
|
|
+function baseTimes(n, iteratee) {
|
|
|
+ var index = -1,
|
|
|
+ result = Array(n);
|
|
|
+
|
|
|
+ while (++index < n) {
|
|
|
+ result[index] = iteratee(index);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if `value` is a valid array-like index.
|
|
|
+ *
|
|
|
+ * @private
|
|
|
+ * @param {*} value The value to check.
|
|
|
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
|
|
|
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
|
|
|
+ */
|
|
|
+function isIndex(value, length) {
|
|
|
+ value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
|
|
|
+ length = length == null ? MAX_SAFE_INTEGER : length;
|
|
|
+ return value > -1 && value % 1 == 0 && value < length;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Converts `iterator` to an array.
|
|
|
+ *
|
|
|
+ * @private
|
|
|
+ * @param {Object} iterator The iterator to convert.
|
|
|
+ * @returns {Array} Returns the converted array.
|
|
|
+ */
|
|
|
+function iteratorToArray(iterator) {
|
|
|
+ var data,
|
|
|
+ result = [];
|
|
|
+
|
|
|
+ while (!(data = iterator.next()).done) {
|
|
|
+ result.push(data.value);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+}
|
|
|
+
|
|
|
+/** Used for built-in method references. */
|
|
|
+var objectProto = global.Object.prototype;
|
|
|
+
|
|
|
+/** Used to check objects for own properties. */
|
|
|
+var hasOwnProperty = objectProto.hasOwnProperty;
|
|
|
+
|
|
|
+/**
|
|
|
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
|
|
+ * of values.
|
|
|
+ */
|
|
|
+var objectToString = objectProto.toString;
|
|
|
+
|
|
|
+/** Built-in value references. */
|
|
|
+var Reflect = global.Reflect,
|
|
|
+ enumerate = Reflect ? Reflect.enumerate : undefined,
|
|
|
+ propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
|
|
+
|
|
|
+/**
|
|
|
+ * The base implementation of `_.keysIn` which doesn't skip the constructor
|
|
|
+ * property of prototypes or treat sparse arrays as dense.
|
|
|
+ *
|
|
|
+ * @private
|
|
|
+ * @param {Object} object The object to query.
|
|
|
+ * @returns {Array} Returns the array of property names.
|
|
|
+ */
|
|
|
+function baseKeysIn(object) {
|
|
|
+ object = object == null ? object : Object(object);
|
|
|
+
|
|
|
+ var result = [];
|
|
|
+ for (var key in object) {
|
|
|
+ result.push(key);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+}
|
|
|
+
|
|
|
+// Fallback for IE < 9 with es6-shim.
|
|
|
+if (enumerate && !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf')) {
|
|
|
+ baseKeysIn = function(object) {
|
|
|
+ return iteratorToArray(enumerate(object));
|
|
|
+ };
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * The base implementation of `_.property` without support for deep paths.
|
|
|
+ *
|
|
|
+ * @private
|
|
|
+ * @param {string} key The key of the property to get.
|
|
|
+ * @returns {Function} Returns the new function.
|
|
|
+ */
|
|
|
+function baseProperty(key) {
|
|
|
+ return function(object) {
|
|
|
+ return object == null ? undefined : object[key];
|
|
|
+ };
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Gets the "length" property value of `object`.
|
|
|
+ *
|
|
|
+ * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
|
|
|
+ * that affects Safari on at least iOS 8.1-8.3 ARM64.
|
|
|
+ *
|
|
|
+ * @private
|
|
|
+ * @param {Object} object The object to query.
|
|
|
+ * @returns {*} Returns the "length" value.
|
|
|
+ */
|
|
|
+var getLength = baseProperty('length');
|
|
|
+
|
|
|
+/**
|
|
|
+ * Creates an array of index keys for `object` values of arrays,
|
|
|
+ * `arguments` objects, and strings, otherwise `null` is returned.
|
|
|
+ *
|
|
|
+ * @private
|
|
|
+ * @param {Object} object The object to query.
|
|
|
+ * @returns {Array|null} Returns index keys, else `null`.
|
|
|
+ */
|
|
|
+function indexKeys(object) {
|
|
|
+ var length = object ? object.length : undefined;
|
|
|
+ return (isLength(length) && (isArray(object) || isString(object) || isArguments(object)))
|
|
|
+ ? baseTimes(length, String)
|
|
|
+ : null;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if `value` is likely a prototype object.
|
|
|
+ *
|
|
|
+ * @private
|
|
|
+ * @param {*} value The value to check.
|
|
|
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
|
|
|
+ */
|
|
|
+function isPrototype(value) {
|
|
|
+ var Ctor = value && value.constructor,
|
|
|
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
|
|
|
+
|
|
|
+ return value === proto;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if `value` is likely an `arguments` object.
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @category Lang
|
|
|
+ * @param {*} value The value to check.
|
|
|
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * _.isArguments(function() { return arguments; }());
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.isArguments([1, 2, 3]);
|
|
|
+ * // => false
|
|
|
+ */
|
|
|
+function isArguments(value) {
|
|
|
+ // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode.
|
|
|
+ return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
|
|
|
+ (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if `value` is classified as an `Array` object.
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @type Function
|
|
|
+ * @category Lang
|
|
|
+ * @param {*} value The value to check.
|
|
|
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * _.isArray([1, 2, 3]);
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.isArray(document.body.children);
|
|
|
+ * // => false
|
|
|
+ *
|
|
|
+ * _.isArray('abc');
|
|
|
+ * // => false
|
|
|
+ *
|
|
|
+ * _.isArray(_.noop);
|
|
|
+ * // => false
|
|
|
+ */
|
|
|
+var isArray = Array.isArray;
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if `value` is array-like. A value is considered array-like if it's
|
|
|
+ * not a function and has a `value.length` that's an integer greater than or
|
|
|
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @type Function
|
|
|
+ * @category Lang
|
|
|
+ * @param {*} value The value to check.
|
|
|
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * _.isArrayLike([1, 2, 3]);
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.isArrayLike(document.body.children);
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.isArrayLike('abc');
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.isArrayLike(_.noop);
|
|
|
+ * // => false
|
|
|
+ */
|
|
|
+function isArrayLike(value) {
|
|
|
+ return value != null &&
|
|
|
+ !(typeof value == 'function' && isFunction(value)) && isLength(getLength(value));
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * This method is like `_.isArrayLike` except that it also checks if `value`
|
|
|
+ * is an object.
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @type Function
|
|
|
+ * @category Lang
|
|
|
+ * @param {*} value The value to check.
|
|
|
+ * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * _.isArrayLikeObject([1, 2, 3]);
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.isArrayLikeObject(document.body.children);
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.isArrayLikeObject('abc');
|
|
|
+ * // => false
|
|
|
+ *
|
|
|
+ * _.isArrayLikeObject(_.noop);
|
|
|
+ * // => false
|
|
|
+ */
|
|
|
+function isArrayLikeObject(value) {
|
|
|
+ return isObjectLike(value) && isArrayLike(value);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if `value` is classified as a `Function` object.
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @category Lang
|
|
|
+ * @param {*} value The value to check.
|
|
|
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * _.isFunction(_);
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.isFunction(/abc/);
|
|
|
+ * // => false
|
|
|
+ */
|
|
|
+function isFunction(value) {
|
|
|
+ // The use of `Object#toString` avoids issues with the `typeof` operator
|
|
|
+ // in Safari 8 which returns 'object' for typed array constructors, and
|
|
|
+ // PhantomJS 1.9 which returns 'function' for `NodeList` instances.
|
|
|
+ var tag = isObject(value) ? objectToString.call(value) : '';
|
|
|
+ return tag == funcTag || tag == genTag;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if `value` is a valid array-like length.
|
|
|
+ *
|
|
|
+ * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @category Lang
|
|
|
+ * @param {*} value The value to check.
|
|
|
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * _.isLength(3);
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.isLength(Number.MIN_VALUE);
|
|
|
+ * // => false
|
|
|
+ *
|
|
|
+ * _.isLength(Infinity);
|
|
|
+ * // => false
|
|
|
+ *
|
|
|
+ * _.isLength('3');
|
|
|
+ * // => false
|
|
|
+ */
|
|
|
+function isLength(value) {
|
|
|
+ return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
|
|
|
+ * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @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) {
|
|
|
+ // Avoid a V8 JIT bug in Chrome 19-20.
|
|
|
+ // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
|
|
|
+ var type = typeof value;
|
|
|
+ return !!value && (type == 'object' || type == 'function');
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 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 _
|
|
|
+ * @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 && typeof value == 'object';
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if `value` is classified as a `String` primitive or object.
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @category Lang
|
|
|
+ * @param {*} value The value to check.
|
|
|
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * _.isString('abc');
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.isString(1);
|
|
|
+ * // => false
|
|
|
+ */
|
|
|
+function isString(value) {
|
|
|
+ return typeof value == 'string' ||
|
|
|
+ (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Creates an array of the own and inherited enumerable property names of `object`.
|
|
|
+ *
|
|
|
+ * **Note:** Non-object values are coerced to objects.
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @category Object
|
|
|
+ * @param {Object} object The object to query.
|
|
|
+ * @returns {Array} Returns the array of property names.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * function Foo() {
|
|
|
+ * this.a = 1;
|
|
|
+ * this.b = 2;
|
|
|
+ * }
|
|
|
+ *
|
|
|
+ * Foo.prototype.c = 3;
|
|
|
+ *
|
|
|
+ * _.keysIn(new Foo);
|
|
|
+ * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
|
|
|
+ */
|
|
|
+function keysIn(object) {
|
|
|
+ var index = -1,
|
|
|
+ isProto = isPrototype(object),
|
|
|
+ props = baseKeysIn(object),
|
|
|
+ propsLength = props.length,
|
|
|
+ indexes = indexKeys(object),
|
|
|
+ skipIndexes = !!indexes,
|
|
|
+ result = indexes || [],
|
|
|
+ length = result.length;
|
|
|
+
|
|
|
+ while (++index < propsLength) {
|
|
|
+ var key = props[index];
|
|
|
+ if (!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
|
|
|
+ !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
|
|
|
+ result.push(key);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+}
|
|
|
+
|
|
|
+module.exports = keysIn;
|
|
|
+
|
|
|
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
|
+},{}],7:[function(require,module,exports){
|
|
|
+(function (global){
|
|
|
+/**
|
|
|
+ * lodash 4.0.0 (Custom Build) <https://lodash.com/>
|
|
|
+ * Build: `lodash modularize exports="npm" -o ./`
|
|
|
+ * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
|
|
|
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
|
+ * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
|
+ * Available under MIT license <https://lodash.com/license>
|
|
|
+ */
|
|
|
+
|
|
|
+/** Used as the `TypeError` message for "Functions" methods. */
|
|
|
+var FUNC_ERROR_TEXT = 'Expected a function';
|
|
|
+
|
|
|
+/** Used as references for various `Number` constants. */
|
|
|
+var INFINITY = 1 / 0,
|
|
|
+ MAX_INTEGER = 1.7976931348623157e+308,
|
|
|
+ NAN = 0 / 0;
|
|
|
+
|
|
|
+/** `Object#toString` result references. */
|
|
|
+var funcTag = '[object Function]',
|
|
|
+ genTag = '[object GeneratorFunction]';
|
|
|
+
|
|
|
+/** Used to match leading and trailing whitespace. */
|
|
|
+var reTrim = /^\s+|\s+$/g;
|
|
|
+
|
|
|
+/** Used to detect bad signed hexadecimal string values. */
|
|
|
+var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
|
|
+
|
|
|
+/** Used to detect binary string values. */
|
|
|
+var reIsBinary = /^0b[01]+$/i;
|
|
|
+
|
|
|
+/** Used to detect octal string values. */
|
|
|
+var reIsOctal = /^0o[0-7]+$/i;
|
|
|
+
|
|
|
+/** Built-in method references without a dependency on `global`. */
|
|
|
+var freeParseInt = parseInt;
|
|
|
+
|
|
|
+/**
|
|
|
+ * A faster alternative to `Function#apply`, this function invokes `func`
|
|
|
+ * with the `this` binding of `thisArg` and the arguments of `args`.
|
|
|
+ *
|
|
|
+ * @private
|
|
|
+ * @param {Function} func The function to invoke.
|
|
|
+ * @param {*} thisArg The `this` binding of `func`.
|
|
|
+ * @param {...*} [args] The arguments to invoke `func` with.
|
|
|
+ * @returns {*} Returns the result of `func`.
|
|
|
+ */
|
|
|
+function apply(func, thisArg, args) {
|
|
|
+ var length = args ? args.length : 0;
|
|
|
+ switch (length) {
|
|
|
+ case 0: return func.call(thisArg);
|
|
|
+ case 1: return func.call(thisArg, args[0]);
|
|
|
+ case 2: return func.call(thisArg, args[0], args[1]);
|
|
|
+ case 3: return func.call(thisArg, args[0], args[1], args[2]);
|
|
|
+ }
|
|
|
+ return func.apply(thisArg, args);
|
|
|
+}
|
|
|
+
|
|
|
+/** Used for built-in method references. */
|
|
|
+var objectProto = global.Object.prototype;
|
|
|
+
|
|
|
+/**
|
|
|
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
|
|
+ * of values.
|
|
|
+ */
|
|
|
+var objectToString = objectProto.toString;
|
|
|
+
|
|
|
+/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
|
+var nativeMax = Math.max;
|
|
|
+
|
|
|
+/**
|
|
|
+ * Creates a function that invokes `func` with the `this` binding of the
|
|
|
+ * created function and arguments from `start` and beyond provided as an array.
|
|
|
+ *
|
|
|
+ * **Note:** This method is based on the [rest parameter](https://mdn.io/rest_parameters).
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @category Function
|
|
|
+ * @param {Function} func The function to apply a rest parameter to.
|
|
|
+ * @param {number} [start=func.length-1] The start position of the rest parameter.
|
|
|
+ * @returns {Function} Returns the new function.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * var say = _.rest(function(what, names) {
|
|
|
+ * return what + ' ' + _.initial(names).join(', ') +
|
|
|
+ * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
|
|
|
+ * });
|
|
|
+ *
|
|
|
+ * say('hello', 'fred', 'barney', 'pebbles');
|
|
|
+ * // => 'hello fred, barney, & pebbles'
|
|
|
+ */
|
|
|
+function rest(func, start) {
|
|
|
+ if (typeof func != 'function') {
|
|
|
+ throw new TypeError(FUNC_ERROR_TEXT);
|
|
|
+ }
|
|
|
+ start = nativeMax(start === undefined ? (func.length - 1) : toInteger(start), 0);
|
|
|
+ return function() {
|
|
|
+ var args = arguments,
|
|
|
+ index = -1,
|
|
|
+ length = nativeMax(args.length - start, 0),
|
|
|
+ array = Array(length);
|
|
|
+
|
|
|
+ while (++index < length) {
|
|
|
+ array[index] = args[start + index];
|
|
|
+ }
|
|
|
+ switch (start) {
|
|
|
+ case 0: return func.call(this, array);
|
|
|
+ case 1: return func.call(this, args[0], array);
|
|
|
+ case 2: return func.call(this, args[0], args[1], array);
|
|
|
+ }
|
|
|
+ var otherArgs = Array(start + 1);
|
|
|
+ index = -1;
|
|
|
+ while (++index < start) {
|
|
|
+ otherArgs[index] = args[index];
|
|
|
+ }
|
|
|
+ otherArgs[start] = array;
|
|
|
+ return apply(func, this, otherArgs);
|
|
|
+ };
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if `value` is classified as a `Function` object.
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @category Lang
|
|
|
+ * @param {*} value The value to check.
|
|
|
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * _.isFunction(_);
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.isFunction(/abc/);
|
|
|
+ * // => false
|
|
|
+ */
|
|
|
+function isFunction(value) {
|
|
|
+ // The use of `Object#toString` avoids issues with the `typeof` operator
|
|
|
+ // in Safari 8 which returns 'object' for typed array constructors, and
|
|
|
+ // PhantomJS 1.9 which returns 'function' for `NodeList` instances.
|
|
|
+ var tag = isObject(value) ? objectToString.call(value) : '';
|
|
|
+ return tag == funcTag || tag == genTag;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
|
|
|
+ * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @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) {
|
|
|
+ // Avoid a V8 JIT bug in Chrome 19-20.
|
|
|
+ // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
|
|
|
+ var type = typeof value;
|
|
|
+ return !!value && (type == 'object' || type == 'function');
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Converts `value` to an integer.
|
|
|
+ *
|
|
|
+ * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger).
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @category Lang
|
|
|
+ * @param {*} value The value to convert.
|
|
|
+ * @returns {number} Returns the converted integer.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * _.toInteger(3);
|
|
|
+ * // => 3
|
|
|
+ *
|
|
|
+ * _.toInteger(Number.MIN_VALUE);
|
|
|
+ * // => 0
|
|
|
+ *
|
|
|
+ * _.toInteger(Infinity);
|
|
|
+ * // => 1.7976931348623157e+308
|
|
|
+ *
|
|
|
+ * _.toInteger('3');
|
|
|
+ * // => 3
|
|
|
+ */
|
|
|
+function toInteger(value) {
|
|
|
+ if (!value) {
|
|
|
+ return value === 0 ? value : 0;
|
|
|
+ }
|
|
|
+ value = toNumber(value);
|
|
|
+ if (value === INFINITY || value === -INFINITY) {
|
|
|
+ var sign = (value < 0 ? -1 : 1);
|
|
|
+ return sign * MAX_INTEGER;
|
|
|
+ }
|
|
|
+ var remainder = value % 1;
|
|
|
+ return value === value ? (remainder ? value - remainder : value) : 0;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Converts `value` to a number.
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @category Lang
|
|
|
+ * @param {*} value The value to process.
|
|
|
+ * @returns {number} Returns the number.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * _.toNumber(3);
|
|
|
+ * // => 3
|
|
|
+ *
|
|
|
+ * _.toNumber(Number.MIN_VALUE);
|
|
|
+ * // => 5e-324
|
|
|
+ *
|
|
|
+ * _.toNumber(Infinity);
|
|
|
+ * // => Infinity
|
|
|
+ *
|
|
|
+ * _.toNumber('3');
|
|
|
+ * // => 3
|
|
|
+ */
|
|
|
+function toNumber(value) {
|
|
|
+ if (isObject(value)) {
|
|
|
+ var other = isFunction(value.valueOf) ? value.valueOf() : value;
|
|
|
+ value = isObject(other) ? (other + '') : other;
|
|
|
+ }
|
|
|
+ if (typeof value != 'string') {
|
|
|
+ return value === 0 ? value : +value;
|
|
|
+ }
|
|
|
+ value = value.replace(reTrim, '');
|
|
|
+ var isBinary = reIsBinary.test(value);
|
|
|
+ return (isBinary || reIsOctal.test(value))
|
|
|
+ ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
|
|
|
+ : (reIsBadHex.test(value) ? NAN : +value);
|
|
|
+}
|
|
|
+
|
|
|
+module.exports = rest;
|
|
|
+
|
|
|
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
|
+},{}],8:[function(require,module,exports){
|
|
|
+(function (global){
|
|
|
+/**
|
|
|
+ * lodash 4.0.0 (Custom Build) <https://lodash.com/>
|
|
|
+ * Build: `lodash modularize exports="npm" -o ./`
|
|
|
+ * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
|
|
|
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
|
+ * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
|
+ * Available under MIT license <https://lodash.com/license>
|
|
|
+ */
|
|
|
+var arrayMap = require('lodash._arraymap'),
|
|
|
+ assignInWith = require('lodash.assigninwith'),
|
|
|
+ keys = require('lodash.keys'),
|
|
|
+ reInterpolate = require('lodash._reinterpolate'),
|
|
|
+ rest = require('lodash.rest'),
|
|
|
+ templateSettings = require('lodash.templatesettings');
|
|
|
+
|
|
|
+/** Used as references for various `Number` constants. */
|
|
|
+var INFINITY = 1 / 0,
|
|
|
+ MAX_SAFE_INTEGER = 9007199254740991;
|
|
|
+
|
|
|
+/** `Object#toString` result references. */
|
|
|
+var errorTag = '[object Error]',
|
|
|
+ funcTag = '[object Function]',
|
|
|
+ genTag = '[object GeneratorFunction]',
|
|
|
+ symbolTag = '[object Symbol]';
|
|
|
+
|
|
|
+/** Used to match empty string literals in compiled template source. */
|
|
|
+var reEmptyStringLeading = /\b__p \+= '';/g,
|
|
|
+ reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
|
|
|
+ reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
|
|
|
+
|
|
|
+/** Used to match [ES template delimiters](http://ecma-international.org/ecma-262/6.0/#sec-template-literal-lexical-components). */
|
|
|
+var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
|
|
|
+
|
|
|
+/** Used to detect unsigned integer values. */
|
|
|
+var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
|
+
|
|
|
+/** Used to ensure capturing order of template delimiters. */
|
|
|
+var reNoMatch = /($^)/;
|
|
|
+
|
|
|
+/** Used to match unescaped characters in compiled string literals. */
|
|
|
+var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
|
|
|
+
|
|
|
+/** Used to escape characters for inclusion in compiled string literals. */
|
|
|
+var stringEscapes = {
|
|
|
+ '\\': '\\',
|
|
|
+ "'": "'",
|
|
|
+ '\n': 'n',
|
|
|
+ '\r': 'r',
|
|
|
+ '\u2028': 'u2028',
|
|
|
+ '\u2029': 'u2029'
|
|
|
+};
|
|
|
+
|
|
|
+/**
|
|
|
+ * A faster alternative to `Function#apply`, this function invokes `func`
|
|
|
+ * with the `this` binding of `thisArg` and the arguments of `args`.
|
|
|
+ *
|
|
|
+ * @private
|
|
|
+ * @param {Function} func The function to invoke.
|
|
|
+ * @param {*} thisArg The `this` binding of `func`.
|
|
|
+ * @param {...*} [args] The arguments to invoke `func` with.
|
|
|
+ * @returns {*} Returns the result of `func`.
|
|
|
+ */
|
|
|
+function apply(func, thisArg, args) {
|
|
|
+ var length = args ? args.length : 0;
|
|
|
+ switch (length) {
|
|
|
+ case 0: return func.call(thisArg);
|
|
|
+ case 1: return func.call(thisArg, args[0]);
|
|
|
+ case 2: return func.call(thisArg, args[0], args[1]);
|
|
|
+ case 3: return func.call(thisArg, args[0], args[1], args[2]);
|
|
|
+ }
|
|
|
+ return func.apply(thisArg, args);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * The base implementation of `_.values` and `_.valuesIn` which creates an
|
|
|
+ * array of `object` property values corresponding to the property names
|
|
|
+ * of `props`.
|
|
|
+ *
|
|
|
+ * @private
|
|
|
+ * @param {Object} object The object to query.
|
|
|
+ * @param {Array} props The property names to get values for.
|
|
|
+ * @returns {Object} Returns the array of property values.
|
|
|
+ */
|
|
|
+function baseValues(object, props) {
|
|
|
+ return arrayMap(props, function(key) {
|
|
|
+ return object[key];
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Used by `_.template` to escape characters for inclusion in compiled string literals.
|
|
|
+ *
|
|
|
+ * @private
|
|
|
+ * @param {string} chr The matched character to escape.
|
|
|
+ * @returns {string} Returns the escaped character.
|
|
|
+ */
|
|
|
+function escapeStringChar(chr) {
|
|
|
+ return '\\' + stringEscapes[chr];
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if `value` is a valid array-like index.
|
|
|
+ *
|
|
|
+ * @private
|
|
|
+ * @param {*} value The value to check.
|
|
|
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
|
|
|
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
|
|
|
+ */
|
|
|
+function isIndex(value, length) {
|
|
|
+ value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
|
|
|
+ length = length == null ? MAX_SAFE_INTEGER : length;
|
|
|
+ return value > -1 && value % 1 == 0 && value < length;
|
|
|
+}
|
|
|
+
|
|
|
+/** Used for built-in method references. */
|
|
|
+var objectProto = global.Object.prototype;
|
|
|
+
|
|
|
+/** Used to check objects for own properties. */
|
|
|
+var hasOwnProperty = objectProto.hasOwnProperty;
|
|
|
+
|
|
|
+/**
|
|
|
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
|
|
+ * of values.
|
|
|
+ */
|
|
|
+var objectToString = objectProto.toString;
|
|
|
+
|
|
|
+/** Built-in value references. */
|
|
|
+var _Symbol = global.Symbol;
|
|
|
+
|
|
|
+/** Used to convert symbols to primitives and strings. */
|
|
|
+var symbolProto = _Symbol ? _Symbol.prototype : undefined,
|
|
|
+ symbolToString = _Symbol ? symbolProto.toString : undefined;
|
|
|
+
|
|
|
+/**
|
|
|
+ * Used by `_.defaults` to customize its `_.assignIn` use.
|
|
|
+ *
|
|
|
+ * @private
|
|
|
+ * @param {*} objValue The destination value.
|
|
|
+ * @param {*} srcValue The source value.
|
|
|
+ * @param {string} key The key of the property to assign.
|
|
|
+ * @param {Object} object The parent object of `objValue`.
|
|
|
+ * @returns {*} Returns the value to assign.
|
|
|
+ */
|
|
|
+function assignInDefaults(objValue, srcValue, key, object) {
|
|
|
+ if (objValue === undefined ||
|
|
|
+ (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
|
|
|
+ return srcValue;
|
|
|
+ }
|
|
|
+ return objValue;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * The base implementation of `_.property` without support for deep paths.
|
|
|
+ *
|
|
|
+ * @private
|
|
|
+ * @param {string} key The key of the property to get.
|
|
|
+ * @returns {Function} Returns the new function.
|
|
|
+ */
|
|
|
+function baseProperty(key) {
|
|
|
+ return function(object) {
|
|
|
+ return object == null ? undefined : object[key];
|
|
|
+ };
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Gets the "length" property value of `object`.
|
|
|
+ *
|
|
|
+ * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
|
|
|
+ * that affects Safari on at least iOS 8.1-8.3 ARM64.
|
|
|
+ *
|
|
|
+ * @private
|
|
|
+ * @param {Object} object The object to query.
|
|
|
+ * @returns {*} Returns the "length" value.
|
|
|
+ */
|
|
|
+var getLength = baseProperty('length');
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if the provided arguments are from an iteratee call.
|
|
|
+ *
|
|
|
+ * @private
|
|
|
+ * @param {*} value The potential iteratee value argument.
|
|
|
+ * @param {*} index The potential iteratee index or key argument.
|
|
|
+ * @param {*} object The potential iteratee object argument.
|
|
|
+ * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.
|
|
|
+ */
|
|
|
+function isIterateeCall(value, index, object) {
|
|
|
+ if (!isObject(object)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ var type = typeof index;
|
|
|
+ if (type == 'number'
|
|
|
+ ? (isArrayLike(object) && isIndex(index, object.length))
|
|
|
+ : (type == 'string' && index in object)) {
|
|
|
+ return eq(object[index], value);
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
|
|
|
+ * comparison between two values to determine if they are equivalent.
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @category Lang
|
|
|
+ * @param {*} value The value to compare.
|
|
|
+ * @param {*} other The other value to compare.
|
|
|
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * var object = { 'user': 'fred' };
|
|
|
+ * var other = { 'user': 'fred' };
|
|
|
+ *
|
|
|
+ * _.eq(object, object);
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.eq(object, other);
|
|
|
+ * // => false
|
|
|
+ *
|
|
|
+ * _.eq('a', 'a');
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.eq('a', Object('a'));
|
|
|
+ * // => false
|
|
|
+ *
|
|
|
+ * _.eq(NaN, NaN);
|
|
|
+ * // => true
|
|
|
+ */
|
|
|
+function eq(value, other) {
|
|
|
+ return value === other || (value !== value && other !== other);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if `value` is array-like. A value is considered array-like if it's
|
|
|
+ * not a function and has a `value.length` that's an integer greater than or
|
|
|
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @type Function
|
|
|
+ * @category Lang
|
|
|
+ * @param {*} value The value to check.
|
|
|
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * _.isArrayLike([1, 2, 3]);
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.isArrayLike(document.body.children);
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.isArrayLike('abc');
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.isArrayLike(_.noop);
|
|
|
+ * // => false
|
|
|
+ */
|
|
|
+function isArrayLike(value) {
|
|
|
+ return value != null &&
|
|
|
+ !(typeof value == 'function' && isFunction(value)) && isLength(getLength(value));
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
|
|
|
+ * `SyntaxError`, `TypeError`, or `URIError` object.
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @category Lang
|
|
|
+ * @param {*} value The value to check.
|
|
|
+ * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * _.isError(new Error);
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.isError(Error);
|
|
|
+ * // => false
|
|
|
+ */
|
|
|
+function isError(value) {
|
|
|
+ return isObjectLike(value) &&
|
|
|
+ typeof value.message == 'string' && objectToString.call(value) == errorTag;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if `value` is classified as a `Function` object.
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @category Lang
|
|
|
+ * @param {*} value The value to check.
|
|
|
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * _.isFunction(_);
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.isFunction(/abc/);
|
|
|
+ * // => false
|
|
|
+ */
|
|
|
+function isFunction(value) {
|
|
|
+ // The use of `Object#toString` avoids issues with the `typeof` operator
|
|
|
+ // in Safari 8 which returns 'object' for typed array constructors, and
|
|
|
+ // PhantomJS 1.9 which returns 'function' for `NodeList` instances.
|
|
|
+ var tag = isObject(value) ? objectToString.call(value) : '';
|
|
|
+ return tag == funcTag || tag == genTag;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if `value` is a valid array-like length.
|
|
|
+ *
|
|
|
+ * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @category Lang
|
|
|
+ * @param {*} value The value to check.
|
|
|
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * _.isLength(3);
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.isLength(Number.MIN_VALUE);
|
|
|
+ * // => false
|
|
|
+ *
|
|
|
+ * _.isLength(Infinity);
|
|
|
+ * // => false
|
|
|
+ *
|
|
|
+ * _.isLength('3');
|
|
|
+ * // => false
|
|
|
+ */
|
|
|
+function isLength(value) {
|
|
|
+ return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
|
|
|
+ * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @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) {
|
|
|
+ // Avoid a V8 JIT bug in Chrome 19-20.
|
|
|
+ // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
|
|
|
+ var type = typeof value;
|
|
|
+ return !!value && (type == 'object' || type == 'function');
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 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 _
|
|
|
+ * @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 && typeof value == 'object';
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Checks if `value` is classified as a `Symbol` primitive or object.
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @category Lang
|
|
|
+ * @param {*} value The value to check.
|
|
|
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * _.isSymbol(Symbol.iterator);
|
|
|
+ * // => true
|
|
|
+ *
|
|
|
+ * _.isSymbol('abc');
|
|
|
+ * // => false
|
|
|
+ */
|
|
|
+function isSymbol(value) {
|
|
|
+ return typeof value == 'symbol' ||
|
|
|
+ (isObjectLike(value) && objectToString.call(value) == symbolTag);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Converts `value` to a string if it's not one. An empty string is returned
|
|
|
+ * for `null` and `undefined` values. The sign of `-0` is preserved.
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @category Lang
|
|
|
+ * @param {*} value The value to process.
|
|
|
+ * @returns {string} Returns the string.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * _.toString(null);
|
|
|
+ * // => ''
|
|
|
+ *
|
|
|
+ * _.toString(-0);
|
|
|
+ * // => '-0'
|
|
|
+ *
|
|
|
+ * _.toString([1, 2, 3]);
|
|
|
+ * // => '1,2,3'
|
|
|
+ */
|
|
|
+function toString(value) {
|
|
|
+ // Exit early for strings to avoid a performance hit in some environments.
|
|
|
+ if (typeof value == 'string') {
|
|
|
+ return value;
|
|
|
+ }
|
|
|
+ if (value == null) {
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+ if (isSymbol(value)) {
|
|
|
+ return _Symbol ? symbolToString.call(value) : '';
|
|
|
+ }
|
|
|
+ var result = (value + '');
|
|
|
+ return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Creates a compiled template function that can interpolate data properties
|
|
|
+ * in "interpolate" delimiters, HTML-escape interpolated data properties in
|
|
|
+ * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
|
|
|
+ * properties may be accessed as free variables in the template. If a setting
|
|
|
+ * object is provided it takes precedence over `_.templateSettings` values.
|
|
|
+ *
|
|
|
+ * **Note:** In the development build `_.template` utilizes
|
|
|
+ * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
|
|
|
+ * for easier debugging.
|
|
|
+ *
|
|
|
+ * For more information on precompiling templates see
|
|
|
+ * [lodash's custom builds documentation](https://lodash.com/custom-builds).
|
|
|
+ *
|
|
|
+ * For more information on Chrome extension sandboxes see
|
|
|
+ * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @category String
|
|
|
+ * @param {string} [string=''] The template string.
|
|
|
+ * @param {Object} [options] The options object.
|
|
|
+ * @param {RegExp} [options.escape] The HTML "escape" delimiter.
|
|
|
+ * @param {RegExp} [options.evaluate] The "evaluate" delimiter.
|
|
|
+ * @param {Object} [options.imports] An object to import into the template as free variables.
|
|
|
+ * @param {RegExp} [options.interpolate] The "interpolate" delimiter.
|
|
|
+ * @param {string} [options.sourceURL] The sourceURL of the template's compiled source.
|
|
|
+ * @param {string} [options.variable] The data object variable name.
|
|
|
+ * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`.
|
|
|
+ * @returns {Function} Returns the compiled template function.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * // using the "interpolate" delimiter to create a compiled template
|
|
|
+ * var compiled = _.template('hello <%= user %>!');
|
|
|
+ * compiled({ 'user': 'fred' });
|
|
|
+ * // => 'hello fred!'
|
|
|
+ *
|
|
|
+ * // using the HTML "escape" delimiter to escape data property values
|
|
|
+ * var compiled = _.template('<b><%- value %></b>');
|
|
|
+ * compiled({ 'value': '<script>' });
|
|
|
+ * // => '<b><script></b>'
|
|
|
+ *
|
|
|
+ * // using the "evaluate" delimiter to execute JavaScript and generate HTML
|
|
|
+ * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
|
|
|
+ * compiled({ 'users': ['fred', 'barney'] });
|
|
|
+ * // => '<li>fred</li><li>barney</li>'
|
|
|
+ *
|
|
|
+ * // using the internal `print` function in "evaluate" delimiters
|
|
|
+ * var compiled = _.template('<% print("hello " + user); %>!');
|
|
|
+ * compiled({ 'user': 'barney' });
|
|
|
+ * // => 'hello barney!'
|
|
|
+ *
|
|
|
+ * // using the ES delimiter as an alternative to the default "interpolate" delimiter
|
|
|
+ * var compiled = _.template('hello ${ user }!');
|
|
|
+ * compiled({ 'user': 'pebbles' });
|
|
|
+ * // => 'hello pebbles!'
|
|
|
+ *
|
|
|
+ * // using custom template delimiters
|
|
|
+ * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
|
|
|
+ * var compiled = _.template('hello {{ user }}!');
|
|
|
+ * compiled({ 'user': 'mustache' });
|
|
|
+ * // => 'hello mustache!'
|
|
|
+ *
|
|
|
+ * // using backslashes to treat delimiters as plain text
|
|
|
+ * var compiled = _.template('<%= "\\<%- value %\\>" %>');
|
|
|
+ * compiled({ 'value': 'ignored' });
|
|
|
+ * // => '<%- value %>'
|
|
|
+ *
|
|
|
+ * // using the `imports` option to import `jQuery` as `jq`
|
|
|
+ * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
|
|
|
+ * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
|
|
|
+ * compiled({ 'users': ['fred', 'barney'] });
|
|
|
+ * // => '<li>fred</li><li>barney</li>'
|
|
|
+ *
|
|
|
+ * // using the `sourceURL` option to specify a custom sourceURL for the template
|
|
|
+ * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
|
|
|
+ * compiled(data);
|
|
|
+ * // => find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector
|
|
|
+ *
|
|
|
+ * // using the `variable` option to ensure a with-statement isn't used in the compiled template
|
|
|
+ * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
|
|
|
+ * compiled.source;
|
|
|
+ * // => function(data) {
|
|
|
+ * // var __t, __p = '';
|
|
|
+ * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
|
|
|
+ * // return __p;
|
|
|
+ * // }
|
|
|
+ *
|
|
|
+ * // using the `source` property to inline compiled templates for meaningful
|
|
|
+ * // line numbers in error messages and a stack trace
|
|
|
+ * fs.writeFileSync(path.join(cwd, 'jst.js'), '\
|
|
|
+ * var JST = {\
|
|
|
+ * "main": ' + _.template(mainText).source + '\
|
|
|
+ * };\
|
|
|
+ * ');
|
|
|
+ */
|
|
|
+function template(string, options, guard) {
|
|
|
+ // Based on John Resig's `tmpl` implementation (http://ejohn.org/blog/javascript-micro-templating/)
|
|
|
+ // and Laura Doktorova's doT.js (https://github.com/olado/doT).
|
|
|
+ var settings = templateSettings.imports._.templateSettings || templateSettings;
|
|
|
+
|
|
|
+ if (guard && isIterateeCall(string, options, guard)) {
|
|
|
+ options = undefined;
|
|
|
+ }
|
|
|
+ string = toString(string);
|
|
|
+ options = assignInWith({}, options, settings, assignInDefaults);
|
|
|
+
|
|
|
+ var imports = assignInWith({}, options.imports, settings.imports, assignInDefaults),
|
|
|
+ importsKeys = keys(imports),
|
|
|
+ importsValues = baseValues(imports, importsKeys);
|
|
|
+
|
|
|
+ var isEscaping,
|
|
|
+ isEvaluating,
|
|
|
+ index = 0,
|
|
|
+ interpolate = options.interpolate || reNoMatch,
|
|
|
+ source = "__p += '";
|
|
|
+
|
|
|
+ // Compile the regexp to match each delimiter.
|
|
|
+ var reDelimiters = RegExp(
|
|
|
+ (options.escape || reNoMatch).source + '|' +
|
|
|
+ interpolate.source + '|' +
|
|
|
+ (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
|
|
|
+ (options.evaluate || reNoMatch).source + '|$'
|
|
|
+ , 'g');
|
|
|
+
|
|
|
+ // Use a sourceURL for easier debugging.
|
|
|
+ var sourceURL = 'sourceURL' in options ? '//# sourceURL=' + options.sourceURL + '\n' : '';
|
|
|
+
|
|
|
+ string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
|
|
|
+ interpolateValue || (interpolateValue = esTemplateValue);
|
|
|
+
|
|
|
+ // Escape characters that can't be included in string literals.
|
|
|
+ source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
|
|
|
+
|
|
|
+ // Replace delimiters with snippets.
|
|
|
+ if (escapeValue) {
|
|
|
+ isEscaping = true;
|
|
|
+ source += "' +\n__e(" + escapeValue + ") +\n'";
|
|
|
+ }
|
|
|
+ if (evaluateValue) {
|
|
|
+ isEvaluating = true;
|
|
|
+ source += "';\n" + evaluateValue + ";\n__p += '";
|
|
|
+ }
|
|
|
+ if (interpolateValue) {
|
|
|
+ source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
|
|
|
+ }
|
|
|
+ index = offset + match.length;
|
|
|
+
|
|
|
+ // The JS engine embedded in Adobe products needs `match` returned in
|
|
|
+ // order to produce the correct `offset` value.
|
|
|
+ return match;
|
|
|
+ });
|
|
|
+
|
|
|
+ source += "';\n";
|
|
|
+
|
|
|
+ // If `variable` is not specified wrap a with-statement around the generated
|
|
|
+ // code to add the data object to the top of the scope chain.
|
|
|
+ var variable = options.variable;
|
|
|
+ if (!variable) {
|
|
|
+ source = 'with (obj) {\n' + source + '\n}\n';
|
|
|
+ }
|
|
|
+ // Cleanup code by stripping empty strings.
|
|
|
+ source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
|
|
|
+ .replace(reEmptyStringMiddle, '$1')
|
|
|
+ .replace(reEmptyStringTrailing, '$1;');
|
|
|
+
|
|
|
+ // Frame code as the function body.
|
|
|
+ source = 'function(' + (variable || 'obj') + ') {\n' +
|
|
|
+ (variable
|
|
|
+ ? ''
|
|
|
+ : 'obj || (obj = {});\n'
|
|
|
+ ) +
|
|
|
+ "var __t, __p = ''" +
|
|
|
+ (isEscaping
|
|
|
+ ? ', __e = _.escape'
|
|
|
+ : ''
|
|
|
+ ) +
|
|
|
+ (isEvaluating
|
|
|
+ ? ', __j = Array.prototype.join;\n' +
|
|
|
+ "function print() { __p += __j.call(arguments, '') }\n"
|
|
|
+ : ';\n'
|
|
|
+ ) +
|
|
|
+ source +
|
|
|
+ 'return __p\n}';
|
|
|
+
|
|
|
+ var result = attempt(function() {
|
|
|
+ return Function(importsKeys, sourceURL + 'return ' + source).apply(undefined, importsValues);
|
|
|
+ });
|
|
|
+
|
|
|
+ // Provide the compiled function's source by its `toString` method or
|
|
|
+ // the `source` property as a convenience for inlining compiled templates.
|
|
|
+ result.source = source;
|
|
|
+ if (isError(result)) {
|
|
|
+ throw result;
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Attempts to invoke `func`, returning either the result or the caught error
|
|
|
+ * object. Any additional arguments are provided to `func` when it's invoked.
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @category Util
|
|
|
+ * @param {Function} func The function to attempt.
|
|
|
+ * @returns {*} Returns the `func` result or error object.
|
|
|
+ * @example
|
|
|
+ *
|
|
|
+ * // avoid throwing errors for invalid selectors
|
|
|
+ * var elements = _.attempt(function(selector) {
|
|
|
+ * return document.querySelectorAll(selector);
|
|
|
+ * }, '>_>');
|
|
|
+ *
|
|
|
+ * if (_.isError(elements)) {
|
|
|
+ * elements = [];
|
|
|
+ * }
|
|
|
+ */
|
|
|
+var attempt = rest(function(func, args) {
|
|
|
+ try {
|
|
|
+ return apply(func, undefined, args);
|
|
|
+ } catch (e) {
|
|
|
+ return isError(e) ? e : new Error(e);
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
+module.exports = template;
|
|
|
+
|
|
|
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
|
+},{"lodash._arraymap":1,"lodash._reinterpolate":2,"lodash.assigninwith":3,"lodash.keys":5,"lodash.rest":7,"lodash.templatesettings":9}],9:[function(require,module,exports){
|
|
|
+/**
|
|
|
+ * lodash 3.1.1 (Custom Build) <https://lodash.com/>
|
|
|
+ * Build: `lodash modularize exports="npm" -o ./`
|
|
|
+ * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
|
|
|
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
|
+ * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
|
+ * Available under MIT license <https://lodash.com/license>
|
|
|
+ */
|
|
|
+var escape = require('lodash.escape'),
|
|
|
+ reInterpolate = require('lodash._reinterpolate');
|
|
|
+
|
|
|
+/** Used to match template delimiters. */
|
|
|
+var reEscape = /<%-([\s\S]+?)%>/g,
|
|
|
+ reEvaluate = /<%([\s\S]+?)%>/g;
|
|
|
+
|
|
|
+/**
|
|
|
+ * By default, the template delimiters used by lodash are like those in
|
|
|
+ * embedded Ruby (ERB). Change the following template settings to use
|
|
|
+ * alternative delimiters.
|
|
|
+ *
|
|
|
+ * @static
|
|
|
+ * @memberOf _
|
|
|
+ * @type Object
|
|
|
+ */
|
|
|
+var templateSettings = {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Used to detect `data` property values to be HTML-escaped.
|
|
|
+ *
|
|
|
+ * @memberOf _.templateSettings
|
|
|
+ * @type RegExp
|
|
|
+ */
|
|
|
+ 'escape': reEscape,
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Used to detect code to be evaluated.
|
|
|
+ *
|
|
|
+ * @memberOf _.templateSettings
|
|
|
+ * @type RegExp
|
|
|
+ */
|
|
|
+ 'evaluate': reEvaluate,
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Used to detect `data` property values to inject.
|
|
|
+ *
|
|
|
+ * @memberOf _.templateSettings
|
|
|
+ * @type RegExp
|
|
|
+ */
|
|
|
+ 'interpolate': reInterpolate,
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Used to reference the data object in the template text.
|
|
|
+ *
|
|
|
+ * @memberOf _.templateSettings
|
|
|
+ * @type string
|
|
|
+ */
|
|
|
+ 'variable': '',
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Used to import variables into the compiled template.
|
|
|
+ *
|
|
|
+ * @memberOf _.templateSettings
|
|
|
+ * @type Object
|
|
|
+ */
|
|
|
+ 'imports': {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * A reference to the `lodash` function.
|
|
|
+ *
|
|
|
+ * @memberOf _.templateSettings.imports
|
|
|
+ * @type Function
|
|
|
+ */
|
|
|
+ '_': { 'escape': escape }
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+module.exports = templateSettings;
|
|
|
+
|
|
|
+},{"lodash._reinterpolate":2,"lodash.escape":4}],10:[function(require,module,exports){
|
|
|
+'use strict';
|
|
|
+
|
|
|
+var _lodash = require('lodash.template');
|
|
|
+
|
|
|
+var _lodash2 = _interopRequireDefault(_lodash);
|
|
|
+
|
|
|
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+var indexTemplate = (0, _lodash2.default)("<ul>\n <% users.forEach(function(user) { %>\n <li><%= user %></li>\n <% }); %>\n</ul>\n");
|
|
|
+
|
|
|
+console.log('lodash template:');
|
|
|
+console.log(indexTemplate({ users: ['John', 'Ira', 'Karl'] }));
|
|
|
+
|
|
|
+},{"lodash.template":8}]},{},[10]);
|