Add _.sample.

Former-commit-id: 00e27cca2a65e1310b26904173ffec18aa484e48
This commit is contained in:
John-David Dalton
2013-08-16 00:26:41 -07:00
parent 96605766bb
commit 425499b3aa
12 changed files with 530 additions and 296 deletions

View File

@@ -201,7 +201,8 @@
'rest': ['createCallback', 'slice'],
'result': ['isFunction'],
'runInContext': ['defaults', 'pick'],
'shuffle': ['forEach'],
'sample': ['random', 'shuffle', 'toArray'],
'shuffle': ['forEach', 'random'],
'size': ['keys'],
'some': ['baseEach', 'createCallback', 'isArray'],
'sortBy': ['compareAscending', 'createCallback', 'forEach', 'getObject', 'releaseObject'],
@@ -380,6 +381,7 @@
'reduce',
'reduceRight',
'reject',
'sample',
'shuffle',
'size',
'some',
@@ -584,6 +586,7 @@
'pull',
'remove',
'runInContext',
'sample',
'transform',
'wrapperToString'
];

View File

@@ -225,6 +225,7 @@
'rest',
'result',
'runInContext',
'sample',
'select',
'setImmediate',
'setTimeout',

80
dist/lodash.compat.js vendored
View File

@@ -3759,6 +3759,37 @@
});
}
/**
* Retrieves a random element or `n` random elements from a collection.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|String} collection The collection to sample.
* @returns {Array} Returns the random sample(s) of `collection`.
* @example
*
* _.sample([1, 2, 3, 4]);
* // => 2
*
* _.sample([1, 2, 3, 4], 2);
* // => [3, 1]
*/
function sample(collection, n, guard) {
if (!isArray(collection)) {
collection = toArray(collection);
}
var index = -1,
maxIndex = collection.length - 1;
if (n == null || guard) {
return collection[random(maxIndex)];
}
var result = shuffle(collection);
result.length = nativeMin(nativeMax(0, n), result.length);
return result;
}
/**
* Creates an array of shuffled values, using a version of the Fisher-Yates
* shuffle. See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle.
@@ -3779,7 +3810,7 @@
result = Array(typeof length == 'number' ? length : 0);
forEach(collection, function(value) {
var rand = floor(nativeRandom() * (++index + 1));
var rand = random(++index);
result[index] = result[rand];
result[rand] = value;
});
@@ -4121,11 +4152,10 @@
}
/**
* Gets the first element of an array. If a number `n` is provided the first
* `n` elements of the array are returned. If a callback is provided elements
* at the beginning of the array are returned as long as the callback returns
* truthy. The callback is bound to `thisArg` and invoked with three arguments;
* (value, index, array).
* Gets the first element or first `n` elements of an array. If a callback
* is provided elements at the beginning of the array are returned as long
* as the callback returns truthy. The callback is bound to `thisArg` and
* invoked with three arguments; (value, index, array).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
@@ -4288,11 +4318,10 @@
}
/**
* Gets all but the last element of an array. If a number `n` is provided
* the last `n` elements are excluded from the result. If a callback is
* provided elements at the end of the array are excluded from the result
* as long as the callback returns truthy. The callback is bound to `thisArg`
* and invoked with three arguments; (value, index, array).
* Gets all but the last element or last `n` elements of an array. If a
* callback is provided elements at the end of the array are excluded from
* the result as long as the callback returns truthy. The callback is bound
* to `thisArg` and invoked with three arguments; (value, index, array).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
@@ -4422,12 +4451,10 @@
}
/**
* Gets the last element of an array. If a number `n` is provided the last
* `n` elements of the array are returned. If a callback is provided elements
* at the end of the array are returned as long as the callback returns truthy.
* The callback is bound to `thisArg` and invoked with three arguments;
* (value, index, array).
*
* Gets the last element or last `n` elements of an array. If a callback is
* provided elements at the end of the array are returned as long as the
* callback returns truthy. The callback is bound to `thisArg` and invoked
* with three arguments; (value, index, array).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
@@ -4671,12 +4698,11 @@
}
/**
* The opposite of `_.initial` this method gets all but the first value of
* an array. If a number `n` is provided the first `n` values are excluded
* from the result. If a callback function is provided elements at the beginning
* of the array are excluded from the result as long as the callback returns
* truthy. The callback is bound to `thisArg` and invoked with three
* arguments; (value, index, array).
* The opposite of `_.initial` this method gets all but the first element or
* first `n` elements of an array. If a callback function is provided elements
* at the beginning of the array are excluded from the result as long as the
* callback returns truthy. The callback is bound to `thisArg` and invoked
* with three arguments; (value, index, array).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
@@ -6373,18 +6399,20 @@
// add functions capable of returning wrapped and unwrapped values when chaining
lodash.first = first;
lodash.last = last;
lodash.sample = sample;
// add aliases
lodash.take = first;
lodash.head = first;
forOwn(lodash, function(func, methodName) {
var callbackable = methodName !== 'sample';
if (!lodash.prototype[methodName]) {
lodash.prototype[methodName]= function(callback, thisArg) {
lodash.prototype[methodName]= function(n, guard) {
var chainAll = this.__chain__,
result = func(this.__wrapped__, callback, thisArg);
result = func(this.__wrapped__, n, guard);
return !chainAll && (callback == null || (thisArg && typeof callback != 'function'))
return !chainAll && (n == null || (guard && !(callbackable && typeof n == 'function')))
? result
: new lodashWrapper(result, chainAll);
};

View File

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

80
dist/lodash.js vendored
View File

@@ -3458,6 +3458,37 @@
});
}
/**
* Retrieves a random element or `n` random elements from a collection.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|String} collection The collection to sample.
* @returns {Array} Returns the random sample(s) of `collection`.
* @example
*
* _.sample([1, 2, 3, 4]);
* // => 2
*
* _.sample([1, 2, 3, 4], 2);
* // => [3, 1]
*/
function sample(collection, n, guard) {
if (!isArray(collection)) {
collection = toArray(collection);
}
var index = -1,
maxIndex = collection.length - 1;
if (n == null || guard) {
return collection[random(maxIndex)];
}
var result = shuffle(collection);
result.length = nativeMin(nativeMax(0, n), result.length);
return result;
}
/**
* Creates an array of shuffled values, using a version of the Fisher-Yates
* shuffle. See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle.
@@ -3478,7 +3509,7 @@
result = Array(typeof length == 'number' ? length : 0);
forEach(collection, function(value) {
var rand = floor(nativeRandom() * (++index + 1));
var rand = random(++index);
result[index] = result[rand];
result[rand] = value;
});
@@ -3818,11 +3849,10 @@
}
/**
* Gets the first element of an array. If a number `n` is provided the first
* `n` elements of the array are returned. If a callback is provided elements
* at the beginning of the array are returned as long as the callback returns
* truthy. The callback is bound to `thisArg` and invoked with three arguments;
* (value, index, array).
* Gets the first element or first `n` elements of an array. If a callback
* is provided elements at the beginning of the array are returned as long
* as the callback returns truthy. The callback is bound to `thisArg` and
* invoked with three arguments; (value, index, array).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
@@ -3985,11 +4015,10 @@
}
/**
* Gets all but the last element of an array. If a number `n` is provided
* the last `n` elements are excluded from the result. If a callback is
* provided elements at the end of the array are excluded from the result
* as long as the callback returns truthy. The callback is bound to `thisArg`
* and invoked with three arguments; (value, index, array).
* Gets all but the last element or last `n` elements of an array. If a
* callback is provided elements at the end of the array are excluded from
* the result as long as the callback returns truthy. The callback is bound
* to `thisArg` and invoked with three arguments; (value, index, array).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
@@ -4119,12 +4148,10 @@
}
/**
* Gets the last element of an array. If a number `n` is provided the last
* `n` elements of the array are returned. If a callback is provided elements
* at the end of the array are returned as long as the callback returns truthy.
* The callback is bound to `thisArg` and invoked with three arguments;
* (value, index, array).
*
* Gets the last element or last `n` elements of an array. If a callback is
* provided elements at the end of the array are returned as long as the
* callback returns truthy. The callback is bound to `thisArg` and invoked
* with three arguments; (value, index, array).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
@@ -4368,12 +4395,11 @@
}
/**
* The opposite of `_.initial` this method gets all but the first value of
* an array. If a number `n` is provided the first `n` values are excluded
* from the result. If a callback function is provided elements at the beginning
* of the array are excluded from the result as long as the callback returns
* truthy. The callback is bound to `thisArg` and invoked with three
* arguments; (value, index, array).
* The opposite of `_.initial` this method gets all but the first element or
* first `n` elements of an array. If a callback function is provided elements
* at the beginning of the array are excluded from the result as long as the
* callback returns truthy. The callback is bound to `thisArg` and invoked
* with three arguments; (value, index, array).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
@@ -6070,18 +6096,20 @@
// add functions capable of returning wrapped and unwrapped values when chaining
lodash.first = first;
lodash.last = last;
lodash.sample = sample;
// add aliases
lodash.take = first;
lodash.head = first;
forOwn(lodash, function(func, methodName) {
var callbackable = methodName !== 'sample';
if (!lodash.prototype[methodName]) {
lodash.prototype[methodName]= function(callback, thisArg) {
lodash.prototype[methodName]= function(n, guard) {
var chainAll = this.__chain__,
result = func(this.__wrapped__, callback, thisArg);
result = func(this.__wrapped__, n, guard);
return !chainAll && (callback == null || (thisArg && typeof callback != 'function'))
return !chainAll && (n == null || (guard && !(callbackable && typeof n == 'function')))
? result
: new lodashWrapper(result, chainAll);
};

85
dist/lodash.min.js vendored
View File

@@ -4,48 +4,49 @@
* Build: `lodash modern -o ./dist/lodash.js`
*/
;!function(n){function t(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 r(n,r){var e=typeof r;if(n=n.k,"boolean"==e||r==m)return n[r];"number"!=e&&"string"!=e&&(e="object");var u="number"==e?r:j+r;return n=n[e]||(n[e]={}),"object"==e?n[u]&&-1<t(n[u],r)?0:-1:n[u]?0:-1}function e(n){var t=this.k,r=typeof n;if("boolean"==r||n==m)t[n]=y;else{"number"!=r&&"string"!=r&&(r="object");var e="number"==r?n:j+n,t=t[r]||(t[r]={});"object"==r?(t[e]||(t[e]=[])).push(n):t[e]=y
}}function u(n){return n.charCodeAt(0)}function o(n,t){var r=n.l,e=t.l;if(r!==e){if(r>e||typeof r=="undefined")return 1;if(r<e||typeof e=="undefined")return-1}return n.m-t.m}function i(n){var t=-1,r=n.length,u=n[0],o=n[r-1];if(u&&typeof u=="object"&&o&&typeof o=="object")return _;for(u=c(),u["false"]=u["null"]=u["true"]=u.undefined=_,o=c(),o.b=n,o.k=u,o.push=e;++t<r;)o.push(n[t]);return o}function a(n){return"\\"+H[n]}function f(){return b.pop()||[]}function c(){return d.pop()||{b:m,k:m,configurable:_,l:m,enumerable:_,"false":_,m:0,leading:_,maxWait:0,"null":_,number:m,z:m,push:m,string:m,trailing:_,"true":_,undefined:_,n:m,writable:_}
}function l(){}function p(n){n.length=0,b.length<x&&b.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=m,d.length<x&&d.push(n)}function v(n,t,r){t||(t=0),typeof r=="undefined"&&(r=n?n.length:0);var e=-1;r=r-t||0;for(var u=Array(0>r?0:r);++e<r;)u[e]=n[t+e];return u}function h(e){function b(n){if(!n||dr.call(n)!=L)return _;var t=n.valueOf,r=typeof t=="function"&&(r=vr(t))&&vr(r);return r?n==r||vr(n)==r:pt(n)}function d(n,t,r){if(!n||!G[typeof n])return n;t=t&&typeof r=="undefined"?t:rt(t,r,3);
for(var e=-1,u=G[typeof n]&&qr(n),o=u?u.length:0;++e<o&&(r=u[e],!(t(n[r],r,n)===false)););return n}function x(n,t,r){var e;if(!n||!G[typeof n])return n;t=t&&typeof r=="undefined"?t:rt(t,r,3);for(e in n)if(t(n[e],e,n)===false)break;return n}function H(n,t,r){var e,u=n,o=u;if(!u)return o;for(var i=arguments,a=0,f=typeof r=="number"?2:i.length;++a<f;)if((u=i[a])&&G[typeof u])for(var c=-1,l=G[typeof u]&&qr(u),p=l?l.length:0;++c<p;)e=l[c],"undefined"==typeof o[e]&&(o[e]=u[e]);return o}function J(n,t,r){var e,u=n,o=u;
if(!u)return o;var i=arguments,a=0,f=typeof r=="number"?2:i.length;if(3<f&&"function"==typeof i[f-2])var c=rt(i[--f-1],i[f--],2);else 2<f&&"function"==typeof i[f-1]&&(c=i[--f]);for(;++a<f;)if((u=i[a])&&G[typeof u])for(var l=-1,p=G[typeof u]&&qr(u),s=p?p.length:0;++l<s;)e=p[l],o[e]=c?c(o[e],u[e]):u[e];return o}function X(n){var t,r=[];if(!n||!G[typeof n])return r;for(t in n)hr.call(n,t)&&r.push(t);return r}function Z(n){return n&&typeof n=="object"&&!zr(n)&&hr.call(n,"__wrapped__")?n:new nt(n)}function nt(n,t){this.__chain__=!!t,this.__wrapped__=n
}function tt(n,t,r,e,u){var o=n;if(r){if(o=r(o),typeof o!="undefined")return o;o=n}var i=_t(o);if(i){var a=dr.call(o);if(!V[a])return o;var c=zr(o)}if(!i||!t)return i?c?v(o):J({},o):o;switch(i=Dr[a],a){case q:case W:return new i(+o);case K:case U:return new i(o);case M:return i(o.source,A.exec(o))}a=!e,e||(e=f()),u||(u=f());for(var l=e.length;l--;)if(e[l]==n)return u[l];return o=c?i(o.length):{},c&&(hr.call(n,"index")&&(o.index=n.index),hr.call(n,"input")&&(o.input=n.input)),e.push(n),u.push(o),(c?Ot:d)(n,function(n,i){o[i]=tt(n,t,r,e,u)
}),a&&(p(e),p(u)),o}function rt(n,t,r){if(typeof n!="function")return Ut;if(typeof t=="undefined")return n;var e=!n.name||n.__bindData__;if(typeof e=="undefined"&&(e=!$||$.test(sr.call(n)),Tr(n,e)),e!==y&&!(e&&1&e[1]))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,o){return n.call(t,r,e,u,o)}}return Kt(n,t)}function et(n,t,r,e){e=(e||0)-1;for(var u=n?n.length:0,o=[];++e<u;){var i=n[e];
i&&typeof i=="object"&&(zr(i)||vt(i))?yr.apply(o,t?i:et(i,t,r)):r||o.push(i)}return o}function ut(n,t,r,e,u,o){if(r){var i=r(n,t);if(typeof i!="undefined")return!!i}if(n===t)return 0!==n||1/n==1/t;if(n===n&&(!n||!G[typeof n])&&(!t||!G[typeof t]))return _;if(n==m||t==m)return n===t;var a=dr.call(n),c=dr.call(t);if(a==T&&(a=L),c==T&&(c=L),a!=c)return _;switch(a){case q:case W:return+n==+t;case K:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case M:case U:return n==rr(t)}if(c=a==z,!c){if(hr.call(n,"__wrapped__")||hr.call(t,"__wrapped__"))return ut(n.__wrapped__||n,t.__wrapped__||t,r,e,u,o);
if(a!=L)return _;var a=n.constructor,l=t.constructor;if(a!=l&&(!mt(a)||!(a instanceof a&&mt(l)&&l instanceof l)))return _}for(l=!u,u||(u=f()),o||(o=f()),a=u.length;a--;)if(u[a]==n)return o[a]==t;var s=0,i=y;if(u.push(n),o.push(t),c){if(a=n.length,s=t.length,i=s==n.length,!i&&!e)return i;for(;s--;)if(c=a,l=t[s],e)for(;c--&&!(i=ut(n[c],l,r,e,u,o)););else if(!(i=ut(n[s],l,r,e,u,o)))break;return i}return x(t,function(t,a,f){return hr.call(f,a)?(s++,i=hr.call(n,a)&&ut(n[a],t,r,e,u,o)):void 0}),i&&!e&&x(n,function(n,t,r){return hr.call(r,t)?i=-1<--s:void 0
}),l&&(p(u),p(o)),i}function ot(n,t,r,e,u){(zr(t)?Ot:d)(t,function(t,o){var i,a,f=t,c=n[o];if(t&&((a=zr(t))||b(t))){for(f=e.length;f--;)if(i=e[f]==t){c=u[f];break}if(!i){var l;r&&(f=r(c,t),l=typeof f!="undefined")&&(c=f),l||(c=a?zr(c)?c:[]:b(c)?c:{}),e.push(t),u.push(c),l||ot(c,t,r,e,u)}}else r&&(f=r(c,t),typeof f=="undefined"&&(f=t)),typeof f!="undefined"&&(c=f);n[o]=c})}function it(n,e,u){var o=-1,a=lt(),c=n?n.length:0,l=[],v=!e&&c>=k&&a===t,h=u||v?f():l;if(v){var g=i(h);g?(a=r,h=g):(v=_,h=u?h:(p(h),l))
}for(;++o<c;){var g=n[o],y=u?u(g,o,n):g;(e?!o||h[h.length-1]!==y:0>a(h,y))&&((u||v)&&h.push(y),l.push(g))}return v?(p(h.b),s(h)):u&&p(h),l}function at(n){return function(t,r,e){var u={};return r=Z.createCallback(r,e,3),Ot(t,function(t,e,o){e=rr(r(t,e,o)),n(u,t,e,o)}),u}}function ft(n,t,r,e,u,o){var i=1&t,a=2&t,f=4&t,c=8&t,l=16&t,p=32&t;if(!a&&!mt(n))throw new er;var s=n&&n.__bindData__;if(s)return i&&!(1&s[1])&&(s[4]=u),!i&&1&s[1]&&(t|=8),f&&!(4&s[1])&&(s[5]=o),l&&yr.apply(s[2]||(s[2]=[]),r),p&&yr.apply(s[3]||(s[3]=[]),e),s[1]|=t,ft.apply(m,s);
if(!i||a||f||p||!(Fr.fastBind||jr&&r.length))v=function(){var l=arguments,p=i?u:this;return r&&wr.apply(l,r),e&&yr.apply(l,e),f&&l.length<o?(t|=16,ft(n,c?t:-4&t,l,m,u,o)):(a&&(n=p[h]),this instanceof v?(p=_t(n.prototype)?kr(n.prototype):{},l=n.apply(p,l),_t(l)?l:p):n.apply(p,l))};else{l=[n,u],yr.apply(l,r);var v=jr.call.apply(jr,l)}if(s=Rr.call(arguments),a){var h=u;u=n}return Tr(v,s),v}function ct(n){return Wr[n]}function lt(){var n=(n=Z.indexOf)===Ft?t:n;return n}function pt(n){var t,r;return n&&dr.call(n)==L&&(t=n.constructor,!mt(t)||t instanceof t)?(x(n,function(n,t){r=t
}),r===g||hr.call(n,r)):_}function st(n){return Pr[n]}function vt(n){return n&&typeof n=="object"?dr.call(n)==T:_}function ht(n,t,r){var e=qr(n),u=e.length;for(t=rt(t,r,3);u--&&(r=e[u],!(t(n[r],r,n)===false)););return n}function gt(n){var t=[];return x(n,function(n,r){mt(n)&&t.push(r)}),t.sort()}function yt(n){for(var t=-1,r=qr(n),e=r.length,u={};++t<e;){var o=r[t];u[n[o]]=o}return u}function mt(n){return typeof n=="function"}function _t(n){return!(!n||!G[typeof n])}function bt(n){return typeof n=="number"||dr.call(n)==K
}function dt(n){return typeof n=="string"||dr.call(n)==U}function wt(n){for(var t=-1,r=qr(n),e=r.length,u=Ht(e);++t<e;)u[t]=n[r[t]];return u}function jt(n,t,r){var e=-1,u=lt(),o=n?n.length:0,i=_;return r=(0>r?Ir(0,o+r):r)||0,o&&typeof o=="number"?i=-1<(dt(n)?n.indexOf(t,r):u(n,t,r)):d(n,function(n){return++e<r?void 0:!(i=n===t)}),i}function kt(n,t,r){var e=y;t=Z.createCallback(t,r,3),r=-1;var u=n?n.length:0;if(typeof u=="number")for(;++r<u&&(e=!!t(n[r],r,n)););else d(n,function(n,r,u){return e=!!t(n,r,u)
}}function u(n){return n.charCodeAt(0)}function o(n,t){var r=n.l,e=t.l;if(r!==e){if(r>e||typeof r=="undefined")return 1;if(r<e||typeof e=="undefined")return-1}return n.m-t.m}function a(n){var t=-1,r=n.length,u=n[0],o=n[r-1];if(u&&typeof u=="object"&&o&&typeof o=="object")return _;for(u=c(),u["false"]=u["null"]=u["true"]=u.undefined=_,o=c(),o.b=n,o.k=u,o.push=e;++t<r;)o.push(n[t]);return o}function i(n){return"\\"+H[n]}function f(){return b.pop()||[]}function c(){return d.pop()||{b:m,k:m,configurable:_,l:m,enumerable:_,"false":_,m:0,leading:_,maxWait:0,"null":_,number:m,z:m,push:m,string:m,trailing:_,"true":_,undefined:_,n:m,writable:_}
}function l(){}function p(n){n.length=0,b.length<x&&b.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=m,d.length<x&&d.push(n)}function v(n,t,r){t||(t=0),typeof r=="undefined"&&(r=n?n.length:0);var e=-1;r=r-t||0;for(var u=Array(0>r?0:r);++e<r;)u[e]=n[t+e];return u}function h(e){function b(n){if(!n||kr.call(n)!=L)return _;var t=n.valueOf,r=typeof t=="function"&&(r=yr(t))&&yr(r);return r?n==r||yr(n)==r:pt(n)}function d(n,t,r){if(!n||!G[typeof n])return n;t=t&&typeof r=="undefined"?t:rt(t,r,3);
for(var e=-1,u=G[typeof n]&&Kr(n),o=u?u.length:0;++e<o&&(r=u[e],!(t(n[r],r,n)===false)););return n}function x(n,t,r){var e;if(!n||!G[typeof n])return n;t=t&&typeof r=="undefined"?t:rt(t,r,3);for(e in n)if(t(n[e],e,n)===false)break;return n}function H(n,t,r){var e,u=n,o=u;if(!u)return o;for(var a=arguments,i=0,f=typeof r=="number"?2:a.length;++i<f;)if((u=a[i])&&G[typeof u])for(var c=-1,l=G[typeof u]&&Kr(u),p=l?l.length:0;++c<p;)e=l[c],"undefined"==typeof o[e]&&(o[e]=u[e]);return o}function J(n,t,r){var e,u=n,o=u;
if(!u)return o;var a=arguments,i=0,f=typeof r=="number"?2:a.length;if(3<f&&"function"==typeof a[f-2])var c=rt(a[--f-1],a[f--],2);else 2<f&&"function"==typeof a[f-1]&&(c=a[--f]);for(;++i<f;)if((u=a[i])&&G[typeof u])for(var l=-1,p=G[typeof u]&&Kr(u),s=p?p.length:0;++l<s;)e=p[l],o[e]=c?c(o[e],u[e]):u[e];return o}function X(n){var t,r=[];if(!n||!G[typeof n])return r;for(t in n)mr.call(n,t)&&r.push(t);return r}function Z(n){return n&&typeof n=="object"&&!Pr(n)&&mr.call(n,"__wrapped__")?n:new nt(n)}function nt(n,t){this.__chain__=!!t,this.__wrapped__=n
}function tt(n,t,r,e,u){var o=n;if(r){if(o=r(o),typeof o!="undefined")return o;o=n}var a=_t(o);if(a){var i=kr.call(o);if(!V[i])return o;var c=Pr(o)}if(!a||!t)return a?c?v(o):J({},o):o;switch(a=zr[i],i){case q:case W:return new a(+o);case K:case U:return new a(o);case M:return a(o.source,A.exec(o))}i=!e,e||(e=f()),u||(u=f());for(var l=e.length;l--;)if(e[l]==n)return u[l];return o=c?a(o.length):{},c&&(mr.call(n,"index")&&(o.index=n.index),mr.call(n,"input")&&(o.input=n.input)),e.push(n),u.push(o),(c?Ot:d)(n,function(n,a){o[a]=tt(n,t,r,e,u)
}),i&&(p(e),p(u)),o}function rt(n,t,r){if(typeof n!="function")return Gt;if(typeof t=="undefined")return n;var e=!n.name||n.__bindData__;if(typeof e=="undefined"&&(e=!$||$.test(gr.call(n)),Wr(n,e)),e!==y&&!(e&&1&e[1]))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,o){return n.call(t,r,e,u,o)}}return Mt(n,t)}function et(n,t,r,e){e=(e||0)-1;for(var u=n?n.length:0,o=[];++e<u;){var a=n[e];
a&&typeof a=="object"&&(Pr(a)||vt(a))?br.apply(o,t?a:et(a,t,r)):r||o.push(a)}return o}function ut(n,t,r,e,u,o){if(r){var a=r(n,t);if(typeof a!="undefined")return!!a}if(n===t)return 0!==n||1/n==1/t;if(n===n&&(!n||!G[typeof n])&&(!t||!G[typeof t]))return _;if(n==m||t==m)return n===t;var i=kr.call(n),c=kr.call(t);if(i==T&&(i=L),c==T&&(c=L),i!=c)return _;switch(i){case q:case W:return+n==+t;case K:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case M:case U:return n==or(t)}if(c=i==z,!c){if(mr.call(n,"__wrapped__")||mr.call(t,"__wrapped__"))return ut(n.__wrapped__||n,t.__wrapped__||t,r,e,u,o);
if(i!=L)return _;var i=n.constructor,l=t.constructor;if(i!=l&&(!mt(i)||!(i instanceof i&&mt(l)&&l instanceof l)))return _}for(l=!u,u||(u=f()),o||(o=f()),i=u.length;i--;)if(u[i]==n)return o[i]==t;var s=0,a=y;if(u.push(n),o.push(t),c){if(i=n.length,s=t.length,a=s==n.length,!a&&!e)return a;for(;s--;)if(c=i,l=t[s],e)for(;c--&&!(a=ut(n[c],l,r,e,u,o)););else if(!(a=ut(n[s],l,r,e,u,o)))break;return a}return x(t,function(t,i,f){return mr.call(f,i)?(s++,a=mr.call(n,i)&&ut(n[i],t,r,e,u,o)):void 0}),a&&!e&&x(n,function(n,t,r){return mr.call(r,t)?a=-1<--s:void 0
}),l&&(p(u),p(o)),a}function ot(n,t,r,e,u){(Pr(t)?Ot:d)(t,function(t,o){var a,i,f=t,c=n[o];if(t&&((i=Pr(t))||b(t))){for(f=e.length;f--;)if(a=e[f]==t){c=u[f];break}if(!a){var l;r&&(f=r(c,t),l=typeof f!="undefined")&&(c=f),l||(c=i?Pr(c)?c:[]:b(c)?c:{}),e.push(t),u.push(c),l||ot(c,t,r,e,u)}}else r&&(f=r(c,t),typeof f=="undefined"&&(f=t)),typeof f!="undefined"&&(c=f);n[o]=c})}function at(n,e,u){var o=-1,i=lt(),c=n?n.length:0,l=[],v=!e&&c>=k&&i===t,h=u||v?f():l;if(v){var g=a(h);g?(i=r,h=g):(v=_,h=u?h:(p(h),l))
}for(;++o<c;){var g=n[o],y=u?u(g,o,n):g;(e?!o||h[h.length-1]!==y:0>i(h,y))&&((u||v)&&h.push(y),l.push(g))}return v?(p(h.b),s(h)):u&&p(h),l}function it(n){return function(t,r,e){var u={};return r=Z.createCallback(r,e,3),Ot(t,function(t,e,o){e=or(r(t,e,o)),n(u,t,e,o)}),u}}function ft(n,t,r,e,u,o){var a=1&t,i=2&t,f=4&t,c=8&t,l=16&t,p=32&t;if(!i&&!mt(n))throw new ar;var s=n&&n.__bindData__;if(s)return a&&!(1&s[1])&&(s[4]=u),!a&&1&s[1]&&(t|=8),f&&!(4&s[1])&&(s[5]=o),l&&br.apply(s[2]||(s[2]=[]),r),p&&br.apply(s[3]||(s[3]=[]),e),s[1]|=t,ft.apply(m,s);
if(!a||i||f||p||!(qr.fastBind||Cr&&r.length))v=function(){var l=arguments,p=a?u:this;return r&&xr.apply(l,r),e&&br.apply(l,e),f&&l.length<o?(t|=16,ft(n,c?t:-4&t,l,m,u,o)):(i&&(n=p[h]),this instanceof v?(p=_t(n.prototype)?Or(n.prototype):{},l=n.apply(p,l),_t(l)?l:p):n.apply(p,l))};else{l=[n,u],br.apply(l,r);var v=Cr.call.apply(Cr,l)}if(s=Dr.call(arguments),i){var h=u;u=n}return Wr(v,s),v}function ct(n){return Lr[n]}function lt(){var n=(n=Z.indexOf)===zt?t:n;return n}function pt(n){var t,r;return n&&kr.call(n)==L&&(t=n.constructor,!mt(t)||t instanceof t)?(x(n,function(n,t){r=t
}),r===g||mr.call(n,r)):_}function st(n){return Mr[n]}function vt(n){return n&&typeof n=="object"?kr.call(n)==T:_}function ht(n,t,r){var e=Kr(n),u=e.length;for(t=rt(t,r,3);u--&&(r=e[u],!(t(n[r],r,n)===false)););return n}function gt(n){var t=[];return x(n,function(n,r){mt(n)&&t.push(r)}),t.sort()}function yt(n){for(var t=-1,r=Kr(n),e=r.length,u={};++t<e;){var o=r[t];u[n[o]]=o}return u}function mt(n){return typeof n=="function"}function _t(n){return!(!n||!G[typeof n])}function bt(n){return typeof n=="number"||kr.call(n)==K
}function dt(n){return typeof n=="string"||kr.call(n)==U}function wt(n){for(var t=-1,r=Kr(n),e=r.length,u=Xt(e);++t<e;)u[t]=n[r[t]];return u}function jt(n,t,r){var e=-1,u=lt(),o=n?n.length:0,a=_;return r=(0>r?Nr(0,o+r):r)||0,o&&typeof o=="number"?a=-1<(dt(n)?n.indexOf(t,r):u(n,t,r)):d(n,function(n){return++e<r?void 0:!(a=n===t)}),a}function kt(n,t,r){var e=y;t=Z.createCallback(t,r,3),r=-1;var u=n?n.length:0;if(typeof u=="number")for(;++r<u&&(e=!!t(n[r],r,n)););else d(n,function(n,r,u){return e=!!t(n,r,u)
});return e}function xt(n,t,r){var e=[];t=Z.createCallback(t,r,3),r=-1;var u=n?n.length:0;if(typeof u=="number")for(;++r<u;){var o=n[r];t(o,r,n)&&e.push(o)}else d(n,function(n,r,u){t(n,r,u)&&e.push(n)});return e}function Ct(n,t,r){t=Z.createCallback(t,r,3),r=-1;var e=n?n.length:0;if(typeof e!="number"){var u;return d(n,function(n,r,e){return t(n,r,e)?(u=n,_):void 0}),u}for(;++r<e;){var o=n[r];if(t(o,r,n))return o}}function Ot(n,t,r){var e=-1,u=n?n.length:0;if(t=t&&typeof r=="undefined"?t:rt(t,r,3),typeof u=="number")for(;++e<u&&t(n[e],e,n)!==false;);else d(n,t);
return n}function Et(n,t,r){var e=n?n.length:0;if(typeof e!="number")var u=qr(n),e=u.length;return t=rt(t,r,3),Ot(n,function(r,o,i){return o=u?u[--e]:--e,t(n[o],o,i)}),n}function It(n,t,r){var e=-1,u=n?n.length:0;if(t=Z.createCallback(t,r,3),typeof u=="number")for(var o=Ht(u);++e<u;)o[e]=t(n[e],e,n);else o=[],d(n,function(n,r,u){o[++e]=t(n,r,u)});return o}function St(n,t,r){var e=-1/0,o=e;if(!t&&zr(n)){r=-1;for(var i=n.length;++r<i;){var a=n[r];a>o&&(o=a)}}else t=!t&&dt(n)?u:Z.createCallback(t,r,3),Ot(n,function(n,r,u){r=t(n,r,u),r>e&&(e=r,o=n)
});return o}function At(n,t){var r=-1,e=n?n.length:0;if(typeof e=="number")for(var u=Ht(e);++r<e;)u[r]=n[r][t];return u||It(n,t)}function Nt(n,t,r,e){if(!n)return r;var u=3>arguments.length;t=rt(t,e,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(r=n[++o]);++o<i;)r=t(r,n[o],o,n);else d(n,function(n,e,o){r=u?(u=_,n):t(r,n,e,o)});return r}function Rt(n,t,r,e){var u=3>arguments.length;return t=rt(t,e,4),Et(n,function(n,e,o){r=u?(u=_,n):t(r,n,e,o)}),r}function Bt(n,t,r){var e;t=Z.createCallback(t,r,3),r=-1;
var u=n?n.length:0;if(typeof u=="number")for(;++r<u&&!(e=t(n[r],r,n)););else d(n,function(n,r,u){return!(e=t(n,r,u))});return!!e}function $t(n){var e=-1,u=lt(),o=n?n.length:0,a=et(arguments,y,y,1),f=[],c=o>=k&&u===t;if(c){var l=i(a);l?(u=r,a=l):c=_}for(;++e<o;)l=n[e],0>u(a,l)&&f.push(l);return c&&s(a),f}function Dt(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=m){var o=-1;for(t=Z.createCallback(t,r,3);++o<u&&t(n[o],o,n);)e++}else if(e=t,e==m||r)return n[0];return v(n,0,Sr(Ir(0,e),u))}}function Ft(n,r,e){if(typeof e=="number"){var u=n?n.length:0;
e=0>e?Ir(0,u+e):e||0}else if(e)return e=zt(n,r),n[e]===r?e:-1;return n?t(n,r,e):-1}function Tt(n,t,r){if(typeof t!="number"&&t!=m){var e=0,u=-1,o=n?n.length:0;for(t=Z.createCallback(t,r,3);++u<o&&t(n[u],u,n);)e++}else e=t==m||r?1:Ir(0,t);return v(n,e)}function zt(n,t,r,e){var u=0,o=n?n.length:u;for(r=r?Z.createCallback(r,e,1):Ut,t=r(t);u<o;)e=u+o>>>1,r(n[e])<t?u=e+1:o=e;return u}function qt(n,t,r,e){return typeof t!="boolean"&&t!=m&&(e=r,r=e&&e[t]===n?g:t,t=_),r!=m&&(r=Z.createCallback(r,e,3)),it(n,t,r)
}function Wt(){for(var n=1<arguments.length?arguments:arguments[0],t=-1,r=n?St(At(n,"length")):0,e=Ht(0>r?0:r);++t<r;)e[t]=At(n,t);return e}function Pt(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var o=n[r];t?u[o]=t[r]:o&&(u[o[0]]=o[1])}return u}function Kt(n,t){return ft(n,17,Rr.call(arguments,2),m,t)}function Lt(n,t,r){function e(){o(),(h||p!==t)&&(l=gr(),a=n.apply(f,i))}function u(){var t=h&&(!g||1<c);o(),t&&(l=gr(),a=n.apply(f,i))}function o(){cr(s),cr(v),c=0,s=v=m}var i,a,f,c=0,l=0,p=_,s=m,v=m,h=y;
if(!mt(n))throw new er;if(t=Ir(0,t||0),r===y)var g=y,h=_;else _t(r)&&(g=r.leading,p="maxWait"in r&&Ir(t,r.maxWait||0),h="trailing"in r?r.trailing:h);return function(){if(i=arguments,f=this,c++,cr(v),p===false)g&&2>c&&(a=n.apply(f,i));else{var r=gr();!s&&!g&&(l=r);var o=p-(r-l);0<o?s||(s=_r(e,o)):(cr(s),s=m,l=r,a=n.apply(f,i))}return t!==p&&(v=_r(u,t)),a}}function Mt(n){if(!mt(n))throw new er;var t=Rr.call(arguments,1);return _r(function(){n.apply(g,t)},1)}function Ut(n){return n}function Vt(n,t){var r=n,e=!t||mt(r);
t||(r=nt,t=n,n=Z),Ot(gt(t),function(u){var o=n[u]=t[u];e&&(r.prototype[u]=function(){var t=this.__wrapped__,e=[t];return yr.apply(e,arguments),e=o.apply(n,e),t&&typeof t=="object"&&t===e?this:new r(e)})})}function Gt(){return this.__wrapped__}e=e?Y.defaults(n.Object(),e,Y.pick(n,F)):n;var Ht=e.Array,Jt=e.Boolean,Qt=e.Date,Xt=e.Function,Yt=e.Math,Zt=e.Number,nr=e.Object,tr=e.RegExp,rr=e.String,er=e.TypeError,ur=[],or=nr.prototype,ir=e._,ar=tr("^"+rr(or.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),fr=Yt.ceil,cr=e.clearTimeout,lr=ar.test(lr=nr.defineProperty)&&lr,pr=Yt.floor,sr=Xt.prototype.toString,vr=ar.test(vr=nr.getPrototypeOf)&&vr,hr=or.hasOwnProperty,gr=ar.test(gr=Qt.now)&&gr||function(){return+new Qt
},yr=ur.push,mr=e.setImmediate,_r=e.setTimeout,br=ur.splice,dr=or.toString,wr=ur.unshift,jr=ar.test(jr=dr.bind)&&jr,kr=ar.test(kr=nr.create)&&kr,xr=ar.test(xr=Ht.isArray)&&xr,Cr=e.isFinite,Or=e.isNaN,Er=ar.test(Er=nr.keys)&&Er,Ir=Yt.max,Sr=Yt.min,Ar=e.parseInt,Nr=Yt.random,Rr=ur.slice,Br=ar.test(e.attachEvent),$r=jr&&!/\n|true/.test(jr+Br),Dr={};Dr[z]=Ht,Dr[q]=Jt,Dr[W]=Qt,Dr[P]=Xt,Dr[L]=nr,Dr[K]=Zt,Dr[M]=tr,Dr[U]=rr,nt.prototype=Z.prototype;var Fr=Z.support={};Fr.fastBind=jr&&!$r,Z.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:N,variable:"",imports:{_:Z}};
var Tr=lr?function(n,t){var r=c();r.value=t,lr(n,"__bindData__",r),s(r)}:l,zr=xr||function(n){return n&&typeof n=="object"?dr.call(n)==z:_},qr=Er?function(n){return _t(n)?Er(n):[]}:X,Wr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Pr=yt(Wr),Kr=tr("("+qr(Pr).join("|")+")","g"),Lr=tr("["+qr(Wr).join("")+"]","g"),Mr=at(function(n,t,r){hr.call(n,r)?n[r]++:n[r]=1}),Ur=at(function(n,t,r){(hr.call(n,r)?n[r]:n[r]=[]).push(t)}),Vr=at(function(n,t,r){n[r]=t});$r&&Q&&typeof mr=="function"&&(Mt=function(n){if(!mt(n))throw new er;
return mr.apply(e,arguments)});var Gr=8==Ar(C+"08")?Ar:function(n,t){return Ar(dt(n)?n.replace(R,""):n,t||0)};return Z.after=function(n,t){if(!mt(t))throw new er;return function(){return 1>--n?t.apply(this,arguments):void 0}},Z.assign=J,Z.at=function(n){for(var t=arguments,r=-1,e=et(t,y,_,1),t=t[2]&&t[2][t[1]]===n?1:e.length,u=Ht(t);++r<t;)u[r]=n[e[r]];return u},Z.bind=Kt,Z.bindAll=function(n){for(var t=1<arguments.length?et(arguments,y,_,1):gt(n),r=-1,e=t.length;++r<e;){var u=t[r];n[u]=Kt(n[u],n)
}return n},Z.bindKey=function(n,t){return ft(n,19,Rr.call(arguments,2),m,t)},Z.chain=function(n){return n=new nt(n),n.__chain__=y,n},Z.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},Z.compose=function(){for(var n=arguments,t=n.length||1;t--;)if(!mt(n[t]))throw new er;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];return t[0]}},Z.countBy=Mr,Z.createCallback=function(n,t,r){var e=typeof n;if(n==m||"function"==e)return rt(n,t,r);
if("object"!=e)return function(t){return t[n]};var u=qr(n),o=u[0],i=n[o];return 1!=u.length||i!==i||_t(i)?function(t){for(var r=u.length,e=_;r--&&(e=ut(t[u[r]],n[u[r]],m,y)););return e}:function(n){return n=n[o],i===n&&(0!==i||1/i==1/n)}},Z.curry=function(n,t){return t=typeof t=="number"?t:+t||n.length,ft(n,4,m,m,m,t)},Z.debounce=Lt,Z.defaults=H,Z.defer=Mt,Z.delay=function(n,t){if(!mt(n))throw new er;var r=Rr.call(arguments,2);return _r(function(){n.apply(g,r)},t)},Z.difference=$t,Z.filter=xt,Z.flatten=function(n,t,r,e){return typeof t!="boolean"&&t!=m&&(e=r,r=e&&e[t]===n?g:t,t=_),r!=m&&(n=It(n,r,e)),et(n,t)
},Z.forEach=Ot,Z.forEachRight=Et,Z.forIn=x,Z.forInRight=function(n,t,r){var e=[];x(n,function(n,t){e.push(t,n)});var u=e.length;for(t=rt(t,r,3);u--&&t(e[u--],e[u],n)!==false;);return n},Z.forOwn=d,Z.forOwnRight=ht,Z.functions=gt,Z.groupBy=Ur,Z.indexBy=Vr,Z.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t!="number"&&t!=m){var o=u;for(t=Z.createCallback(t,r,3);o--&&t(n[o],o,n);)e++}else e=t==m||r?1:t||e;return v(n,0,Sr(Ir(0,u-e),u))},Z.intersection=function(n){for(var e=arguments,u=e.length,o=-1,a=f(),c=-1,l=lt(),v=n?n.length:0,h=[],g=f();++o<u;){var y=e[o];
a[o]=l===t&&(y?y.length:0)>=k&&i(o?e[o]:g)}n:for(;++c<v;){var m=a[0],y=n[c];if(0>(m?r(m,y):l(g,y))){for(o=u,(m||g).push(y);--o;)if(m=a[o],0>(m?r(m,y):l(e[o],y)))continue n;h.push(y)}}for(;u--;)(m=a[u])&&s(m);return p(a),p(g),h},Z.invert=yt,Z.invoke=function(n,t){var r=Rr.call(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,i=Ht(typeof o=="number"?o:0);return Ot(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},Z.keys=qr,Z.map=It,Z.max=St,Z.memoize=function(n,t){function r(){var e=r.cache,u=j+(t?t.apply(this,arguments):arguments[0]);
return hr.call(e,u)?e[u]:e[u]=n.apply(this,arguments)}if(!mt(n))throw new er;return r.cache={},r},Z.merge=function(n){var t=arguments,r=2;if(!_t(n))return n;if("number"!=typeof t[2]&&(r=t.length),3<r&&"function"==typeof t[r-2])var e=rt(t[--r-1],t[r--],2);else 2<r&&"function"==typeof t[r-1]&&(e=t[--r]);for(var t=Rr.call(arguments,1,r),u=-1,o=f(),i=f();++u<r;)ot(n,t[u],e,o,i);return p(o),p(i),n},Z.min=function(n,t,r){var e=1/0,o=e;if(!t&&zr(n)){r=-1;for(var i=n.length;++r<i;){var a=n[r];a<o&&(o=a)}}else t=!t&&dt(n)?u:Z.createCallback(t,r,3),Ot(n,function(n,r,u){r=t(n,r,u),r<e&&(e=r,o=n)
});return o},Z.omit=function(n,t,r){var e=lt(),u=typeof t=="function",o={};if(u)t=Z.createCallback(t,r,3);else var i=et(arguments,y,_,1);return x(n,function(n,r,a){(u?!t(n,r,a):0>e(i,r))&&(o[r]=n)}),o},Z.once=function(n){var t,r;if(!mt(n))throw new er;return function(){return t?r:(t=y,r=n.apply(this,arguments),n=m,r)}},Z.pairs=function(n){for(var t=-1,r=qr(n),e=r.length,u=Ht(e);++t<e;){var o=r[t];u[t]=[o,n[o]]}return u},Z.partial=function(n){return ft(n,16,Rr.call(arguments,1))},Z.partialRight=function(n){return ft(n,32,m,Rr.call(arguments,1))
},Z.pick=function(n,t,r){var e={};if(typeof t!="function")for(var u=-1,o=et(arguments,y,_,1),i=_t(n)?o.length:0;++u<i;){var a=o[u];a in n&&(e[a]=n[a])}else t=Z.createCallback(t,r,3),x(n,function(n,r,u){t(n,r,u)&&(e[r]=n)});return e},Z.pluck=At,Z.pull=function(n){for(var t=arguments,r=0,e=t.length,u=n?n.length:0;++r<e;)for(var o=-1,i=t[r];++o<u;)n[o]===i&&(br.call(n,o--,1),u--);return n},Z.range=function(n,t,r){n=+n||0,r=typeof r=="number"?r:+r||1,t==m&&(t=n,n=0);var e=-1;t=Ir(0,fr((t-n)/(r||1)));
for(var u=Ht(t);++e<t;)u[e]=n,n+=r;return u},Z.reject=function(n,t,r){return t=Z.createCallback(t,r,3),xt(n,function(n,r,e){return!t(n,r,e)})},Z.remove=function(n,t,r){var e=-1,u=n?n.length:0,o=[];for(t=Z.createCallback(t,r,3);++e<u;)r=n[e],t(r,e,n)&&(o.push(r),br.call(n,e--,1),u--);return o},Z.rest=Tt,Z.shuffle=function(n){var t=-1,r=n?n.length:0,e=Ht(typeof r=="number"?r:0);return Ot(n,function(n){var r=pr(Nr()*(++t+1));e[t]=e[r],e[r]=n}),e},Z.sortBy=function(n,t,r){var e=-1,u=n?n.length:0,i=Ht(typeof u=="number"?u:0);
for(t=Z.createCallback(t,r,3),Ot(n,function(n,r,u){var o=i[++e]=c();o.l=t(n,r,u),o.m=e,o.n=n}),u=i.length,i.sort(o);u--;)n=i[u],i[u]=n.n,s(n);return i},Z.tap=function(n,t){return t(n),n},Z.throttle=function(n,t,r){var e=y,u=y;if(!mt(n))throw new er;return r===false?e=_:_t(r)&&(e="leading"in r?r.leading:e,u="trailing"in r?r.trailing:u),r=c(),r.leading=e,r.maxWait=t,r.trailing=u,n=Lt(n,t,r),s(r),n},Z.times=function(n,t,r){n=-1<(n=+n)?n:0;var e=-1,u=Ht(n);for(t=rt(t,r,1);++e<n;)u[e]=t(e);return u},Z.toArray=function(n){return n&&typeof n.length=="number"?v(n):wt(n)
},Z.transform=function(n,t,r,e){var u=zr(n);return t=rt(t,e,4),r==m&&(u?r=[]:(e=n&&n.constructor,r=_t(e&&e.prototype)?kr(e&&e.prototype):{})),(u?Ot:d)(n,function(n,e,u){return t(r,n,e,u)}),r},Z.union=function(){return it(et(arguments,y,y))},Z.uniq=qt,Z.values=wt,Z.where=xt,Z.without=function(n){return $t(n,Rr.call(arguments,1))},Z.wrap=function(n,t){if(!mt(t))throw new er;return function(){var r=[n];return yr.apply(r,arguments),t.apply(this,r)}},Z.zip=Wt,Z.zipObject=Pt,Z.collect=It,Z.drop=Tt,Z.each=Ot,Z.a=Et,Z.extend=J,Z.methods=gt,Z.object=Pt,Z.select=xt,Z.tail=Tt,Z.unique=qt,Z.unzip=Wt,Vt(Z),Z.clone=function(n,t,r,e){return typeof t!="boolean"&&t!=m&&(e=r,r=t,t=_),tt(n,t,typeof r=="function"&&rt(r,e,1))
},Z.cloneDeep=function(n,t,r){return tt(n,y,typeof t=="function"&&rt(t,r,1))},Z.contains=jt,Z.escape=function(n){return n==m?"":rr(n).replace(Lr,ct)},Z.every=kt,Z.find=Ct,Z.findIndex=function(n,t,r){var e=-1,u=n?n.length:0;for(t=Z.createCallback(t,r,3);++e<u;)if(t(n[e],e,n))return e;return-1},Z.findKey=function(n,t,r){var e;return t=Z.createCallback(t,r,3),d(n,function(n,r,u){return t(n,r,u)?(e=r,_):void 0}),e},Z.findLast=function(n,t,r){var e;return t=Z.createCallback(t,r,3),Et(n,function(n,r,u){return t(n,r,u)?(e=n,_):void 0
}),e},Z.findLastIndex=function(n,t,r){var e=n?n.length:0;for(t=Z.createCallback(t,r,3);e--;)if(t(n[e],e,n))return e;return-1},Z.findLastKey=function(n,t,r){var e;return t=Z.createCallback(t,r,3),ht(n,function(n,r,u){return t(n,r,u)?(e=r,_):void 0}),e},Z.has=function(n,t){return n?hr.call(n,t):_},Z.identity=Ut,Z.indexOf=Ft,Z.isArguments=vt,Z.isArray=zr,Z.isBoolean=function(n){return n===y||n===false||dr.call(n)==q},Z.isDate=function(n){return n?typeof n=="object"&&dr.call(n)==W:_},Z.isElement=function(n){return n?1===n.nodeType:_
},Z.isEmpty=function(n){var t=y;if(!n)return t;var r=dr.call(n),e=n.length;return r==z||r==U||r==T||r==L&&typeof e=="number"&&mt(n.splice)?!e:(d(n,function(){return t=_}),t)},Z.isEqual=function(n,t,r,e){return ut(n,t,typeof r=="function"&&rt(r,e,2))},Z.isFinite=function(n){return Cr(n)&&!Or(parseFloat(n))},Z.isFunction=mt,Z.isNaN=function(n){return bt(n)&&n!=+n},Z.isNull=function(n){return n===m},Z.isNumber=bt,Z.isObject=_t,Z.isPlainObject=b,Z.isRegExp=function(n){return n?typeof n=="object"&&dr.call(n)==M:_
},Z.isString=dt,Z.isUndefined=function(n){return typeof n=="undefined"},Z.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?Ir(0,e+r):Sr(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},Z.mixin=Vt,Z.noConflict=function(){return e._=ir,this},Z.parseInt=Gr,Z.random=function(n,t){n==m&&t==m&&(t=1),n=+n||0,t==m?(t=n,n=0):t=+t||0;var r=Nr();return n%1||t%1?n+Sr(r*(t-n+parseFloat("1e-"+((r+"").length-1))),t):n+pr(r*(t-n+1))},Z.reduce=Nt,Z.reduceRight=Rt,Z.result=function(n,t){var r=n?n[t]:g;
return mt(r)?n[t]():r},Z.runInContext=h,Z.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:qr(n).length},Z.some=Bt,Z.sortedIndex=zt,Z.template=function(n,t,r){var e=Z.templateSettings;n||(n=""),r=H({},r,e);var u,o=H({},r.imports,e.imports),e=qr(o),o=wt(o),i=0,f=r.interpolate||B,c="__p+='",f=tr((r.escape||B).source+"|"+f.source+"|"+(f===N?S:B).source+"|"+(r.evaluate||B).source+"|$","g");n.replace(f,function(t,r,e,o,f,l){return e||(e=o),c+=n.slice(i,l).replace(D,a),r&&(c+="'+__e("+r+")+'"),f&&(u=y,c+="';"+f+";__p+='"),e&&(c+="'+((__t=("+e+"))==null?'':__t)+'"),i=l+t.length,t
}),c+="';\n",f=r=r.variable,f||(r="obj",c="with("+r+"){"+c+"}"),c=(u?c.replace(O,""):c).replace(E,"$1").replace(I,"$1;"),c="function("+r+"){"+(f?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+c+"return __p}";try{var l=Xt(e,"return "+c).apply(g,o)}catch(p){throw p.source=c,p}return t?l(t):(l.source=c,l)},Z.unescape=function(n){return n==m?"":rr(n).replace(Kr,st)},Z.uniqueId=function(n){var t=++w;return rr(n==m?"":n)+t
},Z.all=kt,Z.any=Bt,Z.detect=Ct,Z.findWhere=Ct,Z.foldl=Nt,Z.foldr=Rt,Z.include=jt,Z.inject=Nt,d(Z,function(n,t){Z.prototype[t]||(Z.prototype[t]=function(){var t=[this.__wrapped__],r=this.__chain__;return yr.apply(t,arguments),t=n.apply(Z,t),r?new nt(t,r):t})}),Z.first=Dt,Z.last=function(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=m){var o=u;for(t=Z.createCallback(t,r,3);o--&&t(n[o],o,n);)e++}else if(e=t,e==m||r)return n[u-1];return v(n,Ir(0,u-e))}},Z.take=Dt,Z.head=Dt,d(Z,function(n,t){Z.prototype[t]||(Z.prototype[t]=function(t,r){var e=this.__chain__,u=n(this.__wrapped__,t,r);
return!e&&(t==m||r&&typeof t!="function")?u:new nt(u,e)})}),Z.VERSION="1.3.1",Z.prototype.chain=function(){return this.__chain__=y,this},Z.prototype.toString=function(){return rr(this.__wrapped__)},Z.prototype.value=Gt,Z.prototype.valueOf=Gt,Ot(["join","pop","shift"],function(n){var t=ur[n];Z.prototype[n]=function(){var n=this.__chain__,r=t.apply(this.__wrapped__,arguments);return n?new nt(r,n):r}}),Ot(["push","reverse","sort","unshift"],function(n){var t=ur[n];Z.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this
}}),Ot(["concat","slice","splice"],function(n){var t=ur[n];Z.prototype[n]=function(){return new nt(t.apply(this.__wrapped__,arguments),this.__chain__)}}),Z}var g,y=!0,m=null,_=!1,b=[],d=[],w=0,j=+new Date+"",k=75,x=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",O=/\b__p\+='';/g,E=/\b(__p\+=)''\+/g,I=/(__e\(.*?\)|\b__t\))\+'';/g,S=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,A=/\w*$/,N=/<%=([\s\S]+?)%>/g,R=RegExp("^["+C+"]*0+(?=.$)"),B=/($^)/,$=($=/\bthis\b/)&&$.test(h)&&$,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(" "),T="[object Arguments]",z="[object Array]",q="[object Boolean]",W="[object Date]",P="[object Function]",K="[object Number]",L="[object Object]",M="[object RegExp]",U="[object String]",V={};
return n}function Et(n,t,r){var e=n?n.length:0;if(typeof e!="number")var u=Kr(n),e=u.length;return t=rt(t,r,3),Ot(n,function(r,o,a){return o=u?u[--e]:--e,t(n[o],o,a)}),n}function It(n,t,r){var e=-1,u=n?n.length:0;if(t=Z.createCallback(t,r,3),typeof u=="number")for(var o=Xt(u);++e<u;)o[e]=t(n[e],e,n);else o=[],d(n,function(n,r,u){o[++e]=t(n,r,u)});return o}function St(n,t,r){var e=-1/0,o=e;if(!t&&Pr(n)){r=-1;for(var a=n.length;++r<a;){var i=n[r];i>o&&(o=i)}}else t=!t&&dt(n)?u:Z.createCallback(t,r,3),Ot(n,function(n,r,u){r=t(n,r,u),r>e&&(e=r,o=n)
});return o}function At(n,t){var r=-1,e=n?n.length:0;if(typeof e=="number")for(var u=Xt(e);++r<e;)u[r]=n[r][t];return u||It(n,t)}function Nt(n,t,r,e){if(!n)return r;var u=3>arguments.length;t=rt(t,e,4);var o=-1,a=n.length;if(typeof a=="number")for(u&&(r=n[++o]);++o<a;)r=t(r,n[o],o,n);else d(n,function(n,e,o){r=u?(u=_,n):t(r,n,e,o)});return r}function Rt(n,t,r,e){var u=3>arguments.length;return t=rt(t,e,4),Et(n,function(n,e,o){r=u?(u=_,n):t(r,n,e,o)}),r}function Bt(n){var t=-1,r=n?n.length:0,e=Xt(typeof r=="number"?r:0);
return Ot(n,function(n){var r=Jt(++t);e[t]=e[r],e[r]=n}),e}function $t(n,t,r){var e;t=Z.createCallback(t,r,3),r=-1;var u=n?n.length:0;if(typeof u=="number")for(;++r<u&&!(e=t(n[r],r,n)););else d(n,function(n,r,u){return!(e=t(n,r,u))});return!!e}function Dt(n){return n&&typeof n.length=="number"?v(n):wt(n)}function Ft(n){var e=-1,u=lt(),o=n?n.length:0,i=et(arguments,y,y,1),f=[],c=o>=k&&u===t;if(c){var l=a(i);l?(u=r,i=l):c=_}for(;++e<o;)l=n[e],0>u(i,l)&&f.push(l);return c&&s(i),f}function Tt(n,t,r){if(n){var e=0,u=n.length;
if(typeof t!="number"&&t!=m){var o=-1;for(t=Z.createCallback(t,r,3);++o<u&&t(n[o],o,n);)e++}else if(e=t,e==m||r)return n[0];return v(n,0,Rr(Nr(0,e),u))}}function zt(n,r,e){if(typeof e=="number"){var u=n?n.length:0;e=0>e?Nr(0,u+e):e||0}else if(e)return e=Wt(n,r),n[e]===r?e:-1;return n?t(n,r,e):-1}function qt(n,t,r){if(typeof t!="number"&&t!=m){var e=0,u=-1,o=n?n.length:0;for(t=Z.createCallback(t,r,3);++u<o&&t(n[u],u,n);)e++}else e=t==m||r?1:Nr(0,t);return v(n,e)}function Wt(n,t,r,e){var u=0,o=n?n.length:u;
for(r=r?Z.createCallback(r,e,1):Gt,t=r(t);u<o;)e=u+o>>>1,r(n[e])<t?u=e+1:o=e;return u}function Pt(n,t,r,e){return typeof t!="boolean"&&t!=m&&(e=r,r=e&&e[t]===n?g:t,t=_),r!=m&&(r=Z.createCallback(r,e,3)),at(n,t,r)}function Kt(){for(var n=1<arguments.length?arguments:arguments[0],t=-1,r=n?St(At(n,"length")):0,e=Xt(0>r?0:r);++t<r;)e[t]=At(n,t);return e}function Lt(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var o=n[r];t?u[o]=t[r]:o&&(u[o[0]]=o[1])}return u}function Mt(n,t){return ft(n,17,Dr.call(arguments,2),m,t)
}function Ut(n,t,r){function e(){o(),(h||p!==t)&&(l=_r(),i=n.apply(f,a))}function u(){var t=h&&(!g||1<c);o(),t&&(l=_r(),i=n.apply(f,a))}function o(){sr(s),sr(v),c=0,s=v=m}var a,i,f,c=0,l=0,p=_,s=m,v=m,h=y;if(!mt(n))throw new ar;if(t=Nr(0,t||0),r===y)var g=y,h=_;else _t(r)&&(g=r.leading,p="maxWait"in r&&Nr(t,r.maxWait||0),h="trailing"in r?r.trailing:h);return function(){if(a=arguments,f=this,c++,sr(v),p===false)g&&2>c&&(i=n.apply(f,a));else{var r=_r();!s&&!g&&(l=r);var o=p-(r-l);0<o?s||(s=wr(e,o)):(sr(s),s=m,l=r,i=n.apply(f,a))
}return t!==p&&(v=wr(u,t)),i}}function Vt(n){if(!mt(n))throw new ar;var t=Dr.call(arguments,1);return wr(function(){n.apply(g,t)},1)}function Gt(n){return n}function Ht(n,t){var r=n,e=!t||mt(r);t||(r=nt,t=n,n=Z),Ot(gt(t),function(u){var o=n[u]=t[u];e&&(r.prototype[u]=function(){var t=this.__wrapped__,e=[t];return br.apply(e,arguments),e=o.apply(n,e),t&&typeof t=="object"&&t===e?this:new r(e)})})}function Jt(n,t){n==m&&t==m&&(t=1),n=+n||0,t==m?(t=n,n=0):t=+t||0;var r=$r();return n%1||t%1?n+Rr(r*(t-n+parseFloat("1e-"+((r+"").length-1))),t):n+hr(r*(t-n+1))
}function Qt(){return this.__wrapped__}e=e?Y.defaults(n.Object(),e,Y.pick(n,F)):n;var Xt=e.Array,Yt=e.Boolean,Zt=e.Date,nr=e.Function,tr=e.Math,rr=e.Number,er=e.Object,ur=e.RegExp,or=e.String,ar=e.TypeError,ir=[],fr=er.prototype,cr=e._,lr=ur("^"+or(fr.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),pr=tr.ceil,sr=e.clearTimeout,vr=lr.test(vr=er.defineProperty)&&vr,hr=tr.floor,gr=nr.prototype.toString,yr=lr.test(yr=er.getPrototypeOf)&&yr,mr=fr.hasOwnProperty,_r=lr.test(_r=Zt.now)&&_r||function(){return+new Zt
},br=ir.push,dr=e.setImmediate,wr=e.setTimeout,jr=ir.splice,kr=fr.toString,xr=ir.unshift,Cr=lr.test(Cr=kr.bind)&&Cr,Or=lr.test(Or=er.create)&&Or,Er=lr.test(Er=Xt.isArray)&&Er,Ir=e.isFinite,Sr=e.isNaN,Ar=lr.test(Ar=er.keys)&&Ar,Nr=tr.max,Rr=tr.min,Br=e.parseInt,$r=tr.random,Dr=ir.slice,Fr=lr.test(e.attachEvent),Tr=Cr&&!/\n|true/.test(Cr+Fr),zr={};zr[z]=Xt,zr[q]=Yt,zr[W]=Zt,zr[P]=nr,zr[L]=er,zr[K]=rr,zr[M]=ur,zr[U]=or,nt.prototype=Z.prototype;var qr=Z.support={};qr.fastBind=Cr&&!Tr,Z.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:N,variable:"",imports:{_:Z}};
var Wr=vr?function(n,t){var r=c();r.value=t,vr(n,"__bindData__",r),s(r)}:l,Pr=Er||function(n){return n&&typeof n=="object"?kr.call(n)==z:_},Kr=Ar?function(n){return _t(n)?Ar(n):[]}:X,Lr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Mr=yt(Lr),Ur=ur("("+Kr(Mr).join("|")+")","g"),Vr=ur("["+Kr(Lr).join("")+"]","g"),Gr=it(function(n,t,r){mr.call(n,r)?n[r]++:n[r]=1}),Hr=it(function(n,t,r){(mr.call(n,r)?n[r]:n[r]=[]).push(t)}),Jr=it(function(n,t,r){n[r]=t});Tr&&Q&&typeof dr=="function"&&(Vt=function(n){if(!mt(n))throw new ar;
return dr.apply(e,arguments)});var Qr=8==Br(C+"08")?Br:function(n,t){return Br(dt(n)?n.replace(R,""):n,t||0)};return Z.after=function(n,t){if(!mt(t))throw new ar;return function(){return 1>--n?t.apply(this,arguments):void 0}},Z.assign=J,Z.at=function(n){for(var t=arguments,r=-1,e=et(t,y,_,1),t=t[2]&&t[2][t[1]]===n?1:e.length,u=Xt(t);++r<t;)u[r]=n[e[r]];return u},Z.bind=Mt,Z.bindAll=function(n){for(var t=1<arguments.length?et(arguments,y,_,1):gt(n),r=-1,e=t.length;++r<e;){var u=t[r];n[u]=Mt(n[u],n)
}return n},Z.bindKey=function(n,t){return ft(n,19,Dr.call(arguments,2),m,t)},Z.chain=function(n){return n=new nt(n),n.__chain__=y,n},Z.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},Z.compose=function(){for(var n=arguments,t=n.length||1;t--;)if(!mt(n[t]))throw new ar;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];return t[0]}},Z.countBy=Gr,Z.createCallback=function(n,t,r){var e=typeof n;if(n==m||"function"==e)return rt(n,t,r);
if("object"!=e)return function(t){return t[n]};var u=Kr(n),o=u[0],a=n[o];return 1!=u.length||a!==a||_t(a)?function(t){for(var r=u.length,e=_;r--&&(e=ut(t[u[r]],n[u[r]],m,y)););return e}:function(n){return n=n[o],a===n&&(0!==a||1/a==1/n)}},Z.curry=function(n,t){return t=typeof t=="number"?t:+t||n.length,ft(n,4,m,m,m,t)},Z.debounce=Ut,Z.defaults=H,Z.defer=Vt,Z.delay=function(n,t){if(!mt(n))throw new ar;var r=Dr.call(arguments,2);return wr(function(){n.apply(g,r)},t)},Z.difference=Ft,Z.filter=xt,Z.flatten=function(n,t,r,e){return typeof t!="boolean"&&t!=m&&(e=r,r=e&&e[t]===n?g:t,t=_),r!=m&&(n=It(n,r,e)),et(n,t)
},Z.forEach=Ot,Z.forEachRight=Et,Z.forIn=x,Z.forInRight=function(n,t,r){var e=[];x(n,function(n,t){e.push(t,n)});var u=e.length;for(t=rt(t,r,3);u--&&t(e[u--],e[u],n)!==false;);return n},Z.forOwn=d,Z.forOwnRight=ht,Z.functions=gt,Z.groupBy=Hr,Z.indexBy=Jr,Z.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t!="number"&&t!=m){var o=u;for(t=Z.createCallback(t,r,3);o--&&t(n[o],o,n);)e++}else e=t==m||r?1:t||e;return v(n,0,Rr(Nr(0,u-e),u))},Z.intersection=function(n){for(var e=arguments,u=e.length,o=-1,i=f(),c=-1,l=lt(),v=n?n.length:0,h=[],g=f();++o<u;){var y=e[o];
i[o]=l===t&&(y?y.length:0)>=k&&a(o?e[o]:g)}n:for(;++c<v;){var m=i[0],y=n[c];if(0>(m?r(m,y):l(g,y))){for(o=u,(m||g).push(y);--o;)if(m=i[o],0>(m?r(m,y):l(e[o],y)))continue n;h.push(y)}}for(;u--;)(m=i[u])&&s(m);return p(i),p(g),h},Z.invert=yt,Z.invoke=function(n,t){var r=Dr.call(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,a=Xt(typeof o=="number"?o:0);return Ot(n,function(n){a[++e]=(u?t:n[t]).apply(n,r)}),a},Z.keys=Kr,Z.map=It,Z.max=St,Z.memoize=function(n,t){function r(){var e=r.cache,u=j+(t?t.apply(this,arguments):arguments[0]);
return mr.call(e,u)?e[u]:e[u]=n.apply(this,arguments)}if(!mt(n))throw new ar;return r.cache={},r},Z.merge=function(n){var t=arguments,r=2;if(!_t(n))return n;if("number"!=typeof t[2]&&(r=t.length),3<r&&"function"==typeof t[r-2])var e=rt(t[--r-1],t[r--],2);else 2<r&&"function"==typeof t[r-1]&&(e=t[--r]);for(var t=Dr.call(arguments,1,r),u=-1,o=f(),a=f();++u<r;)ot(n,t[u],e,o,a);return p(o),p(a),n},Z.min=function(n,t,r){var e=1/0,o=e;if(!t&&Pr(n)){r=-1;for(var a=n.length;++r<a;){var i=n[r];i<o&&(o=i)}}else t=!t&&dt(n)?u:Z.createCallback(t,r,3),Ot(n,function(n,r,u){r=t(n,r,u),r<e&&(e=r,o=n)
});return o},Z.omit=function(n,t,r){var e=lt(),u=typeof t=="function",o={};if(u)t=Z.createCallback(t,r,3);else var a=et(arguments,y,_,1);return x(n,function(n,r,i){(u?!t(n,r,i):0>e(a,r))&&(o[r]=n)}),o},Z.once=function(n){var t,r;if(!mt(n))throw new ar;return function(){return t?r:(t=y,r=n.apply(this,arguments),n=m,r)}},Z.pairs=function(n){for(var t=-1,r=Kr(n),e=r.length,u=Xt(e);++t<e;){var o=r[t];u[t]=[o,n[o]]}return u},Z.partial=function(n){return ft(n,16,Dr.call(arguments,1))},Z.partialRight=function(n){return ft(n,32,m,Dr.call(arguments,1))
},Z.pick=function(n,t,r){var e={};if(typeof t!="function")for(var u=-1,o=et(arguments,y,_,1),a=_t(n)?o.length:0;++u<a;){var i=o[u];i in n&&(e[i]=n[i])}else t=Z.createCallback(t,r,3),x(n,function(n,r,u){t(n,r,u)&&(e[r]=n)});return e},Z.pluck=At,Z.pull=function(n){for(var t=arguments,r=0,e=t.length,u=n?n.length:0;++r<e;)for(var o=-1,a=t[r];++o<u;)n[o]===a&&(jr.call(n,o--,1),u--);return n},Z.range=function(n,t,r){n=+n||0,r=typeof r=="number"?r:+r||1,t==m&&(t=n,n=0);var e=-1;t=Nr(0,pr((t-n)/(r||1)));
for(var u=Xt(t);++e<t;)u[e]=n,n+=r;return u},Z.reject=function(n,t,r){return t=Z.createCallback(t,r,3),xt(n,function(n,r,e){return!t(n,r,e)})},Z.remove=function(n,t,r){var e=-1,u=n?n.length:0,o=[];for(t=Z.createCallback(t,r,3);++e<u;)r=n[e],t(r,e,n)&&(o.push(r),jr.call(n,e--,1),u--);return o},Z.rest=qt,Z.shuffle=Bt,Z.sortBy=function(n,t,r){var e=-1,u=n?n.length:0,a=Xt(typeof u=="number"?u:0);for(t=Z.createCallback(t,r,3),Ot(n,function(n,r,u){var o=a[++e]=c();o.l=t(n,r,u),o.m=e,o.n=n}),u=a.length,a.sort(o);u--;)n=a[u],a[u]=n.n,s(n);
return a},Z.tap=function(n,t){return t(n),n},Z.throttle=function(n,t,r){var e=y,u=y;if(!mt(n))throw new ar;return r===false?e=_:_t(r)&&(e="leading"in r?r.leading:e,u="trailing"in r?r.trailing:u),r=c(),r.leading=e,r.maxWait=t,r.trailing=u,n=Ut(n,t,r),s(r),n},Z.times=function(n,t,r){n=-1<(n=+n)?n:0;var e=-1,u=Xt(n);for(t=rt(t,r,1);++e<n;)u[e]=t(e);return u},Z.toArray=Dt,Z.transform=function(n,t,r,e){var u=Pr(n);return t=rt(t,e,4),r==m&&(u?r=[]:(e=n&&n.constructor,r=_t(e&&e.prototype)?Or(e&&e.prototype):{})),(u?Ot:d)(n,function(n,e,u){return t(r,n,e,u)
}),r},Z.union=function(){return at(et(arguments,y,y))},Z.uniq=Pt,Z.values=wt,Z.where=xt,Z.without=function(n){return Ft(n,Dr.call(arguments,1))},Z.wrap=function(n,t){if(!mt(t))throw new ar;return function(){var r=[n];return br.apply(r,arguments),t.apply(this,r)}},Z.zip=Kt,Z.zipObject=Lt,Z.collect=It,Z.drop=qt,Z.each=Ot,Z.a=Et,Z.extend=J,Z.methods=gt,Z.object=Lt,Z.select=xt,Z.tail=qt,Z.unique=Pt,Z.unzip=Kt,Ht(Z),Z.clone=function(n,t,r,e){return typeof t!="boolean"&&t!=m&&(e=r,r=t,t=_),tt(n,t,typeof r=="function"&&rt(r,e,1))
},Z.cloneDeep=function(n,t,r){return tt(n,y,typeof t=="function"&&rt(t,r,1))},Z.contains=jt,Z.escape=function(n){return n==m?"":or(n).replace(Vr,ct)},Z.every=kt,Z.find=Ct,Z.findIndex=function(n,t,r){var e=-1,u=n?n.length:0;for(t=Z.createCallback(t,r,3);++e<u;)if(t(n[e],e,n))return e;return-1},Z.findKey=function(n,t,r){var e;return t=Z.createCallback(t,r,3),d(n,function(n,r,u){return t(n,r,u)?(e=r,_):void 0}),e},Z.findLast=function(n,t,r){var e;return t=Z.createCallback(t,r,3),Et(n,function(n,r,u){return t(n,r,u)?(e=n,_):void 0
}),e},Z.findLastIndex=function(n,t,r){var e=n?n.length:0;for(t=Z.createCallback(t,r,3);e--;)if(t(n[e],e,n))return e;return-1},Z.findLastKey=function(n,t,r){var e;return t=Z.createCallback(t,r,3),ht(n,function(n,r,u){return t(n,r,u)?(e=r,_):void 0}),e},Z.has=function(n,t){return n?mr.call(n,t):_},Z.identity=Gt,Z.indexOf=zt,Z.isArguments=vt,Z.isArray=Pr,Z.isBoolean=function(n){return n===y||n===false||kr.call(n)==q},Z.isDate=function(n){return n?typeof n=="object"&&kr.call(n)==W:_},Z.isElement=function(n){return n?1===n.nodeType:_
},Z.isEmpty=function(n){var t=y;if(!n)return t;var r=kr.call(n),e=n.length;return r==z||r==U||r==T||r==L&&typeof e=="number"&&mt(n.splice)?!e:(d(n,function(){return t=_}),t)},Z.isEqual=function(n,t,r,e){return ut(n,t,typeof r=="function"&&rt(r,e,2))},Z.isFinite=function(n){return Ir(n)&&!Sr(parseFloat(n))},Z.isFunction=mt,Z.isNaN=function(n){return bt(n)&&n!=+n},Z.isNull=function(n){return n===m},Z.isNumber=bt,Z.isObject=_t,Z.isPlainObject=b,Z.isRegExp=function(n){return n?typeof n=="object"&&kr.call(n)==M:_
},Z.isString=dt,Z.isUndefined=function(n){return typeof n=="undefined"},Z.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?Nr(0,e+r):Rr(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},Z.mixin=Ht,Z.noConflict=function(){return e._=cr,this},Z.parseInt=Qr,Z.random=Jt,Z.reduce=Nt,Z.reduceRight=Rt,Z.result=function(n,t){var r=n?n[t]:g;return mt(r)?n[t]():r},Z.runInContext=h,Z.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Kr(n).length},Z.some=$t,Z.sortedIndex=Wt,Z.template=function(n,t,r){var e=Z.templateSettings;
n||(n=""),r=H({},r,e);var u,o=H({},r.imports,e.imports),e=Kr(o),o=wt(o),a=0,f=r.interpolate||B,c="__p+='",f=ur((r.escape||B).source+"|"+f.source+"|"+(f===N?S:B).source+"|"+(r.evaluate||B).source+"|$","g");n.replace(f,function(t,r,e,o,f,l){return e||(e=o),c+=n.slice(a,l).replace(D,i),r&&(c+="'+__e("+r+")+'"),f&&(u=y,c+="';"+f+";__p+='"),e&&(c+="'+((__t=("+e+"))==null?'':__t)+'"),a=l+t.length,t}),c+="';\n",f=r=r.variable,f||(r="obj",c="with("+r+"){"+c+"}"),c=(u?c.replace(O,""):c).replace(E,"$1").replace(I,"$1;"),c="function("+r+"){"+(f?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+c+"return __p}";
try{var l=nr(e,"return "+c).apply(g,o)}catch(p){throw p.source=c,p}return t?l(t):(l.source=c,l)},Z.unescape=function(n){return n==m?"":or(n).replace(Ur,st)},Z.uniqueId=function(n){var t=++w;return or(n==m?"":n)+t},Z.all=kt,Z.any=$t,Z.detect=Ct,Z.findWhere=Ct,Z.foldl=Nt,Z.foldr=Rt,Z.include=jt,Z.inject=Nt,d(Z,function(n,t){Z.prototype[t]||(Z.prototype[t]=function(){var t=[this.__wrapped__],r=this.__chain__;return br.apply(t,arguments),t=n.apply(Z,t),r?new nt(t,r):t})}),Z.first=Tt,Z.last=function(n,t,r){if(n){var e=0,u=n.length;
if(typeof t!="number"&&t!=m){var o=u;for(t=Z.createCallback(t,r,3);o--&&t(n[o],o,n);)e++}else if(e=t,e==m||r)return n[u-1];return v(n,Nr(0,u-e))}},Z.sample=function(n,t,r){Pr(n)||(n=Dt(n));var e=n.length-1;return t==m||r?n[Jt(e)]:(n=Bt(n),n.length=Rr(Nr(0,t),n.length),n)},Z.take=Tt,Z.head=Tt,d(Z,function(n,t){var r="sample"!==t;Z.prototype[t]||(Z.prototype[t]=function(t,e){var u=this.__chain__,o=n(this.__wrapped__,t,e);return u||t!=m&&(!e||r&&typeof t=="function")?new nt(o,u):o})}),Z.VERSION="1.3.1",Z.prototype.chain=function(){return this.__chain__=y,this
},Z.prototype.toString=function(){return or(this.__wrapped__)},Z.prototype.value=Qt,Z.prototype.valueOf=Qt,Ot(["join","pop","shift"],function(n){var t=ir[n];Z.prototype[n]=function(){var n=this.__chain__,r=t.apply(this.__wrapped__,arguments);return n?new nt(r,n):r}}),Ot(["push","reverse","sort","unshift"],function(n){var t=ir[n];Z.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Ot(["concat","slice","splice"],function(n){var t=ir[n];Z.prototype[n]=function(){return new nt(t.apply(this.__wrapped__,arguments),this.__chain__)
}}),Z}var g,y=!0,m=null,_=!1,b=[],d=[],w=0,j=+new Date+"",k=75,x=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",O=/\b__p\+='';/g,E=/\b(__p\+=)''\+/g,I=/(__e\(.*?\)|\b__t\))\+'';/g,S=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,A=/\w*$/,N=/<%=([\s\S]+?)%>/g,R=RegExp("^["+C+"]*0+(?=.$)"),B=/($^)/,$=($=/\bthis\b/)&&$.test(h)&&$,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(" "),T="[object Arguments]",z="[object Array]",q="[object Boolean]",W="[object Date]",P="[object Function]",K="[object Number]",L="[object Object]",M="[object RegExp]",U="[object String]",V={};
V[P]=_,V[T]=V[z]=V[q]=V[W]=V[K]=V[L]=V[M]=V[U]=y;var G={"boolean":_,"function":y,object:y,number:_,string:_,undefined:_},H={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},J=G[typeof exports]&&exports,Q=G[typeof module]&&module&&module.exports==J&&module,X=G[typeof global]&&global;!X||X.global!==X&&X.window!==X||(n=X);var Y=h();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=Y, define(function(){return Y})):J&&!J.nodeType?Q?(Q.exports=Y)._=Y:J._=Y:n._=Y
}(this);

View File

@@ -2401,7 +2401,7 @@
result = Array(typeof length == 'number' ? length : 0);
forEach(collection, function(value) {
var rand = floor(nativeRandom() * (++index + 1));
var rand = random(++index);
result[index] = result[rand];
result[rand] = value;
});
@@ -2669,11 +2669,10 @@
}
/**
* Gets the first element of an array. If a number `n` is provided the first
* `n` elements of the array are returned. If a callback is provided elements
* at the beginning of the array are returned as long as the callback returns
* truthy. The callback is bound to `thisArg` and invoked with three arguments;
* (value, index, array).
* Gets the first element or first `n` elements of an array. If a callback
* is provided elements at the beginning of the array are returned as long
* as the callback returns truthy. The callback is bound to `thisArg` and
* invoked with three arguments; (value, index, array).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
@@ -2827,11 +2826,10 @@
}
/**
* Gets all but the last element of an array. If a number `n` is provided
* the last `n` elements are excluded from the result. If a callback is
* provided elements at the end of the array are excluded from the result
* as long as the callback returns truthy. The callback is bound to `thisArg`
* and invoked with three arguments; (value, index, array).
* Gets all but the last element or last `n` elements of an array. If a
* callback is provided elements at the end of the array are excluded from
* the result as long as the callback returns truthy. The callback is bound
* to `thisArg` and invoked with three arguments; (value, index, array).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
@@ -2940,12 +2938,10 @@
}
/**
* Gets the last element of an array. If a number `n` is provided the last
* `n` elements of the array are returned. If a callback is provided elements
* at the end of the array are returned as long as the callback returns truthy.
* The callback is bound to `thisArg` and invoked with three arguments;
* (value, index, array).
*
* Gets the last element or last `n` elements of an array. If a callback is
* provided elements at the end of the array are returned as long as the
* callback returns truthy. The callback is bound to `thisArg` and invoked
* with three arguments; (value, index, array).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
@@ -3104,12 +3100,11 @@
}
/**
* The opposite of `_.initial` this method gets all but the first value of
* an array. If a number `n` is provided the first `n` values are excluded
* from the result. If a callback function is provided elements at the beginning
* of the array are excluded from the result as long as the callback returns
* truthy. The callback is bound to `thisArg` and invoked with three
* arguments; (value, index, array).
* The opposite of `_.initial` this method gets all but the first element or
* first `n` elements of an array. If a callback function is provided elements
* at the beginning of the array are excluded from the result as long as the
* callback returns truthy. The callback is bound to `thisArg` and invoked
* with three arguments; (value, index, array).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.

View File

@@ -3,35 +3,35 @@
* 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 r(n,r,t){t=(t||0)-1;for(var e=n?n.length:0;++t<e;)if(n[t]===r)return t;return-1}function t(n,r){var t=n.l,e=r.l;if(t!==e){if(t>e||typeof t=="undefined")return 1;if(t<e||typeof e=="undefined")return-1}return n.m-r.m}function e(n){return"\\"+vr[n]}function u(){}function i(n){return n instanceof i?n:new o(n)}function o(n,r){this.__chain__=!!r,this.__wrapped__=n}function a(n,r,t){if(typeof n!="function")return Q;if(typeof r=="undefined")return n;switch(t){case 1:return function(t){return n.call(r,t)
};case 2:return function(t,e){return n.call(r,t,e)};case 3:return function(t,e,u){return n.call(r,t,e,u)};case 4:return function(t,e,u,i){return n.call(r,t,e,u,i)}}return J(n,r)}function f(n,r,t,e){e=(e||0)-1;for(var u=n?n.length:0,i=[];++e<u;){var o=n[e];o&&typeof o=="object"&&(zr(o)||m(o))?Er.apply(i,r?o:f(o,r,t)):t||i.push(o)}return i}function l(n,r,t,e){if(n===r)return 0!==n||1/n==1/r;if(n===n&&(!n||!sr[typeof n])&&(!r||!sr[typeof r]))return!1;if(null==n||null==r)return n===r;var u=Ar.call(n),o=Ar.call(r);
if(u!=o)return!1;switch(u){case or:case ar:return+n==+r;case fr:return n!=+n?r!=+r:0==n?1/n==1/r:n==+r;case cr:case pr:return n==r+""}if(o=u==ir,!o){if(xr.call(n,"__wrapped__")||r instanceof i)return l(n.__wrapped__||n,r.__wrapped__||r,t,e);if(u!=lr)return!1;var u=n.constructor,a=r.constructor;if(u!=a&&(!x(u)||!(u instanceof u&&x(a)&&a instanceof a)))return!1}for(t||(t=[]),e||(e=[]),u=t.length;u--;)if(t[u]==n)return e[u]==r;var f=!0,c=0;if(t.push(n),e.push(r),o){if(c=r.length,f=c==n.length)for(;c--&&(f=l(n[c],r[c],t,e)););return f
}return Jr(r,function(r,u,i){return xr.call(i,u)?(c++,!(f=xr.call(n,u)&&l(n[u],r,t,e))&&nr):void 0}),f&&Jr(n,function(n,r,t){return xr.call(t,r)?!(f=-1<--c)&&nr:void 0}),f}function c(n,r,t){for(var e=-1,u=g(),i=n?n.length:0,o=[],a=t?[]:o;++e<i;){var f=n[e],l=t?t(f,e,n):f;(r?!e||a[a.length-1]!==l:0>u(a,l))&&(t&&a.push(l),o.push(f))}return o}function p(n){return function(r,t,e){var u={};return t=K(t,e,3),B(r,function(r,e,i){e=t(r,e,i)+"",n(u,r,e,i)}),u}}function s(n,r,t,e,u,i){var o=1&r,a=2&r,f=4&r,l=8&r,c=32&r;
if(!a&&!x(n))throw new TypeError;if(!o||a||f||c||!(Wr.fastBind||Or&&t.length))p=function(){var c=arguments,g=o?u:this;return t&&Tr.apply(c,t),e&&Er.apply(c,e),f&&c.length<i?(r|=16,s(n,l?r:-4&r,c,null,u,i)):(a&&(n=g[h]),this instanceof p?(g=v(n.prototype),c=n.apply(g,c),E(c)?c:g):n.apply(g,c))};else{c=[n,u],Er.apply(c,t);var p=Or.call.apply(Or,c)}if(a){var h=u;u=n}return p}function v(n){return E(n)?Sr(n):{}}function h(n){return Ur[n]}function g(){var n=(n=i.indexOf)===U?r:n;return n}function y(n){return Vr[n]
}function m(n){return n&&typeof n=="object"?Ar.call(n)==ur:!1}function _(n){if(!n)return n;for(var r=1,t=arguments.length;r<t;r++){var e=arguments[r];if(e)for(var u in e)n[u]=e[u]}return n}function d(n){if(!n)return n;for(var r=1,t=arguments.length;r<t;r++){var e=arguments[r];if(e)for(var u in e)"undefined"==typeof n[u]&&(n[u]=e[u])}return n}function b(n){var r=[];return Jr(n,function(n,t){x(n)&&r.push(t)}),r.sort()}function w(n){for(var r=-1,t=Pr(n),e=t.length,u={};++r<e;){var i=t[r];u[n[i]]=i}return u
}function j(n){if(!n)return!0;if(zr(n)||T(n))return!n.length;for(var r in n)if(xr.call(n,r))return!1;return!0}function x(n){return typeof n=="function"}function E(n){return!(!n||!sr[typeof n])}function A(n){return typeof n=="number"||Ar.call(n)==fr}function T(n){return typeof n=="string"||Ar.call(n)==pr}function O(n){for(var r=-1,t=Pr(n),e=t.length,u=Array(e);++r<e;)u[r]=n[t[r]];return u}function S(n,r){var t=g(),e=n?n.length:0,u=!1;return e&&typeof e=="number"?u=-1<t(n,r):Kr(n,function(n){return(u=n===r)&&nr
}),u}function F(n,r,t){var e=!0;r=K(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++t<u&&(e=!!r(n[t],t,n)););else Kr(n,function(n,t,u){return!(e=!!r(n,t,u))&&nr});return e}function N(n,r,t){var e=[];r=K(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++t<u;){var i=n[t];r(i,t,n)&&e.push(i)}else Kr(n,function(n,t,u){r(n,t,u)&&e.push(n)});return e}function R(n,r,t){r=K(r,t,3),t=-1;var e=n?n.length:0;if(typeof e!="number"){var u;return Kr(n,function(n,t,e){return r(n,t,e)?(u=n,nr):void 0
}),u}for(;++t<e;){var i=n[t];if(r(i,t,n))return i}}function B(n,r,t){var e=-1,u=n?n.length:0;if(r=r&&typeof t=="undefined"?r:a(r,t,3),typeof u=="number")for(;++e<u&&r(n[e],e,n)!==nr;);else Kr(n,r)}function k(n,r){var t=n?n.length:0;if(typeof t!="number")var e=Pr(n),t=e.length;B(n,function(u,i,o){return i=e?e[--t]:--t,false===r(n[i],i,o)&&nr})}function D(n,r,t){var e=-1,u=n?n.length:0;if(r=K(r,t,3),typeof u=="number")for(var i=Array(u);++e<u;)i[e]=r(n[e],e,n);else i=[],Kr(n,function(n,t,u){i[++e]=r(n,t,u)
});return i}function q(n,r,t){var e=-1/0,u=e,i=-1,o=n?n.length:0;if(r||typeof o!="number")r=K(r,t,3),B(n,function(n,t,i){t=r(n,t,i),t>e&&(e=t,u=n)});else for(;++i<o;)t=n[i],t>u&&(u=t);return u}function M(n,r){var t=-1,e=n?n.length:0;if(typeof e=="number")for(var u=Array(e);++t<e;)u[t]=n[t][r];return u||D(n,r)}function $(n,r,t,e){if(!n)return t;var u=3>arguments.length;r=a(r,e,4);var i=-1,o=n.length;if(typeof o=="number")for(u&&(t=n[++i]);++i<o;)t=r(t,n[i],i,n);else Kr(n,function(n,e,i){t=u?(u=!1,n):r(t,n,e,i)
});return t}function I(n,r,t,e){var u=3>arguments.length;return r=a(r,e,4),k(n,function(n,e,i){t=u?(u=!1,n):r(t,n,e,i)}),t}function W(n,r,t){var e;r=K(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++t<u&&!(e=r(n[t],t,n)););else Kr(n,function(n,t,u){return(e=r(n,t,u))&&nr});return!!e}function z(n,r,t){return t&&j(r)?Y:(t?R:N)(n,r)}function C(n){for(var r=-1,t=g(),e=n.length,u=f(arguments,!0,!0,1),i=[];++r<e;){var o=n[r];0>t(u,o)&&i.push(o)}return i}function P(n,r,t){if(n){var e=0,u=n.length;
if(typeof r!="number"&&null!=r){var i=-1;for(r=K(r,t,3);++i<u&&r(n[i],i,n);)e++}else if(e=r,null==e||t)return n[0];return Mr.call(n,0,Dr(kr(0,e),u))}}function U(n,t,e){if(typeof e=="number"){var u=n?n.length:0;e=0>e?kr(0,u+e):e||0}else if(e)return e=G(n,t),n[e]===t?e:-1;return n?r(n,t,e):-1}function V(n,r,t){if(typeof r!="number"&&null!=r){var e=0,u=-1,i=n?n.length:0;for(r=K(r,t,3);++u<i&&r(n[u],u,n);)e++}else e=null==r||t?1:kr(0,r);return Mr.call(n,e)}function G(n,r,t,e){var u=0,i=n?n.length:u;for(t=t?K(t,e,1):Q,r=t(r);u<i;)e=u+i>>>1,t(n[e])<r?u=e+1:i=e;
return u}function H(n,r,t,e){return typeof r!="boolean"&&null!=r&&(e=t,t=e&&e[r]===n?Y:r,r=!1),null!=t&&(t=K(t,e,3)),c(n,r,t)}function J(n,r){return s(n,17,Mr.call(arguments,2),null,r)}function K(n,r,t){var e=typeof n;if(null==n||"function"==e)return a(n,r,t);if("object"!=e)return function(r){return r[n]};var u=Pr(n);return function(r){for(var t=u.length,e=!1;t--&&(e=r[u[t]]===n[u[t]]););return e}}function L(n,r,t){var e,u,i,o=0,a=0,f=!1,l=null,c=null,p=!0;if(!x(n))throw new TypeError;if(r=kr(0,r||0),true===t)var s=!0,p=!1;
else E(t)&&(s=t.leading,f="maxWait"in t&&kr(r,t.maxWait||0),p="trailing"in t?t.trailing:p);var v=function(){clearTimeout(l),clearTimeout(c),o=0,l=c=null},h=function(){var r=p&&(!s||1<o);v(),r&&(a=+new Date,u=n.apply(i,e))},g=function(){v(),(p||f!==r)&&(a=+new Date,u=n.apply(i,e))};return function(){if(e=arguments,i=this,o++,clearTimeout(c),false===f)s&&2>o&&(u=n.apply(i,e));else{var t=+new Date;!l&&!s&&(a=t);var p=f-(t-a);0<p?l||(l=setTimeout(g,p)):(clearTimeout(l),l=null,a=t,u=n.apply(i,e))}return r!==f&&(c=setTimeout(h,r)),u
}}function Q(n){return n}function X(n){B(b(n),function(r){var t=i[r]=n[r];i.prototype[r]=function(){var n=[this.__wrapped__];return Er.apply(n,arguments),n=t.apply(i,n),this.__chain__&&(n=new o(n),n.__chain__=!0),n}})}var Y,Z=0,nr={},rr=+new Date+"",tr=/($^)/,er=/['\n\r\t\u2028\u2029\\]/g,ur="[object Arguments]",ir="[object Array]",or="[object Boolean]",ar="[object Date]",fr="[object Number]",lr="[object Object]",cr="[object RegExp]",pr="[object String]",sr={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},vr={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},hr=sr[typeof exports]&&exports,gr=sr[typeof module]&&module&&module.exports==hr&&module,yr=sr[typeof global]&&global;
!yr||yr.global!==yr&&yr.window!==yr||(n=yr);var mr=[],_r=Object.prototype,dr=n._,br=RegExp("^"+(_r.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),wr=Math.ceil,jr=Math.floor,xr=_r.hasOwnProperty,Er=mr.push,Ar=_r.toString,Tr=mr.unshift,Or=br.test(Or=Ar.bind)&&Or,Sr=br.test(Sr=Object.create)&&Sr,Fr=br.test(Fr=Array.isArray)&&Fr,Nr=n.isFinite,Rr=n.isNaN,Br=br.test(Br=Object.keys)&&Br,kr=Math.max,Dr=Math.min,qr=Math.random,Mr=mr.slice,$r=br.test(n.attachEvent),Ir=Or&&!/\n|true/.test(Or+$r);
o.prototype=i.prototype;var Wr={};!function(){var n={0:1,length:1};Wr.fastBind=Or&&!Ir,Wr.spliceObjects=(mr.splice.call(n,0,1),!n[0])}(1),i.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},Sr||(v=function(n){if(E(n)){u.prototype=n;var r=new u;u.prototype=null}return r||{}}),m(arguments)||(m=function(n){return n&&typeof n=="object"?xr.call(n,"callee"):!1});var zr=Fr||function(n){return n&&typeof n=="object"?Ar.call(n)==ir:!1},Cr=function(n){var r,t=[];
if(!n||!sr[typeof n])return t;for(r in n)xr.call(n,r)&&t.push(r);return t},Pr=Br?function(n){return E(n)?Br(n):[]}:Cr,Ur={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"},Vr=w(Ur),Gr=RegExp("("+Pr(Vr).join("|")+")","g"),Hr=RegExp("["+Pr(Ur).join("")+"]","g"),Jr=function(n,r){var t;if(!n||!sr[typeof n])return n;for(t in n)if(r(n[t],t,n)===nr)break;return n},Kr=function(n,r){var t;if(!n||!sr[typeof n])return n;for(t in n)if(xr.call(n,t)&&r(n[t],t,n)===nr)break;return n};x(/x/)&&(x=function(n){return typeof n=="function"&&"[object Function]"==Ar.call(n)
});var Lr=p(function(n,r,t){xr.call(n,t)?n[t]++:n[t]=1}),Qr=p(function(n,r,t){(xr.call(n,t)?n[t]:n[t]=[]).push(r)});i.after=function(n,r){if(!x(r))throw new TypeError;return function(){return 1>--n?r.apply(this,arguments):void 0}},i.bind=J,i.bindAll=function(n){for(var r=1<arguments.length?f(arguments,!0,!1,1):b(n),t=-1,e=r.length;++t<e;){var u=r[t];n[u]=J(n[u],n)}return n},i.chain=function(n){return n=new o(n),n.__chain__=!0,n},i.compact=function(n){for(var r=-1,t=n?n.length:0,e=[];++r<t;){var u=n[r];
u&&e.push(u)}return e},i.compose=function(){for(var n=arguments,r=n.length||1;r--;)if(!x(n[r]))throw new TypeError;return function(){for(var r=arguments,t=n.length;t--;)r=[n[t].apply(this,r)];return r[0]}},i.countBy=Lr,i.debounce=L,i.defaults=d,i.defer=function(n){if(!x(n))throw new TypeError;var r=Mr.call(arguments,1);return setTimeout(function(){n.apply(Y,r)},1)},i.delay=function(n,r){if(!x(n))throw new TypeError;var t=Mr.call(arguments,2);return setTimeout(function(){n.apply(Y,t)},r)},i.difference=C,i.filter=N,i.flatten=function(n,r){return f(n,r)
},i.forEach=B,i.functions=b,i.groupBy=Qr,i.initial=function(n,r,t){if(!n)return[];var e=0,u=n.length;if(typeof r!="number"&&null!=r){var i=u;for(r=K(r,t,3);i--&&r(n[i],i,n);)e++}else e=null==r||t?1:r||e;return Mr.call(n,0,Dr(kr(0,u-e),u))},i.intersection=function(n){var r=arguments,t=r.length,e=-1,u=g(),i=n?n.length:0,o=[];n:for(;++e<i;){var a=n[e];if(0>u(o,a)){for(var f=t;--f;)if(0>u(r[f],a))continue n;o.push(a)}}return o},i.invert=w,i.invoke=function(n,r){var t=Mr.call(arguments,2),e=-1,u=typeof r=="function",i=n?n.length:0,o=Array(typeof i=="number"?i:0);
return B(n,function(n){o[++e]=(u?r:n[r]).apply(n,t)}),o},i.keys=Pr,i.map=D,i.max=q,i.memoize=function(n,r){var t={};return function(){var e=rr+(r?r.apply(this,arguments):arguments[0]);return xr.call(t,e)?t[e]:t[e]=n.apply(this,arguments)}},i.min=function(n,r,t){var e=1/0,u=e,i=-1,o=n?n.length:0;if(r||typeof o!="number")r=K(r,t,3),B(n,function(n,t,i){t=r(n,t,i),t<e&&(e=t,u=n)});else for(;++i<o;)t=n[i],t<u&&(u=t);return u},i.omit=function(n){var r=g(),t=f(arguments,!0,!1,1),e={};return Jr(n,function(n,u){0>r(t,u)&&(e[u]=n)
}),e},i.once=function(n){var r,t;if(!x(n))throw new TypeError;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},i.pairs=function(n){for(var r=-1,t=Pr(n),e=t.length,u=Array(e);++r<e;){var i=t[r];u[r]=[i,n[i]]}return u},i.partial=function(n){return s(n,16,Mr.call(arguments,1))},i.pick=function(n){for(var r=-1,t=f(arguments,!0,!1,1),e=t.length,u={};++r<e;){var i=t[r];i in n&&(u[i]=n[i])}return u},i.pluck=M,i.range=function(n,r,t){n=+n||0,t=+t||1,null==r&&(r=n,n=0);var e=-1;r=kr(0,wr((r-n)/t));
for(var u=Array(r);++e<r;)u[e]=n,n+=t;return u},i.reject=function(n,r,t){return r=K(r,t,3),N(n,function(n,t,e){return!r(n,t,e)})},i.rest=V,i.shuffle=function(n){var r=-1,t=n?n.length:0,e=Array(typeof t=="number"?t:0);return B(n,function(n){var t=jr(qr()*(++r+1));e[r]=e[t],e[t]=n}),e},i.sortBy=function(n,r,e){var u=-1,i=n?n.length:0,o=Array(typeof i=="number"?i:0);for(r=K(r,e,3),B(n,function(n,t,e){o[++u]={l:r(n,t,e),m:u,n:n}}),i=o.length,o.sort(t);i--;)o[i]=o[i].n;return o},i.tap=function(n,r){return r(n),n
},i.throttle=function(n,r,t){var e=!0,u=!0;return false===t?e=!1:E(t)&&(e="leading"in t?t.leading:e,u="trailing"in t?t.trailing:u),t={},t.leading=e,t.maxWait=r,t.trailing=u,L(n,r,t)},i.times=function(n,r,t){for(var e=-1,u=Array(-1<n?n:0);++e<n;)u[e]=r.call(t,e);return u},i.toArray=function(n){return zr(n)?Mr.call(n):n&&typeof n.length=="number"?D(n):O(n)},i.union=function(){return c(f(arguments,!0,!0))},i.uniq=H,i.values=O,i.where=z,i.without=function(n){return C(n,Mr.call(arguments,1))},i.wrap=function(n,r){if(!x(r))throw new TypeError;
return function(){var t=[n];return Er.apply(t,arguments),r.apply(this,t)}},i.zip=function(){for(var n=-1,r=q(M(arguments,"length")),t=Array(0>r?0:r);++n<r;)t[n]=M(arguments,n);return t},i.collect=D,i.drop=V,i.each=B,i.extend=_,i.methods=b,i.object=function(n,r){for(var t=-1,e=n?n.length:0,u={};++t<e;){var i=n[t];r?u[i]=r[t]:i&&(u[i[0]]=i[1])}return u},i.select=N,i.tail=V,i.unique=H,i.clone=function(n){return E(n)?zr(n)?Mr.call(n):_({},n):n},i.contains=S,i.escape=function(n){return null==n?"":(n+"").replace(Hr,h)
},i.every=F,i.find=R,i.has=function(n,r){return n?xr.call(n,r):!1},i.identity=Q,i.indexOf=U,i.isArguments=m,i.isArray=zr,i.isBoolean=function(n){return true===n||false===n||Ar.call(n)==or},i.isDate=function(n){return n?typeof n=="object"&&Ar.call(n)==ar:!1},i.isElement=function(n){return n?1===n.nodeType:!1},i.isEmpty=j,i.isEqual=function(n,r){return l(n,r)},i.isFinite=function(n){return Nr(n)&&!Rr(parseFloat(n))},i.isFunction=x,i.isNaN=function(n){return A(n)&&n!=+n},i.isNull=function(n){return null===n
},i.isNumber=A,i.isObject=E,i.isRegExp=function(n){return n&&sr[typeof n]?Ar.call(n)==cr:!1},i.isString=T,i.isUndefined=function(n){return typeof n=="undefined"},i.lastIndexOf=function(n,r,t){var e=n?n.length:0;for(typeof t=="number"&&(e=(0>t?kr(0,e+t):Dr(t,e-1))+1);e--;)if(n[e]===r)return e;return-1},i.mixin=X,i.noConflict=function(){return n._=dr,this},i.random=function(n,r){null==n&&null==r&&(r=1),n=+n||0,null==r?(r=n,n=0):r=+r||0;var t=qr();return n%1||r%1?n+Dr(t*(r-n+parseFloat("1e-"+((t+"").length-1))),r):n+jr(t*(r-n+1))
},i.reduce=$,i.reduceRight=I,i.result=function(n,r){var t=n?n[r]:Y;return x(t)?n[r]():t},i.size=function(n){var r=n?n.length:0;return typeof r=="number"?r:Pr(n).length},i.some=W,i.sortedIndex=G,i.template=function(n,r,t){var u=i,o=u.templateSettings;n||(n=""),t=d({},t,o);var a=0,f="__p+='",o=t.variable;n.replace(RegExp((t.escape||tr).source+"|"+(t.interpolate||tr).source+"|"+(t.evaluate||tr).source+"|$","g"),function(r,t,u,i,o){return f+=n.slice(a,o).replace(er,e),t&&(f+="'+_.escape("+t+")+'"),i&&(f+="';"+i+";__p+='"),u&&(f+="'+((__t=("+u+"))==null?'':__t)+'"),a=o+r.length,r
}),f+="';\n",o||(o="obj",f="with("+o+"||{}){"+f+"}"),f="function("+o+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+f+"return __p}";try{var l=Function("_","return "+f)(u)}catch(c){throw c.source=f,c}return r?l(r):(l.source=f,l)},i.unescape=function(n){return null==n?"":(n+"").replace(Gr,y)},i.uniqueId=function(n){var r=++Z+"";return n?n+r:r},i.all=F,i.any=W,i.detect=R,i.findWhere=function(n,r){return z(n,r,!0)},i.foldl=$,i.foldr=I,i.include=S,i.inject=$,i.first=P,i.last=function(n,r,t){if(n){var e=0,u=n.length;
if(typeof r!="number"&&null!=r){var i=u;for(r=K(r,t,3);i--&&r(n[i],i,n);)e++}else if(e=r,null==e||t)return n[u-1];return Mr.call(n,kr(0,u-e))}},i.take=P,i.head=P,X(i),i.VERSION="1.3.1",i.prototype.chain=function(){return this.__chain__=!0,this},i.prototype.value=function(){return this.__wrapped__},B("pop push reverse shift sort splice unshift".split(" "),function(n){var r=mr[n];i.prototype[n]=function(){var n=this.__wrapped__;return r.apply(n,arguments),!Wr.spliceObjects&&0===n.length&&delete n[0],this
}}),B(["concat","join","slice"],function(n){var r=mr[n];i.prototype[n]=function(){var n=r.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new o(n),n.__chain__=!0),n}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=i, define(function(){return i})):hr&&!hr.nodeType?gr?(gr.exports=i)._=i:hr._=i:n._=i}(this);
;!function(n){function r(n,r,t){t=(t||0)-1;for(var e=n?n.length:0;++t<e;)if(n[t]===r)return t;return-1}function t(n,r){var t=n.l,e=r.l;if(t!==e){if(t>e||typeof t=="undefined")return 1;if(t<e||typeof e=="undefined")return-1}return n.m-r.m}function e(n){return"\\"+hr[n]}function u(){}function i(n){return n instanceof i?n:new o(n)}function o(n,r){this.__chain__=!!r,this.__wrapped__=n}function a(n,r,t){if(typeof n!="function")return Q;if(typeof r=="undefined")return n;switch(t){case 1:return function(t){return n.call(r,t)
};case 2:return function(t,e){return n.call(r,t,e)};case 3:return function(t,e,u){return n.call(r,t,e,u)};case 4:return function(t,e,u,i){return n.call(r,t,e,u,i)}}return J(n,r)}function f(n,r,t,e){e=(e||0)-1;for(var u=n?n.length:0,i=[];++e<u;){var o=n[e];o&&typeof o=="object"&&(Cr(o)||m(o))?Ar.apply(i,r?o:f(o,r,t)):t||i.push(o)}return i}function l(n,r,t,e){if(n===r)return 0!==n||1/n==1/r;if(n===n&&(!n||!vr[typeof n])&&(!r||!vr[typeof r]))return!1;if(null==n||null==r)return n===r;var u=Tr.call(n),o=Tr.call(r);
if(u!=o)return!1;switch(u){case ar:case fr:return+n==+r;case lr:return n!=+n?r!=+r:0==n?1/n==1/r:n==+r;case pr:case sr:return n==r+""}if(o=u==or,!o){if(Er.call(n,"__wrapped__")||r instanceof i)return l(n.__wrapped__||n,r.__wrapped__||r,t,e);if(u!=cr)return!1;var u=n.constructor,a=r.constructor;if(u!=a&&(!x(u)||!(u instanceof u&&x(a)&&a instanceof a)))return!1}for(t||(t=[]),e||(e=[]),u=t.length;u--;)if(t[u]==n)return e[u]==r;var f=!0,c=0;if(t.push(n),e.push(r),o){if(c=r.length,f=c==n.length)for(;c--&&(f=l(n[c],r[c],t,e)););return f
}return Kr(r,function(r,u,i){return Er.call(i,u)?(c++,!(f=Er.call(n,u)&&l(n[u],r,t,e))&&rr):void 0}),f&&Kr(n,function(n,r,t){return Er.call(t,r)?!(f=-1<--c)&&rr:void 0}),f}function c(n,r,t){for(var e=-1,u=g(),i=n?n.length:0,o=[],a=t?[]:o;++e<i;){var f=n[e],l=t?t(f,e,n):f;(r?!e||a[a.length-1]!==l:0>u(a,l))&&(t&&a.push(l),o.push(f))}return o}function p(n){return function(r,t,e){var u={};return t=K(t,e,3),B(r,function(r,e,i){e=t(r,e,i)+"",n(u,r,e,i)}),u}}function s(n,r,t,e,u,i){var o=1&r,a=2&r,f=4&r,l=8&r,c=32&r;
if(!a&&!x(n))throw new TypeError;if(!o||a||f||c||!(zr.fastBind||Sr&&t.length))p=function(){var c=arguments,g=o?u:this;return t&&Or.apply(c,t),e&&Ar.apply(c,e),f&&c.length<i?(r|=16,s(n,l?r:-4&r,c,null,u,i)):(a&&(n=g[h]),this instanceof p?(g=v(n.prototype),c=n.apply(g,c),E(c)?c:g):n.apply(g,c))};else{c=[n,u],Ar.apply(c,t);var p=Sr.call.apply(Sr,c)}if(a){var h=u;u=n}return p}function v(n){return E(n)?Fr(n):{}}function h(n){return Vr[n]}function g(){var n=(n=i.indexOf)===U?r:n;return n}function y(n){return Gr[n]
}function m(n){return n&&typeof n=="object"?Tr.call(n)==ir:!1}function _(n){if(!n)return n;for(var r=1,t=arguments.length;r<t;r++){var e=arguments[r];if(e)for(var u in e)n[u]=e[u]}return n}function d(n){if(!n)return n;for(var r=1,t=arguments.length;r<t;r++){var e=arguments[r];if(e)for(var u in e)"undefined"==typeof n[u]&&(n[u]=e[u])}return n}function b(n){var r=[];return Kr(n,function(n,t){x(n)&&r.push(t)}),r.sort()}function w(n){for(var r=-1,t=Ur(n),e=t.length,u={};++r<e;){var i=t[r];u[n[i]]=i}return u
}function j(n){if(!n)return!0;if(Cr(n)||T(n))return!n.length;for(var r in n)if(Er.call(n,r))return!1;return!0}function x(n){return typeof n=="function"}function E(n){return!(!n||!vr[typeof n])}function A(n){return typeof n=="number"||Tr.call(n)==lr}function T(n){return typeof n=="string"||Tr.call(n)==sr}function O(n){for(var r=-1,t=Ur(n),e=t.length,u=Array(e);++r<e;)u[r]=n[t[r]];return u}function S(n,r){var t=g(),e=n?n.length:0,u=!1;return e&&typeof e=="number"?u=-1<t(n,r):Lr(n,function(n){return(u=n===r)&&rr
}),u}function F(n,r,t){var e=!0;r=K(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++t<u&&(e=!!r(n[t],t,n)););else Lr(n,function(n,t,u){return!(e=!!r(n,t,u))&&rr});return e}function N(n,r,t){var e=[];r=K(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++t<u;){var i=n[t];r(i,t,n)&&e.push(i)}else Lr(n,function(n,t,u){r(n,t,u)&&e.push(n)});return e}function R(n,r,t){r=K(r,t,3),t=-1;var e=n?n.length:0;if(typeof e!="number"){var u;return Lr(n,function(n,t,e){return r(n,t,e)?(u=n,rr):void 0
}),u}for(;++t<e;){var i=n[t];if(r(i,t,n))return i}}function B(n,r,t){var e=-1,u=n?n.length:0;if(r=r&&typeof t=="undefined"?r:a(r,t,3),typeof u=="number")for(;++e<u&&r(n[e],e,n)!==rr;);else Lr(n,r)}function k(n,r){var t=n?n.length:0;if(typeof t!="number")var e=Ur(n),t=e.length;B(n,function(u,i,o){return i=e?e[--t]:--t,false===r(n[i],i,o)&&rr})}function D(n,r,t){var e=-1,u=n?n.length:0;if(r=K(r,t,3),typeof u=="number")for(var i=Array(u);++e<u;)i[e]=r(n[e],e,n);else i=[],Lr(n,function(n,t,u){i[++e]=r(n,t,u)
});return i}function q(n,r,t){var e=-1/0,u=e,i=-1,o=n?n.length:0;if(r||typeof o!="number")r=K(r,t,3),B(n,function(n,t,i){t=r(n,t,i),t>e&&(e=t,u=n)});else for(;++i<o;)t=n[i],t>u&&(u=t);return u}function M(n,r){var t=-1,e=n?n.length:0;if(typeof e=="number")for(var u=Array(e);++t<e;)u[t]=n[t][r];return u||D(n,r)}function $(n,r,t,e){if(!n)return t;var u=3>arguments.length;r=a(r,e,4);var i=-1,o=n.length;if(typeof o=="number")for(u&&(t=n[++i]);++i<o;)t=r(t,n[i],i,n);else Lr(n,function(n,e,i){t=u?(u=!1,n):r(t,n,e,i)
});return t}function I(n,r,t,e){var u=3>arguments.length;return r=a(r,e,4),k(n,function(n,e,i){t=u?(u=!1,n):r(t,n,e,i)}),t}function W(n,r,t){var e;r=K(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++t<u&&!(e=r(n[t],t,n)););else Lr(n,function(n,t,u){return(e=r(n,t,u))&&rr});return!!e}function z(n,r,t){return t&&j(r)?Z:(t?R:N)(n,r)}function C(n){for(var r=-1,t=g(),e=n.length,u=f(arguments,!0,!0,1),i=[];++r<e;){var o=n[r];0>t(u,o)&&i.push(o)}return i}function P(n,r,t){if(n){var e=0,u=n.length;
if(typeof r!="number"&&null!=r){var i=-1;for(r=K(r,t,3);++i<u&&r(n[i],i,n);)e++}else if(e=r,null==e||t)return n[0];return $r.call(n,0,qr(Dr(0,e),u))}}function U(n,t,e){if(typeof e=="number"){var u=n?n.length:0;e=0>e?Dr(0,u+e):e||0}else if(e)return e=G(n,t),n[e]===t?e:-1;return n?r(n,t,e):-1}function V(n,r,t){if(typeof r!="number"&&null!=r){var e=0,u=-1,i=n?n.length:0;for(r=K(r,t,3);++u<i&&r(n[u],u,n);)e++}else e=null==r||t?1:Dr(0,r);return $r.call(n,e)}function G(n,r,t,e){var u=0,i=n?n.length:u;for(t=t?K(t,e,1):Q,r=t(r);u<i;)e=u+i>>>1,t(n[e])<r?u=e+1:i=e;
return u}function H(n,r,t,e){return typeof r!="boolean"&&null!=r&&(e=t,t=e&&e[r]===n?Z:r,r=!1),null!=t&&(t=K(t,e,3)),c(n,r,t)}function J(n,r){return s(n,17,$r.call(arguments,2),null,r)}function K(n,r,t){var e=typeof n;if(null==n||"function"==e)return a(n,r,t);if("object"!=e)return function(r){return r[n]};var u=Ur(n);return function(r){for(var t=u.length,e=!1;t--&&(e=r[u[t]]===n[u[t]]););return e}}function L(n,r,t){var e,u,i,o=0,a=0,f=!1,l=null,c=null,p=!0;if(!x(n))throw new TypeError;if(r=Dr(0,r||0),true===t)var s=!0,p=!1;
else E(t)&&(s=t.leading,f="maxWait"in t&&Dr(r,t.maxWait||0),p="trailing"in t?t.trailing:p);var v=function(){clearTimeout(l),clearTimeout(c),o=0,l=c=null},h=function(){var r=p&&(!s||1<o);v(),r&&(a=+new Date,u=n.apply(i,e))},g=function(){v(),(p||f!==r)&&(a=+new Date,u=n.apply(i,e))};return function(){if(e=arguments,i=this,o++,clearTimeout(c),false===f)s&&2>o&&(u=n.apply(i,e));else{var t=+new Date;!l&&!s&&(a=t);var p=f-(t-a);0<p?l||(l=setTimeout(g,p)):(clearTimeout(l),l=null,a=t,u=n.apply(i,e))}return r!==f&&(c=setTimeout(h,r)),u
}}function Q(n){return n}function X(n){B(b(n),function(r){var t=i[r]=n[r];i.prototype[r]=function(){var n=[this.__wrapped__];return Ar.apply(n,arguments),n=t.apply(i,n),this.__chain__&&(n=new o(n),n.__chain__=!0),n}})}function Y(n,r){null==n&&null==r&&(r=1),n=+n||0,null==r?(r=n,n=0):r=+r||0;var t=Mr();return n%1||r%1?n+qr(t*(r-n+parseFloat("1e-"+((t+"").length-1))),r):n+xr(t*(r-n+1))}var Z,nr=0,rr={},tr=+new Date+"",er=/($^)/,ur=/['\n\r\t\u2028\u2029\\]/g,ir="[object Arguments]",or="[object Array]",ar="[object Boolean]",fr="[object Date]",lr="[object Number]",cr="[object Object]",pr="[object RegExp]",sr="[object String]",vr={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},hr={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},gr=vr[typeof exports]&&exports,yr=vr[typeof module]&&module&&module.exports==gr&&module,mr=vr[typeof global]&&global;
!mr||mr.global!==mr&&mr.window!==mr||(n=mr);var _r=[],dr=Object.prototype,br=n._,wr=RegExp("^"+(dr.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),jr=Math.ceil,xr=Math.floor,Er=dr.hasOwnProperty,Ar=_r.push,Tr=dr.toString,Or=_r.unshift,Sr=wr.test(Sr=Tr.bind)&&Sr,Fr=wr.test(Fr=Object.create)&&Fr,Nr=wr.test(Nr=Array.isArray)&&Nr,Rr=n.isFinite,Br=n.isNaN,kr=wr.test(kr=Object.keys)&&kr,Dr=Math.max,qr=Math.min,Mr=Math.random,$r=_r.slice,Ir=wr.test(n.attachEvent),Wr=Sr&&!/\n|true/.test(Sr+Ir);
o.prototype=i.prototype;var zr={};!function(){var n={0:1,length:1};zr.fastBind=Sr&&!Wr,zr.spliceObjects=(_r.splice.call(n,0,1),!n[0])}(1),i.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},Fr||(v=function(n){if(E(n)){u.prototype=n;var r=new u;u.prototype=null}return r||{}}),m(arguments)||(m=function(n){return n&&typeof n=="object"?Er.call(n,"callee"):!1});var Cr=Nr||function(n){return n&&typeof n=="object"?Tr.call(n)==or:!1},Pr=function(n){var r,t=[];
if(!n||!vr[typeof n])return t;for(r in n)Er.call(n,r)&&t.push(r);return t},Ur=kr?function(n){return E(n)?kr(n):[]}:Pr,Vr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"},Gr=w(Vr),Hr=RegExp("("+Ur(Gr).join("|")+")","g"),Jr=RegExp("["+Ur(Vr).join("")+"]","g"),Kr=function(n,r){var t;if(!n||!vr[typeof n])return n;for(t in n)if(r(n[t],t,n)===rr)break;return n},Lr=function(n,r){var t;if(!n||!vr[typeof n])return n;for(t in n)if(Er.call(n,t)&&r(n[t],t,n)===rr)break;return n};x(/x/)&&(x=function(n){return typeof n=="function"&&"[object Function]"==Tr.call(n)
});var Qr=p(function(n,r,t){Er.call(n,t)?n[t]++:n[t]=1}),Xr=p(function(n,r,t){(Er.call(n,t)?n[t]:n[t]=[]).push(r)});i.after=function(n,r){if(!x(r))throw new TypeError;return function(){return 1>--n?r.apply(this,arguments):void 0}},i.bind=J,i.bindAll=function(n){for(var r=1<arguments.length?f(arguments,!0,!1,1):b(n),t=-1,e=r.length;++t<e;){var u=r[t];n[u]=J(n[u],n)}return n},i.chain=function(n){return n=new o(n),n.__chain__=!0,n},i.compact=function(n){for(var r=-1,t=n?n.length:0,e=[];++r<t;){var u=n[r];
u&&e.push(u)}return e},i.compose=function(){for(var n=arguments,r=n.length||1;r--;)if(!x(n[r]))throw new TypeError;return function(){for(var r=arguments,t=n.length;t--;)r=[n[t].apply(this,r)];return r[0]}},i.countBy=Qr,i.debounce=L,i.defaults=d,i.defer=function(n){if(!x(n))throw new TypeError;var r=$r.call(arguments,1);return setTimeout(function(){n.apply(Z,r)},1)},i.delay=function(n,r){if(!x(n))throw new TypeError;var t=$r.call(arguments,2);return setTimeout(function(){n.apply(Z,t)},r)},i.difference=C,i.filter=N,i.flatten=function(n,r){return f(n,r)
},i.forEach=B,i.functions=b,i.groupBy=Xr,i.initial=function(n,r,t){if(!n)return[];var e=0,u=n.length;if(typeof r!="number"&&null!=r){var i=u;for(r=K(r,t,3);i--&&r(n[i],i,n);)e++}else e=null==r||t?1:r||e;return $r.call(n,0,qr(Dr(0,u-e),u))},i.intersection=function(n){var r=arguments,t=r.length,e=-1,u=g(),i=n?n.length:0,o=[];n:for(;++e<i;){var a=n[e];if(0>u(o,a)){for(var f=t;--f;)if(0>u(r[f],a))continue n;o.push(a)}}return o},i.invert=w,i.invoke=function(n,r){var t=$r.call(arguments,2),e=-1,u=typeof r=="function",i=n?n.length:0,o=Array(typeof i=="number"?i:0);
return B(n,function(n){o[++e]=(u?r:n[r]).apply(n,t)}),o},i.keys=Ur,i.map=D,i.max=q,i.memoize=function(n,r){var t={};return function(){var e=tr+(r?r.apply(this,arguments):arguments[0]);return Er.call(t,e)?t[e]:t[e]=n.apply(this,arguments)}},i.min=function(n,r,t){var e=1/0,u=e,i=-1,o=n?n.length:0;if(r||typeof o!="number")r=K(r,t,3),B(n,function(n,t,i){t=r(n,t,i),t<e&&(e=t,u=n)});else for(;++i<o;)t=n[i],t<u&&(u=t);return u},i.omit=function(n){var r=g(),t=f(arguments,!0,!1,1),e={};return Kr(n,function(n,u){0>r(t,u)&&(e[u]=n)
}),e},i.once=function(n){var r,t;if(!x(n))throw new TypeError;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},i.pairs=function(n){for(var r=-1,t=Ur(n),e=t.length,u=Array(e);++r<e;){var i=t[r];u[r]=[i,n[i]]}return u},i.partial=function(n){return s(n,16,$r.call(arguments,1))},i.pick=function(n){for(var r=-1,t=f(arguments,!0,!1,1),e=t.length,u={};++r<e;){var i=t[r];i in n&&(u[i]=n[i])}return u},i.pluck=M,i.range=function(n,r,t){n=+n||0,t=+t||1,null==r&&(r=n,n=0);var e=-1;r=Dr(0,jr((r-n)/t));
for(var u=Array(r);++e<r;)u[e]=n,n+=t;return u},i.reject=function(n,r,t){return r=K(r,t,3),N(n,function(n,t,e){return!r(n,t,e)})},i.rest=V,i.shuffle=function(n){var r=-1,t=n?n.length:0,e=Array(typeof t=="number"?t:0);return B(n,function(n){var t=Y(++r);e[r]=e[t],e[t]=n}),e},i.sortBy=function(n,r,e){var u=-1,i=n?n.length:0,o=Array(typeof i=="number"?i:0);for(r=K(r,e,3),B(n,function(n,t,e){o[++u]={l:r(n,t,e),m:u,n:n}}),i=o.length,o.sort(t);i--;)o[i]=o[i].n;return o},i.tap=function(n,r){return r(n),n
},i.throttle=function(n,r,t){var e=!0,u=!0;return false===t?e=!1:E(t)&&(e="leading"in t?t.leading:e,u="trailing"in t?t.trailing:u),t={},t.leading=e,t.maxWait=r,t.trailing=u,L(n,r,t)},i.times=function(n,r,t){for(var e=-1,u=Array(-1<n?n:0);++e<n;)u[e]=r.call(t,e);return u},i.toArray=function(n){return Cr(n)?$r.call(n):n&&typeof n.length=="number"?D(n):O(n)},i.union=function(){return c(f(arguments,!0,!0))},i.uniq=H,i.values=O,i.where=z,i.without=function(n){return C(n,$r.call(arguments,1))},i.wrap=function(n,r){if(!x(r))throw new TypeError;
return function(){var t=[n];return Ar.apply(t,arguments),r.apply(this,t)}},i.zip=function(){for(var n=-1,r=q(M(arguments,"length")),t=Array(0>r?0:r);++n<r;)t[n]=M(arguments,n);return t},i.collect=D,i.drop=V,i.each=B,i.extend=_,i.methods=b,i.object=function(n,r){for(var t=-1,e=n?n.length:0,u={};++t<e;){var i=n[t];r?u[i]=r[t]:i&&(u[i[0]]=i[1])}return u},i.select=N,i.tail=V,i.unique=H,i.clone=function(n){return E(n)?Cr(n)?$r.call(n):_({},n):n},i.contains=S,i.escape=function(n){return null==n?"":(n+"").replace(Jr,h)
},i.every=F,i.find=R,i.has=function(n,r){return n?Er.call(n,r):!1},i.identity=Q,i.indexOf=U,i.isArguments=m,i.isArray=Cr,i.isBoolean=function(n){return true===n||false===n||Tr.call(n)==ar},i.isDate=function(n){return n?typeof n=="object"&&Tr.call(n)==fr:!1},i.isElement=function(n){return n?1===n.nodeType:!1},i.isEmpty=j,i.isEqual=function(n,r){return l(n,r)},i.isFinite=function(n){return Rr(n)&&!Br(parseFloat(n))},i.isFunction=x,i.isNaN=function(n){return A(n)&&n!=+n},i.isNull=function(n){return null===n
},i.isNumber=A,i.isObject=E,i.isRegExp=function(n){return n&&vr[typeof n]?Tr.call(n)==pr:!1},i.isString=T,i.isUndefined=function(n){return typeof n=="undefined"},i.lastIndexOf=function(n,r,t){var e=n?n.length:0;for(typeof t=="number"&&(e=(0>t?Dr(0,e+t):qr(t,e-1))+1);e--;)if(n[e]===r)return e;return-1},i.mixin=X,i.noConflict=function(){return n._=br,this},i.random=Y,i.reduce=$,i.reduceRight=I,i.result=function(n,r){var t=n?n[r]:Z;return x(t)?n[r]():t},i.size=function(n){var r=n?n.length:0;return typeof r=="number"?r:Ur(n).length
},i.some=W,i.sortedIndex=G,i.template=function(n,r,t){var u=i,o=u.templateSettings;n||(n=""),t=d({},t,o);var a=0,f="__p+='",o=t.variable;n.replace(RegExp((t.escape||er).source+"|"+(t.interpolate||er).source+"|"+(t.evaluate||er).source+"|$","g"),function(r,t,u,i,o){return f+=n.slice(a,o).replace(ur,e),t&&(f+="'+_.escape("+t+")+'"),i&&(f+="';"+i+";__p+='"),u&&(f+="'+((__t=("+u+"))==null?'':__t)+'"),a=o+r.length,r}),f+="';\n",o||(o="obj",f="with("+o+"||{}){"+f+"}"),f="function("+o+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+f+"return __p}";
try{var l=Function("_","return "+f)(u)}catch(c){throw c.source=f,c}return r?l(r):(l.source=f,l)},i.unescape=function(n){return null==n?"":(n+"").replace(Hr,y)},i.uniqueId=function(n){var r=++nr+"";return n?n+r:r},i.all=F,i.any=W,i.detect=R,i.findWhere=function(n,r){return z(n,r,!0)},i.foldl=$,i.foldr=I,i.include=S,i.inject=$,i.first=P,i.last=function(n,r,t){if(n){var e=0,u=n.length;if(typeof r!="number"&&null!=r){var i=u;for(r=K(r,t,3);i--&&r(n[i],i,n);)e++}else if(e=r,null==e||t)return n[u-1];return $r.call(n,Dr(0,u-e))
}},i.take=P,i.head=P,X(i),i.VERSION="1.3.1",i.prototype.chain=function(){return this.__chain__=!0,this},i.prototype.value=function(){return this.__wrapped__},B("pop push reverse shift sort splice unshift".split(" "),function(n){var r=_r[n];i.prototype[n]=function(){var n=this.__wrapped__;return r.apply(n,arguments),!zr.spliceObjects&&0===n.length&&delete n[0],this}}),B(["concat","join","slice"],function(n){var r=_r[n];i.prototype[n]=function(){var n=r.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new o(n),n.__chain__=!0),n
}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=i, define(function(){return i})):gr&&!gr.nodeType?yr?(yr.exports=i)._=i:gr._=i:n._=i}(this);

View File

@@ -85,6 +85,7 @@
* [`_.reduce`](#_reducecollection--callbackidentity-accumulator-thisarg)
* [`_.reduceRight`](#_reducerightcollection--callbackidentity-accumulator-thisarg)
* [`_.reject`](#_rejectcollection--callbackidentity-thisarg)
* [`_.sample`](#_samplecollection)
* [`_.select`](#_filtercollection--callbackidentity-thisarg)
* [`_.shuffle`](#_shufflecollection)
* [`_.size`](#_sizecollection)
@@ -230,7 +231,7 @@
<!-- div -->
### <a id="_compactarray"></a>`_.compact(array)`
<a href="#_compactarray">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4056 "View in source") [&#x24C9;][1]
<a href="#_compactarray">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4087 "View in source") [&#x24C9;][1]
Creates an array with all falsey values removed. The values `false`, `null`, `0`, `""`, `undefined`, and `NaN` are all falsey.
@@ -254,7 +255,7 @@ _.compact([0, 1, false, 2, '', 3]);
<!-- div -->
### <a id="_differencearray--array1-array2-"></a>`_.difference(array [, array1, array2, ...])`
<a href="#_differencearray--array1-array2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4085 "View in source") [&#x24C9;][1]
<a href="#_differencearray--array1-array2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4116 "View in source") [&#x24C9;][1]
Creates an array excluding all values of the provided arrays using strict equality for comparisons, i.e. `===`.
@@ -279,7 +280,7 @@ _.difference([1, 2, 3, 4, 5], [5, 2, 10]);
<!-- div -->
### <a id="_findindexarray--callbackidentity-thisarg"></a>`_.findIndex(array [, callback=identity, thisArg])`
<a href="#_findindexarray--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4135 "View in source") [&#x24C9;][1]
<a href="#_findindexarray--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4166 "View in source") [&#x24C9;][1]
This method is like `_.find` except that it returns the index of the first element that passes the callback check, instead of the element itself.
@@ -307,7 +308,7 @@ _.findIndex(['apple', 'banana', 'beet'], function(food) {
<!-- div -->
### <a id="_findlastindexarray--callbackidentity-thisarg"></a>`_.findLastIndex(array [, callback=identity, thisArg])`
<a href="#_findlastindexarray--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4168 "View in source") [&#x24C9;][1]
<a href="#_findlastindexarray--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4199 "View in source") [&#x24C9;][1]
This method is like `_.findIndex` except that it iterates over elements of a `collection` from right to left.
@@ -335,9 +336,9 @@ _.findLastIndex(['apple', 'banana', 'beet'], function(food) {
<!-- div -->
### <a id="_firstarray--callbackn-thisarg"></a>`_.first(array [, callback|n, thisArg])`
<a href="#_firstarray--callbackn-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4236 "View in source") [&#x24C9;][1]
<a href="#_firstarray--callbackn-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4266 "View in source") [&#x24C9;][1]
Gets the first element of an array. If a number `n` is provided the first `n` elements of the array are returned. If a callback is provided elements at the beginning of the array are returned as long as the callback returns truthy. The callback is bound to `thisArg` and invoked with three arguments; *(value, index, array)*.
Gets the first element or first `n` elements of an array. If a callback is provided elements at the beginning of the array are returned as long as the callback returns truthy. The callback is bound to `thisArg` and invoked with three arguments; *(value, index, array)*.
If a property name is provided for `callback` the created "_.pluck" style callback will return the property value of the given element.
@@ -395,7 +396,7 @@ _.first(food, { 'type': 'fruit' });
<!-- div -->
### <a id="_flattenarray--isshallowfalse-callbackidentity-thisarg"></a>`_.flatten(array [, isShallow=false, callback=identity, thisArg])`
<a href="#_flattenarray--isshallowfalse-callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4298 "View in source") [&#x24C9;][1]
<a href="#_flattenarray--isshallowfalse-callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4328 "View in source") [&#x24C9;][1]
Flattens a nested array *(the nesting can be to any depth)*. If `isShallow` is truthy, the array will only be flattened a single level. If a callback is provided each element of the array is passed through the callback before flattening. The callback is bound to `thisArg` and invoked with three arguments; *(value, index, array)*.
@@ -438,7 +439,7 @@ _.flatten(stooges, 'quotes');
<!-- div -->
### <a id="_indexofarray-value--fromindex0"></a>`_.indexOf(array, value [, fromIndex=0])`
<a href="#_indexofarray-value--fromindex0">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4335 "View in source") [&#x24C9;][1]
<a href="#_indexofarray-value--fromindex0">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4365 "View in source") [&#x24C9;][1]
Gets the index at which the first occurrence of `value` is found using strict equality for comparisons, i.e. `===`. If the array is already sorted providing `true` for `fromIndex` will run a faster binary search.
@@ -470,9 +471,9 @@ _.indexOf([1, 1, 2, 2, 3, 3], 2, true);
<!-- div -->
### <a id="_initialarray--callbackn1-thisarg"></a>`_.initial(array [, callback|n=1, thisArg])`
<a href="#_initialarray--callbackn1-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4402 "View in source") [&#x24C9;][1]
<a href="#_initialarray--callbackn1-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4431 "View in source") [&#x24C9;][1]
Gets all but the last element of an array. If a number `n` is provided the last `n` elements are excluded from the result. If a callback is provided elements at the end of the array are excluded from the result as long as the callback returns truthy. The callback is bound to `thisArg` and invoked with three arguments; *(value, index, array)*.
Gets all but the last element or last `n` elements of an array. If a callback is provided elements at the end of the array are excluded from the result as long as the callback returns truthy. The callback is bound to `thisArg` and invoked with three arguments; *(value, index, array)*.
If a property name is provided for `callback` the created "_.pluck" style callback will return the property value of the given element.
@@ -527,7 +528,7 @@ _.initial(food, { 'type': 'vegetable' });
<!-- div -->
### <a id="_intersectionarray1-array2-"></a>`_.intersection([array1, array2, ...])`
<a href="#_intersectionarray1-array2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4435 "View in source") [&#x24C9;][1]
<a href="#_intersectionarray1-array2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4464 "View in source") [&#x24C9;][1]
Creates an array of unique values present in all provided arrays using strict equality for comparisons, i.e. `===`.
@@ -551,11 +552,11 @@ _.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]);
<!-- div -->
### <a id="_lastarray--callbackn-thisarg"></a>`_.last(array [, callback|n, thisArg])`
<a href="#_lastarray--callbackn-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4537 "View in source") [&#x24C9;][1]
<a href="#_lastarray--callbackn-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4564 "View in source") [&#x24C9;][1]
Gets the last element of an array. If a number `n` is provided the last `n` elements of the array are returned. If a callback is provided elements at the end of the array are returned as long as the callback returns truthy. The callback is bound to `thisArg` and invoked with three arguments; *(value, index, array)*.
Gets the last element or last `n` elements of an array. If a callback is provided elements at the end of the array are returned as long as the callback returns truthy. The callback is bound to `thisArg` and invoked with three arguments; *(value, index, array)*.
If a property name is provided for `callback` the created "_.pluck" style callback will return the property value of the given element.
If a property name is provided for `callback` the created "_.pluck" style callback will return the property value of the given element.
If an object is provided for `callback` the created "_.where" style callback will return `true` for elements that have the properties of the given object, else `false`.
@@ -608,7 +609,7 @@ _.last(food, { 'type': 'vegetable' });
<!-- div -->
### <a id="_lastindexofarray-value--fromindexarraylength-1"></a>`_.lastIndexOf(array, value [, fromIndex=array.length-1])`
<a href="#_lastindexofarray-value--fromindexarraylength-1">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4578 "View in source") [&#x24C9;][1]
<a href="#_lastindexofarray-value--fromindexarraylength-1">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4605 "View in source") [&#x24C9;][1]
Gets the index at which the last occurrence of `value` is found using strict equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used as the offset from the end of the collection.
@@ -637,7 +638,7 @@ _.lastIndexOf([1, 2, 3, 1, 2, 3], 2, 3);
<!-- div -->
### <a id="_pullarray--value1-value2-"></a>`_.pull(array [, value1, value2, ...])`
<a href="#_pullarray--value1-value2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4608 "View in source") [&#x24C9;][1]
<a href="#_pullarray--value1-value2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4635 "View in source") [&#x24C9;][1]
Removes all provided values from the given array using strict equality for comparisons, i.e. `===`.
@@ -664,7 +665,7 @@ console.log(array);
<!-- div -->
### <a id="_rangestart0-end--step1"></a>`_.range([start=0], end [, step=1])`
<a href="#_rangestart0-end--step1">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4659 "View in source") [&#x24C9;][1]
<a href="#_rangestart0-end--step1">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4686 "View in source") [&#x24C9;][1]
Creates an array of numbers *(positive and/or negative)* progressing from `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.
@@ -705,7 +706,7 @@ _.range(0);
<!-- div -->
### <a id="_removearray--callbackidentity-thisarg"></a>`_.remove(array [, callback=identity, thisArg])`
<a href="#_removearray--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4712 "View in source") [&#x24C9;][1]
<a href="#_removearray--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4739 "View in source") [&#x24C9;][1]
Removes all elements from an array that the callback returns truthy for and returns an array of removed elements. The callback is bound to `thisArg` and invoked with three arguments; *(value, index, array)*.
@@ -741,9 +742,9 @@ console.log(evens);
<!-- div -->
### <a id="_restarray--callbackn1-thisarg"></a>`_.rest(array [, callback|n=1, thisArg])`
<a href="#_restarray--callbackn1-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4787 "View in source") [&#x24C9;][1]
<a href="#_restarray--callbackn1-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4813 "View in source") [&#x24C9;][1]
The opposite of `_.initial` this method gets all but the first value of an array. If a number `n` is provided the first `n` values are excluded from the result. If a callback function is provided elements at the beginning of the array are excluded from the result as long as the callback returns truthy. The callback is bound to `thisArg` and invoked with three arguments; *(value, index, array)*.
The opposite of `_.initial` this method gets all but the first element or first `n` elements of an array. If a callback function is provided elements at the beginning of the array are excluded from the result as long as the callback returns truthy. The callback is bound to `thisArg` and invoked with three arguments; *(value, index, array)*.
If a property name is provided for `callback` the created "_.pluck" style callback will return the property value of the given element.
@@ -801,7 +802,7 @@ _.rest(food, { 'type': 'fruit' });
<!-- div -->
### <a id="_sortedindexarray-value--callbackidentity-thisarg"></a>`_.sortedIndex(array, value [, callback=identity, thisArg])`
<a href="#_sortedindexarray-value--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4851 "View in source") [&#x24C9;][1]
<a href="#_sortedindexarray-value--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4877 "View in source") [&#x24C9;][1]
Uses a binary search to determine the smallest index at which a value should be inserted into a given sorted array in order to maintain the sort order of the array. If a callback is provided it will be executed for `value` and each element of `array` to compute their sort ranking. The callback is bound to `thisArg` and invoked with one argument; *(value)*.
@@ -850,7 +851,7 @@ _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) {
<!-- div -->
### <a id="_unionarray1-array2-"></a>`_.union([array1, array2, ...])`
<a href="#_unionarray1-array2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4882 "View in source") [&#x24C9;][1]
<a href="#_unionarray1-array2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4908 "View in source") [&#x24C9;][1]
Creates an array of unique values, in order, of the provided arrays using strict equality for comparisons, i.e. `===`.
@@ -874,7 +875,7 @@ _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]);
<!-- div -->
### <a id="_uniqarray--issortedfalse-callbackidentity-thisarg"></a>`_.uniq(array [, isSorted=false, callback=identity, thisArg])`
<a href="#_uniqarray--issortedfalse-callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4930 "View in source") [&#x24C9;][1]
<a href="#_uniqarray--issortedfalse-callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4956 "View in source") [&#x24C9;][1]
Creates a duplicate-value-free version of an array using strict equality for comparisons, i.e. `===`. If the array is sorted, providing `true` for `isSorted` will use a faster algorithm. If a callback is provided each element of `array` is passed through the callback before uniqueness is computed. The callback is bound to `thisArg` and invoked with three arguments; *(value, index, array)*.
@@ -921,7 +922,7 @@ _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
<!-- div -->
### <a id="_withoutarray--value1-value2-"></a>`_.without(array [, value1, value2, ...])`
<a href="#_withoutarray--value1-value2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4958 "View in source") [&#x24C9;][1]
<a href="#_withoutarray--value1-value2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4984 "View in source") [&#x24C9;][1]
Creates an array excluding all provided values using strict equality for comparisons, i.e. `===`.
@@ -946,7 +947,7 @@ _.without([1, 2, 1, 0, 3, 1, 4], 0, 1);
<!-- div -->
### <a id="_ziparray1-array2-"></a>`_.zip([array1, array2, ...])`
<a href="#_ziparray1-array2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4978 "View in source") [&#x24C9;][1]
<a href="#_ziparray1-array2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5004 "View in source") [&#x24C9;][1]
Creates an array of grouped elements, the first of which contains the first elements of the given arrays, the second of which contains the second elements of the given arrays, and so on.
@@ -973,7 +974,7 @@ _.zip(['moe', 'larry'], [30, 40], [true, false]);
<!-- div -->
### <a id="_zipobjectkeys--values"></a>`_.zipObject(keys [, values=[]])`
<a href="#_zipobjectkeys--values">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5008 "View in source") [&#x24C9;][1]
<a href="#_zipobjectkeys--values">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5034 "View in source") [&#x24C9;][1]
Creates an object composed from arrays of `keys` and `values`. Provide either a single two dimensional array, i.e. `[[key1, value1], [key2, value2]]` or two arrays, one of `keys` and one of corresponding `values`.
@@ -1061,7 +1062,7 @@ _.isArray(squares.value());
<!-- div -->
### <a id="_chainvalue"></a>`_.chain(value)`
<a href="#_chainvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6181 "View in source") [&#x24C9;][1]
<a href="#_chainvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6207 "View in source") [&#x24C9;][1]
Creates a `lodash` object that wraps the given `value`.
@@ -1094,7 +1095,7 @@ var youngest = _.chain(stooges)
<!-- div -->
### <a id="_tapvalue-interceptor"></a>`_.tap(value, interceptor)`
<a href="#_tapvalue-interceptor">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6209 "View in source") [&#x24C9;][1]
<a href="#_tapvalue-interceptor">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6235 "View in source") [&#x24C9;][1]
Invokes `interceptor` with the `value` as the first argument and then returns `value`. The purpose of this method is to "tap into" a method chain in order to perform operations on intermediate results within the chain.
@@ -1124,7 +1125,7 @@ _([1, 2, 3, 4])
<!-- div -->
### <a id="_prototypechain"></a>`_.prototype.chain()`
<a href="#_prototypechain">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6229 "View in source") [&#x24C9;][1]
<a href="#_prototypechain">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6255 "View in source") [&#x24C9;][1]
Enables method chaining on the wrapper object.
@@ -1148,7 +1149,7 @@ var sum = _([1, 2, 3])
<!-- div -->
### <a id="_prototypetostring"></a>`_.prototype.toString()`
<a href="#_prototypetostring">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6246 "View in source") [&#x24C9;][1]
<a href="#_prototypetostring">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6272 "View in source") [&#x24C9;][1]
Produces the `toString` result of the wrapped value.
@@ -1169,7 +1170,7 @@ _([1, 2, 3]).toString();
<!-- div -->
### <a id="_prototypevalueof"></a>`_.prototype.valueOf()`
<a href="#_prototypevalueof">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6263 "View in source") [&#x24C9;][1]
<a href="#_prototypevalueof">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6289 "View in source") [&#x24C9;][1]
Extracts the wrapped value.
@@ -1907,10 +1908,37 @@ _.reject(food, { 'type': 'fruit' });
<!-- /div -->
<!-- div -->
### <a id="_samplecollection"></a>`_.sample(collection)`
<a href="#_samplecollection">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3834 "View in source") [&#x24C9;][1]
Retrieves a random element or `n` random elements from a collection.
#### Arguments
1. `collection` *(Array|Object|String)*: The collection to sample.
#### Returns
*(Array)*: Returns the random sample(s) of `collection`.
#### Example
```js
_.sample([1, 2, 3, 4]);
// => 2
_.sample([1, 2, 3, 4], 2);
// => [3, 1]
```
* * *
<!-- /div -->
<!-- div -->
### <a id="_shufflecollection"></a>`_.shuffle(collection)`
<a href="#_shufflecollection">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3832 "View in source") [&#x24C9;][1]
<a href="#_shufflecollection">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3863 "View in source") [&#x24C9;][1]
Creates an array of shuffled values, using a version of the Fisher-Yates shuffle. See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle.
@@ -1934,7 +1962,7 @@ _.shuffle([1, 2, 3, 4, 5, 6]);
<!-- div -->
### <a id="_sizecollection"></a>`_.size(collection)`
<a href="#_sizecollection">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3865 "View in source") [&#x24C9;][1]
<a href="#_sizecollection">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3896 "View in source") [&#x24C9;][1]
Gets the size of the `collection` by returning `collection.length` for arrays and array-like objects or the number of own enumerable properties for objects.
@@ -1964,7 +1992,7 @@ _.size('curly');
<!-- div -->
### <a id="_somecollection--callbackidentity-thisarg"></a>`_.some(collection [, callback=identity, thisArg])`
<a href="#_somecollection--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3912 "View in source") [&#x24C9;][1]
<a href="#_somecollection--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3943 "View in source") [&#x24C9;][1]
Checks if the callback returns a truthy value for **any** element of a collection. The function returns as soon as it finds a passing value and does not iterate over the entire collection. The callback is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*.
@@ -2010,7 +2038,7 @@ _.some(food, { 'type': 'meat' });
<!-- div -->
### <a id="_sortbycollection--callbackidentity-thisarg"></a>`_.sortBy(collection [, callback=identity, thisArg])`
<a href="#_sortbycollection--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3968 "View in source") [&#x24C9;][1]
<a href="#_sortbycollection--callbackidentity-thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L3999 "View in source") [&#x24C9;][1]
Creates an array of elements, sorted in ascending order by the results of running each element in a collection through the callback. This method performs a stable sort, that is, it will preserve the original sort order of equal elements. The callback is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*.
@@ -2047,7 +2075,7 @@ _.sortBy(['banana', 'strawberry', 'apple'], 'length');
<!-- div -->
### <a id="_toarraycollection"></a>`_.toArray(collection)`
<a href="#_toarraycollection">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4004 "View in source") [&#x24C9;][1]
<a href="#_toarraycollection">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4035 "View in source") [&#x24C9;][1]
Converts the `collection` to an array.
@@ -2071,7 +2099,7 @@ Converts the `collection` to an array.
<!-- div -->
### <a id="_wherecollection-properties"></a>`_.where(collection, properties)`
<a href="#_wherecollection-properties">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4038 "View in source") [&#x24C9;][1]
<a href="#_wherecollection-properties">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L4069 "View in source") [&#x24C9;][1]
Performs a deep comparison of each element in a `collection` to the given `properties` object, returning an array of all elements that have equivalent property values.
@@ -2111,7 +2139,7 @@ _.where(stooges, { 'quotes': ['Poifect!'] });
<!-- div -->
### <a id="_aftern-func"></a>`_.after(n, func)`
<a href="#_aftern-func">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5045 "View in source") [&#x24C9;][1]
<a href="#_aftern-func">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5071 "View in source") [&#x24C9;][1]
Creates a function this is restricted to executing `func` with the `this` binding and arguments of the created function, only after it is called `n` times.
@@ -2139,7 +2167,7 @@ _.forEach(notes, function(note) {
<!-- div -->
### <a id="_bindfunc--thisarg-arg1-arg2-"></a>`_.bind(func [, thisArg, arg1, arg2, ...])`
<a href="#_bindfunc--thisarg-arg1-arg2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5078 "View in source") [&#x24C9;][1]
<a href="#_bindfunc--thisarg-arg1-arg2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5104 "View in source") [&#x24C9;][1]
Creates a function that, when called, invokes `func` with the `this` binding of `thisArg` and prepends any additional `bind` arguments to those provided to the bound function.
@@ -2170,7 +2198,7 @@ func();
<!-- div -->
### <a id="_bindallobject--methodname1-methodname2-"></a>`_.bindAll(object [, methodName1, methodName2, ...])`
<a href="#_bindallobject--methodname1-methodname2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5106 "View in source") [&#x24C9;][1]
<a href="#_bindallobject--methodname1-methodname2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5132 "View in source") [&#x24C9;][1]
Binds methods of an object to the object itself, overwriting the existing method. Method names may be specified as individual arguments or as arrays of method names. If no method names are provided all the function properties of `object` will be bound.
@@ -2201,7 +2229,7 @@ jQuery('#docs').on('click', view.onClick);
<!-- div -->
### <a id="_bindkeyobject-key--arg1-arg2-"></a>`_.bindKey(object, key [, arg1, arg2, ...])`
<a href="#_bindkeyobject-key--arg1-arg2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5152 "View in source") [&#x24C9;][1]
<a href="#_bindkeyobject-key--arg1-arg2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5178 "View in source") [&#x24C9;][1]
Creates a function that, when called, invokes the method at `object[key]` and prepends any additional `bindKey` arguments to those provided to the bound function. This method differs from `_.bind` by allowing bound functions to reference methods that will be redefined or don't yet exist. See http://michaux.ca/articles/lazy-function-definition-pattern.
@@ -2242,7 +2270,7 @@ func();
<!-- div -->
### <a id="_composefunc1-func2-"></a>`_.compose([func1, func2, ...])`
<a href="#_composefunc1-func2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5186 "View in source") [&#x24C9;][1]
<a href="#_composefunc1-func2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5212 "View in source") [&#x24C9;][1]
Creates a function that is the composition of the provided functions, where each function consumes the return value of the function that follows. For example, composing the functions `f()`, `g()`, and `h()` produces `f(g(h()))`. Each function is executed with the `this` binding of the composed function.
@@ -2280,7 +2308,7 @@ welcome('curly');
<!-- div -->
### <a id="_createcallbackfuncidentity-thisarg-argcount"></a>`_.createCallback([func=identity, thisArg, argCount])`
<a href="#_createcallbackfuncidentity-thisarg-argcount">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5237 "View in source") [&#x24C9;][1]
<a href="#_createcallbackfuncidentity-thisarg-argcount">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5263 "View in source") [&#x24C9;][1]
Produces a callback bound to an optional `thisArg`. If `func` is a property name the created callback will return the property value for a given element. If `func` is an object the created callback will return `true` for elements that contain the equivalent object properties, otherwise it will return `false`.
@@ -2319,7 +2347,7 @@ _.filter(stooges, 'age__gt45');
<!-- div -->
### <a id="_curryfunc--arityfunclength"></a>`_.curry(func [, arity=func.length])`
<a href="#_curryfunc--arityfunclength">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5302 "View in source") [&#x24C9;][1]
<a href="#_curryfunc--arityfunclength">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5328 "View in source") [&#x24C9;][1]
Creates a function which accepts one or more arguments of `func` that when invoked either executes `func` returning its result, if all `func` arguments have been provided, or returns a function that accepts one or more of the remaining `func` arguments, and so on. The arity of `func` can be specified if `func.length` is not sufficient.
@@ -2354,7 +2382,7 @@ curried(1, 2, 3);
<!-- div -->
### <a id="_debouncefunc-wait-options"></a>`_.debounce(func, wait, options)`
<a href="#_debouncefunc-wait-options">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5346 "View in source") [&#x24C9;][1]
<a href="#_debouncefunc-wait-options">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5372 "View in source") [&#x24C9;][1]
Creates a function that will delay the execution of `func` until after `wait` milliseconds have elapsed since the last time it was invoked. Provide an options object to indicate that `func` should be invoked on the leading and/or trailing edge of the `wait` timeout. Subsequent calls to the debounced function will return the result of the last `func` call.
@@ -2395,7 +2423,7 @@ source.addEventListener('message', _.debounce(batchLog, 250, {
<!-- div -->
### <a id="_deferfunc--arg1-arg2-"></a>`_.defer(func [, arg1, arg2, ...])`
<a href="#_deferfunc--arg1-arg2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5444 "View in source") [&#x24C9;][1]
<a href="#_deferfunc--arg1-arg2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5470 "View in source") [&#x24C9;][1]
Defers executing the `func` function until the current call stack has cleared. Additional arguments will be provided to `func` when it is invoked.
@@ -2420,7 +2448,7 @@ _.defer(function() { console.log('deferred'); });
<!-- div -->
### <a id="_delayfunc-wait--arg1-arg2-"></a>`_.delay(func, wait [, arg1, arg2, ...])`
<a href="#_delayfunc-wait--arg1-arg2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5478 "View in source") [&#x24C9;][1]
<a href="#_delayfunc-wait--arg1-arg2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5504 "View in source") [&#x24C9;][1]
Executes the `func` function after `wait` milliseconds. Additional arguments will be provided to `func` when it is invoked.
@@ -2447,7 +2475,7 @@ _.delay(log, 1000, 'logged later');
<!-- div -->
### <a id="_memoizefunc--resolver"></a>`_.memoize(func [, resolver])`
<a href="#_memoizefunc--resolver">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5506 "View in source") [&#x24C9;][1]
<a href="#_memoizefunc--resolver">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5532 "View in source") [&#x24C9;][1]
Creates a function that memoizes the result of `func`. If `resolver` is provided it will be used to determine the cache key for storing the result based on the arguments provided to the memoized function. By default, the first argument provided to the memoized function is used as the cache key. The `func` is executed with the `this` binding of the memoized function. The result cache is exposed as the `cache` property on the memoized function.
@@ -2473,7 +2501,7 @@ var fibonacci = _.memoize(function(n) {
<!-- div -->
### <a id="_oncefunc"></a>`_.once(func)`
<a href="#_oncefunc">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5539 "View in source") [&#x24C9;][1]
<a href="#_oncefunc">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5565 "View in source") [&#x24C9;][1]
Creates a function that is restricted to execute `func` once. Repeat calls to the function will return the value of the first call. The `func` is executed with the `this` binding of the created function.
@@ -2499,7 +2527,7 @@ initialize();
<!-- div -->
### <a id="_partialfunc--arg1-arg2-"></a>`_.partial(func [, arg1, arg2, ...])`
<a href="#_partialfunc--arg1-arg2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5577 "View in source") [&#x24C9;][1]
<a href="#_partialfunc--arg1-arg2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5603 "View in source") [&#x24C9;][1]
Creates a function that, when called, invokes `func` with any additional `partial` arguments prepended to those provided to the new function. This method is similar to `_.bind` except it does **not** alter the `this` binding.
@@ -2526,7 +2554,7 @@ hi('moe');
<!-- div -->
### <a id="_partialrightfunc--arg1-arg2-"></a>`_.partialRight(func [, arg1, arg2, ...])`
<a href="#_partialrightfunc--arg1-arg2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5608 "View in source") [&#x24C9;][1]
<a href="#_partialrightfunc--arg1-arg2-">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5634 "View in source") [&#x24C9;][1]
This method is like `_.partial` except that `partial` arguments are appended to those provided to the new function.
@@ -2563,7 +2591,7 @@ options.imports
<!-- div -->
### <a id="_throttlefunc-wait-options"></a>`_.throttle(func, wait, options)`
<a href="#_throttlefunc-wait-options">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5643 "View in source") [&#x24C9;][1]
<a href="#_throttlefunc-wait-options">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5669 "View in source") [&#x24C9;][1]
Creates a function that, when executed, will only call the `func` function at most once per every `wait` milliseconds. Provide an options object to indicate that `func` should be invoked on the leading and/or trailing edge of the `wait` timeout. Subsequent calls to the throttled function will return the result of the last `func` call.
@@ -2597,7 +2625,7 @@ jQuery('.interactive').on('click', _.throttle(renewToken, 300000, {
<!-- div -->
### <a id="_wrapvalue-wrapper"></a>`_.wrap(value, wrapper)`
<a href="#_wrapvalue-wrapper">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5687 "View in source") [&#x24C9;][1]
<a href="#_wrapvalue-wrapper">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5713 "View in source") [&#x24C9;][1]
Creates a function that provides `value` to the wrapper function as its first argument. Additional arguments provided to the function are appended to those provided to the wrapper function. The wrapper is executed with the `this` binding of the created function.
@@ -3772,7 +3800,7 @@ _.values({ 'one': 1, 'two': 2, 'three': 3 });
<!-- div -->
### <a id="_escapestring"></a>`_.escape(string)`
<a href="#_escapestring">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5714 "View in source") [&#x24C9;][1]
<a href="#_escapestring">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5740 "View in source") [&#x24C9;][1]
Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their corresponding HTML entities.
@@ -3796,7 +3824,7 @@ _.escape('Moe, Larry & Curly');
<!-- div -->
### <a id="_identityvalue"></a>`_.identity(value)`
<a href="#_identityvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5732 "View in source") [&#x24C9;][1]
<a href="#_identityvalue">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5758 "View in source") [&#x24C9;][1]
This method returns the first argument provided to it.
@@ -3821,7 +3849,7 @@ moe === _.identity(moe);
<!-- div -->
### <a id="_mixinobject-object"></a>`_.mixin(object, object)`
<a href="#_mixinobject-object">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5759 "View in source") [&#x24C9;][1]
<a href="#_mixinobject-object">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5785 "View in source") [&#x24C9;][1]
Adds function properties of a source object to the `lodash` function and chainable wrapper.
@@ -3852,7 +3880,7 @@ _('moe').capitalize();
<!-- div -->
### <a id="_noconflict"></a>`_.noConflict()`
<a href="#_noconflict">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5797 "View in source") [&#x24C9;][1]
<a href="#_noconflict">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5823 "View in source") [&#x24C9;][1]
Reverts the '_' variable to its previous value and returns a reference to the `lodash` function.
@@ -3872,7 +3900,7 @@ var lodash = _.noConflict();
<!-- div -->
### <a id="_parseintvalue--radix"></a>`_.parseInt(value [, radix])`
<a href="#_parseintvalue--radix">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5821 "View in source") [&#x24C9;][1]
<a href="#_parseintvalue--radix">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5847 "View in source") [&#x24C9;][1]
Converts the given `value` into an integer of the specified `radix`. If `radix` is `undefined` or `0` a `radix` of `10` is used unless the `value` is a hexadecimal, in which case a `radix` of `16` is used.
@@ -3899,7 +3927,7 @@ _.parseInt('08');
<!-- div -->
### <a id="_randommin0-max1"></a>`_.random([min=0, max=1])`
<a href="#_randommin0-max1">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5845 "View in source") [&#x24C9;][1]
<a href="#_randommin0-max1">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5871 "View in source") [&#x24C9;][1]
Produces a random number between `min` and `max` *(inclusive)*. If only one argument is provided a number between `0` and the given number will be returned.
@@ -3927,7 +3955,7 @@ _.random(5);
<!-- div -->
### <a id="_resultobject-property"></a>`_.result(object, property)`
<a href="#_resultobject-property">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5889 "View in source") [&#x24C9;][1]
<a href="#_resultobject-property">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5915 "View in source") [&#x24C9;][1]
Resolves the value of `property` on `object`. If `property` is a function it will be invoked with the `this` binding of `object` and its result returned, else the property value is returned. If `object` is falsey then `undefined` is returned.
@@ -3980,7 +4008,7 @@ Create a new `lodash` function using the given `context` object.
<!-- div -->
### <a id="_templatetext-data-options"></a>`_.template(text, data, options)`
<a href="#_templatetext-data-options">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L5980 "View in source") [&#x24C9;][1]
<a href="#_templatetext-data-options">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6006 "View in source") [&#x24C9;][1]
A micro-templating method that handles arbitrary delimiters, preserves whitespace, and correctly escapes quotes within interpolated code.
@@ -4068,7 +4096,7 @@ fs.writeFileSync(path.join(cwd, 'jst.js'), '\
<!-- div -->
### <a id="_timesn-callback--thisarg"></a>`_.times(n, callback [, thisArg])`
<a href="#_timesn-callback--thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6105 "View in source") [&#x24C9;][1]
<a href="#_timesn-callback--thisarg">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6131 "View in source") [&#x24C9;][1]
Executes the callback `n` times, returning an array of the results of each callback execution. The callback is bound to `thisArg` and invoked with one argument; *(index)*.
@@ -4100,7 +4128,7 @@ _.times(3, function(n) { this.cast(n); }, mage);
<!-- div -->
### <a id="_unescapestring"></a>`_.unescape(string)`
<a href="#_unescapestring">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6132 "View in source") [&#x24C9;][1]
<a href="#_unescapestring">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6158 "View in source") [&#x24C9;][1]
The inverse of `_.escape` this method converts the HTML entities `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to their corresponding characters.
@@ -4124,7 +4152,7 @@ _.unescape('Moe, Larry &amp; Curly');
<!-- div -->
### <a id="_uniqueidprefix"></a>`_.uniqueId([prefix])`
<a href="#_uniqueidprefix">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6152 "View in source") [&#x24C9;][1]
<a href="#_uniqueidprefix">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6178 "View in source") [&#x24C9;][1]
Generates a unique ID. If `prefix` is provided the ID will be appended to it.
@@ -4177,7 +4205,7 @@ A reference to the `lodash` function.
<!-- div -->
### <a id="_version"></a>`_.VERSION`
<a href="#_version">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6459 "View in source") [&#x24C9;][1]
<a href="#_version">#</a> [&#x24C8;](https://github.com/bestiejs/lodash/blob/master/lodash.js#L6487 "View in source") [&#x24C9;][1]
*(String)*: The semantic version number.

View File

@@ -3815,6 +3815,37 @@
});
}
/**
* Retrieves a random element or `n` random elements from a collection.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|String} collection The collection to sample.
* @returns {Array} Returns the random sample(s) of `collection`.
* @example
*
* _.sample([1, 2, 3, 4]);
* // => 2
*
* _.sample([1, 2, 3, 4], 2);
* // => [3, 1]
*/
function sample(collection, n, guard) {
if (!isArray(collection)) {
collection = toArray(collection);
}
var index = -1,
maxIndex = collection.length - 1;
if (n == null || guard) {
return collection[random(maxIndex)];
}
var result = shuffle(collection);
result.length = nativeMin(nativeMax(0, n), result.length);
return result;
}
/**
* Creates an array of shuffled values, using a version of the Fisher-Yates
* shuffle. See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle.
@@ -3835,7 +3866,7 @@
result = Array(typeof length == 'number' ? length : 0);
forEach(collection, function(value) {
var rand = floor(nativeRandom() * (++index + 1));
var rand = random(++index);
result[index] = result[rand];
result[rand] = value;
});
@@ -4177,11 +4208,10 @@
}
/**
* Gets the first element of an array. If a number `n` is provided the first
* `n` elements of the array are returned. If a callback is provided elements
* at the beginning of the array are returned as long as the callback returns
* truthy. The callback is bound to `thisArg` and invoked with three arguments;
* (value, index, array).
* Gets the first element or first `n` elements of an array. If a callback
* is provided elements at the beginning of the array are returned as long
* as the callback returns truthy. The callback is bound to `thisArg` and
* invoked with three arguments; (value, index, array).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
@@ -4344,11 +4374,10 @@
}
/**
* Gets all but the last element of an array. If a number `n` is provided
* the last `n` elements are excluded from the result. If a callback is
* provided elements at the end of the array are excluded from the result
* as long as the callback returns truthy. The callback is bound to `thisArg`
* and invoked with three arguments; (value, index, array).
* Gets all but the last element or last `n` elements of an array. If a
* callback is provided elements at the end of the array are excluded from
* the result as long as the callback returns truthy. The callback is bound
* to `thisArg` and invoked with three arguments; (value, index, array).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
@@ -4478,12 +4507,10 @@
}
/**
* Gets the last element of an array. If a number `n` is provided the last
* `n` elements of the array are returned. If a callback is provided elements
* at the end of the array are returned as long as the callback returns truthy.
* The callback is bound to `thisArg` and invoked with three arguments;
* (value, index, array).
*
* Gets the last element or last `n` elements of an array. If a callback is
* provided elements at the end of the array are returned as long as the
* callback returns truthy. The callback is bound to `thisArg` and invoked
* with three arguments; (value, index, array).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
@@ -4727,12 +4754,11 @@
}
/**
* The opposite of `_.initial` this method gets all but the first value of
* an array. If a number `n` is provided the first `n` values are excluded
* from the result. If a callback function is provided elements at the beginning
* of the array are excluded from the result as long as the callback returns
* truthy. The callback is bound to `thisArg` and invoked with three
* arguments; (value, index, array).
* The opposite of `_.initial` this method gets all but the first element or
* first `n` elements of an array. If a callback function is provided elements
* at the beginning of the array are excluded from the result as long as the
* callback returns truthy. The callback is bound to `thisArg` and invoked
* with three arguments; (value, index, array).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
@@ -6429,18 +6455,20 @@
// add functions capable of returning wrapped and unwrapped values when chaining
lodash.first = first;
lodash.last = last;
lodash.sample = sample;
// add aliases
lodash.take = first;
lodash.head = first;
forOwn(lodash, function(func, methodName) {
var callbackable = methodName !== 'sample';
if (!lodash.prototype[methodName]) {
lodash.prototype[methodName]= function(callback, thisArg) {
lodash.prototype[methodName]= function(n, guard) {
var chainAll = this.__chain__,
result = func(this.__wrapped__, callback, thisArg);
result = func(this.__wrapped__, n, guard);
return !chainAll && (callback == null || (thisArg && typeof callback != 'function'))
return !chainAll && (n == null || (guard && !(callbackable && typeof n == 'function')))
? result
: new lodashWrapper(result, chainAll);
};

View File

@@ -145,6 +145,7 @@
'reduce',
'reduceRight',
'reject',
'sample',
'shuffle',
'size',
'some',
@@ -309,6 +310,7 @@
'pull',
'remove',
'runInContext',
'sample',
'transform'
];

View File

@@ -1080,6 +1080,22 @@
deepEqual(_.first(array, 2), [1, 2]);
});
test('should return an empty array when `n` < `1`', function() {
_.each([0, -1, -2], function(n) {
deepEqual(_.first(array, n), []);
});
});
test('should return all elements when `n` >= `array.length`', function() {
_.each([3, 4], function(n) {
deepEqual(_.first(array, n), array.slice());
});
});
test('should return `undefined` when querying empty arrays', function() {
strictEqual(_.first([]), undefined);
});
test('should work when used as `callback` for `_.map`', function() {
var array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]],
actual = _.map(array, _.first);
@@ -1771,10 +1787,6 @@
{ 'a': 2, 'b': 2 }
];
test('returns all elements for `n` of `0`', function() {
deepEqual(_.initial(array, 0), [1, 2, 3]);
});
test('should accept a falsey `array` argument', function() {
_.forEach(falsey, function(index, value) {
try {
@@ -1788,10 +1800,26 @@
deepEqual(_.initial(array), [1, 2]);
});
test('should exlcude the last two elements', function() {
test('should exclude the last two elements', function() {
deepEqual(_.initial(array, 2), [1]);
});
test('should return an empty when querying empty arrays', function() {
deepEqual(_.initial([]), []);
});
test('should return all elements when `n` < `1`', function() {
_.each([0, -1, -2], function(n) {
deepEqual(_.initial(array, n), array.slice());
});
});
test('should return an empty array when `n` >= `array.length`', function() {
_.each([3, 4], function(n) {
deepEqual(_.initial(array, n), []);
});
});
test('should work when used as `callback` for `_.map`', function() {
var array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]],
actual = _.map(array, _.initial);
@@ -2197,6 +2225,22 @@
deepEqual(_.last(array, 2), [2, 3]);
});
test('should return an empty array when `n` < `1`', function() {
_.each([0, -1, -2], function(n) {
deepEqual(_.last(array, n), []);
});
});
test('should return all elements when `n` >= `array.length`', function() {
_.each([3, 4], function(n) {
deepEqual(_.last(array, n), array.slice());
});
});
test('should return `undefined` when querying empty arrays', function() {
strictEqual(_.last([]), undefined);
});
test('should work when used as `callback` for `_.map`', function() {
var array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]],
actual = _.map(array, _.last);
@@ -3096,10 +3140,6 @@
{ 'a': 0, 'b': 0 }
];
test('returns all elements for `n` of `0`', function() {
deepEqual(_.rest(array, 0), [1, 2, 3]);
});
test('should accept a falsey `array` argument', function() {
_.forEach(falsey, function(index, value) {
try {
@@ -3117,6 +3157,22 @@
deepEqual(_.rest(array, 2), [3]);
});
test('should return all elements when `n` < `1`', function() {
_.each([0, -1, -2], function(n) {
deepEqual(_.rest(array, n), [1, 2, 3]);
});
});
test('should return an empty array when `n` >= `array.length`', function() {
_.each([3, 4], function(n) {
deepEqual(_.rest(array, n), []);
});
});
test('should return an empty when querying empty arrays', function() {
deepEqual(_.rest([]), []);
});
test('should work when used as `callback` for `_.map`', function() {
var array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]],
actual = _.map(array, _.rest);
@@ -3183,6 +3239,69 @@
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.sample');
(function() {
var array = [1, 2, 3];
test('should return a random element', function() {
var actual = _.sample(array);
ok(_.contains(array, actual));
});
test('should return two random elements', function() {
var actual = _.sample(array, 2);
ok(actual[0] !== actual[1] && _.contains(array, actual[0]) && _.contains(array, actual[1]));
});
test('should return an empty array when `n` < `1`', function() {
_.each([0, -1, -2], function(n) {
deepEqual(_.sample(array, n), []);
});
});
test('should return all elements when `n` >= `array.length`', function() {
_.each([3, 4], function(n) {
deepEqual(_.sample(array, n).sort(), array.slice());
});
});
test('should return `undefined` when sampling an empty array', function() {
strictEqual(_.sample([]), undefined);
});
test('should sample an object', function() {
var object = { 'a': 1, 'b': 2, 'c': 3 },
actual = _.sample(object);
ok(_.contains(array, actual));
actual = _.sample(object, 2);
ok(actual[0] !== actual[1] && _.contains(array, actual[0]) && _.contains(array, actual[1]));
});
test('should work when used as `callback` for `_.map`', function() {
var a = [1, 2, 3],
b = [4, 5, 6],
c = [7, 8, 9],
actual = _.map([a, b, c], _.sample);
ok(_.contains(a, actual[0]) && _.contains(b, actual[1]) && _.contains(c, actual[2]));
});
test('should chain when passing `n`', function() {
var actual = _(array).sample(2);
ok(actual instanceof _);
});
test('should not chain when arguments are not provided', function() {
var actual = _(array).sample();
ok(_.contains(array, actual));
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.shuffle');
(function() {