Add _.indexBy method and add a noop fallback for setBindData.

Former-commit-id: f8035b9a221ba7b625c21cb566c62931877da6ef
This commit is contained in:
John-David Dalton
2013-07-26 09:12:04 -07:00
parent e5b8e04dde
commit cf26447f7c
10 changed files with 498 additions and 292 deletions

View File

@@ -103,7 +103,7 @@
'compact': [],
'compose': [],
'contains': ['baseEach', 'getIndexOf', 'isString'],
'countBy': ['createCallback', 'forEach'],
'countBy': ['createAggregator'],
'createCallback': ['baseIsEqual', 'bind', 'identity', 'isObject', 'keys', 'setBindData'],
'debounce': ['isObject'],
'defaults': ['createCallback', 'createIterator'],
@@ -122,9 +122,10 @@
'forIn': ['createIterator'],
'forOwn': ['createIterator'],
'functions': ['forIn', 'isFunction'],
'groupBy': ['createCallback', 'forEach'],
'groupBy': ['createAggregator'],
'has': [],
'identity': [],
'indexBy': ['createAggregator'],
'indexOf': ['baseIndexOf', 'sortedIndex'],
'initial': ['createCallback', 'slice'],
'intersection': ['cacheIndexOf', 'createCache', 'getArray', 'getIndexOf', 'releaseArray', 'releaseObject'],
@@ -208,6 +209,7 @@
'cachePush': [],
'charAtCallback': [],
'compareAscending': [],
'createAggregator': ['createCallback', 'forEach'],
'createBound': ['createObject', 'isFunction', 'isObject', 'setBindData'],
'createCache': ['cachePush', 'getObject', 'releaseObject'],
'createIterator': ['getObject', 'isArguments', 'isArray', 'isString', 'iteratorTemplate', 'lodash', 'releaseObject'],
@@ -224,7 +226,7 @@
'noop': [],
'releaseArray': [],
'releaseObject': [],
'setBindData': [],
'setBindData': ['noop'],
'shimIsPlainObject': ['forIn', 'isArguments', 'isFunction', 'isNode'],
'shimKeys': ['createIterator'],
'slice': [],
@@ -324,6 +326,7 @@
'findWhere',
'forEach',
'groupBy',
'indexBy',
'invoke',
'map',
'max',
@@ -514,6 +517,7 @@
'findKey',
'forIn',
'forOwn',
'indexBy',
'isPlainObject',
'merge',
'parseInt',
@@ -1185,7 +1189,7 @@
*
* @private
* @param {String} source The source to inspect.
* @returns {String} Returns the `createObject` fork.
* @returns {String} Returns the fork.
*/
function getCreateObjectFork(source) {
var result = source.match(/(?:\s*\/\/.*)*\n( *)if *\((?:!nativeCreate)[\s\S]+?\n *};\n\1}/);
@@ -1197,7 +1201,7 @@
*
* @private
* @param {String} source The source to inspect.
* @returns {String} Returns the `_.defer` fork.
* @returns {String} Returns the fork.
*/
function getDeferFork(source) {
var result = source.match(/(?:\s*\/\/.*)*\n( *)if *\(isV8 *&& *freeModule[\s\S]+?\n\1}/);
@@ -1318,7 +1322,7 @@
*
* @private
* @param {String} source The source to inspect.
* @returns {String} Returns the `isArguments` fork.
* @returns {String} Returns the fork.
*/
function getIsArgumentsFork(source) {
var result = source.match(/(?:\s*\/\/.*)*\n( *)if *\((?:!support\.argsClass|!isArguments)[\s\S]+?\n *};\n\1}/);
@@ -1330,7 +1334,7 @@
*
* @private
* @param {String} source The source to inspect.
* @returns {String} Returns the `isArray` fork.
* @returns {String} Returns the fork.
*/
function getIsArrayFork(source) {
return matchFunction(source, 'isArray')
@@ -1343,7 +1347,7 @@
*
* @private
* @param {String} source The source to inspect.
* @returns {String} Returns the `isFunction` fork.
* @returns {String} Returns the fork.
*/
function getIsFunctionFork(source) {
var result = source.match(/(?:\s*\/\/.*)*\n( *)if *\(isFunction\(\/x\/[\s\S]+?\n *};\n\1}/);
@@ -1392,12 +1396,24 @@
) || funcName;
}
/**
* Gets the `setBindData` fork from `source`.
*
* @private
* @param {String} source The source to inspect.
* @returns {String} Returns the fork.
*/
function getSetBindDataFork(source) {
var result = matchFunction(source, 'setBindData').match(/!defineProperty[^:]+:\s*/);
return result ? result[0] : '';
}
/**
* Gets the `templateSettings` assignment from `source`.
*
* @private
* @param {String} source The source to inspect.
* @returns {String} Returns the `templateSettings`.
* @returns {String} Returns the assignment.
*/
function getTemplateSettings(source) {
var result = source.match(RegExp(
@@ -1473,8 +1489,8 @@
*/
function matchFunction(source, funcName, leadingComments) {
var result = _.reduce([
// match variable declarations with `createIterator` and `template`
'( *)var ' + funcName + ' *=.*?(?:createIterator|template)\\((?:.+|[\\s\\S]+?\\n\\3}?)\\);\\n',
// match variable declarations using `createAggregator`, `createIterator` and `template`
'( *)var ' + funcName + ' *=.*?(?:create[A-Z][a-z]+|template)\\((?:.+|[\\s\\S]+?\\n\\3}?)\\);\\n',
// match a function declaration
'( *)function ' + funcName + '\\b[\\s\\S]+?\\n\\3}\\n',
// match a variable declaration with function expression
@@ -1490,7 +1506,7 @@
return result && (
/@type +Function\b/.test(result[0]) ||
/(?:function(?:\s+\w+)?\b|createIterator|template)\(/.test(result[1]))
/(?:function(?:\s+\w+)?\b|create[A-Z][a-z]+|template)\(/.test(result[1]))
? (leadingComments ? result[0] : '') + result[1]
: '';
}
@@ -1634,8 +1650,8 @@
// remove `__bindData__` logic and `setBindData` function calls from `_.createCallback`
source = source.replace(matchFunction(source, 'createCallback'), function(match) {
return match
.replace(/(?:\s*\/\/.*)\n( *)var bindData *=[\s\S]+?\n\1}/, '')
.replace(/(?:\s*\/\/.*)\n( *)if *\(bindData[\s\S]+?\n\1}/, '');
.replace(/(?:\s*\/\/.*)*\n( *)var bindData *=[\s\S]+?\n\1}/, '')
.replace(/(?:\s*\/\/.*)*\n( *)if *\(bindData[\s\S]+?\n\1}/, '');
});
return source;
@@ -1936,6 +1952,19 @@
return source;
}
/**
* Removes the `setBindData` fork from `source`.
*
* @private
* @param {String} source The source to process.
* @returns {String} Returns the modified source.
*/
function removeSetBindDataFork(source) {
return source = source.replace(matchFunction(source, 'isArray'), function(match) {
return match.replace(getSetBindDataFork(source), '');
});
}
/**
* Removes the `support.spliceObjects` fix from the `Array` function mixins
* snippet of `source`.
@@ -2710,8 +2739,10 @@
});
}
else if (isModern) {
funcDependencyMap.setBindData = _.without(funcDependencyMap.setBindData, 'noop');
_.forOwn(funcDependencyMap, function(deps, funcName) {
if (_.contains(deps, 'isArguments')) {
if (funcName != 'baseFlatten' && _.contains(deps, 'isArguments')) {
funcDependencyMap[funcName] = _.without(deps, 'isArguments');
}
});
@@ -3004,6 +3035,7 @@
}
if (isModern) {
source = removeIsArgumentsFork(source);
source = removeSetBindDataFork(source);
source = removeSupportSpliceObjects(source);
if (isMobile) {

View File

@@ -149,6 +149,7 @@
'imports',
'include',
'index',
'indexBy',
'indexOf',
'initial',
'inject',

134
dist/lodash.compat.js vendored
View File

@@ -557,12 +557,12 @@
* `after`, `assign`, `bind`, `bindAll`, `bindKey`, `chain`, `compact`,
* `compose`, `concat`, `countBy`, `createCallback`, `debounce`, `defaults`,
* `defer`, `delay`, `difference`, `filter`, `flatten`, `forEach`, `forIn`,
* `forOwn`, `functions`, `groupBy`, `initial`, `intersection`, `invert`,
* `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`,
* `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `push`, `range`,
* `reject`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`,
* `tap`, `throttle`, `times`, `toArray`, `transform`, `union`, `uniq`, `unshift`,
* `unzip`, `values`, `where`, `without`, `wrap`, and `zip`
* `forOwn`, `functions`, `groupBy`, `indexBy`, `initial`, `intersection`,
* `invert`, `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`,
* `omit`, `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `push`,
* `range`, `reject`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, `sortBy`,
* `splice`, `tap`, `throttle`, `times`, `toArray`, `transform`, `union`, `uniq`,
* `unshift`, `unzip`, `values`, `where`, `without`, `wrap`, and `zip`
*
* The non-chainable wrapper functions are:
* `clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `has`,
@@ -1322,6 +1322,28 @@
return result;
}
/**
* Creates a function that aggregates a collection, creating an object composed
* of keys generated from the results of running each element of the collection
* through a callback. The given `setter` function sets the keys and values
* of the composed object.
*
* @private
* @param {Function} setter The setter function.
* @returns {Function} Returns the new aggregator function.
*/
function createAggregator(setter) {
return function(collection, callback, thisArg) {
var result = {};
callback = lodash.createCallback(callback, thisArg, 3);
forEach(collection, function(value, key, collection) {
key = String(callback(value, key, collection));
setter(result, value, key, collection);
});
return result;
};
}
/**
* Creates a function that, when called, invokes `func` with the `this` binding
* of `thisArg` and prepends any `partialArgs` to the arguments passed to the
@@ -1489,14 +1511,14 @@
* @param {Function} func The function to set data on.
* @param {Mixed} value The value to set.
*/
function setBindData(func, value) {
var setBindData = !defineProperty ? noop : function(func, value) {
defineProperty(func, '__bindData__', {
'configurable': false,
'enumerable': false,
'value': value,
'writable': false
});
}
};
/**
* A fallback implementation of `isPlainObject` which checks if a given `value`
@@ -2247,7 +2269,7 @@
* Checks if `value` is `NaN`.
*
* Note: This is not the same as native `isNaN`, which will return `true` for
* `undefined` and other values. See http://es5.github.io/#x15.1.2.4.
* `undefined` and other non-numeric values. See http://es5.github.io/#x15.1.2.4.
*
* @static
* @memberOf _
@@ -2769,10 +2791,11 @@
}
/**
* Creates an object composed of keys returned from running each element of the
* `collection` through the given `callback`. The corresponding value of each key
* is the number of times the key was returned by the `callback`. The `callback`
* is bound to `thisArg` and invoked with three arguments; (value, index|key, collection).
* Creates an object composed of keys generated from the results of running
* each element of the `collection` through the given `callback`. The corresponding
* value of each key is the number of times the key was returned by the `callback`.
* The `callback` is bound to `thisArg` and invoked with three arguments;
* (value, index|key, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
@@ -2801,16 +2824,9 @@
* _.countBy(['one', 'two', 'three'], 'length');
* // => { '3': 2, '5': 1 }
*/
function countBy(collection, callback, thisArg) {
var result = {};
callback = lodash.createCallback(callback, thisArg, 3);
forEach(collection, function(value, key, collection) {
key = String(callback(value, key, collection));
(hasOwnProperty.call(result, key) ? result[key]++ : result[key] = 1);
});
return result;
}
var countBy = createAggregator(function(result, value, key) {
(hasOwnProperty.call(result, key) ? result[key]++ : result[key] = 1);
});
/**
* Checks if the `callback` returns a truthy value for **all** elements of a
@@ -3045,10 +3061,11 @@
}
/**
* Creates an object composed of keys returned from running each element of the
* `collection` through the `callback`. The corresponding value of each key is
* an array of elements passed to `callback` that returned the key. The `callback`
* is bound to `thisArg` and invoked with three arguments; (value, index|key, collection).
* Creates an object composed of keys generated from the results of running
* each element of the `collection` through the `callback`. The corresponding
* value of each key is an array of the elements responsible for generating
* the key. The `callback` is bound to `thisArg` and invoked with three
* arguments; (value, index|key, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
@@ -3078,16 +3095,52 @@
* _.groupBy(['one', 'two', 'three'], 'length');
* // => { '3': ['one', 'two'], '5': ['three'] }
*/
function groupBy(collection, callback, thisArg) {
var result = {};
callback = lodash.createCallback(callback, thisArg, 3);
var groupBy = createAggregator(function(result, value, key) {
(hasOwnProperty.call(result, key) ? result[key] : result[key] = []).push(value);
});
forEach(collection, function(value, key, collection) {
key = String(callback(value, key, collection));
(hasOwnProperty.call(result, key) ? result[key] : result[key] = []).push(value);
});
return result;
}
/**
* Creates an object composed of keys generated from the results of running
* each element of the `collection` through the given `callback`. The corresponding
* value of each key is the last element responsible for generating the key.
* The `callback` is bound to `thisArg` and invoked with three arguments;
* (value, index|key, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the properties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a property name or object is passed, it will be used to create
* a "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Object} Returns the composed aggregate object.
* @example
*
* var keys = [
* { 'dir': 'left', 'code': 97 },
* { 'dir': 'right', 'code': 100 }
* ];
*
* _.indexBy(keys, 'dir');
* // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
*
* _.indexBy(keys, function(key) { return String.fromCharCode(key.code); });
* // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
*
* _.indexBy(stooges, function(key) { this.fromCharCode(key.code); }, String);
* // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
*/
var indexBy = createAggregator(function(result, value, key) {
result[key] = value;
});
/**
* Invokes the method named by `methodName` on each element in the `collection`,
@@ -4225,7 +4278,8 @@
/**
* Creates an array of numbers (positive and/or negative) progressing from
* `start` up to but not including `end`.
* `start` up to but not including `end`. If `start` is less than `stop` a
* zero-length range is created unless a negative `step` is specified.
*
* @static
* @memberOf _
@@ -4810,6 +4864,7 @@
return result;
};
}
// exit early if there is no `thisArg`
if (typeof thisArg == 'undefined') {
return func;
}
@@ -4827,9 +4882,7 @@
return func.call(thisArg, accumulator, value, index, collection);
};
}
return function() {
return func.apply(thisArg, arguments);
};
return bind(func, thisArg);
}
/**
@@ -5739,6 +5792,7 @@
lodash.forOwn = forOwn;
lodash.functions = functions;
lodash.groupBy = groupBy;
lodash.indexBy = indexBy;
lodash.initial = initial;
lodash.intersection = intersection;
lodash.invert = invert;

View File

@@ -5,48 +5,47 @@
*/
;!function(n){function t(n,t,e){e=(e||0)-1;for(var r=n?n.length:0;++e<r;)if(n[e]===t)return e;return-1}function e(n,e){var r=typeof e;if(n=n.k,"boolean"==r||e==d)return n[e];"number"!=r&&"string"!=r&&(r="object");var u="number"==r?e:x+e;return n=n[r]||(n[r]={}),"object"==r?n[u]&&-1<t(n[u],e)?0:-1:n[u]?0:-1}function r(n){var t=this.k,e=typeof n;if("boolean"==e||n==d)t[n]=m;else{"number"!=e&&"string"!=e&&(e="object");var r="number"==e?n:x+n,t=t[e]||(t[e]={});"object"==e?(t[r]||(t[r]=[])).push(n):t[r]=m
}}function u(n){return n.charCodeAt(0)}function a(n,t){var e=n.m,r=t.m;if(n=n.l,t=t.l,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1}return e<r?-1:1}function o(n){var t=-1,e=n.length,u=n[0],a=n[e-1];if(u&&typeof u=="object"&&a&&typeof a=="object")return b;for(u=f(),u["false"]=u["null"]=u["true"]=u.undefined=b,a=f(),a.b=n,a.k=u,a.push=r;++t<e;)a.push(n[t]);return a}function i(n){return"\\"+Y[n]}function l(){return _.pop()||[]}function f(){return j.pop()||{a:"",b:d,c:"",k:d,l:d,"false":b,d:"",m:0,e:"",u:d,leading:b,g:"",maxWait:0,"null":b,number:d,y:d,push:d,h:d,string:d,i:"",trailing:b,"true":b,undefined:b,j:b,n:d}
}function c(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function s(){}function p(n){n.length=0,_.length<E&&_.push(n)}function g(n){var t=n.k;t&&g(t),n.b=n.k=n.l=n.object=n.number=n.string=n.n=d,j.length<E&&j.push(n)}function v(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Array(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function h(r){function _(n){return n&&typeof n=="object"&&!Be(n)&&ce.call(n,"__wrapped__")?n:new j(n)}function j(n){this.__wrapped__=n
}function E(n,t,e,r,u){var a=n;if(e){if(a=e(a),typeof a!="undefined")return a;a=n}var o=ht(a);if(o){var i=he.call(a);if(!Q[i]||!Pe.nodeClass&&c(a))return a;var f=Be(a)}if(!o||!t)return o?f?v(a):Je({},a):a;switch(o=De[i],i){case K:case L:return new o(+a);case M:case V:return new o(a);case U:return o(a.source,B.exec(a))}i=!r,r||(r=l()),u||(u=l());for(var s=r.length;s--;)if(r[s]==n)return u[s];return a=f?o(a.length):{},f&&(ce.call(n,"index")&&(a.index=n.index),ce.call(n,"input")&&(a.input=n.input)),r.push(n),u.push(a),(f?Le:Ge)(n,function(n,o){a[o]=E(n,t,e,r,u)
}),i&&(p(r),p(u)),a}function Y(n,t,e,r){r=(r||0)-1;for(var u=n?n.length:0,a=[];++r<u;){var o=n[r];o&&typeof o=="object"&&(Be(o)||st(o))?se.apply(a,t?o:Y(o,t,e)):e||a.push(o)}return a}function Z(n,t,e,r,u,a){if(e){var o=e(n,t);if(typeof o!="undefined")return!!o}if(n===t)return 0!==n||1/n==1/t;if(n===n&&(!n||!X[typeof n])&&(!t||!X[typeof t]))return b;if(n==d||t==d)return n===t;var i=he.call(n),f=he.call(t);if(i==T&&(i=G),f==T&&(f=G),i!=f)return b;switch(i){case K:case L:return+n==+t;case M:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;
case U:case V:return n==Xt(t)}if(f=i==W,!f){if(ce.call(n,"__wrapped__")||ce.call(t,"__wrapped__"))return Z(n.__wrapped__||n,t.__wrapped__||t,e,r,u,a);if(i!=G||!Pe.nodeClass&&(c(n)||c(t)))return b;var i=!Pe.argsObject&&st(n)?Vt:n.constructor,s=!Pe.argsObject&&st(t)?Vt:t.constructor;if(i!=s&&(!vt(i)||!(i instanceof i&&vt(s)&&s instanceof s)))return b}for(s=!u,u||(u=l()),a||(a=l()),i=u.length;i--;)if(u[i]==n)return a[i]==t;var g=0,o=m;if(u.push(n),a.push(t),f){if(i=n.length,g=t.length,o=g==n.length,!o&&!r)return o;
for(;g--;)if(f=i,s=t[g],r)for(;f--&&!(o=Z(n[f],s,e,r,u,a)););else if(!(o=Z(n[g],s,e,r,u,a)))break;return o}return Me(t,function(t,i,l){return ce.call(l,i)?(g++,o=ce.call(n,i)&&Z(n[i],t,e,r,u,a)):void 0}),o&&!r&&Me(n,function(n,t,e){return ce.call(e,t)?o=-1<--g:void 0}),s&&(p(u),p(a)),o}function tt(n,t,e,r,u){(Be(t)?Ct:Ge)(t,function(t,a){var o,i,l=t,f=n[a];if(t&&((i=Be(t))||Ue(t))){for(l=r.length;l--;)if(o=r[l]==t){f=u[l];break}if(!o){var c;e&&(l=e(f,t),c=typeof l!="undefined")&&(f=l),c||(f=i?Be(f)?f:[]:Ue(f)?f:{}),r.push(t),u.push(f),c||tt(f,t,e,r,u)
}}else e&&(l=e(f,t),typeof l=="undefined"&&(l=t)),typeof l!="undefined"&&(f=l);n[a]=f})}function rt(n,r,u){var a=-1,i=lt(),f=n?n.length:0,c=[],s=!r&&f>=O&&i===t,v=u||s?l():c;if(s){var h=o(v);h?(i=e,v=h):(s=b,v=u?v:(p(v),c))}for(;++a<f;){var h=n[a],y=u?u(h,a,n):h;(r?!a||v[v.length-1]!==y:0>i(v,y))&&((u||s)&&v.push(y),c.push(h))}return s?(p(v.b),g(v)):u&&p(v),c}function ut(n,t,e,r,u,a){var o=a&&!u;if(!vt(n)&&!o)throw new Yt;if(u||a||r.length||!(Pe.fastBind||me&&e.length))i=function(){var a=arguments,f=u?this:t;
return o&&(n=t[l]),(e.length||r.length)&&(ye.apply(a,e),se.apply(a,r)),this instanceof i?(f=ot(n.prototype),a=n.apply(f,a),ht(a)?a:f):n.apply(f,a)};else{a=[n,t],se.apply(a,e);var i=me.call.apply(me,a)}if(o){var l=t;t=n}return i}function at(){var n=f();n.h=q,n.b=n.c=n.g=n.i="",n.e="s",n.j=m;for(var t,e=0;t=arguments[e];e++)for(var r in t)n[r]=t[r];e=n.a,n.d=/^[^,]+/.exec(e)[0],t=Mt,e="return function("+e+"){",r="var m,s="+n.d+",D="+n.e+";if(!s)return D;"+n.i+";",n.b?(r+="var t=s.length;m=-1;if("+n.b+"){",Pe.unindexedChars&&(r+="if(r(s)){s=s.split('')}"),r+="while(++m<t){"+n.g+";}}else{"):Pe.nonEnumArgs&&(r+="var t=s.length;m=-1;if(t&&o(s)){while(++m<t){m+='';"+n.g+";}}else{"),Pe.enumPrototypes&&(r+="var F=typeof s=='function';"),Pe.enumErrorProps&&(r+="var E=s===j||s instanceof Error;");
}function c(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function s(){}function p(n){n.length=0,_.length<E&&_.push(n)}function g(n){var t=n.k;t&&g(t),n.b=n.k=n.l=n.object=n.number=n.string=n.n=d,j.length<E&&j.push(n)}function v(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Array(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function h(r){function _(n){return n&&typeof n=="object"&&!Ne(n)&&se.call(n,"__wrapped__")?n:new j(n)}function j(n){this.__wrapped__=n
}function E(n,t,e,r,u){var a=n;if(e){if(a=e(a),typeof a!="undefined")return a;a=n}var o=yt(a);if(o){var i=ye.call(a);if(!Q[i]||!Pe.nodeClass&&c(a))return a;var f=Ne(a)}if(!o||!t)return o?f?v(a):He({},a):a;switch(o=Ie[i],i){case K:case L:return new o(+a);case M:case V:return new o(a);case U:return o(a.source,P.exec(a))}i=!r,r||(r=l()),u||(u=l());for(var s=r.length;s--;)if(r[s]==n)return u[s];return a=f?o(a.length):{},f&&(se.call(n,"index")&&(a.index=n.index),se.call(n,"input")&&(a.input=n.input)),r.push(n),u.push(a),(f?Je:Ue)(n,function(n,o){a[o]=E(n,t,e,r,u)
}),i&&(p(r),p(u)),a}function Y(n,t,e,r){r=(r||0)-1;for(var u=n?n.length:0,a=[];++r<u;){var o=n[r];o&&typeof o=="object"&&(Ne(o)||pt(o))?pe.apply(a,t?o:Y(o,t,e)):e||a.push(o)}return a}function Z(n,t,e,r,u,a){if(e){var o=e(n,t);if(typeof o!="undefined")return!!o}if(n===t)return 0!==n||1/n==1/t;if(n===n&&(!n||!X[typeof n])&&(!t||!X[typeof t]))return b;if(n==d||t==d)return n===t;var i=ye.call(n),f=ye.call(t);if(i==T&&(i=G),f==T&&(f=G),i!=f)return b;switch(i){case K:case L:return+n==+t;case M:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;
case U:case V:return n==Yt(t)}if(f=i==W,!f){if(se.call(n,"__wrapped__")||se.call(t,"__wrapped__"))return Z(n.__wrapped__||n,t.__wrapped__||t,e,r,u,a);if(i!=G||!Pe.nodeClass&&(c(n)||c(t)))return b;var i=!Pe.argsObject&&pt(n)?Qt:n.constructor,s=!Pe.argsObject&&pt(t)?Qt:t.constructor;if(i!=s&&(!ht(i)||!(i instanceof i&&ht(s)&&s instanceof s)))return b}for(s=!u,u||(u=l()),a||(a=l()),i=u.length;i--;)if(u[i]==n)return a[i]==t;var g=0,o=m;if(u.push(n),a.push(t),f){if(i=n.length,g=t.length,o=g==n.length,!o&&!r)return o;
for(;g--;)if(f=i,s=t[g],r)for(;f--&&!(o=Z(n[f],s,e,r,u,a)););else if(!(o=Z(n[g],s,e,r,u,a)))break;return o}return Ge(t,function(t,i,l){return se.call(l,i)?(g++,o=se.call(n,i)&&Z(n[i],t,e,r,u,a)):void 0}),o&&!r&&Ge(n,function(n,t,e){return se.call(e,t)?o=-1<--g:void 0}),s&&(p(u),p(a)),o}function tt(n,t,e,r,u){(Ne(t)?kt:Ue)(t,function(t,a){var o,i,l=t,f=n[a];if(t&&((i=Ne(t))||Ve(t))){for(l=r.length;l--;)if(o=r[l]==t){f=u[l];break}if(!o){var c;e&&(l=e(f,t),c=typeof l!="undefined")&&(f=l),c||(f=i?Ne(f)?f:[]:Ve(f)?f:{}),r.push(t),u.push(f),c||tt(f,t,e,r,u)
}}else e&&(l=e(f,t),typeof l=="undefined"&&(l=t)),typeof l!="undefined"&&(f=l);n[a]=f})}function rt(n,r,u){var a=-1,i=ft(),f=n?n.length:0,c=[],s=!r&&f>=O&&i===t,v=u||s?l():c;if(s){var h=o(v);h?(i=e,v=h):(s=b,v=u?v:(p(v),c))}for(;++a<f;){var h=n[a],y=u?u(h,a,n):h;(r?!a||v[v.length-1]!==y:0>i(v,y))&&((u||s)&&v.push(y),c.push(h))}return s?(p(v.b),g(v)):u&&p(v),c}function ut(n){return function(t,e,r){var u={};return e=_.createCallback(e,r,3),kt(t,function(t,r,a){r=Yt(e(t,r,a)),n(u,t,r,a)}),u}}function at(n,t,e,r,u,a){var o=a&&!u;
if(!ht(n)&&!o)throw new Zt;if(u||a||r.length||!(Pe.fastBind||de&&e.length))i=function(){var a=arguments,f=u?this:t;return o&&(n=t[l]),(e.length||r.length)&&(me.apply(a,e),pe.apply(a,r)),this instanceof i?(f=it(n.prototype),a=n.apply(f,a),yt(a)?a:f):n.apply(f,a)};else{a=[n,t],pe.apply(a,e);var i=de.call.apply(de,a)}if(o){var l=t;t=n}return i}function ot(){var n=f();n.h=q,n.b=n.c=n.g=n.i="",n.e="s",n.j=m;for(var t,e=0;t=arguments[e];e++)for(var r in t)n[r]=t[r];e=n.a,n.d=/^[^,]+/.exec(e)[0],t=Gt,e="return function("+e+"){",r="var m,s="+n.d+",D="+n.e+";if(!s)return D;"+n.i+";",n.b?(r+="var t=s.length;m=-1;if("+n.b+"){",Pe.unindexedChars&&(r+="if(r(s)){s=s.split('')}"),r+="while(++m<t){"+n.g+";}}else{"):Pe.nonEnumArgs&&(r+="var t=s.length;m=-1;if(t&&o(s)){while(++m<t){m+='';"+n.g+";}}else{"),Pe.enumPrototypes&&(r+="var F=typeof s=='function';"),Pe.enumErrorProps&&(r+="var E=s===j||s instanceof Error;");
var u=[];if(Pe.enumPrototypes&&u.push('!(F&&m=="prototype")'),Pe.enumErrorProps&&u.push('!(E&&(m=="message"||m=="name"))'),n.j&&n.f)r+="var B=-1,C=A[typeof s]&&u(s),t=C?C.length:0;while(++B<t){m=C[B];",u.length&&(r+="if("+u.join("&&")+"){"),r+=n.g+";",u.length&&(r+="}"),r+="}";else if(r+="for(m in s){",n.j&&u.push("l.call(s, m)"),u.length&&(r+="if("+u.join("&&")+"){"),r+=n.g+";",u.length&&(r+="}"),r+="}",Pe.nonEnumShadows){for(r+="if(s!==z){var h=s.constructor,q=s===(h&&h.prototype),e=s===I?H:s===j?i:K.call(s),w=x[e];",k=0;7>k;k++)r+="m='"+n.h[k]+"';if((!(q&&w[m])&&l.call(s,m))",n.j||(r+="||(!w[m]&&s[m]!==z[m])"),r+="){"+n.g+"}";
r+="}"}return(n.b||Pe.nonEnumArgs)&&(r+="}"),r+=n.c+";return D",t=t("i,j,l,n,o,p,r,u,v,z,A,x,H,I,K",e+r+"}"),g(n),t(J,ne,ce,C,st,Be,mt,n.f,_,te,X,Ie,V,ee,he)}function ot(n){return ht(n)?de(n):{}}function it(n){return qe[n]}function lt(){var n=(n=_.indexOf)===It?t:n;return n}function ft(n){var t,e;return!n||he.call(n)!=G||(t=n.constructor,vt(t)&&!(t instanceof t))||!Pe.argsClass&&st(n)||!Pe.nodeClass&&c(n)?b:Pe.ownLast?(Me(n,function(n,t,r){return e=ce.call(r,t),b}),e!==false):(Me(n,function(n,t){e=t
}),e===y||ce.call(n,e))}function ct(n){return Te[n]}function st(n){return n&&typeof n=="object"?he.call(n)==T:b}function pt(n){var t=[];return Me(n,function(n,e){vt(n)&&t.push(e)}),t.sort()}function gt(n){for(var t=-1,e=Fe(n),r=e.length,u={};++t<r;){var a=e[t];u[n[a]]=a}return u}function vt(n){return typeof n=="function"}function ht(n){return!(!n||!X[typeof n])}function yt(n){return typeof n=="number"||he.call(n)==M}function mt(n){return typeof n=="string"||he.call(n)==V}function dt(n){for(var t=-1,e=Fe(n),r=e.length,u=Lt(r);++t<r;)u[t]=n[e[t]];
return u}function bt(n,t,e){var r=-1,u=lt(),a=n?n.length:0,o=b;return e=(0>e?Ce(0,a+e):e)||0,a&&typeof a=="number"?o=-1<(mt(n)?n.indexOf(t,e):u(n,t,e)):Le(n,function(n){return++r<e?void 0:!(o=n===t)}),o}function _t(n,t,e){var r=m;if(t=_.createCallback(t,e,3),Be(n)){e=-1;for(var u=n.length;++e<u&&(r=!!t(n[e],e,n)););}else Le(n,function(n,e,u){return r=!!t(n,e,u)});return r}function jt(n,t,e){var r=[];if(t=_.createCallback(t,e,3),Be(n)){e=-1;for(var u=n.length;++e<u;){var a=n[e];t(a,e,n)&&r.push(a)
}}else Le(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function wt(n,t,e){if(t=_.createCallback(t,e,3),!Be(n)){var r;return Le(n,function(n,e,u){return t(n,e,u)?(r=n,b):void 0}),r}e=-1;for(var u=n.length;++e<u;){var a=n[e];if(t(a,e,n))return a}}function Ct(n,t,e){if(t&&typeof e=="undefined"&&Be(n)){e=-1;for(var r=n.length;++e<r&&t(n[e],e,n)!==false;);}else Le(n,t,e);return n}function kt(n,t,e){var r=-1,u=n?n.length:0,a=Lt(typeof u=="number"?u:0);if(t=_.createCallback(t,e,3),Be(n))for(;++r<u;)a[r]=t(n[r],r,n);
else Le(n,function(n,e,u){a[++r]=t(n,e,u)});return a}function xt(n,t,e){var r=-1/0,a=r;if(!t&&Be(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];i>a&&(a=i)}}else t=!t&&mt(n)?u:_.createCallback(t,e,3),Le(n,function(n,e,u){e=t(n,e,u),e>r&&(r=e,a=n)});return a}function Ot(n,t,e,r){var u=3>arguments.length;if(t=_.createCallback(t,r,4),Be(n)){var a=-1,o=n.length;for(u&&(e=n[++a]);++a<o;)e=t(e,n[a],a,n)}else Le(n,function(n,r,a){e=u?(u=b,n):t(e,n,r,a)});return e}function Et(n,t,e,r){var u=n,a=n?n.length:0,o=3>arguments.length;
if(typeof a!="number")var i=Fe(n),a=i.length;else Pe.unindexedChars&&mt(n)&&(u=n.split(""));return t=_.createCallback(t,r,4),Ct(n,function(n,r,l){r=i?i[--a]:--a,e=o?(o=b,u[r]):t(e,u[r],r,l)}),e}function St(n,t,e){var r;if(t=_.createCallback(t,e,3),Be(n)){e=-1;for(var u=n.length;++e<u&&!(r=t(n[e],e,n)););}else Le(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function At(n){var r=-1,u=lt(),a=n?n.length:0,i=Y(arguments,m,m,1),l=[],f=a>=O&&u===t;if(f){var c=o(i);c?(u=e,i=c):f=b}for(;++r<a;)c=n[r],0>u(i,c)&&l.push(c);
return f&&g(i),l}function Dt(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&t!=d){var a=-1;for(t=_.createCallback(t,e,3);++a<u&&t(n[a],a,n);)r++}else if(r=t,r==d||e)return n[0];return v(n,0,ke(Ce(0,r),u))}}function It(n,e,r){if(typeof r=="number"){var u=n?n.length:0;r=0>r?Ce(0,u+r):r||0}else if(r)return r=Bt(n,e),n[r]===e?r:-1;return n?t(n,e,r):-1}function Pt(n,t,e){if(typeof t!="number"&&t!=d){var r=0,u=-1,a=n?n.length:0;for(t=_.createCallback(t,e,3);++u<a&&t(n[u],u,n);)r++}else r=t==d||e?1:Ce(0,t);
return v(n,r)}function Bt(n,t,e,r){var u=0,a=n?n.length:u;for(e=e?_.createCallback(e,r,1):Tt,t=e(t);u<a;)r=u+a>>>1,e(n[r])<t?u=r+1:a=r;return u}function Nt(n,t,e,r){return typeof t!="boolean"&&t!=d&&(r=e,e=r&&r[t]===n?y:t,t=b),e!=d&&(e=_.createCallback(e,r,3)),rt(n,t,e)}function Ft(){for(var n=1<arguments.length?arguments:arguments[0],t=-1,e=n?xt(Ve(n,"length")):0,r=Lt(0>e?0:e);++t<e;)r[t]=Ve(n,t);return r}function $t(n,t){for(var e=-1,r=n?n.length:0,u={};++e<r;){var a=n[e];t?u[a]=t[e]:a&&(u[a[0]]=a[1])
}return u}function zt(n,t){return ut(n,t,Ee.call(arguments,2),[])}function Rt(n,t,e){function r(){oe(p),oe(g),f=0,p=g=d}function u(){var t=v&&(!h||1<f);r(),t&&(s!==false&&(c=new Ht),i=n.apply(l,o))}function a(){r(),(v||s!==t)&&(c=new Ht,i=n.apply(l,o))}var o,i,l,f=0,c=0,s=b,p=d,g=d,v=m;if(t=Ce(0,t||0),e===m)var h=m,v=b;else ht(e)&&(h=e.leading,s="maxWait"in e&&Ce(t,e.maxWait||0),v="trailing"in e?e.trailing:v);return function(){if(o=arguments,l=this,f++,oe(g),s===false)h&&2>f&&(i=n.apply(l,o));else{var e=new Ht;
!p&&!h&&(c=e);var r=s-(e-c);0<r?p||(p=ve(a,r)):(oe(p),p=d,c=e,i=n.apply(l,o))}return t!==s&&(g=ve(u,t)),i}}function qt(n){var t=Ee.call(arguments,1);return ve(function(){n.apply(y,t)},1)}function Tt(n){return n}function Wt(n,t){t||(t=n,n=_);var e=vt(n);Ct(pt(t),function(r){var u=n[r]=t[r];e&&(n.prototype[r]=function(){var t=this.__wrapped__,e=[t];return se.apply(e,arguments),e=u.apply(n,e),t&&typeof t=="object"&&t===e?this:new j(e)})})}function Kt(){return this.__wrapped__}r=r?et.defaults(n.Object(),r,et.pick(n,R)):n;
var Lt=r.Array,Jt=r.Boolean,Ht=r.Date,Mt=r.Function,Gt=r.Math,Ut=r.Number,Vt=r.Object,Qt=r.RegExp,Xt=r.String,Yt=r.TypeError,Zt=[],ne=r.Error.prototype,te=Vt.prototype,ee=Xt.prototype,re=r._,ue=Qt("^"+Xt(te.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),ae=Gt.ceil,oe=r.clearTimeout,ie=ue.test(ie=Vt.defineProperty)&&ie,le=Gt.floor,fe=ue.test(fe=Vt.getPrototypeOf)&&fe,ce=te.hasOwnProperty,se=Zt.push,pe=te.propertyIsEnumerable,ge=r.setImmediate,ve=r.setTimeout,he=te.toString,ye=Zt.unshift,me=ue.test(me=he.bind)&&me,de=ue.test(de=Vt.create)&&de,be=ue.test(be=Lt.isArray)&&be,_e=r.isFinite,je=r.isNaN,we=ue.test(we=Vt.keys)&&we,Ce=Gt.max,ke=Gt.min,xe=r.parseInt,Oe=Gt.random,Ee=Zt.slice,Se=ue.test(r.attachEvent),Ae=me&&!/\n|true/.test(me+Se),De={};
De[W]=Lt,De[K]=Jt,De[L]=Ht,De[H]=Mt,De[G]=Vt,De[M]=Ut,De[U]=Qt,De[V]=Xt;var Ie={};Ie[W]=Ie[L]=Ie[M]={constructor:m,toLocaleString:m,toString:m,valueOf:m},Ie[K]=Ie[V]={constructor:m,toString:m,valueOf:m},Ie[J]=Ie[H]=Ie[U]={constructor:m,toString:m},Ie[G]={constructor:m},function(){for(var n=q.length;n--;){var t,e=q[n];for(t in Ie)ce.call(Ie,t)&&!ce.call(Ie[t],e)&&(Ie[t][e]=b)}}(),j.prototype=_.prototype;var Pe=_.support={};!function(){function n(){this.x=1}var t={0:1,length:1},e=[];n.prototype={valueOf:1};
for(var r in new n)e.push(r);for(r in arguments);Pe.argsObject=arguments.constructor==Vt&&!(arguments instanceof Lt),Pe.argsClass=he.call(arguments)==T,Pe.enumErrorProps=pe.call(ne,"message")||pe.call(ne,"name"),Pe.enumPrototypes=pe.call(n,"prototype"),Pe.fastBind=me&&!Ae,Pe.ownLast="x"!=e[0],Pe.nonEnumArgs=0!=r,Pe.nonEnumShadows=!/valueOf/.test(e),Pe.spliceObjects=(Zt.splice.call(t,0,1),!t[0]),Pe.unindexedChars="xx"!="x"[0]+Vt("x")[0];try{Pe.nodeClass=!(he.call(document)==G&&!({toString:0}+""))}catch(u){Pe.nodeClass=m
}}(1),_.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:N,variable:"",imports:{_:_}},de||(ot=function(n){if(ht(n)){s.prototype=n;var t=new s;s.prototype=d}return t||{}}),Pe.argsClass||(st=function(n){return n&&typeof n=="object"?ce.call(n,"callee"):b});var Be=be||function(n){return n&&typeof n=="object"?he.call(n)==W:b},Ne=at({a:"y",e:"[]",i:"if(!(A[typeof y]))return D",g:"D.push(m)"}),Fe=we?function(n){return ht(n)?Pe.enumPrototypes&&typeof n=="function"||Pe.nonEnumArgs&&n.length&&st(n)?Ne(n):we(n):[]
}:Ne,$e={a:"f,d,J",i:"d=d&&typeof J=='undefined'?d:v.createCallback(d,J,3)",b:"typeof t=='number'",u:Fe,g:"if(d(s[m],m,f)===false)return D"},ze={a:"y,G,k",i:"var a=arguments,b=0,c=typeof k=='number'?2:a.length;while(++b<c){s=a[b];if(s&&A[typeof s]){",u:Fe,g:"if(typeof D[m]=='undefined')D[m]=s[m]",c:"}}"},Re={i:"if(!A[typeof s])return D;"+$e.i,b:b},qe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Te=gt(qe),We=Qt("("+Fe(Te).join("|")+")","g"),Ke=Qt("["+Fe(qe).join("")+"]","g"),Le=at($e),Je=at(ze,{i:ze.i.replace(";",";if(c>3&&typeof a[c-2]=='function'){var d=v.createCallback(a[--c-1],a[c--],2)}else if(c>2&&typeof a[c-1]=='function'){d=a[--c]}"),g:"D[m]=d?d(D[m],s[m]):s[m]"}),He=at(ze),Me=at($e,Re,{j:b}),Ge=at($e,Re);
vt(/x/)&&(vt=function(n){return typeof n=="function"&&he.call(n)==H});var Ue=fe?function(n){if(!n||he.call(n)!=G||!Pe.argsClass&&st(n))return b;var t=n.valueOf,e=typeof t=="function"&&(e=fe(t))&&fe(e);return e?n==e||fe(n)==e:ft(n)}:ft,Ve=kt;Ae&&nt&&typeof ge=="function"&&(qt=zt(ge,r));var Qe=8==xe(S+"08")?xe:function(n,t){return xe(mt(n)?n.replace(F,""):n,t||0)};return _.after=function(n,t){return function(){return 1>--n?t.apply(this,arguments):void 0}},_.assign=Je,_.at=function(n){var t=-1,e=Y(arguments,m,b,1),r=e.length,u=Lt(r);
for(Pe.unindexedChars&&mt(n)&&(n=n.split(""));++t<r;)u[t]=n[e[t]];return u},_.bind=zt,_.bindAll=function(n){for(var t=1<arguments.length?Y(arguments,m,b,1):pt(n),e=-1,r=t.length;++e<r;){var u=t[e];n[u]=zt(n[u],n)}return n},_.bindKey=function(n,t){return ut(n,t,Ee.call(arguments,2),[],b,m)},_.compact=function(n){for(var t=-1,e=n?n.length:0,r=[];++t<e;){var u=n[t];u&&r.push(u)}return r},_.compose=function(){var n=arguments;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];
return t[0]}},_.countBy=function(n,t,e){var r={};return t=_.createCallback(t,e,3),Ct(n,function(n,e,u){e=Xt(t(n,e,u)),ce.call(r,e)?r[e]++:r[e]=1}),r},_.createCallback=function(n,t,e){if(n==d)return Tt;var r=typeof n;if("function"!=r){if("object"!=r)return function(t){return t[n]};var u=Fe(n),a=u[0],o=n[a];return 1!=u.length||o!==o||ht(o)?function(t){for(var e=u.length,r=b;e--&&(r=Z(t[u[e]],n[u[e]],d,m)););return r}:function(n){return n=n[a],o===n&&(0!==o||1/o==1/n)}}if(typeof t=="undefined")return n;
switch(e){case 1:return function(e){return n.call(t,e)};case 2:return function(e,r){return n.call(t,e,r)};case 3:return function(e,r,u){return n.call(t,e,r,u)};case 4:return function(e,r,u,a){return n.call(t,e,r,u,a)}}return function(){return n.apply(t,arguments)}},_.debounce=Rt,_.defaults=He,_.defer=qt,_.delay=function(n,t){var e=Ee.call(arguments,2);return ve(function(){n.apply(y,e)},t)},_.difference=At,_.filter=jt,_.flatten=function(n,t,e,r){return typeof t!="boolean"&&t!=d&&(r=e,e=r&&r[t]===n?y:t,t=b),e!=d&&(n=kt(n,e,r)),Y(n,t)
},_.forEach=Ct,_.forIn=Me,_.forOwn=Ge,_.functions=pt,_.groupBy=function(n,t,e){var r={};return t=_.createCallback(t,e,3),Ct(n,function(n,e,u){e=Xt(t(n,e,u)),(ce.call(r,e)?r[e]:r[e]=[]).push(n)}),r},_.initial=function(n,t,e){if(!n)return[];var r=0,u=n.length;if(typeof t!="number"&&t!=d){var a=u;for(t=_.createCallback(t,e,3);a--&&t(n[a],a,n);)r++}else r=t==d||e?1:t||r;return v(n,0,ke(Ce(0,u-r),u))},_.intersection=function(n){for(var r=arguments,u=r.length,a=-1,i=l(),f=-1,c=lt(),s=n?n.length:0,v=[],h=l();++a<u;){var y=r[a];
i[a]=c===t&&(y?y.length:0)>=O&&o(a?r[a]:h)}n:for(;++f<s;){var m=i[0],y=n[f];if(0>(m?e(m,y):c(h,y))){for(a=u,(m||h).push(y);--a;)if(m=i[a],0>(m?e(m,y):c(r[a],y)))continue n;v.push(y)}}for(;u--;)(m=i[u])&&g(m);return p(i),p(h),v},_.invert=gt,_.invoke=function(n,t){var e=Ee.call(arguments,2),r=-1,u=typeof t=="function",a=n?n.length:0,o=Lt(typeof a=="number"?a:0);return Ct(n,function(n){o[++r]=(u?t:n[t]).apply(n,e)}),o},_.keys=Fe,_.map=kt,_.max=xt,_.memoize=function(n,t){function e(){var r=e.cache,u=x+(t?t.apply(this,arguments):arguments[0]);
return ce.call(r,u)?r[u]:r[u]=n.apply(this,arguments)}return e.cache={},e},_.merge=function(n){var t=arguments,e=2;if(!ht(n))return n;if("number"!=typeof t[2]&&(e=t.length),3<e&&"function"==typeof t[e-2])var r=_.createCallback(t[--e-1],t[e--],2);else 2<e&&"function"==typeof t[e-1]&&(r=t[--e]);for(var t=Ee.call(arguments,1,e),u=-1,a=l(),o=l();++u<e;)tt(n,t[u],r,a,o);return p(a),p(o),n},_.min=function(n,t,e){var r=1/0,a=r;if(!t&&Be(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];i<a&&(a=i)}}else t=!t&&mt(n)?u:_.createCallback(t,e,3),Le(n,function(n,e,u){e=t(n,e,u),e<r&&(r=e,a=n)
});return a},_.omit=function(n,t,e){var r=lt(),u=typeof t=="function",a={};if(u)t=_.createCallback(t,e,3);else var o=Y(arguments,m,b,1);return Me(n,function(n,e,i){(u?!t(n,e,i):0>r(o,e))&&(a[e]=n)}),a},_.once=function(n){var t,e;return function(){return t?e:(t=m,e=n.apply(this,arguments),n=d,e)}},_.pairs=function(n){for(var t=-1,e=Fe(n),r=e.length,u=Lt(r);++t<r;){var a=e[t];u[t]=[a,n[a]]}return u},_.partial=function(n){return ut(n,d,Ee.call(arguments,1),[],m)},_.partialRight=function(n){return ut(n,d,[],Ee.call(arguments,1),m,m)
},_.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,a=Y(arguments,m,b,1),o=ht(n)?a.length:0;++u<o;){var i=a[u];i in n&&(r[i]=n[i])}else t=_.createCallback(t,e,3),Me(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},_.pluck=Ve,_.range=function(n,t,e){n=+n||0,e=+e||1,t==d&&(t=n,n=0);var r=-1;t=Ce(0,ae((t-n)/e));for(var u=Lt(t);++r<t;)u[r]=n,n+=e;return u},_.reject=function(n,t,e){return t=_.createCallback(t,e,3),jt(n,function(n,e,r){return!t(n,e,r)})},_.rest=Pt,_.shuffle=function(n){var t=-1,e=n?n.length:0,r=Lt(typeof e=="number"?e:0);
return Ct(n,function(n){var e=le(Oe()*(++t+1));r[t]=r[e],r[e]=n}),r},_.sortBy=function(n,t,e){var r=-1,u=n?n.length:0,o=Lt(typeof u=="number"?u:0);for(t=_.createCallback(t,e,3),Ct(n,function(n,e,u){var a=o[++r]=f();a.l=t(n,e,u),a.m=r,a.n=n}),u=o.length,o.sort(a);u--;)n=o[u],o[u]=n.n,g(n);return o},_.tap=function(n,t){return t(n),n},_.throttle=function(n,t,e){var r=m,u=m;return e===false?r=b:ht(e)&&(r="leading"in e?e.leading:r,u="trailing"in e?e.trailing:u),e=f(),e.leading=r,e.maxWait=t,e.trailing=u,n=Rt(n,t,e),g(e),n
},_.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=Lt(n);for(t=_.createCallback(t,e,1);++r<n;)u[r]=t(r);return u},_.toArray=function(n){return n&&typeof n.length=="number"?Pe.unindexedChars&&mt(n)?n.split(""):v(n):dt(n)},_.transform=function(n,t,e,r){var u=Be(n);return t=_.createCallback(t,r,4),e==d&&(u?e=[]:(r=n&&n.constructor,e=ot(r&&r.prototype))),(u?Le:Ge)(n,function(n,r,u){return t(e,n,r,u)}),e},_.union=function(){return rt(Y(arguments,m,m))},_.uniq=Nt,_.values=dt,_.where=jt,_.without=function(n){return At(n,Ee.call(arguments,1))
},_.wrap=function(n,t){return function(){var e=[n];return se.apply(e,arguments),t.apply(this,e)}},_.zip=Ft,_.zipObject=$t,_.collect=kt,_.drop=Pt,_.each=Ct,_.extend=Je,_.methods=pt,_.object=$t,_.select=jt,_.tail=Pt,_.unique=Nt,_.unzip=Ft,Wt(_),_.chain=_,_.prototype.chain=function(){return this},_.clone=function(n,t,e,r){return typeof t!="boolean"&&t!=d&&(r=e,e=t,t=b),E(n,t,typeof e=="function"&&_.createCallback(e,r,1))},_.cloneDeep=function(n,t,e){return E(n,m,typeof t=="function"&&_.createCallback(t,e,1))
},_.contains=bt,_.escape=function(n){return n==d?"":Xt(n).replace(Ke,it)},_.every=_t,_.find=wt,_.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=_.createCallback(t,e,3);++r<u;)if(t(n[r],r,n))return r;return-1},_.findKey=function(n,t,e){var r;return t=_.createCallback(t,e,3),Ge(n,function(n,e,u){return t(n,e,u)?(r=e,b):void 0}),r},_.has=function(n,t){return n?ce.call(n,t):b},_.identity=Tt,_.indexOf=It,_.isArguments=st,_.isArray=Be,_.isBoolean=function(n){return n===m||n===false||he.call(n)==K
},_.isDate=function(n){return n?typeof n=="object"&&he.call(n)==L:b},_.isElement=function(n){return n?1===n.nodeType:b},_.isEmpty=function(n){var t=m;if(!n)return t;var e=he.call(n),r=n.length;return e==W||e==V||(Pe.argsClass?e==T:st(n))||e==G&&typeof r=="number"&&vt(n.splice)?!r:(Ge(n,function(){return t=b}),t)},_.isEqual=function(n,t,e,r){return Z(n,t,typeof e=="function"&&_.createCallback(e,r,2))},_.isFinite=function(n){return _e(n)&&!je(parseFloat(n))},_.isFunction=vt,_.isNaN=function(n){return yt(n)&&n!=+n
},_.isNull=function(n){return n===d},_.isNumber=yt,_.isObject=ht,_.isPlainObject=Ue,_.isRegExp=function(n){return n&&X[typeof n]?he.call(n)==U:b},_.isString=mt,_.isUndefined=function(n){return typeof n=="undefined"},_.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?Ce(0,r+e):ke(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},_.mixin=Wt,_.noConflict=function(){return r._=re,this},_.parseInt=Qe,_.random=function(n,t){n==d&&t==d&&(t=1),n=+n||0,t==d?(t=n,n=0):t=+t||0;var e=Oe();
return n%1||t%1?n+ke(e*(t-n+parseFloat("1e-"+((e+"").length-1))),t):n+le(e*(t-n+1))},_.reduce=Ot,_.reduceRight=Et,_.result=function(n,t){var e=n?n[t]:y;return vt(e)?n[t]():e},_.runInContext=h,_.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Fe(n).length},_.some=St,_.sortedIndex=Bt,_.template=function(n,t,e){var r=_.templateSettings;n||(n=""),e=He({},e,r);var u,a=He({},e.imports,r.imports),r=Fe(a),a=dt(a),o=0,l=e.interpolate||$,f="__p+='",l=Qt((e.escape||$).source+"|"+l.source+"|"+(l===N?P:$).source+"|"+(e.evaluate||$).source+"|$","g");
n.replace(l,function(t,e,r,a,l,c){return r||(r=a),f+=n.slice(o,c).replace(z,i),e&&(f+="'+__e("+e+")+'"),l&&(u=m,f+="';"+l+";__p+='"),r&&(f+="'+((__t=("+r+"))==null?'':__t)+'"),o=c+t.length,t}),f+="';\n",l=e=e.variable,l||(e="obj",f="with("+e+"){"+f+"}"),f=(u?f.replace(A,""):f).replace(D,"$1").replace(I,"$1;"),f="function("+e+"){"+(l?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+f+"return __p}";try{var c=Mt(r,"return "+f).apply(y,a)
}catch(s){throw s.source=f,s}return t?c(t):(c.source=f,c)},_.unescape=function(n){return n==d?"":Xt(n).replace(We,ct)},_.uniqueId=function(n){var t=++w;return Xt(n==d?"":n)+t},_.all=_t,_.any=St,_.detect=wt,_.findWhere=wt,_.foldl=Ot,_.foldr=Et,_.include=bt,_.inject=Ot,Ge(_,function(n,t){_.prototype[t]||(_.prototype[t]=function(){var t=[this.__wrapped__];return se.apply(t,arguments),n.apply(_,t)})}),_.first=Dt,_.last=function(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&t!=d){var a=u;for(t=_.createCallback(t,e,3);a--&&t(n[a],a,n);)r++
}else if(r=t,r==d||e)return n[u-1];return v(n,Ce(0,u-r))}},_.take=Dt,_.head=Dt,Ge(_,function(n,t){_.prototype[t]||(_.prototype[t]=function(t,e){var r=n(this.__wrapped__,t,e);return t==d||e&&typeof t!="function"?r:new j(r)})}),_.VERSION="1.3.1",_.prototype.toString=function(){return Xt(this.__wrapped__)},_.prototype.value=Kt,_.prototype.valueOf=Kt,Le(["join","pop","shift"],function(n){var t=Zt[n];_.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}}),Le(["push","reverse","sort","unshift"],function(n){var t=Zt[n];
_.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Le(["concat","slice","splice"],function(n){var t=Zt[n];_.prototype[n]=function(){return new j(t.apply(this.__wrapped__,arguments))}}),Pe.spliceObjects||Le(["pop","shift","splice"],function(n){var t=Zt[n],e="splice"==n;_.prototype[n]=function(){var n=this.__wrapped__,r=t.apply(n,arguments);return 0===n.length&&delete n[0],e?new j(r):r}}),_}var y,m=!0,d=null,b=!1,_=[],j=[],w=0,C={},x=+new Date+"",O=75,E=40,S=" \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",A=/\b__p\+='';/g,D=/\b(__p\+=)''\+/g,I=/(__e\(.*?\)|\b__t\))\+'';/g,P=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,B=/\w*$/,N=/<%=([\s\S]+?)%>/g,F=RegExp("^["+S+"]*0+(?=.$)"),$=/($^)/,z=/['\n\r\t\u2028\u2029\\]/g,R="Array Boolean Date Error Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),q="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),T="[object Arguments]",W="[object Array]",K="[object Boolean]",L="[object Date]",J="[object Error]",H="[object Function]",M="[object Number]",G="[object Object]",U="[object RegExp]",V="[object String]",Q={};
r+="}"}return(n.b||Pe.nonEnumArgs)&&(r+="}"),r+=n.c+";return D",t=t("i,j,l,n,o,p,r,u,v,z,A,x,H,I,K",e+r+"}"),g(n),t(J,te,se,C,pt,Ne,dt,n.f,_,ee,X,Be,V,re,ye)}function it(n){return yt(n)?be(n):{}}function lt(n){return Te[n]}function ft(){var n=(n=_.indexOf)===Bt?t:n;return n}function ct(n){var t,e;return!n||ye.call(n)!=G||(t=n.constructor,ht(t)&&!(t instanceof t))||!Pe.argsClass&&pt(n)||!Pe.nodeClass&&c(n)?b:Pe.ownLast?(Ge(n,function(n,t,r){return e=se.call(r,t),b}),e!==false):(Ge(n,function(n,t){e=t
}),e===y||se.call(n,e))}function st(n){return We[n]}function pt(n){return n&&typeof n=="object"?ye.call(n)==T:b}function gt(n){var t=[];return Ge(n,function(n,e){ht(n)&&t.push(e)}),t.sort()}function vt(n){for(var t=-1,e=$e(n),r=e.length,u={};++t<r;){var a=e[t];u[n[a]]=a}return u}function ht(n){return typeof n=="function"}function yt(n){return!(!n||!X[typeof n])}function mt(n){return typeof n=="number"||ye.call(n)==M}function dt(n){return typeof n=="string"||ye.call(n)==V}function bt(n){for(var t=-1,e=$e(n),r=e.length,u=Jt(r);++t<r;)u[t]=n[e[t]];
return u}function _t(n,t,e){var r=-1,u=ft(),a=n?n.length:0,o=b;return e=(0>e?ke(0,a+e):e)||0,a&&typeof a=="number"?o=-1<(dt(n)?n.indexOf(t,e):u(n,t,e)):Je(n,function(n){return++r<e?void 0:!(o=n===t)}),o}function jt(n,t,e){var r=m;if(t=_.createCallback(t,e,3),Ne(n)){e=-1;for(var u=n.length;++e<u&&(r=!!t(n[e],e,n)););}else Je(n,function(n,e,u){return r=!!t(n,e,u)});return r}function wt(n,t,e){var r=[];if(t=_.createCallback(t,e,3),Ne(n)){e=-1;for(var u=n.length;++e<u;){var a=n[e];t(a,e,n)&&r.push(a)
}}else Je(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function Ct(n,t,e){if(t=_.createCallback(t,e,3),!Ne(n)){var r;return Je(n,function(n,e,u){return t(n,e,u)?(r=n,b):void 0}),r}e=-1;for(var u=n.length;++e<u;){var a=n[e];if(t(a,e,n))return a}}function kt(n,t,e){if(t&&typeof e=="undefined"&&Ne(n)){e=-1;for(var r=n.length;++e<r&&t(n[e],e,n)!==false;);}else Je(n,t,e);return n}function xt(n,t,e){var r=-1,u=n?n.length:0,a=Jt(typeof u=="number"?u:0);if(t=_.createCallback(t,e,3),Ne(n))for(;++r<u;)a[r]=t(n[r],r,n);
else Je(n,function(n,e,u){a[++r]=t(n,e,u)});return a}function Ot(n,t,e){var r=-1/0,a=r;if(!t&&Ne(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];i>a&&(a=i)}}else t=!t&&dt(n)?u:_.createCallback(t,e,3),Je(n,function(n,e,u){e=t(n,e,u),e>r&&(r=e,a=n)});return a}function Et(n,t,e,r){var u=3>arguments.length;if(t=_.createCallback(t,r,4),Ne(n)){var a=-1,o=n.length;for(u&&(e=n[++a]);++a<o;)e=t(e,n[a],a,n)}else Je(n,function(n,r,a){e=u?(u=b,n):t(e,n,r,a)});return e}function St(n,t,e,r){var u=n,a=n?n.length:0,o=3>arguments.length;
if(typeof a!="number")var i=$e(n),a=i.length;else Pe.unindexedChars&&dt(n)&&(u=n.split(""));return t=_.createCallback(t,r,4),kt(n,function(n,r,l){r=i?i[--a]:--a,e=o?(o=b,u[r]):t(e,u[r],r,l)}),e}function At(n,t,e){var r;if(t=_.createCallback(t,e,3),Ne(n)){e=-1;for(var u=n.length;++e<u&&!(r=t(n[e],e,n)););}else Je(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function Dt(n){var r=-1,u=ft(),a=n?n.length:0,i=Y(arguments,m,m,1),l=[],f=a>=O&&u===t;if(f){var c=o(i);c?(u=e,i=c):f=b}for(;++r<a;)c=n[r],0>u(i,c)&&l.push(c);
return f&&g(i),l}function It(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&t!=d){var a=-1;for(t=_.createCallback(t,e,3);++a<u&&t(n[a],a,n);)r++}else if(r=t,r==d||e)return n[0];return v(n,0,xe(ke(0,r),u))}}function Bt(n,e,r){if(typeof r=="number"){var u=n?n.length:0;r=0>r?ke(0,u+r):r||0}else if(r)return r=Nt(n,e),n[r]===e?r:-1;return n?t(n,e,r):-1}function Pt(n,t,e){if(typeof t!="number"&&t!=d){var r=0,u=-1,a=n?n.length:0;for(t=_.createCallback(t,e,3);++u<a&&t(n[u],u,n);)r++}else r=t==d||e?1:ke(0,t);
return v(n,r)}function Nt(n,t,e,r){var u=0,a=n?n.length:u;for(e=e?_.createCallback(e,r,1):Wt,t=e(t);u<a;)r=u+a>>>1,e(n[r])<t?u=r+1:a=r;return u}function Ft(n,t,e,r){return typeof t!="boolean"&&t!=d&&(r=e,e=r&&r[t]===n?y:t,t=b),e!=d&&(e=_.createCallback(e,r,3)),rt(n,t,e)}function $t(){for(var n=1<arguments.length?arguments:arguments[0],t=-1,e=n?Ot(Ze(n,"length")):0,r=Jt(0>e?0:e);++t<e;)r[t]=Ze(n,t);return r}function zt(n,t){for(var e=-1,r=n?n.length:0,u={};++e<r;){var a=n[e];t?u[a]=t[e]:a&&(u[a[0]]=a[1])
}return u}function Rt(n,t){return at(n,t,Se.call(arguments,2),[])}function qt(n,t,e){function r(){ie(p),ie(g),f=0,p=g=d}function u(){var t=v&&(!h||1<f);r(),t&&(s!==false&&(c=new Mt),i=n.apply(l,o))}function a(){r(),(v||s!==t)&&(c=new Mt,i=n.apply(l,o))}var o,i,l,f=0,c=0,s=b,p=d,g=d,v=m;if(t=ke(0,t||0),e===m)var h=m,v=b;else yt(e)&&(h=e.leading,s="maxWait"in e&&ke(t,e.maxWait||0),v="trailing"in e?e.trailing:v);return function(){if(o=arguments,l=this,f++,ie(g),s===false)h&&2>f&&(i=n.apply(l,o));else{var e=new Mt;
!p&&!h&&(c=e);var r=s-(e-c);0<r?p||(p=he(a,r)):(ie(p),p=d,c=e,i=n.apply(l,o))}return t!==s&&(g=he(u,t)),i}}function Tt(n){var t=Se.call(arguments,1);return he(function(){n.apply(y,t)},1)}function Wt(n){return n}function Kt(n,t){t||(t=n,n=_);var e=ht(n);kt(gt(t),function(r){var u=n[r]=t[r];e&&(n.prototype[r]=function(){var t=this.__wrapped__,e=[t];return pe.apply(e,arguments),e=u.apply(n,e),t&&typeof t=="object"&&t===e?this:new j(e)})})}function Lt(){return this.__wrapped__}r=r?et.defaults(n.Object(),r,et.pick(n,R)):n;
var Jt=r.Array,Ht=r.Boolean,Mt=r.Date,Gt=r.Function,Ut=r.Math,Vt=r.Number,Qt=r.Object,Xt=r.RegExp,Yt=r.String,Zt=r.TypeError,ne=[],te=r.Error.prototype,ee=Qt.prototype,re=Yt.prototype,ue=r._,ae=Xt("^"+Yt(ee.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),oe=Ut.ceil,ie=r.clearTimeout,le=ae.test(le=Qt.defineProperty)&&le,fe=Ut.floor,ce=ae.test(ce=Qt.getPrototypeOf)&&ce,se=ee.hasOwnProperty,pe=ne.push,ge=ee.propertyIsEnumerable,ve=r.setImmediate,he=r.setTimeout,ye=ee.toString,me=ne.unshift,de=ae.test(de=ye.bind)&&de,be=ae.test(be=Qt.create)&&be,_e=ae.test(_e=Jt.isArray)&&_e,je=r.isFinite,we=r.isNaN,Ce=ae.test(Ce=Qt.keys)&&Ce,ke=Ut.max,xe=Ut.min,Oe=r.parseInt,Ee=Ut.random,Se=ne.slice,Ae=ae.test(r.attachEvent),De=de&&!/\n|true/.test(de+Ae),Ie={};
Ie[W]=Jt,Ie[K]=Ht,Ie[L]=Mt,Ie[H]=Gt,Ie[G]=Qt,Ie[M]=Vt,Ie[U]=Xt,Ie[V]=Yt;var Be={};Be[W]=Be[L]=Be[M]={constructor:m,toLocaleString:m,toString:m,valueOf:m},Be[K]=Be[V]={constructor:m,toString:m,valueOf:m},Be[J]=Be[H]=Be[U]={constructor:m,toString:m},Be[G]={constructor:m},function(){for(var n=q.length;n--;){var t,e=q[n];for(t in Be)se.call(Be,t)&&!se.call(Be[t],e)&&(Be[t][e]=b)}}(),j.prototype=_.prototype;var Pe=_.support={};!function(){function n(){this.x=1}var t={0:1,length:1},e=[];n.prototype={valueOf:1};
for(var r in new n)e.push(r);for(r in arguments);Pe.argsObject=arguments.constructor==Qt&&!(arguments instanceof Jt),Pe.argsClass=ye.call(arguments)==T,Pe.enumErrorProps=ge.call(te,"message")||ge.call(te,"name"),Pe.enumPrototypes=ge.call(n,"prototype"),Pe.fastBind=de&&!De,Pe.ownLast="x"!=e[0],Pe.nonEnumArgs=0!=r,Pe.nonEnumShadows=!/valueOf/.test(e),Pe.spliceObjects=(ne.splice.call(t,0,1),!t[0]),Pe.unindexedChars="xx"!="x"[0]+Qt("x")[0];try{Pe.nodeClass=!(ye.call(document)==G&&!({toString:0}+""))}catch(u){Pe.nodeClass=m
}}(1),_.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:N,variable:"",imports:{_:_}},be||(it=function(n){if(yt(n)){s.prototype=n;var t=new s;s.prototype=d}return t||{}}),Pe.argsClass||(pt=function(n){return n&&typeof n=="object"?se.call(n,"callee"):b});var Ne=_e||function(n){return n&&typeof n=="object"?ye.call(n)==W:b},Fe=ot({a:"y",e:"[]",i:"if(!(A[typeof y]))return D",g:"D.push(m)"}),$e=Ce?function(n){return yt(n)?Pe.enumPrototypes&&typeof n=="function"||Pe.nonEnumArgs&&n.length&&pt(n)?Fe(n):Ce(n):[]
}:Fe,ze={a:"f,d,J",i:"d=d&&typeof J=='undefined'?d:v.createCallback(d,J,3)",b:"typeof t=='number'",u:$e,g:"if(d(s[m],m,f)===false)return D"},Re={a:"y,G,k",i:"var a=arguments,b=0,c=typeof k=='number'?2:a.length;while(++b<c){s=a[b];if(s&&A[typeof s]){",u:$e,g:"if(typeof D[m]=='undefined')D[m]=s[m]",c:"}}"},qe={i:"if(!A[typeof s])return D;"+ze.i,b:b},Te={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},We=vt(Te),Ke=Xt("("+$e(We).join("|")+")","g"),Le=Xt("["+$e(Te).join("")+"]","g"),Je=ot(ze),He=ot(Re,{i:Re.i.replace(";",";if(c>3&&typeof a[c-2]=='function'){var d=v.createCallback(a[--c-1],a[c--],2)}else if(c>2&&typeof a[c-1]=='function'){d=a[--c]}"),g:"D[m]=d?d(D[m],s[m]):s[m]"}),Me=ot(Re),Ge=ot(ze,qe,{j:b}),Ue=ot(ze,qe);
ht(/x/)&&(ht=function(n){return typeof n=="function"&&ye.call(n)==H});var Ve=ce?function(n){if(!n||ye.call(n)!=G||!Pe.argsClass&&pt(n))return b;var t=n.valueOf,e=typeof t=="function"&&(e=ce(t))&&ce(e);return e?n==e||ce(n)==e:ct(n)}:ct,Qe=ut(function(n,t,e){se.call(n,e)?n[e]++:n[e]=1}),Xe=ut(function(n,t,e){(se.call(n,e)?n[e]:n[e]=[]).push(t)}),Ye=ut(function(n,t,e){n[e]=t}),Ze=xt;De&&nt&&typeof ve=="function"&&(Tt=Rt(ve,r));var nr=8==Oe(S+"08")?Oe:function(n,t){return Oe(dt(n)?n.replace(F,""):n,t||0)
};return _.after=function(n,t){return function(){return 1>--n?t.apply(this,arguments):void 0}},_.assign=He,_.at=function(n){var t=-1,e=Y(arguments,m,b,1),r=e.length,u=Jt(r);for(Pe.unindexedChars&&dt(n)&&(n=n.split(""));++t<r;)u[t]=n[e[t]];return u},_.bind=Rt,_.bindAll=function(n){for(var t=1<arguments.length?Y(arguments,m,b,1):gt(n),e=-1,r=t.length;++e<r;){var u=t[e];n[u]=Rt(n[u],n)}return n},_.bindKey=function(n,t){return at(n,t,Se.call(arguments,2),[],b,m)},_.compact=function(n){for(var t=-1,e=n?n.length:0,r=[];++t<e;){var u=n[t];
u&&r.push(u)}return r},_.compose=function(){var n=arguments;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];return t[0]}},_.countBy=Qe,_.createCallback=function(n,t,e){if(n==d)return Wt;var r=typeof n;if("function"!=r){if("object"!=r)return function(t){return t[n]};var u=$e(n),a=u[0],o=n[a];return 1!=u.length||o!==o||yt(o)?function(t){for(var e=u.length,r=b;e--&&(r=Z(t[u[e]],n[u[e]],d,m)););return r}:function(n){return n=n[a],o===n&&(0!==o||1/o==1/n)}}if(typeof t=="undefined")return n;
switch(e){case 1:return function(e){return n.call(t,e)};case 2:return function(e,r){return n.call(t,e,r)};case 3:return function(e,r,u){return n.call(t,e,r,u)};case 4:return function(e,r,u,a){return n.call(t,e,r,u,a)}}return Rt(n,t)},_.debounce=qt,_.defaults=Me,_.defer=Tt,_.delay=function(n,t){var e=Se.call(arguments,2);return he(function(){n.apply(y,e)},t)},_.difference=Dt,_.filter=wt,_.flatten=function(n,t,e,r){return typeof t!="boolean"&&t!=d&&(r=e,e=r&&r[t]===n?y:t,t=b),e!=d&&(n=xt(n,e,r)),Y(n,t)
},_.forEach=kt,_.forIn=Ge,_.forOwn=Ue,_.functions=gt,_.groupBy=Xe,_.indexBy=Ye,_.initial=function(n,t,e){if(!n)return[];var r=0,u=n.length;if(typeof t!="number"&&t!=d){var a=u;for(t=_.createCallback(t,e,3);a--&&t(n[a],a,n);)r++}else r=t==d||e?1:t||r;return v(n,0,xe(ke(0,u-r),u))},_.intersection=function(n){for(var r=arguments,u=r.length,a=-1,i=l(),f=-1,c=ft(),s=n?n.length:0,v=[],h=l();++a<u;){var y=r[a];i[a]=c===t&&(y?y.length:0)>=O&&o(a?r[a]:h)}n:for(;++f<s;){var m=i[0],y=n[f];if(0>(m?e(m,y):c(h,y))){for(a=u,(m||h).push(y);--a;)if(m=i[a],0>(m?e(m,y):c(r[a],y)))continue n;
v.push(y)}}for(;u--;)(m=i[u])&&g(m);return p(i),p(h),v},_.invert=vt,_.invoke=function(n,t){var e=Se.call(arguments,2),r=-1,u=typeof t=="function",a=n?n.length:0,o=Jt(typeof a=="number"?a:0);return kt(n,function(n){o[++r]=(u?t:n[t]).apply(n,e)}),o},_.keys=$e,_.map=xt,_.max=Ot,_.memoize=function(n,t){function e(){var r=e.cache,u=x+(t?t.apply(this,arguments):arguments[0]);return se.call(r,u)?r[u]:r[u]=n.apply(this,arguments)}return e.cache={},e},_.merge=function(n){var t=arguments,e=2;if(!yt(n))return n;
if("number"!=typeof t[2]&&(e=t.length),3<e&&"function"==typeof t[e-2])var r=_.createCallback(t[--e-1],t[e--],2);else 2<e&&"function"==typeof t[e-1]&&(r=t[--e]);for(var t=Se.call(arguments,1,e),u=-1,a=l(),o=l();++u<e;)tt(n,t[u],r,a,o);return p(a),p(o),n},_.min=function(n,t,e){var r=1/0,a=r;if(!t&&Ne(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];i<a&&(a=i)}}else t=!t&&dt(n)?u:_.createCallback(t,e,3),Je(n,function(n,e,u){e=t(n,e,u),e<r&&(r=e,a=n)});return a},_.omit=function(n,t,e){var r=ft(),u=typeof t=="function",a={};
if(u)t=_.createCallback(t,e,3);else var o=Y(arguments,m,b,1);return Ge(n,function(n,e,i){(u?!t(n,e,i):0>r(o,e))&&(a[e]=n)}),a},_.once=function(n){var t,e;return function(){return t?e:(t=m,e=n.apply(this,arguments),n=d,e)}},_.pairs=function(n){for(var t=-1,e=$e(n),r=e.length,u=Jt(r);++t<r;){var a=e[t];u[t]=[a,n[a]]}return u},_.partial=function(n){return at(n,d,Se.call(arguments,1),[],m)},_.partialRight=function(n){return at(n,d,[],Se.call(arguments,1),m,m)},_.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,a=Y(arguments,m,b,1),o=yt(n)?a.length:0;++u<o;){var i=a[u];
i in n&&(r[i]=n[i])}else t=_.createCallback(t,e,3),Ge(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},_.pluck=Ze,_.range=function(n,t,e){n=+n||0,e=+e||1,t==d&&(t=n,n=0);var r=-1;t=ke(0,oe((t-n)/e));for(var u=Jt(t);++r<t;)u[r]=n,n+=e;return u},_.reject=function(n,t,e){return t=_.createCallback(t,e,3),wt(n,function(n,e,r){return!t(n,e,r)})},_.rest=Pt,_.shuffle=function(n){var t=-1,e=n?n.length:0,r=Jt(typeof e=="number"?e:0);return kt(n,function(n){var e=fe(Ee()*(++t+1));r[t]=r[e],r[e]=n}),r},_.sortBy=function(n,t,e){var r=-1,u=n?n.length:0,o=Jt(typeof u=="number"?u:0);
for(t=_.createCallback(t,e,3),kt(n,function(n,e,u){var a=o[++r]=f();a.l=t(n,e,u),a.m=r,a.n=n}),u=o.length,o.sort(a);u--;)n=o[u],o[u]=n.n,g(n);return o},_.tap=function(n,t){return t(n),n},_.throttle=function(n,t,e){var r=m,u=m;return e===false?r=b:yt(e)&&(r="leading"in e?e.leading:r,u="trailing"in e?e.trailing:u),e=f(),e.leading=r,e.maxWait=t,e.trailing=u,n=qt(n,t,e),g(e),n},_.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=Jt(n);for(t=_.createCallback(t,e,1);++r<n;)u[r]=t(r);return u},_.toArray=function(n){return n&&typeof n.length=="number"?Pe.unindexedChars&&dt(n)?n.split(""):v(n):bt(n)
},_.transform=function(n,t,e,r){var u=Ne(n);return t=_.createCallback(t,r,4),e==d&&(u?e=[]:(r=n&&n.constructor,e=it(r&&r.prototype))),(u?Je:Ue)(n,function(n,r,u){return t(e,n,r,u)}),e},_.union=function(){return rt(Y(arguments,m,m))},_.uniq=Ft,_.values=bt,_.where=wt,_.without=function(n){return Dt(n,Se.call(arguments,1))},_.wrap=function(n,t){return function(){var e=[n];return pe.apply(e,arguments),t.apply(this,e)}},_.zip=$t,_.zipObject=zt,_.collect=xt,_.drop=Pt,_.each=kt,_.extend=He,_.methods=gt,_.object=zt,_.select=wt,_.tail=Pt,_.unique=Ft,_.unzip=$t,Kt(_),_.chain=_,_.prototype.chain=function(){return this
},_.clone=function(n,t,e,r){return typeof t!="boolean"&&t!=d&&(r=e,e=t,t=b),E(n,t,typeof e=="function"&&_.createCallback(e,r,1))},_.cloneDeep=function(n,t,e){return E(n,m,typeof t=="function"&&_.createCallback(t,e,1))},_.contains=_t,_.escape=function(n){return n==d?"":Yt(n).replace(Le,lt)},_.every=jt,_.find=Ct,_.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=_.createCallback(t,e,3);++r<u;)if(t(n[r],r,n))return r;return-1},_.findKey=function(n,t,e){var r;return t=_.createCallback(t,e,3),Ue(n,function(n,e,u){return t(n,e,u)?(r=e,b):void 0
}),r},_.has=function(n,t){return n?se.call(n,t):b},_.identity=Wt,_.indexOf=Bt,_.isArguments=pt,_.isArray=Ne,_.isBoolean=function(n){return n===m||n===false||ye.call(n)==K},_.isDate=function(n){return n?typeof n=="object"&&ye.call(n)==L:b},_.isElement=function(n){return n?1===n.nodeType:b},_.isEmpty=function(n){var t=m;if(!n)return t;var e=ye.call(n),r=n.length;return e==W||e==V||(Pe.argsClass?e==T:pt(n))||e==G&&typeof r=="number"&&ht(n.splice)?!r:(Ue(n,function(){return t=b}),t)},_.isEqual=function(n,t,e,r){return Z(n,t,typeof e=="function"&&_.createCallback(e,r,2))
},_.isFinite=function(n){return je(n)&&!we(parseFloat(n))},_.isFunction=ht,_.isNaN=function(n){return mt(n)&&n!=+n},_.isNull=function(n){return n===d},_.isNumber=mt,_.isObject=yt,_.isPlainObject=Ve,_.isRegExp=function(n){return n&&X[typeof n]?ye.call(n)==U:b},_.isString=dt,_.isUndefined=function(n){return typeof n=="undefined"},_.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?ke(0,r+e):xe(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},_.mixin=Kt,_.noConflict=function(){return r._=ue,this
},_.parseInt=nr,_.random=function(n,t){n==d&&t==d&&(t=1),n=+n||0,t==d?(t=n,n=0):t=+t||0;var e=Ee();return n%1||t%1?n+xe(e*(t-n+parseFloat("1e-"+((e+"").length-1))),t):n+fe(e*(t-n+1))},_.reduce=Et,_.reduceRight=St,_.result=function(n,t){var e=n?n[t]:y;return ht(e)?n[t]():e},_.runInContext=h,_.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:$e(n).length},_.some=At,_.sortedIndex=Nt,_.template=function(n,t,e){var r=_.templateSettings;n||(n=""),e=Me({},e,r);var u,a=Me({},e.imports,r.imports),r=$e(a),a=bt(a),o=0,l=e.interpolate||$,f="__p+='",l=Xt((e.escape||$).source+"|"+l.source+"|"+(l===N?B:$).source+"|"+(e.evaluate||$).source+"|$","g");
n.replace(l,function(t,e,r,a,l,c){return r||(r=a),f+=n.slice(o,c).replace(z,i),e&&(f+="'+__e("+e+")+'"),l&&(u=m,f+="';"+l+";__p+='"),r&&(f+="'+((__t=("+r+"))==null?'':__t)+'"),o=c+t.length,t}),f+="';\n",l=e=e.variable,l||(e="obj",f="with("+e+"){"+f+"}"),f=(u?f.replace(A,""):f).replace(D,"$1").replace(I,"$1;"),f="function("+e+"){"+(l?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+f+"return __p}";try{var c=Gt(r,"return "+f).apply(y,a)
}catch(s){throw s.source=f,s}return t?c(t):(c.source=f,c)},_.unescape=function(n){return n==d?"":Yt(n).replace(Ke,st)},_.uniqueId=function(n){var t=++w;return Yt(n==d?"":n)+t},_.all=jt,_.any=At,_.detect=Ct,_.findWhere=Ct,_.foldl=Et,_.foldr=St,_.include=_t,_.inject=Et,Ue(_,function(n,t){_.prototype[t]||(_.prototype[t]=function(){var t=[this.__wrapped__];return pe.apply(t,arguments),n.apply(_,t)})}),_.first=It,_.last=function(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&t!=d){var a=u;for(t=_.createCallback(t,e,3);a--&&t(n[a],a,n);)r++
}else if(r=t,r==d||e)return n[u-1];return v(n,ke(0,u-r))}},_.take=It,_.head=It,Ue(_,function(n,t){_.prototype[t]||(_.prototype[t]=function(t,e){var r=n(this.__wrapped__,t,e);return t==d||e&&typeof t!="function"?r:new j(r)})}),_.VERSION="1.3.1",_.prototype.toString=function(){return Yt(this.__wrapped__)},_.prototype.value=Lt,_.prototype.valueOf=Lt,Je(["join","pop","shift"],function(n){var t=ne[n];_.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}}),Je(["push","reverse","sort","unshift"],function(n){var t=ne[n];
_.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Je(["concat","slice","splice"],function(n){var t=ne[n];_.prototype[n]=function(){return new j(t.apply(this.__wrapped__,arguments))}}),Pe.spliceObjects||Je(["pop","shift","splice"],function(n){var t=ne[n],e="splice"==n;_.prototype[n]=function(){var n=this.__wrapped__,r=t.apply(n,arguments);return 0===n.length&&delete n[0],e?new j(r):r}}),_}var y,m=!0,d=null,b=!1,_=[],j=[],w=0,C={},x=+new Date+"",O=75,E=40,S=" \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",A=/\b__p\+='';/g,D=/\b(__p\+=)''\+/g,I=/(__e\(.*?\)|\b__t\))\+'';/g,B=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,P=/\w*$/,N=/<%=([\s\S]+?)%>/g,F=RegExp("^["+S+"]*0+(?=.$)"),$=/($^)/,z=/['\n\r\t\u2028\u2029\\]/g,R="Array Boolean Date Error Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),q="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),T="[object Arguments]",W="[object Array]",K="[object Boolean]",L="[object Date]",J="[object Error]",H="[object Function]",M="[object Number]",G="[object Object]",U="[object RegExp]",V="[object String]",Q={};
Q[H]=b,Q[T]=Q[W]=Q[K]=Q[L]=Q[M]=Q[G]=Q[U]=Q[V]=m;var X={"boolean":b,"function":m,object:m,number:b,string:b,undefined:b},Y={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},Z=X[typeof exports]&&exports,nt=X[typeof module]&&module&&module.exports==Z&&module,tt=X[typeof global]&&global;!tt||tt.global!==tt&&tt.window!==tt||(n=tt);var et=h();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=et, define(function(){return et})):Z&&!Z.nodeType?nt?(nt.exports=et)._=et:Z._=et:n._=et
}(this);

147
dist/lodash.js vendored
View File

@@ -506,12 +506,12 @@
* `after`, `assign`, `bind`, `bindAll`, `bindKey`, `chain`, `compact`,
* `compose`, `concat`, `countBy`, `createCallback`, `debounce`, `defaults`,
* `defer`, `delay`, `difference`, `filter`, `flatten`, `forEach`, `forIn`,
* `forOwn`, `functions`, `groupBy`, `initial`, `intersection`, `invert`,
* `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`,
* `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `push`, `range`,
* `reject`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`,
* `tap`, `throttle`, `times`, `toArray`, `transform`, `union`, `uniq`, `unshift`,
* `unzip`, `values`, `where`, `without`, `wrap`, and `zip`
* `forOwn`, `functions`, `groupBy`, `indexBy`, `initial`, `intersection`,
* `invert`, `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`,
* `omit`, `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `push`,
* `range`, `reject`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, `sortBy`,
* `splice`, `tap`, `throttle`, `times`, `toArray`, `transform`, `union`, `uniq`,
* `unshift`, `unzip`, `values`, `where`, `without`, `wrap`, and `zip`
*
* The non-chainable wrapper functions are:
* `clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `has`,
@@ -1056,6 +1056,28 @@
return result;
}
/**
* Creates a function that aggregates a collection, creating an object composed
* of keys generated from the results of running each element of the collection
* through a callback. The given `setter` function sets the keys and values
* of the composed object.
*
* @private
* @param {Function} setter The setter function.
* @returns {Function} Returns the new aggregator function.
*/
function createAggregator(setter) {
return function(collection, callback, thisArg) {
var result = {};
callback = lodash.createCallback(callback, thisArg, 3);
forEach(collection, function(value, key, collection) {
key = String(callback(value, key, collection));
setter(result, value, key, collection);
});
return result;
};
}
/**
* Creates a function that, when called, invokes `func` with the `this` binding
* of `thisArg` and prepends any `partialArgs` to the arguments passed to the
@@ -1176,14 +1198,14 @@
* @param {Function} func The function to set data on.
* @param {Mixed} value The value to set.
*/
function setBindData(func, value) {
var setBindData = !defineProperty ? noop : function(func, value) {
defineProperty(func, '__bindData__', {
'configurable': false,
'enumerable': false,
'value': value,
'writable': false
});
}
};
/**
* A fallback implementation of `isPlainObject` which checks if a given `value`
@@ -1917,7 +1939,7 @@
* Checks if `value` is `NaN`.
*
* Note: This is not the same as native `isNaN`, which will return `true` for
* `undefined` and other values. See http://es5.github.io/#x15.1.2.4.
* `undefined` and other non-numeric values. See http://es5.github.io/#x15.1.2.4.
*
* @static
* @memberOf _
@@ -2436,10 +2458,11 @@
}
/**
* Creates an object composed of keys returned from running each element of the
* `collection` through the given `callback`. The corresponding value of each key
* is the number of times the key was returned by the `callback`. The `callback`
* is bound to `thisArg` and invoked with three arguments; (value, index|key, collection).
* Creates an object composed of keys generated from the results of running
* each element of the `collection` through the given `callback`. The corresponding
* value of each key is the number of times the key was returned by the `callback`.
* The `callback` is bound to `thisArg` and invoked with three arguments;
* (value, index|key, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
@@ -2468,16 +2491,9 @@
* _.countBy(['one', 'two', 'three'], 'length');
* // => { '3': 2, '5': 1 }
*/
function countBy(collection, callback, thisArg) {
var result = {};
callback = lodash.createCallback(callback, thisArg, 3);
forEach(collection, function(value, key, collection) {
key = String(callback(value, key, collection));
(hasOwnProperty.call(result, key) ? result[key]++ : result[key] = 1);
});
return result;
}
var countBy = createAggregator(function(result, value, key) {
(hasOwnProperty.call(result, key) ? result[key]++ : result[key] = 1);
});
/**
* Checks if the `callback` returns a truthy value for **all** elements of a
@@ -2713,10 +2729,11 @@
}
/**
* Creates an object composed of keys returned from running each element of the
* `collection` through the `callback`. The corresponding value of each key is
* an array of elements passed to `callback` that returned the key. The `callback`
* is bound to `thisArg` and invoked with three arguments; (value, index|key, collection).
* Creates an object composed of keys generated from the results of running
* each element of the `collection` through the `callback`. The corresponding
* value of each key is an array of the elements responsible for generating
* the key. The `callback` is bound to `thisArg` and invoked with three
* arguments; (value, index|key, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
@@ -2746,16 +2763,52 @@
* _.groupBy(['one', 'two', 'three'], 'length');
* // => { '3': ['one', 'two'], '5': ['three'] }
*/
function groupBy(collection, callback, thisArg) {
var result = {};
callback = lodash.createCallback(callback, thisArg, 3);
var groupBy = createAggregator(function(result, value, key) {
(hasOwnProperty.call(result, key) ? result[key] : result[key] = []).push(value);
});
forEach(collection, function(value, key, collection) {
key = String(callback(value, key, collection));
(hasOwnProperty.call(result, key) ? result[key] : result[key] = []).push(value);
});
return result;
}
/**
* Creates an object composed of keys generated from the results of running
* each element of the `collection` through the given `callback`. The corresponding
* value of each key is the last element responsible for generating the key.
* The `callback` is bound to `thisArg` and invoked with three arguments;
* (value, index|key, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the properties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a property name or object is passed, it will be used to create
* a "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Object} Returns the composed aggregate object.
* @example
*
* var keys = [
* { 'dir': 'left', 'code': 97 },
* { 'dir': 'right', 'code': 100 }
* ];
*
* _.indexBy(keys, 'dir');
* // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
*
* _.indexBy(keys, function(key) { return String.fromCharCode(key.code); });
* // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
*
* _.indexBy(stooges, function(key) { this.fromCharCode(key.code); }, String);
* // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
*/
var indexBy = createAggregator(function(result, value, key) {
result[key] = value;
});
/**
* Invokes the method named by `methodName` on each element in the `collection`,
@@ -3902,7 +3955,8 @@
/**
* Creates an array of numbers (positive and/or negative) progressing from
* `start` up to but not including `end`.
* `start` up to but not including `end`. If `start` is less than `stop` a
* zero-length range is created unless a negative `step` is specified.
*
* @static
* @memberOf _
@@ -4487,20 +4541,20 @@
return result;
};
}
var bindData = func.__bindData__;
// exit early if there is no `thisArg`
if (typeof thisArg == 'undefined') {
return func;
}
var bindData = !func.name || func.__bindData__;
if (typeof bindData == 'undefined') {
// checks if `func` references the `this` keyword and stores the result
bindData = !reThis || reThis.test(fnToString.call(func));
setBindData(func, bindData);
}
if (typeof thisArg == 'undefined' || !bindData) {
// exit early if there are no `this` references or `func` is bound
if (bindData !== true && !(bindData && bindData[4])) {
return func;
}
else if (bindData !== true) {
// exit early if already bound or leverage bind optimizations if
// created by `_.partial` or `_.partialRight`
return bindData[4] ? bind(func, thisArg) : func;
}
switch (argCount) {
case 1: return function(value) {
return func.call(thisArg, value);
@@ -4515,9 +4569,7 @@
return func.call(thisArg, accumulator, value, index, collection);
};
}
return function() {
return func.apply(thisArg, arguments);
};
return bind(func, thisArg);
}
/**
@@ -5427,6 +5479,7 @@
lodash.forOwn = forOwn;
lodash.functions = functions;
lodash.groupBy = groupBy;
lodash.indexBy = indexBy;
lodash.initial = initial;
lodash.intersection = intersection;
lodash.invert = invert;

84
dist/lodash.min.js vendored
View File

@@ -3,46 +3,46 @@
* Lo-Dash 1.3.1 (Custom Build) lodash.com/license | Underscore.js 1.5.1 underscorejs.org/LICENSE
* Build: `lodash modern -o ./dist/lodash.js`
*/
;!function(n){function t(n,t,e){e=(e||0)-1;for(var r=n?n.length:0;++e<r;)if(n[e]===t)return e;return-1}function e(n,e){var r=typeof e;if(n=n.k,"boolean"==r||e==h)return n[e];"number"!=r&&"string"!=r&&(r="object");var u="number"==r?e:k+e;return n=n[r]||(n[r]={}),"object"==r?n[u]&&-1<t(n[u],e)?0:-1:n[u]?0:-1}function r(n){var t=this.k,e=typeof n;if("boolean"==e||n==h)t[n]=y;else{"number"!=e&&"string"!=e&&(e="object");var r="number"==e?n:k+n,t=t[e]||(t[e]={});"object"==e?(t[r]||(t[r]=[])).push(n):t[r]=y
}}function u(n){return n.charCodeAt(0)}function a(n,t){var e=n.m,r=t.m;if(n=n.l,t=t.l,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1}return e<r?-1:1}function o(n){var t=-1,e=n.length,u=n[0],a=n[e-1];if(u&&typeof u=="object"&&a&&typeof a=="object")return b;for(u=l(),u["false"]=u["null"]=u["true"]=u.undefined=b,a=l(),a.b=n,a.k=u,a.push=r;++t<e;)a.push(n[t]);return a}function i(n){return"\\"+H[n]}function f(){return m.pop()||[]}function l(){return d.pop()||{b:h,k:h,l:h,"false":b,m:0,leading:b,maxWait:0,"null":b,number:h,y:h,push:h,string:h,trailing:b,"true":b,undefined:b,n:h}
}function c(n){n.length=0,m.length<w&&m.push(n)}function p(n){var t=n.k;t&&p(t),n.b=n.k=n.l=n.object=n.number=n.string=n.n=h,d.length<w&&d.push(n)}function s(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Array(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function v(r){function m(n){if(!n||ge.call(n)!=K)return b;var t=n.valueOf,e=typeof t=="function"&&(e=le(t))&&le(e);return e?n==e||le(n)==e:lt(n)}function d(n,t,e){if(!n||!G[typeof n])return n;t=t&&typeof e=="undefined"?t:Y.createCallback(t,e,3);
for(var r=-1,u=G[typeof n]&&$e(n),a=u?u.length:0;++r<a&&(e=u[r],!(t(n[e],e,n)===false)););return n}function w(n,t,e){var r;if(!n||!G[typeof n])return n;t=t&&typeof e=="undefined"?t:Y.createCallback(t,e,3);for(r in n)if(t(n[r],r,n)===false)break;return n}function H(n,t,e){var r,u=n,a=u;if(!u)return a;for(var o=arguments,i=0,f=typeof e=="number"?2:o.length;++i<f;)if((u=o[i])&&G[typeof u])for(var l=-1,c=G[typeof u]&&$e(u),p=c?c.length:0;++l<p;)r=c[l],"undefined"==typeof a[r]&&(a[r]=u[r]);return a}function J(n,t,e){var r,u=n,a=u;
if(!u)return a;var o=arguments,i=0,f=typeof e=="number"?2:o.length;if(3<f&&"function"==typeof o[f-2])var l=Y.createCallback(o[--f-1],o[f--],2);else 2<f&&"function"==typeof o[f-1]&&(l=o[--f]);for(;++i<f;)if((u=o[i])&&G[typeof u])for(var c=-1,p=G[typeof u]&&$e(u),s=p?p.length:0;++c<s;)r=p[c],a[r]=l?l(a[r],u[r]):u[r];return a}function Q(n){var t,e=[];if(!n||!G[typeof n])return e;for(t in n)ce.call(n,t)&&e.push(t);return e}function Y(n){return n&&typeof n=="object"&&!Ne(n)&&ce.call(n,"__wrapped__")?n:new Z(n)
}function Z(n){this.__wrapped__=n}function nt(n,t,e,r,u){var a=n;if(e){if(a=e(a),typeof a!="undefined")return a;a=n}var o=yt(a);if(o){var i=ge.call(a);if(!V[i])return a;var l=Ne(a)}if(!o||!t)return o?l?s(a):J({},a):a;switch(o=Ae[i],i){case q:case z:return new o(+a);case P:case U:return new o(a);case M:return o(a.source,A.exec(a))}i=!r,r||(r=f()),u||(u=f());for(var p=r.length;p--;)if(r[p]==n)return u[p];return a=l?o(a.length):{},l&&(ce.call(n,"index")&&(a.index=n.index),ce.call(n,"input")&&(a.input=n.input)),r.push(n),u.push(a),(l?wt:d)(n,function(n,o){a[o]=nt(n,t,e,r,u)
}),i&&(c(r),c(u)),a}function tt(n,t,e,r){r=(r||0)-1;for(var u=n?n.length:0,a=[];++r<u;){var o=n[r];o&&typeof o=="object"&&(Ne(o)||pt(o))?pe.apply(a,t?o:tt(o,t,e)):e||a.push(o)}return a}function et(n,t,e,r,u,a){if(e){var o=e(n,t);if(typeof o!="undefined")return!!o}if(n===t)return 0!==n||1/n==1/t;if(n===n&&(!n||!G[typeof n])&&(!t||!G[typeof t]))return b;if(n==h||t==h)return n===t;var i=ge.call(n),l=ge.call(t);if(i==R&&(i=K),l==R&&(l=K),i!=l)return b;switch(i){case q:case z:return+n==+t;case P:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;
case M:case U:return n==Yt(t)}if(l=i==T,!l){if(ce.call(n,"__wrapped__")||ce.call(t,"__wrapped__"))return et(n.__wrapped__||n,t.__wrapped__||t,e,r,u,a);if(i!=K)return b;var i=n.constructor,p=t.constructor;if(i!=p&&(!gt(i)||!(i instanceof i&&gt(p)&&p instanceof p)))return b}for(p=!u,u||(u=f()),a||(a=f()),i=u.length;i--;)if(u[i]==n)return a[i]==t;var s=0,o=y;if(u.push(n),a.push(t),l){if(i=n.length,s=t.length,o=s==n.length,!o&&!r)return o;for(;s--;)if(l=i,p=t[s],r)for(;l--&&!(o=et(n[l],p,e,r,u,a)););else if(!(o=et(n[s],p,e,r,u,a)))break;
return o}return w(t,function(t,i,f){return ce.call(f,i)?(s++,o=ce.call(n,i)&&et(n[i],t,e,r,u,a)):void 0}),o&&!r&&w(n,function(n,t,e){return ce.call(e,t)?o=-1<--s:void 0}),p&&(c(u),c(a)),o}function rt(n,t,e,r,u){(Ne(t)?wt:d)(t,function(t,a){var o,i,f=t,l=n[a];if(t&&((i=Ne(t))||m(t))){for(f=r.length;f--;)if(o=r[f]==t){l=u[f];break}if(!o){var c;e&&(f=e(l,t),c=typeof f!="undefined")&&(l=f),c||(l=i?Ne(l)?l:[]:m(l)?l:{}),r.push(t),u.push(l),c||rt(l,t,e,r,u)}}else e&&(f=e(l,t),typeof f=="undefined"&&(f=t)),typeof f!="undefined"&&(l=f);
n[a]=l})}function ut(n,r,u){var a=-1,i=it(),l=n?n.length:0,s=[],v=!r&&l>=j&&i===t,g=u||v?f():s;if(v){var y=o(g);y?(i=e,g=y):(v=b,g=u?g:(c(g),s))}for(;++a<l;){var y=n[a],h=u?u(y,a,n):y;(r?!a||g[g.length-1]!==h:0>i(g,h))&&((u||v)&&g.push(h),s.push(y))}return v?(c(g.b),p(g)):u&&c(g),s}function at(n,t,e,r,u,a){var o=a&&!u;if(!gt(n)&&!o)throw new Zt;var i=n.__bindData__;if(i)return pe.apply(i[2],e),pe.apply(i[3],r),!u&&i[4]&&(i[1]=t,i[4]=b,i[5]=a),at.apply(h,i);if(u||a||r.length||!(Ie.fastBind||he&&e.length))f=function(){var a=arguments,i=u?this:t;
return o&&(n=t[l]),(e.length||r.length)&&(ye.apply(a,e),pe.apply(a,r)),this instanceof f?(i=yt(n.prototype)?be(n.prototype):{},a=n.apply(i,a),yt(a)?a:i):n.apply(i,a)};else{i=[n,t],pe.apply(i,e);var f=he.call.apply(he,i)}if(i=Oe.call(arguments),o){var l=t;t=n}return ft(f,i),f}function ot(n){return Be[n]}function it(){var n=(n=Y.indexOf)===$t?t:n;return n}function ft(n,t){oe(n,"__bindData__",{configurable:b,enumerable:b,value:t,writable:b})}function lt(n){var t,e;return n&&ge.call(n)==K&&(t=n.constructor,!gt(t)||t instanceof t)?(w(n,function(n,t){e=t
}),e===g||ce.call(n,e)):b}function ct(n){return De[n]}function pt(n){return n&&typeof n=="object"?ge.call(n)==R:b}function st(n){var t=[];return w(n,function(n,e){gt(n)&&t.push(e)}),t.sort()}function vt(n){for(var t=-1,e=$e(n),r=e.length,u={};++t<r;){var a=e[t];u[n[a]]=a}return u}function gt(n){return typeof n=="function"}function yt(n){return!(!n||!G[typeof n])}function ht(n){return typeof n=="number"||ge.call(n)==P}function bt(n){return typeof n=="string"||ge.call(n)==U}function mt(n){for(var t=-1,e=$e(n),r=e.length,u=Ut(r);++t<r;)u[t]=n[e[t]];
return u}function dt(n,t,e){var r=-1,u=it(),a=n?n.length:0,o=b;return e=(0>e?je(0,a+e):e)||0,a&&typeof a=="number"?o=-1<(bt(n)?n.indexOf(t,e):u(n,t,e)):d(n,function(n){return++r<e?void 0:!(o=n===t)}),o}function _t(n,t,e){var r=y;t=Y.createCallback(t,e,3),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u&&(r=!!t(n[e],e,n)););else d(n,function(n,e,u){return r=!!t(n,e,u)});return r}function kt(n,t,e){var r=[];t=Y.createCallback(t,e,3),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u;){var a=n[e];
t(a,e,n)&&r.push(a)}else d(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function jt(n,t,e){t=Y.createCallback(t,e,3),e=-1;var r=n?n.length:0;if(typeof r!="number"){var u;return d(n,function(n,e,r){return t(n,e,r)?(u=n,b):void 0}),u}for(;++e<r;){var a=n[e];if(t(a,e,n))return a}}function wt(n,t,e){var r=-1,u=n?n.length:0;if(t=t&&typeof e=="undefined"?t:Y.createCallback(t,e,3),typeof u=="number")for(;++r<u&&t(n[r],r,n)!==false;);else d(n,t);return n}function Ct(n,t,e){var r=-1,u=n?n.length:0;if(t=Y.createCallback(t,e,3),typeof u=="number")for(var a=Ut(u);++r<u;)a[r]=t(n[r],r,n);
else a=[],d(n,function(n,e,u){a[++r]=t(n,e,u)});return a}function xt(n,t,e){var r=-1/0,a=r;if(!t&&Ne(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];i>a&&(a=i)}}else t=!t&&bt(n)?u:Y.createCallback(t,e,3),wt(n,function(n,e,u){e=t(n,e,u),e>r&&(r=e,a=n)});return a}function Ot(n,t){var e=-1,r=n?n.length:0;if(typeof r=="number")for(var u=Ut(r);++e<r;)u[e]=n[e][t];return u||Ct(n,t)}function Et(n,t,e,r){if(!n)return e;var u=3>arguments.length;t=Y.createCallback(t,r,4);var a=-1,o=n.length;if(typeof o=="number")for(u&&(e=n[++a]);++a<o;)e=t(e,n[a],a,n);
else d(n,function(n,r,a){e=u?(u=b,n):t(e,n,r,a)});return e}function St(n,t,e,r){var u=n?n.length:0,a=3>arguments.length;if(typeof u!="number")var o=$e(n),u=o.length;return t=Y.createCallback(t,r,4),wt(n,function(r,i,f){i=o?o[--u]:--u,e=a?(a=b,n[i]):t(e,n[i],i,f)}),e}function At(n,t,e){var r;t=Y.createCallback(t,e,3),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u&&!(r=t(n[e],e,n)););else d(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function It(n){var r=-1,u=it(),a=n?n.length:0,i=tt(arguments,y,y,1),f=[],l=a>=j&&u===t;
if(l){var c=o(i);c?(u=e,i=c):l=b}for(;++r<a;)c=n[r],0>u(i,c)&&f.push(c);return l&&p(i),f}function Nt(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&t!=h){var a=-1;for(t=Y.createCallback(t,e,3);++a<u&&t(n[a],a,n);)r++}else if(r=t,r==h||e)return n[0];return s(n,0,we(je(0,r),u))}}function $t(n,e,r){if(typeof r=="number"){var u=n?n.length:0;r=0>r?je(0,u+r):r||0}else if(r)return r=Dt(n,e),n[r]===e?r:-1;return n?t(n,e,r):-1}function Bt(n,t,e){if(typeof t!="number"&&t!=h){var r=0,u=-1,a=n?n.length:0;
for(t=Y.createCallback(t,e,3);++u<a&&t(n[u],u,n);)r++}else r=t==h||e?1:je(0,t);return s(n,r)}function Dt(n,t,e,r){var u=0,a=n?n.length:u;for(e=e?Y.createCallback(e,r,1):Pt,t=e(t);u<a;)r=u+a>>>1,e(n[r])<t?u=r+1:a=r;return u}function Ft(n,t,e,r){return typeof t!="boolean"&&t!=h&&(r=e,e=r&&r[t]===n?g:t,t=b),e!=h&&(e=Y.createCallback(e,r,3)),ut(n,t,e)}function Rt(){for(var n=1<arguments.length?arguments:arguments[0],t=-1,e=n?xt(Ot(n,"length")):0,r=Ut(0>e?0:e);++t<e;)r[t]=Ot(n,t);return r}function Tt(n,t){for(var e=-1,r=n?n.length:0,u={};++e<r;){var a=n[e];
t?u[a]=t[e]:a&&(u[a[0]]=a[1])}return u}function qt(n,t){return at(n,t,Oe.call(arguments,2),[])}function zt(n,t,e){function r(){ae(s),ae(v),l=0,s=v=h}function u(){var t=g&&(!m||1<l);r(),t&&(p!==false&&(c=new Gt),i=n.apply(f,o))}function a(){r(),(g||p!==t)&&(c=new Gt,i=n.apply(f,o))}var o,i,f,l=0,c=0,p=b,s=h,v=h,g=y;if(t=je(0,t||0),e===y)var m=y,g=b;else yt(e)&&(m=e.leading,p="maxWait"in e&&je(t,e.maxWait||0),g="trailing"in e?e.trailing:g);return function(){if(o=arguments,f=this,l++,ae(v),p===false)m&&2>l&&(i=n.apply(f,o));
else{var e=new Gt;!s&&!m&&(c=e);var r=p-(e-c);0<r?s||(s=ve(a,r)):(ae(s),s=h,c=e,i=n.apply(f,o))}return t!==p&&(v=ve(u,t)),i}}function Wt(n){var t=Oe.call(arguments,1);return ve(function(){n.apply(g,t)},1)}function Pt(n){return n}function Kt(n,t){t||(t=n,n=Y);var e=gt(n);wt(st(t),function(r){var u=n[r]=t[r];e&&(n.prototype[r]=function(){var t=this.__wrapped__,e=[t];return pe.apply(e,arguments),e=u.apply(n,e),t&&typeof t=="object"&&t===e?this:new Z(e)})})}function Mt(){return this.__wrapped__}r=r?X.defaults(n.Object(),r,X.pick(n,F)):n;
var Ut=r.Array,Vt=r.Boolean,Gt=r.Date,Ht=r.Function,Jt=r.Math,Lt=r.Number,Qt=r.Object,Xt=r.RegExp,Yt=r.String,Zt=r.TypeError,ne=[],te=Qt.prototype,ee=r._,re=Xt("^"+Yt(te.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),ue=Jt.ceil,ae=r.clearTimeout,oe=re.test(oe=Qt.defineProperty)&&oe,ie=Jt.floor,fe=Ht.prototype.toString,le=re.test(le=Qt.getPrototypeOf)&&le,ce=te.hasOwnProperty,pe=ne.push,se=r.setImmediate,ve=r.setTimeout,ge=te.toString,ye=ne.unshift,he=re.test(he=ge.bind)&&he,be=re.test(be=Qt.create)&&be,me=re.test(me=Ut.isArray)&&me,de=r.isFinite,_e=r.isNaN,ke=re.test(ke=Qt.keys)&&ke,je=Jt.max,we=Jt.min,Ce=r.parseInt,xe=Jt.random,Oe=ne.slice,Ee=re.test(r.attachEvent),Se=he&&!/\n|true/.test(he+Ee),Ae={};
Ae[T]=Ut,Ae[q]=Vt,Ae[z]=Gt,Ae[W]=Ht,Ae[K]=Qt,Ae[P]=Lt,Ae[M]=Xt,Ae[U]=Yt,Z.prototype=Y.prototype;var Ie=Y.support={};Ie.fastBind=he&&!Se,Y.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:I,variable:"",imports:{_:Y}};var Ne=me,$e=ke?function(n){return yt(n)?ke(n):[]}:Q,Be={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},De=vt(Be),Fe=Xt("("+$e(De).join("|")+")","g"),Re=Xt("["+$e(Be).join("")+"]","g");Se&&L&&typeof se=="function"&&(Wt=qt(se,r));var Te=8==Ce(C+"08")?Ce:function(n,t){return Ce(bt(n)?n.replace(N,""):n,t||0)
};return Y.after=function(n,t){return function(){return 1>--n?t.apply(this,arguments):void 0}},Y.assign=J,Y.at=function(n){for(var t=-1,e=tt(arguments,y,b,1),r=e.length,u=Ut(r);++t<r;)u[t]=n[e[t]];return u},Y.bind=qt,Y.bindAll=function(n){for(var t=1<arguments.length?tt(arguments,y,b,1):st(n),e=-1,r=t.length;++e<r;){var u=t[e];n[u]=qt(n[u],n)}return n},Y.bindKey=function(n,t){return at(n,t,Oe.call(arguments,2),[],b,y)},Y.compact=function(n){for(var t=-1,e=n?n.length:0,r=[];++t<e;){var u=n[t];u&&r.push(u)
}return r},Y.compose=function(){var n=arguments;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];return t[0]}},Y.countBy=function(n,t,e){var r={};return t=Y.createCallback(t,e,3),wt(n,function(n,e,u){e=Yt(t(n,e,u)),ce.call(r,e)?r[e]++:r[e]=1}),r},Y.createCallback=function(n,t,e){if(n==h)return Pt;var r=typeof n;if("function"!=r){if("object"!=r)return function(t){return t[n]};var u=$e(n),a=u[0],o=n[a];return 1!=u.length||o!==o||yt(o)?function(t){for(var e=u.length,r=b;e--&&(r=et(t[u[e]],n[u[e]],h,y)););return r
}:function(n){return n=n[a],o===n&&(0!==o||1/o==1/n)}}if(r=n.__bindData__,typeof r=="undefined"&&(r=!B||B.test(fe.call(n)),ft(n,r)),typeof t=="undefined"||!r)return n;if(r!==y)return r[4]?qt(n,t):n;switch(e){case 1:return function(e){return n.call(t,e)};case 2:return function(e,r){return n.call(t,e,r)};case 3:return function(e,r,u){return n.call(t,e,r,u)};case 4:return function(e,r,u,a){return n.call(t,e,r,u,a)}}return function(){return n.apply(t,arguments)}},Y.debounce=zt,Y.defaults=H,Y.defer=Wt,Y.delay=function(n,t){var e=Oe.call(arguments,2);
return ve(function(){n.apply(g,e)},t)},Y.difference=It,Y.filter=kt,Y.flatten=function(n,t,e,r){return typeof t!="boolean"&&t!=h&&(r=e,e=r&&r[t]===n?g:t,t=b),e!=h&&(n=Ct(n,e,r)),tt(n,t)},Y.forEach=wt,Y.forIn=w,Y.forOwn=d,Y.functions=st,Y.groupBy=function(n,t,e){var r={};return t=Y.createCallback(t,e,3),wt(n,function(n,e,u){e=Yt(t(n,e,u)),(ce.call(r,e)?r[e]:r[e]=[]).push(n)}),r},Y.initial=function(n,t,e){if(!n)return[];var r=0,u=n.length;if(typeof t!="number"&&t!=h){var a=u;for(t=Y.createCallback(t,e,3);a--&&t(n[a],a,n);)r++
}else r=t==h||e?1:t||r;return s(n,0,we(je(0,u-r),u))},Y.intersection=function(n){for(var r=arguments,u=r.length,a=-1,i=f(),l=-1,s=it(),v=n?n.length:0,g=[],y=f();++a<u;){var h=r[a];i[a]=s===t&&(h?h.length:0)>=j&&o(a?r[a]:y)}n:for(;++l<v;){var b=i[0],h=n[l];if(0>(b?e(b,h):s(y,h))){for(a=u,(b||y).push(h);--a;)if(b=i[a],0>(b?e(b,h):s(r[a],h)))continue n;g.push(h)}}for(;u--;)(b=i[u])&&p(b);return c(i),c(y),g},Y.invert=vt,Y.invoke=function(n,t){var e=Oe.call(arguments,2),r=-1,u=typeof t=="function",a=n?n.length:0,o=Ut(typeof a=="number"?a:0);
return wt(n,function(n){o[++r]=(u?t:n[t]).apply(n,e)}),o},Y.keys=$e,Y.map=Ct,Y.max=xt,Y.memoize=function(n,t){function e(){var r=e.cache,u=k+(t?t.apply(this,arguments):arguments[0]);return ce.call(r,u)?r[u]:r[u]=n.apply(this,arguments)}return e.cache={},e},Y.merge=function(n){var t=arguments,e=2;if(!yt(n))return n;if("number"!=typeof t[2]&&(e=t.length),3<e&&"function"==typeof t[e-2])var r=Y.createCallback(t[--e-1],t[e--],2);else 2<e&&"function"==typeof t[e-1]&&(r=t[--e]);for(var t=Oe.call(arguments,1,e),u=-1,a=f(),o=f();++u<e;)rt(n,t[u],r,a,o);
return c(a),c(o),n},Y.min=function(n,t,e){var r=1/0,a=r;if(!t&&Ne(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];i<a&&(a=i)}}else t=!t&&bt(n)?u:Y.createCallback(t,e,3),wt(n,function(n,e,u){e=t(n,e,u),e<r&&(r=e,a=n)});return a},Y.omit=function(n,t,e){var r=it(),u=typeof t=="function",a={};if(u)t=Y.createCallback(t,e,3);else var o=tt(arguments,y,b,1);return w(n,function(n,e,i){(u?!t(n,e,i):0>r(o,e))&&(a[e]=n)}),a},Y.once=function(n){var t,e;return function(){return t?e:(t=y,e=n.apply(this,arguments),n=h,e)
}},Y.pairs=function(n){for(var t=-1,e=$e(n),r=e.length,u=Ut(r);++t<r;){var a=e[t];u[t]=[a,n[a]]}return u},Y.partial=function(n){return at(n,h,Oe.call(arguments,1),[],y)},Y.partialRight=function(n){return at(n,h,[],Oe.call(arguments,1),y,y)},Y.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,a=tt(arguments,y,b,1),o=yt(n)?a.length:0;++u<o;){var i=a[u];i in n&&(r[i]=n[i])}else t=Y.createCallback(t,e,3),w(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},Y.pluck=Ot,Y.range=function(n,t,e){n=+n||0,e=+e||1,t==h&&(t=n,n=0);
var r=-1;t=je(0,ue((t-n)/e));for(var u=Ut(t);++r<t;)u[r]=n,n+=e;return u},Y.reject=function(n,t,e){return t=Y.createCallback(t,e,3),kt(n,function(n,e,r){return!t(n,e,r)})},Y.rest=Bt,Y.shuffle=function(n){var t=-1,e=n?n.length:0,r=Ut(typeof e=="number"?e:0);return wt(n,function(n){var e=ie(xe()*(++t+1));r[t]=r[e],r[e]=n}),r},Y.sortBy=function(n,t,e){var r=-1,u=n?n.length:0,o=Ut(typeof u=="number"?u:0);for(t=Y.createCallback(t,e,3),wt(n,function(n,e,u){var a=o[++r]=l();a.l=t(n,e,u),a.m=r,a.n=n}),u=o.length,o.sort(a);u--;)n=o[u],o[u]=n.n,p(n);
return o},Y.tap=function(n,t){return t(n),n},Y.throttle=function(n,t,e){var r=y,u=y;return e===false?r=b:yt(e)&&(r="leading"in e?e.leading:r,u="trailing"in e?e.trailing:u),e=l(),e.leading=r,e.maxWait=t,e.trailing=u,n=zt(n,t,e),p(e),n},Y.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=Ut(n);for(t=Y.createCallback(t,e,1);++r<n;)u[r]=t(r);return u},Y.toArray=function(n){return n&&typeof n.length=="number"?s(n):mt(n)},Y.transform=function(n,t,e,r){var u=Ne(n);return t=Y.createCallback(t,r,4),e==h&&(u?e=[]:(r=n&&n.constructor,e=yt(r&&r.prototype)?be(r&&r.prototype):{})),(u?wt:d)(n,function(n,r,u){return t(e,n,r,u)
}),e},Y.union=function(){return ut(tt(arguments,y,y))},Y.uniq=Ft,Y.values=mt,Y.where=kt,Y.without=function(n){return It(n,Oe.call(arguments,1))},Y.wrap=function(n,t){return function(){var e=[n];return pe.apply(e,arguments),t.apply(this,e)}},Y.zip=Rt,Y.zipObject=Tt,Y.collect=Ct,Y.drop=Bt,Y.each=wt,Y.extend=J,Y.methods=st,Y.object=Tt,Y.select=kt,Y.tail=Bt,Y.unique=Ft,Y.unzip=Rt,Kt(Y),Y.chain=Y,Y.prototype.chain=function(){return this},Y.clone=function(n,t,e,r){return typeof t!="boolean"&&t!=h&&(r=e,e=t,t=b),nt(n,t,typeof e=="function"&&Y.createCallback(e,r,1))
},Y.cloneDeep=function(n,t,e){return nt(n,y,typeof t=="function"&&Y.createCallback(t,e,1))},Y.contains=dt,Y.escape=function(n){return n==h?"":Yt(n).replace(Re,ot)},Y.every=_t,Y.find=jt,Y.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=Y.createCallback(t,e,3);++r<u;)if(t(n[r],r,n))return r;return-1},Y.findKey=function(n,t,e){var r;return t=Y.createCallback(t,e,3),d(n,function(n,e,u){return t(n,e,u)?(r=e,b):void 0}),r},Y.has=function(n,t){return n?ce.call(n,t):b},Y.identity=Pt,Y.indexOf=$t,Y.isArguments=pt,Y.isArray=Ne,Y.isBoolean=function(n){return n===y||n===false||ge.call(n)==q
},Y.isDate=function(n){return n?typeof n=="object"&&ge.call(n)==z:b},Y.isElement=function(n){return n?1===n.nodeType:b},Y.isEmpty=function(n){var t=y;if(!n)return t;var e=ge.call(n),r=n.length;return e==T||e==U||e==R||e==K&&typeof r=="number"&&gt(n.splice)?!r:(d(n,function(){return t=b}),t)},Y.isEqual=function(n,t,e,r){return et(n,t,typeof e=="function"&&Y.createCallback(e,r,2))},Y.isFinite=function(n){return de(n)&&!_e(parseFloat(n))},Y.isFunction=gt,Y.isNaN=function(n){return ht(n)&&n!=+n},Y.isNull=function(n){return n===h
},Y.isNumber=ht,Y.isObject=yt,Y.isPlainObject=m,Y.isRegExp=function(n){return n?typeof n=="object"&&ge.call(n)==M:b},Y.isString=bt,Y.isUndefined=function(n){return typeof n=="undefined"},Y.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?je(0,r+e):we(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},Y.mixin=Kt,Y.noConflict=function(){return r._=ee,this},Y.parseInt=Te,Y.random=function(n,t){n==h&&t==h&&(t=1),n=+n||0,t==h?(t=n,n=0):t=+t||0;var e=xe();return n%1||t%1?n+we(e*(t-n+parseFloat("1e-"+((e+"").length-1))),t):n+ie(e*(t-n+1))
},Y.reduce=Et,Y.reduceRight=St,Y.result=function(n,t){var e=n?n[t]:g;return gt(e)?n[t]():e},Y.runInContext=v,Y.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:$e(n).length},Y.some=At,Y.sortedIndex=Dt,Y.template=function(n,t,e){var r=Y.templateSettings;n||(n=""),e=H({},e,r);var u,a=H({},e.imports,r.imports),r=$e(a),a=mt(a),o=0,f=e.interpolate||$,l="__p+='",f=Xt((e.escape||$).source+"|"+f.source+"|"+(f===I?S:$).source+"|"+(e.evaluate||$).source+"|$","g");n.replace(f,function(t,e,r,a,f,c){return r||(r=a),l+=n.slice(o,c).replace(D,i),e&&(l+="'+__e("+e+")+'"),f&&(u=y,l+="';"+f+";__p+='"),r&&(l+="'+((__t=("+r+"))==null?'':__t)+'"),o=c+t.length,t
}),l+="';\n",f=e=e.variable,f||(e="obj",l="with("+e+"){"+l+"}"),l=(u?l.replace(x,""):l).replace(O,"$1").replace(E,"$1;"),l="function("+e+"){"+(f?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}";try{var c=Ht(r,"return "+l).apply(g,a)}catch(p){throw p.source=l,p}return t?c(t):(c.source=l,c)},Y.unescape=function(n){return n==h?"":Yt(n).replace(Fe,ct)},Y.uniqueId=function(n){var t=++_;return Yt(n==h?"":n)+t
},Y.all=_t,Y.any=At,Y.detect=jt,Y.findWhere=jt,Y.foldl=Et,Y.foldr=St,Y.include=dt,Y.inject=Et,d(Y,function(n,t){Y.prototype[t]||(Y.prototype[t]=function(){var t=[this.__wrapped__];return pe.apply(t,arguments),n.apply(Y,t)})}),Y.first=Nt,Y.last=function(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&t!=h){var a=u;for(t=Y.createCallback(t,e,3);a--&&t(n[a],a,n);)r++}else if(r=t,r==h||e)return n[u-1];return s(n,je(0,u-r))}},Y.take=Nt,Y.head=Nt,d(Y,function(n,t){Y.prototype[t]||(Y.prototype[t]=function(t,e){var r=n(this.__wrapped__,t,e);
return t==h||e&&typeof t!="function"?r:new Z(r)})}),Y.VERSION="1.3.1",Y.prototype.toString=function(){return Yt(this.__wrapped__)},Y.prototype.value=Mt,Y.prototype.valueOf=Mt,wt(["join","pop","shift"],function(n){var t=ne[n];Y.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}}),wt(["push","reverse","sort","unshift"],function(n){var t=ne[n];Y.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),wt(["concat","slice","splice"],function(n){var t=ne[n];Y.prototype[n]=function(){return new Z(t.apply(this.__wrapped__,arguments))
}}),Y}var g,y=!0,h=null,b=!1,m=[],d=[],_=0,k=+new Date+"",j=75,w=40,C=" \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",x=/\b__p\+='';/g,O=/\b(__p\+=)''\+/g,E=/(__e\(.*?\)|\b__t\))\+'';/g,S=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,A=/\w*$/,I=/<%=([\s\S]+?)%>/g,N=RegExp("^["+C+"]*0+(?=.$)"),$=/($^)/,B=(B=/\bthis\b/)&&B.test(v)&&B,D=/['\n\r\t\u2028\u2029\\]/g,F="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),R="[object Arguments]",T="[object Array]",q="[object Boolean]",z="[object Date]",W="[object Function]",P="[object Number]",K="[object Object]",M="[object RegExp]",U="[object String]",V={};
V[W]=b,V[R]=V[T]=V[q]=V[z]=V[P]=V[K]=V[M]=V[U]=y;var G={"boolean":b,"function":y,object:y,number:b,string:b,undefined:b},H={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},J=G[typeof exports]&&exports,L=G[typeof module]&&module&&module.exports==J&&module,Q=G[typeof global]&&global;!Q||Q.global!==Q&&Q.window!==Q||(n=Q);var X=v();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=X, define(function(){return X})):J&&!J.nodeType?L?(L.exports=X)._=X:J._=X:n._=X
;!function(n){function t(n,t,e){e=(e||0)-1;for(var r=n?n.length:0;++e<r;)if(n[e]===t)return e;return-1}function e(n,e){var r=typeof e;if(n=n.k,"boolean"==r||e==b)return n[e];"number"!=r&&"string"!=r&&(r="object");var u="number"==r?e:j+e;return n=n[r]||(n[r]={}),"object"==r?n[u]&&-1<t(n[u],e)?0:-1:n[u]?0:-1}function r(n){var t=this.k,e=typeof n;if("boolean"==e||n==b)t[n]=h;else{"number"!=e&&"string"!=e&&(e="object");var r="number"==e?n:j+n,t=t[e]||(t[e]={});"object"==e?(t[r]||(t[r]=[])).push(n):t[r]=h
}}function u(n){return n.charCodeAt(0)}function a(n,t){var e=n.m,r=t.m;if(n=n.l,t=t.l,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1}return e<r?-1:1}function o(n){var t=-1,e=n.length,u=n[0],a=n[e-1];if(u&&typeof u=="object"&&a&&typeof a=="object")return m;for(u=l(),u["false"]=u["null"]=u["true"]=u.undefined=m,a=l(),a.b=n,a.k=u,a.push=r;++t<e;)a.push(n[t]);return a}function i(n){return"\\"+J[n]}function f(){return d.pop()||[]}function l(){return _.pop()||{b:b,k:b,l:b,"false":m,m:0,leading:m,maxWait:0,"null":m,number:b,y:b,push:b,string:b,trailing:m,"true":m,undefined:m,n:b}
}function c(){}function p(n){n.length=0,d.length<C&&d.push(n)}function s(n){var t=n.k;t&&s(t),n.b=n.k=n.l=n.object=n.number=n.string=n.n=b,_.length<C&&_.push(n)}function v(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Array(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function g(r){function d(n){if(!n||ye.call(n)!=M)return m;var t=n.valueOf,e=typeof t=="function"&&(e=ce(t))&&ce(e);return e?n==e||ce(n)==e:ct(n)}function _(n,t,e){if(!n||!H[typeof n])return n;t=t&&typeof e=="undefined"?t:Z.createCallback(t,e,3);
for(var r=-1,u=H[typeof n]&&De(n),a=u?u.length:0;++r<a&&(e=u[r],!(t(n[e],e,n)===false)););return n}function C(n,t,e){var r;if(!n||!H[typeof n])return n;t=t&&typeof e=="undefined"?t:Z.createCallback(t,e,3);for(r in n)if(t(n[r],r,n)===false)break;return n}function J(n,t,e){var r,u=n,a=u;if(!u)return a;for(var o=arguments,i=0,f=typeof e=="number"?2:o.length;++i<f;)if((u=o[i])&&H[typeof u])for(var l=-1,c=H[typeof u]&&De(u),p=c?c.length:0;++l<p;)r=c[l],"undefined"==typeof a[r]&&(a[r]=u[r]);return a}function L(n,t,e){var r,u=n,a=u;
if(!u)return a;var o=arguments,i=0,f=typeof e=="number"?2:o.length;if(3<f&&"function"==typeof o[f-2])var l=Z.createCallback(o[--f-1],o[f--],2);else 2<f&&"function"==typeof o[f-1]&&(l=o[--f]);for(;++i<f;)if((u=o[i])&&H[typeof u])for(var c=-1,p=H[typeof u]&&De(u),s=p?p.length:0;++c<s;)r=p[c],a[r]=l?l(a[r],u[r]):u[r];return a}function X(n){var t,e=[];if(!n||!H[typeof n])return e;for(t in n)pe.call(n,t)&&e.push(t);return e}function Z(n){return n&&typeof n=="object"&&!$e(n)&&pe.call(n,"__wrapped__")?n:new nt(n)
}function nt(n){this.__wrapped__=n}function tt(n,t,e,r,u){var a=n;if(e){if(a=e(a),typeof a!="undefined")return a;a=n}var o=ht(a);if(o){var i=ye.call(a);if(!G[i])return a;var l=$e(a)}if(!o||!t)return o?l?v(a):L({},a):a;switch(o=Ie[i],i){case z:case W:return new o(+a);case K:case V:return new o(a);case U:return o(a.source,I.exec(a))}i=!r,r||(r=f()),u||(u=f());for(var c=r.length;c--;)if(r[c]==n)return u[c];return a=l?o(a.length):{},l&&(pe.call(n,"index")&&(a.index=n.index),pe.call(n,"input")&&(a.input=n.input)),r.push(n),u.push(a),(l?Ct:_)(n,function(n,o){a[o]=tt(n,t,e,r,u)
}),i&&(p(r),p(u)),a}function et(n,t,e,r){r=(r||0)-1;for(var u=n?n.length:0,a=[];++r<u;){var o=n[r];o&&typeof o=="object"&&($e(o)||st(o))?se.apply(a,t?o:et(o,t,e)):e||a.push(o)}return a}function rt(n,t,e,r,u,a){if(e){var o=e(n,t);if(typeof o!="undefined")return!!o}if(n===t)return 0!==n||1/n==1/t;if(n===n&&(!n||!H[typeof n])&&(!t||!H[typeof t]))return m;if(n==b||t==b)return n===t;var i=ye.call(n),l=ye.call(t);if(i==T&&(i=M),l==T&&(l=M),i!=l)return m;switch(i){case z:case W:return+n==+t;case K:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;
case U:case V:return n==Zt(t)}if(l=i==q,!l){if(pe.call(n,"__wrapped__")||pe.call(t,"__wrapped__"))return rt(n.__wrapped__||n,t.__wrapped__||t,e,r,u,a);if(i!=M)return m;var i=n.constructor,c=t.constructor;if(i!=c&&(!yt(i)||!(i instanceof i&&yt(c)&&c instanceof c)))return m}for(c=!u,u||(u=f()),a||(a=f()),i=u.length;i--;)if(u[i]==n)return a[i]==t;var s=0,o=h;if(u.push(n),a.push(t),l){if(i=n.length,s=t.length,o=s==n.length,!o&&!r)return o;for(;s--;)if(l=i,c=t[s],r)for(;l--&&!(o=rt(n[l],c,e,r,u,a)););else if(!(o=rt(n[s],c,e,r,u,a)))break;
return o}return C(t,function(t,i,f){return pe.call(f,i)?(s++,o=pe.call(n,i)&&rt(n[i],t,e,r,u,a)):void 0}),o&&!r&&C(n,function(n,t,e){return pe.call(e,t)?o=-1<--s:void 0}),c&&(p(u),p(a)),o}function ut(n,t,e,r,u){($e(t)?Ct:_)(t,function(t,a){var o,i,f=t,l=n[a];if(t&&((i=$e(t))||d(t))){for(f=r.length;f--;)if(o=r[f]==t){l=u[f];break}if(!o){var c;e&&(f=e(l,t),c=typeof f!="undefined")&&(l=f),c||(l=i?$e(l)?l:[]:d(l)?l:{}),r.push(t),u.push(l),c||ut(l,t,e,r,u)}}else e&&(f=e(l,t),typeof f=="undefined"&&(f=t)),typeof f!="undefined"&&(l=f);
n[a]=l})}function at(n,r,u){var a=-1,i=lt(),l=n?n.length:0,c=[],v=!r&&l>=w&&i===t,g=u||v?f():c;if(v){var y=o(g);y?(i=e,g=y):(v=m,g=u?g:(p(g),c))}for(;++a<l;){var y=n[a],h=u?u(y,a,n):y;(r?!a||g[g.length-1]!==h:0>i(g,h))&&((u||v)&&g.push(h),c.push(y))}return v?(p(g.b),s(g)):u&&p(g),c}function ot(n){return function(t,e,r){var u={};return e=Z.createCallback(e,r,3),Ct(t,function(t,r,a){r=Zt(e(t,r,a)),n(u,t,r,a)}),u}}function it(n,t,e,r,u,a){var o=a&&!u;if(!yt(n)&&!o)throw new ne;var i=n.__bindData__;if(i)return se.apply(i[2],e),se.apply(i[3],r),!u&&i[4]&&(i[1]=t,i[4]=m,i[5]=a),it.apply(b,i);
if(u||a||r.length||!(Ne.fastBind||be&&e.length))f=function(){var a=arguments,i=u?this:t;return o&&(n=t[l]),(e.length||r.length)&&(he.apply(a,e),se.apply(a,r)),this instanceof f?(i=ht(n.prototype)?me(n.prototype):{},a=n.apply(i,a),ht(a)?a:i):n.apply(i,a)};else{i=[n,t],se.apply(i,e);var f=be.call.apply(be,i)}if(i=Ee.call(arguments),o){var l=t;t=n}return Be(f,i),f}function ft(n){return Fe[n]}function lt(){var n=(n=Z.indexOf)===$t?t:n;return n}function ct(n){var t,e;return n&&ye.call(n)==M&&(t=n.constructor,!yt(t)||t instanceof t)?(C(n,function(n,t){e=t
}),e===y||pe.call(n,e)):m}function pt(n){return Re[n]}function st(n){return n&&typeof n=="object"?ye.call(n)==T:m}function vt(n){var t=[];return C(n,function(n,e){yt(n)&&t.push(e)}),t.sort()}function gt(n){for(var t=-1,e=De(n),r=e.length,u={};++t<r;){var a=e[t];u[n[a]]=a}return u}function yt(n){return typeof n=="function"}function ht(n){return!(!n||!H[typeof n])}function bt(n){return typeof n=="number"||ye.call(n)==K}function mt(n){return typeof n=="string"||ye.call(n)==V}function dt(n){for(var t=-1,e=De(n),r=e.length,u=Vt(r);++t<r;)u[t]=n[e[t]];
return u}function _t(n,t,e){var r=-1,u=lt(),a=n?n.length:0,o=m;return e=(0>e?we(0,a+e):e)||0,a&&typeof a=="number"?o=-1<(mt(n)?n.indexOf(t,e):u(n,t,e)):_(n,function(n){return++r<e?void 0:!(o=n===t)}),o}function kt(n,t,e){var r=h;t=Z.createCallback(t,e,3),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u&&(r=!!t(n[e],e,n)););else _(n,function(n,e,u){return r=!!t(n,e,u)});return r}function jt(n,t,e){var r=[];t=Z.createCallback(t,e,3),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u;){var a=n[e];
t(a,e,n)&&r.push(a)}else _(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function wt(n,t,e){t=Z.createCallback(t,e,3),e=-1;var r=n?n.length:0;if(typeof r!="number"){var u;return _(n,function(n,e,r){return t(n,e,r)?(u=n,m):void 0}),u}for(;++e<r;){var a=n[e];if(t(a,e,n))return a}}function Ct(n,t,e){var r=-1,u=n?n.length:0;if(t=t&&typeof e=="undefined"?t:Z.createCallback(t,e,3),typeof u=="number")for(;++r<u&&t(n[r],r,n)!==false;);else _(n,t);return n}function xt(n,t,e){var r=-1,u=n?n.length:0;if(t=Z.createCallback(t,e,3),typeof u=="number")for(var a=Vt(u);++r<u;)a[r]=t(n[r],r,n);
else a=[],_(n,function(n,e,u){a[++r]=t(n,e,u)});return a}function Ot(n,t,e){var r=-1/0,a=r;if(!t&&$e(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];i>a&&(a=i)}}else t=!t&&mt(n)?u:Z.createCallback(t,e,3),Ct(n,function(n,e,u){e=t(n,e,u),e>r&&(r=e,a=n)});return a}function Et(n,t){var e=-1,r=n?n.length:0;if(typeof r=="number")for(var u=Vt(r);++e<r;)u[e]=n[e][t];return u||xt(n,t)}function St(n,t,e,r){if(!n)return e;var u=3>arguments.length;t=Z.createCallback(t,r,4);var a=-1,o=n.length;if(typeof o=="number")for(u&&(e=n[++a]);++a<o;)e=t(e,n[a],a,n);
else _(n,function(n,r,a){e=u?(u=m,n):t(e,n,r,a)});return e}function At(n,t,e,r){var u=n?n.length:0,a=3>arguments.length;if(typeof u!="number")var o=De(n),u=o.length;return t=Z.createCallback(t,r,4),Ct(n,function(r,i,f){i=o?o[--u]:--u,e=a?(a=m,n[i]):t(e,n[i],i,f)}),e}function It(n,t,e){var r;t=Z.createCallback(t,e,3),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u&&!(r=t(n[e],e,n)););else _(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function Nt(n){var r=-1,u=lt(),a=n?n.length:0,i=et(arguments,h,h,1),f=[],l=a>=w&&u===t;
if(l){var c=o(i);c?(u=e,i=c):l=m}for(;++r<a;)c=n[r],0>u(i,c)&&f.push(c);return l&&s(i),f}function Bt(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&t!=b){var a=-1;for(t=Z.createCallback(t,e,3);++a<u&&t(n[a],a,n);)r++}else if(r=t,r==b||e)return n[0];return v(n,0,Ce(we(0,r),u))}}function $t(n,e,r){if(typeof r=="number"){var u=n?n.length:0;r=0>r?we(0,u+r):r||0}else if(r)return r=Ft(n,e),n[r]===e?r:-1;return n?t(n,e,r):-1}function Dt(n,t,e){if(typeof t!="number"&&t!=b){var r=0,u=-1,a=n?n.length:0;
for(t=Z.createCallback(t,e,3);++u<a&&t(n[u],u,n);)r++}else r=t==b||e?1:we(0,t);return v(n,r)}function Ft(n,t,e,r){var u=0,a=n?n.length:u;for(e=e?Z.createCallback(e,r,1):Kt,t=e(t);u<a;)r=u+a>>>1,e(n[r])<t?u=r+1:a=r;return u}function Rt(n,t,e,r){return typeof t!="boolean"&&t!=b&&(r=e,e=r&&r[t]===n?y:t,t=m),e!=b&&(e=Z.createCallback(e,r,3)),at(n,t,e)}function Tt(){for(var n=1<arguments.length?arguments:arguments[0],t=-1,e=n?Ot(Et(n,"length")):0,r=Vt(0>e?0:e);++t<e;)r[t]=Et(n,t);return r}function qt(n,t){for(var e=-1,r=n?n.length:0,u={};++e<r;){var a=n[e];
t?u[a]=t[e]:a&&(u[a[0]]=a[1])}return u}function zt(n,t){return it(n,t,Ee.call(arguments,2),[])}function Wt(n,t,e){function r(){oe(s),oe(v),l=0,s=v=b}function u(){var t=g&&(!y||1<l);r(),t&&(p!==false&&(c=new Ht),i=n.apply(f,o))}function a(){r(),(g||p!==t)&&(c=new Ht,i=n.apply(f,o))}var o,i,f,l=0,c=0,p=m,s=b,v=b,g=h;if(t=we(0,t||0),e===h)var y=h,g=m;else ht(e)&&(y=e.leading,p="maxWait"in e&&we(t,e.maxWait||0),g="trailing"in e?e.trailing:g);return function(){if(o=arguments,f=this,l++,oe(v),p===false)y&&2>l&&(i=n.apply(f,o));
else{var e=new Ht;!s&&!y&&(c=e);var r=p-(e-c);0<r?s||(s=ge(a,r)):(oe(s),s=b,c=e,i=n.apply(f,o))}return t!==p&&(v=ge(u,t)),i}}function Pt(n){var t=Ee.call(arguments,1);return ge(function(){n.apply(y,t)},1)}function Kt(n){return n}function Mt(n,t){t||(t=n,n=Z);var e=yt(n);Ct(vt(t),function(r){var u=n[r]=t[r];e&&(n.prototype[r]=function(){var t=this.__wrapped__,e=[t];return se.apply(e,arguments),e=u.apply(n,e),t&&typeof t=="object"&&t===e?this:new nt(e)})})}function Ut(){return this.__wrapped__}r=r?Y.defaults(n.Object(),r,Y.pick(n,R)):n;
var Vt=r.Array,Gt=r.Boolean,Ht=r.Date,Jt=r.Function,Lt=r.Math,Qt=r.Number,Xt=r.Object,Yt=r.RegExp,Zt=r.String,ne=r.TypeError,te=[],ee=Xt.prototype,re=r._,ue=Yt("^"+Zt(ee.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),ae=Lt.ceil,oe=r.clearTimeout,ie=ue.test(ie=Xt.defineProperty)&&ie,fe=Lt.floor,le=Jt.prototype.toString,ce=ue.test(ce=Xt.getPrototypeOf)&&ce,pe=ee.hasOwnProperty,se=te.push,ve=r.setImmediate,ge=r.setTimeout,ye=ee.toString,he=te.unshift,be=ue.test(be=ye.bind)&&be,me=ue.test(me=Xt.create)&&me,de=ue.test(de=Vt.isArray)&&de,_e=r.isFinite,ke=r.isNaN,je=ue.test(je=Xt.keys)&&je,we=Lt.max,Ce=Lt.min,xe=r.parseInt,Oe=Lt.random,Ee=te.slice,Se=ue.test(r.attachEvent),Ae=be&&!/\n|true/.test(be+Se),Ie={};
Ie[q]=Vt,Ie[z]=Gt,Ie[W]=Ht,Ie[P]=Jt,Ie[M]=Xt,Ie[K]=Qt,Ie[U]=Yt,Ie[V]=Zt,nt.prototype=Z.prototype;var Ne=Z.support={};Ne.fastBind=be&&!Ae,Z.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:N,variable:"",imports:{_:Z}};var Be=ie?function(n,t){ie(n,"__bindData__",{configurable:m,enumerable:m,value:t,writable:m})}:c,$e=de,De=je?function(n){return ht(n)?je(n):[]}:X,Fe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Re=gt(Fe),Te=Yt("("+De(Re).join("|")+")","g"),qe=Yt("["+De(Fe).join("")+"]","g"),ze=ot(function(n,t,e){pe.call(n,e)?n[e]++:n[e]=1
}),We=ot(function(n,t,e){(pe.call(n,e)?n[e]:n[e]=[]).push(t)}),Pe=ot(function(n,t,e){n[e]=t});Ae&&Q&&typeof ve=="function"&&(Pt=zt(ve,r));var Ke=8==xe(x+"08")?xe:function(n,t){return xe(mt(n)?n.replace(B,""):n,t||0)};return Z.after=function(n,t){return function(){return 1>--n?t.apply(this,arguments):void 0}},Z.assign=L,Z.at=function(n){for(var t=-1,e=et(arguments,h,m,1),r=e.length,u=Vt(r);++t<r;)u[t]=n[e[t]];return u},Z.bind=zt,Z.bindAll=function(n){for(var t=1<arguments.length?et(arguments,h,m,1):vt(n),e=-1,r=t.length;++e<r;){var u=t[e];
n[u]=zt(n[u],n)}return n},Z.bindKey=function(n,t){return it(n,t,Ee.call(arguments,2),[],m,h)},Z.compact=function(n){for(var t=-1,e=n?n.length:0,r=[];++t<e;){var u=n[t];u&&r.push(u)}return r},Z.compose=function(){var n=arguments;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];return t[0]}},Z.countBy=ze,Z.createCallback=function(n,t,e){if(n==b)return Kt;var r=typeof n;if("function"!=r){if("object"!=r)return function(t){return t[n]};var u=De(n),a=u[0],o=n[a];return 1!=u.length||o!==o||ht(o)?function(t){for(var e=u.length,r=m;e--&&(r=rt(t[u[e]],n[u[e]],b,h)););return r
}:function(n){return n=n[a],o===n&&(0!==o||1/o==1/n)}}if(typeof t=="undefined")return n;if(r=!n.name||n.__bindData__,typeof r=="undefined"&&(r=!D||D.test(le.call(n)),Be(n,r)),r!==h&&(!r||!r[4]))return n;switch(e){case 1:return function(e){return n.call(t,e)};case 2:return function(e,r){return n.call(t,e,r)};case 3:return function(e,r,u){return n.call(t,e,r,u)};case 4:return function(e,r,u,a){return n.call(t,e,r,u,a)}}return zt(n,t)},Z.debounce=Wt,Z.defaults=J,Z.defer=Pt,Z.delay=function(n,t){var e=Ee.call(arguments,2);
return ge(function(){n.apply(y,e)},t)},Z.difference=Nt,Z.filter=jt,Z.flatten=function(n,t,e,r){return typeof t!="boolean"&&t!=b&&(r=e,e=r&&r[t]===n?y:t,t=m),e!=b&&(n=xt(n,e,r)),et(n,t)},Z.forEach=Ct,Z.forIn=C,Z.forOwn=_,Z.functions=vt,Z.groupBy=We,Z.indexBy=Pe,Z.initial=function(n,t,e){if(!n)return[];var r=0,u=n.length;if(typeof t!="number"&&t!=b){var a=u;for(t=Z.createCallback(t,e,3);a--&&t(n[a],a,n);)r++}else r=t==b||e?1:t||r;return v(n,0,Ce(we(0,u-r),u))},Z.intersection=function(n){for(var r=arguments,u=r.length,a=-1,i=f(),l=-1,c=lt(),v=n?n.length:0,g=[],y=f();++a<u;){var h=r[a];
i[a]=c===t&&(h?h.length:0)>=w&&o(a?r[a]:y)}n:for(;++l<v;){var b=i[0],h=n[l];if(0>(b?e(b,h):c(y,h))){for(a=u,(b||y).push(h);--a;)if(b=i[a],0>(b?e(b,h):c(r[a],h)))continue n;g.push(h)}}for(;u--;)(b=i[u])&&s(b);return p(i),p(y),g},Z.invert=gt,Z.invoke=function(n,t){var e=Ee.call(arguments,2),r=-1,u=typeof t=="function",a=n?n.length:0,o=Vt(typeof a=="number"?a:0);return Ct(n,function(n){o[++r]=(u?t:n[t]).apply(n,e)}),o},Z.keys=De,Z.map=xt,Z.max=Ot,Z.memoize=function(n,t){function e(){var r=e.cache,u=j+(t?t.apply(this,arguments):arguments[0]);
return pe.call(r,u)?r[u]:r[u]=n.apply(this,arguments)}return e.cache={},e},Z.merge=function(n){var t=arguments,e=2;if(!ht(n))return n;if("number"!=typeof t[2]&&(e=t.length),3<e&&"function"==typeof t[e-2])var r=Z.createCallback(t[--e-1],t[e--],2);else 2<e&&"function"==typeof t[e-1]&&(r=t[--e]);for(var t=Ee.call(arguments,1,e),u=-1,a=f(),o=f();++u<e;)ut(n,t[u],r,a,o);return p(a),p(o),n},Z.min=function(n,t,e){var r=1/0,a=r;if(!t&&$e(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];i<a&&(a=i)}}else t=!t&&mt(n)?u:Z.createCallback(t,e,3),Ct(n,function(n,e,u){e=t(n,e,u),e<r&&(r=e,a=n)
});return a},Z.omit=function(n,t,e){var r=lt(),u=typeof t=="function",a={};if(u)t=Z.createCallback(t,e,3);else var o=et(arguments,h,m,1);return C(n,function(n,e,i){(u?!t(n,e,i):0>r(o,e))&&(a[e]=n)}),a},Z.once=function(n){var t,e;return function(){return t?e:(t=h,e=n.apply(this,arguments),n=b,e)}},Z.pairs=function(n){for(var t=-1,e=De(n),r=e.length,u=Vt(r);++t<r;){var a=e[t];u[t]=[a,n[a]]}return u},Z.partial=function(n){return it(n,b,Ee.call(arguments,1),[],h)},Z.partialRight=function(n){return it(n,b,[],Ee.call(arguments,1),h,h)
},Z.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,a=et(arguments,h,m,1),o=ht(n)?a.length:0;++u<o;){var i=a[u];i in n&&(r[i]=n[i])}else t=Z.createCallback(t,e,3),C(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},Z.pluck=Et,Z.range=function(n,t,e){n=+n||0,e=+e||1,t==b&&(t=n,n=0);var r=-1;t=we(0,ae((t-n)/e));for(var u=Vt(t);++r<t;)u[r]=n,n+=e;return u},Z.reject=function(n,t,e){return t=Z.createCallback(t,e,3),jt(n,function(n,e,r){return!t(n,e,r)})},Z.rest=Dt,Z.shuffle=function(n){var t=-1,e=n?n.length:0,r=Vt(typeof e=="number"?e:0);
return Ct(n,function(n){var e=fe(Oe()*(++t+1));r[t]=r[e],r[e]=n}),r},Z.sortBy=function(n,t,e){var r=-1,u=n?n.length:0,o=Vt(typeof u=="number"?u:0);for(t=Z.createCallback(t,e,3),Ct(n,function(n,e,u){var a=o[++r]=l();a.l=t(n,e,u),a.m=r,a.n=n}),u=o.length,o.sort(a);u--;)n=o[u],o[u]=n.n,s(n);return o},Z.tap=function(n,t){return t(n),n},Z.throttle=function(n,t,e){var r=h,u=h;return e===false?r=m:ht(e)&&(r="leading"in e?e.leading:r,u="trailing"in e?e.trailing:u),e=l(),e.leading=r,e.maxWait=t,e.trailing=u,n=Wt(n,t,e),s(e),n
},Z.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=Vt(n);for(t=Z.createCallback(t,e,1);++r<n;)u[r]=t(r);return u},Z.toArray=function(n){return n&&typeof n.length=="number"?v(n):dt(n)},Z.transform=function(n,t,e,r){var u=$e(n);return t=Z.createCallback(t,r,4),e==b&&(u?e=[]:(r=n&&n.constructor,e=ht(r&&r.prototype)?me(r&&r.prototype):{})),(u?Ct:_)(n,function(n,r,u){return t(e,n,r,u)}),e},Z.union=function(){return at(et(arguments,h,h))},Z.uniq=Rt,Z.values=dt,Z.where=jt,Z.without=function(n){return Nt(n,Ee.call(arguments,1))
},Z.wrap=function(n,t){return function(){var e=[n];return se.apply(e,arguments),t.apply(this,e)}},Z.zip=Tt,Z.zipObject=qt,Z.collect=xt,Z.drop=Dt,Z.each=Ct,Z.extend=L,Z.methods=vt,Z.object=qt,Z.select=jt,Z.tail=Dt,Z.unique=Rt,Z.unzip=Tt,Mt(Z),Z.chain=Z,Z.prototype.chain=function(){return this},Z.clone=function(n,t,e,r){return typeof t!="boolean"&&t!=b&&(r=e,e=t,t=m),tt(n,t,typeof e=="function"&&Z.createCallback(e,r,1))},Z.cloneDeep=function(n,t,e){return tt(n,h,typeof t=="function"&&Z.createCallback(t,e,1))
},Z.contains=_t,Z.escape=function(n){return n==b?"":Zt(n).replace(qe,ft)},Z.every=kt,Z.find=wt,Z.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=Z.createCallback(t,e,3);++r<u;)if(t(n[r],r,n))return r;return-1},Z.findKey=function(n,t,e){var r;return t=Z.createCallback(t,e,3),_(n,function(n,e,u){return t(n,e,u)?(r=e,m):void 0}),r},Z.has=function(n,t){return n?pe.call(n,t):m},Z.identity=Kt,Z.indexOf=$t,Z.isArguments=st,Z.isArray=$e,Z.isBoolean=function(n){return n===h||n===false||ye.call(n)==z},Z.isDate=function(n){return n?typeof n=="object"&&ye.call(n)==W:m
},Z.isElement=function(n){return n?1===n.nodeType:m},Z.isEmpty=function(n){var t=h;if(!n)return t;var e=ye.call(n),r=n.length;return e==q||e==V||e==T||e==M&&typeof r=="number"&&yt(n.splice)?!r:(_(n,function(){return t=m}),t)},Z.isEqual=function(n,t,e,r){return rt(n,t,typeof e=="function"&&Z.createCallback(e,r,2))},Z.isFinite=function(n){return _e(n)&&!ke(parseFloat(n))},Z.isFunction=yt,Z.isNaN=function(n){return bt(n)&&n!=+n},Z.isNull=function(n){return n===b},Z.isNumber=bt,Z.isObject=ht,Z.isPlainObject=d,Z.isRegExp=function(n){return n?typeof n=="object"&&ye.call(n)==U:m
},Z.isString=mt,Z.isUndefined=function(n){return typeof n=="undefined"},Z.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?we(0,r+e):Ce(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},Z.mixin=Mt,Z.noConflict=function(){return r._=re,this},Z.parseInt=Ke,Z.random=function(n,t){n==b&&t==b&&(t=1),n=+n||0,t==b?(t=n,n=0):t=+t||0;var e=Oe();return n%1||t%1?n+Ce(e*(t-n+parseFloat("1e-"+((e+"").length-1))),t):n+fe(e*(t-n+1))},Z.reduce=St,Z.reduceRight=At,Z.result=function(n,t){var e=n?n[t]:y;
return yt(e)?n[t]():e},Z.runInContext=g,Z.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:De(n).length},Z.some=It,Z.sortedIndex=Ft,Z.template=function(n,t,e){var r=Z.templateSettings;n||(n=""),e=J({},e,r);var u,a=J({},e.imports,r.imports),r=De(a),a=dt(a),o=0,f=e.interpolate||$,l="__p+='",f=Yt((e.escape||$).source+"|"+f.source+"|"+(f===N?A:$).source+"|"+(e.evaluate||$).source+"|$","g");n.replace(f,function(t,e,r,a,f,c){return r||(r=a),l+=n.slice(o,c).replace(F,i),e&&(l+="'+__e("+e+")+'"),f&&(u=h,l+="';"+f+";__p+='"),r&&(l+="'+((__t=("+r+"))==null?'':__t)+'"),o=c+t.length,t
}),l+="';\n",f=e=e.variable,f||(e="obj",l="with("+e+"){"+l+"}"),l=(u?l.replace(O,""):l).replace(E,"$1").replace(S,"$1;"),l="function("+e+"){"+(f?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}";try{var c=Jt(r,"return "+l).apply(y,a)}catch(p){throw p.source=l,p}return t?c(t):(c.source=l,c)},Z.unescape=function(n){return n==b?"":Zt(n).replace(Te,pt)},Z.uniqueId=function(n){var t=++k;return Zt(n==b?"":n)+t
},Z.all=kt,Z.any=It,Z.detect=wt,Z.findWhere=wt,Z.foldl=St,Z.foldr=At,Z.include=_t,Z.inject=St,_(Z,function(n,t){Z.prototype[t]||(Z.prototype[t]=function(){var t=[this.__wrapped__];return se.apply(t,arguments),n.apply(Z,t)})}),Z.first=Bt,Z.last=function(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&t!=b){var a=u;for(t=Z.createCallback(t,e,3);a--&&t(n[a],a,n);)r++}else if(r=t,r==b||e)return n[u-1];return v(n,we(0,u-r))}},Z.take=Bt,Z.head=Bt,_(Z,function(n,t){Z.prototype[t]||(Z.prototype[t]=function(t,e){var r=n(this.__wrapped__,t,e);
return t==b||e&&typeof t!="function"?r:new nt(r)})}),Z.VERSION="1.3.1",Z.prototype.toString=function(){return Zt(this.__wrapped__)},Z.prototype.value=Ut,Z.prototype.valueOf=Ut,Ct(["join","pop","shift"],function(n){var t=te[n];Z.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}}),Ct(["push","reverse","sort","unshift"],function(n){var t=te[n];Z.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Ct(["concat","slice","splice"],function(n){var t=te[n];Z.prototype[n]=function(){return new nt(t.apply(this.__wrapped__,arguments))
}}),Z}var y,h=!0,b=null,m=!1,d=[],_=[],k=0,j=+new Date+"",w=75,C=40,x=" \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",O=/\b__p\+='';/g,E=/\b(__p\+=)''\+/g,S=/(__e\(.*?\)|\b__t\))\+'';/g,A=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,I=/\w*$/,N=/<%=([\s\S]+?)%>/g,B=RegExp("^["+x+"]*0+(?=.$)"),$=/($^)/,D=(D=/\bthis\b/)&&D.test(g)&&D,F=/['\n\r\t\u2028\u2029\\]/g,R="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),T="[object Arguments]",q="[object Array]",z="[object Boolean]",W="[object Date]",P="[object Function]",K="[object Number]",M="[object Object]",U="[object RegExp]",V="[object String]",G={};
G[P]=m,G[T]=G[q]=G[z]=G[W]=G[K]=G[M]=G[U]=G[V]=h;var H={"boolean":m,"function":h,object:h,number:m,string:m,undefined:m},J={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},L=H[typeof exports]&&exports,Q=H[typeof module]&&module&&module.exports==L&&module,X=H[typeof global]&&global;!X||X.global!==X&&X.window!==X||(n=X);var Y=g();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=Y, define(function(){return Y})):L&&!L.nodeType?Q?(Q.exports=Y)._=Y:L._=Y:n._=Y
}(this);

View File

@@ -212,12 +212,12 @@
* `after`, `assign`, `bind`, `bindAll`, `bindKey`, `chain`, `compact`,
* `compose`, `concat`, `countBy`, `createCallback`, `debounce`, `defaults`,
* `defer`, `delay`, `difference`, `filter`, `flatten`, `forEach`, `forIn`,
* `forOwn`, `functions`, `groupBy`, `initial`, `intersection`, `invert`,
* `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`,
* `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `push`, `range`,
* `reject`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`,
* `tap`, `throttle`, `times`, `toArray`, `transform`, `union`, `uniq`, `unshift`,
* `unzip`, `values`, `where`, `without`, `wrap`, and `zip`
* `forOwn`, `functions`, `groupBy`, `indexBy`, `initial`, `intersection`,
* `invert`, `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`,
* `omit`, `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `push`,
* `range`, `reject`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, `sortBy`,
* `splice`, `tap`, `throttle`, `times`, `toArray`, `transform`, `union`, `uniq`,
* `unshift`, `unzip`, `values`, `where`, `without`, `wrap`, and `zip`
*
* The non-chainable wrapper functions are:
* `clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `has`,
@@ -531,6 +531,28 @@
return result;
}
/**
* Creates a function that aggregates a collection, creating an object composed
* of keys generated from the results of running each element of the collection
* through a callback. The given `setter` function sets the keys and values
* of the composed object.
*
* @private
* @param {Function} setter The setter function.
* @returns {Function} Returns the new aggregator function.
*/
function createAggregator(setter) {
return function(collection, callback, thisArg) {
var result = {};
callback = createCallback(callback, thisArg, 3);
forEach(collection, function(value, key, collection) {
key = String(callback(value, key, collection));
setter(result, value, key, collection);
});
return result;
};
}
/**
* Creates a function that, when called, invokes `func` with the `this` binding
* of `thisArg` and prepends any `partialArgs` to the arguments passed to the
@@ -1251,7 +1273,7 @@
* Checks if `value` is `NaN`.
*
* Note: This is not the same as native `isNaN`, which will return `true` for
* `undefined` and other values. See http://es5.github.io/#x15.1.2.4.
* `undefined` and other non-numeric values. See http://es5.github.io/#x15.1.2.4.
*
* @static
* @memberOf _
@@ -1544,10 +1566,11 @@
}
/**
* Creates an object composed of keys returned from running each element of the
* `collection` through the given `callback`. The corresponding value of each key
* is the number of times the key was returned by the `callback`. The `callback`
* is bound to `thisArg` and invoked with three arguments; (value, index|key, collection).
* Creates an object composed of keys generated from the results of running
* each element of the `collection` through the given `callback`. The corresponding
* value of each key is the number of times the key was returned by the `callback`.
* The `callback` is bound to `thisArg` and invoked with three arguments;
* (value, index|key, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
@@ -1576,16 +1599,9 @@
* _.countBy(['one', 'two', 'three'], 'length');
* // => { '3': 2, '5': 1 }
*/
function countBy(collection, callback, thisArg) {
var result = {};
callback = createCallback(callback, thisArg, 3);
forEach(collection, function(value, key, collection) {
key = String(callback(value, key, collection));
(hasOwnProperty.call(result, key) ? result[key]++ : result[key] = 1);
});
return result;
}
var countBy = createAggregator(function(result, value, key) {
(hasOwnProperty.call(result, key) ? result[key]++ : result[key] = 1);
});
/**
* Checks if the `callback` returns a truthy value for **all** elements of a
@@ -1847,10 +1863,11 @@
}
/**
* Creates an object composed of keys returned from running each element of the
* `collection` through the `callback`. The corresponding value of each key is
* an array of elements passed to `callback` that returned the key. The `callback`
* is bound to `thisArg` and invoked with three arguments; (value, index|key, collection).
* Creates an object composed of keys generated from the results of running
* each element of the `collection` through the `callback`. The corresponding
* value of each key is an array of the elements responsible for generating
* the key. The `callback` is bound to `thisArg` and invoked with three
* arguments; (value, index|key, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
@@ -1880,16 +1897,9 @@
* _.groupBy(['one', 'two', 'three'], 'length');
* // => { '3': ['one', 'two'], '5': ['three'] }
*/
function groupBy(collection, callback, thisArg) {
var result = {};
callback = createCallback(callback, thisArg, 3);
forEach(collection, function(value, key, collection) {
key = String(callback(value, key, collection));
(hasOwnProperty.call(result, key) ? result[key] : result[key] = []).push(value);
});
return result;
}
var groupBy = createAggregator(function(result, value, key) {
(hasOwnProperty.call(result, key) ? result[key] : result[key] = []).push(value);
});
/**
* Invokes the method named by `methodName` on each element in the `collection`,
@@ -2961,7 +2971,8 @@
/**
* Creates an array of numbers (positive and/or negative) progressing from
* `start` up to but not including `end`.
* `start` up to but not including `end`. If `start` is less than `stop` a
* zero-length range is created unless a negative `step` is specified.
*
* @static
* @memberOf _
@@ -3495,6 +3506,7 @@
return result;
};
}
// exit early if there is no `thisArg`
if (typeof thisArg == 'undefined') {
return func;
}
@@ -3512,9 +3524,7 @@
return func.call(thisArg, accumulator, value, index, collection);
};
}
return function() {
return func.apply(thisArg, arguments);
};
return bind(func, thisArg);
}
/**

View File

@@ -3,33 +3,33 @@
* Lo-Dash 1.3.1 (Custom Build) lodash.com/license | Underscore.js 1.5.1 underscorejs.org/LICENSE
* Build: `lodash underscore exports="amd,commonjs,global,node" -o ./dist/lodash.underscore.js`
*/
;!function(n){function t(n,t){var r;if(n&&ht[typeof n])for(r in n)if(Ot.call(n,r)&&t(n[r],r,n)===et)break}function r(n,t){var r;if(n&&ht[typeof n])for(r in n)if(t(n[r],r,n)===et)break}function e(n){var t,r=[];if(!n||!ht[typeof n])return r;for(t in n)Ot.call(n,t)&&r.push(t);return r}function u(n,t,r){r=(r||0)-1;for(var e=n?n.length:0;++r<e;)if(n[r]===t)return r;return-1}function i(n,t){var r=n.m,e=t.m;if(n=n.l,t=t.l,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1
}return r<e?-1:1}function o(n){return"\\"+yt[n]}function a(){}function f(n){return n instanceof f?n:new c(n)}function c(n){this.__wrapped__=n}function l(n,t,r,e){e=(e||0)-1;for(var u=n?n.length:0,i=[];++e<u;){var o=n[e];o&&typeof o=="object"&&(Ct(o)||_(o))?Et.apply(i,t?o:l(o,t,r)):r||i.push(o)}return i}function p(n,t,e,u){if(n===t)return 0!==n||1/n==1/t;if(n===n&&(!n||!ht[typeof n])&&(!t||!ht[typeof t]))return tt;if(n==nt||t==nt)return n===t;var i=Tt.call(n),o=Tt.call(t);if(i!=o)return tt;switch(i){case ct:case lt:return+n==+t;
case pt:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case vt:case gt:return n==t+""}if(o=i==ft,!o){if(n instanceof f||t instanceof f)return p(n.__wrapped__||n,t.__wrapped__||t,e,u);if(i!=st)return tt;var i=n.constructor,a=t.constructor;if(i!=a&&(!A(i)||!(i instanceof i&&A(a)&&a instanceof a)))return tt}for(e||(e=[]),u||(u=[]),i=e.length;i--;)if(e[i]==n)return u[i]==t;var c=Z,l=0;if(e.push(n),u.push(t),o){if(l=t.length,c=l==n.length)for(;l--&&(c=p(n[l],t[l],e,u)););return c}return r(t,function(t,r,i){return Ot.call(i,r)?(l++,!(c=Ot.call(n,r)&&p(n[r],t,e,u))&&et):void 0
}),c&&r(n,function(n,t,r){return Ot.call(r,t)?!(c=-1<--l)&&et:void 0}),c}function s(n,t,r){for(var e=-1,u=y(),i=n?n.length:0,o=[],a=r?[]:o;++e<i;){var f=n[e],c=r?r(f,e,n):f;(t?!e||a[a.length-1]!==c:0>u(a,c))&&(r&&a.push(c),o.push(f))}return o}function v(n,t,r,e){var u=[];if(!A(n))throw new TypeError;if(e||u.length||!(zt.fastBind||Ft&&r.length))o=function(){var i=arguments,a=e?this:t;return(r.length||u.length)&&(St.apply(i,r),Et.apply(i,u)),this instanceof o?(a=g(n.prototype),i=n.apply(a,i),O(i)?i:a):n.apply(a,i)
};else{var i=[n,t];Et.apply(i,r);var o=Ft.call.apply(Ft,i)}return o}function g(n){return O(n)?Nt(n):{}}function h(n){return Ut[n]}function y(){var n=(n=f.indexOf)===U?u:n;return n}function m(n){return Vt[n]}function _(n){return n&&typeof n=="object"?Tt.call(n)==at:tt}function d(n){if(!n)return n;for(var t=1,r=arguments.length;t<r;t++){var e=arguments[t];if(e)for(var u in e)n[u]=e[u]}return n}function b(n){if(!n)return n;for(var t=1,r=arguments.length;t<r;t++){var e=arguments[t];if(e)for(var u in e)"undefined"==typeof n[u]&&(n[u]=e[u])
}return n}function j(n){var t=[];return r(n,function(n,r){A(n)&&t.push(r)}),t.sort()}function w(n){for(var t=-1,r=Pt(n),e=r.length,u={};++t<e;){var i=r[t];u[n[i]]=i}return u}function x(n){if(!n)return Z;if(Ct(n)||T(n))return!n.length;for(var t in n)if(Ot.call(n,t))return tt;return Z}function A(n){return typeof n=="function"}function O(n){return!(!n||!ht[typeof n])}function E(n){return typeof n=="number"||Tt.call(n)==pt}function T(n){return typeof n=="string"||Tt.call(n)==gt}function S(n){for(var t=-1,r=Pt(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];
return u}function F(n,r){var e=y(),u=n?n.length:0,i=tt;return u&&typeof u=="number"?i=-1<e(n,r):t(n,function(n){return(i=n===r)&&et}),i}function N(n,r,e){var u=Z;r=K(r,e,3),e=-1;var i=n?n.length:0;if(typeof i=="number")for(;++e<i&&(u=!!r(n[e],e,n)););else t(n,function(n,t,e){return!(u=!!r(n,t,e))&&et});return u}function R(n,r,e){var u=[];r=K(r,e,3),e=-1;var i=n?n.length:0;if(typeof i=="number")for(;++e<i;){var o=n[e];r(o,e,n)&&u.push(o)}else t(n,function(n,t,e){r(n,t,e)&&u.push(n)});return u}function k(n,r,e){r=K(r,e,3),e=-1;
var u=n?n.length:0;if(typeof u!="number"){var i;return t(n,function(n,t,e){return r(n,t,e)?(i=n,et):void 0}),i}for(;++e<u;){var o=n[e];if(r(o,e,n))return o}}function B(n,r,e){var u=-1,i=n?n.length:0;if(r=r&&typeof e=="undefined"?r:K(r,e,3),typeof i=="number")for(;++u<i&&r(n[u],u,n)!==et;);else t(n,r)}function D(n,r,e){var u=-1,i=n?n.length:0;if(r=K(r,e,3),typeof i=="number")for(var o=Array(i);++u<i;)o[u]=r(n[u],u,n);else o=[],t(n,function(n,t,e){o[++u]=r(n,t,e)});return o}function q(n,t,r){var e=-1/0,u=e,i=-1,o=n?n.length:0;
if(t||typeof o!="number")t=K(t,r,3),B(n,function(n,r,i){r=t(n,r,i),r>e&&(e=r,u=n)});else for(;++i<o;)r=n[i],r>u&&(u=r);return u}function M(n,t){var r=-1,e=n?n.length:0;if(typeof e=="number")for(var u=Array(e);++r<e;)u[r]=n[r][t];return u||D(n,t)}function $(n,r,e,u){if(!n)return e;var i=3>arguments.length;r=K(r,u,4);var o=-1,a=n.length;if(typeof a=="number")for(i&&(e=n[++o]);++o<a;)e=r(e,n[o],o,n);else t(n,function(n,t,u){e=i?(i=tt,n):r(e,n,t,u)});return e}function I(n,t,r,e){var u=n?n.length:0,i=3>arguments.length;
if(typeof u!="number")var o=Pt(n),u=o.length;return t=K(t,e,4),B(n,function(e,a,f){a=o?o[--u]:--u,r=i?(i=tt,n[a]):t(r,n[a],a,f)}),r}function W(n,r,e){var u;r=K(r,e,3),e=-1;var i=n?n.length:0;if(typeof i=="number")for(;++e<i&&!(u=r(n[e],e,n)););else t(n,function(n,t,e){return(u=r(n,t,e))&&et});return!!u}function z(n,t,r){return r&&x(t)?Y:(r?k:R)(n,t)}function C(n){for(var t=-1,r=y(),e=n.length,u=l(arguments,Z,Z,1),i=[];++t<e;){var o=n[t];0>r(u,o)&&i.push(o)}return i}function P(n,t,r){if(n){var e=0,u=n.length;
if(typeof t!="number"&&t!=nt){var i=-1;for(t=K(t,r,3);++i<u&&t(n[i],i,n);)e++}else if(e=t,e==nt||r)return n[0];return It.call(n,0,Mt(qt(0,e),u))}}function U(n,t,r){if(typeof r=="number"){var e=n?n.length:0;r=0>r?qt(0,e+r):r||0}else if(r)return r=G(n,t),n[r]===t?r:-1;return n?u(n,t,r):-1}function V(n,t,r){if(typeof t!="number"&&t!=nt){var e=0,u=-1,i=n?n.length:0;for(t=K(t,r,3);++u<i&&t(n[u],u,n);)e++}else e=t==nt||r?1:qt(0,t);return It.call(n,e)}function G(n,t,r,e){var u=0,i=n?n.length:u;for(r=r?K(r,e,1):Q,t=r(t);u<i;)e=u+i>>>1,r(n[e])<t?u=e+1:i=e;
return u}function H(n,t,r,e){return typeof t!="boolean"&&t!=nt&&(e=r,r=e&&e[t]===n?Y:t,t=tt),r!=nt&&(r=K(r,e,3)),s(n,t,r)}function J(n,t){return v(n,t,It.call(arguments,2))}function K(n,t,r){if(n==nt)return Q;var e=typeof n;if("function"!=e){if("object"!=e)return function(t){return t[n]};var u=Pt(n);return function(t){for(var r=u.length,e=tt;r--&&(e=t[u[r]]===n[u[r]]););return e}}if(typeof t=="undefined")return n;switch(r){case 1:return function(r){return n.call(t,r)};case 2:return function(r,e){return n.call(t,r,e)
};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,i){return n.call(t,r,e,u,i)}}return function(){return n.apply(t,arguments)}}function L(n,t,r){function e(){clearTimeout(s),clearTimeout(v),c=0,s=v=nt}function u(){var t=g&&(!h||1<c);e(),t&&(p!==tt&&(l=new Date),a=n.apply(f,o))}function i(){e(),(g||p!==t)&&(l=new Date,a=n.apply(f,o))}var o,a,f,c=0,l=0,p=tt,s=nt,v=nt,g=Z;if(t=qt(0,t||0),r===Z)var h=Z,g=tt;else O(r)&&(h=r.leading,p="maxWait"in r&&qt(t,r.maxWait||0),g="trailing"in r?r.trailing:g);
return function(){if(o=arguments,f=this,c++,clearTimeout(v),p===tt)h&&2>c&&(a=n.apply(f,o));else{var r=new Date;!s&&!h&&(l=r);var e=p-(r-l);0<e?s||(s=setTimeout(i,e)):(clearTimeout(s),s=nt,l=r,a=n.apply(f,o))}return t!==p&&(v=setTimeout(u,t)),a}}function Q(n){return n}function X(n){B(j(n),function(t){var r=f[t]=n[t];f.prototype[t]=function(){var n=[this.__wrapped__];return Et.apply(n,arguments),n=r.apply(f,n),this.__chain__&&(n=new c(n),n.__chain__=Z),n}})}var Y,Z=!0,nt=null,tt=!1,rt=0,et={},ut=+new Date+"",it=/($^)/,ot=/['\n\r\t\u2028\u2029\\]/g,at="[object Arguments]",ft="[object Array]",ct="[object Boolean]",lt="[object Date]",pt="[object Number]",st="[object Object]",vt="[object RegExp]",gt="[object String]",ht={"boolean":tt,"function":Z,object:Z,number:tt,string:tt,undefined:tt},yt={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},mt=ht[typeof exports]&&exports,_t=ht[typeof module]&&module&&module.exports==mt&&module,dt=ht[typeof global]&&global;
!dt||dt.global!==dt&&dt.window!==dt||(n=dt);var bt=[],dt=Object.prototype,jt=n._,wt=RegExp("^"+(dt.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),xt=Math.ceil,At=Math.floor,Ot=dt.hasOwnProperty,Et=bt.push,Tt=dt.toString,St=bt.unshift,Ft=wt.test(Ft=Tt.bind)&&Ft,Nt=wt.test(Nt=Object.create)&&Nt,Rt=wt.test(Rt=Array.isArray)&&Rt,kt=n.isFinite,Bt=n.isNaN,Dt=wt.test(Dt=Object.keys)&&Dt,qt=Math.max,Mt=Math.min,$t=Math.random,It=bt.slice,dt=wt.test(n.attachEvent),Wt=Ft&&!/\n|true/.test(Ft+dt);
c.prototype=f.prototype;var zt={};!function(){var n={0:1,length:1};zt.fastBind=Ft&&!Wt,zt.spliceObjects=(bt.splice.call(n,0,1),!n[0])}(1),f.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},Nt||(g=function(n){if(O(n)){a.prototype=n;var t=new a;a.prototype=nt}return t||{}}),_(arguments)||(_=function(n){return n&&typeof n=="object"?Ot.call(n,"callee"):tt});var Ct=Rt||function(n){return n&&typeof n=="object"?Tt.call(n)==ft:tt},Pt=Dt?function(n){return O(n)?Dt(n):[]
}:e,Ut={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"},Vt=w(Ut),Gt=RegExp("("+Pt(Vt).join("|")+")","g"),Ht=RegExp("["+Pt(Ut).join("")+"]","g");A(/x/)&&(A=function(n){return typeof n=="function"&&"[object Function]"==Tt.call(n)}),f.after=function(n,t){return function(){return 1>--n?t.apply(this,arguments):void 0}},f.bind=J,f.bindAll=function(n){for(var t=1<arguments.length?l(arguments,Z,tt,1):j(n),r=-1,e=t.length;++r<e;){var u=t[r];n[u]=J(n[u],n)}return n},f.compact=function(n){for(var t=-1,r=n?n.length:0,e=[];++t<r;){var u=n[t];
u&&e.push(u)}return e},f.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];return t[0]}},f.countBy=function(n,t,r){var e={};return t=K(t,r,3),B(n,function(n,r,u){r=t(n,r,u)+"",Ot.call(e,r)?e[r]++:e[r]=1}),e},f.debounce=L,f.defaults=b,f.defer=function(n){var t=It.call(arguments,1);return setTimeout(function(){n.apply(Y,t)},1)},f.delay=function(n,t){var r=It.call(arguments,2);return setTimeout(function(){n.apply(Y,r)},t)},f.difference=C,f.filter=R,f.flatten=function(n,t){return l(n,t)
},f.forEach=B,f.functions=j,f.groupBy=function(n,t,r){var e={};return t=K(t,r,3),B(n,function(n,r,u){r=t(n,r,u)+"",(Ot.call(e,r)?e[r]:e[r]=[]).push(n)}),e},f.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t!="number"&&t!=nt){var i=u;for(t=K(t,r,3);i--&&t(n[i],i,n);)e++}else e=t==nt||r?1:t||e;return It.call(n,0,Mt(qt(0,u-e),u))},f.intersection=function(n){var t=arguments,r=t.length,e=-1,u=y(),i=n?n.length:0,o=[];n:for(;++e<i;){var a=n[e];if(0>u(o,a)){for(var f=r;--f;)if(0>u(t[f],a))continue n;
o.push(a)}}return o},f.invert=w,f.invoke=function(n,t){var r=It.call(arguments,2),e=-1,u=typeof t=="function",i=n?n.length:0,o=Array(typeof i=="number"?i:0);return B(n,function(n){o[++e]=(u?t:n[t]).apply(n,r)}),o},f.keys=Pt,f.map=D,f.max=q,f.memoize=function(n,t){var r={};return function(){var e=ut+(t?t.apply(this,arguments):arguments[0]);return Ot.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},f.min=function(n,t,r){var e=1/0,u=e,i=-1,o=n?n.length:0;if(t||typeof o!="number")t=K(t,r,3),B(n,function(n,r,i){r=t(n,r,i),r<e&&(e=r,u=n)
});else for(;++i<o;)r=n[i],r<u&&(u=r);return u},f.omit=function(n){var t=y(),e=l(arguments,Z,tt,1),u={};return r(n,function(n,r){0>t(e,r)&&(u[r]=n)}),u},f.once=function(n){var t,r;return function(){return t?r:(t=Z,r=n.apply(this,arguments),n=nt,r)}},f.pairs=function(n){for(var t=-1,r=Pt(n),e=r.length,u=Array(e);++t<e;){var i=r[t];u[t]=[i,n[i]]}return u},f.partial=function(n){return v(n,nt,It.call(arguments,1),Z)},f.pick=function(n){for(var t=-1,r=l(arguments,Z,tt,1),e=r.length,u={};++t<e;){var i=r[t];
i in n&&(u[i]=n[i])}return u},f.pluck=M,f.range=function(n,t,r){n=+n||0,r=+r||1,t==nt&&(t=n,n=0);var e=-1;t=qt(0,xt((t-n)/r));for(var u=Array(t);++e<t;)u[e]=n,n+=r;return u},f.reject=function(n,t,r){return t=K(t,r,3),R(n,function(n,r,e){return!t(n,r,e)})},f.rest=V,f.shuffle=function(n){var t=-1,r=n?n.length:0,e=Array(typeof r=="number"?r:0);return B(n,function(n){var r=At($t()*(++t+1));e[t]=e[r],e[r]=n}),e},f.sortBy=function(n,t,r){var e=-1,u=n?n.length:0,o=Array(typeof u=="number"?u:0);for(t=K(t,r,3),B(n,function(n,r,u){o[++e]={l:t(n,r,u),m:e,n:n}
}),u=o.length,o.sort(i);u--;)o[u]=o[u].n;return o},f.tap=function(n,t){return t(n),n},f.throttle=function(n,t,r){var e=Z,u=Z;return r===tt?e=tt:O(r)&&(e="leading"in r?r.leading:e,u="trailing"in r?r.trailing:u),r={},r.leading=e,r.maxWait=t,r.trailing=u,L(n,t,r)},f.times=function(n,t,r){for(var e=-1,u=Array(-1<n?n:0);++e<n;)u[e]=t.call(r,e);return u},f.toArray=function(n){return Ct(n)?It.call(n):n&&typeof n.length=="number"?D(n):S(n)},f.union=function(){return s(l(arguments,Z,Z))},f.uniq=H,f.values=S,f.where=z,f.without=function(n){return C(n,It.call(arguments,1))
},f.wrap=function(n,t){return function(){var r=[n];return Et.apply(r,arguments),t.apply(this,r)}},f.zip=function(){for(var n=-1,t=q(M(arguments,"length")),r=Array(0>t?0:t);++n<t;)r[n]=M(arguments,n);return r},f.collect=D,f.drop=V,f.each=B,f.extend=d,f.methods=j,f.object=function(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var i=n[r];t?u[i]=t[r]:i&&(u[i[0]]=i[1])}return u},f.select=R,f.tail=V,f.unique=H,f.chain=function(n){return n=new c(n),n.__chain__=Z,n},f.clone=function(n){return O(n)?Ct(n)?It.call(n):d({},n):n
},f.contains=F,f.escape=function(n){return n==nt?"":(n+"").replace(Ht,h)},f.every=N,f.find=k,f.has=function(n,t){return n?Ot.call(n,t):tt},f.identity=Q,f.indexOf=U,f.isArguments=_,f.isArray=Ct,f.isBoolean=function(n){return n===Z||n===tt||Tt.call(n)==ct},f.isDate=function(n){return n?typeof n=="object"&&Tt.call(n)==lt:tt},f.isElement=function(n){return n?1===n.nodeType:tt},f.isEmpty=x,f.isEqual=function(n,t){return p(n,t)},f.isFinite=function(n){return kt(n)&&!Bt(parseFloat(n))},f.isFunction=A,f.isNaN=function(n){return E(n)&&n!=+n
},f.isNull=function(n){return n===nt},f.isNumber=E,f.isObject=O,f.isRegExp=function(n){return n&&ht[typeof n]?Tt.call(n)==vt:tt},f.isString=T,f.isUndefined=function(n){return typeof n=="undefined"},f.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?qt(0,e+r):Mt(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},f.mixin=X,f.noConflict=function(){return n._=jt,this},f.random=function(n,t){n==nt&&t==nt&&(t=1),n=+n||0,t==nt?(t=n,n=0):t=+t||0;var r=$t();return n%1||t%1?n+Mt(r*(t-n+parseFloat("1e-"+((r+"").length-1))),t):n+At(r*(t-n+1))
},f.reduce=$,f.reduceRight=I,f.result=function(n,t){var r=n?n[t]:Y;return A(r)?n[t]():r},f.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Pt(n).length},f.some=W,f.sortedIndex=G,f.template=function(n,t,r){var e=f.templateSettings;n||(n=""),r=b({},r,e);var u=0,i="__p+='",e=r.variable;n.replace(RegExp((r.escape||it).source+"|"+(r.interpolate||it).source+"|"+(r.evaluate||it).source+"|$","g"),function(t,r,e,a,f){return i+=n.slice(u,f).replace(ot,o),r&&(i+="'+_.escape("+r+")+'"),a&&(i+="';"+a+";__p+='"),e&&(i+="'+((__t=("+e+"))==null?'':__t)+'"),u=f+t.length,t
}),i+="';\n",e||(e="obj",i="with("+e+"||{}){"+i+"}"),i="function("+e+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+i+"return __p}";try{var a=Function("_","return "+i)(f)}catch(c){throw c.source=i,c}return t?a(t):(a.source=i,a)},f.unescape=function(n){return n==nt?"":(n+"").replace(Gt,m)},f.uniqueId=function(n){var t=++rt+"";return n?n+t:t},f.all=N,f.any=W,f.detect=k,f.findWhere=function(n,t){return z(n,t,Z)},f.foldl=$,f.foldr=I,f.include=F,f.inject=$,f.first=P,f.last=function(n,t,r){if(n){var e=0,u=n.length;
if(typeof t!="number"&&t!=nt){var i=u;for(t=K(t,r,3);i--&&t(n[i],i,n);)e++}else if(e=t,e==nt||r)return n[u-1];return It.call(n,qt(0,u-e))}},f.take=P,f.head=P,f.VERSION="1.3.1",X(f),f.prototype.chain=function(){return this.__chain__=Z,this},f.prototype.value=function(){return this.__wrapped__},B("pop push reverse shift sort splice unshift".split(" "),function(n){var t=bt[n];f.prototype[n]=function(){var n=this.__wrapped__;return t.apply(n,arguments),!zt.spliceObjects&&0===n.length&&delete n[0],this
}}),B(["concat","join","slice"],function(n){var t=bt[n];f.prototype[n]=function(){var n=t.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new c(n),n.__chain__=Z),n}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=f, define(function(){return f})):mt&&!mt.nodeType?_t?(_t.exports=f)._=f:mt._=f:n._=f}(this);
;!function(n){function t(n,t){var r;if(n&&yt[typeof n])for(r in n)if(Tt.call(n,r)&&t(n[r],r,n)===ut)break}function r(n,t){var r;if(n&&yt[typeof n])for(r in n)if(t(n[r],r,n)===ut)break}function e(n){var t,r=[];if(!n||!yt[typeof n])return r;for(t in n)Tt.call(n,t)&&r.push(t);return r}function u(n,t,r){r=(r||0)-1;for(var e=n?n.length:0;++r<e;)if(n[r]===t)return r;return-1}function i(n,t){var r=n.m,e=t.m;if(n=n.l,t=t.l,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1
}return r<e?-1:1}function o(n){return"\\"+mt[n]}function a(){}function f(n){return n instanceof f?n:new c(n)}function c(n){this.__wrapped__=n}function l(n,t,r,e){e=(e||0)-1;for(var u=n?n.length:0,i=[];++e<u;){var o=n[e];o&&typeof o=="object"&&(Vt(o)||d(o))?St.apply(i,t?o:l(o,t,r)):r||i.push(o)}return i}function p(n,t,e,u){if(n===t)return 0!==n||1/n==1/t;if(n===n&&(!n||!yt[typeof n])&&(!t||!yt[typeof t]))return rt;if(n==tt||t==tt)return n===t;var i=Ft.call(n),o=Ft.call(t);if(i!=o)return rt;switch(i){case lt:case pt:return+n==+t;
case st:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case gt:case ht:return n==t+""}if(o=i==ct,!o){if(n instanceof f||t instanceof f)return p(n.__wrapped__||n,t.__wrapped__||t,e,u);if(i!=vt)return rt;var i=n.constructor,a=t.constructor;if(i!=a&&(!O(i)||!(i instanceof i&&O(a)&&a instanceof a)))return rt}for(e||(e=[]),u||(u=[]),i=e.length;i--;)if(e[i]==n)return u[i]==t;var c=nt,l=0;if(e.push(n),u.push(t),o){if(l=t.length,c=l==n.length)for(;l--&&(c=p(n[l],t[l],e,u)););return c}return r(t,function(t,r,i){return Tt.call(i,r)?(l++,!(c=Tt.call(n,r)&&p(n[r],t,e,u))&&ut):void 0
}),c&&r(n,function(n,t,r){return Tt.call(r,t)?!(c=-1<--l)&&ut:void 0}),c}function s(n,t,r){for(var e=-1,u=m(),i=n?n.length:0,o=[],a=r?[]:o;++e<i;){var f=n[e],c=r?r(f,e,n):f;(t?!e||a[a.length-1]!==c:0>u(a,c))&&(r&&a.push(c),o.push(f))}return o}function v(n){return function(t,r,e){var u={};return r=L(r,e,3),D(t,function(t,e,i){e=r(t,e,i)+"",n(u,t,e,i)}),u}}function g(n,t,r,e){var u=[];if(!O(n))throw new TypeError;if(e||u.length||!(Ut.fastBind||Rt&&r.length))o=function(){var i=arguments,a=e?this:t;return(r.length||u.length)&&(Nt.apply(i,r),St.apply(i,u)),this instanceof o?(a=h(n.prototype),i=n.apply(a,i),E(i)?i:a):n.apply(a,i)
};else{var i=[n,t];St.apply(i,r);var o=Rt.call.apply(Rt,i)}return o}function h(n){return E(n)?kt(n):{}}function y(n){return Ht[n]}function m(){var n=(n=f.indexOf)===V?u:n;return n}function _(n){return Jt[n]}function d(n){return n&&typeof n=="object"?Ft.call(n)==ft:rt}function b(n){if(!n)return n;for(var t=1,r=arguments.length;t<r;t++){var e=arguments[t];if(e)for(var u in e)n[u]=e[u]}return n}function j(n){if(!n)return n;for(var t=1,r=arguments.length;t<r;t++){var e=arguments[t];if(e)for(var u in e)"undefined"==typeof n[u]&&(n[u]=e[u])
}return n}function w(n){var t=[];return r(n,function(n,r){O(n)&&t.push(r)}),t.sort()}function x(n){for(var t=-1,r=Gt(n),e=r.length,u={};++t<e;){var i=r[t];u[n[i]]=i}return u}function A(n){if(!n)return nt;if(Vt(n)||S(n))return!n.length;for(var t in n)if(Tt.call(n,t))return rt;return nt}function O(n){return typeof n=="function"}function E(n){return!(!n||!yt[typeof n])}function T(n){return typeof n=="number"||Ft.call(n)==st}function S(n){return typeof n=="string"||Ft.call(n)==ht}function F(n){for(var t=-1,r=Gt(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];
return u}function N(n,r){var e=m(),u=n?n.length:0,i=rt;return u&&typeof u=="number"?i=-1<e(n,r):t(n,function(n){return(i=n===r)&&ut}),i}function R(n,r,e){var u=nt;r=L(r,e,3),e=-1;var i=n?n.length:0;if(typeof i=="number")for(;++e<i&&(u=!!r(n[e],e,n)););else t(n,function(n,t,e){return!(u=!!r(n,t,e))&&ut});return u}function k(n,r,e){var u=[];r=L(r,e,3),e=-1;var i=n?n.length:0;if(typeof i=="number")for(;++e<i;){var o=n[e];r(o,e,n)&&u.push(o)}else t(n,function(n,t,e){r(n,t,e)&&u.push(n)});return u}function B(n,r,e){r=L(r,e,3),e=-1;
var u=n?n.length:0;if(typeof u!="number"){var i;return t(n,function(n,t,e){return r(n,t,e)?(i=n,ut):void 0}),i}for(;++e<u;){var o=n[e];if(r(o,e,n))return o}}function D(n,r,e){var u=-1,i=n?n.length:0;if(r=r&&typeof e=="undefined"?r:L(r,e,3),typeof i=="number")for(;++u<i&&r(n[u],u,n)!==ut;);else t(n,r)}function q(n,r,e){var u=-1,i=n?n.length:0;if(r=L(r,e,3),typeof i=="number")for(var o=Array(i);++u<i;)o[u]=r(n[u],u,n);else o=[],t(n,function(n,t,e){o[++u]=r(n,t,e)});return o}function M(n,t,r){var e=-1/0,u=e,i=-1,o=n?n.length:0;
if(t||typeof o!="number")t=L(t,r,3),D(n,function(n,r,i){r=t(n,r,i),r>e&&(e=r,u=n)});else for(;++i<o;)r=n[i],r>u&&(u=r);return u}function $(n,t){var r=-1,e=n?n.length:0;if(typeof e=="number")for(var u=Array(e);++r<e;)u[r]=n[r][t];return u||q(n,t)}function I(n,r,e,u){if(!n)return e;var i=3>arguments.length;r=L(r,u,4);var o=-1,a=n.length;if(typeof a=="number")for(i&&(e=n[++o]);++o<a;)e=r(e,n[o],o,n);else t(n,function(n,t,u){e=i?(i=rt,n):r(e,n,t,u)});return e}function W(n,t,r,e){var u=n?n.length:0,i=3>arguments.length;
if(typeof u!="number")var o=Gt(n),u=o.length;return t=L(t,e,4),D(n,function(e,a,f){a=o?o[--u]:--u,r=i?(i=rt,n[a]):t(r,n[a],a,f)}),r}function z(n,r,e){var u;r=L(r,e,3),e=-1;var i=n?n.length:0;if(typeof i=="number")for(;++e<i&&!(u=r(n[e],e,n)););else t(n,function(n,t,e){return(u=r(n,t,e))&&ut});return!!u}function C(n,t,r){return r&&A(t)?Z:(r?B:k)(n,t)}function P(n){for(var t=-1,r=m(),e=n.length,u=l(arguments,nt,nt,1),i=[];++t<e;){var o=n[t];0>r(u,o)&&i.push(o)}return i}function U(n,t,r){if(n){var e=0,u=n.length;
if(typeof t!="number"&&t!=tt){var i=-1;for(t=L(t,r,3);++i<u&&t(n[i],i,n);)e++}else if(e=t,e==tt||r)return n[0];return zt.call(n,0,It($t(0,e),u))}}function V(n,t,r){if(typeof r=="number"){var e=n?n.length:0;r=0>r?$t(0,e+r):r||0}else if(r)return r=H(n,t),n[r]===t?r:-1;return n?u(n,t,r):-1}function G(n,t,r){if(typeof t!="number"&&t!=tt){var e=0,u=-1,i=n?n.length:0;for(t=L(t,r,3);++u<i&&t(n[u],u,n);)e++}else e=t==tt||r?1:$t(0,t);return zt.call(n,e)}function H(n,t,r,e){var u=0,i=n?n.length:u;for(r=r?L(r,e,1):X,t=r(t);u<i;)e=u+i>>>1,r(n[e])<t?u=e+1:i=e;
return u}function J(n,t,r,e){return typeof t!="boolean"&&t!=tt&&(e=r,r=e&&e[t]===n?Z:t,t=rt),r!=tt&&(r=L(r,e,3)),s(n,t,r)}function K(n,t){return g(n,t,zt.call(arguments,2))}function L(n,t,r){if(n==tt)return X;var e=typeof n;if("function"!=e){if("object"!=e)return function(t){return t[n]};var u=Gt(n);return function(t){for(var r=u.length,e=rt;r--&&(e=t[u[r]]===n[u[r]]););return e}}if(typeof t=="undefined")return n;switch(r){case 1:return function(r){return n.call(t,r)};case 2:return function(r,e){return n.call(t,r,e)
};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,i){return n.call(t,r,e,u,i)}}return K(n,t)}function Q(n,t,r){function e(){clearTimeout(s),clearTimeout(v),c=0,s=v=tt}function u(){var t=g&&(!h||1<c);e(),t&&(p!==rt&&(l=new Date),a=n.apply(f,o))}function i(){e(),(g||p!==t)&&(l=new Date,a=n.apply(f,o))}var o,a,f,c=0,l=0,p=rt,s=tt,v=tt,g=nt;if(t=$t(0,t||0),r===nt)var h=nt,g=rt;else E(r)&&(h=r.leading,p="maxWait"in r&&$t(t,r.maxWait||0),g="trailing"in r?r.trailing:g);
return function(){if(o=arguments,f=this,c++,clearTimeout(v),p===rt)h&&2>c&&(a=n.apply(f,o));else{var r=new Date;!s&&!h&&(l=r);var e=p-(r-l);0<e?s||(s=setTimeout(i,e)):(clearTimeout(s),s=tt,l=r,a=n.apply(f,o))}return t!==p&&(v=setTimeout(u,t)),a}}function X(n){return n}function Y(n){D(w(n),function(t){var r=f[t]=n[t];f.prototype[t]=function(){var n=[this.__wrapped__];return St.apply(n,arguments),n=r.apply(f,n),this.__chain__&&(n=new c(n),n.__chain__=nt),n}})}var Z,nt=!0,tt=null,rt=!1,et=0,ut={},it=+new Date+"",ot=/($^)/,at=/['\n\r\t\u2028\u2029\\]/g,ft="[object Arguments]",ct="[object Array]",lt="[object Boolean]",pt="[object Date]",st="[object Number]",vt="[object Object]",gt="[object RegExp]",ht="[object String]",yt={"boolean":rt,"function":nt,object:nt,number:rt,string:rt,undefined:rt},mt={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},_t=yt[typeof exports]&&exports,dt=yt[typeof module]&&module&&module.exports==_t&&module,bt=yt[typeof global]&&global;
!bt||bt.global!==bt&&bt.window!==bt||(n=bt);var jt=[],wt=Object.prototype,xt=n._,At=RegExp("^"+(wt.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),Ot=Math.ceil,Et=Math.floor,Tt=wt.hasOwnProperty,St=jt.push,Ft=wt.toString,Nt=jt.unshift,Rt=At.test(Rt=Ft.bind)&&Rt,kt=At.test(kt=Object.create)&&kt,Bt=At.test(Bt=Array.isArray)&&Bt,Dt=n.isFinite,qt=n.isNaN,Mt=At.test(Mt=Object.keys)&&Mt,$t=Math.max,It=Math.min,Wt=Math.random,zt=jt.slice,Ct=At.test(n.attachEvent),Pt=Rt&&!/\n|true/.test(Rt+Ct);
c.prototype=f.prototype;var Ut={};!function(){var n={0:1,length:1};Ut.fastBind=Rt&&!Pt,Ut.spliceObjects=(jt.splice.call(n,0,1),!n[0])}(1),f.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},kt||(h=function(n){if(E(n)){a.prototype=n;var t=new a;a.prototype=tt}return t||{}}),d(arguments)||(d=function(n){return n&&typeof n=="object"?Tt.call(n,"callee"):rt});var Vt=Bt||function(n){return n&&typeof n=="object"?Ft.call(n)==ct:rt},Gt=Mt?function(n){return E(n)?Mt(n):[]
}:e,Ht={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"},Jt=x(Ht),Kt=RegExp("("+Gt(Jt).join("|")+")","g"),Lt=RegExp("["+Gt(Ht).join("")+"]","g");O(/x/)&&(O=function(n){return typeof n=="function"&&"[object Function]"==Ft.call(n)});var Qt=v(function(n,t,r){Tt.call(n,r)?n[r]++:n[r]=1}),Xt=v(function(n,t,r){(Tt.call(n,r)?n[r]:n[r]=[]).push(t)});f.after=function(n,t){return function(){return 1>--n?t.apply(this,arguments):void 0}},f.bind=K,f.bindAll=function(n){for(var t=1<arguments.length?l(arguments,nt,rt,1):w(n),r=-1,e=t.length;++r<e;){var u=t[r];
n[u]=K(n[u],n)}return n},f.compact=function(n){for(var t=-1,r=n?n.length:0,e=[];++t<r;){var u=n[t];u&&e.push(u)}return e},f.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];return t[0]}},f.countBy=Qt,f.debounce=Q,f.defaults=j,f.defer=function(n){var t=zt.call(arguments,1);return setTimeout(function(){n.apply(Z,t)},1)},f.delay=function(n,t){var r=zt.call(arguments,2);return setTimeout(function(){n.apply(Z,r)},t)},f.difference=P,f.filter=k,f.flatten=function(n,t){return l(n,t)
},f.forEach=D,f.functions=w,f.groupBy=Xt,f.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t!="number"&&t!=tt){var i=u;for(t=L(t,r,3);i--&&t(n[i],i,n);)e++}else e=t==tt||r?1:t||e;return zt.call(n,0,It($t(0,u-e),u))},f.intersection=function(n){var t=arguments,r=t.length,e=-1,u=m(),i=n?n.length:0,o=[];n:for(;++e<i;){var a=n[e];if(0>u(o,a)){for(var f=r;--f;)if(0>u(t[f],a))continue n;o.push(a)}}return o},f.invert=x,f.invoke=function(n,t){var r=zt.call(arguments,2),e=-1,u=typeof t=="function",i=n?n.length:0,o=Array(typeof i=="number"?i:0);
return D(n,function(n){o[++e]=(u?t:n[t]).apply(n,r)}),o},f.keys=Gt,f.map=q,f.max=M,f.memoize=function(n,t){var r={};return function(){var e=it+(t?t.apply(this,arguments):arguments[0]);return Tt.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},f.min=function(n,t,r){var e=1/0,u=e,i=-1,o=n?n.length:0;if(t||typeof o!="number")t=L(t,r,3),D(n,function(n,r,i){r=t(n,r,i),r<e&&(e=r,u=n)});else for(;++i<o;)r=n[i],r<u&&(u=r);return u},f.omit=function(n){var t=m(),e=l(arguments,nt,rt,1),u={};return r(n,function(n,r){0>t(e,r)&&(u[r]=n)
}),u},f.once=function(n){var t,r;return function(){return t?r:(t=nt,r=n.apply(this,arguments),n=tt,r)}},f.pairs=function(n){for(var t=-1,r=Gt(n),e=r.length,u=Array(e);++t<e;){var i=r[t];u[t]=[i,n[i]]}return u},f.partial=function(n){return g(n,tt,zt.call(arguments,1),nt)},f.pick=function(n){for(var t=-1,r=l(arguments,nt,rt,1),e=r.length,u={};++t<e;){var i=r[t];i in n&&(u[i]=n[i])}return u},f.pluck=$,f.range=function(n,t,r){n=+n||0,r=+r||1,t==tt&&(t=n,n=0);var e=-1;t=$t(0,Ot((t-n)/r));for(var u=Array(t);++e<t;)u[e]=n,n+=r;
return u},f.reject=function(n,t,r){return t=L(t,r,3),k(n,function(n,r,e){return!t(n,r,e)})},f.rest=G,f.shuffle=function(n){var t=-1,r=n?n.length:0,e=Array(typeof r=="number"?r:0);return D(n,function(n){var r=Et(Wt()*(++t+1));e[t]=e[r],e[r]=n}),e},f.sortBy=function(n,t,r){var e=-1,u=n?n.length:0,o=Array(typeof u=="number"?u:0);for(t=L(t,r,3),D(n,function(n,r,u){o[++e]={l:t(n,r,u),m:e,n:n}}),u=o.length,o.sort(i);u--;)o[u]=o[u].n;return o},f.tap=function(n,t){return t(n),n},f.throttle=function(n,t,r){var e=nt,u=nt;
return r===rt?e=rt:E(r)&&(e="leading"in r?r.leading:e,u="trailing"in r?r.trailing:u),r={},r.leading=e,r.maxWait=t,r.trailing=u,Q(n,t,r)},f.times=function(n,t,r){for(var e=-1,u=Array(-1<n?n:0);++e<n;)u[e]=t.call(r,e);return u},f.toArray=function(n){return Vt(n)?zt.call(n):n&&typeof n.length=="number"?q(n):F(n)},f.union=function(){return s(l(arguments,nt,nt))},f.uniq=J,f.values=F,f.where=C,f.without=function(n){return P(n,zt.call(arguments,1))},f.wrap=function(n,t){return function(){var r=[n];return St.apply(r,arguments),t.apply(this,r)
}},f.zip=function(){for(var n=-1,t=M($(arguments,"length")),r=Array(0>t?0:t);++n<t;)r[n]=$(arguments,n);return r},f.collect=q,f.drop=G,f.each=D,f.extend=b,f.methods=w,f.object=function(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var i=n[r];t?u[i]=t[r]:i&&(u[i[0]]=i[1])}return u},f.select=k,f.tail=G,f.unique=J,f.chain=function(n){return n=new c(n),n.__chain__=nt,n},f.clone=function(n){return E(n)?Vt(n)?zt.call(n):b({},n):n},f.contains=N,f.escape=function(n){return n==tt?"":(n+"").replace(Lt,y)},f.every=R,f.find=B,f.has=function(n,t){return n?Tt.call(n,t):rt
},f.identity=X,f.indexOf=V,f.isArguments=d,f.isArray=Vt,f.isBoolean=function(n){return n===nt||n===rt||Ft.call(n)==lt},f.isDate=function(n){return n?typeof n=="object"&&Ft.call(n)==pt:rt},f.isElement=function(n){return n?1===n.nodeType:rt},f.isEmpty=A,f.isEqual=function(n,t){return p(n,t)},f.isFinite=function(n){return Dt(n)&&!qt(parseFloat(n))},f.isFunction=O,f.isNaN=function(n){return T(n)&&n!=+n},f.isNull=function(n){return n===tt},f.isNumber=T,f.isObject=E,f.isRegExp=function(n){return n&&yt[typeof n]?Ft.call(n)==gt:rt
},f.isString=S,f.isUndefined=function(n){return typeof n=="undefined"},f.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?$t(0,e+r):It(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},f.mixin=Y,f.noConflict=function(){return n._=xt,this},f.random=function(n,t){n==tt&&t==tt&&(t=1),n=+n||0,t==tt?(t=n,n=0):t=+t||0;var r=Wt();return n%1||t%1?n+It(r*(t-n+parseFloat("1e-"+((r+"").length-1))),t):n+Et(r*(t-n+1))},f.reduce=I,f.reduceRight=W,f.result=function(n,t){var r=n?n[t]:Z;
return O(r)?n[t]():r},f.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Gt(n).length},f.some=z,f.sortedIndex=H,f.template=function(n,t,r){var e=f.templateSettings;n||(n=""),r=j({},r,e);var u=0,i="__p+='",e=r.variable;n.replace(RegExp((r.escape||ot).source+"|"+(r.interpolate||ot).source+"|"+(r.evaluate||ot).source+"|$","g"),function(t,r,e,a,f){return i+=n.slice(u,f).replace(at,o),r&&(i+="'+_.escape("+r+")+'"),a&&(i+="';"+a+";__p+='"),e&&(i+="'+((__t=("+e+"))==null?'':__t)+'"),u=f+t.length,t
}),i+="';\n",e||(e="obj",i="with("+e+"||{}){"+i+"}"),i="function("+e+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+i+"return __p}";try{var a=Function("_","return "+i)(f)}catch(c){throw c.source=i,c}return t?a(t):(a.source=i,a)},f.unescape=function(n){return n==tt?"":(n+"").replace(Kt,_)},f.uniqueId=function(n){var t=++et+"";return n?n+t:t},f.all=R,f.any=z,f.detect=B,f.findWhere=function(n,t){return C(n,t,nt)},f.foldl=I,f.foldr=W,f.include=N,f.inject=I,f.first=U,f.last=function(n,t,r){if(n){var e=0,u=n.length;
if(typeof t!="number"&&t!=tt){var i=u;for(t=L(t,r,3);i--&&t(n[i],i,n);)e++}else if(e=t,e==tt||r)return n[u-1];return zt.call(n,$t(0,u-e))}},f.take=U,f.head=U,f.VERSION="1.3.1",Y(f),f.prototype.chain=function(){return this.__chain__=nt,this},f.prototype.value=function(){return this.__wrapped__},D("pop push reverse shift sort splice unshift".split(" "),function(n){var t=jt[n];f.prototype[n]=function(){var n=this.__wrapped__;return t.apply(n,arguments),!Ut.spliceObjects&&0===n.length&&delete n[0],this
}}),D(["concat","join","slice"],function(n){var t=jt[n];f.prototype[n]=function(){var n=t.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new c(n),n.__chain__=nt),n}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=f, define(function(){return f})):_t&&!_t.nodeType?dt?(dt.exports=f)._=f:_t._=f:n._=f}(this);

129
lodash.js
View File

@@ -561,12 +561,12 @@
* `after`, `assign`, `bind`, `bindAll`, `bindKey`, `chain`, `compact`,
* `compose`, `concat`, `countBy`, `createCallback`, `debounce`, `defaults`,
* `defer`, `delay`, `difference`, `filter`, `flatten`, `forEach`, `forIn`,
* `forOwn`, `functions`, `groupBy`, `initial`, `intersection`, `invert`,
* `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`,
* `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `push`, `range`,
* `reject`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`,
* `tap`, `throttle`, `times`, `toArray`, `transform`, `union`, `uniq`, `unshift`,
* `unzip`, `values`, `where`, `without`, `wrap`, and `zip`
* `forOwn`, `functions`, `groupBy`, `indexBy`, `initial`, `intersection`,
* `invert`, `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`,
* `omit`, `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `push`,
* `range`, `reject`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, `sortBy`,
* `splice`, `tap`, `throttle`, `times`, `toArray`, `transform`, `union`, `uniq`,
* `unshift`, `unzip`, `values`, `where`, `without`, `wrap`, and `zip`
*
* The non-chainable wrapper functions are:
* `clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `has`,
@@ -1343,6 +1343,28 @@
return result;
}
/**
* Creates a function that aggregates a collection, creating an object composed
* of keys generated from the results of running each element of the collection
* through a callback. The given `setter` function sets the keys and values
* of the composed object.
*
* @private
* @param {Function} setter The setter function.
* @returns {Function} Returns the new aggregator function.
*/
function createAggregator(setter) {
return function(collection, callback, thisArg) {
var result = {};
callback = lodash.createCallback(callback, thisArg, 3);
forEach(collection, function(value, key, collection) {
key = String(callback(value, key, collection));
setter(result, value, key, collection);
});
return result;
};
}
/**
* Creates a function that, when called, invokes `func` with the `this` binding
* of `thisArg` and prepends any `partialArgs` to the arguments passed to the
@@ -1527,14 +1549,14 @@
* @param {Function} func The function to set data on.
* @param {Mixed} value The value to set.
*/
function setBindData(func, value) {
var setBindData = !defineProperty ? noop : function(func, value) {
defineProperty(func, '__bindData__', {
'configurable': false,
'enumerable': false,
'value': value,
'writable': false
});
}
};
/**
* A fallback implementation of `isPlainObject` which checks if a given `value`
@@ -2285,7 +2307,7 @@
* Checks if `value` is `NaN`.
*
* Note: This is not the same as native `isNaN`, which will return `true` for
* `undefined` and other values. See http://es5.github.io/#x15.1.2.4.
* `undefined` and other non-numeric values. See http://es5.github.io/#x15.1.2.4.
*
* @static
* @memberOf _
@@ -2807,10 +2829,11 @@
}
/**
* Creates an object composed of keys returned from running each element of the
* `collection` through the given `callback`. The corresponding value of each key
* is the number of times the key was returned by the `callback`. The `callback`
* is bound to `thisArg` and invoked with three arguments; (value, index|key, collection).
* Creates an object composed of keys generated from the results of running
* each element of the `collection` through the given `callback`. The corresponding
* value of each key is the number of times the key was returned by the `callback`.
* The `callback` is bound to `thisArg` and invoked with three arguments;
* (value, index|key, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
@@ -2839,16 +2862,9 @@
* _.countBy(['one', 'two', 'three'], 'length');
* // => { '3': 2, '5': 1 }
*/
function countBy(collection, callback, thisArg) {
var result = {};
callback = lodash.createCallback(callback, thisArg, 3);
forEach(collection, function(value, key, collection) {
key = String(callback(value, key, collection));
(hasOwnProperty.call(result, key) ? result[key]++ : result[key] = 1);
});
return result;
}
var countBy = createAggregator(function(result, value, key) {
(hasOwnProperty.call(result, key) ? result[key]++ : result[key] = 1);
});
/**
* Checks if the `callback` returns a truthy value for **all** elements of a
@@ -3083,10 +3099,11 @@
}
/**
* Creates an object composed of keys returned from running each element of the
* `collection` through the `callback`. The corresponding value of each key is
* an array of elements passed to `callback` that returned the key. The `callback`
* is bound to `thisArg` and invoked with three arguments; (value, index|key, collection).
* Creates an object composed of keys generated from the results of running
* each element of the `collection` through the `callback`. The corresponding
* value of each key is an array of the elements responsible for generating
* the key. The `callback` is bound to `thisArg` and invoked with three
* arguments; (value, index|key, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
@@ -3116,16 +3133,52 @@
* _.groupBy(['one', 'two', 'three'], 'length');
* // => { '3': ['one', 'two'], '5': ['three'] }
*/
function groupBy(collection, callback, thisArg) {
var result = {};
callback = lodash.createCallback(callback, thisArg, 3);
var groupBy = createAggregator(function(result, value, key) {
(hasOwnProperty.call(result, key) ? result[key] : result[key] = []).push(value);
});
forEach(collection, function(value, key, collection) {
key = String(callback(value, key, collection));
(hasOwnProperty.call(result, key) ? result[key] : result[key] = []).push(value);
});
return result;
}
/**
* Creates an object composed of keys generated from the results of running
* each element of the `collection` through the given `callback`. The corresponding
* value of each key is the last element responsible for generating the key.
* The `callback` is bound to `thisArg` and invoked with three arguments;
* (value, index|key, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the properties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a property name or object is passed, it will be used to create
* a "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Object} Returns the composed aggregate object.
* @example
*
* var keys = [
* { 'dir': 'left', 'code': 97 },
* { 'dir': 'right', 'code': 100 }
* ];
*
* _.indexBy(keys, 'dir');
* // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
*
* _.indexBy(keys, function(key) { return String.fromCharCode(key.code); });
* // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
*
* _.indexBy(stooges, function(key) { this.fromCharCode(key.code); }, String);
* // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
*/
var indexBy = createAggregator(function(result, value, key) {
result[key] = value;
});
/**
* Invokes the method named by `methodName` on each element in the `collection`,
@@ -4263,7 +4316,8 @@
/**
* Creates an array of numbers (positive and/or negative) progressing from
* `start` up to but not including `end`.
* `start` up to but not including `end`. If `start` is less than `stop` a
* zero-length range is created unless a negative `step` is specified.
*
* @static
* @memberOf _
@@ -5786,6 +5840,7 @@
lodash.forOwn = forOwn;
lodash.functions = functions;
lodash.groupBy = groupBy;
lodash.indexBy = indexBy;
lodash.initial = initial;
lodash.intersection = intersection;
lodash.invert = invert;

View File

@@ -128,6 +128,7 @@
'findWhere',
'forEach',
'groupBy',
'indexBy',
'invoke',
'map',
'max',
@@ -280,6 +281,7 @@
'findKey',
'forIn',
'forOwn',
'indexBy',
'isPlainObject',
'merge',
'parseInt',