diff --git a/lodash.js b/lodash.js index 2d3ab1a58..da7846412 100644 --- a/lodash.js +++ b/lodash.js @@ -278,183 +278,6 @@ /*--------------------------------------------------------------------------*/ - /** - * A specialized version of `_.forEach` 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 `array`. - */ - function arrayEach(array, iteratee) { - var index = -1, - length = array.length; - - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } - } - return array; - } - - /** - * A specialized version of `_.forEachRight` 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 `array`. - */ - function arrayEachRight(array, iteratee) { - var length = array.length; - - while (length--) { - if (iteratee(array[length], length, array) === false) { - break; - } - } - return array; - } - - /** - * A specialized version of `_.every` for arrays without support for callback - * shorthands or `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false`. - */ - function arrayEvery(array, predicate) { - var index = -1, - length = array.length; - - while (++index < length) { - if (!predicate(array[index], index, array)) { - return false; - } - } - return true; - } - - /** - * A specialized version of `_.filter` for arrays without support for callback - * shorthands or `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ - function arrayFilter(array, predicate) { - var index = -1, - length = array.length, - resIndex = -1, - result = []; - - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result[++resIndex] = value; - } - } - return result; - } - - /** - * 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; - } - - /** - * A specialized version of `_.reduce` 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. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initFromArray] Specify using the first element of - * `array` as the initial value. - * @returns {*} Returns the accumulated value. - */ - function arrayReduce(array, iteratee, accumulator, initFromArray) { - var index = -1, - length = array.length; - - if (initFromArray && length) { - accumulator = array[++index]; - } - while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); - } - return accumulator; - } - - /** - * A specialized version of `_.reduceRight` 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. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initFromArray] Specify using the last element of - * `array` as the initial value. - * @returns {*} Returns the accumulated value. - */ - function arrayReduceRight(array, iteratee, accumulator, initFromArray) { - var length = array.length; - if (initFromArray && length) { - accumulator = array[--length]; - } - while (length--) { - accumulator = iteratee(accumulator, array[length], length, array); - } - return accumulator; - } - - /** - * A specialized version of `_.some` for arrays without support for callback - * shorthands or `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - */ - function arraySome(array, predicate) { - var index = -1, - length = array.length; - - while (++index < length) { - if (predicate(array[index], index, array)) { - return true; - } - } - return false; - } - /** * The base implementation of `compareAscending` which compares values and * sorts them in ascending order without guaranteeing a stable sort. @@ -503,25 +326,6 @@ return -1; } - /** - * The base implementation of `_.slice` without support for `start` and `end` - * arguments. - * - * @private - * @param {Array} array The array to slice. - * @returns {Array} Returns the slice of `array`. - */ - function baseSlice(array) { - var index = -1, - length = array.length, - result = Array(length); - - while (++index < length) { - result[index] = array[index]; - } - return result; - } - /** * The base implementation of `_.sortBy` and `_.sortByAll` which uses `comparer` * to define the sort order of `array` and replaces criteria objects with their @@ -991,7 +795,7 @@ * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`, `splice`, * and `unshift` * - * The wrapper functons that support shortcut fusion are: + * The wrapper functions that support shortcut fusion are: * `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, `first`, * `initial`, `last`, `map`, `pluck`, `reject`, `rest`, `reverse`, `slice`, * `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `where` @@ -1058,7 +862,7 @@ return value; } if (hasOwnProperty.call(value, '__wrapped__')) { - return new LodashWrapper(value.__wrapped__, value.__chain__, baseSlice(value.__actions__)); + return new LodashWrapper(value.__wrapped__, value.__chain__, arrayCopy(value.__actions__)); } } return new LodashWrapper(value); @@ -1232,13 +1036,13 @@ views = this.views, result = new LazyWrapper(this.wrapped); - result.actions = actions ? baseSlice(actions) : null; + result.actions = actions ? arrayCopy(actions) : null; result.dir = this.dir; result.dropCount = this.dropCount; result.filtered = this.filtered; - result.iteratees = iteratees ? baseSlice(iteratees) : null; + result.iteratees = iteratees ? arrayCopy(iteratees) : null; result.takeCount = this.takeCount; - result.views = views ? baseSlice(views) : null; + result.views = views ? arrayCopy(views) : null; return result; } @@ -1457,6 +1261,132 @@ return result; } + /** + * Copies the values of `array` to `other`. + * + * @private + * @param {Array} array The array to copy. + * @param {Array} [other=[]] The array to copy values to. + * @returns {Array} Returns `other`. + */ + function arrayCopy(array, other) { + var index = -1, + length = array.length, + result = other || Array(length); + + while (++index < length) { + result[index] = array[index]; + } + return result; + } + + /** + * A specialized version of `_.forEach` 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 `array`. + */ + function arrayEach(array, iteratee) { + var index = -1, + length = array.length; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.forEachRight` 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 `array`. + */ + function arrayEachRight(array, iteratee) { + var length = array.length; + + while (length--) { + if (iteratee(array[length], length, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.every` for arrays without support for callback + * shorthands or `this` binding. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + */ + function arrayEvery(array, predicate) { + var index = -1, + length = array.length; + + while (++index < length) { + if (!predicate(array[index], index, array)) { + return false; + } + } + return true; + } + + /** + * A specialized version of `_.filter` for arrays without support for callback + * shorthands or `this` binding. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function arrayFilter(array, predicate) { + var index = -1, + length = array.length, + resIndex = -1, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[++resIndex] = value; + } + } + return result; + } + + /** + * 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; + } + /** * A specialized version of `_.max` for arrays without support for iteratees. * @@ -1499,6 +1429,76 @@ return result; } + /** + * A specialized version of `_.reduce` 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. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initFromArray] Specify using the first element of + * `array` as the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduce(array, iteratee, accumulator, initFromArray) { + var index = -1, + length = array.length; + + if (initFromArray && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; + } + + /** + * A specialized version of `_.reduceRight` 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. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initFromArray] Specify using the last element of + * `array` as the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduceRight(array, iteratee, accumulator, initFromArray) { + var length = array.length; + if (initFromArray && length) { + accumulator = array[--length]; + } + while (length--) { + accumulator = iteratee(accumulator, array[length], length, array); + } + return accumulator; + } + + /** + * A specialized version of `_.some` for arrays without support for callback + * shorthands or `this` binding. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function arraySome(array, predicate) { + var index = -1, + length = array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; + } + /** * Used by `_.defaults` to customize its `_.assign` use. * @@ -1633,7 +1633,7 @@ } // Handle "_.property" and "_.matches" style callback shorthands. return type == 'object' - ? baseMatches(func, argCount) + ? baseMatches(func, !argCount) : baseProperty(argCount ? (func + '') : func); } @@ -1659,21 +1659,29 @@ if (typeof result != 'undefined') { return result; } - var isArr = isArray(value); - result = value; - if (isArr) { - result = initArrayClone(value, isDeep); - } else if (isObject(value)) { - result = initObjectClone(value, isDeep); - if (result === null) { - isDeep = false; - result = {}; - } else if (isDeep) { - isDeep = objToString.call(result) == objectTag; - } + if (!isObject(value)) { + return value; } - if (!isDeep || result === value) { - return result; + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return arrayCopy(value, result); + } + } else { + var tag = objToString.call(value), + isFunc = tag == funcTag; + + if (tag == objectTag || (isFunc && !object)) { + result = initCloneObject(isFunc ? {} : value); + if (!isDeep) { + return baseAssign(result, value); + } + } else { + return cloneableTags[tag] + ? initCloneByTag(value, tag, isDeep) + : (object ? value : {}); + } } // Check for circular references and return corresponding clone. stackA || (stackA = []); @@ -1730,7 +1738,7 @@ if (!isFunction(func)) { throw new TypeError(FUNC_ERROR_TEXT); } - return setTimeout(function() { func.apply(undefined, slice(args, fromIndex)); }, wait); + return setTimeout(function() { func.apply(undefined, baseSlice(args, fromIndex)); }, wait); } /** @@ -2075,8 +2083,8 @@ * `customizer` functions. * * @private - * @param {*} value The value to compare to `other`. - * @param {*} other The value to compare to `value`. + * @param {*} value The value to compare. + * @param {*} other The other value to compare. * @param {Function} [customizer] The function to customize comparing values. * @param {boolean} [isWhere] Specify performing partial comparisons. * @param {Array} [stackA] Tracks traversed `value` objects. @@ -2107,8 +2115,8 @@ * objects with circular references to be compared. * * @private - * @param {Array} object The object to compare to `other`. - * @param {Array} other The object to compare to `value`. + * @param {Array} object The object to compare. + * @param {Array} other The other object to compare. * @param {Function} equalFunc The function to determine equivalents of arbitrary values. * @param {Function} [customizer] The function to customize comparing objects. * @param {boolean} [isWhere] Specify performing partial comparisons. @@ -2242,7 +2250,7 @@ /** * The base implementation of `_.matches` which supports specifying whether - * `source` is cloned. + * `source` should be cloned. * * @private * @param {Object} source The object of property values to match. @@ -2263,16 +2271,16 @@ }; } } - var notCloned = !isCloned, - values = Array(length), + if (isCloned) { + source = baseClone(source, true); + } + var values = Array(length), strictCompareFlags = Array(length); while (length--) { value = source[props[length]]; - var isStrict = isStrictComparable(value); - - values[length] = (isStrict || notCloned) ? value : baseClone(value, true, clonePassthru); - strictCompareFlags[length] = isStrict; + values[length] = value; + strictCompareFlags[length] = isStrictComparable(value); } return function(object) { return baseIsMatch(object, props, values, strictCompareFlags); @@ -2432,6 +2440,36 @@ return func; }; + /** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + start = start == null ? 0 : (+start || 0); + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = (typeof end == 'undefined' || end > length) ? length : (+end || 0); + if (end < 0) { + end += length; + } + length = start > end ? 0 : (end - start); + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; + } + /** * The base implementation of `_.some` without support for callback shorthands * or `this` binding. @@ -2694,18 +2732,6 @@ }; } - /** - * Used by `_.matches` to clone `source` values, letting uncloneable values - * passthu instead of returning empty objects. - * - * @private - * @param {*} value The value to clone. - * @returns {*} Returns the cloned value. - */ - function clonePassthru(value) { - return isCloneable(value) ? undefined : value; - } - /** * Creates an array that is the composition of partially applied arguments, * placeholders, and provided arguments into a single array of arguments. @@ -2987,7 +3013,7 @@ length -= argsHolders.length; if (length < arity) { - var newArgPos = argPos ? baseSlice(argPos) : null, + var newArgPos = argPos ? arrayCopy(argPos) : null, newArity = nativeMax(arity - length, 0), newsHolders = isCurry ? argsHolders : null, newHoldersRight = isCurry ? null : argsHolders, @@ -3149,8 +3175,8 @@ * partial deep comparisons. * * @private - * @param {Array} array The array to compare to `other`. - * @param {Array} other The array to compare to `value`. + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. * @param {Function} equalFunc The function to determine equivalents of arbitrary values. * @param {Function} [customizer] The function to customize comparing arrays. * @param {boolean} [isWhere] Specify performing partial comparisons. @@ -3204,8 +3230,8 @@ * values of `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. * * @private - * @param {Object} value The object to compare to `other`. - * @param {Object} other The object to compare to `object`. + * @param {Object} value The object to compare. + * @param {Object} other The other object to compare. * @param {string} tag The `toStringTag` of the objects to compare. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ @@ -3241,8 +3267,8 @@ * partial deep comparisons. * * @private - * @param {Object} object The object to compare to `other`. - * @param {Object} other The object to compare to `value`. + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. * @param {Function} equalFunc The function to determine equivalents of arbitrary values. * @param {Function} [customizer] The function to customize comparing values. * @param {boolean} [isWhere] Specify performing partial comparisons. @@ -3399,19 +3425,12 @@ * * @private * @param {Array} array The array to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Array} Returns the initialized array clone. + * @returns {Array} Returns the initialized clone. */ - function initArrayClone(array, isDeep) { - var index = -1, - length = array.length, + function initCloneArray(array) { + var length = array.length, result = new array.constructor(length); - if (!isDeep) { - while (++index < length) { - result[index] = array[index]; - } - } // Add array properties assigned by `RegExp#exec`. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { result.index = array.index; @@ -3425,30 +3444,37 @@ * * @private * @param {Object} object The object to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {null|Object} Returns the initialized object clone if an object - * is cloneable, else `null`. + * @returns {Object} Returns the initialized clone. */ - function initObjectClone(object, isDeep) { - if (!isCloneable(object)) { - return null; - } - var Ctor = object.constructor, - tag = objToString.call(object), - isArgs = tag == argsTag, - isObj = tag == objectTag; - - if (isObj && !(typeof Ctor == 'function' && Ctor instanceof Ctor)) { + function initCloneObject(object) { + var Ctor = object.constructor; + if (!(typeof Ctor == 'function' && Ctor instanceof Ctor)) { Ctor = Object; } - if (isArgs || isObj) { - var result = isDeep ? new Ctor : baseAssign(new Ctor, object); - if (isArgs) { - result.length = object.length; - } - return result; - } + return new Ctor; + } + + /** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with `toStringTag` + * values of `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneByTag(object, tag, isDeep) { + var Ctor = object.constructor; switch (tag) { + case argsTag: + var result = new Ctor; + result.length = object.length; + return arrayCopy(object, result); + case arrayBufferTag: return bufferClone(object); @@ -3510,17 +3536,6 @@ return result; } - /** - * Checks if `value` is cloneable. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is cloneable, else `false`. - */ - function isCloneable(value) { - return (value && cloneableTags[objToString.call(value)]) || false; - } - /** * Checks if the provided arguments are from an iteratee call. * @@ -3616,20 +3631,20 @@ var value = source[3]; if (value) { var partials = data[3]; - data[3] = partials ? composeArgs(partials, value, source[4]) : baseSlice(value); - data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : baseSlice(source[4]); + data[3] = partials ? composeArgs(partials, value, source[4]) : arrayCopy(value); + data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : arrayCopy(source[4]); } // Compose partial right arguments. value = source[5]; if (value) { partials = data[5]; - data[5] = partials ? composeArgsRight(partials, value, source[6]) : baseSlice(value); - data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : baseSlice(source[6]); + data[5] = partials ? composeArgsRight(partials, value, source[6]) : arrayCopy(value); + data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : arrayCopy(source[6]); } // Use source `argPos` if available. value = source[7]; if (value) { - data[7] = baseSlice(value); + data[7] = arrayCopy(value); } // Use source `ary` if it's smaller. if (srcBitmask & ARY_FLAG) { @@ -3704,7 +3719,7 @@ function reorder(array, indexes) { var arrLength = array.length, length = nativeMin(indexes.length, arrLength), - oldArray = baseSlice(array); + oldArray = arrayCopy(array); while (length--) { var index = indexes[length]; @@ -3883,7 +3898,7 @@ result = Array(ceil(length / size)); while (index < length) { - result[++resIndex] = slice(array, index, (index += size)); + result[++resIndex] = baseSlice(array, index, (index += size)); } return result; } @@ -3976,10 +3991,14 @@ * // => [1, 2, 3] */ function drop(array, n, guard) { + var length = array ? array.length : 0; + if (!length) { + return []; + } if (guard ? isIterateeCall(array, n, guard) : n == null) { n = 1; } - return slice(array, n < 0 ? 0 : n); + return baseSlice(array, n < 0 ? 0 : n); } /** @@ -4008,11 +4027,15 @@ * // => [1, 2, 3] */ function dropRight(array, n, guard) { + var length = array ? array.length : 0; + if (!length) { + return []; + } if (guard ? isIterateeCall(array, n, guard) : n == null) { n = 1; } - n = array ? (array.length - (+n || 0)) : 0; - return slice(array, 0, n < 0 ? 0 : n); + n = length - (+n || 0); + return baseSlice(array, 0, n < 0 ? 0 : n); } /** @@ -4057,10 +4080,12 @@ */ function dropRightWhile(array, predicate, thisArg) { var length = array ? array.length : 0; - + if (!length) { + return []; + } predicate = getCallback(predicate, thisArg, 3); while (length-- && predicate(array[length], length, array)) {} - return slice(array, 0, length + 1); + return baseSlice(array, 0, length + 1); } /** @@ -4104,12 +4129,14 @@ * // => ['pebbles'] */ function dropWhile(array, predicate, thisArg) { - var index = -1, - length = array ? array.length : 0; - + var length = array ? array.length : 0; + if (!length) { + return []; + } + var index = -1; predicate = getCallback(predicate, thisArg, 3); while (++index < length && predicate(array[index], index, array)) {} - return slice(array, index); + return baseSlice(array, index); } /** @@ -4631,32 +4658,15 @@ * @returns {Array} Returns the slice of `array`. */ function slice(array, start, end) { - var index = -1, - length = array ? array.length : 0, - endType = typeof end; - - if (end && endType != 'number' && isIterateeCall(array, start, end)) { + var length = array ? array.length : 0; + if (!length) { + return []; + } + if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { start = 0; end = length; } - start = start == null ? 0 : (+start || 0); - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = (endType == 'undefined' || end > length) ? length : (+end || 0); - if (end < 0) { - end += length; - } - if (end && end == length && !start) { - return baseSlice(array); - } - length = start > end ? 0 : (end - start); - - var result = Array(length); - while (++index < length) { - result[index] = array[index + start]; - } - return result; + return baseSlice(array, start, end); } /** @@ -4765,10 +4775,14 @@ * // => [] */ function take(array, n, guard) { + var length = array ? array.length : 0; + if (!length) { + return []; + } if (guard ? isIterateeCall(array, n, guard) : n == null) { n = 1; } - return slice(array, 0, n < 0 ? 0 : n); + return baseSlice(array, 0, n < 0 ? 0 : n); } /** @@ -4797,11 +4811,15 @@ * // => [] */ function takeRight(array, n, guard) { + var length = array ? array.length : 0; + if (!length) { + return []; + } if (guard ? isIterateeCall(array, n, guard) : n == null) { n = 1; } - n = array ? (array.length - (+n || 0)) : 0; - return slice(array, n < 0 ? 0 : n); + n = length - (+n || 0); + return baseSlice(array, n < 0 ? 0 : n); } /** @@ -4846,10 +4864,12 @@ */ function takeRightWhile(array, predicate, thisArg) { var length = array ? array.length : 0; - + if (!length) { + return []; + } predicate = getCallback(predicate, thisArg, 3); while (length-- && predicate(array[length], length, array)) {} - return slice(array, length + 1); + return baseSlice(array, length + 1); } /** @@ -4893,12 +4913,14 @@ * // => ['barney', 'fred'] */ function takeWhile(array, predicate, thisArg) { - var index = -1, - length = array ? array.length : 0; - + var length = array ? array.length : 0; + if (!length) { + return []; + } + var index = -1; predicate = getCallback(predicate, thisArg, 3); while (++index < length && predicate(array[index], index, array)) {} - return slice(array, 0, index); + return baseSlice(array, 0, index); } /** @@ -5042,7 +5064,7 @@ * // => [2, 3, 4] */ function without(array) { - return baseDifference(array, slice(arguments, 1)); + return baseDifference(array, baseSlice(arguments, 1)); } /** @@ -5791,7 +5813,7 @@ * // => [['1', '2', '3'], ['4', '5', '6']] */ function invoke(collection, methodName) { - return baseInvoke(collection, methodName, slice(arguments, 2)); + return baseInvoke(collection, methodName, baseSlice(arguments, 2)); } /** @@ -6327,7 +6349,7 @@ */ function sortByAll(collection) { var args = arguments; - if (args.length == 4 && isIterateeCall(args[1], args[2], args[3])) { + if (args.length > 3 && isIterateeCall(args[1], args[2], args[3])) { args = [collection, args[1]]; } var index = -1, @@ -6368,7 +6390,7 @@ if (!length) { return []; } - return baseSlice(collection); + return arrayCopy(collection); } /** @@ -6562,7 +6584,7 @@ function bind(func, thisArg) { var bitmask = BIND_FLAG; if (arguments.length > 2) { - var partials = slice(arguments, 2), + var partials = baseSlice(arguments, 2), holders = replaceHolders(partials, bind.placeholder); bitmask |= PARTIAL_FLAG; @@ -6651,7 +6673,7 @@ function bindKey(object, key) { var bitmask = BIND_FLAG | BIND_KEY_FLAG; if (arguments.length > 2) { - var partials = slice(arguments, 2), + var partials = baseSlice(arguments, 2), holders = replaceHolders(partials, bindKey.placeholder); bitmask |= PARTIAL_FLAG; @@ -7214,7 +7236,7 @@ * // => 'hi fred' */ function partial(func) { - var partials = slice(arguments, 1), + var partials = baseSlice(arguments, 1), holders = replaceHolders(partials, partial.placeholder); return createWrapper(func, PARTIAL_FLAG, null, partials, holders); @@ -7252,7 +7274,7 @@ * // => 'hello fred' */ function partialRight(func) { - var partials = slice(arguments, 1), + var partials = baseSlice(arguments, 1), holders = replaceHolders(partials, partialRight.placeholder); return createWrapper(func, PARTIAL_RIGHT_FLAG, null, partials, holders); @@ -7644,8 +7666,8 @@ * @static * @memberOf _ * @category Lang - * @param {*} value The value to compare to `other`. - * @param {*} other The value to compare to `value`. + * @param {*} value The value to compare. + * @param {*} other The other value to compare. * @param {Function} [customizer] The function to customize comparing values. * @param {*} [thisArg] The `this` binding of `customizer`. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. @@ -8081,16 +8103,16 @@ * @returns {Object} Returns `object`. * @example * - * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred', 'status': 'busy' }); - * // => { 'user': 'fred', 'age': 40, 'status': 'busy' } + * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' }); + * // => { 'user': 'fred', 'age': 40 } * * // using a customizer callback * var defaults = _.partialRight(_.assign, function(value, other) { * return typeof value == 'undefined' ? other : value; * }); * - * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred', 'status': 'busy' }); - * // => { 'user': 'barney', 'age': 36, 'status': 'busy' } + * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); + * // => { 'user': 'barney', 'age': 36 } */ var assign = createAssigner(baseAssign); @@ -8147,14 +8169,14 @@ * @returns {Object} Returns `object`. * @example * - * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred', 'status': 'busy' }); - * // => { 'user': 'barney', 'age': 36, 'status': 'busy' } + * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); + * // => { 'user': 'barney', 'age': 36 } */ function defaults(object) { if (object == null) { return object; } - var args = baseSlice(arguments); + var args = arrayCopy(arguments); args.push(assignDefaults); return assign.apply(undefined, args); } @@ -8530,7 +8552,7 @@ skipIndexes = length > 0; while (++index < length) { - result[index] = String(index); + result[index] = (index + ''); } for (var key in object) { if (!(skipIndexes && isIndex(key, length)) && @@ -10006,7 +10028,7 @@ var chainAll = this.__chain__; if (chain || chainAll) { var result = object(this.__wrapped__); - (result.__actions__ = baseSlice(this.__actions__)).push({ 'func': func, 'args': arguments, 'thisArg': object }); + (result.__actions__ = arrayCopy(this.__actions__)).push({ 'func': func, 'args': arguments, 'thisArg': object }); result.__chain__ = chainAll; return result; } diff --git a/lodash.min.js b/lodash.min.js index a2c77bc33..d48478a75 100644 --- a/lodash.min.js +++ b/lodash.min.js @@ -3,83 +3,83 @@ * Lo-Dash 3.0.0-pre (Custom Build) lodash.com/license | Underscore.js 1.7.0 underscorejs.org/LICENSE * Build: `lodash modern -o ./lodash.js` */ -;(function(){function n(n,t){for(var r=-1,e=n.length;++rt||!r||typeof n=="undefined"&&e)return 1;if(n=n&&9<=n&&13>=n||32==n||160==n||5760==n||6158==n||8192<=n&&(8202>=n||8232==n||8233==n||8239==n||8287==n||12288==n||65279==n)}function A(n,t){for(var r=-1,e=n.length,u=-1,o=[];++re&&(e=u)}return e}function Jt(n,t){return typeof n=="undefined"?t:n}function Ht(n,t,r,e){return typeof n!="undefined"&&Nu.call(e,r)?n:t}function Qt(n,t,r){for(var e=-1,u=No(t),o=u.length;++eo(t,f)&&e.push(f);return e}function or(n,t){var r=n?n.length:0;if(!ue(r))return gr(n,t);for(var e=-1,u=se(n);++ee(f,s)&&((t||i)&&f.push(s),l.push(c))}return l}function Or(n,t){for(var r=-1,e=t.length,u=mu(e);++r>>1,i=n[o];(r?i<=t:it||null==r)return r; -if(3=o&&f<=i&&(e=L&&t>u||e>u&&t>=L)||o)&&(t&C&&(r[2]=h[2],f|=e&C?0:T),(e=h[3])&&(u=r[3],r[3]=u?Ur(u,e,h[4]):l(e),r[4]=u?A(r[3],Y):l(h[4])),(e=h[5])&&(u=r[5],r[5]=u?Lr(u,e,h[6]):l(e),r[6]=u?A(r[5],Y):l(h[6])),(e=h[7])&&(r[7]=l(e)),t&$&&(r[8]=null==r[8]?h[8]:eo(r[8],h[8])),null==r[9]&&(r[9]=h[9]),r[0]=h[0],r[1]=f),t=r[1],f=r[9] -}return r[9]=null==f?a?0:n.length:ro(f-c,0)||0,(h?mo:xo)(t==C?zr(r[0],r[2]):t!=F&&t!=(C|F)||r[4].length?Pr.apply(null,r):Vr.apply(null,r),r)}function Zr(n,t,r,e,u,o,i){var f=-1,a=n.length,l=t.length,c=true;if(a!=l&&(!u||l<=a))return false;for(;c&&++fu)||i===e&&i===o)&&(u=i,o=n)}),o}function Hr(n,t,r){var e=Dt.callback||pu,e=e===pu?tr:e;return r?e(n,t,r):e}function Qr(n,t,r){var e=Dt.indexOf||ye,e=e===ye?a:e;return n?e(n,t,r):e}function ne(n,t){var r=-1,e=n.length,u=new n.constructor(e);if(!t)for(;++rt?0:t)}function ge(n,t,r){return(r?ee(n,t,r):null==t)&&(t=1),t=n?n.length-(+t||0):0,me(n,0,0>t?0:t) -}function ve(n,t,r){var e=-1,u=n?n.length:0;for(t=Hr(t,r,3);++er?ro(e+r,0):r||0;else if(r)return r=Sr(n,t),n=n[r],(t===t?t===n:n!==n)?r:-1;return a(n,t,r)}function _e(n){return he(n,1)}function me(n,t,r){var e=-1,u=n?n.length:0,o=typeof r;if(r&&"number"!=o&&ee(n,t,r)&&(t=0,r=u),t=null==t?0:+t||0,0>t&&(t=-t>u?0:u+t),r="undefined"==o||r>u?u:+r||0,0>r&&(r+=u),r&&r==u&&!t)return l(n); -for(u=t>r?0:r-t,r=mu(u);++e>>0,u=mu(r);++tr?ro(e+r,0):r||0:0,typeof n=="string"||!Co(n)&&tu(n)?rarguments.length,or)}function We(n,t,r,e){return(Co(n)?o:Rr)(n,Hr(t,e,4),r,3>arguments.length,ir)}function Ne(n,t,r){return(r?ee(n,t,r):null==t)?(n=ce(n),t=n.length,0t?0:+t||0,n.length),n) -}function Fe(n){n=ce(n);for(var t=-1,r=n.length,e=mu(r);++t=r||r>t?(f&&Mu(f),r=p,f=s=p=I,r&&(h=Oo(),a=n.apply(c,i),s||f||(i=c=null))):s=Zu(e,r)}function u(){s&&Mu(s),f=s=p=I,(v||g!==t)&&(h=Oo(),a=n.apply(c,i),s||f||(i=c=null)) -}function o(){if(i=arguments,l=Oo(),c=this,p=v&&(s||!d),false===g)var r=d&&!s;else{f||d||(h=l);var o=g-(l-h),y=0>=o||o>g;y?(f&&(f=Mu(f)),h=l,a=n.apply(c,i)):f||(f=Zu(u,o))}return y&&s?s=Mu(s):s||t===g||(s=Zu(e,t)),r&&(y=true,a=n.apply(c,i)),!y||s||f||(i=c=null),a}var i,f,a,l,c,s,p,h=0,g=false,v=true;if(!Je(n))throw new Iu(V);if(t=0>t?0:t,true===r)var d=true,v=false;else Xe(r)&&(d=r.leading,g="maxWait"in r&&ro(+r.maxWait||0,t),v="trailing"in r?r.trailing:v);return o.cancel=function(){s&&Mu(s),f&&Mu(f),f=s=p=I},o}function qe(){var n=arguments,r=n.length-1; -if(0>r)return function(){};if(!t(n,Je))throw new Iu(V);return function(){for(var t=r,e=n[t].apply(this,arguments);t--;)e=n[t].call(this,e);return e}}function Pe(n,t){function r(){var e=r.cache,u=t?t.apply(this,arguments):arguments[0];if(e.has(u))return e.get(u);var o=n.apply(this,arguments);return e.set(u,o),o}if(!Je(n)||t&&!Je(t))throw new Iu(V);return r.cache=new Pe.Cache,r}function Ke(n){var t=me(arguments,1),r=A(t,Ke.placeholder);return Yr(n,F,null,t,r)}function Ve(n){var t=me(arguments,1),r=A(t,Ve.placeholder); -return Yr(n,U,null,t,r)}function Ye(n){return ue(w(n)?n.length:I)&&Uu.call(n)==_t||false}function Ze(n){return n&&1===n.nodeType&&w(n)&&-1t||null==n||!no(t))return r;n+="";do t%2&&(r+=n),t=qu(t/2),n+=n;while(t);return r}function lu(n,t,r){var e=n;return(n=pe(n))?(r?ee(e,t,r):null==t)?n.slice(j(n),E(n)+1):(t+="",n.slice(p(n,t),h(n,t)+1)):n}function cu(n,t,r){return r&&ee(n,t,r)&&(t=null),n=pe(n),n.match(t||vt)||[]}function su(n){try{return n()}catch(t){return Ge(t)?t:wu(t)}}function pu(n,t,r){return r&&ee(n,t,r)&&(t=null),tr(n,t) -}function hu(n){return function(){return n}}function gu(n){return n}function vu(n){return xr(n,true)}function du(n,t,r){if(null==r){var e=Xe(t),u=e&&No(t);((u=u&&u.length&&dr(t,u))?u.length:e)||(u=false,r=t,t=n,n=this)}u||(u=dr(t,No(t)));var o=true,e=-1,i=Je(n),f=u.length;false===r?o=false:Xe(r)&&"chain"in r&&(o=r.chain);for(;++e>>1,ho=Hu?Hu.BYTES_PER_ELEMENT:0,go=Au.pow(2,53)-1,vo=Xu&&new Xu,yo=Dt.support={};!function(n){yo.funcDecomp=!He(x.WinRTError)&&ht.test(k),yo.funcNames=typeof xu.name=="string";try{yo.dom=11===Su.createDocumentFragment().nodeType}catch(t){yo.dom=false -}try{yo.nonEnumArgs=!Vu.call(arguments,1)}catch(r){yo.nonEnumArgs=true}}(0,0),Dt.templateSettings={escape:tt,evaluate:rt,interpolate:et,variable:"",imports:{_:Dt}};var _o=function(){function n(){}return function(t){if(Xe(t)){n.prototype=t;var r=new n;n.prototype=null}return r||x.Object()}}(),mo=vo?function(n,t){return vo.set(n,t),n}:gu;zu||(Nr=Bu&&Ju?function(n){var t=n.byteLength,r=Hu?qu(t/ho):0,e=r*ho,u=new Bu(t);if(r){var o=new Hu(u,0,r);o.set(new Hu(n,0,r))}return t!=e&&(o=new Ju(u,e),o.set(new Ju(n,e))),u -}:hu(null));var bo=Yu?function(n){return new Kt(n)}:hu(null),wo=vo?function(n){return vo.get(n)}:yu,xo=function(){var n=0,t=0;return function(r,e){var u=Oo(),o=M-(u-t);if(t=u,0=D)return r}else n=0;return mo(r,e)}}(),Ao=$r(function(n,t,r){Nu.call(n,r)?++n[r]:n[r]=1}),jo=$r(function(n,t,r){Nu.call(n,r)?n[r].push(t):n[r]=[t]}),Eo=$r(function(n,t,r){n[r]=t}),Ro=qr(Gt),ko=qr(function(n){for(var t=-1,r=n.length,e=lo;++t--n?t.apply(this,arguments):void 0}},Dt.ary=function(n,t,r){return r&&ee(n,t,r)&&(t=null),t=null==t?n.length:+t||0,Yr(n,$,null,null,null,null,t) -},Dt.assign=Wo,Dt.at=function(n){return ue(n?n.length:0)&&(n=ce(n)),nr(n,cr(arguments,false,false,1))},Dt.before=Le,Dt.bind=$e,Dt.bindAll=function(n){for(var t=n,r=1(s?Yt(s,i):u(c,i))){for(t=r;--t;){var p=e[t];if(0>(p?Yt(p,i):u(n[t],i)))continue n}s&&s.push(i),c.push(i)}return c},Dt.invert=function(n,t,r){r&&ee(n,t,r)&&(t=null),r=-1;for(var e=No(n),u=e.length,o={};++rt?0:t)},Dt.takeRight=function(n,t,r){return(r?ee(n,t,r):null==t)&&(t=1),t=n?n.length-(+t||0):0,me(n,0>t?0:t)},Dt.takeRightWhile=function(n,t,r){var e=n?n.length:0;for(t=Hr(t,r,3);e--&&t(n[e],e,n););return me(n,e+1)},Dt.takeWhile=function(n,t,r){var e=-1,u=n?n.length:0;for(t=Hr(t,r,3);++en||!no(n))return[];var e=-1,u=mu(eo(n,co));for(t=Wr(t,r,1);++er?0:+r||0,e))-t.length,0<=r&&n.indexOf(t,r)==r},Dt.escape=function(n){return(n=pe(n))&&nt.test(n)?n.replace(H,y):n},Dt.escapeRegExp=iu,Dt.every=Re,Dt.find=Ie,Dt.findIndex=ve,Dt.findKey=function(n,t,r){return t=Hr(t,r,3),lr(n,t,gr,true)},Dt.findLast=function(n,t,r){return t=Hr(t,r,3),lr(n,t,ir)},Dt.findLastIndex=function(n,t,r){var e=n?n.length:0; -for(t=Hr(t,r,3);e--;)if(t(n[e],e,n))return e;return-1},Dt.findLastKey=function(n,t,r){return t=Hr(t,r,3),lr(n,t,vr,true)},Dt.findWhere=function(n,t){return Ie(n,vu(t))},Dt.first=de,Dt.has=function(n,t){return n?Nu.call(n,t):false},Dt.identity=gu,Dt.includes=Ee,Dt.indexOf=ye,Dt.isArguments=Ye,Dt.isArray=Co,Dt.isBoolean=function(n){return true===n||false===n||w(n)&&Uu.call(n)==bt||false},Dt.isDate=function(n){return w(n)&&Uu.call(n)==wt||false},Dt.isElement=Ze,Dt.isEmpty=function(n){if(null==n)return true;var t=n.length; -return ue(t)&&(Co(n)||tu(n)||Ye(n)||w(n)&&Je(n.splice))?!t:!No(n).length},Dt.isEqual=function(n,t,r,e){return r=typeof r=="function"&&Wr(r,e,3),!r&&oe(n)&&oe(t)?n===t:(e=r?r(n,t):I,typeof e=="undefined"?_r(n,t,r):!!e)},Dt.isError=Ge,Dt.isFinite=So,Dt.isFunction=Je,Dt.isMatch=function(n,t,r,e){var u=No(t),o=u.length;if(r=typeof r=="function"&&Wr(r,e,3),!r&&1==o){var i=u[0];if(e=t[i],oe(e))return null!=n&&e===n[i]&&Nu.call(n,i)}for(var i=mu(o),f=mu(o);o--;)e=i[o]=t[u[o]],f[o]=oe(e);return br(n,u,i,f,r) -},Dt.isNaN=function(n){return Qe(n)&&n!=+n},Dt.isNative=He,Dt.isNull=function(n){return null===n},Dt.isNumber=Qe,Dt.isObject=Xe,Dt.isPlainObject=To,Dt.isRegExp=nu,Dt.isString=tu,Dt.isUndefined=function(n){return typeof n=="undefined"},Dt.kebabCase=Lo,Dt.last=function(n){var t=n?n.length:0;return t?n[t-1]:I},Dt.lastIndexOf=function(n,t,r){var e=n?n.length:0;if(!e)return-1;var u=e;if(typeof r=="number")u=(0>r?ro(e+r,0):eo(r||0,e-1))+1;else if(r)return u=Sr(n,t,true)-1,n=n[u],(t===t?t===n:n!==n)?u:-1;if(t!==t)return m(n,u,true); -for(;u--;)if(n[u]===t)return u;return-1},Dt.max=Ro,Dt.min=ko,Dt.noConflict=function(){return x._=Lu,this},Dt.noop=yu,Dt.now=Oo,Dt.pad=function(n,t,r){n=pe(n),t=+t;var e=n.length;return er?0:+r||0,n.length),n.lastIndexOf(t,r)==r -},Dt.template=function(n,t,r){var e=Dt.templateSettings;r&&ee(n,t,r)&&(t=r=null),n=pe(n),t=Qt(Qt({},r||t),e,Ht),r=Qt(Qt({},t.imports),e.imports,Ht);var u,o,i=No(r),f=Or(r,i),a=0;r=t.interpolate||ct;var l="__p+='";r=Ru((t.escape||ct).source+"|"+r.source+"|"+(r===et?ut:ct).source+"|"+(t.evaluate||ct).source+"|$","g");var c="sourceURL"in t?"//# sourceURL="+t.sourceURL+"\n":"";if(n.replace(r,function(t,r,e,i,f,c){return e||(e=i),l+=n.slice(a,c).replace(gt,_),r&&(u=true,l+="'+__e("+r+")+'"),f&&(o=true,l+="';"+f+";\n__p+='"),e&&(l+="'+((__t=("+e+"))==null?'':__t)+'"),a=c+t.length,t -}),l+="';",(t=t.variable)||(l="with(obj){"+l+"}"),l=(o?l.replace(Z,""):l).replace(G,"$1").replace(J,"$1;"),l="function("+(t||"obj")+"){"+(t?"":"obj||(obj={});")+"var __t,__p=''"+(u?",__e=_.escape":"")+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}",t=su(function(){return xu(i,c+"return "+l).apply(I,f)}),t.source=l,Ge(t))throw t;return t},Dt.trim=lu,Dt.trimLeft=function(n,t,r){var e=n;return(n=pe(n))?n.slice((r?ee(e,t,r):null==t)?j(n):p(n,t+"")):n},Dt.trimRight=function(n,t,r){var e=n; -return(n=pe(n))?(r?ee(e,t,r):null==t)?n.slice(0,E(n)+1):n.slice(0,h(n,t+"")+1):n},Dt.trunc=function(n,t,r){r&&ee(n,t,r)&&(t=null);var e=B;if(r=z,null!=t)if(Xe(t)){var u="separator"in t?t.separator:u,e="length"in t?+t.length||0:e;r="omission"in t?t.omission+"":r}else e=+t||0;if(n=pe(n),e>=n.length)return n;if(e-=r.length,1>e)return r;if(t=n.slice(0,e),null==u)return t+r;if(nu(u)){if(n.slice(e).search(u)){var o,i=n.slice(0,e);for(u.global||(u=Ru(u.source,(ot.exec(u)||"")+"g")),u.lastIndex=0;n=u.exec(i);)o=n.index; -t=t.slice(0,null==o?e:o)}}else n.indexOf(u,e)!=e&&(u=t.lastIndexOf(u),-1u.dir,i.push({iteratee:n,type:t}),u}}),n(["drop","take"],function(n,t){var r=n+"Count",e=n+"While";qt.prototype[n]=function(e){e=null==e?1:ro(+e||0,0);var u=this.clone();if(u.filtered){var o=u[r]; -u[r]=t?eo(o,e):o+e}else(u.views||(u.views=[])).push({size:e,type:n+(0>u.dir?"Right":"")});return u},qt.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()},qt.prototype[n+"RightWhile"]=function(n,t){return this.reverse()[e](n,t).reverse()}}),n(["first","last"],function(n,t){var r="take"+(t?"Right":"");qt.prototype[n]=function(){return this[r](1).value()[0]}}),n(["initial","rest"],function(n,t){var r="drop"+(t?"":"Right");qt.prototype[n]=function(){return this[r](1)}}),n(["pluck","where"],function(n,t){var r=t?"filter":"map",e=t?vu:_u; -qt.prototype[n]=function(n){return this[r](e(n))}}),qt.prototype.dropWhile=function(n,t){n=Hr(n,t,3);var r,e,u=0>this.dir;return this.filter(function(t,o,i){return r=r&&(u?oe),e=o,r||(r=!n(t,o,i))})},qt.prototype.reject=function(n,t){return n=Hr(n,t,3),this.filter(function(t,r,e){return!n(t,r,e)})},qt.prototype.slice=function(n,t){n=null==n?0:+n||0;var r=0>n?this.takeRight(-n):this.drop(n);return typeof t!="undefined"&&(t=+t||0,r=0>t?r.dropRight(-t):r.take(t-n)),r},gr(qt.prototype,function(n,t){var r=/^(?:first|last)$/.test(t); -Dt.prototype[t]=function(){function e(n){return n=[n],Ku.apply(n,o),Dt[t].apply(Dt,n)}var u=this.__wrapped__,o=arguments,i=this.__chain__,f=!!this.__actions__.length,a=u instanceof qt,l=a&&!f;return r&&!i?l?n.call(u):Dt[t](this.value()):a||Co(u)?(u=n.apply(l?u:new qt(this),o),r||!f&&!u.actions||(u.actions||(u.actions=[])).push({func:je,args:[e],thisArg:Dt}),new Mt(u,i)):this.thru(e)}}),n("concat join pop push shift sort splice unshift".split(" "),function(n){var t=Ou[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:join|pop|shift)$/.test(n); -Dt.prototype[n]=function(){var n=arguments;return e&&!this.__chain__?t.apply(this.value(),n):this[r](function(r){return t.apply(r,n)})}}),qt.prototype.clone=function(){var n=this.actions,t=this.iteratees,r=this.views,e=new qt(this.wrapped);return e.actions=n?l(n):null,e.dir=this.dir,e.dropCount=this.dropCount,e.filtered=this.filtered,e.iteratees=t?l(t):null,e.takeCount=this.takeCount,e.views=r?l(r):null,e},qt.prototype.reverse=function(){var n=this.filtered,t=n?new qt(this):this.clone();return t.dir=-1*this.dir,t.filtered=n,t -},qt.prototype.value=function(){var n=this.wrapped.value();if(!Co(n))return Cr(n,this.actions);var t,r=this.dir,e=0>r,u=n.length;t=u;for(var o=this.views,i=0,f=-1,a=o?o.length:0;++f"'`]/g,Q=RegExp(X.source),nt=RegExp(H.source),tt=/<%-([\s\S]+?)%>/g,rt=/<%([\s\S]+?)%>/g,et=/<%=([\s\S]+?)%>/g,ut=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ot=/\w*$/,it=/^\s*function[ \n\r\t]+\w/,ft=/^0[xX]/,at=/^\[object .+?Constructor\]$/,lt=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,ct=/($^)/,st=/[.*+?^${}()|[\]\/\\]/g,pt=RegExp(st.source),ht=/\bthis\b/,gt=/['\n\r\u2028\u2029\\]/g,vt=RegExp("[A-Z\\xc0-\\xd6\\xd8-\\xde]{2,}(?=[A-Z\\xc0-\\xd6\\xd8-\\xde][a-z\\xdf-\\xf6\\xf8-\\xff]+)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+|[A-Z\\xc0-\\xd6\\xd8-\\xde]+|[0-9]+","g"),dt=" \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",yt="Array ArrayBuffer Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Math Number Object RegExp Set String _ clearTimeout document isFinite parseInt setTimeout TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap window WinRTError".split(" "),_t="[object Arguments]",mt="[object Array]",bt="[object Boolean]",wt="[object Date]",xt="[object Error]",At="[object Function]",jt="[object Number]",Et="[object Object]",Rt="[object RegExp]",kt="[object String]",It="[object ArrayBuffer]",Ot="[object Float32Array]",Ct="[object Float64Array]",St="[object Int8Array]",Tt="[object Int16Array]",Wt="[object Int32Array]",Nt="[object Uint8Array]",Ft="[object Uint8ClampedArray]",Ut="[object Uint16Array]",Lt="[object Uint32Array]",$t={}; -$t[_t]=$t[mt]=$t[Ot]=$t[Ct]=$t[St]=$t[Tt]=$t[Wt]=$t[Nt]=$t[Ft]=$t[Ut]=$t[Lt]=true,$t[It]=$t[bt]=$t[wt]=$t[xt]=$t[At]=$t["[object Map]"]=$t[jt]=$t[Et]=$t[Rt]=$t["[object Set]"]=$t[kt]=$t["[object WeakMap]"]=false;var Bt={};Bt[_t]=Bt[mt]=Bt[It]=Bt[bt]=Bt[wt]=Bt[Ot]=Bt[Ct]=Bt[St]=Bt[Tt]=Bt[Wt]=Bt[jt]=Bt[Et]=Bt[Rt]=Bt[kt]=Bt[Nt]=Bt[Ft]=Bt[Ut]=Bt[Lt]=true,Bt[xt]=Bt[At]=Bt["[object Map]"]=Bt["[object Set]"]=Bt["[object WeakMap]"]=false;var zt={leading:false,maxWait:0,trailing:false},Dt={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss"},Mt={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},qt={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Pt={"function":true,object:true},Kt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Vt=Pt[typeof window]&&window!==(this&&this.window)?window:this,Yt=Pt[typeof exports]&&exports&&!exports.nodeType&&exports,Zt=Pt[typeof module]&&module&&!module.nodeType&&module,Gt=Yt&&Zt&&typeof global=="object"&&global; -!Gt||Gt.global!==Gt&&Gt.window!==Gt&&Gt.self!==Gt||(Vt=Gt);var Jt=Zt&&Zt.exports===Yt&&Yt,Xt=k();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Vt._=Xt, define(function(){return Xt})):Yt&&Zt?Jt?(Zt.exports=Xt)._=Xt:Yt._=Xt:Vt._=Xt}).call(this); \ No newline at end of file +;(function(){function n(n,t){if(n!==t){var r=n===n,e=t===t;if(n>t||!r||typeof n=="undefined"&&e)return 1;if(n=n&&9<=n&&13>=n||32==n||160==n||5760==n||6158==n||8192<=n&&(8202>=n||8232==n||8233==n||8239==n||8287==n||12288==n||65279==n) +}function v(n,t){for(var r=-1,e=n.length,u=-1,o=[];++re&&(e=u)}return e}function Zt(n,t,r,e){var u=-1,o=n.length;for(e&&o&&(r=n[++u]);++ui(r,a)&&u.push(a); +return u}function or(n,t){var r=n?n.length:0;if(!oe(r))return gr(n,t);for(var e=-1,u=pe(n);++et&&(t=-t>u?0:u+t),r=typeof r=="undefined"||r>u?u:+r||0,0>r&&(r+=u),u=t>r?0:r-t,r=mu(u);++eu(a,s)&&((r||f)&&a.push(s),c.push(l)) +}return c}function Cr(n,t){for(var r=-1,e=t.length,u=mu(e);++r>>1,i=n[o];(r?i<=t:it||null==r)return r; +if(3=o&&f<=i&&(e=O&&t>u||e>u&&t>=O)||o)&&(t&x&&(r[2]=p[2],f|=e&x?0:j),(e=p[3])&&(u=r[3],r[3]=u?Ur(u,e,p[4]):Mt(e),r[4]=u?v(r[3],B):Mt(p[4])),(e=p[5])&&(u=r[5],r[5]=u?Lr(u,e,p[6]):Mt(e),r[6]=u?v(r[5],B):Mt(p[6])),(e=p[7])&&(r[7]=Mt(e)),t&C&&(r[8]=null==r[8]?p[8]:eo(r[8],p[8])),null==r[9]&&(r[9]=p[9]),r[0]=p[0],r[1]=f),t=r[1],f=r[9] +}return r[9]=null==f?a?0:n.length:ro(f-c,0)||0,(p?mo:xo)(t==x?zr(r[0],r[2]):t!=k&&t!=(x|k)||r[4].length?Pr.apply(null,r):Vr.apply(null,r),r)}function Zr(n,t,r,e,u,o,i){var f=-1,a=n.length,c=t.length,l=true;if(a!=c&&(!u||c<=a))return false;for(;l&&++fu)||i===e&&i===o)&&(u=i,o=n)}),o}function Hr(n,t,r){var e=Wt.callback||pu,e=e===pu?tr:e;return r?e(n,t,r):e}function Qr(n,r,e){var u=Wt.indexOf||_e,u=u===_e?t:u;return n?u(n,r,e):u}function ne(n){var t=n.length,r=new n.constructor(t);return t&&"string"==typeof n[0]&&Nu.call(n,"index")&&(r.index=n.index,r.input=n.input),r}function te(n){return n=n.constructor,typeof n=="function"&&n instanceof n||(n=Eu),new n +}function re(n,t,r){var e=n.constructor;switch(t){case lt:var u=new e;return u.length=n.length,Mt(n,u);case bt:return Fr(n);case pt:case ht:return new e(+n);case wt:case xt:case At:case jt:case Et:case Rt:case kt:case It:case Ot:return t=n.buffer,new e(r?Fr(t):t,n.byteOffset,n.length);case dt:case mt:return new e(n);case _t:u=new e(n.source,X.exec(n)),u.lastIndex=n.lastIndex}return u}function ee(n){return h(n)&&oe(n.length)&&Ct[Uu.call(n)]||false}function ue(n,t,r){if(!Xe(r))return false;var e=typeof t; +return"number"==e?(e=r.length,e=oe(e)&&p(t,e)):e="string"==e,e&&r[t]===n}function oe(n){return typeof n=="number"&&-1t?0:t)):[] +}function ve(n,t,r){var e=n?n.length:0;return e?((r?ue(n,t,r):null==t)&&(t=1),t=e-(+t||0),kr(n,0,0>t?0:t)):[]}function de(n,t,r){var e=-1,u=n?n.length:0;for(t=Hr(t,r,3);++ee?ro(u+e,0):e||0;else if(e)return e=Tr(n,r),n=n[e],(r===r?r===n:n!==n)?e:-1;return t(n,r,e)}function me(n){return ge(n,1)}function be(n,r,e,u){if(!n||!n.length)return[];typeof r!="boolean"&&null!=r&&(u=e,e=ue(n,r,u)?null:r,r=false); +var o=Hr();if((o!==tr||null!=e)&&(e=o(e,u,3)),r&&Qr()==t){r=e;var i;e=-1,u=n.length;for(var o=-1,f=[];++e>>0,e=mu(r);++tr?ro(e+r,0):r||0:0,typeof n=="string"||!Co(n)&&tu(n)?rarguments.length,or)}function We(n,t,r,e){return(Co(n)?Gt:Rr)(n,Hr(t,e,4),r,3>arguments.length,ir)}function Ne(n,t,r){return(r?ue(n,t,r):null==t)?(n=se(n),t=n.length,0t?0:+t||0,n.length),n)}function Fe(n){n=se(n); +for(var t=-1,r=n.length,e=mu(r);++t=r||r>t?(f&&Mu(f),r=p,f=s=p=b,r&&(h=Oo(),a=n.apply(l,i),s||f||(i=l=null))):s=Zu(e,r)}function u(){s&&Mu(s),f=s=p=b,(v||g!==t)&&(h=Oo(),a=n.apply(l,i),s||f||(i=l=null))}function o(){if(i=arguments,c=Oo(),l=this,p=v&&(s||!d),false===g)var r=d&&!s; +else{f||d||(h=c);var o=g-(c-h),y=0>=o||o>g;y?(f&&(f=Mu(f)),h=c,a=n.apply(l,i)):f||(f=Zu(u,o))}return y&&s?s=Mu(s):s||t===g||(s=Zu(e,t)),r&&(y=true,a=n.apply(l,i)),!y||s||f||(i=l=null),a}var i,f,a,c,l,s,p,h=0,g=false,v=true;if(!Je(n))throw new Iu($);if(t=0>t?0:t,true===r)var d=true,v=false;else Xe(r)&&(d=r.leading,g="maxWait"in r&&ro(+r.maxWait||0,t),v="trailing"in r?r.trailing:v);return o.cancel=function(){s&&Mu(s),f&&Mu(f),f=s=p=b},o}function qe(){var n=arguments,t=n.length-1;if(0>t)return function(){};if(!Pt(n,Je))throw new Iu($); +return function(){for(var r=t,e=n[r].apply(this,arguments);r--;)e=n[r].call(this,e);return e}}function Pe(n,t){function r(){var e=r.cache,u=t?t.apply(this,arguments):arguments[0];if(e.has(u))return e.get(u);var o=n.apply(this,arguments);return e.set(u,o),o}if(!Je(n)||t&&!Je(t))throw new Iu($);return r.cache=new Pe.Cache,r}function Ke(n){var t=kr(arguments,1),r=v(t,Ke.placeholder);return Yr(n,k,null,t,r)}function Ve(n){var t=kr(arguments,1),r=v(t,Ve.placeholder);return Yr(n,I,null,t,r)}function Ye(n){return oe(h(n)?n.length:b)&&Uu.call(n)==lt||false +}function Ze(n){return n&&1===n.nodeType&&h(n)&&-1t||null==n||!no(t))return r;n+="";do t%2&&(r+=n),t=qu(t/2),n+=n;while(t);return r}function cu(n,t,r){var e=n;return(n=he(n))?(r?ue(e,t,r):null==t)?n.slice(d(n),y(n)+1):(t+="",n.slice(u(n,t),o(n,t)+1)):n}function lu(n,t,r){return r&&ue(n,t,r)&&(t=null),n=he(n),n.match(t||ft)||[]}function su(n){try{return n()}catch(t){return Ge(t)?t:wu(t)}}function pu(n,t,r){return r&&ue(n,t,r)&&(t=null),tr(n,t)}function hu(n){return function(){return n}}function gu(n){return n}function vu(n){return xr(n,true) +}function du(n,t,r){if(null==r){var e=Xe(t),u=e&&No(t);((u=u&&u.length&&dr(t,u))?u.length:e)||(u=false,r=t,t=n,n=this)}u||(u=dr(t,No(t)));var o=true,e=-1,i=Je(n),f=u.length;false===r?o=false:Xe(r)&&"chain"in r&&(o=r.chain);for(;++e>>1,ho=Hu?Hu.BYTES_PER_ELEMENT:0,go=Au.pow(2,53)-1,vo=Xu&&new Xu,yo=Wt.support={};!function(n){yo.funcDecomp=!He(g.WinRTError)&&ot.test(m),yo.funcNames=typeof xu.name=="string";try{yo.dom=11===Su.createDocumentFragment().nodeType}catch(t){yo.dom=false +}try{yo.nonEnumArgs=!Vu.call(arguments,1)}catch(r){yo.nonEnumArgs=true}}(0,0),Wt.templateSettings={escape:Y,evaluate:Z,interpolate:G,variable:"",imports:{_:Wt}};var _o=function(){function n(){}return function(t){if(Xe(t)){n.prototype=t;var r=new n;n.prototype=null}return r||g.Object()}}(),mo=vo?function(n,t){return vo.set(n,t),n}:gu;zu||(Fr=Bu&&Ju?function(n){var t=n.byteLength,r=Hu?qu(t/ho):0,e=r*ho,u=new Bu(t);if(r){var o=new Hu(u,0,r);o.set(new Hu(n,0,r))}return t!=e&&(o=new Ju(u,e),o.set(new Ju(n,e))),u +}:hu(null));var bo=Yu?function(n){return new Lt(n)}:hu(null),wo=vo?function(n){return vo.get(n)}:yu,xo=function(){var n=0,t=0;return function(r,e){var u=Oo(),o=N-(u-t);if(t=u,0=W)return r}else n=0;return mo(r,e)}}(),Ao=$r(function(n,t,r){Nu.call(n,r)?++n[r]:n[r]=1}),jo=$r(function(n,t,r){Nu.call(n,r)?n[r].push(t):n[r]=[t]}),Eo=$r(function(n,t,r){n[r]=t}),Ro=qr(Yt),ko=qr(function(n){for(var t=-1,r=n.length,e=co;++t--n?t.apply(this,arguments):void 0}},Wt.ary=function(n,t,r){return r&&ue(n,t,r)&&(t=null),t=null==t?n.length:+t||0,Yr(n,C,null,null,null,null,t) +},Wt.assign=Wo,Wt.at=function(n){return oe(n?n.length:0)&&(n=se(n)),nr(n,lr(arguments,false,false,1))},Wt.before=Le,Wt.bind=$e,Wt.bindAll=function(n){for(var t=n,r=1(s?Bt(s,f):o(l,f))){for(r=e;--r;){var p=u[r];if(0>(p?Bt(p,f):o(n[r],f)))continue n}s&&s.push(f),l.push(f)}return l},Wt.invert=function(n,t,r){r&&ue(n,t,r)&&(t=null),r=-1; +for(var e=No(n),u=e.length,o={};++rt?0:t)):[]},Wt.takeRight=function(n,t,r){var e=n?n.length:0; +return e?((r?ue(n,t,r):null==t)&&(t=1),t=e-(+t||0),kr(n,0>t?0:t)):[]},Wt.takeRightWhile=function(n,t,r){var e=n?n.length:0;if(!e)return[];for(t=Hr(t,r,3);e--&&t(n[e],e,n););return kr(n,e+1)},Wt.takeWhile=function(n,t,r){var e=n?n.length:0;if(!e)return[];var u=-1;for(t=Hr(t,r,3);++un||!no(n))return[];var e=-1,u=mu(eo(n,lo));for(t=Nr(t,r,1);++er?0:+r||0,e))-t.length,0<=r&&n.indexOf(t,r)==r},Wt.escape=function(n){return(n=he(n))&&V.test(n)?n.replace(P,c):n},Wt.escapeRegExp=iu,Wt.every=Re,Wt.find=Ie,Wt.findIndex=de,Wt.findKey=function(n,t,r){return t=Hr(t,r,3),cr(n,t,gr,true) +},Wt.findLast=function(n,t,r){return t=Hr(t,r,3),cr(n,t,ir)},Wt.findLastIndex=function(n,t,r){var e=n?n.length:0;for(t=Hr(t,r,3);e--;)if(t(n[e],e,n))return e;return-1},Wt.findLastKey=function(n,t,r){return t=Hr(t,r,3),cr(n,t,vr,true)},Wt.findWhere=function(n,t){return Ie(n,vu(t))},Wt.first=ye,Wt.has=function(n,t){return n?Nu.call(n,t):false},Wt.identity=gu,Wt.includes=Ee,Wt.indexOf=_e,Wt.isArguments=Ye,Wt.isArray=Co,Wt.isBoolean=function(n){return true===n||false===n||h(n)&&Uu.call(n)==pt||false},Wt.isDate=function(n){return h(n)&&Uu.call(n)==ht||false +},Wt.isElement=Ze,Wt.isEmpty=function(n){if(null==n)return true;var t=n.length;return oe(t)&&(Co(n)||tu(n)||Ye(n)||h(n)&&Je(n.splice))?!t:!No(n).length},Wt.isEqual=function(n,t,r,e){return r=typeof r=="function"&&Nr(r,e,3),!r&&ie(n)&&ie(t)?n===t:(e=r?r(n,t):b,typeof e=="undefined"?_r(n,t,r):!!e)},Wt.isError=Ge,Wt.isFinite=So,Wt.isFunction=Je,Wt.isMatch=function(n,t,r,e){var u=No(t),o=u.length;if(r=typeof r=="function"&&Nr(r,e,3),!r&&1==o){var i=u[0];if(e=t[i],ie(e))return null!=n&&e===n[i]&&Nu.call(n,i) +}for(var i=mu(o),f=mu(o);o--;)e=i[o]=t[u[o]],f[o]=ie(e);return br(n,u,i,f,r)},Wt.isNaN=function(n){return Qe(n)&&n!=+n},Wt.isNative=He,Wt.isNull=function(n){return null===n},Wt.isNumber=Qe,Wt.isObject=Xe,Wt.isPlainObject=To,Wt.isRegExp=nu,Wt.isString=tu,Wt.isUndefined=function(n){return typeof n=="undefined"},Wt.kebabCase=Lo,Wt.last=function(n){var t=n?n.length:0;return t?n[t-1]:b},Wt.lastIndexOf=function(n,t,r){var e=n?n.length:0;if(!e)return-1;var u=e;if(typeof r=="number")u=(0>r?ro(e+r,0):eo(r||0,e-1))+1; +else if(r)return u=Tr(n,t,true)-1,n=n[u],(t===t?t===n:n!==n)?u:-1;if(t!==t)return s(n,u,true);for(;u--;)if(n[u]===t)return u;return-1},Wt.max=Ro,Wt.min=ko,Wt.noConflict=function(){return g._=Lu,this},Wt.noop=yu,Wt.now=Oo,Wt.pad=function(n,t,r){n=he(n),t=+t;var e=n.length;return er?0:+r||0,n.length),n.lastIndexOf(t,r)==r},Wt.template=function(n,t,r){var e=Wt.templateSettings;r&&ue(n,t,r)&&(t=r=null),n=he(n),t=Qt(Qt({},r||t),e,Ht),r=Qt(Qt({},t.imports),e.imports,Ht);var u,o,i=No(r),f=Cr(r,i),a=0;r=t.interpolate||rt;var c="__p+='";r=Ru((t.escape||rt).source+"|"+r.source+"|"+(r===G?J:rt).source+"|"+(t.evaluate||rt).source+"|$","g"); +var s="sourceURL"in t?"//# sourceURL="+t.sourceURL+"\n":"";if(n.replace(r,function(t,r,e,i,f,s){return e||(e=i),c+=n.slice(a,s).replace(it,l),r&&(u=true,c+="'+__e("+r+")+'"),f&&(o=true,c+="';"+f+";\n__p+='"),e&&(c+="'+((__t=("+e+"))==null?'':__t)+'"),a=s+t.length,t}),c+="';",(t=t.variable)||(c="with(obj){"+c+"}"),c=(o?c.replace(z,""):c).replace(D,"$1").replace(M,"$1;"),c="function("+(t||"obj")+"){"+(t?"":"obj||(obj={});")+"var __t,__p=''"+(u?",__e=_.escape":"")+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+c+"return __p}",t=su(function(){return xu(i,s+"return "+c).apply(b,f) +}),t.source=c,Ge(t))throw t;return t},Wt.trim=cu,Wt.trimLeft=function(n,t,r){var e=n;return(n=he(n))?n.slice((r?ue(e,t,r):null==t)?d(n):u(n,t+"")):n},Wt.trimRight=function(n,t,r){var e=n;return(n=he(n))?(r?ue(e,t,r):null==t)?n.slice(0,y(n)+1):n.slice(0,o(n,t+"")+1):n},Wt.trunc=function(n,t,r){r&&ue(n,t,r)&&(t=null);var e=S;if(r=T,null!=t)if(Xe(t)){var u="separator"in t?t.separator:u,e="length"in t?+t.length||0:e;r="omission"in t?t.omission+"":r}else e=+t||0;if(n=he(n),e>=n.length)return n;if(e-=r.length,1>e)return r; +if(t=n.slice(0,e),null==u)return t+r;if(nu(u)){if(n.slice(e).search(u)){var o,i=n.slice(0,e);for(u.global||(u=Ru(u.source,(X.exec(u)||"")+"g")),u.lastIndex=0;n=u.exec(i);)o=n.index;t=t.slice(0,null==o?e:o)}}else n.indexOf(u,e)!=e&&(u=t.lastIndexOf(u),-1u.dir,i.push({iteratee:n,type:t}),u +}}),qt(["drop","take"],function(n,t){var r=n+"Count",e=n+"While";Ft.prototype[n]=function(e){e=null==e?1:ro(+e||0,0);var u=this.clone();if(u.filtered){var o=u[r];u[r]=t?eo(o,e):o+e}else(u.views||(u.views=[])).push({size:e,type:n+(0>u.dir?"Right":"")});return u},Ft.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()},Ft.prototype[n+"RightWhile"]=function(n,t){return this.reverse()[e](n,t).reverse()}}),qt(["first","last"],function(n,t){var r="take"+(t?"Right":"");Ft.prototype[n]=function(){return this[r](1).value()[0] +}}),qt(["initial","rest"],function(n,t){var r="drop"+(t?"":"Right");Ft.prototype[n]=function(){return this[r](1)}}),qt(["pluck","where"],function(n,t){var r=t?"filter":"map",e=t?vu:_u;Ft.prototype[n]=function(n){return this[r](e(n))}}),Ft.prototype.dropWhile=function(n,t){n=Hr(n,t,3);var r,e,u=0>this.dir;return this.filter(function(t,o,i){return r=r&&(u?oe),e=o,r||(r=!n(t,o,i))})},Ft.prototype.reject=function(n,t){return n=Hr(n,t,3),this.filter(function(t,r,e){return!n(t,r,e)})},Ft.prototype.slice=function(n,t){n=null==n?0:+n||0; +var r=0>n?this.takeRight(-n):this.drop(n);return typeof t!="undefined"&&(t=+t||0,r=0>t?r.dropRight(-t):r.take(t-n)),r},gr(Ft.prototype,function(n,t){var r=/^(?:first|last)$/.test(t);Wt.prototype[t]=function(){function e(n){return n=[n],Ku.apply(n,o),Wt[t].apply(Wt,n)}var u=this.__wrapped__,o=arguments,i=this.__chain__,f=!!this.__actions__.length,a=u instanceof Ft,c=a&&!f;return r&&!i?c?n.call(u):Wt[t](this.value()):a||Co(u)?(u=n.apply(c?u:new Ft(this),o),r||!f&&!u.actions||(u.actions||(u.actions=[])).push({func:je,args:[e],thisArg:Wt}),new Nt(u,i)):this.thru(e) +}}),qt("concat join pop push shift sort splice unshift".split(" "),function(n){var t=Ou[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:join|pop|shift)$/.test(n);Wt.prototype[n]=function(){var n=arguments;return e&&!this.__chain__?t.apply(this.value(),n):this[r](function(r){return t.apply(r,n)})}}),Ft.prototype.clone=function(){var n=this.actions,t=this.iteratees,r=this.views,e=new Ft(this.wrapped);return e.actions=n?Mt(n):null,e.dir=this.dir,e.dropCount=this.dropCount,e.filtered=this.filtered,e.iteratees=t?Mt(t):null,e.takeCount=this.takeCount,e.views=r?Mt(r):null,e +},Ft.prototype.reverse=function(){var n=this.filtered,t=n?new Ft(this):this.clone();return t.dir=-1*this.dir,t.filtered=n,t},Ft.prototype.value=function(){var n=this.wrapped.value();if(!Co(n))return Sr(n,this.actions);var t,r=this.dir,e=0>r,u=n.length;t=u;for(var o=this.views,i=0,f=-1,a=o?o.length:0;++f"'`]/g,K=RegExp(q.source),V=RegExp(P.source),Y=/<%-([\s\S]+?)%>/g,Z=/<%([\s\S]+?)%>/g,G=/<%=([\s\S]+?)%>/g,J=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,X=/\w*$/,H=/^\s*function[ \n\r\t]+\w/,Q=/^0[xX]/,nt=/^\[object .+?Constructor\]$/,tt=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,rt=/($^)/,et=/[.*+?^${}()|[\]\/\\]/g,ut=RegExp(et.source),ot=/\bthis\b/,it=/['\n\r\u2028\u2029\\]/g,ft=RegExp("[A-Z\\xc0-\\xd6\\xd8-\\xde]{2,}(?=[A-Z\\xc0-\\xd6\\xd8-\\xde][a-z\\xdf-\\xf6\\xf8-\\xff]+)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+|[A-Z\\xc0-\\xd6\\xd8-\\xde]+|[0-9]+","g"),at=" \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",ct="Array ArrayBuffer Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Math Number Object RegExp Set String _ clearTimeout document isFinite parseInt setTimeout TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap window WinRTError".split(" "),lt="[object Arguments]",st="[object Array]",pt="[object Boolean]",ht="[object Date]",gt="[object Error]",vt="[object Function]",dt="[object Number]",yt="[object Object]",_t="[object RegExp]",mt="[object String]",bt="[object ArrayBuffer]",wt="[object Float32Array]",xt="[object Float64Array]",At="[object Int8Array]",jt="[object Int16Array]",Et="[object Int32Array]",Rt="[object Uint8Array]",kt="[object Uint8ClampedArray]",It="[object Uint16Array]",Ot="[object Uint32Array]",Ct={}; +Ct[lt]=Ct[st]=Ct[wt]=Ct[xt]=Ct[At]=Ct[jt]=Ct[Et]=Ct[Rt]=Ct[kt]=Ct[It]=Ct[Ot]=true,Ct[bt]=Ct[pt]=Ct[ht]=Ct[gt]=Ct[vt]=Ct["[object Map]"]=Ct[dt]=Ct[yt]=Ct[_t]=Ct["[object Set]"]=Ct[mt]=Ct["[object WeakMap]"]=false;var St={};St[lt]=St[st]=St[bt]=St[pt]=St[ht]=St[wt]=St[xt]=St[At]=St[jt]=St[Et]=St[dt]=St[yt]=St[_t]=St[mt]=St[Rt]=St[kt]=St[It]=St[Ot]=true,St[gt]=St[vt]=St["[object Map]"]=St["[object Set]"]=St["[object WeakMap]"]=false;var Tt={leading:false,maxWait:0,trailing:false},Wt={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss"},Nt={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Ft={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Ut={"function":true,object:true},Lt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},$t=Ut[typeof window]&&window!==(this&&this.window)?window:this,Bt=Ut[typeof exports]&&exports&&!exports.nodeType&&exports,Ut=Ut[typeof module]&&module&&!module.nodeType&&module,zt=Bt&&Ut&&typeof global=="object"&&global; +!zt||zt.global!==zt&&zt.window!==zt&&zt.self!==zt||($t=zt);var zt=Ut&&Ut.exports===Bt&&Bt,Dt=m();typeof define=="function"&&typeof define.amd=="object"&&define.amd?($t._=Dt, define(function(){return Dt})):Bt&&Ut?zt?(Ut.exports=Dt)._=Dt:Bt._=Dt:$t._=Dt}).call(this); \ No newline at end of file